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_CSP_NONCE=00234000e32072a014d5cc34991776a WWW_DOCUMENT_ROOT= WWW_GATEWAY_INTERFACE=CGI/1.1 WWW_GATEWAY_EOF=$Z-62EA03C21B57DC5B37E713E0- WWW_GATEWAY_EOT=$D-93ED4A61CC2C7CAE3EA2AD57- WWW_GATEWAY_ESC=$E-186939AC1DDCEABD0C90925A- WWW_GATEWAY_MRS=16492 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_ACCEPT_ENCODING=gzip, br, zstd, deflate WWW_HTTP_HOST=wasd.vsm.com.au WWW_PATH_INFO= WWW_PATH_TRANSLATED= WWW_QUERY_STRING= WWW_REMOTE_ADDR=3.16.69.52 WWW_REMOTE_HOST=ec2-3-16-69-52.us-east-2.compute.amazonaws.com WWW_REMOTE_PORT=32877 WWW_REMOTE_USER= WWW_REQUEST_METHOD=GET WWW_REQUEST_PROTOCOL=HTTP/2 WWW_REQUEST_SCHEME=https: WWW_REQUEST_TIME_GMT=Fri, 01 Nov 2024 00:35:46 GMT WWW_REQUEST_TIME_LOCAL=Fri, 01 Nov 2024 11:05:46 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=119.252.17.13 WWW_SERVER_CHARSET=ISO-8859-1 WWW_SERVER_GMT=+10:30 WWW_SERVER_NAME=wasd.vsm.com.au WWW_SERVER_PROTOCOL=HTTP/1.1 WWW_SERVER_PORT=443 WWW_SERVER_SIGNATURE=
WASD/12.2.5 Server at wasd.vsm.com.au Port 443
WWW_SERVER_SOFTWARE=HTTPd-WASD/12.2.5 OpenVMS/IA64 SSL WWW_UNIQUE_ID=fd73387f2c42777623e 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]