1
0
Fork 0
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:
Firew0lf 2016-04-10 01:47:52 +02:00
parent e87651a404
commit e7ff54d58c
9 changed files with 333 additions and 75 deletions

View file

@ -13,30 +13,6 @@ Used to manage the applets and application status.
#include <lua.h>
#include <lauxlib.h>
/***
Initialize the APT module. Useless.
@function init
*/
static int apt_init(lua_State *L) {
Result ret = aptInit();
if (ret!=0) {
lua_pushboolean(L, false);
lua_pushinteger(L, ret);
return 2;
}
lua_pushboolean(L, true);
return 1;
}
/***
Shutdown the APT module. Useless, don't use it.
@function shutdown
*/
static int apt_shutdown(lua_State *L) {
aptExit();
return 0;
}
/***
Open an APT session. Should only work if you don't use the homebrew menu.
@function openSession
@ -132,8 +108,6 @@ static int apt_getMenuAppID(lua_State *L) {
}
static const struct luaL_Reg apt_lib[] = {
{"init", apt_init },
{"shutdown", apt_shutdown },
{"openSession", apt_openSession },
{"closeSession", apt_closeSession },
{"setStatus", apt_setStatus },
@ -327,6 +301,8 @@ struct { char *name; int value; } apt_constants[] = {
};
int luaopen_apt_lib(lua_State *L) {
aptInit();
luaL_newlib(L, apt_lib);
for (int i = 0; apt_constants[i].name; i++) {
@ -340,3 +316,7 @@ int luaopen_apt_lib(lua_State *L) {
void load_apt_lib(lua_State *L) {
luaL_requiref(L, "ctr.apt", luaopen_apt_lib, false);
}
void unload_apt_lib(lua_State *L) {
aptExit();
}