Changeset 313

Show
Ignore:
Timestamp:
30/07/07 13:42:39 (16 months ago)
Author:
ono
Message:

nad_cache_new & nad_cache_free should be exported as JABBERD2_API functions.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/util/nad.h

    r219 r313  
    5050#endif 
    5151 
    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 
     65typedef struct nad_st **nad_cache_t; 
    5366 
    5467struct nad_elem_st { 
     
    7689}; 
    7790 
    78 typedef struct _nad_st { 
    79     pool_t p; 
     91typedef struct nad_st 
     92{ 
     93    nad_cache_t cache;   /* he who gave us life */ 
    8094    struct nad_elem_st *elems; 
    8195    struct nad_attr_st *attrs; 
     
    86100    int ecur, acur, ncur, ccur; 
    87101    int scope; /* currently scoped namespaces, get attached to the next element */ 
     102    struct nad_st *next; /* for keeping a list of nads */ 
    88103} *nad_t; 
    89104 
     105/** create a new cache, simple pointer to a list of nads */ 
     106JABBERD2_API nad_cache_t nad_cache_new(void); 
     107 
     108/** free the cache and any nads in it */ 
     109JABBERD2_API void nad_cache_free(nad_cache_t cache); 
     110 
    90111/** create a new nad */ 
    91 JABBERD2_API nad_t nad_new(pool_t p); 
     112JABBERD2_API nad_t nad_new(nad_cache_t cache); 
    92113 
    93114/** copy a nad */ 
    94115JABBERD2_API nad_t nad_copy(nad_t nad); 
     116 
     117/** free that nad */ 
     118JABBERD2_API void nad_free(nad_t nad); 
    95119 
    96120/** find the next element with this name/depth */ 
     
    151175/** serialize and deserialize a nad */ 
    152176JABBERD2_API void nad_serialize(nad_t nad, char **buf, int *len); 
    153 JABBERD2_API nad_t nad_deserialize(pool_t p, const char *buf); 
     177JABBERD2_API nad_t nad_deserialize(nad_cache_t cache, const char *buf); 
    154178 
    155179/** create a nad from raw xml */ 
    156 JABBERD2_API nad_t nad_parse(pool_t p, const char *buf, int len); 
     180JABBERD2_API nad_t nad_parse(nad_cache_t cache, const char *buf, int len); 
    157181 
    158182/* these are some helpful macros */