save
[protos/libecoli.git] / lib / ecoli_tk_or.h
index a04c6a3..c34b808 100644 (file)
 #ifndef ECOLI_TK_OR_
 #define ECOLI_TK_OR_
 
-#include <sys/queue.h>
-
 #include <ecoli_tk.h>
 
-struct ec_tk_or {
-       struct ec_tk gen;
-       struct ec_tk **table;
-       unsigned int len;
-};
-
-struct ec_tk *ec_tk_or_new(const char *id);
+#define EC_TK_OR(args...) __ec_tk_or(args, EC_TK_ENDLIST)
 
 /* list must be terminated with EC_TK_ENDLIST */
 /* all token given in the list will be freed when freeing this one */
-struct ec_tk *ec_tk_or_new_list(const char *id, ...);
+/* avoid using this function directly, prefer the macro EC_TK_OR() or
+ * ec_tk_or() + ec_tk_or_add() */
+struct ec_tk *__ec_tk_or(const char *id, ...);
 
-/* all token given in the list will be freed when freeing this one */
+struct ec_tk *ec_tk_or(const char *id);
+
+/* child is consumed */
 int ec_tk_or_add(struct ec_tk *tk, struct ec_tk *child);
 
+
 #endif