/* *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* */ /* ** Copyright UCAR */ /* ** University Corporation for Atmospheric Research (UCAR) */ /* ** National Center for Atmospheric Research (NCAR) */ /* ** Boulder, Colorado, USA */ /* ** BSD licence applies - redistribution and use in source and binary */ /* ** forms, with or without modification, are permitted provided that */ /* ** the following conditions are met: */ /* ** 1) If the software is modified to produce derivative works, */ /* ** such modified software should be clearly marked, so as not */ /* ** to confuse it with the version available from UCAR. */ /* ** 2) Redistributions of source code must retain the above copyright */ /* ** notice, this list of conditions and the following disclaimer. */ /* ** 3) Redistributions in binary form must reproduce the above copyright */ /* ** notice, this list of conditions and the following disclaimer in the */ /* ** documentation and/or other materials provided with the distribution. */ /* ** 4) Neither the name of UCAR nor the names of its contributors, */ /* ** if any, may be used to endorse or promote products derived from */ /* ** this software without specific prior written permission. */ /* ** DISCLAIMER: THIS SOFTWARE IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESS */ /* ** OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ /* ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* */ //////////////////////////////////////////// // Params.cc // // TDRP C++ code file for class 'Params'. // // Code for program EnsLookupGen // // This file has been automatically // generated by TDRP, do not modify. // ///////////////////////////////////////////// /** * * @file Params.cc * * @class Params * * This class is automatically generated by the Table * Driven Runtime Parameters (TDRP) system * * @note Source is automatically generated from * paramdef file at compile time, do not modify * since modifications will be overwritten. * * * @author Automatically generated * */ #include "Params.hh" #include //////////////////////////////////////////// // Default constructor // Params::Params() { // zero out table memset(_table, 0, sizeof(_table)); // zero out members memset(&_start_, 0, &_end_ - &_start_); // class name _className = "Params"; // initialize table _init(); // set members tdrpTable2User(_table, &_start_); _exitDeferred = false; } //////////////////////////////////////////// // Copy constructor // Params::Params(const Params& source) { // sync the source object source.sync(); // zero out table memset(_table, 0, sizeof(_table)); // zero out members memset(&_start_, 0, &_end_ - &_start_); // class name _className = "Params"; // copy table tdrpCopyTable((TDRPtable *) source._table, _table); // set members tdrpTable2User(_table, &_start_); _exitDeferred = false; } //////////////////////////////////////////// // Destructor // Params::~Params() { // free up freeAll(); } //////////////////////////////////////////// // Assignment // void Params::operator=(const Params& other) { // sync the other object other.sync(); // free up any existing memory freeAll(); // zero out table memset(_table, 0, sizeof(_table)); // zero out members memset(&_start_, 0, &_end_ - &_start_); // copy table tdrpCopyTable((TDRPtable *) other._table, _table); // set members tdrpTable2User(_table, &_start_); _exitDeferred = other._exitDeferred; } //////////////////////////////////////////// // loadFromArgs() // // Loads up TDRP using the command line args. // // Check usage() for command line actions associated with // this function. // // argc, argv: command line args // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // char **params_path_p: // If this is non-NULL, it is set to point to the path // of the params file used. // // bool defer_exit: normally, if the command args contain a // print or check request, this function will call exit(). // If defer_exit is set, such an exit is deferred and the // private member _exitDeferred is set. // Use exidDeferred() to test this flag. // // Returns 0 on success, -1 on failure. // int Params::loadFromArgs(int argc, char **argv, char **override_list, char **params_path_p, bool defer_exit) { int exit_deferred; if (_tdrpLoadFromArgs(argc, argv, _table, &_start_, override_list, params_path_p, _className, defer_exit, &exit_deferred)) { return (-1); } else { if (exit_deferred) { _exitDeferred = true; } return (0); } } //////////////////////////////////////////// // loadApplyArgs() // // Loads up TDRP using the params path passed in, and applies // the command line args for printing and checking. // // Check usage() for command line actions associated with // this function. // // const char *param_file_path: the parameter file to be read in // // argc, argv: command line args // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // bool defer_exit: normally, if the command args contain a // print or check request, this function will call exit(). // If defer_exit is set, such an exit is deferred and the // private member _exitDeferred is set. // Use exidDeferred() to test this flag. // // Returns 0 on success, -1 on failure. // int Params::loadApplyArgs(const char *params_path, int argc, char **argv, char **override_list, bool defer_exit) { int exit_deferred; if (tdrpLoadApplyArgs(params_path, argc, argv, _table, &_start_, override_list, _className, defer_exit, &exit_deferred)) { return (-1); } else { if (exit_deferred) { _exitDeferred = true; } return (0); } } //////////////////////////////////////////// // isArgValid() // // Check if a command line arg is a valid TDRP arg. // bool Params::isArgValid(const char *arg) { return (tdrpIsArgValid(arg)); } //////////////////////////////////////////// // load() // // Loads up TDRP for a given class. // // This version of load gives the programmer the option to load // up more than one class for a single application. It is a // lower-level routine than loadFromArgs, and hence more // flexible, but the programmer must do more work. // // const char *param_file_path: the parameter file to be read in. // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // expand_env: flag to control environment variable // expansion during tokenization. // If TRUE, environment expansion is set on. // If FALSE, environment expansion is set off. // // Returns 0 on success, -1 on failure. // int Params::load(const char *param_file_path, char **override_list, int expand_env, int debug) { if (tdrpLoad(param_file_path, _table, &_start_, override_list, expand_env, debug)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // loadFromBuf() // // Loads up TDRP for a given class. // // This version of load gives the programmer the option to // load up more than one module for a single application, // using buffers which have been read from a specified source. // // const char *param_source_str: a string which describes the // source of the parameter information. It is used for // error reporting only. // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // const char *inbuf: the input buffer // // int inlen: length of the input buffer // // int start_line_num: the line number in the source which // corresponds to the start of the buffer. // // expand_env: flag to control environment variable // expansion during tokenization. // If TRUE, environment expansion is set on. // If FALSE, environment expansion is set off. // // Returns 0 on success, -1 on failure. // int Params::loadFromBuf(const char *param_source_str, char **override_list, const char *inbuf, int inlen, int start_line_num, int expand_env, int debug) { if (tdrpLoadFromBuf(param_source_str, _table, &_start_, override_list, inbuf, inlen, start_line_num, expand_env, debug)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // loadDefaults() // // Loads up default params for a given class. // // See load() for more detailed info. // // Returns 0 on success, -1 on failure. // int Params::loadDefaults(int expand_env) { if (tdrpLoad(NULL, _table, &_start_, NULL, expand_env, FALSE)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // sync() // // Syncs the user struct data back into the parameter table, // in preparation for printing. // // This function alters the table in a consistent manner. // Therefore it can be regarded as const. // void Params::sync(void) const { tdrpUser2Table(_table, (char *) &_start_); } //////////////////////////////////////////// // print() // // Print params file // // The modes supported are: // // PRINT_SHORT: main comments only, no help or descriptions // structs and arrays on a single line // PRINT_NORM: short + descriptions and help // PRINT_LONG: norm + arrays and structs expanded // PRINT_VERBOSE: long + private params included // void Params::print(FILE *out, tdrp_print_mode_t mode) { tdrpPrint(out, _table, _className, mode); } //////////////////////////////////////////// // checkAllSet() // // Return TRUE if all set, FALSE if not. // // If out is non-NULL, prints out warning messages for those // parameters which are not set. // int Params::checkAllSet(FILE *out) { return (tdrpCheckAllSet(out, _table, &_start_)); } ////////////////////////////////////////////////////////////// // checkIsSet() // // Return TRUE if parameter is set, FALSE if not. // // int Params::checkIsSet(const char *paramName) { return (tdrpCheckIsSet(paramName, _table, &_start_)); } //////////////////////////////////////////// // freeAll() // // Frees up all TDRP dynamic memory. // void Params::freeAll(void) { tdrpFreeAll(_table, &_start_); } //////////////////////////////////////////// // usage() // // Prints out usage message for TDRP args as passed // in to loadFromArgs(). // void Params::usage(ostream &out) { out << "TDRP args: [options as below]\n" << " [ -params/--params path ] specify params file path\n" << " [ -check_params/--check_params] check which params are not set\n" << " [ -print_params/--print_params [mode]] print parameters\n" << " using following modes, default mode is 'norm'\n" << " short: main comments only, no help or descr\n" << " structs and arrays on a single line\n" << " norm: short + descriptions and help\n" << " long: norm + arrays and structs expanded\n" << " verbose: long + private params included\n" << " short_expand: short with env vars expanded\n" << " norm_expand: norm with env vars expanded\n" << " long_expand: long with env vars expanded\n" << " verbose_expand: verbose with env vars expanded\n" << " [ -tdrp_debug] debugging prints for tdrp\n" << " [ -tdrp_usage] print this usage\n"; } //////////////////////////////////////////// // arrayRealloc() // // Realloc 1D array. // // If size is increased, the values from the last array // entry is copied into the new space. // // Returns 0 on success, -1 on error. // int Params::arrayRealloc(const char *param_name, int new_array_n) { if (tdrpArrayRealloc(_table, &_start_, param_name, new_array_n)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // array2DRealloc() // // Realloc 2D array. // // If size is increased, the values from the last array // entry is copied into the new space. // // Returns 0 on success, -1 on error. // int Params::array2DRealloc(const char *param_name, int new_array_n1, int new_array_n2) { if (tdrpArray2DRealloc(_table, &_start_, param_name, new_array_n1, new_array_n2)) { return (-1); } else { return (0); } } //////////////////////////////////////////// // _init() // // Class table initialization function. // // void Params::_init() { TDRPtable *tt = _table; // Parameter 'Comment 0' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 0"); tt->comment_hdr = tdrpStrDup("EnsLookupGen"); tt->comment_text = tdrpStrDup(""); tt++; // Parameter 'Comment 1' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = COMMENT_TYPE; tt->param_name = tdrpStrDup("Comment 1"); tt->comment_hdr = tdrpStrDup("EnsLookupGen"); tt->comment_text = tdrpStrDup(""); tt++; // Parameter 'ensembleMembers' // ctype is 'char*' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = STRING_TYPE; tt->param_name = tdrpStrDup("ensembleMembers"); tt->descr = tdrpStrDup(""); tt->help = tdrpStrDup(""); tt->array_offset = (char *) &_ensembleMembers - &_start_; tt->array_n_offset = (char *) &ensembleMembers_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = FALSE; tt->array_elem_size = sizeof(char*); tt->array_n = 20; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].s = tdrpStrDup("gep01"); tt->array_vals[1].s = tdrpStrDup("gep02"); tt->array_vals[2].s = tdrpStrDup("gep03"); tt->array_vals[3].s = tdrpStrDup("gep04"); tt->array_vals[4].s = tdrpStrDup("gep05"); tt->array_vals[5].s = tdrpStrDup("gep06"); tt->array_vals[6].s = tdrpStrDup("gep07"); tt->array_vals[7].s = tdrpStrDup("gep08"); tt->array_vals[8].s = tdrpStrDup("gep09"); tt->array_vals[9].s = tdrpStrDup("gep10"); tt->array_vals[10].s = tdrpStrDup("gep11"); tt->array_vals[11].s = tdrpStrDup("gep12"); tt->array_vals[12].s = tdrpStrDup("gep13"); tt->array_vals[13].s = tdrpStrDup("gep14"); tt->array_vals[14].s = tdrpStrDup("gep15"); tt->array_vals[15].s = tdrpStrDup("gep16"); tt->array_vals[16].s = tdrpStrDup("gep17"); tt->array_vals[17].s = tdrpStrDup("gep18"); tt->array_vals[18].s = tdrpStrDup("gep19"); tt->array_vals[19].s = tdrpStrDup("gep20"); tt++; // Parameter 'extendedProjectionFile' // ctype is 'char*' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = STRING_TYPE; tt->param_name = tdrpStrDup("extendedProjectionFile"); tt->descr = tdrpStrDup(""); tt->help = tdrpStrDup("Projection file for extended domain"); tt->val_offset = (char *) &extendedProjectionFile - &_start_; tt->single_val.s = tdrpStrDup("proj.parm"); tt++; // Parameter 'threshParmFile' // ctype is 'char*' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = STRING_TYPE; tt->param_name = tdrpStrDup("threshParmFile"); tt->descr = tdrpStrDup(""); tt->help = tdrpStrDup("Files with Specification of all the database and fixed input thresholds"); tt->array_offset = (char *) &_threshParmFile - &_start_; tt->array_n_offset = (char *) &threshParmFile_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = FALSE; tt->array_elem_size = sizeof(char*); tt->array_n = 1; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].s = tdrpStrDup("thresh.parm"); tt++; // Parameter 'maxAgeHours' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("maxAgeHours"); tt->descr = tdrpStrDup("maximum age hours"); tt->help = tdrpStrDup("Maximum age in real time of data compared to current real time in order to use the data (hours)"); tt->val_offset = (char *) &maxAgeHours - &_start_; tt->single_val.d = 24; tt++; // Parameter 'triggerFeedbackMinutes' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("triggerFeedbackMinutes"); tt->descr = tdrpStrDup("triggering feedback minutes"); tt->help = tdrpStrDup("Triggering mechanism will return from each URL after this number of minutes to tell the handler there has been no new input. Set this fairly small to speed up detection of timeout and disable situations."); tt->val_offset = (char *) &triggerFeedbackMinutes - &_start_; tt->single_val.d = 1; tt++; // Parameter 'urlTimeoutMinutes' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("urlTimeoutMinutes"); tt->descr = tdrpStrDup("URL timout minutes"); tt->help = tdrpStrDup("If a URL has produced data at a gen time, but no new lead times trigger, it has 'timed out'. This parameter tells how long to wait until declaring a timeout. It can be fairly big if this is a rare event"); tt->val_offset = (char *) &urlTimeoutMinutes - &_start_; tt->single_val.d = 60; tt++; // Parameter 'urlDisableMinutes' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("urlDisableMinutes"); tt->descr = tdrpStrDup("URL disable minutes"); tt->help = tdrpStrDup("If a URL has not produced data at a gen time, but other URls have, the URL is declared 'disabled' if this many minutes have elapsed between the first data at the gen time from any URL, and the current real time"); tt->val_offset = (char *) &urlDisableMinutes - &_start_; tt->single_val.d = 60; tt++; // Parameter 'encodingType' // ctype is '_encodingType_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = ENUM_TYPE; tt->param_name = tdrpStrDup("encodingType"); tt->descr = tdrpStrDup("Set encoding type."); tt->help = tdrpStrDup(""); tt->val_offset = (char *) &encodingType - &_start_; tt->enum_def.name = tdrpStrDup("encodingType_t"); tt->enum_def.nfields = 3; tt->enum_def.fields = (enum_field_t *) tdrpMalloc(tt->enum_def.nfields * sizeof(enum_field_t)); tt->enum_def.fields[0].name = tdrpStrDup("ENCODING_INT8"); tt->enum_def.fields[0].val = ENCODING_INT8; tt->enum_def.fields[1].name = tdrpStrDup("ENCODING_INT16"); tt->enum_def.fields[1].val = ENCODING_INT16; tt->enum_def.fields[2].name = tdrpStrDup("ENCODING_FLOAT32"); tt->enum_def.fields[2].val = ENCODING_FLOAT32; tt->single_val.e = ENCODING_INT8; tt++; // Parameter 'archiveSpdbBestOffsetHours' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("archiveSpdbBestOffsetHours"); tt->descr = tdrpStrDup("Archive mode offset for SPDB"); tt->help = tdrpStrDup("threshold SPDB is typically written in real time several days after the fact, only when the model verifies to Cmorph data, which also comes in late. This param is the typcial offset (hours), should be >=0, this is hours BACK"); tt->val_offset = (char *) &archiveSpdbBestOffsetHours - &_start_; tt->single_val.d = 84; tt++; // Parameter 'archiveSpdbOffsetHours' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("archiveSpdbOffsetHours"); tt->descr = tdrpStrDup("Archive mode range of offsets for SPDB"); tt->help = tdrpStrDup("The range of allowed offsets from gentime for SPDB in archive mode, hours BACK from real time, largest number first"); tt->array_offset = (char *) &_archiveSpdbOffsetHours - &_start_; tt->array_n_offset = (char *) &archiveSpdbOffsetHours_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = TRUE; tt->array_elem_size = sizeof(double); tt->array_n = 2; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].d = 96; tt->array_vals[1].d = 72; tt++; // Parameter 'realtimeSpdbOffsetHours' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("realtimeSpdbOffsetHours"); tt->descr = tdrpStrDup("Realtime allowed offsets from gen time"); tt->help = tdrpStrDup("Range of offsets (hours) from gen time for SPDB data. The newest data in this range will be used"); tt->array_offset = (char *) &_realtimeSpdbOffsetHours - &_start_; tt->array_n_offset = (char *) &realtimeSpdbOffsetHours_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = TRUE; tt->array_elem_size = sizeof(double); tt->array_n = 2; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].d = -24; tt->array_vals[1].d = 6; tt++; // Parameter 'nptSmoothTiledGrid' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("nptSmoothTiledGrid"); tt->descr = tdrpStrDup("Smoothing of tiled grid"); tt->help = tdrpStrDup("Number of gridpoints in x and y to smooth stitched tiled grids"); tt->val_offset = (char *) &nptSmoothTiledGrid - &_start_; tt->single_val.i = 0; tt++; // Parameter 'centerWeightTiledGrid' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("centerWeightTiledGrid"); tt->descr = tdrpStrDup("Weighting of tiled grid"); tt->help = tdrpStrDup("Tile centerpoint weight"); tt->val_offset = (char *) ¢erWeightTiledGrid - &_start_; tt->single_val.d = 1; tt++; // Parameter 'edgeWeightTiledGrid' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("edgeWeightTiledGrid"); tt->descr = tdrpStrDup("Weighting of tiled grid"); tt->help = tdrpStrDup("Tile edge weight"); tt->val_offset = (char *) &edgeWeightTiledGrid - &_start_; tt->single_val.d = 0.1; tt++; // Parameter 'debugLatlon' // ctype is 'double' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = DOUBLE_TYPE; tt->param_name = tdrpStrDup("debugLatlon"); tt->descr = tdrpStrDup("debug lat/lon"); tt->help = tdrpStrDup("latitude/longitude of a point to debug, {0,0} for no debugging"); tt->array_offset = (char *) &_debugLatlon - &_start_; tt->array_n_offset = (char *) &debugLatlon_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = TRUE; tt->array_elem_size = sizeof(double); tt->array_n = 2; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt->array_vals[0].d = 0; tt->array_vals[1].d = 0; tt++; // Parameter 'debugSpdb' // ctype is 'tdrp_bool_t' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = BOOL_TYPE; tt->param_name = tdrpStrDup("debugSpdb"); tt->descr = tdrpStrDup("debug SPDB flag"); tt->help = tdrpStrDup("True to print out similar to ThreshViewer for specific tiles"); tt->val_offset = (char *) &debugSpdb - &_start_; tt->single_val.b = pFALSE; tt++; // Parameter 'debugTiles' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("debugTiles"); tt->descr = tdrpStrDup("Set of tile indices to print, empty to print all indices"); tt->help = tdrpStrDup("Used only when debugSpdb is true"); tt->array_offset = (char *) &_debugTiles - &_start_; tt->array_n_offset = (char *) &debugTiles_n - &_start_; tt->is_array = TRUE; tt->array_len_fixed = FALSE; tt->array_elem_size = sizeof(int); tt->array_n = 0; tt->array_vals = (tdrpVal_t *) tdrpMalloc(tt->array_n * sizeof(tdrpVal_t)); tt++; // Parameter 'maximumNptInside' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("maximumNptInside"); tt->descr = tdrpStrDup("Number of points (y) to penetrate the domain to first get full original thresholds"); tt->help = tdrpStrDup("A linear increase in percentage weight given to fixed outside thresholds when closer to boundary"); tt->val_offset = (char *) &maximumNptInside - &_start_; tt->single_val.i = 10; tt++; // Parameter 'num_threads' // ctype is 'int' memset(tt, 0, sizeof(TDRPtable)); tt->ptype = INT_TYPE; tt->param_name = tdrpStrDup("num_threads"); tt->descr = tdrpStrDup(""); tt->help = tdrpStrDup("Number of threads on lead time, 0 or 1 for no threading"); tt->val_offset = (char *) &num_threads - &_start_; tt->single_val.i = 0; tt++; // trailing entry has param_name set to NULL tt->param_name = NULL; return; }