libxml-xmlmemory.html revision 2ace1956859a5429c6e353a84cb05fafd93c8f73
1<HTML
2><HEAD
3><TITLE
4>xmlmemory</TITLE
5><META
6NAME="GENERATOR"
7CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
8"><LINK
9REL="HOME"
10TITLE="Gnome XML Library Reference Manual"
11HREF="book1.html"><LINK
12REL="UP"
13TITLE="Libxml Library Reference"
14HREF="libxml-lib.html"><LINK
15REL="PREVIOUS"
16TITLE="debugXML"
17HREF="libxml-debugxml.html"><LINK
18REL="NEXT"
19TITLE="xmlregexp"
20HREF="libxml-xmlregexp.html"></HEAD
21><BODY
22CLASS="REFENTRY"
23BGCOLOR="#FFFFFF"
24TEXT="#000000"
25LINK="#0000FF"
26VLINK="#840084"
27ALINK="#0000FF"
28><DIV
29CLASS="NAVHEADER"
30><TABLE
31WIDTH="100%"
32BORDER="0"
33BGCOLOR="#000000"
34CELLPADDING="1"
35CELLSPACING="0"
36><TR
37><TH
38COLSPAN="4"
39ALIGN="center"
40><FONT
41COLOR="#FFFFFF"
42SIZE="5"
43>Gnome XML Library Reference Manual</FONT
44></TH
45></TR
46><TR
47><TD
48WIDTH="25%"
49BGCOLOR="#C00000"
50ALIGN="left"
51><A
52HREF="libxml-debugxml.html"
53><FONT
54COLOR="#FFFFFF"
55SIZE="3"
56><B
57>&#60;&#60;&#60; Previous Page</B
58></FONT
59></A
60></TD
61><TD
62WIDTH="25%"
63BGCOLOR="#0000C0"
64ALIGN="center"
65><FONT
66COLOR="#FFFFFF"
67SIZE="3"
68><B
69><A
70HREF="book1.html"
71><FONT
72COLOR="#FFFFFF"
73SIZE="3"
74><B
75>Home</B
76></FONT
77></A
78></B
79></FONT
80></TD
81><TD
82WIDTH="25%"
83BGCOLOR="#00C000"
84ALIGN="center"
85><FONT
86COLOR="#FFFFFF"
87SIZE="3"
88><B
89><A
90HREF="libxml-lib.html"
91><FONT
92COLOR="#FFFFFF"
93SIZE="3"
94><B
95>Up</B
96></FONT
97></A
98></B
99></FONT
100></TD
101><TD
102WIDTH="25%"
103BGCOLOR="#C00000"
104ALIGN="right"
105><A
106HREF="libxml-xmlregexp.html"
107><FONT
108COLOR="#FFFFFF"
109SIZE="3"
110><B
111>Next Page &#62;&#62;&#62;</B
112></FONT
113></A
114></TD
115></TR
116></TABLE
117></DIV
118><H1
119><A
120NAME="LIBXML-XMLMEMORY">xmlmemory</H1
121><DIV
122CLASS="REFNAMEDIV"
123><A
124NAME="AEN27205"
125></A
126><H2
127>Name</H2
128>xmlmemory&nbsp;--&nbsp;</DIV
129><DIV
130CLASS="REFSYNOPSISDIV"
131><A
132NAME="AEN27208"><H2
133>Synopsis</H2
134><TABLE
135BORDER="0"
136BGCOLOR="#D6E8FF"
137WIDTH="100%"
138CELLPADDING="6"
139><TR
140><TD
141><PRE
142CLASS="SYNOPSIS"
143>&#13;
144
145#define     <A
146HREF="libxml-xmlmemory.html#DEBUG-MEMORY-CAPS"
147>DEBUG_MEMORY</A
148>
149void        (<A
150HREF="libxml-xmlmemory.html#XMLFREEFUNC"
151>*xmlFreeFunc</A
152>)                  (void *mem);
153void*       (<A
154HREF="libxml-xmlmemory.html#XMLMALLOCFUNC"
155>*xmlMallocFunc</A
156>)                (<GTKDOCLINK
157HREF="SIZE-T"
158>size_t</GTKDOCLINK
159> size);
160void*       (<A
161HREF="libxml-xmlmemory.html#XMLREALLOCFUNC"
162>*xmlReallocFunc</A
163>)               (void *mem,
164                                             <GTKDOCLINK
165HREF="SIZE-T"
166>size_t</GTKDOCLINK
167> size);
168char*       (<A
169HREF="libxml-xmlmemory.html#XMLSTRDUPFUNC"
170>*xmlStrdupFunc</A
171>)                (const char *str);
172int         <A
173HREF="libxml-xmlmemory.html#XMLMEMSETUP"
174>xmlMemSetup</A
175>                     (<A
176HREF="libxml-xmlmemory.html#XMLFREEFUNC"
177>xmlFreeFunc</A
178> freeFunc,
179                                             <A
180HREF="libxml-xmlmemory.html#XMLMALLOCFUNC"
181>xmlMallocFunc</A
182> mallocFunc,
183                                             <A
184HREF="libxml-xmlmemory.html#XMLREALLOCFUNC"
185>xmlReallocFunc</A
186> reallocFunc,
187                                             <A
188HREF="libxml-xmlmemory.html#XMLSTRDUPFUNC"
189>xmlStrdupFunc</A
190> strdupFunc);
191int         <A
192HREF="libxml-xmlmemory.html#XMLMEMGET"
193>xmlMemGet</A
194>                       (<A
195HREF="libxml-xmlmemory.html#XMLFREEFUNC"
196>xmlFreeFunc</A
197> *freeFunc,
198                                             <A
199HREF="libxml-xmlmemory.html#XMLMALLOCFUNC"
200>xmlMallocFunc</A
201> *mallocFunc,
202                                             <A
203HREF="libxml-xmlmemory.html#XMLREALLOCFUNC"
204>xmlReallocFunc</A
205> *reallocFunc,
206                                             <A
207HREF="libxml-xmlmemory.html#XMLSTRDUPFUNC"
208>xmlStrdupFunc</A
209> *strdupFunc);
210int         <A
211HREF="libxml-xmlmemory.html#XMLINITMEMORY"
212>xmlInitMemory</A
213>                   (void);
214int         <A
215HREF="libxml-xmlmemory.html#XMLMEMUSED"
216>xmlMemUsed</A
217>                      (void);
218void        <A
219HREF="libxml-xmlmemory.html#XMLMEMDISPLAY"
220>xmlMemDisplay</A
221>                   (<GTKDOCLINK
222HREF="FILE-CAPS"
223>FILE</GTKDOCLINK
224> *fp);
225void        <A
226HREF="libxml-xmlmemory.html#XMLMEMSHOW"
227>xmlMemShow</A
228>                      (<GTKDOCLINK
229HREF="FILE-CAPS"
230>FILE</GTKDOCLINK
231> *fp,
232                                             int nr);
233void        <A
234HREF="libxml-xmlmemory.html#XMLMEMORYDUMP"
235>xmlMemoryDump</A
236>                   (void);
237#define     <A
238HREF="libxml-globals.html#XMLMALLOC"
239>xmlMalloc</A
240>                       (size)
241#define     <A
242HREF="libxml-globals.html#XMLREALLOC"
243>xmlRealloc</A
244>                      (ptr, size)
245#define     <A
246HREF="libxml-globals.html#XMLMEMSTRDUP"
247>xmlMemStrdup</A
248>                    (str)
249void*       <A
250HREF="libxml-xmlmemory.html#XMLMALLOCLOC"
251>xmlMallocLoc</A
252>                    (<GTKDOCLINK
253HREF="SIZE-T"
254>size_t</GTKDOCLINK
255> size,
256                                             const char *file,
257                                             int line);
258void*       <A
259HREF="libxml-xmlmemory.html#XMLREALLOCLOC"
260>xmlReallocLoc</A
261>                   (void *ptr,
262                                             <GTKDOCLINK
263HREF="SIZE-T"
264>size_t</GTKDOCLINK
265> size,
266                                             const char *file,
267                                             int line);
268char*       <A
269HREF="libxml-xmlmemory.html#XMLMEMSTRDUPLOC"
270>xmlMemStrdupLoc</A
271>                 (const char *str,
272                                             const char *file,
273                                             int line);</PRE
274></TD
275></TR
276></TABLE
277></DIV
278><DIV
279CLASS="REFSECT1"
280><A
281NAME="AEN27243"
282></A
283><H2
284>Description</H2
285><P
286></P
287></DIV
288><DIV
289CLASS="REFSECT1"
290><A
291NAME="AEN27246"
292></A
293><H2
294>Details</H2
295><DIV
296CLASS="REFSECT2"
297><A
298NAME="AEN27248"
299></A
300><H3
301><A
302NAME="DEBUG-MEMORY-CAPS"
303></A
304>DEBUG_MEMORY</H3
305><TABLE
306BORDER="0"
307BGCOLOR="#D6E8FF"
308WIDTH="100%"
309CELLPADDING="6"
310><TR
311><TD
312><PRE
313CLASS="PROGRAMLISTING"
314>#define DEBUG_MEMORY</PRE
315></TD
316></TR
317></TABLE
318><P
319>DEBUG_MEMORY replaces the allocator with a collect and debug
320shell to the libc allocator.
321DEBUG_MEMORY should only be activated when debugging 
322libxml i.e. if libxml has been configured with --with-debug-mem too.</P
323><P
324></P
325></DIV
326><HR><DIV
327CLASS="REFSECT2"
328><A
329NAME="AEN27254"
330></A
331><H3
332><A
333NAME="XMLFREEFUNC"
334></A
335>xmlFreeFunc ()</H3
336><TABLE
337BORDER="0"
338BGCOLOR="#D6E8FF"
339WIDTH="100%"
340CELLPADDING="6"
341><TR
342><TD
343><PRE
344CLASS="PROGRAMLISTING"
345>void        (*xmlFreeFunc)                  (void *mem);</PRE
346></TD
347></TR
348></TABLE
349><P
350>Signature for a <GTKDOCLINK
351HREF="FREE"
352>free</GTKDOCLINK
353>() implementation.</P
354><P
355></P
356><DIV
357CLASS="INFORMALTABLE"
358><A
359NAME="AEN27261"><P
360></P
361><TABLE
362BORDER="0"
363WIDTH="100%"
364BGCOLOR="#FFD0D0"
365CELLSPACING="0"
366CELLPADDING="4"
367CLASS="CALSTABLE"
368><TBODY
369><TR
370><TD
371WIDTH="20%"
372ALIGN="RIGHT"
373VALIGN="TOP"
374><TT
375CLASS="PARAMETER"
376><I
377>mem</I
378></TT
379>&nbsp;:</TD
380><TD
381WIDTH="80%"
382ALIGN="LEFT"
383VALIGN="TOP"
384> an already allocated block of memory</TD
385></TR
386></TBODY
387></TABLE
388><P
389></P
390></DIV
391></DIV
392><HR><DIV
393CLASS="REFSECT2"
394><A
395NAME="AEN27270"
396></A
397><H3
398><A
399NAME="XMLMALLOCFUNC"
400></A
401>xmlMallocFunc ()</H3
402><TABLE
403BORDER="0"
404BGCOLOR="#D6E8FF"
405WIDTH="100%"
406CELLPADDING="6"
407><TR
408><TD
409><PRE
410CLASS="PROGRAMLISTING"
411>void*       (*xmlMallocFunc)                (<GTKDOCLINK
412HREF="SIZE-T"
413>size_t</GTKDOCLINK
414> size);</PRE
415></TD
416></TR
417></TABLE
418><P
419>Signature for a <GTKDOCLINK
420HREF="MALLOC"
421>malloc</GTKDOCLINK
422>() implementation.</P
423><P
424></P
425><DIV
426CLASS="INFORMALTABLE"
427><A
428NAME="AEN27278"><P
429></P
430><TABLE
431BORDER="0"
432WIDTH="100%"
433BGCOLOR="#FFD0D0"
434CELLSPACING="0"
435CELLPADDING="4"
436CLASS="CALSTABLE"
437><TBODY
438><TR
439><TD
440WIDTH="20%"
441ALIGN="RIGHT"
442VALIGN="TOP"
443><TT
444CLASS="PARAMETER"
445><I
446>size</I
447></TT
448>&nbsp;:</TD
449><TD
450WIDTH="80%"
451ALIGN="LEFT"
452VALIGN="TOP"
453>  the size requested in bytes</TD
454></TR
455></TBODY
456></TABLE
457><P
458></P
459></DIV
460></DIV
461><HR><DIV
462CLASS="REFSECT2"
463><A
464NAME="AEN27287"
465></A
466><H3
467><A
468NAME="XMLREALLOCFUNC"
469></A
470>xmlReallocFunc ()</H3
471><TABLE
472BORDER="0"
473BGCOLOR="#D6E8FF"
474WIDTH="100%"
475CELLPADDING="6"
476><TR
477><TD
478><PRE
479CLASS="PROGRAMLISTING"
480>void*       (*xmlReallocFunc)               (void *mem,
481                                             <GTKDOCLINK
482HREF="SIZE-T"
483>size_t</GTKDOCLINK
484> size);</PRE
485></TD
486></TR
487></TABLE
488><P
489>Signature for a <GTKDOCLINK
490HREF="REALLOC"
491>realloc</GTKDOCLINK
492>() implementation.</P
493><P
494></P
495><DIV
496CLASS="INFORMALTABLE"
497><A
498NAME="AEN27295"><P
499></P
500><TABLE
501BORDER="0"
502WIDTH="100%"
503BGCOLOR="#FFD0D0"
504CELLSPACING="0"
505CELLPADDING="4"
506CLASS="CALSTABLE"
507><TBODY
508><TR
509><TD
510WIDTH="20%"
511ALIGN="RIGHT"
512VALIGN="TOP"
513><TT
514CLASS="PARAMETER"
515><I
516>mem</I
517></TT
518>&nbsp;:</TD
519><TD
520WIDTH="80%"
521ALIGN="LEFT"
522VALIGN="TOP"
523> an already allocated block of memory</TD
524></TR
525><TR
526><TD
527WIDTH="20%"
528ALIGN="RIGHT"
529VALIGN="TOP"
530><TT
531CLASS="PARAMETER"
532><I
533>size</I
534></TT
535>&nbsp;:</TD
536><TD
537WIDTH="80%"
538ALIGN="LEFT"
539VALIGN="TOP"
540>  the new size requested in bytes</TD
541></TR
542></TBODY
543></TABLE
544><P
545></P
546></DIV
547></DIV
548><HR><DIV
549CLASS="REFSECT2"
550><A
551NAME="AEN27308"
552></A
553><H3
554><A
555NAME="XMLSTRDUPFUNC"
556></A
557>xmlStrdupFunc ()</H3
558><TABLE
559BORDER="0"
560BGCOLOR="#D6E8FF"
561WIDTH="100%"
562CELLPADDING="6"
563><TR
564><TD
565><PRE
566CLASS="PROGRAMLISTING"
567>char*       (*xmlStrdupFunc)                (const char *str);</PRE
568></TD
569></TR
570></TABLE
571><P
572>Signature for an <GTKDOCLINK
573HREF="STRDUP"
574>strdup</GTKDOCLINK
575>() implementation.</P
576><P
577></P
578><DIV
579CLASS="INFORMALTABLE"
580><A
581NAME="AEN27315"><P
582></P
583><TABLE
584BORDER="0"
585WIDTH="100%"
586BGCOLOR="#FFD0D0"
587CELLSPACING="0"
588CELLPADDING="4"
589CLASS="CALSTABLE"
590><TBODY
591><TR
592><TD
593WIDTH="20%"
594ALIGN="RIGHT"
595VALIGN="TOP"
596><TT
597CLASS="PARAMETER"
598><I
599>str</I
600></TT
601>&nbsp;:</TD
602><TD
603WIDTH="80%"
604ALIGN="LEFT"
605VALIGN="TOP"
606> a zero terminated string</TD
607></TR
608><TR
609><TD
610WIDTH="20%"
611ALIGN="RIGHT"
612VALIGN="TOP"
613><SPAN
614CLASS="emphasis"
615><I
616CLASS="EMPHASIS"
617>Returns</I
618></SPAN
619> :</TD
620><TD
621WIDTH="80%"
622ALIGN="LEFT"
623VALIGN="TOP"
624>the copy of the string or NULL in case of error.</TD
625></TR
626></TBODY
627></TABLE
628><P
629></P
630></DIV
631></DIV
632><HR><DIV
633CLASS="REFSECT2"
634><A
635NAME="AEN27328"
636></A
637><H3
638><A
639NAME="XMLMEMSETUP"
640></A
641>xmlMemSetup ()</H3
642><TABLE
643BORDER="0"
644BGCOLOR="#D6E8FF"
645WIDTH="100%"
646CELLPADDING="6"
647><TR
648><TD
649><PRE
650CLASS="PROGRAMLISTING"
651>int         xmlMemSetup                     (<A
652HREF="libxml-xmlmemory.html#XMLFREEFUNC"
653>xmlFreeFunc</A
654> freeFunc,
655                                             <A
656HREF="libxml-xmlmemory.html#XMLMALLOCFUNC"
657>xmlMallocFunc</A
658> mallocFunc,
659                                             <A
660HREF="libxml-xmlmemory.html#XMLREALLOCFUNC"
661>xmlReallocFunc</A
662> reallocFunc,
663                                             <A
664HREF="libxml-xmlmemory.html#XMLSTRDUPFUNC"
665>xmlStrdupFunc</A
666> strdupFunc);</PRE
667></TD
668></TR
669></TABLE
670><P
671>Override the default memory access functions with a new set
672This has to be called before any other libxml routines !</P
673><P
674>Should this be blocked if there was already some allocations
675done ?</P
676><P
677></P
678><DIV
679CLASS="INFORMALTABLE"
680><A
681NAME="AEN27339"><P
682></P
683><TABLE
684BORDER="0"
685WIDTH="100%"
686BGCOLOR="#FFD0D0"
687CELLSPACING="0"
688CELLPADDING="4"
689CLASS="CALSTABLE"
690><TBODY
691><TR
692><TD
693WIDTH="20%"
694ALIGN="RIGHT"
695VALIGN="TOP"
696><TT
697CLASS="PARAMETER"
698><I
699>freeFunc</I
700></TT
701>&nbsp;:</TD
702><TD
703WIDTH="80%"
704ALIGN="LEFT"
705VALIGN="TOP"
706> the <GTKDOCLINK
707HREF="FREE"
708>free</GTKDOCLINK
709>() function to use</TD
710></TR
711><TR
712><TD
713WIDTH="20%"
714ALIGN="RIGHT"
715VALIGN="TOP"
716><TT
717CLASS="PARAMETER"
718><I
719>mallocFunc</I
720></TT
721>&nbsp;:</TD
722><TD
723WIDTH="80%"
724ALIGN="LEFT"
725VALIGN="TOP"
726> the <GTKDOCLINK
727HREF="MALLOC"
728>malloc</GTKDOCLINK
729>() function to use</TD
730></TR
731><TR
732><TD
733WIDTH="20%"
734ALIGN="RIGHT"
735VALIGN="TOP"
736><TT
737CLASS="PARAMETER"
738><I
739>reallocFunc</I
740></TT
741>&nbsp;:</TD
742><TD
743WIDTH="80%"
744ALIGN="LEFT"
745VALIGN="TOP"
746> the <GTKDOCLINK
747HREF="REALLOC"
748>realloc</GTKDOCLINK
749>() function to use</TD
750></TR
751><TR
752><TD
753WIDTH="20%"
754ALIGN="RIGHT"
755VALIGN="TOP"
756><TT
757CLASS="PARAMETER"
758><I
759>strdupFunc</I
760></TT
761>&nbsp;:</TD
762><TD
763WIDTH="80%"
764ALIGN="LEFT"
765VALIGN="TOP"
766> the <GTKDOCLINK
767HREF="STRDUP"
768>strdup</GTKDOCLINK
769>() function to use</TD
770></TR
771><TR
772><TD
773WIDTH="20%"
774ALIGN="RIGHT"
775VALIGN="TOP"
776><SPAN
777CLASS="emphasis"
778><I
779CLASS="EMPHASIS"
780>Returns</I
781></SPAN
782> :</TD
783><TD
784WIDTH="80%"
785ALIGN="LEFT"
786VALIGN="TOP"
787>0 on success</TD
788></TR
789></TBODY
790></TABLE
791><P
792></P
793></DIV
794></DIV
795><HR><DIV
796CLASS="REFSECT2"
797><A
798NAME="AEN27368"
799></A
800><H3
801><A
802NAME="XMLMEMGET"
803></A
804>xmlMemGet ()</H3
805><TABLE
806BORDER="0"
807BGCOLOR="#D6E8FF"
808WIDTH="100%"
809CELLPADDING="6"
810><TR
811><TD
812><PRE
813CLASS="PROGRAMLISTING"
814>int         xmlMemGet                       (<A
815HREF="libxml-xmlmemory.html#XMLFREEFUNC"
816>xmlFreeFunc</A
817> *freeFunc,
818                                             <A
819HREF="libxml-xmlmemory.html#XMLMALLOCFUNC"
820>xmlMallocFunc</A
821> *mallocFunc,
822                                             <A
823HREF="libxml-xmlmemory.html#XMLREALLOCFUNC"
824>xmlReallocFunc</A
825> *reallocFunc,
826                                             <A
827HREF="libxml-xmlmemory.html#XMLSTRDUPFUNC"
828>xmlStrdupFunc</A
829> *strdupFunc);</PRE
830></TD
831></TR
832></TABLE
833><P
834>Return the memory access functions set currently in use</P
835><P
836></P
837><DIV
838CLASS="INFORMALTABLE"
839><A
840NAME="AEN27378"><P
841></P
842><TABLE
843BORDER="0"
844WIDTH="100%"
845BGCOLOR="#FFD0D0"
846CELLSPACING="0"
847CELLPADDING="4"
848CLASS="CALSTABLE"
849><TBODY
850><TR
851><TD
852WIDTH="20%"
853ALIGN="RIGHT"
854VALIGN="TOP"
855><TT
856CLASS="PARAMETER"
857><I
858>freeFunc</I
859></TT
860>&nbsp;:</TD
861><TD
862WIDTH="80%"
863ALIGN="LEFT"
864VALIGN="TOP"
865> the <GTKDOCLINK
866HREF="FREE"
867>free</GTKDOCLINK
868>() function in use</TD
869></TR
870><TR
871><TD
872WIDTH="20%"
873ALIGN="RIGHT"
874VALIGN="TOP"
875><TT
876CLASS="PARAMETER"
877><I
878>mallocFunc</I
879></TT
880>&nbsp;:</TD
881><TD
882WIDTH="80%"
883ALIGN="LEFT"
884VALIGN="TOP"
885> the <GTKDOCLINK
886HREF="MALLOC"
887>malloc</GTKDOCLINK
888>() function in use</TD
889></TR
890><TR
891><TD
892WIDTH="20%"
893ALIGN="RIGHT"
894VALIGN="TOP"
895><TT
896CLASS="PARAMETER"
897><I
898>reallocFunc</I
899></TT
900>&nbsp;:</TD
901><TD
902WIDTH="80%"
903ALIGN="LEFT"
904VALIGN="TOP"
905> the <GTKDOCLINK
906HREF="REALLOC"
907>realloc</GTKDOCLINK
908>() function in use</TD
909></TR
910><TR
911><TD
912WIDTH="20%"
913ALIGN="RIGHT"
914VALIGN="TOP"
915><TT
916CLASS="PARAMETER"
917><I
918>strdupFunc</I
919></TT
920>&nbsp;:</TD
921><TD
922WIDTH="80%"
923ALIGN="LEFT"
924VALIGN="TOP"
925> the <GTKDOCLINK
926HREF="STRDUP"
927>strdup</GTKDOCLINK
928>() function in use</TD
929></TR
930><TR
931><TD
932WIDTH="20%"
933ALIGN="RIGHT"
934VALIGN="TOP"
935><SPAN
936CLASS="emphasis"
937><I
938CLASS="EMPHASIS"
939>Returns</I
940></SPAN
941> :</TD
942><TD
943WIDTH="80%"
944ALIGN="LEFT"
945VALIGN="TOP"
946>0 on success</TD
947></TR
948></TBODY
949></TABLE
950><P
951></P
952></DIV
953></DIV
954><HR><DIV
955CLASS="REFSECT2"
956><A
957NAME="AEN27407"
958></A
959><H3
960><A
961NAME="XMLINITMEMORY"
962></A
963>xmlInitMemory ()</H3
964><TABLE
965BORDER="0"
966BGCOLOR="#D6E8FF"
967WIDTH="100%"
968CELLPADDING="6"
969><TR
970><TD
971><PRE
972CLASS="PROGRAMLISTING"
973>int         xmlInitMemory                   (void);</PRE
974></TD
975></TR
976></TABLE
977><P
978>Initialize the memory layer.</P
979><P
980></P
981><DIV
982CLASS="INFORMALTABLE"
983><A
984NAME="AEN27413"><P
985></P
986><TABLE
987BORDER="0"
988WIDTH="100%"
989BGCOLOR="#FFD0D0"
990CELLSPACING="0"
991CELLPADDING="4"
992CLASS="CALSTABLE"
993><TBODY
994><TR
995><TD
996WIDTH="20%"
997ALIGN="RIGHT"
998VALIGN="TOP"
999><SPAN
1000CLASS="emphasis"
1001><I
1002CLASS="EMPHASIS"
1003>Returns</I
1004></SPAN
1005> :</TD
1006><TD
1007WIDTH="80%"
1008ALIGN="LEFT"
1009VALIGN="TOP"
1010>0 on success</TD
1011></TR
1012></TBODY
1013></TABLE
1014><P
1015></P
1016></DIV
1017></DIV
1018><HR><DIV
1019CLASS="REFSECT2"
1020><A
1021NAME="AEN27422"
1022></A
1023><H3
1024><A
1025NAME="XMLMEMUSED"
1026></A
1027>xmlMemUsed ()</H3
1028><TABLE
1029BORDER="0"
1030BGCOLOR="#D6E8FF"
1031WIDTH="100%"
1032CELLPADDING="6"
1033><TR
1034><TD
1035><PRE
1036CLASS="PROGRAMLISTING"
1037>int         xmlMemUsed                      (void);</PRE
1038></TD
1039></TR
1040></TABLE
1041><P
1042>returns the amount of memory currently allocated</P
1043><P
1044></P
1045><DIV
1046CLASS="INFORMALTABLE"
1047><A
1048NAME="AEN27428"><P
1049></P
1050><TABLE
1051BORDER="0"
1052WIDTH="100%"
1053BGCOLOR="#FFD0D0"
1054CELLSPACING="0"
1055CELLPADDING="4"
1056CLASS="CALSTABLE"
1057><TBODY
1058><TR
1059><TD
1060WIDTH="20%"
1061ALIGN="RIGHT"
1062VALIGN="TOP"
1063><SPAN
1064CLASS="emphasis"
1065><I
1066CLASS="EMPHASIS"
1067>Returns</I
1068></SPAN
1069> :</TD
1070><TD
1071WIDTH="80%"
1072ALIGN="LEFT"
1073VALIGN="TOP"
1074>an int representing the amount of memory allocated.</TD
1075></TR
1076></TBODY
1077></TABLE
1078><P
1079></P
1080></DIV
1081></DIV
1082><HR><DIV
1083CLASS="REFSECT2"
1084><A
1085NAME="AEN27437"
1086></A
1087><H3
1088><A
1089NAME="XMLMEMDISPLAY"
1090></A
1091>xmlMemDisplay ()</H3
1092><TABLE
1093BORDER="0"
1094BGCOLOR="#D6E8FF"
1095WIDTH="100%"
1096CELLPADDING="6"
1097><TR
1098><TD
1099><PRE
1100CLASS="PROGRAMLISTING"
1101>void        xmlMemDisplay                   (<GTKDOCLINK
1102HREF="FILE-CAPS"
1103>FILE</GTKDOCLINK
1104> *fp);</PRE
1105></TD
1106></TR
1107></TABLE
1108><P
1109>show in-extenso the memory blocks allocated</P
1110><P
1111></P
1112><DIV
1113CLASS="INFORMALTABLE"
1114><A
1115NAME="AEN27444"><P
1116></P
1117><TABLE
1118BORDER="0"
1119WIDTH="100%"
1120BGCOLOR="#FFD0D0"
1121CELLSPACING="0"
1122CELLPADDING="4"
1123CLASS="CALSTABLE"
1124><TBODY
1125><TR
1126><TD
1127WIDTH="20%"
1128ALIGN="RIGHT"
1129VALIGN="TOP"
1130><TT
1131CLASS="PARAMETER"
1132><I
1133>fp</I
1134></TT
1135>&nbsp;:</TD
1136><TD
1137WIDTH="80%"
1138ALIGN="LEFT"
1139VALIGN="TOP"
1140>  a FILE descriptor used as the output file, if NULL, the result is
1141written to the file .memorylist</TD
1142></TR
1143></TBODY
1144></TABLE
1145><P
1146></P
1147></DIV
1148></DIV
1149><HR><DIV
1150CLASS="REFSECT2"
1151><A
1152NAME="AEN27453"
1153></A
1154><H3
1155><A
1156NAME="XMLMEMSHOW"
1157></A
1158>xmlMemShow ()</H3
1159><TABLE
1160BORDER="0"
1161BGCOLOR="#D6E8FF"
1162WIDTH="100%"
1163CELLPADDING="6"
1164><TR
1165><TD
1166><PRE
1167CLASS="PROGRAMLISTING"
1168>void        xmlMemShow                      (<GTKDOCLINK
1169HREF="FILE-CAPS"
1170>FILE</GTKDOCLINK
1171> *fp,
1172                                             int nr);</PRE
1173></TD
1174></TR
1175></TABLE
1176><P
1177>show a show display of the memory allocated, and dump
1178the <TT
1179CLASS="PARAMETER"
1180><I
1181>nr</I
1182></TT
1183> last allocated areas which were not freed</P
1184><P
1185></P
1186><DIV
1187CLASS="INFORMALTABLE"
1188><A
1189NAME="AEN27461"><P
1190></P
1191><TABLE
1192BORDER="0"
1193WIDTH="100%"
1194BGCOLOR="#FFD0D0"
1195CELLSPACING="0"
1196CELLPADDING="4"
1197CLASS="CALSTABLE"
1198><TBODY
1199><TR
1200><TD
1201WIDTH="20%"
1202ALIGN="RIGHT"
1203VALIGN="TOP"
1204><TT
1205CLASS="PARAMETER"
1206><I
1207>fp</I
1208></TT
1209>&nbsp;:</TD
1210><TD
1211WIDTH="80%"
1212ALIGN="LEFT"
1213VALIGN="TOP"
1214>  a FILE descriptor used as the output file</TD
1215></TR
1216><TR
1217><TD
1218WIDTH="20%"
1219ALIGN="RIGHT"
1220VALIGN="TOP"
1221><TT
1222CLASS="PARAMETER"
1223><I
1224>nr</I
1225></TT
1226>&nbsp;:</TD
1227><TD
1228WIDTH="80%"
1229ALIGN="LEFT"
1230VALIGN="TOP"
1231>  number of entries to dump</TD
1232></TR
1233></TBODY
1234></TABLE
1235><P
1236></P
1237></DIV
1238></DIV
1239><HR><DIV
1240CLASS="REFSECT2"
1241><A
1242NAME="AEN27474"
1243></A
1244><H3
1245><A
1246NAME="XMLMEMORYDUMP"
1247></A
1248>xmlMemoryDump ()</H3
1249><TABLE
1250BORDER="0"
1251BGCOLOR="#D6E8FF"
1252WIDTH="100%"
1253CELLPADDING="6"
1254><TR
1255><TD
1256><PRE
1257CLASS="PROGRAMLISTING"
1258>void        xmlMemoryDump                   (void);</PRE
1259></TD
1260></TR
1261></TABLE
1262><P
1263>Dump in-extenso the memory blocks allocated to the file .memorylist</P
1264><P
1265></P
1266></DIV
1267><HR><DIV
1268CLASS="REFSECT2"
1269><A
1270NAME="AEN27480"
1271></A
1272><H3
1273><A
1274NAME="XMLMALLOC"
1275></A
1276>xmlMalloc()</H3
1277><TABLE
1278BORDER="0"
1279BGCOLOR="#D6E8FF"
1280WIDTH="100%"
1281CELLPADDING="6"
1282><TR
1283><TD
1284><PRE
1285CLASS="PROGRAMLISTING"
1286>#define     xmlMalloc(size)</PRE
1287></TD
1288></TR
1289></TABLE
1290><P
1291>Wrapper for the <GTKDOCLINK
1292HREF="MALLOC"
1293>malloc</GTKDOCLINK
1294>() function used in the XML library.</P
1295><P
1296></P
1297><DIV
1298CLASS="INFORMALTABLE"
1299><A
1300NAME="AEN27487"><P
1301></P
1302><TABLE
1303BORDER="0"
1304WIDTH="100%"
1305BGCOLOR="#FFD0D0"
1306CELLSPACING="0"
1307CELLPADDING="4"
1308CLASS="CALSTABLE"
1309><TBODY
1310><TR
1311><TD
1312WIDTH="20%"
1313ALIGN="RIGHT"
1314VALIGN="TOP"
1315><TT
1316CLASS="PARAMETER"
1317><I
1318>size</I
1319></TT
1320>&nbsp;:</TD
1321><TD
1322WIDTH="80%"
1323ALIGN="LEFT"
1324VALIGN="TOP"
1325>  number of bytes to allocate</TD
1326></TR
1327></TBODY
1328></TABLE
1329><P
1330></P
1331></DIV
1332></DIV
1333><HR><DIV
1334CLASS="REFSECT2"
1335><A
1336NAME="AEN27496"
1337></A
1338><H3
1339><A
1340NAME="XMLREALLOC"
1341></A
1342>xmlRealloc()</H3
1343><TABLE
1344BORDER="0"
1345BGCOLOR="#D6E8FF"
1346WIDTH="100%"
1347CELLPADDING="6"
1348><TR
1349><TD
1350><PRE
1351CLASS="PROGRAMLISTING"
1352>#define     xmlRealloc(ptr, size)</PRE
1353></TD
1354></TR
1355></TABLE
1356><P
1357>Wrapper for the <GTKDOCLINK
1358HREF="REALLOC"
1359>realloc</GTKDOCLINK
1360>() function used in the XML library.</P
1361><P
1362></P
1363><DIV
1364CLASS="INFORMALTABLE"
1365><A
1366NAME="AEN27503"><P
1367></P
1368><TABLE
1369BORDER="0"
1370WIDTH="100%"
1371BGCOLOR="#FFD0D0"
1372CELLSPACING="0"
1373CELLPADDING="4"
1374CLASS="CALSTABLE"
1375><TBODY
1376><TR
1377><TD
1378WIDTH="20%"
1379ALIGN="RIGHT"
1380VALIGN="TOP"
1381><TT
1382CLASS="PARAMETER"
1383><I
1384>ptr</I
1385></TT
1386>&nbsp;:</TD
1387><TD
1388WIDTH="80%"
1389ALIGN="LEFT"
1390VALIGN="TOP"
1391>  pointer to the existing allocated area</TD
1392></TR
1393><TR
1394><TD
1395WIDTH="20%"
1396ALIGN="RIGHT"
1397VALIGN="TOP"
1398><TT
1399CLASS="PARAMETER"
1400><I
1401>size</I
1402></TT
1403>&nbsp;:</TD
1404><TD
1405WIDTH="80%"
1406ALIGN="LEFT"
1407VALIGN="TOP"
1408>  number of bytes to allocate</TD
1409></TR
1410></TBODY
1411></TABLE
1412><P
1413></P
1414></DIV
1415></DIV
1416><HR><DIV
1417CLASS="REFSECT2"
1418><A
1419NAME="AEN27516"
1420></A
1421><H3
1422><A
1423NAME="XMLMEMSTRDUP"
1424></A
1425>xmlMemStrdup()</H3
1426><TABLE
1427BORDER="0"
1428BGCOLOR="#D6E8FF"
1429WIDTH="100%"
1430CELLPADDING="6"
1431><TR
1432><TD
1433><PRE
1434CLASS="PROGRAMLISTING"
1435>#define     xmlMemStrdup(str)</PRE
1436></TD
1437></TR
1438></TABLE
1439><P
1440>Wrapper for the <GTKDOCLINK
1441HREF="STRDUP"
1442>strdup</GTKDOCLINK
1443>() function, <A
1444HREF="libxml-parser.html#XMLSTRDUP"
1445>xmlStrdup</A
1446>() is usually preferred.</P
1447><P
1448></P
1449><DIV
1450CLASS="INFORMALTABLE"
1451><A
1452NAME="AEN27524"><P
1453></P
1454><TABLE
1455BORDER="0"
1456WIDTH="100%"
1457BGCOLOR="#FFD0D0"
1458CELLSPACING="0"
1459CELLPADDING="4"
1460CLASS="CALSTABLE"
1461><TBODY
1462><TR
1463><TD
1464WIDTH="20%"
1465ALIGN="RIGHT"
1466VALIGN="TOP"
1467><TT
1468CLASS="PARAMETER"
1469><I
1470>str</I
1471></TT
1472>&nbsp;:</TD
1473><TD
1474WIDTH="80%"
1475ALIGN="LEFT"
1476VALIGN="TOP"
1477>  pointer to the existing string</TD
1478></TR
1479></TBODY
1480></TABLE
1481><P
1482></P
1483></DIV
1484></DIV
1485><HR><DIV
1486CLASS="REFSECT2"
1487><A
1488NAME="AEN27533"
1489></A
1490><H3
1491><A
1492NAME="XMLMALLOCLOC"
1493></A
1494>xmlMallocLoc ()</H3
1495><TABLE
1496BORDER="0"
1497BGCOLOR="#D6E8FF"
1498WIDTH="100%"
1499CELLPADDING="6"
1500><TR
1501><TD
1502><PRE
1503CLASS="PROGRAMLISTING"
1504>void*       xmlMallocLoc                    (<GTKDOCLINK
1505HREF="SIZE-T"
1506>size_t</GTKDOCLINK
1507> size,
1508                                             const char *file,
1509                                             int line);</PRE
1510></TD
1511></TR
1512></TABLE
1513><P
1514>a <GTKDOCLINK
1515HREF="MALLOC"
1516>malloc</GTKDOCLINK
1517>() equivalent, with logging of the allocation info.</P
1518><P
1519></P
1520><DIV
1521CLASS="INFORMALTABLE"
1522><A
1523NAME="AEN27541"><P
1524></P
1525><TABLE
1526BORDER="0"
1527WIDTH="100%"
1528BGCOLOR="#FFD0D0"
1529CELLSPACING="0"
1530CELLPADDING="4"
1531CLASS="CALSTABLE"
1532><TBODY
1533><TR
1534><TD
1535WIDTH="20%"
1536ALIGN="RIGHT"
1537VALIGN="TOP"
1538><TT
1539CLASS="PARAMETER"
1540><I
1541>size</I
1542></TT
1543>&nbsp;:</TD
1544><TD
1545WIDTH="80%"
1546ALIGN="LEFT"
1547VALIGN="TOP"
1548>  an int specifying the size in byte to allocate.</TD
1549></TR
1550><TR
1551><TD
1552WIDTH="20%"
1553ALIGN="RIGHT"
1554VALIGN="TOP"
1555><TT
1556CLASS="PARAMETER"
1557><I
1558>file</I
1559></TT
1560>&nbsp;:</TD
1561><TD
1562WIDTH="80%"
1563ALIGN="LEFT"
1564VALIGN="TOP"
1565>  the file name or NULL</TD
1566></TR
1567><TR
1568><TD
1569WIDTH="20%"
1570ALIGN="RIGHT"
1571VALIGN="TOP"
1572><TT
1573CLASS="PARAMETER"
1574><I
1575>line</I
1576></TT
1577>&nbsp;:</TD
1578><TD
1579WIDTH="80%"
1580ALIGN="LEFT"
1581VALIGN="TOP"
1582>  the line number</TD
1583></TR
1584></TBODY
1585></TABLE
1586><P
1587></P
1588></DIV
1589></DIV
1590><HR><DIV
1591CLASS="REFSECT2"
1592><A
1593NAME="AEN27558"
1594></A
1595><H3
1596><A
1597NAME="XMLREALLOCLOC"
1598></A
1599>xmlReallocLoc ()</H3
1600><TABLE
1601BORDER="0"
1602BGCOLOR="#D6E8FF"
1603WIDTH="100%"
1604CELLPADDING="6"
1605><TR
1606><TD
1607><PRE
1608CLASS="PROGRAMLISTING"
1609>void*       xmlReallocLoc                   (void *ptr,
1610                                             <GTKDOCLINK
1611HREF="SIZE-T"
1612>size_t</GTKDOCLINK
1613> size,
1614                                             const char *file,
1615                                             int line);</PRE
1616></TD
1617></TR
1618></TABLE
1619><P
1620>a <GTKDOCLINK
1621HREF="REALLOC"
1622>realloc</GTKDOCLINK
1623>() equivalent, with logging of the allocation info.</P
1624><P
1625></P
1626><DIV
1627CLASS="INFORMALTABLE"
1628><A
1629NAME="AEN27566"><P
1630></P
1631><TABLE
1632BORDER="0"
1633WIDTH="100%"
1634BGCOLOR="#FFD0D0"
1635CELLSPACING="0"
1636CELLPADDING="4"
1637CLASS="CALSTABLE"
1638><TBODY
1639><TR
1640><TD
1641WIDTH="20%"
1642ALIGN="RIGHT"
1643VALIGN="TOP"
1644><TT
1645CLASS="PARAMETER"
1646><I
1647>ptr</I
1648></TT
1649>&nbsp;:</TD
1650><TD
1651WIDTH="80%"
1652ALIGN="LEFT"
1653VALIGN="TOP"
1654>  the initial memory block pointer</TD
1655></TR
1656><TR
1657><TD
1658WIDTH="20%"
1659ALIGN="RIGHT"
1660VALIGN="TOP"
1661><TT
1662CLASS="PARAMETER"
1663><I
1664>size</I
1665></TT
1666>&nbsp;:</TD
1667><TD
1668WIDTH="80%"
1669ALIGN="LEFT"
1670VALIGN="TOP"
1671>  an int specifying the size in byte to allocate.</TD
1672></TR
1673><TR
1674><TD
1675WIDTH="20%"
1676ALIGN="RIGHT"
1677VALIGN="TOP"
1678><TT
1679CLASS="PARAMETER"
1680><I
1681>file</I
1682></TT
1683>&nbsp;:</TD
1684><TD
1685WIDTH="80%"
1686ALIGN="LEFT"
1687VALIGN="TOP"
1688>  the file name or NULL</TD
1689></TR
1690><TR
1691><TD
1692WIDTH="20%"
1693ALIGN="RIGHT"
1694VALIGN="TOP"
1695><TT
1696CLASS="PARAMETER"
1697><I
1698>line</I
1699></TT
1700>&nbsp;:</TD
1701><TD
1702WIDTH="80%"
1703ALIGN="LEFT"
1704VALIGN="TOP"
1705>  the line number</TD
1706></TR
1707></TBODY
1708></TABLE
1709><P
1710></P
1711></DIV
1712></DIV
1713><HR><DIV
1714CLASS="REFSECT2"
1715><A
1716NAME="AEN27587"
1717></A
1718><H3
1719><A
1720NAME="XMLMEMSTRDUPLOC"
1721></A
1722>xmlMemStrdupLoc ()</H3
1723><TABLE
1724BORDER="0"
1725BGCOLOR="#D6E8FF"
1726WIDTH="100%"
1727CELLPADDING="6"
1728><TR
1729><TD
1730><PRE
1731CLASS="PROGRAMLISTING"
1732>char*       xmlMemStrdupLoc                 (const char *str,
1733                                             const char *file,
1734                                             int line);</PRE
1735></TD
1736></TR
1737></TABLE
1738><P
1739>a <GTKDOCLINK
1740HREF="STRDUP"
1741>strdup</GTKDOCLINK
1742>() equivalent, with logging of the allocation info.</P
1743><P
1744></P
1745><DIV
1746CLASS="INFORMALTABLE"
1747><A
1748NAME="AEN27594"><P
1749></P
1750><TABLE
1751BORDER="0"
1752WIDTH="100%"
1753BGCOLOR="#FFD0D0"
1754CELLSPACING="0"
1755CELLPADDING="4"
1756CLASS="CALSTABLE"
1757><TBODY
1758><TR
1759><TD
1760WIDTH="20%"
1761ALIGN="RIGHT"
1762VALIGN="TOP"
1763><TT
1764CLASS="PARAMETER"
1765><I
1766>str</I
1767></TT
1768>&nbsp;:</TD
1769><TD
1770WIDTH="80%"
1771ALIGN="LEFT"
1772VALIGN="TOP"
1773>  the initial string pointer</TD
1774></TR
1775><TR
1776><TD
1777WIDTH="20%"
1778ALIGN="RIGHT"
1779VALIGN="TOP"
1780><TT
1781CLASS="PARAMETER"
1782><I
1783>file</I
1784></TT
1785>&nbsp;:</TD
1786><TD
1787WIDTH="80%"
1788ALIGN="LEFT"
1789VALIGN="TOP"
1790>  the file name or NULL</TD
1791></TR
1792><TR
1793><TD
1794WIDTH="20%"
1795ALIGN="RIGHT"
1796VALIGN="TOP"
1797><TT
1798CLASS="PARAMETER"
1799><I
1800>line</I
1801></TT
1802>&nbsp;:</TD
1803><TD
1804WIDTH="80%"
1805ALIGN="LEFT"
1806VALIGN="TOP"
1807>  the line number</TD
1808></TR
1809><TR
1810><TD
1811WIDTH="20%"
1812ALIGN="RIGHT"
1813VALIGN="TOP"
1814><SPAN
1815CLASS="emphasis"
1816><I
1817CLASS="EMPHASIS"
1818>Returns</I
1819></SPAN
1820> :</TD
1821><TD
1822WIDTH="80%"
1823ALIGN="LEFT"
1824VALIGN="TOP"
1825>a pointer to the new string or NULL if allocation error occurred.</TD
1826></TR
1827></TBODY
1828></TABLE
1829><P
1830></P
1831></DIV
1832></DIV
1833></DIV
1834><DIV
1835CLASS="NAVFOOTER"
1836><BR
1837CLEAR="all"><BR><TABLE
1838WIDTH="100%"
1839BORDER="0"
1840BGCOLOR="#000000"
1841CELLPADDING="1"
1842CELLSPACING="0"
1843><TR
1844><TD
1845WIDTH="25%"
1846BGCOLOR="#C00000"
1847ALIGN="left"
1848><A
1849HREF="libxml-debugxml.html"
1850><FONT
1851COLOR="#FFFFFF"
1852SIZE="3"
1853><B
1854>&#60;&#60;&#60; Previous Page</B
1855></FONT
1856></A
1857></TD
1858><TD
1859WIDTH="25%"
1860BGCOLOR="#0000C0"
1861ALIGN="center"
1862><FONT
1863COLOR="#FFFFFF"
1864SIZE="3"
1865><B
1866><A
1867HREF="book1.html"
1868><FONT
1869COLOR="#FFFFFF"
1870SIZE="3"
1871><B
1872>Home</B
1873></FONT
1874></A
1875></B
1876></FONT
1877></TD
1878><TD
1879WIDTH="25%"
1880BGCOLOR="#00C000"
1881ALIGN="center"
1882><FONT
1883COLOR="#FFFFFF"
1884SIZE="3"
1885><B
1886><A
1887HREF="libxml-lib.html"
1888><FONT
1889COLOR="#FFFFFF"
1890SIZE="3"
1891><B
1892>Up</B
1893></FONT
1894></A
1895></B
1896></FONT
1897></TD
1898><TD
1899WIDTH="25%"
1900BGCOLOR="#C00000"
1901ALIGN="right"
1902><A
1903HREF="libxml-xmlregexp.html"
1904><FONT
1905COLOR="#FFFFFF"
1906SIZE="3"
1907><B
1908>Next Page &#62;&#62;&#62;</B
1909></FONT
1910></A
1911></TD
1912></TR
1913><TR
1914><TD
1915COLSPAN="2"
1916ALIGN="left"
1917><FONT
1918COLOR="#FFFFFF"
1919SIZE="3"
1920><B
1921>debugXML</B
1922></FONT
1923></TD
1924><TD
1925COLSPAN="2"
1926ALIGN="right"
1927><FONT
1928COLOR="#FFFFFF"
1929SIZE="3"
1930><B
1931>xmlregexp</B
1932></FONT
1933></TD
1934></TR
1935></TABLE
1936></DIV
1937></BODY
1938></HTML
1939>