]>
cygwin.com Git - cygwin-apps/setup.git/blob - package_meta.h
8af4390cb09beb9f487f0d30ab5037a45a26feb6
2 * Copyright (c) 2001, Robert Collins.
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.
9 * A copy of the GNU General Public License can be found at
12 * Written by Robert Collins <rbtcollins@hotmail.com>
16 #ifndef _PACKAGE_META_H_
17 #define _PACKAGE_META_H_
22 /* Required to parse this completely */
23 #include "category_list.h"
28 For cleanliness this may need to be put in its own file later. */
32 CategoryPackage (packagemeta
& package
):next (0), pkg (package
)
35 CategoryPackage
*next
; /* The next package pointer in the list */
40 /* NOTE: A packagemeta without 1 packageversion is invalid! */
44 packagemeta (char const *pkgname
):installed_from (0),
46 // versioncount (0), versionspace (0),
47 installed (0), prev (0), prevtimestamp (0), curr (0), currtimestamp (0),
48 exp (0), exptimestamp (0), desired (0)
50 name
= new char[strlen (pkgname
) + 1];
51 strcpy (name
, pkgname
);
54 packagemeta (char const *pkgname
,
55 char const *installedfrom
):installed_from (0),
56 //versions (0), versioncount (0), versionspace (0),
58 installed (0), prev (0), prevtimestamp (0), curr (0), currtimestamp (0),
59 exp (0), exptimestamp (0), desired (0)
61 name
= new char[strlen (pkgname
) + 1];
62 strcpy (name
, pkgname
);
63 installed_from
= new char[strlen (installedfrom
) + 1];
64 strcpy (installed_from
, installedfrom
);
72 delete installed_from
;
75 void add_version (packageversion
&);
76 void set_installed (packageversion
&);
79 char *name
; /* package name, like "cygwin" */
80 /* legacy variable used to output data for installed.db versions <= 2 */
82 /* SDesc is global in theory, across all package versions.
83 LDesc is not: it can be different per version */
85 /* what categories does this package belong in. Note that if multiple versions
86 * of a package disagree.... the first one read in will take precedence.
88 CategoryList
& Categories ()
92 /* Add a known category to this objects category list.
94 void add_category (Category
&);
96 list
< packageversion
, char const *, strcasecmp
> versions
;
97 /* which one is installed. */
98 packageversion
*installed
;
99 /* which one is listed as "prev" in our available packages db */
100 packageversion
*prev
;
101 /* And what was the timestamp of the ini it was found from */
102 unsigned int prevtimestamp
;
103 /* ditto for current - stable */
104 packageversion
*curr
;
105 unsigned int currtimestamp
;
106 /* and finally the experimental version */
108 unsigned int exptimestamp
;
109 /* Now for the user stuff :] */
110 /* What version does the user want ? */
111 packageversion
*desired
;
113 CategoryList categories
;
116 #endif /* _PACKAGE_META_H_ */
This page took 0.104356 seconds and 4 git commands to generate.