Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
[citadel.git] / citadel / modules / xmpp / xmpp_xmacros.h
diff --git a/citadel/modules/xmpp/xmpp_xmacros.h b/citadel/modules/xmpp/xmpp_xmacros.h
new file mode 100644 (file)
index 0000000..f7427b8
--- /dev/null
@@ -0,0 +1,39 @@
+
+/*
+ * define the structures for one token each
+ * typename: TheToken_<Tokenname>
+ */
+#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;
+#include "token.def"
+#undef STRPROP
+#undef PAYLOAD
+#undef TOKEN
+
+
+/*
+ * forward declarations for freeing the members of one struct instance
+ # name: free_buf_<Tokenname>
+ */
+
+#define TOKEN(NAME, STRUCT)                                            \
+       void free_buf_##NAME(TheToken_##NAME *pdata);
+#include "token.def"
+#undef STRPROP
+#undef PAYLOAD
+#undef TOKEN
+
+/*
+ * forward declarations, freeing structs and member. 
+ * name: free_<Tokenname>
+ */
+#define TOKEN(NAME, STRUCT)                                            \
+       void free_##NAME(TheToken_##NAME *pdata);
+
+#include "token.def"
+#undef STRPROP
+#undef PAYLOAD
+#undef TOKEN