shell: shell_utils internal api update

Add prefix z_ to internal functions provided by the shell_utils
module.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
Jakub Rzeszutko 2020-12-07 16:10:11 +01:00 committed by Carles Cufí
commit 889e37b8d9
8 changed files with 121 additions and 118 deletions

View file

@ -15,29 +15,30 @@ extern "C" {
#define SHELL_MSG_SPECIFY_SUBCOMMAND "Please specify a subcommand.\n"
int32_t row_span_with_buffer_offsets_get(struct shell_multiline_cons *cons,
uint16_t offset1,
uint16_t offset2);
int32_t z_row_span_with_buffer_offsets_get(struct shell_multiline_cons *cons,
uint16_t offset1,
uint16_t offset2);
int32_t column_span_with_buffer_offsets_get(struct shell_multiline_cons *cons,
uint16_t offset1,
uint16_t offset2);
int32_t z_column_span_with_buffer_offsets_get(struct shell_multiline_cons *cons,
uint16_t offset1,
uint16_t offset2);
void shell_multiline_data_calc(struct shell_multiline_cons *cons,
uint16_t buff_pos, uint16_t buff_len);
void z_shell_multiline_data_calc(struct shell_multiline_cons *cons,
uint16_t buff_pos, uint16_t buff_len);
static inline uint16_t shell_strlen(const char *str)
static inline uint16_t z_shell_strlen(const char *str)
{
return str == NULL ? 0U : (uint16_t)strlen(str);
}
char shell_make_argv(size_t *argc, const char **argv,
char *cmd, uint8_t max_argc);
char z_shell_make_argv(size_t *argc, const char **argv,
char *cmd, uint8_t max_argc);
/** @brief Removes pattern and following space
*
*/
void shell_pattern_remove(char *buff, uint16_t *buff_len, const char *pattern);
void z_shell_pattern_remove(char *buff, uint16_t *buff_len,
const char *pattern);
/** @brief Get subcommand with given index from the root.
*
@ -47,12 +48,12 @@ void shell_pattern_remove(char *buff, uint16_t *buff_len, const char *pattern);
*
* @return Fetched command or null if command with that index does not exist.
*/
const struct shell_static_entry *shell_cmd_get(
const struct shell_static_entry *z_shell_cmd_get(
const struct shell_static_entry *parent,
size_t idx,
struct shell_static_entry *dloc);
const struct shell_static_entry *shell_find_cmd(
const struct shell_static_entry *z_shell_find_cmd(
const struct shell_static_entry *parent,
const char *cmd_str,
struct shell_static_entry *dloc);
@ -69,7 +70,7 @@ const struct shell_static_entry *shell_find_cmd(
*
* @return Pointer to found command.
*/
const struct shell_static_entry *shell_get_last_command(
const struct shell_static_entry *z_shell_get_last_command(
const struct shell_static_entry *entry,
size_t argc,
const char *argv[],
@ -77,16 +78,15 @@ const struct shell_static_entry *shell_get_last_command(
struct shell_static_entry *dloc,
bool only_static);
void shell_spaces_trim(char *str);
void z_shell_spaces_trim(char *str);
void z_shell_cmd_trim(const struct shell *shell);
static inline void transport_buffer_flush(const struct shell *shell)
static inline void z_transport_buffer_flush(const struct shell *shell)
{
z_shell_fprintf_buffer_flush(shell->fprintf_ctx);
}
void shell_cmd_trim(const struct shell *shell);
static inline bool shell_in_select_mode(const struct shell *shell)
static inline bool z_shell_in_select_mode(const struct shell *shell)
{
return shell->ctx->selected_cmd == NULL ? false : true;
}