Skip to content

Commit

Permalink
fix: add the "const" qualifier to the api
Browse files Browse the repository at this point in the history
Resolves #95
  • Loading branch information
tomghuang committed May 5, 2024
1 parent 14c244a commit 3634526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/arg_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void arg_make_get_help_msg(arg_dstr_t res) {
arg_dstr_catf(res, "Please type '%s help' to get more information.\n", module_name());
}

void arg_make_help_msg(arg_dstr_t ds, char* cmd_name, void** argtable) {
void arg_make_help_msg(arg_dstr_t ds, const char* cmd_name, void** argtable) {
arg_cmd_info_t* cmd_info = (arg_cmd_info_t*)arg_hashtable_search(s_hashtable, cmd_name);
if (cmd_info) {
arg_dstr_catf(ds, "%s: %s\n", cmd_name, cmd_info->description);
Expand All @@ -259,7 +259,7 @@ void arg_make_syntax_err_msg(arg_dstr_t ds, void** argtable, struct arg_end* end
arg_dstr_cat(ds, "\n");
}

int arg_make_syntax_err_help_msg(arg_dstr_t ds, char* name, int help, int nerrors, void** argtable, struct arg_end* end, int* exitcode) {
int arg_make_syntax_err_help_msg(arg_dstr_t ds, const char* name, int help, int nerrors, void** argtable, struct arg_end* end, int* exitcode) {
/* help handling
* note: '-h|--help' takes precedence over error reporting
*/
Expand Down
4 changes: 2 additions & 2 deletions src/argtable3.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ ARG_EXTERN arg_cmd_info_t* arg_cmd_itr_value(arg_cmd_itr_t itr);
ARG_EXTERN int arg_cmd_itr_search(arg_cmd_itr_t itr, void* k);
ARG_EXTERN void arg_mgsort(void* data, int size, int esize, int i, int k, arg_comparefn* comparefn);
ARG_EXTERN void arg_make_get_help_msg(arg_dstr_t res);
ARG_EXTERN void arg_make_help_msg(arg_dstr_t ds, char* cmd_name, void** argtable);
ARG_EXTERN void arg_make_help_msg(arg_dstr_t ds, const char* cmd_name, void** argtable);
ARG_EXTERN void arg_make_syntax_err_msg(arg_dstr_t ds, void** argtable, struct arg_end* end);
ARG_EXTERN int arg_make_syntax_err_help_msg(arg_dstr_t ds, char* name, int help, int nerrors, void** argtable, struct arg_end* end, int* exitcode);
ARG_EXTERN int arg_make_syntax_err_help_msg(arg_dstr_t ds, const char* name, int help, int nerrors, void** argtable, struct arg_end* end, int* exitcode);
ARG_EXTERN void arg_set_module_name(const char* name);
ARG_EXTERN void arg_set_module_version(int major, int minor, int patch, const char* tag);

Expand Down

0 comments on commit 3634526

Please sign in to comment.