00001 /* 00002 Copyright (c) 2007, Forkbeard team 00003 00004 All rights reserved. 00005 00006 Licensed under BSD license. See License.txt 00007 */ 00008 00068 #ifndef _XML_PRINT_H 00069 #define _XML_PRINT_H 00070 00071 #include <stdlib.h> 00072 #include <malloc.h> 00073 #include <stdio.h> 00074 #include <string.h> 00075 00082 struct _xmlprintTag 00083 { 00084 struct _xmlprintTag *parent; 00085 char *tag; 00086 }; 00087 00090 typedef struct _xmlprintTag xmlprintTag; 00091 00104 struct _xmlprintOutput 00105 { 00106 xmlprintTag * toptag; 00107 int numberofspaces; 00108 }; 00109 00112 typedef struct _xmlprintOutput xmlprintOutput; 00113 00114 /* XML special character definition */ 00115 00116 #define AMP "&" 00117 #define LT "<" 00118 #define GT ">" 00119 #define APOS "'" 00120 #define QUOT """ 00124 /* --------------------------------------------------------------------------*/ 00125 00131 xmlprintOutput * xmlprint_createoutput(); 00132 /* --------------------------------------------------------------------------*/ 00133 00134 00135 00136 /* --------------------------------------------------------------------------*/ 00147 void xmlprint_oneliner(xmlprintOutput *output, char * tag, char *attributes); 00148 /* --------------------------------------------------------------------------*/ 00149 00150 00151 00152 /* --------------------------------------------------------------------------*/ 00166 xmlprintOutput * xmlprint_addtag(xmlprintOutput *output, char * tag, char *attributes); 00167 /* --------------------------------------------------------------------------*/ 00168 00169 00170 00171 /* --------------------------------------------------------------------------*/ 00180 void xmlprint_addtagvalue(xmlprintOutput *output, char * value); 00181 /* --------------------------------------------------------------------------*/ 00182 00183 00184 00185 /* --------------------------------------------------------------------------*/ 00194 xmlprintOutput * xmlprint_endtag(xmlprintOutput *output); 00195 /* --------------------------------------------------------------------------*/ 00196 00197 00198 00199 /* --------------------------------------------------------------------------*/ 00209 void xmlprint_closeoutput(xmlprintOutput *output); 00210 /* --------------------------------------------------------------------------*/ 00211 00212 /* --------------------------------------------------------------------------*/ 00223 char *doSpecialCharacters(char *source, int attribute); 00224 /* --------------------------------------------------------------------------*/ 00225 00226 00227 #endif