Register luaopen_lush() in stdlibs so the lush table is available as a global. Users can now extend the shell by adding functions to lush.builtins. The OP_LUSH VM access via integer keys is preserved.
29 lines
639 B
C
29 lines
639 B
C
/*
|
|
** $Id: lcmd.h $
|
|
** Command execution for backtick syntax
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
|
|
#ifndef lcmd_h
|
|
#define lcmd_h
|
|
|
|
#include "lua.h"
|
|
|
|
/* OP_LUSH sub-operation indices (B operand selects which function) */
|
|
#define LUSH_OP_COMMAND 0
|
|
#define LUSH_OP_INTERACTIVE 1
|
|
#define LUSH_OP_GETENV 2
|
|
#define LUSH_OP_SETENV 3
|
|
#define LUSH_OP_SUBCMD 4
|
|
#define LUSH_OP_COUNT 5
|
|
|
|
int lushCmd_command (lua_State *L);
|
|
int lushCmd_interactive (lua_State *L);
|
|
int lushCmd_getenv (lua_State *L);
|
|
int lushCmd_setenv (lua_State *L);
|
|
int lushCmd_subcmd (lua_State *L);
|
|
|
|
LUAMOD_API int luaopen_lush (lua_State *L);
|
|
|
|
#endif
|