|
|
@ -1,5 +1,5 @@ |
|
|
|
/*
|
|
|
|
** $Id: lauxlib.h,v 1.15 1999/11/22 17:39:51 roberto Exp roberto $ |
|
|
|
** $Id: lauxlib.h,v 1.16 1999/12/03 11:26:23 roberto Exp roberto $ |
|
|
|
** Auxiliary functions for building Lua libraries |
|
|
|
** See Copyright Notice in lua.h |
|
|
|
*/ |
|
|
@ -18,8 +18,37 @@ struct luaL_reg { |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
void luaL_openlib (lua_State *L, const struct luaL_reg *l, int n); |
|
|
|
void luaL_argerror (lua_State *L, int numarg, const char *extramsg); |
|
|
|
const char *luaL_check_lstr (lua_State *L, int numArg, long *len); |
|
|
|
const char *luaL_opt_lstr (lua_State *L, int numArg, const char *def, long *len); |
|
|
|
double luaL_check_number (lua_State *L, int numArg); |
|
|
|
double luaL_opt_number (lua_State *L, int numArg, double def); |
|
|
|
lua_Object luaL_functionarg (lua_State *L, int arg); |
|
|
|
lua_Object luaL_tablearg (lua_State *L, int arg); |
|
|
|
lua_Object luaL_nonnullarg (lua_State *L, int numArg); |
|
|
|
void luaL_verror (lua_State *L, const char *fmt, ...); |
|
|
|
char *luaL_openspace (lua_State *L, int size); |
|
|
|
void luaL_resetbuffer (lua_State *L); |
|
|
|
void luaL_addchar (lua_State *L, int c); |
|
|
|
int luaL_getsize (lua_State *L); |
|
|
|
void luaL_addsize (lua_State *L, int n); |
|
|
|
int luaL_newbuffer (lua_State *L, int size); |
|
|
|
void luaL_oldbuffer (lua_State *L, int old); |
|
|
|
char *luaL_buffer (lua_State *L); |
|
|
|
int luaL_findstring (const char *name, const char *const list[]); |
|
|
|
void luaL_chunkid (char *out, const char *source, int len); |
|
|
|
void luaL_filesource (char *out, const char *filename, int len); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef LUA_REENTRANT |
|
|
|
|
|
|
|
/*
|
|
|
|
** =============================================================== |
|
|
|
** some useful macros |
|
|
|
** =============================================================== |
|
|
|
*/ |
|
|
|
|
|
|
|
#define luaL_arg_check(L, cond,numarg,extramsg) if (!(cond)) \ |
|
|
|
luaL_argerror(L, numarg,extramsg) |
|
|
|
#define luaL_check_string(L,n) (luaL_check_lstr(L, (n), NULL)) |
|
|
@ -32,6 +61,13 @@ struct luaL_reg { |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
** =============================================================== |
|
|
|
** Macros for single-state use |
|
|
|
** =============================================================== |
|
|
|
*/ |
|
|
|
|
|
|
|
#define luaL_arg_check(cond,numarg,extramsg) if (!(cond)) \ |
|
|
|
luaL_argerror(numarg,extramsg) |
|
|
|
#define luaL_check_string(n) (luaL_check_lstr((n), NULL)) |
|
|
@ -42,33 +78,6 @@ struct luaL_reg { |
|
|
|
#define luaL_opt_long(n,d) ((long)luaL_opt_number(n,d)) |
|
|
|
#define luaL_openl(a) luaL_openlib(a, (sizeof(a)/sizeof(a[0]))) |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
void luaL_openlib (lua_State *L, const struct luaL_reg *l, int n); |
|
|
|
void luaL_argerror (lua_State *L, int numarg, const char *extramsg); |
|
|
|
const char *luaL_check_lstr (lua_State *L, int numArg, long *len); |
|
|
|
const char *luaL_opt_lstr (lua_State *L, int numArg, const char *def, long *len); |
|
|
|
double luaL_check_number (lua_State *L, int numArg); |
|
|
|
double luaL_opt_number (lua_State *L, int numArg, double def); |
|
|
|
lua_Object luaL_functionarg (lua_State *L, int arg); |
|
|
|
lua_Object luaL_tablearg (lua_State *L, int arg); |
|
|
|
lua_Object luaL_nonnullarg (lua_State *L, int numArg); |
|
|
|
void luaL_verror (lua_State *L, const char *fmt, ...); |
|
|
|
char *luaL_openspace (lua_State *L, int size); |
|
|
|
void luaL_resetbuffer (lua_State *L); |
|
|
|
void luaL_addchar (lua_State *L, int c); |
|
|
|
int luaL_getsize (lua_State *L); |
|
|
|
void luaL_addsize (lua_State *L, int n); |
|
|
|
int luaL_newbuffer (lua_State *L, int size); |
|
|
|
void luaL_oldbuffer (lua_State *L, int old); |
|
|
|
char *luaL_buffer (lua_State *L); |
|
|
|
int luaL_findstring (const char *name, const char *const list[]); |
|
|
|
void luaL_chunkid (char *out, const char *source, int len); |
|
|
|
void luaL_filesource (char *out, const char *filename, int len); |
|
|
|
|
|
|
|
|
|
|
|
#ifndef LUA_REENTRANT |
|
|
|
|
|
|
|
#define luaL_openlib(l,n) (luaL_openlib)(lua_state,l,n) |
|
|
|
#define luaL_argerror(numarg,extramsg) \ |
|
|
|