-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added lua shell and reworked lua binding
- Loading branch information
Showing
31 changed files
with
1,863 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef LIBFSEMU_EMU_LUA_H_ | ||
#define LIBFSEMU_EMU_LUA_H_ | ||
|
||
#ifdef WITH_LUA | ||
|
||
#include <lauxlib.h> | ||
|
||
typedef struct fs_emu_lua_binding { | ||
int (*run_handler)(const char *name); | ||
int (*run_script)(const char *path); | ||
lua_State *(*create_state)(void); | ||
void (*destroy_state)(lua_State *); | ||
void (*lock_state)(lua_State *); | ||
void (*unlock_state)(lua_State *); | ||
} fs_emu_lua_binding; | ||
|
||
typedef int (*fs_emu_lua_func)(lua_State *); | ||
|
||
// bind lua interpreter | ||
extern void fs_emu_lua_set_binding(fs_emu_lua_binding *); | ||
extern void fs_emu_lua_bind(void); | ||
extern void fs_emu_lua_unbind(void); | ||
|
||
// register functions | ||
extern void fs_emu_lua_init(void); | ||
extern void fs_emu_lua_register_func(const char *name, fs_emu_lua_func f); | ||
extern int luaopen_fsemulib(lua_State *state); | ||
|
||
extern lua_State *fs_emu_lua_create_state(void); | ||
extern void fs_emu_lua_destroy_state(lua_State *); | ||
extern void fs_emu_lua_lock_state(lua_State *); | ||
extern void fs_emu_lua_unlock_state(lua_State *); | ||
|
||
#endif | ||
|
||
extern int fs_emu_lua_run_handler(const char *name); | ||
extern int fs_emu_lua_run_script(const char *path); | ||
|
||
#endif // LIBFSEMU_EMU_LUA_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifdef WINDOWS | ||
#include <Winsock2.h> | ||
#include <Ws2tcpip.h> | ||
#else | ||
#include <sys/types.h> | ||
#include <sys/socket.h> | ||
#include <netdb.h> | ||
#include <netinet/in.h> | ||
#include <netinet/tcp.h> | ||
#include <unistd.h> | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.