Browse Source

* commands.[ch] : add f2b_cmd_check_argc()

master
Alex 'AdUser' Z 8 years ago
parent
commit
fd6e9b1aae
  1. 7
      src/commands.c
  2. 3
      src/commands.h

7
src/commands.c

@ -192,3 +192,10 @@ f2b_cmd_parse(const char *src, char *buf, size_t buflen) {
return CMD_NONE; return CMD_NONE;
} }
bool
f2b_cmd_check_argc(enum f2b_cmd_type type, int argc) {
if (commands[type].argc == argc)
return true;
return false;
}

3
src/commands.h

@ -34,4 +34,7 @@ void f2b_cmd_help();
enum f2b_cmd_type enum f2b_cmd_type
f2b_cmd_parse(const char *src, char *buf, size_t buflen); f2b_cmd_parse(const char *src, char *buf, size_t buflen);
bool
f2b_cmd_check_argc(enum f2b_cmd_type type, int argc);
#endif /* F2B_COMMANDS_H_ */ #endif /* F2B_COMMANDS_H_ */

Loading…
Cancel
Save