3 * @brief Headers for the fastcgi web interface
10 * Status codes that fcgi module handlers can return
11 * Success status codes have values > 0
12 * Failure status codes have values <(=) 0
13 * Note: 0 is counted as an error code to minimise confusion
14 * with in-browser JSON parsing error codes
16 typedef enum StatusCodes {
19 STATUS_UNAUTHORIZED = -2
22 typedef struct FCGIContext FCGIContext;
23 typedef void (*ModuleHandler) (FCGIContext *context, char *params);
25 extern void FCGI_BeginControl(FCGIContext *context, bool force);
26 extern void FCGI_EndControl(FCGIContext *context);
27 extern bool FCGI_HasControl(FCGIContext *context, const char *key);
28 extern char *FCGI_KeyPair(char *in, const char **key, const char **value);
29 extern void FCGI_BeginJSON(FCGIContext *context, StatusCodes status_code);
30 extern void FCGI_JSONPair(const char *key, const char *value);
31 extern void FCGI_JSONLong(const char *key, long value);
32 extern void FCGI_JSONDouble(const char *key, double value);
33 extern void FCGI_JSONBool(const char *key, bool value);
34 extern void FCGI_JSONKey(const char *key);
35 extern void FCGI_PrintRaw(const char *format, ...);
36 extern void FCGI_EndJSON();
37 extern void FCGI_RejectJSON(FCGIContext *context);
38 extern void FCGI_RejectJSONEx(FCGIContext *context, StatusCodes status, const char *description);
39 extern void * FCGI_RequestLoop (void *data);
42 * Custom formatting function for the JSON value. To be used in
43 * conjunction with FCGI_JSONKey. Care should be taken to ensure
44 * that valid JSON is produced.
46 * @see FCGI_PrintRaw for calling syntax
48 #define FCGI_JSONValue FCGI_PrintRaw