@lpc-lang/core 1.1.2-5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/README.md +255 -0
  2. package/bin/lpc +4 -0
  3. package/bin/lpcserver +4 -0
  4. package/cancellationToken/cancellationToken.d.ts +8 -0
  5. package/cancellationToken/cancellationToken.d.ts.map +1 -0
  6. package/cancellationToken/serverCancellationToken.d.ts +21 -0
  7. package/cancellationToken/serverCancellationToken.d.ts.map +1 -0
  8. package/cli/_namespaces/lpc.d.ts +2 -0
  9. package/cli/_namespaces/lpc.d.ts.map +1 -0
  10. package/cli/lpc.d.ts +2 -0
  11. package/cli/lpc.d.ts.map +1 -0
  12. package/compiler/LpcConfig.d.ts +17 -0
  13. package/compiler/LpcConfig.d.ts.map +1 -0
  14. package/compiler/_namespaces/lpc.d.ts +49 -0
  15. package/compiler/_namespaces/lpc.d.ts.map +1 -0
  16. package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts +2 -0
  17. package/compiler/_namespaces/lpc.moduleSpecifiers.d.ts.map +1 -0
  18. package/compiler/_namespaces/lpc.performance.d.ts +2 -0
  19. package/compiler/_namespaces/lpc.performance.d.ts.map +1 -0
  20. package/compiler/binder.d.ts +2 -0
  21. package/compiler/binder.d.ts.map +1 -0
  22. package/compiler/builderPublic.d.ts +76 -0
  23. package/compiler/builderPublic.d.ts.map +1 -0
  24. package/compiler/checker.d.ts +2 -0
  25. package/compiler/checker.d.ts.map +1 -0
  26. package/compiler/commandLineParser.d.ts +47 -0
  27. package/compiler/commandLineParser.d.ts.map +1 -0
  28. package/compiler/core.d.ts +3 -0
  29. package/compiler/core.d.ts.map +1 -0
  30. package/compiler/corePublic.d.ts +19 -0
  31. package/compiler/corePublic.d.ts.map +1 -0
  32. package/compiler/debug.d.ts +71 -0
  33. package/compiler/debug.d.ts.map +1 -0
  34. package/compiler/diagnosticInformation.d.ts +518 -0
  35. package/compiler/diagnosticInformation.d.ts.map +1 -0
  36. package/compiler/emitter.d.ts +11 -0
  37. package/compiler/emitter.d.ts.map +1 -0
  38. package/compiler/executeCommandLine.d.ts +15 -0
  39. package/compiler/executeCommandLine.d.ts.map +1 -0
  40. package/compiler/expressionToTypeNode.d.ts +2 -0
  41. package/compiler/expressionToTypeNode.d.ts.map +1 -0
  42. package/compiler/factory/baseNodeFactory.d.ts +2 -0
  43. package/compiler/factory/baseNodeFactory.d.ts.map +1 -0
  44. package/compiler/factory/emitHelper.d.ts +2 -0
  45. package/compiler/factory/emitHelper.d.ts.map +1 -0
  46. package/compiler/factory/emitNode.d.ts +22 -0
  47. package/compiler/factory/emitNode.d.ts.map +1 -0
  48. package/compiler/factory/nodeChildren.d.ts +2 -0
  49. package/compiler/factory/nodeChildren.d.ts.map +1 -0
  50. package/compiler/factory/nodeConverters.d.ts +2 -0
  51. package/compiler/factory/nodeConverters.d.ts.map +1 -0
  52. package/compiler/factory/nodeFactory.d.ts +4 -0
  53. package/compiler/factory/nodeFactory.d.ts.map +1 -0
  54. package/compiler/factory/parenthesizerRules.d.ts +2 -0
  55. package/compiler/factory/parenthesizerRules.d.ts.map +1 -0
  56. package/compiler/factory/utilities.d.ts +2 -0
  57. package/compiler/factory/utilities.d.ts.map +1 -0
  58. package/compiler/factory/utilitiesPublic.d.ts +4 -0
  59. package/compiler/factory/utilitiesPublic.d.ts.map +1 -0
  60. package/compiler/lpcFileHandler.d.ts +10 -0
  61. package/compiler/lpcFileHandler.d.ts.map +1 -0
  62. package/compiler/lpcJsHelpers.d.ts +17 -0
  63. package/compiler/lpcJsHelpers.d.ts.map +1 -0
  64. package/compiler/lpcbuild.d.ts +2 -0
  65. package/compiler/lpcbuild.d.ts.map +1 -0
  66. package/compiler/lpcbuildPublic.d.ts +26 -0
  67. package/compiler/lpcbuildPublic.d.ts.map +1 -0
  68. package/compiler/moduleNameResolver.d.ts +55 -0
  69. package/compiler/moduleNameResolver.d.ts.map +1 -0
  70. package/compiler/moduleSpecifiers.d.ts +2 -0
  71. package/compiler/moduleSpecifiers.d.ts.map +1 -0
  72. package/compiler/nodeTests.d.ts +115 -0
  73. package/compiler/nodeTests.d.ts.map +1 -0
  74. package/compiler/parser.d.ts +65 -0
  75. package/compiler/parser.d.ts.map +1 -0
  76. package/compiler/path.d.ts +2 -0
  77. package/compiler/path.d.ts.map +1 -0
  78. package/compiler/perfLoger.d.ts +2 -0
  79. package/compiler/perfLoger.d.ts.map +1 -0
  80. package/compiler/performance.d.ts +2 -0
  81. package/compiler/performance.d.ts.map +1 -0
  82. package/compiler/performanceCore.d.ts +2 -0
  83. package/compiler/performanceCore.d.ts.map +1 -0
  84. package/compiler/program.d.ts +72 -0
  85. package/compiler/program.d.ts.map +1 -0
  86. package/compiler/resolutionCache.d.ts +6 -0
  87. package/compiler/resolutionCache.d.ts.map +1 -0
  88. package/compiler/resolver.d.ts +1 -0
  89. package/compiler/resolver.d.ts.map +1 -0
  90. package/compiler/scanner.d.ts +85 -0
  91. package/compiler/scanner.d.ts.map +1 -0
  92. package/compiler/sourcemap.d.ts +2 -0
  93. package/compiler/sourcemap.d.ts.map +1 -0
  94. package/compiler/sys.d.ts +56 -0
  95. package/compiler/sys.d.ts.map +1 -0
  96. package/compiler/tracing.d.ts +31 -0
  97. package/compiler/tracing.d.ts.map +1 -0
  98. package/compiler/transformers/declarations.d.ts +2 -0
  99. package/compiler/transformers/declarations.d.ts.map +1 -0
  100. package/compiler/transformers.d.ts +2 -0
  101. package/compiler/transformers.d.ts.map +1 -0
  102. package/compiler/types.d.ts +3284 -0
  103. package/compiler/types.d.ts.map +1 -0
  104. package/compiler/utilities.d.ts +57 -0
  105. package/compiler/utilities.d.ts.map +1 -0
  106. package/compiler/utilitiesPublic.d.ts +213 -0
  107. package/compiler/utilitiesPublic.d.ts.map +1 -0
  108. package/compiler/visitorPublic.d.ts +72 -0
  109. package/compiler/visitorPublic.d.ts.map +1 -0
  110. package/compiler/watch.d.ts +2 -0
  111. package/compiler/watch.d.ts.map +1 -0
  112. package/compiler/watchPublic.d.ts +44 -0
  113. package/compiler/watchPublic.d.ts.map +1 -0
  114. package/compiler/watchUtilities.d.ts +14 -0
  115. package/compiler/watchUtilities.d.ts.map +1 -0
  116. package/config-types.d.ts +33 -0
  117. package/config-types.d.ts.map +1 -0
  118. package/harness/harnessIO.d.ts +4 -0
  119. package/harness/harnessIO.d.ts.map +1 -0
  120. package/lpc/_namespaces/lpc.d.ts +6 -0
  121. package/lpc/_namespaces/lpc.d.ts.map +1 -0
  122. package/lpc/_namespaces/lpc.server.d.ts +2 -0
  123. package/lpc/_namespaces/lpc.server.d.ts.map +1 -0
  124. package/lpc/lpc.d.ts +2 -0
  125. package/lpc/lpc.d.ts.map +1 -0
  126. package/lpcserver/document.d.ts +1 -0
  127. package/lpcserver/document.d.ts.map +1 -0
  128. package/lpcserver/nodeServer.d.ts +25 -0
  129. package/lpcserver/nodeServer.d.ts.map +1 -0
  130. package/lpcserver/protocol.const.d.ts +46 -0
  131. package/lpcserver/protocol.const.d.ts.map +1 -0
  132. package/lpcserver/server.d.ts +3 -0
  133. package/lpcserver/server.d.ts.map +1 -0
  134. package/lpcserver/textRendering.d.ts +14 -0
  135. package/lpcserver/textRendering.d.ts.map +1 -0
  136. package/lpcserver/typeConverters.d.ts +44 -0
  137. package/lpcserver/typeConverters.d.ts.map +1 -0
  138. package/lpcserver/utils.d.ts +14 -0
  139. package/lpcserver/utils.d.ts.map +1 -0
  140. package/package.json +48 -0
  141. package/parse-fluff-docs.d.ts +2 -0
  142. package/parse-fluff-docs.d.ts.map +1 -0
  143. package/parse-ld-docs.d.ts +2 -0
  144. package/parse-ld-docs.d.ts.map +1 -0
  145. package/server/_namespaces/lpc.d.ts +5 -0
  146. package/server/_namespaces/lpc.d.ts.map +1 -0
  147. package/server/_namespaces/lpc.server.d.ts +11 -0
  148. package/server/_namespaces/lpc.server.d.ts.map +1 -0
  149. package/server/_namespaces/lpc.server.protocol.d.ts +2 -0
  150. package/server/_namespaces/lpc.server.protocol.d.ts.map +1 -0
  151. package/server/editorServices.d.ts +261 -0
  152. package/server/editorServices.d.ts.map +1 -0
  153. package/server/project.d.ts +143 -0
  154. package/server/project.d.ts.map +1 -0
  155. package/server/protocol.d.ts +962 -0
  156. package/server/protocol.d.ts.map +1 -0
  157. package/server/scriptInfo.d.ts +53 -0
  158. package/server/scriptInfo.d.ts.map +1 -0
  159. package/server/scriptVersionCache.d.ts +2 -0
  160. package/server/scriptVersionCache.d.ts.map +1 -0
  161. package/server/session.d.ts +150 -0
  162. package/server/session.d.ts.map +1 -0
  163. package/server/types.d.ts +24 -0
  164. package/server/types.d.ts.map +1 -0
  165. package/server/utilities.d.ts +2 -0
  166. package/server/utilities.d.ts.map +1 -0
  167. package/server/utilitiesPublic.d.ts +37 -0
  168. package/server/utilitiesPublic.d.ts.map +1 -0
  169. package/server.d.ts +2 -0
  170. package/server.d.ts.map +1 -0
  171. package/services/_namespaces/lpc.Completions.StringCompletions.d.ts +2 -0
  172. package/services/_namespaces/lpc.Completions.StringCompletions.d.ts.map +1 -0
  173. package/services/_namespaces/lpc.Completions.d.ts +4 -0
  174. package/services/_namespaces/lpc.Completions.d.ts.map +1 -0
  175. package/services/_namespaces/lpc.FindAllReferences.d.ts +3 -0
  176. package/services/_namespaces/lpc.FindAllReferences.d.ts.map +1 -0
  177. package/services/_namespaces/lpc.GoToDefinition.d.ts +2 -0
  178. package/services/_namespaces/lpc.GoToDefinition.d.ts.map +1 -0
  179. package/services/_namespaces/lpc.JsDoc.d.ts +2 -0
  180. package/services/_namespaces/lpc.JsDoc.d.ts.map +1 -0
  181. package/services/_namespaces/lpc.NavigationBar.d.ts +2 -0
  182. package/services/_namespaces/lpc.NavigationBar.d.ts.map +1 -0
  183. package/services/_namespaces/lpc.Rename.d.ts +2 -0
  184. package/services/_namespaces/lpc.Rename.d.ts.map +1 -0
  185. package/services/_namespaces/lpc.SignatureHelp.d.ts +2 -0
  186. package/services/_namespaces/lpc.SignatureHelp.d.ts.map +1 -0
  187. package/services/_namespaces/lpc.SymbolDisplay.d.ts +2 -0
  188. package/services/_namespaces/lpc.SymbolDisplay.d.ts.map +1 -0
  189. package/services/_namespaces/lpc.codefix.d.ts +3 -0
  190. package/services/_namespaces/lpc.codefix.d.ts.map +1 -0
  191. package/services/_namespaces/lpc.d.ts +30 -0
  192. package/services/_namespaces/lpc.d.ts.map +1 -0
  193. package/services/_namespaces/lpc.formatting.d.ts +7 -0
  194. package/services/_namespaces/lpc.formatting.d.ts.map +1 -0
  195. package/services/_namespaces/lpc.textChanges.d.ts +2 -0
  196. package/services/_namespaces/lpc.textChanges.d.ts.map +1 -0
  197. package/services/classifier2020.d.ts +2 -0
  198. package/services/classifier2020.d.ts.map +1 -0
  199. package/services/codefixes/helpers.d.ts +2 -0
  200. package/services/codefixes/helpers.d.ts.map +1 -0
  201. package/services/codefixes/importFixes.d.ts +2 -0
  202. package/services/codefixes/importFixes.d.ts.map +1 -0
  203. package/services/completions.d.ts +2 -0
  204. package/services/completions.d.ts.map +1 -0
  205. package/services/documentRegistry.d.ts +90 -0
  206. package/services/documentRegistry.d.ts.map +1 -0
  207. package/services/exportInfoMap.d.ts +5 -0
  208. package/services/exportInfoMap.d.ts.map +1 -0
  209. package/services/findAllReferences.d.ts +2 -0
  210. package/services/findAllReferences.d.ts.map +1 -0
  211. package/services/formatting/formatting.d.ts +2 -0
  212. package/services/formatting/formatting.d.ts.map +1 -0
  213. package/services/formatting/formattingContext.d.ts +2 -0
  214. package/services/formatting/formattingContext.d.ts.map +1 -0
  215. package/services/formatting/rule.d.ts +2 -0
  216. package/services/formatting/rule.d.ts.map +1 -0
  217. package/services/formatting/rules.d.ts +2 -0
  218. package/services/formatting/rules.d.ts.map +1 -0
  219. package/services/formatting/rulesMap.d.ts +2 -0
  220. package/services/formatting/rulesMap.d.ts.map +1 -0
  221. package/services/formatting/smartIndenter.d.ts +2 -0
  222. package/services/formatting/smartIndenter.d.ts.map +1 -0
  223. package/services/goToDefinition.d.ts +2 -0
  224. package/services/goToDefinition.d.ts.map +1 -0
  225. package/services/importTracker.d.ts +2 -0
  226. package/services/importTracker.d.ts.map +1 -0
  227. package/services/jsDoc.d.ts +2 -0
  228. package/services/jsDoc.d.ts.map +1 -0
  229. package/services/navigationBar.d.ts +2 -0
  230. package/services/navigationBar.d.ts.map +1 -0
  231. package/services/rename.d.ts +2 -0
  232. package/services/rename.d.ts.map +1 -0
  233. package/services/services.d.ts +54 -0
  234. package/services/services.d.ts.map +1 -0
  235. package/services/signatureHelp.d.ts +2 -0
  236. package/services/signatureHelp.d.ts.map +1 -0
  237. package/services/sourcemaps.d.ts +2 -0
  238. package/services/sourcemaps.d.ts.map +1 -0
  239. package/services/stringCompletions.d.ts +2 -0
  240. package/services/stringCompletions.d.ts.map +1 -0
  241. package/services/suggestionDiagnostics.d.ts +2 -0
  242. package/services/suggestionDiagnostics.d.ts.map +1 -0
  243. package/services/symbolDisplay.d.ts +2 -0
  244. package/services/symbolDisplay.d.ts.map +1 -0
  245. package/services/textChanges.d.ts +2 -0
  246. package/services/textChanges.d.ts.map +1 -0
  247. package/services/types.d.ts +901 -0
  248. package/services/types.d.ts.map +1 -0
  249. package/services/utilities.d.ts +3 -0
  250. package/services/utilities.d.ts.map +1 -0
  251. package/src/cli.js +58 -0
  252. package/src/cli.js.map +7 -0
  253. package/src/efuns/fluffos/arrays.h +205 -0
  254. package/src/efuns/fluffos/async.h +84 -0
  255. package/src/efuns/fluffos/buffers.h +80 -0
  256. package/src/efuns/fluffos/calls.h +275 -0
  257. package/src/efuns/fluffos/contrib.h +805 -0
  258. package/src/efuns/fluffos/db.h +125 -0
  259. package/src/efuns/fluffos/driver.h +107 -0
  260. package/src/efuns/fluffos/ed.h +48 -0
  261. package/src/efuns/fluffos/efuns.fluffos.h +75 -0
  262. package/src/efuns/fluffos/external.h +30 -0
  263. package/src/efuns/fluffos/filesystem.h +154 -0
  264. package/src/efuns/fluffos/floats.h +136 -0
  265. package/src/efuns/fluffos/functions.h +104 -0
  266. package/src/efuns/fluffos/general.h +548 -0
  267. package/src/efuns/fluffos/interactive.h +777 -0
  268. package/src/efuns/fluffos/internals.h +455 -0
  269. package/src/efuns/fluffos/lpc-config.json +10 -0
  270. package/src/efuns/fluffos/mappings.h +205 -0
  271. package/src/efuns/fluffos/misc.h +43 -0
  272. package/src/efuns/fluffos/mudlib.h +228 -0
  273. package/src/efuns/fluffos/numbers.h +41 -0
  274. package/src/efuns/fluffos/objects.h +365 -0
  275. package/src/efuns/fluffos/parsing.h +220 -0
  276. package/src/efuns/fluffos/pcre.h +75 -0
  277. package/src/efuns/fluffos/sockets.h +276 -0
  278. package/src/efuns/fluffos/strings.h +542 -0
  279. package/src/efuns/fluffos/system.h +408 -0
  280. package/src/efuns/fluffos/zh-cn/arrays.zh-cn.h +167 -0
  281. package/src/efuns/fluffos/zh-cn/async.zh-cn.h +81 -0
  282. package/src/efuns/fluffos/zh-cn/buffers.zh-cn.h +69 -0
  283. package/src/efuns/fluffos/zh-cn/calls.zh-cn.h +242 -0
  284. package/src/efuns/fluffos/zh-cn/contrib.zh-cn.h +767 -0
  285. package/src/efuns/fluffos/zh-cn/db.zh-cn.h +113 -0
  286. package/src/efuns/fluffos/zh-cn/ed.zh-cn.h +42 -0
  287. package/src/efuns/fluffos/zh-cn/efuns.fluffos.h +76 -0
  288. package/src/efuns/fluffos/zh-cn/external.zh-cn.h +25 -0
  289. package/src/efuns/fluffos/zh-cn/filesystem.zh-cn.h +140 -0
  290. package/src/efuns/fluffos/zh-cn/floats.zh-cn.h +129 -0
  291. package/src/efuns/fluffos/zh-cn/functions.zh-cn.h +87 -0
  292. package/src/efuns/fluffos/zh-cn/general.zh-cn.h +506 -0
  293. package/src/efuns/fluffos/zh-cn/interactive.zh-cn.h +659 -0
  294. package/src/efuns/fluffos/zh-cn/internals.zh-cn.h +356 -0
  295. package/src/efuns/fluffos/zh-cn/mappings.zh-cn.h +188 -0
  296. package/src/efuns/fluffos/zh-cn/misc.zh-cn.h +43 -0
  297. package/src/efuns/fluffos/zh-cn/mudlib.zh-cn.h +190 -0
  298. package/src/efuns/fluffos/zh-cn/numbers.zh-cn.h +36 -0
  299. package/src/efuns/fluffos/zh-cn/objects.zh-cn.h +280 -0
  300. package/src/efuns/fluffos/zh-cn/parsing.zh-cn.h +212 -0
  301. package/src/efuns/fluffos/zh-cn/pcre.zh-cn.h +67 -0
  302. package/src/efuns/fluffos/zh-cn/sockets.zh-cn.h +230 -0
  303. package/src/efuns/fluffos/zh-cn/strings.zh-cn.h +484 -0
  304. package/src/efuns/fluffos/zh-cn/system.zh-cn.h +366 -0
  305. package/src/efuns/ldmud/defines.h +69 -0
  306. package/src/efuns/ldmud/efun.h +10449 -0
  307. package/src/efuns/ldmud/efuns.ldmud.h +87 -0
  308. package/src/efuns/ldmud/lpc-config.json +9 -0
  309. package/src/efuns/ldmud/obsolete.h +2168 -0
  310. package/src/lpc.js +82486 -0
  311. package/src/lpc.js.map +6 -0
  312. package/src/server.js +129 -0
  313. package/src/server.js.map +7 -0
  314. package/types.d.ts +23 -0
  315. package/types.d.ts.map +1 -0
  316. package/utils.d.ts +21 -0
  317. package/utils.d.ts.map +1 -0
