]> git.mxchange.org Git - flightgear.git/blobdiff - utils/xmlgrep/xml.h
Another gitignore
[flightgear.git] / utils / xmlgrep / xml.h
index 26c55098fa147dc379d43364e4bfbaeb677cedc6..7431b4b5b03e47821c02176090a5addb5f5867b6 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (c) 2007, 2008 by Adalin B.V.
- * Copyright (c) 2007, 2008 by Erik Hofman
+/* Copyright (c) 2007-2009 by Adalin B.V.
+ * Copyright (c) 2007-2009 by Erik Hofman
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 extern "C" {
 #endif
 
+#undef XML_NONVALIDATING
+
+#ifdef XML_USE_NODECACHE
+#include "xml_cache.h"
+#else
+void *cacheGet(void *);
+#endif
+
 enum
 {
     XML_NO_ERROR = 0,
@@ -49,6 +57,63 @@ enum
     XML_MAX_ERROR
 };
 
+#ifdef WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+typedef struct
+{
+    HANDLE m;
+    void *p;
+} SIMPLE_UNMMAP;
+#endif
+
+#ifndef XML_NONVALIDATING
+struct _xml_error
+{
+    char *pos;
+    int err_no;
+};
+#endif
+
+/*
+ * It is required for both the rood node and the normal xml nodes to both
+ * have 'char *name' defined as the first entry. The code tests whether
+ * name == 0 to detect the root node.
+ */
+struct _root_id
+{
+    char *name;
+    char *start;
+    size_t len;
+    int fd;
+#ifdef XML_USE_NODECACHE
+    void *node;
+#endif
+#ifndef XML_NONVALIDATING
+    struct _xml_error *info;
+#endif
+#ifdef WIN32
+    SIMPLE_UNMMAP un;
+#endif
+};
+
+struct _xml_id
+{
+    char *name;
+    char *start;
+    size_t len;
+    size_t name_len;
+#ifndef XML_NONVALIDATING
+    struct _root_id *root;
+#endif
+#ifdef XML_USE_NODECACHE
+    void *node;
+#endif
+};
+
+
+
 /**
  * Open an XML file for processing.
  *
@@ -325,7 +390,6 @@ double xmlNodeGetDouble(const void *, const char *);
 double xmlAttributeGetDouble(const void *, const char *);
 
 
-#ifndef XML_NONVALIDATING
 /**
  * Get the error number of the last error and clear it.
  *
@@ -361,7 +425,6 @@ size_t xmlErrorGetColumnNo(const void *, int);
  * @return a string that explains the last error.
  */
 const char *xmlErrorGetString(const void *, int);
-#endif
 
 #ifdef __cplusplus
 }