CGIplus-enabled Run-time Environment Example -------------------------------------------- ***** FIRST, EVIDENCE OF PERSISTANCE ***** Usage Count: 1 ***** SECOND, THE CGI ENVIRONMENT AVAILABLE ***** WWW_AUTH_TYPE= WWW_CONTENT_LENGTH=0 WWW_CONTENT_TYPE= WWW_DOCUMENT_ROOT= WWW_GATEWAY_INTERFACE=CGI/1.1 WWW_GATEWAY_EOF=$Z-41986E55B2FFAB12FD7DE76B- WWW_GATEWAY_EOT=$D-49FDBFB0E29E6FF1F47FE0FE- WWW_GATEWAY_ESC=$E-29D2116739812A7CC613514D- WWW_GATEWAY_MRS=4096 WWW_HTTP_ACCEPT=*/* WWW_HTTP_USER_AGENT=Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) WWW_HTTP_HOST=timmersit.nl WWW_PATH_INFO= WWW_PATH_TRANSLATED= WWW_QUERY_STRING= WWW_REMOTE_ADDR=18.118.120.109 WWW_REMOTE_HOST=18.118.120.109 WWW_REMOTE_PORT=52213 WWW_REMOTE_USER= WWW_REQUEST_METHOD=GET WWW_REQUEST_PROTOCOL=HTTP/1.1 WWW_REQUEST_SCHEME=http: WWW_REQUEST_TIME_GMT=Sun, 28 Apr 2024 22:45:36 GMT WWW_REQUEST_TIME_LOCAL=Mon, 29 Apr 2024 00:45:36 WWW_REQUEST_URI=/rtbin/dict.h WWW_SCRIPT_FILENAME=WASD_ROOT:[SRC.HTTPD]DICT.H WWW_SCRIPT_NAME=/rtbin/dict.h WWW_SCRIPT_RTE=cgi-bin:[000000]rte_example.exe WWW_SERVER_ADDR=192.168.1.31 WWW_SERVER_CHARSET=ISO-8859-1 WWW_SERVER_GMT=+02:00 WWW_SERVER_NAME=vms1.timmersit.nl WWW_SERVER_PROTOCOL=HTTP/1.1 WWW_SERVER_PORT=80 WWW_SERVER_SIGNATURE=
WASD/11.3.0 Server at vms1.timmersit.nl Port 80
WWW_SERVER_SOFTWARE=HTTPd-WASD/11.3.0 OpenVMS/AXP WWW_UNIQUE_ID=Zi7tsAAAAAQAAXp0mGg WWW_SECURITY_STATUS=NONE WWW_KEY_COUNT=0 ***** THIRD, AN "INTERPRETED" FILE (WWW_SCRIPT_NAME/WWW_SCRIPT_FILENAME) ***** [0001] /*****************************************************************************/ [0002] /* [0003] dict.h [0004] */ [0005] /*****************************************************************************/ [0006] [0007] #ifndef DICT_H_LOADED [0008] #define DICT_H_LOADED 1 [0009] [0010] #include "wasd.h" [0011] [0012] /**********/ [0013] /* macros */ [0014] /**********/ [0015] [0016] #define DICT_DEFAULT_SIZE 32 /* hash entries */ [0017] #define DICT_MIN_BYTES 64 /* minimum chunk of memory for entry strings */ [0018] [0019] #define DICT_HASH_MULT 69069 /* hash multiplier */ [0020] [0021] /* some of these are design elements and currently not in use */ [0022] #define DICT_TYPE_CONFIG "~" /* configuration/mapping entry */ [0023] #define DICT_TYPE_INTERNAL "$" /* server internal */ [0024] #define DICT_TYPE_GLOBAL "_" /* global configuration */ [0025] #define DICT_TYPE_OPAQUE "?" /* opaque value (not string) */ [0026] #define DICT_TYPE_OPAQUE_KEY "|" /* opaque key and value (not strings) */ [0027] #define DICT_TYPE_REQUEST ">" /* request header */ [0028] #define DICT_TYPE_RESERVED "!" /* used by METACON.C to remove an entry */ [0029] #define DICT_TYPE_RESPONSE "<" /* response header */ [0030] #define DICT_TYPE_SSI "^" /* nudge, nudge, wink, wink */ [0031] #define DICT_TYPE_UNDEFINED "" /* null character */ [0032] [0033] #define DICT_TYPE_UNIQUE 0x80 /* enumerated entries */ [0034] #define DICT_TYPE_RESPONSE_UNIQUE "\xbc" /* enumerated response header */ [0035] [0036] #define DICT_GET_COUNT(ptr) (((DICT_STRUCT*)(ptr))->count) [0037] #define DICT_GET_KEY(ptr) (((DICT_ENTRY_STRUCT*)(ptr))->key) [0038] #define DICT_GET_KEY_LEN(ptr) (((DICT_ENTRY_STRUCT*)(ptr))->klen) [0039] #define DICT_GET_TYPE(ptr) (((DICT_ENTRY_STRUCT*)(ptr))->type) [0040] #define DICT_GET_VALUE(ptr) (((DICT_ENTRY_STRUCT*)(ptr))->value) [0041] #define DICT_GET_VALUE_LEN(ptr) (((DICT_ENTRY_STRUCT*)(ptr))->vlen) [0042] #define DICT_GET_BYTES(ptr) (((DICT_ENTRY_STRUCT*)(ptr))->bytes) [0043] #define DICT_GET_VALUE_SIZE(ptr) \ [0044] ((((DICT_ENTRY_STRUCT*)(ptr))->bytes) - (((DICT_ENTRY_STRUCT*)(ptr))->klen)) [0045] [0046] /**************/ [0047] /* structures */ [0048] /**************/ [0049] [0050] #pragma member_alignment __save [0051] #pragma member_alignment [0052] [0053] typedef struct DictStruct DICT_STRUCT; [0054] typedef struct DictEntryStruct DICT_ENTRY_STRUCT; [0055] [0056] struct DictEntryStruct [0057] { [0058] DICT_ENTRY_STRUCT *blink, [0059] *clink, [0060] *flink; [0061] DICT_STRUCT *DictPtr; [0062] uint bytes, [0063] extract, [0064] hash, [0065] klen, [0066] vlen; [0067] uchar *key, [0068] *value; [0069] uchar type[2]; [0070] uchar buffer[]; [0071] }; [0072] [0073] struct DictStruct [0074] { [0075] uint bytes, [0076] count, [0077] dirty, [0078] size, [0079] unique; [0080] REQUEST_STRUCT *RequestPtr; [0081] DICT_ENTRY_STRUCT *head, [0082] *next, [0083] *tail; [0084] DICT_ENTRY_STRUCT **table; [0085] }; [0086] [0087] #pragma member_alignment __restore [0088] [0089] /***********************/ [0090] /* function prototypes */ [0091] /***********************/ [0092] [0093] DICT_STRUCT* DictCreate (REQUEST_STRUCT*, int); [0094] DICT_STRUCT* DictDestroy (DICT_STRUCT*); [0095] DICT_STRUCT* DictDuplicate (REQUEST_STRUCT*, DICT_STRUCT*); [0096] uint DictDirty (DICT_STRUCT*); [0097] DICT_ENTRY_STRUCT* DictExpandEntry (DICT_ENTRY_STRUCT*, uint); [0098] DICT_ENTRY_STRUCT* DictExtractEntry (DICT_ENTRY_STRUCT*); [0099] DICT_ENTRY_STRUCT* DictInsert (DICT_STRUCT*, uchar*, uchar*, int, uchar*, int); [0100] DICT_ENTRY_STRUCT* DictInsertEntry (DICT_STRUCT*, DICT_ENTRY_STRUCT*); [0101] DICT_ENTRY_STRUCT* DictIterate (DICT_STRUCT*, uchar*); [0102] DICT_ENTRY_STRUCT* DictLookup (DICT_STRUCT*, uchar*, uchar*, int); [0103] DICT_ENTRY_STRUCT* DictRemove (DICT_STRUCT*, uchar*, uchar*, int); [0104] DICT_ENTRY_STRUCT* DictRemoveEntry (DICT_ENTRY_STRUCT*); [0105] void DictValueLength (DICT_ENTRY_STRUCT*, uint); [0106] void DictWatch (DICT_STRUCT*, uchar*, uchar*); [0107] void DictWatchEntry (DICT_ENTRY_STRUCT*); [0108] void DictTest (char*); [0109] [0110] #endif /* DICT_H_LOADED */ [0111] [0112] /*****************************************************************************/ [0113]