Browse Source

* new translated include files

git-svn-id: trunk@11538 -
ivost 17 years ago
parent
commit
d951ad5408

+ 20 - 55
packages/libxml/src/c14n.inc

@@ -14,18 +14,9 @@
  *
  * Author: Aleksey Sanin <[email protected]>
  *)
-#ifndef __XML_C14N_H__
-#define __XML_C14N_H__
-{ LIBXML_C14N_ENABLED
-{ LIBXML_OUTPUT_ENABLED
 
-{ __cplusplus
-extern "C" {
-#endif (* __cplusplus *)
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
+{$IFDEF LIBXML_C14N_ENABLED}
+{$IFDEF LIBXML_OUTPUT_ENABLED}
 
 (*
  * XML Canonicazation
@@ -52,54 +43,28 @@ extern "C" {
  *    ...
  *)
 
-
-XMLPUBFUN int XMLCALL
-		xmlC14NDocSaveTo	(xmlDocPtr doc,
-					 xmlNodeSetPtr nodes,
-					 int exclusive,
-					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments,
-					 xmlOutputBufferPtr buf);
-
-XMLPUBFUN int XMLCALL
-		xmlC14NDocDumpMemory	(xmlDocPtr doc,
-					 xmlNodeSetPtr nodes,
-					 int exclusive,
-					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments,
-					 xmlChar **doc_txt_ptr);
-
-XMLPUBFUN int XMLCALL
-		xmlC14NDocSave		(xmlDocPtr doc,
-					 xmlNodeSetPtr nodes,
-					 int exclusive,
-					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments,
-					 char* filename,
-					 int compression);
-
-
+{$IFDEF TYPE}
 (**
  * This is the core C14N function
  *)
-typedef int (*xmlC14NIsVisibleCallback)	(void* user_data,
-					 xmlNodePtr node,
-					 xmlNodePtr parent);
 
-XMLPUBFUN int XMLCALL
-		xmlC14NExecute		(xmlDocPtr doc,
-					 xmlC14NIsVisibleCallback is_visible_callback,
-					 void* user_data,
-					 int exclusive,
-					 xmlChar **inclusive_ns_prefixes,
-					 int with_comments,
-					 xmlOutputBufferPtr buf);
+  xmlC14NIsVisibleCallback = function(user_data: pointer; node, parent: xmlNodePtr): cint; XMLCALL;
+{$ENDIF}
+
+{$IFDEF FUNCTION}
+function xmlC14NDocSaveTo(doc: xmlDocPtr; nodes: xmlNodeSetPtr; exclusive: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+  with_comments: cint; buf: xmlOutputBufferPtr): cint; XMLCALL; XMLPUBFUN;
+
+function xmlC14NDocDumpMemory(doc: xmlDocPtr; nodes: xmlNodeSetPtr; exclusive: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+  with_comments: cint; doc_txt_ptr: xmlCharPtrPtr): cint; XMLCALL; XMLPUBFUN;
+
+function xmlC14NDocSave(doc: xmlDocPtr; nodes: xmlNodeSetPtr; exclusive: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+  with_comments: cint; filename: pchar; compression: cint): cint; XMLCALL; XMLPUBFUN;
 
-{ __cplusplus
-}
-#endif (* __cplusplus *)
+function xmlC14NExecute(doc: xmlDocPtr; is_visible_callback: xmlC14NIsVisibleCallback; user_data: pointer;
+  exclusive: cint; inclusive_ns_prefixes: xmlCharPtrPtr; with_comments: cint; buf: xmlOutputBufferPtr): cint; XMLCALL; XMLPUBFUN;
+{$ENDIF}
 
-#endif (* LIBXML_OUTPUT_ENABLED *)
-#endif (* LIBXML_C14N_ENABLED *)
-#endif (* __XML_C14N_H__ *)
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+{$ENDIF} (* LIBXML_C14N_ENABLED *)
 

+ 143 - 113
packages/libxml/src/globals.inc

@@ -94,7 +94,6 @@ function xmlThrDefDeregisterNodeDefault(func: xmlRegisterNodeFunc): xmlDeregiste
 function xmlDeregisterNodeDefault(func: xmlOutputBufferCreateFilenameFunc): xmlOutputBufferCreateFilenameFunc; XMLCALL; XMLPUBFUN;
 function xmlThrDefDeregisterNodeDefault(func: xmlParserInputBufferCreateFilenameFunc): xmlParserInputBufferCreateFilenameFunc; XMLCALL; XMLPUBFUN;
 
-{$IFDEF 0}
 (** DOC_DISABLE *)
 (*
  * In general the memory allocation entry points are not kept
@@ -108,71 +107,80 @@ function xmlThrDefDeregisterNodeDefault(func: xmlParserInputBufferCreateFilename
 
 {$IFDEF LIBXML_THREAD_ALLOC_ENABLED}
 {$IFDEF LIBXML_THREAD_ENABLED}
-XMLPUBFUN  xmlMallocFunc * XMLCALL __xmlMalloc(void);
-#define xmlMalloc ( *(__xmlMalloc()))
+function __xmlMalloc: xmlMallocFuncPtr; XMLCALL; XMLPUBFUN;
+{$DEFINE xmlMalloc := __xmlMalloc()^ }
 {$ELSE}
-XMLPUBVAR xmlMallocFunc xmlMalloc;
+var
+  xmlMalloc: xmlMallocFunc; XMLPUBVAR;
 {$ENDIF}
 
 {$IFDEF LIBXML_THREAD_ENABLED}
-XMLPUBFUN  xmlMallocFunc * XMLCALL __xmlMallocAtomic(void);
+function __xmlMallocAtomic: xmlMallocFuncPtr; XMLCALL; XMLPUBFUN;
 #define xmlMallocAtomic ( *(__xmlMallocAtomic()))
 {$ELSE}
-XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
+var
+  xmlMallocAtomic: xmlMallocFunc; XMLPUBVAR;
 {$ENDIF}
 
 {$IFDEF LIBXML_THREAD_ENABLED}
-XMLPUBFUN  xmlReallocFunc * XMLCALL __xmlRealloc(void);
+function __xmlRealloc: xmlReallocFuncPtr; XMLCALL; XMLPUBFUN;
 #define xmlRealloc ( *(__xmlRealloc()))
 {$ELSE}
-XMLPUBVAR xmlReallocFunc xmlRealloc;
+var
+  xmlRealloc: xmlReallocFunc; XMLPUBVAR;
 {$ENDIF}
 
 {$IFDEF LIBXML_THREAD_ENABLED}
-XMLPUBFUN  xmlFreeFunc * XMLCALL __xmlFree(void);
+function __xmlFree: xmlFreeFuncPtr; XMLCALL; XMLPUBFUN;
 #define xmlFree ( *(__xmlFree()))
 {$ELSE}
-XMLPUBVAR xmlFreeFunc xmlFree;
+var
+  xmlFree: xmlFreeFunc; XMLPUBVAR;
 {$ENDIF}
 
 {$IFDEF LIBXML_THREAD_ENABLED}
-XMLPUBFUN  xmlStrdupFunc * XMLCALL __xmlMemStrdup(void);
+function __xmlMemStrdup: xmlStrdupFuncPtr; XMLCALL; XMLPUBFUN;
 #define xmlMemStrdup ( *(__xmlMemStrdup()))
 {$ELSE}
-XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
+var
+  xmlMemStrdup: xmlStrdupFunc; XMLPUBVAR;
 {$ENDIF}
 
 {$ELSE} (* !LIBXML_THREAD_ALLOC_ENABLED *)
-XMLPUBVAR xmlMallocFunc xmlMalloc;
-XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
-XMLPUBVAR xmlReallocFunc xmlRealloc;
-XMLPUBVAR xmlFreeFunc xmlFree;
-XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
+var
+  xmlMalloc: xmlMallocFunc; XMLPUBVAR;
+  xmlMallocAtomic: xmlMallocFunc; XMLPUBVAR;
+  xmlRealloc: xmlReallocFunc; XMLPUBVAR;
+  xmlFree: xmlFreeFunc; XMLPUBVAR;
+  xmlMemStrdup: xmlStrdupFunc; XMLPUBVAR;
 {$ENDIF} (* LIBXML_THREAD_ALLOC_ENABLED *)
 
 {$IFDEF LIBXML_DOCB_ENABLED}
-XMLPUBFUN  xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void);
+function __docbDefaultSAXHandler: xmlSAXHandlerV1Ptr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define docbDefaultSAXHandler ( *(__docbDefaultSAXHandler()))
+{$DEFINE docbDefaultSAXHandler := __docbDefaultSAXHandler()^ }
 {$ELSE}
-XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler;
+var
+  docbDefaultSAXHandler: xmlSAXHandlerV1; XMLPUBVAR;
 {$ENDIF}
 {$ENDIF}
 
 {$IFDEF LIBXML_HTML_ENABLED}
-XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void);
+function __htmlDefaultSAXHandler: xmlSAXHandlerV1Ptr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define htmlDefaultSAXHandler ( *(__htmlDefaultSAXHandler()))
+{$DEFINE htmlDefaultSAXHandler := __htmlDefaultSAXHandler()^ }
 {$ELSE}
-XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler;
+var
+  htmlDefaultSAXHandler: xmlSAXHandlerV1; XMLPUBVAR;
 {$ENDIF}
 {$ENDIF}
 
-XMLPUBFUN xmlError * XMLCALL __xmlLastError(void);
+function __xmlLastError: xmlErrorPtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlLastError ( *(__xmlLastError()))
+{$DEFINE xmlLastError := __xmlLastError()^ }
 {$ELSE}
-XMLPUBVAR xmlError xmlLastError;
+var
+  xmlLastError: xmlError; XMLPUBVAR;
 {$ENDIF}
 
 (*
@@ -181,187 +189,209 @@ XMLPUBVAR xmlError xmlLastError;
  * Do not modify the previous line.
  *)
 
-
-XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void);
+function __oldXMLWDcompatibility: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define oldXMLWDcompatibility ( *(__oldXMLWDcompatibility()))
+{$DEFINE oldXMLWDcompatibility := __oldXMLWDcompatibility()^ }
 {$ELSE}
-XMLPUBVAR int oldXMLWDcompatibility;
+var
+  oldXMLWDcompatibility: cint; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void);
+function __xmlBufferAllocScheme: xmlBufferAllocationSchemePtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlBufferAllocScheme ( *(__xmlBufferAllocScheme()))
+{$DEFINE xmlBufferAllocScheme := __xmlBufferAllocScheme()^ }
 {$ELSE}
-XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
+var
+  xmlBufferAllocScheme: xmlBufferAllocationScheme; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
+function xmlThrDefBufferAllocScheme(v: xmlBufferAllocationScheme): xmlBufferAllocationScheme; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void);
+function __xmlDefaultBufferSize: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlDefaultBufferSize ( *(__xmlDefaultBufferSize()))
+{$DEFINE xmlDefaultBufferSize := __xmlDefaultBufferSize()^ }
 {$ELSE}
-XMLPUBVAR int xmlDefaultBufferSize;
+var
+  xmlDefaultBufferSize: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v);
+function xmlThrDefDefaultBufferSize(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void);
+function __xmlDefaultSAXHandler: xmlSAXHandlerV1Ptr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlDefaultSAXHandler ( *(__xmlDefaultSAXHandler()))
+{$DEFINE xmlDefaultSAXHandler := __xmlDefaultSAXHandler()^ }
 {$ELSE}
-XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler;
+var
+  xmlDefaultSAXHandler: xmlSAXHandlerV1; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void);
+function __xmlDefaultSAXLocator: xmlSAXLocatorPtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlDefaultSAXLocator ( *(__xmlDefaultSAXLocator()))
+{$DEFINE xmlDefaultSAXLocator := __xmlDefaultSAXLocator()^ }
 {$ELSE}
-XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator;
+var
+  xmlDefaultSAXLocator: xmlSAXLocator; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void);
+function __xmlDoValidityCheckingDefaultValue: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlDoValidityCheckingDefaultValue ( *(__xmlDoValidityCheckingDefaultValue()))
+{$DEFINE xmlDoValidityCheckingDefaultValue := __xmlDoValidityCheckingDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR int xmlDoValidityCheckingDefaultValue;
+var
+  xmlDoValidityCheckingDefaultValue: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v);
+function xmlThrDefDoValidityCheckingDefaultValue(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void);
+function __xmlGenericError: xmlGenericErrorFuncPtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlGenericError ( *(__xmlGenericError()))
+{$DEFINE xmlGenericError := __xmlGenericError()^ }
 {$ELSE}
-XMLPUBVAR xmlGenericErrorFunc xmlGenericError;
+var
+  xmlGenericError: xmlGenericErrorFunc; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void);
+function __xmlStructuredError: xmlStructuredErrorFuncPtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlStructuredError ( *(__xmlStructuredError()))
+{$DEFINE xmlStructuredError := __xmlStructuredError()^ }
 {$ELSE}
-XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
+var
+  xmlStructuredError: xmlStructuredErrorFunc; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
+function __xmlGenericErrorContext: ppointer; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlGenericErrorContext ( *(__xmlGenericErrorContext()))
+{$DEFINE xmlGenericErrorContext := __xmlGenericErrorContext()^ }
 {$ELSE}
-XMLPUBVAR void * xmlGenericErrorContext;
+var
+  xmlGenericErrorContext: pointer; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void);
+function __xmlGetWarningsDefaultValue: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlGetWarningsDefaultValue ( *(__xmlGetWarningsDefaultValue()))
+{$DEFINE xmlGetWarningsDefaultValue := __xmlGetWarningsDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR int xmlGetWarningsDefaultValue;
+var
+  xmlGetWarningsDefaultValue: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v);
+function xmlThrDefGetWarningsDefaultValue(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void);
+function __xmlIndentTreeOutput: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlIndentTreeOutput ( *(__xmlIndentTreeOutput()))
+{$DEFINE xmlIndentTreeOutput := __xmlIndentTreeOutput()^ }
 {$ELSE}
