1 /* 2 * cmd.h -- read and execute commands, this is the main loop 3 * 4 * Yet Another FTP Client 5 * Copyright (C) 1998-2001, Martin Hedenfalk <mhe@stacken.kth.se> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. See COPYING for more details. 11 */ 12 13 #ifndef _cmd_h_included 14 #define _cmd_h_included 15 16 #include "args.h" 17 18 #define CMD_AMBIGUOUS (cmd_t *)-1 19 20 typedef void (*vfunc)(int argc, char **argv); 21 22 typedef struct { 23 char *cmd; 24 bool needconnect, needlogdin; 25 bool auto_unquote; 26 int cpltype; 27 vfunc func; 28 } cmd_t; 29 30 /* in commands.c */ 31 cmd_t *find_cmd(const char *name); 32 cmd_t *find_func(const char *cmd, bool print_error); 33 int rearrange_redirections(args_t *args); 34 35 void command_loop(void); 36 void exit_yafc(void) YAFC_NORETURN; 37 extern void exe_cmdline(char *str, bool aliases_are_expanded); 38 39 extern cmd_t cmds[]; 40 41 #endif 42