axis2_http_chunked_stream.h

Go to the documentation of this file.
00001 /*
00002 * Licensed to the Apache Software Foundation (ASF) under one or more
00003 * contributor license agreements.  See the NOTICE file distributed with
00004 * this work for additional information regarding copyright ownership.
00005 * The ASF licenses this file to You under the Apache License, Version 2.0
00006 * (the "License"); you may not use this file except in compliance with
00007 * the License.  You may obtain a copy of the License at
00008 *
00009 *      http://www.apache.org/licenses/LICENSE-2.0
00010 *
00011 * Unless required by applicable law or agreed to in writing, software
00012 * distributed under the License is distributed on an "AS IS" BASIS,
00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 * See the License for the specific language governing permissions and
00015 * limitations under the License.
00016 */
00017 
00018 #ifndef AXIS2_HTTP_CHUNKED_STREAM_H
00019 #define AXIS2_HTTP_CHUNKED_STREAM_H
00020 
00033 #include <axis2_const.h>
00034 #include <axis2_defines.h>
00035 #include <axis2_env.h>
00036 #include <axis2_stream.h>
00037 
00038 
00039 #ifdef __cplusplus
00040 extern "C"
00041 {
00042 #endif
00043 
00045     typedef struct axis2_http_chunked_stream_ops axis2_http_chunked_stream_ops_t;
00047     typedef struct axis2_http_chunked_stream axis2_http_chunked_stream_t;
00048 
00049 
00054     struct axis2_http_chunked_stream_ops
00055     {
00062         int (AXIS2_CALL *
00063                 read)(
00064                     axis2_http_chunked_stream_t *chunked_stream,
00065                     const axis2_env_t *env,
00066                     void *buffer,
00067                     size_t count);
00068 
00074         int (AXIS2_CALL *
00075                 write)(
00076                     axis2_http_chunked_stream_t *chunked_stream,
00077                     const axis2_env_t *env,
00078                     const void *buffer,
00079                     size_t count);
00080 
00085         int (AXIS2_CALL *
00086                 get_current_chunk_size)(
00087                     const axis2_http_chunked_stream_t *chunked_stream,
00088                     const axis2_env_t *env);
00089 
00095         axis2_status_t (AXIS2_CALL *
00096                 write_last_chunk)(
00097                     axis2_http_chunked_stream_t *chunked_stream,
00098                     const axis2_env_t *env);
00099 
00105         axis2_status_t (AXIS2_CALL *
00106                 free)(
00107                     axis2_http_chunked_stream_t *chunked_stream,
00108                     const axis2_env_t *env);
00109     };
00110 
00114     struct axis2_http_chunked_stream
00115     {
00117         axis2_http_chunked_stream_ops_t *ops;
00118     };
00119 
00120 
00125     AXIS2_EXTERN axis2_http_chunked_stream_t * AXIS2_CALL
00126     axis2_http_chunked_stream_create(
00127         const axis2_env_t *env,
00128         axis2_stream_t* stream);
00129 
00130 /********************* Start of function macros   ***************************/
00131 
00134 #define AXIS2_HTTP_CHUNKED_STREAM_READ(chunked_stream, env, buffer, count) \
00135                         ((chunked_stream)->ops->read(chunked_stream, env, \
00136                   buffer, count))
00137 
00140 #define AXIS2_HTTP_CHUNKED_STREAM_WRITE(chunked_stream, env, buffer, count) \
00141                   ((chunked_stream)->ops->write(chunked_stream, env, \
00142                   buffer, count))
00143 
00146 #define AXIS2_HTTP_CHUNKED_GET_CURRENT_CHUNK_SIZE(chunked_stream, env) \
00147                         ((chunked_stream)->ops->get_current_chunk_size \
00148                   (chunked_stream, env))
00149 
00152 #define AXIS2_HTTP_CHUNKED_STREAM_WRITE_LAST_CHUNK(chunked_stream, env) \
00153                   ((chunked_stream)->ops->write_last_chunk(chunked_stream\
00154                   , env))
00155 
00158 #define AXIS2_HTTP_CHUNKED_STREAM_FREE(chunked_stream, env) \
00159                         ((chunked_stream)->ops->free(chunked_stream, env))
00160 
00161 /************************* End of function macros *****************************/
00162 
00164 #ifdef __cplusplus
00165 }
00166 #endif
00167 #endif /* AXIS2_HTTP_CHUNKED_STREAM_H */

Generated on Wed Dec 20 20:34:49 2006 for Axis2/C by  doxygen 1.5.1