node.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*====================================================================*
  2. *
  3. * node.h - document node definitions and declarations;
  4. *
  5. * Motley Tools by Charles Maier;
  6. * Copyright 2001-2006 by Charles Maier Associates;
  7. * Licensed under the Internet Software Consortium License;
  8. *
  9. *--------------------------------------------------------------------*/
  10. #ifndef NODE_HEADER
  11. #define NODE_HEADER
  12. /*====================================================================*
  13. * system headers;
  14. *--------------------------------------------------------------------*/
  15. #include <unistd.h>
  16. #include <stdint.h>
  17. /*====================================================================*
  18. * custom headers;
  19. *--------------------------------------------------------------------*/
  20. #include "../tools/types.h"
  21. /*====================================================================*
  22. *
  23. *--------------------------------------------------------------------*/
  24. #define ISO_CHARSET "iso-8859-1"
  25. #define ISO_CONTENT "text/html"
  26. /*====================================================================*
  27. *
  28. *--------------------------------------------------------------------*/
  29. #define W3C_STD "-//W3C//DTD XHTML 1.0 Strict//EN"
  30. #define W3C_DTD "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  31. /*====================================================================*
  32. *
  33. *--------------------------------------------------------------------*/
  34. #define XML_VERSION "1.0"
  35. #define XML_NAMESPACE "http://www.w3.org/2001/XMLSchema-instance"
  36. #define XML_CHARSET ISO_CHARSET
  37. #define XML_LANGUAGE "en-us"
  38. #define XML_SCHEMA "http://www.w3.org/2001/XMLSchema"
  39. /*====================================================================*
  40. *
  41. *--------------------------------------------------------------------*/
  42. #define NODE_ELEM '<'
  43. #define NODE_SGML '!'
  44. #define NODE_INST '?'
  45. #define NODE_ATTR ' '
  46. #define NODE_VALU '='
  47. #define NODE_ETAG '/'
  48. #define NODE_DATA '>'
  49. /*====================================================================*
  50. *
  51. *--------------------------------------------------------------------*/
  52. #define DATA_SCHEMA "piboffset.xsd"
  53. #define DATA_NAME "name"
  54. #define DATA_TEXT "text"
  55. #define DATA_OBJECT "pib"
  56. #define DATA_MEMBER "object"
  57. #define DATA_OFFSET "offset"
  58. #define DATA_LENGTH "length"
  59. #define DATA_STRUCT "array"
  60. #define DATA_STRING "dataString"
  61. #define DATA_MEMORY "dataHex"
  62. #define DATA_HUGE "dataHuge"
  63. #define DATA_LONG "dataLong"
  64. #define DATA_WORD "dataWord"
  65. #define DATA_BYTE "dataByte"
  66. /*====================================================================*
  67. * variables;
  68. *--------------------------------------------------------------------*/
  69. typedef struct node
  70. {
  71. struct node * above;
  72. struct node * prior;
  73. struct node * after;
  74. struct node * below;
  75. unsigned line;
  76. unsigned type;
  77. char * text;
  78. }
  79. NODE;
  80. /*====================================================================*
  81. * functions;
  82. *--------------------------------------------------------------------*/
  83. char const * xmlselect (NODE const *, char const * element, char const * attribute);
  84. signed xmlread (NODE *, char const * filename);
  85. signed xmlscan (NODE *);
  86. signed xmledit (NODE const *, void * memory, size_t extent);
  87. NODE * xmlopen (char const * filename);
  88. NODE * xmlnode (NODE *);
  89. NODE const * xmlelement (NODE const *, char const * name);
  90. NODE const * xmlattribute (NODE const *, char const * name);
  91. NODE const * xmlvalue (NODE const *);
  92. NODE const * xmldata (NODE const *);
  93. void xmlschema ();
  94. void xmltree (NODE const *);
  95. void xmlfree (NODE *);
  96. /*====================================================================*
  97. *
  98. *--------------------------------------------------------------------*/
  99. #endif