onelua.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * one.c -- Lua core, libraries, and interpreter in a single file
  3. */
  4. /* default is to build the full interpreter */
  5. #ifndef MAKE_LIB
  6. #ifndef MAKE_LUAC
  7. #ifndef MAKE_LUA
  8. #define MAKE_LUA
  9. #endif
  10. #endif
  11. #endif
  12. /* choose suitable platform-specific features */
  13. /* some of these may need extra libraries such as -ldl -lreadline -lncurses */
  14. #if 0
  15. #define LUA_USE_LINUX
  16. #define LUA_USE_MACOSX
  17. #define LUA_USE_POSIX
  18. #define LUA_ANSI
  19. #endif
  20. /* no need to change anything below this line ----------------------------- */
  21. #include "lprefix.h"
  22. #include <assert.h>
  23. #include <ctype.h>
  24. #include <errno.h>
  25. #include <float.h>
  26. #include <limits.h>
  27. #include <locale.h>
  28. #include <math.h>
  29. #include <setjmp.h>
  30. #include <signal.h>
  31. #include <stdarg.h>
  32. #include <stddef.h>
  33. #include <stdio.h>
  34. #include <stdlib.h>
  35. #include <string.h>
  36. #include <time.h>
  37. /* setup for luaconf.h */
  38. #define LUA_CORE
  39. #define LUA_LIB
  40. #define ltable_c
  41. #define lvm_c
  42. #include "luaconf.h"
  43. /* do not export internal symbols */
  44. #undef LUAI_FUNC
  45. #undef LUAI_DDEC
  46. #undef LUAI_DDEF
  47. #define LUAI_FUNC static
  48. #define LUAI_DDEC(def) /* empty */
  49. #define LUAI_DDEF static
  50. /* core -- used by all */
  51. #include "lzio.c"
  52. #include "lctype.c"
  53. #include "lopcodes.c"
  54. #include "lmem.c"
  55. #include "lundump.c"
  56. #include "ldump.c"
  57. #include "lstate.c"
  58. #include "lgc.c"
  59. #include "llex.c"
  60. #include "lcode.c"
  61. #include "lparser.c"
  62. #include "ldebug.c"
  63. #include "lfunc.c"
  64. #include "lobject.c"
  65. #include "ltm.c"
  66. #include "lstring.c"
  67. #include "ltable.c"
  68. #include "ldo.c"
  69. #include "lvm.c"
  70. #include "lapi.c"
  71. /* auxiliary library -- used by all */
  72. #include "lauxlib.c"
  73. /* standard library -- not used by luac */
  74. #ifndef MAKE_LUAC
  75. #include "lbaselib.c"
  76. #include "lcorolib.c"
  77. #include "ldblib.c"
  78. #include "liolib.c"
  79. #include "lmathlib.c"
  80. #include "loadlib.c"
  81. #include "loslib.c"
  82. #include "lstrlib.c"
  83. #include "ltablib.c"
  84. #include "lutf8lib.c"
  85. #include "linit.c"
  86. #endif
  87. /* lua */
  88. #ifdef MAKE_LUA
  89. #include "lua.c"
  90. #endif
  91. /* luac */
  92. #ifdef MAKE_LUAC
  93. #include "luac.c"
  94. #endif