awful debugging hacking
[dpkg] / dselect / method.h
1 /*
2 * dselect - Debian package maintenance user interface
3 * method.h - access method handling declarations
4 *
5 * Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
6 * Copyright © 2001 Wichert Akkerman <wakkerma@debian.org>
7 *
8 * This is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef METHOD_H
23 #define METHOD_H
24
25 #define CMETHOPTFILE "cmethopt"
26 #define METHLOCKFILE "methlock"
27
28 #define METHODSDIR "methods"
29
30 #define IMETHODMAXLEN 50
31 #define IOPTIONMAXLEN IMETHODMAXLEN
32 #define METHODOPTIONSFILE "names"
33 #define METHODSETUPSCRIPT "setup"
34 #define METHODUPDATESCRIPT "update"
35 #define METHODINSTALLSCRIPT "install"
36 #define OPTIONSDESCPFX "desc."
37 #define OPTIONINDEXMAXLEN 5
38
39 struct method {
40 struct method *next, *prev;
41 char *name, *path, *pathinmeth;
42 };
43
44 struct dselect_option {
45 dselect_option *next;
46 method *meth;
47 char index[OPTIONINDEXMAXLEN];
48 char *name, *summary;
49 char *description;
50 };
51
52 class methodlist : public baselist {
53 protected:
54 column col_status;
55 column col_name;
56 column col_desc;
57
58 // Table of methods
59 struct dselect_option **table;
60
61 // Misc.
62 char searchstring[50];
63
64 // Information displays
65 void itd_description();
66
67 // Define these virtuals
68 void redraw1itemsel(int index, int selected);
69 void redrawcolheads();
70 void redrawthisstate();
71 void redrawinfo();
72 void redrawtitle();
73 void setwidths();
74 void setheights();
75 const char *itemname(int index);
76 const struct helpmenuentry *helpmenulist();
77
78 public:
79 // Keybinding functions */
80 void kd_quit();
81 void kd_abort();
82
83 methodlist();
84 quitaction display();
85 ~methodlist();
86 };
87
88 extern int noptions;
89 extern struct dselect_option *options, *coption;
90 extern struct method *methods;
91
92 void readmethods(const char *pathbase, dselect_option **optionspp, int *nread);
93 void getcurrentopt();
94 void writecurrentopt();
95
96 #endif /* METHOD_H */