gwenhywfar  5.10.1
xmlcmd.c
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Sat Apr 18 2018
3  copyright : (C) 2020 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 
26 #ifdef HAVE_CONFIG_H
27 # include <config.h>
28 #endif
29 
30 
31 
32 #include "xmlcmd_p.h"
33 
34 #include <gwenhywfar/debug.h>
35 
36 
37 #include <ctype.h>
38 
39 
40 
42 
43 
44 
45 
47 {
48  GWEN_XMLCOMMANDER *cmd;
49 
51  assert(cmd);
53 
54  return cmd;
55 }
56 
57 
58 
60 {
61  if (cmd) {
63  GWEN_FREE_OBJECT(cmd);
64  }
65 }
66 
67 
68 
70 {
72 
73  oldFn=cmd->handleChildrenFn;
74  cmd->handleChildrenFn=f;
75  return oldFn;
76 }
77 
78 
79 
81 {
82  if (cmd->handleChildrenFn)
83  return (cmd->handleChildrenFn)(cmd, xmlNode);
84  else
86 }
87 
88 
89 
90 
91 
GWEN_XMLCMD_HANDLECHILDREN_FN GWEN_XmlCommander_SetHandleChildrenFn(GWEN_XMLCOMMANDER *cmd, GWEN_XMLCMD_HANDLECHILDREN_FN f)
Definition: xmlcmd.c:69
#define GWEN_INHERIT_FINI(t, element)
Definition: inherit.h:238
#define GWEN_FREE_OBJECT(varname)
Definition: memory.h:61
int(* GWEN_XMLCMD_HANDLECHILDREN_FN)(GWEN_XMLCOMMANDER *cmd, GWEN_XMLNODE *xmlNode)
Definition: xmlcmd.h:42
#define GWEN_NEW_OBJECT(typ, varname)
Definition: memory.h:55
#define GWEN_INHERIT_INIT(t, element)
Definition: inherit.h:223
void GWEN_XmlCommander_free(GWEN_XMLCOMMANDER *cmd)
Definition: xmlcmd.c:59
GWEN_XMLCOMMANDER * GWEN_XmlCommander_new(void)
Definition: xmlcmd.c:46
int GWEN_XmlCommander_HandleChildren(GWEN_XMLCOMMANDER *cmd, GWEN_XMLNODE *xmlNode)
Definition: xmlcmd.c:80
#define GWEN_INHERIT_FUNCTIONS(t)
Definition: inherit.h:163
struct GWEN__XMLNODE GWEN_XMLNODE
Definition: xml.h:156
struct GWEN_XMLCOMMANDER GWEN_XMLCOMMANDER
Definition: xmlcmd.h:39
#define GWEN_ERROR_NOT_IMPLEMENTED
Definition: error.h:108