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