Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

xmlIO.h

Go to the documentation of this file.
00001 /*
00002  * xmlIO.h : interface for the I/O interfaces used by the parser
00003  *
00004  * See Copyright for the status of this software.
00005  *
00006  * daniel@veillard.com
00007  *
00008  */
00009 
00010 #ifndef __XML_IO_H__
00011 #define __XML_IO_H__
00012 
00013 #include <stdio.h>
00014 #include <libxml/xmlversion.h>
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019 
00020 /*
00021  * Those are the functions and datatypes for the parser input
00022  * I/O structures.
00023  */
00024 
00034 typedef int (*xmlInputMatchCallback) (char const *filename);
00043 typedef void * (*xmlInputOpenCallback) (char const *filename);
00054 typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
00063 typedef int (*xmlInputCloseCallback) (void * context);
00064 
00065 #ifdef LIBXML_OUTPUT_ENABLED
00066 /*
00067  * Those are the functions and datatypes for the library output
00068  * I/O structures.
00069  */
00070 
00080 typedef int (*xmlOutputMatchCallback) (char const *filename);
00089 typedef void * (*xmlOutputOpenCallback) (char const *filename);
00100 typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
00101                                        int len);
00110 typedef int (*xmlOutputCloseCallback) (void * context);
00111 #endif /* LIBXML_OUTPUT_ENABLED */
00112 
00113 #ifdef __cplusplus
00114 }
00115 #endif
00116 
00117 #include <libxml/globals.h>
00118 #include <libxml/tree.h>
00119 #include <libxml/parser.h>
00120 #include <libxml/encoding.h>
00121 
00122 #ifdef __cplusplus
00123 extern "C" {
00124 #endif
00125 struct _xmlParserInputBuffer {
00126     void*                  context;
00127     xmlInputReadCallback   readcallback;
00128     xmlInputCloseCallback  closecallback;
00129     
00130     xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
00131     
00132     xmlBufferPtr buffer;    /* Local buffer encoded in UTF-8 */
00133     xmlBufferPtr raw;       /* if encoder != NULL buffer for raw input */
00134     int compressed;         /* -1=unknown, 0=not compressed, 1=compressed */
00135     int error;
00136 };
00137 
00138 
00139 #ifdef LIBXML_OUTPUT_ENABLED
00140 struct _xmlOutputBuffer {
00141     void*                   context;
00142     xmlOutputWriteCallback  writecallback;
00143     xmlOutputCloseCallback  closecallback;
00144     
00145     xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
00146     
00147     xmlBufferPtr buffer;    /* Local buffer encoded in UTF-8 or ISOLatin */
00148     xmlBufferPtr conv;      /* if encoder != NULL buffer for output */
00149     int written;            /* total number of byte written */
00150     int error;
00151 };
00152 #endif /* LIBXML_OUTPUT_ENABLED */
00153 
00154 /*
00155  * Interfaces for input
00156  */
00157 XMLPUBFUN void XMLCALL  
00158         xmlCleanupInputCallbacks                (void);
00159 
00160 XMLPUBFUN void XMLCALL  
00161         xmlRegisterDefaultInputCallbacks        (void);
00162 XMLPUBFUN xmlParserInputBufferPtr XMLCALL
00163         xmlAllocParserInputBuffer               (xmlCharEncoding enc);
00164 
00165 XMLPUBFUN xmlParserInputBufferPtr XMLCALL
00166         xmlParserInputBufferCreateFilename      (const char *URI,
00167                                                  xmlCharEncoding enc);
00168 XMLPUBFUN xmlParserInputBufferPtr XMLCALL
00169         xmlParserInputBufferCreateFile          (FILE *file,
00170                                                  xmlCharEncoding enc);
00171 XMLPUBFUN xmlParserInputBufferPtr XMLCALL
00172         xmlParserInputBufferCreateFd            (int fd,
00173                                                  xmlCharEncoding enc);
00174 XMLPUBFUN xmlParserInputBufferPtr XMLCALL
00175         xmlParserInputBufferCreateMem           (const char *mem, int size,
00176                                                  xmlCharEncoding enc);
00177 XMLPUBFUN xmlParserInputBufferPtr XMLCALL
00178         xmlParserInputBufferCreateStatic        (const char *mem, int size,
00179                                                  xmlCharEncoding enc);
00180 XMLPUBFUN xmlParserInputBufferPtr XMLCALL
00181         xmlParserInputBufferCreateIO            (xmlInputReadCallback   ioread,
00182                                                  xmlInputCloseCallback  ioclose,
00183                                                  void *ioctx,
00184                                                  xmlCharEncoding enc);
00185 XMLPUBFUN int XMLCALL   
00186         xmlParserInputBufferRead                (xmlParserInputBufferPtr in,
00187                                                  int len);
00188 XMLPUBFUN int XMLCALL   
00189         xmlParserInputBufferGrow                (xmlParserInputBufferPtr in,
00190                                                  int len);
00191 XMLPUBFUN int XMLCALL   
00192         xmlParserInputBufferPush                (xmlParserInputBufferPtr in,
00193                                                  int len,
00194                                                  const char *buf);
00195 XMLPUBFUN void XMLCALL  
00196         xmlFreeParserInputBuffer                (xmlParserInputBufferPtr in);
00197 XMLPUBFUN char * XMLCALL        
00198         xmlParserGetDirectory                   (const char *filename);
00199 
00200 XMLPUBFUN int XMLCALL     
00201         xmlRegisterInputCallbacks               (xmlInputMatchCallback matchFunc,
00202                                                  xmlInputOpenCallback openFunc,
00203                                                  xmlInputReadCallback readFunc,
00204                                                  xmlInputCloseCallback closeFunc);
00205 #ifdef LIBXML_OUTPUT_ENABLED
00206 /*
00207  * Interfaces for output
00208  */
00209 XMLPUBFUN void XMLCALL  
00210         xmlCleanupOutputCallbacks               (void);
00211 XMLPUBFUN void XMLCALL  
00212         xmlRegisterDefaultOutputCallbacks(void);
00213 XMLPUBFUN xmlOutputBufferPtr XMLCALL
00214         xmlAllocOutputBuffer            (xmlCharEncodingHandlerPtr encoder);
00215 
00216 XMLPUBFUN xmlOutputBufferPtr XMLCALL
00217         xmlOutputBufferCreateFilename   (const char *URI,
00218                                          xmlCharEncodingHandlerPtr encoder,
00219                                          int compression);
00220 
00221 XMLPUBFUN xmlOutputBufferPtr XMLCALL
00222         xmlOutputBufferCreateFile       (FILE *file,
00223                                          xmlCharEncodingHandlerPtr encoder);
00224 
00225 XMLPUBFUN xmlOutputBufferPtr XMLCALL
00226         xmlOutputBufferCreateFd         (int fd,
00227                                          xmlCharEncodingHandlerPtr encoder);
00228 
00229 XMLPUBFUN xmlOutputBufferPtr XMLCALL
00230         xmlOutputBufferCreateIO         (xmlOutputWriteCallback   iowrite,
00231                                          xmlOutputCloseCallback  ioclose,
00232                                          void *ioctx,
00233                                          xmlCharEncodingHandlerPtr encoder);
00234 
00235 XMLPUBFUN int XMLCALL   
00236         xmlOutputBufferWrite            (xmlOutputBufferPtr out,
00237                                          int len,
00238                                          const char *buf);
00239 XMLPUBFUN int XMLCALL   
00240         xmlOutputBufferWriteString      (xmlOutputBufferPtr out,
00241                                          const char *str);
00242 
00243 XMLPUBFUN int XMLCALL   
00244         xmlOutputBufferFlush            (xmlOutputBufferPtr out);
00245 XMLPUBFUN int XMLCALL   
00246         xmlOutputBufferClose            (xmlOutputBufferPtr out);
00247 
00248 XMLPUBFUN int XMLCALL     
00249         xmlRegisterOutputCallbacks      (xmlOutputMatchCallback matchFunc,
00250                                          xmlOutputOpenCallback openFunc,
00251                                          xmlOutputWriteCallback writeFunc,
00252                                          xmlOutputCloseCallback closeFunc);
00253 #endif /* LIBXML_OUTPUT_ENABLED */
00254 
00255 /*  This function only exists if HTTP support built into the library  */
00256 #ifdef LIBXML_HTTP_ENABLED
00257 XMLPUBFUN void * XMLCALL        
00258         xmlIOHTTPOpenW                  (const char * post_uri,
00259                                          int   compression );
00260 XMLPUBFUN void XMLCALL  
00261         xmlRegisterHTTPPostCallbacks    (void );
00262 #endif
00263 XMLPUBFUN xmlParserInputPtr XMLCALL
00264         xmlCheckHTTPInput               (xmlParserCtxtPtr ctxt,
00265                                          xmlParserInputPtr ret);
00266 
00267 /*
00268  * A predefined entity loader disabling network accesses
00269  */
00270 XMLPUBFUN xmlParserInputPtr XMLCALL 
00271         xmlNoNetExternalEntityLoader    (const char *URL,
00272                                          const char *ID,
00273                                          xmlParserCtxtPtr ctxt);
00274 
00275 /* 
00276  * xmlNormalizeWindowsPath is obsolete, don't use it. 
00277  * Check xmlCanonicPath in uri.h for a better alternative.
00278  */
00279 XMLPUBFUN xmlChar * XMLCALL 
00280         xmlNormalizeWindowsPath         (const xmlChar *path);
00281 
00282 XMLPUBFUN int XMLCALL   
00283         xmlCheckFilename                (const char *path);
00287 XMLPUBFUN int XMLCALL   
00288         xmlFileMatch                    (const char *filename);
00289 XMLPUBFUN void * XMLCALL        
00290         xmlFileOpen                     (const char *filename);
00291 XMLPUBFUN int XMLCALL   
00292         xmlFileRead                     (void * context, 
00293                                          char * buffer, 
00294                                          int len);
00295 XMLPUBFUN int XMLCALL   
00296         xmlFileClose                    (void * context);
00297 
00301 #ifdef LIBXML_HTTP_ENABLED
00302 XMLPUBFUN int XMLCALL   
00303         xmlIOHTTPMatch                  (const char *filename);
00304 XMLPUBFUN void * XMLCALL        
00305         xmlIOHTTPOpen                   (const char *filename);
00306 XMLPUBFUN int XMLCALL   
00307         xmlIOHTTPRead                   (void * context, 
00308                                          char * buffer, 
00309                                          int len);
00310 XMLPUBFUN int XMLCALL   
00311         xmlIOHTTPClose                  (void * context);
00312 #endif /* LIBXML_HTTP_ENABLED */
00313 
00317 #ifdef LIBXML_FTP_ENABLED 
00318 XMLPUBFUN int XMLCALL   
00319         xmlIOFTPMatch                   (const char *filename);
00320 XMLPUBFUN void * XMLCALL        
00321         xmlIOFTPOpen                    (const char *filename);
00322 XMLPUBFUN int XMLCALL   
00323         xmlIOFTPRead                    (void * context, 
00324                                          char * buffer, 
00325                                          int len);
00326 XMLPUBFUN int XMLCALL   
00327         xmlIOFTPClose                   (void * context);
00328 #endif /* LIBXML_FTP_ENABLED */
00329 
00330 #ifdef __cplusplus
00331 }
00332 #endif
00333 
00334 #endif /* __XML_IO_H__ */
00335 

Generated on Wed Mar 16 00:10:27 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1