Browse Source

* progress in libxml2 translation

git-svn-id: trunk@11565 -
ivost 17 years ago
parent
commit
4aee6550d8

+ 4 - 0
packages/libxml/src/dict.inc

@@ -11,6 +11,10 @@
 (*
 (*
  * The dictionnary
  * The dictionnary
  *)
  *)
+{$IFDEF POINTER}
+  xmlDictPtr = ^xmlDict;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
   xmlDict = record end;
   xmlDict = record end;
 {$ENDIF}
 {$ENDIF}

+ 4 - 0
packages/libxml/src/encoding.inc

@@ -19,6 +19,10 @@
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlCharEncodingHandlerPtr = ^xmlCharEncodingHandler;
+{$ENDIF}
+
 (*
 (*
  * xmlCharEncoding:
  * xmlCharEncoding:
  *
  *

+ 5 - 0
packages/libxml/src/entities.inc

@@ -8,6 +8,11 @@
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlEntityPtr = ^xmlEntity;
+  xmlEntitiesTablePtr = ^xmlEntitiesTable;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (*
 (*
  * The different valid entity types.
  * The different valid entity types.

+ 8 - 0
packages/libxml/src/globals.inc

@@ -11,6 +11,14 @@
  * Author: Gary Pennington <[email protected]>, Daniel Veillard
  * Author: Gary Pennington <[email protected]>, Daniel Veillard
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlGlobalStatePtr = ^xmlGlobalState;
+  xmlRegisterNodeFuncPtr = ^xmlRegisterNodeFunc;
+  xmlDeregisterNodeFuncPtr = ^xmlDeregisterNodeFunc;
+  xmlParserInputBufferCreateFilenameFuncPtr = ^xmlParserInputBufferCreateFilenameFunc;
+  xmlOutputBufferCreateFilenameFuncPtr = ^xmlOutputBufferCreateFilenameFunc;
+{$ENDIF}
+
 {$IFDEF FUNCTION}
 {$IFDEF FUNCTION}
 procedure xmlInitGlobals; XMLCALL; XMLPUBFUN;
 procedure xmlInitGlobals; XMLCALL; XMLPUBFUN;
 procedure xmlCleanupGlobals; XMLCALL; XMLPUBFUN;
 procedure xmlCleanupGlobals; XMLCALL; XMLPUBFUN;

+ 4 - 0
packages/libxml/src/hash.inc

@@ -8,6 +8,10 @@
  * Author: Bjorn Reese <[email protected]>
  * Author: Bjorn Reese <[email protected]>
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlHashTablePtr = ^xmlHashTable;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (*
 (*
  * The hash table.
  * The hash table.

+ 73 - 138
packages/libxml/src/libxml2.pas

@@ -25,7 +25,7 @@ const
   {$MESSAGE ERROR 'DYNLINK not supported'}
   {$MESSAGE ERROR 'DYNLINK not supported'}
 {$IFEND}
 {$IFEND}
 {$ELSE}
 {$ELSE}
-  {$LINKLIB libxml2}
+  {$LINKLIB xml2}
 {$ENDIF}
 {$ENDIF}
 
 
 {$i xmlexports.inc}
 {$i xmlexports.inc}
@@ -37,146 +37,45 @@ type
   va_list = pointer;
   va_list = pointer;
   size_t = {$IF Sizeof(pointer) = 8}qword{$ELSE}longword{$IFEND};
   size_t = {$IF Sizeof(pointer) = 8}qword{$ELSE}longword{$IFEND};
 
 
-(*
-  pointer forwarders
-*)
-// dict.inc
-  xmlDictPtr = ^xmlDict;
-
-// encoding.inc
-  xmlCharEncodingHandlerPtr = ^xmlCharEncodingHandler;
-
-// entities.inc
-  xmlEntityPtr = ^xmlEntity;
-  xmlEntitiesTablePtr = ^xmlEntitiesTable;
-
-// globals.inc
-  xmlGlobalStatePtr = ^xmlGlobalState;
-  xmlRegisterNodeFuncPtr = ^xmlRegisterNodeFunc;
-  xmlDeregisterNodeFuncPtr = ^xmlDeregisterNodeFunc;
-  xmlParserInputBufferCreateFilenameFuncPtr = ^xmlParserInputBufferCreateFilenameFunc;
-  xmlOutputBufferCreateFilenameFuncPtr = ^xmlOutputBufferCreateFilenameFunc;
-
-// hash.inc
-  xmlHashTablePtr = ^xmlHashTable;
-
-// parser.inc
-  xmlParserInputPtr = ^xmlParserInput;
-  xmlParserInputPtrPtr = ^xmlParserInputPtr;
-  xmlParserNodeInfoPtr = ^xmlParserNodeInfo;
-  xmlParserNodeInfoSeqPtr = ^xmlParserNodeInfoSeq;
-  xmlParserCtxtPtr = ^xmlParserCtxt;
-  xmlSAXLocatorPtr = ^xmlSAXLocator;
-  xmlSAXHandlerPtr = ^xmlSAXHandler;
-  xmlSAXHandlerV1Ptr = ^xmlSAXHandlerV1;
-
-// pattern.inc
-  xmlPatternPtr = ^xmlPattern;
-  xmlStreamCtxtPtr = ^xmlStreamCtxt;
-
-// schemasInternals.inc
-  xmlSchemaValPtr = ^xmlSchemaVal;
-  xmlSchemaValPtrPtr = ^xmlSchemaValPtr;
-  xmlSchemaTypePtr = ^xmlSchemaType;
-  xmlSchemaFacetPtr = ^xmlSchemaFacet;
-  xmlSchemaAnnotPtr = ^xmlSchemaAnnot;
-  xmlSchemaAttributePtr = ^xmlSchemaAttribute;
-  xmlSchemaAttributeLinkPtr = ^xmlSchemaAttributeLink;
-  xmlSchemaAttributeLinkPtrPtr = ^xmlSchemaAttributeLinkPtr;
-  xmlSchemaWildcardNsPtr = ^xmlSchemaWildcardNs;
-  xmlSchemaWildcardPtr = ^xmlSchemaWildcard;
-  xmlSchemaAttributeGroupPtr = ^xmlSchemaAttributeGroup;
-  xmlSchemaTypeLinkPtr = ^xmlSchemaTypeLink;
-  xmlSchemaFacetLinkPtr = ^xmlSchemaFacetLink;
-  xmlSchemaElementPtr = ^xmlSchemaElement;
-
-// tree.inc
-  xmlBufferPtr = ^xmlBuffer;
-  xmlNotationPtr = ^xmlNotation;
-  xmlEnumerationPtr = ^xmlEnumeration;
-  xmlAttributePtr = ^xmlAttribute;
-  xmlElementContentPtr = ^xmlElementContent;
-  xmlElementPtr = ^xmlElement;
-  xmlNsPtr = ^xmlNs;
-  xmlNodePtr = ^xmlNode;
-  xmlNodePtrPtr = ^xmlNodePtr;
-  xmlDtdPtr = ^xmlDtd;
-  xmlAttrPtr = ^xmlAttr;
-  xmlIDPtr = ^xmlID;
-  xmlRefPtr = ^xmlRef;
-  xmlDocPtr = ^xmlDoc;
-  xmlDOMWrapCtxtPtr = ^xmlDOMWrapCtxt;
-  xmlBufferAllocationSchemePtr = ^xmlBufferAllocationScheme;
-
-// list.inc
-  xmlLinkPtr = ^xmlLink;
-  xmlListPtr = ^xmlList;
-
-// threads.inc
-  xmlMutexPtr = ^xmlMutex;
-  xmlRMutexPtr = ^xmlRMutex;
-
-// uri.inc
-  xmlURIPtr = ^xmlURI;
-
-// relaxng.inc
-  xmlRelaxNGPtr = ^xmlRelaxNG;
-  xmlRelaxNGParserCtxtPtr = ^xmlRelaxNGParserCtxt;
-  xmlRelaxNGValidCtxtPtr = ^xmlRelaxNGValidCtxt;
-
-// valid.inc
-  xmlValidStatePtr = ^xmlValidState;
-  xmlValidCtxtPtr = ^xmlValidCtxt;
-  xmlNotationTablePtr = ^xmlNotationTable;
-  xmlElementTablePtr = ^xmlElementTable;
-  xmlAttributeTablePtr = ^xmlAttributeTable;
-  xmlIDTablePtr = ^xmlIDTable;
-  xmlRefTablePtr = ^xmlRefTable;
-
-// xmlautomata.inc
-  xmlAutomataPtr = ^xmlAutomata;
-  xmlAutomataStatePtr = ^xmlAutomataState;
-
-// xmlerror.inc
-  xmlErrorPtr = ^xmlError;
-  xmlGenericErrorFuncPtr = ^xmlGenericErrorFunc;
-  xmlStructuredErrorFuncPtr = ^xmlStructuredErrorFunc;
-
-// xmlIO.inc
-  xmlParserInputBufferPtr = ^xmlParserInputBuffer;
-  xmlOutputBufferPtr = ^xmlOutputBuffer;
-
-// xmlmodule.inc
-  xmlModulePtr = ^xmlModule;
-
-// xmlreader.inc
-  xmlTextReaderPtr = ^xmlTextReader;
-
-// xmlregexp.inc
-  xmlRegexpPtr = ^xmlRegexp;
-  xmlRegExecCtxtPtr = ^xmlRegExecCtxt;
-  xmlExpCtxtPtr = ^xmlExpCtxt;
-
-// xmlsave.inc
-  xmlSaveCtxtPtr = ^xmlSaveCtxt;
-
-// xmlschemas.inc
-  xmlSchemaPtr = ^xmlSchema;
-  xmlSchemaParserCtxtPtr = ^xmlSchemaParserCtxt;
-  xmlSchemaValidCtxtPtr = ^xmlSchemaValidCtxt;
-  xmlSchemaSAXPlugPtr = ^xmlSchemaSAXPlugStruct;
 
 
-// xmlstring.inc
-  xmlCharPtr = pchar;
-  xmlCharPtrPtr = ^xmlCharPtr;
-
-// xmlwriter.inc
-  xmlTextWriterPtr = ^xmlTextWriter;
-
-// xpath.inc
   xmlNodeSetPtr = ^xmlNodeSet;
   xmlNodeSetPtr = ^xmlNodeSet;
   xmlNodeSet = record end;
   xmlNodeSet = record end;
 
 
+(*
+  include pointers (forwarding)
+*)
+{$DEFINE POINTER}
+  {$i dict.inc}
+  {$i encoding.inc}
+  {$i tree.inc}
+  {$i list.inc}
+  {$i entities.inc}
+  {$i xmlerror.inc}
+  {$i xmlmemory.inc}
+  {$i hash.inc}
+  {$i pattern.inc}
+  {$i schemasInternals.inc}
+  {$i valid.inc}
+  {$i parser.inc}
+  {$i threads.inc}
+  {$i uri.inc}
+  {$i relaxng.inc}
+  {$i globals.inc}
+  {$i xmlautomata.inc}
+  {$i xmlIO.inc}
+  {$i xmlmodule.inc}
+  {$i xmlreader.inc}
+  {$i xmlregexp.inc}
+  {$i xmlsave.inc}
+  {$i xmlschemas.inc}
+  {$i xmlschemastypes.inc}
+  {$i xmlstring.inc}
+  {$i xmlunicode.inc}
+  {$i xmlwriter.inc}
+  {.$i xpath.inc}
+  {$i c14n.inc}
+{$UNDEF POINTER}
+
 (*
 (*
   include types
   include types
 *)
 *)
@@ -212,6 +111,42 @@ type
   {$i c14n.inc}
   {$i c14n.inc}
 {$UNDEF TYPE}
 {$UNDEF TYPE}
 
 
+(*
+  include constants
+*)
+{$DEFINE CONST}
+const
+  {$i dict.inc}
+  {$i encoding.inc}
+  {$i tree.inc}
+  {$i list.inc}
+  {$i entities.inc}
+  {$i xmlerror.inc}
+  {$i xmlmemory.inc}
+  {$i pattern.inc}
+  {$i schemasInternals.inc}
+  {$i hash.inc}
+  {$i valid.inc}
+  {$i parser.inc}
+  {$i threads.inc}
+  {$i uri.inc}
+  {$i relaxng.inc}
+  {$i globals.inc}
+  {$i xmlautomata.inc}
+  {$i xmlIO.inc}
+  {$i xmlmodule.inc}
+  {$i xmlreader.inc}
+  {$i xmlregexp.inc}
+  {$i xmlsave.inc}
+  {$i xmlschemas.inc}
+  {$i xmlschemastypes.inc}
+  {$i xmlstring.inc}
+  {$i xmlunicode.inc}
+  {$i xmlwriter.inc}
+  {.$i xpath.inc}
+  {$i c14n.inc}
+{$UNDEF CONST}
+
 (*
 (*
   include functions
   include functions
 *)
 *)
@@ -306,4 +241,4 @@ finalization
  *)
  *)
   xmlMemoryDump();
   xmlMemoryDump();
 
 
-end.
+end.

+ 5 - 0
packages/libxml/src/list.inc

@@ -8,6 +8,11 @@
  * Author: Gary Pennington <[email protected]>
  * Author: Gary Pennington <[email protected]>
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlLinkPtr = ^xmlLink;
+  xmlListPtr = ^xmlList;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
   xmlLink = record end;
   xmlLink = record end;
   xmlList = record end;
   xmlList = record end;

+ 43 - 24
packages/libxml/src/parser.inc

@@ -7,14 +7,27 @@
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
 
 
-{$IFDEF TYPE}
+{$IFDEF POINTER}
+  xmlParserInputPtr = ^xmlParserInput;
+  xmlParserInputPtrPtr = ^xmlParserInputPtr;
+  xmlParserNodeInfoPtr = ^xmlParserNodeInfo;
+  xmlParserNodeInfoSeqPtr = ^xmlParserNodeInfoSeq;
+  xmlParserCtxtPtr = ^xmlParserCtxt;
+  xmlSAXLocatorPtr = ^xmlSAXLocator;
+  xmlSAXHandlerPtr = ^xmlSAXHandler;
+  xmlSAXHandlerV1Ptr = ^xmlSAXHandlerV1;
+{$ENDIF}
+
+{$IFDEF CONST}
 (**
 (**
  * XML_DEFAULT_VERSION:
  * XML_DEFAULT_VERSION:
  *
  *
  * The default version of XML used: 1.0
  * The default version of XML used: 1.0
  *)
  *)
-{$DEFINE XML_DEFAULT_VERSION :=	'1.0'}
+  XML_DEFAULT_VERSION = '1.0';
+{$ENDIF}
 
 
+{$IFDEF TYPE}
 (**
 (**
  * xmlParserInput:
  * xmlParserInput:
  *
  *
@@ -107,14 +120,16 @@
     XML_PARSER_IGNORE,		(* within an IGNORED section *)
     XML_PARSER_IGNORE,		(* within an IGNORED section *)
     XML_PARSER_PUBLIC_LITERAL 	(* within a PUBLIC value *)
     XML_PARSER_PUBLIC_LITERAL 	(* within a PUBLIC value *)
   );
   );
+{$ENDIF}
 
 
+{$IFDEF CONST}
 (**
 (**
  * XML_DETECT_IDS:
  * XML_DETECT_IDS:
  *
  *
  * Bit in the loadsubset context field to tell to do ID/REFs lookups.
  * Bit in the loadsubset context field to tell to do ID/REFs lookups.
  * Use it to initialize xmlLoadExtDtdDefaultValue.
  * Use it to initialize xmlLoadExtDtdDefaultValue.
  *)
  *)
-{$define XML_DETECT_IDS := 2}
+  XML_DETECT_IDS = 2;
 
 
 (**
 (**
  * XML_COMPLETE_ATTRS:
  * XML_COMPLETE_ATTRS:
@@ -123,7 +138,7 @@
  * elements attributes lists with the ones defaulted from the DTDs.
  * elements attributes lists with the ones defaulted from the DTDs.
  * Use it to initialize xmlLoadExtDtdDefaultValue.
  * Use it to initialize xmlLoadExtDtdDefaultValue.
  *)
  *)
-{$define XML_COMPLETE_ATTRS := 4}
+  XML_COMPLETE_ATTRS = 4;
 
 
 (**
 (**
  * XML_SKIP_IDS:
  * XML_SKIP_IDS:
@@ -131,8 +146,10 @@
  * Bit in the loadsubset context field to tell to not do ID/REFs registration.
  * Bit in the loadsubset context field to tell to not do ID/REFs registration.
  * Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
  * Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
  *)
  *)
-{$define XML_SKIP_IDS := 8}
+  XML_SKIP_IDS = 8;
+{$ENDIF}
 
 
+{$IFDEF TYPE}
 (**
 (**
  * xmlParserMode:
  * xmlParserMode:
  *
  *
@@ -738,28 +755,30 @@
  * to the xmlReadDoc() and similar calls.
  * to the xmlReadDoc() and similar calls.
  *)
  *)
   xmlParserOption = type cint;
   xmlParserOption = type cint;
-
-{$DEFINE XML_PARSE_RECOVER := (1 shl 0)} (* recover on errors *)
-{$DEFINE XML_PARSE_NOENT := (1 shl 1)} (* substitute entities *)
-{$DEFINE XML_PARSE_DTDLOAD := (1 shl 2)} (* load the external subset *)
-{$DEFINE XML_PARSE_DTDATTR := (1 shl 3)} (* default DTD attributes *)
-{$DEFINE XML_PARSE_DTDVALID  := (1 shl 4)} (* validate with the DTD *)
-{$DEFINE XML_PARSE_NOERROR := (1 shl 5)} (* suppress error reports *)
-{$DEFINE XML_PARSE_NOWARNING := (1 shl 6)} (* suppress warning reports *)
-{$DEFINE XML_PARSE_PEDANTIC  := (1 shl 7)} (* pedantic error reporting *)
-{$DEFINE XML_PARSE_NOBLANKS  := (1 shl 8)} (* remove blank nodes *)
-{$DEFINE XML_PARSE_SAX1  := (1 shl 9)} (* use the SAX1 interface internally *)
-{$DEFINE XML_PARSE_XINCLUDE  := (1 shl 10)}(* Implement XInclude substitition  *)
-{$DEFINE XML_PARSE_NONET := (1 shl 11)}(* Forbid network access *)
-{$DEFINE XML_PARSE_NODICT  := (1 shl 12)}(* Do not reuse the context dictionnary *)
-{$DEFINE XML_PARSE_NSCLEAN := (1 shl 13)}(* remove redundant namespaces declarations *)
-{$DEFINE XML_PARSE_NOCDATA := (1 shl 14)}(* merge CDATA as text nodes *)
-{$DEFINE XML_PARSE_NOXINCNODE:= (1 shl 15)}(* do not generate XINCLUDE START/END nodes *)
-{$DEFINE XML_PARSE_COMPACT   := (1 shl 16)} (* compact small text nodes)} no modification of
+{$ENDIF}
+{$IFDEF CONST}
+  XML_PARSE_RECOVER = (1 shl 0); (* recover on errors *)
+  XML_PARSE_NOENT = (1 shl 1); (* substitute entities *)
+  XML_PARSE_DTDLOAD = (1 shl 2); (* load the external subset *)
+  XML_PARSE_DTDATTR = (1 shl 3); (* default DTD attributes *)
+  XML_PARSE_DTDVALID  = (1 shl 4); (* validate with the DTD *)
+  XML_PARSE_NOERROR = (1 shl 5); (* suppress error reports *)
+  XML_PARSE_NOWARNING = (1 shl 6); (* suppress warning reports *)
+  XML_PARSE_PEDANTIC  = (1 shl 7); (* pedantic error reporting *)
+  XML_PARSE_NOBLANKS  = (1 shl 8); (* remove blank nodes *)
+  XML_PARSE_SAX1  = (1 shl 9); (* use the SAX1 interface internally *)
+  XML_PARSE_XINCLUDE  = (1 shl 10);(* Implement XInclude substitition  *)
+  XML_PARSE_NONET = (1 shl 11);(* Forbid network access *)
+  XML_PARSE_NODICT  = (1 shl 12);(* Do not reuse the context dictionnary *)
+  XML_PARSE_NSCLEAN = (1 shl 13);(* remove redundant namespaces declarations *)
+  XML_PARSE_NOCDATA = (1 shl 14);(* merge CDATA as text nodes *)
+  XML_PARSE_NOXINCNODE = (1 shl 15);(* do not generate XINCLUDE START/END nodes *)
+  XML_PARSE_COMPACT   = (1 shl 16); (* compact small text nodes); no modification of
                                    the tree allowed afterwards (will possibly
                                    the tree allowed afterwards (will possibly
            crash if you try to modify the tree) *)
            crash if you try to modify the tree) *)
+{$ENDIF}
 
 
-
+{$IFDEF TYPE}
   xmlFeature = (
   xmlFeature = (
     XML_WITH_THREAD = 1,
     XML_WITH_THREAD = 1,
     XML_WITH_TREE = 2,
     XML_WITH_TREE = 2,

+ 13 - 6
packages/libxml/src/pattern.inc

@@ -10,6 +10,11 @@
 
 
 {$IFDEF LIBXML_PATTERN_ENABLED}
 {$IFDEF LIBXML_PATTERN_ENABLED}
 
 
+{$IFDEF POINTER}
+  xmlPatternPtr = ^xmlPattern;
+  xmlStreamCtxtPtr = ^xmlStreamCtxt;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
  * xmlPattern:
  * xmlPattern:
@@ -27,12 +32,14 @@
  * matching with this module
  * matching with this module
  *
  *
  *)
  *)
-  xmlPatternFlags = (
-    XML_PATTERN_DEFAULT		= 0,	(* simple pattern match *)
-    XML_PATTERN_XPATH		= 1 shl 0,	(* standard XPath pattern *)
-    XML_PATTERN_XSSEL		= 1 shl 1,	(* XPath subset for schema selector *)
-    XML_PATTERN_XSFIELD		= 1 shl 2	(* XPath subset for schema field *)
-  );
+  xmlPatternFlags = type cint;
+{$ENDIF}
+
+{$IFDEF CONST}
+  XML_PATTERN_DEFAULT		= 0;	(* simple pattern match *)
+  XML_PATTERN_XPATH		= 1 shl 0;	(* standard XPath pattern *)
+  XML_PATTERN_XSSEL		= 1 shl 1;	(* XPath subset for schema selector *)
+  XML_PATTERN_XSFIELD		= 1 shl 2;	(* XPath subset for schema field *)
 {$ENDIF}
 {$ENDIF}
 
 
 {$IFDEF FUNCTION}
 {$IFDEF FUNCTION}

+ 6 - 0
packages/libxml/src/relaxng.inc

@@ -10,6 +10,12 @@
 
 
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 
 
+{$IFDEF POINTER}
+  xmlRelaxNGPtr = ^xmlRelaxNG;
+  xmlRelaxNGParserCtxtPtr = ^xmlRelaxNGParserCtxt;
+  xmlRelaxNGValidCtxtPtr = ^xmlRelaxNGValidCtxt;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
   xmlRelaxNG = record end;
   xmlRelaxNG = record end;
 
 

+ 124 - 120
packages/libxml/src/schemasInternals.inc

@@ -12,6 +12,23 @@
 
 
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 
 
+{$IFDEF POINTER}
+  xmlSchemaValPtr = ^xmlSchemaVal;
+  xmlSchemaValPtrPtr = ^xmlSchemaValPtr;
+  xmlSchemaTypePtr = ^xmlSchemaType;
+  xmlSchemaFacetPtr = ^xmlSchemaFacet;
+  xmlSchemaAnnotPtr = ^xmlSchemaAnnot;
+  xmlSchemaAttributePtr = ^xmlSchemaAttribute;
+  xmlSchemaAttributeLinkPtr = ^xmlSchemaAttributeLink;
+  xmlSchemaAttributeLinkPtrPtr = ^xmlSchemaAttributeLinkPtr;
+  xmlSchemaWildcardNsPtr = ^xmlSchemaWildcardNs;
+  xmlSchemaWildcardPtr = ^xmlSchemaWildcard;
+  xmlSchemaAttributeGroupPtr = ^xmlSchemaAttributeGroup;
+  xmlSchemaTypeLinkPtr = ^xmlSchemaTypeLink;
+  xmlSchemaFacetLinkPtr = ^xmlSchemaFacetLink;
+  xmlSchemaElementPtr = ^xmlSchemaElement;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
   xmlSchemaVal = record end;
   xmlSchemaVal = record end;
 
 
@@ -129,93 +146,76 @@
     next    : xmlSchemaAnnotPtr;
     next    : xmlSchemaAnnotPtr;
     content : xmlNodePtr; (* the annotation *)
     content : xmlNodePtr; (* the annotation *)
   end;
   end;
+{$ENDIF}
 
 
-(**
- * XML_SCHEMAS_ANYATTR_SKIP:
- *
- * Skip unknown attribute from validation
- * Obsolete, not used anymore.
- *)
-{$DEFINE XML_SCHEMAS_ANYATTR_SKIP :=       1}
-(**
- * XML_SCHEMAS_ANYATTR_LAX:
- *
- * Ignore validation non definition on attributes
- * Obsolete, not used anymore.
- *)
-{$DEFINE XML_SCHEMAS_ANYATTR_LAX  :=              2}
-(**
- * XML_SCHEMAS_ANYATTR_STRICT:
- *
- * Apply strict validation rules on attributes
- * Obsolete, not used anymore.
- *)
-{$DEFINE XML_SCHEMAS_ANYATTR_STRICT :=       3}
+{$IFDEF CONST}
 (**
 (**
  * XML_SCHEMAS_ANY_SKIP:
  * XML_SCHEMAS_ANY_SKIP:
  *
  *
  * Skip unknown attribute from validation
  * Skip unknown attribute from validation
  *)
  *)
-{$DEFINE XML_SCHEMAS_ANY_SKIP :=       1}
+  XML_SCHEMAS_ANY_SKIP =       1;
 (**
 (**
  * XML_SCHEMAS_ANY_LAX:
  * XML_SCHEMAS_ANY_LAX:
  *
  *
  * Used by wildcards.
  * Used by wildcards.
  * Validate if type found, don't worry if not found
  * Validate if type found, don't worry if not found
  *)
  *)
-{$DEFINE XML_SCHEMAS_ANY_LAX :=               2}
+  XML_SCHEMAS_ANY_LAX =               2;
 (**
 (**
  * XML_SCHEMAS_ANY_STRICT:
  * XML_SCHEMAS_ANY_STRICT:
  *
  *
  * Used by wildcards.
  * Used by wildcards.
  * Apply strict validation rules
  * Apply strict validation rules
  *)
  *)
-{$DEFINE XML_SCHEMAS_ANY_STRICT :=       3}
+  XML_SCHEMAS_ANY_STRICT =       3;
 (**
 (**
  * XML_SCHEMAS_ATTR_USE_PROHIBITED:
  * XML_SCHEMAS_ATTR_USE_PROHIBITED:
  *
  *
  * Used by wildcards.
  * Used by wildcards.
  * The attribute is prohibited.
  * The attribute is prohibited.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTR_USE_PROHIBITED := 0}
+  XML_SCHEMAS_ATTR_USE_PROHIBITED = 0;
 (**
 (**
  * XML_SCHEMAS_ATTR_USE_REQUIRED:
  * XML_SCHEMAS_ATTR_USE_REQUIRED:
  *
  *
  * The attribute is required.
  * The attribute is required.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTR_USE_REQUIRED := 1}
+  XML_SCHEMAS_ATTR_USE_REQUIRED = 1;
 (**
 (**
  * XML_SCHEMAS_ATTR_USE_OPTIONAL:
  * XML_SCHEMAS_ATTR_USE_OPTIONAL:
  *
  *
  * The attribute is optional.
  * The attribute is optional.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTR_USE_OPTIONAL := 2}
+  XML_SCHEMAS_ATTR_USE_OPTIONAL = 2;
 (**
 (**
  * XML_SCHEMAS_ATTR_GLOBAL:
  * XML_SCHEMAS_ATTR_GLOBAL:
  *
  *
  * allow elements in no namespace
  * allow elements in no namespace
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTR_GLOBAL :=       (1 shl 0)}
+  XML_SCHEMAS_ATTR_GLOBAL =       (1 shl 0);
 (**
 (**
  * XML_SCHEMAS_ATTR_NSDEFAULT:
  * XML_SCHEMAS_ATTR_NSDEFAULT:
  *
  *
  * allow elements in no namespace
  * allow elements in no namespace
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTR_NSDEFAULT :=       (1 shl 7)}
+  XML_SCHEMAS_ATTR_NSDEFAULT =       (1 shl 7);
 (**
 (**
  * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
  * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
  *
  *
  * this is set when the "type" and "ref" references
  * this is set when the "type" and "ref" references
  * have been resolved.
  * have been resolved.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTR_INTERNAL_RESOLVED :=       (1 shl 8)}
+  XML_SCHEMAS_ATTR_INTERNAL_RESOLVED =       (1 shl 8);
 (**
 (**
  * XML_SCHEMAS_ATTR_FIXED:
  * XML_SCHEMAS_ATTR_FIXED:
  *
  *
  * the attribute has a fixed value
  * the attribute has a fixed value
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTR_FIXED     :=   (1 shl 9)}
+  XML_SCHEMAS_ATTR_FIXED     =   (1 shl 9);
+{$ENDIF}
 
 
+{$IFDEF TYPE}
 (**
 (**
  * xmlSchemaAttribute:
  * xmlSchemaAttribute:
  * An attribute definition.
  * An attribute definition.
@@ -252,14 +252,18 @@
     next  : xmlSchemaAttributeLinkPtr;(* the next attribute link ... *)
     next  : xmlSchemaAttributeLinkPtr;(* the next attribute link ... *)
     attr  : xmlSchemaAttributePtr;(* the linked attribute *)
     attr  : xmlSchemaAttributePtr;(* the linked attribute *)
   end;
   end;
+{$ENDIF}
 
 
+{$IFDEF CONST}
 (**
 (**
  * XML_SCHEMAS_WILDCARD_COMPLETE:
  * XML_SCHEMAS_WILDCARD_COMPLETE:
  *
  *
  * If the wildcard is complete.
  * If the wildcard is complete.
  *)
  *)
-{$DEFINE XML_SCHEMAS_WILDCARD_COMPLETE := (1 shl 0)}
+  XML_SCHEMAS_WILDCARD_COMPLETE = (1 shl 0);
+{$ENDIF}
 
 
+{$IFDEF TYPE}
 (**
 (**
  * xmlSchemaCharValueLink:
  * xmlSchemaCharValueLink:
  * Used to build a list of namespaces on wildcards.
  * Used to build a list of namespaces on wildcards.
@@ -286,40 +290,43 @@
     negNsSet        : xmlSchemaWildcardNsPtr; (* The negated namespace *)
     negNsSet        : xmlSchemaWildcardNsPtr; (* The negated namespace *)
     flags           : cint;
     flags           : cint;
   end;
   end;
+{$ENDIF}
 
 
-
+{$IFDEF CONST}
 (**
 (**
  * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
  * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
  *
  *
  * The attribute wildcard has been already builded.
  * The attribute wildcard has been already builded.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED := (1 shl 0)}
+  XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED = (1 shl 0);
 (**
 (**
  * XML_SCHEMAS_ATTRGROUP_GLOBAL:
  * XML_SCHEMAS_ATTRGROUP_GLOBAL:
  *
  *
  * The attribute wildcard has been already builded.
  * The attribute wildcard has been already builded.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTRGROUP_GLOBAL := (1 shl 1)}
+  XML_SCHEMAS_ATTRGROUP_GLOBAL = (1 shl 1);
 (**
 (**
  * XML_SCHEMAS_ATTRGROUP_MARKED:
  * XML_SCHEMAS_ATTRGROUP_MARKED:
  *
  *
  * Marks the attr group as marked; used for circular checks.
  * Marks the attr group as marked; used for circular checks.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTRGROUP_MARKED := (1 shl 2)}
+  XML_SCHEMAS_ATTRGROUP_MARKED = (1 shl 2);
 
 
 (**
 (**
  * XML_SCHEMAS_ATTRGROUP_REDEFINED:
  * XML_SCHEMAS_ATTRGROUP_REDEFINED:
  *
  *
  * The attr group was redefined.
  * The attr group was redefined.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTRGROUP_REDEFINED := (1 shl 3)}
+  XML_SCHEMAS_ATTRGROUP_REDEFINED = (1 shl 3);
 (**
 (**
  * XML_SCHEMAS_ATTRGROUP_HAS_REFS:
  * XML_SCHEMAS_ATTRGROUP_HAS_REFS:
  *
  *
  * Whether this attr. group contains attr. group references.
  * Whether this attr. group contains attr. group references.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ATTRGROUP_HAS_REFS := (1 shl 4)}
+  XML_SCHEMAS_ATTRGROUP_HAS_REFS = (1 shl 4);
+{$ENDIF}
 
 
+{$IFDEF TYPE}
 (**
 (**
  * An attribute group definition.
  * An attribute group definition.
  *
  *
@@ -363,38 +370,33 @@
     next  : xmlSchemaFacetLinkPtr;(* the next facet link ... *)
     next  : xmlSchemaFacetLinkPtr;(* the next facet link ... *)
     facet : xmlSchemaFacetPtr;(* the linked facet *)
     facet : xmlSchemaFacetPtr;(* the linked facet *)
   end;
   end;
+{$ENDIF}
 
 
+{$IFDEF CONST}
 (**
 (**
  * XML_SCHEMAS_TYPE_MIXED:
  * XML_SCHEMAS_TYPE_MIXED:
  *
  *
  * the element content type is mixed
  * the element content type is mixed
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_MIXED                := (1 shl 0)}
+  XML_SCHEMAS_TYPE_MIXED                = (1 shl 0);
 (**
 (**
  * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
  * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
  *
  *
  * the simple or complex type has a derivation method of "extension".
  * the simple or complex type has a derivation method of "extension".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION                := (1 shl 1)}
+  XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION                = (1 shl 1);
 (**
 (**
  * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
  * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
  *
  *
  * the simple or complex type has a derivation method of "restriction".
  * the simple or complex type has a derivation method of "restriction".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION                := (1 shl 2)}
+  XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION                = (1 shl 2);
 (**
 (**
  * XML_SCHEMAS_TYPE_GLOBAL:
  * XML_SCHEMAS_TYPE_GLOBAL:
  *
  *
  * the type is global
  * the type is global
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_GLOBAL                := (1 shl 3)}
-(**
- * XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
- *
- * the complexType owns an attribute wildcard, i.e.
- * it can be freed by the complexType
- *)
-{$DEFINE XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD    := (1 shl 4)} (* Obsolete. *)
+  XML_SCHEMAS_TYPE_GLOBAL                = (1 shl 3);
 (**
 (**
  * XML_SCHEMAS_TYPE_VARIETY_ABSENT:
  * XML_SCHEMAS_TYPE_VARIETY_ABSENT:
  *
  *
@@ -403,161 +405,163 @@
  * none of the variety flags occur then it's
  * none of the variety flags occur then it's
  * automatically absent.
  * automatically absent.
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_VARIETY_ABSENT    := (1 shl 5)}
+  XML_SCHEMAS_TYPE_VARIETY_ABSENT    = (1 shl 5);
 (**
 (**
  * XML_SCHEMAS_TYPE_VARIETY_LIST:
  * XML_SCHEMAS_TYPE_VARIETY_LIST:
  *
  *
  * the simpleType has a variety of "list".
  * the simpleType has a variety of "list".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_VARIETY_LIST    := (1 shl 6)}
+  XML_SCHEMAS_TYPE_VARIETY_LIST    = (1 shl 6);
 (**
 (**
  * XML_SCHEMAS_TYPE_VARIETY_UNION:
  * XML_SCHEMAS_TYPE_VARIETY_UNION:
  *
  *
  * the simpleType has a variety of "union".
  * the simpleType has a variety of "union".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_VARIETY_UNION    := (1 shl 7)}
+  XML_SCHEMAS_TYPE_VARIETY_UNION    = (1 shl 7);
 (**
 (**
  * XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
  * XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
  *
  *
  * the simpleType has a variety of "union".
  * the simpleType has a variety of "union".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_VARIETY_ATOMIC    := (1 shl 8)}
+  XML_SCHEMAS_TYPE_VARIETY_ATOMIC    = (1 shl 8);
 (**
 (**
  * XML_SCHEMAS_TYPE_FINAL_EXTENSION:
  * XML_SCHEMAS_TYPE_FINAL_EXTENSION:
  *
  *
  * the complexType has a final of "extension".
  * the complexType has a final of "extension".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_FINAL_EXTENSION    := (1 shl 9)}
+  XML_SCHEMAS_TYPE_FINAL_EXTENSION    = (1 shl 9);
 (**
 (**
  * XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
  * XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
  *
  *
  * the simpleType/complexType has a final of "restriction".
  * the simpleType/complexType has a final of "restriction".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_FINAL_RESTRICTION    := (1 shl 10)}
+  XML_SCHEMAS_TYPE_FINAL_RESTRICTION    = (1 shl 10);
 (**
 (**
  * XML_SCHEMAS_TYPE_FINAL_LIST:
  * XML_SCHEMAS_TYPE_FINAL_LIST:
  *
  *
  * the simpleType has a final of "list".
  * the simpleType has a final of "list".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_FINAL_LIST    := (1 shl 11)}
+  XML_SCHEMAS_TYPE_FINAL_LIST    = (1 shl 11);
 (**
 (**
  * XML_SCHEMAS_TYPE_FINAL_UNION:
  * XML_SCHEMAS_TYPE_FINAL_UNION:
  *
  *
  * the simpleType has a final of "union".
  * the simpleType has a final of "union".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_FINAL_UNION    := (1 shl 12)}
+  XML_SCHEMAS_TYPE_FINAL_UNION    = (1 shl 12);
 (**
 (**
  * XML_SCHEMAS_TYPE_FINAL_DEFAULT:
  * XML_SCHEMAS_TYPE_FINAL_DEFAULT:
  *
  *
  * the simpleType has a final of "default".
  * the simpleType has a final of "default".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_FINAL_DEFAULT    := (1 shl 13)}
+  XML_SCHEMAS_TYPE_FINAL_DEFAULT    = (1 shl 13);
 (**
 (**
  * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
  * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
  *
  *
  * Marks the item as a builtin primitive.
  * Marks the item as a builtin primitive.
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE    := (1 shl 14)}
+  XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE    = (1 shl 14);
 (**
 (**
  * XML_SCHEMAS_TYPE_MARKED:
  * XML_SCHEMAS_TYPE_MARKED:
  *
  *
  * Marks the item as marked; used for circular checks.
  * Marks the item as marked; used for circular checks.
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_MARKED        := (1 shl 16)}
+  XML_SCHEMAS_TYPE_MARKED        = (1 shl 16);
 (**
 (**
  * XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
  * XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
  *
  *
  * the complexType did not specify 'block' so use the default of the
  * the complexType did not specify 'block' so use the default of the
  * <schema> item.
  * <schema> item.
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_BLOCK_DEFAULT    := (1 shl 17)}
+  XML_SCHEMAS_TYPE_BLOCK_DEFAULT    = (1 shl 17);
 (**
 (**
  * XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
  * XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
  *
  *
  * the complexType has a 'block' of "extension".
  * the complexType has a 'block' of "extension".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_BLOCK_EXTENSION    := (1 shl 18)}
+  XML_SCHEMAS_TYPE_BLOCK_EXTENSION    = (1 shl 18);
 (**
 (**
  * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
  * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
  *
  *
  * the complexType has a 'block' of "restriction".
  * the complexType has a 'block' of "restriction".
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_BLOCK_RESTRICTION    := (1 shl 19)}
+  XML_SCHEMAS_TYPE_BLOCK_RESTRICTION    = (1 shl 19);
 (**
 (**
  * XML_SCHEMAS_TYPE_ABSTRACT:
  * XML_SCHEMAS_TYPE_ABSTRACT:
  *
  *
  * the simple/complexType is abstract.
  * the simple/complexType is abstract.
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_ABSTRACT    := (1 shl 20)}
+  XML_SCHEMAS_TYPE_ABSTRACT    = (1 shl 20);
 (**
 (**
  * XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
  * XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
  *
  *
  * indicates if the facets need a computed value
  * indicates if the facets need a computed value
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_FACETSNEEDVALUE    := (1 shl 21)}
+  XML_SCHEMAS_TYPE_FACETSNEEDVALUE    = (1 shl 21);
 (**
 (**
  * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
  * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
  *
  *
  * indicates that the type was typefixed
  * indicates that the type was typefixed
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_INTERNAL_RESOLVED    := (1 shl 22)}
+  XML_SCHEMAS_TYPE_INTERNAL_RESOLVED    = (1 shl 22);
 (**
 (**
  * XML_SCHEMAS_TYPE_INTERNAL_INVALID:
  * XML_SCHEMAS_TYPE_INTERNAL_INVALID:
  *
  *
  * indicates that the type is invalid
  * indicates that the type is invalid
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_INTERNAL_INVALID    := (1 shl 23)}
+  XML_SCHEMAS_TYPE_INTERNAL_INVALID    = (1 shl 23);
 (**
 (**
  * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
  * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
  *
  *
  * a whitespace-facet value of "preserve"
  * a whitespace-facet value of "preserve"
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE    := (1 shl 24)}
+  XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE    = (1 shl 24);
 (**
 (**
  * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
  * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
  *
  *
  * a whitespace-facet value of "replace"
  * a whitespace-facet value of "replace"
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_WHITESPACE_REPLACE    := (1 shl 25)}
+  XML_SCHEMAS_TYPE_WHITESPACE_REPLACE    = (1 shl 25);
 (**
 (**
  * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
  * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
  *
  *
  * a whitespace-facet value of "collapse"
  * a whitespace-facet value of "collapse"
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE    := (1 shl 26)}
+  XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE    = (1 shl 26);
 (**
 (**
  * XML_SCHEMAS_TYPE_HAS_FACETS:
  * XML_SCHEMAS_TYPE_HAS_FACETS:
  *
  *
  * has facets
  * has facets
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_HAS_FACETS    := (1 shl 27)}
+  XML_SCHEMAS_TYPE_HAS_FACETS    = (1 shl 27);
 (**
 (**
  * XML_SCHEMAS_TYPE_NORMVALUENEEDED:
  * XML_SCHEMAS_TYPE_NORMVALUENEEDED:
  *
  *
  * indicates if the facets (pattern) need a normalized value
  * indicates if the facets (pattern) need a normalized value
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_NORMVALUENEEDED    := (1 shl 28)}
+  XML_SCHEMAS_TYPE_NORMVALUENEEDED    = (1 shl 28);
 
 
 (**
 (**
  * XML_SCHEMAS_TYPE_FIXUP_1:
  * XML_SCHEMAS_TYPE_FIXUP_1:
  *
  *
  * First stage of fixup was done.
  * First stage of fixup was done.
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_FIXUP_1    := (1 shl 29)}
+  XML_SCHEMAS_TYPE_FIXUP_1    = (1 shl 29);
 
 
 (**
 (**
  * XML_SCHEMAS_TYPE_REDEFINED:
  * XML_SCHEMAS_TYPE_REDEFINED:
  *
  *
  * The type was redefined.
  * The type was redefined.
  *)
  *)
-{$DEFINE XML_SCHEMAS_TYPE_REDEFINED    := (1 shl 30)}
+  XML_SCHEMAS_TYPE_REDEFINED    = (1 shl 30);
 (**
 (**
  * XML_SCHEMAS_TYPE_REDEFINING:
  * XML_SCHEMAS_TYPE_REDEFINING:
  *
  *
  * The type redefines an other type.
  * The type redefines an other type.
  *)
  *)
-(* {$DEFINE XML_SCHEMAS_TYPE_REDEFINING    := (1 shl 31)} *)
+(*   XML_SCHEMAS_TYPE_REDEFINING    = (1 shl 31); *)
+{$ENDIF}
 
 
+{$IFDEF TYPE}
 (**
 (**
  * _xmlSchemaType:
  * _xmlSchemaType:
  *
  *
@@ -597,7 +601,9 @@
     targetNamespace   : xmlCharPtr;
     targetNamespace   : xmlCharPtr;
     attrUses          : pointer;
     attrUses          : pointer;
   end;
   end;
+{$ENDIF}
 
 
+{$IFDEF CONST}
 (*
 (*
  * xmlSchemaElement:
  * xmlSchemaElement:
  * An element definition.
  * An element definition.
@@ -610,120 +616,108 @@
  *
  *
  * the element is nillable
  * the element is nillable
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_NILLABLE        := (1 shl 0)}
+  XML_SCHEMAS_ELEM_NILLABLE        = (1 shl 0);
 (**
 (**
  * XML_SCHEMAS_ELEM_GLOBAL:
  * XML_SCHEMAS_ELEM_GLOBAL:
  *
  *
  * the element is global
  * the element is global
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_GLOBAL                := (1 shl 1)}
+  XML_SCHEMAS_ELEM_GLOBAL                = (1 shl 1);
 (**
 (**
  * XML_SCHEMAS_ELEM_DEFAULT:
  * XML_SCHEMAS_ELEM_DEFAULT:
  *
  *
  * the element has a default value
  * the element has a default value
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_DEFAULT        := (1 shl 2)}
+  XML_SCHEMAS_ELEM_DEFAULT        = (1 shl 2);
 (**
 (**
  * XML_SCHEMAS_ELEM_FIXED:
  * XML_SCHEMAS_ELEM_FIXED:
  *
  *
  * the element has a fixed value
  * the element has a fixed value
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_FIXED                := (1 shl 3)}
+  XML_SCHEMAS_ELEM_FIXED                = (1 shl 3);
 (**
 (**
  * XML_SCHEMAS_ELEM_ABSTRACT:
  * XML_SCHEMAS_ELEM_ABSTRACT:
  *
  *
  * the element is abstract
  * the element is abstract
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_ABSTRACT        := (1 shl 4)}
-(**
- * XML_SCHEMAS_ELEM_TOPLEVEL:
- *
- * the element is top level
- * obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
- *)
-{$DEFINE XML_SCHEMAS_ELEM_TOPLEVEL        := (1 shl 5)}
+  XML_SCHEMAS_ELEM_ABSTRACT        = (1 shl 4);
 (**
 (**
  * XML_SCHEMAS_ELEM_REF:
  * XML_SCHEMAS_ELEM_REF:
  *
  *
  * the element is a reference to a type
  * the element is a reference to a type
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_REF                := (1 shl 6)}
-(**
- * XML_SCHEMAS_ELEM_NSDEFAULT:
- *
- * allow elements in no namespace
- * Obsolete, not used anymore.
- *)
-{$DEFINE XML_SCHEMAS_ELEM_NSDEFAULT        := (1 shl 7)}
+  XML_SCHEMAS_ELEM_REF                = (1 shl 6);
 (**
 (**
  * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
  * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
  *
  *
  * this is set when "type", "ref", "substitutionGroup"
  * this is set when "type", "ref", "substitutionGroup"
  * references have been resolved.
  * references have been resolved.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_INTERNAL_RESOLVED        := (1 shl 8)}
+  XML_SCHEMAS_ELEM_INTERNAL_RESOLVED        = (1 shl 8);
  (**
  (**
  * XML_SCHEMAS_ELEM_CIRCULAR:
  * XML_SCHEMAS_ELEM_CIRCULAR:
  *
  *
  * a helper flag for the search of circular references.
  * a helper flag for the search of circular references.
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_CIRCULAR        := (1 shl 9)}
+  XML_SCHEMAS_ELEM_CIRCULAR        = (1 shl 9);
 (**
 (**
  * XML_SCHEMAS_ELEM_BLOCK_ABSENT:
  * XML_SCHEMAS_ELEM_BLOCK_ABSENT:
  *
  *
  * the "block" attribute is absent
  * the "block" attribute is absent
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_BLOCK_ABSENT        := (1 shl 10)}
+  XML_SCHEMAS_ELEM_BLOCK_ABSENT        = (1 shl 10);
 (**
 (**
  * XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
  * XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
  *
  *
  * disallowed substitutions are absent
  * disallowed substitutions are absent
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_BLOCK_EXTENSION        := (1 shl 11)}
+  XML_SCHEMAS_ELEM_BLOCK_EXTENSION        = (1 shl 11);
 (**
 (**
  * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
  * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
  *
  *
  * disallowed substitutions: "restriction"
  * disallowed substitutions: "restriction"
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_BLOCK_RESTRICTION        := (1 shl 12)}
+  XML_SCHEMAS_ELEM_BLOCK_RESTRICTION        = (1 shl 12);
 (**
 (**
  * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
  * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
  *
  *
  * disallowed substitutions: "substituion"
  * disallowed substitutions: "substituion"
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION        := (1 shl 13)}
+  XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION        = (1 shl 13);
 (**
 (**
  * XML_SCHEMAS_ELEM_FINAL_ABSENT:
  * XML_SCHEMAS_ELEM_FINAL_ABSENT:
  *
  *
  * substitution group exclusions are absent
  * substitution group exclusions are absent
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_FINAL_ABSENT        := (1 shl 14)}
+  XML_SCHEMAS_ELEM_FINAL_ABSENT        = (1 shl 14);
 (**
 (**
  * XML_SCHEMAS_ELEM_FINAL_EXTENSION:
  * XML_SCHEMAS_ELEM_FINAL_EXTENSION:
  *
  *
  * substitution group exclusions: "extension"
  * substitution group exclusions: "extension"
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_FINAL_EXTENSION        := (1 shl 15)}
+  XML_SCHEMAS_ELEM_FINAL_EXTENSION        = (1 shl 15);
 (**
 (**
  * XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
  * XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
  *
  *
  * substitution group exclusions: "restriction"
  * substitution group exclusions: "restriction"
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_FINAL_RESTRICTION        := (1 shl 16)}
+  XML_SCHEMAS_ELEM_FINAL_RESTRICTION        = (1 shl 16);
 (**
 (**
  * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
  * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
  *
  *
  * the declaration is a substitution group head
  * the declaration is a substitution group head
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD        := (1 shl 17)}
+  XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD        = (1 shl 17);
 (**
 (**
  * XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
  * XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
  *
  *
  * this is set when the elem decl has been checked against
  * this is set when the elem decl has been checked against
  * all constraints
  * all constraints
  *)
  *)
-{$DEFINE XML_SCHEMAS_ELEM_INTERNAL_CHECKED        := (1 shl 18)}
+  XML_SCHEMAS_ELEM_INTERNAL_CHECKED        = (1 shl 18);
+{$ENDIF}
 
 
+{$IFDEF TYPE}
   xmlSchemaElement = record
   xmlSchemaElement = record
     _type             : xmlSchemaTypeType; (* The kind of type *)
     _type             : xmlSchemaTypeType; (* The kind of type *)
     next              : xmlSchemaTypePtr; (* Not used? *)
     next              : xmlSchemaTypePtr; (* Not used? *)
@@ -754,31 +748,36 @@
     defVal            : xmlSchemaValPtr; (* The compiled value contraint. *)
     defVal            : xmlSchemaValPtr; (* The compiled value contraint. *)
     idcs              : pointer; (* The identity-constraint defs *)
     idcs              : pointer; (* The identity-constraint defs *)
   end;
   end;
+{$ENDIF}
 
 
+{$IFDEF CONST}
 (*
 (*
  * XML_SCHEMAS_FACET_UNKNOWN:
  * XML_SCHEMAS_FACET_UNKNOWN:
  *
  *
  * unknown facet handling
  * unknown facet handling
  *)
  *)
-{$DEFINE XML_SCHEMAS_FACET_UNKNOWN        := (0)}
+  XML_SCHEMAS_FACET_UNKNOWN        = (0);
 (*
 (*
  * XML_SCHEMAS_FACET_PRESERVE:
  * XML_SCHEMAS_FACET_PRESERVE:
  *
  *
  * preserve the type of the facet
  * preserve the type of the facet
  *)
  *)
-{$DEFINE XML_SCHEMAS_FACET_PRESERVE        := (1)}
+  XML_SCHEMAS_FACET_PRESERVE        = (1);
 (*
 (*
  * XML_SCHEMAS_FACET_REPLACE:
  * XML_SCHEMAS_FACET_REPLACE:
  *
  *
  * replace the type of the facet
  * replace the type of the facet
  *)
  *)
-{$DEFINE XML_SCHEMAS_FACET_REPLACE        := (2)}
+  XML_SCHEMAS_FACET_REPLACE        = (2);
 (*
 (*
  * XML_SCHEMAS_FACET_COLLAPSE:
  * XML_SCHEMAS_FACET_COLLAPSE:
  *
  *
  * collapse the types of the facet
  * collapse the types of the facet
  *)
  *)
-{$DEFINE XML_SCHEMAS_FACET_COLLAPSE        := (3)}
+  XML_SCHEMAS_FACET_COLLAPSE        = (3);
+{$ENDIF}
+
+{$IFDEF TYPE}
 (**
 (**
  * A facet definition.
  * A facet definition.
  *)
  *)
@@ -805,7 +804,9 @@
     identifier    : xmlCharPtr;
     identifier    : xmlCharPtr;
     targetNamespace : xmlCharPtr;
     targetNamespace : xmlCharPtr;
   end;
   end;
+{$ENDIF}
 
 
+{$IFDEF CONST}
 (*
 (*
 * TODO: Actually all those flags used for the schema should sit
 * TODO: Actually all those flags used for the schema should sit
 * on the schema parser context, since they are used only
 * on the schema parser context, since they are used only
@@ -818,63 +819,66 @@
  * Reflects elementFormDefault == qualified in
  * Reflects elementFormDefault == qualified in
  * an XML schema document.
  * an XML schema document.
  *)
  *)
-{$DEFINE XML_SCHEMAS_QUALIF_ELEM                := (1 shl 0)}
+  XML_SCHEMAS_QUALIF_ELEM                = (1 shl 0);
 (**
 (**
  * XML_SCHEMAS_QUALIF_ATTR:
  * XML_SCHEMAS_QUALIF_ATTR:
  *
  *
  * Reflects attributeFormDefault == qualified in
  * Reflects attributeFormDefault == qualified in
  * an XML schema document.
  * an XML schema document.
  *)
  *)
-{$DEFINE XML_SCHEMAS_QUALIF_ATTR            := (1 shl 1)}
+  XML_SCHEMAS_QUALIF_ATTR            = (1 shl 1);
 (**
 (**
  * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
  * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
  *
  *
  * the schema has "extension" in the set of finalDefault.
  * the schema has "extension" in the set of finalDefault.
  *)
  *)
-{$DEFINE XML_SCHEMAS_FINAL_DEFAULT_EXTENSION        := (1 shl 2)}
+  XML_SCHEMAS_FINAL_DEFAULT_EXTENSION        = (1 shl 2);
 (**
 (**
  * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
  * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
  *
  *
  * the schema has "restriction" in the set of finalDefault.
  * the schema has "restriction" in the set of finalDefault.
  *)
  *)
-{$DEFINE XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION            := (1 shl 3)}
+  XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION            = (1 shl 3);
 (**
 (**
  * XML_SCHEMAS_FINAL_DEFAULT_LIST:
  * XML_SCHEMAS_FINAL_DEFAULT_LIST:
  *
  *
  * the cshema has "list" in the set of finalDefault.
  * the cshema has "list" in the set of finalDefault.
  *)
  *)
-{$DEFINE XML_SCHEMAS_FINAL_DEFAULT_LIST            := (1 shl 4)}
+  XML_SCHEMAS_FINAL_DEFAULT_LIST            = (1 shl 4);
 (**
 (**
  * XML_SCHEMAS_FINAL_DEFAULT_UNION:
  * XML_SCHEMAS_FINAL_DEFAULT_UNION:
  *
  *
  * the schema has "union" in the set of finalDefault.
  * the schema has "union" in the set of finalDefault.
  *)
  *)
-{$DEFINE XML_SCHEMAS_FINAL_DEFAULT_UNION            := (1 shl 5)}
+  XML_SCHEMAS_FINAL_DEFAULT_UNION            = (1 shl 5);
 (**
 (**
  * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
  * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
  *
  *
  * the schema has "extension" in the set of blockDefault.
  * the schema has "extension" in the set of blockDefault.
  *)
  *)
-{$DEFINE XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION            := (1 shl 6)}
+  XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION            = (1 shl 6);
 (**
 (**
  * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
  * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
  *
  *
  * the schema has "restriction" in the set of blockDefault.
  * the schema has "restriction" in the set of blockDefault.
  *)
  *)
-{$DEFINE XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION            := (1 shl 7)}
+  XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION            = (1 shl 7);
 (**
 (**
  * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
  * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
  *
  *
  * the schema has "substitution" in the set of blockDefault.
  * the schema has "substitution" in the set of blockDefault.
  *)
  *)
-{$DEFINE XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION            := (1 shl 8)}
+  XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION            = (1 shl 8);
 (**
 (**
  * XML_SCHEMAS_INCLUDING_CONVERT_NS:
  * XML_SCHEMAS_INCLUDING_CONVERT_NS:
  *
  *
  * the schema is currently including an other schema with
  * the schema is currently including an other schema with
  * no target namespace.
  * no target namespace.
  *)
  *)
-{$DEFINE XML_SCHEMAS_INCLUDING_CONVERT_NS            := (1 shl 9)}
+  XML_SCHEMAS_INCLUDING_CONVERT_NS            = (1 shl 9);
+{$ENDIF}
+
+{$IFDEF TYPE}
 (**
 (**
  * _xmlSchema:
  * _xmlSchema:
  *
  *

+ 5 - 0
packages/libxml/src/threads.inc

@@ -8,6 +8,11 @@
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlMutexPtr = ^xmlMutex;
+  xmlRMutexPtr = ^xmlRMutex;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (*
 (*
  * xmlMutex are a simple mutual exception locks.
  * xmlMutex are a simple mutual exception locks.

+ 25 - 5
packages/libxml/src/tree.inc

@@ -9,18 +9,36 @@
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlBufferPtr = ^xmlBuffer;
+  xmlNotationPtr = ^xmlNotation;
+  xmlEnumerationPtr = ^xmlEnumeration;
+  xmlAttributePtr = ^xmlAttribute;
+  xmlElementContentPtr = ^xmlElementContent;
+  xmlElementPtr = ^xmlElement;
+  xmlNsPtr = ^xmlNs;
+  xmlNodePtr = ^xmlNode;
+  xmlNodePtrPtr = ^xmlNodePtr;
+  xmlDtdPtr = ^xmlDtd;
+  xmlAttrPtr = ^xmlAttr;
+  xmlIDPtr = ^xmlID;
+  xmlRefPtr = ^xmlRef;
+  xmlDocPtr = ^xmlDoc;
+  xmlDOMWrapCtxtPtr = ^xmlDOMWrapCtxt;
+  xmlBufferAllocationSchemePtr = ^xmlBufferAllocationScheme;
+{$ENDIF}
+
 (*
 (*
  * Some of the basic types pointer to structures:
  * Some of the basic types pointer to structures:
  *)
  *)
 
 
-{$IFDEF TYPE}
-
+{$IFDEF CONST}
 (**
 (**
  * BASE_BUFFER_SIZE:
  * BASE_BUFFER_SIZE:
  *
  *
  * default buffer size 4000.
  * default buffer size 4000.
  *)
  *)
-{$DEFINE BASE_BUFFER_SIZE := 4096}
+  BASE_BUFFER_SIZE = 4096;
 
 
 (**
 (**
  * LIBXML_NAMESPACE_DICT:
  * LIBXML_NAMESPACE_DICT:
@@ -37,15 +55,17 @@
  * This is the namespace for the special xml: prefix predefined in the
  * This is the namespace for the special xml: prefix predefined in the
  * XML Namespace specification.
  * XML Namespace specification.
  *)
  *)
-{$DEFINE XML_XML_NAMESPACE := xmlCharPtr('http://www.w3.org/XML/1998/namespace')}
+  //XML_XML_NAMESPACE: xmlCharPtr = pchar('http://www.w3.org/XML/1998/namespace');
 
 
 (**
 (**
  * XML_XML_ID:
  * XML_XML_ID:
  *
  *
  * This is the name for the special xml:id attribute
  * This is the name for the special xml:id attribute
  *)
  *)
-{$DEFINE XML_XML_ID := xmlCharPtr('xml:id')}
+  //XML_XML_ID: xmlCharPtr = pchar('xml:id');
+{$ENDIF}
 
 
+{$IFDEF TYPE}
 (**
 (**
  * xmlBufferAllocationScheme:
  * xmlBufferAllocationScheme:
  *
  *

+ 4 - 0
packages/libxml/src/uri.inc

@@ -8,6 +8,10 @@
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlURIPtr = ^xmlURI;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
  * xmlURI:
  * xmlURI:

+ 10 - 0
packages/libxml/src/valid.inc

@@ -7,6 +7,16 @@
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlValidStatePtr = ^xmlValidState;
+  xmlValidCtxtPtr = ^xmlValidCtxt;
+  xmlNotationTablePtr = ^xmlNotationTable;
+  xmlElementTablePtr = ^xmlElementTable;
+  xmlAttributeTablePtr = ^xmlAttributeTable;
+  xmlIDTablePtr = ^xmlIDTable;
+  xmlRefTablePtr = ^xmlRefTable;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (*
 (*
  * Validation state added for non-determinist content model.
  * Validation state added for non-determinist content model.

+ 5 - 2
packages/libxml/src/xmlIO.inc

@@ -12,6 +12,11 @@
  * I/O structures.
  * I/O structures.
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlParserInputBufferPtr = ^xmlParserInputBuffer;
+  xmlOutputBufferPtr = ^xmlOutputBuffer;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
  * xmlInputMatchCallback:
  * xmlInputMatchCallback:
@@ -190,10 +195,8 @@ function xmlCheckHTTPInput(ctxt: xmlParserCtxtPtr; ret: xmlParserInputPtr): xmlP
 function xmlNoNetExternalEntityLoader(URL: pchar; ID: pchar; ctxt: xmlParserCtxtPtr): xmlParserInputPtr; XMLCALL; XMLPUBFUN;
 function xmlNoNetExternalEntityLoader(URL: pchar; ID: pchar; ctxt: xmlParserCtxtPtr): xmlParserInputPtr; XMLCALL; XMLPUBFUN;
 
 
 (*
 (*
- * xmlNormalizeWindowsPath is obsolete, don't use it.
  * Check xmlCanonicPath in uri.h for a better alternative.
  * Check xmlCanonicPath in uri.h for a better alternative.
  *)
  *)
-function xmlNormalizeWindowsPath(path: xmlCharPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
 function xmlCheckFilename(path: pchar): cint; XMLCALL; XMLPUBFUN;
 function xmlCheckFilename(path: pchar): cint; XMLCALL; XMLPUBFUN;
 
 
 (**
 (**

+ 5 - 0
packages/libxml/src/xmlautomata.inc

@@ -10,6 +10,11 @@
 {$IFDEF LIBXML_REGEXP_ENABLED}
 {$IFDEF LIBXML_REGEXP_ENABLED}
 {$IFDEF LIBXML_AUTOMATA_ENABLED}
 {$IFDEF LIBXML_AUTOMATA_ENABLED}
 
 
+{$IFDEF POINTER}
+  xmlAutomataPtr = ^xmlAutomata;
+  xmlAutomataStatePtr = ^xmlAutomataState;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
  * xmlAutomataPtr:
  * xmlAutomataPtr:

+ 32 - 26
packages/libxml/src/xmlerror.inc

@@ -6,6 +6,11 @@
  *
  *
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
+{$IFDEF POINTER}
+  xmlErrorPtr = ^xmlError;
+  xmlGenericErrorFuncPtr = ^xmlGenericErrorFunc;
+  xmlStructuredErrorFuncPtr = ^xmlStructuredErrorFunc;
+{$ENDIF}
 
 
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
@@ -868,33 +873,34 @@ procedure xmlCtxtResetLastError(ctx: pointer); XMLCALL; XMLPUBFUN;
 procedure xmlResetError(err: xmlErrorPtr); XMLCALL; XMLPUBFUN;
 procedure xmlResetError(err: xmlErrorPtr); XMLCALL; XMLPUBFUN;
 function xmlResetError(from, _to: xmlErrorPtr): cint; XMLCALL; XMLPUBFUN;
 function xmlResetError(from, _to: xmlErrorPtr): cint; XMLCALL; XMLPUBFUN;
 
 
-{$IFDEF IN_LIBXML}
 (*
 (*
  * Internal callback reporting routine
  * Internal callback reporting routine
  *)
  *)
-{XMLPUBFUN void XMLCALL
-    __xmlRaiseError		(xmlStructuredErrorFunc schannel,
-    				 xmlGenericErrorFunc channel,
-    				 void *data,
-                                 void *ctx,
-    				 void *node,
-    				 int domain,
-				 int code,
-				 xmlErrorLevel level,
-				 char *file,
-				 int line,
-				 char *str1,
-				 char *str2,
-				 char *str3,
-				 int int1,
-				 int col,
-				 char *msg,
-				 ...);
-XMLPUBFUN void XMLCALL
-    __xmlSimpleError		(int domain,
-    				 int code,
-				 xmlNodePtr node,
-				 char *msg,
-				 char *extra);}
-{$ENDIF}
+procedure __xmlRaiseError(
+  schannel: xmlStructuredErrorFunc;
+  channel: xmlGenericErrorFunc;
+  data: pointer;
+  ctx: pointer;
+  node: pointer;
+  domain: cint;
+  code: cint;
+  level: xmlErrorLevel;
+  _file: pchar;
+  line: cint;
+  str1: pchar;
+  str2: pchar;
+  str3: pchar;
+  int1: cint;
+  col: cint;
+  msg: pchar;
+  args: array of const
+); XMLCALL; XMLPUBFUN;
+
+procedure __xmlSimpleError(
+  domain: cint;
+  code: cint;
+  node: xmlNodePtr;
+  msg: pchar;
+  extra: pchar
+); XMLCALL; XMLPUBFUN;
 {$ENDIF}
 {$ENDIF}

+ 4 - 0
packages/libxml/src/xmlmodule.inc

@@ -10,6 +10,10 @@
 
 
 {$IFDEF LIBXML_MODULES_ENABLED}
 {$IFDEF LIBXML_MODULES_ENABLED}
 
 
+{$IFDEF POINTER}
+  xmlModulePtr = ^xmlModule;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
  * xmlModulePtr:
  * xmlModulePtr:

+ 5 - 0
packages/libxml/src/xmlreader.inc

@@ -9,6 +9,11 @@
 
 
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 {$IFDEF LIBXML_READER_ENABLED}
 {$IFDEF LIBXML_READER_ENABLED}
+
+{$IFDEF POINTER}
+  xmlTextReaderPtr = ^xmlTextReader;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
  * xmlTextReaderMode:
  * xmlTextReaderMode:

+ 11 - 5
packages/libxml/src/xmlregexp.inc

@@ -9,6 +9,15 @@
  *)
  *)
 
 
 {$IFDEF LIBXML_REGEXP_ENABLED}
 {$IFDEF LIBXML_REGEXP_ENABLED}
+
+{$IFDEF POINTER}
+  xmlExpNodePtr = ^xmlExpNode;
+  xmlRegexpPtr = ^xmlRegexp;
+  xmlRegExecCtxtPtr = ^xmlRegExecCtxt;
+  xmlExpCtxtPtr = ^xmlExpCtxt;
+{$ENDIF}
+
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
  * xmlRegexpPtr:
  * xmlRegexpPtr:
@@ -60,13 +69,10 @@ function xmlRegExecErrInfo(exec: xmlRegExecCtxtPtr; _string: xmlCharPtrPtr; nbva
 
 
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (* expressions are used within a context *)
 (* expressions are used within a context *)
-  xmlExpCtxt = record
-  end;
+  xmlExpCtxt = record end;
 
 
 (* Expressions are trees but the tree is opaque *)
 (* Expressions are trees but the tree is opaque *)
-  xmlExpNodePtr = ^xmlExpNode;
-  xmlExpNode = record
-  end;
+  xmlExpNode = record end;
 
 
   xmlExpNodeType = (
   xmlExpNodeType = (
     XML_EXP_EMPTY = 0,
     XML_EXP_EMPTY = 0,

+ 13 - 7
packages/libxml/src/xmlsave.inc

@@ -9,6 +9,10 @@
 
 
 {$IFDEF LIBXML_OUTPUT_ENABLED}
 {$IFDEF LIBXML_OUTPUT_ENABLED}
 
 
+{$IFDEF POINTER}
+  xmlSaveCtxtPtr = ^xmlSaveCtxt;
+{$ENDIF}
+
 (**
 (**
  * xmlSaveOption:
  * xmlSaveOption:
  *
  *
@@ -16,14 +20,16 @@
  * to the xmlSaveToFd() and similar calls.
  * to the xmlSaveToFd() and similar calls.
  *)
  *)
 {$IFDEF TYPE}
 {$IFDEF TYPE}
-  xmlSaveOption = (
-    XML_SAVE_FORMAT     = 1 shl 0,	(* format save output *)
-    XML_SAVE_NO_DECL    = 1 shl 1,	(* drop the xml declaration *)
-    XML_SAVE_NO_EMPTY	= 1 shl 2, (* no empty tags *)
-    XML_SAVE_NO_XHTML	= 1 shl 3  (* disable XHTML1 specific rules *)
-  );
-
   xmlSaveCtxt = record end;
   xmlSaveCtxt = record end;
+
+  xmlSaveOption = type cint;
+{$ENDIF}
+
+{$IFDEF CONST}
+  XML_SAVE_FORMAT     = 1 shl 0;	(* format save output *)
+  XML_SAVE_NO_DECL    = 1 shl 1;	(* drop the xml declaration *)
+  XML_SAVE_NO_EMPTY	= 1 shl 2; (* no empty tags *)
+  XML_SAVE_NO_XHTML	= 1 shl 3;  (* disable XHTML1 specific rules *)
 {$ENDIF}
 {$ENDIF}
 
 
 {$IFDEF FUNCTION}
 {$IFDEF FUNCTION}

+ 15 - 4
packages/libxml/src/xmlschemas.inc

@@ -10,6 +10,13 @@
 
 
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 
 
+{$IFDEF POINTER}
+  xmlSchemaPtr = ^xmlSchema;
+  xmlSchemaParserCtxtPtr = ^xmlSchemaParserCtxt;
+  xmlSchemaValidCtxtPtr = ^xmlSchemaValidCtxt;
+  xmlSchemaSAXPlugPtr = ^xmlSchemaSAXPlugStruct;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**
  * This error codes are obsolete; not used any more.
  * This error codes are obsolete; not used any more.
@@ -53,20 +60,24 @@
  *
  *
  * This is the set of XML Schema validation options.
  * This is the set of XML Schema validation options.
  *)
  *)
-  xmlSchemaValidOption = (
-    XML_SCHEMA_VAL_VC_I_CREATE			= 1 shl 0,
+  xmlSchemaValidOption = type cint;
+{$ENDIF}
+
+{$IFDEF CONST}
+    XML_SCHEMA_VAL_VC_I_CREATE			= 1 shl 0;
 	(* Default/fixed: create an attribute node
 	(* Default/fixed: create an attribute node
 	* or an element's text node on the instance.
 	* or an element's text node on the instance.
 	*)
 	*)
 
 
-    XML_SCHEMA_VAL_XSI_ASSEMBLE			= 1 shl 1
+    XML_SCHEMA_VAL_XSI_ASSEMBLE			= 1 shl 1;
 (*
 (*
 	* assemble schemata using
 	* assemble schemata using
 	* xsi:schemaLocation and
 	* xsi:schemaLocation and
 	* xsi:noNamespaceSchemaLocation
 	* xsi:noNamespaceSchemaLocation
 *)
 *)
-  );
+{$ENDIF}
 
 
+{$IFDEF TYPE}
 (**
 (**
  * The schemas related types are kept internal
  * The schemas related types are kept internal
  *)
  *)

+ 4 - 0
packages/libxml/src/xmlstring.inc

@@ -8,6 +8,10 @@
  * Author: Daniel Veillard
  * Author: Daniel Veillard
  *)
  *)
 
 
+{$IFDEF POINTER}
+  xmlCharPtr = pchar;
+  xmlCharPtrPtr = ^xmlCharPtr;
+{$ENDIF}
 
 
 {$IFDEF TYPE}
 {$IFDEF TYPE}
 (**
 (**

+ 7 - 6
packages/libxml/src/xmlversion.inc

@@ -14,34 +14,34 @@
  *)
  *)
 procedure xmlCheckVersion(version: cint); XMLCALL; XMLPUBFUN;
 procedure xmlCheckVersion(version: cint); XMLCALL; XMLPUBFUN;
 
 
-
 (**
 (**
  * LIBXML_DOTTED_VERSION:
  * LIBXML_DOTTED_VERSION:
  *
  *
  * the version string like "1.2.3"
  * the version string like "1.2.3"
  *)
  *)
-{$DEFINE LIBXML_DOTTED_VERSION := '2.6.32'}
+const
+  LIBXML_DOTTED_VERSION = '2.6.32';
 
 
 (**
 (**
  * LIBXML_VERSION:
  * LIBXML_VERSION:
  *
  *
  * the version number: 1.2.3 value is 10203
  * the version number: 1.2.3 value is 10203
  *)
  *)
-{$DEFINE LIBXML_VERSION := 20632}
+  LIBXML_VERSION = 20632;
 
 
 (**
 (**
  * LIBXML_VERSION_STRING:
  * LIBXML_VERSION_STRING:
  *
  *
  * the version number string, 1.2.3 value is "10203"
  * the version number string, 1.2.3 value is "10203"
  *)
  *)
-{$DEFINE LIBXML_VERSION_STRING := '20632'}
+  LIBXML_VERSION_STRING = '20632';
 
 
 (**
 (**
  * LIBXML_VERSION_EXTRA:
  * LIBXML_VERSION_EXTRA:
  *
  *
  * extra version information, used to show a CVS compilation
  * extra version information, used to show a CVS compilation
  *)
  *)
-{$DEFINE LIBXML_VERSION_EXTRA := '-CVS2831'}
+  LIBXML_VERSION_EXTRA = '-CVS2831';
 
 
 (**
 (**
  * LIBXML_TEST_VERSION:
  * LIBXML_TEST_VERSION:
@@ -277,7 +277,8 @@ procedure xmlCheckVersion(version: cint); XMLCALL; XMLPUBFUN;
  *
  *
  * the string suffix used by dynamic modules (usually shared libraries)
  * the string suffix used by dynamic modules (usually shared libraries)
  *)
  *)
-{$DEFINE LIBXML_MODULE_EXTENSION := '.so'}
+const
+  LIBXML_MODULE_EXTENSION = '.so';
 
 
 (**
 (**
  * LIBXML_ZLIB_ENABLED:
  * LIBXML_ZLIB_ENABLED:

+ 6 - 2
packages/libxml/src/xmlwriter.inc

@@ -10,6 +10,10 @@
 
 
 {$IFDEF LIBXML_WRITER_ENABLED}
 {$IFDEF LIBXML_WRITER_ENABLED}
 
 
+{$IFDEF POINTER}
+  xmlTextWriterPtr = ^xmlTextWriter;
+{$ENDIF}
+
 {$IFDEF TYPE}
 {$IFDEF TYPE}
   xmlTextWriter = record end;
   xmlTextWriter = record end;
 {$ENDIF}
 {$ENDIF}
@@ -111,7 +115,7 @@ function xmlTextWriterWritePI(writer: xmlTextWriterPtr; target, content: xmlChar
  *
  *
  * This macro maps to xmlTextWriterWritePI
  * This macro maps to xmlTextWriterWritePI
  *)
  *)
-{$DEFINE xmlTextWriterWriteProcessingInstruction := xmlTextWriterWritePI}
+//function xmlTextWriterWriteProcessingInstruction(writer: xmlTextWriterPtr; target, content: xmlCharPtr): cint; XMLCALL; XMLPUBFUN 'xmlTextWriterWritePI';
 
 
 (*
 (*
  * CDATA
  * CDATA
@@ -144,7 +148,7 @@ function xmlTextWriterWriteDTD(writer: xmlTextWriterPtr; name, pubid, sysid, sub
  *
  *
  * this macro maps to xmlTextWriterWriteDTD
  * this macro maps to xmlTextWriterWriteDTD
  *)
  *)
-{$DEFINE xmlTextWriterWriteDocType := xmlTextWriterWriteDTD}
+//{$DEFINE xmlTextWriterWriteDocType := xmlTextWriterWriteDTD}
 
 
 (*
 (*
  * DTD element definition
  * DTD element definition