Browse Source

* added more highspeed string parsing functions

git-svn-id: trunk@14126 -
ivost 15 years ago
parent
commit
c1baa643db
3 changed files with 284 additions and 255 deletions
  1. 1 24
      packages/libxml/src/xml2.pas
  2. 4 5
      packages/libxml/src/xmlstring.inc
  3. 279 226
      packages/libxml/src/xmlxsd.pas

+ 1 - 24
packages/libxml/src/xml2.pas

@@ -32,9 +32,6 @@ const
 
 {$i xml2.inc}
 
-operator := (const S: String): xmlCharPtr; inline;
-//operator := (const C: AnsiChar): xmlCharPtr; inline;
-
 implementation
 
 procedure fpcxmlFree(mem: pointer); EXTDECL;
@@ -73,26 +70,6 @@ end;
  * macros from xmlversion.inc
  *)
 
-function BAD_CAST(str: pchar): xmlCharPtr;
-begin
-  result := xmlCharPtr(str);
-end;
-
-function BAD_CAST(str: string): xmlCharPtr;
-begin
-  result := xmlCharPtr(PChar(str));
-end;
-
-operator := (const S: String): xmlCharPtr; inline;
-begin
-  Result := xmlCharPtr(PChar(S));
-end;
-
-{operator := (const C: AnsiChar): xmlCharPtr; inline;
-begin
-  Result := xmlCharPtr(PChar(String(C)));
-end;}
-
 
 (*
  * macros from chvalid.inc
@@ -218,7 +195,7 @@ end;
 
 function htmlElementAllowedHereDesc(parent: htmlElemDescPtr; elt: htmlElemDescPtr): cint;
 begin
-  Result := htmlElementAllowedHere(parent, BAD_CAST(elt^.name));
+  Result := htmlElementAllowedHere(parent, xmlCharPtr(elt^.name));
 end;
 
 function htmlRequiredAttrs(elt: htmlElemDescPtr): ppchar;

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

@@ -9,8 +9,8 @@
  *)
 
 {$IFDEF POINTER}
-  xmlCharPtr = ^xmlChar;
-  xmlCharPtrPtr = ^xmlCharPtr;
+  xmlCharPtr = PChar;
+  xmlCharPtrPtr = PPChar;
 {$ENDIF}
 
 {$IFDEF TYPE}
@@ -21,7 +21,7 @@
  * It's unsigned allowing to pinpoint case where char * are assigned
  * to xmlChar * (possibly making serialization back impossible).
  *)
-  xmlChar = cchar;
+  xmlChar = Char;
 {$ENDIF}
 
 {$IFDEF FUNCTION}
@@ -30,8 +30,7 @@
  *
  * Macro to cast a string to an xmlChar * when one know its safe.
  *)
-function BAD_CAST(str: pchar): xmlCharPtr; inline;
-function BAD_CAST(str: string): xmlCharPtr; inline;
+//function BAD_CAST(str: string): xmlCharPtr; inline;
 
 (*
  * xmlChar handling

File diff suppressed because it is too large
+ 279 - 226
packages/libxml/src/xmlxsd.pas


Some files were not shown because too many files changed in this diff