GRASS Programmer's Manual
6.4.2(2012)
|
00001 00002 /*************************************************************************** 00003 * globals.h 00004 * 00005 * Mon Apr 18 15:04:11 2005 00006 * Copyright 2005 Benjamin Ducke 00007 ****************************************************************************/ 00008 00009 /* 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00023 */ 00024 00025 00026 #ifndef _GLOBALS_H 00027 #define _GLOBALS_H 00028 00029 /* put a 00030 #define LOCAL 00031 into main.c ! */ 00032 00033 #ifdef LOCAL 00034 #define EXTERN 00035 #else 00036 #define EXTERN extern 00037 #endif 00038 00039 #include <stdlib.h> 00040 #include <stdio.h> 00041 #include <errno.h> 00042 #include <string.h> 00043 #include <sys/types.h> 00044 #include <sys/stat.h> 00045 #include <unistd.h> 00046 #include <dirent.h> 00047 00048 #include "at_exit_funcs.h" 00049 #include "error.h" 00050 #include "tools.h" 00051 #include "reg_deps.h" 00052 #include "reg_entries.h" 00053 #include "reg_html.h" 00054 #include "actions.h" 00055 00056 00057 #define PROGVERSION 1.03 00058 00059 #define MAXSTR 2048 /* maximum length of strings this program handles */ 00060 00061 /* possible actions */ 00062 #define NONE 0 00063 #define HELP 1 00064 #define VERSION 2 00065 #define INSTALL 3 00066 #define BIN_INSTALL 4 00067 #define QUERY 5 00068 #define CLEAN 6 00069 #define LICENSE 7 00070 #define TEST_INSTALL 8 00071 #define DETAILS 9 00072 #define UNINSTALL 10 00073 #define RESTORE 11 00074 #define LIST 12 00075 00076 /* error codes */ 00077 #define ERR_INVOCATION -1 00078 #define ERR_NO_ACCESS_EXT -2 00079 #define ERR_CONFIGURE_EXT -3 00080 #define ERR_COMPILE_EXT -4 00081 #define ERR_INSTALL_EXT -5 00082 #define ERR_INVALID_EXT -6 00083 #define ERR_UNPACK_EXT -7 00084 #define ERR_RM_TMPDIR -8 00085 #define ERR_MISSING_CMD -9 00086 #define ERR_NO_LICENSE -10 00087 #define ERR_VERSION -11 00088 #define ERR_MISSING_BINS -12 00089 #define ERR_UNINSTALL_EXT -13 00090 #define ERR_SU -14 00091 #define ERR_REGISTER_EXT -15 00092 #define ERR_EXISTS_EXT -16 00093 #define ERR_CHECK_DEPS -17 00094 #define ERR_MISSING_DEPS -18 00095 #define ERR_DEREGISTER_EXT -19 00096 #define ERR_DOWNLOAD -20 00097 #define ERR_REGISTER_ENTRIES_GISMAN -21 00098 #define ERR_DEREGISTER_ENTRIES_GISMAN -22 00099 #define ERR_DUMP_PLAIN_TXT -23 00100 #define ERR_REGISTER_HTML -24 00101 #define ERR_DEREGISTER_HTML -25 00102 #define ERR_RESTORE -26 00103 #define ERR_MISSING_CFG -27 00104 #define ERR_DUMP_HTML -28 00105 #define ERR_LIST -29 00106 #define ERR_TMPFILE -30 00107 #define ERR_RM_TMPFILE -31 00108 #define ERR_REGISTER_ENTRIES_GISMAN2 -32 00109 #define ERR_DEREGISTER_ENTRIES_GISMAN2 -33 00110 00111 #define TYPE_UNKNOWN 0 00112 #define TAR_GZIP 1 00113 #define TAR_BZIP2 2 00114 #define ZIP 3 00115 #define TAR 4 00116 00117 #define TOKEN_SUBMENU 0 00118 #define TOKEN_ENTRY 1 00119 #define TOKEN_COMMAND 2 00120 #define TOKEN_SEPARATOR 3 00121 00122 00123 /* ENVIRONMENT VARIABLES */ 00124 EXTERN char GINSTALL_DST[MAXSTR]; 00125 EXTERN char GINSTALL_INC[MAXSTR]; 00126 EXTERN char GINSTALL_LIB[MAXSTR]; 00127 EXTERN char UNINSTALL_BASE[MAXSTR]; 00128 EXTERN char GEM_EXT_NAME[MAXSTR]; 00129 EXTERN char GEM_EXT_VERSION[MAXSTR]; 00130 EXTERN char GEM_EXT_DESCR[MAXSTR]; 00131 EXTERN char GEM_EXT_INFO[MAXSTR]; 00132 EXTERN char GEM_EXT_DEPS[MAXSTR]; 00133 EXTERN char GEM_EXT_BUGS[MAXSTR]; 00134 EXTERN char GEM_EXT_AUTHORS[MAXSTR]; 00135 EXTERN char GEM_GRASS_DIR[MAXSTR]; 00136 EXTERN char GEM_ACTION[MAXSTR]; 00137 EXTERN char INSTALL_BASE[MAXSTR]; 00138 EXTERN char INSTALL_TYPE[MAXSTR]; 00139 EXTERN char GEM_FORCE[MAXSTR]; 00140 EXTERN char GEM_VERBOSE[MAXSTR]; 00141 EXTERN char GEM_GUI[MAXSTR]; 00142 EXTERN char GEM_C_OPTS[MAXSTR]; 00143 EXTERN char EXT_BASE[MAXSTR]; 00144 00145 00146 /* GLOBAL VARIABLES */ 00147 EXTERN int VERBOSE; 00148 EXTERN char TMPDIR[MAXSTR]; 00149 EXTERN char TMPDB[MAXSTR]; 00150 EXTERN char TMP_GISMAN[MAXSTR]; 00151 EXTERN char TMP_DESCR[MAXSTR]; 00152 EXTERN char TMP_INFO[MAXSTR]; 00153 EXTERN char TMP_DEPS[MAXSTR]; 00154 EXTERN char TMP_BUGS[MAXSTR]; 00155 EXTERN char TMP_AUTHORS[MAXSTR]; 00156 EXTERN char TMP_NULL[MAXSTR]; /* pipe all output that should be hidden to this file */ 00157 00158 EXTERN char TMP_HTML[MAXSTR]; 00159 EXTERN int TMPCLEAN; 00160 EXTERN int TMPDBCLEAN; 00161 EXTERN int FORCE; 00162 EXTERN int UPGRADE; 00163 EXTERN int SKIP_CFG; 00164 00165 EXTERN char GISMAN_CMD[MAXSTR]; 00166 EXTERN char GISMAN2_CMD[MAXSTR]; 00167 EXTERN char HTML_CMD[MAXSTR]; 00168 EXTERN char QGIS_CMD[MAXSTR]; 00169 EXTERN char UNINSTALL_CMD[MAXSTR]; 00170 EXTERN char CONFIG_OPTS[MAXSTR]; 00171 EXTERN char CONFIG_CMD[MAXSTR]; 00172 EXTERN char MAKE_CMD[MAXSTR]; 00173 00174 /* stores current working directory */ 00175 EXTERN char CWD[MAXSTR]; 00176 00177 /* this are used to generate a summary message on exit */ 00178 EXTERN int ERROR; /* error code: set to < 0 on abnormal program exit */ 00179 EXTERN int WARNINGS; /* number of warnings issued during program run */ 00180 00181 00182 00183 #endif /* _GLOBALS_H */