Changeset 313
- Timestamp:
- 30/07/07 13:42:39 (16 months ago)
- Files:
-
- 1 modified
-
trunk/util/nad.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/util/nad.h
r219 r313 50 50 #endif 51 51 52 #include "pool.h" 52 /* jabberd2 Windows DLL */ 53 #ifndef JABBERD2_API 54 # ifdef _WIN32 55 # ifdef JABBERD2_EXPORTS 56 # define JABBERD2_API __declspec(dllexport) 57 # else /* JABBERD2_EXPORTS */ 58 # define JABBERD2_API __declspec(dllimport) 59 # endif /* JABBERD2_EXPORTS */ 60 # else /* _WIN32 */ 61 # define JABBERD2_API extern 62 # endif /* _WIN32 */ 63 #endif /* JABBERD2_API */ 64 65 typedef struct nad_st **nad_cache_t; 53 66 54 67 struct nad_elem_st { … … 76 89 }; 77 90 78 typedef struct _nad_st { 79 pool_t p; 91 typedef struct nad_st 92 { 93 nad_cache_t cache; /* he who gave us life */ 80 94 struct nad_elem_st *elems; 81 95 struct nad_attr_st *attrs; … … 86 100 int ecur, acur, ncur, ccur; 87 101 int scope; /* currently scoped namespaces, get attached to the next element */ 102 struct nad_st *next; /* for keeping a list of nads */ 88 103 } *nad_t; 89 104 105 /** create a new cache, simple pointer to a list of nads */ 106 JABBERD2_API nad_cache_t nad_cache_new(void); 107 108 /** free the cache and any nads in it */ 109 JABBERD2_API void nad_cache_free(nad_cache_t cache); 110 90 111 /** create a new nad */ 91 JABBERD2_API nad_t nad_new( pool_t p);112 JABBERD2_API nad_t nad_new(nad_cache_t cache); 92 113 93 114 /** copy a nad */ 94 115 JABBERD2_API nad_t nad_copy(nad_t nad); 116 117 /** free that nad */ 118 JABBERD2_API void nad_free(nad_t nad); 95 119 96 120 /** find the next element with this name/depth */ … … 151 175 /** serialize and deserialize a nad */ 152 176 JABBERD2_API void nad_serialize(nad_t nad, char **buf, int *len); 153 JABBERD2_API nad_t nad_deserialize( pool_t p, const char *buf);177 JABBERD2_API nad_t nad_deserialize(nad_cache_t cache, const char *buf); 154 178 155 179 /** create a nad from raw xml */ 156 JABBERD2_API nad_t nad_parse( pool_t p, const char *buf, int len);180 JABBERD2_API nad_t nad_parse(nad_cache_t cache, const char *buf, int len); 157 181 158 182 /* these are some helpful macros */