@@ -0,0 +1,805 @@
1
+ // contrib.h
2
+
3
+ /**
4
+ * zonetime - returns ctime(int) for timezone string
5
+ *
6
+ * returns ctime(int) for timezone string.
7
+ *
8
+ */
9
+ string zonetime(string timezone, int timestamp);
10
+
11
+ /**
12
+ * variables - returns array of global variable names
13
+ *
14
+ * int == 0:
15
+ * returns array of global variable names
16
+ *
17
+ * int != 0
18
+ * returns array of arrays of variable name & type
19
+ * @param {object} ob - object to query
20
+ * @param {int} flag (optional) defaults to 0
21
+ */
22
+ mixed *variables(object ob, int flag);
23
+
24
+ /**
25
+ * upper_case() - returns a string with every letter supplied in the source
26
+ capitalised.
27
+ *
28
+ * Returns a new string with every character in <text> converted to upper case.
29
+ *
30
+ * string text = upper_case( "I like cheese." ) ; // "I LIKE CHEESE."
31
+ *
32
+ */
33
+ string upper_case(string text);
34
+
35
+ /**
36
+ * test_load - test if a file is loadable
37
+ *
38
+ * Tests if a file is loadable. Will return 1 if a file is loadable,
39
+ * otherwise 0. If a file attempting to be loaded contains errors,
40
+ * they will be reported, in which case, you may need to wrap the
41
+ * function call in a catch statement to retrieve the 0 result.
42
+ *
43
+ */
44
+ int test_load( string filename );
45
+
46
+ /**
47
+ * terminal_colour() - return a wrapped and indented string where the driver
48
+ substitutes %^KEY%^ in the string with the matching VALUE of KEY in the
49
+ supplied mapping.
50
+ *
51
+ * string: to be parsed for '%^KEY%^' sequences
52
+ * mapping: 'KEY:value' pairs
53
+ * 1st int: wrap after int printed symbols
54
+ * if int < 0 fillout lines with blank's
55
+ *
56
+ * wrap = 4:
57
+ * '12\n345'
58
+ * wrap = -4:
59
+ * '12 \n345 '
60
+ *
61
+ * minwrap: 2
62
+ *
63
+ * 2nd int: indent by int blanks
64
+ * maxindent: wrap-2
65
+ *
66
+ * returns wrapped and indented string with each '%^KEY%^' replaced by KEY's value
67
+ * or original string if no '%^KEY%^' sequence is found
68
+ * (shouldn't it at least be wrapped and indented?)
69
+ *
70
+ */
71
+ string terminal_colour(string, mapping, int | void, int | void);
72
+
73
+ /**
74
+ * string_difference - return levenshtein difference
75
+ *
76
+ * returns levenshtein difference
77
+ *
78
+ */
79
+ int string_difference(string, string);
80
+
81
+ /**
82
+ * store_variable - store a value in an object's global variable
83
+ *
84
+ * This efun stores the value in the global variable variable_name in `ob`.
85
+ *
86
+ * `variable_name` is name of the global variable.
87
+ * `value` is the data to be stored in the global variable.
88
+ * `ob` defaults to this_object() if not specified.
89
+ *
90
+ * If `ob` is not specified, then `variable_name` can be any global variable
91
+ * in the inheritance hierarchy, regardless of scope. If `ob` is specified,
92
+ * then `variable_name` must be public scope.
93
+ *
94
+ * This is a potential security hazard and, therefore, you may wish to overload
95
+ * this function to perform security checks.
96
+ *
97
+ * store_variable( "weight", 150, this_player() ) ;
98
+ *
99
+ */
100
+ void store_variable(string variable_name, mixed value, void|object ob);
101
+
102
+ /**
103
+ * store_class_member
104
+ *
105
+ * Store <value> in the <class_element>th member of an <instantiated_class>.
106
+ *
107
+ * Returns an updated version of the <instantiated_class>.
108
+ *
109
+ * class person {
110
+ * string name ;
111
+ * int age ;
112
+ * string city ;
113
+ * }
114
+ *
115
+ * void fun()
116
+ * {
117
+ * class person me = new(class person) ;
118
+ *
119
+ * me->name = "Foo" ;
120
+ * me->age = 42 ;
121
+ * me->city = "Fooville" ;
122
+ *
123
+ * write( sprintf("%O\n", me) ) ;
124
+ *
125
+ * // Result:
126
+ * // CLASS( 3 elements
127
+ * // "Foo",
128
+ * // 42,
129
+ * // "Fooville"
130
+ * // )
131
+ *
132
+ * me = store_class_member( me, 1, 43 ) ;
133
+ *
134
+ * write( sprintf("%O\n", me) ) ;
135
+ *
136
+ * // Result:
137
+ * // CLASS( 3 elements
138
+ * // "Foo",
139
+ * // 43,
140
+ * // "Fooville"
141
+ * // )
142
+ * }
143
+ *
144
+ */
145
+ mixed store_class_member(mixed instantiated_class, int class_element, mixed value);
146
+
147
+ /**
148
+ * shuffle
149
+ *
150
+ * randomly reorders the elements of the given array (changes original!!!)
151
+ *
152
+ */
153
+ mixed *shuffle(mixed *arr);
154
+
155
+ /**
156
+ *
157
+ *
158
+ *
159
+ *
160
+ */
161
+
162
+
163
+ /**
164
+ * send_nullbyte - sends '\0' to interactive
165
+ *
166
+ * sends '\0' to interactive, returns -2 in case of error 1 otherwise
167
+ *
168
+ */
169
+ int send_nullbyte(object);
170
+
171
+ /**
172
+ * roll_MdN() - dice roll generator where you specify the number of dice and
173
+ the number of sides to each die, with bonus if supplied.
174
+ *
175
+ * rolls `sides`-sided die `rolls` number of times and returns the sum
176
+ * of all rolls
177
+ *
178
+ * if `bonus` is supplied, will add the bonus and return the result.
179
+ *
180
+ * // roll a 1d4
181
+ * roll_MdN(1, 4)
182
+ *
183
+ * // roll 2d6
184
+ * roll_MdN(2, 6)
185
+ *
186
+ * // roll 1d10 and add 15
187
+ * roll_MdN(1, 10, 15)
188
+ * @param {int} rolls - number of dice
189
+ * @param {int} sides - number of sides on each die
190
+ * @param {int} bonus - (optional) bonus to add to the roll, defaults to 0
191
+ */
192
+ int roll_MdN(int rolls, int sides, int bonus);
193
+
194
+ /**
195
+ * restore_from_string() - like restore_object(), but restores variables from
196
+ a string where the string is in the same format as from restore_object()
197
+ *
198
+ * uses string as restore_object uses file meaning of int the same
199
+ * @param {string} str - string to restore from
200
+ * @param {int} flag - defaults to 0
201
+ */
202
+ void restore_from_string(string str, int flag);
203
+
204
+ /**
205
+ * replaceable - check if object is replaceable
206
+ *
207
+ * string *func defaults to ({ "create", "__INIT" }) and contains a list of
208
+ * functions which may be ignored for checking
209
+ *
210
+ * checks if object defines any functions itself (beside create)
211
+ *
212
+ * returns 1 if no and object is not simul_efun object and not ???
213
+ * 0 otherwise
214
+ *
215
+ */
216
+ int replaceable(object, void | string *func);
217
+
218
+ /**
219
+ * repeat_string() - repeat a string a certain number of times.
220
+ *
221
+ * returns a new string
222
+ *
223
+ * - repeats <= 0: ""
224
+ * - repeats > 0 original string repeated either int times or the maximum
225
+ * number of times without getting greater than the maximum string length
226
+ *
227
+ * maxstrlen = 5:
228
+ * repeat_string("ab", 3) = "abab"
229
+ *
230
+ * maxstrlen >=6:
231
+ * repeat_string("ab", 3) = "ababab"
232
+ *
233
+ */
234
+ string repeat_string(string str, int repeats);
235
+
236
+ /**
237
+ * remove_shadow() - remove all shadows from the specified object, or remove
238
+ a specified shadow from another object. does not destruct the shadow.
239
+ *
240
+ * ob defaults to this_object()
241
+ * returns 0 if object is either destroyed or is no shadow and isn't shadowed
242
+ * returns 1 otherwise
243
+ *
244
+ * ob <- shadow1 <- shadow2
245
+ *
246
+ * remove(shadow2): ob <- shadow1 shadow2
247
+ * remove(shadow1): ob <- shadow2 shadow1
248
+ * remove(ob): shadow1 <- shadow2 ob
249
+ *
250
+ * #ifndef NO_SHADOWS
251
+ *
252
+ */
253
+ int remove_shadow(object ob);
254
+
255
+ /**
256
+ * remove_interactive - removes the interactive object
257
+ *
258
+ * If the argument object is interactive and not destructed, cause it to be
259
+ * disconnected and lose interactive status. Returns 1 when the operation is
260
+ * successful.
261
+ *
262
+ * This function requires PACKAGE_CONTRIB to be defined in the options file.
263
+ *
264
+ */
265
+ int remove_interactive(object interactive);
266
+
267
+ /**
268
+ * remove_get_char() - cancels active input_to
269
+ *
270
+ * cancels active input_to
271
+ * set's interactive->carryover = NULL
272
+ * set's interactive->num_carry = 0
273
+ *
274
+ * returns -3 if argument missing
275
+ * -2 if object destroyed or not interactive
276
+ * -1 if no input_to active
277
+ * 1 otherwise
278
+ *
279
+ */
280
+ int remove_get_char(object interactive);
281
+
282
+ /**
283
+ * remove_charmode() - switches interactive object into linemode
284
+ *
285
+ * switches interactive object into linemode
286
+ *
287
+ * returns -1 if argument missing
288
+ * -2 in case of error (object destroyed or not interactive)
289
+ * current input_to flags with char_mode unset
290
+ *
291
+ */
292
+ int remove_charmode(object);
293
+
294
+ /**
295
+ * real_time
296
+ *
297
+ * returns local server time
298
+ *
299
+ */
300
+ int real_time();
301
+
302
+ /**
303
+ * query_replaced_program
304
+ *
305
+ * obiect defaults to this_object()
306
+ *
307
+ * if object called replace_program this function returns the path to the object
308
+ * it was replaced with
309
+ *
310
+ */
311
+ string query_replaced_program(void | object);
312
+
313
+ /**
314
+ * query_num
315
+ *
316
+ * Warning: English only!!!
317
+ *
318
+ * Converts `num` into a string representation. If `many` is greater than 0
319
+ * and `num` is greater than `many`, the resulting string is "many".
320
+ *
321
+ * Any `num` greater than 99,999 is always "many", the same for any `num` less
322
+ * than 0.
323
+ * @param {int} num - number to convert
324
+ * @param {int} many - (optional) defaults to 0
325
+ */
326
+ varargs string query_num(int num, int many);
327
+
328
+ /**
329
+ * query_notify_fail
330
+ *
331
+ * returns current notify_fail setting (funcp or string)
332
+ * #ifndef NO_ADD_ACTION
333
+ *
334
+ */
335
+ mixed query_notify_fail();
336
+
337
+ /**
338
+ * query_ip_port - returns local_port of connection
339
+ *
340
+ * object defaults to this_player()
341
+ *
342
+ * returns local_port of connection or 0 if object not interactive
343
+ *
344
+ */
345
+ int query_ip_port(void | object);
346
+
347
+ /**
348
+ * query_charmode
349
+ *
350
+ * returns -1 if argument missing
351
+ * -2 in case of error (object destroyed or not interactive)
352
+ * 0 if interactive object is in line mode
353
+ * !0 otherwise (actual value depends on compile time define)
354
+ *
355
+ */
356
+ int query_charmode(object);
357
+
358
+ /**
359
+ * program_info
360
+ *
361
+ * object defaults to ALL objects
362
+ *
363
+ * returns mapping consinsting of:
364
+ *
365
+ * - header size : int
366
+ * - code size : int
367
+ * - function size : int
368
+ * - var size : int
369
+ * - class size : int
370
+ * - inherit size : int
371
+ * - saved type size : int
372
+ * - total size : int
373
+ *
374
+ */
375
+ mapping program_info(void | object);
376
+
377
+ /**
378
+ * pluralize - return plural form
379
+ *
380
+ * for english only!
381
+ *
382
+ * returns plural form:
383
+ * 'a red house' -> 'red houses'
384
+ * 'a sack of rice' -> 'sacks of rice'
385
+ *
386
+ */
387
+ string pluralize(string);
388
+
389
+ /**
390
+ * num_classes - returns the number of classes used by object
391
+ *
392
+ * returns the number of classes used by object
393
+ *
394
+ */
395
+ int num_classes(object);
396
+
397
+ /**
398
+ * network_stats
399
+ *
400
+ * returns mapping:
401
+ *
402
+ * - incoming packets total : int
403
+ * - incoming volume total : int
404
+ * - outgoing packets total : int
405
+ * - outgoing volume total : int
406
+ *
407
+ * - incoming packets port X : int
408
+ * - incoming volume port X : int
409
+ * - outgoing packets port X : int
410
+ * - outgoing volume port X : int
411
+ *
412
+ * #ifdef PACKAGE_SOCKETS:
413
+ *
414
+ * - incoming packets sockets : int
415
+ * - incoming volume sockets : int
416
+ * - outgoing packets sockets : int
417
+ * - outgoing volume sockets : int
418
+ *
419
+ */
420
+ mapping network_stats();
421
+
422
+ /**
423
+ * named_livings - return named livings
424
+ *
425
+ * returns all those livings [see efun::livings()] which have
426
+ * set_living_name and enable_command called #ifndef NO_ADD_ACTION
427
+ *
428
+ */
429
+ object *named_livings( void );
430
+
431
+ /**
432
+ * min() - searches for the minimum value inside an array
433
+ *
434
+ * Searches minimum value for (int|float|string) arrays. If flag is 0 or
435
+ * omitted the minimum value will be returned, otherwise the first index
436
+ * of its occurrence.
437
+ *
438
+ */
439
+ mixed min(mixed * arr);
440
+ mixed min(mixed * arr, int flag);
441
+
442
+ /**
443
+ * memory_summary()
444
+ *
445
+ * returns mapping:
446
+ * ([
447
+ * "prog1" : ([
448
+ * "var1" : mem_usage,
449
+ * ...
450
+ * ]),
451
+ * ...
452
+ * ])
453
+ *
454
+ */
455
+ mapping memory_summary();
456
+
457
+ /**
458
+ * max() - searches for the maximum value inside an array
459
+ *
460
+ * Searches maximum value for (int|float|string) arrays. If flag is 0 or
461
+ * omitted the maximum value will be returned, otherwise the first index
462
+ * of its occurrence.
463
+ *
464
+ */
465
+ mixed max(mixed * arr);
466
+ mixed max(mixed * arr, int flag);
467
+
468
+ /**
469
+ * is_daylight_savings_time
470
+ *
471
+ * returns 1 if given time in given timezone is within daylight saving region
472
+ * 0 if not
473
+ * -1 on error
474
+ *
475
+ */
476
+ int is_daylight_savings_time(string, int);
477
+
478
+ /**
479
+ * heart_beats - returns an array of all objects with enabled heartbeat
480
+ *
481
+ * returns an array of all objects with enabled heartbeat
482
+ *
483
+ */
484
+ object *heart_beats( void );
485
+
486
+ /**
487
+ * get_garbage() - get all clones without environments or inventories which are
488
+ not shadowing.
489
+ *
490
+ * returns array of all (up to **MAX_ARRAY_SIZE**) those cloned(!) objects which
491
+ * have neither environment nor inventory and aren't shadowing another object
492
+ * and haven't object->super set
493
+ *
494
+ */
495
+ object *get_garbage();
496
+
497
+ /**
498
+ * functions() - returns a string array of function names or mixed* array of
499
+ information for all functions in a passed object.
500
+ *
501
+ * Returns an array of strings containing the function names found in
502
+ * <ob>. The functions returned will include all functions, whether public,
503
+ * protected, or private. The <flag> parameter is by default zero.
504
+ *
505
+ * Flag: 0
506
+ * Returns: a string array containing function names, including all inherited
507
+ * functions.
508
+ * ({ "func1", "func2", "func3", "func4", ... })
509
+ *
510
+ * Flag: 1
511
+ * Returns: A two-dimensional array of mixed arrays containing additional
512
+ * information about each function, including all inherited functions.
513
+ *
514
+ * ({
515
+ * ({
516
+ * "func1", // function name
517
+ * 2, // number of parameters in function
518
+ * "int", // return type of function
519
+ * "object", // the first parameter
520
+ * "string *", // the second parameter
521
+ * }),
522
+ * ...
523
+ * })
524
+ *
525
+ * Flag: 2
526
+ * Like Flag 0, but excludes inherited functions.
527
+ *
528
+ * Flag: 3
529
+ * Like Flag 1, but excludes inherited functions.
530
+ *
531
+ * @param {object} ob - object to query
532
+ * @param {int} flag (optional) defaults to 0
533
+ */
534
+ mixed *functions(object ob, int flag);
535
+
536
+ /**
537
+ * function_owner - returns the object defining the given function
538
+ *
539
+ * returns the object defining the given function.
540
+ *
541
+ */
542
+ object function_owner(function);
543
+
544
+ /**
545
+ * file_length - return the line count of a file
546
+ *
547
+ * returns
548
+ *
549
+ * - line count
550
+ * - -1 in case of error (e.g insufficient privs)
551
+ * - -2 if file is directory
552
+ *
553
+ */
554
+ int file_length(string);
555
+
556
+ /**
557
+ * fetch_variable - fetch a value stored in an object's global variable
558
+ *
559
+ * This efun returns the value stored in the global variable `variable_name`
560
+ * in ob.
561
+ *
562
+ * `variable_name` is name of the global variable.
563
+ * `ob` defaults to this_object() if not specified.
564
+ *
565
+ * If `ob` is not specified, then `variable_name` can be any global variable
566
+ * in the inheritance hierarchy, regardless of scope. If `ob` is specified,
567
+ * then `variable_name` must be public scope.
568
+ *
569
+ * This is a potential security hazard and, therefore, you may wish to overload
570
+ * this function to perform security checks.
571
+ *
572
+ * int weight = fetch_variable( "weight", this_player() ) ;
573
+ * printf("%d\n", weight") ;
574
+ *
575
+ * // result: 150
576
+ *
577
+ */
578
+ mixed fetch_variable(string variable_name, void|object ob);
579
+
580
+ /**
581
+ * fetch_class_member() - return the value of a specified, indexed member of
582
+ an instantiated class.
583
+ *
584
+ * Given an <instantiated_class>, return the value of the <index>th
585
+ * member. This is particularly useful when you have an anonymous
586
+ * class with no labels for the data members.
587
+ *
588
+ * mixed me = assemble_class( ({ "Foo", 42, "Fooville" }) ) ;
589
+ * int age ;
590
+ * string name, city ;
591
+ *
592
+ * name = fetch_class_member( me, 0 ) ;
593
+ * age = fetch_class_member( me, 1 ) ;
594
+ * city = fetch_class_member( me, 2 ) ;
595
+ *
596
+ */
597
+ mixed fetch_class_member( mixed instantiated_class, int index );
598
+
599
+ /**
600
+ * event() - call event_* in other objects with specified parameters. similar
601
+ to call_other, but with no return type.
602
+ *
603
+ * Calls "event_" + event_name in target. "event_" + event_name must be a
604
+ * public function.
605
+ *
606
+ * Target can be a single object or an array of objects.
607
+ *
608
+ * If the target is a single object, the event efun will first call the event
609
+ * function in the object and then it will call the event function all of the
610
+ * objects in the target's all_inventory().
611
+ *
612
+ * If the target is an array of objects, the event efun will call the event
613
+ * function in all of the objects specified. Unlike the single-target version,
614
+ * it will not cascade to each of the object's inventories.
615
+ *
616
+ * The efun will pass as its first argument the calling object followed by
617
+ * all of the specified arguments.
618
+ *
619
+ * // In a room
620
+ *
621
+ * // will call event_heal_up on the room, and then every object in the room
622
+ * event( this_object(), "heal_up", 50, 50 ) ;
623
+ *
624
+ * // will call event_heal_up in the results of users() efun
625
+ * event( users(), "heal_up", 25, 25 ) ;
626
+ *
627
+ * // In a player object
628
+ *
629
+ * // To take advantage of this event, write an event_heal_up in the player
630
+ * // object to receive the call
631
+ * void event_heal_up(object source, int health, int mana)
632
+ * {
633
+ * message("heal", sprintf("You were healed %d health and %d mana by %O.\n", health, mana, source), this_object()) ;
634
+ * }
635
+ *
636
+ */
637
+ void event(object | object * target, string event_name, mixed *args...);
638
+
639
+ /**
640
+ * element_of() - returns random elememt of given array
641
+ *
642
+ * returns random elememt of given array
643
+ *
644
+ */
645
+ mixed element_of(mixed *arr);
646
+
647
+ /**
648
+ * disassemble_class() - given an instantiated class, returns a mixed* array
649
+ with elements comprised of the values of each member of the class.
650
+ *
651
+ * Given an <instantiated_class>, return a mixed array containing the
652
+ * values of all of the members.
653
+ *
654
+ * class person {
655
+ * string name ;
656
+ * int age ;
657
+ * string city ;
658
+ * }
659
+ *
660
+ * void fun()
661
+ * {
662
+ * mixed *result ;
663
+ * class person me = new(class person);
664
+ *
665
+ * me->name = "Foo" ;
666
+ * me->age = 42 ;
667
+ * me->city = "Fooville" ;
668
+ *
669
+ * result = disassemble_class( me ) ;
670
+ *
671
+ * write( sprintf("%O\n", result ) ) ;
672
+ *
673
+ * // ({ /* sizeof() == 3 *\/
674
+ * // "Foo",
675
+ * // 42,
676
+ * // "Fooville"
677
+ * // })
678
+ * }
679
+ *
680
+ */
681
+ mixed *disassemble_class( mixed instantiated_class );
682
+
683
+ /**
684
+ * debug_message() - logs a debug message
685
+ *
686
+ * Prints the given message on the <stderr> file desciptor of the driver
687
+ * and appends it to the debug log.
688
+ *
689
+ */
690
+ void debug_message(string msg);
691
+
692
+ /**
693
+ * mixed copy(mixed arg) - return a deep copy of an array, buffer, class, or
694
+ mapping
695
+ *
696
+ * arg is either one of:
697
+ *
698
+ * - array
699
+ * - buffer (if compiled into driver)
700
+ * - class
701
+ * - mapping
702
+ *
703
+ * returns deep copy
704
+ *
705
+ * This is particularly useful when you wish to have data that is passed
706
+ * by reference, but do not want to alter the original.
707
+ *
708
+ */
709
+ mixed copy(mixed arg);
710
+
711
+ /**
712
+ * compressedp() - returns if interactive connection uses telopt compress
713
+ *
714
+ * returns if interactive connection uses telopt compress
715
+ * #ifdef PACKAGE_COMPRESS
716
+ *
717
+ */
718
+ int compressedp(object ob);
719
+
720
+ /**
721
+ * classes() - return names of classes used by object
722
+ *
723
+ * Return a string array consisting of names of classes used by <ob>.
724
+ *
725
+ * The <verbose> parameter is optional and by default 0.
726
+ *
727
+ * If <verbose> is non-zero, then additional information will be
728
+ * returned.
729
+ *
730
+ * string *classes_used = classes( ob ) ;
731
+ * // ({ "class_name", }) ;
732
+ *
733
+ * mixed *classes_used = classes( ob, 1 ) ;
734
+ *
735
+ * // ({
736
+ * // ({
737
+ * // "class_name",
738
+ * // ({
739
+ * // "member_name",
740
+ * // "type"
741
+ * // }),
742
+ * // ...
743
+ * // }),
744
+ * // ...
745
+ * // })
746
+ *
747
+ */
748
+ mixed *classes(object ob, int verbose);
749
+
750
+ /**
751
+ * base_name - return the base name without object id (OID)
752
+ *
753
+ * In the first version, return the segment of the <text> up to, but
754
+ * not including the first occurrence of #.
755
+ *
756
+ * Like the first version, but performs file_name on <ob> first.
757
+ *
758
+ * Like the second version, but the object is this_object().
759
+ *
760
+ * string path = base_name( "/std/object#123" ) ; // "/std/object"
761
+ *
762
+ * object ob = new("/std/object) ;
763
+ * string path = base_name( ob ) ; // "/std/object"
764
+ *
765
+ * // in /std/object
766
+ * string path = base_name() ; // "/std/object"
767
+ *
768
+ */
769
+ string base_name(string text);
770
+ string base_name(object ob);
771
+ string base_name();
772
+
773
+ /**
774
+ * assemble_class() - provided an array, return a class composed of the members
775
+ of that array.
776
+ *
777
+ * Takes an array of <elements> and returns an instantiated class.
778
+ *
779
+ * mixed *elements = ({ "Foo", 42, "Fooville" }) ;
780
+ * mixed cl = assemble_class( elements ) ;
781
+ *
782
+ * write( sprintf( "%O\n", cl ) ) ;
783
+ *
784
+ * // CLASS( 3 elements
785
+ * // "Foo",
786
+ * // 42,
787
+ * // "Fooville"
788
+ * // )
789
+ *
790
+ */
791
+ mixed assemble_class( mixed *elements );
792
+
793
+ /**
794
+ * abs() - return the absolute value of a number
795
+ *
796
+ * Returns the absolute value of the supplied <number>.
797
+ *
798
+ * int value = abs( 10 ); // 10
799
+ * int value = abs( -10 ); // 10
800
+ * float value = abs( 3.14 ); // 3.140000
801
+ * float value = abs( -3.14 ); // 3.140000
802
+ *
803
+ */
804
+ mixed abs( int | float number );
805
+