diff options
author | David Walter Seikel | 2012-01-23 23:36:30 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:36:30 +1000 |
commit | 6523585c66c04cea54df50013df8886b589847d8 (patch) | |
tree | 0b22aee7064166d88595eda260ca2d17c0773da5 /libraries/luajit-2.0/src/lj_str.h | |
parent | Update the EFL to what I'm actually using, coz I'm using some stuff not yet r... (diff) | |
download | SledjHamr-6523585c66c04cea54df50013df8886b589847d8.zip SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.gz SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.bz2 SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.xz |
Add luaproc and LuaJIT libraries.
Two versions of LuaJIT, the stable release, and the dev version. Try the dev version first, until ih fails badly.
Diffstat (limited to '')
-rw-r--r-- | libraries/luajit-2.0/src/lj_str.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libraries/luajit-2.0/src/lj_str.h b/libraries/luajit-2.0/src/lj_str.h new file mode 100644 index 0000000..fbd927c --- /dev/null +++ b/libraries/luajit-2.0/src/lj_str.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | ** String handling. | ||
3 | ** Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h | ||
4 | */ | ||
5 | |||
6 | #ifndef _LJ_STR_H | ||
7 | #define _LJ_STR_H | ||
8 | |||
9 | #include <stdarg.h> | ||
10 | |||
11 | #include "lj_obj.h" | ||
12 | |||
13 | /* String interning. */ | ||
14 | LJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b); | ||
15 | LJ_FUNC void lj_str_resize(lua_State *L, MSize newmask); | ||
16 | LJ_FUNCA GCstr *lj_str_new(lua_State *L, const char *str, size_t len); | ||
17 | LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s); | ||
18 | |||
19 | #define lj_str_newz(L, s) (lj_str_new(L, s, strlen(s))) | ||
20 | #define lj_str_newlit(L, s) (lj_str_new(L, "" s, sizeof(s)-1)) | ||
21 | |||
22 | /* Type conversions. */ | ||
23 | LJ_FUNC int LJ_FASTCALL lj_str_numconv(const char *s, TValue *n); | ||
24 | LJ_FUNC int LJ_FASTCALL lj_str_tonum(GCstr *str, TValue *n); | ||
25 | LJ_FUNC int LJ_FASTCALL lj_str_tonumber(GCstr *str, TValue *n); | ||
26 | LJ_FUNC size_t LJ_FASTCALL lj_str_bufnum(char *s, cTValue *o); | ||
27 | LJ_FUNC char * LJ_FASTCALL lj_str_bufint(char *p, int32_t k); | ||
28 | LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np); | ||
29 | LJ_FUNC GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k); | ||
30 | LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnumber(lua_State *L, cTValue *o); | ||
31 | |||
32 | #define LJ_STR_INTBUF (1+10) | ||
33 | #define LJ_STR_NUMBUF LUAI_MAXNUMBER2STR | ||
34 | |||
35 | /* String formatting. */ | ||
36 | LJ_FUNC const char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp); | ||
37 | LJ_FUNC const char *lj_str_pushf(lua_State *L, const char *fmt, ...) | ||
38 | #if defined(__GNUC__) | ||
39 | __attribute__ ((format (printf, 2, 3))) | ||
40 | #endif | ||
41 | ; | ||
42 | |||
43 | /* Resizable string buffers. Struct definition in lj_obj.h. */ | ||
44 | LJ_FUNC char *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz); | ||
45 | |||
46 | #define lj_str_initbuf(sb) ((sb)->buf = NULL, (sb)->sz = 0) | ||
47 | #define lj_str_resetbuf(sb) ((sb)->n = 0) | ||
48 | #define lj_str_resizebuf(L, sb, size) \ | ||
49 | ((sb)->buf = (char *)lj_mem_realloc(L, (sb)->buf, (sb)->sz, (size)), \ | ||
50 | (sb)->sz = (size)) | ||
51 | #define lj_str_freebuf(g, sb) lj_mem_free(g, (void *)(sb)->buf, (sb)->sz) | ||
52 | |||
53 | #endif | ||