All pastes #761420 Raw Edit

Anonymous

public cpp v1 · immutable
·published 2007-11-04 21:21 UTC
rendered paste body
/* *      luautil.hpp *       *      Copyright 2007 Julian Moore <jlulian38@localhost> *       *      This program is free software; you can redistribute it and/or modify *      it under the terms of the GNU General Public License as published by *      the Free Software Foundation; either version 2 of the License, or *      (at your option) any later version. *       *      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. *       *      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., 51 Franklin Street, Fifth Floor, Boston, *      MA 02110-1301, USA. */bool isError(lua_State* L){	if (lua_isstring(L,-1)) {		return true;	}else{		return false;	}}const char* getError(lua_State* L){	if (isError(L)) {		const char* err = lua_tostring(L,-1);		lua_pop(L,1);		return err;	}else{		return "";	}}void printError(lua_State* L,const char* msg){	if (isError(L)) {		std::cerr << msg << getError(L) << std::endl;	}}void DoString(lua_State* L,const char* str){	luaL_dostring(L,str);	printError(L,"[C++ STRING]: ");}void DoFile(lua_State* L,const char* str){	luaL_dofile(L,str);	printError(L,"[C++ FILE]: ");}#include "ircluautil.hpp"