]>
cygwin.com Git - cygwin-apps/setup.git/blob - ini.h
2 * Copyright (c) 2000, Red Hat, Inc.
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 DJ Delorie <dj@cygnus.com>
24 void ini_init (char *string
);
25 #define YYSTYPE char *
35 /* When setup.ini is parsed, the information is stored according to
36 the declarations here. ini.cc (via inilex and iniparse)
37 initializes these structures. choose.cc sets the action and trust
38 fields. download.cc downloads any needed files for selected
39 packages (the chosen "install" field). install.cc installs
42 /* the classes here store installation info *shrug* */
44 /* lowest number must be most trusted, highest least trusted */
63 #define is_download_action(pkg) \
64 ((pkg)->action == ACTION_PREV || \
65 (pkg)->action == ACTION_CURR || \
66 (pkg)->action == ACTION_TEST || \
67 (pkg)->action == ACTION_REDO || \
68 (pkg)->action == ACTION_SRC_ONLY)
70 #define is_upgrade_action(pkg) \
71 (((pkg)->action >= ACTION_CURR && \
72 (pkg)->action <= ACTION_TEST) || \
73 (pkg)->action == ACTION_REDO)
75 #define is_uninstall_action(pkg) \
76 (is_upgrade_action (pkg) || \
77 (pkg)->action == ACTION_PREV || \
78 (pkg)->action == ACTION_UNINSTALL)
80 #define is_full_action(pkg) \
81 (((pkg)->action >= ACTION_SAME_PREV && (pkg)->action <= ACTION_SAME_TEST) \
82 || (pkg)->action == ACTION_SKIP)
84 #define SRCACTION_NO 0
85 #define SRCACTION_YES 1
88 char *version
; /* version part of filename */
89 char *install
; /* file name to install */
90 unsigned int install_size
; /* in bytes */
91 int install_exists
; /* install file exists on disk */
92 int derived
; /* True if we "figured out" that this version should
93 go here but it was not in setup.ini */
94 char *source
; /* sources for installed binaries */
95 unsigned int source_size
; /* in bytes */
96 int source_exists
; /* source file exists on disk */
97 _Info (const char *_install
, const char *_version
,
98 int _install_size
, const char *_source
= NULL
,
99 int _source_size
= 0);
101 Info
; /* +1 for TRUST_UNKNOWN */
103 typedef struct _CategoryPackage
105 struct _CategoryPackage
*next
; /* The next package pointer in the list */
106 char *pkgname
; /* This should be Package *, but the packages can move */
113 Category
*next
; /* the next category in the list */
114 char *name
; /* the category */
115 CategoryPackage
*packages
; /* the packages in this category */
118 typedef struct _Dependency
120 struct _Dependency
*next
; /* the next package in this dependency list */
121 char *package
; /* the name of the package that is depended on */
123 Dependency
; /* Dependencies can be used for
124 recommended/required/related... */
128 char *name
; /* package name, like "cygwin" */
129 char *sdesc
; /* short description (replaces "name" if provided) */
130 char *ldesc
; /* long description (multi-line) */
131 Category
*category
; /* the categories the package belongs to */
132 Dependency
*required
; /* the packages required for this package to work */
133 actions action
; /* A range of states applicable to this package */
134 trusts trust
; /* Selects among info[] below, a subset of action */
135 int srcpicked
; /* True if source is required */
137 Info
*installed
; /* Info on installed package */
138 trusts installed_ix
; /* Index into info array for currently installed package */
139 excludes exclude
; /* true if this package should be excluded */
141 /* The reason for this weird layout is to allow for loops that scan either
142 the info array, based on trust value or the infoscan array based on a pointer,
143 looking for a particular version. */
144 Info info
[1]; /* First element. Intentionally allocated prior
146 Info infoscan
[NTRUST
- 1]; /* +1 for TRUST_UNKNOWN */
147 Info infoend
[0]; /* end marker */
150 extern Package
*package
;
151 extern int npackages
;
152 extern Category
*category
;
153 extern int ncategories
;
155 Package
*new_package (char *name
);
156 Package
*getpkgbyname (const char *pkgname
);
157 void new_requirement (Package
* package
, char *dependson
);
158 Category
*getcategorybyname (const char *categoryname
);
159 Category
*getpackagecategorybyname (Package
* pkg
,
160 const char *categoryname
);
161 Category
*register_category (const char *name
);
162 void add_category (Package
* package
, Category
* cat
);
This page took 0.047949 seconds and 6 git commands to generate.