Skip to content

Instantly share code, notes, and snippets.

@FurryHead
Created June 28, 2011 18:35
Show Gist options
  • Save FurryHead/1051828 to your computer and use it in GitHub Desktop.
Save FurryHead/1051828 to your computer and use it in GitHub Desktop.
lua_getglobal(L, "plugins");
lua_pushnil(L);
string pname;
bool loaded = false;
while (lua_next(L, -2) != 0) {
/* key is at -2, value at -1 */
if (lua_isstring(L, -2)) {
pname = lua_tostring(L, -2);
if (pname == name) {
loaded = true;
}
}
lua_pop(L, 1);
}
lua_pop(L, 1);
return loaded;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment