4e4f5951fed8f4d923dcbbc313b3596c62374091 tdreszer Mon Jun 25 12:13:22 2012 -0700 Next batch of many checkins as dictated by Jim. Formatting space after if and limiting lines to 100 chars. Changes limited to lines last touched by tdreszer (git blame) so as not to ruin history. None of these changes should affect executables in any way. Only affect is to my sanity and Jim's. diff --git src/inc/cheapcgi.h src/inc/cheapcgi.h index e6ea666..e45cce1 100644 --- src/inc/cheapcgi.h +++ src/inc/cheapcgi.h @@ -102,31 +102,32 @@ btChrome=4, // Google Chrome btSafari=5, // Safari btOther=6 // Anything else }; enum osType /* How to look at a track. */ { osUnknown=0, // Not yet known osWindows=1, // The evil empire osLinux=2, // Workhorse osMac=3, // ashion or Religion osOther=4 // Anything else }; -enum browserType cgiClientBrowser(char **browserQualifier, enum osType *clientOs, char **clientOsQualifier); +enum browserType cgiClientBrowser(char **browserQualifier, enum osType *clientOs, + char **clientOsQualifier); /* These routines abort the html output if the input isn't * there or is misformatted. */ #define cgiBrowser() cgiClientBrowser(NULL,NULL,NULL) char *cgiString(char *varName); int cgiInt(char *varName); double cgiDouble(char *varName); boolean cgiBoolean(char *varName); /* The cgiBoolean is a little problematic. If the variable * is TRUE it exists, but if it is false it is simply not * defined. cgiBoolean() thus returns FALSE if the CGI * variable doesn't exist or if it is set to FALSE. To * work around this when need be use cgiBooleanDefined(), * which relies on the fact that when we define a boolean @@ -243,116 +244,132 @@ void cgiMakeCheckBox(char *name, boolean checked); /* Make check box. */ void cgiMakeCheckBoxWithMsg(char *name, boolean checked, char *msg); /* Make check box, which includes a msg. */ void cgiMakeCheckBoxWithId(char *name, boolean checked, char *id); /* Make check box, which includes an ID. */ void cgiMakeCheckBoxJS(char *name, boolean checked, char *javascript); /* Make check box with javascript */ void cgiMakeCheckBoxIdAndJS(char *name, boolean checked, char *id, char *javascript); /* Make check box with ID and javascript. */ -void cgiMakeCheckBoxFourWay(char *name, boolean checked, boolean enabled, char *id, char *classes, char *moreHtml); +void cgiMakeCheckBoxFourWay(char *name, boolean checked, boolean enabled, char *id, + char *classes, char *moreHtml); /* Make check box - with fourWay functionality (checked/unchecked by enabled/disabled * Also makes a shadow hidden variable that supports the 2 boolean states. */ void cgiMakeTextArea(char *varName, char *initialVal, int rowCount, int columnCount); /* Make a text area with area rowCount X columnCount and with text: intialVal. */ void cgiMakeTextAreaDisableable(char *varName, char *initialVal, int rowCount, int columnCount, boolean disabled); /* Make a text area that can be disabled. The rea has rowCount X * columnCount and with text: intialVal */ void cgiMakeTextVar(char *varName, char *initialVal, int charSize); /* Make a text control filled with initial value. If charSize * is zero it's calculated from initialVal size. */ void cgiMakeTextVarWithExtraHtml(char *varName, char *initialVal, int width, char *extra); /* Make a text control filled with initial value. */ void cgiMakeOnKeypressTextVar(char *varName, char *initialVal, int charSize, char *script); /* Make a text control filled with initial value, with a (java)script * to execute every time a key is pressed. If charSize is zero it's * calculated from initialVal size. */ void cgiMakeIntVar(char *varName, int initialVal, int maxDigits); /* Make a text control filled with initial integer value. */ #define NO_VALUE -96669 -void cgiMakeIntVarInRange(char *varName, int initialVal, char *title, int width, char *min, char *max); +void cgiMakeIntVarInRange(char *varName, int initialVal, char *title, int width, + char *min, char *max); /* Make a integer control filled with initial value. If min and/or max are non-NULL will enforce range Requires utils.js jQuery.js and inputBox class */ -void cgiMakeIntVarWithLimits(char *varName, int initialVal, char *title, int width, int min, int max); +void cgiMakeIntVarWithLimits(char *varName, int initialVal, char *title, int width, + int min, int max); void cgiMakeIntVarWithMin(char *varName, int initialVal, char *title, int width, int min); void cgiMakeIntVarWithMax(char *varName, int initialVal, char *title, int width, int max); -#define cgiMakeIntVarNoLimits(varName,initialVal,title,width) cgiMakeIntVarInRange(varName,initialVal,title,width,NULL,NULL) +#define cgiMakeIntVarNoLimits(varName,initialVal,title,width) \ + cgiMakeIntVarInRange(varName,initialVal,title,width,NULL,NULL) /* All four of these call cgiMakeIntVarInRange() and therefore require utils.js */ void cgiMakeDoubleVar(char *varName, double initialVal, int maxDigits); /* Make a text control filled with initial floating-point value. */ -void cgiMakeDoubleVarInRange(char *varName, double initialVal, char *title, int width, char *min, char *max); +void cgiMakeDoubleVarInRange(char *varName, double initialVal, char *title, int width, + char *min, char *max); /* Make a floating point control filled with initial value. If min and/or max are non-NULL will enforce range Requires utils.js jQuery.js and inputBox class */ -void cgiMakeDoubleVarWithLimits(char *varName, double initialVal, char *title, int width, double min, double max); +void cgiMakeDoubleVarWithLimits(char *varName, double initialVal, char *title, int width, + double min, double max); void cgiMakeDoubleVarWithMin(char *varName, double initialVal, char *title, int width, double min); void cgiMakeDoubleVarWithMax(char *varName, double initialVal, char *title, int width, double max); -#define cgiMakeDoubleVarNoLimits(varName,initialVal,title,width) cgiMakeDoubleVarInRange(varName,initialVal,title,width,NULL,NULL) +#define cgiMakeDoubleVarNoLimits(varName,initialVal,title,width) \ + cgiMakeDoubleVarInRange(varName,initialVal,title,width,NULL,NULL) /* All four of these call cgiMakeDoubleVarInRange() and therefore require utils.js */ void cgiMakeDropListClass(char *name, char *menu[], int menuSize, char *checked, char *class); /* Make a drop-down list with names and style sheet class. */ void cgiMakeDropList(char *name, char *menu[], int menuSize, char *checked); /* Make a drop-down list with names. * uses style "normalText" */ void cgiMakeDropListClassWithStyleAndJavascript(char *name, char *menu[], int menuSize, char *checked, char *class, char *style,char *javascript); /* Make a drop-down list with names, text class, style and javascript. */ void cgiMakeDropListClassWithStyle(char *name, char *menu[], int menuSize, char *checked, char *class, char *style); /* Make a drop-down list with names, text class and style. */ void cgiMakeDropListWithVals(char *name, char *menu[], char *values[], int menuSize, char *checked); /* Make a drop-down list with names and values. In this case checked * corresponds to a value, not a menu. */ void cgiMakeDropListFull(char *name, char *menu[], char *values[], int menuSize, char *checked, char *extraAttribs); /* Make a drop-down list with names and values. */ void cgiDropDownWithTextValsAndExtra(char *name, char *text[], char *values[], int count, char *selected, char *extra); /* Make a drop-down list with both text and values. */ -char *cgiMakeSelectDropList(boolean multiple, char *name, struct slPair *valsAndLabels,char *selected, char *anyAll,char *extraClasses, char *extraHtml); -// Returns allocated string of HTML defining a drop-down select (if multiple, REQUIRES ui-dropdownchecklist.js) -// In valsAndLabels, val (pair->name) must be filled in but label (pair->val) may be NULL. -// selected, if not NULL is a val found in the valsAndLabels (multiple then comma delimited list). If null and anyAll not NULL, that will be selected -// anyAll, if not NULL is the string for an initial option. It can contain val and label, delimited by a comma -// extraHtml, if not NULL contains id, javascript calls and style. It does NOT contain class definitions -#define cgiMakeMultiSelectDropList(name, valsAndLabels, selected, anyAll, extraClasses, extraHtml) cgiMakeSelectDropList(TRUE, (name), (valsAndLabels), (selected), (anyAll), (extraClasses), (extraHtml)) -#define cgiMakeSingleSelectDropList(name, valsAndLabels, selected, anyAll, extraClasses, extraHtml) cgiMakeSelectDropList(FALSE,(name), (valsAndLabels), (selected), (anyAll), (extraClasses), (extraHtml)) +char *cgiMakeSelectDropList(boolean multiple, char *name, struct slPair *valsAndLabels, + char *selected, char *anyAll,char *extraClasses, char *extraHtml); +// Returns allocated string of HTML defining a drop-down select +// (if multiple, REQUIRES ui-dropdownchecklist.js) +// valsAndLabels: val (pair->name) must be filled in but label (pair->val) may be NULL. +// selected: if not NULL is a val found in the valsAndLabels (multiple then comma delimited list). +// If null and anyAll not NULL, that will be selected +// anyAll: if not NULL is the string for an initial option. It can contain val and label, +// delimited by a comma +// extraHtml: if not NULL contains id, javascript calls and style. +// It does NOT contain class definitions +#define cgiMakeMultiSelectDropList(name,valsAndLabels,selected,anyAll,extraClasses,extraHtml) \ + cgiMakeSelectDropList(TRUE,(name),(valsAndLabels),(selected),(anyAll),\ + (extraClasses),(extraHtml)) +#define cgiMakeSingleSelectDropList(name,valsAndLabels,selected,anyAll,extraClasses,extraHtml) \ + cgiMakeSelectDropList(FALSE,(name),(valsAndLabels),(selected),(anyAll),\ + (extraClasses),(extraHtml)) void cgiMakeMultList(char *name, char *menu[], int menuSize, struct slName *checked, int length); /* Make a list of names which can have multiple selections. * Same as drop-down list except "multiple" is added to select tag */ void cgiMakeCheckboxGroup(char *name, char *menu[], int menuSize, struct slName *checked, int tableColumns); /* Make a table of checkboxes that have the same variable name but different * values (same behavior as a multi-select input). */ void cgiMakeCheckboxGroupWithVals(char *name, char *menu[], char *values[], int menuSize, struct slName *checked, int tableColumns); /* Make a table of checkboxes that have the same variable name but different * values (same behavior as a multi-select input), with nice labels in menu[]. */