00001
00007 #ifndef _GLOBALS_H
00008 #define _GLOBALS_H
00009
00010 #include "version.h"
00011 #include "class.h"
00012
00013 #ifdef _MAIN_C
00014 #define GLOBAL
00015 #define INIT(A) = A
00016 #else
00017 #define GLOBAL extern
00018 #define INIT(A)
00019 #endif
00020
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024
00025 #ifndef FALSE
00026 #define FALSE (0)
00027 #define TRUE (!FALSE)
00028 #endif
00029
00030 typedef enum {FAILED=FALSE, SUCCESS=TRUE} STATUS;
00031
00032 typedef struct s_globalvar {
00033 char name[256];
00034 PROPERTY *prop;
00035 struct s_globalvar *next;
00036 unsigned long flags;
00037 void (*callback)(char *);
00038 } GLOBALVAR;
00039
00040 STATUS global_init(void);
00041 GLOBALVAR *global_getnext(GLOBALVAR *previous);
00042 GLOBALVAR *global_find(char *name);
00043 GLOBALVAR *global_create(char *name, ...);
00044 STATUS global_setvar(char *def,...);
00045 char *global_getvar(char *name, char *buffer, int size);
00046 void global_dump(void);
00047
00048
00049 GLOBAL unsigned global_version_major INIT(REV_MAJOR);
00050 GLOBAL unsigned global_version_minor INIT(REV_MINOR);
00052 GLOBAL char global_command_line[1024];
00053 GLOBAL char global_environment[1024] INIT("batch");
00054 GLOBAL int global_quiet_mode INIT(FALSE);
00055 GLOBAL int global_warn_mode INIT(TRUE);
00056 GLOBAL int global_debug_mode INIT(FALSE);
00057 GLOBAL int global_test_mode INIT(FALSE);
00058 GLOBAL int global_verbose_mode INIT(FALSE);
00059 GLOBAL int global_debug_output INIT(FALSE);
00060 GLOBAL int global_keep_progress INIT(FALSE);
00061 GLOBAL unsigned global_iteration_limit INIT(100);
00062 GLOBAL char global_workdir[1024] INIT(".");
00063 GLOBAL char global_dumpfile[1024] INIT("gridlabd.xml");
00064 GLOBAL char global_savefile[1024] INIT("");
00065 GLOBAL int global_dumpall INIT(FALSE);
00066 GLOBAL int global_runchecks INIT(FALSE);
00068 GLOBAL int global_threadcount INIT(1);
00069 GLOBAL int global_profiler INIT(0);
00070 GLOBAL int global_pauseatexit INIT(0);
00071 GLOBAL char global_testoutputfile[1024] INIT("test.txt");
00072 GLOBAL int global_xml_encoding INIT(8);
00073 GLOBAL char global_pidfile[1024] INIT("");
00074 GLOBAL unsigned char global_no_balance INIT(FALSE);
00075 GLOBAL char global_kmlfile[1024] INIT("");
00076 GLOBAL char global_modelname[1024] INIT("");
00077 GLOBAL char global_execdir[1024] INIT("");
00078 GLOBAL bool global_strictnames INIT(true);
00079 GLOBAL bool global_xmlstrict INIT(false);
00080 GLOBAL int global_relax_naming_rules INIT(0);
00081 GLOBAL char global_urlbase[1024]
00082 #ifdef _DEBUG
00083 INIT("./");
00084 #else
00085 INIT("http://www.gridlabd.org/");
00086 #endif
00087 GLOBAL unsigned int global_randomseed INIT(0);
00088 GLOBAL char global_include[1024]
00089 #ifdef WIN32
00090 INIT("");
00091 #else
00092 INIT("/usr/etc/gridlabd");
00093 #endif
00094 GLOBAL int global_gdb INIT(0);
00095 GLOBAL char global_trace[1024] INIT("");
00096 GLOBAL int global_gdb_window INIT(0);
00097 GLOBAL int global_process_id INIT(0);
00098 GLOBAL char global_execname[1024] INIT("");
00099 GLOBAL char global_tmp[1024]
00100 #ifdef WIN32
00101 INIT("c:/temp");
00102 #else
00103 INIT("/tmp");
00104 #endif
00105 GLOBAL int global_force_compile INIT(0);
00106 GLOBAL int global_nolocks INIT(0);
00107 GLOBAL int global_forbid_multiload INIT(0);
00108 GLOBAL int global_skipsafe INIT(0);
00109 typedef enum {DF_ISO=0, DF_US=1, DF_EURO=2} DATEFORMAT;
00110 GLOBAL int global_dateformat INIT(DF_ISO);
00112 #include "timestamp.h"
00113 #include "realtime.h"
00114
00115 GLOBAL TIMESTAMP global_clock INIT(TS_ZERO);
00116 GLOBAL TIMESTAMP global_starttime INIT(0);
00117 GLOBAL TIMESTAMP global_stoptime INIT(TS_NEVER);
00119 GLOBAL char global_double_format[32] INIT("%+lg");
00120 GLOBAL char global_complex_format[256] INIT("%+lg%+lg%c");
00121 GLOBAL char global_object_format[32] INIT("%s:%d");
00122 GLOBAL char global_object_scan[32] INIT("%[^:]:%d");
00124 GLOBAL int global_minimum_timestep INIT(1);
00125 GLOBAL int global_maximum_synctime INIT(60);
00127 GLOBAL char global_platform[8]
00128 #ifdef WIN32
00129 INIT("WINDOWS");
00130 #else
00131 INIT("LINUX");
00132 #endif
00133
00134 GLOBAL int global_suppress_repeat_messages INIT(1);
00135 GLOBAL int global_suppress_deprecated_messages INIT(0);
00137 GLOBAL int global_run_realtime INIT(0);
00139 #ifdef _DEBUG
00140 GLOBAL char global_sync_dumpfile[1024] INIT("");
00141 #endif
00142
00143 GLOBAL int global_streaming_io_enabled INIT(0);
00145 GLOBAL int global_nondeterminism_warning INIT(0);
00146 GLOBAL int global_compileonly INIT(0);
00148 #ifdef __cplusplus
00149 }
00150 #endif
00151
00152 #undef GLOBAL
00153 #undef INIT
00154
00155 #endif
00156