6
/* This function compares two 'dep' structures. It returns 1 if the packages
7
match, 0 if they do not.
10
pkgcmp(const dep a, const dep b)
12
if (a.namehash == b.namehash)
13
return (strcmp(a.name, b.name) ? 0 : 1);
18
/* Simple function to hash a string to an unsigned int.
21
strhash(const char *line)
34
/* This function removes all occurences of the character 'c' from the
38
strstripchr(char *s, int c)
42
/* No need to shift while c is not found. Thank you, Wessel. */
43
for (; *s && *s != c; s++);
56
string_to_priority(const char *priority)
58
switch (upcase(*priority)) {
59
case 'R': /*equired */
61
case 'I': /*mportant */
63
case 'S': /*tandard */
65
case 'O': /*ptional */
69
default: /*unknown/error */
75
priority_to_string(unsigned int priority)
77
static const char *priorities[] = { "unknown", "required", "important",
78
"standard", "optional", "extra"
81
return priorities[priority > 5 ? 0 : priority];