src/server/public/nsapi.h

changeset 118
38bf6dd8f4e7
parent 110
43a746e905f6
child 127
84e206063b64
equal deleted inserted replaced
117:a94cf2e94492 118:38bf6dd8f4e7
381 #include <errno.h> 381 #include <errno.h>
382 #include <time.h> 382 #include <time.h>
383 383
384 /* --- End native platform includes --- */ 384 /* --- End native platform includes --- */
385 385
386 #ifndef TRUE
387 #define TRUE 1
388 #endif
389 #ifndef FALSE
390 #define FALSE 0
391 #endif
392
386 /* --- Begin type definitions --- */ 393 /* --- Begin type definitions --- */
387 394
388 /* NOTE: both SYS_FILE and SYS_NETFD are actually NSPR PRFileDesc * and can */ 395 /* NOTE: both SYS_FILE and SYS_NETFD are actually NSPR PRFileDesc * and can */
389 /* be used with NSPR API calls (after casting them to PRFileDesc *) */ 396 /* be used with NSPR API calls (after casting them to PRFileDesc *) */
390 397
1357 1364
1358 #define MALLOC malloc 1365 #define MALLOC malloc
1359 #define CALLOC(size) calloc(1, size) 1366 #define CALLOC(size) calloc(1, size)
1360 #define REALLOC realloc 1367 #define REALLOC realloc
1361 #define FREE free 1368 #define FREE free
1369 #define STRDUP strdup
1362 1370
1363 // func util functions 1371 // func util functions
1364 FuncStruct* func_resolve(pblock *pb, Session *sn, Request *rq); 1372 FuncStruct* func_resolve(pblock *pb, Session *sn, Request *rq);
1365 int func_exec(pblock *pb, Session *sn, Request *rq); 1373 int func_exec(pblock *pb, Session *sn, Request *rq);
1366 struct FuncStruct func_insert(char *name, FuncPtr fn); 1374 struct FuncStruct func_insert(char *name, FuncPtr fn);
1382 1390
1383 NSAPI_PUBLIC void http_format_etag(Session *sn, Request *rq, char *etagp, int etaglen, off_t size, time_t mtime); 1391 NSAPI_PUBLIC void http_format_etag(Session *sn, Request *rq, char *etagp, int etaglen, off_t size, time_t mtime);
1384 NSAPI_PUBLIC int http_check_preconditions(Session *sn, Request *rq, struct tm *mtm, const char *etag); 1392 NSAPI_PUBLIC int http_check_preconditions(Session *sn, Request *rq, struct tm *mtm, const char *etag);
1385 NSAPI_PUBLIC int http_set_finfo(Session *sn, Request *rq, struct stat *finfo); 1393 NSAPI_PUBLIC int http_set_finfo(Session *sn, Request *rq, struct stat *finfo);
1386 1394
1395 NSAPI_PUBLIC char **http_hdrs2env(pblock *pb);
1387 1396
1388 typedef void (*thrstartfunc)(void *); 1397 typedef void (*thrstartfunc)(void *);
1389 SYS_THREAD INTsysthread_start(int prio, int stksz, thrstartfunc fn, void *arg); 1398 SYS_THREAD INTsysthread_start(int prio, int stksz, thrstartfunc fn, void *arg);
1390 NSAPI_PUBLIC void INTsysthread_sleep(int milliseconds); 1399 NSAPI_PUBLIC void INTsysthread_sleep(int milliseconds);
1391 1400

mercurial