gwenhywfar  4.3.1
g_generic.c
Go to the documentation of this file.
00001 /***************************************************************************
00002  begin       : Sat Feb 20 2010
00003  copyright   : (C) 2010 by Martin Preuss
00004  email       : martin@libchipcard.de
00005 
00006  ***************************************************************************
00007  *          Please see toplevel file COPYING for license details           *
00008  ***************************************************************************/
00009 
00010 
00011 #ifdef HAVE_CONFIG_H
00012 # include <config.h>
00013 #endif
00014 
00015 #define DISABLE_DEBUGLOG
00016 
00017 #include "g_generic_p.h"
00018 #include "htmlctx_l.h"
00019 
00020 #include <gwenhywfar/misc.h>
00021 #include <gwenhywfar/debug.h>
00022 
00023 
00024 
00025 
00026 HTML_GROUP *HtmlGroup_Generic_new(const char *groupName,
00027                                   HTML_GROUP *parent,
00028                                   GWEN_XML_CONTEXT *ctx) {
00029   HTML_GROUP *g;
00030 
00031   /* create base group */
00032   g=HtmlGroup_new(groupName, parent, ctx);
00033   assert(g);
00034 
00035   /* set virtual functions */
00036   HtmlGroup_SetEndTagFn(g, HtmlGroup_Generic_EndTag);
00037   HtmlGroup_SetAddDataFn(g, HtmlGroup_Generic_AddData);
00038   HtmlGroup_SetEndSubGroupFn(g, HtmlGroup_Generic_EndSubGroup);
00039 
00040   return g;
00041 }
00042 
00043 
00044 
00045 int HtmlGroup_Generic_EndTag(HTML_GROUP *g, const char *tagName) {
00046   assert(g);
00047 
00048   if (strcasecmp(HtmlGroup_GetGroupName(g), tagName)!=0) {
00049     DBG_INFO(GWEN_LOGDOMAIN,
00050              "Tag [%s] does not close [%s], ignoring",
00051              tagName, HtmlGroup_GetGroupName(g));
00052     /*return GWEN_ERROR_BAD_DATA;*/
00053     return 0;
00054   }
00055 
00056   /* always end this tag */
00057   return 1;
00058 }
00059 
00060 
00061 
00062 int HtmlGroup_Generic_AddData(HTML_GROUP *g, const char *data) {
00063   assert(g);
00064 
00065   /* just ignore the data */
00066   return 0;
00067 }
00068 
00069 
00070 
00071 int HtmlGroup_Generic_EndSubGroup(HTML_GROUP *g, HTML_GROUP *sg){
00072   assert(g);
00073 
00074   /* just ignore the end of sub group */
00075   return 0;
00076 }
00077 
00078 
00079 
00080 
00081 
00082 
00083 
00084 
00085 
00086 
00087