kstars
lilxml.h
Go to the documentation of this file.00001 #if 0
00002 liblilxml
00003 Copyright (C) 2003 Elwood C. Downey
00004
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2.1 of the License, or (at your option) any later version.
00009
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013 Lesser General Public License for more details.
00014
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00018
00019 #endif
00020
00060 #ifndef LILXML_H
00061 #define LILXML_H
00062
00063 #include <stdio.h>
00064
00065 #ifdef __cplusplus
00066 extern "C" {
00067 #endif
00068
00069
00070 typedef struct _xml_att XMLAtt;
00071 typedef struct _xml_ele XMLEle;
00072 typedef struct _LilXML LilXML;
00073
00078
00079
00080
00084 extern LilXML *newLilXML(void);
00085
00089 extern void delLilXML (LilXML *lp);
00090
00094 extern void delXMLEle (XMLEle *e);
00095
00102 extern XMLEle *readXMLEle (LilXML *lp, int c, char errmsg[]);
00103
00104
00110 extern XMLAtt *findXMLAtt (XMLEle *e, const char *name);
00111
00117 extern XMLEle *findXMLEle (XMLEle *e, const char *tag);
00118
00119
00125 extern XMLEle *nextXMLEle (XMLEle *ep, int first);
00126
00132 extern XMLAtt *nextXMLAtt (XMLEle *ep, int first);
00133
00134
00138 extern XMLEle *parentXMLEle (XMLEle *ep);
00139
00143 extern XMLEle *parentXMLAtt (XMLAtt *ap);
00144
00145
00150 extern char *tagXMLEle (XMLEle *ep);
00151
00156 extern char *pcdataXMLEle (XMLEle *ep);
00157
00162 extern char *nameXMLAtt (XMLAtt *ap);
00163
00168 extern char *valuXMLAtt (XMLAtt *ap);
00169
00174 extern int pcdatalenXMLEle (XMLEle *ep);
00175
00180 extern int nXMLEle (XMLEle *ep);
00181
00186 extern int nXMLAtt (XMLEle *ep);
00187
00188
00192 extern XMLEle *addXMLEle (XMLEle *parent, const char *tag);
00193
00198 extern void editXMLEle (XMLEle *ep, const char *pcdata);
00199
00205 extern XMLAtt* addXMLAtt (XMLEle *ep, const char *name, const char *value);
00206
00211 extern void rmXMLAtt (XMLEle *ep, const char *name);
00212
00217 extern void editXMLAtt (XMLAtt *ap, const char *str);
00218
00222 extern char *entityXML (char *str);
00223
00224
00230 extern const char *findXMLAttValu (XMLEle *ep, const char *name);
00231
00238 extern XMLEle *readXMLFile (FILE *fp, LilXML *lp, char errmsg[]);
00239
00245 extern void prXMLEle (FILE *fp, XMLEle *e, int level);
00246
00252 extern int sprXMLEle (char *s, XMLEle *ep, int level);
00253
00257 extern int sprlXMLEle (XMLEle *ep, int level);
00258
00259
00260 extern void indi_xmlMalloc (void *(*newmalloc)(size_t size),
00261 void *(*newrealloc)(void *ptr, size_t size), void (*newfree)(void *ptr));
00262
00265 #ifdef __cplusplus
00266 }
00267 #endif
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302 #endif