]> cygwin.com Git - cygwin-apps/setup.git/blame - category.cc
2002-01-27 Robert Collins <rbtcollins@hotmail.com>
[cygwin-apps/setup.git] / category.cc
CommitLineData
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 25Category::Category ():next (0), name (0), key (0), packages (0)
7b606ae5
RC
26{
27}
28
29Category::Category (const char *categoryname):
fa0c0d10
RC
30next (0),
31packages (0)
7b606ae5
RC
32{
33 /* FIXME: search the global category list for name, and reuse that pointer */
5e0464a1
RC
34 char *t = new char [strlen(categoryname) + 1];
35 strcpy (t, categoryname);
36 name = t;
4fe323f9
RC
37 key = name;
38}
39
40int
d343da15 41Categorycmp (Category const & a, Category const & b)
4fe323f9
RC
42{
43 return strcasecmp (a.name, b.name);
7b606ae5 44}
d343da15
RC
45
46int
47Categorycmp (Category & a, Category & b)
48{
49 return strcasecmp (a.name, b.name);
50}
This page took 0.025861 seconds and 5 git commands to generate.