source: rtems/cpukit/httpd/ejIntrn.h @ ee3afa2

4.104.114.84.95
Last change on this file since ee3afa2 was ee3afa2, checked in by Joel Sherrill <joel.sherrill@…>, on 04/11/03 at 14:46:55

2002-04-10 Mike Siers <mikes@…>

  • rtems_webserver/NOTES, rtems_webserver/asp.c, rtems_webserver/balloc.c, rtems_webserver/default.c, rtems_webserver/ej.h, rtems_webserver/ejIntrn.h, rtems_webserver/ejlex.c, rtems_webserver/ejparse.c, rtems_webserver/emfdb.c, rtems_webserver/emfdb.h, rtems_webserver/form.c, rtems_webserver/h.c, rtems_webserver/handler.c, rtems_webserver/license.txt, rtems_webserver/md5.h, rtems_webserver/md5c.c, rtems_webserver/mime.c, rtems_webserver/misc.c, rtems_webserver/ringq.c, rtems_webserver/rom.c, rtems_webserver/security.c, rtems_webserver/sock.c, rtems_webserver/sym.c, rtems_webserver/uemf.c, rtems_webserver/uemf.h, rtems_webserver/um.c, rtems_webserver/um.h, rtems_webserver/url.c, rtems_webserver/value.c, rtems_webserver/wbase64.c, rtems_webserver/webcomp.c, rtems_webserver/webpage.c, rtems_webserver/webrom.c, rtems_webserver/webs.c, rtems_webserver/webs.h, rtems_webserver/websuemf.c, rtems_webserver/wsIntrn.h: Update to GoAhead? Webserver 2.1.4. The following URL is the release notes from GoAhead?.

http://data.goahead.com/Software/Webserver/2.1.4/release.htm

I have only done a minimal amount of testing (i.e. the network
demo program works fine). Please try this out and let me know
if it works. The patch needs to be applied on the
c/src/libnetworking/rtems_webserver directory.

  • Property mode set to 100644
