@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,125 @@
1
+ // db.h
2
+
3
+ /**
4
+ * db_status() - return package status
5
+ *
6
+ * Returns a string describing the current status of the database package.
7
+ *
8
+ */
9
+ string db_status( void );
10
+
11
+ /**
12
+ * db_rollback() - rollback the last transaction
13
+ *
14
+ * For transactional databases this will rollback the last set of actions.
15
+ *
16
+ * Returns 1 on success, 0 otherwise
17
+ *
18
+ */
19
+ int db_rollback( int );
20
+
21
+ /**
22
+ * db_fetch() - fetches a result set
23
+ *
24
+ * Fetches the result set for the given row of the last executeted sql on
25
+ * the passed database handle.
26
+ *
27
+ * Returns an array of columns of the named row upon success an error
28
+ * string otherwise.
29
+ *
30
+ * string *res;
31
+ * mixed rows;
32
+ * int dbconn, i;
33
+ *
34
+ * dbconn = db_connect("db.server", "db_mud");
35
+ * if(dbconn < 1)
36
+ * return 0;
37
+ * rows = db_exec(dbconn, "SELECT player_name, exp FROM t_player");
38
+ * if(!rows)
39
+ * write("No rows return3d.");
40
+ * else
41
+ * if(stringp(rows)) /* error *\/
42
+ * write(rows);
43
+ * else
44
+ * for(i = 1; i <= rows; i++)
45
+ * {
46
+ * res = db_fetch(dbconn, i);
47
+ * write(res[0]);
48
+ * write(res[1]);
49
+ * }
50
+ *
51
+ * db_close(dbconn);
52
+ *
53
+ */
54
+ mixed *db_fetch( int handle, int row );
55
+
56
+ /**
57
+ * db_exec() - executes an sql statement
58
+ *
59
+ * This function will execute the passed sql statement for the given data‐
60
+ * base handle.
61
+ *
62
+ * Returns the number of rows in result set on success, or an error string
63
+ * otherwise.
64
+ *
65
+ */
66
+ mixed db_exec( int handle, string sql_query );
67
+
68
+ /**
69
+ * db_connect() - close the database connection
70
+ *
71
+ * Creates a new connection to the database db on the given host. The
72
+ * connection uses either the given user or a compile time value as login
73
+ * id. type may be used to choose the type of database server. Valid val‐
74
+ * ues depend on compile time settings should be made available through a
75
+ * corresponding header file within the mudlib.
76
+ *
77
+ * Returns a handle to the new connection on success, 0 otherwise
78
+ *
79
+ * Driver will call master object's valid_database function to reterive
80
+ * password for this database (string) or approvals (positive intgeter).
81
+ *
82
+ * FlufFOS supports MYSQL, SQLITE3 and PostgreSQL.
83
+ *
84
+ * When compiling driver, you need to pass -DPACKAGE_DB=ON and
85
+ * -DPACKAGE_DB_MYSQL=X or
86
+ * -DPACKAGE_DB_SQLITE=X or
87
+ * -DPACKAGE_DB_POSTGRESQL=X
88
+ * and you should also pass -DPACKAGE_DB_DEFAULT_DB=X which should be one
89
+ * of the value above. If one value is an empty string, the driver support for
90
+ * that DB is disabled.
91
+ *
92
+ * X here means an integer representing the "type" parameter in db_connect().
93
+ *
94
+ * Driver prvoides following pre-defines constant to lib for DB types.
95
+ *
96
+ * __USE_MYSQL__ is what -DPACKAGE_DB_MYSQL=<value> is, default to be 1
97
+ * __USE_SQLITE3__ is what -DPACKAGE_DB_SQLITE=<value> is, default to be not defined.
98
+ * __USE_POSTGRE__ is what -DPACKAGE_DB_POSTGRESQL=<value> is, default to be not defined.
99
+ * __DEFAULT_DB__ is what -DPACKAGE_DB_DEFAULT_DB=<value> is, default to be 1
100
+ *
101
+ */
102
+ int db_connect( string host, string db );
103
+ int db_connect( string host, string db, string user );
104
+ int db_connect( string host, string db, string user, int type );
105
+
106
+ /**
107
+ * db_commit() - commits the last transaction
108
+ *
109
+ * For transactional databases this will commit the last set of actions.
110
+ *
111
+ * Returns 1 on success, 0 otherwise
112
+ *
113
+ */
114
+ int db_commit(int handle );
115
+
116
+ /**
117
+ * db_close() - close the database connection
118
+ *
119
+ * Closes the database connection represented by the given handle.
120
+ *
121
+ * Returns 1 on success, 0 otherwise
122
+ *
123
+ */
124
+ int db_close( int handle );
125
+
@@ -0,0 +1,107 @@
1
+ /* These are not automatically provided by the driver */
2
+ #define T_INT "int"
3
+ #define T_STRING "string"
4
+ #define T_ARRAY "array"
5
+ #define T_OBJECT "object"
6
+ #define T_MAPPING "mapping"
7
+ #define T_FUNCTION "function"
8
+ #define T_FLOAT "float"
9
+ #define T_BUFFER "buffer"
10
+ #define T_CLASS "class"
11
+ #define T_INVALID "*invalid*"
12
+ #define T_LVALUE "*lvalue*"
13
+ #define T_LVALUE_BYTE "*lvalue_byte*"
14
+ #define T_LVALUE_RANGE "*lvalue_range*"
15
+ #define T_LVALUE_CODEPOINT "*lvalue_codepoint*"
16
+ #define T_ERROR_HANDLER "*error_handler*"
17
+ #define T_FREED "*freed*"
18
+ #define T_UNKNOWN "*unknown*"
19
+
20
+ // https://github.com/fluffos/fluffos/blob/master/src/include/function.h
21
+ #define FP_LOCAL 2
22
+ #define FP_EFUN 3
23
+ #define FP_SIMUL 4
24
+ #define FP_FUNCTIONAL 5
25
+ #define FP_G_VAR 6
26
+ #define FP_L_VAR 7
27
+ #define FP_ANONYMOUS 8
28
+ #define FP_MASK 0x0f
29
+ #define FP_HAS_ARGUMENTS 0x10
30
+ #define FP_OWNER_DESTED 0x20
31
+ #define FP_NOT_BINDABLE 0x40
32
+
33
+ // src/include/localtime.h
34
+ /*
35
+ * Definitions for localtime() efun
36
+ */
37
+ #define LT_SEC 0
38
+ #define LT_MIN 1
39
+ #define LT_HOUR 2
40
+ #define LT_MDAY 3
41
+ #define LT_MON 4
42
+ #define LT_YEAR 5
43
+ #define LT_WDAY 6
44
+ #define LT_YDAY 7
45
+ #define LT_GMTOFF 8
46
+ #define LT_ZONE 9
47
+ #define LT_ISDST 10
48
+
49
+ /* codes returned by the origin() efun */
50
+
51
+ #define ORIGIN_BACKEND "driver" /* backwards compat */
52
+ #define ORIGIN_DRIVER "driver"
53
+ #define ORIGIN_LOCAL "local"
54
+ #define ORIGIN_CALL_OTHER "call_other"
55
+ #define ORIGIN_SIMUL_EFUN "simul"
56
+ #define ORIGIN_INTERNAL "internal"
57
+ #define ORIGIN_EFUN "efun"
58
+ /* pseudo frames for call_other function pointers and efun pointer */
59
+ #define ORIGIN_FUNCTION_POINTER "function_pointer"
60
+ /* anonymous functions */
61
+ #define ORIGIN_FUNCTIONAL "functional"
62
+
63
+ #define ERR_IS_NOT 1
64
+ #define ERR_NOT_LIVING 2
65
+ #define ERR_NOT_ACCESSIBLE 3
66
+ #define ERR_AMBIG 4
67
+ #define ERR_ORDINAL 5
68
+ #define ERR_ALLOCATED 6
69
+ #define ERR_THERE_IS_NO 7
70
+ #define ERR_BAD_MULTIPLE 8
71
+ #define ERR_MANY_PATHS 9
72
+
73
+ #define EESUCCESS 1 /* Call was successful */
74
+ #define EESOCKET -1 /* Problem creating socket */
75
+ #define EESETSOCKOPT -2 /* Problem with setsockopt */
76
+ #define EENONBLOCK -3 /* Problem setting non-blocking mode */
77
+ #define EENOSOCKS -4 /* UNUSED */
78
+ #define EEFDRANGE -5 /* Descriptor out of range */
79
+ #define EEBADF -6 /* Descriptor is invalid */
80
+ #define EESECURITY -7 /* Security violation attempted */
81
+ #define EEISBOUND -8 /* Socket is already bound */
82
+ #define EEADDRINUSE -9 /* Address already in use */
83
+ #define EEBIND -10 /* Problem with bind */
84
+ #define EEGETSOCKNAME -11 /* Problem with getsockname */
85
+ #define EEMODENOTSUPP -12 /* Socket mode not supported */
86
+ #define EENOADDR -13 /* Socket not bound to an address */
87
+ #define EEISCONN -14 /* Socket is already connected */
88
+ #define EELISTEN -15 /* Problem with listen */
89
+ #define EENOTLISTN -16 /* Socket not listening */
90
+ #define EEWOULDBLOCK -17 /* Operation would block */
91
+ #define EEINTR -18 /* Interrupted system call */
92
+ #define EEACCEPT -19 /* Problem with accept */
93
+ #define EEISLISTEN -20 /* Socket is listening */
94
+ #define EEBADADDR -21 /* Problem with address format */
95
+ #define EEALREADY -22 /* Operation already in progress */
96
+ #define EECONNREFUSED -23 /* Connection refused */
97
+ #define EECONNECT -24 /* Problem with connect */
98
+ #define EENOTCONN -25 /* Socket not connected */
99
+ #define EETYPENOTSUPP -26 /* Object type not supported */
100
+ #define EESENDTO -27 /* Problem with sendto */
101
+ #define EESEND -28 /* Problem with send */
102
+ #define EECALLBACK -29 /* Wait for callback */
103
+ #define EESOCKRLSD -30 /* Socket already released */
104
+ #define EESOCKNOTRLSD -31 /* Socket not released */
105
+ #define EEBADDATA -32 /* sending data with too many nested levels */
106
+
107
+ #define ERROR_STRINGS 33 /* sizeof (error_strings) */
@@ -0,0 +1,48 @@
1
+ // ed.h
2
+
3
+ /**
4
+ * query_ed_mode() - find out the status of the current ed session
5
+ *
6
+ * Finds the status of the ed session for the current object, if one
7
+ * exists. It returns:
8
+ *
9
+ * 0 - the current object is at a normal ed prompt (':')
10
+ *
11
+ * -1 - the current object isn't in ed
12
+ *
13
+ * -2 - the current object is at the more prompt in the middle of help
14
+ *
15
+ * >0 - the object is at a prompt for a line. The number is the line
16
+ * number.
17
+ *
18
+ */
19
+ int query_ed_mode();
20
+
21
+ /**
22
+ * ed_start() - start an ed session
23
+ *
24
+ * This efun is available only if __OLD_ED__ is not defined.
25
+ *
26
+ * The internal editor is started, optionally loading 'file' for editing.
27
+ * The resulting output is returned. The editor session remains active,
28
+ * and further calls to ed_cmd() can be used to send commands to it.
29
+ *
30
+ * If restricted is 1, the commands that change which file is being edited
31
+ * will be disabled.
32
+ *
33
+ * Only one ed session can be active per object at a time.
34
+ *
35
+ */
36
+ string ed_start(void|string file, void|int restricted);
37
+
38
+ /**
39
+ * ed_cmd() - send a command to an ed session
40
+ *
41
+ * This efun is available only if __OLD_ED__ is not defined.
42
+ *
43
+ * The command 'cmd' is sent to the active ed session, and the resulting
44
+ * output is returned.
45
+ *
46
+ */
47
+ string ed_cmd(string cmd);
48
+
@@ -0,0 +1,75 @@
1
+ /** These objects must be here - they are used by the type checker for various non-primitive types */
2
+ object __LS__Array;
3
+ object __LS__Mapping;
4
+ object __LS__Object;
5
+ object __LS__Function;
6
+ object __LS__CallableFunction;
7
+ object __LS__NewableFunction;
8
+ object __LS__Int;
9
+ object __LS__ReadonlyArray;
10
+ object __LS__String;
11
+ object __LS__Closure;
12
+
13
+ // Driver Provided Defines
14
+ // These are made available to each sourcefile
15
+ #define MUDOS 1
16
+ #define FLUFFOS 1
17
+ #define __GET_CHAR_IS_BUFFERED__ 1
18
+ #define __PORT__ 1
19
+ #define __VERSION__ "1.0"
20
+ #define __ARCH__ "x86_64"
21
+ #define __COMPILER__ "gcc"
22
+ #define __CXXFLAGS__ "linux"
23
+ #define MUD_NAME "FluffOS"
24
+
25
+ #define SIZEOFINT 4
26
+ #define MAX_INT 2147483647 /* the largest integer number */
27
+ #define MIN_INT -2147483648 /* the smallest integer number */
28
+ #define MAX_FLOAT 1.0e+20 /* the largest (positive) float number */
29
+ #define MIN_FLOAT 0.00000 /* the smallest (positive) float number */
30
+ #define __LARGEST_PRINTABLE_STRING__ 8192
31
+ #define __CACHE_STATS__ 1
32
+ #define __STRING_STATS__ 1
33
+ #define __ARRAY_STATS__ 1
34
+ #define __CLASS_STATS__ 1
35
+ #define __CALLOUT_HANDLES__ 1
36
+ #define __ARGUMENTS_IN_TRACEBACK__ 1
37
+ #define __LOCALS_IN_TRACEBACK__ 1
38
+ #define __DEBUG_MACRO__ 1
39
+
40
+ /*
41
+ * efun definitions
42
+ *
43
+ * The doc comments in the FluffOS efun files were created
44
+ * from the FluffOS source code.
45
+ * https://github.com/fluffos/fluffos/tree/master/docs
46
+ *
47
+ * See the https://github.com/fluffos/fluffos/blob/master/Copyright
48
+ * for license/copyright info.
49
+ */
50
+
51
+ #include "arrays.h"
52
+ #include "async.h"
53
+ #include "buffers.h"
54
+ #include "calls.h"
55
+ #include "contrib.h"
56
+ #include "db.h"
57
+ #include "ed.h"
58
+ #include "external.h"
59
+ #include "filesystem.h"
60
+ #include "floats.h"
61
+ #include "functions.h"
62
+ #include "general.h"
63
+ #include "interactive.h"
64
+ #include "internals.h"
65
+ #include "mappings.h"
66
+ #include "misc.h"
67
+ #include "mudlib.h"
68
+ #include "numbers.h"
69
+ #include "objects.h"
70
+ #include "parsing.h"
71
+ #include "pcre.h"
72
+ #include "sockets.h"
73
+ #include "strings.h"
74
+ #include "system.h"
75
+
@@ -0,0 +1,30 @@
1
+ // external.h
2
+
3
+ /**
4
+ * external_start() - execute a shell command external to the driver
5
+ *
6
+ * Execute a shell command external to the driver.
7
+ *
8
+ * Commands that you would like to execute must be added to the runtime config.
9
+ * The enumerated commands may then be invoked by their number as the first
10
+ * argument to external_start `external_index`.
11
+ *
12
+ * This function returns the socket number which you should record for later
13
+ * processing of the results from the external command.
14
+ *
15
+ * `args` - An array of the arguments passed to the external command.
16
+ * `read_call_back` - As data becomes available, this function will be called
17
+ * with a string containing that data.
18
+ * `write_call_back` - I am not 100% sure what would be written to the external
19
+ * command, but, this is a required parameter.
20
+ * `close_call_back` - When the socket closes, this function is called.
21
+ *
22
+ * This is a very basic example using the information provided in this document
23
+ *
24
+ */
25
+ int external_start(int external_index,
26
+ string *args,
27
+ string|function read_call_back,
28
+ string|function write_call_back,
29
+ string|function close_call_back);
30
+
@@ -0,0 +1,154 @@
1
+ // filesystem.h
2
+
3
+ /**
4
+ * write_file() - appends a string to a file
5
+ *
6
+ * Append the string 'str' into the file 'file'. Returns 0 or 1 for fail‐
7
+ * ure or success. If flag is 1, write_file overwrites instead of append‐
8
+ * ing.
9
+ *
10
+ */
11
+ varargs int write_file( string file, string str, int flag );
12
+
13
+ /**
14
+ * write_bytes() - writes a contiguous series of bytes to a file
15
+ *
16
+ * This function writes the bytes in 'series' into the file named by
17
+ * 'path' beginning at byte # 'start'. It returns zero (0) upon failure,
18
+ * 1 otherwise.
19
+ *
20
+ */
21
+ int write_bytes( string path, int start, string series );
22
+
23
+ /**
24
+ * stat() - returns information pertaining to a file or a directory
25
+ *
26
+ * If str is the name of a regular file (not a directory), then stat()
27
+ * will return an array of information pertaining to that file. The form
28
+ * of the array is as follows:
29
+ *
30
+ * ({ file_size, last_time_file_touched, time_object_loaded, time_file_created })
31
+ *
32
+ * If stat is called on a directory (not a regular file), or with a second
33
+ * argument of -1, then stat() behaves identically to get_dir(3).
34
+ *
35
+ * @param {string} str - the file or directory to get information about
36
+ * @param {int} flag defaults 0, if 0, return an array of information, if -1, return an array of subarrays
37
+ */
38
+ mixed stat( string str, int flag );
39
+
40
+ /**
41
+ * rmdir() - remove a directory
42
+ *
43
+ * Remove directory 'dir'.
44
+ *
45
+ */
46
+ int rmdir( string dir );
47
+
48
+ /**
49
+ * rm() - remove a file
50
+ *
51
+ * Remove file 'file'. Returns 0 for failure and 1 for success.
52
+ *
53
+ */
54
+ int rm( string file );
55
+
56
+ /**
57
+ * rename() - rename a file
58
+ *
59
+ * Renames the file <src> to <dst>.
60
+ *
61
+ */
62
+ int rename( string src, string dst );
63
+
64
+ /**
65
+ * read_file() - read a file into a string
66
+ *
67
+ * Read a line of text from a file into a string. The second and third
68
+ * arguments are optional. If only the first argument is specified, the
69
+ * entire file is returned (as a string).
70
+ *
71
+ * The start_line is the line number of the line you wish to read. This
72
+ * routine will return 0 if you try to read past the end of the file, or
73
+ * if you try to read from a nonpositive line.
74
+ *
75
+ */
76
+ varargs string read_file( string file, int start_line, int number_of_lines );
77
+
78
+ /**
79
+ * read_bytes() - reads a contiguous series of bytes from a file into a
80
+ string
81
+ *
82
+ * This function reads 'length' bytes beginning at byte # 'start' in the
83
+ * file named 'path'. The bytes are returned as a string. Note that
84
+ * (start + length) must not be past the end of the file or else
85
+ * read_bytes will fail. If the second and third arguments are omitted,
86
+ * the entire file is returned.
87
+ *
88
+ */
89
+ string read_bytes( string path, int start, int length );
90
+
91
+ /**
92
+ * mkdir() - make a directory
93
+ *
94
+ * Creates the specified directory. Returns 1 if successful, 0 if not.
95
+ *
96
+ */
97
+ int mkdir( string directory );
98
+
99
+ /**
100
+ * link() - link a file to another
101
+ *
102
+ * Creates a link <reference> to the file <original>. This efun causes
103
+ * valid_link(original, reference) to be called in the master object. If
104
+ * valid_link() returns 0, the link() call fails. If valid_link() returns
105
+ * 1 then the link() suceeds iff rename() would succeed if called with the
106
+ * same arguments.
107
+ *
108
+ * Note: This efun creates a hard link, not a symbolic one.
109
+ * https://www.geeksforgeeks.org/difference-between-hard-link-and-soft-link/
110
+ *
111
+ */
112
+ void link( string original, string reference );
113
+
114
+ /**
115
+ * get_dir() - returns information pertaining to a filesystem directory
116
+ *
117
+ * If 'dir' is a filename ('*' and '?' wildcards are supported), an array
118
+ * of strings is returned containing all filenames that match the specifi‐
119
+ * cation. If 'dir' is a directory name (ending with a slash--ie: "/u/",
120
+ * "/adm/", etc), all filenames in that directory are returned.
121
+ *
122
+ * If called with a second argument equal to -1, get_dir will return an
123
+ * array of subarrays, where the format of each subarray is:
124
+ *
125
+ * ({ filename, size_of_file, last_time_file_touched })
126
+ *
127
+ * Where filename is a string and last_time_file_touched is an integer
128
+ * being number of seconds since January 1, 1970 (same format as time(3)).
129
+ * The size_of_file element is the same value that is returned by
130
+ * file_size(3); the size of the file in bytes, or -2 if it's a directory.
131
+ *
132
+ * @param {string} dir - the directory to get information about
133
+ * @param {int} flag defaults 0, if 0, return an array of strings, if -1, return an array of subarrays
134
+ */
135
+ varargs mixed *get_dir(string dir, int flag);
136
+
137
+ /**
138
+ * file_size() - get the size of a file
139
+ *
140
+ * file_size() returns the size of file <file> in bytes. Size -1 indi‐
141
+ * cates that <file> either does not exist, or that it is not readable by
142
+ * you. Size -2 indicates that <file> is a directory.
143
+ *
144
+ */
145
+ int file_size( string file );
146
+
147
+ /**
148
+ * cp() - copy a file
149
+ *
150
+ * Copies the file <src> to the file <dst>.
151
+ *
152
+ */
153
+ int cp( string src, string dst );
154
+
@@ -0,0 +1,136 @@
1
+ // floats.h
2
+
3
+ /**
4
+ * to_int - convert a float or buffer to an int
5
+ *
6
+ * If 'x' is a float, the to_int() call returns the number of type 'int'
7
+ * that is equivalent to 'x' (with any decimal stripped off, and floored).
8
+ *
9
+ * If 'x' is a buffer, the call returns the integer (in network-byte-order)
10
+ * that is embedded in the buffer.
11
+ *
12
+ * If 'x' is a string, the call will attempt to convert the string to an
13
+ * integer. The conversion will start at the first character and stop before
14
+ * the last non-numeric string representation of a number and return.
15
+ * If it was unsuccessful, it will return UNDEFINED.
16
+ *
17
+ */
18
+ int to_int( float | string | buffer x);
19
+
20
+ /**
21
+ * tan() - return the tangent of a float
22
+ *
23
+ * Returns the tangent of its argument, 'f', measured in radians.
24
+ *
25
+ */
26
+ float tan( float f );
27
+
28
+ /**
29
+ * sqrt() - returns the square root of a float
30
+ *
31
+ * sqrt() returns the non-negative square root of its argument, 'f'. The
32
+ * value of 'f' must not be negative.
33
+ *
34
+ */
35
+ float sqrt( float f );
36
+
37
+ /**
38
+ * sin() - return the sine of a float
39
+ *
40
+ * Returns the sine of its argument, 'f', measured in radians.
41
+ *
42
+ */
43
+ float sin( float f );
44
+
45
+ /**
46
+ * round() - rounds a float
47
+ *
48
+ * returns the rounded value of `f` as a float.
49
+ *
50
+ */
51
+ float round( float f );
52
+
53
+ /**
54
+ * pow() - find an exponent of a float
55
+ *
56
+ * pow() returns x to the y power. If x is 0.0, y must be positive. If x
57
+ * is negative, y must be an integer.
58
+ *
59
+ */
60
+ float pow( float x, float y );
61
+
62
+ /**
63
+ * log() - returns the natural logarithm of a float
64
+ *
65
+ * Returns the natural logarithm of its argument, 'f'. 'f' must be posi‐
66
+ * tive.
67
+ *
68
+ */
69
+ float log( float f );
70
+
71
+ /**
72
+ * floor() - round a float down to the nearest integer
73
+ *
74
+ * Returns (as a float) the nearest integer number equal to or smaller
75
+ * than f.
76
+ *
77
+ */
78
+ float floor( float f );
79
+
80
+ /**
81
+ * floatp() - determine whether or not a given variable is a float
82
+ *
83
+ * Return 1 if 'arg' is a float number and zero (0) otherwise.
84
+ *
85
+ */
86
+ int floatp( mixed arg );
87
+
88
+ /**
89
+ * exp() - find e to the power of a float
90
+ *
91
+ * exp() returns e^f.
92
+ *
93
+ */
94
+ float exp( float f );
95
+
96
+ /**
97
+ * cos() - return the cosine of a float
98
+ *
99
+ * Returns the cosine of its argument, 'f', measured in radians.
100
+ *
101
+ */
102
+ float cos( float f );
103
+
104
+ /**
105
+ * ceil() - round a float up to the nearest integer
106
+ *
107
+ * Returns (as a float) the nearest integer number equal to or greater
108
+ * than f.
109
+ *
110
+ */
111
+ float ceil( float f );
112
+
113
+ /**
114
+ * atan() - return the arctangent of a float
115
+ *
116
+ * Returns the arctangent of its argument, 'f', measured in radians.
117
+ *
118
+ */
119
+ float atan( float f );
120
+
121
+ /**
122
+ * asin() - return the arcsine of a float
123
+ *
124
+ * Returns the arcsine of its argument, 'f', measured in radians.
125
+ *
126
+ */
127
+ float asin( float f );
128
+
129
+ /**
130
+ * acos() - return the arccosine of a float
131
+ *
132
+ * Returns the arccosine of its argument, 'f', measured in radians.
133
+ *
134
+ */
135
+ float acos( float f );
136
+