/[magpie]/magpie/magpie.h
ViewVC logotype

Contents of /magpie/magpie.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Aug 30 23:12:10 2003 UTC (9 years, 8 months ago) by djpig-guest
Branch: MAIN
Changes since 1.2: +3 -1 lines
File MIME type: text/plain
Add dependencies and includes related to option processing
1 /*
2 Magpie - reference librarian for Debian systems
3 Copyright (C) 2000 Bear Giles <bgiles@coyotesong.com>
4
5 This program is free software; you may redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the license, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 $Id: magpie.h,v 1.3 2003/08/30 23:12:10 djpig-guest Exp $
20 */
21 #ifndef MAGPIE_H
22 #define MAGPIE_H
23
24 #include "magpieopts.h"
25
26 extern const char *sections[];
27 extern const char *categories[];
28 extern const char *priorities[];
29 extern const char *architectures[];
30
31 #define CNT_SECTIONS 11
32 #define CNT_CATEGORIES 37
33 #define CNT_PRIORITIES 5
34 #define CNT_ARCHITECTURES 14
35
36 #define MAX_DESCCNT 300
37
38 /*+
39 This structure describes a list of packages.
40 +*/
41 struct package_list {
42 char *name;
43 char *restriction;
44 struct package_list *next; /* and... */
45 struct package_list *down; /* or... */
46 };
47
48 /*+
49 This structure describes a single package.
50 +*/
51 struct package_info {
52 char *name;
53 char *version;
54 int priority;
55 int section;
56 int category;
57 int essential;
58 char *filename;
59 char *maintainer;
60 char *md5sum;
61 char *summary;
62 int architecture;
63 long size;
64 long installed_size;
65 char *status[3];
66 char *config_version;
67 char *origin;
68 char *bugs;
69
70 int desccnt;
71 char *description[MAX_DESCCNT];
72
73 int cfcnt;
74 char *conffiles[MAX_DESCCNT];
75
76 struct package_list *source;
77 struct package_list *depends;
78 struct package_list *predepends;
79 struct package_list *recommends;
80 struct package_list *suggests;
81 struct package_list *conflicts;
82 struct package_list *replaces;
83 struct package_list *provides;
84 struct package_list *enhances;
85
86 struct package_list *r_depends;
87 struct package_list *r_recommends;
88 struct package_list *r_suggests;
89
90 int installed;
91 int unpacked;
92
93 int dupfile;
94
95 char *installed_version;
96
97 char *tag;
98 int selected;
99 int flag; /* description vs conffiles flag */
100 };
101
102 #define MAGPIE_ALL_PACKAGES 0
103 #define MAGPIE_INSTALLED_PACKAGES 1
104
105 /*+
106 This package describes a magpie module.
107 +*/
108 struct magpie_module {
109 int version;
110 int status;
111 const char *description;
112 int (*database) (void);
113 int (*init) (void);
114 int (*cleanup) (void);
115 int (*annotated_index) (FILE *, int);
116 int (*unannotated_index) (FILE *, int);
117 int (*miscellaneous) (FILE *);
118 } magpie_module;
119
120
121 /*+
122 We use a simple array to access the structures allocated by the
123 parser. This allows us to easily sort the contents.
124 +*/
125 extern struct package_info *cache[];
126 extern int cachecnt;
127
128 /*+
129 arrays containing the number of packages in each category. This
130 allows us to avoid creating empty files.
131 +*/
132 extern int matrixcnt_s[CNT_SECTIONS];
133 extern int matrixcnt_sc[CNT_SECTIONS][CNT_CATEGORIES];
134 extern int matrixcnt_scp[CNT_SECTIONS][CNT_CATEGORIES][CNT_PRIORITIES];
135 extern int matrixcnt_sp[CNT_SECTIONS][CNT_PRIORITIES];
136 extern int matrixcnt_p[CNT_PRIORITIES];
137
138 extern struct package_info *mp_lookup (const char *name);
139
140 extern int gzip (const char *);
141
142
143 extern void mp_text (FILE *fp, const char *s);
144
145 extern void mp_doc_open (FILE *fp, const char *fmt,...);
146 extern void mp_doc_close (FILE *fp);
147
148 extern void mp_abstract (FILE *fp, const char *fmt,...);
149
150 extern void mp_name (FILE *fp, const char *name);
151 extern void mp_url (FILE *fp, const char *fmt1, const char *fmt2,...);
152
153 extern void mp_title (FILE *fp, int level, const char *fmt,...);
154 extern void mp_title_open (FILE *fp, int level, const char *fmt,...);
155 extern void mp_title_close (FILE *fp, int level);
156
157 extern void mp_list_open (FILE *fp);
158 extern void mp_list_close (FILE *fp);
159
160 extern void mp_item_open (FILE *fp);
161 extern void mp_item_close (FILE *fp);
162
163 extern void mp_literal_open (FILE *fp);
164 extern void mp_literal_close (FILE *fp);
165
166 extern void mp_nbsp (FILE *fp);
167 extern void mp_break (FILE *fp);
168
169 extern void mp_tt (FILE *fp, const char *str);
170
171 extern void mp_tag (FILE *fp, const char *fmt,...);
172
173 extern void mp_item (FILE *fp, const struct package_list *d);
174
175 extern void mp_package (FILE *fp, struct package_info *p, int mode, int type);
176
177 extern void mp_histogram (FILE *fp, const int data[], int nelms);
178
179 #endif

  ViewVC Help
Powered by ViewVC 1.1.5