Keep looking Donot settle
分类: LINUX
2015-04-17 18:20:59
nt websAspOpen()
功能:主要是创建asp symbol table和write命令
说明:定义了一个write命令,对应的实现函数为websAspWrite
-----------------------------------------------------------------------------------------------------------------
void websAspClose()
功能:关闭Asp symbol table.
说明:
-----------------------------------------------------------------------------------------------------------------
int websAspRequest(webs_t wp, char_t *lpath)
功能:处理asp请求。就是输出一个asp页面,并且将asp页面中的script解析出来,输出到asp页面中。
说明:
1. 标识,头部信息已经向浏览器输出完成
2. 将asp页面读入到内存buf中;
3. 然后在buf中查找<% language=javascript %>
4. 在查找到<%时,将buf中此位置前的页面输出到浏览器;
5. asp中可能存在<% language=javascript %>,也可能不存在<% language=javascript %>,而是存在<% ……. %>。所以需要区分,是<% language=javascript %>时,不向浏览器输出。
6. 然后调用<% %>中的处理程序,输出数据到浏览器,是有区分的(有无EMF_SCRIPT_EJSCRIPT)
7. 最后输出%>位置后的asp页面数据到浏览器中。
-----------------------------------------------------------------------------------------------------------------
int websAspDefine(char_t *name, int (*fn)(int ejid, webs_t wp, int argc, char_t **argv))
功能:定义一个asp 函数script
说明:就是<% %>中对应的处理函数。
-----------------------------------------------------------------------------------------------------------------
int websAspWrite(int ejid, webs_t wp, int argc, char_t **argv)
功能:write命令的实现函数
说明:<%write()%>
-----------------------------------------------------------------------------------------------------------------
static char_t *strtokcmp(char_t *s1, char_t *s2)
功能:在字符s1中查找s2,掠过s1中的空格。
说明:
-----------------------------------------------------------------------------------------------------------------
static char_t *skipWhite(char_t *s)
功能:跳过空格
说明:
<% language=javascript write("Query String: " + QUERY_STRING) %>
<% write("JavaScript is still the selected language"): %>
Today is <% write("Hello World"); %>
例子:
<% language=javascript %>
ASP / JavaScript Test
Expanded ASP data: <% aspTest("Peter Smith", "
<% var z; \
for (z=0; z<5; z=z+1) \
{ \
if (z<=2) \
write(z+" is less than 3
"); \
else if (z==3) \
write(z+" is equal to 3
"); \
else \
write(z+" is greater than 3
"); \
} \
%>
int ejLexOpen(ej_t* ep)
void ejLexClose(ej_t* ep)
int ejLexOpenScript(ej_t* ep, char_t *script)
void ejLexCloseScript(ej_t* ep)
void ejLexSaveInputState(ej_t* ep, ejinput_t* state)
void ejLexRestoreInputState(ej_t* ep, ejinput_t* state)
void ejLexFreeInputState(ej_t* ep, ejinput_t* state)
int ejLexGetToken(ej_t* ep, int state)
static int getLexicalToken(ej_t* ep, int state)
void ejLexPutbackToken(ej_t* ep, int tid, char_t *string)
static int tokenAddChar(ej_t *ep, int c)
static int inputGetc(ej_t* ep)
static void inputPutback(ej_t* ep, int c)
static int charConvert(ej_t* ep, int base, int maxDig)
int ejOpenEngine(sym_fd_t variables, sym_fd_t functions)
void ejCloseEngine(int eid)
char_t *ejEvalFile(int eid, char_t *path, char_t **emsg)
int ejOpenBlock(int eid)
int ejCloseBlock(int eid, int vid)
char_t *ejEvalBlock(int eid, char_t *script, char_t **emsg)
char_t *ejEval(int eid, char_t *script, char_t **emsg)
static int parse(ej_t *ep, int state, int flags)
static int parseStmt(ej_t *ep, int state, int flags)
static int parseDeclaration(ej_t *ep, int state, int flags)
static int parseArgs(ej_t *ep, int state, int flags)
static int parseCond(ej_t *ep, int state, int flags)
static int parseExpr(ej_t *ep, int state, int flags)
static int evalCond(ej_t *ep, char_t *lhs, int rel, char_t *rhs)
static int evalExpr(ej_t *ep, char_t *lhs, int rel, char_t *rhs)
static int evalFunction(ej_t *ep)
void ejError(ej_t* ep, char_t* fmt, ...)
static void clearString(char_t **ptr)
static void setString(B_ARGS_DEC, char_t **ptr, char_t *s)
static void appendString(char_t **ptr, char_t *s)
int ejSetGlobalFunction(int eid, char_t *name, int (*fn)(int eid, void *handle, int argc, char_t **argv))
int ejSetGlobalFunctionDirect(sym_fd_t functions, char_t *name,
int (*fn)(int eid, void *handle, int argc, char_t **argv))
int ejRemoveGlobalFunction(int eid, char_t *name)
void *ejGetGlobalFunction(int eid, char_t *name)
int ejArgs(int argc, char_t **argv, char_t *fmt, ...)
void ejSetUserHandle(int eid, void* handle)
void* ejGetUserHandle(int eid)
int ejGetLineNumber(int eid)
void ejSetResult(int eid, char_t *s)
char_t *ejGetResult(int eid)
void ejSetVar(int eid, char_t *var, char_t *value)
void ejSetLocalVar(int eid, char_t *var, char_t *value)
void ejSetGlobalVar(int eid, char_t *var, char_t *value)
int ejGetVar(int eid, char_t *var, char_t **value)
sym_fd_t ejGetVariableTable(int eid)
sym_fd_t ejGetFunctionTable(int eid)
static void freeFunc(ejfunc_t *func)
static ej_t *ejPtr(int eid)
static void ejRemoveNewlines(ej_t *ep, int state)