-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfunction_help.moo
265 lines (265 loc) · 108 KB
/
function_help.moo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
@create $generic_help named ToastStunt Help Database:ToastStunt Help Database,Help Database,Database,Help,ToastStunt
@prop #123."binary_hmac()" {} rc
;;#123.("binary_hmac()") = {"Syntax: string_hmac (STR text, STR key [, STR algo [, binary]])", " binary_hmac (STR bin-string, STR key [, STR algo [, binary]])", "", "Returns a string encoding the result of applying the HMAC-SHA256 cryptographically secure HMAC function to the contents of the string text or the binary string bin-string with the specified secret key. If algo is provided, it specifies the hashing algorithm to use. Currently, only \"SHA1\" and \"SHA256\" are supported. If binary is provided and true, the result is in MOO binary string format; by default the result is a hexidecimal string.", "", "All cryptographically secure HMACs have the property that, if string_hmac(x, a) == string_hmac(y, b) then, almost certainly, equal(x, y) and furthermore, equal(a, b)", "", " This can be useful, for example, in applications that need to verify both the integrity of the message (the text) and the authenticity of the sender (as demonstrated by the possession of the secret key)."}
@prop #123."string_hmac()" {} rc
;;#123.("string_hmac()") = {"*forward*", "binary_hmac"}
@prop #123."decode_base64()" {} rc
;;#123.("decode_base64()") = {"Syntax: decode_base64 (STR base64 [, INT safe]) => STR", "", "Returns the binary string representation of the supplied Base64 encoded string argument. Raises E_INVARG if base64 is not a properly-formed Base64 string. If safe is provide and is true, a URL-safe version of Base64 is used (see RFC4648).", "", "decode_base64(\"AAEC\") => \"~00~01~02\"", "decode_base64(\"AAE\", 1) => \"~00~01\""}
@prop #123."encode_base64()" {} rc
;;#123.("encode_base64()") = {"Syntax: encode_base64 (STR binary [, INT safe]) => STR", "", "Returns the Base64 encoded string representation of the supplied binary string argument. Raises E_INVARG if binary is not a properly-formed binary string. If safe is provide and is true, a URL-safe version of Base64 is used (see RFC4648).", "", "encode_base64(\"~00~01~02\") => \"AAEC\"", "encode_base64(\"~00~01\", 1) => \"AAE\""}
@prop #123."exec()" {} rc
;;#123.("exec()") = {"Syntax: exec (LIST command[, STR input][, LIST environment variables])", "", "Asynchronously executes the specified external executable, optionally sending input. Returns the process return code, output and error. If the programmer is not a wizard, then E_PERM is raised.", "", "The first argument must be a list of strings, or E_INVARG is raised. The first string is the path to the executable and is required. The rest are command line arguments passed to the executable.", "", "The path to the executable may not start with a slash (/) or dot-dot (..), and it may not contain slash-dot (/.) or dot-slash (./), or E_INVARG is raised. If the specified executable does not exist or is not a regular file, E_INVARG is raised.", "", "If the string input is present, it is written to standard input of the executing process.", "", "Additionally, you can provide a list of environment variables to set in the shell.", "", "When the process exits, it returns a list of the form:", "", "{code, output, error}", "", "code is the integer process exit status or return code. output and error are strings of data that were written to the standard output and error of the process.", "", "The specified command is executed asynchronously. The function suspends the current task and allows other tasks to run until the command finishes. Tasks suspended this way can be killed with kill_task().", "", "The strings, input, output and error are all MOO binary strings.", "", "All external executables must reside in the executables directory.", "", "exec({\"cat\", \"-?\"}) {1, \"\", \"cat: illegal option -- ?~0Ausage: cat [-benstuv] [file ...]~0A\"}", "exec({\"cat\"}, \"foo\") {0, \"foo\", \"\"}", "exec({\"echo\", \"one\", \"two\"}) {0, \"one two~0A\", \"\"}"}
@prop #123."exp()" {} rc
;;#123.("exp()") = {"Syntax: exp (FLOAT x)", "", "Returns E (Eulers number) raised to the power of x. "}
@prop #123."generate_json()" {} rc
;;#123.("generate_json()") = {"Syntax: generate_json (ANY value [, STR mode])", "", "Returns the JSON representation of the MOO value.", "", "MOO supports a richer set of values than JSON allows. The optional mode specifies how this function handles the conversion of MOO values into their JSON representation.", "", "The common subset mode, specified by the literal mode string \"common-subset\", is the default conversion mode. In this mode, only the common subset of types (strings and numbers) are translated with fidelity between MOO types and JSON types. All other types are treated as alternative representations of the string type. This mode is useful for integration with non-MOO applications.", "", "The embedded types mode, specified by the literal mode string \"embedded-types\", adds type information. Specifically, values other than strings and numbers, which carry implicit type information, are converted into strings with type information appended. The converted string consists of the string representation of the value (as if tostr() were applied) followed by the pipe (|) character and the type. This mode is useful for serializing/deserializing objects and collections of MOO values.", "", "generate_json([]) => \"{}\"", "generate_json([\"foo\" -> \"bar\"]) => \"{\\\"foo\\\":\\\"bar\\\"}\"", "generate_json([\"foo\" -> \"bar\"], \"common-subset\") => \"{\\\"foo\\\":\\\"bar\\\"}\"", "generate_json([\"foo\" -> \"bar\"], \"embedded-types\") => \"{\\\"foo\\\":\\\"bar\\\"}\"", "generate_json([\"foo\" -> 1.1]) => \"{\\\"foo\\\":1.1}\"", "generate_json([\"foo\" -> 1.1], \"common-subset\") => \"{\\\"foo\\\":1.1}\"", "generate_json([\"foo\" -> 1.1], \"embedded-types\") => \"{\\\"foo\\\":1.1}\"", "generate_json([\"foo\" -> #1]) => \"{\\\"foo\\\":\\\"#1\\\"}\"", "generate_json([\"foo\" -> #1], \"common-subset\") => \"{\\\"foo\\\":\\\"#1\\\"}\"", "generate_json([\"foo\" -> #1], \"embedded-types\") => \"{\\\"foo\\\":\\\"#1|obj\\\"}\"", "generate_json([\"foo\" -> E_PERM]) => \"{\\\"foo\\\":\\\"E_PERM\\\"}\"", "generate_json([\"foo\" -> E_PERM], \"common-subset\") => \"{\\\"foo\\\":\\\"E_PERM\\\"}\"", "generate_json([\"foo\" -> E_PERM], \"embedded-types\") => \"{\\\"foo\\\":\\\"E_PERM|err\\\"}\"", "", "JSON keys must be strings, so regardless of the mode, the key will be converted to a string value.", "", "generate_json([1 -> 2]) => \"{\\\"1\\\":2}\"", "generate_json([1 -> 2], \"common-subset\") => \"{\\\"1\\\":2}\"", "generate_json([1 -> 2], \"embedded-types\") => \"{\\\"1|int\\\":2}\"", "generate_json([#1 -> 2], \"embedded-types\") => \"{\\\"#1|obj\\\":2}\"", "", "tion: value parse_json (str json [, str mode])", "", "Returns the MOO value representation of the JSON string. If the specified string is not valid JSON, E_INVARG is raised.", "", "The optional mode specifies how this function handles conversion of MOO values into their JSON representation. The options are the same as for generate_json().", "", "parse_json(\"{}\") => []", "parse_json(\"{\\\"foo\\\":\\\"bar\\\"}\") => [\"foo\" -> \"bar\"]", "parse_json(\"{\\\"foo\\\":\\\"bar\\\"}\", \"common-subset\") => [\"foo\" -> \"bar\"]", "parse_json(\"{\\\"foo\\\":\\\"bar\\\"}\", \"embedded-types\") => [\"foo\" -> \"bar\"]", "parse_json(\"{\\\"foo\\\":1.1}\") => [\"foo\" -> 1.1]", "parse_json(\"{\\\"foo\\\":1.1}\", \"common-subset\") => [\"foo\" -> 1.1]", "parse_json(\"{\\\"foo\\\":1.1}\", \"embedded-types\") => [\"foo\" -> 1.1]", "parse_json(\"{\\\"foo\\\":\\\"#1\\\"}\") => [\"foo\" -> \"#1\"]", "parse_json(\"{\\\"foo\\\":\\\"#1\\\"}\", \"common-subset\") => [\"foo\" -> \"#1\"]", "parse_json(\"{\\\"foo\\\":\\\"#1|obj\\\"}\", \"embedded-types\") => [\"foo\" -> #1]", "parse_json(\"{\\\"foo\\\":\\\"E_PERM\\\"}\") => [\"foo\" -> \"E_PERM\"]", "parse_json(\"{\\\"foo\\\":\\\"E_PERM\\\"}\", \"common-subset\") => [\"foo\" -> \"E_PERM\"]", "parse_json(\"{\\\"foo\\\":\\\"E_PERM|err\\\"}\", \"embedded-types\") => [\"foo\" -> E_PERM]", "", "In embedded types mode, key values can be converted to MOO types by appending type information. The full set of supported types are obj, str, err, float and int.", "", "parse_json(\"{\\\"1\\\":2}\") => [\"1\" -> 2]", "parse_json(\"{\\\"1\\\":2}\", \"common-subset\") => [\"1\" -> 2]", "parse_json(\"{\\\"1|int\\\":2}\", \"embedded-types\") => [1 -> 2]", "parse_json(\"{\\\"#1|obj\\\":2}\", \"embedded-types\") => [#1 -> 2]", "", "JSON defines types that MOO (currently) does not support, such as boolean true and false, and null. These values are always converted to the strings \"true\", \"false\" and \"null\". "}
@prop #123."getenv()" {} rc
;;#123.("getenv()") = {"Syntax: getenv (STR name)", "", "Returns the value of the named environment variable. If no such environment variable exists, 0 is returned. If the programmer is not a wizard, then E_PERM is raised.", "", "getenv(\"HOME\") => \"/home/foobar\"", "getenv(\"XYZZY\") => 0"}
@prop #123."mapdelete()" {} rc
;;#123.("mapdelete()") = {"Syntax: mapdelete (MAP map, ANY key)", "", "Returns a copy of map with the value corresponding to key removed. If key is not a valid key, then E_RANGE is raised.", "", "x = [\"foo\" -> 1, \"bar\" -> 2, \"baz\" -> 3];", "mapdelete(x, \"bar\") => [\"baz\" -> 3, \"foo\" -> 1]"}
@prop #123."mapkeys()" {} rc
;;#123.("mapkeys()") = {"Syntax: mapkeys (MAP map)", "", "Returns the keys of the elements of map.", "", "x = [\"foo\" -> 1, \"bar\" -> 2, \"baz\" -> 3];", "mapkeys(x) => {\"bar\", \"baz\", \"foo\"}"}
@prop #123."mapvalues()" {} rc
;;#123.("mapvalues()") = {"Syntax: mapvalues (MAP <map> [, ... STR <key>])", "", "Returns the values of the elements of map.", "", "If you only want the values of specific keys in the map, you can specify them as optional arguments. See examples below.", "", "Examples: ", "x = [\"foo\" -> 1, \"bar\" -> 2, \"baz\" -> 3];", "", ";mapvalues(x)", "=> {2, 3, 1}", ";mapvalues(x, \"foo\", \"baz\")", "=> {1, 3}"}
@prop #123."parse_json()" {} rc
;;#123.("parse_json()") = {"Syntax: parse_json (STR json [, STR mode])", "", "Returns the MOO value representation of the JSON string. If the specified string is not valid JSON, E_INVARG is raised.", "", "The optional mode specifies how this function handles conversion of MOO values into their JSON representation. The options are the same as for generate_json().", "", "parse_json(\"{}\") => []", "parse_json(\"{\\\"foo\\\":\\\"bar\\\"}\") => [\"foo\" -> \"bar\"]", "parse_json(\"{\\\"foo\\\":\\\"bar\\\"}\", \"common-subset\") => [\"foo\" -> \"bar\"]", "parse_json(\"{\\\"foo\\\":\\\"bar\\\"}\", \"embedded-types\") => [\"foo\" -> \"bar\"]", "parse_json(\"{\\\"foo\\\":1.1}\") => [\"foo\" -> 1.1]", "parse_json(\"{\\\"foo\\\":1.1}\", \"common-subset\") => [\"foo\" -> 1.1]", "parse_json(\"{\\\"foo\\\":1.1}\", \"embedded-types\") => [\"foo\" -> 1.1]", "parse_json(\"{\\\"foo\\\":\\\"#1\\\"}\") => [\"foo\" -> \"#1\"]", "parse_json(\"{\\\"foo\\\":\\\"#1\\\"}\", \"common-subset\") => [\"foo\" -> \"#1\"]", "parse_json(\"{\\\"foo\\\":\\\"#1|obj\\\"}\", \"embedded-types\") => [\"foo\" -> #1]", "parse_json(\"{\\\"foo\\\":\\\"E_PERM\\\"}\") => [\"foo\" -> \"E_PERM\"]", "parse_json(\"{\\\"foo\\\":\\\"E_PERM\\\"}\", \"common-subset\") => [\"foo\" -> \"E_PERM\"]", "parse_json(\"{\\\"foo\\\":\\\"E_PERM|err\\\"}\", \"embedded-types\") => [\"foo\" -> E_PERM]", "", "In embedded types mode, key values can be converted to MOO types by appending type information. The full set of supported types are obj, str, err, float and int.", "", "parse_json(\"{\\\"1\\\":2}\") => [\"1\" -> 2]", "parse_json(\"{\\\"1\\\":2}\", \"common-subset\") => [\"1\" -> 2]", "parse_json(\"{\\\"1|int\\\":2}\", \"embedded-types\") => [1 -> 2]", "parse_json(\"{\\\"#1|obj\\\":2}\", \"embedded-types\") => [#1 -> 2]", "", "JSON defines types that MOO (currently) does not support, such as boolean true and false, and null. These values are always converted to the strings \"true\", \"false\" and \"null\". "}
@prop #123."random_bytes()" {} rc
;;#123.("random_bytes()") = {"Syntax: random_bytes (INT count)", "", "Returns a binary string composed of between one and 10000 random bytes. count specifies the number of bytes and must be a positive integer; otherwise, E_INVARG is raised. "}
@prop #123."read_http()" {} rc
;;#123.("read_http()") = {"Syntax: read_http (request-or-response [, OBJ conn])", "", "Reads lines from the connection conn (or, if not provided, from the player that typed the command that initiated the current task) and attempts to parse the lines as if they are an HTTP request or response. request-or-response must be either the string \"request\" or \"response\". It dictates the type of parsing that will be done.", "", "Just like read(), if conn is provided, then the programmer must either be a wizard or the owner of conn; if conn is not provided, then read_http() may only be called by a wizard and only in the task that was last spawned by a command from the connection in question. Otherwise, E_PERM is raised. Likewise, if conn is not currently connected and has no pending lines of input, or if the connection is closed while a task is waiting for input but before any lines of input are received, then read_http() raises E_INVARG.", "", "If parsing fails because the request or response is syntactically incorrect, read_http() will return a map with the single key \"error\" and a list of values describing the reason for the error. If parsing succeeds, read_http() will return a map with an appropriate subset of the following keys, with values parsed from the HTTP request or response: \"method\", \"uri\", \"headers\", \"body\", \"status\" and \"upgrade\".", "", " Fine point: read_http() assumes the input strings are binary strings. When called interactively, as in the example below, the programmer must insert the literal line terminators or parsing will fail. ", "", "The following example interactively reads an HTTP request from the players connection.", "", "read_http(\"request\", player)", "GET /path HTTP/1.1~0D~0A", "Host: example.com~0D~0A", "~0D~0A", "", "In this example, the string ~0D~0A ends the request. The call returns the following (the request has no body):", "", "[\"headers\" -> [\"Host\" -> \"example.com\"], \"method\" -> \"GET\", \"uri\" -> \"/path\"]", "", "The following example interactively reads an HTTP response from the players connection.", "", "read_http(\"response\", player)", "HTTP/1.1 200 Ok~0D~0A", "Content-Length: 10~0D~0A", "~0D~0A", "1234567890", "", "The call returns the following:", "", "[\"body\" -> \"1234567890\", \"headers\" -> [\"Content-Length\" -> \"10\"], \"status\" -> 200]"}
@prop #123."salt()" {} rc
;;#123.("salt()") = {"Syntax: salt (STR format, STR input)", "", "Generate a crypt() compatible salt string for the specified salt format using the specified binary random input. The specific set of formats supported depends on the libraries used to build the server, but will always include the standard salt format, indicated by the format string \"\" (the empty string), and the BCrypt salt format, indicated by the format string \"$2a$NN$\" (where \"NN\" is the work factor). Other possible formats include MD5 (\"$1$\"), SHA256 (\"$5$\") and SHA512 (\"$6$\"). Both the SHA256 and SHA512 formats support optional rounds.", "", "salt(\"\", \".M\") => \"iB\"", "salt(\"$1$\", \"~183~1E~C6/~D1\") => \"$1$MAX54zGo\"", "salt(\"$5$\", \"x~F2~1Fv~ADj~92Y~9E~D4l~C3\") => \"$5$s7z5qpeOGaZb\"", "salt(\"$5$rounds=2000$\", \"G~7E~A7~F5Q5~B7~0Aa~80T\") => \"$5$rounds=2000$5trdp5JBreEM\"", "salt(\"$6$\", \"U7~EC!~E8~85~AB~CD~B5+~E1?\") => \"$6$JR1vVUSVfqQhf2yD\"", "salt(\"$6$rounds=5000$\", \"~ED'~B0~BD~B9~DB^,\\\\~BD~E7\") => \"$6$rounds=5000$hT0gxavqSl0L\"", "salt(\"$2a$08$\", \"|~99~86~DEq~94_~F3-~1A~D2#~8C~B5sx\") => \"$2a$08$dHkE1lESV9KrErGhhJTxc.\"", "", "Note: To ensure proper security, the random input must be from a sufficiently random source. "}
@prop #123."strtr()" {} rc
;;#123.("strtr()") = {"Syntax: strtr (STR source, STR str1, STR str2 [, case-matters])", "", "Transforms the string source by replacing the characters specified by str1 with the corresponding characters specified by str2. All other characters are not transformed. If str2 has fewer characters than str1 the unmatched characters are simply removed from source. By default the transformation is done on both upper and lower case characters no matter the case. If case-matters is provided and true, then case is treated as significant.", "", "strtr(\"foobar\", \"o\", \"i\") => \"fiibar\"", "strtr(\"foobar\", \"ob\", \"bo\") => \"fbboar\"", "strtr(\"foobar\", \"\", \"\") => \"foobar\"", "strtr(\"foobar\", \"foba\", \"\") => \"r\"", "strtr(\"5xX\", \"135x\", \"0aBB\", 0) => \"BbB\"", "strtr(\"5xX\", \"135x\", \"0aBB\", 1) => \"BBX\"", "strtr(\"xXxX\", \"xXxX\", \"1234\", 0) => \"4444\"", "strtr(\"xXxX\", \"xXxX\", \"1234\", 1) => \"3434\""}
@prop #123."value_hmac()" {} rc
;;#123.("value_hmac()") = {"Syntax: value_hmac (value, STR key [, STR algo [, binary]])", "", "Returns the same string as string_hmac(toliteral(value), key, ...); see the description of string_hmac() for details. "}
@prop #123."crypt()" {} rc
;;#123.("crypt()") = {"Syntax: crypt (STR text [, STR salt])", "", "Encrypts (hashes) the given text using the standard UNIX encryption method. If provided, salt should be a string at least two characters long, and it may dictate a specific algorithm to use. By default, crypt uses the original, now insecure, DES algorithm. Stunt specifically includes the BCrypt algorithm (identified by salts that start with \"$2a$\"), and may include MD5, SHA256, and SHA512 algorithms depending on the libraries used to build the server. The salt used is returned as the first part of the resulting encrypted string.", "", "Aside from the possibly-random input in the salt, the encryption algorithms are entirely deterministic. In particular, you can test whether or not a given string is the same as the one used to produce a given piece of encrypted text; simply extract the salt from the front of the encrypted text and pass the candidate string and the salt to crypt(). If the result is identical to the given encrypted text, then youve got a match.", "", "crypt(\"foobar\", \"iB\") => \"iBhNpg2tYbVjw\"", "crypt(\"foobar\", \"$1$MAX54zGo\") => \"$1$MAX54zGo$UKU7XRUEEiKlB.qScC1SX0\"", "crypt(\"foobar\", \"$5$s7z5qpeOGaZb\") => \"$5$s7z5qpeOGaZb$xkxjnDdRGlPaP7Z ... .pgk/pXcdLpeVCYh0uL9\"", "crypt(\"foobar\", \"$5$rounds=2000$5trdp5JBreEM\") => \"$5$rounds=2000$5trdp5JBreEM$Imi ... ckZPoh7APC0Mo6nPeCZ3\"", "crypt(\"foobar\", \"$6$JR1vVUSVfqQhf2yD\") => \"$6$JR1vVUSVfqQhf2yD$/4vyLFcuPTz ... qI0w8m8az076yMTdl0h.\"", "crypt(\"foobar\", \"$6$rounds=5000$hT0gxavqSl0L\") => \"$6$rounds=5000$hT0gxavqSl0L$9/Y ... zpCATppeiBaDxqIbAN7/\"", "crypt(\"foobar\", \"$2a$08$dHkE1lESV9KrErGhhJTxc.\") => \"$2a$08$dHkE1lESV9KrErGhhJTxc.QnrW/bHp8mmBl5vxGVUcsbjo3gcKlf6\"", "", "Note: The specific set of supported algorithms depends on the libraries used to build the server. Only the BCrypt algorithm, which is distributed with the server source code, is guaranteed to exist. BCrypt is currently mature and well tested, and is recommended for new development."}
@prop #123."argon2()" {} rc
;;#123.("argon2()") = {"Syntax: argon2 (STR <password>, STR <salt> [, <iterations> 3] [, <memory usage in KB> 4096] [, <CPU threads> 1]) => STR", "", "The function `argon2()' hashes a password using the Argon2id password hashing algorithm. It is parametrized by three optional arguments:", "", " * Time: This is the number of times the hash will get run. This defines the amount of computation required and, as a result, how long the function will take to complete.", " * Memory: This is how much RAM is reserved for hashing.", " * Parallelism: This is the number of CPU threads that will run in parallel.", "", "The salt for the password should, at minimum, be 16 bytes for password hashing. It is recommended to use the random_bytes() function."}
@prop #123."task_local()" {} rc
;;#123.("task_local()") = {"Syntax: task_local ()", "", "Returns the value associated with the current task. The value is set with the `set_task_local` function."}
@prop #123."set_task_local()" {} rc
;;#123.("set_task_local()") = {"Syntax: set_task_local(ANY value)", "", "Sets a value that gets associated with the current running task. This value persists across verb calls and gets reset when the task is killed, making it suitable for securely passing sensitive intermediate data between verbs. The value can then later be retrieved using the `task_local` function.", "", "set_task_local(\"arbitrary data\")", "set_task_local({\"list\", \"of\", \"arbitrary\", \"data\"})"}
@prop #123."respond_to()" {} rc
;;#123.("respond_to()") = {"Syntax: respond_to(OBJ object, STR verb)", "", "Returns true if <verb> is callable on <object>, taking into account inheritance, wildcards (star verbs), etc. Otherwise, returns false. If the caller is permitted to read the object (because the object's `r' flag is true, or the caller is the owner or a wizard) the true value is a list containing the object number of the object that defines the verb and the full verb name(s). Otherwise, the numeric value `1' is returned."}
@prop #123."isa()" {} rc
;;#123.("isa()") = {"Syntax: isa(OBJ <object>, OBJ <parent>)", " isa(OBJ <object>, LIST <parent list> [, INT <return_parent>])", "", "Returns true if <object> is a descendant of <parent>, otherwise false.", "", "If a third argument is present and true, the return value will be the first parent that object1 descends from in the <parent list>.", "", "isa(#2, $wiz) => 1", "isa(#2, {$thing, $wiz, $container}) => 1", "isa(#2, {$thing, $wiz, $container}, 1) => #57 (generic wizard)", "isa(#2, {$thing, $room, $container}, 1) => #-1 <$nothing>"}
@prop #123."switch_player()" {} rc
;;#123.("switch_player()") = {"Syntax: switch_player(OBJ <object1>, OBJ <object2> [, INT <silent>])", "", "Silently switches the player associated with this connection from <object1> to <object2>. <object1> must be connected and <object2> must be a player. This can be used in do_login_command() verbs that read or suspend (which prevents the normal player selection mechanism from working.", "", "If <silent> is true, no connection messages will be printed."}
@prop #123."stunt" {} rc
;;#123.("stunt") = {"LambdaMOO-Stunt adds the following built-in functions:", "", "binary_hmac", "string_hmac", "value_hmac - Cryptographically secure HMAC functions.", "decode_base64", "encode_base64 - Encode and decode binary Base64 strings.", "exec - Execute shell scripts and applications.", "exp - Return Eulers number (E) to the power of <x>.", "generate_json - Return the JSON representation of the MOO value.", "parse_json - Return the MOO value representation of a JSON string.", "getenv - Return the value of the named environment variable.", "mapdelete - Delete a key from a map.", "mapkeys - List the keys in a map.", "mapvalues - List the values in a map.", "random_bytes - Return a binary string of <x> bytes.", "read_http - Parse lines from a network connection as HTTP requests.", "salt - Generate a cryptographically secure salt string.", "strtr - Replace characters in a string.", "crypt - Encrypt a string using a variety of algorithms.", "task_local - Return values associated with the current task.", "set_task_local - Set values associated with the current task.", "respond_to - Check if a verb is callable on an object.", "isa - Check if an object is a descendant of another object.", "switch_player - Silently switch a connection to another player.", "", "", "Additionally, the ToastStunt fork adds these:", "", "argon2 - Argon2id secure hashing.", "argon2_verify - Compares password to hash", "sqlite - See HELP SQLITE for a complete list.", "pcre_match - Match a string using Perl Compatible Regular Expressions.", "pcre_replace - Replace text in a string using Perl Compatible Regular Expressions.", "frandom - Random floats.", "distance - Calculate the distance between an arbitrary number of points.", "relative_heading - Calculate a relative bearing between two points.", "memory_usage - Total memory used, resident set size, shared pages, text, data + stack", "ftime - Precise time, including an argument for monotonic timing.", "locate_by_name - Quickly locate objects by their name and aliases.", "usage - Returns a list of system information from the operating system.", "explode - Return a list of substrings of a string separated by a break.", "occupants - Return a list of objects of parent parent, optionally with a player flag check.", "spellcheck - Check the spelling of a word using Aspell.", "locations - Recursive location reporting function.", "clear_ancestor_cache - Manually clears the ancestor cache.", "simplex_noise - Generate Simplex Noise.", "threads - Display a list of active threads.", "thread_info - Display specific information about a running thread.", "new_waif - Create a new waif.", "waif_stats - Display a count of instantiated waifs by class.", "sort - Sorts a list by itself or another list of keys. Also support natural ordering and reverse.", "yin - Yield if needed. Suspend a task when running out of ticks or seconds.", "slice - Makes a new list of the index-th elements of the original list.", "reverse - Reverse a list.", "recreate - Create valid objects from invalid objects.", "set_thread_mode - Enable or disable threading of functions for the current verb.", "chr - Translate integers into ASCII characters.", "recycled_objects - Return a list of all invalid objects in the database.", "next_recycled_object - Return the first available invalid object.", "all_members - Return the indices of all instances of an element in a list.", "owned_objects - Return a list of all objects owned by the specified player.", "sqlite_limit - Specify limits on various SQLite constructs.", "curl - Return websites as strings.", "connection_name_lookup - Perform a DNS name lookup in another thread.", "thread_pool - Manipulate the server thread pool. (Caution advised.)", "connection_info - Return network information about a specific connection.", "maphaskey - Return true if a map contains the key specified.", "ancestors - Return all ancestors of an object", "finished_tasks - When enabled, track execution time", "listen - Updated listen() with ipv6 & tls", "open_network_connection - Updated to support ipv6 & tls", "reseed_random - Provide a new seed to the pseudo random number generator.", "FileIO - See HELP fileio for details", "log_cache_stats", "verb_cache_stats", "create", "value_hash", "index", "rindex", "encode_base64", "decode_base64", "string_hash", "binary_hash", "server_log", "new_waif", "sqlite", "typeof", "reverse", "locations", "finished_tasks", "explode", "chparents", "parents", ""}
@prop #123."sqlite_open()" {} rc
;;#123.("sqlite_open()") = {"Syntax: sqlite_open(STR <path to database>, [INT options]) => INT", "", "The function `sqlite_open' will attempt to open the database at <path> for use with SQLite.", "", "The second argument is a bitmask of options. Options are:", "", " SQLITE_PARSE_OBJECTS [4]: Determines whether strings beginning with a pound symbol (#) are interpreted as MOO object numbers or not.", " The default is true, which means that any queries that would return a string (such as \"#123\") will be returned as objects.", " SQLITE_PARSE_TYPES [2]: If unset, no parsing of rows takes place and only strings are returned.", " SQLITE_SANITIZE_STRINGS [8]: If set, newlines (\\n) are converted into tabs (\\t) to avoid corrupting the MOO database. Default is unset.", "", "NOTE: If the MOO doesn't support bitmasking, you can still specify options. You'll just have to manipulate the int yourself. e.g. if you want to parse objects and types, arg[2] would be a 6. If you only want to parse types, arg[2] would be 2.", "", "If successful, the function will return the numeric handle for the open database.", "", "If unsuccessful, the function will return a helpful error message.", "", "If the database is already open, a traceback will be thrown that contains the already open database handle."}
@prop #123."sqlite_close()" {} rc
;;#123.("sqlite_close()") = {"Syntax: sqlite_close(INT <database handle) => INT", "", "This function will close an open database.", "", "If successful, return 1;", "", "If unsuccessful, returns E_INVARG."}
@prop #123."sqlite_handles()" {} rc
;;#123.("sqlite_handles()") = {"Syntax: sqlite_handles() => LIST", "", "Returns a list of open SQLite database handles."}
@prop #123."sqlite_info()" {} rc
;;#123.("sqlite_info()") = {"Syntax: sqlite_info(INT <database handle>) => MAP", "", "This function returns a map of information about the database at <handle>", "", "The information returned is:", " Database Path", " Type parsing enabled?", " Object parsing enabled?", " String sanitation enabled?"}
@prop #123."sqlite_query()" {} rc
;;#123.("sqlite_query()") = {"Syntax: sqlite_query(INT <database handle>, STR <database query>[, INT <show columns>]) => [LIST or STR]", "", "This function will attempt to execute the query given in <query> on the database referred to by <handle>.", "", "On success, this function will return a list identifying the returned rows. If the query didn't return rows but was successful, an empty list is returned.", "", "If the query fails, a string will be returned identifying the SQLite error message.", "", "If <show columns> is true, the return list will include the name of the column before its results.", "", "WARNING: sqlite_query does NOT use prepared statements and should NOT be used on queries that contain user input."}
@prop #123."sqlite_execute()" {} rc
;;#123.("sqlite_execute()") = {"Syntax: sqlite_execute(INT <database handle>, STR <SQL prepared statement query>, LIST <values>) => [LIST or STR]", "", "This function will attempt to create and execute the prepared statement query given in <query> on the database referred to by <handle> with the values <values>.", "", "On success, this function will return a list identifying the returned rows. If the query didn't return rows but was successful, an empty list is returned.", "", "If the query fails, a string will be returned identifying the SQLite error message.", "", "sqlite_execute uses prepared statements, so it's the preferred function to use for security and performance reasons.", "", "Example:", "sqlite_execute(0, \"INSERT INTO users VALUES (?, ?, ?);\", {#7, \"lisdude\", \"Albori Sninvel\"})"}
@prop #123."sqlite_last_insert_row_id()" {} rc
;;#123.("sqlite_last_insert_row_id()") = {"Syntax: sqlite_last_insert_row_id(INT <database handle>)", "", "This function identifies the row ID of the last insert command executed on the database."}
@prop #123."sqlite" {} rc
;;#123.("sqlite") = {"SQLite allows you to store information in locally hosted SQLite databases. The following functions (see HELP <function name> for detailed information) are available:", "", "sqlite_open Opens an SQLite database.", "sqlite_close Closes an SQLite database.", "sqlite_handles Returns a list of open SQLite database handles.", "sqlite_info Returns information about an open SQLite database.", "sqlite_query Runs a raw SQL query on the database.", "sqlite_execute Executes an SQL prepared statement on the database.", "sqlite_limit Set limits on various SQL constructs.", "sqlite_interrupt Abort a database operation.", "sqlite_last_insert_row_id Identifies row ID of the last insert command"}
@prop #123."pcre_replace()" {} rc
;;#123.("pcre_replace()") = {"Syntax: pcre_replace (STR <subject>, STR <pattern>) => STR", "", "The function `pcre_replace()' replaces <subject> with replacements found in <pattern> using the Perl Compatible Regular Expressions library.", "", "The pattern string has a specific format that must be followed, which should be familiar if you have used the likes of Vim, Perl, or sed. The string is composed of four elements, each separated by a delimiter (typically a slash (/) or an exclamation mark (!)), that tell PCRE how to parse your replacement. We'll break the string down and mention relevant options below:", "", "1. Type of search to perform. In MOO, only 's' is valid. This parameter is kept for the sake of consistency.", "2. The text you want to search for a replacement.", "3. The regular expression you want to use for your replacement text.", "4. Optional modifiers:", " g: Global. This will replace all occurrences in your string rather than stopping at the first.", " i: Case-insensitive. Uppercase, lowercase, it doesn't matter. All will be replaced.", " ", "The replacement text can use placeholders in the form of a dollar sign and a number corresponding to a capture group (e.g. $1 will be replaced with the text from the first capture group, $2 the second, etc).", "", "Examples:", "", "Replace one word with another:", "pcre_replace(\"I like banana pie. Do you like banana pie?\", \"s/banana/apple/g\")", "=> \"I like apple pie. Do you like apple pie?\"", "", "Replace text from a capture group:", ";pcre_replace(\"You can find it in objref #1234.\", \"s/objref (#\\d*)/object $1/g\")", "=> \"You can find it in object #1234.\"", "", "If you find yourself wanting to replace a string that contains slashes, it can be useful to change your delimiter to an exclamation mark:", "pcre_replace(\"Unix, wow! /bin/bash is a thing.\", \"s!/bin/bash!/bin/fish!g\")", "=> \"Unix, wow! /bin/fish is a thing.\""}
@prop #123."frandom()" {} rc
;;#123.("frandom()") = {"Syntax: frandom (FLOAT <mod1> [, FLOAT <mod2>) => FLOAT", "", "If only one argument is given, a floating point number is chosen randomly from the range `[1.0..<mod1>]` and returned. If two arguments are given, a floating point number is randomly chosen from the range `[<mod1>..<mod2>]`. "}
@prop #123."memory_usage()" {} rc
;;#123.("memory_usage()") = {"Syntax: memory_usage () => LIST", "", "Return statistics concerning the server's consumption of system memory. The result is a list in the following format:", "", "{total memory used, resident set size, shared pages, text, data + stack}"}
@prop #123."ftime()" {} rc
;;#123.("ftime()") = {"Syntax: ftime ([INT monotonic]) => FLOAT", "", "Returns the current time represented as the number of seconds and nanoseconds that have elapsed since midnight on 1 January 1970, Greenwich Mean Time.", "", "If the <monotonic> argument is supplied and set to 1, the time returned will be monotonic. This means that will you will always get how much time has elapsed from an arbitrary, fixed point in the past that is unaffected by clock skew or other changes in the wall-clock. This is useful for benchmarking how long an operation takes, as it's unaffected by the actual system time.", "", "The general rule of thumb is that you should use ftime() with no arguments for telling time and ftime() with the monotonic clock argument for measuring the passage of time."}
@prop #123."locate_by_name()" {} rc
;;#123.("locate_by_name()") = {"Syntax: locate_by_name (STR <object name>) => LIST", "", "This function searches every object in the database for those containing <object name> in their .name property."}
@prop #123."usage()" {} rc
;;#123.("usage()") = {"Syntax: usage () => LIST", "", "Return statistics concerning the server the MOO is running on. The result is a list in the following format:", "", "{load averages}, user time, system time, page reclaims, page faults, block input ops, block output ops, voluntary context switches, involuntary context switches, signals received"}
@prop #123."explode()" {} rc
;;#123.("explode()") = {"Syntax: explode(STR subject [, STR break [, INT include-sequential-occurrences]) => LIST", "", "Returns a list of substrings of subject that are separated by break. break defaults to a space.", "", "Only the first character of break is considered:", "", "explode(\"slither%is%wiz\", \"%\") => {\"slither\", \"is\", \"wiz\"}", "explode(\"slither%is%%wiz\", \"%%\") => {\"slither\", \"is\", \"wiz\"}", "", "You can use include-sequential-occurrences to get back an empty string as part of your list if break appears multiple times with nothing between it, or there is a leading/trailing break in your string:", "", "explode(\"slither%is%%wiz\", \"%%\", 1) => {\"slither\", \"is\", \"\", \"wiz\"}", "explode(\"slither%is%%wiz%\", \"%\", 1) => {\"slither\", \"is\", \"\", \"wiz\", \"\"}", "explode(\"%slither%is%%wiz%\", \"%\", 1) => {\"\", \"slither\", \"is\", \"\", \"wiz\", \"\"}", "", "Note: This can be used as a replacement for $string_utils:explode.", ""}
@prop #123."clear_ancestor_cache()" {} rc
;;#123.("clear_ancestor_cache()") = {"Syntax: clear_ancestor_cache() => none", "", "The ancestor cache contains a quick lookup of all of an object's ancestors which aids in expediant property lookups. This is an experimental feature and, as such, you may find that something has gone wrong. If that's that case, this function will completely clear the cache and it will be rebuilt as-needed."}
@prop #123."locations()" {} rc
;;#123.("locations()") = {"Syntax: locations(OBJ object [, OBJ stop [, INT is-parent]]) => LIST", "", "Recursively build a list of an object's location, its location's location, and so forth until finally hitting $nothing.", "", "Example:", "", "locations(me) => {#20381, #443, #104735}", "", "$string_utils:title_list(locations(me)) => \"\\\"Butterknife Ballet\\\" Control Room FelElk, the one-person celestial birther \\\"Butterknife Ballet\\\", and Uncharted Space: Empty Space\"", "", "If stop is in the locations found, it will stop before there and return the list (exclusive of the stop object).", "", "If the third argument is true, stop is assumed to be a PARENT. And if any of your locations are children of that parent, it stops there.", ""}
@prop #123."spellcheck()" {} rc
;;#123.("spellcheck()") = {"Syntax: spellcheck(STR <word>) => INT or LIST", "", "This function checks the English spelling of <word>. If the spelling is correct, the function will return a 1. If the spelling is incorrect, a LIST of suggestions for correct spellings will be returned instead. If the spelling is incorrect and no suggestions can be found, an empty LIST is returned."}
@prop #123."threads()" {} rc
;;#123.("threads()") = {"Syntax: threads() => LIST", "", "When one or more MOO processes are suspended and working in a separate thread, this function will return a LIST of handlers to those threads. These handlers can then be passed to `thread_info' for more information."}
@prop #123."thread_info()" {} rc
;;#123.("thread_info()") = {"Syntax: thread_info(INT <thread handler>) => LIST", "", "If a MOO task is running in another thread, its thread handler will give you information about that thread. The information returned in a LIST will be:", "", " English Name: This is the name the programmer of the builtin function has given to the task being executed.", " Active: 1 or 0 depending upon whether or not the MOO task has been killed. Not all threads cleanup immediately after the MOO task dies."}
@prop #123."waif_stats()" {} rc
;;#123.("waif_stats()") = {"Syntax: waif_stats() => MAP", "", "Returns a MAP of statistics about instantiated waifs. Each waif class will be a key in the MAP and its value will be the number of waifs of that class currently instantiated. Additionally, there is a `total' key that will return the total number of instantiated waifs, and a `pending_recycle' key that will return the number of waifs that have been destroyed and are awaiting the call of their :recycle verb."}
@prop #123."toaststunt-index()" {} rc
;;#123.("toaststunt-index()") = {"*index*", "Stunt / ToastStunt Functions"}
@prop #123."occupants()" {} rc
;;#123.("occupants()") = {"Syntax: occupants(LIST <objects> [, OBJ | LIST <parent>, INT <player flag set?>]) => LIST", "", "Iterates through the list of <objects> and returns those matching a specific set of criteria:", "", "1. If only <objects> is specified, the occupants function will return a list of objects with the player flag set.", "2. If the <parent> argument is specified, a list of <objects> descending from <parent> will be returned. If <parent> is a list, <object> must descend from at least one object in the list.", "3. If both <parent> and <player flag set> are specified, occupants will check both that an object is descended from <parent> and also has the player flag set."}
@prop #123."sort()" {} rc
;;#123.("sort()") = {"Syntax: sort(LIST <list> [, LIST <keys>, INT <natural sort order?>, INT <reverse>]) => LIST", "", "Sorts <list> either by <keys> or using the list itself. When sorting <list> by itself, you can use an empty list ({}) for <keys> to specify additional optional arguments.", "", "If <natural sort order> is true, strings containing multi-digit numbers will consider those numbers to be a single character. So, for instance, this means that 'x2' would come before 'x11' when sorted naturally because 2 is less than 11. This argument defaults to 0.", "", "If <reverse> is true, the sort order is reversed. This argument defaults to 0.", "", "Examples:", "", "Sort a list by itself:", ">;sort({\"a57\", \"a5\", \"a7\", \"a1\", \"a2\", \"a11\"})", "=> {\"a1\", \"a11\", \"a2\", \"a5\", \"a57\", \"a7\"}", "", "Sort a list by itself with natural sort order:", ">;sort({\"a57\", \"a5\", \"a7\", \"a1\", \"a2\", \"a11\"}, {}, 1)", "=> {\"a1\", \"a2\", \"a5\", \"a7\", \"a11\", \"a57\"}", "", "Sort a list of strings by a list of numeric keys:", ">;sort({\"foo\", \"bar\", \"baz\"}, {123, 5, 8000})", "=> {\"bar\", \"foo\", \"baz\"}"}
@prop #123."yin()" {} rc
;;#123.("yin()") = {"Syntax: yin([INT <time>, INT <minimum ticks>, INT <minimum seconds>] ) => INT", "", "Suspend the current task if it's running out of ticks or seconds. This is meant to provide similar functionality to the LambdaCore-based suspend_if_needed verb or manually specifying something like: ticks_left() < 2000 && suspend(0)", "", "Time: How long to suspend the task. Default: 0", "Minimum ticks: The minimum number of ticks the task has left before suspending.", "Minimum seconds: The minimum number of seconds the task has left before suspending."}
@prop #123."slice()" {} rc
;;#123.("slice()") = {"Syntax: slice(LIST <alist> [, INT | LIST | STR <index>, ANY <default map value>]) => LIST", "", "Return the <index>-th elements of <alist>. By default, index will be 1. If index is a list of integers, the returned list will have those elements from <alist>. This is the built-in equivalent of LambdaCore's $list_utils:slice verb.", "", "If <alist> is a list of maps, index can be a string indicating a key to return from each map in <alist>.", "", "If <default map value> is specified, any maps not containing the key <index> will have <default map value> returned in their place. This is useful in situations where you need to maintain consistency with a list index and can't have gaps in your return list.", "", "Examples:", " >slice({{\"z\", 1}, {\"y\", 2}, {\"x\",5}}, 2) => {1, 2, 5}.", " >slice({{\"z\", 1, 3}, {\"y\", 2, 4}}, {2, 1}) => {{1, \"z\"}, {2, \"y\"}}", " >;slice({[\"a\" -> 1, \"b\" -> 2], [\"a\" -> 5, \"b\" -> 6]}, \"a\") => {1, 5}", " >;slice({[\"a\" -> 1, \"b\" -> 2], [\"a\" -> 5, \"b\" -> 6], [\"b\" -> 8]}, \"a\", 0) => {1, 5, 0}"}
@prop #123."set_thread_mode()" {} rc
;;#123.("set_thread_mode()") = {"Syntax: set_thread_mode([INT <mode>])", "", "With no arguments specified, set_thread_mode will return the current thread mode for the verb. A value of 1 indicates that threading is enabled for functions that support it. A value of 0 indicates that threading is disabled and all functions will execute in the main MOO thread, as functions have done in default LambdaMOO since version 1.", "", "If you specify an argument, you can control the thread mode of the current verb. A <mode> of 1 will enable threading and a <mode> of 0 will disable it. You can invoke this function multiple times if you want to disable threading for a single function call and enable it for the rest.", "", "When should you disable threading? In general, threading should be disabled in verbs where it would be undesirable to suspend(). Each threaded function will immediately suspend the verb while the thread carries out its work. This can have a negative effect when you want to use these functions in verbs that cannot or should not suspend, like $sysobj:do_command or $sysobj:do_login_command.", "", "Note that the threading mode affects the current verb only and does NOT affect verbs called from within that verb."}
@prop #123."recreate()" {} rc
;;#123.("recreate()") = {"Syntax: recreate(OBJ <old>, OBJ <parent> [, OBJ <owner>]) => OBJ", "", "Recreate invalid object <old> (one that has previously been recycle()ed) as <parent>, optionally owned by <owner>. This has the effect of filling in holes created by recycle() that would normally require renumbering and resetting the maximum object.", "", "The normal rules apply to parent and owner. You either have to own <parent>, <parent> must be fertile, or you have to be a wizard. Similarly, to change <owner>, you should be a wizard. Otherwise it's superfluous."}
@prop #123."toaststunt" {} rc
;;#123.("toaststunt") = {"*forward*", "stunt"}
@prop #123."chr()" {} rc
;;#123.("chr()") = {"Syntax: chr(INT <arg>, ...) => STR", "", "This function translates integers into ASCII characters. Each argument must be an integer between 0 and 255.", "If the programmer is not a wizard, and integers less than 32 are provided, E_INVARG is raised. This prevents control characters or newlines from being written to the database file by non-trusted individuals."}
@prop #123."recycled_objects()" {} rc
;;#123.("recycled_objects()") = {"Syntax: recycled_objects() => LIST", "", "Return a list of all invalid objects in the database. An invalid object is one that has been destroyed with the recycle() function."}
@prop #123."next_recycled_object()" {} rc
;;#123.("next_recycled_object()") = {"Syntax: next_recycled_object(OBJ <start>) => OBJ | INT", "", "Return the lowest invalid object. If <start> is specified, no object lower than <start> will be considered. If there are no invalid objects, this function will return 0."}
@prop #123."all_members()" {} rc
;;#123.("all_members()") = {"Syntax: all_members(ANY <value>, LIST <alist>) => LIST", "", "Returns the indices of every instance of <value> in <alist>.", "", "Example:", ";all_members(\"a\", {\"a\", \"b\", \"a\", \"c\", \"a\", \"d\"}) => {1, 3, 5}"}
@prop #123."pcre_match()" {} rc
;;#123.("pcre_match()") = {"Syntax: pcre_match (STR <subject>, STR <pattern> [, <case matters> 0] [, <repeat until no matches> 1] => LIST", "", "The function `pcre_match()' searches <subject> for <pattern> using the Perl Compatible Regular Expressions library. The return value is a list of maps containing each match. Each returned map will have a key which corresponds to either a named capture group or the number of the capture group being matched. The full match is always found in the key \"0\". The value of each key will be another map containing the keys 'match' and 'position'. Match corresponds to the text that was matched and position will return the indices of the substring within <subject>.", "", "If <repeat until no matches> is 1, the expression will continue to be evaluated until no further matches can be found or it exhausts the iteration limit. This defaults to 1.", "", "Additionally, wizards can control how many iterations of the loop are possible by adding a property to $server_options. $server_options.pcre_match_max_iterations is the maximum number of loops allowed before giving up and allowing other tasks to proceed. CAUTION: It's recommended to keep this value fairly low. The default value is 1000. The minimum value is 100.", "", "Examples:", "", "Extract dates from a string:", "pcre_match(\"09/12/1999 other random text 01/21/1952\", \"([0-9]{2})/([0-9]{2})/([0-9]{4})\")", "=> {[\"0\" -> [\"match\" -> \"09/12/1999\", \"position\" -> {1, 10}], \"1\" -> [\"match\" -> \"09\", \"position\" -> {1, 2}], \"2\" -> [\"match\" -> \"12\", \"position\" -> {4, 5}], \"3\" -> [\"match\" -> \"1999\", \"position\" -> {7, 10}]], [\"0\" -> [\"match\" -> \"01/21/1952\", \"position\" -> {30, 39}], \"1\" -> [\"match\" -> \"01\", \"position\" -> {30, 31}], \"2\" -> [\"match\" -> \"21\", \"position\" -> {33, 34}], \"3\" -> [\"match\" -> \"1952\", \"position\" -> {36, 39}]]}", "", "Explode a string (albeit a contrived example):", ";;ret = {}; for x in (pcre_match(\"This is a string of words, with punctuation, that should be exploded. By space. --zippy--\", \"[a-zA-Z]+\", 0, 1)) ret = {@ret, x[\"0\"][\"match\"]}; endfor return ret;", "=> {\"This\", \"is\", \"a\", \"string\", \"of\", \"words\", \"with\", \"punctuation\", \"that\", \"should\", \"be\", \"exploded\", \"By\", \"space\", \"zippy\"}"}
@prop #123."sqlite_limit()" {} rc
;;#123.("sqlite_limit()") = {"Syntax: sqlite_limit(INT <database handle>, STR <category> INT <new value>) => INT", "", "This function allows you to specify various construct limitations on a per-database basis.", "", "If <new value> is a negative number, the limit is unchanged. Each limit category has a hardcoded upper bound. Attempts to increase a limit above its hard upper bound are silently truncated to the hard upper bound.", "", "Regardless of whether or not the limit was changed, the sqlite_limit() function returns the prior value of the limit. Hence, to find the current value of a limit without changing it, simply invoke this interface with the third parameter set to -1.", "", "As of this writing, the following limits exist:", "", "LIMIT_LENGTH", " The maximum size of any string or BLOB or table row, in bytes.", "", "LIMIT_SQL_LENGTH", " The maximum length of an SQL statement, in bytes.", "", "LIMIT_COLUMN", " The maximum number of columns in a table definition or in the result set of a SELECT or the maximum number of columns in an index or in an ORDER BY or GROUP BY clause.", "", "LIMIT_EXPR_DEPTH", " The maximum depth of the parse tree on any expression.", "", "LIMIT_COMPOUND_SELECT", " The maximum number of terms in a compound SELECT statement.", "", "LIMIT_VDBE_OP", " The maximum number of instructions in a virtual machine program used to implement an SQL statement. If sqlite3_prepare_v2() or the equivalent tries to allocate space for more than this many opcodes in a single prepared statement, an SQLITE_NOMEM error is returned.", "", "LIMIT_FUNCTION_ARG", " The maximum number of arguments on a function.", "", "LIMIT_ATTACHED", " The maximum number of attached databases.", "", "LIMIT_LIKE_PATTERN_LENGTH", " The maximum length of the pattern argument to the LIKE or GLOB operators.", "", "LIMIT_VARIABLE_NUMBER", " The maximum index number of any parameter in an SQL statement.", "", "LIMIT_TRIGGER_DEPTH", " The maximum depth of recursion for triggers.", "", "LIMIT_WORKER_THREADS", " The maximum number of auxiliary worker threads that a single prepared statement may start.", "", "For an up-to-date list of limits, see the SQLite documentation here: https://www.sqlite.org/c3ref/c_limit_attached.html"}
@prop #123."curl()" {} rc
;;#123.("curl()") = {"Syntax: curl(STR <url> [, INT <include_headers>, INT timeout]) => STR", "", "The curl builtin will download a webpage and return it as a string. If <include_headers> is true, the HTTP headers will be included in the return string.", "", "It's worth noting that the data you get back will be binary encoded. In particular, you will find that line breaks appear as ~0A. You can easily convert a page into a list by passing the return string into the decode_binary() function.", "", "CURL_TIMEOUT is defined in options.h to specify the maximum amount of time a CURL request can take before failing. For special circumstances, you can specify a longer or shorter timeout using the third argument of curl()."}
@prop #123."connection_name_lookup()" {} rc
;;#123.("connection_name_lookup()") = {"Syntax: connection_name_lookup (OBJ <connection> [, INT record_result]) => STR", "", "This function performs a DNS name lookup on connection's IP address. If a hostname can't be resolved, the function simply returns the numeric IP address. Otherwise, it will return the resolved hostname.", "", "If record_result is true, the resolved hostname will be saved with the connection and will overwrite it's existing 'connection_name()'. This means that you can call 'connection_name_lookup()' a single time when a connection is created and then continue to use 'connection_name()' as you always have in the past.", "", "This function is primarily intended for use when the 'NO_NAME_LOOKUP' server option is set. Barring temporarily failures in your nameserver, very little will be gained by calling this when the server is performing DNS name lookups for you.", "", "NOTE: This function runs in a separate thread. While this is good for performance (long lookups won't lock your MOO like traditional pre-2.6.0 name lookups), it also means it will require slightly more work to create an entirely in-database DNS lookup solution. Because it explicitly suspends, you won't be able to use it in 'do_login_command()' without also using the 'switch_player()' function. For an example of how this can work, see '#0:do_login_command()' in ToastCore."}
@prop #123."connection_info()" {} rc
;;#123.("connection_info()") = {"Syntax: connection_info (OBJ <connection>) => LIST", "", "Returns a MAP of network connection information for <connection>. At the time of writing, the following information is returned:", "", "destination_address: The hostname of the connection. For incoming connections, this is the hostname of the connected user.", " For outbound connections, this is the hostname of the outbound connection's destination.", "", "destination_ip: The unresolved numeric IP address of the connection.", "", "destination_port: For incoming connections, this is the local port used to make the connection.", " For outbound connections, this is the port the connection was made to.", "", "source_address: This is the hostname of the interface an incoming connection was made on. For outbound connections, this value is meaningless.", "", "source_ip: The unresolved numeric IP address of the interface a connection was made on. For outbound connections, this value is meaningless.", "", "source_port: The local port a connection connected to. For outbound connections, this value is meaningless.", "", "protocol: Describes the protocol used to make the connection. At the time of writing, this could be IPv4 or IPv6.", " "}
@prop #123."argon2_verify()" {} rc
;;#123.("argon2_verify()") = {"Syntax: argon2_verify (STR <hash>, STR <password>) => INT", "", "Compares <password> to the previously hashed <hash>. Returns 1 if the two match or 0 if they don't."}
@prop #123."maphaskey()" {} rc
;;#123.("maphaskey()") = {"Syntax: maphaskey (MAP <map>, STR <key>) => INT", "", "Returns 1 if <key> exists in <map>. When not dealing with hundreds of keys, this function is faster (and easier to read) than something like: !(x in mapkeys(map))"}
@prop #123."reseed_random()" {} rc
;;#123.("reseed_random()") = {"Syntax: reseed_random()", "", "Provide a new seed to the pseudo random number generator."}
@prop #123."finished_tasks()" {} rc
;;#123.("finished_tasks()") = {"Syntax: finished_tasks () => LIST", "", "When enabled (via SAVE_FINISHED_TASKS in options.h), the server will keep track of the execution time of every task that passes through the interpreter. This data is then made available to the database in two ways.", "", "The first is the finished_tasks() function. This function will return a list of maps of the last several finished tasks (configurable via $server_options.finished_tasks_limit) with the following information:", "", "", "Foreground: True if this was a foreground task.", "Fullverb: The full name of the verb being executed.", "Object: The object the verb is defined on.", "Player: The result of the 'player' variable.", "Programmer: The player whose permissions the verb is running as.", "Receiver: The object that received the verb invocation. In the case of primitives, this is the primitive's object handler.", "Suspended: True if the task suspended instead of finishing.", "This: The result of the 'this' variable.", "Time: The total time the task took inside the interpreter.", "Verb: The verb name used to invoke the task.", "", "", "The second is via the $handle_lagging_task verb. When the execution threshold defined in $server_options.task_lag_threshold is exceeded, the server will write an entry to the log file and call the $handle_lagging_task verb with the call stack of the task as well as the execution time."}
@prop #123."owned_objects()" {} rc
;;#123.("owned_objects()") = {"Syntax: owned_objects(OBJ owner) => LIST", "", "Returns a list of all objects in the database owned by <owner>. Ownership is defined by the value of .owner on the object."}
@prop #123."ancestors()" {} rc
;;#123.("ancestors()") = {"Syntax: ancestors(OBJ <object> [, INT <full>]) => LIST", "", "Return a list of all ancestors of <object> in order ascending up the inheritance hiearchy. If <full> is true, <object> will be included in the list."}
@prop #123."descendants()" {} rc
;;#123.("descendants()") = {"Syntax: descendants(OBJ <object> [, INT <full>]) => LIST", "", "Return a list of all nested children of <object>. If <full> is true, <object> will be included in the list."}
@prop #123."panic()" {} rc
;;#123.("panic()") = {"Syntax: panic([STR <message>])", "", "Unceremoniously shut down the server, mimicking the behavior of a fatal error. The database will NOT be dumped to the file specified when starting the server. A new file will be created with the name of your database appended with .PANIC."}
@prop #123."thread_pool()" {} rc
;;#123.("thread_pool()") = {"Syntax: thread_pool(STR <function>, STR <pool> [, INT <value>])", "", "This function allows you to control any thread pools that the server created at startup. It should be used with care, as it has the potential to create disasterous consequences if used incorrectly.", "", "The <function> parameter is the function you wish to perform on the thread pool. The functions available are:", "", " INIT: Control initialization of a thread pool.", "", " ", "The <pool> parameter controls which thread pool you wish to apply the designated function to. At the time of writing, the server creates the following thread pool:", "", " MAIN: The main thread pool where threaded built-in function work takes place.", "", "", "Finally, <value> is the value you want to pass to the <function> of <pool>. The following functions accept the following values:", "", " INIT: The number of threads to spawn. NOTE: When executing this function, the existing <pool> will be destroyed and a new one created in its place.", "", "", "Examples:", ";thread_pool(\"INIT\", \"MAIN\", 1) => Replace the existing main thread pool with a new pool consisting of a single thread."}
@prop #123."sqlite_interrupt()" {} rc
;;#123.("sqlite_interrupt()") = {"Syntax: sqlite_interrupt(INT <database handle>)", "", "This function causes any pending database operation to abort at its earliest opportunity. If the operation is nearly finished when sqlite_interrupt is called, it might not have an opportunity to be interrupted and could continue to completion.", "", "This can be useful when you execute a long-running query and want to abort it.", "", "NOTE: As of this writing (server version 2.7.0) the @kill command WILL NOT abort operations taking place in a helper thread. If you want to interrupt an SQLite query, you must use sqlite_interrupt and NOT the @kill command."}
@prop #123."reverse()" {} rc
;;#123.("reverse()") = {"Syntax: reverse(LIST <alist>) => LIST | STR", "", "Return a reversed list or string.", "", "Examples:", "", ";reverse({1,2,3,4}) => {4,3,2,1}", ";reverse(\"asdf\") => \"fdsa\"", ""}
@prop #123."queued_tasks()" {} rc
;;#123.("queued_tasks()") = {"Syntax: queued_tasks ([INT <show runtime> [, INT count-only]) => LIST", "", "Returns information on each of the background tasks (i.e., forked, suspended, or reading) owned by the programmer (or, if the programmer is a wizard, all queued tasks). The returned value is a list of lists, each of which encodes certain information about a particular queued task in the following format:", "", " {<task-id>, <start-time>, <ticks>, <clock-id>,", " <programmer>, <verb-loc>, <verb-name>, <line>, <this>, <task-size>}", "", "where <task-id> is a numeric identifier for this queued task, <start-time> is the time after which this task will begin execution (in `time()' format), <ticks> is the number of ticks this task will have when it starts (always 20,000 now, though this is changeable. This makes this value obsolete and no longer interesting), <clock-id> is a number whose value is no longer interesting, <programmer> is the permissions with which this task will begin execution (and also the player who \"owns\" this task), <verb-loc> is the object on which the verb that forked this task was defined at the time, <verb-name> is that name of that verb, <line> is the number of the first line of the code in that verb that this task will execute, and <this> is the value of the variable `this' in that verb. For reading tasks, <start-time> is `-1'. <task-size> is in bytes, and is the size of memory in use by the task for local variables, stack frames, etc.", "", "If <show runtime> is true, all variables present in the task are presented in a map with the variable name as the key and its value as the value. ", "", "If `count-only` is true, then only the number of tasks is returned. This is significantly more performant than length(queued_tasks()). ", "", "The <ticks> and <clock-id> fields are now obsolete and are retained only for backward-compatibility reasons. They may disappear in a future version of the server."}
@prop #123."move()" {} rc
;;#123.("move()") = {"Syntax: move (OBJ <what>, OBJ <where>[, INT <position>]) => none", "", "Changes <what>'s location to be <where>. This is a complex process because a number of permissions checks and notifications must be performed. The actual movement takes place as described in the following paragraphs.", "", "<what> should be a valid object and <where> should be either a valid object or `#-1' (denoting a location of 'nowhere'); otherwise E_INVARG is raised. The programmer must be either the owner of <what> or a wizard; otherwise, E_PERM is raised.", "", "If <where> is a valid object and isn't the same as <what>'s location, then the verb-call", "", " <where>:accept(<what>)", "", "is performed before any movement takes place. If the verb returns a false value and the programmer is not a wizard, then <where> is considered to have refused entrance to <what>; `move()' raises E_NACC. If <where> does not define an `accept' verb, then it is treated as if it defined one that always returned false.", "", "If moving <what> into <where> would create a loop in the containment hierarchy (i.e., <what> would contain itself, even indirectly), then E_RECMOVE is raised instead.", "", "The `location' property of <what> is changed to be <where>, and the `contents' properties of the old and new locations are modified appropriately. If <position> is specified, the object will be inserted into the `contents' property of the new location at <position>.", "", "If <where> differs from <what>'s current location, two additional verb calls take place. Let <old-where> be the location of <what> before it was moved. If <old-where> is a valid object, then the verb-call", "", " <old-where>:exitfunc(<what>)", "", "is performed and its result is ignored; it is not an error if <old-where> does not define a verb named `exitfunc'. Finally, if <where> and <what> are still valid objects, and <where> is still the location of <what>, then the verb-call", "", " <where>:enterfunc(<what>)", "", "is performed and its result is ignored; again, it is not an error if <where> does not define a verb named `enterfunc'."}
@prop #123."listen()" {} rc
;;#123.("listen()") = {"Syntax: listen (OBJ <object>, INT <port> [, MAP <options>]) => value", "", "Create a new point at which the server will listen for network connections, just as it does normally. <Object> is the object whose verbs `do_login_command', `do_command', `do_out_of_band_command', `user_connected', `user_created', `user_reconnected', `user_disconnected', and `user_client_disconnected' will be called at appropriate points as these verbs are called on #0 for normal connections. (See the chapter in the LambdaMOO Programmer's Manual on server assumptions about the database for the complete story on when these functions are called.) <Port> is a TCP port number on which to listen. The listen() function will return <port> unless <port> is zero, in which case the return value is a port number assigned by the operating system.", "", "An optional third argument allows you to set various miscellaneous options for the listening point. These are:", "", " print-messages: If true, the various database-configurable messages (also detailed in the chapter on server assumptions) will be printed on connections received at the new listening port.", " ipv6: Use the IPv6 protocol rather than IPv4.", " tls: Only accept valid secure TLS connections.", " certificate: The full path to a TLS certificate. NOTE: Requires the TLS option also be specified and true. This option is only necessary if the certificate differs from the one specified in options.h.", " key: The full path to a TLS private key. NOTE: Requires the TLS option also be specified and true. This option is only necessary if the key differs from the one specified in options.h.", "", "listen() raises E_PERM if the programmer is not a wizard, E_INVARG if <object> is invalid or there is already a listening point described by <point>, and E_QUOTA if some network-configuration-specific error occurred.", "", "", "Example:", ">;listen(#0, 1234, [\"ipv6\" -> 1, \"tls\" -> 1, \"certificate\" -> \"/etc/certs/something.pem\", \"key\" -> \"/etc/certs/privkey.pem\", \"print-messages\" -> 1]", "Listen for IPv6 connections on port 1234 and print messages as appropriate. These connections must be TLS and will use the private key and certificate found in /etc/certs."}
@prop #123."open_network_connection()" {} rc
;;#123.("open_network_connection()") = {"Syntax: open_network_connection (STR <host>, INT <port> [, MAP <options>]) => obj", "", "Establishes a network connection to the place specified by the arguments and more-or-less pretends that a new, normal player connection has been established from there. The new connection, as usual, will not be logged in initially and will have a negative object number associated with it for use with `read()', `notify()', and `boot_player()'. This object number is the value returned by this function.", "", "If the programmer is not a wizard or if the `OUTBOUND_NETWORK' compilation option was not used in building the server, then `E_PERM' is raised.", "", "<Host> refers to a string naming a host (possibly a numeric IP address) and <port> is an integer referring to a TCP port number. If a connection cannot be made because the host does not exist, the port does not exist, the host is not reachable or refused the connection, `E_INVARG' is raised. If the connection cannot be made for other reasons, including resource limitations, then `E_QUOTA' is raised.", "", "Optionally, you can specify a map with any or all of the following options:", "", " listener: An object whose listening verbs will be called at appropriate points. (See HELP LISTEN() for more details.)", " tls: If true, establish a secure TLS connection.", " ipv6: If true, utilize the IPv6 protocol rather than the IPv4 protocol.", "", "The outbound connection process involves certain steps that can take quite a long time, during which the server is not doing anything else, including responding to user commands and executing MOO tasks. See the chapter on server assumptions about the database for details about how the server limits the amount of time it will wait for these steps to successfully complete.", "", "It is worth mentioning one tricky point concerning the use of this function. Since the server treats the new connection pretty much like any normal player connection, it will naturally try to parse any input from that connection as commands in the usual way. To prevent this treatment, you should use `set_connection_option()' to set the `hold-input' option true on the connection.", "", "Example:", ">;open_network_connection(\"2607:5300:60:4be0::\", 1234, [\"ipv6\" -> 1, \"listener\" -> #6, \"tls\" -> 1])", "Open a new connection to the IPv6 address 2607:5300:60:4be0:: on port 1234 using TLS. Relevant verbs will be called on #6."}
@prop #123."is_member()" {} rc
;;#123.("is_member()") = {"Syntax: is_member (ANY value, LIST list [, INT case-sensitive]) => INT", "", "Returns the index of <value> if there is an element of <list> that is completely indistinguishable from <value>. This is much the same operation as \"<value> in <list>\" except that, unlike `in', the `is_member()' function does not treat upper- and lower-case characters in strings as equal. This treatment of strings can be controlled with the <case-sensitive> argument; setting <case-sensitive> to false will effectively disable this behavior.", "", "Raises E_ARGS if two values are given or if more than three arguments are given. Raises E_TYPE if the second argument is not a list. Otherwise returns the index of <value> in <list>, or 0 if it's not in there.", "", " is_member(3, {3, 10, 11}) => 1", " is_member(\"a\", {\"A\", \"B\", \"C\"}) => 0", " is_member(\"XyZ\", {\"XYZ\", \"xyz\", \"XyZ\"}) => 3", " is_member(\"def\", {\"ABC\", \"DEF\", \"GHI\"}, 0) => 2"}
@prop #123."fio" {} rc
;;#123.("fio") = {"*forward*", "fileio"}
@prop #123."fileio" {} rc
;;#123.("fileio") = {"General-purpose functions:", "", "FHANDLE file_open(STR pathname, STR mode)", "void file_close(FHANDLE fh)", "STR file_name(FHANDLE fh)", "STR file_openmode(FHANDLE fh)", "STR file_readline(FHANDLE fh)", "LIST file_readlines(FHANDLE fh, INT start, INT end)", "void file_writeline(FHANDLE fh, STR line)", "STR file_read(FHANDLE fh, INT bytes)", "INT file_write(FHANDLE fh, STR data)", "INT file_tell(FHANDLE fh)", "void file_seek(FHANDLE fh, INT loc, STR whence)", "INT file_eof(FHANDLE fh)", "void file_rename(STR oldpath, STR newpath)", "void file_remove(STR pathname)", "void file_mkdir(STR pathname)", "void file_rmdir(STR pathname)", "LIST file_list(STR pathname, [ANY detailed])", "STR file_type(STR pathname)", "STR file_mode(STR filename)", "void file_chmod(STR filename, STR mode)", "LIST file_handles()", "LIST file_grep(FHANDLER fh, STR search [,?match_all=0])", "", "Attribute functions:", "", "INT file_size(STR pathname)", "STR file_mode(STR pathname)", "INT file_last_access(STR pathname)", "INT file_last_modify(STR pathname)", "INT file_last_change(STR pathname)", "INT file_size(FHANDLE fh)", "STR file_mode(FHANDLE fh)", "INT file_last_access(FHANDLE fh)", "INT file_last_modify(FHANDLE fh)", "INT file_last_change(FHANDLE fh)", "INT file_count_lines(FHANDLE fh)", "", "void file_stat(STR pathname)", "void file_stat(FHANDLE fh)", "", ""}
@prop #123."file_open()" {} rc
;;#123.("file_open()") = {" Function: FHANDLE file_open(STR pathname, STR mode)", "", " Raises: E_INVARG if mode is not a valid mode, E_QUOTA if too many files are open.", " This opens a file specified by pathname and returns an FHANDLE for it.", " It ensures pathname is legal. Mode is a string of characters indicating what mode the file is opened in. ", " The mode string is four characters.", "", " The first character must be (r)ead, (w)rite, or (a)ppend. The second must be '+' or '-'. This modifies the previous argument.", "", " o r- opens the file for reading and fails if the file does not exist.", "", " o r+ opens the file for reading and writing and fails if the file", " does not exist.", "", " o w- opens the file for writing, truncating if it exists and creating", " if not.", "", " o w+ opens the file for reading and writing, truncating if it exists", " and creating if not.", "", " o a- opens a file for writing, creates it if it does not exist and", " positions the stream at the end of the file.", "", " o a+ opens the file for reading and writing, creates it if does not", " exist and positions the stream at the end of the file.", "", " The third character is either (t)ext or (b)inary. In text mode,", " data is written as-is from the MOO and data read in by the MOO is", " stripped of unprintable characters. In binary mode, data is", " written filtered through the binary-string->raw-bytes conversion", " and data is read filtered through the raw-bytes->binary-string", " conversion. For example, in text mode writing \" 1B\" means three", " bytes are written: ' ' Similarly, in text mode reading \" 1B\" means", " the characters ' ' '1' 'B' were present in the file. In binary", " mode reading \" 1B\" means an ASCII ESC was in the file. In text", " mode, reading an ESC from a file results in the ESC getting", " stripped.", "", " It is not recommended that files containing unprintable ASCII data be", " read in text mode, for obvious reasons.", "", " The final character is either 'n' or 'f'. If this character is 'f',", " whenever data is written to the file, the MOO will force it to finish", " writing to the physical disk before returning. If it is 'n' then", " this won't happen.", "", " This is implemented using fopen()."}
@prop #123."file_close()" {} rc
;;#123.("file_close()") = {" Function: void file_close(FHANDLE fh)", "", " Closes the file associated with fh.", "", " This is implemented using fclose()."}
@prop #123."file_name()" {} rc
;;#123.("file_name()") = {"Function: STR file_name(FHANDLE fh)", "", " Returns the pathname originally associated with fh by file_open().", " This is not necessarily the file's current name if it was renamed or", " unlinked after the fh was opened."}
@prop #123."file_openmode()" {} rc
;;#123.("file_openmode()") = {"Function: STR file_openmode(FHANDLE fh)", "", " Returns the mode the file associated with fh was opened in."}
@prop #123."file_readline()" {} rc
;;#123.("file_readline()") = {"Function: STR file_readline(FHANDLE fh)", "", " Reads the next line in the file and returns it (without the newline).", "", " Not recommended for use on files in binary mode.", "", " This is implemented using fgetc()."}
@prop #123."file_readlines()" {} rc
;;#123.("file_readlines()") = {" Function: LIST file_readlines(FHANDLE fh, INT start, INT end)", "", " Rewinds the file and then reads the specified lines from the file,", " returning them as a list of strings. After this operation, the stream", " is positioned right after the last line read.", "", " Not recommended for use on files in binary mode.", "", " This is implemented using fgetc()."}
@prop #123."file_writeline()" {} rc
;;#123.("file_writeline()") = {" Function: void file_writeline(FHANDLE fh, STR line)", "", " Writes the specified line to the file (adding a newline).", "", " Not recommended for use on files in binary mode.", "", " This is implemented using fputs()"}
@prop #123."file_read()" {} rc
;;#123.("file_read()") = {"Function: STR file_read(FHANDLE fh, INT bytes)", "", " Reads up to the specified number of bytes from the file and returns", " them.", "", " Not recommended for use on files in text mode.", "", " This is implemented using fread()."}
@prop #123."file_write()" {} rc
;;#123.("file_write()") = {"Function: INT file_write(FHANDLE fh, STR data)", "", " Writes the specified data to the file. Returns number of bytes", " written.", "", " Not recommended for use on files in text mode.", "", " This is implemented using fwrite()."}
@prop #123."file_tell()" {} rc
;;#123.("file_tell()") = {"Function: INT file_tell(FHANDLE fh)", "", " Returns position in file.", "", " This is implemented using ftell()."}
@prop #123."file_seek()" {} rc
;;#123.("file_seek()") = {"Function: void file_seek(FHANDLE fh, INT loc, STR whence)", "", " Seeks to a particular location in a file. whence is one of the", " strings:", "", " o \"SEEK_SET\" - seek to location relative to beginning", "", " o \"SEEK_CUR\" - seek to location relative to current", "", " o \"SEEK_END\" - seek to location relative to end", "", " This is implemented using fseek()."}
@prop #123."file_eof()" {} rc
;;#123.("file_eof()") = {"Function: INT file_eof(FHANDLE fh)", "", " Returns true if and only if fh's stream is positioned at EOF.", "", " This is implemented using feof()."}
@prop #123."file_rename()" {} rc
;;#123.("file_rename()") = {"Function: void file_rename(STR oldpath, STR newpath)", "", " Attempts to rename the oldpath to newpath.", "", " This is implemented using rename()."}
@prop #123."file_remove()" {} rc
;;#123.("file_remove()") = {"Function: void file_remove(STR pathname)", "", " Attempts to remove the given file.", "", " This is implemented using remove()."}
@prop #123."file_mkdir()" {} rc
;;#123.("file_mkdir()") = {"Function: void file_mkdir(STR pathname)", "", " Attempts to create the given directory.", "", " This is implemented using mkdir()."}
@prop #123."file_rmdir()" {} rc
;;#123.("file_rmdir()") = {"Function: void file_rmdir(STR pathname)", "", " Attempts to remove the given directory.", "", " This is implemented using rmdir()."}
@prop #123."file_list()" {} rc
;;#123.("file_list()") = {"Function: LIST file_list(STR pathname, [ANY detailed])", "", " Attempts to list the contents of the given directory. Returns a list", " of files in the directory. If the detailed argument is provided and", " true, then the list contains detailed entries, otherwise it contains a", " simple list of names.", "", " detailed entry:", " {STR filename, STR file type, STR file mode, INT file size}", " normal entry:", " STR filename", "", " This is implemented using scandir()."}
@prop #123."file_type()" {} rc
;;#123.("file_type()") = {"Function: STR file_type(STR pathname)", "", " Returns the type of the given pathname, one of \"reg\", \"dir\", \"dev\",", " \"fifo\", or \"socket\".", "", " This is implemented using stat()."}
@prop #123."file_mode()" {} rc
;;#123.("file_mode()") = {" Function: STR file_mode(STR filename)", "", " Returns octal mode for a file (e.g. \"644\").", "", " This is implemented using stat()."}
@prop #123."file_chmod()" {} rc
;;#123.("file_chmod()") = {"Function: void file_chmod(STR filename, STR mode)", "", " Attempts to set mode of a file using mode as an octal string of", " exactly three characters.", "", " This is implemented using chmod()."}
@prop #123."file_stat()" {} rc
;;#123.("file_stat()") = {" Function: void file_stat(STR pathname)", " Function: void file_stat(FHANDLE fh)", "", " Returns the result of stat() (or fstat()) on the given file.", " Specifically a list as follows:", "", " {file size in bytes, file type, file access mode, owner, group,", " last access, last modify, and last change}", "", " owner and group are always the empty string.", "", " It is recommended that the specific information functions file_size,", " file_type, file_mode, file_last_access, file_last_modify, and", " file_last_change be used instead. In most cases only one of these", " elements is desired and in those cases there's no reason to make and", " free a list."}
@Prop #123."random()" {} rc
;;#123.("random()") = {"Function: int random ([INT mod [,INT range]])", "", "random -- Return a random integer ", "", "mod must be a positive integer; otherwise, E_INVARG is raised. If mod is not provided, it defaults to the largest MOO integer, which will depend on if you are running 32 or 64bit.", "", "if range is provided then an integer in the range of mod to range (inclusive) is returned.", "", "random(10) => integer between 1-10", "random() => integer between 1 and maximum integer supported", "random(1, 5000) => integer between 1 and 5000"}
@prop #123."value_hash()" {} rc
;;#123.("value_hash()") = {"Function: str value_hash(value, [, STR algo [, binary])", "", "Returns the same string as string_hash(toliteral(value)). ", "", "See the description of string_hash() for details."}
@prop #123."string_hash()" {} rc
;;#123.("string_hash()") = {"*forward*", "binary_hash()"}
@prop #123."binary_hash()" {} rc
;;#123.("binary_hash()") = {"Syntax: string_hash (STR string, [, algo [, binary])", " binary_hash (STR bin-string, [, algo [, binary])", "", "string_hash -- Returns a 64-character hexadecimal string.", "binary_hash -- Returns a 64-character hexadecimal string.", "", "Returns a 64-character hexadecimal string encoding the result of applying the SHA256 cryptographically secure hash function to the contents of the string text or the binary string bin-string. If algo is provided, it specifies the hashing algorithm to use. \"MD5\", \"SHA1\" and \"SHA256\" are all supported.", "", "Note that the MD5 hash algorithm is broken from a cryptographic standpoint, as is SHA1. Both are included for interoperability with existing applications (both are still popular).", "", "All supported hash functions have the property that, if", "", "string_hash(x) == string_hash(y)", "", "then, almost certainly,", "", "equal(x, y)", "", "This can be useful, for example, in certain networking applications: after sending a large piece of text across a connection, also send the result of applying string_hash() to the text; if the destination site also applies string_hash() to the text and gets the same result, you can be quite confident that the large text has arrived unchanged."}
@prop #123."descendents()" {} rc
;;#123.("descendents()") = {"*forward*", "descendants"}
@prop #123."file_grep()" {} rc
;;#123.("file_grep()") = {"Function: LIST file_grep(FHANDLER fh, STR search [,?match_all = 0])", "", "Search for a string in a file.", "", "Assume we have a file `test.txt` with the contents:", "", "asdf asdf 11", "11", "112", "", "And we have an open file handler from running:", "", ";file_open(\"test.txt\", \"r-tn\")", "", "If we were to execute a file grep:", "", ";file_grep(1, \"11\")", "", "We would get the first result:", "", "{{\"asdf asdf 11\", 1}}", "", "The resulting LIST is of the form {{STR match, INT line-number}}", "", "If you pass in the optional third argument", "", ";file_grep(1, \"11\", 1)", "", "we will receive all the matching results:", "", "{{\"asdf asdf 11\", 1}, {\"11\", 2}, {\"112\", 3}}"}
@prop #123."file_count_lines()" {} rc
;;#123.("file_count_lines()") = {"Function: INT file_count_lines (FHANDLER fh)", "", "Count the lines in a file.", "", "", ""}
@prop #123."file_handles()" {} rc
;;#123.("file_handles()") = {"Function: LIST file_handles()", "", "Return a list of open files.", ""}
@prop #123."notify()" {} rc
;;#123.("notify()") = {"Function: INT notify (OBJ conn, STR string [, INT no-flush [, INT suppress-newline]])", "", "Enqueues <string> for output (on a line by itself) on the connection <conn>. If the programmer is not <conn> or a wizard, then E_PERM is raised. If <conn> is not a currently-active connection, then this function does nothing. Output is normally written to connections only between tasks, not during execution.", "", "The server will not queue an arbitrary amount of output for a connection; the `MAX_QUEUED_OUTPUT' compilation option (in `options.h') controls the limit. When an attempt is made to enqueue output that would take the server over its limit, it first tries to write as much output as possible to the connection without having to wait for the other end. If that doesn't result in the new output being able to fit in the queue, the server starts throwing away the oldest lines in the queue until the new output will fit. The server remembers how many lines of output it has `flushed' in this way and, when next it can succeed in writing anything to the connection, it first writes a line like `>> Network buffer overflow; X lines of output to you have been lost <<' where <X> is the number of of flushed lines.", "", "If <no-flush> is provided and true, then `notify()' never flushes any output from the queue; instead it immediately returns false. `Notify()' otherwise always returns true.", "", "If no-flush is provided and true, then `notify()` never flushes any output from the queue; instead it immediately returns false. `Notify()` otherwise always returns true.", "", "", ""}
@prop #123."task_stack()" {} rc
;;#123.("task_stack()") = {"Function: task_stack (INT task-id [, INT include-line-numbers [, INT include-variables]) => LIST", "", "Returns information like that returned by the `callers()' function, but for the suspended task with the given <task-id>; the <include-line-numbers> argument has the same meaning as in `callers()'. Raises E_INVARG if <task-id> does not specify an existing suspended task and E_PERM if the programmer is neither a wizard nor the owner of the specified task.", "", "If include-line-numbers is passed and true, line numbers will be included.", "", "If include-variables is passed and true, variables will be included with each frame of the provided task."}
@prop #123."queue_info()" {} rc
;;#123.("queue_info()") = {"Function: LIST queue_info([obj user])", " MAP queue_info([obj user])", "", "Returns the number of forked tasks that <user> has at the moment. Since it doesn't say which tasks, security is not a significant issue. If no argument is given, then gives a list of all users with task queues in the server. (Essentially all connected players + all open connections + all users with tasks running in the background.)", "", "If the caller is a wizard a map of debug information about task queues will be returned."}
@prop #123."verb_cache_stats()" {} rc
;;#123.("verb_cache_stats()") = {"Syntax: verb_cache_stats() => LIST", " log_cache_stats() => NONE", "", "The server caches verbname-to-program lookups to improve performance. These functions respectively return or write to the server log file the current cache statistics. For verb_cache_stats the return value will be a list of the form", "", "{hits, negative_hits, misses, table_clears, histogram},", "", "though this may change in future server releases. The cache is invalidated by any builtin function call that may have an effect on verb lookups (e.g., delete_verb())."}
@prop #123."log_cache_stats()" {} rc
;;#123.("log_cache_stats()") = {"*forward*", "verb_cache_stats()"}
@prop #123."create()" {} rc
;;#123.("create()") = {"Syntax: create (obj parent [, obj owner] [, int anon-flag] [, list init-args]) => OBJ", " create (list parents [, obj owner] [, int anon-flag] [, list init-args]) => OBJ", "", "Creates and returns a new object whose parents are parents (or whose parent is parent) and whose owner is as described below. If any of the given parents are not valid, or if the given parent is neither valid nor #-1, then E_INVARG is raised. The given parents objects must be valid and must be usable as a parent (i.e., their a or f bits must be true) or else the programmer must own parents or be a wizard; otherwise E_PERM is raised. Futhermore, if anon-flag is true then a must be true; and, if anon-flag is false or not present, then f must be true. Otherwise, E_PERM is raised unless the programmer owns parents or is a wizard. E_PERM is also raised if owner is provided and not the same as the programmer, unless the programmer is a wizard.", "", "After the new object is created, its initialize verb, if any, is called. If init-args were given, they are passed as args to initialize. The new object is assigned the least non-negative object number that has not yet been used for a created object. Note that no object number is ever reused, even if the object with that number is recycled.", "", " Note: This is not strictly true, especially if you are using ToastCore and the $recycler, which is a great idea. If you don't, you end up with extremely high object numbers. However, if you plan on reusing object numbers you need to consider this carefully in your code. You do not want to include object numbers in your code if this is the case, as object numbers could change. Use corified references instead (IE: @prop #0.my_object #objnum allows you to use $my_object in your code. If the object number ever changes, you can change the reference without updating all of your code.)", "", "If anon-flag is false or not present, the new object is a permanent object and is assigned the least non-negative object number that has not yet been used for a created object. Note that no object number is ever reused, even if the object with that number is recycled.", "", "If anon-flag is true, the new object is an anonymous object and is not assigned an object number. Anonymous objects are automatically recycled when they are no longer used.", "", "The owner of the new object is either the programmer (if owner is not provided), the new object itself (if owner was given and is invalid, or owner (otherwise).", "", "The other built-in properties of the new object are initialized as follows:", "", "name \"\"", "location #-1", "contents {}", "programmer 0", "wizard 0", "r 0", "w 0", "f 0", "", "The function is_player() returns false for newly created objects.", "", "In addition, the new object inherits all of the other properties on its parents. These properties have the same permission bits as on the parents. If the c permissions bit is set, then the owner of the property on the new object is the same as the owner of the new object itself; otherwise, the owner of the property on the new object is the same as that on the parent. The initial value of every inherited property is clear; see the description of the built-in function clear_property() for details.", "", "If the intended owner of the new object has a property named ownership_quota and the value of that property is an integer, then create() treats that value as a quota. If the quota is less than or equal to zero, then the quota is considered to be exhausted and create() raises E_QUOTA instead of creating an object. Otherwise, the quota is decremented and stored back into the ownership_quota property as a part of the creation of the new object."}
@prop #123."index()" {} rc
;;#123.("index()") = {"Syntax: index (STR str1, STR str2, [, INT case-matters [, INT skip]) => INT", " rindex (STR str1, STR str2, [, INT case-matters [, INT skip]) => INT", "", "index -- Returns the index of the first character of the first occurrence of str2 in str1. ", "", "rindex -- Returns the index of the first character of the last occurrence of str2 in str1.", "", "These functions will return zero if str2 does not occur in str1 at all.", "", "By default the search for an occurrence of str2 is done while ignoring the upper/lower case distinction. If case-matters is provided and true, then case is treated as significant in all comparisons.", "", "By default the search starts at the beginning (end) of str1. If skip is provided, the search skips the first (last) skip characters and starts at an offset from the beginning (end) of str1. The skip must be a positive integer for index() and a negative integer for rindex(). The default value of skip is 0 (skip no characters).", "", "index(\"foobar\", \"o\") 2", "index(\"foobar\", \"o\", 0, 0) 2", "index(\"foobar\", \"o\", 0, 2) 1", "rindex(\"foobar\", \"o\") 3", "rindex(\"foobar\", \"o\", 0, 0) 3", "rindex(\"foobar\", \"o\", 0, -4) 2", "index(\"foobar\", \"x\") 0", "index(\"foobar\", \"oba\") 3", "index(\"Foobar\", \"foo\", 1) 0", ""}
@prop #123."rindex()" {} rc
;;#123.("rindex()") = {"*forward*", "index()"}
@prop #123."server_log()" {} rc
;;#123.("server_log()") = {"Syntax: server_log (STR message [, INT level]) => NONE", "", "The text in message is sent to the server log with a distinctive prefix (so that it can be distinguished from server-generated messages)", "", "If the programmer is not a wizard, then E_PERM is raised.", "", "If level is provided and is an integer between 0 and 7 inclusive, then message is marked in the server log as one of eight predefined types, from simple log message to error message. Otherwise, if level is provided and true, then message is marked in the server log as an error."}
@prop #123."new_waif()" {} rc
;;#123.("new_waif()") = {"Syntax: new_waif() => WAIF", "", "The new_waif() builtin creates a new WAIF whose class is the calling object and whose owner is the perms of the calling verb.", "", "This wizardly version causes it to be owned by the caller of the verb."}
@prop #123."typeof()" {} rc
;;#123.("typeof()") = {"Syntax: typeof (value) => INT", "", "Takes any MOO value and returns an integer representing the type of value.", "", "The result is the same as the initial value of one of these built-in variables: INT, FLOAT, STR, LIST, MAP, OBJ, or ERR, BOOL, MAP, WAIF, ANON. ", "", "Thus, one usually writes code like this:", "", "if (typeof(x) == LIST) ...", "", "and not like this:", "", "if (typeof(x) == 3) ...", "", "because the former is much more readable than the latter."}
@prop #123."chparent()" {} rc
;;#123.("chparent()") = {"Syntax: chparent (OBJ object, OBJ new-parent) => NONE", " chparents (OBJ object, LIST new-parents) => NONE", "", "chparent -- Changes the parent of object to be new-parent.", "chparents -- Changes the parent of object to be new-parents.", "", "If object is not valid, or if new-parent is neither valid nor equal to #-1, then E_INVARG is raised. If the programmer is neither a wizard or the owner of object, or if new-parent is not fertile (i.e., its f bit is not set) and the programmer is neither the owner of new-parent nor a wizard, then E_PERM is raised. If new-parent is equal to object or one of its current ancestors, E_RECMOVE is raised. If object or one of its descendants defines a property with the same name as one defined either on new-parent or on one of its ancestors, then E_INVARG is raised.", "", "Changing an object's parent can have the effect of removing some properties from and adding some other properties to that object and all of its descendants (i.e., its children and its children's children, etc.). Let common be the nearest ancestor that object and new-parent have in common before the parent of object is changed. Then all properties defined by ancestors of object under common (that is, those ancestors of object that are in turn descendants of common) are removed from object and all of its descendants. All properties defined by new-parent or its ancestors under common are added to object and all of its descendants. As with create(), the newly-added properties are given the same permission bits as they have on new-parent, the owner of each added property is either the owner of the object it's added to (if the c permissions bit is set) or the owner of that property on new-parent, and the value of each added property is clear; see the description of the built-in function clear_property() for details. All properties that are not removed or added in the reparenting process are completely unchanged.", "", "If new-parent is equal to #-1, then object is given no parent at all; it becomes a new root of the parent/child hierarchy. In this case, all formerly inherited properties on object are simply removed.", "", "If new-parents is equal to {}, then object is given no parent at all; it becomes a new root of the parent/child hierarchy. In this case, all formerly inherited properties on object are simply removed.", "", "Warning: On the subject of multiple inheritance, the author (Slither) thinks you should completely avoid it. Prefer composition over inheritance.", ""}
@prop #123."chparents()" {} rc
;;#123.("chparents()") = {"*forward*", "chparent()"}
@prop #123."parent()" {} rc
;;#123.("parent()") = {"Syntax: parent (OBJ object) => OBJ", " parents (OBJ object) => LIST", "", "parent -- return the parent of object", "parents -- return the parents of object"}
@prop #123."parents()" {} rc
;;#123.("parents()") = {"*forward*", "parent()"}
@prop #123."suspend()" {} rc
;;#123.("suspend()") = {"Syntax: suspend([INT|FLOAT seconds]) => VALUE", "", "Suspends the current task, and resumes it after at least <seconds> seconds. Sub-second suspend (IE: 0.1) is possible. (If <seconds> is not provided, the task is suspended indefinitely; such a task can only be resumed by use of the `resume()' function.) When the task is resumed, it will have a full quota of ticks and seconds. This function is useful for programs that run for a long time or require a lot of ticks. If <seconds> is negative, then E_INVARG is raised. `Suspend()' returns zero unless it was resumed via `resume()' in which case it returns the second argument given to that function.", "", "In some sense, this function forks the `rest' of the executing task. However, there is a major difference between the use of `suspend(<seconds>)' and the use of the `fork (<seconds>)'. The `fork' statement creates a new task (a \"forked task\") while the currently-running task still goes on to completion, but a `suspend()' suspends the currently-running task (thus making it into a \"suspended task\"). This difference may be best explained by the following examples, in which one verb calls another:", "", "", " .program #0:caller_A", "", " #0.prop = 1;", "", " #0:callee_A();", "", " #0.prop = 2;", "", " .", "", "", " .program #0:callee_A", "", " fork(5)", "", " #0.prop = 3;", "", " endfork", "", " .", "", "", " .program #0:caller_B", "", " #0.prop = 1;", "", " #0:callee_B();", "", " #0.prop = 2;", "", " .", "", "", " .program #0:callee_B", "", " suspend(5);", "", " #0.prop = 3;", "", " .", "", "Consider `#0:caller_A', which calls `#0:callee_A'. Such a task would assign 1 to `#0.prop', call `#0:callee_A', fork a new task, return to `#0:caller_A', and assign 2 to `#0.prop', ending this task. Five seconds later, if the forked task had not been killed, then it would begin to run; it would assign 3 to `#0.prop' and then stop. So, the final value of `#0.prop' (i.e., the value after more than 5 seconds) would be 3.", "", "Now consider `#0:caller_B', which calls `#0:callee_B' instead of `#0:callee_A'. This task would assign 1 to `#0.prop', call `#0:callee_B', and suspend. Five seconds later, if the suspended task had not been killed, then it would resume; it would assign 3 to `#0.prop', return to `#0:caller', and assign 2 to `#0.prop', ending the task. So, the final value of `#0.prop' (i.e., the value after more than 5 seconds) would be 2.", "", "A suspended task, like a forked task, can be described by the `queued_tasks()' function and killed by the `kill_task()' function. Suspending a task does not change its task id. A task can be suspended again and again by successive calls to `suspend()'.", "", "Once `suspend()' has been used in a particular task, then the `read()' function will always raise E_PERM in that task. For more details, see the description of `read()'.", "", "By default, there is no limit to the number of tasks any player may suspend, but such a limit can be imposed from within the database. See the chapter in the ToastStunt Programmers Manual on server assumptions about the database for details."}
@prop #123."verb_info()" {} rc
;;#123.("verb_info()") = {"Syntax: verb_info (OBJ <object>, STR|INT <verb-name>) => LIST", " set_verb_info (OBJ <object>, STR|INT <verb-name>, LIST <info>) => none", "", "BE AWARE: verb-name can be the string name of the verb OR the index from verbs()", "", "These two functions get and set (respectively) the owner, permission bits, and name(s) for the verb named <verb-name> on the given <object>. If <object> is not valid, then E_INVARG is raised. If <object> does not define a verb named <verb-name>, then E_VERBNF is raised. If the programmer does not have read (write) permission on the verb in question, then `verb_info()' (`set_verb_info()') raises E_PERM. Verb info has the following form:", "", " {<owner>, <perms>, <names>}", "", "where <owner> is an object, <perms> is a string containing only characters from the set `r', `w', `x', and `d', and <names> is a string. This is the kind of value returned by `verb_info()' and expected as the third argument to `set_verb_info()'. The latter function raises E_INVARG if <owner> is not valid, if <perms> contains any illegal characters, or if <names> is the empty string or consists entirely of spaces; it raises E_PERM if <owner> is not the programmer and the programmer is not a wizard."}
@prop #123."verb_args()" {} rc
;;#123.("verb_args()") = {"Syntax: verb_args (OBJ <object>, STR|INT <verb-name>) => LIST", " set_verb_args (OBJ <object>, STR|INT <verb-name>, LIST <args>) => none", "", "BE AWARE: verb-name can be the string name of the verb OR the index from verbs()", "", "These two functions get and set (respectively) the direct-object, preposition, and indirect-object specifications for the verb named <verb-name> on the given <object>. If <object> is not valid, then E_INVARG is raised. If <object> does not define a verb named <verb-name>, then E_VERBNF is raised. If the programmer does not have read (write) permission on the verb in question, then `verb_args()' (`set_verb_args()') raises E_PERM. Verb args specifications have the following form:", "", " {<dobj>, <prep>, <iobj>}", "", "where <dobj> and <iobj> are strings drawn from the set `\"this\"', `\"none\"', and `\"any\"', and <prep> is a string that is either `\"none\"', `\"any\"', or one of the prepositional phrases listed much earlier in the description of verbs in the first chapter. This is the kind of value returned by `verb_info()' and expected as the third argument to `set_verb_info()'. Note that for `set_verb_args()', <prep> must be only one of the prepositional phrases, not (as is shown in that table) a set of such phrases separated by `/' characters. `Set_verb_args()' raises E_INVARG if any of the <dobj>, <prep>, or <iobj> strings is illegal.", "", " verb_args($container, \"take\")", " => {\"any\", \"out of/from inside/from\", \"this\"}", "", " set_verb_args($container, \"take\", {\"any\", \"from\", \"this\"})"}
@prop #123."delete_verb()" {} rc
;;#123.("delete_verb()") = {"Syntax: delete_verb (OBJ <object>, STR|INT <verb-name>) => NONE", "", "BE AWARE: verb-name can be the string name of the verb OR the index from verbs()", "", "Removes the verb named <verb-name> from the given <object>. If <object> is not valid, then E_INVARG is raised. If the programmer does not have write permission on <object>, then E_PERM is raised. If <object> does not define a verb named <verb-name>, then E_VERBNF is raised."}
@prop #123."verb_code()" {} rc
;;#123.("verb_code()") = {"Syntax: verb_code (OBJ <object>, STR|INT <verb-name> [, <fully-paren> [, <indent>]]) => LIST", " set_verb_code (OBJ <object>, STR|INT <verb-name>, LIST <code>) => LIST", "", "BE AWARE: verb-name can be the string name of the verb OR the index from verbs()", "", "These functions get and set (respectively) the MOO-code program associated with the verb named <verb-name> on <object>. The program is represented as a list of strings, one for each line of the program; this is the kind of value returned by `verb_code()' and expected as the third argument to `set_verb_code()'. For `verb_code()', the expressions in the returned code are usually written with the minimum-necessary parenthesization; if <full-paren> is true, then all expressions are fully parenthesized. Also for `verb_code()', the lines in the returned code are usually not indented at all; if <indent> is true, each line is indented to better show the nesting of statements.", "", "If <object> is not valid, then E_INVARG is raised. If <object> does not define a verb named <verb-name>, then E_VERBNF is raised. If the programmer does not have read (write) permission on the verb in question, then `verb_code()' (`set_verb_code()') raises E_PERM. If the programmer is not, in fact, a programmer, then E_PERM is raised.", "", "For `set_verb_code()', the result is a list of strings, the error messages generated by the MOO-code compiler during processing of <code>. If the list is non-empty, then `set_verb_code()' did not install <code>; the program associated with the verb in question is unchanged."}
@prop #123."disassemble()" {} rc
;;#123.("disassemble()") = {"Syntax: disassemble (OBJ object, STR|INT verb-desc) => LIST", "", "BE AWARE: verb-name can be the string name of the verb OR the index from verbs()", "", "Returns a (longish) list of strings giving a listing of the server's internal \"compiled\" form of the verb as specified by <verb-desc> on <object>. This format is not documented and may indeed change from release to release, but some programmers may nonetheless find the output of `disassemble()' interesting to peruse as a way to gain a deeper appreciation of how the server works.", "", "If <object> is not valid, then E_INVARG is raised. If <object> does not define a verb as specified by <verb-desc>, then E_VERBNF is raised. If the programmer does not have read permission on the verb in question, then disassemble() raises E_PERM."}
@prop #123."connection_name()" {} rc
;;#123.("connection_name()") = {"Syntax: connection_name (OBJ <player>, [INT method]) => STR", "", "When provided just a player object this function only returns obj's hostname (e.g. 1-2-3-6.someplace.com). An optional argument allows you to specify 1 if you want a numeric IP address, or 2 if you want to return the legacy connection_name string.", "", "Warning: If you are using a LambdaMOO core, this is a semi-breaking change. You'll want to update any code on your server that runs connection_name to pass in the argument for returning the legacy connection_name string if you want things to work exactly the same.", "", "If the programmer is not a wizard and not player, then E_PERM is raised. If player is not currently connected, then E_INVARG is raised.", "", "Legacy Connection String Information:", "", "For the TCP/IP networking configurations, for in-bound connections, the string has the form:", "", "\"port lport from host, port port\"", "", "where lport is the decimal TCP listening port on which the connection arrived, host is either the name or decimal TCP address of the host from which the player is connected, and port is the decimal TCP port of the connection on that host.", "", "For outbound TCP/IP connections, the string has the form", "", "\"port lport to host, port port\"", "", "where lport is the decimal local TCP port number from which the connection originated, host is either the name or decimal TCP address of the host to which the connection was opened, and port is the decimal TCP port of the connection on that host.", "", "For the System V 'local' networking configuration, the string is the UNIX login name of the connecting user or, if no such name can be found, something of the form:", "", "\"User #number\"", "", "where number is a UNIX numeric user ID.", "", "For the other networking configurations, the string is the same for all connections and, thus, useless."}