00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00041 #ifndef _HTTPD_H_
00042 #define _HTTPD_H_
00043
00044 #include "sys.h"
00045
00051 #ifndef HTTP_SERVLETS
00052 #define HTTP_SERVLETS 1
00053 #endif
00054
00055
00056 #if HTTP_SERVLETS
00057
00059 typedef void* SERVLET_t;
00060
00062 typedef sint_t (*SERVLETFUNC_t)(SERVLET_t slobj);
00063
00064 #define SLERR_OK 0
00065 #define SLERR_FAIL -1
00066 #define SLERR_NEEDMEM -2
00067
00068 #define SLERR_BADREQUEST -3
00069 #define SLERR_NOTFOUND -4
00070 #define SLERR_SERVER -5
00071 #define SLERR_CREATED -6
00072 #define SLERR_ACCEPTED -7
00073 #define SLERR_PARTIAL -8
00074 #define SLERR_FORBIDDEN -9
00075 #define SLERR_TOOLARGE -10
00076 #define SLERR_UNAVAILABLE -11
00077 #define SLERR_BUSY -12
00078
00079
00090 sint_t hsl_create(SERVLETFUNC_t func, const char *filename);
00091
00099 sint_t hsl_destroy(SERVLETFUNC_t func);
00100
00110 char *hsl_getParameterByName(SERVLET_t *slobj, const char *name);
00111
00119 char *hsl_getOwnName(SERVLET_t *slobj);
00120
00136 sint_t hsl_setStreamBufSize(SERVLET_t *slobj, u32_t bufsize);
00137
00147 sint_t hsl_printf(SERVLET_t *slobj, const char *fmt, ...);
00148
00158 void* hsl_getSession(SERVLET_t *slobj);
00159
00174 void* hsl_newSession(SERVLET_t *slobj, u32_t memsize, u32_t timeout);
00175
00184 sint_t hsl_destroySession(SERVLET_t *slobj);
00185
00193 sint_t hsl_formAddSessionId(SERVLET_t *slobj);
00194
00195
00196 #define HSL_LINK_RAW 0x00000001
00197 #define HSL_LINK_SID 0x00000002
00198 #define HSL_LINK_QM 0x80000000
00199
00200
00223 sint_t hsl_linkCreate(SERVLET_t *slobj, const char* url, u32_t flags);
00224
00236 sint_t hsl_linkAddStringVal(SERVLET_t *slobj, const char *name,
00237 const char* val);
00238
00250 sint_t hsl_linkAddNumberVal(SERVLET_t *slobj, const char *name, u32_t val);
00251
00265 sint_t hsl_linkInsert(SERVLET_t *slobj, const char *linktext);
00266
00274 sint_t hsl_addSessionIdToForm(SERVLET_t *slobj);
00275
00276
00277 #endif
00278
00279
00302 sint_t httpd_start(const char *rootDirectory,
00303 u32_t maxServletMem, u32_t maxSessionMem);
00304
00311 sint_t httpd_stop(void);
00312
00318 sint_t httpd_running(void);
00319
00320
00322 #endif