diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 3985e00f..92554788 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,9 @@ +2011-06-27 Mike Frysinger + + * include/urjtag/cmd.h, src/cmd/cmd.h, src/cmd/cmd_cmd.c: Move prototypes + for some useful command related functions to the public cmd.h header. + In the process, constify the array passed into urj_cmd_params. + 2011-06-25 Mike Frysinger * src/cmd/cmd_initbus.c: Drop useless double const keywords. diff --git a/urjtag/include/urjtag/cmd.h b/urjtag/include/urjtag/cmd.h index b7ea807e..c812cb2d 100644 --- a/urjtag/include/urjtag/cmd.h +++ b/urjtag/include/urjtag/cmd.h @@ -56,4 +56,30 @@ int urj_cmd_run (urj_chain_t *chain, char *params[]); */ char **urj_cmd_complete (urj_chain_t *chain, const char *line, int point); +/** + * Tests if chain has a cable pointer + * + * @return URJ_STATUS_OK if success; URJ_STATUS_FAIL on error or failure + */ +int urj_cmd_test_cable (urj_chain_t *chain); + +/** + * Count the number of parameters in this NULL-terminated list + * + * @param params pointer to array of null-terminated strings + * + * @return number of parameter strings; 0 for none. + */ +int urj_cmd_params (char * const params[]); + +/** + * Parse parameter as a long unsigned + * + * @param s string containing textual representation of a number + * @param i pointer to variable in which to store the resulting number + * + * @return URJ_STATUS_OK on success, URJ_STATUS_FAIL on error + */ +int urj_cmd_get_number (const char *s, long unsigned *i); + #endif /* URJ_CMD_H */ diff --git a/urjtag/src/cmd/cmd.h b/urjtag/src/cmd/cmd.h index 1a92a153..ad405e11 100644 --- a/urjtag/src/cmd/cmd.h +++ b/urjtag/src/cmd/cmd.h @@ -56,23 +56,6 @@ typedef struct extern const urj_cmd_t * const urj_cmds[]; -/** - * Tests if chain has a cable pointer - * - * @return URJ_STATUS_OK if success; URJ_STATUS_FAIL on error or failure - */ -int urj_cmd_test_cable (urj_chain_t *chain); - -/** - * Count the number of parameters in this NULL-terminated list - */ -int urj_cmd_params (char *params[]); -/** - * Parse parameter as a long unsigned - * @return URJ_STATUS_OK on success, URJ_STATUS_FAIL on error - */ -int urj_cmd_get_number (const char *s, long unsigned *i); - /** * Show a list of structures with name/desc */ diff --git a/urjtag/src/cmd/cmd_cmd.c b/urjtag/src/cmd/cmd_cmd.c index de4eb061..7f8a94f4 100644 --- a/urjtag/src/cmd/cmd_cmd.c +++ b/urjtag/src/cmd/cmd_cmd.c @@ -234,7 +234,7 @@ urj_cmd_run (urj_chain_t *chain, char *params[]) } int -urj_cmd_params (char *params[]) +urj_cmd_params (char * const params[]) { int i = 0;