-XMLPUBVAR int xmlIndentTreeOutput;
+var
+  xmlIndentTreeOutput: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v);
+function xmlThrDefIndentTreeOutput(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN char * * XMLCALL __xmlTreeIndentString(void);
+function __xmlTreeIndentString: ppchar; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlTreeIndentString ( *(__xmlTreeIndentString()))
+{$DEFINE xmlTreeIndentString := __xmlTreeIndentString()^ }
 {$ELSE}
-XMLPUBVAR char * xmlTreeIndentString;
+var
+  xmlTreeIndentString: pchar; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN char * XMLCALL xmlThrDefTreeIndentString(char * v);
+function xmlThrDefTreeIndentString(v: pchar): pchar; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void);
+function __xmlKeepBlanksDefaultValue: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlKeepBlanksDefaultValue ( *(__xmlKeepBlanksDefaultValue()))
+{$DEFINE xmlKeepBlanksDefaultValue := __xmlKeepBlanksDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR int xmlKeepBlanksDefaultValue;
+var
+  xmlKeepBlanksDefaultValue: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v);
+function xmlThrDefKeepBlanksDefaultValue(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void);
+function __xmlLineNumbersDefaultValue: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlLineNumbersDefaultValue ( *(__xmlLineNumbersDefaultValue()))
+{$DEFINE xmlLineNumbersDefaultValue := __xmlLineNumbersDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR int xmlLineNumbersDefaultValue;
+var
+  xmlLineNumbersDefaultValue: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v);
+function xmlThrDefLineNumbersDefaultValue(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void);
+function __xmlLoadExtDtdDefaultValue: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlLoadExtDtdDefaultValue ( *(__xmlLoadExtDtdDefaultValue()))
+{$DEFINE xmlLoadExtDtdDefaultValue := __xmlLoadExtDtdDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR int xmlLoadExtDtdDefaultValue;
+var
+  xmlLoadExtDtdDefaultValue: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v);
+function xmlThrDefLoadExtDtdDefaultValue(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void);
+function __xmlParserDebugEntities: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlParserDebugEntities ( *(__xmlParserDebugEntities()))
+{$DEFINE xmlParserDebugEntities := __xmlParserDebugEntities()^ }
 {$ELSE}
-XMLPUBVAR int xmlParserDebugEntities;
+var
+  xmlParserDebugEntities: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v);
+function xmlThrDefParserDebugEntities(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN char * * XMLCALL __xmlParserVersion(void);
+function __xmlParserVersion: ppchar; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlParserVersion ( *(__xmlParserVersion()))
+{$DEFINE xmlParserVersion := __xmlParserVersion()^ }
 {$ELSE}
-XMLPUBVAR char * xmlParserVersion;
+var
+  xmlParserVersion: pchar; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void);
+function __xmlPedanticParserDefaultValue: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlPedanticParserDefaultValue ( *(__xmlPedanticParserDefaultValue()))
+{$DEFINE xmlPedanticParserDefaultValue := __xmlPedanticParserDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR int xmlPedanticParserDefaultValue;
+var
+  xmlPedanticParserDefaultValue: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v);
+function xmlThrDefPedanticParserDefaultValue(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void);
+function __xmlSaveNoEmptyTags: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlSaveNoEmptyTags ( *(__xmlSaveNoEmptyTags()))
+{$DEFINE xmlSaveNoEmptyTags := __xmlSaveNoEmptyTags()^ }
 {$ELSE}
-XMLPUBVAR int xmlSaveNoEmptyTags;
+var
+  xmlSaveNoEmptyTags: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v);
+function xmlThrDefSaveNoEmptyTags(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void);
+function __xmlSubstituteEntitiesDefaultValue: pcint; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlSubstituteEntitiesDefaultValue ( *(__xmlSubstituteEntitiesDefaultValue()))
+{$DEFINE xmlSubstituteEntitiesDefaultValue := __xmlSubstituteEntitiesDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR int xmlSubstituteEntitiesDefaultValue;
+var
+  xmlSubstituteEntitiesDefaultValue: cint; XMLPUBVAR;
 {$ENDIF}
-XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v);
+function xmlThrDefSubstituteEntitiesDefaultValue(v: cint): cint; XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void);
+function __xmlRegisterNodeDefaultValue: xmlRegisterNodeFuncPtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlRegisterNodeDefaultValue ( *(__xmlRegisterNodeDefaultValue()))
+{$DEFINE xmlRegisterNodeDefaultValue := __xmlRegisterNodeDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
+var
+  xmlRegisterNodeDefaultValue: xmlRegisterNodeFunc; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void);
+function __xmlDeregisterNodeDefaultValue: xmlDeregisterNodeFuncPtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlDeregisterNodeDefaultValue ( *(__xmlDeregisterNodeDefaultValue()))
+{$DEFINE xmlDeregisterNodeDefaultValue := __xmlDeregisterNodeDefaultValue()^ }
 {$ELSE}
-XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
+var
+  xmlDeregisterNodeDefaultValue: xmlDeregisterNodeFunc; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL __xmlParserInputBufferCreateFilenameValue(void);
+function __xmlParserInputBufferCreateFilenameValue: xmlParserInputBufferCreateFilenameFuncPtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlParserInputBufferCreateFilenameValue ( *(__xmlParserInputBufferCreateFilenameValue()))
+{$DEFINE xmlParserInputBufferCreateFilenameValue := __xmlParserInputBufferCreateFilenameValue()^ }
 {$ELSE}
-XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
+var
+  xmlParserInputBufferCreateFilenameValue: xmlParserInputBufferCreateFilenameFunc; XMLPUBVAR;
 {$ENDIF}
 
-XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void);
+function __xmlOutputBufferCreateFilenameValue: xmlOutputBufferCreateFilenameFuncPtr; XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_THREAD_ENABLED}
-#define xmlOutputBufferCreateFilenameValue ( *(__xmlOutputBufferCreateFilenameValue()))
+{$DEFINE xmlOutputBufferCreateFilenameValue := __xmlOutputBufferCreateFilenameValue()^ }
 {$ELSE}
-XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
+var
+  xmlOutputBufferCreateFilenameValue: xmlOutputBufferCreateFilenameFunc; XMLPUBVAR;
 {$ENDIF}
-{$ENDIF} (* 0 *)
 
 {$ENDIF}

+ 58 - 34
packages/libxml/src/libxml2.pas

@@ -3,6 +3,9 @@ unit libxml2;
 {$mode objfpc}
 {$macro on}
 
+{$ALIGN 8}
+{$MINENUMSIZE 4}
+
 interface
 
 uses
@@ -30,6 +33,7 @@ const
 
 type
   iconv_t = pointer;
+  PFILE = pointer;
   va_list = pointer;
   size_t = {$IF Sizeof(pointer) = 8}qword{$ELSE}longword{$IFEND};
 
@@ -48,6 +52,10 @@ type
 
 // globals.inc
   xmlGlobalStatePtr = ^xmlGlobalState;
+  xmlRegisterNodeFuncPtr = ^xmlRegisterNodeFunc;
+  xmlDeregisterNodeFuncPtr = ^xmlDeregisterNodeFunc;
+  xmlParserInputBufferCreateFilenameFuncPtr = ^xmlParserInputBufferCreateFilenameFunc;
+  xmlOutputBufferCreateFilenameFuncPtr = ^xmlOutputBufferCreateFilenameFunc;
 
 // hash.inc
   xmlHashTablePtr = ^xmlHashTable;
@@ -62,6 +70,26 @@ type
   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;
@@ -78,11 +106,16 @@ type
   xmlRefPtr = ^xmlRef;
   xmlDocPtr = ^xmlDoc;
   xmlDOMWrapCtxtPtr = ^xmlDOMWrapCtxt;
+  xmlBufferAllocationSchemePtr = ^xmlBufferAllocationScheme;
 
 // list.inc
   xmlLinkPtr = ^xmlLink;
   xmlListPtr = ^xmlList;
 
+// threads.inc
+  xmlMutexPtr = ^xmlMutex;
+  xmlRMutexPtr = ^xmlRMutex;
+
 // uri.inc
   xmlURIPtr = ^xmlURI;
 
@@ -106,6 +139,8 @@ type
 
 // xmlerror.inc
   xmlErrorPtr = ^xmlError;
+  xmlGenericErrorFuncPtr = ^xmlGenericErrorFunc;
+  xmlStructuredErrorFuncPtr = ^xmlStructuredErrorFunc;
 
 // xmlIO.inc
   xmlParserInputBufferPtr = ^xmlParserInputBuffer;
@@ -138,6 +173,10 @@ type
 // xmlwriter.inc
   xmlTextWriterPtr = ^xmlTextWriter;
 
+// xpath.inc
+  xmlNodeSetPtr = ^xmlNodeSet;
+  xmlNodeSet = record end;
+
 (*
   include types
 *)
@@ -150,9 +189,11 @@ type
   {$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}
@@ -168,40 +209,9 @@ type
   {$i xmlunicode.inc}
   {$i xmlwriter.inc}
   {.$i xpath.inc}
-  {.$i c14n.inc}
+  {$i c14n.inc}
 {$UNDEF TYPE}
 
-const
-{$DEFINE CONST}
-  {$i dict.inc}
-  {$i encoding.inc}
-  {$i tree.inc}
-  {$i list.inc}
-  {$i entities.inc}
-  {$i xmlerror.inc}
-  {$i xmlmemory.inc}
-  {$i schemasInternals.inc}
-  {$i hash.inc}
-  {$i valid.inc}
-  {$i parser.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
 *)
@@ -213,10 +223,12 @@ const
   {$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}
@@ -232,7 +244,7 @@ const
   {$i xmlunicode.inc}
   {$i xmlwriter.inc}
   {.$i xpath.inc}
-  {.$i c14n.inc}
+  {$i c14n.inc}
 {$UNDEF FUNCTION}
 
 implementation
@@ -253,6 +265,17 @@ begin
   ReallocMem(Result, size);
 end;
 
+procedure fpcxmlGenericErrorHandler(ctx: pointer; msg: pchar; args: array of const); XMLCDECL;
+begin
+  writeln(msg);
+end;
+
+procedure fpcxmlStructuredErrorHandler(userData: pointer; error: xmlErrorPtr); XMLCALL;
+begin
+  writeln('struct error');
+end;
+
+
 initialization
 (*
  * this initialize the library and check potential ABI mismatches
@@ -269,7 +292,8 @@ initialization
 (*
  * overloading the error functions
  *)
-  //xmlSetGenericErrorFunc(nil, @fpcxmlErrorHandler);
+  xmlSetGenericErrorFunc(nil, @fpcxmlGenericErrorHandler);
+  xmlSetStructuredErrorFunc(nil, @fpcxmlStructuredErrorHandler);
 
 finalization
 (*

+ 33 - 35
packages/libxml/src/parser.inc

@@ -63,7 +63,7 @@
  * xmlParserNodeInfo:
  *
  * The parser can be asked to collect Node informations, i.e. at what
- * place in the file they were detected. 
+ * place in the file they were detected.
  * NOTE: This is off by default and not very well tested.
  *)
   xmlParserNodeInfo = record
@@ -365,8 +365,8 @@
 (**
  * entityDeclSAXFunc:
  * @ctx:  the user data (XML parser context)
- * @name:  the entity name 
- * @type:  the entity type 
+ * @name:  the entity name
+ * @type:  the entity type
  * @publicId: The public ID of the entity
  * @systemId: The system ID of the entity
  * @content: the entity value (without processing).
@@ -390,8 +390,8 @@
  * attributeDeclSAXFunc:
  * @ctx:  the user data (XML parser context)
  * @elem:  the name of the element
- * @fullname:  the attribute name 
- * @type:  the attribute type 
+ * @fullname:  the attribute name
+ * @type:  the attribute type
  * @def:  the type of default value
  * @defaultValue: the attribute default value
  * @tree:  the tree of enumerated value set
@@ -403,8 +403,8 @@
 (**
  * elementDeclSAXFunc:
  * @ctx:  the user data (XML parser context)
- * @name:  the element name 
- * @type:  the element type 
+ * @name:  the element name
+ * @type:  the element type
  * @content: the element value tree
  *
  * An element definition has been parsed.
@@ -486,7 +486,7 @@
  * @ctx:  the user data (XML parser context)
  * @name:  The entity name
  *
- * Called when an entity reference is detected. 
+ * Called when an entity reference is detected.
  *)
   referenceSAXFunc = procedure(ctx: pointer; name: xmlCharPtr); XMLCALL;
 
@@ -545,7 +545,7 @@
  * @ctx:  an XML parser context
  * @msg:  the message to display/transmit
  * @...:  extra parameters for the message display
- * 
+ *
  * Display and format a warning messages, callback.
  *)
   warningSAXFunc = procedure(ctx: pointer; msg: pchar; args: array of const); XMLCDECL;
@@ -555,7 +555,7 @@
  * @ctx:  an XML parser context
  * @msg:  the message to display/transmit
  * @...:  extra parameters for the message display
- * 
+ *
  * Display and format an error messages, callback.
  *)
   errorSAXFunc = procedure(ctx: pointer; msg: pchar; args: array of const); XMLCDECL;
@@ -565,7 +565,7 @@
  * @ctx:  an XML parser context
  * @msg:  the message to display/transmit
  * @...:  extra parameters for the message display
- * 
+ *
  * Display and format fatal error messages, callback.
  * Note: so far fatalError() SAX callbacks are not used, error()
  *       get all the callbacks for errors.
@@ -723,7 +723,7 @@
  * xmlExternalEntityLoader:
  * @URL: The System ID of the resource requested
  * @ID: The Public ID of the resource requested
- * @context: the XML parser context 
+ * @context: the XML parser context
  *
  * External entity loaders types.
  *
@@ -738,30 +738,28 @@
  * to the xmlReadDoc() and similar calls.
  *)
   xmlParserOption = type cint;
