From fb10caed81d59950847b44817fe13c7a836735b6 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Tue, 25 Aug 2020 10:42:32 -0700 Subject: [PATCH 001/117] Add varchar property type --- gldcore/property.h | 204 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) diff --git a/gldcore/property.h b/gldcore/property.h index 45ca8774d..d6b112340 100644 --- a/gldcore/property.h +++ b/gldcore/property.h @@ -70,6 +70,210 @@ typedef unsigned int64 DEPRECATED uint64; #endif // HAVE_STDINT_H #ifdef __cplusplus + +class varchar { +private: + + int *refcnt; + char *bufptr; + size_t *buflen; + + inline char *resize(size_t len) + { + if ( len > *buflen ) + { + *buflen = ::pow(2,::ceil(::log(len+1)/::log(2))); + char *bigger = new char[*buflen]; + strncpy(bigger,bufptr,(*buflen)-1); + delete [] bufptr; + bufptr = bigger; + } + return bufptr; + } + + inline char *resize(const char *s) + { + return resize(strlen(s)+1); + } + +public: + + // Constructor: charbuf + inline varchar(size_t size=0) + { + refcnt = new int; + *refcnt = 1; + buflen = new size_t; + *buflen = size+1; + bufptr = new char[*buflen]; + erase(); + }; + + // Constructor: charbuf + inline varchar(const char *s) + { + refcnt = new int; + *refcnt = 1; + buflen = new size_t; + *buflen = ::pow(2,::ceil(::log(strlen(s)+1)/::log(2))); // round up to next power of 2 + bufptr = new char[*buflen]; + copy_from(s); + }; + + // Constructor: charbuf + inline varchar(varchar &s) + { + refcnt = s.refcnt; + buflen = s.buflen; + bufptr = s.bufptr; + (*refcnt)++; + } + + // Destructor: ~charbuf + inline ~varchar(void) + { + if ( --(*refcnt) == 0 ) + { + delete refcnt; + delete buflen; + delete [] bufptr; + refcnt = NULL; + buflen = NULL; + bufptr = NULL; + } + }; + + inline varchar &operator = (varchar &s) + { + refcnt = s.refcnt; + buflen = s.buflen; + bufptr = s.bufptr; + (*refcnt)++; + return *this; + } + + inline varchar &operator = (const char *s) + { + copy_from(s); + return *this; + } + + // Method: get_size + inline size_t get_size(void) const + { + return *buflen; + }; + + // Method: get_length + inline size_t get_length(void) const + { + return strlen(bufptr); + }; + + // Method: get_string + inline char *get_string(void) + { + return bufptr; + }; + + // Method: erase + inline char* erase(void) + { + return (char*)memset(bufptr,0,*buflen); + }; + + // Method: copy_to + inline char* copy_to(char *s, size_t len = 0) const + { + return ( s != NULL ) ? strncpy(s,bufptr,len?len:*buflen) : NULL; + }; + + // Method: copy_from + inline char* copy_from(const char *s) + { + + return ( s != NULL ) ? strncpy(resize(s),s,*buflen) : NULL; + }; + + // Method: cast to const char* + inline operator const char*(void) const + { + return bufptr; + }; + + // Method: operator == + inline bool operator == (const char *s) const + { + return strcmp(bufptr,s)==0; + }; + + // Method: operator < + inline bool operator < (const char *s) const + { + return strcmp(bufptr,s)==-1; + }; + + // Method: operator > + inline bool operator > (const char *s) const + { + return strcmp(bufptr,s)==1; + }; + + // Method: operator <= + inline bool operator <= (const char *s) const + { + return strcmp(bufptr,s)<=0; + }; + + // Method: operator >= + inline bool operator >= (const char *s) const + { + return strcmp(bufptr,s)>=0; + }; + + // Method: find + inline char *find(const char c) + { + return strchr(bufptr,c); + }; + + // Method: find + inline char *find(const char *s) + { + return strstr(bufptr,s); + }; + + // Method: findrev + inline char *findrev(const char c) + { + return strrchr(bufptr,c); + }; + + // Method: token + inline char *token(const char *from, const char *delim, char **context) + { + return ::strtok_r(from==NULL?bufptr:NULL,delim,context); + }; + + // Method: format + inline size_t format(char *fmt, ...) + { + va_list ptr; + va_start(ptr,fmt); + size_t len = vformat(fmt,ptr); + va_end(ptr); + return len; + }; + + // Method: vformat + inline size_t vformat(char *fmt, va_list ptr) + { + size_t len = vsnprintf(NULL,0,fmt,ptr); + resize(len+1); + return vsnprintf(bufptr,(*buflen)-1,fmt,ptr); + }; +}; + /* Class: charbuf General character array buffer handling class From 8f0dc59816c6b025243617611444d3b25ea0f226 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Tue, 25 Aug 2020 20:05:48 -0700 Subject: [PATCH 002/117] Replace char{8,32,256,1024} with varchar --- climate/climate.h | 2 +- climate/csv_reader.cpp | 2 +- climate/csv_reader.h | 2 +- climate/init.cpp | 8 +- commercial/ceus.cpp | 24 +-- commercial/office.cpp | 9 +- gldcore/convert.cpp | 185 +---------------- gldcore/convert.h | 22 +- gldcore/daemon.cpp | 6 +- gldcore/find.cpp | 4 +- gldcore/globals.cpp | 17 +- gldcore/globals.h | 2 +- gldcore/gridlabd.h | 12 +- gldcore/load.cpp | 5 +- gldcore/module.cpp | 14 +- gldcore/object.cpp | 6 +- gldcore/property.cpp | 8 +- gldcore/property.h | 278 ++++++++++++------------- gldcore/sanitize.cpp | 43 ++-- gldcore/timestamp.cpp | 2 +- industrial/industrial.cpp | 4 +- influxdb/database.cpp | 25 +-- influxdb/database.h | 2 +- influxdb/recorder.cpp | 2 +- influxdb/recorder.h | 2 +- market/auction.cpp | 2 +- market/controller.cpp | 10 +- market/double_controller.cpp | 25 +-- market/generator_controller.cpp | 4 +- powerflow/currdump.cpp | 10 +- powerflow/fault_check.cpp | 2 +- powerflow/pqload.cpp | 2 +- powerflow/restoration.cpp | 14 +- powerflow/restoration.h | 324 +++++++++++++++--------------- powerflow/solver_nr.cpp | 4 +- powerflow/solver_py.cpp | 2 +- powerflow/triplex_meter.cpp | 2 +- powerflow/volt_var_control.cpp | 44 ++-- powerflow/voltdump.cpp | 8 +- reliability/eventgen.cpp | 23 ++- reliability/eventgen.h | 2 +- reliability/metrics.cpp | 10 +- residential/evcharger.cpp | 8 +- residential/evcharger_det.cpp | 2 +- residential/rbsa.cpp | 24 +-- revenue/revenue.h | 2 +- tape/collector.cpp | 67 +++--- tape/file.cpp | 26 +-- tape/file.h | 12 +- tape/group_recorder.cpp | 2 +- tape/histogram.cpp | 32 +-- tape/metrics_collector_writer.cpp | 20 +- tape/multi_recorder.cpp | 178 +++++++++------- tape/player.cpp | 106 +++++----- tape/recorder.cpp | 123 ++++++------ tape/shaper.cpp | 26 +-- tape/tape.cpp | 39 ++-- tape/tape.h | 51 +++-- tape/violation_recorder.cpp | 4 +- tape_file/tape_file.cpp | 20 +- tape_file/tape_file.h | 16 +- tape_plot/tape_plot.cpp | 8 +- tape_plot/tape_plot.h | 4 +- 63 files changed, 911 insertions(+), 1033 deletions(-) diff --git a/climate/climate.h b/climate/climate.h index 3f86f44d0..78a972a04 100644 --- a/climate/climate.h +++ b/climate/climate.h @@ -19,7 +19,7 @@ #include "weather.h" #include "weather_reader.h" -extern char climate_library_path[sizeof(char1024)]; +extern varchar climate_library_path; typedef enum e_compass_ptr { CP_H = 0, diff --git a/climate/csv_reader.cpp b/climate/csv_reader.cpp index 2944d93f4..744fbd20c 100644 --- a/climate/csv_reader.cpp +++ b/climate/csv_reader.cpp @@ -264,7 +264,7 @@ int csv_reader::read_prop(char *line) return 1; } -int csv_reader::read_header(char *line ) +int csv_reader::read_header(const char *line ) { struct cmnlist { char *name; diff --git a/climate/csv_reader.h b/climate/csv_reader.h index f64056a70..d7571d015 100644 --- a/climate/csv_reader.h +++ b/climate/csv_reader.h @@ -25,7 +25,7 @@ class csv_reader : public weather_reader { private: protected: int read_prop(char *); - int read_header(char *); + int read_header(const char *); int read_line(char *, int); int column_ct; diff --git a/climate/init.cpp b/climate/init.cpp index f8d20dfe0..3f3d70b00 100644 --- a/climate/init.cpp +++ b/climate/init.cpp @@ -4,7 +4,7 @@ #include "climate.h" -char climate_library_path[sizeof(char1024)] = "/usr/local/share/gridlabd/weather/US"; +varchar climate_library_path("/usr/local/share/gridlabd/weather/US"); EXPORT CLASS *init(CALLBACKS *fntable, MODULE *module, int argc, char *argv[]) { @@ -20,11 +20,11 @@ EXPORT CLASS *init(CALLBACKS *fntable, MODULE *module, int argc, char *argv[]) new weather(module); new csv_reader(module); - if ( gl_global_getvar("datadir",climate_library_path,sizeof(climate_library_path)) ) + if ( gl_global_getvar("datadir",climate_library_path.resize(PATH_MAX+1),PATH_MAX) ) { - strcat(climate_library_path,"/weather/US"); + climate_library_path = "/weather/US"; } - gl_global_create("climate::library_path",PT_char1024,climate_library_path,NULL); + gl_global_create("climate::library_path",PT_char1024,&climate_library_path,NULL); /* always return the first class registered */ return climate::oclass; diff --git a/commercial/ceus.cpp b/commercial/ceus.cpp index ccdc3d815..91196d643 100644 --- a/commercial/ceus.cpp +++ b/commercial/ceus.cpp @@ -21,17 +21,17 @@ double ceus::default_nominal_voltage = 240.0; complex ceus::default_nominal_voltage_A(240.0,0.0,A); complex ceus::default_nominal_voltage_B(240.0,-120.0,A); complex ceus::default_nominal_voltage_C(240.0,+120.0,A); -char32 ceus::default_weekday_code ="WEEKDAY"; -char32 ceus::default_saturday_code ="SATURDAY"; -char32 ceus::default_sunday_code ="SUNDAY"; -char32 ceus::default_holiday_code ="HOLIDAY"; -char32 ceus::default_month_heading = "Month"; -char32 ceus::default_daytype_heading = "Daytype"; -char32 ceus::default_hour_heading = "Hour"; -char1024 ceus::temperature_variable_name = "temperature"; -char1024 ceus::solargain_variable_name = "solar_direct"; -char1024 ceus::price_variable_name = "energy_price"; -char1024 ceus::occupancy_variable_name = "occupancy_fraction"; +char32 ceus::default_weekday_code("WEEKDAY"); +char32 ceus::default_saturday_code("SATURDAY"); +char32 ceus::default_sunday_code("SUNDAY"); +char32 ceus::default_holiday_code("HOLIDAY"); +char32 ceus::default_month_heading("Month"); +char32 ceus::default_daytype_heading("Daytype"); +char32 ceus::default_hour_heading("Hour"); +char1024 ceus::temperature_variable_name("temperature"); +char1024 ceus::solargain_variable_name("solar_direct"); +char1024 ceus::price_variable_name("energy_price"); +char1024 ceus::occupancy_variable_name("occupancy_fraction"); double ceus::default_temperature_cooling_balance = 70.0; double ceus::default_temperature_cooling_base = 70.0; double ceus::default_temperature_cooling_design = 100.0; @@ -754,7 +754,7 @@ int ceus::filename(char *filename, size_t len) size_t count = 0; struct { - char *label; + const char *label; DAYTYPE code; } codes[] = { diff --git a/commercial/office.cpp b/commercial/office.cpp index 74aa4043c..bf6eb7ff5 100644 --- a/commercial/office.cpp +++ b/commercial/office.cpp @@ -233,7 +233,7 @@ int office::create(void) Day 0 = Sunday, etc., day 7 = holiday Hour 0 = midnight to 1am */ -static void occupancy_schedule(char *text, char occupied[24]) +static void occupancy_schedule(const char *text, char occupied[24]) { char days[8]; memset(days,0,sizeof(days)); @@ -241,12 +241,11 @@ static void occupancy_schedule(char *text, char occupied[24]) char hours[27]; memset(hours,0,sizeof(hours)); - char *p = text; int next=-1; int start=-1, stop=-1; char *target = days; - for (p=text; true; p++) + for ( const char *p = text ; true ; p++) { if (*p==';') { /* recursion on the rest of the schedule */ @@ -355,8 +354,8 @@ int office::init(OBJECT *parent) zone.control.auxiliary_cutin=2; /* schedule */ - if (strcmp(zone.design.schedule,"")==0) - strcpy(zone.design.schedule,"1-5 8-17"); /* default is unoccupied, MTWRF 8a-5p is occupied */ + if ( zone.design.schedule == "" ) + zone.design.schedule = "1-5 8-17"; /* default is unoccupied, MTWRF 8a-5p is occupied */ occupancy_schedule(zone.design.schedule,occupied); /* automatic sizing of HVAC equipment */ diff --git a/gldcore/convert.cpp b/gldcore/convert.cpp index a7f936889..3cecc83a0 100644 --- a/gldcore/convert.cpp +++ b/gldcore/convert.cpp @@ -701,194 +701,29 @@ int convert_to_int64(const char *buffer, /**< a pointer to the string buffer */ return sscanf(buffer,"%lld",(long long *)data); } -/** Convert from a \e char8 - Converts a \e char8 property to a string. +/** Convert from a \e varchar + Converts a \e varchar property to a string. @return the number of character written to the string **/ -int convert_from_char8(char *buffer, /**< pointer to the string buffer */ +int convert_from_varchar(char *buffer, /**< pointer to the string buffer */ int size, /**< size of the string buffer */ void *data, /**< a pointer to the data */ PROPERTY *prop) /**< a pointer to keywords that are supported */ { - char temp[1025]; - const char *format = "%s"; - int count = 0; - if ( strchr((char*)data,' ') != NULL || strchr((char*)data,';') != NULL || ((char*)data)[0] == '\0' ) - { - // TODO: get rid of this when GLM is made strictly quoted properties - format = "\"%s\""; - } - count = sprintf(temp,format,(char*)data); - if ( count > size - 1 ) - { - return 0; - } - else - { - memcpy(buffer, temp, count); - buffer[count] = 0; - return count; - } -} - -/** Convert to a \e char8 - Converts a string to a \e char8 property. - @return 1 on success, 0 on failure, -1 if conversion was incomplete - **/ -int convert_to_char8(const char *buffer, /**< a pointer to the string buffer */ - void *data, /**< a pointer to the data */ - PROPERTY *prop) /**< a pointer to keywords that are supported */ -{ - char c=((char*)buffer)[0]; - switch (c) { - case '\0': - return ((char*)data)[0]='\0', 1; - case '"': - return sscanf(buffer+1,"%8[^\"]",(char*)data) ? strlen((char*)data)+1 : 0; - default: - return sscanf(buffer,"%8[^\n]",(char*)data) ? strlen((char*)data)+1 : 0; - } -} - -/** Convert from a \e char32 - Converts a \e char32 property to a string. - @return the number of character written to the string - **/ -int convert_from_char32(char *buffer, /**< pointer to the string buffer */ - int size, /**< size of the string buffer */ - void *data, /**< a pointer to the data */ - PROPERTY *prop) /**< a pointer to keywords that are supported */ -{ - char temp[1025]; - const char *format = "%s"; - int count = 0; - if ( strchr((char*)data,' ') != NULL || strchr((char*)data,';') != NULL || ((char*)data)[0] == '\0' ) - { - // TODO: get rid of this when GLM is made strictly quoted properties - format = "\"%s\""; - } - count = sprintf(temp,format,(char*)data); - if ( count > size - 1 ) - { - return 0; - } - else - { - memcpy(buffer, temp, count); - buffer[count] = 0; - return count; - } -} - -/** Convert to a \e char32 - Converts a string to a \e char32 property. - @return 1 on success, 0 on failure, -1 if conversion was incomplete - **/ -int convert_to_char32(const char *buffer, /**< a pointer to the string buffer */ - void *data, /**< a pointer to the data */ - PROPERTY *prop) /**< a pointer to keywords that are supported */ -{ - char c=((char*)buffer)[0]; - switch (c) { - case '\0': - return ((char*)data)[0]='\0', 1; - case '"': - return sscanf(buffer+1,"%32[^\"]",(char*)data) ? strlen((char*)data)+1 : 0; - default: - return sscanf(buffer,"%32[^\n]",(char*)data) ? strlen((char*)data)+1 : 0; - } -} - -/** Convert from a \e char256 - Converts a \e char256 property to a string. - @return the number of character written to the string - **/ -int convert_from_char256(char *buffer, /**< pointer to the string buffer */ - int size, /**< size of the string buffer */ - void *data, /**< a pointer to the data */ - PROPERTY *prop) /**< a pointer to keywords that are supported */ -{ - char temp[1025]; - const char *format = "%s"; - int count = 0; - if ( strchr((char*)data,' ') != NULL || strchr((char*)data,';') != NULL || ((char*)data)[0] == '\0') - { - // TODO: get rid of this when GLM is made strictly quoted properties - format = "\"%s\""; - } - count = sprintf(temp,format,(char*)data); - if ( count > size - 1 ) - { - return 0; - } - else - { - memcpy(buffer, temp, count); - buffer[count] = 0; - return count; - } + ((varchar*)data)->copy_to(buffer,size); + return strlen(buffer); } -/** Convert to a \e char256 - Converts a string to a \e char256 property. +/** Convert to a \e varchar + Converts a string to a \e varchar property. @return 1 on success, 0 on failure, -1 if conversion was incomplete **/ -int convert_to_char256(const char *buffer, /**< a pointer to the string buffer */ +int convert_to_varchar(const char *buffer, /**< a pointer to the string buffer */ void *data, /**< a pointer to the data */ PROPERTY *prop) /**< a pointer to keywords that are supported */ { - char c=((char*)buffer)[0]; - switch (c) { - case '\0': - return ((char*)data)[0]='\0', 1; - case '"': - return sscanf(buffer+1,"%256[^\"]",(char*)data) ? strlen((char*)data)+1 : 0; - default: - return sscanf(buffer,"%256[^\n]",(char*)data) ? strlen((char*)data)+1 : 0; - } -} - -/** Convert from a \e char1024 - Converts a \e char1024 property to a string. - @return the number of character written to the string - **/ -int convert_from_char1024(char *buffer, /**< pointer to the string buffer */ - int size, /**< size of the string buffer */ - void *data, /**< a pointer to the data */ - PROPERTY *prop) /**< a pointer to keywords that are supported */ -{ - char temp[4097]; - const char *format = "%s"; - int count = 0; - if (strchr((char*)data,' ')!=NULL || strchr((char*)data,';')!=NULL || ((char*)data)[0]=='\0') - format = "\"%s\""; - count = sprintf(temp,format,(char*)data); - if(count > size - 1){ - return 0; - } else { - memcpy(buffer, temp, count); - buffer[count] = 0; - return count; - } -} - -/** Convert to a \e char1024 - Converts a string to a \e char1024 property. - @return 1 on success, 0 on failure, -1 if conversion was incomplete - **/ -int convert_to_char1024(const char *buffer, /**< a pointer to the string buffer */ - void *data, /**< a pointer to the data */ - PROPERTY *prop) /**< a pointer to keywords that are supported */ -{ - char c=((char*)buffer)[0]; - switch (c) { - case '\0': - return ((char*)data)[0]='\0', 1; - case '"': - return sscanf(buffer+1,"%1024[^\"]",(char*)data) ? strlen((char*)data)+1 : 0; - default: - return sscanf(buffer,"%1024[^\n]",(char*)data) ? strlen((char*)data)+1 : 0; - } + ((varchar*)data)->copy_from(buffer); + return strlen(buffer); } /** Convert from an \e object diff --git a/gldcore/convert.h b/gldcore/convert.h index 19fe503b3..157c3035a 100644 --- a/gldcore/convert.h +++ b/gldcore/convert.h @@ -67,29 +67,11 @@ DEPRECATED int convert_from_int64(char *buffer, int size, void *data, PROPERTY * // Function: convert_to_int64 DEPRECATED int convert_to_int64(const char *buffer, void *data, PROPERTY *prop); -// Function: convert_from_char8 -DEPRECATED int convert_from_char8(char *buffer, int size, void *data, PROPERTY *prop); - -// Function: convert_to_char8 -DEPRECATED int convert_to_char8(const char *buffer, void *data, PROPERTY *prop); - -// Function: convert_from_char32 -DEPRECATED int convert_from_char32(char *buffer, int size, void *data, PROPERTY *prop); - -// Function: convert_to_char32 -DEPRECATED int convert_to_char32(const char *buffer, void *data, PROPERTY *prop); - -// Function: convert_from_char256 -DEPRECATED int convert_from_char256(char *buffer, int size, void *data, PROPERTY *prop); - -// Function: convert_to_char256 -DEPRECATED int convert_to_char256(const char *buffer, void *data, PROPERTY *prop); - // Function: convert_from_char1024 -DEPRECATED int convert_from_char1024(char *buffer, int size, void *data, PROPERTY *prop); +DEPRECATED int convert_from_varchar(char *buffer, int size, void *data, PROPERTY *prop); // Function: convert_to_char1024 -DEPRECATED int convert_to_char1024(const char *buffer, void *data, PROPERTY *prop); +DEPRECATED int convert_to_varchar(const char *buffer, void *data, PROPERTY *prop); // Function: convert_from_object DEPRECATED int convert_from_object(char *buffer, int size, void *data, PROPERTY *prop); diff --git a/gldcore/daemon.cpp b/gldcore/daemon.cpp index e2bc31cd1..327eeaafe 100644 --- a/gldcore/daemon.cpp +++ b/gldcore/daemon.cpp @@ -424,7 +424,7 @@ static void daemon_loadconfig(void) if ( fp == NULL ) { - if ( find_file(global_daemon_configfile,NULL,R_OK,global_daemon_configfile,sizeof(global_daemon_configfile)-1) == NULL || (fp=fopen(global_daemon_configfile,"rt")) == NULL ) + if ( find_file(global_daemon_configfile,NULL,R_OK,global_daemon_configfile.resize(PATH_MAX+1),PATH_MAX) == NULL || (fp=fopen(global_daemon_configfile,"rt")) == NULL ) { output_warning("daemon_loadconfig(): '%s' open failed: %s",(const char*)global_daemon_configfile,strerror(errno)); output_warning("daemon_loadconfig(): using default configuration"); @@ -498,8 +498,8 @@ static int daemon_arguments(int argc, const char *argv[]) if ( argc > 0 ) { struct stat fs; - strcpy((char*)global_daemon_configfile,*argv); - if ( stat((char*)global_daemon_configfile,&fs) == 0 ) + global_daemon_configfile = *argv; + if ( stat((const char*)global_daemon_configfile,&fs) == 0 ) { IN_MYCONTEXT output_debug("configuration file '%s selected", (const char*)global_daemon_configfile); } diff --git a/gldcore/find.cpp b/gldcore/find.cpp index 58794fa36..cf1f9cb0c 100644 --- a/gldcore/find.cpp +++ b/gldcore/find.cpp @@ -160,7 +160,7 @@ int compare(OBJECT *obj, FINDTYPE ftype, FINDOP op, void *value, char *propname) case FT_CLASS: return obj->oclass->module!=NULL && compare_string((char*)obj->oclass->name,op,(char*)value); case FT_ISA: return object_isa(obj,(char*)value); case FT_MODULE: return ( obj->oclass->module!=NULL && compare_string((char*)obj->oclass->module->name,op,(char*)value) ); - case FT_GROUPID: return compare_string((char*)obj->groupid,op,(char*)value); + case FT_GROUPID: return compare_string((const char*)obj->groupid,op,(const char*)value); case FT_RANK: return compare_int((int64)obj->rank,op,(int64)*(int*)value); case FT_CLOCK: return compare_int((int64)obj->clock,op,(int64)*(TIMESTAMP*)value); //case FT_PROPERTY: return compare_property_alt(obj,propname,op,value); @@ -928,7 +928,7 @@ int expression(PARSER, FINDPGM **pgm) FINDOP op = EQ; START; if WHITE ACCEPT; - if (TERM(name(HERE,pname,sizeof(pname))) && WHITE,TERM(compare_op(HERE,&op)) && WHITE,TERM(token(HERE,pvalue,sizeof(pvalue)))) + if (TERM(name(HERE,pname.resize(33),32)) && WHITE,TERM(compare_op(HERE,&op)) && WHITE,TERM(token(HERE,pvalue.resize(257),256))) { /* NOTE: this will seg fault if op's value is an invalid index! */ OBJECT _t; diff --git a/gldcore/globals.cpp b/gldcore/globals.cpp index 374289f2d..934db245a 100644 --- a/gldcore/globals.cpp +++ b/gldcore/globals.cpp @@ -399,16 +399,17 @@ STATUS GldGlobals::init(void) global_version_patch = version_patch(); global_version_build = version_build(); strncpy(global_version_branch,version_branch(),sizeof(global_version_branch)); - strcpy(global_datadir,global_execdir); - char *bin = strstr(global_datadir,"/bin"); - if ( bin ) *bin = '\0'; - strcat(global_datadir,"/share/gridlabd"); + global_datadir = global_execdir; + size_t bin = global_datadir.find("/bin"); + global_datadir.copy_from("/share/gridlabd",bin); sprintf(global_version,"%d.%d.%d-%d-%s",global_version_major,global_version_minor,global_version_patch,global_version_build,global_version_branch); - for (i = 0; i < sizeof(map) / sizeof(map[0]); i++){ + for ( i = 0 ; i < sizeof(map) / sizeof(map[0]) ; i++ ) + { struct s_varmap *p = &(map[i]); GLOBALVAR *var = global_create(p->name, p->type, p->addr, PT_ACCESS, p->access, p->description?PT_DESCRIPTION:0, p->description, NULL); - if(var == NULL){ + if ( var == NULL ) + { output_error("global_init(): global variable '%s' registration failed", p->name); /* TROUBLESHOOT The global variable initialization process was unable to register @@ -416,7 +417,9 @@ STATUS GldGlobals::init(void) detailed explanation of the error. Follow the troubleshooting for that message and try again. */ - } else { + } + else + { var->prop->keywords = p->keys; var->callback = p->callback; } diff --git a/gldcore/globals.h b/gldcore/globals.h index 085b8a828..3177f839f 100644 --- a/gldcore/globals.h +++ b/gldcore/globals.h @@ -19,7 +19,7 @@ #ifdef _MAIN_C #define GLOBAL -#define INIT(A) = A +#define INIT(A) (A) #else #define GLOBAL extern #define INIT(A) diff --git a/gldcore/gridlabd.h b/gldcore/gridlabd.h index 514adfb93..fa803266e 100644 --- a/gldcore/gridlabd.h +++ b/gldcore/gridlabd.h @@ -205,7 +205,7 @@ typedef enum e_status {FAILED=FALSE, SUCCESS=TRUE} STATUS; #ifdef DLMAIN #define EXTERN -#define INIT(X) = X +#define INIT(X) (X) #else #define EXTERN extern #define INIT(X) @@ -2662,10 +2662,10 @@ class gld_keyword inline char get_##X(size_t n) { gld_rlock _lock(my()); return X[n]; }; \ inline char get_##X(size_t n, gld_rlock&) { return X[n]; }; \ inline char get_##X(size_t n, gld_wlock&) { return X[n]; }; \ - inline void set_##X(char *p) { gld_wlock _lock(my()); strncpy(X,p,sizeof(X)); }; \ - inline void set_##X(char *p, gld_wlock&) { strncpy(X,p,sizeof(X)); }; \ - inline void set_##X(size_t n, char c) { gld_wlock _lock(my()); X[n]=c; }; \ - inline void set_##X(size_t n, char c, gld_wlock&) { X[n]=c; }; \ + inline void set_##X(char *p) { gld_wlock _lock(my()); X = p; }; \ + inline void set_##X(char *p, gld_wlock&) { X = p; }; \ + inline void set_##X(size_t n, char c) { gld_wlock _lock(my()); X.set_at(n,c); }; \ + inline void set_##X(size_t n, char c, gld_wlock&) { X.set_at(n,c); }; \ // Define: GL_ARRAY // Define an array property @@ -3092,7 +3092,7 @@ class gld_property { return; } char1024 vn; - sprintf(vn,"%s::%s",m,n); + vn.format("%s::%s",m,n); GLOBALVAR *v=callback->global.find(vn); pstruct.prop= (v?v->prop:NULL); }; diff --git a/gldcore/load.cpp b/gldcore/load.cpp index eb3cf288e..a68a6cd87 100755 --- a/gldcore/load.cpp +++ b/gldcore/load.cpp @@ -4547,8 +4547,9 @@ int GldLoader::object_properties(PARSER, CLASS *oclass, OBJECT *obj) SAVETERM; ACCEPT; } - else if (strcmp(propname,"groupid")==0){ - strncpy(obj->groupid, propval, sizeof(obj->groupid)); + else if (strcmp(propname,"groupid")==0) + { + obj->groupid = propval; } else if (strcmp(propname,"flags")==0) { diff --git a/gldcore/module.cpp b/gldcore/module.cpp index e2a5b09f5..10af7611a 100644 --- a/gldcore/module.cpp +++ b/gldcore/module.cpp @@ -850,10 +850,10 @@ int module_saveall(FILE *fp) int module_saveall_xml(FILE *fp){ MODULE *mod; int count = 0; - char32 varname = ""; - char32 value = ""; + char32 varname(""); + char32 value(""); GLOBALVAR *gvptr = NULL; - char1024 buffer; + char buffer[1024]; for (mod = first_module; mod != NULL; mod = mod->next){ char tname[67]; @@ -979,7 +979,7 @@ int module_saveall_xml_old(FILE *fp) for (mod=first_module; mod!=NULL; mod=mod->next) { CLASS *oclass; - char32 varname=""; + char32 varname(""); count += fprintf(fp,"\t\t \n"); count += fprintf(fp,"\t\t\t%s\n",mod->name); if(mod->major > 0) @@ -1942,7 +1942,7 @@ int sched_getinfo(int n,char *buf, size_t sz) } if ( process_map[n].pid!=0 ) { - char *modelname = process_map[n].model; + const char *modelname = process_map[n].model; int len; char t[64]=" - "; int is_defunct = 0; @@ -2019,7 +2019,7 @@ STATUS sched_getinfo(int n,PROCINFO *pinfo) pinfo->starttime = process_map[n].starttime; pinfo->stoptime = process_map[n].stoptime; pinfo->status = process_map[n].status; - strcpy(pinfo->model,process_map[n].model); + pinfo->model = process_map[n].model; pinfo->start = process_map[n].start; sched_unlock(n); return SUCCESS; @@ -2127,7 +2127,7 @@ MYPROCINFO *sched_allocate_procs(unsigned int n_threads, pid_t pid) my_proc->list[t] = n; process_map[n].pid = pid; IN_MYCONTEXT output_debug("module.c/sched_allocate_procs(): assigned processor %d to pid %d\n", n, pid); - strncpy(process_map[n].model,global_modelname,sizeof(process_map[n].model)-1); + process_map[n].model = global_modelname; process_map[n].start = time(NULL); sched_unlock(n); diff --git a/gldcore/object.cpp b/gldcore/object.cpp index e2349def9..9daa5eb47 100644 --- a/gldcore/object.cpp +++ b/gldcore/object.cpp @@ -998,7 +998,7 @@ static int set_header_value(OBJECT *obj, const char *name, const char *value) { if ( strlen(value)groupid) ) { - strcpy(obj->groupid,value); + obj->groupid = value; return SUCCESS; } else @@ -2152,7 +2152,7 @@ int object_saveall(FILE *fp) /**< the stream to write to */ PROPERTY *prop = NULL; CLASS *oclass = obj->oclass; MODULE *mod = oclass->module; - char32 oname = "(unidentified)"; + char32 oname("(unidentified)"); OBJECT *parent = obj->parent; OBJECT **topological_parent = object_get_object_by_name(obj,"topological_parent"); if ( mod ) @@ -3019,7 +3019,7 @@ FORECAST *forecast_create(OBJECT *obj, const char *specs) output_warning("forecast_create(): description parsing not implemented"); /* copy the description */ - strncpy(fc->specification,specs,sizeof(fc->specification)); + fc->specification = specs; return fc; } diff --git a/gldcore/property.cpp b/gldcore/property.cpp index 078c3d0e3..588f9f1c3 100644 --- a/gldcore/property.cpp +++ b/gldcore/property.cpp @@ -26,10 +26,10 @@ PROPERTYSPEC property_type[_PT_LAST] = { {"int16", "integer", "0", sizeof(int16), 6, convert_from_int16,convert_to_int16,NULL,NULL,NULL,convert_to_int16,{TCOPS(uint16)},}, {"int32", "integer", "0", sizeof(int32), 12, convert_from_int32,convert_to_int32,NULL,NULL,NULL,convert_to_int32,{TCOPS(uint32)},}, {"int64", "integer", "0", sizeof(int64), 24, convert_from_int64,convert_to_int64,NULL,NULL,NULL,convert_to_int64,{TCOPS(uint64)},}, - {"char8", "string", "", sizeof(char8), 8, convert_from_char8,convert_to_char8,NULL,NULL,NULL,convert_to_char8,{TCOPS(string)},}, - {"char32", "string", "", sizeof(char32), 32, convert_from_char32,convert_to_char32,NULL,NULL,NULL,convert_to_char32,{TCOPS(string)},}, - {"char256", "string", "", sizeof(char256), 256, convert_from_char256,convert_to_char256,NULL,NULL,NULL,convert_to_char256,{TCOPS(string)},}, - {"char1024", "string", "", sizeof(char1024), 1024, convert_from_char1024,convert_to_char1024,NULL,NULL,NULL,convert_to_char1024,{TCOPS(string)},}, + {"char8", "string", "", sizeof(char8), 8, convert_from_varchar,convert_to_varchar,NULL,NULL,NULL,convert_to_varchar,{TCOPS(string)},}, + {"char32", "string", "", sizeof(char32), 32, convert_from_varchar,convert_to_varchar,NULL,NULL,NULL,convert_to_varchar,{TCOPS(string)},}, + {"char256", "string", "", sizeof(char256), 256, convert_from_varchar,convert_to_varchar,NULL,NULL,NULL,convert_to_varchar,{TCOPS(string)},}, + {"char1024", "string", "", sizeof(char1024), 1024, convert_from_varchar,convert_to_varchar,NULL,NULL,NULL,convert_to_varchar,{TCOPS(string)},}, {"object", "string", NULL, sizeof(OBJECT*), 64, convert_from_object,convert_to_object,NULL,NULL,NULL,convert_to_object,{TCOPB(object)},object_get_part,object_set_part}, {"delegated", "string", NULL, 0, PSZ_DYNAMIC, convert_from_delegated, convert_to_delegated}, {"bool", "string", "FALSE", sizeof(bool), 6, convert_from_boolean, convert_to_boolean,NULL,NULL,NULL,convert_to_boolean,{TCOPB(bool)},}, diff --git a/gldcore/property.h b/gldcore/property.h index d6b112340..80e84dee1 100644 --- a/gldcore/property.h +++ b/gldcore/property.h @@ -69,80 +69,100 @@ typedef unsigned int64 DEPRECATED uint64; #endif // HAVE_STDINT_H -#ifdef __cplusplus - class varchar { private: int *refcnt; - char *bufptr; + char **bufptr; size_t *buflen; - inline char *resize(size_t len) - { - if ( len > *buflen ) - { - *buflen = ::pow(2,::ceil(::log(len+1)/::log(2))); - char *bigger = new char[*buflen]; - strncpy(bigger,bufptr,(*buflen)-1); - delete [] bufptr; - bufptr = bigger; - } - return bufptr; - } +private: - inline char *resize(const char *s) + size_t get_pos(int pos) { - return resize(strlen(s)+1); + int end = strlen(*bufptr); + int p = (pos<0?end-pos:pos); + if ( p < 0 ) p = 0; + if ( p >= end ) p = end - 1; + return p; } public: - // Constructor: charbuf + // Constructor: varchar inline varchar(size_t size=0) { refcnt = new int; - *refcnt = 1; buflen = new size_t; - *buflen = size+1; - bufptr = new char[*buflen]; + bufptr = new char*; + *refcnt = 1; + *buflen = ::pow(2,::ceil(::log(size+1)/::log(2))); + *bufptr = new char[*buflen]; erase(); }; - // Constructor: charbuf + // Constructor: varchar inline varchar(const char *s) { refcnt = new int; - *refcnt = 1; buflen = new size_t; + bufptr = new char*; + *refcnt = 1; *buflen = ::pow(2,::ceil(::log(strlen(s)+1)/::log(2))); // round up to next power of 2 - bufptr = new char[*buflen]; + *bufptr = new char[*buflen]; copy_from(s); }; - // Constructor: charbuf + // Constructor: varchar inline varchar(varchar &s) { refcnt = s.refcnt; buflen = s.buflen; bufptr = s.bufptr; (*refcnt)++; - } + }; - // Destructor: ~charbuf + // Destructor: ~varchar inline ~varchar(void) { if ( --(*refcnt) == 0 ) { + delete [] *bufptr; delete refcnt; delete buflen; - delete [] bufptr; + delete bufptr; refcnt = NULL; buflen = NULL; bufptr = NULL; } }; +#ifdef MAIN +#warning change all char * to const char * +#endif + inline char *resize(size_t len) + { + if ( len > *buflen ) + { + *buflen = ::pow(2,::ceil(::log(len+1)/::log(2))); + char *bigger = new char[*buflen]; + strncpy(bigger,*bufptr,(*buflen)-1); + delete [] *bufptr; + *bufptr = bigger; + } + return *bufptr; + } + + inline char *resize(const char *s) + { + return resize(strlen(s)+1); + } + + inline operator const char * () const + { + return *bufptr; + }; + inline varchar &operator = (varchar &s) { refcnt = s.refcnt; @@ -150,13 +170,13 @@ class varchar { bufptr = s.bufptr; (*refcnt)++; return *this; - } + }; inline varchar &operator = (const char *s) { copy_from(s); return *this; - } + }; // Method: get_size inline size_t get_size(void) const @@ -167,96 +187,139 @@ class varchar { // Method: get_length inline size_t get_length(void) const { - return strlen(bufptr); + return strlen(*bufptr); }; // Method: get_string inline char *get_string(void) { - return bufptr; + return *bufptr; + }; + + // Method: get_at + inline const char *substr(int pos) + { + return *bufptr + get_pos(pos); + }; + + inline const void set_at(int pos, char c) + { + (*bufptr)[get_pos(pos)] = c; + } + + inline char operator [] (int i) + { + return (*bufptr)[get_pos(i)]; }; // Method: erase - inline char* erase(void) + inline const char* erase(void) { - return (char*)memset(bufptr,0,*buflen); + memset(*bufptr,0,*buflen); + return *bufptr; }; // Method: copy_to - inline char* copy_to(char *s, size_t len = 0) const + inline const char* copy_to(char *s, size_t len, size_t at = 0) const { - return ( s != NULL ) ? strncpy(s,bufptr,len?len:*buflen) : NULL; + strncpy(s,(*bufptr)+at,len); + return s; }; // Method: copy_from - inline char* copy_from(const char *s) - { - - return ( s != NULL ) ? strncpy(resize(s),s,*buflen) : NULL; + inline char* copy_from(const char *s, size_t at = 0) + { + size_t len = strlen(*bufptr); + if ( at < 0 ) + { + at = len-at; + if ( at < 0 ) + { + at = 0; + } + } + resize(strlen(s)+strlen(*bufptr)-at+1); + return ( s != NULL ) ? strncpy((*bufptr)+at,s,*buflen) : NULL; }; - // Method: cast to const char* - inline operator const char*(void) const + // Method: operator == + inline bool operator == (const char *s) const { - return bufptr; + return strcmp(*bufptr,s) == 0; }; - // Method: operator == - inline bool operator == (const char *s) const + // Method: operator != + inline bool operator != (const char *s) const { - return strcmp(bufptr,s)==0; + return strcmp(*bufptr,s) != 0; }; // Method: operator < inline bool operator < (const char *s) const { - return strcmp(bufptr,s)==-1; + return strcmp(*bufptr,s) == -1; }; // Method: operator > inline bool operator > (const char *s) const { - return strcmp(bufptr,s)==1; + return strcmp(*bufptr,s) == 1; }; // Method: operator <= inline bool operator <= (const char *s) const { - return strcmp(bufptr,s)<=0; + return strcmp(*bufptr,s) <= 0; }; // Method: operator >= inline bool operator >= (const char *s) const { - return strcmp(bufptr,s)>=0; + return strcmp(*bufptr,s) >= 0; }; // Method: find - inline char *find(const char c) + inline size_t find(const char c) const { - return strchr(bufptr,c); + char *ptr = strchr(*bufptr,c); + return ptr ? ptr - (*bufptr) : -1; }; // Method: find - inline char *find(const char *s) + inline size_t find(const char *s) const { - return strstr(bufptr,s); + char *ptr = strstr(*bufptr,s); + return ptr ? ptr - (*bufptr) : -1; }; // Method: findrev - inline char *findrev(const char c) + inline size_t findrev(const char c) const { - return strrchr(bufptr,c); + char *ptr = strrchr(*bufptr,c); + return ptr ? ptr - (*bufptr) : -1; }; + // Method: findrev + inline size_t findrev(const char *s) const + { + size_t last = -1; + size_t next = find(s); + while ( next > last ) + { + last = next; + next = find(s); + } + return next; + } + // Method: token inline char *token(const char *from, const char *delim, char **context) { - return ::strtok_r(from==NULL?bufptr:NULL,delim,context); + return ::strtok_r(from==NULL?(*bufptr):NULL,delim,context); }; // Method: format - inline size_t format(char *fmt, ...) + inline size_t format(const char *fmt, ...) { va_list ptr; va_start(ptr,fmt); @@ -266,112 +329,25 @@ class varchar { }; // Method: vformat - inline size_t vformat(char *fmt, va_list ptr) + inline size_t vformat(const char *fmt, va_list ptr) { size_t len = vsnprintf(NULL,0,fmt,ptr); resize(len+1); - return vsnprintf(bufptr,(*buflen)-1,fmt,ptr); + return vsnprintf(*bufptr,(*buflen)-1,fmt,ptr); }; }; -/* Class: charbuf - - General character array buffer handling class - */ -template class charbuf { -private: - - char buffer[size]; - -public: - - // Constructor: charbuf - inline charbuf(void) { erase(); }; - - // Constructor: charbuf - inline charbuf(const char *s) { copy_from(s); }; - - // Destructor: ~charbuf - inline ~charbuf(void) {}; - - // Method: get_size - inline size_t get_size(void) { return size; }; - - // Method: get_addr - inline void *get_addr(void) { return (void*)buffer; }; - - // Method: get_length - inline size_t get_length(void) { return strlen(buffer); }; - - // Method: get_string - inline char *get_string(void) { return buffer; }; - - // Method: erase - inline char* erase(void) { return (char*)memset(buffer,0,size); }; - - // Method: copy_to - inline char* copy_to(char *s) { return s?strncpy(s,buffer,size):NULL; }; - - // Method: copy_from - inline char* copy_from(const char *s) { return s?strncpy(buffer,s,size):NULL; }; - - // Method: operator char* - inline operator char*(void) { return buffer; }; - - // Method: operator== - inline bool operator==(const char *s) { return strcmp(buffer,s)==0; }; - - // Method: operator< - inline bool operator<(const char *s) { return strcmp(buffer,s)==-1; }; - - // Method: operator> - inline bool operator>(const char *s) { return strcmp(buffer,s)==1; }; - - // Method: operator<= - inline bool operator<=(const char *s) { return strcmp(buffer,s)<=0; }; - - // Method: operator>= - inline bool operator>=(const char *s) { return strcmp(buffer,s)>=0; }; - - // Method: find - inline char *find(const char c) { return strchr(buffer,c); }; - - // Method: find - inline char *find(const char *s) { return strstr(buffer,s); }; - - // Method: findrev - inline char *findrev(const char c) { return strrchr(buffer,c); }; - - // Method: token - inline char *token(const char *from, const char *delim, char **context) { return ::strtok_r(from==NULL?this->buffer:NULL,delim,context); }; - - // Method: format - inline size_t format(char *fmt, ...) { va_list ptr; va_start(ptr,fmt); size_t len=vsnprintf(buffer,size,fmt,ptr); va_end(ptr); return len; }; - - // Method: vformat - inline size_t vformat(char *fmt, va_list ptr) { return vsnprintf(buffer,size,fmt,ptr); }; -}; - // Typedef: char1024 -typedef charbuf<1025> char1024; +typedef varchar char1024; // Typedef: char256 -typedef charbuf<257> char256; +typedef varchar char256; // Typedef: char32 -typedef charbuf<33> char32; +typedef varchar char32; // Typedef: char8 -typedef charbuf<9> char8; - -#else // DEPRECATED - -typedef char char1024[1025]; /**< strings up to 1024 characters */ -typedef char char256[257]; /**< strings up to 256 characters */ -typedef char char32[33]; /**< strings up to 32 characters */ -typedef char char8[9]; /** string up to 8 characters */ - -#endif +typedef varchar char8; // Typedef: set typedef uint64 set; /* sets (each of up to 64 values may be defined) */ diff --git a/gldcore/sanitize.cpp b/gldcore/sanitize.cpp index 65ad3069c..c4bfef557 100644 --- a/gldcore/sanitize.cpp +++ b/gldcore/sanitize.cpp @@ -68,34 +68,33 @@ int sanitize(void *main, int argc, const char *argv[]) } // dump object name index - if ( strcmp(global_sanitizeindex,".xml")==0 ) + if ( global_sanitizeindex == ".xml" ) { - strcpy(global_sanitizeindex,global_modelname); - char *ext = strrchr(global_sanitizeindex,'.'); - if ( ext && strcmp(ext,".glm")==0 ) strcpy(ext,"-index.xml"); - else strcat(global_sanitizeindex,"-index.xml"); + global_sanitizeindex = global_modelname; + global_sanitizeindex.copy_from("-index.xml",global_sanitizeindex.findrev(".xml")); } - else if ( strcmp(global_sanitizeindex,".txt")==0 ) + else if ( global_sanitizeindex == ".txt" ) { - strcpy(global_sanitizeindex,global_modelname); - char *ext = strrchr(global_sanitizeindex,'.'); - if ( ext && strcmp(ext,".glm")==0 ) strcpy(ext,"-index.txt"); - else strcat(global_sanitizeindex,"-index.txt"); + global_sanitizeindex = global_modelname; + global_sanitizeindex.copy_from("-index.txt",global_sanitizeindex.findrev(".txt")); } - else if ( global_sanitizeindex[0]=='.' ) + else if ( global_sanitizeindex == ".json" ) + { + global_sanitizeindex = global_modelname; + global_sanitizeindex.copy_from("-index.json",global_sanitizeindex.findrev(".json")); + } + else if ( global_sanitizeindex[0] == '.' ) { output_error("sanitization index file spec '%s' is not recognized", global_sanitizeindex.get_string()); return -2; } - if ( strcmp(global_sanitizeindex,"")!=0 ) + if ( global_sanitizeindex != "" ) { - char *ext = strrchr(global_sanitizeindex,'.'); - bool use_xml = (ext && strcmp(ext,".xml")==0) ; fp = fopen(global_sanitizeindex,"w"); if ( fp ) { SAFENAME *item; - if ( use_xml ) + if ( varchar(global_sanitizeindex.substr(-4)) == ".xml" ) { fprintf(fp,"\n"); fprintf(fp,"\t%s\n",global_modelname); @@ -109,6 +108,20 @@ int sanitize(void *main, int argc, const char *argv[]) fprintf(fp,"\t\n"); fprintf(fp,"\n"); } + else if ( varchar(global_sanitizeindex.substr(-4)) == ".json" ) + { + fprintf(fp,"{\n"); + fprintf(fp," \"modelname\" : \"%s\",\n",global_modelname); + fprintf(fp," \"geographic_offsets\" : {\n"); + fprintf(fp," \"latitude\" : %.6f,\n",delta_latitude); + fprintf(fp," \"longitude\" : %.6f\n",delta_longitude); + fprintf(fp," }\n"); + fprintf(fp," \"safename_map\" : {\n"); + for ( item=safename_list ; item!=NULL ; item=item->next ) + fprintf(fp," \"%s\" : \"%s\"%s\n", item->old, item->name, item->next != NULL ? "," : ""); + fprintf(fp," }\n"); + fprintf(fp,"}\n"); + } else { fprintf(fp,"modelname\t= %s\n", global_modelname); diff --git a/gldcore/timestamp.cpp b/gldcore/timestamp.cpp index 37ae9bafb..34c4e3786 100644 --- a/gldcore/timestamp.cpp +++ b/gldcore/timestamp.cpp @@ -1037,7 +1037,7 @@ const char *timestamp_set_tz(const char *tz_name) } load_tzspecs(tz_name); - strcpy(global_timezone_locale,current_tzname); + global_timezone_locale = current_tzname; return current_tzname; } diff --git a/industrial/industrial.cpp b/industrial/industrial.cpp index a62509fb0..2a5593e7c 100644 --- a/industrial/industrial.cpp +++ b/industrial/industrial.cpp @@ -10,8 +10,8 @@ EXPORT_PRECOMMIT(industrial); CLASS *industrial::oclass = NULL; industrial *industrial::defaults = NULL; -char256 industrial::load_property_name = "base_power_"; -char1024 industrial::naics_data_file = "naics_data_file.csv"; +char256 industrial::load_property_name("base_power_"); +char1024 industrial::naics_data_file("naics_data_file.csv"); naics *industrial::naics_data = NULL; industrial::industrial(MODULE *module) diff --git a/influxdb/database.cpp b/influxdb/database.cpp index 9b9d68e7b..1a429e13f 100644 --- a/influxdb/database.cpp +++ b/influxdb/database.cpp @@ -13,12 +13,12 @@ EXPORT_DESTROY(database); CLASS *database::oclass = NULL; database *database::defaults = NULL; -char32 database::connection_protocol = "http"; -char32 database::default_username = "gridlabd"; -char32 database::default_password = "gridlabd"; -char256 database::default_hostname = "localhost"; +char32 database::connection_protocol("http"); +char32 database::default_username("gridlabd"); +char32 database::default_password("gridlabd"); +char256 database::default_hostname("localhost"); int32 database::default_port = 8086; -char256 database::default_database = "gridlabd"; +char256 database::default_database("gridlabd"); bool database::synchronous_postdata = false; static FILE *devnull = NULL; @@ -61,19 +61,19 @@ database::database(MODULE *module) } gl_global_create("influxdb::default_username", - PT_char32,database::default_username.get_addr(), + PT_char32,&database::default_username, PT_ACCESS,PA_PUBLIC, PT_DESCRIPTION,"default InfluxDB username", NULL); gl_global_create("influxdb::default_password", - PT_char32,database::default_password.get_addr(), + PT_char32,&database::default_password, PT_ACCESS,PA_PUBLIC, PT_DESCRIPTION,"default InfluxDB password", NULL); gl_global_create("influxdb::default_hostname", - PT_char256,database::default_hostname.get_addr(), + PT_char256,&database::default_hostname, PT_ACCESS,PA_PUBLIC, PT_DESCRIPTION,"default InfluxDB hostname", NULL); @@ -85,13 +85,13 @@ database::database(MODULE *module) NULL); gl_global_create("influxdb::default_database", - PT_char256,database::default_database.get_addr(), + PT_char256,&database::default_database, PT_ACCESS,PA_PUBLIC, PT_DESCRIPTION,"default InfluxDB database", NULL); gl_global_create("influxdb::connection_protocol", - PT_char32,database::connection_protocol.get_addr(), + PT_char32,&database::connection_protocol, PT_ACCESS,PA_PUBLIC, PT_DESCRIPTION,"default InfluxDB connection protocol", NULL); @@ -524,7 +524,7 @@ int database::get_taglist(char *buffer, int size) return pos; } -int database::add_taglist(char *buffer) +int database::add_taglist(const char *buffer) { char value[1024]; int len = strlen(buffer); @@ -650,7 +650,8 @@ const char *database::get_header_value(OBJECT *obj, const char *item, char *buff } else if ( strcmp(item,"groupid") == 0 ) { - char *c, *p = buffer; + const char *c; + char *p = buffer; for ( c = obj->groupid ; *c != '\0' && p < buffer+len-1 ; c++ ) { if ( strchr(", \t",*c) ) diff --git a/influxdb/database.h b/influxdb/database.h index 0cf8db69b..d935f702c 100644 --- a/influxdb/database.h +++ b/influxdb/database.h @@ -121,7 +121,7 @@ class database : public gld_object std::string *tagtext; int get_taglist_size(); int get_taglist(char *buffer,int size); - int add_taglist(char *buffer); + int add_taglist(const char *buffer); size_t log_id; public: diff --git a/influxdb/recorder.cpp b/influxdb/recorder.cpp index fcfd54c2f..4940c8b31 100644 --- a/influxdb/recorder.cpp +++ b/influxdb/recorder.cpp @@ -209,7 +209,7 @@ int recorder::get_taglist(char *buffer, int size) return pos; } -int recorder::add_taglist(char *buffer) +int recorder::add_taglist(const char *buffer) { char value[1024]; int len = strlen(buffer); diff --git a/influxdb/recorder.h b/influxdb/recorder.h index 8cee72562..fe45c92dc 100644 --- a/influxdb/recorder.h +++ b/influxdb/recorder.h @@ -34,7 +34,7 @@ class recorder : public gld_object std::string *tagtext; int get_taglist_size(); int get_taglist(char *buffer,int size); - int add_taglist(char *buffer); + int add_taglist(const char *buffer); public: diff --git a/market/auction.cpp b/market/auction.cpp index acce231ee..14470e463 100644 --- a/market/auction.cpp +++ b/market/auction.cpp @@ -509,7 +509,7 @@ int auction::init_statistics() // enqueue a new STATPROP instance sp = (STATISTIC *)malloc(sizeof(STATISTIC)); memcpy(sp, &statprop, sizeof(STATISTIC)); - strcpy(sp->statname, prop->name); + sp->statname = prop->name; sp->prop = prop; sp->value = 0; if(stats == 0){ diff --git a/market/controller.cpp b/market/controller.cpp index 47a114c8d..c4522ca43 100644 --- a/market/controller.cpp +++ b/market/controller.cpp @@ -657,10 +657,12 @@ int controller::init(OBJECT *parent){ return 0; } } - } else if(control_mode == CN_DOUBLE_RAMP){ - sprintf(aux_state, "is_AUX_on"); - sprintf(heat_state, "is_HEAT_on"); - sprintf(cool_state, "is_COOL_on"); + } + else if ( control_mode == CN_DOUBLE_RAMP ) + { + aux_state = "is_AUX_on"; + heat_state = "is_HEAT_on"; + cool_state = "is_COOL_on"; if(fetch_property(&pHeatingSetpoint, (char *)(&heating_setpoint), parent) == 0) { return 0; } diff --git a/market/double_controller.cpp b/market/double_controller.cpp index 908a093bd..901743083 100644 --- a/market/double_controller.cpp +++ b/market/double_controller.cpp @@ -85,10 +85,11 @@ double_controller::double_controller(MODULE *module) } } -int double_controller::create( ) { +int double_controller::create( void ) +{ memset(this, 0, sizeof(double_controller)); - sprintf(avg_target, "avg24"); - sprintf(std_target, "std24"); + avg_target = "avg24"; + std_target = "std24"; controller_bid.rebid = false; controller_bid.bid_accepted = true; return 1; @@ -99,15 +100,15 @@ void double_controller::cheat( ) { case ST_NONE: break; case ST_HOUSE: - strcpy(temperature_name, "air_temperature"); - strcpy(deadband_name, "thermostat_deadband"); - strcpy(cool_setpoint_name, "cooling_setpoint"); - strcpy(cool_demand_name, "cooling_demand"); - strcpy(heat_setpoint_name, "heating_setpoint"); - strcpy(heat_demand_name, "heating_demand"); - strcpy(load_name, "hvac_load"); - strcpy(total_load_name, "total_load"); - strcpy(state_name,"power_state"); + temperature_name = "air_temperature"; + deadband_name = "thermostat_deadband"; + cool_setpoint_name = "cooling_setpoint"; + cool_demand_name = "cooling_demand"; + heat_setpoint_name = "heating_setpoint"; + heat_demand_name = "heating_demand"; + load_name = "hvac_load"; + total_load_name = "total_load"; + state_name = "power_state"; break; default: break; diff --git a/market/generator_controller.cpp b/market/generator_controller.cpp index c49435084..e18b5c01b 100644 --- a/market/generator_controller.cpp +++ b/market/generator_controller.cpp @@ -142,7 +142,7 @@ int generator_controller::create(void) total_hours_year = 0.0; //0.0 = infinite hours hours_run_this_year = 0.0; //None run yet scaling_factor = 0.2; //Default value from an Olypen generator - runtime_year_end[0] = '\0'; //No date specified + runtime_year_end.erase(); //No date specified license_premium = 0.0; //No premium calculated hours_in_year = 8760.0; //Assumes normal year op_and_maint_cost = 0.0; //No O&M Cost @@ -1763,7 +1763,7 @@ void generator_controller::parse_bid_curve(OBJECT *thisobj, TIMESTAMP t0) { //Set up the parsing values plast = 0.0; - curr_ptr = bidding_curve_txt; + curr_ptr = bidding_curve_txt.get_string(); //Loop for (index=0; index<(num_entries+1); index++) diff --git a/powerflow/currdump.cpp b/powerflow/currdump.cpp index b26a44e9c..3e33d243b 100644 --- a/powerflow/currdump.cpp +++ b/powerflow/currdump.cpp @@ -67,7 +67,7 @@ int currdump::create(void) runcount = 0; mode = CDM_RECT; interval = 0; - strcpy(filemode,"w"); + filemode = "w"; maxcount = 1; version = 0; return 1; @@ -87,9 +87,9 @@ int currdump::init(OBJECT *parent) { maxcount = 0; } - if ( strcmp(filemode,"") == 0 ) + if ( filemode == "" ) { - strcpy(filemode,"a"); + filemode = "a"; } runtime = TS_NEVER; } @@ -99,9 +99,9 @@ int currdump::init(OBJECT *parent) { maxcount = 1; } - if ( strcmp(filemode,"") == 0 ) + if ( filemode == "" ) { - strcpy(filemode,"w"); + filemode = "w"; } } if ( version < 0 || version > 2 ) diff --git a/powerflow/fault_check.cpp b/powerflow/fault_check.cpp index c7f85d527..baf531c82 100644 --- a/powerflow/fault_check.cpp +++ b/powerflow/fault_check.cpp @@ -53,7 +53,7 @@ int fault_check::create(void) phases = PHASE_A; //Arbitrary - set so powerflow_object shuts up (library doesn't grant us access to synch) fcheck_state = SINGLE; //Default to only one check - output_filename[0] = '\0'; //Empty file name + output_filename.erase(); //Empty file name full_print_output = false; //By default, only output unsupported nodes diff --git a/powerflow/pqload.cpp b/powerflow/pqload.cpp index 4f61272c0..6704e2fef 100644 --- a/powerflow/pqload.cpp +++ b/powerflow/pqload.cpp @@ -107,7 +107,7 @@ pqload::pqload(MODULE *mod) : load(mod) memset(this,0,sizeof(pqload)); input[5] = 1.0; /* constant term */ //imped_p[5] = 0; - strcpy(schedule, "* * * * *:1.0;"); + schedule = "* * * * *:1.0;"; temp_nom = zero_F; load_class = LC_UNKNOWN; sched_until = TS_NEVER; diff --git a/powerflow/restoration.cpp b/powerflow/restoration.cpp index 26798c90f..fa28cdc75 100644 --- a/powerflow/restoration.cpp +++ b/powerflow/restoration.cpp @@ -262,10 +262,10 @@ int restoration::init(OBJECT *parent) //Parse the defined input values //Read in the feeder power limit values - feeder_power_limit = ParseDoubleString(&feeder_power_limit_Pub[0],&numfVer); + feeder_power_limit = ParseDoubleString(feeder_power_limit_Pub.get_string(),&numfVer); //Read in the feeder vertex object list - fVerObjList = ParseObjectString(&fVerPub[0],&working_int_val); + fVerObjList = ParseObjectString(fVerPub.get_string(),&working_int_val); //Make sure the counts match, or throw an error if (numfVer != working_int_val) @@ -277,7 +277,7 @@ int restoration::init(OBJECT *parent) } //Read in the feeder "power flow" object list - fLinkObjList = ParseObjectString(&feeder_power_link_Pub[0],&working_int_val); + fLinkObjList = ParseObjectString(feeder_power_link_Pub.get_string(),&working_int_val); //Do another check to make sure counts match if (numfVer != working_int_val) @@ -348,10 +348,10 @@ int restoration::init(OBJECT *parent) } //Read in the microgrid power limits (complex) - microgrid_limit = ParseComplexString(µgrid_limit_Pub[0],&numMG); + microgrid_limit = ParseComplexString(microgrid_limit_Pub.get_string(),&numMG); //Read in the microgrid vertex list - mVerObjList = ParseObjectString(&mVerPub[0],&working_int_val); + mVerObjList = ParseObjectString(mVerPub.get_string(),&working_int_val); //Check to make sure these are proper too if (numMG != working_int_val) @@ -364,7 +364,7 @@ int restoration::init(OBJECT *parent) } //Read in the microgrid "power flow" object list - mLinkObjList = ParseObjectString(µgrid_power_link_Pub[0],&working_int_val); + mLinkObjList = ParseObjectString(microgrid_power_link_Pub.get_string(),&working_int_val); //Do another check to make sure counts match if (numMG != working_int_val) @@ -848,7 +848,7 @@ int restoration::PerformRestoration(int faulting_link) //Utility functions - string parsing //Parse comma-separated list of doubles into array //Assumes 1024-character input array -double *restoration::ParseDoubleString(char *input_string,int *num_items_found) +double *restoration::ParseDoubleString(char *input_string, int *num_items_found) { int index, num_items, item_count; char *working_token, *parsing_token; diff --git a/powerflow/restoration.h b/powerflow/restoration.h index 962ef1fcc..496e53644 100644 --- a/powerflow/restoration.h +++ b/powerflow/restoration.h @@ -11,7 +11,7 @@ typedef struct s_ChainNode { int data; struct s_ChainNode *link; -} CHAINNODE; ///Node of the linked list +} CHAINNODE; /// Node of the linked list typedef struct s_intVect { int *data; @@ -20,44 +20,44 @@ typedef struct s_intVect { } INTVECT; typedef struct s_ChordSet { - int *data_1; //Column 1 - int *data_2; //Column 2 - semi-silly to do it this way, but I have reasons + int *data_1; // Column 1 + int *data_2; // Column 2 - semi-silly to do it this way, but I have reasons int currSize; int maxSize; } CHORDSET; typedef struct s_LocSet { - int *data_1; //Column 1 - int *data_2; //Column 2 - semi-silly to do it this way, but I have reasons - int *data_3; //Column 3 - Expanded silly, but makes the ML transition easier - int *data_4; //Column 4 - Expanded silly, but makes the ML transition easier + int *data_1; // Column 1 + int *data_2; // Column 2 - semi-silly to do it this way, but I have reasons + int *data_3; // Column 3 - Expanded silly, but makes the ML transition easier + int *data_4; // Column 4 - Expanded silly, but makes the ML transition easier int currSize; int maxSize; } LOCSET; typedef struct s_CandSwOpe { - int *data_1; //Column 1 -- Switch to be opened (1) - int *data_2; //Column 2 - semi-silly to do it this way, but I have reasons -- Switch to be opened (2) - int *data_3; //Column 3 - Expanded silly, but makes the ML transition easier -- Switch to be closed (1) - int *data_4; //Column 4 - Expanded silly, but makes the ML transition easier -- Switch to be closed (2) - int *data_5; //Column 5 - Expanded silly, but makes the ML transition easier -- previous cyclic interfhange operation - double *data_6; //Column 6 - Expanded silly, but makes the ML transition easier -- Amount of loads not able to be restored or overload. Not sure - int *data_7; //Column 7 - Expanded silly, but makes the ML transition easier -- Feeder number overloaded? + int *data_1; // Column 1 -- Switch to be opened (1) + int *data_2; // Column 2 - semi-silly to do it this way, but I have reasons -- Switch to be opened (2) + int *data_3; // Column 3 - Expanded silly, but makes the ML transition easier -- Switch to be closed (1) + int *data_4; // Column 4 - Expanded silly, but makes the ML transition easier -- Switch to be closed (2) + int *data_5; // Column 5 - Expanded silly, but makes the ML transition easier -- previous cyclic interfhange operation + double *data_6; // Column 6 - Expanded silly, but makes the ML transition easier -- Amount of loads not able to be restored or overload. Not sure + int *data_7; // Column 7 - Expanded silly, but makes the ML transition easier -- Feeder number overloaded? int currSize; int maxSize; } CANDSWOP; typedef struct s_BranchVertices { - int from_vert; //From vertex - int to_vert; //To vertex + int from_vert; // From vertex + int to_vert; // To vertex } BRANCHVERTICES; -//ChainNode class +// ChainNode class class Chain { public: //member properties - CHAINNODE *first; //first node of linked list - CHAINNODE *last; //last node of linked list + CHAINNODE *first; // first node of linked list + CHAINNODE *last; // last node of linked list public: //member constructor inline Chain() { @@ -65,107 +65,107 @@ class Chain last = NULL; } public: //member functions - void delAllNodes(void); //deletes all nodes in linked list - bool isempty(void); //checks if linked list is empty - int getLength(void); //returns the length of the linked list - int search(int sData); //search linkedlist for given data, return index - bool modify(int oldData, int newData); //replace oldData with newData and return 1. If no oldData, return 0 - void addNode(int kIndex, int newData); //add new node after kth node - void deleteNode(int dData); //delete 1st node found containing dData. If not found, do nothing - void copy(Chain *ilist); //copy a linked list into a new linked list - void append(int newData); //add a new node containing newData at the end of the linked list + void delAllNodes(void); // deletes all nodes in linked list + bool isempty(void); // checks if linked list is empty + int getLength(void); // returns the length of the linked list + int search(int sData); // search linkedlist for given data, return index + bool modify(int oldData, int newData); // replace oldData with newData and return 1. If no oldData, return 0 + void addNode(int kIndex, int newData); // add new node after kth node + void deleteNode(int dData); // delete 1st node found containing dData. If not found, do nothing + void copy(Chain *ilist); // copy a linked list into a new linked list + void append(int newData); // add a new node containing newData at the end of the linked list }; -//LinkedQueue class +// LinkedQueue class class LinkedQueue : public Chain { public: - inline LinkedQueue():Chain(){}; //Constructor link - void enQueue(int newData); //add new node at end of the queue - int deQueue(void); //delete first node of queue and return its data + inline LinkedQueue():Chain(){}; // Constructor link + void enQueue(int newData); // add new node at end of the queue + int deQueue(void); // delete first node of queue and return its data }; -//ChainIterator class +// ChainIterator class class ChainIterator { public: // member properties - CHAINNODE *location; //a pointer to a node of a linked list + CHAINNODE *location; // a pointer to a node of a linked list public: // class constructor inline ChainIterator() { location = NULL; } public: // member functions - int initialize(Chain *lList); //initializes the iterator, takes as argument lList of class Chain - int next(void); //move the pointer to the next node + int initialize(Chain *lList); // initializes the iterator, takes as argument lList of class Chain + int next(void); // move the pointer to the next node }; -//LinkedBase class +// LinkedBase class class LinkedBase { public: // member properties - int numVertices; //number of vertices in graph - int numEdges; //number of edges in graph - Chain **adjList; //adjacency list - just 0's and 1's - ChainIterator **iterPos; //array of pointers to linked-list iterators - int source; //source vertex - int *status_value; //should be enumeration - 0:not discovered, 1:discovered but not finished, 2:finished - int *parent_value; //the parents of all vertices. -1 means no parent - double *dist; //distance for the source to each vertext (For Breath-First-Search or BFS) - TIMESTAMP dfs_time; //Previous timestamp - mainly for intialization - TIMESTAMP *dTime; //timestamp array I for DFS, records when each vertex is discovered - TIMESTAMP *fTime; //timestamp array II for DFS, records when the search finishes exaining the adjacency list for each vertex + int numVertices; // number of vertices in graph + int numEdges; // number of edges in graph + Chain **adjList; // adjacency list - just 0's and 1's + ChainIterator **iterPos; // array of pointers to linked-list iterators + int source; // source vertex + int *status_value; // should be enumeration - 0:not discovered, 1:discovered but not finished, 2:finished + int *parent_value; // the parents of all vertices. -1 means no parent + double *dist; // distance for the source to each vertext (For Breath-First-Search or BFS) + TIMESTAMP dfs_time; // Previous timestamp - mainly for intialization + TIMESTAMP *dTime; // timestamp array I for DFS, records when each vertex is discovered + TIMESTAMP *fTime; // timestamp array II for DFS, records when the search finishes exaining the adjacency list for each vertex public: // member functions - LinkedBase(int nVer); //Initializer - void delAllVer(void); //delete all elements in the adjacency list - int getVerNum(void); //return number of vertices of graph - int getEdgNum(void); //return number of edges of graph - int getOutDeg(int index); //return the out degree of given vertex - void initializePos(void); //initialize iterPos - void deactivatePos(void); //delete iterPos - int beginVertex(int index); //return first vertex connected to given vertex - int nextVertex(int index); //return next vertex connected to given vertex - void BFS(int s); //breadth-first search (s is source vertex) - void DFS1(void); //depth-first search, creates depth-first forest - void DFS2(int s); //creates a depth-first tree with a specificied root - connected graph only - void DFSVisit(int u); //visits vertices in depth first search and marks them as visited; u is a vertex - void copy(LinkedBase *graph1); //copy a graph, but only vertices, edges, and adjacency. Properties for iterator and graph traversal excluded - void addAIsoVer(int n); //add n isolated vertices into a graph + LinkedBase(int nVer); // Initializer + void delAllVer(void); // delete all elements in the adjacency list + int getVerNum(void); // return number of vertices of graph + int getEdgNum(void); // return number of edges of graph + int getOutDeg(int index); // return the out degree of given vertex + void initializePos(void); // initialize iterPos + void deactivatePos(void); // delete iterPos + int beginVertex(int index); // return first vertex connected to given vertex + int nextVertex(int index); // return next vertex connected to given vertex + void BFS(int s); // breadth-first search (s is source vertex) + void DFS1(void); // depth-first search, creates depth-first forest + void DFS2(int s); // creates a depth-first tree with a specificied root - connected graph only + void DFSVisit(int u); // visits vertices in depth first search and marks them as visited; u is a vertex + void copy(LinkedBase *graph1); // copy a graph, but only vertices, edges, and adjacency. Properties for iterator and graph traversal excluded + void addAIsoVer(int n); // add n isolated vertices into a graph }; -//LinkedDigraph class +// LinkedDigraph class class LinkedDigraph : public LinkedBase { public: - inline LinkedDigraph(int nVer):LinkedBase(nVer){}; //Constructor link - bool isEdgeExisting(int iIndex, int jIndex); //determine if edge esists in graph - void addEdge(int iIndex, int jIndex); //add a new edge into the graph - void deleteEdge(int iIndex, int jIndex); //delete an existing edge from graph - int getInDeg(int index); //return the in degree of the given vertex - int getOutDeg(int index); //return the out degree of the given vertex + inline LinkedDigraph(int nVer):LinkedBase(nVer){}; // Constructor link + bool isEdgeExisting(int iIndex, int jIndex); // determine if edge esists in graph + void addEdge(int iIndex, int jIndex); // add a new edge into the graph + void deleteEdge(int iIndex, int jIndex); // delete an existing edge from graph + int getInDeg(int index); // return the in degree of the given vertex + int getOutDeg(int index); // return the out degree of the given vertex }; -//LinkedUndigraph class +// LinkedUndigraph class class LinkedUndigraph : public LinkedDigraph { public: - inline LinkedUndigraph(int nVer):LinkedDigraph(nVer){}; //Constructor - - void addEdge(int iIndex, int jIndex); //add a new edge into the graph - void deleteEdge(int iIndex, int jIndex); //delete an existing edge from graph - int getInDeg(int index); //return the in degree of the given vertex - int getOutDeg(int index); //return the out degree of the given vertex - int getDeg(int index); //Return the degree of the given vertex - - ////the following functions support restoration - void findFunCutSet(CHORDSET *chordSet, BRANCHVERTICES *tBranch, CHORDSET *cutSet); //find fundamental cut set. - void simplify(CHORDSET *chordset, BRANCHVERTICES *fBranch, int source, INTVECT *fVer, INTVECT *vMap); //graph simplification - //void unique_int(INTVECT *inputvect, INTVECT *outputvect); //Outputvect is unique elements of input vector (sorted) - void find_int(INTVECT *inputvect, INTVECT *foundvect, int findval, int numfind); //foundvect is the matching entries of inputvect - //void merge_sort_int(int *Input_Array, unsigned int Alen, int *Work_Array); //Merge sort - stolen from solver_nr - int isolateDeg12Ver(INTVECT *iVer); //isolate vertices with degree < 3 + inline LinkedUndigraph(int nVer):LinkedDigraph(nVer){}; // Constructor + + void addEdge(int iIndex, int jIndex); // add a new edge into the graph + void deleteEdge(int iIndex, int jIndex); // delete an existing edge from graph + int getInDeg(int index); // return the in degree of the given vertex + int getOutDeg(int index); // return the out degree of the given vertex + int getDeg(int index); // Return the degree of the given vertex + + // the following functions support restoration + void findFunCutSet(CHORDSET *chordSet, BRANCHVERTICES *tBranch, CHORDSET *cutSet); // find fundamental cut set. + void simplify(CHORDSET *chordset, BRANCHVERTICES *fBranch, int source, INTVECT *fVer, INTVECT *vMap); // graph simplification + // void unique_int(INTVECT *inputvect, INTVECT *outputvect); // Outputvect is unique elements of input vector (sorted) + void find_int(INTVECT *inputvect, INTVECT *foundvect, int findval, int numfind); // foundvect is the matching entries of inputvect + // void merge_sort_int(int *Input_Array, unsigned int Alen, int *Work_Array); // Merge sort - stolen from solver_nr + int isolateDeg12Ver(INTVECT *iVer); // isolate vertices with degree < 3 void deleteIsoVer(INTVECT *vMap); //delete all isolated vertices (degree = 0) - void mergeVer_2(INTVECT *vMap); //merge vertices according to the map of vertices + void mergeVer_2(INTVECT *vMap); // merge vertices according to the map of vertices }; @@ -175,29 +175,29 @@ class restoration : public powerflow_library static CLASS *oclass; static CLASS *pclass; public: - int reconfig_attempts; //Number of reconfigurations/timestep to try before giving up - int reconfig_iter_limit; //Number of iterations to let PF go before flagging this as a bad reconfiguration + int reconfig_attempts; // Number of reconfigurations/timestep to try before giving up + int reconfig_iter_limit; // Number of iterations to let PF go before flagging this as a bad reconfiguration - OBJECT *sourceVerObj; //Object reference to source vertex - OBJECT *faultSecObj; //Object reference to faulted section + OBJECT *sourceVerObj; // Object reference to source vertex + OBJECT *faultSecObj; // Object reference to faulted section - char1024 fVerPub; //Published string for fVer object list (to be parsed) - char1024 feeder_power_limit_Pub; //Published string for feeder_power_limit (to be parsed) - char1024 feeder_power_link_Pub; //Published string for feeder_power_link (to be parsed) + char1024 fVerPub; // Published string for fVer object list (to be parsed) + char1024 feeder_power_limit_Pub; // Published string for feeder_power_limit (to be parsed) + char1024 feeder_power_link_Pub; // Published string for feeder_power_link (to be parsed) - char1024 mVerPub; //Published string for mVer object list (to be parsed) - char1024 microgrid_limit_Pub; //Published string for microgrid_limit (to be parsed) - char1024 microgrid_power_link_Pub; //Published string for microgrid_power_link (to be parsed) + char1024 mVerPub; // Published string for mVer object list (to be parsed) + char1024 microgrid_limit_Pub; // Published string for microgrid_limit (to be parsed) + char1024 microgrid_power_link_Pub; // Published string for microgrid_power_link (to be parsed) - char1024 logfile_name; //Filename for output file of restoration -- if desired + char1024 logfile_name; // Filename for output file of restoration -- if desired - double voltage_limit[2]; //Lower and upper limits of load voltages + double voltage_limit[2]; // Lower and upper limits of load voltages - bool stop_and_generate; //Flag to either perform the base-WSU functionality (check all scenarios), or to just do a "first solution exit" approach - //False = GLD approach (exit when first valid reconfig found), true = WSU MATLAB (generate all) + bool stop_and_generate; // Flag to either perform the base-WSU functionality (check all scenarios), or to just do a "first solution exit" approach + // False = GLD approach (exit when first valid reconfig found), true = WSU MATLAB (generate all) - //I/O functions for GLD Interface - int PerformRestoration(int faulting_link); //Base function - similar to main class of MATLAB (called by fault_check) + // I/O functions for GLD Interface + int PerformRestoration(int faulting_link); // Base function - similar to main class of MATLAB (called by fault_check) restoration(MODULE *mod); inline restoration(CLASS *cl=oclass):powerflow_library(cl){}; @@ -206,98 +206,98 @@ class restoration : public powerflow_library int isa(char *classname); private: - int s_ver; //Source vertex - only one specifiable (saying so) - int s_ver_1; //Source vertex after first simpliciation - int s_ver_2; //Source vertex after the second simplification - - int numfVer; //Size of feeder vertices - INTVECT feederVertices; //ID of the start vertices of feeders in the graph after the 2nd simplification - INTVECT feederVertices_1; //First reduction working version - INTVECT feederVertices_2; //Second reduction working verstion - OBJECT **fVerObjList; //Feeder vertices - object list - OBJECT **fLinkObjList; //Feeder "power link" - object list - FUNCTIONADDR *fLinkPowerFunc; //Feeder "power update" function list (matches fLinkObjList) - double *feeder_power_limit; //Feeder power limits - must match number of feeder vertices (feeders) - parsed from string - complex **feeder_power_link_value; //Feeder power output - linked from parsed feeder list - - int numMG; //Number of microgrids - INTVECT MGIdx; //Microgrid vertices - specify by object name and parse (string) - INTVECT MGIdx_1; //Microgrid vertices -- first reduction working version - INTVECT MGIdx_2; //Microgrid vertices -- second reduction working version - OBJECT **mVerObjList; //Microgrid vertices - object list - OBJECT **mLinkObjList; //Microgrid "power link" - object list - FUNCTIONADDR *mLinkPowerFunc; //Microgrid "power update" function list (matches fLinkObjList) - complex *microgrid_limit; //Microgrid power limit - must match number of microgrid vertices - parsed from string (real & reactive) - complex **microgrid_power_link_value; //Microgrid power output - linked from parsed microgrid list + int s_ver; // Source vertex - only one specifiable (saying so) + int s_ver_1; // Source vertex after first simpliciation + int s_ver_2; // Source vertex after the second simplification + + int numfVer; // Size of feeder vertices + INTVECT feederVertices; // ID of the start vertices of feeders in the graph after the 2nd simplification + INTVECT feederVertices_1; // First reduction working version + INTVECT feederVertices_2; // Second reduction working verstion + OBJECT **fVerObjList; // Feeder vertices - object list + OBJECT **fLinkObjList; // Feeder "power link" - object list + FUNCTIONADDR *fLinkPowerFunc; // Feeder "power update" function list (matches fLinkObjList) + double *feeder_power_limit; // Feeder power limits - must match number of feeder vertices (feeders) - parsed from string + complex **feeder_power_link_value; // Feeder power output - linked from parsed feeder list + + int numMG; // Number of microgrids + INTVECT MGIdx; // Microgrid vertices - specify by object name and parse (string) + INTVECT MGIdx_1; // Microgrid vertices -- first reduction working version + INTVECT MGIdx_2; // Microgrid vertices -- second reduction working version + OBJECT **mVerObjList; // Microgrid vertices - object list + OBJECT **mLinkObjList; // Microgrid "power link" - object list + FUNCTIONADDR *mLinkPowerFunc; // Microgrid "power update" function list (matches fLinkObjList) + complex *microgrid_limit; // Microgrid power limit - must match number of microgrid vertices - parsed from string (real & reactive) + complex **microgrid_power_link_value; // Microgrid power output - linked from parsed microgrid list - FUNCTIONADDR fault_check_fxn; //Function address for "reliability_alterations" function - meant to do topology check after a restoration operation + FUNCTIONADDR fault_check_fxn; // Function address for "reliability_alterations" function - meant to do topology check after a restoration operation - bool file_output_desired; //Flag to see if a text file output is wanted + bool file_output_desired; // Flag to see if a text file output is wanted - LinkedUndigraph *top_ori; //Graph object for original network - LinkedUndigraph *top_sim_1; //Graph object for topology after first simplification -- all non-switch edges deleted - LinkedUndigraph *top_sim_2; //Graph object for topology after second simplification -- vertices whose degrees are 1 or 2 are deleted - LinkedUndigraph *top_res; //Topology after restoration, represented by a tree - LinkedUndigraph *top_tmp; //Assumed to be a temporary tree/graph + LinkedUndigraph *top_ori; // Graph object for original network + LinkedUndigraph *top_sim_1; // Graph object for topology after first simplification -- all non-switch edges deleted + LinkedUndigraph *top_sim_2; // Graph object for topology after second simplification -- vertices whose degrees are 1 or 2 are deleted + LinkedUndigraph *top_res; // Topology after restoration, represented by a tree + LinkedUndigraph *top_tmp; // Assumed to be a temporary tree/graph - CHORDSET tie_swi; //Set of tie-switches (nromally open), n*2 matrix - CHORDSET tie_swi_1; //Tie switches after the 1st simplification - CHORDSET tie_swi_2; //Tie switches after the 2nd simplification - CHORDSET sec_swi; //Set of sectionalizing switches (normally closed), n*2 matrix - CHORDSET sec_swi_1; //Sectionalizing switches after the 1st simplification - CHORDSET sec_swi_2; //Sectionalizing switches after the 2nd simplification - CHORDSET sec_list; //Copy of sec_swi for iterations -- not sure if really needed + CHORDSET tie_swi; // Set of tie-switches (nromally open), n*2 matrix + CHORDSET tie_swi_1; // Tie switches after the 1st simplification + CHORDSET tie_swi_2; // Tie switches after the 2nd simplification + CHORDSET sec_swi; // Set of sectionalizing switches (normally closed), n*2 matrix + CHORDSET sec_swi_1; // Sectionalizing switches after the 1st simplification + CHORDSET sec_swi_2; // Sectionalizing switches after the 2nd simplification + CHORDSET sec_list; // Copy of sec_swi for iterations -- not sure if really needed - CHORDSET sec_swi_map; //??? - CHORDSET sec_swi_map_1; //??? + CHORDSET sec_swi_map; // ??? + CHORDSET sec_swi_map_1; // ??? - LOCSET tie_swi_loc; //Location of tie switches status in original GLM file - LOCSET sec_swi_loc; //Location of sectionalizing switches status in original GLM file + LOCSET tie_swi_loc; // Location of tie switches status in original GLM file + LOCSET sec_swi_loc; // Location of sectionalizing switches status in original GLM file - BRANCHVERTICES f_sec; //Faulted section - BRANCHVERTICES f_sec_1; //Faulted section after 1st simplification - BRANCHVERTICES f_sec_2; //Faulted section after 2nd simplification + BRANCHVERTICES f_sec; // Faulted section + BRANCHVERTICES f_sec_1; // Faulted section after 1st simplification + BRANCHVERTICES f_sec_2; // Faulted section after 2nd simplification - INTVECT ver_map_1; //Map between the vertices of the original tree and those of the 1st simplified tree - INTVECT ver_map_2; //Map between the vertices of the 1st simplification tree and the 2nd simplified tree + INTVECT ver_map_1; // Map between the vertices of the original tree and those of the 1st simplified tree + INTVECT ver_map_2; // Map between the vertices of the 1st simplification tree and the 2nd simplified tree - CANDSWOP candidateSwOpe; //Candidate switching operations - CANDSWOP candidateSwOpe_1; //Candidate switching operations on top_sim_1 - CANDSWOP candidateSwOpe_2; //Candidate switching operations on top_sim_2 + CANDSWOP candidateSwOpe; // Candidate switching operations + CANDSWOP candidateSwOpe_1; // Candidate switching operations on top_sim_1 + CANDSWOP candidateSwOpe_2; // Candidate switching operations on top_sim_2 - complex **voltage_storage; //Voltage storage - to restore when powerflow dies a horrible death + complex **voltage_storage; // Voltage storage - to restore when powerflow dies a horrible death - //Voltage saving (value saving) functions + // Voltage saving (value saving) functions void PowerflowSave(void); void PowerflowRestore(void); - //General parsing functions + // General parsing functions double *ParseDoubleString(char *input_string,int *num_items_found); complex *ParseComplexString(char *input_string,int *num_items_found); OBJECT **ParseObjectString(char *input_string,int *num_items_found); bool isSwitch(int iIndex, int jIndex); bool isSwiInFeeder(BRANCHVERTICES *swi_2, int feederID_overload); - //General output function + // General output function void printResult(int IdxSW); void printSOs(FILE *FPHandle, int IdxSW); void printCIO(FILE *FPHandle, int IdxSW); - //General allocation algorithms -- functionalized just for simplicity + // General allocation algorithms -- functionalized just for simplicity void INTVECTalloc(INTVECT *inititem, int allocsizeval); void CHORDSETalloc(CHORDSET *inititem, int allocsizeval); void LOCSETalloc(LOCSET *inititem, int allocsizeval); void CANDSWOPalloc(CANDSWOP *inititem, int allocsizeval); - //General deallocation functions - again for simplicity + // General deallocation functions - again for simplicity void INTVECTfree(INTVECT *inititem); void CHORDSETfree(CHORDSET *inititem); void LOCSETfree(LOCSET *inititem); void CANDSWOPfree(CANDSWOP *inititem); - //Reconfiguration functions + // Reconfiguration functions void simplifyTop_1(void); - //void loadInfo(void); + // void loadInfo(void); void simplifyTop_2(void); void setFeederVertices_2(void); void setMicrogridVertices(void); @@ -319,7 +319,7 @@ class restoration : public powerflow_library EXPORT int perform_restoration(OBJECT *thisobj,int faulting_link); -void unique_int(INTVECT *inputvect, INTVECT *outputvect); //Outputvect is unique elements of input vector (sorted) -void merge_sort_int(int *Input_Array, unsigned int Alen, int *Work_Array); //Merge sort - stolen from solver_nr +void unique_int(INTVECT *inputvect, INTVECT *outputvect); // Outputvect is unique elements of input vector (sorted) +void merge_sort_int(int *Input_Array, unsigned int Alen, int *Work_Array); // Merge sort - stolen from solver_nr #endif // _RESTORATION_H diff --git a/powerflow/solver_nr.cpp b/powerflow/solver_nr.cpp index 02d0bdd36..f6368ea62 100644 --- a/powerflow/solver_nr.cpp +++ b/powerflow/solver_nr.cpp @@ -62,8 +62,8 @@ SuperMatrix A_LU,B_LU; //External solver global void *ext_solver_glob_vars; -char1024 solver_profile_filename = "solver_nr_profile.csv"; -char1024 solver_headers = "timestamp,duration[microsec],iteration,bus_count,branch_count,error"; +char1024 solver_profile_filename("solver_nr_profile.csv"); +char1024 solver_headers("timestamp,duration[microsec],iteration,bus_count,branch_count,error"); static FILE * nr_profile = NULL; bool solver_profile_headers_included = true; bool solver_profile_enable = false; diff --git a/powerflow/solver_py.cpp b/powerflow/solver_py.cpp index 03c150206..e4934a211 100644 --- a/powerflow/solver_py.cpp +++ b/powerflow/solver_py.cpp @@ -13,7 +13,7 @@ #define CONFIGPATH "/usr/local/var/gridlabd/" static SOLVERPYTHONSTATUS solver_py_status = SPS_INIT; -char1024 solver_py_config = CONFIGPATH CONFIGNAME; +char1024 solver_py_config(CONFIGPATH CONFIGNAME); static const char *model_busdump = NULL; static const char *model_branchdump = NULL; static const char *model_dump_handler = NULL; diff --git a/powerflow/triplex_meter.cpp b/powerflow/triplex_meter.cpp index 4e4ac21d5..d2d285be0 100644 --- a/powerflow/triplex_meter.cpp +++ b/powerflow/triplex_meter.cpp @@ -17,7 +17,7 @@ EXPORT int64 triplex_meter_reset(OBJECT *obj) return 0; } -char1024 market_price_name = "current_market.clearing_price"; +char1024 market_price_name("current_market.clearing_price"); ////////////////////////////////////////////////////////////////////////// // triplex_meter CLASS FUNCTIONS diff --git a/powerflow/volt_var_control.cpp b/powerflow/volt_var_control.cpp index 91fea7f03..7de421e29 100644 --- a/powerflow/volt_var_control.cpp +++ b/powerflow/volt_var_control.cpp @@ -342,7 +342,7 @@ int volt_var_control::init(OBJECT *parent) if (num_regs==1) //Only 1 column, make sure something is actually in there { - temp_obj = gl_get_object((char *)regulator_list); + temp_obj = gl_get_object(regulator_list); if (temp_obj == NULL) //Not really an object, must be no controllable capacitors num_regs = 0; @@ -490,7 +490,7 @@ int volt_var_control::init(OBJECT *parent) //Now populate each of these massive arrays //start with the regulators, their configurations, and related items - token_a = regulator_list; + token_a = regulator_list.get_string(); for (index=0; (int)index 1) //One for each regulator { //Point to list - token_a = minimum_voltage_txt; - token_b = maximum_voltage_txt; - token_c = desired_voltage_txt; + token_a = minimum_voltage_txt.get_string(); + token_b = maximum_voltage_txt.get_string(); + token_c = desired_voltage_txt.get_string(); //Initialize output pointers - just so compiler shuts up token_a1 = token_a; @@ -577,9 +577,9 @@ int volt_var_control::init(OBJECT *parent) else if (num_des_volt == 1) //1 value for all { //Point to list - token_a = minimum_voltage_txt; - token_b = maximum_voltage_txt; - token_c = desired_voltage_txt; + token_a = minimum_voltage_txt.get_string(); + token_b = maximum_voltage_txt.get_string(); + token_c = desired_voltage_txt.get_string(); //Initialize output pointers - just so compiler shuts up token_a1 = token_a; @@ -673,9 +673,9 @@ int volt_var_control::init(OBJECT *parent) if (num_max_vdrop > 1) //One for each regulator - loop precursor (point the tokens) { //Point to list - token_a = max_vdrop_txt; - token_b = vbw_low_txt; - token_c = vbw_high_txt; + token_a = max_vdrop_txt.get_string(); + token_b = vbw_low_txt.get_string(); + token_c = vbw_high_txt.get_string(); //Initialize output pointers - just so compiler shuts up token_a1 = token_a; @@ -685,9 +685,9 @@ int volt_var_control::init(OBJECT *parent) else if (num_max_vdrop == 1) //One for all regulators { //Point to list - token_a = max_vdrop_txt; - token_b = vbw_low_txt; - token_c = vbw_high_txt; + token_a = max_vdrop_txt.get_string(); + token_b = vbw_low_txt.get_string(); + token_c = vbw_high_txt.get_string(); //Initialize output pointers - just so compiler shuts up token_a1 = token_a; @@ -835,7 +835,7 @@ int volt_var_control::init(OBJECT *parent) if (num_caps==1) //Only 1 column, make sure something is actually in there { - temp_obj = gl_get_object((char *)capacitor_list); + temp_obj = gl_get_object(capacitor_list); if (temp_obj == NULL) //Not really an object, must be no controllable capacitors num_caps = 0; @@ -877,7 +877,7 @@ int volt_var_control::init(OBJECT *parent) } //Parse the list now - the list is the capacitor - token_a = capacitor_list; + token_a = capacitor_list.get_string(); temp_obj = gl_get_object(token_a); @@ -991,7 +991,7 @@ int volt_var_control::init(OBJECT *parent) } //Parse the list now - token_a = capacitor_list; + token_a = capacitor_list.get_string(); for (index = 0; (int)index < num_caps; index++) { //Extract the object information @@ -1173,7 +1173,7 @@ int volt_var_control::init(OBJECT *parent) tempchar[index] = 0; //Find the first comma - token_b = measurement_list; + token_b = measurement_list.get_string(); token_b1 = strchr(token_b,','); //Find the second comma @@ -1217,7 +1217,7 @@ int volt_var_control::init(OBJECT *parent) else if ((num_regs == 1) && (total_meas == 1)) { //1 reg and 1 measurement, make sure it is a valid object before proceeding - token_a = measurement_list; //Get first item (valid) + token_a = measurement_list.get_string(); //Get first item (valid) //Extract the object information token_a1 = obj_token(token_a, &temp_obj); @@ -1256,7 +1256,7 @@ int volt_var_control::init(OBJECT *parent) if (total_meas != 0) //There's at least something in there { //List is assumed valid, now figure out how big everything needs to be - token_b1 = measurement_list; //Start the list + token_b1 = measurement_list.get_string(); //Start the list for (index=0; (int)index 2 ) diff --git a/reliability/eventgen.cpp b/reliability/eventgen.cpp index f375bb58b..aeeb28eb3 100644 --- a/reliability/eventgen.cpp +++ b/reliability/eventgen.cpp @@ -97,11 +97,11 @@ eventgen::eventgen(MODULE *module) /* Object creation is called once for each object that is created by the core */ int eventgen::create(void) { - target_group[0] = '\0'; - fault_type[0] = '\0'; - manual_fault_list[0] = '\0'; - controlled_switch[0] = '\0'; - external_fault_event[0] = '\0'; + target_group.erase(); + fault_type.erase(); + manual_fault_list.erase(); + controlled_switch.erase(); + external_fault_event.erase(); use_external_faults = false; switch_state = 1; last_switch_state = 1; @@ -351,7 +351,7 @@ int eventgen::init(OBJECT *parent) } //Loop through the count and try parsing out what everything is - do individual error checks - token_a = manual_fault_list; + token_a = manual_fault_list.get_string(); for (index=0; indexobjdetails.implemented_fault = implemented_fault; //Populate the details - no real supersecond support now, just populate - memcpy(new_struct->event_type,event_type,33*sizeof(char)); + new_struct->event_type = event_type; new_struct->objdetails.obj_of_int = obj_to_fault; new_struct->objdetails.obj_made_int = NULL; new_struct->objdetails.fail_time = fail_time; @@ -2089,7 +2090,7 @@ void eventgen::do_event(TIMESTAMP t1_ts, double t1_dbl, bool entry_type) } } -void eventgen::parse_external_fault_events(char *events_char) +void eventgen::parse_external_fault_events(const char *events_char) { std::string events_str((const char *)events_char); Json::Reader json_rdr; diff --git a/reliability/eventgen.h b/reliability/eventgen.h index b8846807c..9b0ddf44c 100644 --- a/reliability/eventgen.h +++ b/reliability/eventgen.h @@ -106,7 +106,7 @@ class eventgen : public gld_object { void do_event(TIMESTAMP t1_ts, double t1_dbl, bool entry_type); /**< Function to execute a status change on objects driven by event_gen */ void regen_events(TIMESTAMP t1_ts, double t1_dbl); /**< Function to update time to next event on the system */ - void parse_external_fault_events(char *event_char); + void parse_external_fault_events(const char *event_char); public: RELEVANTSTRUCT Unhandled_Events; /**< unhandled event linked list */ diff --git a/reliability/metrics.cpp b/reliability/metrics.cpp index c4f6b6bdf..63374f579 100644 --- a/reliability/metrics.cpp +++ b/reliability/metrics.cpp @@ -45,9 +45,9 @@ metrics::metrics(MODULE *module) /* Object creation is called once for each object that is created by the core */ int metrics::create(void) { - customer_group[0] = '\0'; + customer_group.erase(); module_metrics_obj = NULL; - metrics_oi[0] = '\0'; + metrics_oi.erase(); metric_interval_dbl = 0.0; report_interval_dbl = 31536000.0; //Defaults to a year @@ -189,11 +189,11 @@ int metrics::init(OBJECT *parent) CalcIndices[index].MetricLoc = NULL; //No address by default for (indexa=0; indexa<257; indexa++) //+1 due to end \0 - CalcIndices[index].MetricName[indexa]='\0'; + CalcIndices[index].MetricName.set_at(indexa,'\0'); } //Populate it up - copy it first so we don't destroy the original - metrics_oi.copy_to(work_metrics); + metrics_oi.copy_to(work_metrics,sizeof(work_metrics)); //Set initial pointers startVal = work_metrics; @@ -217,7 +217,7 @@ int metrics::init(OBJECT *parent) while ((workVal<=endVal) && (indexa < 256)) { //Copy the value in - CalcIndices[index].MetricName[indexa] = *workVal; + CalcIndices[index].MetricName.set_at(indexa,*workVal); //Copy into secondary metricbuffer[indexa] = *workVal; diff --git a/residential/evcharger.cpp b/residential/evcharger.cpp index 46b7c3575..1d684a523 100644 --- a/residential/evcharger.cpp +++ b/residential/evcharger.cpp @@ -96,7 +96,7 @@ EVPROFILEITEM *first_demand_profile = NULL; /// Find an EV demand profile /// @returns pointer to the matching EVPROFILEITEM structure -EVDEMAND *find_demand_profile(char *name) ///< name of profile +EVDEMAND *find_demand_profile(const char *name) ///< name of profile { EVPROFILEITEM *item = first_demand_profile; while (item!=NULL) @@ -119,7 +119,7 @@ EVPROFILEITEM *add_demand_profile(EVDEMAND *data) item->next = first_demand_profile; return first_demand_profile = item; } -EVDEMAND *load_demand_profile(char *filename) +EVDEMAND *load_demand_profile(const char *filename) { char filepath[1024]; if (gl_findfile(filename,NULL,R_OK,filepath,sizeof(filepath))==NULL) @@ -238,7 +238,7 @@ EVDEMAND *load_demand_profile(char *filename) fclose(fp); return data; } -EVDEMAND *get_demand_profile(char *name) +EVDEMAND *get_demand_profile(const char *name) { EVDEMAND *profile = find_demand_profile(name); if (profile==NULL) @@ -378,7 +378,9 @@ int evcharger::init(OBJECT *parent) // load demand profile if (strcmp(demand_profile,"")!=0) + { pDemand = get_demand_profile(demand_profile); + } retval = residential_enduse::init(parent); diff --git a/residential/evcharger_det.cpp b/residential/evcharger_det.cpp index 1cc04db08..edbf27170 100644 --- a/residential/evcharger_det.cpp +++ b/residential/evcharger_det.cpp @@ -81,7 +81,7 @@ int evcharger_det::create() Work_Charge_Available = false; //No work charging - NHTSDataFile[0] = '\0'; //Null file + NHTSDataFile.erase(); //Null file VehicleLocation = 0; //Car information - battery info is left uninitialized diff --git a/residential/rbsa.cpp b/residential/rbsa.cpp index 99248aa5f..77e9f4517 100644 --- a/residential/rbsa.cpp +++ b/residential/rbsa.cpp @@ -26,17 +26,17 @@ double rbsa::default_nominal_voltage = 240.0; complex rbsa::default_nominal_voltage_A(240.0,0.0,A); complex rbsa::default_nominal_voltage_B(240.0,-120.0,A); complex rbsa::default_nominal_voltage_C(240.0,+120.0,A); -char32 rbsa::default_weekday_code ="WEEKDAY"; -char32 rbsa::default_saturday_code ="SATURDAY"; -char32 rbsa::default_sunday_code ="SUNDAY"; -char32 rbsa::default_holiday_code ="HOLIDAY"; -char32 rbsa::default_month_heading = "Month"; -char32 rbsa::default_daytype_heading = "Daytype"; -char32 rbsa::default_hour_heading = "Hour"; -char1024 rbsa::temperature_variable_name = "temperature"; -char1024 rbsa::solargain_variable_name = "solar_direct"; -char1024 rbsa::price_variable_name = "energy_price"; -char1024 rbsa::occupancy_variable_name = "occupancy_fraction"; +char32 rbsa::default_weekday_code("WEEKDAY"); +char32 rbsa::default_saturday_code("SATURDAY"); +char32 rbsa::default_sunday_code("SUNDAY"); +char32 rbsa::default_holiday_code("HOLIDAY"); +char32 rbsa::default_month_heading("Month"); +char32 rbsa::default_daytype_heading("Daytype"); +char32 rbsa::default_hour_heading("Hour"); +char1024 rbsa::temperature_variable_name("temperature"); +char1024 rbsa::solargain_variable_name("solar_direct"); +char1024 rbsa::price_variable_name("energy_price"); +char1024 rbsa::occupancy_variable_name("occupancy_fraction"); double rbsa::default_temperature_cooling_balance = 70.0; double rbsa::default_temperature_cooling_base = 70.0; double rbsa::default_temperature_cooling_design = 100.0; @@ -662,7 +662,7 @@ int rbsa::filename(char *filename, size_t len) char line[1024]; size_t count = 0; struct { - char *label; + const char *label; DAYTYPE code; } codes[] = { {default_weekday_code, DT_WEEKDAY}, diff --git a/revenue/revenue.h b/revenue/revenue.h index 8793846df..2662cad27 100644 --- a/revenue/revenue.h +++ b/revenue/revenue.h @@ -8,7 +8,7 @@ #include "gridlabd.h" #ifdef DLMAIN -#define INIT(X) = X +#define INIT(X) (X) #define GLOBAL #else #define INIT(X) diff --git a/tape/collector.cpp b/tape/collector.cpp index b3538628c..2df6579f6 100644 --- a/tape/collector.cpp +++ b/tape/collector.cpp @@ -45,18 +45,18 @@ EXPORT int create_collector(OBJECT **obj, OBJECT *parent) struct collector *my = OBJECTDATA(*obj,struct collector); last_collector = *obj; gl_set_parent(*obj,parent); - strcpy(my->file,""); - strcpy(my->filetype,"txt"); - strcpy(my->delim,","); - strcpy(my->group,""); + my->file = ""; + my->filetype = "txt"; + my->delim = ","; + my->group = ""; my->interval = TS_NEVER; /* transients only */ my->dInterval = -1.0; my->last.ts = -1; - strcpy(my->last.value,""); + my->last.value = ""; my->limit = 0; my->samples = 0; my->status = TS_INIT; - my->trigger[0]='\0'; + my->trigger = ""; my->format = 0; my->aggr = NULL; my->property = NULL; @@ -68,9 +68,9 @@ EXPORT int create_collector(OBJECT **obj, OBJECT *parent) static int collector_open(OBJECT *obj) { - char32 type="file"; - char1024 fname=""; - char32 flags="w"; + char32 type("file"); + char1024 fname(""); + char32 flags("w"); TAPEFUNCS *tf = 0; struct collector *my = OBJECTDATA(obj,struct collector); @@ -83,11 +83,11 @@ static int collector_open(OBJECT *obj) my->interval = (int64)(my->dInterval/TS_SECOND); /* if prefix is omitted (no colons found) */ - if (sscanf(my->file,"%32[^:]:%1024[^:]:%[^:]",(char*)type,(char*)fname,(char*)flags)==1) + if (sscanf(my->file,"%32[^:]:%1024[^:]:%[^:]",type.resize(33),fname.resize(1025),flags.resize(33))==1) { /* filename is file by default */ - strcpy(fname,my->file); - strcpy(type,"file"); + fname = my->file; + type = "file"; } /* if no filename given */ @@ -95,10 +95,10 @@ static int collector_open(OBJECT *obj) { char *p; /* use group spec as default file name */ - sprintf(fname,"%s.%s",(char*)(my->group),(char*)(my->filetype)); + snprintf(fname.resize(PATH_MAX+33),PATH_MAX+33,"%s.%s",(const char*)(my->group),(const char*)(my->filetype)); /* but change disallowed characters to _ */ - for (p=fname; *p!='\0'; p++) + for ( p = fname.get_string() ; *p != '\0' ; p++ ) { if (!isalnum(*p) && *p!='-' && *p!='.') *p='_'; @@ -116,7 +116,7 @@ static int collector_open(OBJECT *obj) return my->ops->open(my, fname, flags); } -static int write_collector(struct collector *my, char *ts, char *value) +static int write_collector(struct collector *my, const char *ts, const char *value) { int rc=my->ops->write(my, ts, value); if ( (my->flush==0 || (my->flush>0 && gl_globalclock%my->flush==0)) && my->ops->flush!=NULL ) @@ -218,7 +218,7 @@ EXPORT int method_collector_property(OBJECT *obj, ...) va_end(args); } -AGGREGATION *link_aggregates(char *aggregate_list, char *group) +AGGREGATION *link_aggregates(const char *aggregate_list, const char *group) { char *item; AGGREGATION *first=NULL, *last=NULL; @@ -250,7 +250,7 @@ int read_aggregates(AGGREGATION *aggr, char *buffer, int size) char tmp[1024]; char32 fmt; - gl_global_getvar("double_format", fmt, 32); + gl_global_getvar("double_format", fmt.get_string(), 32); for ( p = aggr; p != NULL ; p = p->next ) { int sz = snprintf(tmp,sizeof(tmp)-1,fmt,gl_run_aggregate(p)); @@ -276,7 +276,7 @@ EXPORT TIMESTAMP sync_collector(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) struct collector *my = OBJECTDATA(obj,struct collector); typedef enum {NONE='\0', LT='<', EQ='=', GT='>'} COMPAREOP; COMPAREOP comparison; - char1024 buffer = ""; + static char1024 buffer(""); if(my->status == TS_DONE){ return TS_NEVER; @@ -289,7 +289,7 @@ EXPORT TIMESTAMP sync_collector(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) /* read property */ if (my->aggr==NULL) { - sprintf(buffer,"'%s' contains an aggregate that is not found in the group '%s'", my->property, (char*)my->group); + buffer.format("'%s' contains an aggregate that is not found in the group '%s'", my->property, (const char*)my->group); my->status = TS_ERROR; goto Error; } @@ -299,15 +299,15 @@ EXPORT TIMESTAMP sync_collector(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) if((my->interval > 0) && (my->last.ts < t0) && (my->last.value[0] != 0)){ collector_write(obj); //my->last.ts = t0; - my->last.value[0] = 0; + my->last.value = ""; } } //if(my->aggr != NULL && (my->aggr = link_aggregates(my->property,my->group)),read_aggregates(my->aggr,buffer,sizeof(buffer))==0) if(my->aggr != NULL && (my->interval == 0 || my->interval == -1)){ - if(read_aggregates(my->aggr,buffer,sizeof(buffer))==0) + if ( read_aggregates(my->aggr,buffer.resize(1025),1025) == 0 ) { - sprintf(buffer,"unable to read aggregate '%s' of group '%s'", my->property, (char*)my->group); + buffer.format("unable to read aggregate '%s' of group '%s'", my->property, (const char*)my->group); close_collector(my); my->status = TS_ERROR; } @@ -315,8 +315,9 @@ EXPORT TIMESTAMP sync_collector(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) if(my->aggr != NULL && my->interval > 0){ if((t0 >= my->last.ts + my->interval) || (t0 == my->last.ts)){ - if(read_aggregates(my->aggr,buffer,sizeof(buffer))==0){ - sprintf(buffer,"unable to read aggregate '%s' of group '%s'", my->property, (char*)my->group); + if ( read_aggregates(my->aggr,buffer.resize(1025),1025) == 0 ) + { + buffer.format("unable to read aggregate '%s' of group '%s'", my->property, (const char*)my->group); close_collector(my); my->status = TS_ERROR; } @@ -347,21 +348,25 @@ EXPORT TIMESTAMP sync_collector(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) } /* write tape */ - if(my->status == TS_OPEN){ - if(my->interval == 0 /* sample on every pass */ + if ( my->status == TS_OPEN ) + { + if ( my->interval == 0 /* sample on every pass */ || ((my->interval == -1) && my->last.ts != t0 && strcmp(buffer, my->last.value) != 0) /* sample only when value changes */ - ){ - strncpy(my->last.value, buffer, sizeof(my->last.value)); + ) + { + my->last.value = buffer; my->last.ts = t0; collector_write(obj); - } else if(my->interval > 0 && my->last.ts == t0){ - strncpy(my->last.value, buffer, sizeof(my->last.value)); + } + else if ( my->interval > 0 && my->last.ts == t0 ) + { + my->last.value = buffer; } } Error: if (my->status==TS_ERROR) { - gl_error("collector %d %s\n",obj->id, (char*)buffer); + gl_error("collector %d %s\n",obj->id, (const char*)buffer); my->status=TS_DONE; return 0; /* failed */ } diff --git a/tape/file.cpp b/tape/file.cpp index 96cf21b73..a955e6cbe 100644 --- a/tape/file.cpp +++ b/tape/file.cpp @@ -15,7 +15,7 @@ /******************************************************************* * players */ -int file_open_player(struct player *my, char *fname, char *flags) +int file_open_player(struct player *my, const char *fname, const char *flags) { char ff[1024]; @@ -56,7 +56,7 @@ void file_close_player(struct player *my) #define MAPSIZE(N) ((N-1)/8+1) #define SET(X,B) ((X)[(B)/8]|=(1<<((B)&7))) #define ISSET(X,B) (((X)[(B)/8]&(1<<((B)&7)))==(1<<((B)&7))) -char *file=NULL; +const char *file=NULL; int linenum=0; static void setmap(char *spec, unsigned char *map, int size) { @@ -132,7 +132,7 @@ static unsigned char *weekdaymap(char *spec) return weekdays; } -int file_open_shaper(struct shaper *my, char *fname, char *flags) +int file_open_shaper(struct shaper *my, const char *fname, const char *flags) { char line[1024], group[256]="(unnamed)"; float sum=0, load=0, peak=0; @@ -235,7 +235,7 @@ int file_open_shaper(struct shaper *my, char *fname, char *flags) return 1; } -char *file_read_shaper(struct shaper *my,char *buffer,unsigned int size) +char *file_read_shaper(struct shaper *my, char *buffer, unsigned int size) { return fgets(buffer,size,my->fp); } @@ -252,7 +252,7 @@ void file_close_shaper(struct shaper *my) /******************************************************************* * recorders */ -int file_open_recorder(struct recorder *my, char *fname, char *flags) +int file_open_recorder(struct recorder *my, const char *fname, const char *flags) { time_t now=time(NULL); OBJECT *obj=OBJECTHDR(my); @@ -270,7 +270,7 @@ int file_open_recorder(struct recorder *my, char *fname, char *flags) my->samples=0; /* put useful header information in file first */ - fprintf(my->fp,"# file...... %s\n", (char*)my->file); + fprintf(my->fp,"# file...... %s\n", (const char*)my->file); fprintf(my->fp,"# date...... %s", asctime(localtime(&now))); #ifdef WIN32 fprintf(my->fp,"# user...... %s\n", getenv("USERNAME")); @@ -280,7 +280,7 @@ int file_open_recorder(struct recorder *my, char *fname, char *flags) fprintf(my->fp,"# host...... %s\n", getenv("HOST")); #endif fprintf(my->fp,"# target.... %s %d\n", obj->parent->oclass->name, obj->parent->id); - fprintf(my->fp,"# trigger... %s\n", my->trigger[0]=='\0'?"(none)":(char*)my->trigger); + fprintf(my->fp,"# trigger... %s\n", my->trigger[0]=='\0'?"(none)":(const char*)my->trigger); fprintf(my->fp,"# interval.. %lld\n", my->interval); fprintf(my->fp,"# limit..... %d\n", my->limit); fprintf(my->fp,"# timestamp,%s\n", my->property); @@ -288,7 +288,7 @@ int file_open_recorder(struct recorder *my, char *fname, char *flags) return 1; } -int file_write_recorder(struct recorder *my, char *timestamp, char *value) +int file_write_recorder(struct recorder *my, const char *timestamp, const char *value) { return fprintf(my->fp,"%s,%s\n", timestamp, value); } @@ -306,7 +306,7 @@ void file_flush_recorder(struct recorder *my) /******************************************************************* * collectors */ -int file_open_collector(struct collector *my, char *fname, char *flags) +int file_open_collector(struct collector *my, const char *fname, const char *flags) { unsigned int count=0; time_t now=time(NULL); @@ -324,7 +324,7 @@ int file_open_collector(struct collector *my, char *fname, char *flags) my->samples=0; /* put useful header information in file first */ - count += fprintf(my->fp,"# file...... %s\n", (char*)my->file); + count += fprintf(my->fp,"# file...... %s\n", (const char*)my->file); count += fprintf(my->fp,"# date...... %s", asctime(localtime(&now))); #ifdef WIN32 count += fprintf(my->fp,"# user...... %s\n", getenv("USERNAME")); @@ -333,8 +333,8 @@ int file_open_collector(struct collector *my, char *fname, char *flags) count += fprintf(my->fp,"# user...... %s\n", getenv("USER")); count += fprintf(my->fp,"# host...... %s\n", getenv("HOST")); #endif - count += fprintf(my->fp,"# group..... %s\n", (char*)my->group); - count += fprintf(my->fp,"# trigger... %s\n", my->trigger[0]=='\0'?"(none)":(char*)my->trigger); + count += fprintf(my->fp,"# group..... %s\n", (const char*)my->group); + count += fprintf(my->fp,"# trigger... %s\n", my->trigger[0]=='\0'?"(none)":(const char*)my->trigger); count += fprintf(my->fp,"# interval.. %lld\n", my->interval); count += fprintf(my->fp,"# limit..... %d\n", my->limit); count += fprintf(my->fp,"# property.. timestamp,%s\n", my->property); @@ -342,7 +342,7 @@ int file_open_collector(struct collector *my, char *fname, char *flags) return count; } -int file_write_collector(struct collector *my, char *timestamp, char *value) +int file_write_collector(struct collector *my, const char *timestamp, const char *value) { return fprintf(my->fp,"%s,%s\n", timestamp, value); } diff --git a/tape/file.h b/tape/file.h index 4d6cfa158..2001713a5 100644 --- a/tape/file.h +++ b/tape/file.h @@ -5,22 +5,22 @@ #ifndef _FILE_H #define _FILE_H -int file_open_player(struct player *my, char *fname, char *flags); +int file_open_player(struct player *my, const char *fname, const char *flags); char *file_read_player(struct player *my,char *buffer,unsigned int size); int file_rewind_player(struct player *my); void file_close_player(struct player *my); -int file_open_shaper(struct shaper *my, char *fname, char *flags); +int file_open_shaper(struct shaper *my, const char *fname, const char *flags); char *file_read_shaper(struct shaper *my,char *buffer,unsigned int size); int file_rewind_shaper(struct shaper *my); void file_close_shaper(struct shaper *my); -int file_open_recorder(struct recorder *my, char *fname, char *flags); -int file_write_recorder(struct recorder *my, char *timestamp, char *value); +int file_open_recorder(struct recorder *my, const char *fname, const char *flags); +int file_write_recorder(struct recorder *my, const char *timestamp, const char *value); void file_close_recorder(struct recorder *my); -int file_open_collector(struct collector *my, char *fname, char *flags); -int file_write_collector(struct collector *my, char *timestamp, char *value); +int file_open_collector(struct collector *my, const char *fname, const char *flags); +int file_write_collector(struct collector *my, const char *timestamp, const char *value); void file_close_collector(struct collector *my); #endif diff --git a/tape/group_recorder.cpp b/tape/group_recorder.cpp index a29d4af35..46e66199c 100644 --- a/tape/group_recorder.cpp +++ b/tape/group_recorder.cpp @@ -82,7 +82,7 @@ int group_recorder::init(OBJECT *obj){ gl_error("group_recorder::init(): no filename defined in strict mode"); return 0; } else { - sprintf(filename, "%256s-%256i.csv", oclass->name, obj->id); + filename.format("%s-%d.csv", oclass->name, obj->id); gl_warning("group_recorder::init(): no filename defined, auto-generating '%s'", filename.get_string()); /* TROUBLESHOOT group_recorder requires a filename. If none is provided, a filename will be generated diff --git a/tape/histogram.cpp b/tape/histogram.cpp index 5ec1d8f60..919ce9d07 100644 --- a/tape/histogram.cpp +++ b/tape/histogram.cpp @@ -56,10 +56,10 @@ histogram::histogram(MODULE *mod) PT_int32, "limit", PADDR(limit),PT_DESCRIPTION,"the number of samples to write", NULL) < 1) GL_THROW("unable to publish properties in %s",__FILE__); defaults = this; - memset(filename, 0, 1025); - memset(group, 0, 1025); - memset(bins, 0, 1025); - memset(property, 0, 33); + filename = ""; + group = ""; + bins = ""; + property = ""; min = 0; max = -1; bin_count = -1; @@ -71,8 +71,8 @@ histogram::histogram(MODULE *mod) binctr = NULL; prop_ptr = NULL; next_count = t_count = next_sample = t_sample = TS_ZERO; - strcpy(mode, "file"); - flags[0]='w'; + mode = "file"; + flags = "w"; } } @@ -202,8 +202,7 @@ void histogram::test_for_complex(char *tprop, char *tpart){ gl_error("Unable to resolve complex part for '%s'", property.get_string()); return; } - char *last; - strtok_r(property, ".",&last); /* "quickly" replaces the dot with a space */ + property.set_at(property.find('.'),' '); } } @@ -312,20 +311,23 @@ int histogram::init(OBJECT *parent) * If a or b is not present, the bin will fill in a positve/negative infinity. */ { - char *cptr = bins; + char *cptr = bins.get_string(); char bincpy[1025]; int i = 0; bin_count = 1; /* assume at least one */ /* would be better to count the number of times strtok succeeds, but this should work -mh */ //while(*cptr != 0){ - for(cptr = bins; *cptr != 0; ++cptr){ - if(*cptr == ',' && cptr[1] != 0){ + for ( cptr = bins.get_string() ; *cptr != 0 ; ++cptr ) + { + if ( *cptr == ',' && cptr[1] != 0 ) + { ++bin_count; } // ++cptr; } bin_list = (BIN *)gl_malloc(sizeof(BIN) * bin_count); - if(bin_list == NULL){ + if ( bin_list == NULL ) + { gl_error("Histogram malloc error: unable to alloc %i * %i bytes for %s", bin_count, sizeof(BIN), obj->name ? obj->name : "(anon. histogram)"); return 0; } @@ -367,14 +369,14 @@ int histogram::init(OBJECT *parent) // if (sscanf(filename,"%32[^:]:%1024[^:]:%[^:]",ftype,fname,flags)==1) // { /* filename is file by default */ - strcpy(fname,filename); + fname = filename; // strcpy(ftype,"file"); // } /* if no filename given */ - if (strcmp(fname,"")==0) + if ( fname == "" ) /* use object name-id as default file name */ - sprintf(fname,"%s-%d.%s",obj->parent->oclass->name,obj->parent->id, ftype.get_string()); + fname.format("%s-%d.%s",obj->parent->oclass->name,obj->parent->id, ftype.get_string()); /* if type is file or file is stdin */ tf = get_ftable(mode); diff --git a/tape/metrics_collector_writer.cpp b/tape/metrics_collector_writer.cpp index 2294602a5..0dd7249ce 100644 --- a/tape/metrics_collector_writer.cpp +++ b/tape/metrics_collector_writer.cpp @@ -46,7 +46,7 @@ int metrics_collector_writer::init(OBJECT *parent) // check for filename if(0 == filename[0]){ // if no filename, auto-generate based on ID - sprintf(filename, "%256s-%256i-metrics_collector_output.json", oclass->name, obj->id); + filename.format("%256s-%256i-metrics_collector_output.json", oclass->name, obj->id); gl_warning("metrics_collector_writer::init(): no filename defined, auto-generating '%s'", filename.get_string()); /* TROUBLESHOOT group_recorder requires a filename. If none is provided, a filename will be generated @@ -55,18 +55,12 @@ int metrics_collector_writer::init(OBJECT *parent) } // Write seperate json files for meters, triplex_meters, inverters, capacitors, regulators, houses, substation_meter: - filename_billing_meter = "billing_meter_"; - strcat(filename_billing_meter, filename); - filename_inverter = "inverter_"; - strcat(filename_inverter, filename); - filename_capacitor = "capacitor_"; - strcat(filename_capacitor, filename); - filename_regulator = "regulator_"; - strcat(filename_regulator, filename); - filename_house = "house_"; - strcat(filename_house, filename); - filename_substation = "substation_"; - strcat(filename_substation, filename); + filename_billing_meter.format("billing_meter_%s",(const char*)filename); + filename_inverter.format("inverter_%s",(const char*)filename); + filename_capacitor.format("capacitor_%s",(const char*)filename); + filename_regulator.format("regulator_%s",(const char*)filename); + filename_house.format("house_%s",(const char*)filename); + filename_substation.format("substation_%s",(const char*)filename); // Check valid metrics_collector output interval interval_length = (int64)(interval_length_dbl); diff --git a/tape/multi_recorder.cpp b/tape/multi_recorder.cpp index 700526b9a..03e8b5d24 100644 --- a/tape/multi_recorder.cpp +++ b/tape/multi_recorder.cpp @@ -83,21 +83,21 @@ EXPORT int create_multi_recorder(OBJECT **obj, OBJECT *parent) struct recorder *my = OBJECTDATA(*obj,struct recorder); last_recorder = *obj; gl_set_parent(*obj,parent); - strcpy(my->file,""); - strcpy(my->multifile,""); - strcpy(my->filetype,"txt"); - strcpy(my->delim,","); - strcpy(my->mode, "file"); + my->file = ""; + my->multifile = ""; + my->filetype = "txt"; + my->delim = ","; + my->mode = "file"; my->interval = -1; /* transients only */ my->dInterval = -1.0; my->last.ts = -1; - strcpy(my->last.value,""); + my->last.value = ""; my->limit = 0; my->samples = 0; my->status = TS_INIT; - my->trigger[0]='\0'; + my->trigger = ""; my->format = 0; - strcpy(my->plotcommands,""); + my->plotcommands = ""; my->target = NULL; my->header_units = HU_DEFAULT; my->line_units = LU_DEFAULT; @@ -110,9 +110,9 @@ EXPORT int create_multi_recorder(OBJECT **obj, OBJECT *parent) static int multi_recorder_open(OBJECT *obj) { - char32 type="file"; - char1024 fname=""; - char32 flags="w"; + char32 type("file"); + char1024 fname(""); + char32 flags("w"); struct recorder *my = OBJECTDATA(obj,struct recorder); TAPEFUNCS *tf = 0; @@ -124,36 +124,43 @@ static int multi_recorder_open(OBJECT *obj) my->interval = (int64)(my->dInterval/TS_SECOND); /* if prefix is omitted (no colons found) */ - if (sscanf(my->file,"%32[^:]:%1024[^:]:%[^:]",(char*)type,(char*)fname,(char*)flags)==1) + if ( sscanf(my->file,"%32[^:]:%1024[^:]:%32[^:]",type.resize(33),fname.resize(1025),flags.resize(33)) == 1 ) { /* filename is file by default */ - strcpy(fname,my->file); - strcpy(type,"file"); + fname = my->file; + type = "file"; } /* if no filename given */ - if (strcmp(fname,"")==0) + if ( strcmp(fname,"") == 0 ) + { /* use object name-id as default file name */ - sprintf(fname,"%s-%d.%s",obj->parent->oclass->name,obj->parent->id, (char*)(my->filetype)); + fname.format("%s-%d.%s", obj->parent->oclass->name, obj->parent->id, (const char*)(my->filetype)); + } /* open multiple-run input file & temp output file */ - if(my->type == FT_FILE && my->multifile[0] != 0){ - if(my->interval < 1){ + if ( my->type == FT_FILE && my->multifile[0] != 0 ) + { + if ( my->interval < 1 ) + { gl_error("multirecorder: transient recorders cannot use multi-run output files"); return 0; } - sprintf(my->multitempfile, "temp_%s", (char*)(my->file)); + my->multitempfile.format("temp_%s", (const char*)(my->file)); my->multifp = fopen(my->multitempfile, "w"); - if(my->multifp == NULL){ - gl_error("multirecorder: unable to open \'%s\' for multi-run output", (char*)(my->multitempfile)); - } else { + if ( my->multifp == NULL ) + { + gl_error("multirecorder: unable to open \'%s\' for multi-run output", (const char*)(my->multitempfile)); + } + else + { time_t now=time(NULL); my->inputfp = fopen(my->multifile, "r"); // write header into temp file - fprintf(my->multifp,"# file...... %s\n", (char*)(my->file)); + fprintf(my->multifp,"# file...... %s\n", (const char*)(my->file)); fprintf(my->multifp,"# date...... %s", asctime(localtime(&now))); #ifdef WIN32 fprintf(my->multifp,"# user...... %s\n", getenv("USERNAME")); @@ -167,7 +174,7 @@ static int multi_recorder_open(OBJECT *obj) } else { fprintf(my->multifp,"# target.... (none)\n"); } - fprintf(my->multifp,"# trigger... %s\n", my->trigger[0]=='\0'?"(none)":(char*)(my->trigger)); + fprintf(my->multifp,"# trigger... %s\n", my->trigger[0]=='\0'?"(none)":(const char*)(my->trigger)); fprintf(my->multifp,"# interval.. %lld\n", my->interval); fprintf(my->multifp,"# limit..... %d\n", my->limit); fprintf(my->multifp,"# property.. %s\n", my->property); @@ -178,14 +185,16 @@ static int multi_recorder_open(OBJECT *obj) char *data; int get_col = 0; do{ - if(0 != fgets(inbuffer, 1024, my->inputfp)){ - char *end = strchr(inbuffer, '\n'); - data = inbuffer+strlen("# file...... "); - if(end != 0){ - *end = 0; // trim the trailing newline + if ( fgets(inbuffer.resize(1025), 1024, my->inputfp) != 0 ) + { + int end = inbuffer.find('\n'); + data = inbuffer.get_string() + strlen("# file...... "); + if ( end >= 0) + { + inbuffer.set_at(end,'\0'); // trim the trailing newline } // "# columns... " - if(strncmp(inbuffer, "# file", strlen("# file")) == 0){ + if( strncmp(inbuffer, "# file", strlen("# file")) == 0){ ; // ignore } else if(strncmp(inbuffer, "# date", strlen("# date")) == 0){ ; // ignore @@ -196,10 +205,12 @@ static int multi_recorder_open(OBJECT *obj) } else if(strncmp(inbuffer, "# target", strlen("# target")) == 0){ // verify same target char256 target; - if(obj->parent != 0){ - sprintf(target, "%s %d", obj->parent->oclass->name, obj->parent->id); - if(0 != strncmp(target, data, strlen(data))){ - gl_error("multirecorder:%i: re-recording target mismatch: was %s, now %s", obj->id, data, (char*)target); + if ( obj->parent != 0 ) + { + target.format("%s %d", obj->parent->oclass->name, obj->parent->id); + if ( 0 != strncmp(target, data, strlen(data)) ) + { + gl_error("multirecorder:%i: re-recording target mismatch: was %s, now %s", obj->id, data, (const char*)target); } } else { if(strncmp("(none)", target, 6)){ @@ -229,44 +240,55 @@ static int multi_recorder_open(OBJECT *obj) // next line is full header column list get_col = 1; } - } else { - gl_error("multirecorder: error reading multi-read input file \'%s\'", (char*)(my->multifile)); + } + else + { + gl_error("multirecorder: error reading multi-read input file \'%s\'", (const char*)(my->multifile)); break; } } while(inbuffer[0] == '#' && get_col == 0); // get full column list - if(0 != fgets(inbuffer, 1024, my->inputfp)){ + if ( fgets(inbuffer.resize(1025), 1024, my->inputfp) != 0 ) + { int rep=0; int replen = (int)strlen("# repetition"); int len, lenmax = 1024, i = 0; char1024 propstr, shortstr; PROPERTY *tprop = my->target; gl_verbose("read last buffer"); - if(strncmp(inbuffer, "# repetition", replen) == 0){ - char *trim; + if ( strncmp(inbuffer, "# repetition", replen) == 0 ) + { rep = atoi(inbuffer + replen + 1); // skip intermediate space ++rep; fprintf(my->multifp, "# repetition %i\n", rep); - fgets(inbuffer, 1024, my->inputfp); - trim = strchr(inbuffer, '\n'); - if(trim) *trim = 0; - } else { // invalid input file or somesuch, we could error ... or we can trample onwards with our output file. + fgets(inbuffer.resize(1025), 1024, my->inputfp); + int trim = inbuffer.find('\n'); + if ( trim >= 0 ) + { + inbuffer.set_at(trim,'\0'); + } + } + else + { + // invalid input file or somesuch, we could error ... or we can trample onwards with our output file. rep = 0; fprintf(my->multifp, "# repetition %i\n", rep); } // following block matches below - while(tprop != NULL){ - sprintf(shortstr, ",%s(%i)", tprop->name, rep); + while ( tprop != NULL ) + { + shortstr.format(",%s(%i)", tprop->name, rep); len = (int)strlen(shortstr); - if(len > lenmax){ + if ( len > lenmax ) + { gl_error("multirecorder: multi-run recorder output full property list is larger than the buffer, please start a new file!"); break; // will still print everything up to this one } - strncpy(propstr+i, shortstr, len+1); + strncpy(propstr.get_string()+i, shortstr, len+1); i += len; tprop = tprop->next; } - fprintf(my->multifp, "%s%s\n", (char*)inbuffer, (char*)propstr); + fprintf(my->multifp, "%s%s\n", (const char*)inbuffer, (const char*)propstr); } } else { /* new file, so write repetition & properties with (0) */ char1024 propstr, shortstr; @@ -277,23 +299,23 @@ static int multi_recorder_open(OBJECT *obj) PROPERTY *tprop = my->target; fprintf(my->multifp, "# repetition 0\n"); // no string from previous runs to append new props to - sprintf(propstr, "# timestamp"); + propstr = "# timestamp"; len = (int)strlen(propstr); lenmax-=len; i = len; // following block matches above while(tprop != NULL){ - sprintf(shortstr, ",%s(0)", tprop->name); + shortstr.format(",%s(0)", tprop->name); len = (int)strlen(shortstr); if(len > lenmax){ gl_error("multirecorder: multi-run recorder output full property list is larger than the buffer, please start a new file!"); break; // will still print everything up to this one } - strncpy(propstr+i, shortstr, len+1); + strncpy(propstr.get_string()+i, shortstr, len+1); i += len; tprop = tprop->next; } - fprintf(my->multifp, "%s\n", (char*)propstr); + fprintf(my->multifp, "%s\n", (const char*)propstr); /* * * End update part * * */ @@ -321,7 +343,7 @@ static int multi_recorder_open(OBJECT *obj) char *last; switch(my->header_units){ case HU_DEFAULT: - strcpy(my->out_property, my->property); + my->out_property = my->property; break; case HU_ALL: strcpy(unit_buffer, my->property); @@ -403,19 +425,19 @@ static int multi_recorder_open(OBJECT *obj) if(myobj != obj->parent){ // need to include target object name in string if(unit != 0){ - sprintf(my->out_property+offset, "%s%s:%s[%s]", (first ? "" : ","), myobj->name, propstr, (unitstr[0] ? unitstr : unit->name)); + sprintf(my->out_property.get_string()+offset, "%s%s:%s[%s]", (first ? "" : ","), myobj->name, propstr, (unitstr[0] ? unitstr : unit->name)); offset += strlen(propstr) + (first ? 0 : 1) + 2 + strlen(unitstr[0] ? unitstr : unit->name) + strlen(myobj->name) + 1; } else { - sprintf(my->out_property+offset, "%s%s:%s", (first ? "" : ","), myobj->name, propstr); + sprintf(my->out_property.get_string()+offset, "%s%s:%s", (first ? "" : ","), myobj->name, propstr); offset += strlen(propstr) + (first ? 0 : 1 + strlen(myobj->name) + 1); } } else { // parent object, so no explicit object name if(unit != 0){ - sprintf(my->out_property+offset, "%s%s[%s]", (first ? "" : ","), propstr, (unitstr[0] ? unitstr : unit->name)); + sprintf(my->out_property.get_string()+offset, "%s%s[%s]", (first ? "" : ","), propstr, (unitstr[0] ? unitstr : unit->name)); offset += strlen(propstr) + (first ? 0 : 1) + 2 + strlen(unitstr[0] ? unitstr : unit->name); } else { - sprintf(my->out_property+offset, "%s%s", (first ? "" : ","), propstr); + sprintf(my->out_property.get_string()+offset, "%s%s", (first ? "" : ","), propstr); offset += strlen(propstr) + (first ? 0 : 1); } } @@ -429,7 +451,7 @@ static int multi_recorder_open(OBJECT *obj) ; // no logic change } // print just the property, regardless of type or explicitly declared property - sprintf(my->out_property+offset, "%s%s", (first ? "" : ","), propstr); + sprintf(my->out_property.get_string()+offset, "%s%s", (first ? "" : ","), propstr); offset += strlen(propstr) + (first ? 0 : 1); first = 0; } @@ -442,7 +464,7 @@ static int multi_recorder_open(OBJECT *obj) return my->ops->open(my, fname, flags); } -static int write_multi_recorder(struct recorder *my, char *ts, char *value) +static int write_multi_recorder(struct recorder *my, const char *ts, const char *value) { return my->ops->write(my, ts, value); } @@ -454,7 +476,7 @@ static void close_multi_recorder(struct recorder *my) } if(my->multifp){ if(0 != fclose(my->multifp)){ - gl_error("multirecorder: unable to close multi-run temp file \'%s\'", (char*)(my->multitempfile)); + gl_error("multirecorder: unable to close multi-run temp file \'%s\'", (const char*)(my->multitempfile)); perror("fclose(): "); } @@ -463,12 +485,12 @@ static void close_multi_recorder(struct recorder *my) if(my->inputfp != NULL){ fclose(my->inputfp); if(0 != remove(my->multifile)){ // old file - gl_error("multirecorder: unable to remove out-of-data multi-run file \'%s\'", (char*)(my->multifile)); + gl_error("multirecorder: unable to remove out-of-data multi-run file \'%s\'", (const char*)(my->multifile)); perror("remove(): "); } } if(0 != rename(my->multitempfile, my->multifile)){ - gl_error("multirecorder: unable to rename multi-run file \'%s\' to \'%s\'", (char*)(my->multitempfile), (char*)(my->multifile)); + gl_error("multirecorder: unable to rename multi-run file \'%s\' to \'%s\'", (const char*)(my->multitempfile), (const char*)(my->multifile)); perror("rename(): "); } @@ -514,12 +536,12 @@ static TIMESTAMP multi_recorder_write(OBJECT *obj) char *in_ts = 0; char *in_tok = 0; - memset(inbuffer, 0, sizeof(inbuffer)); + inbuffer = ""; if(my->inputfp != NULL){ // read line do{ - if(0 == fgets(inbuffer, 1024, my->inputfp)){ + if(0 == fgets(inbuffer.resize(1025), 1024, my->inputfp)){ if(feof(my->inputfp)){ // if there is no more data to append rows to, we're done with the aggregate //fclose(my->multifp); // happens in close() @@ -536,7 +558,7 @@ static TIMESTAMP multi_recorder_write(OBJECT *obj) // NOTE: this is not thread safe! // split on first comma - in_ts = strtok_s(inbuffer, ",\n", &lasts); + in_ts = strtok_s(inbuffer.get_string(), ",\n", &lasts); in_tok = strtok_s(NULL, "\n", &lasts); if(in_ts == NULL){ @@ -548,12 +570,12 @@ static TIMESTAMP multi_recorder_write(OBJECT *obj) if(strcmp(in_ts, ts) != 0){ gl_warning("multirecorder: timestamp mismatch between current input line and simulation time"); } - sprintf(outbuffer, "%s,%s", in_tok, (char*)(my->last.value)); + outbuffer.format("%s,%s", in_tok, (const char*)(my->last.value)); } else { // no input file ~ write normal output - strcpy(outbuffer, my->last.value); + outbuffer = my->last.value; } // fprintf - fprintf(my->multifp, "%s,%s\n", ts, (char*)outbuffer); + fprintf(my->multifp, "%s,%s\n", ts, (const char*)outbuffer); } return TS_NEVER; } @@ -623,7 +645,7 @@ RECORDER_MAP *link_multi_properties(OBJECT *obj, char *property_list) PROPERTY *target_prop = NULL; OBJECT *target_obj = NULL; UNIT *unit = NULL; - char256 pstr="", ustr=""; + char256 pstr(""), ustr(""); double scale = 1.0; rmap = (RECORDER_MAP *)malloc(sizeof(RECORDER_MAP)); @@ -679,19 +701,19 @@ RECORDER_MAP *link_multi_properties(OBJECT *obj, char *property_list) gl_debug("target object = '%s:%d'", target_obj->oclass->name, target_obj->id); // everything that looks like a property name, then read units up to ] - if ( sscanf(propstr,"%255[A-Za-z0-9_.][%255[^]\n,]]", (char*)pstr, (char*)ustr) == 2 ) + if ( sscanf(propstr,"%255[A-Za-z0-9_.][%255[^]\n,]]", pstr.resize(256), ustr.resize(256)) == 2 ) { unit = gl_find_unit(ustr); if ( unit == NULL ) { - gl_error("%s: unable to find unit '%s' for property '%s' in object '%s %i'", objname, (char*)ustr,(char*)pstr,target_obj->oclass->name, target_obj->id); + gl_error("%s: unable to find unit '%s' for property '%s' in object '%s %i'", objname, (const char*)ustr,(const char*)pstr,target_obj->oclass->name, target_obj->id); continue; } } /* branch: test to see if we're trying to split up a complex property */ /* must occur w/ *cpart=0 before gl_get_property in order to properly reformat the property name string */ - cpart = strchr(pstr, '.'); + cpart = strchr(pstr.get_string(), '.'); if ( cpart != NULL ) { if ( strcmp("imag", cpart+1) == 0 ) @@ -717,7 +739,7 @@ RECORDER_MAP *link_multi_properties(OBJECT *obj, char *property_list) } else if ( unit != NULL && gl_convert_ex(target_prop->unit, unit, &scale) == 0 ) { - gl_error("%s: unable to convert property '%s' units to '%s'", objname, item, (char*)ustr); + gl_error("%s: unable to convert property '%s' units to '%s'", objname, item, (const char*)ustr); continue; } if ( first == NULL ) @@ -867,7 +889,7 @@ EXPORT TIMESTAMP sync_multi_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) // if the recorder is clock-based, write the value if((my->interval > 0) && (my->last.ts < t0) && (my->last.value[0] != 0)){ multi_recorder_write(obj); - my->last.value[0] = 0; // once it's been finalized, dump it + my->last.value = ""; // once it's been finalized, dump it } } @@ -925,11 +947,13 @@ EXPORT TIMESTAMP sync_multi_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) ) { - strncpy(my->last.value,buffer,sizeof(my->last.value)); + my->last.value = buffer; my->last.ts = t0; multi_recorder_write(obj); - } else if (my->interval > 0 && my->last.ts == t0){ - strncpy(my->last.value,buffer,sizeof(my->last.value)); + } + else if (my->interval > 0 && my->last.ts == t0) + { + my->last.value = buffer; } } Error: diff --git a/tape/player.cpp b/tape/player.cpp index 6a5183d57..24517cae3 100644 --- a/tape/player.cpp +++ b/tape/player.cpp @@ -49,7 +49,7 @@ static OBJECT *last_player = NULL; extern TIMESTAMP delta_mode_needed; -PROPERTY *player_link_properties(struct player *player, OBJECT *obj, char *property_list) +PROPERTY *player_link_properties(struct player *player, OBJECT *obj, const char *property_list) { char *item; PROPERTY *first=NULL, *last=NULL; @@ -63,9 +63,9 @@ PROPERTY *player_link_properties(struct player *player, OBJECT *obj, char *prope char *cpart = 0; int64 cid = -1; - strcpy(list,property_list); /* avoid destroying orginal list */ + list = property_list; /* avoid destroying orginal list */ char *last_token; - for (item=strtok_r(list,",",&last_token); item!=NULL; item=strtok_r(NULL,",",&last_token)) + for (item=strtok_r(list.get_string(),",",&last_token); item!=NULL; item=strtok_r(NULL,",",&last_token)) { prop = NULL; target = NULL; @@ -76,13 +76,15 @@ PROPERTY *player_link_properties(struct player *player, OBJECT *obj, char *prope // everything that looks like a property name, then read units up to ] while (isspace(*item)) item++; - if(2 == sscanf(item,"%[A-Za-z0-9_.][%[^]\n,]]", (char*)pstr, (char*)ustr)){ + if ( sscanf(item,"%255[A-Za-z0-9_.][%255[^]\n,]]", pstr.resize(256), ustr.resize(256)) == 2 ) + { unit = gl_find_unit(ustr); - if(unit == NULL){ - gl_error("sync_player:%d: unable to find unit '%s' for property '%s'",obj->id, (char*)ustr,(char*)pstr); + if ( unit == NULL ) + { + gl_error("sync_player:%d: unable to find unit '%s' for property '%s'",obj->id, (const char*)ustr,(const char*)pstr); return NULL; } - item = pstr; + item = pstr.get_string(); } prop = (PROPERTY*)malloc(sizeof(PROPERTY)); @@ -110,7 +112,7 @@ PROPERTY *player_link_properties(struct player *player, OBJECT *obj, char *prope } else if(unit != NULL && 0 == gl_convert_ex(target->unit, unit, &scale)) { - gl_error("sync_player:%d: unable to convert property '%s' units to '%s'", obj->id, item, (char*)ustr); + gl_error("sync_player:%d: unable to convert property '%s' units to '%s'", obj->id, item, (const char*)ustr); return NULL; } if (first==NULL) first=prop; else last->next=prop; @@ -140,9 +142,9 @@ int player_write_properties(struct player *my, OBJECT *obj, PROPERTY *prop, cons int count=0; const char delim[] = ",\n\r\t"; char1024 bufcpy; - memcpy(bufcpy, buffer, sizeof(char1024)); + bufcpy = buffer; char *next; - char *token = strtok_s(bufcpy, delim, &next); + char *token = strtok_s(bufcpy.get_string(), delim, &next); PROPERTY *p=NULL; for (p=prop; p!=NULL; p=p->next) { @@ -166,19 +168,19 @@ EXPORT int create_player(OBJECT **obj, OBJECT *parent) struct player *my = OBJECTDATA(*obj,struct player); last_player = *obj; gl_set_parent(*obj,parent); - strcpy(my->file,""); - strcpy(my->filetype,"txt"); - strcpy(my->mode, "file"); - strcpy(my->property,"(undefined)"); + my->file = ""; + my->filetype = "txt"; + my->mode = "file"; + my->property = "(undefined)"; my->next.ts = TS_ZERO; - strcpy(my->next.value,""); + my->next.value = ""; my->loopnum = 0; my->loop = 0; my->status = TS_INIT; my->target = gl_get_property(*obj,my->property,NULL); my->delta_track.ns = 0; my->delta_track.ts = TS_NEVER; - my->delta_track.value[0] = '\0'; + my->delta_track.value = ""; return 1; } return 0; @@ -186,8 +188,8 @@ EXPORT int create_player(OBJECT **obj, OBJECT *parent) static int player_open(OBJECT *obj) { - char1024 fname=""; - char32 flags="r"; + char1024 fname(""); + char32 flags("r"); struct player *my = OBJECTDATA(obj,struct player); TAPEFUNCS *tf = 0; int retvalue; @@ -196,15 +198,15 @@ static int player_open(OBJECT *obj) // if (sscanf(my->file,"%32[^:]:%1024[^:]:%[^:]",type,fname,flags)==1) // { // /* filename is file by default */ - strcpy(fname,my->file); + fname = my->file; // strcpy(type,"file"); // } /* if no filename given */ - if (strcmp(fname,"")==0) + if ( fname == "" ) /* use object name-id as default file name */ - sprintf(fname,"%s-%d.%s",obj->parent->oclass->name,obj->parent->id, (char*)(my->filetype)); + fname.format("%s-%d.%s",obj->parent->oclass->name,obj->parent->id, (const char*)(my->filetype)); /* if type is file or file is stdin */ tf = get_ftable(my->mode); @@ -297,7 +299,7 @@ CDECL TIMESTAMP player_read(OBJECT *obj) memset(timebuf, 0, 64); memset(valbuf, 0, 1024); memset(tbuf, 0, 64); - memset(value, 0, 1024); + value = ""; memset(tz, 0, 6); if (result==NULL) { @@ -320,7 +322,7 @@ CDECL TIMESTAMP player_read(OBJECT *obj) if(sscanf(result, "%32[^,],%1024[^\n\r;]", tbuf, valbuf) == 2){ trim(tbuf, timebuf); - trim(valbuf, value); + trim(valbuf, value.get_string()); if (sscanf(timebuf,"%d-%d-%d %d:%d:%lf %4s",&Y,&m,&d,&H,&M,&S, tz)==7){ DATETIME dt; switch ( dateformat ) { @@ -357,7 +359,7 @@ CDECL TIMESTAMP player_read(OBJECT *obj) while(value[voff] == ' '){ ++voff; } - strcpy(my->next.value, value+voff); + my->next.value = value+voff; } } else if (sscanf(timebuf,"%d-%d-%d %d:%d:%lf",&Y,&m,&d,&H,&M,&S)>=4) @@ -391,17 +393,21 @@ CDECL TIMESTAMP player_read(OBJECT *obj) dt.nanosecond = (unsigned int)(1e9*(S-dt.second)); t1 = (TIMESTAMP)gl_mktime(&dt); if ((obj->flags & OF_DELTAMODE)==OF_DELTAMODE) /* Only request deltamode if we're explicitly enabled */ + { enable_deltamode(dt.nanosecond==0?TS_NEVER:t1); - if (t1!=TS_INVALID && my->loop==my->loopnum){ + } + if (t1!=TS_INVALID && my->loop==my->loopnum) + { my->next.ts = t1; my->next.ns = dt.nanosecond; - while(value[voff] == ' '){ + while(value[voff] == ' ') + { ++voff; } - strcpy(my->next.value, value+voff); + my->next.value = value + voff; } } - else if (sscanf(timebuf,"%" FMT_INT64 "d%1s", &t1, unit)==2) + else if ( sscanf(timebuf,"%" FMT_INT64 "d%1s", &t1, unit) == 2 ) { { int64 scale=1; @@ -413,18 +419,23 @@ CDECL TIMESTAMP player_read(OBJECT *obj) default: break; } t1 *= scale; - if (result[0]=='+'){ /* timeshifts have leading + */ + if ( result[0] == '+' ) /* timeshifts have leading + */ + { my->next.ts += t1; - while(value[voff] == ' '){ + while ( value[voff] == ' ' ) + { ++voff; } - strcpy(my->next.value, value+voff); - } else if (my->loop==my->loopnum){ /* absolute times are ignored on all but first loops */ + my->next.value = value + voff; + } + else if ( my->loop == my->loopnum ) /* absolute times are ignored on all but first loops */ + { my->next.ts = t1; - while(value[voff] == ' '){ + while(value[voff] == ' ') + { ++voff; } - strcpy(my->next.value, value+voff); + my->next.value = value + voff; } } } @@ -433,12 +444,16 @@ CDECL TIMESTAMP player_read(OBJECT *obj) if (my->loop==my->loopnum) { my->next.ts = (unsigned short)S; my->next.ns = (unsigned int)(1e9*(S-my->next.ts)); - if ((obj->flags & OF_DELTAMODE)==OF_DELTAMODE) /* Only request deltamode if we're explicitly enabled */ + if ((obj->flags & OF_DELTAMODE)==OF_DELTAMODE) + { + /* Only request deltamode if we're explicitly enabled */ enable_deltamode(my->next.ns==0?TS_NEVER:t1); - while(value[voff] == ' '){ + } + while(value[voff] == ' ') + { ++voff; } - strcpy(my->next.value, value+voff); + my->next.value = value + voff; } } else @@ -459,7 +474,8 @@ EXPORT TIMESTAMP sync_player(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) TIMESTAMP t1 = (TS_OPEN == my->status) ? my->next.ts : TS_NEVER; TIMESTAMP temp_t =0; - if (my->status==TS_INIT){ + if ( my->status == TS_INIT ) + { /* get local target if remote is not used and "value" is defined by the user at runtime */ if (my->target==NULL && obj->parent == NULL) @@ -467,7 +483,7 @@ EXPORT TIMESTAMP sync_player(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) if(player_open(obj) == 0) { - gl_error("sync_player: Unable to open player file '%s' for object '%s'", (char*)(my->file), obj->name?obj->name:"(anon)"); + gl_error("sync_player: Unable to open player file '%s' for object '%s'", (const char*)(my->file), obj->name?obj->name:"(anon)"); } else { @@ -480,7 +496,7 @@ EXPORT TIMESTAMP sync_player(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) if (my->target==NULL) my->target = player_link_properties(my, obj->parent, my->property); if (my->target==NULL){ - gl_error("sync_player: Unable to find property \"%s\" in object %s", (char*)(my->property), obj->name?obj->name:"(anon)"); + gl_error("sync_player: Unable to find property \"%s\" in object %s", (const char*)(my->property), obj->name?obj->name:"(anon)"); my->status = TS_ERROR; } if (my->target!=NULL) @@ -492,7 +508,7 @@ EXPORT TIMESTAMP sync_player(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) /* Copy the current value into our "tracking" variable */ my->delta_track.ns = my->next.ns; my->delta_track.ts = my->next.ts; - memcpy(my->delta_track.value,my->next.value,sizeof(char1024)); + my->delta_track.value = my->next.value; t1 = player_read(obj); } @@ -514,7 +530,7 @@ EXPORT TIMESTAMP sync_player(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) if (my->target==NULL) my->target = player_link_properties(my, obj->parent, my->property); if (my->target==NULL){ - gl_error("sync_player: Unable to find property \"%s\" in object %s", (char*)(my->property), obj->name?obj->name:"(anon)"); + gl_error("sync_player: Unable to find property \"%s\" in object %s", (const char*)(my->property), obj->name?obj->name:"(anon)"); my->status = TS_ERROR; } @@ -532,7 +548,7 @@ EXPORT TIMESTAMP sync_player(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) /* Copy the value into the tracking variable */ my->delta_track.ns = my->next.ns; my->delta_track.ts = my->next.ts; - memcpy(my->delta_track.value,my->next.value,sizeof(char1024)); + my->delta_track.value = my->next.value; /* Perform the update */ temp_t = player_read(obj); @@ -559,7 +575,7 @@ EXPORT TIMESTAMP sync_player(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) /* Copy the value into the tracking variable */ my->delta_track.ns = my->next.ns; my->delta_track.ts = my->next.ts; - memcpy(my->delta_track.value,my->next.value,sizeof(char1024)); + my->delta_track.value = my->next.value; /* Perform the update */ temp_t = player_read(obj); @@ -583,7 +599,7 @@ EXPORT TIMESTAMP sync_player(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) /* Copy the value into the tracking variable */ my->delta_track.ns = my->next.ns; my->delta_track.ts = my->next.ts; - memcpy(my->delta_track.value,my->next.value,sizeof(char1024)); + my->delta_track.value = my->next.value; /* Perform the update */ temp_t = player_read(obj); diff --git a/tape/recorder.cpp b/tape/recorder.cpp index 32c912c07..fa3b0d17c 100644 --- a/tape/recorder.cpp +++ b/tape/recorder.cpp @@ -73,17 +73,17 @@ EXPORT int create_recorder(OBJECT **obj, OBJECT *parent) struct recorder *my = OBJECTDATA(*obj,struct recorder); last_recorder = *obj; gl_set_parent(*obj,parent); - strcpy(my->file,""); - strcpy(my->multifile,""); - strcpy(my->filetype,"txt"); - strcpy(my->delim,","); + my->file = ""; + my->multifile = ""; + my->filetype = "txt"; + my->delim = ","; // my->interval = -1; // transients only my->last.ts = -1; my->last.ns = -1; - strcpy(my->last.value,""); + my->last.value = ""; my->samples = 0; my->status = TS_INIT; - strcpy(my->plotcommands,""); + my->plotcommands = ""; my->target = NULL; my->property = NULL; my->property_len = 0; @@ -96,7 +96,7 @@ EXPORT int create_recorder(OBJECT **obj, OBJECT *parent) static int recorder_open(OBJECT *obj) { - char32 flags="w"; + char32 flags("w"); TAPEFUNCS *f = 0; struct recorder *my = OBJECTDATA(obj,struct recorder); int retvalue; @@ -118,7 +118,7 @@ static int recorder_open(OBJECT *obj) if (strcmp(my->file,"")==0) { /* use object name-id as default file name */ - sprintf(my->file,"%s-%d.%s",obj->parent->oclass->name,obj->parent->id, (char*)my->filetype); + my->file.format("%s-%d.%s",obj->parent->oclass->name,obj->parent->id, (const char*)my->filetype); } /* open multiple-run input file & temp output file */ @@ -129,17 +129,17 @@ static int recorder_open(OBJECT *obj) gl_error("transient recorders cannot use multi-run output files"); return 0; } - sprintf(my->multitempfile, "temp_%s", (char*)my->file); + my->multitempfile.format("temp_%s", (const char*)my->file); my->multifp = fopen(my->multitempfile, "w"); if(my->multifp == NULL){ - gl_error("unable to open \'%s\' for multi-run output", (char*)my->multitempfile); + gl_error("unable to open \'%s\' for multi-run output", (const char*)my->multitempfile); } else { time_t now=time(NULL); my->inputfp = fopen(my->multifile, "r"); // write header into temp file - fprintf(my->multifp,"# file...... %s\n", (char*)my->file); + fprintf(my->multifp,"# file...... %s\n", (const char*)my->file); fprintf(my->multifp,"# date...... %s", asctime(localtime(&now))); #ifdef WIN32 fprintf(my->multifp,"# user...... %s\n", getenv("USERNAME")); @@ -149,7 +149,7 @@ static int recorder_open(OBJECT *obj) fprintf(my->multifp,"# host...... %s\n", getenv("HOST")); #endif fprintf(my->multifp,"# target.... %s %d\n", obj->parent->oclass->name, obj->parent->id); - fprintf(my->multifp,"# trigger... %s\n", my->trigger[0]=='\0'?"(none)":(char*)my->trigger); + fprintf(my->multifp,"# trigger... %s\n", my->trigger[0]=='\0'?"(none)":(const char*)my->trigger); fprintf(my->multifp,"# interval.. %lld\n", my->interval); fprintf(my->multifp,"# limit..... %d\n", my->limit); fprintf(my->multifp,"# flush..... %d\n", my->flush); @@ -161,9 +161,9 @@ static int recorder_open(OBJECT *obj) char *data; int get_col = 0; do{ - if(0 != fgets(inbuffer, 1024, my->inputfp)){ - char *end = strchr(inbuffer, '\n'); - data = inbuffer+strlen("# file...... "); + if(0 != fgets(inbuffer.resize(1025), 1024, my->inputfp)){ + char *end = strchr(inbuffer.get_string(), '\n'); + data = inbuffer.get_string() + strlen("# file...... "); if(end != 0){ *end = 0; // trim the trailing newline } @@ -179,9 +179,9 @@ static int recorder_open(OBJECT *obj) } else if(strncmp(inbuffer, "# target", strlen("# target")) == 0){ // verify same target char256 target; - sprintf(target, "%s %d", obj->parent->oclass->name, obj->parent->id); + target.format("%s %d", obj->parent->oclass->name, obj->parent->id); if(0 != strncmp(target, data, strlen(data))){ - gl_error("recorder:%i: re-recording target mismatch: was %s, now %s", obj->id, data, (char*)target); + gl_error("recorder:%i: re-recording target mismatch: was %s, now %s", obj->id, data, (const char*)target); } } else if(strncmp(inbuffer, "# trigger", strlen("# trigger")) == 0){ // verify same trigger, or absence thereof @@ -207,12 +207,12 @@ static int recorder_open(OBJECT *obj) get_col = 1; } } else { - gl_error("error reading multi-read input file \'%s\'", (char*)my->multifile); + gl_error("error reading multi-read input file \'%s\'", (const char*)my->multifile); break; } } while(inbuffer[0] == '#' && get_col == 0); // get full column list - if(0 != fgets(inbuffer, 1024, my->inputfp)){ + if(0 != fgets(inbuffer.resize(1025), 1024, my->inputfp)){ int rep=0; int replen = (int)strlen("# repetition"); int len, lenmax = 1024, i = 0; @@ -224,8 +224,8 @@ static int recorder_open(OBJECT *obj) rep = atoi(inbuffer + replen + 1); // skip intermediate space ++rep; fprintf(my->multifp, "# repetition %i\n", rep); - fgets(inbuffer, 1024, my->inputfp); - trim = strchr(inbuffer, '\n'); + fgets(inbuffer.resize(1025), 1024, my->inputfp); + trim = strchr(inbuffer.get_string(), '\n'); if(trim) *trim = 0; } else { // invalid input file or somesuch, we could error ... or we can trample onwards with our output file. rep = 0; @@ -233,17 +233,17 @@ static int recorder_open(OBJECT *obj) } // following block matches below while(tprop != NULL){ - sprintf(shortstr, ",%s(%i)", tprop->name, rep); + shortstr.format(",%s(%i)", tprop->name, rep); len = (int)strlen(shortstr); if(len > lenmax){ gl_error("multi-run recorder output full property list is larger than the buffer, please start a new file!"); break; // will still print everything up to this one } - strncpy(propstr+i, shortstr, len+1); + strncpy(propstr.get_string()+i, shortstr, len+1); i += len; tprop = tprop->next; } - fprintf(my->multifp, "%s%s\n", (char*)inbuffer, (char*)propstr); + fprintf(my->multifp, "%s%s\n", (const char*)inbuffer, (const char*)propstr); } } else { /* new file, so write repetition & properties with (0) */ char1024 propstr, shortstr; @@ -251,23 +251,23 @@ static int recorder_open(OBJECT *obj) PROPERTY *tprop = my->target; fprintf(my->multifp, "# repetition 0\n"); // no string from previous runs to append new props to - sprintf(propstr, "# timestamp"); + propstr.format("# timestamp"); len = (int)strlen(propstr); lenmax-=len; i = len; // following block matches above while(tprop != NULL){ - sprintf(shortstr, ",%s(0)", tprop->name); + shortstr.format(",%s(0)", tprop->name); len = (int)strlen(shortstr); if(len > lenmax){ gl_error("multi-run recorder output full property list is larger than the buffer, please start a new file!"); break; // will still print everything up to this one } - strncpy(propstr+i, shortstr, len+1); + strncpy(propstr.get_string()+i, shortstr, len+1); i += len; tprop = tprop->next; } - fprintf(my->multifp, "%s\n", (char*)propstr); + fprintf(my->multifp, "%s\n", (const char*)propstr); } } @@ -300,10 +300,10 @@ static int recorder_open(OBJECT *obj) switch ( my->header_units ) { case HU_DEFAULT: - strcpy(my->out_property, my->property); + my->out_property = my->property; break; case HU_ALL: - strcpy(unit_buffer, my->property); + strncpy(unit_buffer,my->property,sizeof(unit_buffer)-1); for ( token = strtok_s(unit_buffer,",",&last_token) ; token != NULL ; fmt_count++, token = strtok_s(NULL, ",",&last_token) ) { unit = 0; @@ -337,12 +337,12 @@ static int recorder_open(OBJECT *obj) // print the property, and if there is one, the unit if ( unit != NULL ) { - sprintf(my->out_property+offset, "%s%s[%s]", (first ? "" : ","), propstr, (unitstr[0] ? unitstr : unit->name)); + sprintf(my->out_property.get_string()+offset, "%s%s[%s]", (first ? "" : ","), propstr, (unitstr[0] ? unitstr : unit->name)); offset += strlen(propstr) + (first ? 0 : 1) + 2 + strlen(unitstr[0] ? unitstr : unit->name); } else { - sprintf(my->out_property+offset, "%s%s", (first ? "" : ","), propstr); + sprintf(my->out_property.get_string()+offset, "%s%s", (first ? "" : ","), propstr); offset += strlen(propstr) + (first ? 0 : 1); } first = 0; @@ -358,7 +358,7 @@ static int recorder_open(OBJECT *obj) return 0; } // print just the property, regardless of type or explicitly declared property - sprintf(my->out_property+offset, "%s%s", (first ? "" : ","), propstr); + sprintf(my->out_property.get_string()+offset, "%s%s", (first ? "" : ","), propstr); offset += strlen(propstr) + (first ? 0 : 1); first = 0; } @@ -386,7 +386,7 @@ static int recorder_open(OBJECT *obj) return my->ops->open(my, my->file, flags); } -static int write_recorder(struct recorder *my, char *ts, char *value) +static int write_recorder(struct recorder *my, const char *ts, const char *value) { int rc=my->ops->write(my, ts, value); if ( (my->flush==0 || (my->flush>0 && gl_globalclock%my->flush==0)) && my->ops->flush!=NULL ) @@ -401,7 +401,7 @@ static void close_recorder(struct recorder *my) } if(my->multifp){ if(0 != fclose(my->multifp)){ - gl_error("unable to close multi-run temp file \'%s\'", (char*)my->multitempfile); + gl_error("unable to close multi-run temp file \'%s\'", (const char*)my->multitempfile); perror("fclose(): "); } @@ -410,12 +410,12 @@ static void close_recorder(struct recorder *my) if(my->inputfp != NULL){ fclose(my->inputfp); if(0 != remove(my->multifile)){ // old file - gl_error("unable to remove out-of-data multi-run file \'%s\'", (char*)my->multifile); + gl_error("unable to remove out-of-data multi-run file \'%s\'", (const char*)my->multifile); perror("remove(): "); } } if(0 != rename(my->multitempfile, my->multifile)){ - gl_error("unable to rename multi-run file \'%s\' to \'%s\'", (char*)my->multitempfile, (char*)my->multifile); + gl_error("unable to rename multi-run file \'%s\' to \'%s\'", (const char*)my->multitempfile, (const char*)my->multifile); perror("rename(): "); } @@ -431,7 +431,7 @@ static TIMESTAMP recorder_write(OBJECT *obj) if (my->last.ts>TS_ZERO) { time_t t = (time_t)(my->last.ts); - if ( my->strftime_format[0]==0 || strftime(ts,sizeof(ts),(char*)(my->strftime_format),localtime(&t))==0 ) + if ( my->strftime_format[0]==0 || strftime(ts,sizeof(ts),(const char*)(my->strftime_format),localtime(&t))==0 ) { DATETIME dt; gl_localtime(my->last.ts,&dt); @@ -461,12 +461,13 @@ static TIMESTAMP recorder_write(OBJECT *obj) char *in_ts = 0; char *in_tok = 0; - memset(inbuffer, 0, sizeof(inbuffer)); + inbuffer = ""; if(my->inputfp != NULL){ // read line do{ - if(0 == fgets(inbuffer, 1024, my->inputfp)){ + if ( fgets(inbuffer.resize(1025), 1024, my->inputfp) == 0 ) + { if(feof(my->inputfp)){ // if there is no more data to append rows to, we're done with the aggregate //fclose(my->multifp); // happens in close() @@ -483,7 +484,7 @@ static TIMESTAMP recorder_write(OBJECT *obj) // NOTE: this is not thread safe! // split on first comma - in_ts = strtok_s(inbuffer, ",\n", &lasts); + in_ts = strtok_s(inbuffer.get_string(), ",\n", &lasts); in_tok = strtok_s(NULL, "\n", &lasts); if(in_ts == NULL){ @@ -495,12 +496,12 @@ static TIMESTAMP recorder_write(OBJECT *obj) if(strcmp(in_ts, ts) != 0){ gl_warning("timestamp mismatch between current input line and simulation time"); } - sprintf(outbuffer, "%s,%s", in_tok, (char*)my->last.value); + outbuffer.format("%s,%s", in_tok, (const char*)my->last.value); } else { // no input file ~ write normal output - strcpy(outbuffer, my->last.value); + outbuffer = my->last.value; } // fprintf - fprintf(my->multifp, "%s,%s\n", ts, (char*)outbuffer); + fprintf(my->multifp, "%s,%s\n", ts, (const char*)outbuffer); } return TS_NEVER; } @@ -590,9 +591,9 @@ PROPERTY *link_properties(struct recorder *rec, OBJECT *obj, char *property_list // everything that looks like a property name, then read units up to ] while ( isspace(*item) ) item++; - if ( sscanf(item,"%255[A-Za-z0-9_.][%255[^]\n,]]", (char*)pstr, (char*)ustr) > 1 ) + if ( sscanf(item,"%255[A-Za-z0-9_.][%255[^]\n,]]", pstr.resize(256), ustr.resize(256)) > 1 ) { - char *format = strchr(ustr,':'); + char *format = strchr(ustr.get_string(),':'); if ( format ) { *format++ = '\0'; @@ -611,12 +612,12 @@ PROPERTY *link_properties(struct recorder *rec, OBJECT *obj, char *property_list unit = gl_find_unit(ustr); if ( unit == NULL ) { - gl_error("recorder:%d: unable to find unit '%s' for property '%s'",obj->id, (char*)ustr,(char*)pstr); + gl_error("recorder:%d: unable to find unit '%s' for property '%s'",obj->id, (const char*)ustr,(const char*)pstr); free(list); return NULL; } } - item = pstr; + item = pstr.get_string(); } prop = (PROPERTY*)malloc(sizeof(PROPERTY)); if ( prop == NULL ) @@ -665,7 +666,7 @@ PROPERTY *link_properties(struct recorder *rec, OBJECT *obj, char *property_list } else if(unit != NULL && 0 == gl_convert_ex(target->unit, unit, &scale)) { - gl_error("recorder:%d: unable to convert property '%s' units to '%s'", obj->id, item, (char*)ustr); + gl_error("recorder:%d: unable to convert property '%s' units to '%s'", obj->id, item, (const char*)ustr); free(list); return NULL; } @@ -856,7 +857,7 @@ EXPORT TIMESTAMP sync_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) struct recorder *my = OBJECTDATA(obj,struct recorder); typedef enum {NONE='\0', LT='<', EQ='=', GT='>'} COMPAREOP; COMPAREOP comparison; - char1024 buffer = ""; + char1024 buffer(""); if (my->status==TS_DONE) { @@ -866,7 +867,7 @@ EXPORT TIMESTAMP sync_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) if(obj->parent == NULL){ char tb[32]; - sprintf(buffer, "'%s' lacks a parent object", obj->name ? obj->name : (sprintf(tb, "recorder:%i", obj->id),tb)); + buffer.format("'%s' lacks a parent object", obj->name ? obj->name : (snprintf(tb,sizeof(tb),"recorder:%i", obj->id),tb)); close_recorder(my); my->status = TS_ERROR; goto Error; @@ -884,7 +885,7 @@ EXPORT TIMESTAMP sync_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) } if (my->target==NULL) { - sprintf(buffer,"'%s' contains a property of %s %d that is not found", my->property, obj->parent->oclass->name, obj->parent->id); + buffer.format("'%s' contains a property of %s %d that is not found", my->property, obj->parent->oclass->name, obj->parent->id); close_recorder(my); my->status = TS_ERROR; goto Error; @@ -899,19 +900,19 @@ EXPORT TIMESTAMP sync_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) if (my->last.ns == 0) { recorder_write(obj); - my->last.value[0] = 0; // once it's been finalized, dump it + my->last.value = ""; // once it's been finalized, dump it } else //Just dump it, we already recorded this "timestamp" - my->last.value[0] = 0; + my->last.value = ""; } } /* update property value */ if ( ( my->target != NULL ) && ( my->interval <= 0 ) ) { - if(read_properties(my, obj->parent,my->target,buffer,sizeof(buffer))==0) + if ( read_properties(my, obj->parent,my->target,buffer.resize(1025),1024) == 0 ) { - sprintf(buffer,"unable to read property '%s' of %s %d", my->property, obj->parent->oclass->name, obj->parent->id); + buffer.format("unable to read property '%s' of %s %d", my->property, obj->parent->oclass->name, obj->parent->id); close_recorder(my); my->status = TS_ERROR; } @@ -919,9 +920,9 @@ EXPORT TIMESTAMP sync_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) else if ( ( my->target != NULL ) && ( my->interval > 0 ) ) { if((t0 >=my->last.ts + my->interval) || ((t0 == my->last.ts) && (my->last.ns == 0))){ - if(read_properties(my, obj->parent,my->target,buffer,sizeof(buffer))==0) + if ( read_properties(my, obj->parent,my->target,buffer.resize(1025),1024)==0) { - sprintf(buffer,"unable to read property '%s' of %s %d", my->property, obj->parent->oclass->name, obj->parent->id); + buffer.format("unable to read property '%s' of %s %d", my->property, obj->parent->oclass->name, obj->parent->id); close_recorder(my); my->status = TS_ERROR; } @@ -964,7 +965,7 @@ EXPORT TIMESTAMP sync_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) ) { - strncpy(my->last.value,buffer,sizeof(my->last.value)); + my->last.value = buffer; /* Deltamode-related check -- if we're ahead, don't overwrite this */ if (my->last.ts < t0) @@ -974,13 +975,13 @@ EXPORT TIMESTAMP sync_recorder(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) recorder_write(obj); } } else if ((my->interval > 0) && (my->last.ts == t0) && (my->last.ns == 0)){ - strncpy(my->last.value,buffer,sizeof(my->last.value)); + my->last.value = buffer; } } Error: if (my->status==TS_ERROR) { - gl_error("recorder %d %s\n",obj->id, (char*)buffer); + gl_error("recorder %d %s\n",obj->id, (const char*)buffer); close_recorder(my); my->status=TS_DONE; return TS_NEVER; diff --git a/tape/shaper.cpp b/tape/shaper.cpp index 025133670..dac2be2e1 100644 --- a/tape/shaper.cpp +++ b/tape/shaper.cpp @@ -57,11 +57,11 @@ EXPORT int create_shaper(OBJECT **obj, OBJECT *parent) struct shaper *my = OBJECTDATA(*obj,struct shaper); last_shaper = *obj; gl_set_parent(*obj,parent); - strcpy(my->file,""); - strcpy(my->filetype,"txt"); - strcpy(my->property,""); - strcpy(my->group,""); - strcpy(my->mode, "file"); + my->file = ""; + my->filetype = "txt"; + my->property = ""; + my->group = ""; + my->mode = "file"; my->loopnum = 0; my->status = TS_INIT; my->targets = NULL; @@ -79,8 +79,8 @@ EXPORT int create_shaper(OBJECT **obj, OBJECT *parent) static int shaper_open(OBJECT *obj) { - char1024 fname=""; - char32 flags="r"; + char1024 fname(""); + char32 flags("r"); TAPEFUNCS *fns; struct shaper *my = OBJECTDATA(obj,struct shaper); @@ -88,7 +88,7 @@ static int shaper_open(OBJECT *obj) // if (sscanf(my->file,"%32[^:]:%1024[^:]:%[^:]",type,fname,flags)==1) // { /* filename is file by default */ - strcpy(fname,my->file); + fname = my->file; // strcpy(type,"file"); // } @@ -96,7 +96,7 @@ static int shaper_open(OBJECT *obj) if (strcmp(fname,"")==0) /* use object name-id as default file name */ - sprintf(fname,"%s-%d.%s",obj->parent->oclass->name,obj->parent->id, (char*)my->filetype); + fname.format("%s-%d.%s",obj->parent->oclass->name,obj->parent->id, (const char*)my->filetype); /* if type is file or file is stdin */ fns = get_ftable(my->mode); @@ -197,12 +197,12 @@ EXPORT TIMESTAMP sync_shaper(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) /* build target list */ if (my->targets==NULL && my->group[0]!='\0') { - FINDLIST *object_list = gl_find_objects(FL_GROUP,(char*)my->group); + FINDLIST *object_list = gl_find_objects(FL_GROUP,(const char*)my->group); OBJECT *item=NULL; int n=0; if (object_list==NULL || object_list->hit_count<=0) { - gl_warning("shaper group '%s' is empty", (char*)my->group); + gl_warning("shaper group '%s' is empty", (const char*)my->group); my->status=TS_DONE; return TS_NEVER; } @@ -241,7 +241,7 @@ EXPORT TIMESTAMP sync_shaper(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) else gl_warning("object %s:%d property %s is not a double", item->oclass->name,item->id, prop->name); } else { - gl_error("object %s:%d property %s not found in object %s", obj->oclass->name,obj->id, (char*)my->property, item->oclass->name,item->id); + gl_error("object %s:%d property %s not found in object %s", obj->oclass->name,obj->id, (const char*)my->property, item->oclass->name,item->id); } } } @@ -276,7 +276,7 @@ EXPORT TIMESTAMP sync_shaper(OBJECT *obj, TIMESTAMP t0, PASSCONFIG pass) } obj->clock = t0; if(t1 == 0){ - gl_error("shaper:%i will return t1==0 ~ check the shaper's target property, \"%s\"", obj->id, (char*)my->property); + gl_error("shaper:%i will return t1==0 ~ check the shaper's target property, \"%s\"", obj->id, (const char*)my->property); } return t1!=TS_NEVER?-t1:TS_NEVER; /* negative indicates a "soft" event which is only considered for stepping, not for stopping */ } diff --git a/tape/tape.cpp b/tape/tape.cpp index 2e04fc97c..520385af3 100644 --- a/tape/tape.cpp +++ b/tape/tape.cpp @@ -83,9 +83,9 @@ int32 flush_interval = 0; int csv_data_only = 0; /* enable this option to suppress addition of lines starting with # in CSV */ int csv_keep_clean = 0; /* enable this option to keep data flushed at end of line */ -typedef int (*OPENFUNC)(void *, char *, char *); +typedef int (*OPENFUNC)(void *, const char *, const char *); typedef char *(*READFUNC)(void *, char *, unsigned int); -typedef int (*WRITEFUNC)(void *, char *, char *); +typedef int (*WRITEFUNC)(void *, const char *, const char *); typedef int (*REWINDFUNC)(void *); typedef void (*CLOSEFUNC)(void *); typedef void *(*SETOPTIONCALL)(const char *name, void *value); @@ -104,7 +104,8 @@ void set_csv_options(void) } } -TAPEFUNCS *get_ftable(char *mode){ +TAPEFUNCS *get_ftable(const char *mode) +{ /* check what we've already loaded */ char256 modname; TAPEFUNCS *fptr = funcs; @@ -119,25 +120,29 @@ TAPEFUNCS *get_ftable(char *mode){ } /* fptr = NULL */ fptr = (TAPEFUNCS*)malloc(sizeof(TAPEFUNCS)); - if(fptr == NULL) + if ( fptr == NULL ) { gl_error("get_ftable(char *mode='%s'): out of memory", mode); return NULL; /* out of memory */ } - snprintf(modname, sizeof(modname), "tape_%s" DLEXT, mode); + modname.format("tape_%s" DLEXT, mode); - if(gl_findfile(modname, NULL, 0|4, tpath,sizeof(tpath)) == NULL){ - gl_error("unable to locate %s", (char*)modname); + if ( gl_findfile(modname, NULL, 0|4, tpath,sizeof(tpath)) == NULL ) + { + gl_error("unable to locate %s", (const char*)modname); return NULL; } lib = fptr->hLib = DLLOAD(tpath); - if(fptr->hLib == NULL){ - gl_error("tape module: unable to load DLL for %s", (char*)modname); + if ( fptr->hLib == NULL ) + { + gl_error("tape module: unable to load DLL for %s", (const char*)modname); return NULL; } c = (CALLBACKS **)DLSYM(lib, "callback"); - if(c) + if ( c ) + { *c = callback; + } // nonfatal ommission ops = fptr->collector = (TAPEOPS*)malloc(sizeof(TAPEOPS)); @@ -211,9 +216,9 @@ EXPORT CLASS *init(CALLBACKS *fntable, void *module, int argc, char *argv[]) /* globals for the tape module*/ #ifdef WIN32 - sprintf(tape_gnuplot_path, "c:/Program Files/GnuPlot/bin/wgnuplot.exe"); + tape_gnuplot_path.format("c:/Program Files/GnuPlot/bin/wgnuplot.exe"); #else - sprintf(tape_gnuplot_path,"/usr/bin/gnuplot"); + tape_gnuplot_path.format("/usr/bin/gnuplot"); #endif gl_global_create("tape::gnuplot_path",PT_char1024,&tape_gnuplot_path,NULL); gl_global_create("tape::flush_interval",PT_int32,&flush_interval,NULL); @@ -420,7 +425,7 @@ EXPORT int check(void) if (gl_findfile(pData->file,NULL,F_OK,fpath,sizeof(fpath))==NULL) { errcount++; - gl_error("player %s (id=%d) uses the file '%s', which cannot be found", obj->name?obj->name:"(unnamed)", obj->id, (char*)pData->file); + gl_error("player %s (id=%d) uses the file '%s', which cannot be found", obj->name?obj->name:"(unnamed)", obj->id, (const char*)pData->file); } } } @@ -434,7 +439,7 @@ EXPORT int check(void) if (gl_findfile(pData->file,NULL,F_OK,fpath,sizeof(fpath))==NULL) { errcount++; - gl_error("shaper %s (id=%d) uses the file '%s', which cannot be found", obj->name?obj->name:"(unnamed)", obj->id, (char*)pData->file); + gl_error("shaper %s (id=%d) uses the file '%s', which cannot be found", obj->name?obj->name:"(unnamed)", obj->id, (const char*)pData->file); } } } @@ -622,7 +627,7 @@ EXPORT SIMULATIONMODE interupdate(MODULE *module, TIMESTAMP t0, unsigned int64 d /* See if we're in service */ if ((obj->in_svc_double <= gl_globaldeltaclock) && (obj->out_svc_double >= gl_globaldeltaclock)) { - strcpy(curr_value,my->next.value); + curr_value = my->next.value; /* post the current value */ if ( t<=clock_val ) @@ -693,7 +698,7 @@ EXPORT SIMULATIONMODE interupdate(MODULE *module, TIMESTAMP t0, unsigned int64 d /* Behave similar to "supersecond" players */ while ( t<=clock_val ) { - gl_set_value(obj->parent,GETADDR(obj->parent,my->target),my->next.value,my->target); /* pointer => int64 */ + gl_set_value(obj->parent,GETADDR(obj->parent,my->target),my->next.value.get_string(),my->target); /* pointer => int64 */ /* read the next value */ player_read(obj); @@ -813,7 +818,7 @@ EXPORT STATUS postupdate(MODULE *module, TIMESTAMP t0, unsigned int64 dt) myrec->last.ns = rec_microseconds; /* Copy in the last value, just in case */ - strcpy(myrec->last.value,value); + myrec->last.value = value; } } /* Defaulted else - not in service */ diff --git a/tape/tape.h b/tape/tape.h index 74720e0b6..7a761b2ab 100644 --- a/tape/tape.h +++ b/tape/tape.h @@ -24,16 +24,18 @@ typedef enum {UNKNOWN=0, PLAYER=1, RECORDER=2, GROUPRECORDER=3} DELTATAPEOBJ; typedef enum {HU_DEFAULT, HU_ALL, HU_NONE} HEADERUNITS; typedef enum {LU_DEFAULT, LU_ALL, LU_NONE} LINEUNITS; -typedef struct s_tape_operations { - int (*open)(void *my, char *fname, char *flags); +typedef struct s_tape_operations +{ + int (*open)(void *my, const char *fname, const char *flags); char *(*read)(void *my,char *buffer,unsigned int size); - int (*write)(void *my, char *timestamp, char *value); + int (*write)(void *my, const char *timestamp, const char *value); int (*rewind)(void *my); void (*close)(void *my); void (*flush)(void *my); } TAPEOPS; -typedef struct s_tape_funcs { +typedef struct s_tape_funcs +{ char256 mode; void *hLib; TAPEOPS *player; @@ -44,29 +46,33 @@ typedef struct s_tape_funcs { struct s_tape_funcs *next; } TAPEFUNCS; -CDECL TAPEFUNCS *get_ftable(char *mode); +CDECL TAPEFUNCS *get_ftable(const char *mode); -typedef struct { +typedef struct +{ const char *name; VARIABLETYPE type; void *addr; double min, max; } VARMAP; -typedef struct s_recobjmap { +typedef struct s_recobjmap +{ OBJECT *obj; PROPERTY prop; // must be an instance double scale; struct s_recobjmap *next; } RECORDER_MAP; -typedef struct s_deltaobj { +typedef struct s_deltaobj +{ OBJECT *obj; DELTATAPEOBJ obj_type; struct s_deltaobj *next; } DELTAOBJ_LIST; -typedef struct s_memory { +typedef struct s_memory +{ GLOBALVAR *buffer; unsigned short index; } MEMORY; @@ -75,7 +81,8 @@ typedef struct s_memory { @addtogroup player @{ **/ -struct player { +struct player +{ /* public */ char1024 file; /**< the name of the player source */ char8 filetype; /**< the type of the player source */ @@ -110,13 +117,15 @@ struct player { @addtogroup shaper @{ **/ -typedef struct s_shapertarget { +typedef struct s_shapertarget +{ double *addr; /**< the address of the target property */ TIMESTAMP ts; /**< the current timestamp to shape for */ double value; /**< the current value to shape */ } SHAPERTARGET; /**< the shaper target structure */ -struct shaper { +struct shaper +{ /* public */ char1024 file; /**< the name of the shaper source */ char8 filetype; /**< the type of the shaper source */ @@ -149,7 +158,8 @@ struct shaper { @addtogroup recorder @{ **/ -struct recorder { +struct recorder +{ /* public */ char1024 file; char8 filetype; @@ -178,7 +188,8 @@ struct recorder { FILETYPE type; HEADERUNITS header_units; LINEUNITS line_units; - union { + union + { FILE *fp; MEMORY *memory; void *tsp; @@ -186,7 +197,8 @@ struct recorder { }; TAPESTATUS status; char8 delim; - struct { + struct + { TIMESTAMP ts; int64 ns; char1024 value; @@ -201,7 +213,8 @@ struct recorder { @addtogroup collector @{ **/ -struct collector { +struct collector +{ /* public */ char1024 file; char8 filetype; @@ -222,7 +235,8 @@ struct collector { /* private */ TAPEOPS *ops; FILETYPE type; - union { + union + { FILE *fp; MEMORY *memory; void *tsp; @@ -230,7 +244,8 @@ struct collector { }; TAPESTATUS status; char8 delim; - struct { + struct + { TIMESTAMP ts; char1024 value; } last; diff --git a/tape/violation_recorder.cpp b/tape/violation_recorder.cpp index 364ae2ce0..18b5f0266 100644 --- a/tape/violation_recorder.cpp +++ b/tape/violation_recorder.cpp @@ -83,7 +83,7 @@ int violation_recorder::init(OBJECT *obj){ gl_error("violation_recorder::init(): no filename defined in strict mode"); return 0; } else { - sprintf(filename, "%s-violation-log.csv", oclass->name); + filename.format("%s-violation-log.csv", oclass->name); gl_warning("violation_recorder::init(): no filename defined, auto-generating '%s'", filename.get_string()); } } @@ -95,7 +95,7 @@ int violation_recorder::init(OBJECT *obj){ gl_error("violation_recorder::init(): no summary defined in strict mode"); return 0; } else { - sprintf(summary, "%s-violation-summary.csv", oclass->name); + summary.format("%s-violation-summary.csv", oclass->name); gl_warning("violation_recorder::init(): no summary defined, auto-generating '%s'", summary.get_string()); } } diff --git a/tape_file/tape_file.cpp b/tape_file/tape_file.cpp index 0a601af61..1ada985d2 100644 --- a/tape_file/tape_file.cpp +++ b/tape_file/tape_file.cpp @@ -63,10 +63,10 @@ EXPORT void *set_option(const char *name, void *pValue) /******************************************************************* * players */ -EXPORT int open_player(struct player *my, char *fname, char *flags) +EXPORT int open_player(struct player *my, const char *fname, const char *flags) { //char *ff = gl_findfile(fname,NULL,FF_READ); - char *ff = fname; + const char *ff = fname; /* "-" means stdin */ my->fp = (strcmp(fname,"-")==0?stdin:(ff?fopen(ff,flags):NULL)); @@ -107,7 +107,7 @@ EXPORT void close_player(struct player *my) #define MAPSIZE(N) ((N-1)/8+1) #define SET(X,B) ((X)[(B)/8]|=(1<<((B)&7))) #define ISSET(X,B) (((X)[(B)/8]&(1<<((B)&7)))==(1<<((B)&7))) -char *file=NULL; +const char *file=NULL; int linenum=0; static int setmap(char *spec, unsigned char *map, int size) { @@ -194,13 +194,13 @@ static unsigned char *weekdaymap(char *spec) return NULL; } -EXPORT int open_shaper(struct shaper *my, char *fname, char *flags) +EXPORT int open_shaper(struct shaper *my, const char *fname, const char *flags) { char line[1024], group[256]="(unnamed)"; float sum=0, load=0, peak=0; float scale[12][31][7][24]; //char *ff = gl_findfile(fname,NULL,FF_READ); - char *ff = fname; + const char *ff = fname; /* clear everything */ memset(scale,0,sizeof(scale)); @@ -350,7 +350,7 @@ EXPORT void close_shaper(struct shaper *my) /******************************************************************* * recorders */ -EXPORT int open_recorder(struct recorder *my, char *fname, char *flags) +EXPORT int open_recorder(struct recorder *my, const char *fname, const char *flags) { time_t now=time(NULL); OBJECT *obj=OBJECTHDR(my); @@ -402,7 +402,7 @@ EXPORT int open_recorder(struct recorder *my, char *fname, char *flags) return 1; } -EXPORT int write_recorder(struct recorder *my, char *timestamp, char *value) +EXPORT int write_recorder(struct recorder *my, const char *timestamp, const char *value) { int count = fprintf(my->fp,"%s,%s\n", timestamp, value); if (csv_keep_clean) fflush(my->fp); @@ -428,7 +428,7 @@ EXPORT void close_recorder(struct recorder *my) /******************************************************************* * histograms */ -EXPORT int open_histogram(histogram *my, char *fname, char *flags) +EXPORT int open_histogram(histogram *my, const char *fname, const char *flags) { time_t now=time(NULL); OBJECT *obj=OBJECTHDR(my); @@ -520,7 +520,7 @@ EXPORT void close_histogram(histogram *my) /******************************************************************* * collectors */ -EXPORT int open_collector(struct collector *my, char *fname, char *flags) +EXPORT int open_collector(struct collector *my, const char *fname, const char *flags) { time_t now=time(NULL); @@ -569,7 +569,7 @@ EXPORT int open_collector(struct collector *my, char *fname, char *flags) return 1; } -EXPORT int write_collector(struct collector *my, char *timestamp, char *value) +EXPORT int write_collector(struct collector *my, const char *timestamp, const char *value) { int count = fprintf(my->fp,"%s,%s\n", timestamp, value); if (csv_keep_clean) fflush(my->fp); diff --git a/tape_file/tape_file.h b/tape_file/tape_file.h index eededf9c2..3e4b03d91 100644 --- a/tape_file/tape_file.h +++ b/tape_file/tape_file.h @@ -4,23 +4,23 @@ #ifndef _TAPE_FILE_H #define _TAPE_FILE_H -EXPORT int open_player(struct player *my, char *fname, char *flags); -EXPORT char *read_player(struct player *my,char *buffer,unsigned int size); +EXPORT int open_player(struct player *my, const char *fname, const char *flags); +EXPORT char *read_player(struct player *my,char *buffer, unsigned int size); EXPORT int rewind_player(struct player *my); EXPORT void close_player(struct player *my); -EXPORT int open_shaper(struct shaper *my, char *fname, char *flags); -EXPORT char *read_shaper(struct shaper *my,char *buffer,unsigned int size); +EXPORT int open_shaper(struct shaper *my, const char *fname, const char *flags); +EXPORT char *read_shaper(struct shaper *my,char *buffer, unsigned int size); EXPORT int rewind_shaper(struct shaper *my); EXPORT void close_shaper(struct shaper *my); -EXPORT int open_recorder(struct recorder *my, char *fname, char *flags); -EXPORT int write_recorder(struct recorder *my, char *timestamp, char *value); +EXPORT int open_recorder(struct recorder *my, const char *fname, const char *flags); +EXPORT int write_recorder(struct recorder *my, const char *timestamp, const char *value); EXPORT void close_recorder(struct recorder *my); EXPORT void flush_recorder(struct recorder *my); -EXPORT int open_collector(struct collector *my, char *fname, char *flags); -EXPORT int write_collector(struct collector *my, char *timestamp, char *value); +EXPORT int open_collector(struct collector *my, const char *fname, const char *flags); +EXPORT int write_collector(struct collector *my, const char *timestamp, const char *value); EXPORT void close_collector(struct collector *my); EXPORT void flush_collector(struct collector *my); diff --git a/tape_plot/tape_plot.cpp b/tape_plot/tape_plot.cpp index a57e01d69..b73a6ed56 100644 --- a/tape_plot/tape_plot.cpp +++ b/tape_plot/tape_plot.cpp @@ -271,7 +271,7 @@ EXPORT void close_shaper(struct shaper *my) * recorders */ -EXPORT void write_default_plot_commands_rec(struct recorder *my, char32 extension) +EXPORT void write_default_plot_commands_rec(struct recorder *my, char* extension) { char fname[sizeof(char32)]; char type[sizeof(char32)]; @@ -292,7 +292,7 @@ EXPORT void write_default_plot_commands_rec(struct recorder *my, char32 extensio j= strlen(my->columns)>0 ? 0: fprintf(my->fp, "set xdata time;\n"); fprintf(my->fp, "set datafile separator \",\";\n"); if(my->output != SCR){ - fprintf(my->fp, "set output \"%s.%s\"; \n", fname,extension.get_string()); + fprintf(my->fp, "set output \"%s.%s\"; \n", fname, extension); } fprintf(my->fp, "show output; \n"); fprintf(my->fp, "set timefmt \"%%Y-%%m-%%d %%H:%%M:%%S\";\n"); @@ -517,7 +517,7 @@ EXPORT void close_recorder(struct recorder *my) * collectors */ -EXPORT void write_default_plot_commands_col(struct collector *my, char32 extension) +EXPORT void write_default_plot_commands_col(struct collector *my, char* extension) { char fname[sizeof(char32)]; char type[sizeof(char32)]; @@ -533,7 +533,7 @@ EXPORT void write_default_plot_commands_col(struct collector *my, char32 extensi if (my->plotcommands[0]=='\0' || strcmp(my->plotcommands,"")==0) { j= strlen(my->columns)>0 ? 0: fprintf(my->fp, "set xdata time;\n"); fprintf(my->fp, "set datafile separator \",\";\n"); - fprintf(my->fp, "set output \"%s.%s\"; \n", fname,extension.get_string()); + fprintf(my->fp, "set output \"%s.%s\"; \n", fname, extension); fprintf(my->fp, "show output; \n"); fprintf(my->fp, "set timefmt \"%%Y-%%m-%%d %%H:%%M:%%S\";\n"); j = strlen(my->columns)>0 ? 0: fprintf(my->fp, "plot \'-\' using 1:2 with lines;\n"); diff --git a/tape_plot/tape_plot.h b/tape_plot/tape_plot.h index c05445781..45c60c47b 100644 --- a/tape_plot/tape_plot.h +++ b/tape_plot/tape_plot.h @@ -17,7 +17,7 @@ EXPORT void close_shaper(struct shaper *my); EXPORT int open_recorder(struct recorder *my, char *fname, char *flags); EXPORT int write_recorder(struct recorder *my, char *timestamp, char *value); EXPORT void close_recorder(struct recorder *my); -EXPORT void write_default_plot_commands_rec(struct recorder *my, char32 extension); +EXPORT void write_default_plot_commands_rec(struct recorder *my, char* extension); EXPORT void splitString(char *propertyStr, char *columns[]); EXPORT void set_recorder(struct recorder *my); EXPORT void close_recorder_wrapper(void); @@ -25,7 +25,7 @@ EXPORT void close_recorder_wrapper(void); EXPORT int open_collector(struct collector *my, char *fname, char *flags); EXPORT int write_collector(struct collector *my, char *timestamp, char *value); EXPORT void close_collector(struct collector *my); -EXPORT void write_default_plot_commands_col(struct collector *my, char32 extension); +EXPORT void write_default_plot_commands_col(struct collector *my, char* extension); struct recorder *global_rec; #endif From f0b2381b00b0bf73d02a000a2396106c63728150 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Tue, 25 Aug 2020 21:48:18 -0700 Subject: [PATCH 003/117] Fix globals to use varchar where possible --- gldcore/cmdarg.cpp | 63 ++++++++++++++++++------------- gldcore/daemon.cpp | 14 ++++--- gldcore/debug.cpp | 2 +- gldcore/deltamode.cpp | 10 +++-- gldcore/environment.cpp | 8 ++-- gldcore/exec.cpp | 18 +++++---- gldcore/globals.cpp | 25 ++++++++----- gldcore/globals.h | 68 +++++++++++++++++----------------- gldcore/gui.cpp | 2 +- gldcore/instance.cpp | 2 +- gldcore/instance_slave.cpp | 4 +- gldcore/job.cpp | 4 +- gldcore/kml.cpp | 2 +- gldcore/link/python/python.cpp | 2 +- gldcore/load.cpp | 25 +++++++------ gldcore/main.cpp | 38 +++++++++++-------- gldcore/module.cpp | 6 +-- gldcore/object.cpp | 2 +- gldcore/output.cpp | 2 +- gldcore/property.h | 8 ++-- gldcore/sanitize.cpp | 6 +-- gldcore/save.cpp | 7 ++-- gldcore/server.cpp | 2 +- gldcore/setup.cpp | 3 +- gldcore/timestamp.cpp | 2 +- gldcore/unit.cpp | 2 +- gldcore/validate.cpp | 12 +++--- reliability/eventgen.cpp | 2 +- tape_plot/tape_plot.cpp | 6 +-- 29 files changed, 193 insertions(+), 154 deletions(-) diff --git a/gldcore/cmdarg.cpp b/gldcore/cmdarg.cpp index 9e30a0d8e..e900d98c2 100644 --- a/gldcore/cmdarg.cpp +++ b/gldcore/cmdarg.cpp @@ -259,7 +259,7 @@ STATUS GldCmdarg::no_cmdargs(void) output_message("opening html page '%s'", htmlfile); sprintf(cmd,"start %s file:///%s", global_browser, htmlfile); #elif defined(MACOSX) - sprintf(cmd,"open -a %s %s", global_browser, htmlfile); + sprintf(cmd,"open -a %s %s", (const char*)global_browser, htmlfile); #else sprintf(cmd,"%s '%s' & ps -p $! >/dev/null", global_browser, htmlfile); #endif @@ -273,12 +273,12 @@ STATUS GldCmdarg::no_cmdargs(void) { IN_MYCONTEXT output_verbose("starting interface"); } - strcpy(global_environment,"server"); + global_environment = "server"; global_mainloopstate = MLS_PAUSED; return SUCCESS; } else - output_error("default html file '%s' not found (workdir='%s')", "gridlabd.htm",global_workdir); + output_error("default html file '%s' not found (workdir='%s')", "gridlabd.htm",(const char*)global_workdir); return SUCCESS; } @@ -504,7 +504,8 @@ int GldCmdarg::server_inaddr(int argc, const char *argv[]) { if ( argc>1 ) { - strncpy(global_server_inaddr,(argc--,*++argv),sizeof(global_server_inaddr)-1); + argc--; + global_server_inaddr = *++argv; return 1; } else @@ -864,10 +865,14 @@ DEPRECATED static int pidfile(void *main, int argc, const char *argv[]) int GldCmdarg::pidfile(int argc, const char *argv[]) { const char *filename = strchr(*argv,'='); - if (filename==NULL) - strcpy(global_pidfile,"gridlabd.pid"); + if ( filename == NULL ) + { + global_pidfile = "gridlabd.pid"; + } else - strcpy(global_pidfile,filename+1); + { + global_pidfile = filename+1; + } return 0; } @@ -878,10 +883,14 @@ DEPRECATED static int kml(void *main, int argc, const char *argv[]) int GldCmdarg::kml(int argc, const char *argv[]) { const char *filename = strchr(*argv,'='); - if (filename) - strcpy(global_kmlfile,filename+1); + if ( filename != NULL ) + { + global_kmlfile = filename + 1; + } else - strcpy(global_kmlfile,"gridlabd.kml"); + { + global_kmlfile = "gridlabd.kml"; + } return 0; } @@ -1332,7 +1341,8 @@ int GldCmdarg::output(int argc, const char *argv[]) { if (argc>1) { - strcpy(global_savefile,(argc--,*++argv)); + argc--; + global_savefile = *++argv; return 1; } else @@ -1354,7 +1364,10 @@ DEPRECATED static int environment(void *main, int argc, const char *argv[]) int GldCmdarg::environment(int argc, const char *argv[]) { if (argc>1) - strcpy(global_environment,(argc--,*++argv)); + { + argc--; + global_environment = *++argv; + } else { output_fatal("environment not specified"); @@ -1467,7 +1480,7 @@ DEPRECATED static int server(void *main, int argc, const char *argv[]) } int GldCmdarg::server(int argc, const char *argv[]) { - strcpy(global_environment,"server"); + global_environment = "server"; return 0; } @@ -1550,7 +1563,7 @@ int GldCmdarg::info(int argc, const char *argv[]) #ifdef WIN32 sprintf(cmd,"start %s \"%s%s\"", global_browser, global_infourl, argv[1]); #elif defined(MACOSX) - sprintf(cmd,"open -a %s \"%s%s\"", global_browser, global_infourl, argv[1]); + sprintf(cmd,"open -a %s \"%s%s\"", (const char*)global_browser, (const char*)global_infourl, argv[1]); #else sprintf(cmd,"%s \"%s%s\" & ps -p $! >/dev/null", global_browser, global_infourl, argv[1]); #endif @@ -1598,7 +1611,7 @@ int GldCmdarg::slave(int argc, const char *argv[]) output_error("unable to parse slave parameters"); } - strncpy(global_master,host,sizeof(global_master)-1); + global_master = host; if ( strcmp(global_master,"localhost")==0 ){ sscanf(port,"%" FMT_INT64 "x",&global_master_port); /* port is actual mmap/shmem */ global_multirun_connection = MRC_MEM; @@ -1611,11 +1624,11 @@ int GldCmdarg::slave(int argc, const char *argv[]) if ( FAILED == instance_slave_init() ) { - output_error("slave instance init failed for master '%s' connection '%" FMT_INT64 "x'", global_master, global_master_port); + output_error("slave instance init failed for master '%s' connection '%" FMT_INT64 "x'", (const char*)global_master, global_master_port); return CMDERR; } - IN_MYCONTEXT output_verbose("slave instance for master '%s' using connection '%" FMT_INT64 "x' started ok", global_master, global_master_port); + IN_MYCONTEXT output_verbose("slave instance for master '%s' using connection '%" FMT_INT64 "x' started ok", (const char*)global_master, global_master_port); return 1; } @@ -1830,15 +1843,15 @@ int GldCmdarg::workdir(int argc, const char *argv[]) output_error("--workdir requires a directory argument"); return CMDERR; } - strcpy(global_workdir,argv[1]); + global_workdir = argv[1]; if ( chdir(global_workdir)!=0 ) { - output_error("%s is not a valid workdir", global_workdir); + output_error("%s is not a valid workdir", (const char*)global_workdir); return CMDERR; } - if ( getcwd(global_workdir,sizeof(global_workdir)) ) + if ( getcwd(global_workdir.resize(PATH_MAX),PATH_MAX+1) ) { - IN_MYCONTEXT output_verbose("working directory is '%s'", global_workdir); + IN_MYCONTEXT output_verbose("working directory is '%s'", (const char*)global_workdir); return 1; } else @@ -1916,18 +1929,18 @@ int GldCmdarg::formats(int argc, const char *argv[]) cout << "\t\"glm\" : {" << endl; cout << "\t\t\"json\" : {" << endl; - cout << "\t\t\t\"run\" : \"" << global_execname << " {inputfile} -o {outputfile}\"" << endl; + cout << "\t\t\t\"run\" : \"" << (const char*)global_execname << " {inputfile} -o {outputfile}\"" << endl; cout << "\t\t}" << endl; cout << "\t}," << endl; // TODO: use a directory listing to get all available converters cout << "\t\"json\" : {" << endl; cout << "\t\t\"glm\" : {" << endl; - cout << "\t\t\t\"run\" : \"" << global_datadir << "/json2glm.py {inputfile} -o {outputfile}\"" << endl; + cout << "\t\t\t\"run\" : \"" << (const char*)global_datadir << "/json2glm.py {inputfile} -o {outputfile}\"" << endl; cout << "\t\t}," << endl; cout << "\t\t\"png\" : {" << endl; - cout << "\t\t\t\"run\" : \"" << global_datadir << "/json2png.py {inputfile} -o {outputfile}\"" << endl; + cout << "\t\t\t\"run\" : \"" << (const char*)global_datadir << "/json2png.py {inputfile} -o {outputfile}\"" << endl; cout << "\t\t\t\"type\" : [" << endl; cout << "\t\t\t\t\"summary\"," << endl; cout << "\t\t\t\t\"profile\"" << endl; @@ -2306,7 +2319,7 @@ STATUS GldCmdarg::load(int argc,const char *argv[]) /* preserve name of first model only */ if (strcmp(global_modelname,"")==0) { - strcpy(global_modelname,*argv); + global_modelname = *argv; } if ( ! instance->load_file(*argv) ) diff --git a/gldcore/daemon.cpp b/gldcore/daemon.cpp index 327eeaafe..285cb980e 100644 --- a/gldcore/daemon.cpp +++ b/gldcore/daemon.cpp @@ -267,18 +267,20 @@ static int daemon_run(int sockfd) int argc = parse_command(command, argv+1, MAXARGS-1)+1; // dump - strcpy(global_command_line,""); + global_command_line = ""; for ( int n = 0 ; n < argc ; n++ ) { if ( n > 0 ) - strcat(global_command_line," "); - strcat(global_command_line,argv[n]); + { + global_command_line.copy_from(" ",-1); + } + global_command_line.copy_from(argv[n],-1); } if ( argc > 1 && cmdarg_load(argc,(const char**)argv) == SUCCESS ) { // write result - daemon_log("running command [%s] on socket %d", global_command_line, sockfd); + daemon_log("running command [%s] on socket %d", (const char*)global_command_line, sockfd); delete argv[0]; return XC_SUCCESS; } @@ -311,7 +313,9 @@ static void daemon_process(void) daemon_log("***"); daemon_log("*** new daemon starting"); daemon_log("***"); - daemon_log("gridlabd version %d.%d.%d-%d (%s)",global_version_major,global_version_minor,global_version_patch,global_version_build,global_version_branch); + daemon_log("gridlabd version %d.%d.%d-%d (%s)", + global_version_major, global_version_minor, global_version_patch, + global_version_build, (const char*)global_version_branch); daemon_log("workdir is '%s'", workdir); daemon_log("daemon pid is %d",getpid()); atexit(daemon_cleanup); diff --git a/gldcore/debug.cpp b/gldcore/debug.cpp index 8f01d3ff7..07d8840d8 100644 --- a/gldcore/debug.cpp +++ b/gldcore/debug.cpp @@ -1196,7 +1196,7 @@ DEBUGCMD exec_debug_cmd(struct sync_data *data, /**< the current sync status of } else if (strncmp(cmd,"gdb",3)==0) { - if (exec("gdb --quiet %s --pid=%d",global_execname,global_process_id)<=0) + if (exec("gdb --quiet %s --pid=%d",(const char*)global_execname,global_process_id)<=0) output_debug("unable to start gdb"); } else if (strncmp(cmd,"help",max((size_t)1,strlen(cmd)))==0) diff --git a/gldcore/deltamode.cpp b/gldcore/deltamode.cpp index 781ab315e..5e33dc7d0 100644 --- a/gldcore/deltamode.cpp +++ b/gldcore/deltamode.cpp @@ -78,14 +78,16 @@ STATUS delta_init(void) } /* build qualified module list */ delta_modulecount = 0; - global_deltamode_updateorder[0]='\0'; + global_deltamode_updateorder = ""; for ( module=module_get_first() ; module!=NULL ; module=module_get_next(module) ) { if ( 0 != module->deltadesired ) { - if ( delta_modulecount>0 ) - strcat(global_deltamode_updateorder,","); - strcat(global_deltamode_updateorder,module->name); + if ( delta_modulecount > 0 ) + { + global_deltamode_updateorder.copy_from(",",-1); + } + global_deltamode_updateorder.copy_from(module->name,-1); delta_modulelist[delta_modulecount++] = module; } } diff --git a/gldcore/environment.cpp b/gldcore/environment.cpp index cfd78d2e9..9e5de70e7 100644 --- a/gldcore/environment.cpp +++ b/gldcore/environment.cpp @@ -26,7 +26,7 @@ STATUS environment_start(int argc, /**< the number of arguments to pass to the e { if (gui_get_root()) { - strcpy(global_environment,"gui"); + global_environment = "gui"; goto UseGui; } @@ -45,7 +45,7 @@ STATUS environment_start(int argc, /**< the number of arguments to pass to the e if (global_dumpfile[0]!='\0') { if (!saveall(global_dumpfile)) - output_error("dump to '%s' failed", global_dumpfile); + output_error("dump to '%s' failed", (const char*)global_dumpfile); /* TROUBLESHOOT An attempt to create a dump file failed. This message should be preceded by a more detailed message explaining why if failed. @@ -53,7 +53,7 @@ STATUS environment_start(int argc, /**< the number of arguments to pass to the e */ else { - IN_MYCONTEXT output_debug("dump to '%s' complete", global_dumpfile); + IN_MYCONTEXT output_debug("dump to '%s' complete", (const char*)global_dumpfile); } } return FAILED; @@ -112,7 +112,7 @@ STATUS environment_start(int argc, /**< the number of arguments to pass to the e } else { - output_fatal("%s environment not recognized or supported",global_environment); + output_fatal("%s environment not recognized or supported", (const char*)global_environment); /* TROUBLESHOOT The environment specified isn't supported. Currently only the batch environment is normally supported, although diff --git a/gldcore/exec.cpp b/gldcore/exec.cpp index 0eec106b8..f9c6af36a 100644 --- a/gldcore/exec.cpp +++ b/gldcore/exec.cpp @@ -677,15 +677,19 @@ void GldExec::do_checkpoint(void) /* default checkpoint filename */ if ( strcmp(global_checkpoint_file,"")==0 ) { - char *ext; - /* use the model name by default */ - strcpy(global_checkpoint_file, global_modelname); - ext = strrchr(global_checkpoint_file,'.'); + global_checkpoint_file = global_modelname; + int pos = global_checkpoint_file.findrev('.'); /* trim off the extension, if any */ - if ( ext!=NULL && ( strcmp(ext,".glm")==0 || strcmp(ext,".xml")==0 ) ) - *ext = '\0'; + if ( pos >= 0 ) + { + varchar ext(global_checkpoint_file.substr(pos)); + if ( ext == ".glm" || ext == "xlm" ) + { + global_checkpoint_file.set_at(pos,'\0'); + } + } } /* delete old checkpoint file if not desired */ @@ -693,7 +697,7 @@ void GldExec::do_checkpoint(void) unlink(fn); /* create current checkpoint save filename */ - sprintf(fn,"%s.%d",global_checkpoint_file,global_checkpoint_seqnum++); + sprintf(fn,"%s.%d",(const char*)global_checkpoint_file,global_checkpoint_seqnum++); fp = fopen(fn,"w"); if ( fp==NULL ) output_error("unable to open checkpoint file '%s' for writing"); diff --git a/gldcore/globals.cpp b/gldcore/globals.cpp index 934db245a..2df77a59d 100644 --- a/gldcore/globals.cpp +++ b/gldcore/globals.cpp @@ -362,26 +362,29 @@ DEPRECATED static void buildtmp(void) { const char *tmp, *home, *user; - if ((tmp = getenv("GLTEMP"))) { - snprintf(global_tmp, sizeof(global_tmp), "%s", tmp); + if ( (tmp = getenv("GLTEMP")) != NULL ) + { + global_tmp.format("%s",tmp); return; } - if ((home = getenv(HOMEVAR))) { + if ( (home = getenv(HOMEVAR)) != NULL ) + { #ifdef WIN32 char *drive; - if (!(drive = getenv("HOMEDRIVE"))) + if ( ! (drive=getenv("HOMEDRIVE")) ) + { drive = ""; - snprintf(global_tmp, sizeof(global_tmp), - "%s%s\\Local Settings\\Temp\\gridlabd", drive, home); + } + global_tmp.format("%s%s\\Local Settings\\Temp\\gridlabd", drive, home); #else - snprintf(global_tmp, sizeof(global_tmp), "%s/.gridlabd/tmp", home); + global_tmp.format("%s/.gridlabd/tmp", home); #endif return; } if (!(tmp = getenv("TMP")) && !(tmp = getenv("TEMP"))) tmp = TMP; user = getenv(USERVAR); - snprintf(global_tmp, sizeof(global_tmp), "%s%s%s" PATHSEP PACKAGE, + global_tmp.format("%s%s%s" PATHSEP PACKAGE, tmp, (user ? PATHSEP : ""), (user ? user : "")); } @@ -398,11 +401,13 @@ STATUS GldGlobals::init(void) global_version_minor = version_minor(); global_version_patch = version_patch(); global_version_build = version_build(); - strncpy(global_version_branch,version_branch(),sizeof(global_version_branch)); + global_version_branch = version_branch(); global_datadir = global_execdir; size_t bin = global_datadir.find("/bin"); global_datadir.copy_from("/share/gridlabd",bin); - sprintf(global_version,"%d.%d.%d-%d-%s",global_version_major,global_version_minor,global_version_patch,global_version_build,global_version_branch); + global_version.format("%d.%d.%d-%d-%s", + global_version_major,global_version_minor,global_version_patch, + global_version_build,(const char*)global_version_branch); for ( i = 0 ; i < sizeof(map) / sizeof(map[0]) ; i++ ) { diff --git a/gldcore/globals.h b/gldcore/globals.h index 3177f839f..1d2876ed9 100644 --- a/gldcore/globals.h +++ b/gldcore/globals.h @@ -203,16 +203,16 @@ GLOBAL unsigned global_version_patch INIT(REV_PATCH); /**< The software's patch GLOBAL unsigned global_version_build INIT(BUILDNUM); /**< The software's build number */ /* Variable: global_version_branch */ -GLOBAL char global_version_branch[256] INIT(BRANCH); /**< The software's branch designator */ +GLOBAL varchar global_version_branch INIT(BRANCH); /**< The software's branch designator */ /* Variable: global_version */ -GLOBAL char global_version[1024] INIT(""); /**< The software's official version designation */ +GLOBAL varchar global_version INIT(""); /**< The software's official version designation */ /* Variable: global_command_line */ -GLOBAL char global_command_line[1024]; /**< The current command-line */ +GLOBAL varchar global_command_line INIT(""); /**< The current command-line */ /* Variable: global_environment */ -GLOBAL char global_environment[1024] INIT("batch"); /**< The processing environment in use */ +GLOBAL varchar global_environment INIT("batch"); /**< The processing environment in use */ /* Variable: global_quiet_mode */ GLOBAL int global_quiet_mode INIT(FALSE); /**< The quiet mode flag */ @@ -242,13 +242,13 @@ GLOBAL double global_progress INIT(0.0); /**< Progress fraction */ GLOBAL unsigned global_iteration_limit INIT(100); /**< The global iteration limit */ /* Variable: global_workdir */ -GLOBAL char global_workdir[1024] INIT("."); /**< The current working directory */ +GLOBAL varchar global_workdir INIT("."); /**< The current working directory */ /* Variable: global_dumpfile */ -GLOBAL char global_dumpfile[1024] INIT("gridlabd.json"); /**< The dump file name */ +GLOBAL varchar global_dumpfile INIT("gridlabd.json"); /**< The dump file name */ /* Variable: global_savefile */ -GLOBAL char global_savefile[1024] INIT(""); /**< The save file name */ +GLOBAL varchar global_savefile INIT(""); /**< The save file name */ /* Variable: global_dumpall */ GLOBAL int global_dumpall INIT(FALSE); /**< Flags all modules to dump data after run complete */ @@ -267,28 +267,28 @@ GLOBAL int global_profiler INIT(0); /**< Flags the profiler to process class per GLOBAL int global_pauseatexit INIT(0); /**< Enable a pause for user input after exit */ /* Variable: global_testoutputfile */ -GLOBAL char global_testoutputfile[1024] INIT("test.txt"); /**< Specifies the test output file */ +GLOBAL varchar global_testoutputfile INIT("test.txt"); /**< Specifies the test output file */ /* Variable: global_xml_encoding */ GLOBAL int global_xml_encoding INIT(8); /**< Specifies XML encoding (default is 8) */ /* Variable: global_pidfile */ -GLOBAL char global_pidfile[1024] INIT(""); /**< Specifies that a process id file should be created */ +GLOBAL varchar global_pidfile INIT(""); /**< Specifies that a process id file should be created */ /* Variable: global_no_balance */ -GLOBAL unsigned char global_no_balance INIT(FALSE); +GLOBAL bool global_no_balance INIT(FALSE); /* Variable: global_kmlfile */ -GLOBAL char global_kmlfile[1024] INIT(""); /**< Specifies KML file to dump */ +GLOBAL varchar global_kmlfile INIT(""); /**< Specifies KML file to dump */ /* Variable: global_kmlhost */ -GLOBAL char global_kmlhost[1024] INIT("https://raw.githubusercontent.com/slacgismo/gridlabd/master/gldcore/rt"); /**< Specifies the KML image library server */ +GLOBAL varchar global_kmlhost INIT("https://raw.githubusercontent.com/slacgismo/gridlabd/master/gldcore/rt"); /**< Specifies the KML image library server */ /* Variable: global_modelname */ -GLOBAL char global_modelname[1024] INIT(""); /**< Name of the current model */ +GLOBAL varchar global_modelname INIT(""); /**< Name of the current model */ /* Variable: global_execdir */ -GLOBAL char global_execdir[1024] INIT(""); /**< Path to folder containing installed application files */ +GLOBAL varchar global_execdir INIT(""); /**< Path to folder containing installed application files */ /* Variable: global_strictnames */ GLOBAL bool global_strictnames INIT(true); /**< Enforce strict global naming (prevents globals from being implicitly created by assignment) */ @@ -300,7 +300,7 @@ GLOBAL bool global_xmlstrict INIT(true); /**< Causes XML I/O to use strict XML d GLOBAL int global_relax_naming_rules INIT(0); /**< Causes the error to relax to a warning when object names start with numbers or special characters */ /* Variable: global_urlbase */ -GLOBAL char global_urlbase[1024] /**< default urlbase used for online resources */ +GLOBAL varchar global_urlbase /**< default urlbase used for online resources */ #ifdef _DEBUG INIT("./"); #else @@ -314,13 +314,13 @@ GLOBAL unsigned int global_randomseed INIT(0); /**< random number seed (default GLOBAL unsigned int global_randomstate INIT(0); /* Variable: global_include */ -GLOBAL char global_include[1024] INIT(""); /**< include path for models and code headers */ +GLOBAL varchar global_include INIT(""); /**< include path for models and code headers */ /* Variable: global_gdb */ GLOBAL int global_gdb INIT(0); /**< select gdb debugger */ /* Variable: global_trace */ -GLOBAL char global_trace[1024] INIT(""); /**< comma separate list of runtime calls that will be traced */ +GLOBAL varchar global_trace INIT(""); /**< comma separate list of runtime calls that will be traced */ /* Variable: global_gdb_window */ GLOBAL int global_gdb_window INIT(0); /**< start gdb in a separate window */ @@ -329,10 +329,10 @@ GLOBAL int global_gdb_window INIT(0); /**< start gdb in a separate window */ GLOBAL int global_process_id INIT(0); /**< the main process id */ /* Variable: global_execname*/ -GLOBAL char global_execname[1024] INIT(""); /**< the main program full path */ +GLOBAL varchar global_execname INIT(""); /**< the main program full path */ /* Variable: global_tmp */ -GLOBAL char global_tmp[1024] /**< location for temp files */ +GLOBAL varchar global_tmp /**< location for temp files */ #ifdef WIN32 INIT("C:\\WINDOWS\\TEMP"); #else @@ -371,16 +371,16 @@ GLOBAL TIMESTAMP global_starttime INIT(946684800); /**< The simulation starting GLOBAL TIMESTAMP global_stoptime INIT(TS_NEVER); /**< The simulation stop time (default is 1 year after start time) */ /* Variable: global_double_format */ -GLOBAL char global_double_format[32] INIT("%+lg"); /**< the format to use when processing real numbers */ +GLOBAL varchar global_double_format INIT("%+lg"); /**< the format to use when processing real numbers */ /* Variable: global_complex_format */ -GLOBAL char global_complex_format[256] INIT("%+lg%+lg%c"); /**< the format to use when processing complex numbers */ +GLOBAL varchar global_complex_format INIT("%+lg%+lg%c"); /**< the format to use when processing complex numbers */ /* Variable: global_object_format */ -GLOBAL char global_object_format[32] INIT("%s:%d"); +GLOBAL varchar global_object_format INIT("%s:%d"); /* Variable: global_object_scan */ -GLOBAL char global_object_scan[32] INIT("%[^:]:%d"); /**< the format to use when scanning for object ids */ +GLOBAL varchar global_object_scan INIT("%[^:]:%d"); /**< the format to use when scanning for object ids */ /* Variable: global_minimum_timestep */ GLOBAL int global_minimum_timestep INIT(1); /**< the minimum timestep allowed */ @@ -389,7 +389,7 @@ GLOBAL int global_minimum_timestep INIT(1); /**< the minimum timestep allowed */ GLOBAL int global_maximum_synctime INIT(60); /**< the maximum time allotted to any single sync call */ /* Variable: global_platform */ -GLOBAL char global_platform[8] /**< the host operating platform */ +GLOBAL varchar global_platform /**< the host operating platform */ #ifdef WIN32 INIT("WINDOWS"); #elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 @@ -415,7 +415,7 @@ GLOBAL double global_realtime_metric INIT(0); /**< realtime performance metric ( #ifdef _DEBUG /** @todo: consider making global_sync_dumpfile always available */ /* Variable: global_sync_dumpfile */ -GLOBAL char global_sync_dumpfile[1024] INIT(""); /**< enable sync event dump file */ +GLOBAL varchar global_sync_dumpfile INIT(""); /**< enable sync event dump file */ #endif /* Variable: global_streaming_io_enabled */ @@ -434,13 +434,13 @@ GLOBAL int global_initializeonly INIT(0); /**< flag to enable initialize-only op GLOBAL int global_server_portnum INIT(0); /**< port used in server mode (6267 was assigned by IANA Dec 2010) */ /* Variable: global_server_inaddr */ -GLOBAL char global_server_inaddr[1024] INIT(""); /**< interface address to bind server to */ +GLOBAL varchar global_server_inaddr INIT(""); /**< interface address to bind server to */ /* Variable: global_client_allowed */ -GLOBAL char global_client_allowed[1024] INIT(""); /**< internet address from which clients can be accepted */ +GLOBAL varchar global_client_allowed INIT(""); /**< internet address from which clients can be accepted */ /* Variable: global_browser */ -GLOBAL char global_browser[1024] /**< default browser to use for GUI */ +GLOBAL varchar global_browser /**< default browser to use for GUI */ #ifdef WIN32 INIT("iexplore"); #elif defined(MACOSX) @@ -465,7 +465,7 @@ GLOBAL int global_show_progress INIT(1); GLOBAL int global_checkpoint_type INIT(CPT_NONE); /**< checkpoint type determines whether and how checkpoints are used */ /* Variable: global_checkpoint_file */ -GLOBAL char global_checkpoint_file[1024] INIT(""); /**< checkpoint file name is base name used for checkpoint save files */ +GLOBAL varchar global_checkpoint_file INIT(""); /**< checkpoint file name is base name used for checkpoint save files */ /* Variable: global_checkpoint_seqnum */ GLOBAL int global_checkpoint_seqnum INIT(0); /**< checkpoint sequence file number */ @@ -497,13 +497,13 @@ GLOBAL int global_mainloopstate INIT(MLS_INIT); /**< main loop processing state GLOBAL TIMESTAMP global_mainlooppauseat INIT(TS_NEVER); /**< time at which to pause main loop */ /* Variable: */ -GLOBAL char global_infourl[1024] INIT("http://docs.gridlabd.us/index.html?owner=slacgismo&project=gridlabd&search="); /**< URL for info calls */ +GLOBAL varchar global_infourl INIT("http://docs.gridlabd.us/index.html?owner=slacgismo&project=gridlabd&search="); /**< URL for info calls */ /* Variable: */ -GLOBAL char global_hostname[1024] INIT("localhost"); /**< machine hostname */ +GLOBAL varchar global_hostname INIT("localhost"); /**< machine hostname */ /* Variable: */ -GLOBAL char global_hostaddr[32] INIT("127.0.0.1"); /**< machine ip addr */ +GLOBAL varchar global_hostaddr INIT("127.0.0.1"); /**< machine ip addr */ /* Variable: */ GLOBAL int global_autostartgui INIT(1); /**< autostart GUI when no command args are given */ @@ -543,7 +543,7 @@ GLOBAL DELTAT global_deltaclock INIT(0); /**< the cumulative delta runtime with GLOBAL double global_delta_curr_clock INIT(0.0); /**< Deltamode clock offset by main clock (not just delta offset) */ /* Variable: */ -GLOBAL char global_deltamode_updateorder[1025] INIT(""); /**< the order in which modules are updated */ +GLOBAL varchar global_deltamode_updateorder INIT(""); /**< the order in which modules are updated */ /* Variable: */ GLOBAL unsigned int global_deltamode_iteration_limit INIT(10); /**< Global iteration limit for each delta timestep (object and interupdate calls) */ @@ -555,7 +555,7 @@ GLOBAL unsigned int global_deltamode_forced_extra_timesteps INIT(0); /**< Deltam GLOBAL bool global_deltamode_forced_always INIT(false); /**< Deltamode flag - prevents exit from deltamode (no SM_EVENT) -- mainly for debugging purposes */ /* Variable: */ -GLOBAL char global_master[1024] INIT(""); /**< master hostname */ +GLOBAL varchar global_master INIT(""); /**< master hostname */ /* Variable: */ GLOBAL unsigned int64 global_master_port INIT(0); /**< master port/mmap/shmem info */ diff --git a/gldcore/gui.cpp b/gldcore/gui.cpp index 17102ddfe..b7ef44608 100644 --- a/gldcore/gui.cpp +++ b/gldcore/gui.cpp @@ -1229,7 +1229,7 @@ STATUS GldGui::startup(int argc, const char *argv[]) #ifdef WIN32 sprintf(cmd,"start %s http://localhost:%d/gui/", global_browser, global_server_portnum); #else - sprintf(cmd,"%s http://localhost:%d/gui/ & ps -p $! >/dev/null", global_browser, global_server_portnum); + sprintf(cmd,"%s http://localhost:%d/gui/ & ps -p $! >/dev/null", (const char*)global_browser, global_server_portnum); #endif if (system(cmd)!=0) { diff --git a/gldcore/instance.cpp b/gldcore/instance.cpp index 015be358b..45747bfac 100644 --- a/gldcore/instance.cpp +++ b/gldcore/instance.cpp @@ -498,7 +498,7 @@ STATUS instance_init(instance *inst) /* check for looping model */ if (strcmp(inst->model,global_modelname)==0) { - output_error("instance_init(): slave instance model '%s' is the same as the master model '%'", inst->model,global_modelname); + output_error("instance_init(): slave instance model '%s' is the same as the master model '%'", inst->model,(const char*)global_modelname); return FAILED; } diff --git a/gldcore/instance_slave.cpp b/gldcore/instance_slave.cpp index 09fdefd9b..6fbd55259 100644 --- a/gldcore/instance_slave.cpp +++ b/gldcore/instance_slave.cpp @@ -649,14 +649,14 @@ STATUS instance_slave_init_socket(){ memset(&connaddr, 0, sizeof(connaddr)); connaddr.sin_addr.s_addr = inet_addr(global_master); if(INADDR_NONE == connaddr.sin_addr.s_addr){ - output_fatal("instance_slave_init_socket(): unrecognized inet_addr \'%s\'", global_master); + output_fatal("instance_slave_init_socket(): unrecognized inet_addr \'%s\'", (const char*)global_master); return FAILED; } connaddr.sin_port = htons((unsigned short)global_master_port); connaddr.sin_family = AF_INET; rv = connect(local_inst.sockfd, (struct sockaddr *)&connaddr, sizeof(connaddr)); if(0 != rv){ - output_fatal("instance_slave_init_socket(): could not connect to %s:%d", global_master, global_master_port); + output_fatal("instance_slave_init_socket(): could not connect to %s:%d", (const char*)global_master, global_master_port); #ifdef WIN32 output_error("WSA error: %d", WSAGetLastError()); #else diff --git a/gldcore/job.cpp b/gldcore/job.cpp index 281487b12..b1ac6be52 100644 --- a/gldcore/job.cpp +++ b/gldcore/job.cpp @@ -327,7 +327,7 @@ int job(void *main, int argc, const char *argv[]) if ( !redirect_found ) strcat(job_cmdargs," --redirect all"); global_suppress_repeat_messages = 0; - output_message("Starting job in directory '%s'", global_workdir); + output_message("Starting job in directory '%s'", (const char*)global_workdir); char var[64]; if ( global_getvar("clean",var,sizeof(var))!=NULL && atoi(var)!=0 ) clean = true; @@ -338,7 +338,7 @@ int job(void *main, int argc, const char *argv[]) unsigned int count = (int)process_dir(global_workdir); if ( count==0 ) { - output_warning("no models found to process job in workdir '%s'", global_workdir); + output_warning("no models found to process job in workdir '%s'", (const char*)global_workdir); exit(XC_RUNERR); } diff --git a/gldcore/kml.cpp b/gldcore/kml.cpp index c7950c3d8..c4852f995 100644 --- a/gldcore/kml.cpp +++ b/gldcore/kml.cpp @@ -34,7 +34,7 @@ int kml_document(FILE *fp) MODULE *mod; char buffer[1024]; kml_write("%s"," \n"); - kml_write(" %s\n", global_modelname); + kml_write(" %s\n", (const char*)global_modelname); kml_write(" %s-D results for %s\n", PACKAGE_NAME, convert_from_timestamp(global_clock,buffer,sizeof(buffer))?buffer:"unknown date/time"); diff --git a/gldcore/link/python/python.cpp b/gldcore/link/python/python.cpp index 77068af9a..9c5cbf584 100644 --- a/gldcore/link/python/python.cpp +++ b/gldcore/link/python/python.cpp @@ -117,7 +117,7 @@ static PyObject *gridlabd_version(PyObject *self, PyObject *args) "minor", global_version_minor, "patch", global_version_patch, "build", global_version_build, - "branch", global_version_branch); + "branch", (const char*)global_version_branch); } static PyObject *gridlabd_copyright(PyObject *self, PyObject *args) diff --git a/gldcore/load.cpp b/gldcore/load.cpp index a68a6cd87..63cac8d85 100755 --- a/gldcore/load.cpp +++ b/gldcore/load.cpp @@ -469,10 +469,10 @@ STATUS GldLoader::compile_code(CLASS *oclass, int64 functions) /* check global_include */ if ( strlen(global_include) == 0 ) { - if ( getenv("GRIDLABD") ) + if ( getenv("GRIDLABD") != NULL ) { - strncpy(global_include,getenv("GRIDLABD"),sizeof(global_include)); - IN_MYCONTEXT output_verbose("global_include is not set, assuming value of GRIDLABD variable '%s'", global_include); + global_include = getenv("GRIDLABD"); + IN_MYCONTEXT output_verbose("global_include is not set, assuming value of GRIDLABD variable '%s'", (const char*)global_include); } else { @@ -7516,7 +7516,7 @@ int GldLoader::process_macro(char *line, int size, char *_filename, int linenum) command++; } char command_line[1024]; - sprintf(command_line,"%s/gridlabd-%s",global_execdir,command); + sprintf(command_line,"%s/gridlabd-%s",(const char*)global_execdir,command); output_verbose("executing system(%s)", command_line); global_return_code = my_instance->subcommand("%s",command_line); if( global_return_code != 0 ) @@ -7592,11 +7592,11 @@ int GldLoader::process_macro(char *line, int size, char *_filename, int linenum) return FALSE; } strcpy(value, strip_right_white(term+1)); - IN_MYCONTEXT output_debug("%s(%d): executing system(char *cmd='%s %s')", filename, linenum, global_execname, value); - global_return_code = my_instance->subcommand("%s %s",global_execname,value); + IN_MYCONTEXT output_debug("%s(%d): executing system(char *cmd='%s %s')", filename, linenum, (const char*)global_execname, value); + global_return_code = my_instance->subcommand("%s %s",(const char*)global_execname,value); if( global_return_code != 0 ) { - syntax_error(filename,linenum,"#gridlabd %s -- system('%s %s') failed with status %d", value, global_execname, value, global_return_code); + syntax_error(filename,linenum,"#gridlabd %s -- system('%s %s') failed with status %d", value, (const char*)global_execname, value, global_return_code); strcpy(line,"\n"); return FALSE; } @@ -7752,7 +7752,7 @@ int GldLoader::process_macro(char *line, int size, char *_filename, int linenum) } else { - sprintf(value1,"%s",global_version_branch); + sprintf(value1,"%s",(const char*)global_version_branch); sprintf(value2,"%s",next); } bool test = (strcmp(value1,value2) == criteria); @@ -7762,7 +7762,8 @@ int GldLoader::process_macro(char *line, int size, char *_filename, int linenum) if ( ! ok ) { syntax_error(filename,linenum,"version '%d.%d.%d-%d-%s' does not satisfy the version requirement", - global_version_major, global_version_minor, global_version_patch, global_version_build, global_version_branch); + global_version_major, global_version_minor, global_version_patch, + global_version_build, (const char*)global_version_branch); strcpy(line,"\n"); return FALSE; } @@ -7815,7 +7816,7 @@ int GldLoader::process_macro(char *line, int size, char *_filename, int linenum) return FALSE; } } - int rc = my_instance->subcommand("%s/" PACKAGE "-%s",global_execdir,strchr(line,'#')+1); + int rc = my_instance->subcommand("%s/" PACKAGE "-%s",(const char*)global_execdir,strchr(line,'#')+1); if ( rc != 127 ) { strcpy(line,"\n"); @@ -8206,8 +8207,8 @@ std::string GldLoader::get_depends(const char *format) { if ( format == NULL || strcmp(format,"makefile") == 0 ) { - std::string result = std::string("# generated by gridlabd ") + global_version + "\n\n" - + "all: " + global_modelname + "\n\n"; + std::string result = std::string("# generated by gridlabd ") + (const char*)global_version + "\n\n" + + "all: " + (const char*)global_modelname + "\n\n"; for ( DEPENDENCY_TREE::iterator item = dependency_tree.begin() ; item != dependency_tree.end() ; item++ ) { diff --git a/gldcore/main.cpp b/gldcore/main.cpp index 7cbfc5223..af2a9d7d3 100644 --- a/gldcore/main.cpp +++ b/gldcore/main.cpp @@ -206,7 +206,7 @@ int GldMain::mainloop(int argc, const char *argv[]) { /* start the processing environment */ IN_MYCONTEXT output_verbose("load time: %d sec", realtime_runtime()); - IN_MYCONTEXT output_verbose("starting up %s environment", global_environment); + IN_MYCONTEXT output_verbose("starting up %s environment", (const char*)global_environment); if (environment_start(argc,argv)==FAILED) { output_fatal("environment startup failed: %s", strerror(errno)); @@ -227,21 +227,23 @@ void GldMain::set_global_browser(const char *path) /* specify the default browser */ if ( browser != NULL ) - strncpy(global_browser,browser,sizeof(global_browser)-1); + { + global_browser = browser; + } } void GldMain::set_global_execname(const char *path) { - strcpy(global_execname,path); + global_execname = path; } void GldMain::set_global_execdir(const char *path) { char *pd1, *pd2; - strcpy(global_execdir,path); - pd1 = strrchr(global_execdir,'/'); - pd2 = strrchr(global_execdir,'\\'); + global_execdir = path; + pd1 = strrchr(global_execdir.get_string(),'/'); + pd2 = strrchr(global_execdir.get_string(),'\\'); if (pd1>pd2) *pd1='\0'; else if (pd2>pd1) *pd2='\0'; return; @@ -249,11 +251,13 @@ void GldMain::set_global_execdir(const char *path) void GldMain::set_global_command_line(int argc, const char *argv[]) { - int i, pos=0; - for (i=0; i0?" ":"",argv[i]); + if ( i > 0 ) + { + global_command_line.copy_from(" ",-1); + } + global_command_line.copy_from(argv[i],-1); } return; } @@ -261,9 +265,13 @@ void GldMain::set_global_command_line(int argc, const char *argv[]) void GldMain::set_global_workdir(const char *path) { if ( path ) - strncpy(global_workdir,path,sizeof(global_workdir)-1); - else if ( getcwd(global_workdir,sizeof(global_workdir)-1) == NULL ) + { + global_workdir = path; + } + else if ( getcwd(global_workdir.resize(PATH_MAX),PATH_MAX-1) == NULL ) + { output_error("unable to read current working directory"); + } return; } @@ -274,7 +282,7 @@ void GldMain::create_pidfile() FILE *fp = fopen(global_pidfile,"w"); if (fp==NULL) { - output_fatal("unable to create pidfile '%s'", global_pidfile); + output_fatal("unable to create pidfile '%s'", (const char*)global_pidfile); /* TROUBLESHOOT The system must allow creation of the process id file at the location indicated in the message. Create and/or @@ -286,7 +294,7 @@ void GldMain::create_pidfile() #define getpid _getpid #endif fprintf(fp,"%d\n",getpid()); - IN_MYCONTEXT output_verbose("process id %d written to %s", getpid(), global_pidfile); + IN_MYCONTEXT output_verbose("process id %d written to %s", getpid(), (const char*)global_pidfile); fclose(fp); atexit(delete_pidfile); } @@ -332,7 +340,7 @@ int GldMain::run_on_exit(int return_code) if (strcmp(global_savefile,"")!=0) { if (saveall(global_savefile)==FAILED) - output_error("save to '%s' failed", global_savefile); + output_error("save to '%s' failed", (const char*)global_savefile); } /* do module dumps */ diff --git a/gldcore/module.cpp b/gldcore/module.cpp index 10af7611a..3fd4d3656 100644 --- a/gldcore/module.cpp +++ b/gldcore/module.cpp @@ -630,7 +630,7 @@ static bool _checkimg(const char *fname) } #endif -static void _module_list (char *path) +static void _module_list (const char *path) { struct stat info; static int count = 0; @@ -1740,7 +1740,7 @@ typedef struct s_gldprocinfo { TIMESTAMP starttime; /* sim starttime */ TIMESTAMP stoptime; /* sim stoptime */ enumeration status; /* current status */ - char1024 model; /* model name */ + char model[1024]; /* model name */ time_t start; /* wall time of start */ } GLDPROCINFO; static GLDPROCINFO *process_map = NULL; /* global process map */ @@ -2127,7 +2127,7 @@ MYPROCINFO *sched_allocate_procs(unsigned int n_threads, pid_t pid) my_proc->list[t] = n; process_map[n].pid = pid; IN_MYCONTEXT output_debug("module.c/sched_allocate_procs(): assigned processor %d to pid %d\n", n, pid); - process_map[n].model = global_modelname; + global_modelname.copy_to(process_map[n].model,sizeof(process_map[n].model)); process_map[n].start = time(NULL); sched_unlock(n); diff --git a/gldcore/object.cpp b/gldcore/object.cpp index 9daa5eb47..eee9e5429 100644 --- a/gldcore/object.cpp +++ b/gldcore/object.cpp @@ -1689,7 +1689,7 @@ int object_event(OBJECT *obj, char *event, long long *p_retval=NULL) char buffer[1024]; sprintf(buffer,"%lld",global_clock); setenv("CLOCK",buffer,1); - sprintf(buffer,"%s",global_hostname); + sprintf(buffer,"%s",(const char*)global_hostname); setenv("HOSTNAME",buffer,1); sprintf(buffer,"%d",global_server_portnum); setenv("PORT",buffer,1); diff --git a/gldcore/output.cpp b/gldcore/output.cpp index 6149a64cc..bd3ec8af2 100644 --- a/gldcore/output.cpp +++ b/gldcore/output.cpp @@ -906,7 +906,7 @@ int output_xsl(const char *fname, int n_mods, const char *p_mods[]) GLOBALVAR *stylesheet = global_find("stylesheet"); fprintf(fp,"%s <xsl:value-of select=\"version.major\"/>.<xsl:value-of select=\"version.minor\"/> - <xsl:value-of select=\"modelname\"/>\n",PACKAGE_NAME); if (stylesheet==NULL || stylesheet->prop->ptype!=PT_char1024) /* only char1024 is allowed */ - fprintf(fp,"\n",global_urlbase,global_version_major,global_version_minor); + fprintf(fp,"\n",(const char*)global_urlbase,global_version_major,global_version_minor); else fprintf(fp,"\n",stylesheet->prop->name); } diff --git a/gldcore/property.h b/gldcore/property.h index 80e84dee1..0150a2417 100644 --- a/gldcore/property.h +++ b/gldcore/property.h @@ -137,9 +137,6 @@ class varchar { } }; -#ifdef MAIN -#warning change all char * to const char * -#endif inline char *resize(size_t len) { if ( len > *buflen ) @@ -158,6 +155,11 @@ class varchar { return resize(strlen(s)+1); } + inline operator void * () const + { + return (void*)this; + } + inline operator const char * () const { return *bufptr; diff --git a/gldcore/sanitize.cpp b/gldcore/sanitize.cpp index c4bfef557..ac4f7fa1c 100644 --- a/gldcore/sanitize.cpp +++ b/gldcore/sanitize.cpp @@ -97,7 +97,7 @@ int sanitize(void *main, int argc, const char *argv[]) if ( varchar(global_sanitizeindex.substr(-4)) == ".xml" ) { fprintf(fp,"\n"); - fprintf(fp,"\t%s\n",global_modelname); + fprintf(fp,"\t%s\n",(const char*)global_modelname); fprintf(fp,"\t\n"); fprintf(fp,"\t\t%.6f\n",delta_latitude); fprintf(fp,"\t\t%.6f\n",delta_longitude); @@ -111,7 +111,7 @@ int sanitize(void *main, int argc, const char *argv[]) else if ( varchar(global_sanitizeindex.substr(-4)) == ".json" ) { fprintf(fp,"{\n"); - fprintf(fp," \"modelname\" : \"%s\",\n",global_modelname); + fprintf(fp," \"modelname\" : \"%s\",\n",(const char*)global_modelname); fprintf(fp," \"geographic_offsets\" : {\n"); fprintf(fp," \"latitude\" : %.6f,\n",delta_latitude); fprintf(fp," \"longitude\" : %.6f\n",delta_longitude); @@ -124,7 +124,7 @@ int sanitize(void *main, int argc, const char *argv[]) } else { - fprintf(fp,"modelname\t= %s\n", global_modelname); + fprintf(fp,"modelname\t= %s\n", (const char*)global_modelname); fprintf(fp,"\n[POSITIONS]\n"); fprintf(fp,"latitude\t= %.6f\n",delta_latitude); fprintf(fp,"longitude\t= %.6f\n",delta_longitude); diff --git a/gldcore/save.cpp b/gldcore/save.cpp index 4f4fbc149..26f3123c4 100644 --- a/gldcore/save.cpp +++ b/gldcore/save.cpp @@ -200,8 +200,8 @@ int saveglm(const char *filename,FILE *fp) count += fprintf(fp,"// BEGIN"); count += fprintf(fp,"\n////////////////////////////////////////////////////////\n"); count += fprintf(fp,"// filename... %s\n", filename); - count += fprintf(fp,"// workdir.... %s\n", global_workdir); - count += fprintf(fp,"// command.... %s\n", global_command_line); + count += fprintf(fp,"// workdir.... %s\n", (const char*)global_workdir); + count += fprintf(fp,"// command.... %s\n", (const char*)global_command_line); count += fprintf(fp,"// created.... %s", asctime(localtime(&now))); count += fprintf(fp,"// user....... %s\n", #ifdef WIN32 @@ -310,7 +310,8 @@ int savexml_strict(const char *filename,FILE *fp) count += fprintf(fp,"\n"); if (stylesheet==NULL || stylesheet->prop->ptype!=PT_char1024) /* only char1024 is allowed */ - count += fprintf(fp,"\n",global_urlbase,global_version_major,global_version_minor); + count += fprintf(fp,"\n", + (const char*)global_urlbase,global_version_major,global_version_minor); else count += fprintf(fp,"\n",stylesheet->prop->name); count += fprintf(fp,"\n"); diff --git a/gldcore/server.cpp b/gldcore/server.cpp index ef411906a..831d5adb9 100644 --- a/gldcore/server.cpp +++ b/gldcore/server.cpp @@ -180,7 +180,7 @@ STATUS server_startup(int argc, const char *argv[]) serv_addr.sin_addr.s_addr = inet_addr(global_server_inaddr); if ( !serv_addr.sin_addr.s_addr ) { - output_error("invalid server_inaddr argument supplied : %s", global_server_inaddr); + output_error("invalid server_inaddr argument supplied : %s", (const char*)global_server_inaddr); return FAILED; } } diff --git a/gldcore/setup.cpp b/gldcore/setup.cpp index 91d2795fd..e3aa4c407 100644 --- a/gldcore/setup.cpp +++ b/gldcore/setup.cpp @@ -215,7 +215,8 @@ int setup(void *main, int argc, const char *argv[]) // header mvprintw(0,0,"%s %d.%d.%d-%d (%s) Setup Editor",PACKAGE_NAME, - global_version_major, global_version_minor, global_version_patch, global_version_build,global_version_branch); + global_version_major, global_version_minor, global_version_patch, + global_version_build,(const char*)global_version_branch); mvprintw(1,0,"%s",hline); // tabs diff --git a/gldcore/timestamp.cpp b/gldcore/timestamp.cpp index 34c4e3786..942021da7 100644 --- a/gldcore/timestamp.cpp +++ b/gldcore/timestamp.cpp @@ -1526,7 +1526,7 @@ int timestamp_test(void) } output_test("END: round robin test",steptxt); output_test("END: daylight saving time tests for %d to %d", YEAR0, YEAR0+NYEARS); - IN_MYCONTEXT output_verbose("daylight saving time tests: %d succeeded, %d failed (see '%s' for details)", succeeded, failed, global_testoutputfile); + IN_MYCONTEXT output_verbose("daylight saving time tests: %d succeeded, %d failed (see '%s' for details)", succeeded, failed, (const char*)global_testoutputfile); return failed; } diff --git a/gldcore/unit.cpp b/gldcore/unit.cpp index bdb4c707d..470da0fc1 100644 --- a/gldcore/unit.cpp +++ b/gldcore/unit.cpp @@ -849,7 +849,7 @@ int unit_test(void) } } output_test("END: %d units tested", n); - IN_MYCONTEXT output_verbose("units tested: %d ok, %d failed (see '%s' for details).", succeeded, failed, global_testoutputfile); + IN_MYCONTEXT output_verbose("units tested: %d ok, %d failed (see '%s' for details).", succeeded, failed, (const char*)global_testoutputfile); return failed; } diff --git a/gldcore/validate.cpp b/gldcore/validate.cpp index 7a7028d9f..336826437 100644 --- a/gldcore/validate.cpp +++ b/gldcore/validate.cpp @@ -526,7 +526,7 @@ static counters run_test(char *file, size_t id, double *elapsed_time=NULL) #ifdef WIN32 _pgmptr, #else - global_execname, + (const char*)global_execname, #endif dir,validate_cmdargs, name); dt = my_instance->get_exec()->clock() - dt; @@ -794,7 +794,7 @@ int validate(void *main, int argc, const char *argv[]) if ( !redirect_found ) strcat(validate_cmdargs," --redirect all"); global_suppress_repeat_messages = 0; - output_message("Starting validation test in directory '%s'", global_workdir); + output_message("Starting validation test in directory '%s'", (const char*)global_workdir); char var[64]; if ( global_getvar("clean",var,sizeof(var))!=NULL && atoi(var)!=0 ) clean = true; @@ -802,7 +802,7 @@ int validate(void *main, int argc, const char *argv[]) if ( report_fp==NULL ) output_warning("unable to open '%s' for writing", report_file); report_title("VALIDATION TEST REPORT"); - report_title("%s %d.%d.%d-%d (%s)", PACKAGE_NAME,global_version_major, global_version_minor, global_version_patch, global_version_build, global_version_branch); + report_title("%s %d.%d.%d-%d (%s)", PACKAGE_NAME,global_version_major, global_version_minor, global_version_patch, global_version_build, (const char*)global_version_branch); report_newrow(); report_newtable("TEST CONFIGURATION"); @@ -837,7 +837,7 @@ int validate(void *main, int argc, const char *argv[]) report_data(); report_data("Platform"); - report_data("%d-bit %s %s", sizeof(void*)*8, global_platform, + report_data("%d-bit %s %s", sizeof(void*)*8, (const char*)global_platform, #ifdef _DEBUG "DEBUG" #else @@ -848,7 +848,7 @@ int validate(void *main, int argc, const char *argv[]) report_data(); report_data("Workdir"); - report_data("%s",global_workdir); + report_data("%s",(const char*)global_workdir); report_newrow(); report_data(); @@ -918,7 +918,7 @@ int validate(void *main, int argc, const char *argv[]) final.print(); double dt = (double)my_instance->get_exec()->clock()/(double)CLOCKS_PER_SEC; output_message("Total validation elapsed time: %.1f seconds", dt); - if ( report_fp ) output_message("See '%s/%s' for details", global_workdir, report_file); + if ( report_fp ) output_message("See '%s/%s' for details", (const char*)global_workdir, report_file); if ( final.get_nerrors()==0 ) my_instance->get_exec()->setexitcode(XC_SUCCESS); else diff --git a/reliability/eventgen.cpp b/reliability/eventgen.cpp index aeeb28eb3..e980103a8 100644 --- a/reliability/eventgen.cpp +++ b/reliability/eventgen.cpp @@ -666,7 +666,7 @@ TIMESTAMP eventgen::presync(TIMESTAMP t0, TIMESTAMP t1) // look for events coming from FNCS if (strlen(controlled_switch) > 0) { if (switch_state != last_switch_state) { - cout << "Switch " << controlled_switch << " changing status to " << switch_state << " at " << t0 << " going to " << t1 << endl; + cout << "Switch " << (const char*)controlled_switch << " changing status to " << switch_state << " at " << t0 << " going to " << t1 << endl; OBJECT *swt = gl_get_object(controlled_switch); if (switch_state == 1) { // closed add_unhandled_event (swt, "SW-ABC", t0 - 50, 50, 24, true); diff --git a/tape_plot/tape_plot.cpp b/tape_plot/tape_plot.cpp index b73a6ed56..be61c199a 100644 --- a/tape_plot/tape_plot.cpp +++ b/tape_plot/tape_plot.cpp @@ -639,10 +639,8 @@ EXPORT int open_collector(struct collector *my, char *fname, char *flags) } write_default_plot_commands_col(my, extension); - if (my->columns){ - sscanf(my->columns,"%s", columnlist); - fprintf(my->fp, "plot \'-\' using %s with lines;\n", columnlist); - } + my->columns = columnlist; + fprintf(my->fp, "plot \'-\' using %s with lines;\n", columnlist); free(columns); From 74db3d65ddaf5941b273f958d54f23cce10305a0 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Wed, 26 Aug 2020 06:31:15 -0700 Subject: [PATCH 004/117] Add varchar_create --- gldcore/convert.cpp | 12 ++++++++++++ gldcore/convert.h | 7 +++++-- gldcore/property.cpp | 8 ++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gldcore/convert.cpp b/gldcore/convert.cpp index 3cecc83a0..66ff4496e 100644 --- a/gldcore/convert.cpp +++ b/gldcore/convert.cpp @@ -701,6 +701,18 @@ int convert_to_int64(const char *buffer, /**< a pointer to the string buffer */ return sscanf(buffer,"%lld",(long long *)data); } + +/** Convert to a \e varchar + Converts a string to a new \e varchar property. + @return 1 on success, 0 on failure, -1 if conversion was incomplete + **/ +DEPRECATED int varchar_create(void *data) +{ + varchar v; + *((varchar*)data) = v; + return 1; +} + /** Convert from a \e varchar Converts a \e varchar property to a string. @return the number of character written to the string diff --git a/gldcore/convert.h b/gldcore/convert.h index 157c3035a..19fe60d7b 100644 --- a/gldcore/convert.h +++ b/gldcore/convert.h @@ -67,10 +67,13 @@ DEPRECATED int convert_from_int64(char *buffer, int size, void *data, PROPERTY * // Function: convert_to_int64 DEPRECATED int convert_to_int64(const char *buffer, void *data, PROPERTY *prop); -// Function: convert_from_char1024 +// Function: varchar_create +DEPRECATED int varchar_create(void *data); + +// Function: convert_from_varchar DEPRECATED int convert_from_varchar(char *buffer, int size, void *data, PROPERTY *prop); -// Function: convert_to_char1024 +// Function: convert_to_varchar DEPRECATED int convert_to_varchar(const char *buffer, void *data, PROPERTY *prop); // Function: convert_from_object diff --git a/gldcore/property.cpp b/gldcore/property.cpp index 588f9f1c3..30a1a2cc4 100644 --- a/gldcore/property.cpp +++ b/gldcore/property.cpp @@ -26,10 +26,10 @@ PROPERTYSPEC property_type[_PT_LAST] = { {"int16", "integer", "0", sizeof(int16), 6, convert_from_int16,convert_to_int16,NULL,NULL,NULL,convert_to_int16,{TCOPS(uint16)},}, {"int32", "integer", "0", sizeof(int32), 12, convert_from_int32,convert_to_int32,NULL,NULL,NULL,convert_to_int32,{TCOPS(uint32)},}, {"int64", "integer", "0", sizeof(int64), 24, convert_from_int64,convert_to_int64,NULL,NULL,NULL,convert_to_int64,{TCOPS(uint64)},}, - {"char8", "string", "", sizeof(char8), 8, convert_from_varchar,convert_to_varchar,NULL,NULL,NULL,convert_to_varchar,{TCOPS(string)},}, - {"char32", "string", "", sizeof(char32), 32, convert_from_varchar,convert_to_varchar,NULL,NULL,NULL,convert_to_varchar,{TCOPS(string)},}, - {"char256", "string", "", sizeof(char256), 256, convert_from_varchar,convert_to_varchar,NULL,NULL,NULL,convert_to_varchar,{TCOPS(string)},}, - {"char1024", "string", "", sizeof(char1024), 1024, convert_from_varchar,convert_to_varchar,NULL,NULL,NULL,convert_to_varchar,{TCOPS(string)},}, + {"char8", "string", "", sizeof(char8), 8, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(string)},}, + {"char32", "string", "", sizeof(char32), 32, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(string)},}, + {"char256", "string", "", sizeof(char256), 256, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(string)},}, + {"char1024", "string", "", sizeof(char1024), 1024, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(string)},}, {"object", "string", NULL, sizeof(OBJECT*), 64, convert_from_object,convert_to_object,NULL,NULL,NULL,convert_to_object,{TCOPB(object)},object_get_part,object_set_part}, {"delegated", "string", NULL, 0, PSZ_DYNAMIC, convert_from_delegated, convert_to_delegated}, {"bool", "string", "FALSE", sizeof(bool), 6, convert_from_boolean, convert_to_boolean,NULL,NULL,NULL,convert_to_boolean,{TCOPB(bool)},}, From aefd5822ba72650edb9bad8049c3c899359a03a8 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Wed, 26 Aug 2020 10:02:14 -0700 Subject: [PATCH 005/117] Fix problem with varchar vformat() --- gldcore/globals.cpp | 31 +++++++++++++++++-------------- gldcore/link/python/Makefile.mk | 4 ++-- gldcore/property.h | 18 +++++++++++++----- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/gldcore/globals.cpp b/gldcore/globals.cpp index 2df77a59d..b80dd9aef 100644 --- a/gldcore/globals.cpp +++ b/gldcore/globals.cpp @@ -360,32 +360,35 @@ DEPRECATED static struct s_varmap { DEPRECATED static void buildtmp(void) { - const char *tmp, *home, *user; + const char *tmp = getenv("GLTEMP"); + const char *home = getenv(HOMEVAR); + const char *user = getenv(USERVAR); - if ( (tmp = getenv("GLTEMP")) != NULL ) + if ( tmp != NULL ) { global_tmp.format("%s",tmp); return; } - if ( (home = getenv(HOMEVAR)) != NULL ) + if ( home != NULL ) { #ifdef WIN32 - char *drive; - if ( ! (drive=getenv("HOMEDRIVE")) ) - { - drive = ""; - } - global_tmp.format("%s%s\\Local Settings\\Temp\\gridlabd", drive, home); + char *drive = getenv("HOMEDRIVE"); + global_tmp.format("%s%s\\Local Settings\\Temp\\gridlabd", drive?drive:"", home); #else global_tmp.format("%s/.gridlabd/tmp", home); #endif return; } - if (!(tmp = getenv("TMP")) && !(tmp = getenv("TEMP"))) + tmp = getenv("TMP"); + if ( tmp == NULL ) + { + tmp = getenv("TEMP"); + } + if ( tmp == NULL ) + { tmp = TMP; - user = getenv(USERVAR); - global_tmp.format("%s%s%s" PATHSEP PACKAGE, - tmp, (user ? PATHSEP : ""), (user ? user : "")); + } + global_tmp.format("%s%s%s" PATHSEP PACKAGE, tmp, (user ? PATHSEP : ""), (user ? user : "")); } /** Register global variables @@ -403,7 +406,7 @@ STATUS GldGlobals::init(void) global_version_build = version_build(); global_version_branch = version_branch(); global_datadir = global_execdir; - size_t bin = global_datadir.find("/bin"); + size_t bin = global_datadir.findrev("/bin"); global_datadir.copy_from("/share/gridlabd",bin); global_version.format("%d.%d.%d-%d-%s", global_version_major,global_version_minor,global_version_patch, diff --git a/gldcore/link/python/Makefile.mk b/gldcore/link/python/Makefile.mk index 93503a1c0..ab307a5ec 100644 --- a/gldcore/link/python/Makefile.mk +++ b/gldcore/link/python/Makefile.mk @@ -1,6 +1,6 @@ python-install: - @echo "python3 $(top_srcdir)/gldcore/link/python/setup.py --quiet install" - @( export SRCDIR=$(top_srcdir) ; python3 $(top_srcdir)/gldcore/link/python/setup.py --quiet install ) + @echo "python3 $(top_srcdir)/gldcore/link/python/setup.py --quiet build --parallel 30 install" + @( export SRCDIR=$(top_srcdir) ; python3 $(top_srcdir)/gldcore/link/python/setup.py --quiet build --parallel 30 install ) python-clean: @echo "python3 $(top_srcdir)/gldcore/link/python/setup.py clean" diff --git a/gldcore/property.h b/gldcore/property.h index 0150a2417..ba5e75828 100644 --- a/gldcore/property.h +++ b/gldcore/property.h @@ -143,6 +143,7 @@ class varchar { { *buflen = ::pow(2,::ceil(::log(len+1)/::log(2))); char *bigger = new char[*buflen]; + memset(bigger,0,*buflen); strncpy(bigger,*bufptr,(*buflen)-1); delete [] *bufptr; *bufptr = bigger; @@ -325,17 +326,24 @@ class varchar { { va_list ptr; va_start(ptr,fmt); - size_t len = vformat(fmt,ptr); - va_end(ptr); - return len; + int len = vformat(fmt,ptr); + va_end(ptr); + return len; }; // Method: vformat inline size_t vformat(const char *fmt, va_list ptr) { - size_t len = vsnprintf(NULL,0,fmt,ptr); + char *buf = NULL; + int len = vasprintf(&buf,fmt,ptr); + if ( len < 0 || buf == NULL ) + { + return -1; + } resize(len+1); - return vsnprintf(*bufptr,(*buflen)-1,fmt,ptr); + copy_from(buf); + free(buf); + return len; }; }; From 05cbd9400a98f6bcba05f15df51fdbd833a387d6 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Thu, 27 Aug 2020 14:08:09 -0700 Subject: [PATCH 006/117] Fix varchar compares --- gldcore/compare.cpp | 11 +++++++++++ gldcore/compare.h | 1 + gldcore/property.cpp | 8 ++++---- gldcore/python_embed.cpp | 9 +++++++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gldcore/compare.cpp b/gldcore/compare.cpp index 1b8938dbc..3ca3407b1 100644 --- a/gldcore/compare.cpp +++ b/gldcore/compare.cpp @@ -44,6 +44,16 @@ #define COMPARE_SIN(T) int compare_tc_##T##_in(void* x,void* a,void* b) { return strcmp((char*)x,(char*)a)!=-1 && b!=NULL && strcmp((char*)x,(char*)b)!=1; } #define COMPARE_SNI(T) int compare_tc_##T##_ni(void* x,void* a,void* b) { return !(strcmp((char*)x,(char*)a)!=-1 && b!=NULL && strcmp((char*)x,(char*)b)!=1); } +#define COMPAREOPC(T) COMPARE_CEQ(T) COMPARE_CLE(T) COMPARE_CGE(T) COMPARE_CNE(T) COMPARE_CLT(T) COMPARE_CGT(T) COMPARE_CIN(T) COMPARE_CNI(T) +#define COMPARE_CEQ(T) int compare_tc_##T##_eq(void* x,void* a,void* b) { return *(varchar*)x == (char*)a; } +#define COMPARE_CLE(T) int compare_tc_##T##_le(void* x,void* a,void* b) { return *(varchar*)x <= (char*)a; } +#define COMPARE_CGE(T) int compare_tc_##T##_ge(void* x,void* a,void* b) { return *(varchar*)x >= (char*)a; } +#define COMPARE_CNE(T) int compare_tc_##T##_ne(void* x,void* a,void* b) { return *(varchar*)x != (char*)a; } +#define COMPARE_CLT(T) int compare_tc_##T##_lt(void* x,void* a,void* b) { return *(varchar*)x < (char*)a; } +#define COMPARE_CGT(T) int compare_tc_##T##_gt(void* x,void* a,void* b) { return *(varchar*)x > (char*)a; } +#define COMPARE_CIN(T) int compare_tc_##T##_in(void* x,void* a,void* b) { return *(varchar*)a <= (char*)x && b!=NULL && *(varchar*)x <= (char*)b; } +#define COMPARE_CNI(T) int compare_tc_##T##_ni(void* x,void* a,void* b) { return !(*(varchar*)a <= (char*)x && b!=NULL && *(varchar*)x <= (char*)b); } + /* basic ops */ COMPAREOPF(double) COMPAREOPF(float) @@ -53,3 +63,4 @@ COMPAREOPI(uint64) COMPAREOPB(bool) COMPAREOPS(string) COMPAREOPO(object) +COMPAREOPC(varchar) diff --git a/gldcore/compare.h b/gldcore/compare.h index 9388f8e18..79511e114 100644 --- a/gldcore/compare.h +++ b/gldcore/compare.h @@ -89,5 +89,6 @@ TCOPD(string); TCOPD(bool); TCOPD(timestamp); TCOPD(object); +TCOPD(varchar); #endif diff --git a/gldcore/property.cpp b/gldcore/property.cpp index 30a1a2cc4..3cce55262 100644 --- a/gldcore/property.cpp +++ b/gldcore/property.cpp @@ -26,10 +26,10 @@ PROPERTYSPEC property_type[_PT_LAST] = { {"int16", "integer", "0", sizeof(int16), 6, convert_from_int16,convert_to_int16,NULL,NULL,NULL,convert_to_int16,{TCOPS(uint16)},}, {"int32", "integer", "0", sizeof(int32), 12, convert_from_int32,convert_to_int32,NULL,NULL,NULL,convert_to_int32,{TCOPS(uint32)},}, {"int64", "integer", "0", sizeof(int64), 24, convert_from_int64,convert_to_int64,NULL,NULL,NULL,convert_to_int64,{TCOPS(uint64)},}, - {"char8", "string", "", sizeof(char8), 8, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(string)},}, - {"char32", "string", "", sizeof(char32), 32, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(string)},}, - {"char256", "string", "", sizeof(char256), 256, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(string)},}, - {"char1024", "string", "", sizeof(char1024), 1024, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(string)},}, + {"char8", "string", "", sizeof(char8), 8, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(varchar)},}, + {"char32", "string", "", sizeof(char32), 32, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(varchar)},}, + {"char256", "string", "", sizeof(char256), 256, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(varchar)},}, + {"char1024", "string", "", sizeof(char1024), 1024, convert_from_varchar,convert_to_varchar,NULL,varchar_create,NULL,convert_to_varchar,{TCOPS(varchar)},}, {"object", "string", NULL, sizeof(OBJECT*), 64, convert_from_object,convert_to_object,NULL,NULL,NULL,convert_to_object,{TCOPB(object)},object_get_part,object_set_part}, {"delegated", "string", NULL, 0, PSZ_DYNAMIC, convert_from_delegated, convert_to_delegated}, {"bool", "string", "FALSE", sizeof(bool), 6, convert_from_boolean, convert_to_boolean,NULL,NULL,NULL,convert_to_boolean,{TCOPB(bool)},}, diff --git a/gldcore/python_embed.cpp b/gldcore/python_embed.cpp index 5d3bfbb59..37e55bfbb 100644 --- a/gldcore/python_embed.cpp +++ b/gldcore/python_embed.cpp @@ -13,7 +13,12 @@ void python_embed_init(int argc, const char *argv[]) { program = Py_DecodeLocale(argv[0],NULL); Py_SetProgramName(program); - Py_Initialize(); + Py_InitializeEx(0); + if ( ! Py_IsInitialized() ) + { + throw_exception("python_embed_init(argc=%d,argv=(%s,...)): python initialization failed",argc,argv?argv[0]:"NULL"); + } + main_module = PyModule_GetDict(PyImport_AddModule("__main__")); if ( main_module == NULL ) { @@ -39,7 +44,7 @@ void *python_loader_init(int argc, const char **argv) void python_embed_term() { - if ( Py_FinalizeEx() ) + if ( Py_IsInitialized() && Py_FinalizeEx() ) { output_warning("Py_FinalizeEx() failed"); } From 528dd3223f9bf0c4c549e4c84dec5900abdb7306 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Fri, 28 Aug 2020 06:50:17 -0700 Subject: [PATCH 007/117] Update compare.cpp --- gldcore/compare.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gldcore/compare.cpp b/gldcore/compare.cpp index 3ca3407b1..3608d805f 100644 --- a/gldcore/compare.cpp +++ b/gldcore/compare.cpp @@ -51,8 +51,8 @@ #define COMPARE_CNE(T) int compare_tc_##T##_ne(void* x,void* a,void* b) { return *(varchar*)x != (char*)a; } #define COMPARE_CLT(T) int compare_tc_##T##_lt(void* x,void* a,void* b) { return *(varchar*)x < (char*)a; } #define COMPARE_CGT(T) int compare_tc_##T##_gt(void* x,void* a,void* b) { return *(varchar*)x > (char*)a; } -#define COMPARE_CIN(T) int compare_tc_##T##_in(void* x,void* a,void* b) { return *(varchar*)a <= (char*)x && b!=NULL && *(varchar*)x <= (char*)b; } -#define COMPARE_CNI(T) int compare_tc_##T##_ni(void* x,void* a,void* b) { return !(*(varchar*)a <= (char*)x && b!=NULL && *(varchar*)x <= (char*)b); } +#define COMPARE_CIN(T) int compare_tc_##T##_in(void* x,void* a,void* b) { return *(varchar*)x >= (char*)a && b != NULL && *(varchar*)x <= (char*)b; } +#define COMPARE_CNI(T) int compare_tc_##T##_ni(void* x,void* a,void* b) { return !(*(varchar*)x >= (char*)a && b != NULL && *(varchar*)x <= (char*)b); } /* basic ops */ COMPAREOPF(double) From 1f8c3e4fa645a425c9ef7cf22f97544b54a759cf Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Fri, 28 Aug 2020 06:56:22 -0700 Subject: [PATCH 008/117] Update version.h --- gldcore/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gldcore/version.h b/gldcore/version.h index e87e1edec..9a6096b5a 100644 --- a/gldcore/version.h +++ b/gldcore/version.h @@ -9,9 +9,9 @@ #error "this header may only be included from gldcore.h or gridlabd.h" #endif -#define REV_MAJOR 4 -#define REV_MINOR 2 -#define REV_PATCH 1 +#define REV_MAJOR 5 +#define REV_MINOR 0 +#define REV_PATCH 0 #ifdef HAVE_CONFIG_H #include "config.h" From 4f27ca201b384d7183af34bbcff5555595bccece Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Sun, 30 Aug 2020 09:23:58 -0700 Subject: [PATCH 009/117] Update gridlabd.in --- gldcore/gridlabd.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gldcore/gridlabd.in b/gldcore/gridlabd.in index 3f260bb10..2025c9667 100644 --- a/gldcore/gridlabd.in +++ b/gldcore/gridlabd.in @@ -1,5 +1,5 @@ #! /bin/sh -# Generated from gridlabd.m4sh by GNU Autoconf 2.69. +# Generated from gldcore/gridlabd.m4sh by GNU Autoconf 2.69. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## From ea45d4d95b0c13378146a7a14b691ef6832c844b Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Sun, 30 Aug 2020 09:24:41 -0700 Subject: [PATCH 010/117] Update version.h --- gldcore/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gldcore/version.h b/gldcore/version.h index 9a6096b5a..0b4f66fb0 100644 --- a/gldcore/version.h +++ b/gldcore/version.h @@ -9,9 +9,9 @@ #error "this header may only be included from gldcore.h or gridlabd.h" #endif -#define REV_MAJOR 5 -#define REV_MINOR 0 -#define REV_PATCH 0 +#define REV_MAJOR 4 +#define REV_MINOR 2 +#define REV_PATCH 10 #ifdef HAVE_CONFIG_H #include "config.h" From 59c29f245faf485176458105b8a89051393767fb Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Mon, 31 Aug 2020 07:57:40 -0700 Subject: [PATCH 011/117] Update comparison operation implementation --- assert/assert.cpp | 11 +-- gldcore/complex.h | 3 + gldcore/convert.cpp | 152 ++++++++++++++++++++++++++++++++++++++++++ gldcore/convert.h | 14 ++++ gldcore/gridlabd.h | 61 ++++++++--------- gldcore/module.cpp | 2 +- gldcore/object.h | 1 + gldcore/property.cpp | 70 +++++++++++++++++++ gldcore/property.h | 9 +++ gldcore/rt/gridlabd.h | 29 ++++++++ 10 files changed, 313 insertions(+), 39 deletions(-) diff --git a/assert/assert.cpp b/assert/assert.cpp index 35f5c17a4..247d107e7 100644 --- a/assert/assert.cpp +++ b/assert/assert.cpp @@ -193,14 +193,9 @@ g_assert::ASSERTSTATUS g_assert::evaluate_status(gld_property &target_prop) { const char *a = get_value(); const char *b = get_value2(); - if ( strcmp(get_part(),"") == 0 ) - return target_prop.compare_with_string(relation,a,b[0]=='\0'?NULL:b) ? AS_TRUE : AS_FALSE ; - else - { - double x = atof(a); - double y = atof(b); - return target_prop.compare(relation,&x,b[0]=='\0'?NULL:&y,get_part()) ? AS_TRUE : AS_FALSE ; - } + const char *p = get_part(); + PROPERTYCOMPAREOP op = (PROPERTYCOMPAREOP)get_relation(); + return target_prop.compare(op,a,b[0]=='\0'?NULL:b,p) ? AS_TRUE : AS_FALSE ; } /** @} **/ diff --git a/gldcore/complex.h b/gldcore/complex.h index 2de9b1405..a87e5f1cf 100644 --- a/gldcore/complex.h +++ b/gldcore/complex.h @@ -571,6 +571,9 @@ inline DEPRECATED double complex_set_ang(C,D) {}; // TODO // Method: IsFinite inline bool IsFinite(void) { return isfinite(r) && isfinite(i); }; + + inline double get_real(void) const { return r; }; + inline double get_imag(void) const { return i; }; }; #endif diff --git a/gldcore/convert.cpp b/gldcore/convert.cpp index 66ff4496e..0135f4aee 100644 --- a/gldcore/convert.cpp +++ b/gldcore/convert.cpp @@ -1455,4 +1455,156 @@ int convert_to_method ( const char *buffer, /**< a pointer to the string buffer IN_MYCONTEXT output_debug("gldcore/convert_to_method(buffer='%s', object='%s', prop='%s') -> %d", buffer, obj->name?obj->name:"(anon)", prop->name, rc); return rc; } + +// convert_compare compares strings to properties +DEPRECATED int convert_compare(const double &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + double y, z; + convert_to_double(a,(void*)&y,p); + if ( b != NULL ) + { + convert_to_double(b,(void*)&z,p); + } + switch ( op ) + { + case TCOP_EQ: return x == y; + case TCOP_LE: return x <= y; + case TCOP_GE: return x >= y; + case TCOP_NE: return x != y; + case TCOP_LT: return x < y; + case TCOP_GT: return x > y; + case TCOP_IN: return y <= x && x <= z; + case TCOP_NI: return x < y || z < x; + default: + return false; + } +} + +DEPRECATED int convert_compare(const complex &z, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p, const char *part) +{ + if ( part != NULL && part[0] != '\0' ) + { + double x = complex_get_part((void*)&z,part); + return convert_compare(x,op,a,b,p); + } + throw_exception("convert_compare(x=%g%+gi, op=%d, a='%s', b='%s', p='%s'): invalid comparison op", z.get_real(), z.get_imag(), op, a, b, p->name); + return false; +} + +DEPRECATED int convert_compare(const varchar &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + varchar y, z; + convert_to_varchar(a,(void*)&y,p); + if ( b != NULL ) + { + convert_to_varchar(b,(void*)&z,p); + } + switch ( op ) + { + case TCOP_EQ: return x == y; + case TCOP_LE: return x <= y; + case TCOP_GE: return x >= y; + case TCOP_NE: return x != y; + case TCOP_LT: return x < y; + case TCOP_GT: return x > y; + case TCOP_IN: return y <= x && x <= z; + case TCOP_NI: return x < y || z < x; + default: + throw_exception("convert_compare(x='%s', op=%d, a='%s', b='%s', p='%s'): invalid comparison op", (const char*)x, op, a, b, p->name); + return false; + } +} + +DEPRECATED int convert_compare(const object &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + object y; + convert_to_object(a,(void*)&y,p); + switch ( op ) + { + case TCOP_EQ: return x == y; + case TCOP_NE: return x != y; + default: + throw_exception("convert_compare(x='%s', op=%d, a='%s', b='%s', p='%s'): invalid comparison op", (const char*)x, op, a, b, p->name); + return false; + } +} + +DEPRECATED int convert_compare(const TIMESTAMP &t, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p,const char *part) +{ + double x = (double)t, y, z; + if ( part != NULL && part[0] != '\0' ) + { + x = timestamp_get_part((void*)&t,part); + y = atof(a); + z = b ? atof(b) : QNAN; + + } + else + { + y = convert_to_timestamp(a); + z = b ? convert_to_timestamp(b) : QNAN; + } + switch ( op ) + { + case TCOP_EQ: return x == y; + case TCOP_LE: return x <= y; + case TCOP_GE: return x >= y; + case TCOP_NE: return x != y; + case TCOP_LT: return x < y; + case TCOP_GT: return x > y; + case TCOP_IN: return z != QNAN && y <= x && x <= z; + case TCOP_NI: return z != QNAN && ( x < y || z < x ); + default: + return false; + } +} + +DEPRECATED int convert_compare(const bool &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + bool y, z; + convert_to_boolean(a,(void*)&y,p); + if ( b != NULL ) + { + convert_to_boolean(b,(void*)&z,p); + } + switch ( op ) + { + case TCOP_EQ: return x == y; + case TCOP_NE: return x != y; + default: + return false; + } + +} + +DEPRECATED int convert_compare(const int16 &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + return -1; +} + +DEPRECATED int convert_compare(const int32 &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + return -1; +} + +DEPRECATED int convert_compare_i(const int64 &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + return -1; +} + +DEPRECATED int convert_compare(const enumeration &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + return -1; +} + +DEPRECATED int convert_compare(const set &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p) +{ + return -1; +} + +DEPRECATED int convert_compare(void *data, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *prop, const char *part) +{ + return -1; +} + /**@}**/ diff --git a/gldcore/convert.h b/gldcore/convert.h index 19fe60d7b..c5a4322d4 100644 --- a/gldcore/convert.h +++ b/gldcore/convert.h @@ -149,4 +149,18 @@ DEPRECATED int initial_from_method(char *buffer, int size, void *data, PROPERTY } #endif +// Function: convert_compare +DEPRECATED int convert_compare(const double &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare(const complex &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p, const char *part); +DEPRECATED int convert_compare(const varchar &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare(const object &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare(const TIMESTAMP &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p, const char *part); +DEPRECATED int convert_compare(const bool &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare(const int16 &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare(const int32 &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare_i(const int64 &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare(const enumeration &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare(const set &x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *p); +DEPRECATED int convert_compare(void *x, PROPERTYCOMPAREOP op, const char *a, const char *b, PROPERTY *prop, const char *part); + #endif diff --git a/gldcore/gridlabd.h b/gldcore/gridlabd.h index fa803266e..1902eb52f 100644 --- a/gldcore/gridlabd.h +++ b/gldcore/gridlabd.h @@ -3291,44 +3291,45 @@ class gld_property { inline gld_keyword* find_keyword(const char *name) { return get_first_keyword()->find(name); }; // Method: compare(char *op, char *a, char *b=NULL, char *p=NULL) - inline bool compare(const char *op, const char *a, const char *b=NULL, char *p=NULL) + inline bool compare(const char *op, const char *a, const char *b=NULL, const char *p=NULL) { PROPERTYCOMPAREOP n = callback->properties.get_compare_op(pstruct.prop->ptype,op); if (n==TCOP_ERR) throw "invalid property compare operation"; - return compare((enumeration)n,a,b,p); + return compare(n,a,b,p); }; - // Method: compare(enumeration op, char *a, char *b=NULL) - inline bool compare(enumeration op, const char *a, const char *b=NULL) - { - char v1[1024], v2[1024]; - return callback->convert.string_to_property(pstruct.prop,(void*)v1,a)>0 && callback->properties.compare_basic(pstruct.prop->ptype,(PROPERTYCOMPAREOP)op,get_addr(),(void*)v1,(b&&callback->convert.string_to_property(pstruct.prop,(void*)v2,b)>0)?(void*)v2:NULL, NULL); - }; - - // Method: compare(enumeration op, char *a, char *b, char *p) - inline bool compare(enumeration op, const char *a, const char *b, const char *p) + // Method: compare(PROPERTYCOMPAREOP op, char *a, char *b=NULL) + inline bool compare(PROPERTYCOMPAREOP op, const char *a, const char *b=NULL,const char *p=NULL) { - double v1, v2; v1=atof(a); v2=b?atof(b):0; - return callback->properties.compare_basic(pstruct.prop->ptype,(PROPERTYCOMPAREOP)op,get_addr(),(void*)&v1,b?(void*)&v2:NULL, p); - }; - - // Method: compare(enumeration op, double *a, double *b=NULL, char *p=NULL) - inline bool compare(enumeration op, double *a, double *b=NULL, const char *p=NULL) - { - return callback->properties.compare_basic(pstruct.prop->ptype,(PROPERTYCOMPAREOP)op,get_addr(),a,b,p); + return callback->properties.compare(pstruct.prop,(char*)(obj+1)+(int64)pstruct.prop->addr,op,a,b,p); + // char v1[1024], v2[1024]; + // return callback->convert.string_to_property(pstruct.prop,(void*)v1,a)>0 && callback->properties.compare_basic(pstruct.prop->ptype,(PROPERTYCOMPAREOP)op,get_addr(),(void*)v1,(b&&callback->convert.string_to_property(pstruct.prop,(void*)v2,b)>0)?(void*)v2:NULL, NULL); }; - // Method: compare(enumeration op, void *a, void *b=NULL) - inline bool compare(enumeration op, void *a, void *b=NULL) - { - return callback->properties.compare_basic(pstruct.prop->ptype,(PROPERTYCOMPAREOP)op,get_addr(),a,b,NULL); - }; - - // Method: compare_string(enumeration op, char *a, char *b=NULL) - inline bool compare_with_string(enumeration op, const char *a, const char *b=NULL, const char *p=NULL) - { - return callback->properties.compare_basic_str(pstruct.prop,(PROPERTYCOMPAREOP)op,get_addr(),a,b,p); - }; + // // Method: compare(enumeration op, char *a, char *b, char *p) + // inline bool compare(enumeration op, const char *a, const char *b, const char *p) + // { + // double v1, v2; v1=atof(a); v2=b?atof(b):0; + // return callback->properties.compare_basic(pstruct.prop->ptype,(PROPERTYCOMPAREOP)op,get_addr(),(void*)&v1,b?(void*)&v2:NULL, p); + // }; + + // // Method: compare(enumeration op, double *a, double *b=NULL, char *p=NULL) + // inline bool compare(enumeration op, double *a, double *b=NULL, const char *p=NULL) + // { + // return callback->properties.compare_basic(pstruct.prop->ptype,(PROPERTYCOMPAREOP)op,get_addr(),a,b,p); + // }; + + // // Method: compare(enumeration op, void *a, void *b=NULL) + // inline bool compare(enumeration op, void *a, void *b=NULL) + // { + // return callback->properties.compare_basic(pstruct.prop->ptype,(PROPERTYCOMPAREOP)op,get_addr(),a,b,NULL); + // }; + + // // Method: compare_string(enumeration op, char *a, char *b=NULL) + // inline bool compare_with_string(enumeration op, const char *a, const char *b=NULL, const char *p=NULL) + // { + // return callback->properties.compare_basic_str(pstruct.prop,(PROPERTYCOMPAREOP)op,get_addr(),a,b,p); + // }; // Method: call(char *buffer, size_t len) inline int call(char *buffer, size_t len) { return (*(pstruct.prop->method))(obj,buffer,len); }; diff --git a/gldcore/module.cpp b/gldcore/module.cpp index 3fd4d3656..ce3237876 100644 --- a/gldcore/module.cpp +++ b/gldcore/module.cpp @@ -200,7 +200,7 @@ static CALLBACKS callbacks = { class_define_enumeration_member, class_define_set_member, {object_get_first,object_set_dependent,object_set_parent,object_set_rank,object_get_header_string,}, - {object_get_property, object_set_value_by_addr,object_get_value_by_addr, object_set_value_by_name,object_get_value_by_name,object_get_reference,object_get_unit,object_get_addr,class_string_to_propertytype,property_compare_basic,property_compare_op,property_get_part,property_getspec,property_compare_basic_str}, + {object_get_property, object_set_value_by_addr,object_get_value_by_addr, object_set_value_by_name,object_get_value_by_name,object_get_reference,object_get_unit,object_get_addr,class_string_to_propertytype,property_compare_basic,property_compare_op,property_get_part,property_getspec,property_compare_basic_str,property_compare}, {find_objects,find_next,findlist_copy,findlist_add,findlist_del,findlist_clear,findlist_create}, class_find_property, module_malloc, diff --git a/gldcore/object.h b/gldcore/object.h index d2acf8965..185aa241b 100644 --- a/gldcore/object.h +++ b/gldcore/object.h @@ -164,6 +164,7 @@ typedef struct s_callbacks { double (*get_part)(OBJECT*,PROPERTY*,const char*); PROPERTYSPEC *(*get_spec)(PROPERTYTYPE); bool (*compare_basic_str)(PROPERTY*,PROPERTYCOMPAREOP,void*,const char*,const char*,const char*); + int (*compare)(PROPERTY *p, void *data, PROPERTYCOMPAREOP op, const char *a, const char *b, const char *part); } properties; struct { struct s_findlist *(*objects)(struct s_findlist *,...); diff --git a/gldcore/property.cpp b/gldcore/property.cpp index 3cce55262..88b79b2e1 100644 --- a/gldcore/property.cpp +++ b/gldcore/property.cpp @@ -63,6 +63,17 @@ const char *property_getdefault(PROPERTYTYPE ptype) { return property_type[ptype].default_value; } +const char *property_gettypename(PROPERTYTYPE ptype) +{ + if ( ptype > _PT_FIRST && ptype < _PT_LAST ) + { + return property_type[ptype].name; + } + else + { + return "invalid"; + } +} /** Check whether the properties as defined are mapping safely to memory @return 0 on failure, 1 on success @@ -665,4 +676,63 @@ int convert_from_string(char *buffer, int len, void *data, PROPERTY *p) int n = snprintf(buffer,(size_t)len,"%s",(*str)->c_str()); return n; } + +int property_compare ( + PROPERTY *p, ///< property definition + void *data, ///< data pointer + PROPERTYCOMPAREOP op, ///< comparison operator + const char *a, ///< primary argument + const char *b, ///< secondary argumenet + const char *part ) ///< property part specification +{ + switch ( p->ptype ) + { + case PT_void: + return strcmp(a,"") == 0; + case PT_double: + case PT_loadshape: + case PT_enduse: + case PT_random: + if ( part != NULL ) + { + return convert_compare(data,op,a,b,p,part); + } + else + { + return convert_compare(*(double*)data,op,a,b,p); + } + case PT_complex: + return convert_compare(*(complex*)data,op,a,b,p,part); + case PT_enumeration: + return convert_compare(*(enumeration*)data,op,a,b,p); + case PT_set: + return convert_compare(*(set*)data,op,a,b,p); + case PT_int16: + return convert_compare(*(int16*)data,op,a,b,p); + case PT_int32: + return convert_compare(*(int32*)data,op,a,b,p); + case PT_int64: + return convert_compare_i(*(int64*)data,op,a,b,p); + case PT_char8: + case PT_char32: + case PT_char256: + case PT_char1024: + return convert_compare(*(varchar*)data,op,a,b,p); + case PT_object: + return convert_compare(*(object*)data,op,a,b,p); + case PT_bool: + return convert_compare(*(bool*)data,op,a,b,p); + case PT_timestamp: + return convert_compare(*(TIMESTAMP*)data,op,a,b,p,part); + case PT_string: + case PT_double_array: + case PT_complex_array: + case PT_real: + case PT_float: + case PT_method: + default: + output_warning("property_compare() not implemented for property type '%s'",property_gettypename(p->ptype)); + } + return -1; +} // EOF diff --git a/gldcore/property.h b/gldcore/property.h index ba5e75828..2700c844c 100644 --- a/gldcore/property.h +++ b/gldcore/property.h @@ -1875,6 +1875,15 @@ int convert_to_string(const char *s, void *data, PROPERTY *p); */ int convert_from_string(char *buffer, int len, void *data, PROPERTY *p); +/* Function: compare_to_property + + Returns: + -1: comparison is impossible + 0: comparison is false + 1: comparison is true + */ +int property_compare(PROPERTY *p, void *data, PROPERTYCOMPAREOP op, const char *a, const char *b = NULL, const char *part = NULL); + // EOF #ifdef __cplusplus diff --git a/gldcore/rt/gridlabd.h b/gldcore/rt/gridlabd.h index 6c8995bca..9636599e9 100644 --- a/gldcore/rt/gridlabd.h +++ b/gldcore/rt/gridlabd.h @@ -327,6 +327,34 @@ class complex { inline bool IsFinite(void) { return isfinite(r) && isfinite(i); }; }; +double complex_get_part(complex z, const char *part) +{ + if ( strcmp(part,"real") == 0 ) + { + return z.Re(); + } + else if ( strcmp(part,"imag") == 0 ) + { + return z.Im(); + } + else if ( strcmp(part,"abs") == 0 || strcmp(part,"mag") == 0 ) + { + return z.Mag(); + } + else if ( strcmp(part,"arg") == 0 ) + { + return z.Arg(); + } + else if ( strcmp(part,"ang") == 0 ) + { + return z.Ang(); + } + else + { + return QNAN; + } +} + #ifdef REAL4 typedef float real; #else @@ -1226,6 +1254,7 @@ typedef struct s_callbacks { double (*get_part)(OBJECT*,PROPERTY*,char*); PROPERTYSPEC *(*get_spec)(PROPERTYTYPE ptype); bool (*compare_basic_str)(PROPERTY*,PROPERTYCOMPAREOP,void*,const char*,const char*,const char*); + int (*compare)(PROPERTY *p, void *data, PROPERTYCOMPAREOP op, const char *a, const char *b); } properties; struct { struct s_findlist *(*objects)(struct s_findlist *,...); From ce43e0ba1770390937d23729a8807a23f9be2ede Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Mon, 31 Aug 2020 07:58:18 -0700 Subject: [PATCH 012/117] Update version.h --- gldcore/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gldcore/version.h b/gldcore/version.h index 0b4f66fb0..9a6096b5a 100644 --- a/gldcore/version.h +++ b/gldcore/version.h @@ -9,9 +9,9 @@ #error "this header may only be included from gldcore.h or gridlabd.h" #endif -#define REV_MAJOR 4 -#define REV_MINOR 2 -#define REV_PATCH 10 +#define REV_MAJOR 5 +#define REV_MINOR 0 +#define REV_PATCH 0 #ifdef HAVE_CONFIG_H #include "config.h" From fe976f9c6ea674029cb51b84cdd30a4440a0a009 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Mon, 31 Aug 2020 08:00:10 -0700 Subject: [PATCH 013/117] Update test_assert.glm --- assert/autotest/test_assert.glm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/assert/autotest/test_assert.glm b/assert/autotest/test_assert.glm index 13d4f3149..35ce00ec3 100644 --- a/assert/autotest/test_assert.glm +++ b/assert/autotest/test_assert.glm @@ -296,16 +296,17 @@ object test { // timestamp target object test { - timestamp_value '2001-02-03 04:56:27 PST'; + timestamp_value "2001-02-03 04:56:27 PST"; object assert { target "timestamp_value"; relation "=="; - value '2001-02-03 04:56:27 PST'; - }; + value "2001-02-03 04:56:27 PST"; + }; return -1; + object assert { target "timestamp_value"; relation "!="; - value '2001-02-03 04:56:28 PST'; + value "2001-02-03 04:56:28 PST"; }; object assert { target "timestamp_value"; From 9a195c93fee28d69a1165eb577792c18fccdf164 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Mon, 11 Apr 2022 13:16:33 -0700 Subject: [PATCH 014/117] Remove gldcore (again) --- gldcore/autotest/ceus.glm | 12 - gldcore/autotest/config.glm | 3 - gldcore/autotest/ica_test.glm | 10 - gldcore/autotest/modify.glm | 1 - gldcore/build.h | 15 - gldcore/config.h | 548 - gldcore/config.h.in | 547 - gldcore/config.h.in~ | 547 - gldcore/converters/autotest/IEEE-123-cyme.png | Bin 199398 -> 0 bytes gldcore/converters/autotest/IEEE-13-cyme.png | Bin 74802 -> 0 bytes .../converters/autotest/solver_nr_profile.csv | 12543 ---------------- .../converters/autotest/table2glm_input.glm | 11 - .../autotest/table2glm_input_noclass.glm | 6 - .../autotest/table2glm_input_noname.glm | 6 - gldcore/gridlabd | 370 - gldcore/stamp-h1 | 1 - 16 files changed, 14620 deletions(-) delete mode 100644 gldcore/autotest/ceus.glm delete mode 100644 gldcore/autotest/config.glm delete mode 100644 gldcore/autotest/ica_test.glm delete mode 100644 gldcore/autotest/modify.glm delete mode 100644 gldcore/build.h delete mode 100644 gldcore/config.h delete mode 100644 gldcore/config.h.in delete mode 100644 gldcore/config.h.in~ delete mode 100644 gldcore/converters/autotest/IEEE-123-cyme.png delete mode 100644 gldcore/converters/autotest/IEEE-13-cyme.png delete mode 100644 gldcore/converters/autotest/solver_nr_profile.csv delete mode 100644 gldcore/converters/autotest/table2glm_input.glm delete mode 100644 gldcore/converters/autotest/table2glm_input_noclass.glm delete mode 100644 gldcore/converters/autotest/table2glm_input_noname.glm delete mode 100755 gldcore/gridlabd delete mode 100644 gldcore/stamp-h1 diff --git a/gldcore/autotest/ceus.glm b/gldcore/autotest/ceus.glm deleted file mode 100644 index d8c6fb16d..000000000 --- a/gldcore/autotest/ceus.glm +++ /dev/null @@ -1,12 +0,0 @@ - -// generated by csv-ceus2glm-ceus.py -object ceus { - filename "../ceus.csv"; - total_real_power "0.0"; - total_reactive_power "0.0"; - total_power_A "0+0i"; - total_power_B "0+0i"; - total_power_C "0+0i"; - name "building"; - floor_area "15000sf"; -} diff --git a/gldcore/autotest/config.glm b/gldcore/autotest/config.glm deleted file mode 100644 index 84862e853..000000000 --- a/gldcore/autotest/config.glm +++ /dev/null @@ -1,3 +0,0 @@ -#set strictnames=FALSE -#define TEST1=A -#define TEST2=B diff --git a/gldcore/autotest/ica_test.glm b/gldcore/autotest/ica_test.glm deleted file mode 100644 index 357626c1d..000000000 --- a/gldcore/autotest/ica_test.glm +++ /dev/null @@ -1,10 +0,0 @@ -#define v_per_unit_max_limit="1.05" -#define v_per_unit_min_limit="0.95" -#define change_in_voltage_limit="3" -#define linear_search_step="5000" -#define linear_search_initial="1000" -#define ica_type="1" -#define binary_search_initial="1000" -#define bineary_search_step="500000" -#define bineary_search_tolerance="500" -#define bineary_search_max="15000000" diff --git a/gldcore/autotest/modify.glm b/gldcore/autotest/modify.glm deleted file mode 100644 index 161a35dd2..000000000 --- a/gldcore/autotest/modify.glm +++ /dev/null @@ -1 +0,0 @@ -modify test.var "2.0"; diff --git a/gldcore/build.h b/gldcore/build.h deleted file mode 100644 index f6d55b4a3..000000000 --- a/gldcore/build.h +++ /dev/null @@ -1,15 +0,0 @@ -// /Users/fxie2/github/gridlabd/gldcore/build.h 220110 -#define BUILDNUM 220110 -#define BRANCH "develop_add_cyme_converter" -#define REV_YEAR 2022 -#define BUILD_NAME "origin" -#define BUILD_URL "https://github.com/slacgismo/gridlabd" -#define BUILD_BRANCH "develop-add-cyme-converter" -#define BUILD_SYSTEM "Darwin" -#define BUILD_RELEASE "Darwin 19.6.0" -#define BUILD_ID "073e70afa13e52ed2b85e82a4717694412710708" -#define BUILD_OPTIONS "module/mysql" -#define BUILD_STATUS "## develop-add-cyme-converter...origin/develop-add-cyme-converter [ahead 6]\n"\ -"?? dist/\n"\ -"?? gridlabd.egg-info/\n"\ -"" diff --git a/gldcore/config.h b/gldcore/config.h deleted file mode 100644 index a5b1a2841..000000000 --- a/gldcore/config.h +++ /dev/null @@ -1,548 +0,0 @@ -/* gldcore/config.h. Generated from config.h.in by configure. */ -/* gldcore/config.h.in. Generated from configure.ac by autoheader. */ - -/* Dynamic library extension */ -#define DLEXT ".so" - -/* "Check for existence of dynamic proc functions" */ -/* #undef DYN_PROC_AFFINITY */ - -/* Define to 1 if you have the `alarm' function. */ -#define HAVE_ALARM 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ARPA_INET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ASSERT_H 1 - -/* Define to 1 if you have the `atexit' function. */ -#define HAVE_ATEXIT 1 - -/* Define to 1 if you have the `bindprocessor' function. */ -/* #undef HAVE_BINDPROCESSOR */ - -/* Define to 1 if you have the `bzero' function. */ -#define HAVE_BZERO 1 - -/* Define if CPU_SET and CPU_ZERO defined */ -/* #undef HAVE_CPU_SET_MACROS */ - -/* Define if cpu_set_t is defined in sched.h */ -/* #undef HAVE_CPU_SET_T */ - -/* Define to 1 if you have the header file. */ -#define HAVE_CTYPE_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_CURL_CURL_H 1 - -/* Define to 1 if a SysV or X/Open compatible Curses library is present */ -#define HAVE_CURSES 1 - -/* Define to 1 if library supports color (enhanced functions) */ -#define HAVE_CURSES_COLOR 1 - -/* Define to 1 if library supports X/Open Enhanced functions */ -/* #undef HAVE_CURSES_ENHANCED */ - -/* Define to 1 if is present */ -/* #undef HAVE_CURSES_H */ - -/* Define to 1 if library supports certain obsolete features */ -#define HAVE_CURSES_OBSOLETE 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_DIRECT_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DIRENT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -/* #undef HAVE_DOPRNT */ - -/* Define to 1 if you have the `dup2' function. */ -#define HAVE_DUP2 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_ERRNO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_FLOAT_H 1 - -/* Define to 1 if you have the `floor' function. */ -#define HAVE_FLOOR 1 - -/* Define to 1 if you have the `fork' function. */ -#define HAVE_FORK 1 - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#define HAVE_FSEEKO 1 - -/* Define to 1 if you have the `ftime' function. */ -#define HAVE_FTIME 1 - -/* Define to 1 if you have the `getcwd' function. */ -#define HAVE_GETCWD 1 - -/* Define to 1 if you have the `gethostbyname' function. */ -#define HAVE_GETHOSTBYNAME 1 - -/* Define to 1 if you have the `gethrtime' function. */ -/* #undef HAVE_GETHRTIME */ - -/* Define to 1 if you have the `getpagesize' function. */ -#define HAVE_GETPAGESIZE 1 - -/* Define to 1 if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 - -/* Define this if get_nprocs is available */ -/* #undef HAVE_GET_NPROCS */ - -/* Define to 1 if you have the `inet_ntoa' function. */ -#define HAVE_INET_NTOA 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_IO_H */ - -/* Define to 1 if you have the isfinite function. */ -#define HAVE_ISFINITE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_LIST 1 - -/* Define to 1 if you have the `localeconv' function. */ -#define HAVE_LOCALECONV 1 - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#define HAVE_MALLOC 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_MALLOC_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_MATH_H 1 - -/* Define to 1 if you have the `memchr' function. */ -#define HAVE_MEMCHR 1 - -/* Define to 1 if you have the `memmove' function. */ -#define HAVE_MEMMOVE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have the `mkdir' function. */ -#define HAVE_MKDIR 1 - -/* Define to 1 if you have a working `mmap' system call. */ -#define HAVE_MMAP 1 - -/* Define to 1 if you have the `modf' function. */ -#define HAVE_MODF 1 - -/* Define to 1 if you have the `munmap' function. */ -#define HAVE_MUNMAP 1 - -/* Define to 1 if the Ncurses library is present */ -#define HAVE_NCURSES 1 - -/* Define to 1 if the NcursesW library is present */ -/* #undef HAVE_NCURSESW */ - -/* Define to 1 if is present */ -/* #undef HAVE_NCURSESW_CURSES_H */ - -/* Define to 1 if is present */ -/* #undef HAVE_NCURSESW_H */ - -/* Define to 1 if is present */ -/* #undef HAVE_NCURSES_CURSES_H */ - -/* Define to 1 if is present */ -#define HAVE_NCURSES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETDB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_NETINET_IN_H 1 - -/* Define is the OSX thread affinity policy macros defined */ -/* #undef HAVE_OSX_THREAD_AFFINITY */ - -/* Define to 1 if you have the `pow' function. */ -#define HAVE_POW 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_PROCESS_H */ - -/* Define if you have POSIX threads libraries and header files. */ -#define HAVE_PTHREAD 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_PTHREAD_H 1 - -/* Have PTHREAD_PRIO_INHERIT. */ -#define HAVE_PTHREAD_PRIO_INHERIT 1 - -/* Define to 1 if the system has the type `ptrdiff_t'. */ -#define HAVE_PTRDIFF_T 1 - -/* Define to 1 if you have the `putenv' function. */ -#define HAVE_PUTENV 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_PWD_H 1 - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#define HAVE_REALLOC 1 - -/* Define to 1 if you have the `rmdir' function. */ -#define HAVE_RMDIR 1 - -/* Define to 1 if you have the `sched_getaffinity' function. */ -/* #undef HAVE_SCHED_GETAFFINITY */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SCHED_H 1 - -/* Define to 1 if you have the `sched_setaffinity' function. */ -/* #undef HAVE_SCHED_SETAFFINITY */ - -/* Define to 1 if you have the `select' function. */ -#define HAVE_SELECT 1 - -/* Define to 1 if you have the `setenv' function. */ -#define HAVE_SETENV 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SETJMP_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SIGNAL_H 1 - -/* Define to 1 if you have the `socket' function. */ -#define HAVE_SOCKET 1 - -/* Define to 1 if you have the `sqrt' function. */ -#define HAVE_SQRT 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDARG_H 1 - -/* Define to 1 if stdbool.h conforms to C99. */ -/* #undef HAVE_STDBOOL_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDIO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strcasecmp' function. */ -#define HAVE_STRCASECMP 1 - -/* Define to 1 if you have the `strchr' function. */ -#define HAVE_STRCHR 1 - -/* Define to 1 if you have the `strcspn' function. */ -#define HAVE_STRCSPN 1 - -/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 - -/* Define to 1 if you have the `strerror' function. */ -#define HAVE_STRERROR 1 - -/* Define to 1 if you have the `strftime' function. */ -#define HAVE_STRFTIME 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strndup' function. */ -#define HAVE_STRNDUP 1 - -/* Define to 1 if you have the `strpbrk' function. */ -#define HAVE_STRPBRK 1 - -/* Define to 1 if you have the `strrchr' function. */ -#define HAVE_STRRCHR 1 - -/* Define to 1 if you have the `strspn' function. */ -#define HAVE_STRSPN 1 - -/* Define to 1 if you have the `strstr' function. */ -#define HAVE_STRSTR 1 - -/* Define to 1 if you have the `strtol' function. */ -#define HAVE_STRTOL 1 - -/* Define to 1 if you have the `strtoul' function. */ -#define HAVE_STRTOUL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_ERRNO_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_PARAM_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SELECT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SIGNAL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_SOCKET_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIMEB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIME_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_UNISTD_H 1 - -/* Define to 1 if you have the `thread_policy_set' function. */ -#define HAVE_THREAD_POLICY_SET 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_TIME_H 1 - -/* Define to 1 if you have the `tzset' function. */ -#define HAVE_TZSET 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_VECTOR 1 - -/* Define to 1 if you have the `vfork' function. */ -#define HAVE_VFORK 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_VFORK_H */ - -/* Define to 1 if you have the `vprintf' function. */ -#define HAVE_VPRINTF 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_WCHAR_H 1 - -/* Define to 1 if `fork' works. */ -#define HAVE_WORKING_FORK 1 - -/* Define to 1 if `vfork' works. */ -#define HAVE_WORKING_VFORK 1 - -/* Define to 1 if the system has the type `_Bool'. */ -/* #undef HAVE__BOOL */ - -/* Define to 1 if you have the `__sync_add_and_fetch' builtin. */ -#define HAVE___SYNC_ADD_AND_FETCH 1 - -/* Define to 1 if you have the `__sync_bool_compare_and_swap' builtin. */ -#define HAVE___SYNC_BOOL_COMPARE_AND_SWAP 1 - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "gridlabd" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "gridlabd@gmail.com" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "HiPAS GridLAB-D" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "HiPAS GridLAB-D 4.2.30" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "gridlabd" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "4.2.30" - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -/* #undef PTHREAD_CREATE_JOINABLE */ - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#define TIME_WITH_SYS_TIME 1 - -/* Define to 1 if your declares `struct tm'. */ -/* #undef TM_IN_SYS_TIME */ - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# define _ALL_SOURCE 1 -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# define _GNU_SOURCE 1 -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# define _POSIX_PTHREAD_SEMANTICS 1 -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# define _TANDEM_SOURCE 1 -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# define __EXTENSIONS__ 1 -#endif - - -/* Version number of package */ -#define VERSION "4.2.30" - -/* Define to 1 if the X Window System is missing or not being used. */ -/* #undef X_DISPLAY_MISSING */ - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -/* #undef _LARGEFILE_SOURCE */ - -/* Define to 1 if on MINIX. */ -/* #undef _MINIX */ - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -/* #undef _POSIX_1_SOURCE */ - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -/* #undef _POSIX_SOURCE */ - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT32_T */ - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT64_T */ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -/* #undef int16_t */ - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -/* #undef int32_t */ - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -/* #undef int64_t */ - -/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -/* #undef int8_t */ - -/* Define to rpl_malloc if the replacement function should be used. */ -/* #undef malloc */ - -/* Define to `int' if does not define. */ -/* #undef mode_t */ - -/* Define to `long int' if does not define. */ -/* #undef off_t */ - -/* Define to `int' if does not define. */ -/* #undef pid_t */ - -/* Define to rpl_realloc if the replacement function should be used. */ -/* #undef realloc */ - -/* Define to the equivalent of the C99 'restrict' keyword, or to - nothing if this is not supported. Do not define if restrict is - supported directly. */ -#define restrict __restrict -/* Work around a bug in Sun C++: it does not support _Restrict or - __restrict__, even though the corresponding Sun C compiler ends up with - "#define restrict _Restrict" or "#define restrict __restrict__" in the - previous line. Perhaps some future version of Sun C++ will work with - restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ -#if defined __SUNPRO_CC && !defined __RESTRICT -# define _Restrict -# define __restrict__ -#endif - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint16_t */ - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint32_t */ - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint64_t */ - -/* Define as `fork' if `vfork' does not work. */ -/* #undef vfork */ diff --git a/gldcore/config.h.in b/gldcore/config.h.in deleted file mode 100644 index 4d0e9f011..000000000 --- a/gldcore/config.h.in +++ /dev/null @@ -1,547 +0,0 @@ -/* gldcore/config.h.in. Generated from configure.ac by autoheader. */ - -/* Dynamic library extension */ -#undef DLEXT - -/* "Check for existence of dynamic proc functions" */ -#undef DYN_PROC_AFFINITY - -/* Define to 1 if you have the `alarm' function. */ -#undef HAVE_ALARM - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the `atexit' function. */ -#undef HAVE_ATEXIT - -/* Define to 1 if you have the `bindprocessor' function. */ -#undef HAVE_BINDPROCESSOR - -/* Define to 1 if you have the `bzero' function. */ -#undef HAVE_BZERO - -/* Define if CPU_SET and CPU_ZERO defined */ -#undef HAVE_CPU_SET_MACROS - -/* Define if cpu_set_t is defined in sched.h */ -#undef HAVE_CPU_SET_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CURL_CURL_H - -/* Define to 1 if a SysV or X/Open compatible Curses library is present */ -#undef HAVE_CURSES - -/* Define to 1 if library supports color (enhanced functions) */ -#undef HAVE_CURSES_COLOR - -/* Define to 1 if library supports X/Open Enhanced functions */ -#undef HAVE_CURSES_ENHANCED - -/* Define to 1 if is present */ -#undef HAVE_CURSES_H - -/* Define to 1 if library supports certain obsolete features */ -#undef HAVE_CURSES_OBSOLETE - -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `dup2' function. */ -#undef HAVE_DUP2 - -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if you have the `floor' function. */ -#undef HAVE_FLOOR - -/* Define to 1 if you have the `fork' function. */ -#undef HAVE_FORK - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#undef HAVE_FSEEKO - -/* Define to 1 if you have the `ftime' function. */ -#undef HAVE_FTIME - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `gethostbyname' function. */ -#undef HAVE_GETHOSTBYNAME - -/* Define to 1 if you have the `gethrtime' function. */ -#undef HAVE_GETHRTIME - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define this if get_nprocs is available */ -#undef HAVE_GET_NPROCS - -/* Define to 1 if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IO_H - -/* Define to 1 if you have the isfinite function. */ -#undef HAVE_ISFINITE - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIST - -/* Define to 1 if you have the `localeconv' function. */ -#undef HAVE_LOCALECONV - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MATH_H - -/* Define to 1 if you have the `memchr' function. */ -#undef HAVE_MEMCHR - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the `mkdir' function. */ -#undef HAVE_MKDIR - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `modf' function. */ -#undef HAVE_MODF - -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if the Ncurses library is present */ -#undef HAVE_NCURSES - -/* Define to 1 if the NcursesW library is present */ -#undef HAVE_NCURSESW - -/* Define to 1 if is present */ -#undef HAVE_NCURSESW_CURSES_H - -/* Define to 1 if is present */ -#undef HAVE_NCURSESW_H - -/* Define to 1 if is present */ -#undef HAVE_NCURSES_CURSES_H - -/* Define to 1 if is present */ -#undef HAVE_NCURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define is the OSX thread affinity policy macros defined */ -#undef HAVE_OSX_THREAD_AFFINITY - -/* Define to 1 if you have the `pow' function. */ -#undef HAVE_POW - -/* Define to 1 if you have the header file. */ -#undef HAVE_PROCESS_H - -/* Define if you have POSIX threads libraries and header files. */ -#undef HAVE_PTHREAD - -/* Define to 1 if you have the header file. */ -#undef HAVE_PTHREAD_H - -/* Have PTHREAD_PRIO_INHERIT. */ -#undef HAVE_PTHREAD_PRIO_INHERIT - -/* Define to 1 if the system has the type `ptrdiff_t'. */ -#undef HAVE_PTRDIFF_T - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the `rmdir' function. */ -#undef HAVE_RMDIR - -/* Define to 1 if you have the `sched_getaffinity' function. */ -#undef HAVE_SCHED_GETAFFINITY - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCHED_H - -/* Define to 1 if you have the `sched_setaffinity' function. */ -#undef HAVE_SCHED_SETAFFINITY - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the header file. */ -#undef HAVE_SETJMP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SIGNAL_H - -/* Define to 1 if you have the `socket' function. */ -#undef HAVE_SOCKET - -/* Define to 1 if you have the `sqrt' function. */ -#undef HAVE_SQRT - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strcspn' function. */ -#undef HAVE_STRCSPN - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strftime' function. */ -#undef HAVE_STRFTIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strndup' function. */ -#undef HAVE_STRNDUP - -/* Define to 1 if you have the `strpbrk' function. */ -#undef HAVE_STRPBRK - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strspn' function. */ -#undef HAVE_STRSPN - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_ERRNO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SIGNAL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIMEB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UNISTD_H - -/* Define to 1 if you have the `thread_policy_set' function. */ -#undef HAVE_THREAD_POLICY_SET - -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the `tzset' function. */ -#undef HAVE_TZSET - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VECTOR - -/* Define to 1 if you have the `vfork' function. */ -#undef HAVE_VFORK - -/* Define to 1 if you have the header file. */ -#undef HAVE_VFORK_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCHAR_H - -/* Define to 1 if `fork' works. */ -#undef HAVE_WORKING_FORK - -/* Define to 1 if `vfork' works. */ -#undef HAVE_WORKING_VFORK - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to 1 if you have the `__sync_add_and_fetch' builtin. */ -#undef HAVE___SYNC_ADD_AND_FETCH - -/* Define to 1 if you have the `__sync_bool_compare_and_swap' builtin. */ -#undef HAVE___SYNC_BOOL_COMPARE_AND_SWAP - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -#undef PTHREAD_CREATE_JOINABLE - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - -/* Version number of package */ -#undef VERSION - -/* Define to 1 if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -#undef _LARGEFILE_SOURCE - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT32_T - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT64_T - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef int16_t - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef int32_t - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef int64_t - -/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -#undef int8_t - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to `int' if does not define. */ -#undef mode_t - -/* Define to `long int' if does not define. */ -#undef off_t - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to the equivalent of the C99 'restrict' keyword, or to - nothing if this is not supported. Do not define if restrict is - supported directly. */ -#undef restrict -/* Work around a bug in Sun C++: it does not support _Restrict or - __restrict__, even though the corresponding Sun C compiler ends up with - "#define restrict _Restrict" or "#define restrict __restrict__" in the - previous line. Perhaps some future version of Sun C++ will work with - restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ -#if defined __SUNPRO_CC && !defined __RESTRICT -# define _Restrict -# define __restrict__ -#endif - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef uint16_t - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef uint32_t - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef uint64_t - -/* Define as `fork' if `vfork' does not work. */ -#undef vfork diff --git a/gldcore/config.h.in~ b/gldcore/config.h.in~ deleted file mode 100644 index 4d0e9f011..000000000 --- a/gldcore/config.h.in~ +++ /dev/null @@ -1,547 +0,0 @@ -/* gldcore/config.h.in. Generated from configure.ac by autoheader. */ - -/* Dynamic library extension */ -#undef DLEXT - -/* "Check for existence of dynamic proc functions" */ -#undef DYN_PROC_AFFINITY - -/* Define to 1 if you have the `alarm' function. */ -#undef HAVE_ALARM - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the `atexit' function. */ -#undef HAVE_ATEXIT - -/* Define to 1 if you have the `bindprocessor' function. */ -#undef HAVE_BINDPROCESSOR - -/* Define to 1 if you have the `bzero' function. */ -#undef HAVE_BZERO - -/* Define if CPU_SET and CPU_ZERO defined */ -#undef HAVE_CPU_SET_MACROS - -/* Define if cpu_set_t is defined in sched.h */ -#undef HAVE_CPU_SET_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CURL_CURL_H - -/* Define to 1 if a SysV or X/Open compatible Curses library is present */ -#undef HAVE_CURSES - -/* Define to 1 if library supports color (enhanced functions) */ -#undef HAVE_CURSES_COLOR - -/* Define to 1 if library supports X/Open Enhanced functions */ -#undef HAVE_CURSES_ENHANCED - -/* Define to 1 if is present */ -#undef HAVE_CURSES_H - -/* Define to 1 if library supports certain obsolete features */ -#undef HAVE_CURSES_OBSOLETE - -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `dup2' function. */ -#undef HAVE_DUP2 - -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if you have the `floor' function. */ -#undef HAVE_FLOOR - -/* Define to 1 if you have the `fork' function. */ -#undef HAVE_FORK - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#undef HAVE_FSEEKO - -/* Define to 1 if you have the `ftime' function. */ -#undef HAVE_FTIME - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `gethostbyname' function. */ -#undef HAVE_GETHOSTBYNAME - -/* Define to 1 if you have the `gethrtime' function. */ -#undef HAVE_GETHRTIME - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define this if get_nprocs is available */ -#undef HAVE_GET_NPROCS - -/* Define to 1 if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IO_H - -/* Define to 1 if you have the isfinite function. */ -#undef HAVE_ISFINITE - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIST - -/* Define to 1 if you have the `localeconv' function. */ -#undef HAVE_LOCALECONV - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MATH_H - -/* Define to 1 if you have the `memchr' function. */ -#undef HAVE_MEMCHR - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the `mkdir' function. */ -#undef HAVE_MKDIR - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `modf' function. */ -#undef HAVE_MODF - -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if the Ncurses library is present */ -#undef HAVE_NCURSES - -/* Define to 1 if the NcursesW library is present */ -#undef HAVE_NCURSESW - -/* Define to 1 if is present */ -#undef HAVE_NCURSESW_CURSES_H - -/* Define to 1 if is present */ -#undef HAVE_NCURSESW_H - -/* Define to 1 if is present */ -#undef HAVE_NCURSES_CURSES_H - -/* Define to 1 if is present */ -#undef HAVE_NCURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define is the OSX thread affinity policy macros defined */ -#undef HAVE_OSX_THREAD_AFFINITY - -/* Define to 1 if you have the `pow' function. */ -#undef HAVE_POW - -/* Define to 1 if you have the header file. */ -#undef HAVE_PROCESS_H - -/* Define if you have POSIX threads libraries and header files. */ -#undef HAVE_PTHREAD - -/* Define to 1 if you have the header file. */ -#undef HAVE_PTHREAD_H - -/* Have PTHREAD_PRIO_INHERIT. */ -#undef HAVE_PTHREAD_PRIO_INHERIT - -/* Define to 1 if the system has the type `ptrdiff_t'. */ -#undef HAVE_PTRDIFF_T - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define to 1 if you have the `rmdir' function. */ -#undef HAVE_RMDIR - -/* Define to 1 if you have the `sched_getaffinity' function. */ -#undef HAVE_SCHED_GETAFFINITY - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCHED_H - -/* Define to 1 if you have the `sched_setaffinity' function. */ -#undef HAVE_SCHED_SETAFFINITY - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the header file. */ -#undef HAVE_SETJMP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SIGNAL_H - -/* Define to 1 if you have the `socket' function. */ -#undef HAVE_SOCKET - -/* Define to 1 if you have the `sqrt' function. */ -#undef HAVE_SQRT - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strcspn' function. */ -#undef HAVE_STRCSPN - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strftime' function. */ -#undef HAVE_STRFTIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strndup' function. */ -#undef HAVE_STRNDUP - -/* Define to 1 if you have the `strpbrk' function. */ -#undef HAVE_STRPBRK - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strspn' function. */ -#undef HAVE_STRSPN - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_ERRNO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SIGNAL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIMEB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UNISTD_H - -/* Define to 1 if you have the `thread_policy_set' function. */ -#undef HAVE_THREAD_POLICY_SET - -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the `tzset' function. */ -#undef HAVE_TZSET - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VECTOR - -/* Define to 1 if you have the `vfork' function. */ -#undef HAVE_VFORK - -/* Define to 1 if you have the header file. */ -#undef HAVE_VFORK_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCHAR_H - -/* Define to 1 if `fork' works. */ -#undef HAVE_WORKING_FORK - -/* Define to 1 if `vfork' works. */ -#undef HAVE_WORKING_VFORK - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to 1 if you have the `__sync_add_and_fetch' builtin. */ -#undef HAVE___SYNC_ADD_AND_FETCH - -/* Define to 1 if you have the `__sync_bool_compare_and_swap' builtin. */ -#undef HAVE___SYNC_BOOL_COMPARE_AND_SWAP - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -#undef PTHREAD_CREATE_JOINABLE - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - -/* Version number of package */ -#undef VERSION - -/* Define to 1 if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -#undef _LARGEFILE_SOURCE - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT32_T - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT64_T - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef int16_t - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef int32_t - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef int64_t - -/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -#undef int8_t - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to `int' if does not define. */ -#undef mode_t - -/* Define to `long int' if does not define. */ -#undef off_t - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to the equivalent of the C99 'restrict' keyword, or to - nothing if this is not supported. Do not define if restrict is - supported directly. */ -#undef restrict -/* Work around a bug in Sun C++: it does not support _Restrict or - __restrict__, even though the corresponding Sun C compiler ends up with - "#define restrict _Restrict" or "#define restrict __restrict__" in the - previous line. Perhaps some future version of Sun C++ will work with - restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ -#if defined __SUNPRO_CC && !defined __RESTRICT -# define _Restrict -# define __restrict__ -#endif - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef uint16_t - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef uint32_t - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef uint64_t - -/* Define as `fork' if `vfork' does not work. */ -#undef vfork diff --git a/gldcore/converters/autotest/IEEE-123-cyme.png b/gldcore/converters/autotest/IEEE-123-cyme.png deleted file mode 100644 index 79e7e8a1571006654a0cc40bc909618406fc1eca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 199398 zcmeFZbySvF*gcFfIyxw0D+r7MiW1V&j!C0*BT~}cX)+clB}f^BwD8cWqM%49-60}f zQqsSDP-out#oyoh)_R#WBJw=XeV=o#b6tDyYoGhpdD(NDHqvgSqN3U)A%0q(ifX+V z71eK#e_w}xDSDvYgl__NXH@MJEDh}(b!`l&WOVJU%q;E9j4%D=U|?fwY-z#Gj{jKy zx@>1>Wh=lCl6fNdJwTg;L;`HB&PGLiB zj!xU_T1v)+ep?;2Mbe9^I&}M%s3X5$J$z=>g$K;^Z)Gq1t@x5retW8y*Z#vtWVWCA z^Gx&~;(Ya_;)){{r@jLdhHT)nS8#mupnJnI5&_W-7?kpsW?iezdBlr;V9K8=cPBl zQ%u)~#Y*@yGmEt_%RF)tJV+(`X8tf0Rp-&wBJ@ATp1gD0wr6d5j)NbcoXWN9_xs%4 zy@QrE{-1w-4?LnIIn!$E`>p3gZ~w7X-=7aQq?nGj7c^&CMzU+?KmYKMnaxXSjd(QJN^VO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