gwenhywfar  4.3.3
xml.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Sat Jun 28 2003
3  copyright : (C) 2003-2010 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
25 #ifndef GWENHYWFAR_XML_H
26 #define GWENHYWFAR_XML_H
27 
28 #include <gwenhywfar/gwenhywfarapi.h>
29 #include <gwenhywfar/stringlist.h>
30 #include <gwenhywfar/types.h>
31 #include <gwenhywfar/list2.h>
32 #include <gwenhywfar/syncio.h>
33 
34 #include <stdio.h>
35 
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
46 
51 
52 
56 
60 #define GWEN_XML_FLAGS_HANDLE_COMMENTS 0x0001
61 
66 #define GWEN_XML_FLAGS_INDENT 0x0002
67 
73 #define GWEN_XML_FLAGS_HANDLE_OPEN_HTMLTAGS 0x0004
74 
79 #define GWEN_XML_FLAGS_NO_CONDENSE 0x0008
80 
85 #define GWEN_XML_FLAGS_KEEP_CNTRL 0x0010
86 
87 #define GWEN_XML_FLAGS_KEEP_BLANKS 0x0020
88 
89 #define GWEN_XML_FLAGS_SIMPLE 0x0040
90 
94 #define GWEN_XML_FLAGS_HANDLE_HEADERS 0x0080
95 
103 #define GWEN_XML_FLAGS_TOLERANT_ENDTAGS 0x0100
104 
105 #define GWEN_XML_FLAGS_HANDLE_NAMESPACES 0x0200
106 
110 #define GWEN_XML_FLAGS_DEFAULT \
111  (\
112  GWEN_XML_FLAGS_INDENT | \
113  GWEN_XML_FLAGS_HANDLE_COMMENTS\
114  )
115 
121 typedef enum {
130 
134 typedef struct GWEN__XMLNODE GWEN_XMLNODE;
136 
139 
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 
147 #include <gwenhywfar/xmlctx.h>
148 #include <gwenhywfar/fastbuffer.h>
149 
150 
151 #ifdef __cplusplus
152 extern "C" {
153 #endif
154 
155 
156 
162 GWEN_XMLNODE *GWEN_XMLNode_new(GWEN_XMLNODE_TYPE t, const char *data);
163 
169 
177 
183 
207 
214 
220 
227 
234 
259  const char *GWEN_XMLNode_GetProperty(const GWEN_XMLNODE *n,
260  const char *name,
261  const char *defaultValue);
262 
272  const char *name,
273  const char *value);
274 
286  const GWEN_XMLNODE *sn,
287  int overwrite);
297 
300 const char *GWEN_XMLNode_GetData(const GWEN_XMLNODE *n);
301 
305 void GWEN_XMLNode_SetData(GWEN_XMLNODE *n, const char *data);
306 
308 const char *GWEN_XMLNode_GetNamespace(const GWEN_XMLNODE *n);
309 
311 void GWEN_XMLNode_SetNamespace(GWEN_XMLNODE *n, const char *s);
312 
332 
335 
337  uint32_t GWEN_XMLNode_GetUsage(const GWEN_XMLNODE *n);
356 
366 
371 
382 
396 
406 
420 
448  const char *tname,
449  const char *pname,
450  const char *pvalue);
451 
459  const char *tname,
460  const char *pname,
461  const char *pvalue);
462 
468 int GWEN_XMLNode_IsChildOf(const GWEN_XMLNODE *parent,
469  const GWEN_XMLNODE *child);
470 
472 int GWEN_XMLNode_GetXPath(const GWEN_XMLNODE *n1,
473  const GWEN_XMLNODE *n2,
474  GWEN_BUFFER *nbuf);
475 
490  const char *path,
491  uint32_t flags);
492 
493 
501 
512 
522 
528 
541  int copythem);
542 
551  const char *data);
559 
566 
567 
568 
571 
572 
575 
576 
579  GWEN_XMLNODE_NAMESPACE_LIST *l,
580  uint32_t *pLastId);
581 
582 
585 
591 
593 int GWEN_XMLContext_ReadFromFile(GWEN_XML_CONTEXT *ctx, const char *fname);
594 
596 int GWEN_XMLContext_ReadFromString(GWEN_XML_CONTEXT *ctx, const char *text);
597 
598 
604 int GWEN_XML_ReadFile(GWEN_XMLNODE *n, const char *filepath, uint32_t flags);
605 
608  int len,
609  uint32_t flags);
610 
616  GWEN_XML_CONTEXT *ctx,
617  GWEN_SYNCIO *sio);
618 
624  const char *fname,
625  uint32_t flags);
626 
628 int GWEN_XMLNode_toBuffer(const GWEN_XMLNODE *n, GWEN_BUFFER *buf, uint32_t flags);
629 
630 
631 
632 
634 GWEN_XMLNODE_NAMESPACE_LIST *GWEN_XMLNode_GetNameSpaces(const GWEN_XMLNODE *n);
635 
638  const char *s);
639 
642  const char *s);
643 
646 
647 
648 
673 
680 const char *GWEN_XMLNode_GetCharValue(const GWEN_XMLNODE *n,
681  const char *name,
682  const char *defValue);
683 
686  const char *name,
687  const char *value);
688 
703  const char *name,
704  const char *defValue);
705 
715  const char *name,
716  int defValue);
717 
720  const char *name,
721  int value);
722 
730 
735 void GWEN_XMLNode_Dump(const GWEN_XMLNODE *n, int ind);
738  /* defgroup */
739 
740 
748 
750 
751 
758 
764  GWEN_XMLNODE *n);
765 
772 
777 void GWEN_XMLNode_Path_Dump(GWEN_XMLNODE_PATH *np); /* defgroup */ /* defgroup (all)*/
780 
781 
782 
785  const char *url);
786 
789 
792 
795 
798 
799 
800 #ifdef __cplusplus
801 }
802 #endif
803 
804 
805 
806 #endif