Debian Codegraph @

src/xmlstar.h

raw ◀ ▶
1 Debian patch touch this file
1 #ifndef XMLSTAR_H
2 #define XMLSTAR_H
3
4 #include <config.h>
5 #include <stdlib.h>
6
7 #if HAVE_SETMODE && HAVE_DECL_O_BINARY
8 # include <io.h>
9 # include <fcntl.h>
10 # define set_stdout_binary() setmode(1, O_BINARY)
11 #else
12 # define set_stdout_binary()
13 #endif
14
15 #include <libxml/xpath.h>
16 #include <libxml/xpathInternals.h>
17 #include <libxml/xmlreader.h>
•18 #include <libxml/xmlsave.h>
19
20 typedef enum { /* EXIT_SUCCESS = 0, EXIT_FAILURE = 1, */
21 EXIT_BAD_ARGS = EXIT_FAILURE+1, EXIT_BAD_FILE,
22 EXIT_LIB_ERROR, EXIT_INTERNAL_ERROR } exit_status;
23
24 #define COUNT_OF(array) (sizeof(array)/sizeof(*array))
25
26 typedef enum { QUIET, VERBOSE } Verbosity;
27 typedef enum { CONTINUE, STOP } ErrorStop;
28
29 typedef struct _errorInfo {
30 const char *filename; /* file error occured in, if any, else NULL */
31 xmlTextReaderPtr xmlReader;
32 Verbosity verbose;
33 ErrorStop stop;
34 } ErrorInfo;
35
•36 void reportError(void *ptr, const xmlError *error);
37 void suppressErrors(void);
38
39 typedef struct _gOptions {
40 int quiet; /* no error output */
41 int doc_namespace; /* extract namespace bindings from input doc */
42 } gOptions;
43
44 typedef gOptions *gOptionsPtr;
45
46 extern gOptions globalOptions;
47
48 void registerXstarVariable(xmlXPathContextPtr ctxt,
49 const char* name, xmlXPathObjectPtr value);
50 void registerXstarNs(xmlXPathContextPtr ctxt);
51
52 extern const xmlChar *default_ns;
53
54 int parseNSArr(xmlChar** ns_arr, int* plen, int argc, char **argv);
55 void cleanupNSArr(xmlChar **ns_arr);
56 extern xmlChar *ns_arr[];
57
58 #endif /* XMLSTAR_H */