GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
globals.h
Go to the documentation of this file.
1 
2 /***************************************************************************
3  * globals.h
4  *
5  * Mon Apr 18 15:04:11 2005
6  * Copyright 2005 Benjamin Ducke
7  ****************************************************************************/
8 
9 /*
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 
26 #ifndef _GLOBALS_H
27 #define _GLOBALS_H
28 
29 /* put a
30  #define LOCAL
31  into main.c ! */
32 
33 #ifdef LOCAL
34 #define EXTERN
35 #else
36 #define EXTERN extern
37 #endif
38 
39 #include <stdlib.h>
40 #include <stdio.h>
41 #include <errno.h>
42 #include <string.h>
43 #include <sys/types.h>
44 #include <sys/stat.h>
45 #include <unistd.h>
46 #include <dirent.h>
47 
48 #include "at_exit_funcs.h"
49 #include "error.h"
50 #include "tools.h"
51 #include "reg_deps.h"
52 #include "reg_entries.h"
53 #include "reg_html.h"
54 #include "actions.h"
55 
56 
57 #define PROGVERSION 1.03
58 
59 #define MAXSTR 2048 /* maximum length of strings this program handles */
60 
61 /* possible actions */
62 #define NONE 0
63 #define HELP 1
64 #define VERSION 2
65 #define INSTALL 3
66 #define BIN_INSTALL 4
67 #define QUERY 5
68 #define CLEAN 6
69 #define LICENSE 7
70 #define TEST_INSTALL 8
71 #define DETAILS 9
72 #define UNINSTALL 10
73 #define RESTORE 11
74 #define LIST 12
75 
76 /* error codes */
77 #define ERR_INVOCATION -1
78 #define ERR_NO_ACCESS_EXT -2
79 #define ERR_CONFIGURE_EXT -3
80 #define ERR_COMPILE_EXT -4
81 #define ERR_INSTALL_EXT -5
82 #define ERR_INVALID_EXT -6
83 #define ERR_UNPACK_EXT -7
84 #define ERR_RM_TMPDIR -8
85 #define ERR_MISSING_CMD -9
86 #define ERR_NO_LICENSE -10
87 #define ERR_VERSION -11
88 #define ERR_MISSING_BINS -12
89 #define ERR_UNINSTALL_EXT -13
90 #define ERR_SU -14
91 #define ERR_REGISTER_EXT -15
92 #define ERR_EXISTS_EXT -16
93 #define ERR_CHECK_DEPS -17
94 #define ERR_MISSING_DEPS -18
95 #define ERR_DEREGISTER_EXT -19
96 #define ERR_DOWNLOAD -20
97 #define ERR_REGISTER_ENTRIES_GISMAN -21
98 #define ERR_DEREGISTER_ENTRIES_GISMAN -22
99 #define ERR_DUMP_PLAIN_TXT -23
100 #define ERR_REGISTER_HTML -24
101 #define ERR_DEREGISTER_HTML -25
102 #define ERR_RESTORE -26
103 #define ERR_MISSING_CFG -27
104 #define ERR_DUMP_HTML -28
105 #define ERR_LIST -29
106 #define ERR_TMPFILE -30
107 #define ERR_RM_TMPFILE -31
108 #define ERR_REGISTER_ENTRIES_GISMAN2 -32
109 #define ERR_DEREGISTER_ENTRIES_GISMAN2 -33
110 
111 #define TYPE_UNKNOWN 0
112 #define TAR_GZIP 1
113 #define TAR_BZIP2 2
114 #define ZIP 3
115 #define TAR 4
116 
117 #define TOKEN_SUBMENU 0
118 #define TOKEN_ENTRY 1
119 #define TOKEN_COMMAND 2
120 #define TOKEN_SEPARATOR 3
121 
122 
123 /* ENVIRONMENT VARIABLES */
144 
145 
146 /* GLOBAL VARIABLES */
156 EXTERN char TMP_NULL[MAXSTR]; /* pipe all output that should be hidden to this file */
157 
164 
173 
174 /* stores current working directory */
176 
177 /* this are used to generate a summary message on exit */
178 EXTERN int ERROR; /* error code: set to < 0 on abnormal program exit */
179 EXTERN int WARNINGS; /* number of warnings issued during program run */
180 
181 
182 
183 #endif /* _GLOBALS_H */
EXTERN int VERBOSE
Definition: globals.h:147
EXTERN char GINSTALL_LIB[MAXSTR]
Definition: globals.h:126
EXTERN int SKIP_CFG
Definition: globals.h:163
EXTERN char INSTALL_TYPE[MAXSTR]
Definition: globals.h:138
EXTERN char GEM_VERBOSE[MAXSTR]
Definition: globals.h:140
EXTERN char GEM_EXT_BUGS[MAXSTR]
Definition: globals.h:133
EXTERN char CONFIG_OPTS[MAXSTR]
Definition: globals.h:170
#define MAXSTR
Definition: globals.h:59
EXTERN char CONFIG_CMD[MAXSTR]
Definition: globals.h:171
EXTERN char TMPDIR[MAXSTR]
Definition: globals.h:148
EXTERN char GISMAN2_CMD[MAXSTR]
Definition: globals.h:166
EXTERN char TMP_NULL[MAXSTR]
Definition: globals.h:156
EXTERN char GEM_EXT_INFO[MAXSTR]
Definition: globals.h:131
EXTERN int WARNINGS
Definition: globals.h:179
EXTERN char TMP_HTML[MAXSTR]
Definition: globals.h:158
EXTERN char GEM_ACTION[MAXSTR]
Definition: globals.h:136
EXTERN char GEM_EXT_DESCR[MAXSTR]
Definition: globals.h:130
EXTERN char QGIS_CMD[MAXSTR]
Definition: globals.h:168
EXTERN char UNINSTALL_CMD[MAXSTR]
Definition: globals.h:169
EXTERN char GEM_EXT_DEPS[MAXSTR]
Definition: globals.h:132
EXTERN int TMPCLEAN
Definition: globals.h:159
EXTERN char TMP_AUTHORS[MAXSTR]
Definition: globals.h:155
EXTERN char TMP_BUGS[MAXSTR]
Definition: globals.h:154
EXTERN char HTML_CMD[MAXSTR]
Definition: globals.h:167
EXTERN char GINSTALL_DST[MAXSTR]
Definition: globals.h:124
EXTERN char UNINSTALL_BASE[MAXSTR]
Definition: globals.h:127
EXTERN char GEM_EXT_NAME[MAXSTR]
Definition: globals.h:128
EXTERN int UPGRADE
Definition: globals.h:162
EXTERN char TMP_DESCR[MAXSTR]
Definition: globals.h:151
EXTERN char TMPDB[MAXSTR]
Definition: globals.h:149
EXTERN char CWD[MAXSTR]
Definition: globals.h:175
EXTERN char MAKE_CMD[MAXSTR]
Definition: globals.h:172
EXTERN int FORCE
Definition: globals.h:161
EXTERN char GEM_EXT_AUTHORS[MAXSTR]
Definition: globals.h:134
EXTERN char GEM_GUI[MAXSTR]
Definition: globals.h:141
EXTERN char EXT_BASE[MAXSTR]
Definition: globals.h:143
EXTERN char GINSTALL_INC[MAXSTR]
Definition: globals.h:125
EXTERN char TMP_INFO[MAXSTR]
Definition: globals.h:152
EXTERN int ERROR
Definition: globals.h:178
EXTERN char INSTALL_BASE[MAXSTR]
Definition: globals.h:137
EXTERN char GEM_FORCE[MAXSTR]
Definition: globals.h:139
EXTERN char TMP_DEPS[MAXSTR]
Definition: globals.h:153
EXTERN char GEM_C_OPTS[MAXSTR]
Definition: globals.h:142
EXTERN char GEM_GRASS_DIR[MAXSTR]
Definition: globals.h:135
EXTERN int TMPDBCLEAN
Definition: globals.h:160
EXTERN char GEM_EXT_VERSION[MAXSTR]
Definition: globals.h:129
EXTERN char GISMAN_CMD[MAXSTR]
Definition: globals.h:165
#define EXTERN
Definition: globals.h:36
EXTERN char TMP_GISMAN[MAXSTR]
Definition: globals.h:150