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