gwenhywfar
4.3.3
|
00001 /*************************************************************************** 00002 $RCSfile$ 00003 ------------------- 00004 cvs : $Id: xsd.h 898 2005-11-03 09:51:39Z cstim $ 00005 begin : Sat Jun 28 2003 00006 copyright : (C) 2003 by Martin Preuss 00007 email : martin@libchipcard.de 00008 00009 *************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or * 00012 * modify it under the terms of the GNU Lesser General Public * 00013 * License as published by the Free Software Foundation; either * 00014 * version 2.1 of the License, or (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 00024 * MA 02111-1307 USA * 00025 * * 00026 ***************************************************************************/ 00027 00028 #ifndef GWENHYWFAR_XMLCTX_H 00029 #define GWENHYWFAR_XMLCTX_H 00030 00031 #include <gwenhywfar/gwenhywfarapi.h> 00032 #include <gwenhywfar/inherit.h> 00033 #include <stdio.h> 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif 00038 00039 typedef struct GWEN_XML_CONTEXT GWEN_XML_CONTEXT; 00040 GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_XML_CONTEXT, GWENHYWFAR_API) 00041 00042 00043 #include <gwenhywfar/xml.h> 00044 00045 00046 00047 typedef int (*GWEN_XMLCTX_STARTTAG_FN)(GWEN_XML_CONTEXT *ctx, 00048 const char *tagName); 00049 typedef int (*GWEN_XMLCTX_ENDTAG_FN)(GWEN_XML_CONTEXT *ctx, int closing); 00050 typedef int (*GWEN_XMLCTX_ADDDATA_FN)(GWEN_XML_CONTEXT *ctx, 00051 const char *data); 00052 typedef int (*GWEN_XMLCTX_ADDCOMMENT_FN)(GWEN_XML_CONTEXT *ctx, 00053 const char *data); 00054 typedef int (*GWEN_XMLCTX_ADDATTR_FN)(GWEN_XML_CONTEXT *ctx, 00055 const char *attrName, 00056 const char *attrData); 00057 00058 00059 00060 GWENHYWFAR_API GWEN_XML_CONTEXT *GWEN_XmlCtx_new(uint32_t flags); 00061 GWENHYWFAR_API void GWEN_XmlCtx_free(GWEN_XML_CONTEXT *ctx); 00062 GWENHYWFAR_API void GWEN_XmlCtx_Attach(GWEN_XML_CONTEXT *ctx); 00063 00064 GWENHYWFAR_API 00065 uint32_t GWEN_XmlCtx_GetFlags(const GWEN_XML_CONTEXT *ctx); 00066 00067 GWENHYWFAR_API 00068 void GWEN_XmlCtx_SetFlags(GWEN_XML_CONTEXT *ctx, uint32_t f); 00069 00070 00071 GWENHYWFAR_API 00072 uint32_t GWEN_XmlCtx_GetFinishedElement(const GWEN_XML_CONTEXT *ctx); 00073 00074 GWENHYWFAR_API 00075 void GWEN_XmlCtx_IncFinishedElement(GWEN_XML_CONTEXT *ctx); 00076 00077 GWENHYWFAR_API 00078 void GWEN_XmlCtx_ResetFinishedElement(GWEN_XML_CONTEXT *ctx); 00079 00080 00081 GWENHYWFAR_API 00082 int GWEN_XmlCtx_GetDepth(const GWEN_XML_CONTEXT *ctx); 00083 00084 GWENHYWFAR_API 00085 void GWEN_XmlCtx_SetDepth(GWEN_XML_CONTEXT *ctx, int i); 00086 00087 GWENHYWFAR_API 00088 void GWEN_XmlCtx_IncDepth(GWEN_XML_CONTEXT *ctx); 00089 00090 GWENHYWFAR_API 00091 int GWEN_XmlCtx_DecDepth(GWEN_XML_CONTEXT *ctx); 00092 00093 00094 GWENHYWFAR_API 00095 void GWEN_XmlCtx_SetCurrentNode(GWEN_XML_CONTEXT *ctx, GWEN_XMLNODE *n); 00096 00097 GWENHYWFAR_API 00098 GWEN_XMLNODE *GWEN_XmlCtx_GetCurrentNode(const GWEN_XML_CONTEXT *ctx); 00099 00100 GWENHYWFAR_API 00101 void GWEN_XmlCtx_SetCurrentHeader(GWEN_XML_CONTEXT *ctx, GWEN_XMLNODE *n); 00102 00103 GWENHYWFAR_API 00104 GWEN_XMLNODE *GWEN_XmlCtx_GetCurrentHeader(const GWEN_XML_CONTEXT *ctx); 00105 00106 GWENHYWFAR_API 00107 GWEN_XMLCTX_STARTTAG_FN GWEN_XmlCtx_SetStartTagFn(GWEN_XML_CONTEXT *ctx, 00108 GWEN_XMLCTX_STARTTAG_FN f); 00109 00110 GWENHYWFAR_API 00111 GWEN_XMLCTX_ENDTAG_FN GWEN_XmlCtx_SetEndTagFn(GWEN_XML_CONTEXT *ctx, 00112 GWEN_XMLCTX_ENDTAG_FN f); 00113 00114 GWENHYWFAR_API 00115 GWEN_XMLCTX_ADDDATA_FN GWEN_XmlCtx_SetAddDataFn(GWEN_XML_CONTEXT *ctx, 00116 GWEN_XMLCTX_ADDDATA_FN f); 00117 00118 GWENHYWFAR_API 00119 GWEN_XMLCTX_ADDCOMMENT_FN 00120 GWEN_XmlCtx_SetAddCommentFn(GWEN_XML_CONTEXT *ctx, 00121 GWEN_XMLCTX_ADDCOMMENT_FN f); 00122 00123 GWENHYWFAR_API 00124 GWEN_XMLCTX_ADDATTR_FN GWEN_XmlCtx_SetAddAttrFn(GWEN_XML_CONTEXT *ctx, 00125 GWEN_XMLCTX_ADDATTR_FN f); 00126 00127 00128 00129 00130 00131 GWENHYWFAR_API 00132 GWEN_XML_CONTEXT *GWEN_XmlCtxStore_new(GWEN_XMLNODE *n, uint32_t flags); 00133 00134 00135 #ifdef __cplusplus 00136 } 00137 #endif 00138 00139 00140 #endif 00141