File size: 7.1 KB
Line 
1/*
2 *      ejIntrn.h -- Ejscript(TM) header
3 *
4 *      Copyright (c) GoAhead Software, Inc., 1992-2000
5 *
6 *      See the file "license.txt" for information on usage and redistribution
7 *
8 * $Id$
9 */
10
11#ifndef _h_EJINTERNAL
12#define _h_EJINTERNAL 1
13
14/******************************** Description *********************************/
15
16/*
17 *      GoAhead Ejscript(TM) header. This defines the Ejscript API and internal
18 *      structures.
19 */
20
21/********************************* Includes ***********************************/
22
23#include        <ctype.h>
24#include        <stdarg.h>
25#include        <stdlib.h>
26
27#ifdef CE
28#ifndef UEMF
29        #include        <io.h>
30#endif
31#endif
32
33#ifdef LYNX
34        #include        <unistd.h>
35#endif
36
37#ifdef QNX4
38        #include        <dirent.h>
39#endif
40
41#ifdef UEMF
42        #include        "uemf.h"
43#else
44        #include        <param.h>
45        #include        <stat.h>
46        #include        "basic/basicInternal.h"
47        #include        "emf/emfInternal.h"
48#endif
49
50#include                "ej.h"
51
52/********************************** Defines ***********************************/
53/*
54 *      Constants
55 */
56#define EJ_INC                          110             /* Growth for tags/tokens */
57#define EJ_SCRIPT_INC           1023    /* Growth for ej scripts */
58#define EJ_OFFSET                       1               /* hAlloc doesn't like 0 entries */
59#define EJ_MAX_RECURSE          100             /* Sanity for maximum recursion */
60
61/*
62 *      Ejscript Lexical analyser tokens
63 */
64#define TOK_ERR                         -1              /* Any error */
65#define TOK_LPAREN                      1               /* ( */
66#define TOK_RPAREN                      2               /* ) */
67#define TOK_IF                          3               /* if */
68#define TOK_ELSE                        4               /* else */
69#define TOK_LBRACE                      5               /* { */
70#define TOK_RBRACE                      6               /* } */
71#define TOK_LOGICAL                     7               /* ||, &&, ! */
72#define TOK_EXPR                        8               /* +, -, /, % */
73#define TOK_SEMI                        9               /* ; */
74#define TOK_LITERAL                     10              /* literal string */
75#define TOK_FUNCTION            11              /* function name */
76#define TOK_NEWLINE                     12              /* newline white space */
77#define TOK_ID                          13              /* function name */
78#define TOK_EOF                         14              /* End of script */
79#define TOK_COMMA                       15              /* Comma */
80#define TOK_VAR                         16              /* var */
81#define TOK_ASSIGNMENT          17              /* = */
82#define TOK_FOR                         18              /* for */
83#define TOK_INC_DEC                     19              /* ++, -- */
84#define TOK_RETURN                      20              /* return */
85
86/*
87 *      Expression operators
88 */
89#define EXPR_LESS                       1               /* < */
90#define EXPR_LESSEQ                     2               /* <= */
91#define EXPR_GREATER            3               /* > */
92#define EXPR_GREATEREQ          4               /* >= */
93#define EXPR_EQ                         5               /* == */
94#define EXPR_NOTEQ                      6               /* != */
95#define EXPR_PLUS                       7               /* + */
96#define EXPR_MINUS                      8               /* - */
97#define EXPR_DIV                        9               /* / */
98#define EXPR_MOD                        10              /* % */
99#define EXPR_LSHIFT                     11              /* << */
100#define EXPR_RSHIFT                     12              /* >> */
101#define EXPR_MUL                        13              /* * */
102#define EXPR_ASSIGNMENT         14              /* = */
103#define EXPR_INC                        15              /* ++ */
104#define EXPR_DEC                        16              /* -- */
105#define EXPR_BOOL_COMP          17              /* ! */
106/*
107 *      Conditional operators
108 */
109#define COND_AND                        1               /* && */
110#define COND_OR                         2               /* || */
111#define COND_NOT                        3               /* ! */
112
113/*
114 *      States
115 */
116#define STATE_ERR                               -1                      /* Error state */
117#define STATE_EOF                               1                       /* End of file */
118#define STATE_COND                              2                       /* Parsing a "(conditional)" stmt */
119#define STATE_COND_DONE                 3
120#define STATE_RELEXP                    4                       /* Parsing a relational expr */
121#define STATE_RELEXP_DONE               5
122#define STATE_EXPR                              6                       /* Parsing an expression */
123#define STATE_EXPR_DONE                 7
124#define STATE_STMT                              8                       /* Parsing General statement */
125#define STATE_STMT_DONE                 9
126#define STATE_STMT_BLOCK_DONE   10                      /* End of block "}" */
127#define STATE_ARG_LIST                  11                      /* Function arg list */
128#define STATE_ARG_LIST_DONE             12
129#define STATE_DEC_LIST                  16                      /* Declaration list */
130#define STATE_DEC_LIST_DONE             17
131#define STATE_DEC                               18
132#define STATE_DEC_DONE                  19
133
134#define STATE_RET                               20                      /* Return statement */
135
136#define STATE_BEGIN                             STATE_STMT
137
138/*
139 *      Flags. Used in ej_t and as parameter to parse()
140 */
141#define FLAGS_EXE                               0x1                             /* Execute statements */
142#define FLAGS_VARIABLES                 0x2                             /* Allocated variables store */
143#define FLAGS_FUNCTIONS                 0x4                             /* Allocated function store */
144
145/*
146 *      Function call structure
147 */
148typedef struct {
149        char_t          *fname;                                                 /* Function name */
150        char_t          **args;                                                 /* Args for function (halloc) */
151        int                     nArgs;                                                  /* Number of args */
152} ejfunc_t;
153
154/*
155 *      EJ evaluation block structure
156 */
157typedef struct ejEval {
158        ringq_t         tokbuf;                                                 /* Current token */
159        ringq_t         script;                                                 /* Input script for parsing */
160        char_t          *putBackToken;                                  /* Putback token string */
161        int                     putBackTokenId;                                 /* Putback token ID */
162        char_t          *line;                                                  /* Current line */
163        int                     lineLength;                                             /* Current line length */
164        int                     lineNumber;                                             /* Parse line number */
165        int                     lineColumn;                                             /* Column in line */
166} ejinput_t;
167
168/*
169 *      Per Ejscript session structure
170 */
171typedef struct ej {
172        ejinput_t       *input;                                                 /* Input evaluation block */
173        sym_fd_t        functions;                                              /* Symbol table for functions */
174        sym_fd_t        *variables;                                             /* hAlloc list of variables */
175        int                     variableMax;                                    /* Number of entries */
176        ejfunc_t        *func;                                                  /* Current function */
177        char_t          *result;                                                /* Current expression result */
178        char_t          *error;                                                 /* Error message */
179        char_t          *token;                                                 /* Pointer to token string */
180        int                     tid;                                                    /* Current token id */
181        int                     eid;                                                    /* Halloc handle */
182        int                     flags;                                                  /* Flags */
183        int                     userHandle;                                             /* User defined handle */
184} ej_t;
185
186/******************************** Prototypes **********************************/
187
188extern int              ejOpenBlock(int eid);
189extern int              ejCloseBlock(int eid, int vid);
190extern char_t   *ejEvalBlock(int eid, char_t *script, char_t **emsg);
191#ifndef __NO_EJ_FILE
192extern char_t   *ejEvalFile(int eid, char_t *path, char_t **emsg);
193#endif
194extern int              ejRemoveGlobalFunction(int eid, char_t *name);
195extern void             *ejGetGlobalFunction(int eid, char_t *name);
196extern int              ejSetGlobalFunctionDirect(sym_fd_t functions, char_t *name,
197                                        int (*fn)(int eid, void *handle, int argc, char_t **argv));
198extern void     ejError(ej_t* ep, char_t* fmt, ...);
199extern void             ejSetUserHandle(int eid, int handle);
200extern int              ejGetUserHandle(int eid);
201extern int              ejGetLineNumber(int eid);
202extern char_t   *ejGetResult(int eid);
203extern void             ejSetLocalVar(int eid, char_t *var, char_t *value);
204extern void             ejSetGlobalVar(int eid, char_t *var, char_t *value);
205
206extern int              ejLexOpen(ej_t* ep);
207extern void     ejLexClose(ej_t* ep);
208extern int              ejLexOpenScript(ej_t* ep, char_t *script);
209extern void     ejLexCloseScript(ej_t* ep);
210extern void     ejLexSaveInputState(ej_t* ep, ejinput_t* state);
211extern void     ejLexFreeInputState(ej_t* ep, ejinput_t* state);
212extern void     ejLexRestoreInputState(ej_t* ep, ejinput_t* state);
213extern int              ejLexGetToken(ej_t* ep, int state);
214extern void             ejLexPutbackToken(ej_t* ep, int tid, char_t *string);
215
216extern sym_fd_t ejGetVariableTable(int eid);
217extern sym_fd_t ejGetFunctionTable(int eid);
218
219extern int              ejEmfOpen(int eid);
220extern void             ejEmfClose(int eid);
221
222extern int ejEmfDbRead(int eid, void *handle, int argc, char_t **argv);
223extern int ejEmfDbReadKeyed(int eid, void *handle, int argc, char_t **argv);
224extern int ejEmfDbTableGetNrow(int eid, void *handle, int argc, char_t **argv);
225extern int ejEmfDbDeleteRow(int eid, void *handle, int argc, char_t **argv);
226extern int ejEmfTrace(int eid, void *handle, int argc, char_t **argv);
227extern int ejEmfDbWrite(int eid, void *handle, int argc, char_t **argv);
228extern int ejEmfDbCollectTable(int eid, void *handle, int argc, char_t **argv);
229
230#endif /* _h_EJINTERNAL */
Note: See TracBrowser for help on using the repository browser.