aboutsummaryrefslogtreecommitdiff
path: root/include/pdp_list_macros.h
diff options
context:
space:
mode:
authorPablo Martín <caedesv@users.sourceforge.net>2003-09-07 20:01:24 +0000
committerPablo Martín <caedesv@users.sourceforge.net>2003-09-07 20:01:24 +0000
commite20d5ae3622d5d656dc28d7a090aee76b08158b0 (patch)
treede772d913888f4d5faf127414e2cb4ce486be3ca /include/pdp_list_macros.h
parent69fab985ebfc5ea03228c92a859e4091fee1b28d (diff)
updating pdp to current version 0.12.2
svn path=/trunk/externals/pdp/; revision=936
Diffstat (limited to 'include/pdp_list_macros.h')
-rw-r--r--include/pdp_list_macros.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/pdp_list_macros.h b/include/pdp_list_macros.h
new file mode 100644
index 0000000..cb1f49f
--- /dev/null
+++ b/include/pdp_list_macros.h
@@ -0,0 +1,27 @@
+#ifndef __PDP_LIST_MACROS__
+#define __PDP_LIST_MACROS__
+
+/* some additional (short named) list macros mainly for manipulationg
+ argument lists. needs to be included locally. */
+
+/* reading a list */
+#define FIRST(l) ((l)->first)
+#define SIZE(l) ((l)->elements)
+
+#define NEXT(a) ((a)->next)
+#define N(a) (a = a->next)
+
+#define FLOAT(a) ((a)->t == a_float ? (a)->w.w_float : 0.0f)
+#define PACKET(a) ((a)->t == a_packet ? (a)->w.w_packet : -1)
+#define INT(a) ((a)->t == a_int ? (a)->w.w_packet : 0)
+
+
+/* creating a list, and adding stuff to the end (queueing) */
+#define LIST(n) pdp_list_new(n)
+#define LFREE(l) pdp_list_free(l)
+#define QFLOAT(l, x) pdp_list_add_back(l, a_float, ((t_pdp_word)(float)(x)))
+#define QINT(l, x) pdp_list_add_back(l, a_int, ((t_pdp_word)(int)(x)))
+#define QPACKET(l, x) pdp_list_add_back(l, a_packet,((t_pdp_word)(int)(x)))
+
+
+#endif