#ifndef XMLSTAR_H #define XMLSTAR_H #include #include #if HAVE_SETMODE && HAVE_DECL_O_BINARY # include # include # define set_stdout_binary() setmode(1, O_BINARY) #else # define set_stdout_binary() #endif #include #include #include typedef enum { /* EXIT_SUCCESS = 0, EXIT_FAILURE = 1, */ EXIT_BAD_ARGS = EXIT_FAILURE+1, EXIT_BAD_FILE, EXIT_LIB_ERROR, EXIT_INTERNAL_ERROR } exit_status; #define COUNT_OF(array) (sizeof(array)/sizeof(*array)) typedef enum { QUIET, VERBOSE } Verbosity; typedef struct _errorInfo { const char *filename; /* file error occured in, if any, else NULL */ xmlTextReaderPtr xmlReader; Verbosity verbose; } ErrorInfo; void reportError(void *ptr, xmlErrorPtr error); void registerXstarVariable(xmlXPathContextPtr ctxt, const char* name, xmlXPathObjectPtr value); void registerXstarNs(xmlXPathContextPtr ctxt); int parseNSArr(xmlChar** ns_arr, int* plen, int argc, char **argv); void cleanupNSArr(xmlChar **ns_arr); extern xmlChar *ns_arr[]; #endif /* XMLSTAR_H */