summaryrefslogtreecommitdiff
path: root/src/util.c
blob: a98731bb5cc56342db861db972b653f57527b704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}