File: namespaces.h

package info (click to toggle)
rxp 1.2.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 436 kB
  • ctags: 966
  • sloc: ansic: 9,679; makefile: 127; sh: 3
file content (81 lines) | stat: -rw-r--r-- 2,509 bytes parent folder | download | duplicates (2)
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
#ifndef NAMESPACES_H
#define NAMESPACES_H

#include "charset.h"
#include "rxputil.h"

#ifdef __cplusplus
/* unfortunately the word "namespace" is reserved in C++ */
#define RXP_NAMESPACE name_space
#else
#define RXP_NAMESPACE namespace
#endif

typedef struct namespace_universe *NamespaceUniverse;
typedef struct RXP_NAMESPACE *Namespace;
typedef struct ns_element_definition *NSElementDefinition;
typedef struct ns_attribute_definition *NSAttributeDefinition;

struct namespace_universe {
    Vector(Namespace, namespaces);
};

struct RXP_NAMESPACE {
    char8 *uri;
    NamespaceUniverse universe;
    Vector(NSElementDefinition, elements);
    Vector(NSAttributeDefinition, attributes);
    int nsnum;
};

struct ns_element_definition {
    const Char *name;
    Namespace RXP_NAMESPACE;
    Vector(NSAttributeDefinition, attributes);
    int eltnum;
};

struct ns_attribute_definition {
    Namespace RXP_NAMESPACE;
    NSElementDefinition element;
    const Char *name;
    int attrnum;
};

XML_API int init_namespaces(void);
XML_API void deinit_namespaces(void);
XML_API int reinit_namespaces(void);

XML_API NamespaceUniverse NewNamespaceUniverse(void);
XML_API Namespace NewNamespace(NamespaceUniverse universe, const char8 *uri);
XML_API void FreeNamespaceUniverse(NamespaceUniverse universe);

XML_API NSElementDefinition DefineNSElement(Namespace ns, const Char *name);
XML_API NSAttributeDefinition 
    DefineNSGlobalAttribute(Namespace ns, const Char *name);
XML_API NSAttributeDefinition
     DefineNSElementAttribute(NSElementDefinition element, const Char *name);

XML_API Namespace 
    FindNamespace(NamespaceUniverse universe, const char8 *uri, int create);
XML_API NSElementDefinition
    FindNSElementDefinition(Namespace ns, const Char *name, int create);
XML_API NSAttributeDefinition
    FindNSGlobalAttributeDefinition(Namespace ns,
				    const Char *name, int create);
XML_API NSAttributeDefinition
    FindNSElementAttributeDefinition(NSElementDefinition element,
				     const Char *name, int create);

XML_API Namespace 
    NextNamespace(NamespaceUniverse universe, Namespace previous);
XML_API NSElementDefinition
    NextNSElementDefinition(Namespace ns, NSElementDefinition previous);
XML_API NSAttributeDefinition
    NextNSGlobalAttributeDefinition(Namespace ns, 
				    NSAttributeDefinition previous);
XML_API NSAttributeDefinition
    NextNSElementAttributeDefinition(NSElementDefinition element,
				     NSAttributeDefinition previous);

#endif /* NAMESPACES_H */