call the lua stuff.

This commit is contained in:
Howland Owl 2017-04-25 22:51:32 +03:00
parent ca58921e2e
commit f164ada948

13
st.c
View file

@ -587,7 +587,7 @@ int dothatLua(void) {
L = luaL_newstate(); /* Create Lua state variable */ L = luaL_newstate(); /* Create Lua state variable */
luaL_openlibs(L); /* Load Lua libraries */ luaL_openlibs(L); /* Load Lua libraries */
if (luaL_loadfile(L, "counter.lua")) /* Load but don't run the Lua script */ if (luaL_loadfile(L, "color.lua")) /* Load but don't run the Lua script */
bail(L, "luaL_loadfile() failed"); /* Error out if file can't be read */ bail(L, "luaL_loadfile() failed"); /* Error out if file can't be read */
printf("In C, calling Lua\n"); printf("In C, calling Lua\n");
if (lua_pcall(L, 0, 0, 0)) /* Run the loaded Lua script */ if (lua_pcall(L, 0, 0, 0)) /* Run the loaded Lua script */
@ -3985,21 +3985,21 @@ xdrawcursor(void)
case 8: case 8:
utf8decode("", &g.u, UTF_SIZ); utf8decode("", &g.u, UTF_SIZ);
case 9: case 9:
utf8decode("", &g.u, UTF_SIZ); utf8decode("", &g.u, UTF_SIZ);
case 10: case 10:
utf8decode("", &g.u, UTF_SIZ); utf8decode("", &g.u, UTF_SIZ);
case 11: case 11:
utf8decode("", &g.u, UTF_SIZ); utf8decode("", &g.u, UTF_SIZ);
case 12: case 12:
utf8decode("", &g.u, UTF_SIZ); utf8decode("", &g.u, UTF_SIZ);
case 13: case 13:
utf8decode("", &g.u, UTF_SIZ); utf8decode("", &g.u, UTF_SIZ);
case 14: case 14:
utf8decode("", &g.u, UTF_SIZ); utf8decode("", &g.u, UTF_SIZ);
case 15: case 15:
utf8decode("", &g.u, UTF_SIZ); */ utf8decode("", &g.u, UTF_SIZ); */
case 7: /* st extension: snowman */ case 7: /* st extension: snowman */
utf8decode("", &g.u, UTF_SIZ); utf8decode("", &g.u, UTF_SIZ);
// utf8decode("☃", &g.u, UTF_SIZ); // utf8decode("☃", &g.u, UTF_SIZ);
case 0: /* Blinking Block */ case 0: /* Blinking Block */
case 1: /* Blinking Block (Default) */ case 1: /* Blinking Block (Default) */
@ -4528,6 +4528,7 @@ run:
if (!opt_title && !opt_line) if (!opt_title && !opt_line)
opt_title = basename(xstrdup(argv[0])); opt_title = basename(xstrdup(argv[0]));
} }
dothatLua();
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
XSetLocaleModifiers(""); XSetLocaleModifiers("");
tnew(MAX(cols, 1), MAX(rows, 1)); tnew(MAX(cols, 1), MAX(rows, 1));