Main Page | Modules | Class List | Directories | File List | Class Members | File Members

axis2_stream.h

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 count 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_STREAM_H
00018 #define AXIS2_STREAM_H
00019 
00020 #include <axis2_allocator.h>
00021 
00022 #ifdef __cplusplus
00023 extern "C"
00024 {
00025 #endif
00026 
00027     struct axis2_stream;
00028     struct axis2_stream_ops;
00029 
00041   AXIS2_DECLARE_DATA  typedef struct axis2_stream_ops
00042     {
00043 
00049        axis2_status_t (AXIS2_CALL *free) (struct axis2_stream *stream);
00050        
00057         axis2_status_t (AXIS2_CALL *read) (void *buffer
00058                         , size_t count);
00065         axis2_status_t (AXIS2_CALL *write) 
00066                         (const void *buffer, size_t count);
00067                 
00074                 void * (AXIS2_CALL  *file_open)
00075                         (const char *file_name, const char *options);
00076                 
00082                 axis2_status_t (AXIS2_CALL *file_close) 
00083                                 (void *file_ptr);
00084                 
00089                 axis2_char_t (AXIS2_CALL *file_get_char) 
00090                                 (void *file_ptr);
00091                 
00098                 axis2_status_t (AXIS2_CALL *file_unget_char) 
00099                                 (const char chr, void *file_ptr);
00100                                 
00101     } axis2_stream_ops_t;
00102 
00108     typedef struct axis2_stream
00109     {
00111         struct axis2_stream_ops *ops;
00112                 int axis2_eof;
00113     } axis2_stream_t;
00114 
00115 #define AXIS2_STREAM_FREE(stream) ((stream->ops)->free(stream))
00116 
00117 #define AXIS2_STREAM_READ(stream, buffer, count) \
00118                 ((stream)->ops->read(buffer, count))
00119 #define AXIS2_STREAM_WRITE(stream, buffer, count) \
00120                 ((stream->ops)->write(buffer, count))
00121 #define AXIS2_STREAM_FILE_OPEN(stream, file_name, options) \
00122                 ((stream->ops)->file_open(file_name, options))
00123 #define AXIS2_STREAM_FILE_CLOSE(stream, file_ptr) \
00124                 ((stream->ops)->file_close(file_ptr))
00125 #define AXIS2_STREAM_FILE_GET_CHAR(stream, file_ptr) \
00126                 ((stream->ops)->file_get_char(file_ptr))
00127 #define AXIS2_STREAM_FILE_UNGET_CHAR(stream, chr, file_ptr) \
00128                 ((stream->ops)->file_unget_char(chr, file_ptr)) 
00129 
00132 #ifdef __cplusplus
00133 }
00134 #endif
00135 
00136 #endif                          /* AXIS2_STREAM_H */

Generated on Thu Nov 24 13:58:30 2005 for Axis2/C by  doxygen 1.4.2