Nut/OS  5.0.5
API Reference
mod_ssi.c File Reference
#include <io.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <pro/rfctime.h>
#include <pro/uhttp/utils.h>
#include <pro/uhttp/modules/mod_cgi_func.h>
#include <pro/uhttp/modules/mod_ssi.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
Include dependency graph for mod_ssi.c:

Data Structures

struct  _HTTP_SSI_PARAM
struct  _HTTP_SSI_COMMAND

Defines

#define SSI_TYPE_FILE   0x01
#define SSI_TYPE_VIRTUAL   0x02
#define SSI_TYPE_EXEC   0x03
#define SSI_TYPE_ECHO   0x04
#define HTTP_SSI_CMD_INCLUDE   1
#define HTTP_SSI_CMD_ECHO   2
#define HTTP_SSI_CMD_CONFIG   3
#define HTTP_SSI_CMD_SET   4
#define HTTP_SSI_CMD_IF   5
#define HTTP_SSI_CMD_ELIF   6
#define HTTP_SSI_CMD_ELSE   7
#define HTTP_SSI_CMD_ENDIF   8
#define HTTP_SSI_CMD_BLOCK   9
#define HTTP_SSI_CMD_ENDBLOCK   10
#define HTTP_SSI_NUM_COMMANDS   (sizeof(ssiCmdList) / sizeof(HTTP_SSI_COMMAND))

Typedefs

typedef struct _HTTP_SSI_PARAM HTTP_SSI_PARAM
typedef int(* HTTP_SSICMD_HANDLER )(HTTPD_SESSION *, HTTP_SSI_PARAM *)
typedef struct _HTTP_SSI_COMMAND HTTP_SSI_COMMAND

Functions

int HttpSsiProcessFile (HTTPD_SESSION *hs, int fd)
int HttpSsiIncludeHandler (HTTPD_SESSION *hs, HTTP_SSI_PARAM *prm)
int HttpSsiExecHandler (HTTPD_SESSION *hs, HTTP_SSI_PARAM *prm)
int HttpSsiEchoHandler (HTTPD_SESSION *hs, HTTP_SSI_PARAM *prm)
int HttpSsiParse (HTTPD_SESSION *hs, const char *buf, int len)
int HttpSsiHandler (HTTPD_SESSION *hs, const MEDIA_TYPE_ENTRY *mt, const char *filepath)
 Default SSI handler.
HTTP_SSI_VARHANDLER HttpRegisterSsiVarHandler (HTTP_SSI_VARHANDLER handler)
 Register SSI handler for variables.

Variables

HTTP_SSI_COMMAND ssiCmdList []

Define Documentation

#define SSI_TYPE_FILE   0x01

$Id$

#define SSI_TYPE_VIRTUAL   0x02
#define SSI_TYPE_EXEC   0x03
#define SSI_TYPE_ECHO   0x04
#define HTTP_SSI_CMD_INCLUDE   1
#define HTTP_SSI_CMD_ECHO   2
#define HTTP_SSI_CMD_CONFIG   3
#define HTTP_SSI_CMD_SET   4
#define HTTP_SSI_CMD_IF   5
#define HTTP_SSI_CMD_ELIF   6
#define HTTP_SSI_CMD_ELSE   7
#define HTTP_SSI_CMD_ENDIF   8
#define HTTP_SSI_CMD_BLOCK   9
#define HTTP_SSI_CMD_ENDBLOCK   10
#define HTTP_SSI_NUM_COMMANDS   (sizeof(ssiCmdList) / sizeof(HTTP_SSI_COMMAND))

Referenced by HttpSsiParse().


Typedef Documentation


Function Documentation

int HttpSsiProcessFile ( HTTPD_SESSION hs,
int  fd 
)

References _filelength(), _read(), _seek(), free(), HttpSsiParse(), malloc(), NULL, s_flush(), _HTTPD_SESSION::s_stream, s_write(), SEEK_CUR, and strstr().

Referenced by HttpSsiHandler(), and HttpSsiIncludeHandler().

Here is the call graph for this function:

int HttpSsiIncludeHandler ( HTTPD_SESSION hs,
HTTP_SSI_PARAM prm 
)

References _close(), _O_BINARY, _O_RDONLY, _open(), AllocConcatStringLen(), free(), HTTP_ROOT, HttpSsiProcessFile(), _HTTP_SSI_PARAM::ipar_name, _HTTP_SSI_PARAM::ipar_namelen, _HTTP_SSI_PARAM::ipar_value, _HTTP_SSI_PARAM::ipar_valuelen, memcmp(), and NULL.

Here is the call graph for this function:

int HttpSsiEchoHandler ( HTTPD_SESSION hs,
HTTP_SSI_PARAM prm 
)

References _HTTP_SSI_PARAM::ipar_value, _HTTP_SSI_PARAM::ipar_valuelen, memcpy(), NULL, realloc(), and s_puts().

Here is the call graph for this function:


Variable Documentation

Initial value:
 {
    
    { "include", 7, HttpSsiIncludeHandler },
    
    
    
    { "exec", 4, HttpSsiExecHandler },
    
    
    
    { "echo", 4, HttpSsiEchoHandler },
    
}