File indexing completed on 2025-02-22 10:41:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __XML_IO_H__
0011 #define __XML_IO_H__
0012
0013
0014 #include <stdio.h>
0015 #include <libxml/xmlversion.h>
0016 #include <libxml/encoding.h>
0017 #define XML_TREE_INTERNALS
0018 #include <libxml/tree.h>
0019 #undef XML_TREE_INTERNALS
0020
0021
0022 #ifdef __cplusplus
0023 extern "C" {
0024 #endif
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 typedef int (*xmlInputMatchCallback) (char const *filename);
0041
0042
0043
0044
0045
0046
0047
0048
0049 typedef void * (*xmlInputOpenCallback) (char const *filename);
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
0061
0062
0063
0064
0065
0066
0067
0068
0069 typedef int (*xmlInputCloseCallback) (void * context);
0070
0071 #ifdef LIBXML_OUTPUT_ENABLED
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086 typedef int (*xmlOutputMatchCallback) (char const *filename);
0087
0088
0089
0090
0091
0092
0093
0094
0095 typedef void * (*xmlOutputOpenCallback) (char const *filename);
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106 typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
0107 int len);
0108
0109
0110
0111
0112
0113
0114
0115
0116 typedef int (*xmlOutputCloseCallback) (void * context);
0117 #endif
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130 typedef xmlParserInputBufferPtr
0131 (*xmlParserInputBufferCreateFilenameFunc)(const char *URI, xmlCharEncoding enc);
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 typedef xmlOutputBufferPtr
0145 (*xmlOutputBufferCreateFilenameFunc)(const char *URI,
0146 xmlCharEncodingHandlerPtr encoder, int compression);
0147
0148 struct _xmlParserInputBuffer {
0149 void* context;
0150 xmlInputReadCallback readcallback;
0151 xmlInputCloseCallback closecallback;
0152
0153 xmlCharEncodingHandlerPtr encoder;
0154
0155 xmlBufPtr buffer;
0156 xmlBufPtr raw;
0157 int compressed;
0158 int error;
0159 unsigned long rawconsumed;
0160 };
0161
0162
0163 #ifdef LIBXML_OUTPUT_ENABLED
0164 struct _xmlOutputBuffer {
0165 void* context;
0166 xmlOutputWriteCallback writecallback;
0167 xmlOutputCloseCallback closecallback;
0168
0169 xmlCharEncodingHandlerPtr encoder;
0170
0171 xmlBufPtr buffer;
0172 xmlBufPtr conv;
0173 int written;
0174 int error;
0175 };
0176 #endif
0177
0178
0179 #define XML_GLOBALS_IO \
0180 XML_OP(xmlParserInputBufferCreateFilenameValue, \
0181 xmlParserInputBufferCreateFilenameFunc, XML_DEPRECATED) \
0182 XML_OP(xmlOutputBufferCreateFilenameValue, \
0183 xmlOutputBufferCreateFilenameFunc, XML_DEPRECATED)
0184
0185 #define XML_OP XML_DECLARE_GLOBAL
0186 XML_GLOBALS_IO
0187 #undef XML_OP
0188
0189 #if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
0190 #define xmlParserInputBufferCreateFilenameValue \
0191 XML_GLOBAL_MACRO(xmlParserInputBufferCreateFilenameValue)
0192 #define xmlOutputBufferCreateFilenameValue \
0193 XML_GLOBAL_MACRO(xmlOutputBufferCreateFilenameValue)
0194 #endif
0195
0196
0197
0198
0199
0200 XMLPUBFUN void
0201 xmlCleanupInputCallbacks (void);
0202
0203 XMLPUBFUN int
0204 xmlPopInputCallbacks (void);
0205
0206 XMLPUBFUN void
0207 xmlRegisterDefaultInputCallbacks (void);
0208 XMLPUBFUN xmlParserInputBufferPtr
0209 xmlAllocParserInputBuffer (xmlCharEncoding enc);
0210
0211 XMLPUBFUN xmlParserInputBufferPtr
0212 xmlParserInputBufferCreateFilename (const char *URI,
0213 xmlCharEncoding enc);
0214 XMLPUBFUN xmlParserInputBufferPtr
0215 xmlParserInputBufferCreateFile (FILE *file,
0216 xmlCharEncoding enc);
0217 XMLPUBFUN xmlParserInputBufferPtr
0218 xmlParserInputBufferCreateFd (int fd,
0219 xmlCharEncoding enc);
0220 XMLPUBFUN xmlParserInputBufferPtr
0221 xmlParserInputBufferCreateMem (const char *mem, int size,
0222 xmlCharEncoding enc);
0223 XMLPUBFUN xmlParserInputBufferPtr
0224 xmlParserInputBufferCreateStatic (const char *mem, int size,
0225 xmlCharEncoding enc);
0226 XMLPUBFUN xmlParserInputBufferPtr
0227 xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
0228 xmlInputCloseCallback ioclose,
0229 void *ioctx,
0230 xmlCharEncoding enc);
0231 XMLPUBFUN int
0232 xmlParserInputBufferRead (xmlParserInputBufferPtr in,
0233 int len);
0234 XMLPUBFUN int
0235 xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
0236 int len);
0237 XMLPUBFUN int
0238 xmlParserInputBufferPush (xmlParserInputBufferPtr in,
0239 int len,
0240 const char *buf);
0241 XMLPUBFUN void
0242 xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
0243 XMLPUBFUN char *
0244 xmlParserGetDirectory (const char *filename);
0245
0246 XMLPUBFUN int
0247 xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
0248 xmlInputOpenCallback openFunc,
0249 xmlInputReadCallback readFunc,
0250 xmlInputCloseCallback closeFunc);
0251
0252 xmlParserInputBufferPtr
0253 __xmlParserInputBufferCreateFilename(const char *URI,
0254 xmlCharEncoding enc);
0255
0256 #ifdef LIBXML_OUTPUT_ENABLED
0257
0258
0259
0260 XMLPUBFUN void
0261 xmlCleanupOutputCallbacks (void);
0262 XMLPUBFUN int
0263 xmlPopOutputCallbacks (void);
0264 XMLPUBFUN void
0265 xmlRegisterDefaultOutputCallbacks(void);
0266 XMLPUBFUN xmlOutputBufferPtr
0267 xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
0268
0269 XMLPUBFUN xmlOutputBufferPtr
0270 xmlOutputBufferCreateFilename (const char *URI,
0271 xmlCharEncodingHandlerPtr encoder,
0272 int compression);
0273
0274 XMLPUBFUN xmlOutputBufferPtr
0275 xmlOutputBufferCreateFile (FILE *file,
0276 xmlCharEncodingHandlerPtr encoder);
0277
0278 XMLPUBFUN xmlOutputBufferPtr
0279 xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
0280 xmlCharEncodingHandlerPtr encoder);
0281
0282 XMLPUBFUN xmlOutputBufferPtr
0283 xmlOutputBufferCreateFd (int fd,
0284 xmlCharEncodingHandlerPtr encoder);
0285
0286 XMLPUBFUN xmlOutputBufferPtr
0287 xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
0288 xmlOutputCloseCallback ioclose,
0289 void *ioctx,
0290 xmlCharEncodingHandlerPtr encoder);
0291
0292
0293 XMLPUBFUN const xmlChar *
0294 xmlOutputBufferGetContent (xmlOutputBufferPtr out);
0295 XMLPUBFUN size_t
0296 xmlOutputBufferGetSize (xmlOutputBufferPtr out);
0297
0298 XMLPUBFUN int
0299 xmlOutputBufferWrite (xmlOutputBufferPtr out,
0300 int len,
0301 const char *buf);
0302 XMLPUBFUN int
0303 xmlOutputBufferWriteString (xmlOutputBufferPtr out,
0304 const char *str);
0305 XMLPUBFUN int
0306 xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
0307 const xmlChar *str,
0308 xmlCharEncodingOutputFunc escaping);
0309
0310 XMLPUBFUN int
0311 xmlOutputBufferFlush (xmlOutputBufferPtr out);
0312 XMLPUBFUN int
0313 xmlOutputBufferClose (xmlOutputBufferPtr out);
0314
0315 XMLPUBFUN int
0316 xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
0317 xmlOutputOpenCallback openFunc,
0318 xmlOutputWriteCallback writeFunc,
0319 xmlOutputCloseCallback closeFunc);
0320
0321 xmlOutputBufferPtr
0322 __xmlOutputBufferCreateFilename(const char *URI,
0323 xmlCharEncodingHandlerPtr encoder,
0324 int compression);
0325
0326 #ifdef LIBXML_HTTP_ENABLED
0327
0328 XML_DEPRECATED
0329 XMLPUBFUN void
0330 xmlRegisterHTTPPostCallbacks (void );
0331 #endif
0332
0333 #endif
0334
0335 XML_DEPRECATED
0336 XMLPUBFUN xmlParserInputPtr
0337 xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
0338 xmlParserInputPtr ret);
0339
0340
0341
0342
0343 XMLPUBFUN xmlParserInputPtr
0344 xmlNoNetExternalEntityLoader (const char *URL,
0345 const char *ID,
0346 xmlParserCtxtPtr ctxt);
0347
0348 XML_DEPRECATED
0349 XMLPUBFUN xmlChar *
0350 xmlNormalizeWindowsPath (const xmlChar *path);
0351
0352 XML_DEPRECATED
0353 XMLPUBFUN int
0354 xmlCheckFilename (const char *path);
0355
0356
0357
0358 XML_DEPRECATED
0359 XMLPUBFUN int
0360 xmlFileMatch (const char *filename);
0361 XML_DEPRECATED
0362 XMLPUBFUN void *
0363 xmlFileOpen (const char *filename);
0364 XML_DEPRECATED
0365 XMLPUBFUN int
0366 xmlFileRead (void * context,
0367 char * buffer,
0368 int len);
0369 XML_DEPRECATED
0370 XMLPUBFUN int
0371 xmlFileClose (void * context);
0372
0373
0374
0375
0376 #ifdef LIBXML_HTTP_ENABLED
0377 XML_DEPRECATED
0378 XMLPUBFUN int
0379 xmlIOHTTPMatch (const char *filename);
0380 XML_DEPRECATED
0381 XMLPUBFUN void *
0382 xmlIOHTTPOpen (const char *filename);
0383 #ifdef LIBXML_OUTPUT_ENABLED
0384 XML_DEPRECATED
0385 XMLPUBFUN void *
0386 xmlIOHTTPOpenW (const char * post_uri,
0387 int compression );
0388 #endif
0389 XML_DEPRECATED
0390 XMLPUBFUN int
0391 xmlIOHTTPRead (void * context,
0392 char * buffer,
0393 int len);
0394 XML_DEPRECATED
0395 XMLPUBFUN int
0396 xmlIOHTTPClose (void * context);
0397 #endif
0398
0399
0400
0401
0402 #if defined(LIBXML_FTP_ENABLED)
0403 XML_DEPRECATED
0404 XMLPUBFUN int
0405 xmlIOFTPMatch (const char *filename);
0406 XML_DEPRECATED
0407 XMLPUBFUN void *
0408 xmlIOFTPOpen (const char *filename);
0409 XML_DEPRECATED
0410 XMLPUBFUN int
0411 xmlIOFTPRead (void * context,
0412 char * buffer,
0413 int len);
0414 XML_DEPRECATED
0415 XMLPUBFUN int
0416 xmlIOFTPClose (void * context);
0417 #endif
0418
0419 XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
0420 xmlParserInputBufferCreateFilenameDefault(
0421 xmlParserInputBufferCreateFilenameFunc func);
0422 XMLPUBFUN xmlOutputBufferCreateFilenameFunc
0423 xmlOutputBufferCreateFilenameDefault(
0424 xmlOutputBufferCreateFilenameFunc func);
0425 XML_DEPRECATED
0426 XMLPUBFUN xmlOutputBufferCreateFilenameFunc
0427 xmlThrDefOutputBufferCreateFilenameDefault(
0428 xmlOutputBufferCreateFilenameFunc func);
0429 XML_DEPRECATED
0430 XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
0431 xmlThrDefParserInputBufferCreateFilenameDefault(
0432 xmlParserInputBufferCreateFilenameFunc func);
0433
0434 #ifdef __cplusplus
0435 }
0436 #endif
0437
0438 #endif