1997-03-18 07:30:50 -08:00
|
|
|
/*
|
1999-08-16 13:52:00 -07:00
|
|
|
** $Id: lauxlib.h,v 1.12 1999/03/10 14:19:41 roberto Exp roberto $
|
1998-06-19 09:14:09 -07:00
|
|
|
** Auxiliary functions for building Lua libraries
|
1997-09-16 12:25:59 -07:00
|
|
|
** See Copyright Notice in lua.h
|
1997-03-18 07:30:50 -08:00
|
|
|
*/
|
|
|
|
|
1997-09-16 12:25:59 -07:00
|
|
|
|
1997-03-18 07:30:50 -08:00
|
|
|
#ifndef auxlib_h
|
|
|
|
#define auxlib_h
|
|
|
|
|
1997-09-16 12:25:59 -07:00
|
|
|
|
1997-03-18 07:30:50 -08:00
|
|
|
#include "lua.h"
|
|
|
|
|
1997-09-16 12:25:59 -07:00
|
|
|
|
1997-03-18 07:30:50 -08:00
|
|
|
struct luaL_reg {
|
1999-08-16 13:52:00 -07:00
|
|
|
const char *name;
|
1997-03-18 07:30:50 -08:00
|
|
|
lua_CFunction func;
|
|
|
|
};
|
|
|
|
|
1998-01-09 07:09:53 -08:00
|
|
|
|
|
|
|
#define luaL_arg_check(cond,numarg,extramsg) if (!(cond)) \
|
|
|
|
luaL_argerror(numarg,extramsg)
|
|
|
|
|
1999-08-16 13:52:00 -07:00
|
|
|
void luaL_openlib (const struct luaL_reg *l, int n);
|
|
|
|
void luaL_argerror (int numarg, const char *extramsg);
|
1998-03-06 08:54:42 -08:00
|
|
|
#define luaL_check_string(n) (luaL_check_lstr((n), NULL))
|
1999-08-16 13:52:00 -07:00
|
|
|
const char *luaL_check_lstr (int numArg, long *len);
|
1998-03-06 08:54:42 -08:00
|
|
|
#define luaL_opt_string(n, d) (luaL_opt_lstr((n), (d), NULL))
|
1999-08-16 13:52:00 -07:00
|
|
|
const char *luaL_opt_lstr (int numArg, const char *def, long *len);
|
1997-04-06 07:08:08 -07:00
|
|
|
double luaL_check_number (int numArg);
|
1998-12-28 05:44:54 -08:00
|
|
|
#define luaL_check_int(n) ((int)luaL_check_number(n))
|
|
|
|
#define luaL_check_long(n) ((long)luaL_check_number(n))
|
1997-04-06 07:08:08 -07:00
|
|
|
double luaL_opt_number (int numArg, double def);
|
1998-12-28 05:44:54 -08:00
|
|
|
#define luaL_opt_int(n,d) ((int)luaL_opt_number(n,d))
|
|
|
|
#define luaL_opt_long(n,d) ((long)luaL_opt_number(n,d))
|
1997-12-09 05:50:08 -08:00
|
|
|
lua_Object luaL_functionarg (int arg);
|
|
|
|
lua_Object luaL_tablearg (int arg);
|
1997-09-26 08:02:26 -07:00
|
|
|
lua_Object luaL_nonnullarg (int numArg);
|
1999-08-16 13:52:00 -07:00
|
|
|
void luaL_verror (const char *fmt, ...);
|
1997-12-17 12:48:58 -08:00
|
|
|
char *luaL_openspace (int size);
|
|
|
|
void luaL_resetbuffer (void);
|
|
|
|
void luaL_addchar (int c);
|
1998-03-06 08:54:42 -08:00
|
|
|
int luaL_getsize (void);
|
1997-12-17 12:48:58 -08:00
|
|
|
void luaL_addsize (int n);
|
|
|
|
int luaL_newbuffer (int size);
|
|
|
|
void luaL_oldbuffer (int old);
|
|
|
|
char *luaL_buffer (void);
|
1999-08-16 13:52:00 -07:00
|
|
|
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);
|
1999-03-10 06:19:41 -08:00
|
|
|
|
1997-04-07 07:48:53 -07:00
|
|
|
|
1997-03-18 07:30:50 -08:00
|
|
|
#endif
|