]>
Commit | Line | Data |
---|---|---|
7b606ae5 RC |
1 | /* |
2 | * Copyright (c) 2001, Robert Collins. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Robert Collins <rbtcollins@hotmail.com> | |
13 | * | |
14 | */ | |
15 | ||
16 | /* categories for packages */ | |
17 | ||
18 | #include <stdlib.h> | |
19 | #include <string.h> | |
20 | ||
21 | #include "category.h" | |
22 | ||
23 | /* normal members */ | |
24 | ||
4fe323f9 | 25 | Category::Category ():next (0), name (0), key (0), packages (0) |
7b606ae5 RC |
26 | { |
27 | } | |
28 | ||
29 | Category::Category (const char *categoryname): | |
fa0c0d10 RC |
30 | next (0), |
31 | packages (0) | |
7b606ae5 RC |
32 | { |
33 | /* FIXME: search the global category list for name, and reuse that pointer */ | |
34 | name = strdup (categoryname); | |
4fe323f9 RC |
35 | key = name; |
36 | } | |
37 | ||
38 | int | |
39 | Categorycmp (Category & a, Category & b) | |
40 | { | |
41 | return strcasecmp (a.name, b.name); | |
7b606ae5 | 42 | } |