Volksdata 1.0b7
RDF library
Loading...
Searching...
No Matches
namespace.h
Go to the documentation of this file.
1#ifndef VOLK_NAMESPACE_H
2#define VOLK_NAMESPACE_H
3
4#include "hashmap.h"
5
6#include "volksdata/core.h"
7
8
13
16#define PFX_LEN 8
17
18
21typedef char VOLK_ns_pfx[PFX_LEN];
22
23
26typedef struct ns_entry_t {
27 VOLK_ns_pfx pfx; // Namespace prefix.
28 char * ns; // Fully qualified NS.
29} NSEntry;
30
31
37extern struct hashmap *VOLK_default_nsm;
38
39
52VOLK_nsmap_add (const char *pfx, const char *nsstr);
53
54
62VOLK_nsmap_remove (const char *pfx);
63
64
72const char *
73VOLK_nsmap_get_ns (const char *pfx);
74
75
82const char *
83VOLK_nsmap_get_pfx (const char *ns);
84
85
100VOLK_nsmap_normalize_uri (const char *pfx_uri, char **fq_uri);
101
102
123VOLK_nsmap_denormalize_uri (const char *fq_uri, char **pfx_uri);
124
125
140const char ***
141VOLK_nsmap_dump (void);
142
144
145#endif // VOLK_NAMESPACE_H
VOLK_rc VOLK_nsmap_remove(const char *pfx)
Remove a prefix -> namespace pair from a map.
Definition namespace.c:70
const char * VOLK_nsmap_get_pfx(const char *ns)
Get the prefix for a namespace.
Definition namespace.c:96
struct hashmap * VOLK_default_nsm
Default namespace prefix map.
Definition namespace.c:38
VOLK_rc VOLK_nsmap_normalize_uri(const char *pfx_uri, char **fq_uri)
Convert a namespace-prefixed string to a FQ URI sring if mapped.
Definition namespace.c:110
const char * VOLK_nsmap_get_ns(const char *pfx)
Get the namespace for a prefix.
Definition namespace.c:85
const char *** VOLK_nsmap_dump(void)
Dump all entries of the namespace map.
Definition namespace.c:191
VOLK_rc VOLK_nsmap_denormalize_uri(const char *fq_uri, char **pfx_uri)
Convert a FQ URI string to a prefixed string if the prefix is found.
Definition namespace.c:153
VOLK_rc VOLK_nsmap_add(const char *pfx, const char *nsstr)
Add a prefix -> namespace pair to the map or update it.
Definition namespace.c:42
char VOLK_ns_pfx[PFX_LEN]
Namespace prefix type.
Definition namespace.h:21
#define PFX_LEN
Namespace prefix length, including terminator.
Definition namespace.h:16
int VOLK_rc
Definition core.h:79
Prefix / Namespace pair.
Definition namespace.h:26
char * ns
Definition namespace.h:28
VOLK_ns_pfx pfx
Definition namespace.h:27