1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 01:56:44 +02:00

big refactor for command functionality

This commit is contained in:
Jfreegman
2013-11-09 21:43:56 -05:00
parent 1b041cb089
commit 549fc5ecb6
11 changed files with 732 additions and 180 deletions

23
src/chat_commands.h Normal file
View File

@ -0,0 +1,23 @@
/*
* Toxic -- Tox Curses Client
*/
/* commands */
void cmd_help(WINDOW *window, ToxWindow *chatwin, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_groupinvite(WINDOW *window, ToxWindow *chatwin, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_join_group(WINDOW *window, ToxWindow *chatwin, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_savefile(WINDOW *window, ToxWindow *chatwin, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
void cmd_sendfile(WINDOW *window, ToxWindow *chatwin, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
#define CHAT_NUM_COMMANDS 5
static struct {
char *name;
void (*func)(WINDOW *, ToxWindow *, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]);
} chat_commands[] = {
{ "/help", cmd_help },
{ "/invite", cmd_groupinvite },
{ "/join", cmd_join_group },
{ "/savefile", cmd_savefile },
{ "/sendfile", cmd_sendfile },
};