guththila.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_H
00019 #define GUTHTHILA_H
00020 
00021 #include <guththila_defines.h>
00022 #include <guththila_token.h>
00023 #include <guththila_reader.h>
00024 #include <guththila_xml_writer.h>
00025 #include <guththila_attribute.h>
00026 #include <guththila_namespace.h>
00027 #include <guththila_buffer.h>
00028 #include <guththila_stack.h>
00029 #include <guththila_error.h>
00030 
00031 #include <axutil_utils.h>
00032 
00033 /*
00034 All the functions in this library does not check weather the given arguments are NULL.
00035 It is the responsblity of the user to check weather the arguments contain NULL values.
00036 */
00037 EXTERN_C_START()  enum guththila_status
00038 {
00039     S_0 = 0, 
00040         S_1, 
00041         S_2, 
00042         S_3
00043 };
00044 
00045 enum guththila_UTF16_endianess
00046 {
00047     None = 1, 
00048         LE, 
00049         BE 
00050 };
00051 
00052 typedef enum guththila_type
00053 {
00054     type_file_name = 0, 
00055         type_memory_buffer, 
00056         type_reader, 
00057         type_io
00058 } guththila_type_t;
00059 
00060 enum guththila_event_types
00061 {
00062     GUTHTHILA_START_DOCUMENT =0, 
00063         GUTHTHILA_END_ELEMENT, 
00064         GUTHTHILA_CHARACTER,
00065     GUTHTHILA_ENTITY_REFERANCE, 
00066         GUTHTHILA_COMMENT,
00067     GUTHTHILA_SPACE, 
00068         GUTHTHILA_START_ELEMENT,
00069     GUTHTHILA_EMPTY_ELEMENT
00070 };
00071 
00072 typedef struct guththila_s
00073 {
00074 
00075     guththila_tok_list_t tokens;
00076 
00077     guththila_buffer_t buffer;
00078     
00079     guththila_reader_t *reader;
00080 
00081     guththila_token_t *prefix;
00082 
00083     guththila_token_t *name;
00084 
00085     guththila_token_t *value;
00086     
00087     guththila_stack_t elem;
00088 
00089     guththila_stack_t attrib;
00090 
00091     guththila_stack_t namesp;
00092     
00093         int is_whitespace;
00094 
00095     int is_char;
00096 
00097     int unicode_state;
00098 
00099     int status;
00100 
00101     int guththila_event;
00102 
00103     size_t next;
00104 
00105     int last_start;
00106 
00107     guththila_token_t *temp_prefix;
00108 
00109     guththila_token_t *temp_name;
00110 
00111     guththila_token_t *temp_tok;
00112 } guththila_t;
00113 
00114 
00115 typedef struct guththila_elem_namesp_s
00116 {
00117     guththila_namespace_t *namesp;
00118     int no;
00119     int size;    
00120 } guththila_elem_namesp_t;
00121 
00122 typedef struct guththila_element_s
00123 {
00124     guththila_token_t *name;
00125 
00126     guththila_token_t *prefix;
00127     
00128         int is_namesp;    
00129 } guththila_element_t;
00130 
00131 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00132 guththila_init(guththila_t * m, void *reader, 
00133                            const axutil_env_t * env);
00134 
00135 GUTHTHILA_EXPORT guththila_t * GUTHTHILA_CALL 
00136 guththila_create(void *reader, const axutil_env_t *env);
00137 
00138 GUTHTHILA_EXPORT void GUTHTHILA_CALL
00139 guththila_free(guththila_t * m, const axutil_env_t * env);
00140 
00141 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00142 guththila_un_init(guththila_t * m, const axutil_env_t * env);
00143 
00144 typedef void(GUTHTHILA_CALL * guththila_error_func)(void *arg, 
00145                                                                                                         const guththila_char_t *msg, 
00146                                                                                                         guththila_error_level level, 
00147                                                                                                         void *locator);
00148 
00149 /*
00150 Public functions for reading XML documents
00151 */
00152 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00153 guththila_next(guththila_t * p, const axutil_env_t * env);
00154 
00155 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00156 guththila_get_attribute_count(guththila_t * p, const axutil_env_t * env);
00157 
00158 GUTHTHILA_EXPORT guththila_char_t * GUTHTHILA_CALL
00159 guththila_get_attribute_name(guththila_t * p, guththila_attr_t * att, 
00160                                                          const axutil_env_t * env);
00161 
00162 GUTHTHILA_EXPORT guththila_char_t * GUTHTHILA_CALL  
00163 guththila_get_attribute_value(guththila_t * p, 
00164                                                           guththila_attr_t * att, 
00165                                                           const axutil_env_t * env);
00166 
00167 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00168 guththila_get_attribute_prefix(guththila_t * p, 
00169                                                            guththila_attr_t * att, 
00170                                                            const axutil_env_t * env);
00171 
00172 GUTHTHILA_EXPORT guththila_attr_t *GUTHTHILA_CALL  
00173 guththila_get_attribute(guththila_t * p, const axutil_env_t * env);
00174 
00175 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00176 guththila_get_attribute_name_by_number(guththila_t * p, int i, 
00177                                                                            const axutil_env_t *env);
00178 
00179 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00180 guththila_get_attribute_value_by_number(guththila_t * p, int i, 
00181                                                                                 const axutil_env_t *env);
00182 
00183 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00184 guththila_get_attribute_prefix_by_number(guththila_t * p, int i, 
00185                                                                                  const axutil_env_t *env);
00186 
00187 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00188 guththila_get_name(guththila_t * p, const axutil_env_t * env);
00189 
00190 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00191 guththila_get_prefix(guththila_t * p, const axutil_env_t * env);
00192 
00193 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00194 guththila_get_value(guththila_t * p, const axutil_env_t * env);
00195 
00196 GUTHTHILA_EXPORT guththila_namespace_t *GUTHTHILA_CALL  
00197 guththila_get_namespace(guththila_t * p, const axutil_env_t * env);
00198 
00199 GUTHTHILA_EXPORT int GUTHTHILA_CALL
00200 guththila_get_namespace_count(guththila_t * p, const axutil_env_t * env);
00201 
00202 GUTHTHILA_EXPORT guththila_char_t * GUTHTHILA_CALL
00203 guththila_get_namespace_uri(guththila_t * p, guththila_namespace_t * ns, 
00204                                                         const axutil_env_t * env);
00205 
00206 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00207 guththila_get_namespace_prefix(guththila_t * p, guththila_namespace_t * ns, 
00208                                                            const axutil_env_t * env);
00209 
00210 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00211 guththila_get_namespace_prefix_by_number(guththila_t * p, int i, 
00212                                                                                  const axutil_env_t *env);
00213 
00214 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00215 guththila_get_namespace_uri_by_number(guththila_t * p, int i, 
00216                                                                           const axutil_env_t *env);
00217 
00218 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00219 guththila_get_attribute_namespace_by_number(guththila_t *p, int i, 
00220                                                                                         const axutil_env_t *env);
00221 
00222 GUTHTHILA_EXPORT guththila_char_t *GUTHTHILA_CALL  
00223 guththila_get_encoding(guththila_t * p, const axutil_env_t * env);
00224 
00225 GUTHTHILA_EXPORT void GUTHTHILA_CALL
00226 guththila_set_error_handler(guththila_t * m, guththila_error_func, 
00227                                                         const axutil_env_t * env);
00228 EXTERN_C_END() 
00229 #endif  
00230 

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