/* * iroffer by David Johnson (PMG) * Copyright (C) 1998-2005 David Johnson * * By using this file, you agree to the terms and conditions set * forth in the GNU General Public License. More information is * available in the README file. * * If you received this file without documentation, it can be * downloaded from http://iroffer.org/ * * @(#) iroffer_admin.c 1.215@(#) * pmg@wellington.i202.centerclick.org|src/iroffer_admin.c|20051123201143|48668 * */ /* include the headers */ #include "iroffer_config.h" #include "iroffer_defines.h" #include "iroffer_headers.h" #include "iroffer_globals.h" #include "dinoex_utilities.h" #include "dinoex_admin.h" #include "dinoex_misc.h" /* local functions */ static void #ifdef __GNUC__ __attribute__ ((format(printf, 2, 3))) #endif u_respond(const userinput * const u, const char *format, ...); static void u_help(const userinput * const u); static void u_xdl_head(const userinput * const u); static void u_xdl_foot(const userinput * const u); static void u_xdl_full(const userinput * const u); static void u_xdl_group(const userinput * const u); static void u_xdl(const userinput * const u); static void u_xds(const userinput * const u); static void u_dcl(const userinput * const u); static void u_dcld(const userinput * const u); static void u_qul(const userinput * const u); static void u_close(const userinput * const u); static void u_closeu(const userinput * const u); static void u_nomin(const userinput * const u); static void u_nomax(const userinput * const u); static void u_rmq(const userinput * const u); static void u_raw(const userinput * const u); static void u_redraw(const userinput * const u); static void u_delhist(const userinput * const u); static void u_info(const userinput * const u); static void u_remove(const userinput * const u); static void u_removedir(const userinput * const u); static void u_removegroup(const userinput * const u); static void u_send(const userinput * const u); static void u_psend(const userinput * const u); static void u_msg(const userinput * const u); static void u_mesg(const userinput * const u); static void u_mesq(const userinput * const u); static void u_quit(const userinput * const u); static void u_status(const userinput * const u); static void u_chfile(const userinput * const u); static void u_chdesc(const userinput * const u); static void u_chnote(const userinput * const u); static void u_chmins(const userinput * const u); static void u_chmaxs(const userinput * const u); static void u_chgets(const userinput * const u); static void u_add(const userinput * const u); static void u_adddir(const userinput * const u); static void u_addnew(const userinput * const u); static void u_addgroup(const userinput * const u); static void u_chatme(const userinput * const u); static void u_chatl(const userinput * const u); static void u_closec(const userinput * const u); static void u_rehash(const userinput * const u); static void u_botinfo(const userinput * const u); static void u_ignl(const userinput * const u); static void u_ignore(const userinput * const u); static void u_unignore(const userinput * const u); static void u_nosave(const userinput * const u); static void u_nosend(const userinput * const u); static void u_nolist(const userinput * const u); static void u_renumber(const userinput * const u); static void u_msgread(const userinput * const u); static void u_msgdel(const userinput * const u); static void u_memstat(const userinput * const u); static void u_qsend(const userinput * const u); static void u_shutdown(const userinput * const u); static void u_debug(const userinput * const u); static void u_jump(const userinput * const u); static void u_servqc(const userinput * const u); static void u_servers(const userinput * const u); static void u_trinfo(const userinput * const u); static void u_listul(const userinput * const u); static void u_clearrecords(const userinput * const u); static void u_rmul(const userinput * const u); static void u_crash(const userinput * const u); static void u_chanl(const userinput * const u); /* iroffer-lamm: add-ons */ static void u_announce(const userinput * const u); static void u_addann(const userinput * const u); static void u_race(const userinput * const u); static void u_unrace(const userinput * const u); static void u_riddle(const userinput * const u); static void u_answer(const userinput * const u); static void u_shriddle(const userinput * const u); static void u_relist(const userinput * const u); /* senty's relist (redone) */ static void u_scap (const userinput * const u); /* (senty's) */ static void u_ssends (const userinput * const u); /* (senty's) */ static void u_squeues (const userinput * const u); /* (senty's) */ static void u_queue(const userinput * const u); typedef struct { const short help_section; const userinput_method_e methods_allowed; void (*handler)(const userinput * const); const char *command; const char *args; const char *desc; } userinput_parse_t; /* local info */ static const userinput_parse_t userinput_parse[] = { {1,method_allow_all,u_help, "HELP",NULL,"Shows Help"}, {1,method_allow_all_xdl,u_xdl_full, "XDLFULL",NULL,"Lists All Offered Files"}, {1,method_allow_all_xdl,u_xdl_group, "XDLGROUP","","Show group "}, {1,method_allow_all_xdl,u_xdl, "XDL",NULL,"Lists Offered Groups and Files without group"}, {1,method_allow_all,a_xdlock, "XDLOCK",NULL,"Show all locked packs"}, {1,method_allow_all,u_xds, "XDS",NULL,"Save State File"}, {1,method_allow_all,u_dcl, "DCL",NULL,"Lists Current Transfers"}, {1,method_allow_all,u_dcld, "DCLD",NULL,"Lists Current Transfers with Details"}, {1,method_allow_all,u_trinfo, "TRINFO","n","Lists Information About Transfer n"}, {1,method_allow_all,u_qul, "QUL",NULL,"Lists Current Queue"}, {1,method_allow_all,u_ignl, "IGNL",NULL,"Show Ignored List"}, {1,method_allow_all,u_listul, "LISTUL",NULL,"Shows contents of upload directory"}, {1,method_allow_all,u_chanl, "CHANL",NULL,"Shows channel list with member list"}, {2,method_allow_all,u_close, "CLOSE","n","Cancels Transfer with ID = n"}, {2,method_allow_all,u_closeu, "CLOSEU","n","Cancels Upload with ID = n"}, {2,method_allow_all,u_rmq, "RMQ","n","Removes Queue Number n"}, {2,method_allow_all,u_nomin, "NOMIN","n","Disables Minspeed For Transfer ID n"}, {2,method_allow_all,u_nomax, "NOMAX","n","Disables Maxspeed For Transfer ID n"}, {2,method_allow_all,u_send, "SEND","nick n","Sends Pack n to nick"}, {2,method_allow_all,u_psend, "PSEND","