@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,104 @@
1
+ // functions.h
2
+
3
+ /**
4
+ * functionp() - determine whether or not a given variable is a function pointer, and if so what kind
5
+ * @param arg - The variable to check
6
+ * @returns {arg is function} 1 if arg is a function pointer, 0 otherwise
7
+ *
8
+ * Return nonzero if 'arg' is a function pointer and zero (0) otherwise.
9
+ * Function pointers are variables of type 'function' as indicated in the
10
+ * documentation for the type 'function', for example:
11
+ * ```c
12
+ * f = (: obj, func :);
13
+ * ```
14
+ * The return value indicates the type of function pointer using the val‐
15
+ * ues given in the driver include file "include/function.h".
16
+ *
17
+ * function pointer type value
18
+ * --------------------- -----
19
+ * call_other FP_CALL_OTHER
20
+ * lfun FP_LOCAL
21
+ * efun FP_EFUN
22
+ * simul_efun FP_SIMUL
23
+ * functional FP_FUNCTIONAL
24
+ *
25
+ * In addition, the following values will be added in some cases:
26
+ * FP_HAS_ARGUMENTS arguments provided
27
+ * FP_OWNER_DESTED creator has been dested
28
+ * FP_NOT_BINDABLE not rebindable)
29
+ *
30
+ * The last set of values are bit values and can be tested with bit opera‐
31
+ * tions. The value FP_MASK is provided for ignoring the bit values and
32
+ * testing the basic type of the function pointer.
33
+ *
34
+ * Examples:
35
+ *
36
+ * To test if a function variable is an efun pointer:
37
+ * ```c
38
+ * if ((functionp(f) & FP_MASK) == FP_EFUN) ...
39
+ * ```
40
+ * to test if it has args:
41
+ * ```c
42
+ * if (functionp(f) & FP_HAS_ARGUMENTS) ...
43
+ * ```
44
+ */
45
+ int functionp( mixed arg );
46
+
47
+ /**
48
+ * evaluate() - evaluate a function pointer
49
+ *
50
+ * If f is a function, f is called with the rest of the arguments. Other‐
51
+ * wise, f is returned. evaluate(f, ...) is the same as (*f)(...).
52
+ *
53
+ */
54
+ mixed evaluate(mixed f... );
55
+
56
+ /**
57
+ * defer() - execute function after current function ends
58
+ *
59
+ * Call function pointer *f when current function ends (even if it
60
+ * was due to a runtime error).
61
+ *
62
+ * For example:
63
+ *
64
+ * void create()
65
+ * {
66
+ * ::create();
67
+ *
68
+ * defer( (: enable_commands :) );
69
+ * }
70
+ *
71
+ * The effect the defer() function has is it will cause the
72
+ * enable_commands() efun to be called after the execution of the
73
+ * create() function ends. The argument passed to defer() can be
74
+ * any function type.
75
+ *
76
+ */
77
+ void defer(function f);
78
+
79
+ /**
80
+ * bind() - change the owner of a function pointer
81
+ *
82
+ * Returns a function pointer that is exactly the same as f, but belongs
83
+ * to the object 'ob' instead of the object that created f. Useful if the
84
+ * creator of 'f' has been destructed, or f is an efun pointer to an efun
85
+ * which does something to 'this_object'.
86
+ *
87
+ * For example:
88
+ *
89
+ * void make_living(object ob) {
90
+ * function f;
91
+ *
92
+ * f = bind( (: enable_commands :), ob );
93
+ *
94
+ * evaluate(f); }
95
+ *
96
+ * The effect of the above is the same as if 'ob' itself had evaluated the
97
+ * enable_commands() efun. Note that there are security risks involved in
98
+ * this, as bind() allows you to force another object to run a piece of
99
+ * code. To protect against this, there is a valid_bind() master apply
100
+ * which must return 1 or the call to bind() will fail.
101
+ *
102
+ */
103
+ function bind(function f, object ob);
104
+
@@ -0,0 +1,548 @@
1
+ // general.h
2
+
3
+ /**
4
+ * undefinedp() - determine whether or not a given variable is undefined.
5
+ *
6
+ * Return 1 if 'arg' is undefined. 'arg' will be undefined in the follow‐
7
+ * ing cases:
8
+ *
9
+ * 1. it is a variable set equal to the return value of a call_other to a
10
+ * non-existent method (e.g. arg = call_other(obj, "???")).
11
+ *
12
+ * 2. it is a variable set equal to the return value of an access of an
13
+ * element in a mapping that doesn't exist (e.g. arg =
14
+ * map[not_there]).
15
+ *
16
+ */
17
+ int undefinedp( mixed arg );
18
+
19
+ /**
20
+ * uncompress_file
21
+ *
22
+ * TBW
23
+ *
24
+ */
25
+ int uncompress_file(string, string);
26
+
27
+ /**
28
+ * uncompress
29
+ *
30
+ * TBW
31
+ *
32
+ */
33
+ buffer uncompress(string | buffer);
34
+
35
+ /**
36
+ * typeof() - return the type of an expression
37
+ *
38
+ * Return the type of an expression. The return values are given in
39
+ * <type.h>. They are:
40
+ *
41
+ * T_INT "int"
42
+ * T_STRING "string"
43
+ * T_ARRAY "array"
44
+ * T_OBJECT "object"
45
+ * T_MAPPING "mapping"
46
+ * T_FUNCTION "function"
47
+ * T_FLOAT "float"
48
+ * T_BUFFER "buffer"
49
+ * T_CLASS "class"
50
+ *
51
+ * T_INVALID "*invalid*"
52
+ * T_LVALUE "*lvalue*"
53
+ * T_LVALUE_BYTE "*lvalue_byte*"
54
+ * T_LVALUE_RANGE "*lvalue_range*"
55
+ * T_LVALUE_CODEPOINT "*lvalue_codepoint*"
56
+ * T_ERROR_HANDLER "*error_handler*"
57
+ * T_FREED "*freed*"
58
+ * T_UNKNOWN "*unknown*"
59
+ *
60
+ */
61
+ string typeof( mixed var );
62
+
63
+ /**
64
+ * translate
65
+ *
66
+ * TBW
67
+ *
68
+ */
69
+ float * translate(float *, float, float, float);
70
+
71
+ /**
72
+ * start_request_term_type
73
+ *
74
+ * TBW
75
+ *
76
+ */
77
+ void start_request_term_type();
78
+
79
+ /**
80
+ * sizeof() - return the number of elements in an array, mapping, buffer
81
+ or string
82
+ *
83
+ * Return the number of elements in an array, mapping, string or buffer
84
+ * 'var'. If 'var' is not an array, mapping, string, or buffer, then zero
85
+ * (0) is returned.
86
+ *
87
+ */
88
+ int sizeof( mixed var );
89
+
90
+ /**
91
+ * shallow_inherit_list
92
+ *
93
+ * TBW
94
+ *
95
+ */
96
+ string * shallow_inherit_list(object);
97
+
98
+ /**
99
+ * send_zmp
100
+ *
101
+ * TBW
102
+ *
103
+ */
104
+ void send_zmp(string, string *);
105
+
106
+ /**
107
+ * scale
108
+ *
109
+ * TBW
110
+ *
111
+ */
112
+ float * scale(float *, float, float, float);
113
+
114
+ /**
115
+ * save_variable() - save the value of variable into a string
116
+ *
117
+ * Saves the value of a variable to a string. The format is the same as
118
+ * save/restore_object.
119
+ *
120
+ */
121
+ string save_variable( mixed var );
122
+
123
+ /**
124
+ * rotate_z
125
+ *
126
+ * TBW
127
+ *
128
+ */
129
+ float * rotate_z(float *, float);
130
+
131
+ /**
132
+ * rotate_y
133
+ *
134
+ * TBW
135
+ *
136
+ */
137
+ float * rotate_y(float *, float);
138
+
139
+ /**
140
+ * rotate_x
141
+ *
142
+ * TBW
143
+ *
144
+ */
145
+ float * rotate_x(float *, float);
146
+
147
+ /**
148
+ * restore_variable() - restore value of a variable from a string
149
+ *
150
+ * Restore values of a variable from a string. The format used is the
151
+ * same format as save/restore_object.
152
+ *
153
+ */
154
+ mixed restore_variable( string value );
155
+
156
+ /**
157
+ * request_term_type
158
+ *
159
+ * TBW
160
+ *
161
+ */
162
+ void request_term_type();
163
+
164
+ /**
165
+ * request_term_size
166
+ *
167
+ * TBW
168
+ *
169
+ */
170
+ void request_term_size(int);
171
+
172
+ /**
173
+ * parse_remove
174
+ *
175
+ * TBW
176
+ *
177
+ */
178
+ void parse_remove(string);
179
+
180
+ /**
181
+ * parse_my_rules
182
+ *
183
+ * TBW
184
+ *
185
+ */
186
+ mixed parse_my_rules(object, string, int);
187
+
188
+ /**
189
+ * parse_dump
190
+ *
191
+ * TBW
192
+ *
193
+ */
194
+ string parse_dump();
195
+
196
+ /**
197
+ * parse_add_synonym
198
+ *
199
+ * TBW
200
+ *
201
+ */
202
+ void parse_add_synonym(string, string, string);
203
+
204
+ /**
205
+ * nullp() - determine whether or not a given variable is null.
206
+ *
207
+ * Return 1 if 'arg' is null. 'arg' will be null in the following cases:
208
+ *
209
+ * 1. it has not yet been initialized.
210
+ *
211
+ * 2. it points to a destructed object.
212
+ *
213
+ * 3. it is a function (formal) parameter that corresponds to a missing
214
+ * actual argument.
215
+ * @template T
216
+ * @param {T} arg - The variable to check
217
+ * @returns {arg is 0} - 1 if the variable is null, 0 otherwise
218
+ */
219
+ int nullp(mixed arg);
220
+
221
+ /**
222
+ * norm
223
+ *
224
+ * TBW
225
+ *
226
+ */
227
+ float norm(int * | float *);
228
+
229
+ /**
230
+ * next_bit
231
+ *
232
+ * TBW
233
+ *
234
+ */
235
+ int next_bit(string, int);
236
+
237
+ /**
238
+ * map() - modify an mapping, array, or string via application of a function
239
+ *
240
+ * If the first argument is a mapping, map() behaves exactly like map_map‐
241
+ * ping(). If it is an array, map() behaves exactly like map_array(). If
242
+ * it's argument is a string, map() passes each character (as an int) to
243
+ * the function, and replaces the character with the return value if the
244
+ * return value is a non-zero integer.
245
+ */
246
+ varargs mapping map( mapping x, string fun, object ob, mixed extra... );
247
+ varargs mapping map( mapping x, function f, mixed extra... );
248
+ varargs string map( string x, string fun, object ob, mixed extra... );
249
+ varargs string map( string x, function f, mixed extra... );
250
+ varargs mixed* map( mixed* x, string fun, object ob, mixed extra... );
251
+
252
+ /**
253
+ * @template T, Y
254
+ * @callback mapCallback
255
+ * @param {T} element The element to map
256
+ * @returns {Y} The map callback return value
257
+ */
258
+
259
+ /**
260
+ * map() - modify an array via application of a function
261
+ *
262
+ * If the first argument is a mapping, map() behaves exactly like map_map‐
263
+ * ping(). If it is an array, map() behaves exactly like map_array(). If
264
+ * it's argument is a string, map() passes each character (as an int) to
265
+ * the function, and replaces the character with the return value if the
266
+ * return value is a non-zero integer.
267
+ * @template T
268
+ * @template Y
269
+ * @param {T*} x The array to map
270
+ * @param {mapCallback<T,Y>} f The callback function to apply to each element
271
+ * @param extra Extra arguments to pass to the callback function
272
+ * @returns {Y*} An array of the mapped values
273
+ */
274
+ varargs mixed* map( mixed* x, function f, mixed extra... );
275
+
276
+
277
+ /**
278
+ * lookat_rotate2
279
+ *
280
+ * TBW
281
+ *
282
+ */
283
+ float * lookat_rotate2(float *, float, float, float, float, float, float);
284
+
285
+ /**
286
+ * lookat_rotate
287
+ *
288
+ * TBW
289
+ *
290
+ */
291
+ float * lookat_rotate(float *, float, float, float);
292
+
293
+ /**
294
+ * log2
295
+ *
296
+ * TBW
297
+ *
298
+ */
299
+ float log2(float | int);
300
+
301
+ /**
302
+ * log10
303
+ *
304
+ * TBW
305
+ *
306
+ */
307
+ float log10(float | int);
308
+
309
+ /**
310
+ * id_matrix
311
+ *
312
+ * TBW
313
+ *
314
+ */
315
+ float * id_matrix();
316
+
317
+ /**
318
+ * filter
319
+ *
320
+ * Returns a new string, array or mapping with the same elements as 'source'
321
+ * whose elements pass the test implemented by the filter function.
322
+ *
323
+ * A string is considered an array of integers, so the filter function is
324
+ * called with the integer value of each character in the string.
325
+ *
326
+ * The filter function must accept at least one argument, the element to be
327
+ * tested and return a truthy value if the element should be included in the
328
+ * result, or a falsy value if it should be excluded.
329
+ *
330
+ * In the case of a mapping, filter will pass the key and value to the filter
331
+ * function.
332
+ *
333
+ * Any additional arguments given to filter() will be passed to the filter
334
+ * function after the required arguments.
335
+ *
336
+ * If the first syntax is used, the filter function is performed as a
337
+ * call_other. If ob is a string, it is assumed to be the filename of an
338
+ * object to load and call the filter function on.
339
+ * @template {string|mapping|mixed*} T
340
+ * @param {T} source - The source to filter
341
+ * @returns {T} - The filtered source
342
+ */
343
+ mixed filter(string|mapping|mixed* source,
344
+ string filter_function,
345
+ object|string ob,
346
+ mixed *extra...);
347
+
348
+ /**
349
+ * @template T
350
+ * @callback filterCallback
351
+ * @param {T} element The element to map
352
+ * @returns The map callback return value
353
+ */
354
+ /**
355
+ * filter
356
+ *
357
+ * Returns a new string, array or mapping with the same elements as 'source'
358
+ * whose elements pass the test implemented by the filter function.
359
+ *
360
+ * A string is considered an array of integers, so the filter function is
361
+ * called with the integer value of each character in the string.
362
+ *
363
+ * The filter function must accept at least one argument, the element to be
364
+ * tested and return a truthy value if the element should be included in the
365
+ * result, or a falsy value if it should be excluded.
366
+ *
367
+ * In the case of a mapping, filter will pass the key and value to the filter
368
+ * function.
369
+ *
370
+ * Any additional arguments given to filter() will be passed to the filter
371
+ * function after the required arguments.
372
+ *
373
+ * If the first syntax is used, the filter function is performed as a
374
+ * call_other. If ob is a string, it is assumed to be the filename of an
375
+ * object to load and call the filter function on.
376
+ * @template {string|mapping} T - string, mapping, or array
377
+ * @param {T} source - The source to filter
378
+ * @returns {T} - The filtered source
379
+ */
380
+ string|mapping filter(string|mapping source, function f, mixed *extra... );
381
+
382
+ /**
383
+ * filter
384
+ *
385
+ * Returns an array with the same elements as 'source'
386
+ * whose elements pass the test implemented by the filter function.
387
+ *
388
+ * The filter function must accept at least one argument, the element to be
389
+ * tested and return a truthy value if the element should be included in the
390
+ * result, or a falsy value if it should be excluded.
391
+ *
392
+ * Any additional arguments given to filter() will be passed to the filter
393
+ * function after the required arguments.
394
+ *
395
+ * If the first syntax is used, the filter function is performed as a
396
+ * call_other. If ob is a string, it is assumed to be the filename of an
397
+ * object to load and call the filter function on.
398
+ * @template T - string, mapping, or array
399
+ * @param {T*} source - The source to filter
400
+ * @param {filterCallback<T>} f - The filter function
401
+ * @returns {T*} - The filtered source
402
+ */
403
+ mixed* filter(mixed* source, function f, mixed *extra... );
404
+
405
+ /**
406
+ * explode_reversible
407
+ *
408
+ * TBW
409
+ *
410
+ */
411
+ string * explode_reversible(string, string);
412
+
413
+ /**
414
+ * dump_trace
415
+ *
416
+ * TBW
417
+ *
418
+ */
419
+ mixed * dump_trace();
420
+
421
+ /**
422
+ * dump_stralloc
423
+ *
424
+ * TBW
425
+ *
426
+ */
427
+ string dump_stralloc(string);
428
+
429
+ /**
430
+ * dump_jemalloc
431
+ *
432
+ * TBW
433
+ *
434
+ */
435
+ void dump_jemalloc();
436
+
437
+ /**
438
+ * dotprod
439
+ *
440
+ * TBW
441
+ *
442
+ */
443
+ float dotprod(int * | float *, int * | float *);
444
+
445
+ /**
446
+ * distance
447
+ *
448
+ * TBW
449
+ *
450
+ */
451
+ float distance(int * | float *, int * | float *);
452
+
453
+ /**
454
+ * destructed_objects
455
+ *
456
+ * TBW
457
+ *
458
+ */
459
+ mixed * destructed_objects();
460
+
461
+ /**
462
+ * compress_file
463
+ *
464
+ * TBW
465
+ *
466
+ */
467
+ int compress_file(string, string);
468
+
469
+ /**
470
+ * compress
471
+ *
472
+ * TBW
473
+ *
474
+ */
475
+ buffer compress(string | buffer);
476
+
477
+ /**
478
+ * clear_debug_level
479
+ *
480
+ * This efun will toggle off the debug level for the specified option. The
481
+ * options are the same as for set_debug_level() when using a string.
482
+ *
483
+ * call_out
484
+ * d_flag
485
+ * connections
486
+ * mapping
487
+ * sockets
488
+ * comp_func_tab
489
+ * LPC
490
+ * LPC_line
491
+ * event
492
+ * dns
493
+ * file
494
+ * add_action
495
+ * telnet
496
+ * websocket
497
+ *
498
+ * clear_debug_level("call_out");
499
+ *
500
+ */
501
+ void clear_debug_level(string);
502
+
503
+ /**
504
+ * classp
505
+ *
506
+ * Will return if the item `arg` is a class or not. If `arg` is a class,
507
+ * then the function will return 1, otherwise it will return 0.
508
+ *
509
+ * class Person {
510
+ * string name;
511
+ * int age;
512
+ * }
513
+ *
514
+ * void runit() {
515
+ * class Person p = new(class Person, name: "Bob", age: 42);
516
+ *
517
+ * printf("classp(p) = %d", classp(p)); // 1
518
+ * printf("classp(0) = %d", classp(0)); // 0
519
+ * printf("classp(this_object()) = %d", classp(this_object())); // 0
520
+ * }
521
+ *
522
+ */
523
+ int classp(mixed arg);
524
+
525
+ /**
526
+ * check_memory
527
+ *
528
+ * TBW
529
+ *
530
+ */
531
+ string check_memory(int);
532
+
533
+ /**
534
+ * angle
535
+ *
536
+ * TBW
537
+ *
538
+ */
539
+ float angle(int * | float *, int * | float *);
540
+
541
+ /**
542
+ * act_mxp
543
+ *
544
+ * TBW
545
+ *
546
+ */
547
+ void act_mxp();
548
+