/* ***************************************************************************** * * $RCSfile: general.h,v $ * $Date: 1999/05/18 18:35:55 $ * $Source: /home/richard/Xml/RCS/general.h,v $ * $Revision: 1.19 $ * $Author: richard $ * ***************************************************************************** * * Copyright 1998, Brown University and Richard Goerwitz * ***************************************************************************** */ #ifndef GENERAL_H_INCLUDED #define GENERAL_H_INCLUDED #include #include #include #include #include "config.h" /* define my_wchar_t to hold 16 bits */ typedef u_int16_t my_wchar_t; #ifdef HAVE_UNISTD_H # include # include #endif #ifdef STDC_HEADERS # include # include #else void *malloc (size_t); void *realloc (void *, size_t); void free (void *); size_t strlen (const char *); int strcmp (const char *, const char *); char *strcpy (char *, const char *); char *strcat (char *, const char *); char *strtok (char *, const char *); # ifndef HAVE_STRCHR # warn "No strchr(); trying to use index() instead." # define strchr index # define strrchr rindex # endif # ifndef HAVE_STRDUP # error "Oh, come on; get a C library that has strdup()!" # endif char *strdup (const char *); char *strstr (const char *, const char *); # ifdef HAVE_MEMORY_H # include # else # ifdef HAVE_MEMCPY void *memcpy(void *, const void *, size_t); void *memmove(void *, const void *, size_t); void *memset(void *, int, size_t); # else # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # define memset(d, c, n) bzero ((d), (n)) # endif # endif #endif #ifndef HAVE_STRCOLL # define strcoll strcmp #endif #ifndef HAVE_STRTOL # define strtol(s, p, i) atoi(s) #endif #ifdef HAVE_LIMITS_H # include #endif #ifdef HAVE_GETOPT_H # include #else int getopt (int, char *const[], const char *); extern char *optarg; extern int optopt, optind, opterr; #endif #ifndef MAXPATHLEN # ifdef PATH_MAX # define MAXPATHLEN PATH_MAX # else # define MAXPATHLEN 256 # endif #endif #ifdef XML_NODEBUG # define xwrap(a) ((void) 0) #else # define xwrap(a) a #endif #include "getmessage.h" #include "hashutil.h" typedef enum yesno { no, yes, maybe } yesno; typedef struct xmlparse_environment xmlparse_environment; #include "fileutil.h" /* this is the main structure the program is build around; see below */ extern xmlparse_environment xmlparse_env; /* Master environment for running program; contains the name of the * program (for error messages), pointers to xml_file structures, etc. */ struct xmlparse_environment { /* Ancillary files and directories used by xmlparse */ char *program_name; char *config_filename; char *sgml_catalog_filenames; char *url_resolution_cmd_string; char *fpi_resolution_cmd_string; char *libdir; /* Hash table of public <-> system identifiers */ struct rg_htable *public_to_system_identifier_hashtable; /* Catalog of error, warning, other messages */ message_catalog *message_catalog; /* Debugging level, error/message output method */ int debug_level; yesno use_syslog; /* Turn on security; only http: or urn: sysids will be resolved */ yesno no_local_files; /* We're only validating; don't keep all those children around */ yesno keep_children; /* Do we force attributes/elements in other namespaces to validate OK? */ yesno force_valid_namespaces; /* How many errors/warnings should we display for each file? */ int max_errors; /* array of pointers to xml_file structures */ size_t filelen; xml_file **xml_files; }; #endif /* GENERAL_H_INCLUDED */