summaryrefslogtreecommitdiff
path: root/xmlspec/xmlverify.h
blob: d1eff3db81716697754070240eebefef66babadb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef _XML_VERIFY_H_
#define _XML_VERIFY_H_

#include "xmlparse.h"

typedef enum enumXMLTagVals
{
	TAGVAL_SPEC                   = 0,
	TAGVAL_MACRO,
	TAGVAL_SOURCE,
	TAGVAL_SOURCEMIRROR,
	TAGVAL_PATCH,
	TAGVAL_PATCHMIRROR,
	TAGVAL_BUILDREQUIRES,
	TAGVAL_BUILDREQUIRE,
	TAGVAL_BUILDSUGGESTS,
	TAGVAL_BUILDSUGGEST,
	TAGVAL_PACKAGE,
	TAGVAL_PROVIDE,
	TAGVAL_PROVIDES,
	TAGVAL_REQUIRES,
	TAGVAL_REQUIRE,
	TAGVAL_OBSOLETES,
	TAGVAL_OBSOLETE,
	TAGVAL_CONFLICTS,
	TAGVAL_CONFLICT,
	TAGVAL_SUGGESTS,
	TAGVAL_SUGGEST,
	TAGVAL_SUMMARY,
	TAGVAL_DESCRIPTION,
	TAGVAL_PRE,
	TAGVAL_POST,
	TAGVAL_PREUN,
	TAGVAL_POSTUN,
	TAGVAL_VERIFY,
	TAGVAL_FILES,
	TAGVAL_PREP,
	TAGVAL_BUILD,
	TAGVAL_INSTALL,
	TAGVAL_CLEAN,
	TAGVAL_SCRIPT,
	TAGVAL_SETUPMACRO,
	TAGVAL_PATCHMACRO,
	TAGVAL_CHANGELOG,
	TAGVAL_CHANGES,
	TAGVAL_CHANGE,
	TAGVAL_LAST                   = 0xFFFF
} t_enumXMLTagVals;

typedef enum enumXMLAttrTypes
{
	ATTRTYPE_ANY                  = 0,
	ATTRTYPE_ALPHA,
	ATTRTYPE_NUMERIC,
	ATTRTYPE_BOOL,
	ATTRTYPE_EMAIL,
	ATTRTYPE_DATE,
	ATTRTYPE_CMP,
	ATTRTYPE_SRCFILE,
	ATTRTYPE_SCRIPT,
	ATTRTYPE_URL,
	ATTRTYPE_MD5,
	ATTRTYPE_COUNTRY,
	ATTRTYPE_LAST                 = 0xFFFF
} t_enumXMLAttrTypes;

typedef struct structXMLAttrAttr
{
	char* m_szName;
	int   m_nType;
	int   m_nMandatory;
} t_structXMLAttrAttr;

typedef struct structXMLTags
{
	char*               m_szName;
	int                 m_nValue;
	int                 m_nLevel;
	int                 m_naTree[MAX_XML_LEVELS];
	t_structXMLAttrAttr m_saAttrs[MAX_XML_ATTRS];
} t_structXMLTags;

#ifndef NO_XMLTAGS_EXTERN
extern t_structXMLTags g_pXMLTags[];
#endif

int verifyXMLPath(const char* szName,
		  t_structXMLParse* pParse);

int verifyXMLAttr(const char* szAttr,
		  t_structXMLParse* pParse,
		  int nTagPos);

int verifyXMLAttrs(const char** szaAttrs,
		   t_structXMLParse* pParse,
		   int nTagPos);

#endif