]> cygwin.com Git - cygwin-apps/setup.git/blob - package_meta.h
Backout accidental commit
[cygwin-apps/setup.git] / package_meta.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_META_H_
17 #define _PACKAGE_META_H_
18
19 class packageversion;
20
21 class packagemeta
22 {
23 public:
24 packagemeta (char const *pkgname):installed_from (0), versions (0),
25 versioncount (0), versionspace (0), installed (0), prev (0), exp (0)
26 {
27 name = new char[strlen (pkgname) + 1];
28 strcpy (name, pkgname);
29 };
30
31 packagemeta (char const *pkgname,
32 char const *installedfrom):installed_from (0), versions (0),
33 versioncount (0), versionspace (0), installed (0), prev (0), exp (0)
34 {
35 name = new char[strlen (pkgname) + 1];
36 strcpy (name, pkgname);
37 installed_from = new char[strlen (installedfrom) + 1];
38 strcpy (installed_from, installedfrom);
39 };
40
41
42 ~packagemeta ()
43 {
44 delete name;
45 if (installed_from)
46 delete installed_from;
47 };
48
49 void add_version (packageversion &);
50 void set_installed (packageversion &);
51 void uninstall ();
52
53 char *name;
54 /* legacy variable used to output data for installed.db versions <= 2 */
55 char *installed_from;
56
57 /* this array is //NOT// sorted - too many pointer to get out of joint. */
58 /* we can have member functions to return sorted details if desired */
59 packageversion **versions;
60 size_t versioncount;
61 size_t versionspace;
62 /* which one is installed. */
63 packageversion *installed;
64 /* which one is listed as "prev" in our available packages db */
65 packageversion *prev;
66 /* ditto for current - stable */
67 packageversion *curr;
68 /* and finally the experimental version */
69 packageversion *exp;
70 };
71
72 #endif /* _PACKAGE_META_H_ */
This page took 0.041569 seconds and 6 git commands to generate.