summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
new file mode 100644
index 0000000..a98731b
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,18 @@
+#include "util.h"
+#include <glib.h>
+
+gpointer
+cmumble_find_by_id(GList *list, gsize member_offset, guint id)
+{
+ gpointer el = NULL;
+ GList *l;
+
+ for (l = list; l; l = l->next) {
+ if (G_STRUCT_MEMBER(uint32_t, l, member_offset) == id) {
+ el = l->data;
+ break;
+ }
+ }
+
+ return el;
+}