X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fxmpp%2Fxmpp_xmacros.h;fp=citadel%2Fmodules%2Fxmpp%2Fxmpp_xmacros.h;h=b38edbc703f7bbd0cefdc834da2bd09747fa61c0;hp=f7427b835c9a396e33d22ee8f1ad4151cda8ad94;hb=d13759233eefc3f1d7141b1e10b685bd96c80da5;hpb=f1f85a4859e53e445bf2d12f7fc9dad6efe0bb68 diff --git a/citadel/modules/xmpp/xmpp_xmacros.h b/citadel/modules/xmpp/xmpp_xmacros.h index f7427b835..b38edbc70 100644 --- a/citadel/modules/xmpp/xmpp_xmacros.h +++ b/citadel/modules/xmpp/xmpp_xmacros.h @@ -3,15 +3,25 @@ * define the structures for one token each * typename: TheToken_ */ + +#define XMPPARGS char *token, long len +typedef void (*XMPP_callback)(XMPPARGS); +#define CALLBACK(NAME) XMPP_callback CB_##NAME; #define PAYLOAD(STRUCTNAME, NAME) StrBuf *NAME;int encoding_##NAME; #define STRPROP(STRUCTNAME, NAME) StrBuf *NAME; #define TOKEN(NAME, STRUCT) typedef struct __##NAME \ STRUCT \ TheToken_##NAME; +#define SUBTOKEN(NAME, NS, STOKEN, STRUCT) typedef struct __##NAME##NS##STOKEN \ + STRUCT \ + theSubToken_##NAME##NS##STOKEN; + #include "token.def" + #undef STRPROP #undef PAYLOAD #undef TOKEN +#undef SUBTOKEN /* @@ -19,17 +29,22 @@ # name: free_buf_ */ +#define SUBTOKEN(NAME, NS, STOKEN, STRUCT) void free_buf__##NAME##NS##STOKEN \ + (theSubToken_##NAME##NS##STOKEN *pdata); #define TOKEN(NAME, STRUCT) \ void free_buf_##NAME(TheToken_##NAME *pdata); #include "token.def" #undef STRPROP #undef PAYLOAD #undef TOKEN +#undef SUBTOKEN /* * forward declarations, freeing structs and member. * name: free_ */ +#define SUBTOKEN(NAME, NS, STOKEN, STRUCT) void free__##NAME##NS##STOKEN \ + (theSubToken_##NAME##NS##STOKEN *pdata); #define TOKEN(NAME, STRUCT) \ void free_##NAME(TheToken_##NAME *pdata); @@ -37,3 +52,6 @@ #undef STRPROP #undef PAYLOAD #undef TOKEN +#undef SUBTOKEN + +#undef CALLBACK