summaryrefslogtreecommitdiffstats
path: root/lib/ss
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 04:59:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-21 04:59:33 +0000
commit73193347133e750faf27f88fd3ab31ce43aff062 (patch)
treee28a6d9512d1787b1fcbe9167188c9d134bf51d9 /lib/ss
parentAdding upstream version 1.47.0. (diff)
downloade2fsprogs-upstream.tar.xz
e2fsprogs-upstream.zip
Adding upstream version 1.47.1.upstream/1.47.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ss')
-rw-r--r--lib/ss/execute_cmd.c2
-rw-r--r--lib/ss/help.c2
-rw-r--r--lib/ss/list_rqs.c2
-rw-r--r--lib/ss/listen.c2
-rw-r--r--lib/ss/requests.c8
-rw-r--r--lib/ss/ss.h16
-rw-r--r--lib/ss/ss_internal.h2
-rw-r--r--lib/ss/test_ss.c6
8 files changed, 19 insertions, 21 deletions
diff --git a/lib/ss/execute_cmd.c b/lib/ss/execute_cmd.c
index d092134..1f43990 100644
--- a/lib/ss/execute_cmd.c
+++ b/lib/ss/execute_cmd.c
@@ -100,7 +100,7 @@ static int check_request_table(register ss_request_table *rqtbl, int argc,
for (name = request->command_names; *name; name++)
if (!strcmp(*name, string)) {
info->current_request = request->command_names[0];
- (request->function)(argc, (const char *const *) argv,
+ (request->function)(argc, (ss_argv_t) argv,
sci_idx,info->info_ptr);
info->current_request = (char *)NULL;
return(0);
diff --git a/lib/ss/help.c b/lib/ss/help.c
index 54c78f2..d3319b6 100644
--- a/lib/ss/help.c
+++ b/lib/ss/help.c
@@ -34,7 +34,7 @@
#endif
#include "ss_internal.h"
-void ss_help(int argc, char const * const *argv, int sci_idx, pointer info_ptr)
+void ss_help(int argc, ss_argv_t argv, int sci_idx, pointer info_ptr)
{
char *buffer;
char const *request_name;
diff --git a/lib/ss/list_rqs.c b/lib/ss/list_rqs.c
index 89e37bb..408d3ac 100644
--- a/lib/ss/list_rqs.c
+++ b/lib/ss/list_rqs.c
@@ -22,7 +22,7 @@
typedef void sigret_t;
void ss_list_requests(int argc __SS_ATTR((unused)),
- const char * const *argv __SS_ATTR((unused)),
+ ss_argv_t argv __SS_ATTR((unused)),
int sci_idx, void *infop __SS_ATTR((unused)))
{
ss_request_entry *entry;
diff --git a/lib/ss/listen.c b/lib/ss/listen.c
index 9578c3e..df1311d 100644
--- a/lib/ss/listen.c
+++ b/lib/ss/listen.c
@@ -135,7 +135,7 @@ void ss_abort_subsystem(int sci_idx, int code)
}
void ss_quit(int argc __SS_ATTR((unused)),
- const char * const *argv __SS_ATTR((unused)),
+ ss_argv_t argv __SS_ATTR((unused)),
int sci_idx, pointer infop __SS_ATTR((unused)))
{
ss_abort_subsystem(sci_idx, 0);
diff --git a/lib/ss/requests.c b/lib/ss/requests.c
index 33ce5d2..6a8d00b 100644
--- a/lib/ss/requests.c
+++ b/lib/ss/requests.c
@@ -24,7 +24,7 @@
* ss_self_identify -- assigned by default to the "." request
*/
void ss_self_identify(int argc __SS_ATTR((unused)),
- const char * const *argv __SS_ATTR((unused)),
+ ss_argv_t argv __SS_ATTR((unused)),
int sci_idx, void *infop __SS_ATTR((unused)))
{
register ss_data *info = ss_info(sci_idx);
@@ -36,7 +36,7 @@ void ss_self_identify(int argc __SS_ATTR((unused)),
* ss_subsystem_name -- print name of subsystem
*/
void ss_subsystem_name(int argc __SS_ATTR((unused)),
- const char * const *argv __SS_ATTR((unused)),
+ ss_argv_t argv __SS_ATTR((unused)),
int sci_idx,
void *infop __SS_ATTR((unused)))
{
@@ -47,7 +47,7 @@ void ss_subsystem_name(int argc __SS_ATTR((unused)),
* ss_subsystem_version -- print version of subsystem
*/
void ss_subsystem_version(int argc __SS_ATTR((unused)),
- const char * const *argv __SS_ATTR((unused)),
+ ss_argv_t argv __SS_ATTR((unused)),
int sci_idx,
void *infop __SS_ATTR((unused)))
{
@@ -59,7 +59,7 @@ void ss_subsystem_version(int argc __SS_ATTR((unused)),
* set up as (dont_list,dont_summarize))
*/
void ss_unimplemented(int argc __SS_ATTR((unused)),
- const char * const *argv __SS_ATTR((unused)),
+ ss_argv_t argv __SS_ATTR((unused)),
int sci_idx, void *infop __SS_ATTR((unused)))
{
ss_perror(sci_idx, SS_ET_UNIMPLEMENTED, "");
diff --git a/lib/ss/ss.h b/lib/ss/ss.h
index 7333ffc..e53da50 100644
--- a/lib/ss/ss.h
+++ b/lib/ss/ss.h
@@ -26,7 +26,8 @@
#include <ss/ss_err.h>
#define __SS_CONST const
-#define __SS_PROTO (int, const char * const *, int, void *)
+typedef char * const *ss_argv_t;
+#define __SS_PROTO (int, ss_argv_t, int, void *)
#ifdef __GNUC__
#define __SS_ATTR(x) __attribute__(x)
@@ -79,14 +80,11 @@ int ss_execute_line(int, char *);
void ss_add_request_table(int, ss_request_table *, int, int *);
void ss_delete_request_table(int, ss_request_table *, int *);
void ss_abort_subsystem(int sci_idx, int code);
-void ss_quit(int argc, const char * const *argv, int sci_idx, void *infop);
-void ss_self_identify(int argc, const char * const *argv, int sci_idx, void *infop);
-void ss_subsystem_name(int argc, const char * const *argv,
- int sci_idx, void *infop);
-void ss_subsystem_version(int argc, const char * const *argv,
- int sci_idx, void *infop);
-void ss_unimplemented(int argc, const char * const *argv,
- int sci_idx, void *infop);
+void ss_quit(int argc, ss_argv_t argv, int sci_idx, void *infop);
+void ss_self_identify(int argc, ss_argv_t argv, int sci_idx, void *infop);
+void ss_subsystem_name(int argc, ss_argv_t argv, int sci_idx, void *infop);
+void ss_subsystem_version(int argc, ss_argv_t argv, int sci_idx, void *infop);
+void ss_unimplemented(int argc, ss_argv_t argv, int sci_idx, void *infop);
void ss_set_prompt(int sci_idx, char *new_prompt);
char *ss_get_prompt(int sci_idx);
void ss_get_readline(int sci_idx);
diff --git a/lib/ss/ss_internal.h b/lib/ss/ss_internal.h
index 7b1d23b..e2a8d75 100644
--- a/lib/ss/ss_internal.h
+++ b/lib/ss/ss_internal.h
@@ -86,7 +86,7 @@ int ss_execute_line(int sci_idx, char *line_ptr);
char **ss_parse(int sci_idx, char *line_ptr, int *argc_ptr);
ss_abbrev_info *ss_abbrev_initialize(char *, int *);
void ss_page_stdin(void) __SS_ATTR((noreturn));
-void ss_list_requests(int, char const * const *, int, pointer);
+void ss_list_requests(int argc, ss_argv_t argv, int sci_idex, void *infop);
int ss_execute_command(int sci_idx, char *argv[]);
int ss_pager_create(void);
char *ss_safe_getenv(const char *arg);
diff --git a/lib/ss/test_ss.c b/lib/ss/test_ss.c
index 53ca99f..1258000 100644
--- a/lib/ss/test_ss.c
+++ b/lib/ss/test_ss.c
@@ -136,9 +136,9 @@ int main(int argc, char **argv)
}
-void test_cmd (argc, argv)
- int argc;
- char **argv;
+void test_cmd(int argc, ss_argv_t argv,
+ int sci_idx __SS_ATTR((unused)),
+ void *infop __SS_ATTR((unused)))
{
printf("Hello, world!\n");
printf("Args: ");