From acd4808620b0dc1e7a83befc0b7ede936f7149e3 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Wed, 2 Aug 2000 19:42:26 +0000 Subject: [PATCH] * requests.c (DECLARE): Fix prototype for dispatch functions to properly match what is expected by ss library. * pager.c (ss_pager_create): Cast return from fork to int for use in switch statement. * ss.h: Provide full prototype for ss_name(). Add prototypes for ss_execute_line(), ss_delete_invocation(), ss_add_info_dir(), ss_delete_info_dir(), ss_abort_subsystem(), ss_get_prompt(), ss_set_prompt(), ss_add_request_table(), ss_delete_request_table(), ss_quit(). * ss_internal.h: Made full prototypes for ss_parse(), ss_page_stdin(), ss_pagre_create(). Add prototypes for ss_self_identify(), ss_subsystem_name(), ss_subsystem_version(), ss_unimplemented(). Moved ss_execute_line() to ss.h git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12598 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/ss/ChangeLog | 19 +++++++++++++++++++ src/util/ss/pager.c | 4 ++-- src/util/ss/requests.c | 2 +- src/util/ss/ss.h | 26 ++++++++++++++++++++++++-- src/util/ss/ss_internal.h | 11 +++++++---- 5 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/util/ss/ChangeLog b/src/util/ss/ChangeLog index 88200590e..2155c98ab 100644 --- a/src/util/ss/ChangeLog +++ b/src/util/ss/ChangeLog @@ -1,3 +1,22 @@ +2000-08-02 Ezra Peisach + + * requests.c (DECLARE): Fix prototype for dispatch functions to + properly match what is expected by ss library. + + * pager.c (ss_pager_create): Cast return from fork to int for use + in switch statement. + + * ss.h: Provide full prototype for ss_name(). Add prototypes for + ss_execute_line(), ss_delete_invocation(), ss_add_info_dir(), + ss_delete_info_dir(), ss_abort_subsystem(), ss_get_prompt(), + ss_set_prompt(), ss_add_request_table(), + ss_delete_request_table(), ss_quit(). + + * ss_internal.h: Made full prototypes for ss_parse(), + ss_page_stdin(), ss_pagre_create(). Add prototypes for + ss_self_identify(), ss_subsystem_name(), ss_subsystem_version(), + ss_unimplemented(). Moved ss_execute_line() to ss.h + 2000-07-03 Ezra Peisach * test_ss.c (main): Change usage of ss_listen to agree with diff --git a/src/util/ss/pager.c b/src/util/ss/pager.c index 1aaafeab8..733119423 100644 --- a/src/util/ss/pager.c +++ b/src/util/ss/pager.c @@ -36,7 +36,7 @@ int ss_pager_create() if (pipe(filedes) != 0) return(-1); - switch(fork()) { + switch((int) fork()) { case -1: return(-1); case 0: @@ -102,7 +102,7 @@ void ss_page_stdin() char buf[80]; register int n; while ((n = read(0, buf, 80)) > 0) - write(1, buf, n); + write(1, buf, (unsigned) n); } exit(errno); } diff --git a/src/util/ss/requests.c b/src/util/ss/requests.c index 6f0055f57..ccd0f792c 100644 --- a/src/util/ss/requests.c +++ b/src/util/ss/requests.c @@ -9,7 +9,7 @@ #include #include "ss_internal.h" -#define DECLARE(name) void name(argc,argv,sci_idx)int argc,sci_idx;char **argv; +#define DECLARE(name) void name(argc,argv,sci_idx,info_ptr)int argc,sci_idx;const char * const *argv; pointer info_ptr; /* * ss_self_identify -- assigned by default to the "." request diff --git a/src/util/ss/ss.h b/src/util/ss/ss.h index 435f40264..7920115dc 100644 --- a/src/util/ss/ss.h +++ b/src/util/ss/ss.h @@ -48,18 +48,40 @@ typedef struct _ss_rp_options { /* DEFAULT VALUES */ void ss_help __SS_PROTO; void ss_list_requests __SS_PROTO; char *ss_current_request(); -char *ss_name(); #ifdef __STDC__ +char *ss_name(int); void ss_error (int, long, char const *, ...); void ss_perror (int, long, char const *); int ss_listen (int); int ss_create_invocation(char *, char *, char *, ss_request_table *, int *); +void ss_delete_invocation(int); +void ss_add_info_dir(int , char *, int *); +void ss_delete_info_dir(int , char *, int *); +int ss_execute_command(int sci_idx, char **); +void ss_abort_subsystem(int, int); +void ss_set_prompt(int, char *); +char *ss_get_prompt(int); +void ss_add_request_table(int, ss_request_table *, int, int *); +void ss_delete_request_table(int, ss_request_table *, int *); +int ss_execute_line PROTOTYPE((int, char*)); +int ss_quit PROTOTYPE((int, char**, int, pointer)); #else +char *ss_name(); void ss_error (); void ss_perror (); int ss_listen (); int ss_create_invocation(); -#endif +void ss_delete_invocation(); +void ss_add_info_dir(); +void ss_delete_info_dir(); +int ss_execute_command(); void ss_abort_subsystem(); +void ss_set_prompt(); +char *ss_get_prompt(); +void ss_add_request_table(); +void ss_delete_request_table(); +int ss_execute_line(); +int ss_quit(); +#endif extern ss_request_table ss_std_requests; #endif /* _ss_h */ diff --git a/src/util/ss/ss_internal.h b/src/util/ss/ss_internal.h index 81185172b..deb96cabf 100644 --- a/src/util/ss/ss_internal.h +++ b/src/util/ss/ss_internal.h @@ -101,11 +101,14 @@ typedef struct _ss_data { /* init values */ (*code_ptr=0,ss_info(sci_idx)->current_request) void ss_unknown_function(); void ss_delete_info_dir(); -int ss_execute_line(); -char **ss_parse(); +char **ss_parse PROTOTYPE((int, char *, int *)); ss_abbrev_info *ss_abbrev_initialize PROTOTYPE((char *, int *)); -void ss_page_stdin(); -int ss_pager_create(); +void ss_page_stdin PROTOTYPE((void)); +int ss_pager_create PROTOTYPE((void)); +void ss_self_identify __SS_PROTO; +void ss_subsystem_name __SS_PROTO; +void ss_subsystem_version __SS_PROTO; +void ss_unimplemented __SS_PROTO; extern ss_data **_ss_table; extern char *ss_et_msgs[]; -- 2.26.2