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_BG=BG47039: WWW_GATEWAY_INTERFACE=CGI/1.1 WWW_GATEWAY_EOF=$Z-C3CEC6D71385252C89AE003D- WWW_GATEWAY_EOT=$D-169649DA01F335931F0D5DB8- WWW_GATEWAY_ESC=$E-E92E64597997E046F548260F- WWW_GATEWAY_MRS=4492 WWW_HTTP_CF_RAY=8e9904753b9b61c9-ORD WWW_HTTP_USER_AGENT=Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) WWW_HTTP_HOST=675502.arinterhk.tech WWW_HTTP_CF_IPCOUNTRY=US WWW_HTTP_ACCEPT_ENCODING=gzip, br WWW_HTTP_X_FORWARDED_FOR=18.216.53.7 WWW_HTTP_X_FORWARDED_PROTO=https WWW_HTTP_ACCEPT=*/* WWW_HTTP_CF_CONNECTING_IP=18.216.53.7 WWW_HTTP_CF_VISITOR={"scheme":"https"} WWW_HTTP_CONNECTION=Keep-Alive WWW_HTTP_CDN_LOOP=cloudflare; loops=1 WWW_PATH_INFO= WWW_PATH_TRANSLATED= WWW_QUERY_STRING= WWW_REMOTE_ADDR=172.69.7.54 WWW_REMOTE_HOST=172.69.7.54 WWW_REMOTE_PORT=57444 WWW_REMOTE_USER= WWW_REQUEST_METHOD=GET WWW_REQUEST_PROTOCOL=HTTP/1.1 WWW_REQUEST_SCHEME=http: WWW_REQUEST_TIME_GMT=Thu, 28 Nov 2024 08:40:21 GMT WWW_REQUEST_TIME_LOCAL=Thu, 28 Nov 2024 09:40:21 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=146.48.108.2 WWW_SERVER_CHARSET=ISO-8859-1 WWW_SERVER_GMT=+01:00 WWW_SERVER_NAME=ns1.gposta.it WWW_SERVER_PROTOCOL=HTTP/1.1 WWW_SERVER_PORT=80 WWW_SERVER_SIGNATURE=
WASD/11.5.1 Server at ns1.gposta.it Port 80 WWW_SERVER_SOFTWARE=HTTPd-WASD/11.5.1 OpenVMS/IA64 SSL WWW_UNIQUE_ID=Z0g6hQAAAAQkwAEpABo 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] #ifndef __VAX [0051] # pragma member_alignment __save [0052] # pragma member_alignment [0053] #endif [0054] [0055] typedef struct DictStruct DICT_STRUCT; [0056] typedef struct DictEntryStruct DICT_ENTRY_STRUCT; [0057] [0058] struct DictEntryStruct [0059] { [0060] DICT_ENTRY_STRUCT *blink, [0061] *clink, [0062] *flink; [0063] DICT_STRUCT *DictPtr; [0064] uint bytes, [0065] extract, [0066] hash, [0067] klen, [0068] vlen; [0069] uchar *key, [0070] *value; [0071] uchar type[2]; [0072] uchar buffer[]; [0073] }; [0074] [0075] struct DictStruct [0076] { [0077] uint bytes, [0078] count, [0079] dirty, [0080] size, [0081] unique; [0082] REQUEST_STRUCT *RequestPtr; [0083] DICT_ENTRY_STRUCT *head, [0084] *next, [0085] *tail; [0086] DICT_ENTRY_STRUCT **table; [0087] }; [0088] [0089] #ifndef __VAX [0090] # pragma member_alignment __restore [0091] #endif [0092] [0093] /***********************/ [0094] /* function prototypes */ [0095] /***********************/ [0096] [0097] DICT_STRUCT* DictCreate (REQUEST_STRUCT*, int); [0098] DICT_STRUCT* DictDestroy (DICT_STRUCT*); [0099] DICT_STRUCT* DictDuplicate (REQUEST_STRUCT*, DICT_STRUCT*); [0100] uint DictDirty (DICT_STRUCT*); [0101] DICT_ENTRY_STRUCT* DictExpandEntry (DICT_ENTRY_STRUCT*, uint); [0102] DICT_ENTRY_STRUCT* DictExtractEntry (DICT_ENTRY_STRUCT*); [0103] DICT_ENTRY_STRUCT* DictInsert (DICT_STRUCT*, uchar*, uchar*, int, uchar*, int); [0104] DICT_ENTRY_STRUCT* DictInsertEntry (DICT_STRUCT*, DICT_ENTRY_STRUCT*); [0105] DICT_ENTRY_STRUCT* DictIterate (DICT_STRUCT*, uchar*); [0106] DICT_ENTRY_STRUCT* DictLookup (DICT_STRUCT*, uchar*, uchar*, int); [0107] DICT_ENTRY_STRUCT* DictRemove (DICT_STRUCT*, uchar*, uchar*, int); [0108] DICT_ENTRY_STRUCT* DictRemoveEntry (DICT_ENTRY_STRUCT*); [0109] void DictValueLength (DICT_ENTRY_STRUCT*, uint); [0110] void DictWatch (DICT_STRUCT*, uchar*, uchar*); [0111] void DictWatchEntry (DICT_ENTRY_STRUCT*); [0112] void DictTest (char*); [0113] [0114] #endif /* DICT_H_LOADED */ [0115] [0116] /*****************************************************************************/ [0117]