guththila_buffer.h

00001 
00002 /*
00003  * Licensed to the Apache Software Foundation (ASF) under one or more
00004  * contributor license agreements.  See the NOTICE file distributed with
00005  * this work for additional information regarding copyright ownership.
00006  * The ASF licenses this file to You under the Apache License, Version 2.0
00007  * (the "License"); you may not use this file except in compliance with
00008  * the License.  You may obtain a copy of the License at
00009  *
00010  *      http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 #ifndef GUTHTHILA_BUFFER_H
00019 #define GUTHTHILA_BUFFER_H
00020 
00021 #include <guththila_defines.h>
00022 #include <axutil_utils.h>
00023 
00024 
00025 EXTERN_C_START()
00026 typedef enum guththila_buffer_type
00027 {
00028     GUTHTHILA_SINGLE_BUFFER = 0,
00029     GUTHTHILA_MULTIPLE_BUFFER
00030 } guththila_buffer_type_t;
00031 
00032 typedef struct guththila_buffer_s
00033 {
00034     /* Required to manupulate multiple buffers */
00035     size_t *data_size;
00036     size_t *buffs_size;
00037     guththila_char_t **buff;
00038     int cur_buff;
00039     int cur_buff_pos;
00040     size_t pre_tot_data;
00041     unsigned int no_buffers;
00042     short type;
00043     guththila_char_t *xml;
00044 }
00045 guththila_buffer_t;
00046 
00047 #define GUTHTHILA_BUFFER_DEF_SIZE 16984
00048 #define GUTHTHILA_BUFFER_NUMBER_OF_BUFFERS 4
00049 
00050 #ifndef GUTHTHILA_BUFFER_SIZE
00051 #define GUTHTHILA_BUFFER_SIZE(_buffer) (_buffer.size)
00052 #endif
00053 
00054 #ifndef GUTHTHILA_BUFFER_CURRENT_BUFF
00055 #define GUTHTHILA_BUFFER_CURRENT_BUFF(_buffer) ((_buffer).buff[(_buffer).cur_buff] + (_buffer).data_size[(_buffer).cur_buff])
00056 #endif
00057 
00058 #ifndef GUTHTHILA_BUFFER_CURRENT_BUFF_SIZE
00059 #define GUTHTHILA_BUFFER_CURRENT_BUFF_SIZE(_buffer) ((_buffer).buffs_size[(_buffer).cur_buff] - (_buffer).data_size[(_buffer).cur_buff])
00060 #endif
00061 
00062 #ifndef GUTHTHILA_BUFFER_CURRENT_DATA_SIZE
00063 #define GUTHTHILA_BUFFER_CURRENT_DATA_SIZE(_buffer) ((_buffer).data_size[(_buffer).cur_buff])
00064 #endif
00065 
00066 #ifndef GUTHTHILA_BUFFER_PRE_DATA_SIZE
00067 #define GUTHTHILA_BUFFER_PRE_DATA_SIZE(_buffer) ((_buffer).pre_tot_data)
00068 #endif
00069 
00070 /*We never consider tokens not in the current buffer*/
00071 #ifndef GUTHTHILA_BUF_POS
00072 #define GUTHTHILA_BUF_POS(_buffer, _pos) ((_buffer).buff[(_buffer).cur_buff] + _pos - (_buffer).pre_tot_data)
00073 #endif
00074 
00084 int GUTHTHILA_CALL 
00085 guththila_buffer_init(guththila_buffer_t * buffer,
00086                                           int size,
00087                                           const axutil_env_t * env);
00088 
00097 int GUTHTHILA_CALL 
00098 guththila_buffer_un_init(guththila_buffer_t * buffer,
00099                                            const axutil_env_t * env);
00112 int GUTHTHILA_CALL 
00113 guththila_buffer_init_for_buffer(guththila_buffer_t * mu_buff, 
00114                                                                  guththila_char_t *buffer, 
00115                                                                  int size, 
00116                                                                  const axutil_env_t * env);
00117 
00118 void *GUTHTHILA_CALL 
00119 guththila_get_position(guththila_buffer_t * buffer,
00120                                            int pos, 
00121                                            const axutil_env_t * env);
00122 
00123 int GUTHTHILA_CALL 
00124 guththila_buffer_next(guththila_buffer_t * buffer, 
00125                                           const axutil_env_t * env);
00126 
00127 
00137 void *GUTHTHILA_CALL 
00138 guththila_buffer_get(guththila_buffer_t * buffer, 
00139                                          const axutil_env_t * env);
00140 
00141 
00142 int GUTHTHILA_CALL 
00143 guththila_buffer_shift(guththila_buffer_t * buffer, 
00144                                            int no, const axutil_env_t * env);
00145 
00146 int GUTHTHILA_CALL 
00147 guththila_buffer_insert_data(guththila_buffer_t * buffer, 
00148                                                          void *buff, size_t buff_len, 
00149                                                          const axutil_env_t * env);
00150 
00151 EXTERN_C_END()
00152 #endif
00153 
00154 
00155 
00156 

Generated on Sat May 3 10:44:35 2008 for Axis2/C by  doxygen 1.5.5