Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

wbxml.h

Go to the documentation of this file.
00001 /*
00002  * WBXML Lib, the WBXML Library.
00003  * Copyright (C) 2002-2003  Aymerick Jéhanne
00004  * 
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License (version 2.1) as published by the Free Software Foundation.
00008  * 
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  *
00018  * LGPL v2.1: http://www.gnu.org/licenses/lgpl.txt
00019  *
00020  * Author Contact: libwbxml@jehanne.org
00021  * WBXML Lib home: http://libwbxml.jehanne.org
00022  */
00023  
00034 #ifndef WBXML_H
00035 #define WBXML_H
00036 
00037 
00043 #define WBXML_LIB_VERSION "0.8.2"
00044 
00045 /* WBXML Lib basic types redefinition */
00046 #define WB_BOOL unsigned char
00047 #define WB_UTINY unsigned char
00048 #define WB_TINY char
00049 #define WB_ULONG unsigned int
00050 #define WB_LONG int
00051 
00052 #ifndef TRUE
00053 #define TRUE 1
00054 #endif
00055 
00056 #ifndef FALSE
00057 #define FALSE 0
00058 #endif
00059 
00060 #ifndef NULL
00061 #define NULL 0
00062 #endif
00063 
00064 /* Define NULL string */
00065 #define WBXML_UTINY_NULL_STRING ((WB_UTINY *)"")
00066 
00067 /* WBXML Lib string functions */
00068 #define WBXML_STRLEN(a) strlen((const WB_TINY*)a)
00069 #define WBXML_STRCMP(a,b) strcmp((const WB_TINY*)a,(const WB_TINY*)b)
00070 #define WBXML_STRNCMP(a,b,c) strncmp((const WB_TINY*)a,(const WB_TINY*)b,c)
00071 #define WBXML_STRSTR(a,b) strstr((const WB_TINY*)a,(const WB_TINY*)b)
00072 #if defined( WIN32 )
00073 #define WBXML_STRCASECMP(a,b) _stricmp((const WB_TINY*)a,(const WB_TINY*)b)
00074 #else
00075 #define WBXML_STRCASECMP(a,b) strcasecmp((const WB_TINY*)a,(const WB_TINY*)b)
00076 #endif /* WIN32 */
00077 
00078 #define WBXML_ISDIGIT(a) isdigit(a)
00079 
00080 /* For DLL exported functions */
00081 #if defined( WIN32 )
00082 #define WBXML_DECLARE(type) __declspec(dllexport) type __stdcall
00083 #define WBXML_DECLARE_NONSTD(type) __declspec(dllexport) type
00084 #else
00085 #define WBXML_DECLARE(type) type
00086 #define WBXML_DECLARE_NONSTD(type) type
00087 #endif /* WIN32 */
00088 
00089 
00090 /* WBXML Global Tokens */
00091 #define WBXML_SWITCH_PAGE 0x00
00092 #define WBXML_END         0x01
00093 #define WBXML_ENTITY      0x02
00094 #define WBXML_STR_I       0x03
00095 #define WBXML_LITERAL     0x04
00096 #define WBXML_EXT_I_0     0x40
00097 #define WBXML_EXT_I_1     0x41
00098 #define WBXML_EXT_I_2     0x42
00099 #define WBXML_PI          0x43
00100 #define WBXML_LITERAL_C   0x44
00101 #define WBXML_EXT_T_0     0x80
00102 #define WBXML_EXT_T_1     0x81
00103 #define WBXML_EXT_T_2     0x82
00104 #define WBXML_STR_T       0x83
00105 #define WBXML_LITERAL_A   0x84
00106 #define WBXML_EXT_0       0xC0
00107 #define WBXML_EXT_1       0xC1
00108 #define WBXML_EXT_2       0xC2
00109 #define WBXML_OPAQUE      0xC3
00110 #define WBXML_LITERAL_AC  0xC4
00111 
00112 /* WBXML Tokens Masks */
00113 #define WBXML_TOKEN_MASK              0x3F
00114 #define WBXML_TOKEN_WITH_ATTRS        0x80
00115 #define WBXML_TOKEN_WITH_CONTENT      0x40
00116 
00117 /* WBXML Versions (XML text) */
00118 #define WBXML_VERSION_TEXT_10   "1.0"   
00119 #define WBXML_VERSION_TEXT_11   "1.1"   
00120 #define WBXML_VERSION_TEXT_12   "1.2"   
00121 #define WBXML_VERSION_TEXT_13   "1.3"   
00124 typedef enum WBXMLVersion_e {
00125     WBXML_VERSION_UNKNOWN = -1, 
00126     WBXML_VERSION_10 = 0x00,    
00127     WBXML_VERSION_11 = 0x01,    
00128     WBXML_VERSION_12 = 0x02,    
00129     WBXML_VERSION_13 = 0x03     
00130 } WBXMLVersion;
00131 
00132 
00133 /*
00134  * Possible Compilation Flags:
00135  * ---------------------------
00136  *
00137  *      WBXML_SUPPORT_WML
00138  *      WBXML_SUPPORT_WTA
00139  *      WBXML_SUPPORT_SI
00140  *      WBXML_SUPPORT_SL
00141  *      WBXML_SUPPORT_CO
00142  *      WBXML_SUPPORT_PROV
00143  *      WBXML_SUPPORT_EMN
00144  *      WBXML_SUPPORT_DRMREL
00145  *      WBXML_SUPPORT_OTA_SETTINGS
00146  *      WBXML_SUPPORT_SYNCML
00147  *      WBXML_SUPPORT_WV 
00148  */
00149 
00150 
00152 typedef enum WBXMLLanguage_e {
00153     WBXML_LANG_UNKNOWN = 0,     
00155     /* WAP */
00156 #if defined( WBXML_SUPPORT_WML )
00157     WBXML_LANG_WML10,           
00158     WBXML_LANG_WML11,           
00159     WBXML_LANG_WML12,           
00160     WBXML_LANG_WML13,           
00161 #endif /* WBXML_SUPPORT_WML */
00162 
00163 #if defined( WBXML_SUPPORT_WTA )
00164     WBXML_LANG_WTA10,           
00165     WBXML_LANG_WTAWML12,        
00166     WBXML_LANG_CHANNEL11,       
00167     WBXML_LANG_CHANNEL12,       
00168 #endif /* WBXML_SUPPORT_WTA */
00169 
00170 #if defined( WBXML_SUPPORT_SI )
00171     WBXML_LANG_SI10,            
00172 #endif /* WBXML_SUPPORT_SI */
00173 
00174 #if defined( WBXML_SUPPORT_SL )
00175     WBXML_LANG_SL10,            
00176 #endif /* WBXML_SUPPORT_SL */
00177 
00178 #if defined( WBXML_SUPPORT_CO )
00179     WBXML_LANG_CO10,            
00180 #endif /* WBXML_SUPPORT_CO */
00181 
00182 #if defined( WBXML_SUPPORT_PROV )
00183     WBXML_LANG_PROV10,          
00184 #endif /* WBXML_SUPPORT_PROV */
00185 
00186 #if defined( WBXML_SUPPORT_EMN )
00187     WBXML_LANG_EMN10,           
00188 #endif /* WBXML_SUPPORT_EMN */
00189 
00190 #if defined( WBXML_SUPPORT_DRMREL )
00191     WBXML_LANG_DRMREL10,        
00192 #endif /* WBXML_SUPPORT_DRMREL */
00193 
00194 #if defined( WBXML_SUPPORT_OTA_SETTINGS )
00195     /* Ericsson / Nokia OTA Settings v7.0 */
00196     WBXML_LANG_OTA_SETTINGS,    
00197 #endif /* WBXML_SUPPORT_OTA_SETTINGS */
00198 
00199     /* SyncML */
00200 #if defined( WBXML_SUPPORT_SYNCML )
00201     WBXML_LANG_SYNCML_SYNCML10, 
00202     WBXML_LANG_SYNCML_DEVINF10, 
00203     WBXML_LANG_SYNCML_METINF10, 
00204     WBXML_LANG_SYNCML_SYNCML11, 
00205     WBXML_LANG_SYNCML_DEVINF11, 
00206     WBXML_LANG_SYNCML_METINF11, 
00207 #endif /* WBXML_SUPPORT_SYNCML */
00208 
00209     /* Wireless-Village */
00210 #if defined( WBXML_SUPPORT_WV )
00211     WBXML_LANG_WV_CSP11,        
00212     WBXML_LANG_WV_CSP12         
00213 #endif /* WBXML_SUPPORT_WV */
00214 } WBXMLLanguage;
00215 
00216 
00217 #if defined( WBXML_SUPPORT_WV )
00218 
00219 typedef enum WBXMLWVDataType_e {
00220     WBXML_WV_DATA_TYPE_BOOLEAN = 0,     
00221     WBXML_WV_DATA_TYPE_INTEGER,         
00222     WBXML_WV_DATA_TYPE_DATE_AND_TIME,   
00223     WBXML_WV_DATA_TYPE_STRING,          
00224     WBXML_WV_DATA_TYPE_BINARY           
00225 } WBXMLWVDataType;
00226 #endif /* WBXML_SUPPORT_WV */
00227 
00228 
00229 /* We are good coders and we don't want to ignore Warnings :) */
00230 #ifdef WIN32
00231 #pragma warning(error: 4001) 
00232 #pragma warning(error: 4002) 
00233 #pragma warning(error: 4003) 
00234 #pragma warning(error: 4004) 
00235 #pragma warning(error: 4005) 
00236 #pragma warning(error: 4006) 
00237 #pragma warning(error: 4009) 
00238 #pragma warning(error: 4013) 
00239 #pragma warning(error: 4015) 
00240 #pragma warning(error: 4016) 
00241 #pragma warning(error: 4018) 
00242 #pragma warning(error: 4020) 
00243 #pragma warning(error: 4021) 
00244 #pragma warning(error: 4022) 
00245 #pragma warning(error: 4023) 
00246 #pragma warning(error: 4024) 
00247 #pragma warning(error: 4025) 
00248 #pragma warning(error: 4026) 
00249 #pragma warning(error: 4027) 
00250 #pragma warning(error: 4028) 
00251 #pragma warning(error: 4029) 
00252 #pragma warning(error: 4030) 
00253 #pragma warning(error: 4031) 
00254 #pragma warning(error: 4033) 
00255 #pragma warning(error: 4035) 
00256 #pragma warning(error: 4036) 
00257 #pragma warning(error: 4045) 
00258 #pragma warning(error: 4047) 
00259 #pragma warning(error: 4049) 
00260 #pragma warning(error: 4051) 
00261 #pragma warning(error: 4053) 
00262 #pragma warning(error: 4054) 
00263 #pragma warning(error: 4057) 
00264 #pragma warning(error: 4059) 
00265 #pragma warning(error: 4061) 
00266 #pragma warning(error: 4063) 
00267 #pragma warning(error: 4064) 
00268 #pragma warning(error: 4071) 
00269 #pragma warning(error: 4072) 
00270 #pragma warning(error: 4078) 
00271 #pragma warning(error: 4081) 
00272 #pragma warning(error: 4087) 
00273 #pragma warning(error: 4088) 
00274 #pragma warning(error: 4089) 
00275 #pragma warning(error: 4098) 
00276 #pragma warning(error: 4113) 
00277 #pragma warning(error: 4129) 
00278 #pragma warning(error: 4133) 
00279 #pragma warning(error: 4150) 
00280 #pragma warning(error: 4172) 
00281 #pragma warning(error: 4221) 
00282 #pragma warning(error: 4223) 
00283 #pragma warning(error: 4224) 
00284 #pragma warning(error: 4390) 
00285 #pragma warning(error: 4508) 
00286 #pragma warning(error: 4541) 
00287 #pragma warning(error: 4551) 
00288 #pragma warning(error: 4553) 
00289 #pragma warning(error: 4700) 
00290 #pragma warning(error: 4706) 
00291 #pragma warning(error: 4715) 
00292 #pragma warning(error: 4761) 
00293 #endif /* WIN32 */
00294 
00295 
00296 /* Includes */
00297 #if defined( HAVE_EXPAT)
00298 #include <expat.h>
00299 #endif /* HAVE_EXPAT */
00300 
00301 #include "wbxml_log.h"
00302 #include "wbxml_errors.h"
00303 #include "wbxml_mem.h"
00304 #include "wbxml_lists.h"
00305 #include "wbxml_buffers.h"
00306 #include "wbxml_base64.h"
00307 #include "wbxml_tables.h"
00308 #include "wbxml_elt.h"
00309 #include "wbxml_tree.h"
00310 #include "wbxml_tree_clb_wbxml.h"
00311 #include "wbxml_tree_clb_xml.h"
00312 #include "wbxml_handlers.h"
00313 #include "wbxml_parser.h"
00314 #include "wbxml_encoder.h"
00315 #include "wbxml_conv.h"
00316 
00317 
00320 #endif /* WBXML_H */

Generated on Mon Nov 24 20:09:42 2003 for WBXML Library by doxygen1.3-rc1