]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Change compile_et to generate header files that use <et/com_err.h>
authorTheodore Ts'o <tytso@mit.edu>
Mon, 31 Mar 2003 03:26:13 +0000 (22:26 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 31 Mar 2003 03:26:13 +0000 (22:26 -0500)
instead of <com_err.h>, so the current version of the header file
is used.

Add a --build-tree option to compile_et to make sure that it uses
the et_?.awk files from the build tree.

Remove legacy support for varargs.h, K&R C, and pre-POSIX signal
support.  Also fixed gcc -Wall nits.

26 files changed:
lib/et/ChangeLog
lib/et/com_err.c
lib/et/com_err.h
lib/et/com_err.texinfo
lib/et/compile_et.sh.in
lib/et/error_message.c
lib/et/error_table.h
lib/et/et_h.awk
lib/et/init_et.c
lib/et/internal.h
lib/ext2fs/ChangeLog
lib/ext2fs/Makefile.in
lib/ss/ChangeLog
lib/ss/Makefile.in
lib/ss/ct_c.awk
lib/ss/error.c
lib/ss/get_readline.c
lib/ss/invocation.c
lib/ss/list_rqs.c
lib/ss/listen.c
lib/ss/pager.c
lib/ss/prompt.c
lib/ss/request_tbl.c
lib/ss/requests.c
lib/ss/ss.h
lib/ss/ss_internal.h

index 4df0b491aa500377d19e155a9022cb224ab3046c..52334a33e22cbab1d8916886e451a904e1c6e7d7 100644 (file)
@@ -1,3 +1,18 @@
+2003-03-30  Theodore Ts'o  <tytso@mit.edu>
+
+       * et_h.awk (char_shift): Use the com_err.h file in et/com_err.h,
+               since /usr/include/com_err.h may not exist, and if it
+               does, it might be the wrong one.
+
+       * compile_et.sh.in: Add --build-tree option which forces the use
+               of the et_?.awk files in the build tree.
+
+       * error_table.h, error_message.c, com_err.c, internal.h,
+               init_et.c, com_err.h: Remove STDC legacy #define's.
+
+       * com_err.texinfo: Remove references to K&R C support, and to
+               potential problems that are no longer relevant.
+
 2003-03-19  Theodore Ts'o  <tytso@mit.edu>
 
        * com_err.h, error_table.h: Move definition of the error_table
index 9637b04182b547b5b6e96a6a0e20d41b3ef4b86d..76fdc78fe5e8105f8cdd87770523e5a14f24567f 100644 (file)
 #include "error_table.h"
 #include "internal.h"
 
-#if !defined(__STDC__) && !defined(STDARG_PROTOTYPES)
-#include <varargs.h>
-#define VARARGS
-#endif
-
 static void
-#ifdef __STDC__
-    default_com_err_proc (const char *whoami, errcode_t code, const
-                         char *fmt, va_list args)
-#else
-    default_com_err_proc (whoami, code, fmt, args)
-    const char *whoami;
-    errcode_t code;
-    const char *fmt;
-    va_list args;
-#endif
+default_com_err_proc (const char *whoami, errcode_t code, const
+                     char *fmt, va_list args)
 {
     if (whoami) {
        fputs(whoami, stderr);
@@ -49,52 +36,25 @@ static void
     fflush(stderr);
 }
 
-#ifdef __STDC__
 typedef void (*errf) (const char *, errcode_t, const char *, va_list);
-#else
-typedef void (*errf) ();
-#endif
 
 errf com_err_hook = default_com_err_proc;
 
-#ifdef __STDC__
 void com_err_va (const char *whoami, errcode_t code, const char *fmt,
                 va_list args)
-#else
-void com_err_va (whoami, code, fmt, args)
-    const char *whoami;
-    errcode_t code;
-    const char *fmt;
-    va_list args;
-#endif
 {
     (*com_err_hook) (whoami, code, fmt, args);
 }
 
-#ifndef VARARGS
 void com_err (const char *whoami,
              errcode_t code,
              const char *fmt, ...)
 {
-#else
-void com_err (va_alist)
-    va_dcl
-{
-    const char *whoami, *fmt;
-    errcode_t code;
-#endif
     va_list pvar;
 
     if (!com_err_hook)
        com_err_hook = default_com_err_proc;
-#ifdef VARARGS
-    va_start (pvar);
-    whoami = va_arg (pvar, const char *);
-    code = va_arg (pvar, errcode_t);
-    fmt = va_arg (pvar, const char *);
-#else
     va_start(pvar, fmt);
-#endif
     com_err_va (whoami, code, fmt, pvar);
     va_end(pvar);
 }
index 5c3fd94f1e8a5c61b404273587f05723f42528ef..94c609811dbad711d9c427461ea237d3e7a9bc36 100644 (file)
 
 #ifndef __COM_ERR_H
 
+#include <stdarg.h>
+
 typedef long errcode_t;
 
 struct error_table {
        char const * const * msgs;
-       unsigned long base;
+       long base;
        unsigned int n_msgs;
 };
 
-#ifdef __STDC__
-#include <stdarg.h>
+struct et_list;
 
-/* ANSI C -- use prototypes etc */
-void com_err (const char *, long, const char *, ...);
-void com_err_va (const char *whoami, errcode_t code, const char *fmt,
+extern void com_err (const char *, long, const char *, ...);
+extern void com_err_va (const char *whoami, errcode_t code, const char *fmt,
                 va_list args);
-char const *error_message (long);
+extern char const *error_message (long);
 extern void (*com_err_hook) (const char *, long, const char *, va_list);
-void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
-    (const char *, long, const char *, va_list);
-void (*reset_com_err_hook (void)) (const char *, long, const char *, va_list);
-int init_error_table(const char * const *msgs, int base, int count);
-#else
-/* no prototypes */
-void com_err ();
-void com_err_va ();
-char *error_message ();
-extern void (*com_err_hook) ();
-void (*set_com_err_hook ()) ();
-void (*reset_com_err_hook ()) ();
-int init_error_table();
-#endif
+extern void (*set_com_err_hook (void (*) (const char *, long, 
+                                         const char *, va_list)))
+       (const char *, long, const char *, va_list);
+extern void (*reset_com_err_hook (void)) (const char *, long, 
+                                         const char *, va_list);
+extern int init_error_table(const char * const *msgs, int base, int count);
+
+extern errcode_t add_error_table(const struct error_table * et);
+extern errcode_t remove_error_table(const struct error_table * et);
+extern void add_to_error_table(struct et_list *new_table);
+
 
 #define __COM_ERR_H
 #endif /* ! defined(__COM_ERR_H) */
index 1bf57130e4d5758a5a049dbd80c6722fe5e23c0b..5607281dd7b1f3af857ea89e3b28b6a5acc3c99e 100644 (file)
@@ -256,14 +256,6 @@ included in the source of a module which wishes to reference the error
 codes defined; the object module generated from the C code may be linked in
 to a program which wishes to use the printed forms of the error codes.
 
-This translator accepts a @kbd{-language @var{lang}} argument, which
-determines for which language (or language variant) the output should be
-written.  At the moment, @var{lang} is currently limited to @kbd{ANSI-C}
-and @kbd{K&R-C}, and some abbreviated forms of each.  Eventually, this will
-be extended to include some support for C++.  The default is currently
-@kbd{K&R-C}, though the generated sources will have ANSI-C code
-conditionalized on the symbol @t{__STDC__}.
-
 @node Run-time support routines, Coding Conventions, The error-table compiler, Top
 @section Run-time support routines
 
@@ -523,35 +515,6 @@ error-table compiler.  The files @samp{libcom_err.a},
 installed for use; @samp{com_err.3} and @samp{compile_et.1} can also be
 installed as manual pages.
 
-Potential problems:
-
-@itemize @bullet
-
-@item Use of @code{strcasecmp}, a routine provided in BSD for
-case-insensitive string comparisons.  If an equivalent routine is
-available, you can modify @code{CFLAGS} in the makefile to define
-@code{strcasecmp} to the name of that routine.
-
-@item Compilers that defined @code{__STDC__} without providing the header
-file @code{<stdarg.h>}.  One such example is Metaware's High ``C''
-compiler, as provided at Project Athena on the IBM RT/PC workstation; if
-@code{__HIGHC__} is defined, it is assumed that @code{<stdarg.h>} is not
-available, and therefore @code{<varargs.h>} must be used.  If the symbol
-@code{VARARGS} is defined (e.g., in the makefile), @code{<varargs.h>} will
-be used.
-
-@item If your linker rejects symbols that are simultaneously defined in two
-library files, edit @samp{Makefile} to remove @samp{perror.c} from the
-library.  This file contains a version of @cite{perror(3)} which calls
-@code{com_err} instead of calling @code{write} directly.
-
-@end itemize
-
-As I do not have access to non-BSD systems, there are probably
-bugs present that may interfere with building or using this package on
-other systems.  If they are reported to me, they can probably be fixed for
-the next version.
-
 @node Bug Reports, Acknowledgements, Building and Installation, Top
 @section Bug Reports
 
index ad445fad4e69e022973f946164eeea3df685b404..0e7634c7f6b5da1b4d3ad77c7e28af703123fccc 100644 (file)
@@ -5,6 +5,11 @@ AWK=@AWK@
 DIR="${DIR-@datadir@/et}"
 ET_DIR="@ET_DIR@"
 
+if test "$1" = "--build-tree" ; then
+    shift;
+    DIR="$ET_DIR"
+fi
+
 if test "x$1" = x ; then
     echo "Usage: compile_et file"
     exit 1
index 3668c451f67578c8cee026e6942cbf53ff6a7736..9326308c77aa8264c3fefcb8ed01363443dc8bed 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 #include "com_err.h"
@@ -28,12 +29,7 @@ static char buffer[25];
 struct et_list * _et_list = (struct et_list *) NULL;
 
 
-#ifdef __STDC__
 const char * error_message (errcode_t code)
-#else
-const char * error_message (code)
-       errcode_t       code;
-#endif
 {
     int offset;
     struct et_list *et;
@@ -90,8 +86,7 @@ oops:
 /*
  * New interface provided by krb5's com_err library
  */
-errcode_t add_error_table(et)
-       const struct error_table * et;
+errcode_t add_error_table(const struct error_table * et)
 {
        struct et_list *el = _et_list;
 
@@ -114,8 +109,7 @@ errcode_t add_error_table(et)
 /*
  * New interface provided by krb5's com_err library
  */
-errcode_t remove_error_table(et)
-       const struct error_table * et;
+errcode_t remove_error_table(const struct error_table * et)
 {
        struct et_list *el = _et_list;
        struct et_list *el2 = 0;
index 36348e920410cf6af88630497cf9c6a8ea4234fa..4f10991102a1bbfab0da0b9246c72a21df4e0aee 100644 (file)
  */
 
 #ifndef _ET_H
-/* Are we using ANSI C? */
-#ifndef __STDC__
-#define const
-#endif
 
 struct et_list {
     struct et_list *next;
@@ -27,11 +23,7 @@ extern struct et_list * _et_list;
 #define        ERRCODE_RANGE   8       /* # of bits to shift table number */
 #define        BITS_PER_CHAR   6       /* # bits to shift per character in name */
 
-#ifdef __STDC__
 extern const char *error_table_name(errcode_t num);
-#else
-extern const char *error_table_name();
-#endif
 
 #define _ET_H
 #endif
index e8da3accaab6b09e7be86e1ed1ad52fe8d2253ab..a52c141819cb9b22e3f6e9c98ec76f3744e15f4f 100644 (file)
@@ -119,7 +119,7 @@ c2n["_"]=63
        print " * This file is automatically generated; please do not edit it." > outfile
        print " */" > outfile
        print "" > outfile
-       print "#include <com_err.h>" > outfile
+       print "#include <et/com_err.h>" > outfile
        print "" > outfile
 }
 
index 606afc666f1652cbfb44fdfc73a231520f5a6487..0e30730dad6850823afcb11d98753f820fc48de5 100644 (file)
 #include "com_err.h"
 #include "error_table.h"
 
-#ifndef __STDC__
-#define const
-#endif
-
 struct foobar {
     struct et_list etl;
     struct error_table et;
@@ -35,14 +31,7 @@ struct foobar {
 
 extern struct et_list * _et_list;
 
-#ifdef __STDC__
 int init_error_table(const char * const *msgs, int base, int count)
-#else
-int init_error_table(msgs, base, count)
-    const char * const * msgs;
-    int base;
-    int count;
-#endif
 {
     struct foobar * new_et;
 
index b6c2775518879da4d527abce9946602b6c2e2be7..d16f3731390d0d8d21cef640bd60b28a1c1cfbbc 100644 (file)
  * this software for any purpose.  It is provided "as is" without
  * express or implied warranty.
  */
-#ifndef __STDC__
-#undef const
-#define const
-#endif
 
 #include <errno.h>
 
index b9c997c8a471ad10dc1ceb092a4045408cc8c480..110a6680492376872892d481706f93f4a803d1c9 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-30  Theodore Ts'o  <tytso@mit.edu>
+
+       * Makefile.in: Use the compile_et --build-tree option.
+
 2003-03-14  Theodore Ts'o  <tytso@mit.edu>
 
        * getsize.c: Add support for Apple Darwin's ioctl to get the hard
index b9432eac411cd3f35d71845c49e576c7fadf7a16..7573429b6bb28002920dee4d475650d1562b83ee 100644 (file)
@@ -168,7 +168,7 @@ BSDLIB_INSTALL_DIR = $(root_libdir)
 @ELF_CMT@      $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
 @BSDLIB_CMT@   $(CC) $(ALL_CFLAGS) -fpic -o pic/$*.o -c $<
 
-COMPILE_ET=../et/compile_et
+COMPILE_ET=../et/compile_et --build-tree
 
 DISTFILES= Makefile *.c *.h image
 
index fc6e6b50d0e533a2766e1254d95792bdb1a0950f..fe59b6a107bb3bbbe4a5b3ee20b73297bedabd36 100644 (file)
@@ -1,3 +1,12 @@
+2003-03-30  Theodore Ts'o  <tytso@mit.edu>
+
+       * pager.c, listen.c, requests.c, list_rqs.c, ct_c.awk, prompt.c, 
+               error.c, request_tbl.c, ss_internal.h, invocation.c, ss.h,
+               get_readline.c: Remove old support for K&R C and Varargs.
+               Fix gcc -Wall nits.
+
+       * Makefile.in: Use the compile_et --build-tree option.
+
 2003-03-16  Theodore Ts'o  <tytso@mit.edu>
 
        * mk_cmds.1, Makefile.in: Add (bare-bone) man page
index 70ad3fef3bcce2b5a7de33892eca27699b7cdafb..9dc5cfde29c54e56daec2d7281f2d521abb90083 100644 (file)
@@ -38,13 +38,13 @@ BSDLIB_MYDIR = ss
 BSDLIB_INSTALL_DIR = $(root_libdir)
 
 TAGS=etags
-COMPILE_ET=../et/compile_et
+COMPILE_ET=../et/compile_et --build-tree
 MK_CMDS=_SS_DIR_OVERRIDE=. ./mk_cmds
 
 # -I.. is so that ss/ss_err.h works
 # -I$(srcdir)/.. is so that ss/ss.h works
 # -I$(srcdir)/../et is so com_err.h works
-XTRA_CFLAGS=-DPOSIX_SIGNALS -I$(srcdir)/../et
+XTRA_CFLAGS= -I$(srcdir)/../et
 
 .c.o:
        $(CC) $(ALL_CFLAGS) -c $<
index ef7414532504d1ab7187a2765662b7903708376d..a4424c88ba5ead545f9e303f5fec2b3e18db652b 100644 (file)
@@ -4,10 +4,6 @@
                rootname, rootname > outfile
        print "#include <ss/ss.h>" > outfile
        print "" >outfile
-       print "#ifndef __STDC__" > outfile
-       print "#define const" > outfile
-       print "#endif" > outfile
-       print "" > outfile
 }
        
 /^BOR$/ {
index 26f5ae796b4aa29e2e21985a23df6e680e0ba351..14c0570fd2c803bef3f5ecbe6e7899b3840ec254 100644 (file)
 
 #include <stdio.h>
 
-/*
- * I'm assuming that com_err.h includes varargs.h, which it does
- * (right now).  There really ought to be a way for me to include the
- * file without worrying about whether com_err.h includes it or not,
- * but varargs.h doesn't define anything that I can use as a flag, and
- * gcc will lose if I try to include it twice and redefine stuff.
- */
-#if !defined(__STDC__) || !defined(ibm032) || !defined(NeXT)
-#define ss_error ss_error_external
-#endif
-
 #include <com_err.h>
 #include "ss_internal.h"
 
-#ifdef HAVE_STDARG_H
 #include <stdarg.h>
-#else
-#include <vararg.h>
-#endif
   
-#undef ss_error
-
 char * ss_name(sci_idx)
     int sci_idx;
 {
@@ -74,26 +57,12 @@ char * ss_name(sci_idx)
     }
 }
 
-#ifdef HAVE_STDARG_H
 void ss_error (int sci_idx, long code, const char * fmt, ...)
-#else
-void ss_error (va_alist)
-    va_dcl
-#endif
 {
     register char *whoami;
     va_list pvar;
-#ifndef HAVE_STDARG_H
-    int sci_idx;
-    long code;
-    char * fmt;
-    va_start (pvar);
-    sci_idx = va_arg (pvar, int);
-    code = va_arg (pvar, long);
-    fmt = va_arg (pvar, char *);
-#else
+
     va_start (pvar, fmt);
-#endif
     whoami = ss_name (sci_idx);
     com_err_va (whoami, code, fmt, pvar);
     free (whoami);
index 2ec5ac2070e7d7a742c436336c9833f740169ea9..55b8b47a88b7e4d655689e67471bb50158b7e999 100644 (file)
@@ -49,10 +49,15 @@ void ss_get_readline(int sci_idx)
                return;
 
        info->readline_handle = handle;
-       info->readline = dlsym(handle, "readline");
-       info->add_history = dlsym(handle, "add_history");
-       info->redisplay = dlsym(handle, "rl_forced_update_display");
-       info->rl_completion_matches = dlsym(handle, "rl_completion_matches");
+       info->readline = (char *(*)(const char *))
+               dlsym(handle, "readline");
+       info->add_history = (void (*)(const char *))
+               dlsym(handle, "add_history");
+       info->redisplay = (void (*)(void))
+               dlsym(handle, "rl_forced_update_display");
+       info->rl_completion_matches = (char **(*)(const char *,
+                                   char *(*)(const char *, int)))
+               dlsym(handle, "rl_completion_matches");
        if ((t = dlsym(handle, "rl_readline_name")) != NULL)
                *t = info->subsystem_name;
        if ((completion_func =
index 748886fae1a2deff58f29bc0da69368912ce67f2..074706fcad1a1b6f4d44d41b46aebae187d95b4a 100644 (file)
@@ -30,7 +30,6 @@ int ss_create_invocation(subsystem_name, version_string, info_ptr,
        register int sci_idx;
        register ss_data *new_table;
        register ss_data **table;
-       void *handle;
 
        *code_ptr = 0;
        table = _ss_table;
@@ -92,13 +91,13 @@ ss_delete_invocation(sci_idx)
 
        t = ss_info(sci_idx);
        free(t->prompt);
-       free((char *)t->rqt_tables);
+       free(t->rqt_tables);
        while(t->info_dirs[0] != (char *)NULL)
                ss_delete_info_dir(sci_idx, t->info_dirs[0], &ignored_code);
-       free((char *)t->info_dirs);
+       free(t->info_dirs);
 #if defined(HAVE_DLOPEN) && defined(SHARED_ELF_LIB)
        if (t->readline_shutdown)
                (*t->readline_shutdown)(t);
 #endif
-       free((char *)t);
+       free(t);
 }
index 8c4e8465c4d844b71a3be4a81dd984fea1f7c9da..b1fc5ed63d2789fa11a38aa7103d8dc919c79451 100644 (file)
@@ -41,12 +41,8 @@ void ss_list_requests(argc, argv, sci_idx, info_ptr)
     char buffer[BUFSIZ];
     FILE *output;
     int fd;
-#ifdef POSIX_SIGNALS
     sigset_t omask, igmask;
-#else
-    int mask;
-#endif
-    sigret_t (*func) PROTOTYPE((int));
+    sigret_t (*func)(int);
 #ifndef NO_FORK
     int waitb;
 #endif
@@ -54,21 +50,13 @@ void ss_list_requests(argc, argv, sci_idx, info_ptr)
     DONT_USE(argc);
     DONT_USE(argv);
 
-#ifdef POSIX_SIGNALS
     sigemptyset(&igmask);
     sigaddset(&igmask, SIGINT);
     sigprocmask(SIG_BLOCK, &igmask, &omask);
-#else
-    mask = sigblock(sigmask(SIGINT));
-#endif
     func = signal(SIGINT, SIG_IGN);
     fd = ss_pager_create();
     output = fdopen(fd, "w");
-#ifdef POSIX_SIGNALS
     sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
-#else
-    sigsetmask(mask);
-#endif
 
     fprintf (output, "Available %s requests:\n\n",
             ss_info (sci_idx) -> subsystem_name);
index 073141832784032528399d3c93df36ca0ed72ebd..784af4443908b1411429ac12fe698a6d2cf7a226 100644 (file)
 #include <setjmp.h>
 #include <signal.h>
 #include <sys/param.h>
-#ifdef BSD
-#include <sgtty.h>
-#endif
-
-#ifndef        lint
-static char const rcs_id[] =
-    "$Header$";
-#endif
 
 typedef void sigret_t;
 
@@ -38,16 +30,6 @@ static sigret_t (*sig_cont)(int);
 
 static sigret_t print_prompt(int sig)
 {
-#ifdef BSD
-    /* put input into a reasonable mode */
-    struct sgttyb ttyb;
-    if (ioctl(fileno(stdin), TIOCGETP, &ttyb) != -1) {
-       if (ttyb.sg_flags & (CBREAK|RAW)) {
-           ttyb.sg_flags &= ~(CBREAK|RAW);
-           (void) ioctl(0, TIOCSETP, &ttyb);
-       }
-    }
-#endif
     if (current_info->redisplay)
            (*current_info->redisplay)();
     else {
@@ -69,11 +51,7 @@ int ss_listen (int sci_idx)
     ss_data *info;
     sigret_t (*sig_int)(int), (*old_sig_cont)(int);
     char input[BUFSIZ];
-#ifdef POSIX_SIGNALS
     sigset_t omask, igmask;
-#else
-    int mask;
-#endif
     int code;
     jmp_buf old_jmpb;
     ss_data *old_info = current_info;
@@ -82,21 +60,14 @@ int ss_listen (int sci_idx)
     current_info = info = ss_info(sci_idx);
     sig_cont = (sigret_t (*)(int)) 0;
     info->abort = 0;
-#ifdef POSIX_SIGNALS
     sigemptyset(&igmask);
     sigaddset(&igmask, SIGINT);
     sigprocmask(SIG_BLOCK, &igmask, &omask);
-#else
-    mask = sigblock(sigmask(SIGINT));
-#endif
     memcpy(old_jmpb, listen_jmpb, sizeof(jmp_buf));
     sig_int = signal(SIGINT, listen_int_handler);
     setjmp(listen_jmpb);
-#ifdef POSIX_SIGNALS
     sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
-#else
-    (void) sigsetmask(mask);
-#endif
+
     while(!info->abort) {
        old_sig_cont = sig_cont;
        sig_cont = signal(SIGCONT, print_prompt);
index 979ae5d853b0b33cdc89b99abb797208d3668c1e..ba28f97a7f1598c530f0c6569376e77b79f3ade7 100644 (file)
@@ -42,7 +42,7 @@ extern char *getenv PROTOTYPE((const char *));
  */
 
 #ifndef NO_FORK
-int ss_pager_create(NOARGS
+int ss_pager_create(void
 {
        int filedes[2];
      
@@ -80,22 +80,14 @@ int ss_pager_create()
 void ss_page_stdin()
 {
        int i;
+       sigset_t mask;
+       
        for (i = 3; i < 32; i++)
                (void) close(i);
        (void) signal(SIGINT, SIG_DFL);
-       {
-#ifdef POSIX_SIGNALS
-               sigset_t mask;
-               
-               sigprocmask(SIG_BLOCK, 0, &mask);
-               sigdelset(&mask, SIGINT);
-               sigprocmask(SIG_SETMASK, &mask, 0);
-#else
-               int mask = sigblock(0);
-               mask &= ~sigmask(SIGINT);
-               sigsetmask(mask);
-#endif
-       }
+       sigprocmask(SIG_BLOCK, 0, &mask);
+       sigdelset(&mask, SIGINT);
+       sigprocmask(SIG_SETMASK, &mask, 0);
        if (_ss_pager_name == (char *)NULL) {
                if ((_ss_pager_name = getenv("PAGER")) == (char *)NULL)
                        _ss_pager_name = MORE;
index 90a35ec66b2a118713771d71710a08f204a95411..6fe42637d9f97e6885b55659810cb81944dc0be2 100644 (file)
 #include <stdio.h>
 #include "ss_internal.h"
 
-#ifdef __STDC__
 void ss_set_prompt(int sci_idx, char *new_prompt)
-#else
-void ss_set_prompt(sci_idx, new_prompt)
-     int sci_idx;
-     char *new_prompt;
-#endif
 {
      ss_info(sci_idx)->prompt = new_prompt;
 }
 
-#ifdef __STDC__
 char *ss_get_prompt(int sci_idx)
-#else
-char *ss_get_prompt(sci_idx)
-     int sci_idx;
-#endif
 {
      return(ss_info(sci_idx)->prompt);
 }
index 68b0a49da669b00bbbb62847cd015c53abdbe99b..4027af85feca6c17ab2749ba210cf572142feee3 100644 (file)
@@ -33,7 +33,7 @@ void ss_add_request_table(sci_idx, rqtbl_ptr, position, code_ptr)
                ;
        /* size == C subscript of NULL == #elements */
        size += 2;              /* new element, and NULL */
-       info->rqt_tables = (ssrt **)realloc((char *)info->rqt_tables,
+       info->rqt_tables = (ssrt **)realloc(info->rqt_tables,
                                            (unsigned)size*sizeof(ssrt));
        if (info->rqt_tables == (ssrt **)NULL) {
                *code_ptr = errno;
index 56e429b75aff65ba58f415f16b57b2dc6f683445..7f1805d449a1feb8c4a001e0d5109eb49027f591 100644 (file)
 #include <stdio.h>
 #include "ss_internal.h"
 
-#ifdef __STDC__
 #define        DECLARE(name) void name(int argc,const char * const *argv, \
                                int sci_idx, void *infop)
-#else
-#define        DECLARE(name) void name(argc,argv,sci_idx,infop) \
-       int argc,sci_idx;char **argv;void *infop;
-#endif
        
 /*
  * ss_self_identify -- assigned by default to the "." request
  */
-DECLARE(ss_self_identify)
+void ss_self_identify(int argc,const char * const *argv,
+                     int sci_idx, void *infop)
 {
      register ss_data *info = ss_info(sci_idx);
      printf("%s version %s\n", info->subsystem_name,
@@ -37,7 +33,8 @@ DECLARE(ss_self_identify)
 /*
  * ss_subsystem_name -- print name of subsystem
  */
-DECLARE(ss_subsystem_name)
+void ss_subsystem_name(int argc,const char * const *argv,
+                      int sci_idx, void *infop)
 {
      printf("%s\n", ss_info(sci_idx)->subsystem_name);
 }
@@ -45,7 +42,8 @@ DECLARE(ss_subsystem_name)
 /*
  * ss_subsystem_version -- print version of subsystem
  */
-DECLARE(ss_subsystem_version)
+void ss_subsystem_version(int argc,const char * const *argv,
+                         int sci_idx, void *infop)
 {
      printf("%s\n", ss_info(sci_idx)->subsystem_version);
 }
@@ -54,7 +52,8 @@ DECLARE(ss_subsystem_version)
  * ss_unimplemented -- routine not implemented (should be
  * set up as (dont_list,dont_summarize))
  */
-DECLARE(ss_unimplemented)
+void ss_unimplemented(int argc,const char * const *argv,
+                     int sci_idx, void *infop)
 {
      ss_perror(sci_idx, SS_ET_UNIMPLEMENTED, "");
 }
index 805e1f14eefe3d4c9b5150c2ff0cbce38bb193b9..90a268aa088d45074bf9c39770a98cfa5b3d0f31 100644 (file)
 
 #include <ss/ss_err.h>
 
-#ifdef __STDC__
 #define __SS_CONST const
 #define __SS_PROTO (int, const char * const *, int, void *)
-#else
-#define __SS_CONST
-#define __SS_PROTO ()
-#endif
 
 typedef __SS_CONST struct _ss_request_entry {
     __SS_CONST char * __SS_CONST *command_names; /* whatever */
@@ -63,7 +58,7 @@ void ss_help __SS_PROTO;
 #if 0
 char *ss_current_request();    /* This is actually a macro */
 #endif
-#ifdef __STDC__
+
 char *ss_name(int sci_idx);
 void ss_error (int, long, char const *, ...);
 void ss_perror (int, long, char const *);
@@ -86,25 +81,6 @@ void ss_unimplemented(int argc, const char * const *argv,
 void ss_set_prompt(int sci_idx, char *new_prompt);
 char *ss_get_prompt(int sci_idx);
 void ss_get_readline(int sci_idx);
-#else
-char *ss_name();
-void ss_error ();
-void ss_perror ();
-int ss_create_invocation();
-void ss_delete_invocation();
-int ss_listen();
-int ss_execute_line();
-void ss_add_request_table();
-void ss_delete_request_table();
-void ss_abort_subsystem();
-void ss_quit();
-void ss_self_identify();
-void ss_subsystem_name();
-void ss_subsystem_version();
-void ss_unimplemented();
-void ss_set_prompt;
-char *ss_get_prompt;
-void ss_get_readline();
-#endif
+
 extern ss_request_table ss_std_requests;
 #endif /* _ss_h */
index ce84477d8e880909dacfe831b3ebaa3ad2213e04..48afdbd0611add8bc950305072646d18c03d92e6 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
-#ifdef __STDC__
-
-#define NOARGS void
 #define PROTOTYPE(p) p
 typedef void * pointer;
 
-#else
-
-#define NOARGS
-#define const
-#define volatile
-#define PROTOTYPE(p) ()
-typedef char * pointer;
-
-#endif /* not __STDC__ */
-
 #include "ss.h"
 
-#if defined(__GNUC__)
-#define LOCAL_ALLOC(x) __builtin_alloca(x)
-#define LOCAL_FREE(x)
-#else
-#if defined(vax)
-#define LOCAL_ALLOC(x) alloca(x)
-#define LOCAL_FREE(x)
-extern pointer alloca PROTOTYPE((unsigned));
-#else
-#if defined(__HIGHC__) /* Barf! */
-pragma on(alloca);
-#define LOCAL_ALLOC(x) alloca(x)
-#define LOCAL_FREE(x)
-extern pointer alloca PROTOTYPE((unsigned));
-#else
-/* no alloca? */
-#define LOCAL_ALLOC(x) malloc(x)
-#define LOCAL_FREE(x) free(x)
-#endif
-#endif
-#endif                         /* LOCAL_ALLOC stuff */
-
 typedef char BOOL;
 
 typedef struct _ss_abbrev_entry {
@@ -102,7 +67,7 @@ typedef struct _ss_data {    /* init values */
     void (*readline_shutdown)(struct _ss_data *info);
     char *(*readline)(const char *);
     void (*add_history)(const char *);
-    void (*redisplay)();
+    void (*redisplay)(void);
     char **(*rl_completion_matches)(const char *,
                                    char *(*completer)(const char *, int));
     /* to get out */
@@ -115,17 +80,15 @@ typedef struct _ss_data {  /* init values */
 #define        ss_info(sci_idx)        (_ss_table[sci_idx])
 #define        ss_current_request(sci_idx,code_ptr)    \
      (*code_ptr=0,ss_info(sci_idx)->current_request)
-void ss_add_info_dir PROTOTYPE((int sci_idx, char *info_dir,
-                               int *code_ptr));
-void ss_delete_info_dir PROTOTYPE((int sci_idx, char *info_dir,
-                                  int *code_ptr));
-int ss_execute_line PROTOTYPE((int sci_idx, char *line_ptr));
-char **ss_parse PROTOTYPE((int sci_idx, char *line_ptr, int *argc_ptr));
-ss_abbrev_info *ss_abbrev_initialize PROTOTYPE((char *, int *));
-void ss_page_stdin(NOARGS);
-void ss_list_requests PROTOTYPE((int, char const * const *, int, pointer));
-int ss_execute_command PROTOTYPE((int sci_idx, char *argv[]));
-int ss_pager_create(NOARGS);
+void ss_add_info_dir (int sci_idx, char *info_dir, int *code_ptr);
+void ss_delete_info_dir (int sci_idx, char *info_dir, int *code_ptr);
+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);
+void ss_list_requests(int, char const * const *, int, pointer);
+int ss_execute_command(int sci_idx, char *argv[]);
+int ss_pager_create(void);
 char **ss_rl_completion(const char *text, int start, int end);
 
 extern ss_data **_ss_table;