mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-27 16:39:29 +00:00
Added SSL support to sockets, Added console/stdout support, Removed apt.init/apt.shutdown, Added some SSL options to httpc
The console can __not__ be used with gfx.start() on a screen. You don't have to gfx.render() while print()ing, but you should do it when you are in the main loop. The SSL sockets don't work with Citra.
This commit is contained in:
parent
e87651a404
commit
e7ff54d58c
9 changed files with 333 additions and 75 deletions
25
source/ptm.c
25
source/ptm.c
|
|
@ -10,13 +10,19 @@ The `ptm` module.
|
|||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
|
||||
bool initStatePTM = false;
|
||||
|
||||
/***
|
||||
Initialize the PTM module.
|
||||
@function init
|
||||
*/
|
||||
static int ptm_init(lua_State *L) {
|
||||
ptmuInit();
|
||||
ptmSysmInit();
|
||||
if (!initStatePTM) {
|
||||
ptmuInit();
|
||||
ptmSysmInit();
|
||||
|
||||
initStatePTM = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -26,8 +32,12 @@ Disable the PTM module.
|
|||
@function shutdown
|
||||
*/
|
||||
static int ptm_shutdown(lua_State *L) {
|
||||
ptmuExit();
|
||||
ptmSysmExit();
|
||||
if (initStatePTM) {
|
||||
ptmuExit();
|
||||
ptmSysmExit();
|
||||
|
||||
initStatePTM = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -146,3 +156,10 @@ int luaopen_ptm_lib(lua_State *L) {
|
|||
void load_ptm_lib(lua_State *L) {
|
||||
luaL_requiref(L, "ctr.ptm", luaopen_ptm_lib, 0);
|
||||
}
|
||||
|
||||
void unload_ptm_lib(lua_State *L) {
|
||||
if (initStatePTM) {
|
||||
ptmuExit();
|
||||
ptmSysmExit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue