axis2_http_chunked_stream.h

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

Generated on Thu Oct 26 21:00:11 2006 for Axis2/C by  doxygen 1.4.7