Changeset 548 for branches/PublicaMundi_David-devel/thirds/cgic206/cgic.h
- Timestamp:
- Feb 2, 2015, 9:55:48 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PublicaMundi_David-devel/thirds/cgic206/cgic.h
r511 r548 10 10 types defined by it, such as FILE *. */ 11 11 12 #include "fcgi_stdio.h" 13 //#include <stdio.h> 12 //#include "fcgi_stdio.h" 13 #include <fcgiapp.h> 14 #include <stdio.h> 14 15 15 16 /* The various CGI environment variables. Instead of using getenv(), … … 21 22 for debugging. */ 22 23 23 extern 24 #ifdef __cplusplus 25 "C" 26 #endif 24 25 typedef struct cgiFormEntryStruct { 26 char *attr; 27 /* value is populated for regular form fields only. 28 For file uploads, it points to an empty string, and file 29 upload data should be read from the file tfileName. */ 30 char *value; 31 /* When fileName is not an empty string, tfileName is not null, 32 and 'value' points to an empty string. */ 33 /* Valid for both files and regular fields; does not include 34 terminating null of regular fields. */ 35 int valueLength; 36 char *fileName; 37 char *contentType; 38 /* Temporary file name for working storage of file uploads. */ 39 char *tfileName; 40 struct cgiFormEntryStruct *next; 41 } cgiFormEntry; 42 43 44 45 46 struct cgi_env { 47 int cgiRestored;// = 0; 27 48 char *cgiServerSoftware; 28 extern29 #ifdef __cplusplus30 "C"31 #endif32 49 char *cgiServerName; 33 extern34 #ifdef __cplusplus35 "C"36 #endif37 50 char *cgiGatewayInterface; 38 extern39 #ifdef __cplusplus40 "C"41 #endif42 51 char *cgiServerProtocol; 43 extern44 #ifdef __cplusplus45 "C"46 #endif47 52 char *cgiServerPort; 48 extern49 #ifdef __cplusplus50 "C"51 #endif52 53 char *cgiRequestMethod; 53 extern54 #ifdef __cplusplus55 "C"56 #endif57 54 char *cgiPathInfo; 58 extern59 #ifdef __cplusplus60 "C"61 #endif62 55 char *cgiPathTranslated; 63 extern64 #ifdef __cplusplus65 "C"66 #endif67 56 char *cgiScriptName; 68 extern69 #ifdef __cplusplus70 "C"71 #endif72 57 char *cgiQueryString; 73 extern74 #ifdef __cplusplus75 "C"76 #endif77 58 char *cgiRemoteHost; 78 extern79 #ifdef __cplusplus80 "C"81 #endif82 59 char *cgiRemoteAddr; 83 extern84 #ifdef __cplusplus85 "C"86 #endif87 60 char *cgiAuthType; 88 extern89 #ifdef __cplusplus90 "C"91 #endif92 61 char *cgiRemoteUser; 93 extern94 #ifdef __cplusplus95 "C"96 #endif97 62 char *cgiRemoteIdent; 98 extern 99 #ifdef __cplusplus 100 "C" 101 #endif 102 char *cgiContentType; 103 extern 104 #ifdef __cplusplus 105 "C" 106 #endif 63 char cgiContentTypeData[1024]; 64 char *cgiContentType;// = cgiContentTypeData; 65 66 char * cgiMultipartBoundary; 67 cgiFormEntry *cgiFormEntryFirst; 68 int cgiTreatUrlEncoding; 69 107 70 char *cgiAccept; 108 extern109 #ifdef __cplusplus110 "C"111 #endif112 71 char *cgiUserAgent; 113 extern114 #ifdef __cplusplus115 "C"116 #endif117 72 char *cgiReferrer; 118 73 119 74 /* Cookies as sent to the server. You can also get them 120 75 individually, or as a string array; see the documentation. */ 121 extern122 #ifdef __cplusplus123 "C"124 #endif125 76 char *cgiCookie; 126 127 extern128 #ifdef __cplusplus129 "C"130 #endif131 77 char *cgiSid; 132 78 … … 140 86 directly from cgiIn; the programmer need not do so. */ 141 87 142 extern143 #ifdef __cplusplus144 "C"145 #endif146 88 int cgiContentLength; 147 89 … … 152 94 cgiOut is always equivalent to stdout. */ 153 95 154 extern 155 #ifdef __cplusplus 156 "C" 157 #endif 158 FILE *cgiOut; 159 160 /* Pointer to CGI input. The programmer does not read from this. 161 We have continued to export it for backwards compatibility 162 so that cgic 1.x applications link properly. */ 163 164 extern 165 #ifdef __cplusplus 166 "C" 167 #endif 168 FILE *cgiIn; 169 96 char *cgiFindTarget; 97 cgiFormEntry *cgiFindPos; 98 99 }; 170 100 /* Possible return codes from the cgiForm family of functions (see below). */ 171 101 … … 195 125 #endif 196 126 cgiFormResultType cgiFormString( 197 char *name, char *result, int max );127 char *name, char *result, int max,struct cgi_env **); 198 128 199 129 extern … … 202 132 #endif 203 133 cgiFormResultType cgiFormStringNoNewlines( 204 char *name, char *result, int max );134 char *name, char *result, int max,struct cgi_env ** ce); 205 135 206 136 … … 210 140 #endif 211 141 cgiFormResultType cgiFormStringSpaceNeeded( 212 char *name, int *length );142 char *name, int *length,struct cgi_env ** ce); 213 143 214 144 … … 218 148 #endif 219 149 cgiFormResultType cgiFormStringMultiple( 220 char *name, char ***ptrToStringArray );150 char *name, char ***ptrToStringArray,struct cgi_env ** ce); 221 151 222 152 extern … … 231 161 #endif 232 162 cgiFormResultType cgiFormInteger( 233 char *name, int *result, int defaultV );163 char *name, int *result, int defaultV,struct cgi_env ** ce); 234 164 235 165 extern … … 238 168 #endif 239 169 cgiFormResultType cgiFormIntegerBounded( 240 char *name, int *result, int min, int max, int defaultV );170 char *name, int *result, int min, int max, int defaultV,struct cgi_env **ce); 241 171 242 172 extern … … 245 175 #endif 246 176 cgiFormResultType cgiFormDouble( 247 char *name, double *result, double defaultV );177 char *name, double *result, double defaultV,struct cgi_env **); 248 178 249 179 extern … … 252 182 #endif 253 183 cgiFormResultType cgiFormDoubleBounded( 254 char *name, double *result, double min, double max, double defaultV );184 char *name, double *result, double min, double max, double defaultV, struct cgi_env ** ce); 255 185 256 186 extern … … 260 190 cgiFormResultType cgiFormSelectSingle( 261 191 char *name, char **choicesText, int choicesTotal, 262 int *result, int defaultV );192 int *result, int defaultV,struct cgi_env **ce); 263 193 264 194 … … 269 199 cgiFormResultType cgiFormSelectMultiple( 270 200 char *name, char **choicesText, int choicesTotal, 271 int *result, int *invalid );201 int *result, int *invalid,struct cgi_env **); 272 202 273 203 /* Just an alias; users have asked for this */ … … 279 209 #endif 280 210 cgiFormResultType cgiFormCheckboxSingle( 281 char *name );211 char *name,struct cgi_env ** ce); 282 212 283 213 extern … … 287 217 cgiFormResultType cgiFormCheckboxMultiple( 288 218 char *name, char **valuesText, int valuesTotal, 289 int *result, int *invalid );219 int *result, int *invalid,struct cgi_env ** ce); 290 220 291 221 extern … … 295 225 cgiFormResultType cgiFormRadio( 296 226 char *name, char **valuesText, int valuesTotal, 297 int *result, int defaultV );227 int *result, int defaultV,struct cgi_env **ce); 298 228 299 229 /* The paths returned by this function are the original names of files … … 305 235 #endif 306 236 cgiFormResultType cgiFormFileName( 307 char *name, char *result, int max );237 char *name, char *result, int max,struct cgi_env **); 308 238 309 239 /* The content type of the uploaded file, as reported by the browser. … … 315 245 #endif 316 246 cgiFormResultType cgiFormFileContentType( 317 char *name, char *result, int max );247 char *name, char *result, int max,struct cgi_env ** ce); 318 248 319 249 extern … … 322 252 #endif 323 253 cgiFormResultType cgiFormFileSize( 324 char *name, int *sizeP );254 char *name, int *sizeP,struct cgi_env ** ce); 325 255 326 256 typedef struct cgiFileStruct *cgiFilePtr; … … 331 261 #endif 332 262 cgiFormResultType cgiFormFileOpen( 333 char *name, cgiFilePtr *cfpp );263 char *name, cgiFilePtr *cfpp,struct cgi_env ** ce); 334 264 335 265 extern … … 352 282 #endif 353 283 cgiFormResultType cgiCookieString( 354 char *name, char *result, int max );284 char *name, char *result, int max,char * cgiCookie); 355 285 356 286 extern … … 359 289 #endif 360 290 cgiFormResultType cgiCookieInteger( 361 char *name, int *result, int defaultV );291 char *name, int *result, int defaultV,char * cgiCookie); 362 292 363 293 cgiFormResultType cgiCookies( 364 char ***ptrToStringArray );294 char ***ptrToStringArray,char* cgiCookie); 365 295 366 296 /* path can be null or empty in which case a path of / (entire site) is set. … … 372 302 #endif 373 303 void cgiHeaderCookieSetString(char *name, char *value, 374 int secondsToLive, char *path, char *domain );304 int secondsToLive, char *path, char *domain,FCGX_Stream *out); 375 305 extern 376 306 #ifdef __cplusplus … … 378 308 #endif 379 309 void cgiHeaderCookieSetInteger(char *name, int value, 380 int secondsToLive, char *path, char *domain );381 extern 382 #ifdef __cplusplus 383 "C" 384 #endif 385 void cgiHeaderLocation(char *redirectUrl );386 extern 387 #ifdef __cplusplus 388 "C" 389 #endif 390 void cgiHeaderStatus(int status, char *statusMessage );391 extern 392 #ifdef __cplusplus 393 "C" 394 #endif 395 void cgiHeaderContentType(char *mimeType );310 int secondsToLive, char *path, char *domain,FCGX_Stream *out); 311 extern 312 #ifdef __cplusplus 313 "C" 314 #endif 315 void cgiHeaderLocation(char *redirectUrl,FCGX_Stream * out); 316 extern 317 #ifdef __cplusplus 318 "C" 319 #endif 320 void cgiHeaderStatus(int status, char *statusMessage,FCGX_Stream * out); 321 extern 322 #ifdef __cplusplus 323 "C" 324 #endif 325 void cgiHeaderContentType(char *mimeType,FCGX_Stream * out); 396 326 397 327 typedef enum { … … 421 351 #endif 422 352 cgiFormResultType cgiFormEntries( 423 char ***ptrToStringArray );353 char ***ptrToStringArray,struct cgi_env **ce); 424 354 425 355 /* Output string with the <, &, and > characters HTML-escaped. 426 356 's' is null-terminated. Returns cgiFormIO in the event 427 357 of error, cgiFormSuccess otherwise. */ 428 cgiFormResultType cgiHtmlEscape(char *s );358 cgiFormResultType cgiHtmlEscape(char *s,FCGX_Stream *out); 429 359 430 360 /* Output data with the <, &, and > characters HTML-escaped. … … 432 362 bytes in 'data'. Returns cgiFormIO in the event 433 363 of error, cgiFormSuccess otherwise. */ 434 cgiFormResultType cgiHtmlEscapeData(char *data, int len );364 cgiFormResultType cgiHtmlEscapeData(char *data, int len,FCGX_Stream *out); 435 365 436 366 /* Output string with the " character HTML-escaped, and no … … 439 369 's' is null-terminated. Returns cgiFormIO in the event 440 370 of error, cgiFormSuccess otherwise. */ 441 cgiFormResultType cgiValueEscape(char *s );371 cgiFormResultType cgiValueEscape(char *s,FCGX_Stream *out); 442 372 443 373 /* Output data with the " character HTML-escaped, and no … … 447 377 bytes in 'data'. Returns cgiFormIO in the event 448 378 of error, cgiFormSuccess otherwise. */ 449 cgiFormResultType cgiValueEscapeData(char *data, int len );450 451 int cgiMain_init(int argc, char *argv[] );452 453 void cgiFreeResources( );379 cgiFormResultType cgiValueEscapeData(char *data, int len,FCGX_Stream *out); 380 381 int cgiMain_init(int argc, char *argv[],struct cgi_env ** c,FCGX_Request *); 382 383 void cgiFreeResources(struct cgi_env ** c); 454 384 455 385 #endif /* CGI_C */
Note: See TracChangeset
for help on using the changeset viewer.