mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-28 00:39:30 +00:00
Fixed typos; should compile now
This commit is contained in:
parent
70f44c95c9
commit
aee36e6925
2 changed files with 11 additions and 11 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
#include <lua.h>
|
#include <lua.h>
|
||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
|
|
||||||
int load_gfx_lib(lua_State *L);
|
|
||||||
int load_os_lib(lua_State *L);
|
int load_os_lib(lua_State *L);
|
||||||
|
int load_gfx_lib(lua_State *L);
|
||||||
int load_news_lib(lua_State *L);
|
int load_news_lib(lua_State *L);
|
||||||
int load_ptm_lib(lua_State *L);
|
int load_ptm_lib(lua_State *L);
|
||||||
|
|
||||||
|
|
@ -13,8 +13,8 @@ static const struct luaL_Reg ctr_lib[] = {
|
||||||
struct { char *name; int (*load)(lua_State *L); } ctr_libs[] = {
|
struct { char *name; int (*load)(lua_State *L); } ctr_libs[] = {
|
||||||
{ "gfx", load_gfx_lib },
|
{ "gfx", load_gfx_lib },
|
||||||
{ "news", load_news_lib },
|
{ "news", load_news_lib },
|
||||||
{ "ptm", load_ptm_lib }
|
{ "ptm", load_ptm_lib },
|
||||||
{ NULL, NULL },
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
int luaopen_ctr_lib(lua_State *L) {
|
int luaopen_ctr_lib(lua_State *L) {
|
||||||
|
|
|
||||||
16
source/ptm.c
16
source/ptm.c
|
|
@ -4,7 +4,7 @@
|
||||||
#include <lua.h>
|
#include <lua.h>
|
||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
|
|
||||||
static Handle ptmHandle;
|
static Handle *ptmHandle;
|
||||||
|
|
||||||
static int ptm_init(lua_State *L) {
|
static int ptm_init(lua_State *L) {
|
||||||
ptmInit();
|
ptmInit();
|
||||||
|
|
@ -22,7 +22,7 @@ static int ptm_getShellState(lua_State *L) {
|
||||||
u8 *out = 0;
|
u8 *out = 0;
|
||||||
PTMU_GetShellState(ptmHandle, out);
|
PTMU_GetShellState(ptmHandle, out);
|
||||||
|
|
||||||
lua_pushintegrer(L, (lua_Integrer)out);
|
lua_pushinteger(L, (lua_Integer)out);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -31,7 +31,7 @@ static int ptm_getBatteryLevel(lua_State *L) {
|
||||||
u8 *out = 0;
|
u8 *out = 0;
|
||||||
PTMU_GetBatteryLevel(ptmHandle, out);
|
PTMU_GetBatteryLevel(ptmHandle, out);
|
||||||
|
|
||||||
lua_pushintegrer(L, (lua_Integrer)out);
|
lua_pushinteger(L, (lua_Integer)out);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -40,7 +40,7 @@ static int ptm_getBatteryChargeState(lua_State *L) {
|
||||||
u8 *out = 0;
|
u8 *out = 0;
|
||||||
PTMU_GetBatteryChargeState(ptmHandle, out);
|
PTMU_GetBatteryChargeState(ptmHandle, out);
|
||||||
|
|
||||||
lua_pushintegrer(L, (lua_Integrer)out);
|
lua_pushinteger(L, (lua_Integer)out);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +49,7 @@ static int ptm_getPedometerState(lua_State *L) {
|
||||||
u8 *out = 0;
|
u8 *out = 0;
|
||||||
PTMU_GetPedometerState(ptmHandle, out);
|
PTMU_GetPedometerState(ptmHandle, out);
|
||||||
|
|
||||||
lua_pushintegrer(L, (lua_Integrer)out);
|
lua_pushinteger(L, (lua_Integer)out);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -58,7 +58,7 @@ static int ptm_getTotalStepCount(lua_State *L) {
|
||||||
u32 *steps = 0;
|
u32 *steps = 0;
|
||||||
PTMU_GetTotalStepCount(ptmHandle, steps);
|
PTMU_GetTotalStepCount(ptmHandle, steps);
|
||||||
|
|
||||||
lua_pushintegrer(L, (lua_Integrer)steps);
|
lua_pushinteger(L, (lua_Integer)steps);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
@ -69,10 +69,10 @@ static const struct luaL_Reg ptm_lib[] = {
|
||||||
{"getShellState", ptm_getShellState },
|
{"getShellState", ptm_getShellState },
|
||||||
{"getBatteryLevel", ptm_getBatteryLevel },
|
{"getBatteryLevel", ptm_getBatteryLevel },
|
||||||
{"getBatteryChargeState", ptm_getBatteryChargeState},
|
{"getBatteryChargeState", ptm_getBatteryChargeState},
|
||||||
{"getPedometer", ptm_getPedometer },
|
{"getPedometerState", ptm_getPedometerState },
|
||||||
{"getTotalStepCount", ptm_getTotalStepCount },
|
{"getTotalStepCount", ptm_getTotalStepCount },
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
}
|
};
|
||||||
|
|
||||||
int luaopen_ptm_lib(lua_State *L) {
|
int luaopen_ptm_lib(lua_State *L) {
|
||||||
luaL_newlib(L, ptm_lib);
|
luaL_newlib(L, ptm_lib);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue