Ejemplo n.º 1
0
void
init_lua(gchar **uris, xdgHandle *xdg)
{
    gchar *uri;
    lua_State *L;

    /* init globalconf structs */
    globalconf.signals = signal_tree_new();
    globalconf.windows = g_ptr_array_new();

    /* init lua */
    luaH_init(xdg);
    L = globalconf.L;

    /* push a table of the statup uris */
    lua_newtable(L);
    for (gint i = 0; (uri = uris[i]); i++) {
        lua_pushstring(L, uri);
        lua_rawseti(L, -2, i + 1);
    }
    lua_setglobal(L, "uris");

    /* parse and run configuration file */
    if(!luaH_parserc(xdg, globalconf.confpath, TRUE))
        fatal("couldn't find rc file");

    if (!globalconf.windows->len)
        fatal("no windows spawned by rc file load, exiting");
}
Ejemplo n.º 2
0
void
init_lua(gchar **uris)
{
    gchar *uri;
    lua_State *L;

    /* init globalconf structs */
    globalconf.windows = g_ptr_array_new();

    /* init lua */
    luaH_init();
    L = globalconf.L;

    /* push a table of the statup uris */
    lua_newtable(L);
    for (gint i = 0; uris && (uri = uris[i]); i++) {
        lua_pushstring(L, uri);
        lua_rawseti(L, -2, i + 1);
    }
    lua_setglobal(L, "uris");
}