Main Page | Modules | Namespace List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

webs.c File Reference

#include "wsIntrn.h"

Defines

#define isgoodchar(s)
#define kLt   '<'
#define kLessThan   T("&lt;")
#define kGt   '>'
#define kGreaterThan   T("&gt;")

Functions

static int websGetInput (webs_t wp, char_t **ptext, int *nbytes)
static int websParseFirst (webs_t wp, char_t *text)
static void websParseRequest (webs_t wp)
static void websSocketEvent (int sid, int mask, int data)
static int websGetTimeSinceMark (webs_t wp)
int websOpenServer (int port, int retries)
void websCloseServer ()
int websOpenListen (int port, int retries)
void websCloseListen ()
int websAccept (int sid, char *ipaddr, int port, int listenSid)
void websReadEvent (webs_t wp)
void websSetEnv (webs_t wp)
void websSetVar (webs_t wp, char_t *var, char_t *value)
int websTestVar (webs_t wp, char_t *var)
char_twebsGetVar (webs_t wp, char_t *var, char_t *defaultGetValue)
int websCompareVar (webs_t wp, char_t *var, char_t *value)
void websTimeoutCancel (webs_t wp)
void websResponse (webs_t wp, int code, char_t *message, char_t *redirect)
void websRedirect (webs_t wp, char_t *url)
static int charCount (const char_t *str, char_t ch)
static char_twebsSafeUrl (const char_t *url)
void websError (webs_t wp, int code, char_t *fmt,...)
char_twebsErrorMsg (int code)
int websWrite (webs_t wp, char_t *fmt,...)
int websWriteBlock (webs_t wp, char_t *buf, int nChars)
int websWriteDataNonBlock (webs_t wp, char *buf, int nChars)
void websDecodeUrl (char_t *decoded, char_t *token, int len)
void websTimeout (void *arg, int id)
void websDone (webs_t wp, int code)
int websAlloc (int sid)
void websFree (webs_t wp)
char_twebsGetHost ()
char_twebsGetIpaddrUrl ()
char_twebsGetHostUrl ()
int websGetPort ()
int websGetRequestBytes (webs_t wp)
char_twebsGetRequestDir (webs_t wp)
int websGetRequestFlags (webs_t wp)
char_twebsGetRequestIpaddr (webs_t wp)
char_twebsGetRequestLpath (webs_t wp)
char_twebsGetRequestPath (webs_t wp)
char_twebsGetRequestPassword (webs_t wp)
char_twebsGetRequestType (webs_t wp)
char_twebsGetRequestUserName (webs_t wp)
int websGetRequestWritten (webs_t wp)
void websSetHost (char_t *host)
void websSetHostUrl (char_t *url)
void websSetIpaddr (char_t *ipaddr)
void websSetRequestBytes (webs_t wp, int bytes)
void websSetRequestFlags (webs_t wp, int flags)
void websSetRequestLpath (webs_t wp, char_t *lpath)
void websSetRequestPath (webs_t wp, char_t *dir, char_t *path)
void websSetRequestSocketHandler (webs_t wp, int mask, void(*fn)(webs_t wp))
void websSetRequestWritten (webs_t wp, int written)
int websValid (webs_t wp)
char_twebsGetDateString (websStatType *sbuf)
void websSetTimeMark (webs_t wp)
void websSetRealm (char_t *realmName)
char_twebsGetRealm ()

Variables

websStatsType websStats
webs_twebs
sym_fd_t websMime
int websMax
int websPort
char_t websHost [64]
char_t websIpaddr [64]
char_twebsHostUrl = NULL
char_twebsIpaddrUrl = NULL
websErrorType websErrors []
static int websListenSock
static char_t websRealm [64] = T("GoAhead")
static int websOpenCount = 0

Define Documentation

#define isgoodchar  ) 
 

Value:

(gisalnum((s)) || ((s) == '/') || ((s) == '_') || \
                                                ((s) == '.')  || ((s) == '-') )

#define kGreaterThan   T("&gt;")
 

#define kGt   '>'
 

#define kLessThan   T("&lt;")
 

#define kLt   '<'
 


Function Documentation

static int charCount const char_t str,
char_t  ch
[static]
 

int websAccept int  sid,
char *  ipaddr,
int  port,
int  listenSid
 

int websAlloc int  sid  ) 
 

void websCloseListen  ) 
 

void websCloseServer  ) 
 

int websCompareVar webs_t  wp,
char_t var,
char_t value
 

