diff options
Diffstat (limited to 'src/h_luac.c')
-rw-r--r-- | src/h_luac.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/h_luac.c b/src/h_luac.c index 55e4083..f98e0a5 100644 --- a/src/h_luac.c +++ b/src/h_luac.c @@ -1,21 +1,22 @@ /* -------------------------------------------------------------------------- - * lua language specific functions (for compiled Lua chunks) - * Copyright (c) 2003-2007 Nathan Angelacos (nangel@users.sourceforge.net) + * Copyright 2003-2011 (inclusive) Nathan Angelacos + * (nangel@users.sourceforge.net) + * + * This file is part of haserl. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Haserl is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * Haserl is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with haserl. If not, see <http://www.gnu.org/licenses/>. * - ------------------------------------------------------------------------- */ + * ------------------------------------------------------------------------ */ #if HAVE_CONFIG_H #include <config.h> @@ -33,23 +34,25 @@ extern lua_State *lua_vm; /* tokenizer was not used, so script is NULL, but name is the filename to process */ void -luac_doscript (buffer_t *script, char *name) +luac_doscript (buffer_t * script, char *name) { - if (luaL_loadfile (lua_vm, name) || lua_pcall(lua_vm, 0, LUA_MULTRET, 0)) + if (luaL_loadfile (lua_vm, name) || lua_pcall (lua_vm, 0, LUA_MULTRET, 0)) { - die_with_message (NULL, NULL, "Cannot load lua and execute chunk: %s", lua_tostring(lua_vm, -1)); + die_with_message (NULL, NULL, "Cannot load lua and execute chunk: %s", + lua_tostring (lua_vm, -1)); } } int -h_luac_loadfile (lua_State *L) +h_luac_loadfile (lua_State * L) { const char *filename = luaL_checkstring (L, 1); if (luaL_loadfile (L, filename)) { - die_with_message (NULL, NULL, "Cannot load file '%s': %s", filename, lua_tostring(L, -1)); - } /* no error: function is on the stack */ + die_with_message (NULL, NULL, "Cannot load file '%s': %s", filename, + lua_tostring (L, -1)); + } /* no error: function is on the stack */ return 1; } |