summaryrefslogtreecommitdiff
path: root/wintable/new/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'wintable/new/util.h')
-rw-r--r--wintable/new/util.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/wintable/new/util.h b/wintable/new/util.h
new file mode 100644
index 0000000..c6cbfb3
--- /dev/null
+++ b/wintable/new/util.h
@@ -0,0 +1,14 @@
+// 4 december 2014
+
+typedef BOOL (*handlerfunc)(struct table *, UINT, WPARAM, LPARAM, LRESULT *);
+#define HANDLER(name) static BOOL name(struct table *t, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
+
+static BOOL runHandlers(handlerfunc *list, struct table *t, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
+{
+ handlerfunc *p;
+
+ for (p = list; *p != NULL; p++)
+ if ((*(*p))(t, uMsg, wParam, lParam, lResult))
+ return TRUE;
+ return FALSE;
+}