]> cygwin.com Git - cygwin-apps/setup.git/blob - package_db.h
08a183b2ec936f3f0f3ebcaa2f3ffbe57e9369d1
[cygwin-apps/setup.git] / package_db.h
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 #ifndef _PACKAGE_DB_H_
17 #define _PACKAGE_DB_H_
18
19 class CategoryList;
20 class packagemeta;
21 class io_stream;
22
23 /*TODO: add mutexs */
24 class packagedb
25 {
26 public:
27 packagedb ();
28 packagemeta *getfirstpackage ();
29 packagemeta *getnextpackage ();
30 packagemeta *getpackagebyname (const char *);
31 /* 0 on success */
32 int addpackage (packagemeta &);
33 /* 0 on success */
34 int flush ();
35 /* return an existing record if it exists, otherwise make a new one */
36 packagemeta & registerpackage (char const *);
37 size_t npackages ()
38 {
39 return packagecount;
40 };
41 /* all seen categories */
42 static CategoryList categories;
43 private:
44 /* this gets sorted */
45 static packagemeta **packages;
46 static size_t packagecount;
47 static size_t packagespace;
48 size_t curr_package;
49 io_stream *db;
50 static int installeddbread; /* do we have to reread this */
51 };
52
53 #endif /* _PACKAGE_DB_H_ */
This page took 0.101385 seconds and 4 git commands to generate.