/* defgb.h */ /* Supplies constants to defgb package. */ /* Generally, constants are created from user-supplied compiler */ /* -D values and defaults. The defaults are either coded here, or */ /* are found in defgb_nonconfigurable.h. */ /* Some constants are checked for permissible values */ /* Note that "compile-time initialization" can also be done in */ /* the code modules. Further, run-time initialization can take place */ /* before the system "starts running". Besides the obvious data */ /* declaration statements, check the init* modules in ioopen_routines */ #define DEFGBH_VERSION "defgb.h version 3.5 8 Apr 97" /* 8 Apr 97. Time/date wjstbl size change for new opts */ /* [Begin 3.5] */ /* 18 Mar 97. DEFAULT_OTHER_COMMENT_SINK (bit bucket) */ /* Put "version" in ID string so grep for it works! */ /* [Begin 3.4a] */ /* 11 Feb 97. EOD_STRING */ /* 10 Feb 97. PROCESS_VARLIST replaces PROCESS_NONLEVEL0_VARLIST */ /* 5 Feb 97. VARLIST_OPT. */ /* [Begin 3.4] */ /* 17 Dec 96. Convert externally specifiable *SEPARATOR strings */ /* to *SEPARATORS strings. External is compatible w/def; */ /* internally, 1 char things are SEPARATOR; string things */ /* are SEPARATORS */ /* 7 Dec 96. MAXLEVELS -> defgb_nonconfigurable.h */ /* METHOD_PROTOTYPE compilation switch */ /* WIDTH_OPT -> INPWIDTH_OPT; DISPWIDTH_OPT */ /* READ_COMMANDS switch replaces EXEC switch */ /* READ_OBJECTS switch */ /* 25 Nov 96. WJSTBL strings */ /* DISP_DATA_WIDTHS */ /* 19 Nov 96. ALT_SEPARATORS; DEFAULT separator strings */ /* [Begin 3.3] */ /* 9 Nov 96. Add module name to version string. */ /* Remove defmet. */ /* [Begin 3.2] */ /* 1 Aug 96. Use #error instead of #undef. */ /* [Begin 3.1] */ /* 1 Aug 96. TOKEN to 120 for all methods. WJS */ /* 20 Jul 96. Remove TRUE/FALSE defns. They are now supplied by */ /* some system include file spec'd in _nonconfig.h */ /* 19 Jul 96. Split into conditional and unconditional parts. */ /* Sources that compile with this file must use different */ /* object file names per different conditional input */ /* params. To be safe, always use different names */ /* [Begin v 3.0] WJS */ /* 18 Jul 96. More time/date work. Byte type. */ /* 24 Jun 96. Input and output time structures. */ /* Change GMT references to TIMEDATE. */ /* DATA_FIELD_TRIM not user-specifiable */ /* [Begin 2.3] WJS */ /* 6 Jun 96. DATA_FIELD_TRIM, SIGNIFICANT_EMBEDDED_SEPARATORS */ /* DATAFIELDOPTS opt file WJS */ /* 3 Jun 96. Remove NEGATE_LON. WJS */ /* 1 Jun 96. ERR_PREFIX optional. latlonparams stuff. */ /* [Begin 2.2] WJS */ /* 30 May 96. SIGNIFICANT_CONSECUTIVE_SEPARATORS, ERR_PREFIX WJS */ #include "defgb_nonconfigurable.h" /* ERR_PREFIX String which, if found at the beginning */ /* of any data record, indicates that record */ /* is actually an error message */ #ifndef ERR_PREFIX #define ERR_PREFIX DEFAULT_ERR_PREFIX #endif /* EOD_STRING String which, if equal to a data record */ /* indicates that end-of-data should be sig- */ /* naled. Allows multiple data units in a */ /* single data stream. Logically should be */ /* variable somehow, but ... */ #ifndef EOD_STRING #define EOD_STRING DEFAULT_EOD_STRING #endif /********* /* Use METHOD_PROTOTYPE as compilation switch to avoid confusion caused */ /* by having make file variable METHOD not being the same as compila- */ /* tion switch METHOD. _PROTOTYPE better name anyway, but too lazy */ /* to go through code changing METHOD... */ #ifdef METHOD #error "No more METHOD compilation switch. Please use METHOD_PROTOTYPE. Tnx" #undef METHOD /* ... or else get another diagnostic. #error (above) */ /* does not "stop dead", but will not allow object file */ /* to be created */ #endif #ifdef METHOD_PROTOTYPE #define METHOD METHOD_PROTOTYPE #if METHOD==DEFGB #define DEFAULT_METHOD_NAME "defgb" #elif METHOD==DEFMET #error "No more defmet. met data was edited so that defgb can be used" #elif METHOD==DEFGB_NOHEADER #define DEFAULT_METHOD_NAME "defgb_noheader" #elif METHOD==DEFGB_URL #define DEFAULT_METHOD_NAME "defgb_url" #else #error "Unrecognized METHOD_PROTOTYPE switch-please check compilation line" #endif #else #define METHOD UNKNOWN_VARIANT #define DEFAULT_METHOD_NAME "defgb (by default)" #endif #ifndef METHOD_NAME #define METHOD_NAME DEFAULT_METHOD_NAME #endif /********* /* White space & separator character for optional files. See doc in */ /* defgb_nonconfig.h & create_wjstbl. Only spec these if the default */ /* characters are somewhere in opt file data */ #ifndef WJSTBL_WHITE_SPACE /* Must be a c "white space" character */ #define WJSTBL_WHITE_SPACE DEFAULT_WJSTBL_WHITE_SPACE #endif #ifndef WJSTBL_SEPARATOR #define WJSTBL_SEPARATOR DEFAULT_WJSTBL_SEPARATOR #endif /* _OPT switches allow control of optional capabilities spec'd via */ /* the indirect parameter file. The default value of 0 allows */ /* or disallows capability based on whether or not the relevant file */ /* is provided in the parameter file. If _OPT is positive, relevant */ /* file MUST be provided in the parameter file. If _OPT is negative, */ /* file must NOT be provided in parameter file. */ #ifndef TRANS_OPT #define TRANS_OPT 0 #endif #ifndef INPWIDTH_OPT #define INPWIDTH_OPT 0 #endif #ifndef REMOVAL_OPT #define REMOVAL_OPT 0 #endif #ifndef TIMEDATE_OPT #define TIMEDATE_OPT 0 #endif #ifndef LATLON_OPT #define LATLON_OPT 0 #endif #ifndef DATAFIELDOPTS_OPT #define DATAFIELDOPTS_OPT 0 #endif #ifndef DISPWIDTH_OPT #define DISPWIDTH_OPT 0 #endif #ifndef VARLIST_OPT #define VARLIST_OPT 0 #endif /* No DIAGS_OPT -can't see purpose of it */ #ifdef READ_COMMANDS /* Compile w/EXEC capability. Saying NO allows */ /* defgb use where startchild not written */ #if ((METHOD==DEFGB_URL) && !READ_COMMANDS) #error "This method MUST have READ_COMMANDS capability" #endif #else #define READ_COMMANDS TRUE #endif #ifndef READ_OBJECTS /* Allow use of JGOFS objects as input. Saying */ /* NO allows defgb use where jdb routines (or */ /* the httpd API they use) not available */ #define READ_OBJECTS TRUE #endif #ifndef TOKEN #define TOKEN 120 #endif #if TOKEN < MAXLEN_OUTTIME_VARIABLE #define TOKEN MAXLEN_OUTTIME_VARIABLE #endif #ifndef NVAR #define NVAR 250 #endif #ifndef MAXCOMMENTLINE /* outer limitation. Size does not */ #define MAXCOMMENTLINE 80 /* include # or \n */ #endif #ifndef DISPLAY_WIDTH /* To right-justify inserted comments, */ #define DISPLAY_WIDTH 80 /* need to know rightmost column. In */ #endif /* html mode, outer inserts a hash & */ #define LENGTH_OUTER_DISPLAY_PREFIX 2 /* a blank before each comment */ #define EFFECTIVE_DISPLAY_WIDTH DISPLAY_WIDTH-LENGTH_OUTER_DISPLAY_PREFIX #ifndef COMMENTSIZE #define COMMENTSIZE 2430 #endif #ifndef MAXVARNAMESIZE #define MAXVARNAMESIZE 40 #endif #ifndef MAXREC #define MAXREC 1257 /* No particular reason for this value */ /* according to Glenn 3 Dec 96 */ #endif /* Lists that contain input from various opt files */ #ifndef TRANS_LIST #define TRANS_LIST 10000 #endif #ifndef VAR_DATA_WIDTHS #define VAR_DATA_WIDTHS 1000 #endif #ifndef DISP_DATA_WIDTHS #define DISP_DATA_WIDTHS 1000 #endif /* Params below define differences from defw. Allow these to be */ /* set on compile line */ /* To enable fixed-format input, specify a inpwidths file in an */ /* indirect input file (see doc) */ #ifdef SEPARATOR /* See also doc for fileinfo struct */ #define SEPARATORS SEPARATOR #else #if METHOD==DEFGB_URL /* This string is, logically, datafile[*]. */ #define SEPARATORS DEFAULT_URL_SEPARATORS /* item_separators */ #else #define SEPARATORS DEFAULT_SEPARATORS #endif #endif /* Allow separators within fields by delimiting them with */ /* separator characters */ #ifdef ALT_SEPARATOR #define ALT_SEPARATORS ALT_SEPARATOR #else #define ALT_SEPARATORS DEFAULT_ALT_SEPARATORS #endif /* If set, consecutive SEPARATORS characters mean empty fields */ /* This applies only to free field data; not variable lists, and not */ /* to any subfile field following the data */ #ifndef SIGNIFICANT_CONSECUTIVE_SEPARATORS #define SIGNIFICANT_CONSECUTIVE_SEPARATORS FALSE #endif /* In fixed fields, does an embedded separator mean 2 fields and, */ /* therefore, an error? */ #ifndef SIGNIFICANT_EMBEDDED_SEPARATORS #define SIGNIFICANT_EMBEDDED_SEPARATORS TRUE #endif /* In fixed fields, should we trim off leading and trailing separators? */ /* #ifndef DATA_FIELD_TRIM */ #define DATA_FIELD_TRIM TRUE /* #endif */ /* What character represents a field to skip in a time/date template */ #ifndef TIMEDATE_SKIPFIELD_CHAR #define TIMEDATE_SKIPFIELD_CHAR '*' #endif /* Character interpreted by SSCANF to mean "skip this field" */ #define SSCANF_SKIPFIELD_CHAR '*' /* Are there variable lists in with the data files or not? */ #ifndef PROCESS_VARLIST #define PROCESS_VARLIST METHOD!=DEFGB_NOHEADER #endif /************************************************************************/ /* Compile-time configurable portions of indirect input files */ /* (should be possible to specify all of these at runtime, too -see */ /* runtime doc) */ /* Also see init* modules in ioopen_routines to see how these values */ /* get applied to the actual data structures. */ /* Output options */ /* Set up default. Can be overridden at runtime via diagnostics */ /* opt file. Final value set in configure_output */ #ifndef DEFAULT_ERROR_LEVEL #define DEFAULT_ERROR_LEVEL GET_MORE_FROM_SCRIPT #endif #ifndef DEFAULT_MAXSCRIPTDIAGS #define DEFAULT_MAXSCRIPTDIAGS 5 #endif /* Set up default trace level. Can be overridden at runtime via /* diagnostics opt file. Final value set in configure_output */ #ifndef DEFAULT_TRACE_LEVEL #ifdef DEBUG /* Compatibility w/older inners */ #define DEFAULT_TRACE_LEVEL TRACE_PERFILE_ROUTINES #else #define DEFAULT_TRACE_LEVEL NOTRACE #endif #endif /* Data trace default (compatibility w/older inners) */ #ifdef DEBUG0 #define DEFAULT_DATA_TRACE 1 #else #define DEFAULT_DATA_TRACE 0 #endif /* User-changeable default sinks-since there are some messages */ /* generated before diags get set up. Note that comments generated */ /* before the comment sinks are set up are buffered, so we just */ /* reprocess them from the buffer after we know where they should go */ #ifndef DEFAULT_DEBUG_SINK #define DEFAULT_DEBUG_SINK PRIMARY_DEBUG_SINK #endif #ifndef DEFAULT_ERROR_SINK #define DEFAULT_ERROR_SINK PRIMARY_ERROR_SINK #endif #ifndef DEFAULT_OTHER_COMMENT_SINK #define DEFAULT_OTHER_COMMENT_SINK NULL_SINK #endif /* Inserted comment switch defaults */ #ifndef DEFAULT_INSERTED_MSGS #define DEFAULT_INSERTED_MSGS TRUE #endif #ifndef DEFAULT_INSERTED_MSG_TAG #define DEFAULT_INSERTED_MSG_TAG TRUE #endif #ifndef DEFAULT_COMMENT_SOURCE_TAG #define DEFAULT_COMMENT_SOURCE_TAG TRUE #endif /* Time/date table contains up to 5 pairs of keyword (max size 19) */ /* & variable, up to 10 pairs of keyword (max size 11) & variable */ /* up to 2 pairs of keyword (max size 17) & convention (max size */ /* 5, and up to 10 pairs of keyword (max size 15) & template. */ /* Each pair also requires 2 separators and a blank */ #define TIMEDATE_WJSTBL NUM_OUTTIME_VARIABLES*(19 + MAXVARNAMESIZE + 2 + 1) \ + NUM_TIMEDATE_FRAGS*(11 + MAXVARNAMESIZE + 2 + 1) \ + 2*(17 + 5 + 2 + 1) \ + NUM_TIMEDATE_FRAGS*(15 + TOKEN + 2 + 1) /* Latlon table allows 12 keywords (max size 16), 12 values, and, */ /* for each keyword/variable pair, 2 separators and a blank. */ /* The values can be single characters, formats, or variable names */ #define NUM_LATLONPARAMS 12 #if MAXVARNAMESIZE > MAXLATLONFORMATSIZE #define MAXLATLONVALUESIZE MAXVARNAMESIZE #else #define MAXLATLONVALUESIZE MAXLATLONFORMATSIZE #endif #define LATLON_WJSTBL NUM_LATLONPARAMS*(16 + MAXLATLONVALUESIZE +2 +1)