]>
Commit | Line | Data |
---|---|---|
23c9e63c | 1 | /* |
eb20d728 | 2 | * Copyright (c) 2000,2007 Red Hat, Inc. |
23c9e63c DD |
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 DJ Delorie <dj@cygnus.com> | |
13 | * | |
14 | */ | |
15 | ||
c93bc6d0 MB |
16 | #ifndef SETUP_INI_H |
17 | #define SETUP_INI_H | |
8f53e82a | 18 | |
341988b9 | 19 | class io_stream; |
fd93eff9 | 20 | #include <string> |
296c4272 AG |
21 | #include <vector> |
22 | ||
23 | typedef std::vector <std::string> IniList; | |
24 | extern IniList found_ini_list, setup_ext_list; | |
c9641752 | 25 | const std::string setup_exts[] = { "zst", "xz", "bz2", "ini" }; |
296c4272 | 26 | extern bool is_64bit; |
903087fe | 27 | extern bool is_new_install; |
296c4272 AG |
28 | extern std::string SetupArch; |
29 | extern std::string SetupIniDir; | |
30 | extern std::string SetupBaseName; | |
31 | ||
b92028a4 | 32 | class IniState; |
605034ca | 33 | class IniDBBuilder; |
aa1e3b4d | 34 | class IniParseFeedback; |
605034ca | 35 | void ini_init (io_stream *, IniDBBuilder *, IniParseFeedback &); |
d0fa1c4e RC |
36 | #define YYSTYPE char * |
37 | ||
23c9e63c DD |
38 | /* When setup.ini is parsed, the information is stored according to |
39 | the declarations here. ini.cc (via inilex and iniparse) | |
40 | initializes these structures. choose.cc sets the action and trust | |
41 | fields. download.cc downloads any needed files for selected | |
42 | packages (the chosen "install" field). install.cc installs | |
43 | selected packages. */ | |
44 | ||
0b90765c JT |
45 | extern int yyparse (); |
46 | ||
3ce2ac31 AG |
47 | /* The following definitions are used in the parser implementation */ |
48 | ||
159763b2 AG |
49 | #define hexnibble(val) ('\xff' & (val > '9') ? val - 'a' + 10 : val - '0') |
50 | #define nibbled1(v1,v2) ('\xff' & ((v1 << 4) | v2)) | |
3ce2ac31 | 51 | #define b64url(val) \ |
159763b2 AG |
52 | ('\x3f' & (( val == '_') ? '\x3f' \ |
53 | : (val == '-') ? '\x3e' \ | |
54 | : (val >= 'a') ? val - 'a' + '\x1a' \ | |
55 | : (val >= 'A') ? val - 'A' + '\x00' \ | |
56 | : val - '0' + '\x34')) | |
57 | #define b64d1(v1,v2,v3,v4) ('\xff' & ((v1 << 2) | (v2 >> 4))) | |
58 | #define b64d2(v1,v2,v3,v4) ('\xff' & ((v2 << 4) | (v3 >> 2))) | |
59 | #define b64d3(v1,v2,v3,v4) ('\xff' & ((v3 << 6) | v4)) | |
3ce2ac31 | 60 | |
c93bc6d0 | 61 | #endif /* SETUP_INI_H */ |