X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Futils.h;fp=daemon%2Futils.h;h=812ccec3e0968e1f3d0d1795ac3c4546e07a0126;hb=9ec790e8b81566b934c056c56ece342ba0a32873;hp=b8b6803e7e11855cacd0d8a8e0c85ebad107c019;hpb=ea31fffb5f411a7ce1310935b001224f9805a373;p=doldaconnect.git diff --git a/daemon/utils.h b/daemon/utils.h index b8b6803..812ccec 100644 --- a/daemon/utils.h +++ b/daemon/utils.h @@ -24,6 +24,12 @@ #include #include "log.h" +struct wcspair { + struct wcspair *next; + wchar_t *key; + wchar_t *val; +}; + /* "Safe" functions */ #define smalloc(size) ({void *__result__; ((__result__ = malloc(size)) == NULL)?({LOGOOM(size); abort(); (void *)0;}):__result__;}) #define srealloc(ptr, size) ({void *__result__; ((__result__ = realloc((ptr), (size))) == NULL)?({LOGOOM(size); abort(); (void *)0;}):__result__;}) @@ -59,7 +65,6 @@ char *sprintf2(char *format, ...) #if defined(__GNUC__) && 0 __attribute__ ((format (printf, 1, 2))) #endif - ; wchar_t *vswprintf2(wchar_t *format, va_list al); wchar_t *swprintf2(wchar_t *format, ...); @@ -84,6 +89,8 @@ char *base32decode(char *data, size_t *datalen); void _freeparr(void **arr); int _parrlen(void **arr); char *findfile(char *gname, char *uname, char *homedir); +struct wcspair *newwcspair(wchar_t *key, wchar_t *val, struct wcspair **list); +void freewcspair(struct wcspair *pair, struct wcspair **list); #define sizebuf(b, bs, rs, es, a) _sizebuf((void **)(b), (bs), (rs), (es), (a)) #define sizebuf2(b, rs, a) _sizebuf((void **)(&(b)), &(b ## size), (rs), sizeof(*(b)), (a))