diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-23 14:17:25 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-23 14:17:25 -0300 |
| commit | 39b79783297bee79db9853b63d199e120a009a8f (patch) | |
| tree | c738c621c4c28d8822c2f785400786301985273b /lauxlib.h | |
| parent | d164e2294f73d8e69f00d95a66014514b2dd0ec0 (diff) | |
| download | lua-39b79783297bee79db9853b63d199e120a009a8f.tar.gz lua-39b79783297bee79db9853b63d199e120a009a8f.tar.bz2 lua-39b79783297bee79db9853b63d199e120a009a8f.zip | |
first (big) step to support wide chars
Diffstat (limited to '')
| -rw-r--r-- | lauxlib.h | 30 |
1 files changed, 15 insertions, 15 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.h,v 1.32 2001/01/25 16:45:36 roberto Exp roberto $ | 2 | ** $Id: lauxlib.h,v 1.33 2001/02/02 19:02:40 roberto Exp roberto $ |
| 3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -21,25 +21,25 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | typedef struct luaL_reg { | 23 | typedef struct luaL_reg { |
| 24 | const char *name; | 24 | const l_char *name; |
| 25 | lua_CFunction func; | 25 | lua_CFunction func; |
| 26 | } luaL_reg; | 26 | } luaL_reg; |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | LUALIB_API void luaL_openlib (lua_State *L, const luaL_reg *l, int n); | 29 | LUALIB_API void luaL_openlib (lua_State *L, const luaL_reg *l, int n); |
| 30 | LUALIB_API void luaL_argerror (lua_State *L, int numarg, const char *extramsg); | 30 | LUALIB_API void luaL_argerror (lua_State *L, int numarg, const l_char *extramsg); |
| 31 | LUALIB_API const char *luaL_check_lstr (lua_State *L, int numArg, size_t *len); | 31 | LUALIB_API const l_char *luaL_check_lstr (lua_State *L, int numArg, size_t *len); |
| 32 | LUALIB_API const char *luaL_opt_lstr (lua_State *L, int numArg, const char *def, size_t *len); | 32 | LUALIB_API const l_char *luaL_opt_lstr (lua_State *L, int numArg, const l_char *def, size_t *len); |
| 33 | LUALIB_API lua_Number luaL_check_number (lua_State *L, int numArg); | 33 | LUALIB_API lua_Number luaL_check_number (lua_State *L, int numArg); |
| 34 | LUALIB_API lua_Number luaL_opt_number (lua_State *L, int nArg, lua_Number def); | 34 | LUALIB_API lua_Number luaL_opt_number (lua_State *L, int nArg, lua_Number def); |
| 35 | 35 | ||
| 36 | LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg); | 36 | LUALIB_API void luaL_checkstack (lua_State *L, int space, const l_char *msg); |
| 37 | LUALIB_API void luaL_checktype (lua_State *L, int narg, int t); | 37 | LUALIB_API void luaL_checktype (lua_State *L, int narg, int t); |
| 38 | LUALIB_API void luaL_checkany (lua_State *L, int narg); | 38 | LUALIB_API void luaL_checkany (lua_State *L, int narg); |
| 39 | LUALIB_API void *luaL_check_userdata (lua_State *L, int narg, const char *name); | 39 | LUALIB_API void *luaL_check_userdata (lua_State *L, int narg, const l_char *name); |
| 40 | 40 | ||
| 41 | LUALIB_API void luaL_verror (lua_State *L, const char *fmt, ...); | 41 | LUALIB_API void luaL_verror (lua_State *L, const l_char *fmt, ...); |
| 42 | LUALIB_API int luaL_findstring (const char *name, const char *const list[]); | 42 | LUALIB_API int luaL_findstring (const l_char *name, const l_char *const list[]); |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | 45 | ||
| @@ -73,22 +73,22 @@ LUALIB_API int luaL_findstring (const char *name, const char *const list[]); | |||
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | typedef struct luaL_Buffer { | 75 | typedef struct luaL_Buffer { |
| 76 | char *p; /* current position in buffer */ | 76 | l_char *p; /* current position in buffer */ |
| 77 | int level; | 77 | int level; |
| 78 | lua_State *L; | 78 | lua_State *L; |
| 79 | char buffer[LUAL_BUFFERSIZE]; | 79 | l_char buffer[LUAL_BUFFERSIZE]; |
| 80 | } luaL_Buffer; | 80 | } luaL_Buffer; |
| 81 | 81 | ||
| 82 | #define luaL_putchar(B,c) \ | 82 | #define luaL_putchar(B,c) \ |
| 83 | ((void)((B)->p < &(B)->buffer[LUAL_BUFFERSIZE] || luaL_prepbuffer(B)), \ | 83 | ((void)((B)->p < &(B)->buffer[LUAL_BUFFERSIZE] || luaL_prepbuffer(B)), \ |
| 84 | (*(B)->p++ = (char)(c))) | 84 | (*(B)->p++ = (l_char)(c))) |
| 85 | 85 | ||
| 86 | #define luaL_addsize(B,n) ((B)->p += (n)) | 86 | #define luaL_addsize(B,n) ((B)->p += (n)) |
| 87 | 87 | ||
| 88 | LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B); | 88 | LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B); |
| 89 | LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B); | 89 | LUALIB_API l_char *luaL_prepbuffer (luaL_Buffer *B); |
| 90 | LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l); | 90 | LUALIB_API void luaL_addlstring (luaL_Buffer *B, const l_char *s, size_t l); |
| 91 | LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s); | 91 | LUALIB_API void luaL_addstring (luaL_Buffer *B, const l_char *s); |
| 92 | LUALIB_API void luaL_addvalue (luaL_Buffer *B); | 92 | LUALIB_API void luaL_addvalue (luaL_Buffer *B); |
| 93 | LUALIB_API void luaL_pushresult (luaL_Buffer *B); | 93 | LUALIB_API void luaL_pushresult (luaL_Buffer *B); |
| 94 | 94 | ||
