fragment: add pkg_fragment_lookup().

pull/36/head
William Pitcock 2012-08-09 17:06:09 -05:00
parent c80b088711
commit 58fa286972
1 changed files with 10 additions and 4 deletions

View File

@ -58,8 +58,8 @@ pkg_fragment_add(pkg_fragment_t *head, const char *string)
return pkg_fragment_append(head, frag); return pkg_fragment_append(head, frag);
} }
bool static inline pkg_fragment_t *
pkg_fragment_exists(pkg_fragment_t *head, pkg_fragment_t *base) pkg_fragment_lookup(pkg_fragment_t *head, pkg_fragment_t *base)
{ {
pkg_fragment_t *node; pkg_fragment_t *node;
@ -69,10 +69,16 @@ pkg_fragment_exists(pkg_fragment_t *head, pkg_fragment_t *base)
continue; continue;
if (!strcmp(base->data, node->data)) if (!strcmp(base->data, node->data))
return true; return node;
} }
return false; return NULL;
}
bool
pkg_fragment_exists(pkg_fragment_t *head, pkg_fragment_t *base)
{
return pkg_fragment_lookup(head, base) != NULL;
} }
pkg_fragment_t * pkg_fragment_t *