-{$ENDIF}
-{$IFDEF CONST}
-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
+
+{$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
                                    the tree allowed afterwards (will possibly
            crash if you try to modify the tree) *)
-{$ENDIF}
-{$IFDEF TYPE}
+
+
   xmlFeature = (
     XML_WITH_THREAD = 1,
     XML_WITH_TREE = 2,
@@ -828,7 +826,7 @@ function xmlLineNumbersDefault(val: cint): cint; XMLCALL; XMLPUBFUN;
 
 {$IFDEF LIBXML_SAX1_ENABLED}
 (*
- * Recovery mode 
+ * Recovery mode
  *)
 function xmlRecoverDoc(cur: xmlCharPtr): xmlDocPtr; XMLCALL; XMLPUBFUN;
 function xmlRecoverMemory(buffer: pchar; size: cint): xmlDocPtr; XMLCALL; XMLPUBFUN;

+ 31 - 73
packages/libxml/src/pattern.inc

@@ -8,26 +8,17 @@
  * Author: Daniel Veillard
  *)
 
-#ifndef __XML_PATTERN_H__
-#define __XML_PATTERN_H__
-
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/dict.h>
-
-{ LIBXML_PATTERN_ENABLED
-
-{ __cplusplus
-extern "C" {
-#endif
+{$IFDEF LIBXML_PATTERN_ENABLED}
 
+{$IFDEF TYPE}
 (**
  * xmlPattern:
  *
  * A compiled (XPath based) pattern to select nodes
  *)
-typedef struct _xmlPattern xmlPattern;
-typedef xmlPattern *xmlPatternPtr;
+  xmlPattern = record end;
+
+  xmlStreamCtxt = record end;
 
 (**
  * xmlPatternFlags:
@@ -36,65 +27,32 @@ typedef xmlPattern *xmlPatternPtr;
  * matching with this module
  *
  *)
-typedef enum {
+  xmlPatternFlags = (
     XML_PATTERN_DEFAULT		= 0,	(* simple pattern match *)
-    XML_PATTERN_XPATH		= 1<<0,	(* standard XPath pattern *)
-    XML_PATTERN_XSSEL		= 1<<1,	(* XPath subset for schema selector *)
-    XML_PATTERN_XSFIELD		= 1<<2	(* XPath subset for schema field *)
-} xmlPatternFlags;
-
-XMLPUBFUN void XMLCALL
-			xmlFreePattern		(xmlPatternPtr comp);
-
-XMLPUBFUN void XMLCALL
-			xmlFreePatternList	(xmlPatternPtr comp);
-
-XMLPUBFUN xmlPatternPtr XMLCALL
-			xmlPatterncompile	(xmlChar *pattern,
-						 xmlDict *dict,
-						 int flags,
-						 xmlChar **namespaces);
-XMLPUBFUN int XMLCALL
-			xmlPatternMatch		(xmlPatternPtr comp,
-						 xmlNodePtr node);
+    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}
+
+{$IFDEF FUNCTION}
+procedure xmlFreePattern(comp: xmlPatternPtr); XMLCALL; XMLPUBFUN;
+procedure xmlFreePatternList(comp: xmlPatternPtr); XMLCALL; XMLPUBFUN;
+function xmlPatterncompile(pattern: xmlCharPtr; dict: xmlDictPtr; flags: cint; namespaces: xmlCharPtrPtr): xmlPatternPtr; XMLCALL; XMLPUBFUN;
+function xmlPatternMatch(comp: xmlPatternPtr; node: xmlNodePtr): cint; XMLCALL; XMLPUBFUN;
 
 (* streaming interfaces *)
-typedef struct _xmlStreamCtxt xmlStreamCtxt;
-typedef xmlStreamCtxt *xmlStreamCtxtPtr;
-
-XMLPUBFUN int XMLCALL
-			xmlPatternStreamable	(xmlPatternPtr comp);
-XMLPUBFUN int XMLCALL
-			xmlPatternMaxDepth	(xmlPatternPtr comp);
-XMLPUBFUN int XMLCALL
-			xmlPatternMinDepth	(xmlPatternPtr comp);
-XMLPUBFUN int XMLCALL
-			xmlPatternFromRoot	(xmlPatternPtr comp);
-XMLPUBFUN xmlStreamCtxtPtr XMLCALL
-			xmlPatternGetStreamCtxt	(xmlPatternPtr comp);
-XMLPUBFUN void XMLCALL
-			xmlFreeStreamCtxt	(xmlStreamCtxtPtr stream);
-XMLPUBFUN int XMLCALL
-			xmlStreamPushNode	(xmlStreamCtxtPtr stream,
-						 xmlChar *name,
-						 xmlChar *ns,
-						 int nodeType);
-XMLPUBFUN int XMLCALL
-			xmlStreamPush		(xmlStreamCtxtPtr stream,
-						 xmlChar *name,
-						 xmlChar *ns);
-XMLPUBFUN int XMLCALL
-			xmlStreamPushAttr	(xmlStreamCtxtPtr stream,
-						 xmlChar *name,
-						 xmlChar *ns);
-XMLPUBFUN int XMLCALL
-			xmlStreamPop		(xmlStreamCtxtPtr stream);
-XMLPUBFUN int XMLCALL
-			xmlStreamWantsAnyNode	(xmlStreamCtxtPtr stream);
-{ __cplusplus
-}
-#endif
-
-#endif (* LIBXML_PATTERN_ENABLED *)
-
-#endif (* __XML_PATTERN_H__ *)
+function xmlPatternStreamable(comp: xmlPatternPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlPatternMaxDepth(comp: xmlPatternPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlPatternMinDepth(comp: xmlPatternPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlPatternFromRoot(comp: xmlPatternPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlPatternGetStreamCtxt(comp: xmlPatternPtr): xmlStreamCtxtPtr; XMLCALL; XMLPUBFUN;
+procedure xmlFreeStreamCtxt(stream: xmlStreamCtxtPtr); XMLCALL; XMLPUBFUN;
+function xmlStreamPushNode(stream: xmlStreamCtxtPtr; name, ns: xmlCharPtr; nodeType: cint): cint; XMLCALL; XMLPUBFUN;
+function xmlStreamPush(stream: xmlStreamCtxtPtr; name, ns: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlStreamPushAttr(stream: xmlStreamCtxtPtr; name, ns: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlStreamPop(stream: xmlStreamCtxtPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlStreamWantsAnyNode(stream: xmlStreamCtxtPtr): cint; XMLCALL; XMLPUBFUN;
+{$ENDIF}
+
+{$ENDIF} (* LIBXML_PATTERN_ENABLED *)

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

@@ -102,12 +102,8 @@ procedure xmlRelaxNGSetParserStructuredErrors(ctxt: xmlRelaxNGParserCtxtPtr; ser
 function xmlRelaxNGParse(ctxt: xmlRelaxNGParserCtxtPtr): xmlRelaxNGPtr; XMLCALL; XMLPUBFUN;
 procedure xmlRelaxNGFree(schema: xmlRelaxNGPtr); XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_OUTPUT_ENABLED}
-{XMLPUBFUN void XMLCALL
-		    xmlRelaxNGDump		(FILE *output,
-					 xmlRelaxNGPtr schema);
-XMLPUBFUN void XMLCALL
-		    xmlRelaxNGDumpTree	(FILE * output,
-					 xmlRelaxNGPtr schema);}
+procedure xmlRelaxNGDump(output: PFILE; schema: xmlRelaxNGPtr); XMLCALL; XMLPUBFUN;
+procedure xmlRelaxNGDumpTree(output: PFILE; schema: xmlRelaxNGPtr); XMLCALL; XMLPUBFUN;
 {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
 
 (*

+ 279 - 306
packages/libxml/src/schemasInternals.inc

@@ -12,8 +12,10 @@
 
 {$IFDEF LIBXML_SCHEMAS_ENABLED}
 
-{$IFDEF TYPE_}
-typedef enum {
+{$IFDEF TYPE}
+  xmlSchemaVal = record end;
+
+  xmlSchemaValType = (
     XML_SCHEMAS_UNKNOWN = 0,
     XML_SCHEMAS_STRING,
     XML_SCHEMAS_NORMSTRING,
@@ -61,12 +63,12 @@ typedef enum {
     XML_SCHEMAS_BASE64BINARY,
     XML_SCHEMAS_ANYTYPE,
     XML_SCHEMAS_ANYSIMPLETYPE
-} xmlSchemaValType;
+  );
 
 (*
  * XML Schemas defines multiple type of types.
  *)
-typedef enum {
+  xmlSchemaTypeType = (
     XML_SCHEMA_TYPE_BASIC = 1, (* A built-in datatype *)
     XML_SCHEMA_TYPE_ANY,
     XML_SCHEMA_TYPE_FACET,
@@ -91,8 +93,8 @@ typedef enum {
     XML_SCHEMA_TYPE_IDC_UNIQUE,
     XML_SCHEMA_TYPE_IDC_KEY,
     XML_SCHEMA_TYPE_IDC_KEYREF,
-    XML_SCHEMA_TYPE_PARTICLE = 25, 
-    XML_SCHEMA_TYPE_ATTRIBUTE_USE, 
+    XML_SCHEMA_TYPE_PARTICLE = 25,
+    XML_SCHEMA_TYPE_ATTRIBUTE_USE,
     XML_SCHEMA_FACET_MININCLUSIVE = 1000,
     XML_SCHEMA_FACET_MINEXCLUSIVE,
     XML_SCHEMA_FACET_MAXINCLUSIVE,
@@ -107,9 +109,9 @@ typedef enum {
     XML_SCHEMA_FACET_MINLENGTH,
     XML_SCHEMA_EXTRA_QNAMEREF = 2000,
     XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
-} xmlSchemaTypeType;
+  );
 
-typedef enum {
+  xmlSchemaContentType = (
     XML_SCHEMA_CONTENT_UNKNOWN = 0,
     XML_SCHEMA_CONTENT_EMPTY = 1,
     XML_SCHEMA_CONTENT_ELEMENTS,
@@ -118,26 +120,15 @@ typedef enum {
     XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, (* Obsolete *)
     XML_SCHEMA_CONTENT_BASIC,
     XML_SCHEMA_CONTENT_ANY
-} xmlSchemaContentType;
-
-typedef struct _xmlSchemaVal xmlSchemaVal;
-typedef xmlSchemaVal *xmlSchemaValPtr;
-
-typedef struct _xmlSchemaType xmlSchemaType;
-typedef xmlSchemaType *xmlSchemaTypePtr;
-
-typedef struct _xmlSchemaFacet xmlSchemaFacet;
-typedef xmlSchemaFacet *xmlSchemaFacetPtr;
+  );
 
 (**
  * Annotation
  *)
-typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
-typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
-struct _xmlSchemaAnnot {
-    struct _xmlSchemaAnnot *next;
-    xmlNodePtr content;         (* the annotation *)
-};
+  xmlSchemaAnnot = record
+    next    : xmlSchemaAnnotPtr;
+    content : xmlNodePtr; (* the annotation *)
+  end;
 
 (**
  * XML_SCHEMAS_ANYATTR_SKIP:
@@ -145,197 +136,189 @@ struct _xmlSchemaAnnot {
  * Skip unknown attribute from validation
  * Obsolete, not used anymore.
  *)
-#define XML_SCHEMAS_ANYATTR_SKIP        1
+{$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
+{$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
+{$DEFINE XML_SCHEMAS_ANYATTR_STRICT :=       3}
 (**
  * XML_SCHEMAS_ANY_SKIP:
  *
  * Skip unknown attribute from validation
  *)
-#define XML_SCHEMAS_ANY_SKIP        1
+{$DEFINE XML_SCHEMAS_ANY_SKIP :=       1}
 (**
  * XML_SCHEMAS_ANY_LAX:
  *
  * Used by wildcards.
  * Validate if type found, don't worry if not found
  *)
-#define XML_SCHEMAS_ANY_LAX                2
+{$DEFINE XML_SCHEMAS_ANY_LAX :=               2}
 (**
  * XML_SCHEMAS_ANY_STRICT:
  *
  * Used by wildcards.
  * Apply strict validation rules
  *)
-#define XML_SCHEMAS_ANY_STRICT        3
+{$DEFINE XML_SCHEMAS_ANY_STRICT :=       3}
 (**
  * XML_SCHEMAS_ATTR_USE_PROHIBITED:
  *
  * Used by wildcards.
  * The attribute is prohibited.
  *)
-#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
+{$DEFINE XML_SCHEMAS_ATTR_USE_PROHIBITED := 0}
 (**
  * XML_SCHEMAS_ATTR_USE_REQUIRED:
  *
  * The attribute is required.
  *)
-#define XML_SCHEMAS_ATTR_USE_REQUIRED 1
+{$DEFINE XML_SCHEMAS_ATTR_USE_REQUIRED := 1}
 (**
  * XML_SCHEMAS_ATTR_USE_OPTIONAL:
  *
  * The attribute is optional.
  *)
-#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
+{$DEFINE XML_SCHEMAS_ATTR_USE_OPTIONAL := 2}
 (**
  * XML_SCHEMAS_ATTR_GLOBAL:
  *
  * allow elements in no namespace
  *)
-#define XML_SCHEMAS_ATTR_GLOBAL        1 << 0
+{$DEFINE XML_SCHEMAS_ATTR_GLOBAL :=       (1 shl 0)}
 (**
  * XML_SCHEMAS_ATTR_NSDEFAULT:
  *
  * allow elements in no namespace
  *)
-#define XML_SCHEMAS_ATTR_NSDEFAULT        1 << 7
+{$DEFINE XML_SCHEMAS_ATTR_NSDEFAULT :=       (1 shl 7)}
 (**
  * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
  *
  * this is set when the "type" and "ref" references
  * have been resolved.
  *)
-#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED        1 << 8
+{$DEFINE XML_SCHEMAS_ATTR_INTERNAL_RESOLVED :=       (1 shl 8)}
 (**
  * XML_SCHEMAS_ATTR_FIXED:
  *
  * the attribute has a fixed value
  *)
-#define XML_SCHEMAS_ATTR_FIXED        1 << 9
+{$DEFINE XML_SCHEMAS_ATTR_FIXED     :=   (1 shl 9)}
 
 (**
  * xmlSchemaAttribute:
  * An attribute definition.
  *)
-
-typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
-typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
-struct _xmlSchemaAttribute {
-    xmlSchemaTypeType type;
-    struct _xmlSchemaAttribute *next; (* the next attribute (not used?) *)
-    xmlChar *name; (* the name of the declaration *)
-    xmlChar *id; (* Deprecated; not used *)
-    xmlChar *ref; (* Deprecated; not used *)
-    xmlChar *refNs; (* Deprecated; not used *)
-    xmlChar *typeName; (* the local name of the type definition *)
-    xmlChar *typeNs; (* the ns URI of the type definition *)
-    xmlSchemaAnnotPtr annot;
-
-    xmlSchemaTypePtr base; (* Deprecated; not used *)
-    int occurs; (* Deprecated; not used *)
-    xmlChar *defValue; (* The initial value of the value constraint *)
-    xmlSchemaTypePtr subtypes; (* the type definition *)
-    xmlNodePtr node;
-    xmlChar *targetNamespace;
-    int flags;
-    xmlChar *refPrefix; (* Deprecated; not used *)
-    xmlSchemaValPtr defVal; (* The compiled value constraint *)
-    xmlSchemaAttributePtr refDecl; (* Deprecated; not used *)
-};
+  xmlSchemaAttribute = record
+    _type           : xmlSchemaTypeType;
+    next            : xmlSchemaAttributePtr; (* the next attribute (not used?) *)
+    name            : xmlCharPtr; (* the name of the declaration *)
+    id              : xmlCharPtr; (* Deprecated; not used *)
+    ref             : xmlCharPtr; (* Deprecated; not used *)
+    refNs           : xmlCharPtr; (* Deprecated; not used *)
+    typeName        : xmlCharPtr; (* the local name of the type definition *)
+    typeNs          : xmlCharPtr; (* the ns URI of the type definition *)
+    annot           : xmlSchemaAnnotPtr;
+
+    base            : xmlSchemaTypePtr; (* Deprecated; not used *)
+    occurs          : cint; (* Deprecated; not used *)
+    defValue        : xmlCharPtr; (* The initial value of the value constraint *)
+    subtypes        : xmlSchemaTypePtr; (* the type definition *)
+    node            : xmlNodePtr;
+    targetNamespace : xmlCharPtr;
+    flags           : cint;
+    refPrefix       : xmlCharPtr; (* Deprecated; not used *)
+    defVal          : xmlSchemaValPtr; (* The compiled value constraint *)
+    refDecl         : xmlSchemaAttributePtr; (* Deprecated; not used *)
+  end;
 
 (**
  * xmlSchemaAttributeLink:
  * Used to build a list of attribute uses on complexType definitions.
  * WARNING: Deprecated; not used.
  *)
-typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;
-typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;
-struct _xmlSchemaAttributeLink {
-    struct _xmlSchemaAttributeLink *next;(* the next attribute link ... *)
-    struct _xmlSchemaAttribute *attr;(* the linked attribute *)
-};
+  xmlSchemaAttributeLink = record
+    next  : xmlSchemaAttributeLinkPtr;(* the next attribute link ... *)
+    attr  : xmlSchemaAttributePtr;(* the linked attribute *)
+  end;
 
 (**
  * XML_SCHEMAS_WILDCARD_COMPLETE:
  *
  * If the wildcard is complete.
  *)
-#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
+{$DEFINE XML_SCHEMAS_WILDCARD_COMPLETE := (1 shl 0)}
 
 (**
  * xmlSchemaCharValueLink:
  * Used to build a list of namespaces on wildcards.
  *)
-typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
-typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;
-struct _xmlSchemaWildcardNs {
-    struct _xmlSchemaWildcardNs *next;(* the next constraint link ... *)
-    xmlChar *value;(* the value *)
-};
+  xmlSchemaWildcardNs = record
+    next  : xmlSchemaWildcardNsPtr;(* the next constraint link ... *)
+    value : xmlCharPtr;(* the value *)
+  end;
 
 (**
  * xmlSchemaWildcard.
  * A wildcard.
  *)
-typedef struct _xmlSchemaWildcard xmlSchemaWildcard;
-typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;
-struct _xmlSchemaWildcard {
-    xmlSchemaTypeType type;        (* The kind of type *)
-    xmlChar *id; (* Deprecated; not used *)
-    xmlSchemaAnnotPtr annot;
-    xmlNodePtr node;
-    int minOccurs; (* Deprecated; not used *)
-    int maxOccurs; (* Deprecated; not used *)
-    int processContents;
-    int any; (* Indicates if the ns constraint is of ##any *)
-    xmlSchemaWildcardNsPtr nsSet; (* The list of allowed namespaces *)
-    xmlSchemaWildcardNsPtr negNsSet; (* The negated namespace *)
-    int flags;
-};
+  xmlSchemaWildcard = record
+    _type           : xmlSchemaTypeType;        (* The kind of type *)
+    id              : xmlCharPtr; (* Deprecated; not used *)
+    annot           : xmlSchemaAnnotPtr;
+    node            : xmlNodePtr;
+    minOccurs       : cint; (* Deprecated; not used *)
+    maxOccurs       : cint; (* Deprecated; not used *)
+    processContents : cint;
+    any             : cint; (* Indicates if the ns constraint is of ##any *)
+    nsSet           : xmlSchemaWildcardNsPtr; (* The list of allowed namespaces *)
+    negNsSet        : xmlSchemaWildcardNsPtr; (* The negated namespace *)
+    flags           : cint;
+  end;
+
 
 (**
  * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
  *
  * The attribute wildcard has been already builded.
  *)
-#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0
+{$DEFINE XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED := (1 shl 0)}
 (**
  * XML_SCHEMAS_ATTRGROUP_GLOBAL:
  *
  * The attribute wildcard has been already builded.
  *)
-#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1
+{$DEFINE XML_SCHEMAS_ATTRGROUP_GLOBAL := (1 shl 1)}
 (**
  * XML_SCHEMAS_ATTRGROUP_MARKED:
  *
  * Marks the attr group as marked; used for circular checks.
  *)
-#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2
+{$DEFINE XML_SCHEMAS_ATTRGROUP_MARKED := (1 shl 2)}
 
 (**
  * XML_SCHEMAS_ATTRGROUP_REDEFINED:
  *
  * The attr group was redefined.
  *)
-#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3
+{$DEFINE XML_SCHEMAS_ATTRGROUP_REDEFINED := (1 shl 3)}
 (**
  * XML_SCHEMAS_ATTRGROUP_HAS_REFS:
  *
  * Whether this attr. group contains attr. group references.
  *)
-#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4
+{$DEFINE XML_SCHEMAS_ATTRGROUP_HAS_REFS := (1 shl 4)}
 
 (**
  * An attribute group definition.
@@ -343,81 +326,75 @@ struct _xmlSchemaWildcard {
  * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
  * must be kept similar
  *)
-typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
-typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
-struct _xmlSchemaAttributeGroup {
-    xmlSchemaTypeType type;        (* The kind of type *)
-    struct _xmlSchemaAttribute *next;(* the next attribute if in a group ... *)
-    xmlChar *name;
-    xmlChar *id;
-    xmlChar *ref; (* Deprecated; not used *)
-    xmlChar *refNs; (* Deprecated; not used *)
-    xmlSchemaAnnotPtr annot;
-
-    xmlSchemaAttributePtr attributes; (* Deprecated; not used *)
-    xmlNodePtr node;
-    int flags;
-    xmlSchemaWildcardPtr attributeWildcard;
-    xmlChar *refPrefix; (* Deprecated; not used *)
-    xmlSchemaAttributeGroupPtr refItem; (* Deprecated; not used *)
-    xmlChar *targetNamespace;
-    void *attrUses;
-};
+  xmlSchemaAttributeGroup = record
+    _type           : xmlSchemaTypeType;        (* The kind of type *)
+    next            : xmlSchemaAttributePtr;(* the next attribute if in a group ... *)
+    name            : xmlCharPtr;
+    id              : xmlCharPtr;
+    ref             : xmlCharPtr; (* Deprecated; not used *)
+    refNs           : xmlCharPtr; (* Deprecated; not used *)
+    annot           : xmlSchemaAnnotPtr;
+
+    attributes      : xmlSchemaAttributePtr; (* Deprecated; not used *)
+    node            : xmlNodePtr;
+    flags           : cint;
+    attributeWildcard : xmlSchemaWildcardPtr;
+    refPrefix       : xmlCharPtr; (* Deprecated; not used *)
+    refItem         : xmlSchemaAttributeGroupPtr; (* Deprecated; not used *)
+    targetNamespace : xmlCharPtr;
+    attrUses        : pointer;
+  end;
 
 (**
  * xmlSchemaTypeLink:
  * Used to build a list of types (e.g. member types of
  * simpleType with variety "union").
  *)
-typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;
-typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;
-struct _xmlSchemaTypeLink {
-    struct _xmlSchemaTypeLink *next;(* the next type link ... *)
-    xmlSchemaTypePtr type;(* the linked type *)
-};
+  xmlSchemaTypeLink = record
+    next  : xmlSchemaTypeLinkPtr;(* the next type link ... *)
+    _type : xmlSchemaTypePtr;(* the linked type *)
+  end;
 
 (**
  * xmlSchemaFacetLink:
  * Used to build a list of facets.
  *)
-typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
-typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;
-struct _xmlSchemaFacetLink {
-    struct _xmlSchemaFacetLink *next;(* the next facet link ... *)
-    xmlSchemaFacetPtr facet;(* the linked facet *)
-};
+  xmlSchemaFacetLink = record
+    next  : xmlSchemaFacetLinkPtr;(* the next facet link ... *)
+    facet : xmlSchemaFacetPtr;(* the linked facet *)
+  end;
 
 (**
  * XML_SCHEMAS_TYPE_MIXED:
  *
  * the element content type is mixed
  *)
-#define XML_SCHEMAS_TYPE_MIXED                1 << 0
+{$DEFINE XML_SCHEMAS_TYPE_MIXED                := (1 shl 0)}
 (**
  * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
  *
  * the simple or complex type has a derivation method of "extension".
  *)
-#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION                1 << 1
+{$DEFINE XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION                := (1 shl 1)}
 (**
  * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
  *
  * the simple or complex type has a derivation method of "restriction".
  *)
-#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION                1 << 2
+{$DEFINE XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION                := (1 shl 2)}
 (**
  * XML_SCHEMAS_TYPE_GLOBAL:
  *
  * the type is global
  *)
-#define XML_SCHEMAS_TYPE_GLOBAL                1 << 3
+{$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 << 4 (* Obsolete. *)
+{$DEFINE XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD    := (1 shl 4)} (* Obsolete. *)
 (**
  * XML_SCHEMAS_TYPE_VARIETY_ABSENT:
  *
@@ -426,200 +403,200 @@ struct _xmlSchemaFacetLink {
  * none of the variety flags occur then it's
  * automatically absent.
  *)
-#define XML_SCHEMAS_TYPE_VARIETY_ABSENT    1 << 5
+{$DEFINE XML_SCHEMAS_TYPE_VARIETY_ABSENT    := (1 shl 5)}
 (**
  * XML_SCHEMAS_TYPE_VARIETY_LIST:
  *
  * the simpleType has a variety of "list".
  *)
-#define XML_SCHEMAS_TYPE_VARIETY_LIST    1 << 6
+{$DEFINE XML_SCHEMAS_TYPE_VARIETY_LIST    := (1 shl 6)}
 (**
  * XML_SCHEMAS_TYPE_VARIETY_UNION:
  *
  * the simpleType has a variety of "union".
  *)
-#define XML_SCHEMAS_TYPE_VARIETY_UNION    1 << 7
+{$DEFINE XML_SCHEMAS_TYPE_VARIETY_UNION    := (1 shl 7)}
 (**
  * XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
  *
  * the simpleType has a variety of "union".
  *)
-#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC    1 << 8
+{$DEFINE XML_SCHEMAS_TYPE_VARIETY_ATOMIC    := (1 shl 8)}
 (**
  * XML_SCHEMAS_TYPE_FINAL_EXTENSION:
  *
  * the complexType has a final of "extension".
  *)
-#define XML_SCHEMAS_TYPE_FINAL_EXTENSION    1 << 9
+{$DEFINE XML_SCHEMAS_TYPE_FINAL_EXTENSION    := (1 shl 9)}
 (**
  * XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
  *
  * the simpleType/complexType has a final of "restriction".
  *)
-#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION    1 << 10
+{$DEFINE XML_SCHEMAS_TYPE_FINAL_RESTRICTION    := (1 shl 10)}
 (**
  * XML_SCHEMAS_TYPE_FINAL_LIST:
  *
  * the simpleType has a final of "list".
  *)
-#define XML_SCHEMAS_TYPE_FINAL_LIST    1 << 11
+{$DEFINE XML_SCHEMAS_TYPE_FINAL_LIST    := (1 shl 11)}
 (**
  * XML_SCHEMAS_TYPE_FINAL_UNION:
  *
  * the simpleType has a final of "union".
  *)
-#define XML_SCHEMAS_TYPE_FINAL_UNION    1 << 12
+{$DEFINE XML_SCHEMAS_TYPE_FINAL_UNION    := (1 shl 12)}
 (**
  * XML_SCHEMAS_TYPE_FINAL_DEFAULT:
  *
  * the simpleType has a final of "default".
  *)
-#define XML_SCHEMAS_TYPE_FINAL_DEFAULT    1 << 13
+{$DEFINE XML_SCHEMAS_TYPE_FINAL_DEFAULT    := (1 shl 13)}
 (**
  * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
  *
  * Marks the item as a builtin primitive.
  *)
-#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE    1 << 14
+{$DEFINE XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE    := (1 shl 14)}
 (**
  * XML_SCHEMAS_TYPE_MARKED:
  *
  * Marks the item as marked; used for circular checks.
  *)
-#define XML_SCHEMAS_TYPE_MARKED        1 << 16
+{$DEFINE XML_SCHEMAS_TYPE_MARKED        := (1 shl 16)}
 (**
  * XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
  *
  * the complexType did not specify 'block' so use the default of the
  * <schema> item.
  *)
-#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT    1 << 17
+{$DEFINE XML_SCHEMAS_TYPE_BLOCK_DEFAULT    := (1 shl 17)}
 (**
  * XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
  *
  * the complexType has a 'block' of "extension".
  *)
-#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION    1 << 18
+{$DEFINE XML_SCHEMAS_TYPE_BLOCK_EXTENSION    := (1 shl 18)}
 (**
  * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
  *
  * the complexType has a 'block' of "restriction".
  *)
-#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION    1 << 19
+{$DEFINE XML_SCHEMAS_TYPE_BLOCK_RESTRICTION    := (1 shl 19)}
 (**
  * XML_SCHEMAS_TYPE_ABSTRACT:
  *
  * the simple/complexType is abstract.
  *)
-#define XML_SCHEMAS_TYPE_ABSTRACT    1 << 20
+{$DEFINE XML_SCHEMAS_TYPE_ABSTRACT    := (1 shl 20)}
 (**
  * XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
  *
  * indicates if the facets need a computed value
  *)
-#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE    1 << 21
+{$DEFINE XML_SCHEMAS_TYPE_FACETSNEEDVALUE    := (1 shl 21)}
 (**
  * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
  *
  * indicates that the type was typefixed
  *)
-#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED    1 << 22
+{$DEFINE XML_SCHEMAS_TYPE_INTERNAL_RESOLVED    := (1 shl 22)}
 (**
  * XML_SCHEMAS_TYPE_INTERNAL_INVALID:
  *
  * indicates that the type is invalid
  *)
-#define XML_SCHEMAS_TYPE_INTERNAL_INVALID    1 << 23
+{$DEFINE XML_SCHEMAS_TYPE_INTERNAL_INVALID    := (1 shl 23)}
 (**
  * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
  *
  * a whitespace-facet value of "preserve"
  *)
-#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE    1 << 24
+{$DEFINE XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE    := (1 shl 24)}
 (**
  * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
  *
  * a whitespace-facet value of "replace"
  *)
-#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE    1 << 25
+{$DEFINE XML_SCHEMAS_TYPE_WHITESPACE_REPLACE    := (1 shl 25)}
 (**
  * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
  *
  * a whitespace-facet value of "collapse"
  *)
-#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE    1 << 26
+{$DEFINE XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE    := (1 shl 26)}
 (**
  * XML_SCHEMAS_TYPE_HAS_FACETS:
  *
  * has facets
  *)
-#define XML_SCHEMAS_TYPE_HAS_FACETS    1 << 27
+{$DEFINE XML_SCHEMAS_TYPE_HAS_FACETS    := (1 shl 27)}
 (**
  * XML_SCHEMAS_TYPE_NORMVALUENEEDED:
  *
  * indicates if the facets (pattern) need a normalized value
  *)
-#define XML_SCHEMAS_TYPE_NORMVALUENEEDED    1 << 28
+{$DEFINE XML_SCHEMAS_TYPE_NORMVALUENEEDED    := (1 shl 28)}
 
 (**
  * XML_SCHEMAS_TYPE_FIXUP_1:
  *
  * First stage of fixup was done.
  *)
-#define XML_SCHEMAS_TYPE_FIXUP_1    1 << 29
+{$DEFINE XML_SCHEMAS_TYPE_FIXUP_1    := (1 shl 29)}
 
 (**
  * XML_SCHEMAS_TYPE_REDEFINED:
  *
  * The type was redefined.
  *)
-#define XML_SCHEMAS_TYPE_REDEFINED    1 << 30
+{$DEFINE XML_SCHEMAS_TYPE_REDEFINED    := (1 shl 30)}
 (**
  * XML_SCHEMAS_TYPE_REDEFINING:
  *
  * The type redefines an other type.
  *)
-(* #define XML_SCHEMAS_TYPE_REDEFINING    1 << 31 *)
+(* {$DEFINE XML_SCHEMAS_TYPE_REDEFINING    := (1 shl 31)} *)
 
 (**
  * _xmlSchemaType:
  *
  * Schemas type definition.
  *)
-struct _xmlSchemaType {
-    xmlSchemaTypeType type; (* The kind of type *)
-    struct _xmlSchemaType *next; (* the next type if in a sequence ... *)
-    xmlChar *name;
-    xmlChar *id ; (* Deprecated; not used *)
-    xmlChar *ref; (* Deprecated; not used *)
-    xmlChar *refNs; (* Deprecated; not used *)
-    xmlSchemaAnnotPtr annot;
-    xmlSchemaTypePtr subtypes;
-    xmlSchemaAttributePtr attributes; (* Deprecated; not used *)
-    xmlNodePtr node;
-    int minOccurs; (* Deprecated; not used *)
-    int maxOccurs; (* Deprecated; not used *)
-
-    int flags;
-    xmlSchemaContentType contentType;
-    xmlChar *base; (* Base type's local name *)
-    xmlChar *baseNs; (* Base type's target namespace *)
-    xmlSchemaTypePtr baseType; (* The base type component *)
-    xmlSchemaFacetPtr facets; (* Local facets *)
-    struct _xmlSchemaType *redef; (* Deprecated; not used *)
-    int recurse; (* Obsolete *)
-    xmlSchemaAttributeLinkPtr *attributeUses; (* Deprecated; not used *)
-    xmlSchemaWildcardPtr attributeWildcard;
-    int builtInType; (* Type of built-in types. *)
-    xmlSchemaTypeLinkPtr memberTypes; (* member-types if a union type. *)
-    xmlSchemaFacetLinkPtr facetSet; (* All facets (incl. inherited) *)
-    xmlChar *refPrefix; (* Deprecated; not used *)
-    xmlSchemaTypePtr contentTypeDef; (* Used for the simple content of complex types.
+  xmlSchemaType = record
+    _type             : xmlSchemaTypeType; (* The kind of type *)
+    next              : xmlSchemaTypePtr; (* the next type if in a sequence ... *)
+    name              : xmlCharPtr;
+    id                : xmlCharPtr; (* Deprecated; not used *)
+    ref               : xmlCharPtr; (* Deprecated; not used *)
+    refNs             : xmlCharPtr; (* Deprecated; not used *)
+    annot             : xmlSchemaAnnotPtr;
+    subtypes          : xmlSchemaTypePtr;
+    attributes        : xmlSchemaAttributePtr; (* Deprecated; not used *)
+    node              : xmlNodePtr;
+    minOccurs         : cint; (* Deprecated; not used *)
+    maxOccurs         : cint; (* Deprecated; not used *)
+
+    flags             : cint;
+    contentType       : xmlSchemaContentType;
+    base              : xmlCharPtr; (* Base type's local name *)
+    baseNs            : xmlCharPtr; (* Base type's target namespace *)
+    baseType          : xmlSchemaTypePtr; (* The base type component *)
+    facets            : xmlSchemaFacetPtr; (* Local facets *)
+    redef             : xmlSchemaTypePtr; (* Deprecated; not used *)
+    recurse           : cint; (* Obsolete *)
+    attributeUses     : xmlSchemaAttributeLinkPtrPtr; (* Deprecated; not used *)
+    attributeWildcard : xmlSchemaWildcardPtr;
+    builtInType       : cint; (* Type of built-in types. *)
+    memberTypes       : xmlSchemaTypeLinkPtr; (* member-types if a union type. *)
+    facetSet          : xmlSchemaFacetLinkPtr; (* All facets (incl. inherited) *)
+    refPrefix         : xmlCharPtr; (* Deprecated; not used *)
+    contentTypeDef    : xmlSchemaTypePtr; (* Used for the simple content of complex types.
                                         Could we use @subtypes for this? *)
-    xmlRegexpPtr contModel; (* Holds the automaton of the content model *)
-    xmlChar *targetNamespace;
-    void *attrUses;
-};
+    contModel         : xmlRegexpPtr; (* Holds the automaton of the content model *)
+    targetNamespace   : xmlCharPtr;
+    attrUses          : pointer;
+  end;
 
 (*
  * xmlSchemaElement:
@@ -633,205 +610,201 @@ struct _xmlSchemaType {
  *
  * the element is nillable
  *)
-#define XML_SCHEMAS_ELEM_NILLABLE        1 << 0
+{$DEFINE XML_SCHEMAS_ELEM_NILLABLE        := (1 shl 0)}
 (**
  * XML_SCHEMAS_ELEM_GLOBAL:
  *
  * the element is global
  *)
-#define XML_SCHEMAS_ELEM_GLOBAL                1 << 1
+{$DEFINE XML_SCHEMAS_ELEM_GLOBAL                := (1 shl 1)}
 (**
  * XML_SCHEMAS_ELEM_DEFAULT:
  *
  * the element has a default value
  *)
-#define XML_SCHEMAS_ELEM_DEFAULT        1 << 2
+{$DEFINE XML_SCHEMAS_ELEM_DEFAULT        := (1 shl 2)}
 (**
  * XML_SCHEMAS_ELEM_FIXED:
  *
  * the element has a fixed value
  *)
-#define XML_SCHEMAS_ELEM_FIXED                1 << 3
+{$DEFINE XML_SCHEMAS_ELEM_FIXED                := (1 shl 3)}
 (**
  * XML_SCHEMAS_ELEM_ABSTRACT:
  *
  * the element is abstract
  *)
-#define XML_SCHEMAS_ELEM_ABSTRACT        1 << 4
+{$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 << 5
+{$DEFINE XML_SCHEMAS_ELEM_TOPLEVEL        := (1 shl 5)}
 (**
  * XML_SCHEMAS_ELEM_REF:
  *
  * the element is a reference to a type
  *)
-#define XML_SCHEMAS_ELEM_REF                1 << 6
+{$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 << 7
+{$DEFINE XML_SCHEMAS_ELEM_NSDEFAULT        := (1 shl 7)}
 (**
  * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
  *
  * this is set when "type", "ref", "substitutionGroup"
  * references have been resolved.
  *)
-#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED        1 << 8
+{$DEFINE XML_SCHEMAS_ELEM_INTERNAL_RESOLVED        := (1 shl 8)}
  (**
  * XML_SCHEMAS_ELEM_CIRCULAR:
  *
  * a helper flag for the search of circular references.
  *)
-#define XML_SCHEMAS_ELEM_CIRCULAR        1 << 9
+{$DEFINE XML_SCHEMAS_ELEM_CIRCULAR        := (1 shl 9)}
 (**
  * XML_SCHEMAS_ELEM_BLOCK_ABSENT:
  *
  * the "block" attribute is absent
  *)
-#define XML_SCHEMAS_ELEM_BLOCK_ABSENT        1 << 10
+{$DEFINE XML_SCHEMAS_ELEM_BLOCK_ABSENT        := (1 shl 10)}
 (**
  * XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
  *
  * disallowed substitutions are absent
  *)
-#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION        1 << 11
+{$DEFINE XML_SCHEMAS_ELEM_BLOCK_EXTENSION        := (1 shl 11)}
 (**
  * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
  *
  * disallowed substitutions: "restriction"
  *)
-#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION        1 << 12
+{$DEFINE XML_SCHEMAS_ELEM_BLOCK_RESTRICTION        := (1 shl 12)}
 (**
  * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
  *
  * disallowed substitutions: "substituion"
  *)
-#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION        1 << 13
+{$DEFINE XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION        := (1 shl 13)}
 (**
  * XML_SCHEMAS_ELEM_FINAL_ABSENT:
  *
  * substitution group exclusions are absent
  *)
-#define XML_SCHEMAS_ELEM_FINAL_ABSENT        1 << 14
+{$DEFINE XML_SCHEMAS_ELEM_FINAL_ABSENT        := (1 shl 14)}
 (**
  * XML_SCHEMAS_ELEM_FINAL_EXTENSION:
  *
  * substitution group exclusions: "extension"
  *)
-#define XML_SCHEMAS_ELEM_FINAL_EXTENSION        1 << 15
+{$DEFINE XML_SCHEMAS_ELEM_FINAL_EXTENSION        := (1 shl 15)}
 (**
  * XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
  *
  * substitution group exclusions: "restriction"
  *)
-#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION        1 << 16
+{$DEFINE XML_SCHEMAS_ELEM_FINAL_RESTRICTION        := (1 shl 16)}
 (**
  * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
  *
  * the declaration is a substitution group head
  *)
-#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD        1 << 17
+{$DEFINE XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD        := (1 shl 17)}
 (**
  * XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
  *
  * this is set when the elem decl has been checked against
  * all constraints
  *)
-#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED        1 << 18
-
-typedef struct _xmlSchemaElement xmlSchemaElement;
-typedef xmlSchemaElement *xmlSchemaElementPtr;
-struct _xmlSchemaElement {
-    xmlSchemaTypeType type; (* The kind of type *)
-    struct _xmlSchemaType *next; (* Not used? *)
-    xmlChar *name;
-    xmlChar *id; (* Deprecated; not used *)
-    xmlChar *ref; (* Deprecated; not used *)
-    xmlChar *refNs; (* Deprecated; not used *)
-    xmlSchemaAnnotPtr annot;
-    xmlSchemaTypePtr subtypes; (* the type definition *)
-    xmlSchemaAttributePtr attributes;
-    xmlNodePtr node;
-    int minOccurs; (* Deprecated; not used *)
-    int maxOccurs; (* Deprecated; not used *)
-
-    int flags;
-    xmlChar *targetNamespace;
-    xmlChar *namedType;
-    xmlChar *namedTypeNs;
-    xmlChar *substGroup;
-    xmlChar *substGroupNs;
-    xmlChar *scope;
-    xmlChar *value; (* The original value of the value constraint. *)
-    struct _xmlSchemaElement *refDecl; (* This will now be used for the
+{$DEFINE XML_SCHEMAS_ELEM_INTERNAL_CHECKED        := (1 shl 18)}
+
+  xmlSchemaElement = record
+    _type             : xmlSchemaTypeType; (* The kind of type *)
+    next              : xmlSchemaTypePtr; (* Not used? *)
+    name              : xmlCharPtr;
+    id                : xmlCharPtr; (* Deprecated; not used *)
+    ref               : xmlCharPtr; (* Deprecated; not used *)
+    refNs             : xmlCharPtr; (* Deprecated; not used *)
+    annot             : xmlSchemaAnnotPtr;
+    subtypes          : xmlSchemaTypePtr; (* the type definition *)
+    attributes        : xmlSchemaAttributePtr;
+    node              : xmlNodePtr;
+    minOccurs         : cint; (* Deprecated; not used *)
+    maxOccurs         : cint; (* Deprecated; not used *)
+
+    flags             : cint;
+    targetNamespace   : xmlCharPtr;
+    namedType         : xmlCharPtr;
+    namedTypeNs       : xmlCharPtr;
+    substGroup        : xmlCharPtr;
+    substGroupNs      : xmlCharPtr;
+    scope             : xmlCharPtr;
+    value             : xmlCharPtr; (* The original value of the value constraint. *)
+    refDecl           : xmlSchemaElementPtr; (* This will now be used for the
                                           substitution group affiliation *)
-    xmlRegexpPtr contModel; (* Obsolete for WXS, maybe used for RelaxNG *)
-    xmlSchemaContentType contentType;
-    xmlChar *refPrefix; (* Deprecated; not used *)
-    xmlSchemaValPtr defVal; (* The compiled value contraint. *)
-    void *idcs; (* The identity-constraint defs *)
-};
+    contModel         : xmlRegexpPtr; (* Obsolete for WXS, maybe used for RelaxNG *)
+    contentType       : xmlSchemaContentType;
+    refPrefix         : xmlCharPtr; (* Deprecated; not used *)
+    defVal            : xmlSchemaValPtr; (* The compiled value contraint. *)
+    idcs              : pointer; (* The identity-constraint defs *)
+  end;
 
 (*
  * XML_SCHEMAS_FACET_UNKNOWN:
  *
  * unknown facet handling
  *)
-#define XML_SCHEMAS_FACET_UNKNOWN        0
+{$DEFINE XML_SCHEMAS_FACET_UNKNOWN        := (0)}
 (*
  * XML_SCHEMAS_FACET_PRESERVE:
  *
  * preserve the type of the facet
  *)
-#define XML_SCHEMAS_FACET_PRESERVE        1
+{$DEFINE XML_SCHEMAS_FACET_PRESERVE        := (1)}
 (*
  * XML_SCHEMAS_FACET_REPLACE:
  *
  * replace the type of the facet
  *)
-#define XML_SCHEMAS_FACET_REPLACE        2
+{$DEFINE XML_SCHEMAS_FACET_REPLACE        := (2)}
 (*
  * XML_SCHEMAS_FACET_COLLAPSE:
  *
  * collapse the types of the facet
  *)
-#define XML_SCHEMAS_FACET_COLLAPSE        3
+{$DEFINE XML_SCHEMAS_FACET_COLLAPSE        := (3)}
 (**
  * A facet definition.
  *)
-struct _xmlSchemaFacet {
-    xmlSchemaTypeType type;        (* The kind of type *)
-    struct _xmlSchemaFacet *next;(* the next type if in a sequence ... *)
-    xmlChar *value; (* The original value *)
-    xmlChar *id; (* Obsolete *)
-    xmlSchemaAnnotPtr annot;
-    xmlNodePtr node;
-    int fixed; (* XML_SCHEMAS_FACET_PRESERVE, etc. *)
-    int whitespace;
-    xmlSchemaValPtr val; (* The compiled value *)
-    xmlRegexpPtr    regexp; (* The regex for patterns *)
-};
+  xmlSchemaFacet = record
+    _type         : xmlSchemaTypeType;        (* The kind of type *)
+    next          : xmlSchemaFacetPtr;(* the next type if in a sequence ... *)
+    value         : xmlCharPtr; (* The original value *)
+    id            : xmlCharPtr; (* Obsolete *)
+    annot         : xmlSchemaAnnotPtr;
+    node          : xmlNodePtr;
+    fixed         : cint; (* XML_SCHEMAS_FACET_PRESERVE, etc. *)
+    whitespace    : cint;
+    val           : xmlSchemaValPtr; (* The compiled value *)
+    regexp        : xmlRegexpPtr; (* The regex for patterns *)
+  end;
 
 (**
  * A notation definition.
  *)
-typedef struct _xmlSchemaNotation xmlSchemaNotation;
-typedef xmlSchemaNotation *xmlSchemaNotationPtr;
-struct _xmlSchemaNotation {
-    xmlSchemaTypeType type; (* The kind of type *)
-    xmlChar *name;
-    xmlSchemaAnnotPtr annot;
-    xmlChar *identifier;
-    xmlChar *targetNamespace;
-};
+  xmlSchemaNotation = record
+    _type         : xmlSchemaTypeType; (* The kind of type *)
+    name          : xmlCharPtr;
+    annot         : xmlSchemaAnnotPtr;
+    identifier    : xmlCharPtr;
+    targetNamespace : xmlCharPtr;
+  end;
 
 (*
 * TODO: Actually all those flags used for the schema should sit
@@ -845,99 +818,99 @@ struct _xmlSchemaNotation {
  * Reflects elementFormDefault == qualified in
  * an XML schema document.
  *)
-#define XML_SCHEMAS_QUALIF_ELEM                1 << 0
+{$DEFINE XML_SCHEMAS_QUALIF_ELEM                := (1 shl 0)}
 (**
  * XML_SCHEMAS_QUALIF_ATTR:
  *
  * Reflects attributeFormDefault == qualified in
  * an XML schema document.
  *)
-#define XML_SCHEMAS_QUALIF_ATTR            1 << 1
+{$DEFINE XML_SCHEMAS_QUALIF_ATTR            := (1 shl 1)}
 (**
  * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
  *
  * the schema has "extension" in the set of finalDefault.
  *)
-#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION        1 << 2
+{$DEFINE XML_SCHEMAS_FINAL_DEFAULT_EXTENSION        := (1 shl 2)}
 (**
  * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
  *
  * the schema has "restriction" in the set of finalDefault.
  *)
-#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION            1 << 3
+{$DEFINE XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION            := (1 shl 3)}
 (**
  * XML_SCHEMAS_FINAL_DEFAULT_LIST:
  *
  * the cshema has "list" in the set of finalDefault.
  *)
-#define XML_SCHEMAS_FINAL_DEFAULT_LIST            1 << 4
+{$DEFINE XML_SCHEMAS_FINAL_DEFAULT_LIST            := (1 shl 4)}
 (**
  * XML_SCHEMAS_FINAL_DEFAULT_UNION:
  *
  * the schema has "union" in the set of finalDefault.
  *)
-#define XML_SCHEMAS_FINAL_DEFAULT_UNION            1 << 5
+{$DEFINE XML_SCHEMAS_FINAL_DEFAULT_UNION            := (1 shl 5)}
 (**
  * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
  *
  * the schema has "extension" in the set of blockDefault.
  *)
-#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION            1 << 6
+{$DEFINE XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION            := (1 shl 6)}
 (**
  * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
  *
  * the schema has "restriction" in the set of blockDefault.
  *)
-#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION            1 << 7
+{$DEFINE XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION            := (1 shl 7)}
 (**
  * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
  *
  * the schema has "substitution" in the set of blockDefault.
  *)
-#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION            1 << 8
+{$DEFINE XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION            := (1 shl 8)}
 (**
  * XML_SCHEMAS_INCLUDING_CONVERT_NS:
  *
  * the schema is currently including an other schema with
  * no target namespace.
  *)
-#define XML_SCHEMAS_INCLUDING_CONVERT_NS            1 << 9
+{$DEFINE XML_SCHEMAS_INCLUDING_CONVERT_NS            := (1 shl 9)}
 (**
  * _xmlSchema:
  *
  * A Schemas definition
  *)
-struct _xmlSchema {
-    xmlChar *name; (* schema name *)
-    xmlChar *targetNamespace; (* the target namespace *)
-    xmlChar *version;
-    xmlChar *id; (* Obsolete *)
-    xmlDocPtr doc;
-    xmlSchemaAnnotPtr annot;
-    int flags;
-
-    xmlHashTablePtr typeDecl;
-    xmlHashTablePtr attrDecl;
-    xmlHashTablePtr attrgrpDecl;
-    xmlHashTablePtr elemDecl;
-    xmlHashTablePtr notaDecl;
-
-    xmlHashTablePtr schemasImports;
-
-    void *_private;        (* unused by the library for users or bindings *)
-    xmlHashTablePtr groupDecl;
-    xmlDictPtr      dict;
-    void *includes;     (* the includes, this is opaque for now *)
-    int preserve;        (* whether to free the document *)
-    int counter; (* used to give ononymous components unique names *)
-    xmlHashTablePtr idcDef; (* All identity-constraint defs. *)
-    void *volatiles; (* Obsolete *)
-};
+  xmlSchema = record
+    name            : xmlCharPtr; (* schema name *)
+    targetNamespace : xmlCharPtr; (* the target namespace *)
+    version         : xmlCharPtr;
+    id              : xmlCharPtr; (* Obsolete *)
+    doc             : xmlDocPtr;
+    annot           : xmlSchemaAnnotPtr;
+    flags           : cint;
+
+    typeDecl        : xmlHashTablePtr;
+    attrDecl        : xmlHashTablePtr;
+    attrgrpDecl     : xmlHashTablePtr;
+    elemDecl        : xmlHashTablePtr;
+    notaDecl        : xmlHashTablePtr;
+
+    schemasImports  : xmlHashTablePtr;
+
+    _private        : pointer;        (* unused by the library for users or bindings *)
+    groupDecl       : xmlHashTablePtr;
+    dict            : xmlDictPtr;
+    includes        : pointer;     (* the includes, this is opaque for now *)
+    preserve        : cint;        (* whether to free the document *)
+    counter         : cint; (* used to give ononymous components unique names *)
+    idcDef          : xmlHashTablePtr; (* All identity-constraint defs. *)
+    volatiles       : pointer; (* Obsolete *)
+  end;
 {$ENDIF}
 
-{$IFDEF FUNCTION_}
-XMLPUBFUN void XMLCALL         xmlSchemaFreeType        (xmlSchemaTypePtr type);
-XMLPUBFUN void XMLCALL         xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);
+{$IFDEF FUNCTION}
+procedure xmlSchemaFreeType(_type: xmlSchemaTypePtr); XMLCALL; XMLPUBFUN;
+procedure xmlSchemaFreeWildcard(wildcard: xmlSchemaWildcardPtr); XMLCALL; XMLPUBFUN;
 {$ENDIF}
 
 {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)

+ 24 - 58
packages/libxml/src/threads.inc

@@ -8,77 +8,43 @@
  * Author: Daniel Veillard
  *)
 
-#ifndef __XML_THREADS_H__
-#define __XML_THREADS_H__
-
-#include <libxml/xmlversion.h>
-
-{ __cplusplus
-extern "C" {
-#endif
-
+{$IFDEF TYPE}
 (*
  * xmlMutex are a simple mutual exception locks.
  *)
-typedef struct _xmlMutex xmlMutex;
-typedef xmlMutex *xmlMutexPtr;
+  xmlMutex = record end;
 
 (*
  * xmlRMutex are reentrant mutual exception locks.
  *)
-typedef struct _xmlRMutex xmlRMutex;
-typedef xmlRMutex *xmlRMutexPtr;
+  xmlRMutex = record end;
+{$ENDIF}
 
-{ __cplusplus
-}
-#endif
-#include <libxml/globals.h>
-{ __cplusplus
-extern "C" {
-#endif
-XMLPUBFUN xmlMutexPtr XMLCALL
-			xmlNewMutex	(void);
-XMLPUBFUN void XMLCALL
-			xmlMutexLock	(xmlMutexPtr tok);
-XMLPUBFUN void XMLCALL
-			xmlMutexUnlock	(xmlMutexPtr tok);
-XMLPUBFUN void XMLCALL
-			xmlFreeMutex	(xmlMutexPtr tok);
+{$IFDEF FUNCTION}
+function xmlNewMutex: xmlMutexPtr; XMLCALL; XMLPUBFUN;
+procedure xmlMutexLock(tok: xmlMutexPtr); XMLCALL; XMLPUBFUN;
+procedure xmlMutexUnlock(tok: xmlMutexPtr); XMLCALL; XMLPUBFUN;
+procedure xmlFreeMutex(tok: xmlMutexPtr); XMLCALL; XMLPUBFUN;
 
-XMLPUBFUN xmlRMutexPtr XMLCALL
-			xmlNewRMutex	(void);
-XMLPUBFUN void XMLCALL
-			xmlRMutexLock	(xmlRMutexPtr tok);
-XMLPUBFUN void XMLCALL
-			xmlRMutexUnlock	(xmlRMutexPtr tok);
-XMLPUBFUN void XMLCALL
-			xmlFreeRMutex	(xmlRMutexPtr tok);
+function xmlNewRMutex: xmlRMutexPtr; XMLCALL; XMLPUBFUN;
+procedure xmlRMutexLock(tok: xmlRMutexPtr); XMLCALL; XMLPUBFUN;
+procedure xmlRMutexUnlock(tok: xmlRMutexPtr); XMLCALL; XMLPUBFUN;
+procedure xmlFreeRMutex(tok: xmlRMutexPtr); XMLCALL; XMLPUBFUN;
 
 (*
  * Library wide APIs.
  *)
-XMLPUBFUN void XMLCALL
-			xmlInitThreads	(void);
-XMLPUBFUN void XMLCALL
-			xmlLockLibrary	(void);
-XMLPUBFUN void XMLCALL
-			xmlUnlockLibrary(void);
-XMLPUBFUN int XMLCALL
-			xmlGetThreadId	(void);
-XMLPUBFUN int XMLCALL
-			xmlIsMainThread	(void);
-XMLPUBFUN void XMLCALL
-			xmlCleanupThreads(void);
-XMLPUBFUN xmlGlobalStatePtr XMLCALL
-			xmlGetGlobalState(void);
-
-#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
-int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
-#endif
+procedure xmlInitThreads; XMLCALL; XMLPUBFUN;
+procedure xmlLockLibrary; XMLCALL; XMLPUBFUN;
+procedure xmlUnlockLibrary; XMLCALL; XMLPUBFUN;
 
-{ __cplusplus
-}
-#endif
+function xmlGetThreadId: cint; XMLCALL; XMLPUBFUN;
+function xmlIsMainThread: cint; XMLCALL; XMLPUBFUN;
+procedure xmlCleanupThreads; XMLCALL; XMLPUBFUN;
+function xmlGetGlobalState: xmlGlobalStatePtr; XMLCALL; XMLPUBFUN;
 
+{$IF defined(HAVE_WIN32_THREADS) and not defined(HAVE_COMPILER_TLS) and defined(LIBXML_STATIC_FOR_DLL)}
+//int XMLCALL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
+{$ENDIF}
 
-#endif (* __XML_THREADS_H__ *)
+{$ENDIF}

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

@@ -13,6 +13,7 @@
  * Some of the basic types pointer to structures:
  *)
 
+{$IFDEF TYPE}
 
 (**
  * BASE_BUFFER_SIZE:
@@ -30,24 +31,21 @@
  *)
 {.$DEFINE LIBXML_NAMESPACE_DICT}
 
-{$IFDEF CONST}
 (**
  * XML_XML_NAMESPACE:
  *
  * This is the namespace for the special xml: prefix predefined in the
  * XML Namespace specification.
  *)
-  XML_XML_NAMESPACE: xmlCharPtr = 'http://www.w3.org/XML/1998/namespace';
+{$DEFINE XML_XML_NAMESPACE := xmlCharPtr('http://www.w3.org/XML/1998/namespace')}
 
 (**
  * XML_XML_ID:
  *
  * This is the name for the special xml:id attribute
  *)
-  XML_XML_ID: xmlCharPtr = 'xml:id';
-{$ENDIF}
+{$DEFINE XML_XML_ID := xmlCharPtr('xml:id')}
 
-{$IFDEF TYPE}
 (**
  * xmlBufferAllocationScheme:
  *
@@ -263,19 +261,14 @@
     contModel   : pointer;
 {$ENDIF}
   end;
-{$ENDIF}
-
 
 (**
  * XML_LOCAL_NAMESPACE:
  *
  * A namespace declaration node.
  *)
-{$IFDEF CONST}
-  XML_LOCAL_NAMESPACE = XML_NAMESPACE_DECL;
-{$ENDIF}
+{$DEFINE XML_LOCAL_NAMESPACE := XML_NAMESPACE_DECL}
 
-{$IFDEF TYPE}
   xmlNsType = xmlElementType;
 
 (**
@@ -512,7 +505,6 @@
 #endif}
 {$ENDIF}
 
-
 {$IFDEF FUNCTION}
 (*
  * Variables.
@@ -547,9 +539,7 @@ function xmlBufferCreateSize(size: size_t): xmlBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlBufferCreateStatic(mem: pointer; size: size_t): xmlBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlBufferResize(buf: xmlBufferPtr; size: cuint): cint; XMLCALL; XMLPUBFUN;
 procedure xmlBufferFree(buf: xmlBufferPtr); XMLCALL; XMLPUBFUN;
-{XMLPUBFUN int XMLCALL
-    xmlBufferDump   (FILE *file,
-           xmlBufferPtr buf);}
+procedure xmlBufferDump(fp: PFILE; buf: xmlBufferPtr); XMLCALL; XMLPUBFUN;
 function xmlBufferAdd(buf: xmlBufferPtr; str: xmlCharPtr; len: cint): cint; XMLCALL; XMLPUBFUN;
 function xmlBufferAddHead(buf: xmlBufferPtr; str: xmlCharPtr; len: cint): cint; XMLCALL; XMLPUBFUN;
 function xmlBufferCat(buf: xmlBufferPtr; str: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;

+ 1 - 1
packages/libxml/src/uri.inc

@@ -47,7 +47,7 @@ function xmlParseURI(str: pchar): xmlURIPtr; XMLCALL; XMLPUBFUN;
 function xmlParseURI(str: pchar; raw: cint): xmlURIPtr; XMLCALL; XMLPUBFUN;
 function xmlParseURIReference(uri: xmlURIPtr; str: pchar): cint; XMLCALL; XMLPUBFUN;
 function xmlSaveUri(uri: xmlURIPtr): pchar; XMLCALL; XMLPUBFUN;
-//procedure xmlPrintURI(stream: FILE; uri: xmlURIPtr); XMLCALL; XMLPUBFUN;
+procedure xmlPrintURI(stream: PFILE; uri: xmlURIPtr); XMLCALL; XMLPUBFUN;
 function xmlURIEscapeStr(str: xmlCharPtr; list: xmlCharPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
 function xmlURIUnescapeString(str: pchar; len: cint; target: pchar): xmlCharPtr; XMLCALL; XMLPUBFUN;
 function xmlNormalizeURIPath(path: pchar): cint; XMLCALL; XMLPUBFUN;

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

@@ -118,24 +118,10 @@ procedure xmlDumpNotationTable(buf: xmlBufferPtr; table: xmlNotationTablePtr); X
 {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
 
 (* Element Content *)
-(* the non Doc version are being deprecated *)
-function xmlNewElementContent(name: xmlCharPtr; _type: xmlElementContentType): xmlElementContentPtr; XMLCALL; XMLPUBFUN;
-function xmlCopyElementContent(content: xmlElementContentPtr): xmlElementContentPtr; XMLCALL; XMLPUBFUN;
-procedure xmlFreeElementContent(cur: xmlElementContentPtr); XMLCALL; XMLPUBFUN;
-
-(* the new versions with doc argument *)
 function xmlNewDocElementContent(doc: xmlDocPtr; name: xmlCharPtr; _type: xmlElementContentType): xmlElementContentPtr; XMLCALL; XMLPUBFUN;
 function xmlCopyDocElementContent(doc: xmlDocPtr; content: xmlElementContentPtr): xmlElementContentPtr; XMLCALL; XMLPUBFUN;
 procedure xmlFreeDocElementContent(doc: xmlDocPtr; cur: xmlElementContentPtr); XMLCALL; XMLPUBFUN;
 procedure xmlSnprintfElementContent(buf: pchar; size: cint; content: xmlElementContentPtr; englob: cint); XMLCALL; XMLPUBFUN;
-{$IFDEF LIBXML_OUTPUT_ENABLED}
-(* DEPRECATED *)
-{XMLPUBFUN void XMLCALL		     
-		xmlSprintfElementContent(char *buf,
-	                                 xmlElementContentPtr content,
-					 int englob);}
-{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
-(* DEPRECATED *)
 
 (* Element *)
 function xmlAddElementDecl(ctxt: xmlValidCtxtPtr; dtd: xmlDtdPtr; name: xmlCharPtr; _type: xmlElementTypeVal; content: xmlElementContentPtr): xmlElementPtr; XMLCALL; XMLPUBFUN;

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

@@ -141,7 +141,7 @@ function xmlPopInputCallbacks: cint; XMLCALL; XMLPUBFUN;
 procedure xmlRegisterDefaultInputCallbacks; XMLCALL; XMLPUBFUN;
 function xmlAllocParserInputBuffer(enc: xmlCharEncoding): xmlParserInputBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlParserInputBufferCreateFilename(URI: pchar; enc: xmlCharEncoding): xmlParserInputBufferPtr; XMLCALL; XMLPUBFUN;
-//function xmlParserInputBufferCreateFile(file: FILE; enc: xmlCharEncoding): xmlParserInputBufferPtr; XMLCALL; XMLPUBFUN;
+function xmlParserInputBufferCreateFile(fp: PFILE; enc: xmlCharEncoding): xmlParserInputBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlParserInputBufferCreateFd(fd: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlParserInputBufferCreateMem(mem: pchar; size: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlParserInputBufferCreateStatic(mem: pchar; size: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; XMLCALL; XMLPUBFUN;
@@ -164,7 +164,7 @@ procedure xmlRegisterDefaultOutputCallbacks; XMLCALL; XMLPUBFUN;
 function xmlAllocOutputBuffer(encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; XMLCALL; XMLPUBFUN;
 
 function xmlOutputBufferCreateFilename(URI: pchar; encoder: xmlCharEncodingHandlerPtr; compression: cint): xmlOutputBufferPtr; XMLCALL; XMLPUBFUN;
-//function xmlOutputBufferCreateFile(file: FILE; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; XMLCALL; XMLPUBFUN;
+function xmlOutputBufferCreateFile(fp: PFILE; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlOutputBufferCreateBuffer(buffer: xmlBufferPtr; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlOutputBufferCreateFd(fd: cint; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; XMLCALL; XMLPUBFUN;
 function xmlOutputBufferCreateIO(iowrite: xmlOutputWriteCallback; ioclose: xmlOutputCloseCallback; ioctx: pointer; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; XMLCALL; XMLPUBFUN;

+ 10 - 10
packages/libxml/src/xmlerror.inc

@@ -630,7 +630,7 @@
     XML_SCHEMAV_CVC_ELT_4_3, (* 1852 *)
     XML_SCHEMAV_CVC_ELT_5_1_1, (* 1853 *)
     XML_SCHEMAV_CVC_ELT_5_1_2, (* 1854 *)
-    XML_SCHEMAV_CVC_ELT_5_2_1, (* 1855 *)  
+    XML_SCHEMAV_CVC_ELT_5_2_1, (* 1855 *)
     XML_SCHEMAV_CVC_ELT_5_2_2_1, (* 1856 *)
     XML_SCHEMAV_CVC_ELT_5_2_2_2_1, (* 1857 *)
     XML_SCHEMAV_CVC_ELT_5_2_2_2_2, (* 1858 *)
@@ -655,7 +655,7 @@
     XML_SCHEMAV_CVC_IDC, (* 1877 *)
     XML_SCHEMAV_CVC_WILDCARD, (* 1878 *)
     XML_SCHEMAV_MISC, (* 1879 *)
-    XML_XPTR_UNKNOWN_SCHEME = 1900, 
+    XML_XPTR_UNKNOWN_SCHEME = 1900,
     XML_XPTR_CHILDSEQ_START, (* 1901 *)
     XML_XPTR_EVAL_FAILED, (* 1902 *)
     XML_XPTR_EXTRA_OBJECTS, (* 1903 *)
@@ -676,15 +676,15 @@
     XML_SCHEMAP_SRC_SIMPLE_TYPE_2, (* 3001 *)
     XML_SCHEMAP_SRC_SIMPLE_TYPE_3, (* 3002 *)
     XML_SCHEMAP_SRC_SIMPLE_TYPE_4, (* 3003 *)
-    XML_SCHEMAP_SRC_RESOLVE, (* 3004 *) 
+    XML_SCHEMAP_SRC_RESOLVE, (* 3004 *)
     XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, (* 3005 *)
     XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, (* 3006 *)
     XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, (* 3007 *)
     XML_SCHEMAP_ST_PROPS_CORRECT_1, (* 3008 *)
     XML_SCHEMAP_ST_PROPS_CORRECT_2, (* 3009 *)
-    XML_SCHEMAP_ST_PROPS_CORRECT_3, (* 3010 *)     
+    XML_SCHEMAP_ST_PROPS_CORRECT_3, (* 3010 *)
     XML_SCHEMAP_COS_ST_RESTRICTS_1_1, (* 3011 *)
-    XML_SCHEMAP_COS_ST_RESTRICTS_1_2, (* 3012 *)    
+    XML_SCHEMAP_COS_ST_RESTRICTS_1_2, (* 3012 *)
     XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, (* 3013 *)
     XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, (* 3014 *)
     XML_SCHEMAP_COS_ST_RESTRICTS_2_1, (* 3015 *)
@@ -703,7 +703,7 @@
     XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, (* 3028 *)
     XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, (* 3029 *)
     XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, (* 3030 *)
-    XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, (* 3031 *) 
+    XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, (* 3031 *)
     XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, (* 3032 *)
     XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, (* 3033 *)
     XML_SCHEMAP_S4S_ELEM_MISSING, (* 3034 *)
@@ -722,14 +722,14 @@
     XML_SCHEMAP_E_PROPS_CORRECT_4, (* 3047 *)
     XML_SCHEMAP_E_PROPS_CORRECT_5, (* 3048 *)
     XML_SCHEMAP_E_PROPS_CORRECT_6, (* 3049 *)
-    XML_SCHEMAP_SRC_INCLUDE, (* 3050 *)    
+    XML_SCHEMAP_SRC_INCLUDE, (* 3050 *)
     XML_SCHEMAP_SRC_ATTRIBUTE_1, (* 3051 *)
     XML_SCHEMAP_SRC_ATTRIBUTE_2, (* 3052 *)
     XML_SCHEMAP_SRC_ATTRIBUTE_3_1, (* 3053 *)
     XML_SCHEMAP_SRC_ATTRIBUTE_3_2, (* 3054 *)
     XML_SCHEMAP_SRC_ATTRIBUTE_4, (* 3055 *)
     XML_SCHEMAP_NO_XMLNS, (* 3056 *)
-    XML_SCHEMAP_NO_XSI, (* 3057 *)      
+    XML_SCHEMAP_NO_XSI, (* 3057 *)
     XML_SCHEMAP_COS_VALID_DEFAULT_1, (* 3058 *)
     XML_SCHEMAP_COS_VALID_DEFAULT_2_1, (* 3059 *)
     XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, (* 3060 *)
@@ -872,7 +872,7 @@ function xmlResetError(from, _to: xmlErrorPtr): cint; XMLCALL; XMLPUBFUN;
 (*
  * Internal callback reporting routine
  *)
-{XMLPUBFUN void XMLCALL 
+{XMLPUBFUN void XMLCALL
     __xmlRaiseError		(xmlStructuredErrorFunc schannel,
     				 xmlGenericErrorFunc channel,
     				 void *data,
@@ -890,7 +890,7 @@ function xmlResetError(from, _to: xmlErrorPtr): cint; XMLCALL; XMLPUBFUN;
 				 int col,
 				 char *msg,
 				 ...);
-XMLPUBFUN void XMLCALL 
+XMLPUBFUN void XMLCALL
     __xmlSimpleError		(int domain,
     				 int code,
 				 xmlNodePtr node,

+ 5 - 5
packages/libxml/src/xmlmemory.inc

@@ -13,7 +13,7 @@
  *
  * DEBUG_MEMORY replaces the allocator with a collect and debug
  * shell to the libc allocator.
- * DEBUG_MEMORY should only be activated when debugging 
+ * DEBUG_MEMORY should only be activated when debugging
  * libxml i.e. if libxml has been configured with --with-debug-mem too.
  *)
 {.$DEFINE DEBUG_MEMORY_FREED}
@@ -28,7 +28,7 @@
 (**
  * DEBUG_MEMORY_LOCATION:
  *
- * DEBUG_MEMORY_LOCATION should be activated only when debugging 
+ * DEBUG_MEMORY_LOCATION should be activated only when debugging
  * libxml i.e. if libxml has been configured with --with-debug-mem too.
  *)
 {$IFDEF DEBUG_MEMORY_LOCATION}
@@ -103,7 +103,7 @@ function xmlGcMemGet(var freeFunc: xmlFreeFunc; var mallocFunc: xmlMallocFunc; v
  *)
 function xmlInitMemory(): cint; XMLCALL; XMLPUBFUN;
 
-(* 
+(*
  * Cleanup of the memory layer.
  *)
 procedure xmlCleanupMemory(); XMLCALL; XMLPUBFUN;
@@ -113,8 +113,8 @@ procedure xmlCleanupMemory(); XMLCALL; XMLPUBFUN;
  *)
 function xmlMemUsed(): cint; XMLCALL; XMLPUBFUN;
 function xmlMemBlocks(): cint; XMLCALL; XMLPUBFUN;
-{XMLPUBFUN void XMLCALL	xmlMemDisplay	(FILE *fp);
-XMLPUBFUN void XMLCALL	xmlMemShow	(FILE *fp, int nr);}
+procedure xmlMemDisplay(fp: PFILE); XMLCALL; XMLPUBFUN;
+procedure xmlMemShow(fp: PFILE; nr: cint); XMLCALL; XMLPUBFUN;
 procedure xmlMemoryDump(); XMLCALL; XMLPUBFUN;
 function xmlMemMalloc(size: size_t): pointer; XMLCALL; XMLPUBFUN;
 function xmlMemRealloc(ptr: pointer; size: size_t): pointer; XMLCALL; XMLPUBFUN;

+ 3 - 3
packages/libxml/src/xmlreader.inc

@@ -28,7 +28,7 @@
  * xmlParserProperties:
  *
  * Some common options to use with xmlTextReaderSetParserProp, but it
- * is better to use xmlParserOption and the xmlReaderNewxxx and 
+ * is better to use xmlParserOption and the xmlReaderNewxxx and
  * xmlReaderForxxx APIs now.
  *)
   xmlParserProperties = (
@@ -217,11 +217,11 @@ function xmlReaderNewIO(reader: xmlTextReaderPtr; ioread: xmlInputReadCallback;
  *)
 function xmlTextReaderLocatorLineNumber(locator: xmlTextReaderLocatorPtr): cint; XMLCALL; XMLPUBFUN;
 function xmlTextReaderLocatorBaseURI(locator: xmlTextReaderLocatorPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
-procedure xmlTextReaderLocatorBaseURI(reader: xmlTextReaderPtr; f: xmlTextReaderErrorFunc; arg: pointer); XMLCALL; XMLPUBFUN;
+procedure xmlTextReaderSetErrorHandler(reader: xmlTextReaderPtr; f: xmlTextReaderErrorFunc; arg: pointer); XMLCALL; XMLPUBFUN;
 procedure xmlTextReaderSetStructuredErrorHandler(reader: xmlTextReaderPtr; f: xmlTextReaderErrorFunc; arg: pointer); XMLCALL; XMLPUBFUN;
 procedure xmlTextReaderGetErrorHandler(reader: xmlTextReaderPtr; var f: xmlTextReaderErrorFunc; var arg: pointer); XMLCALL; XMLPUBFUN;
 {$ENDIF}
 
 {$ENDIF} (* LIBXML_READER_ENABLED *)
-{$ENDIF} (* __XML_XMLREADER_H__ *)
+{$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
 

+ 1 - 1
packages/libxml/src/xmlregexp.inc

@@ -38,7 +38,7 @@
 function xmlRegexpCompile(regexp: xmlCharPtr): xmlRegexpPtr; XMLCALL; XMLPUBFUN;
 procedure xmlRegFreeRegexp(regexp: xmlRegexpPtr); XMLCALL; XMLPUBFUN;
 function xmlRegexpExec(comp: xmlRegexpPtr; value: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
-//procedure xmlRegexpPrint(output: FILE; regexp: xmlRegexpPtr); XMLCALL; XMLPUBFUN;
+procedure xmlRegexpPrint(output: PFILE; regexp: xmlRegexpPtr); XMLCALL; XMLPUBFUN;
 function xmlRegexpIsDeterminist(comp: xmlRegexpPtr): cint; XMLCALL; XMLPUBFUN;
 
 (*

+ 3 - 5
packages/libxml/src/xmlschemas.inc

@@ -45,7 +45,7 @@
 
 (*
 * ATTENTION: Change xmlSchemaSetValidOptions's check
-* for invalid values, if adding to the validation 
+* for invalid values, if adding to the validation
 * options below.
 *)
 (**
@@ -70,7 +70,7 @@
 (**
  * The schemas related types are kept internal
  *)
-  xmlSchema = record end;
+//  xmlSchema = record end;
 
 (**
  * A schemas validation context
@@ -100,9 +100,7 @@ function xmlSchemaIsValid(ctxt: xmlSchemaValidCtxtPtr): cint; XMLCALL; XMLPUBFUN
 function xmlSchemaParse(ctxt: xmlSchemaParserCtxtPtr): xmlSchemaPtr; XMLCALL; XMLPUBFUN;
 procedure xmlSchemaFree(schema: xmlSchemaPtr); XMLCALL; XMLPUBFUN;
 {$IFDEF LIBXML_OUTPUT_ENABLED}
-{XMLPUBFUN void XMLCALL		
-	    xmlSchemaDump		(FILE *output,
-					 xmlSchemaPtr schema);}
+procedure xmlSchemaDump(output: PFILE; schema: xmlSchemaPtr); XMLCALL; XMLPUBFUN;
 {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
 
 (*

+ 14 - 42
packages/libxml/src/xmlschemastypes.inc

@@ -19,7 +19,7 @@
   );
 {$ENDIF}
 
-{$IFDEF FUNCTION_}
+{$IFDEF FUNCTION}
 procedure xmlSchemaInitTypes; XMLCALL; XMLPUBFUN;
 procedure xmlSchemaCleanupTypes; XMLCALL; XMLPUBFUN;
 function xmlSchemaGetPredefinedType(name, ns: xmlCharPtr): xmlSchemaTypePtr; XMLCALL; XMLPUBFUN;
@@ -42,47 +42,19 @@ function xmlSchemaWhiteSpaceReplace(value: xmlCharPtr): xmlCharPtr; XMLCALL; XML
 function xmlSchemaGetFacetValueAsULong(facet: xmlSchemaFacetPtr): culong; XMLCALL; XMLPUBFUN;
 function xmlSchemaValidateLengthFacet(_type: xmlSchemaTypePtr; facet: xmlSchemaFacetPtr; value: xmlCharPtr; val: xmlSchemaValPtr; length: pculong): cint; XMLCALL; XMLPUBFUN;
 function xmlSchemaValidateLengthFacetWhtsp(facet: xmlSchemaFacetPtr; valType: xmlSchemaValType; value: xmlCharPtr; val: xmlSchemaValPtr; length: pculong; ws: xmlSchemaWhitespaceValueType): cint; XMLCALL; XMLPUBFUN;
-
-
-XMLPUBFUN int XMLCALL
-		xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type, 
-						 xmlChar *value,
-						 xmlSchemaValPtr *val, 
-						 xmlNodePtr node);
-XMLPUBFUN int XMLCALL
-		xmlSchemaGetCanonValue		(xmlSchemaValPtr val,
-						 xmlChar **retValue);
-XMLPUBFUN int XMLCALL
-		xmlSchemaGetCanonValueWhtsp	(xmlSchemaValPtr val,						 
-						 xmlChar **retValue,
-						 xmlSchemaWhitespaceValueType ws);
-XMLPUBFUN int XMLCALL
-		xmlSchemaValueAppend		(xmlSchemaValPtr prev,
-						 xmlSchemaValPtr cur);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaValueGetNext		(xmlSchemaValPtr cur);
-XMLPUBFUN xmlChar * XMLCALL
-		xmlSchemaValueGetAsString	(xmlSchemaValPtr val);
-XMLPUBFUN int XMLCALL
-		xmlSchemaValueGetAsBoolean	(xmlSchemaValPtr val);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaNewStringValue		(xmlSchemaValType type,
-						 xmlChar *value);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaNewNOTATIONValue	(xmlChar *name,
-						 xmlChar *ns);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaNewQNameValue		(xmlChar *namespaceName,
-						 xmlChar *localName);
-XMLPUBFUN int XMLCALL
-		xmlSchemaCompareValuesWhtsp	(xmlSchemaValPtr x,
-						 xmlSchemaWhitespaceValueType xws,
-						 xmlSchemaValPtr y,
-						 xmlSchemaWhitespaceValueType yws);
-XMLPUBFUN xmlSchemaValPtr XMLCALL
-		xmlSchemaCopyValue		(xmlSchemaValPtr val);
-XMLPUBFUN xmlSchemaValType XMLCALL
-		xmlSchemaGetValType		(xmlSchemaValPtr val);
+function xmlSchemaValPredefTypeNodeNoNorm(_type: xmlSchemaTypePtr; value: xmlCharPtr; val: xmlSchemaValPtrPtr; node: xmlNodePtr): cint; XMLCALL; XMLPUBFUN;
+function xmlSchemaGetCanonValue(val: xmlSchemaValPtr; var retValue: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlSchemaGetCanonValueWhtsp(val: xmlSchemaValPtr; var retValue: xmlCharPtr; ws: xmlSchemaWhitespaceValueType): cint; XMLCALL; XMLPUBFUN;
+function xmlSchemaValueAppend(prev, cur: xmlSchemaValPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlSchemaValueGetNext(cur: xmlSchemaValPtr): xmlSchemaValPtr; XMLCALL; XMLPUBFUN;
+function xmlSchemaValueGetAsString(val: xmlSchemaValPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
+function xmlSchemaValueGetAsBoolean(val: xmlSchemaValPtr): cint; XMLCALL; XMLPUBFUN;
+function xmlSchemaNewStringValue(_type: xmlSchemaValType; value: xmlCharPtr): xmlSchemaValPtr; XMLCALL; XMLPUBFUN;
+function xmlSchemaNewNOTATIONValue(name, ns: xmlCharPtr): xmlSchemaValPtr; XMLCALL; XMLPUBFUN;
+function xmlSchemaNewQNameValue(namespaceName, localName: xmlCharPtr): xmlSchemaValPtr; XMLCALL; XMLPUBFUN;
+function xmlSchemaCompareValuesWhtsp(x: xmlSchemaValPtr; xws: xmlSchemaWhitespaceValueType; y: xmlSchemaValPtr; yws: xmlSchemaWhitespaceValueType): cint; XMLCALL; XMLPUBFUN;
+function xmlSchemaCopyValue(val: xmlSchemaValPtr): xmlSchemaValPtr; XMLCALL; XMLPUBFUN;
+function xmlSchemaGetValType(val: xmlSchemaValPtr): xmlSchemaValType; XMLCALL; XMLPUBFUN;
 {$ENDIF}
 
 {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)

+ 1 - 1
packages/libxml/src/xmlstring.inc

@@ -49,7 +49,7 @@ function xmlStrlen(str: xmlCharPtr): cint; XMLCALL; XMLPUBFUN;
 function xmlStrcat(cur: xmlCharPtr; add: xmlCharPtr): xmlCharPtr; XMLCALL; XMLPUBFUN;
 function xmlStrncat(cur: xmlCharPtr; add: xmlCharPtr; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
 function xmlStrncatNew(str1: xmlCharPtr; str2: xmlCharPtr; len: cint): xmlCharPtr; XMLCALL; XMLPUBFUN;
-function xmlStrPrintf(buf: xmlCharPtr; len: cint; msg: xmlCharPtr; args: array of const): cint; XMLCALL; XMLPUBFUN;
+function xmlStrPrintf(buf: xmlCharPtr; len: cint; msg: xmlCharPtr; args: array of const): cint; XMLCDECL; XMLPUBFUN;
 function xmlStrVPrintf(buf: xmlCharPtr; len: cint; msg: xmlCharPtr; ap: va_list): cint; XMLCALL; XMLPUBFUN;
 function xmlGetUTF8Char(utf: pchar; len: pcint): cint; XMLCALL; XMLPUBFUN;
 function xmlCheckUTF8(utf: pchar): cint; XMLCALL; XMLPUBFUN;