static Bool MatchToken(const char *value, struct xorg_list *patterns, int (*compare)(const char *, const char *)) { const xf86MatchGroup *group; /* If there are no patterns, accept the match */ if (xorg_list_is_empty(patterns)) return TRUE; /* If there are patterns but no attribute, reject the match */ if (!value) return FALSE; /* * Otherwise, iterate the list of patterns ensuring each entry has a * match. Each list entry is a separate Match line of the same type. */ xorg_list_for_each_entry(group, patterns, entry) { Bool match = FALSE; char *const *cur; for (cur = group->values; *cur; cur++) { if ((*compare)(value, *cur) == 0) { match = TRUE; break; } } if (!match) return FALSE; }
static int vivante_dri2_drawable_gone(void *data, XID id) { struct xorg_list *list = data; while (!xorg_list_is_empty(list)) { struct vivante_dri_wait *wait; wait = xorg_list_first_entry(list, struct vivante_dri_wait, drawable_list); xorg_list_del(&wait->drawable_list); wait->drawable_id = None; } free(list); return Success; }
static int vivante_dri2_client_gone(void *data, XID id) { struct xorg_list *list = data; while (!xorg_list_is_empty(list)) { struct vivante_dri_wait *wait; wait = xorg_list_first_entry(list, struct vivante_dri_wait, client_list); xorg_list_del(&wait->client_list); wait->client = NULL; } free(list); return Success; }