void websDecodeUrl char_t decoded,
char_t token,
int  len
 

void websDone webs_t  wp,
int  code
 

void websError webs_t  wp,
int  code,
char_t fmt,
  ...
 

char_t* websErrorMsg int  code  ) 
 

void websFree webs_t  wp  ) 
 

char_t* websGetDateString websStatType sbuf  ) 
 

char_t* websGetHost  ) 
 

char_t* websGetHostUrl  ) 
 

static int websGetInput webs_t  wp,
char_t **  ptext,
int *  nbytes
[static]
 

char_t* websGetIpaddrUrl  ) 
 

int websGetPort  ) 
 

char_t* websGetRealm  ) 
 

int websGetRequestBytes webs_t  wp  ) 
 

char_t* websGetRequestDir webs_t  wp  ) 
 

int websGetRequestFlags webs_t  wp  ) 
 

char_t* websGetRequestIpaddr webs_t  wp  ) 
 

char_t* websGetRequestLpath webs_t  wp  ) 
 

char_t* websGetRequestPassword webs_t  wp  ) 
 

char_t* websGetRequestPath webs_t  wp  ) 
 

char_t* websGetRequestType webs_t  wp  ) 
 

char_t* websGetRequestUserName webs_t  wp  ) 
 

int websGetRequestWritten webs_t  wp  ) 
 

static int websGetTimeSinceMark webs_t  wp  )  [static]
 

char_t* websGetVar webs_t  wp,
char_t var,
char_t defaultGetValue
 

int websOpenListen int  port,
int  retries
 

int websOpenServer int  port,
int  retries
 

static int websParseFirst webs_t  wp,
char_t text
[static]
 

static void websParseRequest webs_t  wp  )  [static]
 

void websReadEvent webs_t  wp  ) 
 

void websRedirect webs_t  wp,
char_t url
 

void websResponse webs_t  wp,
int  code,
char_t message,
char_t redirect
 

static char_t* websSafeUrl const char_t url  )  [static]
 

void websSetEnv webs_t  wp  ) 
 

void websSetHost char_t host  ) 
 

void websSetHostUrl char_t url  ) 
 

void websSetIpaddr char_t ipaddr  ) 
 

void websSetRealm char_t realmName  ) 
 

void websSetRequestBytes webs_t  wp,
int  bytes
 

void websSetRequestFlags webs_t  wp,
int  flags
 

void websSetRequestLpath webs_t  wp,
char_t lpath
 

void websSetRequestPath webs_t  wp,
char_t dir,
char_t path
 

void websSetRequestSocketHandler webs_t  wp,
int  mask,
void(*)(webs_t wp)  fn
 

void websSetRequestWritten webs_t  wp,
int  written
 

void websSetTimeMark webs_t  wp  ) 
 

void websSetVar webs_t  wp,
char_t var,
char_t value
 

static void websSocketEvent int  sid,
int  mask,
int  data
[static]
 

int websTestVar webs_t  wp,
char_t var
 

void websTimeout void *  arg,
int  id
 

void websTimeoutCancel webs_t  wp  ) 
 

int websValid webs_t  wp  ) 
 

int websWrite webs_t  wp,
char_t fmt,
  ...
 

int websWriteBlock webs_t  wp,
char_t buf,
int  nChars
 

int websWriteDataNonBlock webs_t  wp,
char *  buf,
int  nChars
 


Variable Documentation

webs_t* webs
 

websErrorType websErrors[]
 

Initial value:

 {
        { 200, T("Data follows") },
        { 204, T("No Content") },
        { 301, T("Redirect") },
        { 302, T("Redirect") },
        { 304, T("Use local copy") },
        { 400, T("Page not found") },
        { 401, T("Unauthorized") },
        { 403, T("Forbidden") },
        { 404, T("Site or Page Not Found") },
        { 405, T("Access Denied") },
        { 500, T("Web Error") },
        { 501, T("Not Implemented") },
        { 503, T("Site Temporarily Unavailable. Try again.") },
        { 0, NULL }
}

char_t websHost[64]
 

char_t* websHostUrl = NULL
 

char_t websIpaddr[64]
 

char_t* websIpaddrUrl = NULL
 

int websListenSock [static]
 

int websMax
 

sym_fd_t websMime
 

int websOpenCount = 0 [static]
 

int websPort
 

char_t websRealm[64] = T("GoAhead") [static]
 

websStatsType websStats
 


Generated on Thu Mar 2 16:11:29 2006 for VDK Blacksheep by  doxygen 1.4.1