/* ARISA - Admin Interface - Scripting Menu * Copyright (C) 2003 Carl Ritson * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ MENU_CMD(cmd_scripting_interpreters) { int i,j; admin_msg(ac,"-- Interpreters --"); LOCKR(&(global->se.lock)); for(i = 0; i < global->se.no_interpreters; ++i) { interpreter_t *in = global->se.interpreters[i]; LOCK(in); admin_msg(ac,"-- Interpreter: %s --",in->name); admin_msg(ac,"File types:"); for(j = 0; j < in->no_types; ++j) admin_msg(ac," %s",in->types[j]); admin_msg(ac,"Loaded Scripts:"); for(j = 0; j < in->no_loaded; ++j) admin_msg(ac," %s",in->loaded[j]); UNLOCK(in); } UNLOCKR(&(global->se.lock)); return 0; } MENU_CMD(cmd_scripting_autoload) { int ret; LOCK(global->settings); ret = cmd_strarr(ac, &(global->settings->scripts), &(global->settings->no_scripts), args,no_args); UNLOCK(global->settings); return ret; } MENU_CMD(cmd_scripting_load) { if(no_args >= 2) { int ret; switch (tolower(args[0][0])) { case 'l': ret = se_load_script(args[1]); break; case 'r': ret = se_reload_script(args[1]); break; case 'u': ret = se_unload_script(args[1]); break; default: ret = -1; break; } if(ret != 0) admin_msg(ac,"Unable to process command for script: %s",args[1]); } else admin_msg(ac,"%s