interplane.Get Omega
Read in your language

lua

[Ported from github.com/lua/lua] Cast in 'rl_readline_name'

Brought by drakestapleton

branch master Branches Tags History

lua / onelua.c

136 lines · 2475 bytes Raw Blame History
1/*
2** Lua core, libraries, and interpreter in a single file.
3** Compiling just this file generates a complete Lua stand-alone
4** program:
5**
6** $ gcc -O2 -std=c99 -o lua onelua.c -lm
7**
8** or (for C89)
9**
10** $ gcc -O2 -std=c89 -DLUA_USE_C89 -o lua onelua.c -lm
11**
12** or (for Linux)
13**
14** gcc -O2 -o lua -DLUA_USE_LINUX -Wl,-E onelua.c -lm -ldl
15**
16*/
17
18/* default is to build the full interpreter */
19#ifndef MAKE_LIB
20#ifndef MAKE_LUAC
21#ifndef MAKE_LUA
22#define MAKE_LUA
23#endif
24#endif
25#endif
26
27
28/*
29** Choose suitable platform-specific features. Default is no
30** platform-specific features. Some of these options may need extra
31** libraries such as -ldl -lreadline -lncurses
32*/
33#if 0
34#define LUA_USE_LINUX
35#define LUA_USE_MACOSX
36#define LUA_USE_POSIX
37#endif
38
39
40/*
41** Other specific features
42*/
43#if 0
44#define LUA_32BITS
45#define LUA_USE_C89
46#endif
47
48
49/* no need to change anything below this line ----------------------------- */
50
51#include "lprefix.h"
52
53#include <assert.h>
54#include <ctype.h>
55#include <errno.h>
56#include <float.h>
57#include <limits.h>
58#include <locale.h>
59#include <math.h>
60#include <setjmp.h>
61#include <signal.h>
62#include <stdarg.h>
63#include <stddef.h>
64#include <stdio.h>
65#include <stdlib.h>
66#include <string.h>
67#include <time.h>
68
69/* setup for luaconf.h */
70#define LUA_CORE
71#define LUA_LIB
72
73#include "luaconf.h"
74
75/* do not export internal symbols */
76#undef LUAI_FUNC
77#undef LUAI_DDEC
78#undef LUAI_DDEF
79#define LUAI_FUNC static
80#define LUAI_DDEC(def) /* empty */
81#define LUAI_DDEF static
82
83/* core -- used by all */
84#include "lzio.c"
85#include "lctype.c"
86#include "lopcodes.c"
87#include "lmem.c"
88#include "lundump.c"
89#include "ldump.c"
90#include "lstate.c"
91#include "lgc.c"
92#include "llex.c"
93#include "lcode.c"
94#include "lparser.c"
95#include "ldebug.c"
96#include "lfunc.c"
97#include "lobject.c"
98#include "ltm.c"
99#include "lstring.c"
100#include "ltable.c"
101#include "ldo.c"
102#include "lvm.c"
103#include "lapi.c"
104
105/* auxiliary library -- used by all */
106#include "lauxlib.c"
107
108/* standard library -- not used by luac */
109#ifndef MAKE_LUAC
110#include "lbaselib.c"
111#include "lcorolib.c"
112#include "ldblib.c"
113#include "liolib.c"
114#include "lmathlib.c"
115#include "loadlib.c"
116#include "loslib.c"
117#include "lstrlib.c"
118#include "ltablib.c"
119#include "lutf8lib.c"
120#include "linit.c"
121#endif
122
123/* test library -- used only for internal development */
124#if defined(LUA_DEBUG)
125#include "ltests.c"
126#endif
127
128/* lua */
129#ifdef MAKE_LUA
130#include "lua.c"
131#endif
132
133/* luac */
134#ifdef MAKE_LUAC
135#include "luac.c"
136#endif