typedef int(* | xmlInputMatchCallback |
xmlInputMatchCallback: Callback used in the I/O Input API to detect if the current handler can provide input fonctionnalities for this resource.
Returns 1 if yes and 0 if another Input module should be used
typedef void *(* | xmlInputOpenCallback |
xmlInputOpenCallback: Callback used in the I/O Input API to open the resource
Returns an Input context or NULL in case or error
typedef int(* | xmlInputReadCallback |
xmlInputReadCallback: Callback used in the I/O Input API to read the resource
Returns the number of bytes read or -1 in case of error
typedef int(* | xmlInputCloseCallback |
xmlInputCloseCallback: Callback used in the I/O Input API to close the resource
Returns 0 or -1 in case of error
XMLPUBFUN void XMLCALL | xmlCleanupInputCallbacks | ( | void | ) |
xmlCleanupInputCallbacks:
clears the entire input callback table. this includes the compiled-in I/O.
OOM: never
XMLPUBFUN int XMLCALL | xmlPopInputCallbacks | ( | void | ) |
xmlPopInputCallback:
Clear the top input callback from the input stack. this includes the compiled-in I/O.
Returns the number of input callback registered or -1 in case of error.
XMLPUBFUN void XMLCALL | xmlRegisterDefaultInputCallbacks | ( | void | ) |
xmlRegisterDefaultInputCallbacks:
Registers the default compiled-in I/O handlers.
OOM: never
XMLPUBFUN xmlParserInputBufferPtr XMLCALL | xmlAllocParserInputBuffer | ( | xmlCharEncoding | enc | ) |
xmlAllocParserInputBuffer: Create a buffered parser input for progressive parsing
Returns the new parser input or NULL
OOM: possible --> NULL returned and OOM flag is set
Parameters | |
---|---|
enc | the charset encoding if known |
XMLPUBFUN xmlParserInputBufferPtr XMLCALL | xmlParserInputBufferCreateFilename | ( | const char * | URI, |
xmlCharEncoding | enc | |||
) |
xmlParserInputBufferCreateFilename: Create a buffered parser input for the progressive parsing of a file If filename is "-' then we use stdin as the input. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Do an encoding check if enc == XML_CHAR_ENCODING_NONE
Returns the new parser input or NULL
Parameters | |
---|---|
URI | a C string containing the URI or filename |
enc | the charset encoding if known |
XMLPUBFUN xmlParserInputBufferPtr XMLCALL | xmlParserInputBufferCreateFile | ( | FILE * | file, |
xmlCharEncoding | enc | |||
) |
xmlParserInputBufferCreateFile: Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O
Returns the new parser input or NULL
Parameters | |
---|---|
file | a FILE* |
enc | the charset encoding if known |
XMLPUBFUN xmlParserInputBufferPtr XMLCALL | xmlParserInputBufferCreateFd | ( | int | fd, |
xmlCharEncoding | enc | |||
) |
xmlParserInputBufferCreateFd: Create a buffered parser input for the progressive parsing for the input from a file descriptor
Returns the new parser input or NULL
Parameters | |
---|---|
fd | a file descriptor number |
enc | the charset encoding if known |
XMLPUBFUN xmlParserInputBufferPtr XMLCALL | xmlParserInputBufferCreateMem | ( | const char * | mem, |
int | size, | |||
xmlCharEncoding | enc | |||
) |
xmlParserInputBufferCreateMem: Create a buffered parser input for the progressive parsing for the input from a memory area.
Returns the new parser input or NULL
OOM: possible --> sets OOM flag, returns NULL for mem!=NULL && size>0
Parameters | |
---|---|
mem | the memory input |
size | the length of the memory block |
enc | the charset encoding if known |
XMLPUBFUN xmlParserInputBufferPtr XMLCALL | xmlParserInputBufferCreateStatic | ( | const char * | mem, |
int | size, | |||
xmlCharEncoding | enc | |||
) |
xmlParserInputBufferCreateStatic: Create a buffered parser input for the progressive parsing for the input from an immutable memory area. This will not copy the memory area to the buffer, but the memory is expected to be available until the end of the parsing, this is useful for example when using mmap'ed file.
Returns the new parser input or NULL
Parameters | |
---|---|
mem | the memory input |
size | the length of the memory block |
enc | the charset encoding if known |
XMLPUBFUN xmlParserInputBufferPtr XMLCALL | xmlParserInputBufferCreateIO | ( | xmlInputReadCallback | ioread, |
xmlInputCloseCallback | ioclose, | |||
void * | ioctx, | |||
xmlCharEncoding | enc | |||
) |
xmlParserInputBufferCreateIO: Create a buffered parser input for the progressive parsing for the input from an I/O handler
Returns the new parser input or NULL
Parameters | |
---|---|
ioread | an I/O read function |
ioclose | an I/O close function |
ioctx | an I/O handler |
enc | the charset encoding if known |
XMLPUBFUN int XMLCALL | xmlParserInputBufferRead | ( | xmlParserInputBufferPtr | in, |
int | len | |||
) |
xmlParserInputBufferRead: Refresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8
Returns the number of chars read and stored in the buffer, or -1 in case of error.
Parameters | |
---|---|
in | a buffered parser input |
len | indicative value of the amount of chars to read |
XMLPUBFUN int XMLCALL | xmlParserInputBufferGrow | ( | xmlParserInputBufferPtr | in, |
int | len | |||
) |
xmlParserInputBufferGrow: Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode
Returns the number of chars read and stored in the buffer, or -1 in case of error.
OOM: possible --> sets OOM flag when returns 0
Parameters | |
---|---|
in | a buffered parser input |
len | indicative value of the amount of chars to read |
XMLPUBFUN int XMLCALL | xmlParserInputBufferPush | ( | xmlParserInputBufferPtr | in, |
int | len, | |||
const char * | buf | |||
) |
xmlParserInputBufferPush: Push the content of the array in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode.
Returns the number of chars read and stored in the buffer, or -1 in case of error.
OOM: possible -->
Parameters | |
---|---|
in | a buffered parser input |
len | the size in bytes of the array. |
buf | an char array |
XMLPUBFUN void XMLCALL | xmlFreeParserInputBuffer | ( | xmlParserInputBufferPtr | in | ) |
xmlFreeParserInputBuffer: Free up the memory used by a buffered parser input
OOM: never
Parameters | |
---|---|
in | a buffered parser input |
XMLPUBFUN char *XMLCALL | xmlParserGetDirectory | ( | const char * | filename | ) |
xmlParserGetDirectory: lookup the directory for that file
Returns a new allocated string containing the directory, or NULL.
Parameters | |
---|---|
filename | the path to a file |
XMLPUBFUN int XMLCALL | xmlRegisterInputCallbacks | ( | xmlInputMatchCallback | matchFunc, |
xmlInputOpenCallback | openFunc, | |||
xmlInputReadCallback | readFunc, | |||
xmlInputCloseCallback | closeFunc | |||
) |
xmlRegisterInputCallbacks: Register a new set of I/O callback for handling parser input.
Returns the registered handler number or -1 in case of error
OOM: never
Parameters | |
---|---|
matchFunc | the xmlInputMatchCallback |
openFunc | the xmlInputOpenCallback |
readFunc | the xmlInputReadCallback |
closeFunc | the xmlInputCloseCallback |
XMLPUBFUN xmlParserInputPtr XMLCALL | xmlCheckHTTPInput | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputPtr | ret | |||
) |
xmlCheckHTTPInput: Check an input in case it was created from an HTTP stream, in that case it will handle encoding and update of the base URL in case of redirection. It also checks for HTTP errors in which case the input is cleanly freed up and an appropriate error is raised in context
Returns the input or NULL in case of HTTP error.
Parameters | |
---|---|
ctxt | an XML parser context |
ret | an XML parser input |
XMLPUBFUN xmlParserInputPtr XMLCALL | xmlNoNetExternalEntityLoader | ( | const char * | URL, |
const char * | ID, | |||
xmlParserCtxtPtr | ctxt | |||
) |
xmlNoNetExternalEntityLoader: A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.
Returns a new allocated xmlParserInputPtr, or NULL.
Parameters | |
---|---|
URL | the URL for the entity to load |
ID | the System ID for the entity to load |
ctxt | the context in which the entity is called or NULL |
XMLPUBFUN int XMLCALL | xmlCheckFilename | ( | const char * | path | ) |
xmlCheckFilename: function checks to see if path is a valid source (file, socket...) for XML.
if stat is not available on the target machine, returns 1. if stat fails, returns 0 (if calling stat on the filename fails, it can't be right). if stat succeeds and the file is a directory, returns 2. otherwise returns 1.
Parameters | |
---|---|
path | the path to check |
XMLPUBFUN void *XMLCALL | xmlFileOpen | ( | const char * | filename | ) |
xmlFileOpen: Wrapper around xmlFileOpen_real that try it with an unescaped version of filename, if this fails fallback to filename
Returns a handler or NULL in case or failure
Parameters | |
---|---|
filename | the URI for matching |