/* * anylike * * anylike is a ... * * * Copyright (C) 2009-2010 Markus Grueneis * Christian Pointner * * This file is part of anylike. * * anylike 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 3 of the License, or * any later version. * * anylike 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 anylike. If not, see . */ #include #include #include #include "datatypes.h" #include "options.h" int main_loop(options_t* opt) { lua_State *L; L = lua_open(); luaopen_base(L); printf("will now start main_loop.lua:\n"); lua_dofile(L, "main_loop.lua"); printf("script.lua just returned\n"); lua_close(L); return 0; } int main(int argc, char* argv[]) { options_t opt; int ret = options_parse(&opt, argc, argv); if(ret) { if(ret > 0) { fprintf(stderr, "syntax error near: %s\n\n", argv[ret]); } if(ret == -2) { fprintf(stderr, "memory error on options_parse, exitting\n"); } if(ret == -3) { options_print_version(); } if(ret != -2 && ret != -3) options_print_usage(); if(ret == -1 || ret == -3) ret = 0; options_clear(&opt); exit(ret); } options_parse_post(&opt); ret = main_loop(&opt); options_clear(&opt); return ret; }