@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,43 @@
1
+ // test_bit.md.h
2
+
3
+ /**
4
+ * test_bit
5
+ * set_bit() - set a bit in a bitstring
6
+ *
7
+ * Return 0 or 1 of bit 'n' was set in string 'str'.
8
+ *
9
+ */
10
+ int test_bit( string str, int n );
11
+
12
+ // test_load.md.h
13
+
14
+ /**
15
+ * test_load
16
+ * test_load - test if a file is loadable
17
+ *
18
+ * Tests if a file is loadable. Will return 1 if a file is loadable,
19
+ otherwise 0. If a file attempting to be loaded contains errors,
20
+ they will be reported, in which case, you may need to wrap the
21
+ function call in a catch statement to retrieve the 0 result.
22
+ *
23
+ */
24
+ int test_load( string filename );
25
+
26
+
27
+ /**
28
+ * set_notify_destruct() - et the object to be notified when it is destructed
29
+ * @param flag If the flag is set to 1, the object will
30
+ * receive a call to the function on_destruct() when it is destructed. If the
31
+ * flag is set to 0, the object will not receive this notification.
32
+ * @details
33
+ * Toggles a flag in an object that determines whether or not it will be
34
+ * notified when it is destructed. If the flag is set to 1, the object will
35
+ * receive a call to the function on_destruct() when it is destructed. If the
36
+ * flag is set to 0, the object will not receive this notification.
37
+ * Objects do not receive this notification by default. To receive the call to
38
+ * on_destruct(), the object must call set_notify_destruct(1) at some point
39
+ * during its lifetime.
40
+ * The set_notify_destruct() efun may only be called from within the object
41
+ * that would like to receive the notification.
42
+ */
43
+ void set_notify_destruct(int flag);
@@ -0,0 +1,228 @@
1
+ // mudlib.h
2
+
3
+ /**
4
+ * wizardp() - determines if a given object had enable_wizard() performed
5
+ in it
6
+ *
7
+ * Returns 1 if the arg had enable_wizard() performed on it.
8
+ *
9
+ */
10
+ int wizardp( object );
11
+
12
+ /**
13
+ * seteuid() - set the effective user id (euid) of an object
14
+ *
15
+ * Set effective uid to 'str'. valid_seteuid() in master.c controls which
16
+ * values the euid of an object may be set to.
17
+ *
18
+ * When this value is 0, then the current object's uid can be changed by
19
+ * export_uid(), and only then.
20
+ *
21
+ * But, when the value is 0, no objects can be loaded or cloned by this
22
+ * object.
23
+ *
24
+ */
25
+ int seteuid( string str );
26
+
27
+ /**
28
+ * set_privs() - set the privs string for an object
29
+ *
30
+ * Sets the privs string for 'ob' to 'privs'.
31
+ *
32
+ * This efun is only available if PRIVS is defined at driver compile time.
33
+ *
34
+ */
35
+ void set_privs( object ob, string privs );
36
+
37
+ /**
38
+ * set_living_name() - set a living name for a living object
39
+ *
40
+ * Set a living name on an object that is living. After this has been
41
+ * done, the object can be found with "find_living()".
42
+ *
43
+ */
44
+ void set_living_name( string name );
45
+
46
+ /**
47
+ * set_light() - update or query an object's light level
48
+ *
49
+ * Passing <light_level_adjustment> as 0 queries the object's current
50
+ * light level. A positive number will increase the light level, while a
51
+ * negative number will decrease the light level.
52
+ *
53
+ */
54
+ int set_light( int light_level_adjustment );
55
+
56
+ /**
57
+ * set_author - set the author associated with an object.
58
+ *
59
+ * Every object has both an author and a domain associated with it for the
60
+ * purposes of tracking statistics for authors and domains. Domains may
61
+ * only be set in the master object function domain_file(4), however
62
+ * authors are different. They can be initialized to some default value
63
+ * by author_file(4) in the master object, but can also be changed using
64
+ * the set_author efun.
65
+ *
66
+ * set_author changes the author of the object that it is called within.
67
+ * That author will get credit for all future actions of that object that
68
+ * affect mudlib statistics. Note that this may cause some weird numbers
69
+ * to occur in the categories "objects" and "array_size", since the object
70
+ * may have initialized arrays or been created under the original author's
71
+ * credit, but it could be destructed or free the arrays that it's using
72
+ * under another author, thus reducing numbers from a count that didn't
73
+ * have those same numbers added previously. To rememdy this, only use
74
+ * set_author within create(4), and use it before any arrays are allocated
75
+ * if at all possible.
76
+ *
77
+ */
78
+ void set_author( string author );
79
+
80
+ /**
81
+ * query_privs() - return the privs string for an object
82
+ *
83
+ * Returns the privs string for an object. The privs string is determined
84
+ * at compile time via a call to privs_file() in the master object, and
85
+ * changeable via the set_privs() efun.
86
+ *
87
+ * This efun is only available if PRIVS is defined at driver compile time.
88
+ *
89
+ */
90
+ varargs string query_privs( object ob );
91
+
92
+ /**
93
+ * livings() - return an array of all living objects
94
+ *
95
+ * Returns an array of pointers to all living objects (objects that have
96
+ * had enable_commands() called in them).
97
+ *
98
+ */
99
+ object *livings( void );
100
+
101
+ /**
102
+ * living() - detects whether or not a given object is "living"
103
+ *
104
+ * @returns true if `ob` is a living object (that is, if `enable_commands()` has been called by `ob`).
105
+ * @param ob - the object to check
106
+ */
107
+ varargs int living( object ob );
108
+
109
+ /**
110
+ * getuid() - return the user id (uid) of an object
111
+ *
112
+ * Returns the user id of an object. The uid of an object is determined
113
+ * at object creation by the creator_file() function.
114
+ *
115
+ */
116
+ string getuid( object ob );
117
+
118
+ /**
119
+ * geteuid() - return the effective user id of an object or function
120
+ *
121
+ * If given an object argument, geteuid returns the effective user id
122
+ * (euid) of the object. If given an argument of type 'function', it
123
+ * returns the euid of the object that created that 'function' variable.
124
+ * If the object, at the time of the function variable's construction, had
125
+ * no euid, the object's uid is stored instead.
126
+ *
127
+ */
128
+ string geteuid( object|function );
129
+
130
+ /**
131
+ * find_living() - find a living object matching a given id
132
+ *
133
+ * Find first the object that is marked as living, and answers to the id
134
+ * <str>. A living object is an object that has called enable_commands().
135
+ * The object must have set a name with set_living_name(), so its name
136
+ * will be entered into the hash table used to speed up the search for
137
+ * living objects.
138
+ *
139
+ */
140
+ object find_living( string str );
141
+
142
+ /**
143
+ * export_uid() - set the uid of another object
144
+ *
145
+ * Set the uid of <ob> to the effective uid of this_object(). It is only
146
+ * possible when <ob> has an effective uid of 0.
147
+ *
148
+ */
149
+ int export_uid( object ob );
150
+
151
+ /**
152
+ * enable_wizard() - give wizard priveleges to an object
153
+ *
154
+ *
155
+ *
156
+ */
157
+ void enable_wizard( void );
158
+
159
+ /**
160
+ * domain_stats() - returns statistics gathered on domains
161
+ *
162
+ * Both domain_stats() and author_stats() return information stored in a
163
+ * mapping. If no argument is specified, then information is returned on
164
+ * all domains (or on all authors) with one map entry per domain or
165
+ * author. If an argument is specified, then a map is returned that cor‐
166
+ * responds to that domain or author with keys: moves, cost, errors,
167
+ * heart_beats, worth, array_size, and objects. Each of these map to
168
+ * integer values. Moves is the number of objects that have moved into
169
+ * objects in the given domain. Cost is the number of evaluations
170
+ * (eval_cost) accumulated by objects with the given domain (or author).
171
+ * Errors is the number of errors incurred by objects with the given
172
+ * domain. Heart_beats is the number of heartbeat calls made on objects
173
+ * having the given domain. Worth is the value maintained by the
174
+ * add_worth(3) efunction (this is usually used to keep track of how much
175
+ * money a given wizard has given out vs. taken in). Array_size is the
176
+ * size (in bytes) of the arrays allocated by the domain. Objects is the
177
+ * number of objects created by the given domain. When called with no
178
+ * arguments, the returned mapping has a form like this:
179
+ *
180
+ * ([ domain0 : info0, domain1 : info1, ... ])
181
+ *
182
+ * while info0 has the form:
183
+ *
184
+ * ([ "moves" : moves, "cost" : cost, "errors" : errors,
185
+ * "heart_beats" : heart_beats, "worth" : worth,
186
+ * "array_size" : array_size, "objects" : objects ])
187
+ *
188
+ * When called with an argument, the returned mapping will have the form
189
+ * of info0.
190
+ *
191
+ */
192
+ mapping domain_stats( void|string domain );
193
+
194
+ /**
195
+ * author_stats() - returns statistics gathered on authors
196
+ *
197
+ * Both domain_stats() and author_stats() return information stored in a
198
+ * mapping. If no argument is specified, then information is returned on
199
+ * all domains (or on all authors) with one map entry per domain or
200
+ * author. If an argument is specified, then a map is returned that cor‐
201
+ * responds to that domain or author with keys: moves, cost, errors,
202
+ * heart_beats, worth, array_size, and objects. Each of these map to
203
+ * integer values. Moves is the number of objects that have moved into
204
+ * objects in the given domain. Cost is the number of evaluations
205
+ * (eval_cost) accumulated by objects with the given domain (or author).
206
+ * Errors is the number of errors incurred by objects with the given
207
+ * domain. Heart_beats is the number of heartbeat calls made on objects
208
+ * having the given domain. Worth is the value maintained by the
209
+ * add_worth(3) efunction (this is usually used to keep track of how much
210
+ * money a given wizard has given out vs. taken in). Array_size is the
211
+ * size (in bytes) of the arrays allocated by the domain. Objects is the
212
+ * number of objects created by the given domain. When called with no
213
+ * arguments, the returned mapping has a form like this:
214
+ *
215
+ * ([ domain0 : info0, domain1 : info1, ... ])
216
+ *
217
+ * while info0 has the form:
218
+ *
219
+ * ([ "moves" : moves, "cost" : cost, "errors" : errors,
220
+ * "heart_beats" : heart_beats, "worth" : worth,
221
+ * "array_size" : array_size, "objects" : objects ])
222
+ *
223
+ * When called with an argument, the returned mapping will have the form
224
+ * of info0.
225
+ *
226
+ */
227
+ mapping author_stats( void|string domain );
228
+
@@ -0,0 +1,41 @@
1
+ // numbers.h
2
+
3
+ /**
4
+ * to_float - convert an int to a float
5
+ *
6
+ * The to_float() call returns the number of type 'float' that is equiva‐
7
+ * lent to the int 'i'.
8
+ *
9
+ */
10
+ float to_float(int i);
11
+ float to_float(string i);
12
+
13
+ /**
14
+ * secure_random() - return a pseudo-random number, this should be
15
+ unpredictable, but maybe slightly slow.
16
+ *
17
+ * Return a cryptographically secure random number from the range [0 .. (n -1)] (inclusive).
18
+ *
19
+ * On Linux & OSX, this function explicitly use randomness from /dev/urandom,
20
+ * on windows it is implementation defined.
21
+ *
22
+ */
23
+ int secure_random( int n );
24
+
25
+ /**
26
+ * random() - return a pseudo-random number, this is suitable for general
27
+ simulation, but may be predictable.
28
+ *
29
+ * Return a pseudo-random number from the range [0 .. (n -1)] (inclusive).
30
+ *
31
+ */
32
+ int random( int n );
33
+
34
+ /**
35
+ * intp() - determine whether or not a given variable is an integer
36
+ *
37
+ * Return 1 if 'arg' is an integer number and zero (0) otherwise.
38
+ *
39
+ */
40
+ int intp( mixed arg );
41
+
@@ -0,0 +1,365 @@
1
+ // objects.h
2
+
3
+ /**
4
+ * virtualp() - determine whether a given variable points to a virtual object
5
+ *
6
+ * @returns true (1) if the argument is objectp() and the O_VIRTUAL flag is
7
+ * set. The driver sets the O_VIRTUAL flag for those objects created via
8
+ * the 'compile_object' method in master.c.
9
+ *
10
+ */
11
+ varargs int virtualp( object arg );
12
+
13
+ /**
14
+ *
15
+ *
16
+ * Send a message 'str' to object all objects in the room 'ob'. 'ob' can
17
+ * also be the filename of the room (string). If 'exclude' is specified,
18
+ * all objects in the exclude array will not receive the message.
19
+ *
20
+ */
21
+ void tell_room( mixed ob, string str, object *exclude );
22
+
23
+ /**
24
+ * tell_object() - send a message to an object
25
+ *
26
+ * Send a message 'str' to object 'ob'. If it is an interactive object (a
27
+ * player), then the message will go to him, otherwise it will go to the
28
+ * local function "catch_tell()".
29
+ *
30
+ */
31
+ void tell_object( object ob, string str );
32
+
33
+ /**
34
+ * set_hide() - set the hide flag on a hidable object
35
+ *
36
+ * Sets the hidden flag of an object to 'flag', which should be 0 or 1
37
+ * (hide disable, or hide enable, respectively). Only objects for which
38
+ * 'master()->valid_hide(ob)' returns true may make themselves hidden.
39
+ * When the object is hidden, only other hidable objects will be able to
40
+ * find the object with find_object(), or multiple-object returning efuns
41
+ * such as users(), children(), all_inventory(), etc.
42
+ *
43
+ */
44
+ void set_hide( int flag );
45
+
46
+ /**
47
+ * set_heart_beat() - enable or disable an object's heartbeat
48
+ *
49
+ * Passing 'flag' as 0 disables the object's heart beat. Passing a 'flag'
50
+ * of 1 will cause heart_beat() to be called in the object once each heart
51
+ * beat (a variable number defined by your local administrator, usually 2
52
+ * seconds). Passing a 'flag' of greater than 1 will usually set the num‐
53
+ * ber of heart beats inbetween calls to heart_beat(), however your local
54
+ * administrator may have the system configured to treat any 'flag' above
55
+ * 1 as 1.
56
+ *
57
+ */
58
+ int set_heart_beat( int flag );
59
+
60
+ /**
61
+ * save_object() - save the values of variables in an object into a file
62
+ *
63
+ * Save all values of non-static variables in this object in the file
64
+ * 'name'. valid_write() in the master object determines whether this is
65
+ * allowed. The optional second argument is a bitfield: If bit 0 is 1,
66
+ * then variables that are zero (0) are also saved (normally, they
67
+ * aren't). Object variables always save as 0. If bit 1 is 1, then the
68
+ * save file will be compressed.
69
+ *
70
+ */
71
+ varargs int save_object( string name, int flag );
72
+
73
+ /**
74
+ * restore_object() - restore values of variables from a file into an
75
+ object
76
+ *
77
+ * Restore values of variables for current object from file 'name'. If the
78
+ * optional second argument is 1, then all of the non-static variables are
79
+ * not zeroed out prior to restore (normally, they are).
80
+ *
81
+ * In the case of an error, the affected variable will be left untouched
82
+ * and an error given.
83
+ *
84
+ */
85
+ varargs int restore_object( string name, int flag );
86
+
87
+ /**
88
+ * reload_object() - return an object to its just-loaded state
89
+ *
90
+ * When reload_object() is called on 'ob', all the driver-maintained prop‐
91
+ * erties are re-initialized (heart_beat, call_outs, light, shadows, etc),
92
+ * all variables are re-initialized, and create() is called. It has a
93
+ * similar effect to destructing/reloading the object, however, no disk
94
+ * access or parsing is performed.
95
+ *
96
+ */
97
+ void reload_object( object ob );
98
+
99
+ /**
100
+ * query_heart_beat() - query the status of an object's heartbeat
101
+ *
102
+ * Returns the value with which set_heart_beat() has been called with on
103
+ * 'object'. If object is not given, it defaults to the current object.
104
+ * If the object has no heart beat, 0 will be returned.
105
+ *
106
+ * If no object is supplied, this efun will default to this_object().
107
+ *
108
+ */
109
+ varargs int query_heart_beat( object );
110
+
111
+ /**
112
+ * present() - find an object by id
113
+ *
114
+ * if first argument is string, second argument is missing, searches for
115
+ * a object in the object's environment using the id() apply where it answers 1
116
+ * to indicate a match.
117
+ *
118
+ * if first argument is string, second argument is object, only searches
119
+ * for target in that object's inventory using the same strategy as above.
120
+ *
121
+ * "foo 1" means the first "foo" in the inventory. the first in the
122
+ * inventory is the last object that moved in.
123
+ *
124
+ * if first argument is object, second argument is missing, check if
125
+ * object is in this object's inventory, or as a sibling in this object's
126
+ * environment's inventory, returns object's parent.
127
+ *
128
+ * if first argument is object, second argument is object, check if
129
+ * object1 is in object2 inventory, return object1 if true.
130
+ *
131
+ * If object is hidden (via set_hide()), and current object is not hid‐
132
+ * able. returns 0
133
+ *
134
+ */
135
+ varargs object present( mixed str, object ob );
136
+
137
+ /**
138
+ * objects - return an array of all loaded objects
139
+ *
140
+ * An array of every object loaded on the mud is returned by objects().
141
+ * Note that if the system's maximum array size is set too low, objects()
142
+ * will truncate its array, in which case it might not be too useful.
143
+ *
144
+ * If the optional 'func' parameter is given, then func() in this_object()
145
+ * is called with each loaded object as an argument. If the function
146
+ * returns nonzero, then that object is returned by objects(), otherwise
147
+ * it isn't.
148
+ *
149
+ * If 'f' is given, it will be called on all the objects as above. For
150
+ * example, objects( (: clonep :) ) returns a list of all the clones in
151
+ * existence.
152
+ *
153
+ */
154
+ object *objects( void | string | function func );
155
+
156
+ /**
157
+ * objectp() - determine whether or not a given variable is an object
158
+ *
159
+ * @returns {arg is object} 1 if 'arg' is an object.
160
+ *
161
+ */
162
+ int objectp( mixed arg );
163
+
164
+ /**
165
+ * next_inventory() - return the next object in the same inventory
166
+ *
167
+ * Return the next object in the same inventory as 'ob'.
168
+ *
169
+ * Warning: If the object 'ob' is moved by "move_object()", then
170
+ * "next_inventory()" will return an object from the new inventory.
171
+ *
172
+ */
173
+ object next_inventory( object ob );
174
+
175
+ /**
176
+ * new() - load a new copy of an object/class
177
+ *
178
+ * Clones a new object from `filename`, and give it a new unique name. Returns
179
+ * the new object. Optionally, additional arguments may be passed to new()
180
+ * which will be passed to the 'create()' apply in the new object.
181
+ *
182
+ * If the first argument is a class, then a new copy of the class is created
183
+ * and returned. Optionally, additional parameters may be passed to new()
184
+ * which will be used to initialize values in the returned class. If you are
185
+ * passing arguments to the class, you must specify the member name and the
186
+ * value of the members you would like to initialize.
187
+ *
188
+ * ### Object example:
189
+ * ```lpc
190
+ * object ob = new("/obj/torch") ; // clone a torch object
191
+ * object money = new("/obj/money", 10, "dollars" ) ; // clone a money object and set initial values
192
+ * ```
193
+ *
194
+ * ### Class example:
195
+ * ```lpc
196
+ * class ClassPerson {
197
+ * string name ;
198
+ * int age ;
199
+ * }
200
+ *
201
+ * class ClassPerson person = new(class ClassPerson) ;
202
+ * person.name = "Bob" ;
203
+ * person.age = 42 ;
204
+ * // or
205
+ * class ClassPerson person = new(class ClassPerson, name: "Bob", age: 42) ;
206
+ * ```
207
+ */
208
+ varargs object new(string filename, mixed args...);
209
+ varargs class ClassName new(class ClassName, mixed args... ) ;
210
+
211
+ /**
212
+ * move_object() - move current object to another environment
213
+ *
214
+ * Move the current object into the object `dest'. dest should either be
215
+ * a filename or an object.
216
+ *
217
+ */
218
+ void move_object( mixed dest );
219
+
220
+ /**
221
+ * master() - returns the master object
222
+ *
223
+ * Returns a pointer to the master object.
224
+ * @returns {__LPC_CONFIG_LIBFILES_MASTER}
225
+ */
226
+ object master( void );
227
+
228
+ /**
229
+ * load_object() - find or load an object by file name
230
+ *
231
+ * Find the object with the file name 'str'. If the file exists and the
232
+ * object hasn't been loaded yet, it is loaded and returned (if possible).
233
+ *
234
+ */
235
+ object load_object( string str );
236
+
237
+ /**
238
+ * first_inventory() - return the first item in an object's inventory
239
+ *
240
+ * Return the first object in the inventory of <ob>, where <ob> is either
241
+ * an object or the file name of an object.
242
+ *
243
+ * If no object is supplied, this efun will default to this_object().
244
+ *
245
+ */
246
+ object first_inventory( mixed ob );
247
+
248
+ /**
249
+ * find_object() - find an object by file name
250
+ *
251
+ * Find the object with the file name 'str', which can reference a cloned
252
+ * object by using the file name format returned by file_name().
253
+ *
254
+ * If 'flag' is 1, find_object() will behave like load_object().
255
+ *
256
+ */
257
+ object find_object( string str, void | int flag );
258
+
259
+ /**
260
+ * file_name() - get the file name of an object
261
+ *
262
+ * file_name() returns the name of the file from which <ob> was loaded.
263
+ * If the object is a cloned object, then file_name() will not be an
264
+ * actual file on disk, but will be the name of the file from which the
265
+ * object was originally cloned, appended with an octothorpe (#) and the
266
+ * object instance number. Object instance numbers start at 0 when the
267
+ * game is booted, and increase by one for each object cloned, hence the
268
+ * number is unique for each cloned object. <ob> defaults to
269
+ * this_object() if not specified.
270
+ *
271
+ */
272
+ varargs string file_name( object ob );
273
+
274
+ /**
275
+ * environment() - return the environment of an object
276
+ *
277
+ * Return the containing object (environment) of <ob>. If no argument is
278
+ * given, <ob> defaults to this_object().
279
+ *
280
+ */
281
+ varargs object environment( object ob );
282
+
283
+ /**
284
+ * destruct() - remove an object from the games
285
+ *
286
+ * Completely destroy and remove object 'ob'. After the call to
287
+ * destruct(), no global variables will exist any longer, only locals, and
288
+ * arguments. If 'ob' is this_object(), execution will continue, but it
289
+ * is best to return a value immediately.
290
+ *
291
+ * If no object is supplied, this efun will default to this_object().
292
+ *
293
+ */
294
+ varargs void destruct( object ob );
295
+
296
+ /**
297
+ * deep_inventory() - return the nested inventory of an object
298
+ *
299
+ * Returns an array of the objects contained in the inventory of <ob> and
300
+ * all the objects contained in the inventories of those objects and so
301
+ * on.
302
+ *
303
+ * If no object is supplied, this efun will default to this_object().
304
+ *
305
+ */
306
+ varargs object *deep_inventory( object ob );
307
+
308
+ /**
309
+ * clonep() - determine whether or not a given variable points to a cloned
310
+ object
311
+ *
312
+ * Returns true (1) iff the argument is objectp() and the O_CLONE flag is
313
+ * set. The driver sets the O_CLONE flag for those objects created via
314
+ * new(3) (clone_object(3)). The clonep() efun will not return true when
315
+ * called on objects that are the master copy (those that are loaded via
316
+ * call_other(3)). Note that if clonep() returns true, then file_name()
317
+ * will return a string containing a '#'. clonep() defaults to
318
+ * this_object().
319
+ *
320
+ */
321
+ int clonep( void | mixed arg );
322
+
323
+ /**
324
+ * clone_object() - load a copy of an object
325
+ *
326
+ * Load a new object from definition <name>, and give it a new unique
327
+ * name. Returns the new object. An object with a nonzero environment()
328
+ * cannot be cloned. Optionally, additional arguments may be passed to
329
+ * clone_object() which will be passed to 'create()' in the new object.
330
+ *
331
+ * object ob = clone_object("/obj/torch") ; // clone a torch object
332
+ * object money = clone_object("/obj/money", 10, "dollars" ) ; // clone a money object and set initial values
333
+ *
334
+ */
335
+ object clone_object( string name, mixed args... );
336
+
337
+ /**
338
+ * children() - returns an array of objects cloned from a given object.
339
+ *
340
+ * This efunction returns an array of objects that have been cloned from
341
+ * the file named by 'name', as well as the object 'name' itself, if
342
+ * loaded. An example use of children() is to find all objects that have
343
+ * been cloned from the user object:
344
+ *
345
+ * ```
346
+ * object *list;
347
+ *
348
+ * list = children("/obj/user");
349
+ * ```
350
+ * This lets you find all users (both netdead and interactive whereas
351
+ * users() only reports interactive users).
352
+ *
353
+ */
354
+ object *children( string name );
355
+
356
+ /**
357
+ * all_inventory() - return the inventory of an object
358
+ *
359
+ * Returns an array of the objects contained in the inventory of <ob>.
360
+ *
361
+ * If ob is not passed, this parameter defaults to this_object().
362
+ *
363
+ */
364
+ varargs object *all_inventory( object ob );
365
+