screen: Stop using a_tokenize()

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-09-02 18:53:44 +02:00
parent a440dab39d
commit 53ac35930d
1 changed files with 16 additions and 24 deletions

View File

@ -484,7 +484,6 @@ luaA_screen_tags(lua_State *L)
static int static int
luaA_screen_index(lua_State *L) luaA_screen_index(lua_State *L)
{ {
size_t len;
const char *buf; const char *buf;
screen_t *s; screen_t *s;
@ -503,21 +502,16 @@ luaA_screen_index(lua_State *L)
/* No, so remove everything. */ /* No, so remove everything. */
lua_pop(L, 2); lua_pop(L, 2);
buf = luaL_checklstring(L, 2, &len); buf = luaL_checkstring(L, 2);
s = lua_touserdata(L, 1); s = lua_touserdata(L, 1);
switch(a_tokenize(buf, len)) if(a_strcmp(buf, "index") == 0)
{
case A_TK_INDEX:
lua_pushinteger(L, screen_array_indexof(&globalconf.screens, s) + 1); lua_pushinteger(L, screen_array_indexof(&globalconf.screens, s) + 1);
break; else if(a_strcmp(buf, "geometry") == 0)
case A_TK_GEOMETRY:
luaA_pusharea(L, s->geometry); luaA_pusharea(L, s->geometry);
break; else if(a_strcmp(buf, "workarea") == 0)
case A_TK_WORKAREA:
luaA_pusharea(L, screen_area_get(s, true)); luaA_pusharea(L, screen_area_get(s, true));
break; else if(a_strcmp(buf, "outputs") == 0)
case A_TK_OUTPUTS:
{ {
lua_createtable(L, 0, s->outputs.len); lua_createtable(L, 0, s->outputs.len);
foreach(output, s->outputs) foreach(output, s->outputs)
@ -530,10 +524,8 @@ luaA_screen_index(lua_State *L)
lua_setfield(L, -2, output->name); lua_setfield(L, -2, output->name);
} }
} }
break; else
default:
return 0; return 0;
}
return 1; return 1;
} }