JabberWerxC  2015.1.1
jid.h
Go to the documentation of this file.
1 
27 #ifndef JABBERWERX_JID_H
28 #define JABBERWERX_JID_H
29 
30 #include "util/mem.h"
31 
32 
34 typedef struct _jw_jid_ctx_int jw_jid_ctx;
35 
37 typedef struct _jw_jid_int jw_jid;
38 
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
64 JABBERWERX_API bool jw_jid_context_create(size_t bucket_count,
65  jw_jid_ctx **ctx,
66  jw_err *err);
67 
76 
88  bool destroy_key,
89  void *key,
90  void *data);
91 
102 
125  const char *jidstr,
126  jw_jid **jid,
127  jw_err *err);
128 
159  const char *localpart,
160  const char *domainpart,
161  const char *resourcepart,
162  jw_jid **jid,
163  jw_err *err);
164 
173 
181 
189 
208  jw_jid *jid,
209  jw_jid **cpy,
210  jw_err *err);
211 
220 JABBERWERX_API bool jw_jid_valid(const char *jidstr);
221 
230 JABBERWERX_API const char *jw_jid_get_localpart(jw_jid *jid);
231 
239 JABBERWERX_API const char *jw_jid_get_domain(jw_jid *jid);
240 
249 JABBERWERX_API const char *jw_jid_get_resource(jw_jid *jid);
250 
259 JABBERWERX_API const char *jw_jid_get_bare(jw_jid *jid);
260 
269 JABBERWERX_API const char *jw_jid_get_full(jw_jid *jid);
270 
284 
303 JABBERWERX_API int jw_jid_cmp(jw_jid *lhs, jw_jid *rhs);
304 
323 JABBERWERX_API bool jw_jid_escape_localpart(const char *localpart,
324  char **result,
325  size_t *result_len,
326  jw_err *err);
327 
346 JABBERWERX_API bool jw_jid_unescape_localpart(const char *localpart,
347  char **result,
348  size_t *result_len,
349  jw_err *err);
350 
351 #ifdef __cplusplus
352 }
353 #endif
354 
355 #endif /* JABBERWERX_JID_H */
JABBERWERX_API jw_jid_ctx * jw_jid_get_context(jw_jid *jid)
#define JABBERWERX_API
Definition: basics.h:32
JABBERWERX_API bool jw_jid_create_by_parts(jw_jid_ctx *ctx, const char *localpart, const char *domainpart, const char *resourcepart, jw_jid **jid, jw_err *err)
JABBERWERX_API jw_pool * jw_jid_context_get_pool(jw_jid_ctx *ctx)
JABBERWERX_API const char * jw_jid_get_localpart(jw_jid *jid)
JABBERWERX_API void jw_jid_destroy(jw_jid *jid)
This file contains JabberWerxC allocation related functions and jw_pool objects.
JABBERWERX_API const char * jw_jid_get_full(jw_jid *jid)
JABBERWERX_API const char * jw_jid_get_bare(jw_jid *jid)
struct _jw_pool_int jw_pool
Definition: mem.h:51
JABBERWERX_API void jw_jid_context_destroy(jw_jid_ctx *ctx)
JABBERWERX_API bool jw_jid_valid(const char *jidstr)
JABBERWERX_API jw_jid * jw_jid_get_bare_jid(jw_jid *jid)
JABBERWERX_API void jw_jid_context_htable_cleaner(bool replace, bool destroy_key, void *key, void *data)
JABBERWERX_API bool jw_jid_create(jw_jid_ctx *ctx, const char *jidstr, jw_jid **jid, jw_err *err)
JABBERWERX_API int jw_jid_cmp(jw_jid *lhs, jw_jid *rhs)
JABBERWERX_API bool jw_jid_escape_localpart(const char *localpart, char **result, size_t *result_len, jw_err *err)
Definition: basics.h:157
JABBERWERX_API jw_jid * jw_jid_copy(jw_jid *jid)
JABBERWERX_API const char * jw_jid_get_resource(jw_jid *jid)
struct _jw_jid_ctx_int jw_jid_ctx
Definition: jid.h:34
JABBERWERX_API bool jw_jid_import(jw_jid_ctx *ctx, jw_jid *jid, jw_jid **cpy, jw_err *err)
struct _jw_jid_int jw_jid
Definition: jid.h:37
JABBERWERX_API bool jw_jid_unescape_localpart(const char *localpart, char **result, size_t *result_len, jw_err *err)
JABBERWERX_API const char * jw_jid_get_domain(jw_jid *jid)
JABBERWERX_API bool jw_jid_context_create(size_t bucket_count, jw_jid_ctx **ctx, jw_err *err)