Switch back to HTTP status codes for fastcgi + update unit tests
[matches/MCTX3420.git] / server / fastcgi.h
1 /**
2  * @file fastcgi.h
3  * @purpose Headers for the fastcgi web interface
4  */
5  
6 #ifndef _FASTCGI_H
7 #define _FASTCGI_H
8  
9 /**(HTTP) Status codes that fcgi module handlers can return**/
10 typedef enum StatusCodes {
11         STATUS_OK = 200,
12         STATUS_ERROR = 400,
13         STATUS_UNAUTHORIZED = 401
14 } StatusCodes;
15
16 typedef struct FCGIContext FCGIContext;
17 typedef void (*ModuleHandler) (FCGIContext *data, char *params);
18
19 extern bool FCGI_Authorized(FCGIContext *context, const char *key);
20 extern char *FCGI_KeyPair(char *in, const char **key, const char **value);
21 extern void FCGI_BeginJSON(FCGIContext *context, StatusCodes status_code);
22 extern void FCGI_JSONPair(const char *key, const char *value);
23 extern void FCGI_JSONLong(const char *key, long value);
24 extern void FCGI_JSONDouble(const char *key, double value);
25 extern void FCGI_JSONBool(const char *key, bool value);
26 extern void FCGI_JSONKey(const char *key);
27 extern void FCGI_JSONValue(const char *format, ...);
28 extern void FCGI_EndJSON();
29 extern void FCGI_RejectJSON(FCGIContext *context);
30 extern void * FCGI_RequestLoop (void *data);
31
32 #endif
33
34

UCC git Repository :: git.ucc.asn.au