00001 00006 #ifndef _GLOBALS_H 00007 #define _GLOBALS_H 00008 00009 #include "version.h" 00010 #include "class.h" 00011 00012 #ifdef _MAIN_C 00013 #define GLOBAL 00014 #define INIT(A) = A 00015 #else 00016 #define GLOBAL extern 00017 #define INIT(A) 00018 #endif 00019 00020 #ifdef __cplusplus 00021 extern "C" { 00022 #endif 00023 00024 #ifndef FALSE 00025 #define FALSE (0) 00026 #define TRUE (!FALSE) 00027 #endif 00028 00029 typedef enum {FAILED=FALSE, SUCCESS=TRUE} STATUS; 00030 00031 typedef struct s_globalvar { 00032 char name[256]; 00033 PROPERTY *prop; 00034 struct s_globalvar *next; 00035 } GLOBALVAR; 00036 00037 STATUS global_init(void); 00038 GLOBALVAR *global_getnext(GLOBALVAR *previous); 00039 GLOBALVAR *global_find(char *name); 00040 GLOBALVAR *global_create(char *name, ...); 00041 STATUS global_setvar(char *def,...); 00042 char *global_getvar(char *name, char *buffer, int size); 00043 void global_dump(void); 00044 00045 /* MAJOR and MINOR version */ 00046 GLOBAL unsigned global_version_major INIT(REV_MAJOR); 00047 GLOBAL unsigned global_version_minor INIT(REV_MINOR); 00049 GLOBAL char global_command_line[1024]; 00050 GLOBAL char global_environment[1024] INIT("batch"); 00051 GLOBAL int global_quiet_mode INIT(FALSE); 00052 GLOBAL int global_warn_mode INIT(FALSE); 00053 GLOBAL int global_debug_mode INIT(FALSE); 00054 GLOBAL int global_test_mode INIT(FALSE); 00055 GLOBAL int global_verbose_mode INIT(FALSE); 00056 GLOBAL int global_debug_output INIT(FALSE); 00057 GLOBAL int global_keep_progress INIT(FALSE); 00058 GLOBAL unsigned global_iteration_limit INIT(100); 00059 GLOBAL char global_workdir[1024] INIT("."); 00060 GLOBAL char global_dumpfile[1024] INIT("gridlabd.xml"); 00061 GLOBAL char global_savefile[1024] INIT(""); 00062 GLOBAL int global_dumpall INIT(FALSE); 00063 GLOBAL int global_runchecks INIT(FALSE); 00065 GLOBAL int global_threadcount INIT(1); 00066 GLOBAL int global_profiler INIT(0); 00067 GLOBAL int global_pauseatexit INIT(0); 00068 GLOBAL char global_testoutputfile[1024] INIT(""); 00069 GLOBAL int global_xml_encoding INIT(8); 00070 GLOBAL char global_pidfile[1024] INIT(""); 00071 GLOBAL unsigned char global_no_balance INIT(FALSE); 00072 GLOBAL char global_kmlfile[1024] INIT(""); 00073 GLOBAL char global_modelname[1024] INIT(""); 00074 GLOBAL char global_execdir[1024] INIT(""); 00076 #include "timestamp.h" 00077 #include "realtime.h" 00078 00079 GLOBAL TIMESTAMP global_clock INIT(TS_ZERO); 00080 GLOBAL TIMESTAMP global_starttime INIT(0); 00081 GLOBAL TIMESTAMP global_stoptime INIT(TS_NEVER); 00083 GLOBAL char global_double_format[32] INIT("%+lg"); 00084 GLOBAL char global_complex_format[256] INIT("%+lg%+lg%c"); 00085 GLOBAL char global_object_format[32] INIT("%s:%d"); 00086 GLOBAL char global_object_scan[32] INIT("%[^:]:%d"); 00088 #ifdef __cplusplus 00089 } 00090 #endif 00091 00092 #undef GLOBAL 00093 #undef INIT 00094 00095 #endif 00096