cmd_dispatch.h (909B)
1 /* 2 * MySmartUSB MK3 Interface 3 * 4 * @copyright: Copyright (c) 2012, Dominik Schmidt 5 * @author: Dominik Schmidt <das1993@hotmail.com> 6 * @version: 0.0.0 7 * @license: CC-BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/) 8 * 9 */ 10 #pragma once 11 #include <option.h> 12 #include <cmd.h> 13 14 struct command_def{ 15 struct option opt; 16 17 char *name; 18 int (*callback)(struct command_exec *cmd, int fd); 19 unsigned short int request_mymode; 20 }; 21 extern struct command_def commands[]; 22 extern int executeCommand(struct command_exec *cmd, int fd); 23 extern int processCommands(struct command_exec **cmdlist, int fd); 24 extern struct command_def *getCmdDefByName(char *name); 25 extern struct command_def *getCmdDefByOpt(char *desc); 26 extern struct command_exec *newCommand(struct command_def *cd); 27 28 extern int prepareCommandExecution(int fd, struct conf *config); 29 extern int finishCommandExecution(int fd, struct conf *config);