]> asedeno.scripts.mit.edu Git - 1ts-debian.git/commitdiff
r4264@bucket (orig r254): kcr | 2008-01-20 22:11:44 -0500
authorkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Thu, 18 Dec 2008 04:49:36 +0000 (04:49 +0000)
committerkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Thu, 18 Dec 2008 04:49:36 +0000 (04:49 +0000)
 de K&Rify, fix prototypes

git-svn-id: svn://svn.1ts.org/debian/trunk@326 cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f

62 files changed:
zephyr/zwgc/X_driver.c
zephyr/zwgc/X_driver.h
zephyr/zwgc/X_fonts.c
zephyr/zwgc/X_fonts.h
zephyr/zwgc/X_gram.c
zephyr/zwgc/X_gram.h
zephyr/zwgc/buffer.c
zephyr/zwgc/buffer.h
zephyr/zwgc/character_class.c
zephyr/zwgc/character_class.h
zephyr/zwgc/dictionary.c
zephyr/zwgc/dictionary.h
zephyr/zwgc/eval.c
zephyr/zwgc/eval.h
zephyr/zwgc/exec.c
zephyr/zwgc/exec.h
zephyr/zwgc/file.c
zephyr/zwgc/file.h
zephyr/zwgc/formatter.c
zephyr/zwgc/formatter.h
zephyr/zwgc/lexer.c
zephyr/zwgc/lexer.h
zephyr/zwgc/main.c
zephyr/zwgc/main.h
zephyr/zwgc/mux.c
zephyr/zwgc/mux.h
zephyr/zwgc/new_string.c
zephyr/zwgc/new_string.h
zephyr/zwgc/node.c
zephyr/zwgc/node.h
zephyr/zwgc/notice.c
zephyr/zwgc/notice.h
zephyr/zwgc/parser.h
zephyr/zwgc/parser.y
zephyr/zwgc/port.c
zephyr/zwgc/port.h
zephyr/zwgc/regexp.c
zephyr/zwgc/regexp.h
zephyr/zwgc/standard_ports.c
zephyr/zwgc/string_dictionary_aux.c
zephyr/zwgc/string_dictionary_aux.h
zephyr/zwgc/subscriptions.c
zephyr/zwgc/subscriptions.h
zephyr/zwgc/substitute.c
zephyr/zwgc/substitute.h
zephyr/zwgc/text_operations.c
zephyr/zwgc/text_operations.h
zephyr/zwgc/tty_filter.c
zephyr/zwgc/variables.c
zephyr/zwgc/variables.h
zephyr/zwgc/xcut.c
zephyr/zwgc/xerror.c
zephyr/zwgc/xerror.h
zephyr/zwgc/xmark.c
zephyr/zwgc/xmark.h
zephyr/zwgc/xrevstack.c
zephyr/zwgc/xrevstack.h
zephyr/zwgc/xselect.c
zephyr/zwgc/xselect.h
zephyr/zwgc/xshow.c
zephyr/zwgc/zephyr.c
zephyr/zwgc/zephyr.h

index 925a05be13f6bef530b497c434afa4b2220fdf7b..2577966595fd25520f669c07fde76a9e3f84dc20 100644 (file)
@@ -27,6 +27,7 @@ static const char rcsid_X_driver_c[] = "$Id$";
 
 #ifndef X_DISPLAY_MISSING
 
+#include "new_string.h"
 #include "X_driver.h"
 #include <X11/Xresource.h>
 #include "new_memory.h"
@@ -84,8 +85,8 @@ static XrmDatabase x_resources = NULL;
  *                  returns -1.
  */
 
-static int convert_string_to_bool(text)
-     string text;
+static int
+convert_string_to_bool(string text)
 {
     if (!strcasecmp("yes", text) || !strcasecmp("y", text) ||
        !strcasecmp("true", text) || !strcasecmp("t", text) ||
@@ -103,9 +104,9 @@ static int convert_string_to_bool(text)
  *
  */
 
-char *get_string_resource(name, class)
-     string name;
-     string class;
+char *
+get_string_resource(string name,
+                   string class)
 {
     string full_name, full_class;
     int status;
@@ -134,10 +135,10 @@ char *get_string_resource(name, class)
  *
  */
 
-int get_bool_resource(name, class, default_value)
-     string name;
-     string class;
-     int default_value;
+int
+get_bool_resource(string name,
+                 string class,
+                 int default_value)
 {
     int result;
     char *temp;
@@ -165,9 +166,9 @@ static unsigned_long_dictionary color_dict = NULL;
  *     trip each time.
  */
 
-unsigned long x_string_to_color(name,def)
-     char *name;
-     unsigned long def;
+unsigned long
+x_string_to_color(char *name,
+                 unsigned long def)
 {
    unsigned_long_dictionary_binding *binding;
    int exists;
@@ -236,14 +237,13 @@ static XrmOptionDescRec cmd_options[] = {
  *
  */
 
-int open_display_and_load_resources(pargc, argv)
-     int *pargc;
-     char **argv;
+int
+open_display_and_load_resources(int *pargc,
+                               char **argv)
 {
     XrmDatabase temp_db1, temp_db2, temp_db3;
     char *filename, *res, *xdef;
     char dbasename[128];
-    extern char *getenv();
 
     /* Initialize X resource manager: */
     XrmInitialize();
@@ -316,11 +316,9 @@ int open_display_and_load_resources(pargc, argv)
  *
  */
 
-int X_driver_ioerror(display)
-Display *display;
+int
+X_driver_ioerror(Display *display)
 {
-    extern void finalize_zephyr();
-
     ERROR2("X IO error on display '%s'--exiting\n", DisplayString(display));
     finalize_zephyr();
     exit(1);
@@ -331,14 +329,12 @@ Display *display;
 /*                                                                          */
 /****************************************************************************/
 
-extern void x_get_input();
-
 /*ARGSUSED*/
-int X_driver_init(drivername, notfirst, pargc, argv)
-     char *drivername;
-     char notfirst;
-     int *pargc;
-     char **argv;
+int
+X_driver_init(char *drivername,
+             char notfirst,
+             int *pargc,
+             char **argv)
 {
     string temp;
     int sync;
@@ -373,12 +369,13 @@ int X_driver_init(drivername, notfirst, pargc, argv)
     x_gram_init(dpy);
     xicccmInitAtoms(dpy);
     
-    mux_add_input_source(ConnectionNumber(dpy), x_get_input, dpy);
+    mux_add_input_source(ConnectionNumber(dpy), (void(*)(void *))x_get_input, dpy);
 
     return(0);
 }
 
-void X_driver_reset()
+void
+X_driver_reset(void)
 {
 }
 
@@ -388,8 +385,8 @@ void X_driver_reset()
 /*                                                                          */
 /****************************************************************************/
 
-char *X_driver(text)
-     string text;
+char *
+X_driver(string text)
 {
     string text_copy;
     desctype *desc;
index ec2492f48bb99763624130b553590b57f8b0a582..b32562ece1a46f0fa3e0199e0dc0e4d1261247f3 100644 (file)
 
 #include <X11/Xlib.h>
 
+#include "new_string.h"
+
 extern Display *dpy;
 
-extern char *get_string_resource();
-extern int get_bool_resource();
+extern char *get_string_resource(string, string);
+extern int get_bool_resource(string, string, int);
+extern unsigned long x_string_to_color(char *, unsigned long);
 
 #endif
index 93583838831338ebdce6f0a0681f09a7d4837656..95e21d510cc1ab2bfc1cf78e56fd0527f19683f9 100644 (file)
@@ -51,11 +51,9 @@ static pointer_dictionary fidst_dict = NULL;
 static string face_to_string[] = { "roman", "bold", "italic", "bolditalic" };
 static string size_to_string[] = { "small", "medium", "large" };
 
-extern char *get_string_resources();
-
-static char *get_family(style,substyle)
-     char *style;
-     char *substyle;
+static char *
+get_family(char *style,
+          char *substyle)
 {
    char *desc;
    pointer_dictionary_binding *binding;
@@ -87,10 +85,10 @@ static char *get_family(style,substyle)
    }
 }
 
-static char *get_specific_fontname(family,size,face)
-     char *family;
-     int size;
-     int face;
+static char *
+get_specific_fontname(char *family,
+                     int size,
+                     int face)
 {
    char *desc;
    pointer_dictionary_binding *binding;
@@ -127,8 +125,8 @@ static char *get_specific_fontname(family,size,face)
  * that I know that Font us really an unsigned long. */
 
 static char hexdigits[] = {"0123456789ABCDEF"};
-static char *Font_to_hex(num)
-     Font num;
+static char *
+Font_to_hex(Font num)
 {
    char *temp;
    int i;
@@ -142,8 +140,8 @@ static char *Font_to_hex(num)
    return(temp);
 }
 
-void add_fid(font)
-     XFontStruct *font;
+void
+add_fid(XFontStruct *font)
 {
    
    char *fidstr;
@@ -161,8 +159,8 @@ void add_fid(font)
 }
 
 /* requires that the font already be cached. */
-XFontStruct *get_fontst_from_fid(fid)
-     Font fid;
+XFontStruct *
+get_fontst_from_fid(Font fid)
 {
    char *fidstr;
    pointer_dictionary_binding *binding;
@@ -184,9 +182,9 @@ XFontStruct *get_fontst_from_fid(fid)
 #endif
 }
 
-static XFontStruct *get_fontst(dpy,fontname)
-     Display *dpy;
-     char *fontname;
+static XFontStruct *
+get_fontst(Display *dpy,
+          char *fontname)
 {
    pointer_dictionary_binding *binding;
    int exists;
@@ -209,10 +207,10 @@ static XFontStruct *get_fontst(dpy,fontname)
    }
 }
 
-static char *get_fontname(family,size,face)
-     char *family;
-     int size;
-     int face;
+static char *
+get_fontname(char *family,
+            int size,
+            int face)
 {
    char *fontname;
 
@@ -223,12 +221,12 @@ static char *get_fontname(family,size,face)
    return(fontname);
 }
 
-static XFontStruct *complete_get_fontst(dpy,style,substyle,size,face)
-     Display *dpy;
-     string style;
-     string substyle;
-     int size;
-     int face;
+static XFontStruct *
+complete_get_fontst(Display *dpy,
+                   string style,
+                   string substyle,
+                   int size,
+                   int face)
 {
    char *family,*fontname;
    XFontStruct *fontst;
@@ -249,12 +247,12 @@ static XFontStruct *complete_get_fontst(dpy,style,substyle,size,face)
  *          Effects: unknown
  */
 
-XFontStruct *get_font(dpy,style,substyle,size,face)
-     Display *dpy;
-     string style;
-     string substyle;
-     int size;
-     int face;
+XFontStruct *
+get_font(Display *dpy,
+        string style,
+        string substyle,
+        int size,
+        int face)
 {
    char *family,*fontname;
    XFontStruct *fontst;
index 9a0a2f96b587e33f8a10f051f4e6862b22b8afe2..62469c842ce7a991baa7993c2b8bc449ee472b4a 100644 (file)
@@ -41,7 +41,7 @@
  *                  specified by default.medium.roman is used. <<<>>>
  */
 
-extern XFontStruct *get_font();
-extern XFontStruct *get_fontst_from_fid();
+extern XFontStruct *get_font(Display *, string, string, int, int);
+extern XFontStruct *get_fontst_from_fid(Font);
 
 #endif
index d5879b3569ffe845a3c57e2b827b092ac51bf12c..96e8fb1c508f1c1ab59a4d5063c127773e70e57d 100644 (file)
@@ -37,8 +37,6 @@ static const char rcsid_X_gram_c[] = "$Id$";
 
 extern XContext desc_context;
 extern char *app_instance;
-extern unsigned long x_string_to_color();
-extern char *getenv();
 
 /*
  *
@@ -89,14 +87,14 @@ static Atom net_wm_window_type_utility = None;
  */
 
 /*ARGSUSED*/
-void x_set_icccm_hints(dpy,w,name,icon_name,psizehints,pwmhints,main_window)
-     Display *dpy;
-     Window w;
-     char *name;
-     char *icon_name;
-     XSizeHints *psizehints;
-     XWMHints *pwmhints;
-     Window main_window;
+void
+x_set_icccm_hints(Display *dpy,
+                 Window w,
+                 char *name,
+                 char *icon_name,
+                 XSizeHints *psizehints,
+                 XWMHints *pwmhints,
+                 Window main_window)
 {
    XStoreName(dpy,w,name);
    XSetIconName(dpy,w,icon_name);
@@ -113,8 +111,8 @@ void x_set_icccm_hints(dpy,w,name,icon_name,psizehints,pwmhints,main_window)
       XSetWMProtocols(dpy,w,&XA_WM_DELETE_WINDOW,1);
 }
 
-void x_gram_init(dpy)
-     Display *dpy;
+void
+x_gram_init(Display *dpy)
 {
     char *temp;
     XSizeHints sizehints;
@@ -261,8 +259,9 @@ void x_gram_init(dpy)
     }
 }
 
-int x_calc_gravity(xalign, yalign)
-     int xalign, yalign;
+int
+x_calc_gravity(int xalign,
+              int yalign)
 {
     if (yalign > 0) {                                  /* North */
        return (xalign > 0)  ? NorthWestGravity
@@ -279,21 +278,22 @@ int x_calc_gravity(xalign, yalign)
     }
 }
 
-void x_gram_create(dpy, gram, xalign, yalign, xpos, ypos, xsize, ysize,
-                  beepcount)
-     Display *dpy;
-     x_gram *gram;
-     int xalign, yalign;
-     int xpos, ypos;
-     int xsize, ysize;
-     int beepcount;
+void
+x_gram_create(Display *dpy,
+             x_gram *gram,
+             int xalign,
+             int yalign,
+             int xpos,
+             int ypos,
+             int xsize,
+             int ysize,
+             int beepcount)
 {
     Window w;
     XSizeHints sizehints;
     XWMHints wmhints;
     XSetWindowAttributes attributes;
     unsigned long all_desktops = 0xFFFFFFFF;
-    extern void x_get_input();
 
     /*
      * Adjust xpos, ypos based on the alignments xalign, yalign and the sizes:
@@ -397,11 +397,11 @@ void x_gram_create(dpy, gram, xalign, yalign, xpos, ypos, xsize, ysize,
     x_get_input(dpy);
 }
 
-void x_gram_draw(dpy, w, gram, region)
-     Display *dpy;
-     Window w;
-     x_gram *gram;
-     Region region;
+void
+x_gram_draw(Display *dpy,
+           Window w,
+           x_gram *gram,
+           Region region)
 {
    int i;
    GC gc;
@@ -493,11 +493,11 @@ void x_gram_draw(dpy, w, gram, region)
    XFreeGC(dpy,gc);
 }
 
-void x_gram_expose(dpy,w,gram,event)
-     Display *dpy;
-     Window w;
-     x_gram *gram;
-     XExposeEvent *event;
+void
+x_gram_expose(Display *dpy,
+             Window w,
+             x_gram *gram,
+             XExposeEvent *event)
 {
    static Region region;
    static int partregion;
index 33623f1b428f3c875dac07222cce87ddeff79ad4..5d3f5d02aefe1ac96ccb54fc29d0d6838e93b747 100644 (file)
 #define x_gram_TYPE
 
 #include <X11/Xlib.h>
+#include <X11/Xutil.h>
 #include <sys/time.h>
 
+#include "formatter.h"
+
 typedef struct _xblock {
    unsigned long fgcolor;
    Font fid;
@@ -73,10 +76,11 @@ typedef struct _xlinedesc {
 #define CENTERALIGN 1
 #define RIGHTALIGN  2
 
-extern void x_gram_init();
-extern void x_gram_create();
-extern void x_gram_expose();
-extern void xshow();
-extern void xcut();
+extern void x_gram_init(Display *);
+extern void x_gram_create(Display *, x_gram *, int, int, int, int, int, int, int);
+extern void x_gram_expose(Display *, Window, x_gram *, XExposeEvent *);
+extern void xshow(Display *, desctype *, int, int);
+extern void xcut(Display *, XEvent *, XContext);
+extern void x_get_input(Display *);
 
 #endif
index 4b46c2240a87a184d65bacdde39d988dfac50a4b..8c047af1d76ad84bd24464629a87939f84229dc0 100644 (file)
@@ -24,12 +24,14 @@ static const char rcsid_buffer_c[] = "$Id$";
 
 static char *buffer = 0;
 
-string buffer_to_string()
+string
+buffer_to_string(void)
 {
     return(buffer);
 }
 
-void clear_buffer()
+void
+clear_buffer(void)
 {
     if (buffer)
       free(buffer);
@@ -37,8 +39,8 @@ void clear_buffer()
     buffer = string_Copy("");
 }
 
-void append_buffer(str)
-     char *str;
+void
+append_buffer(char *str)
 {
     buffer = string_Concat2(buffer, str);
 }
index 8b9e5b21ff98eb6728613191aae2db392fb472d1..db3f2ea28cdd4dff1c0d13f8c716aeac5ed85aa7 100644 (file)
@@ -19,8 +19,8 @@
 
 #include "new_string.h"
 
-extern string buffer_to_string();
-extern void clear_buffer();
-extern void append_buffer();
+extern string buffer_to_string(void);
+extern void clear_buffer(void);
+extern void append_buffer(char *);
 
 #endif
index f14e600d8ca6a87bb4057acc6c1131e48f0c0ff1..a11aa86effc992ce3529e7f59a5c72d43971de6f 100644 (file)
@@ -29,8 +29,8 @@ static const char rcsid_character_class_c[] = "$Id$";
 static character_class cache;
 
 /* character_class */
-char * string_to_character_class(str)
-     string str;
+char *
+string_to_character_class(string str)
 {
     int i;
 
index 1ead477b7f3c70125bd20173132ba2da588ae0eb..050b282e0ffb8873419ba5a87a4e6a4798cb6e69 100644 (file)
@@ -23,6 +23,6 @@
 
 typedef char character_class[NUMBER_OF_CHARACTERS];
 
-extern /* character_class */ char * string_to_character_class();
+extern /* character_class */ char * string_to_character_class(string);
 
 #endif
index c30d73f2858b3e5264d627286a081011962cfe00..f6a3c742d3c59d95d927bf3b339977b5901044f9 100644 (file)
@@ -66,8 +66,8 @@ static const char rcsid_dictionary_c[] = "$Id$";
  *                 that size is a prime number.
  */
 
-TYPE_T_dictionary TYPE_T_dictionary_Create(size)
-     int size;
+TYPE_T_dictionary
+TYPE_T_dictionary_Create(int size)
 {
     int i;
     TYPE_T_dictionary result;
@@ -94,8 +94,8 @@ TYPE_T_dictionary TYPE_T_dictionary_Create(size)
  *                 TYPE_T_dictionary_Enumerate.
  */
 
-void TYPE_T_dictionary_Destroy(d)
-     TYPE_T_dictionary d;
+void
+TYPE_T_dictionary_Destroy(TYPE_T_dictionary d)
 {
     int i;
     TYPE_T_dictionary_binding *binding_ptr, *new_binding_ptr;
@@ -124,9 +124,8 @@ void TYPE_T_dictionary_Destroy(d)
  *                 writable by proc.
  */
 
-void TYPE_T_dictionary_Enumerate(d, proc)
-     TYPE_T_dictionary d;
-     void (*proc)(/* TYPE_T_dictionary_binding *b */);
+void TYPE_T_dictionary_Enumerate(TYPE_T_dictionary d,
+                                void (*proc)(TYPE_T_dictionary_binding *))
 {
     int i;
     TYPE_T_dictionary_binding *binding_ptr;
@@ -149,8 +148,8 @@ void TYPE_T_dictionary_Enumerate(d, proc)
  *                 keys over the table's slots.
  */
 
-static unsigned int dictionary__hash(s)
-     char *s;
+static unsigned int
+dictionary__hash(char *s)
 {
     unsigned int result = 0;
 
@@ -174,9 +173,9 @@ static unsigned int dictionary__hash(s)
  *                 Note the access restrictions on bindings...
  */
 
-TYPE_T_dictionary_binding *TYPE_T_dictionary_Lookup(d, key)
-     TYPE_T_dictionary d;
-     char *key;
+TYPE_T_dictionary_binding *
+TYPE_T_dictionary_Lookup(TYPE_T_dictionary d,
+                        char *key)
 {
     TYPE_T_dictionary_binding *binding_ptr;
 
@@ -206,10 +205,10 @@ TYPE_T_dictionary_binding *TYPE_T_dictionary_Lookup(d, key)
  *                 in this case.
  */
 
-TYPE_T_dictionary_binding *TYPE_T_dictionary_Define(d, key, already_existed)
-     TYPE_T_dictionary d;
-     char *key;
-     int *already_existed;
+TYPE_T_dictionary_binding *
+TYPE_T_dictionary_Define(TYPE_T_dictionary d,
+                        char *key,
+                        int *already_existed)
 {
     TYPE_T_dictionary_binding **ptr_to_the_slot, *binding_ptr;
 
@@ -245,9 +244,8 @@ TYPE_T_dictionary_binding *TYPE_T_dictionary_Define(d, key, already_existed)
  *                 before making this call.
  */
 
-void TYPE_T_dictionary_Delete(d, b)
-     TYPE_T_dictionary d;
-     TYPE_T_dictionary_binding *b;
+void TYPE_T_dictionary_Delete(TYPE_T_dictionary d,
+                             TYPE_T_dictionary_binding *b)
 {
     TYPE_T_dictionary_binding **ptr_to_binding_ptr;
 
index b9d9312345c2159690170e4e9cc0af683dc079fb..d3f77be9e06f476251858481a3914ffb79c8379b 100644 (file)
@@ -37,7 +37,7 @@ typedef struct _TYPE_T_dictionary {                /* PRIVATE */
  *                 that size is a prime number.
  */
 
-extern TYPE_T_dictionary TYPE_T_dictionary_Create(/* int size */);
+extern TYPE_T_dictionary TYPE_T_dictionary_Create(int);
 
 /*
  *    void TYPE_T_dictionary_Destroy(TYPE_T_dictionary d):
@@ -50,10 +50,11 @@ extern TYPE_T_dictionary TYPE_T_dictionary_Create(/* int size */);
  *                 TYPE_T_dictionary_Enumerate.
  */
 
-extern void TYPE_T_dictionary_Destroy(/* TYPE_T_dictionary d */);
+extern void TYPE_T_dictionary_Destroy(TYPE_T_dictionary);
 
 /*
- *    void TYPE_T_dictionary_Enumerate(TYPE_T_dictionary d; void (*proc)()):
+ *    void TYPE_T_dictionary_Enumerate(TYPE_T_dictionary d;
+ *                                     void (*proc)(TYPE_T_dictionary_binding *b)):
  *        Requires: proc is a void procedure taking 1 argument, a
  *                  TYPE_T_dictionary_binding pointer, which does not
  *                  make any calls using dictionary d.
@@ -63,8 +64,7 @@ extern void TYPE_T_dictionary_Destroy(/* TYPE_T_dictionary d */);
  *                 writable by proc.
  */
 
-extern void TYPE_T_dictionary_Enumerate(/* TYPE_T_dictionary d, 
-                                          void (*proc)() */);
+extern void TYPE_T_dictionary_Enumerate(TYPE_T_dictionary, void (*)(TYPE_T_dictionary_binding *));
 
 /*
  *    TYPE_T_dictionary_binding *TYPE_T_dictionary_Lookup(TYPE_T_dictionary d,
@@ -74,7 +74,8 @@ extern void TYPE_T_dictionary_Enumerate(/* TYPE_T_dictionary d,
  *                 Note the access restrictions on bindings...
  */
 
-extern TYPE_T_dictionary_binding *TYPE_T_dictionary_Lookup(/* d, key */);
+extern TYPE_T_dictionary_binding *TYPE_T_dictionary_Lookup(TYPE_T_dictionary,
+                                                          char *);
 
 /*
  *    TYPE_T_dictionary_binding *TYPE_T_dictionary_Define(TYPE_T_dictionary d,
@@ -92,7 +93,8 @@ extern TYPE_T_dictionary_binding *TYPE_T_dictionary_Lookup(/* d, key */);
  *                 in this case.
  */
 
-extern TYPE_T_dictionary_binding *TYPE_T_dictionary_Define();
+extern TYPE_T_dictionary_binding *TYPE_T_dictionary_Define(TYPE_T_dictionary,
+                                                          char *, int *);
 
 /*
  *    void TYPE_T_dictionary_Delete(TYPE_T_dictionary d,
@@ -104,6 +106,7 @@ extern TYPE_T_dictionary_binding *TYPE_T_dictionary_Define();
  *                 before making this call.
  */
 
-extern void TYPE_T_dictionary_Delete();
+extern void TYPE_T_dictionary_Delete(TYPE_T_dictionary,
+                                    TYPE_T_dictionary_binding *);
 
 #endif
index 0bf8d1c78d5cfb1195142deed561eae7da4f85bf..33c4140f335f10706d403b3563876718e5d4d032 100644 (file)
@@ -33,6 +33,7 @@ static const char rcsid_eval_c[] = "$Id$";
 #include "port.h"
 #include "buffer.h"
 #include "regexp.h"
+#include "formatter.h"
 #include "text_operations.h"
 #include "zwgc.h"
 #include "variables.h"
@@ -65,8 +66,8 @@ static const char rcsid_eval_c[] = "$Id$";
  *                eventually.
  */
 
-static string bool_to_string(bool)
-     int bool;
+static string
+bool_to_string(int bool)
 {
     return(bool ? string_Copy("TRUE") : string_Copy("FALSE"));
 }
@@ -79,8 +80,8 @@ static string bool_to_string(bool)
  *                 NULL is defined to have the boolean value true.
  */
 
-int eval_bool_expr(expr)
-     Node *expr;
+int
+eval_bool_expr(Node *expr)
 {
     string temp;
     int result;
@@ -110,15 +111,14 @@ int eval_bool_expr(expr)
  *                 eventually.
  */
 
-string eval_expr(expr)
-     Node *expr;
+string
+eval_expr(Node *expr)
 {
     int opcode = expr->opcode;
     int bool_result;
     string first, second;
     char *result;
     string *text_ptr;
-    char *getenv();           /* UNIX get environment variable function */
 
     /*
      * Dispatch based on the opcode of the top node in the expression:
index d664794bf898f7cc1a6fc9999cb1c86eb103bd2f..427f713c26174083e330842acebf278649be84f8 100644 (file)
@@ -28,7 +28,7 @@
  *                 eventually.
  */
 
-extern string eval_expr();
+extern string eval_expr(Node *);
 
 /*
  *    int eval_bool_expr(Node *expr)
@@ -38,6 +38,6 @@ extern string eval_expr();
  *                 NULL is defined to have the boolean value true.
  */
 
-extern int eval_bool_expr();
+extern int eval_bool_expr(Node *);
 
 #endif
index 1bf8f724908fcfa5d7fbdbcc3ac0cfada63be623..f24bcb83aa6d3f1cc6087cd07cefb26ccc5e8fe8 100644 (file)
@@ -27,15 +27,16 @@ static const char rcsid_exec_c[] = "$Id$";
 
 #include <zephyr/zephyr.h>
 #include "new_memory.h"
+#include "node.h"
 #include "exec.h"
 #include "eval.h"
-#include "node.h"
 #include "buffer.h"
 #include "port.h"
 #include "variables.h"
 #include "notice.h"
 
-static int exec_subtree(), exec_fields();
+static int exec_subtree(Node *);
+static int exec_fields(Node *);
 
 /****************************************************************************/
 /*                                                                          */
@@ -43,8 +44,8 @@ static int exec_subtree(), exec_fields();
 /*                                                                          */
 /****************************************************************************/
 
-static string eval_exprlist_to_string(exprlist)
-     Node *exprlist;
+static string
+eval_exprlist_to_string(Node *exprlist)
 {
     string result = string_Copy("");
     string temp;
@@ -64,8 +65,8 @@ static string eval_exprlist_to_string(exprlist)
     return(result);
 }
 
-static char **eval_exprlist_to_args(exprlist)
-     Node *exprlist;
+static char **
+eval_exprlist_to_args(Node *exprlist)
 {
     char **result = (char **)malloc(sizeof(char *));
     int argc = 0;
@@ -80,8 +81,8 @@ static char **eval_exprlist_to_args(exprlist)
     return(result);
 }
 
-static void free_args(args)
-     char **args;
+static void
+free_args(char **args)
 {
     char **p;
 
@@ -103,28 +104,28 @@ static void free_args(args)
 #define  EXIT      2
 
 /*ARGSUSED*/
-static int exec_noop(node)
-     Node *node;
+static int
+exec_noop(Node *node)
 {
     return(NOBREAK);
 }
 
 /*ARGSUSED*/
-static int exec_break(node)
-     Node *node;
+static int
+exec_break(Node *node)
 {
     return(BREAK);
 }
 
 /*ARGSUSED*/
-static int exec_exit(node)
-     Node *node;
+static int
+exec_exit(Node *node)
 {
     return(EXIT);
 }
 
-static int exec_set(node)
-     Node *node;
+static int
+exec_set(Node *node)
 {
     var_set_variable_then_free_value(node->d.nodes.first->d.string_constant,
                                     eval_expr(node->d.nodes.second));
@@ -132,8 +133,8 @@ static int exec_set(node)
     return(NOBREAK);
 }
 
-static int exec_execport(node)
-     Node *node;
+static int
+exec_execport(Node *node)
 {
     string name = eval_expr(node->d.nodes.first);
     char **argv = eval_exprlist_to_args(node->d.nodes.second);
@@ -145,8 +146,8 @@ static int exec_execport(node)
     return(NOBREAK);
 }
 
-static int exec_appendport(node)
-     Node *node;
+static int
+exec_appendport(Node *node)
 {
     string name, filename;
 
@@ -160,8 +161,8 @@ static int exec_appendport(node)
     return(NOBREAK);
 }
 
-static int exec_inputport(node)
-     Node *node;
+static int
+exec_inputport(Node *node)
 {
     string name, filename;
 
@@ -175,8 +176,8 @@ static int exec_inputport(node)
     return(NOBREAK);
 }
 
-static int exec_outputport(node)
-     Node *node;
+static int
+exec_outputport(Node *node)
 {
     string name, filename;
 
@@ -190,8 +191,8 @@ static int exec_outputport(node)
     return(NOBREAK);
 }
 
-static int exec_closeinput(node)
-     Node *node;
+static int
+exec_closeinput(Node *node)
 {
     string name;
 
@@ -202,8 +203,8 @@ static int exec_closeinput(node)
     return(NOBREAK);
 }
 
-static int exec_closeoutput(node)
-     Node *node;
+static int
+exec_closeoutput(Node *node)
 {
     string name;
 
@@ -214,8 +215,8 @@ static int exec_closeoutput(node)
     return(NOBREAK);
 }
 
-static int exec_closeport(node)
-     Node *node;
+static int
+exec_closeport(Node *node)
 {
     string name;
 
@@ -227,8 +228,8 @@ static int exec_closeport(node)
     return(NOBREAK);
 }
 
-static int exec_put(node)
-     Node *node;
+static int
+exec_put(Node *node)
 {
     string name, temp;
 
@@ -249,8 +250,8 @@ static int exec_put(node)
     return(NOBREAK);
 }
 
-static int exec_print(node)
-     Node *node;
+static int
+exec_print(Node *node)
 {
     string temp;
 
@@ -262,16 +263,16 @@ static int exec_print(node)
 }
 
 /*ARGSUSED*/
-static int exec_clearbuf(node)
-     Node *node;
+static int
+exec_clearbuf(Node *node)
 {
     clear_buffer();
 
     return(NOBREAK);
 }
 
-static int exec_case(node)
-     Node *node;
+static int
+exec_case(Node *node)
 {
     string constant,temp;
     Node *match, *cond;
@@ -300,8 +301,8 @@ static int exec_case(node)
     return(NOBREAK);
 }
 
-static int exec_while(node)
-     Node *node;
+static int
+exec_while(Node *node)
 {
     int continue_code = NOBREAK;
 
@@ -317,8 +318,8 @@ static int exec_while(node)
     return(continue_code);
 }
 
-static int exec_if(node)
-     Node *node;
+static int
+exec_if(Node *node)
 {
     Node *conds;
 
@@ -329,8 +330,8 @@ static int exec_if(node)
     return(NOBREAK);
 }
 
-static int exec_exec(node)
-     Node *node;
+static int
+exec_exec(Node *node)
 {
     int pid;
     char **argv = eval_exprlist_to_args(node->d.nodes.first);
@@ -351,7 +352,7 @@ static int exec_exec(node)
 }
 
 static struct _Opstuff {
-    int (*exec)();
+    int (*exec)(Node *);
 } const opstuff[] = {
     { exec_noop },                         /* string_constant */
     { exec_noop },                         /* varref */
@@ -412,8 +413,8 @@ static struct _Opstuff {
     { exec_noop },                           /* default */
 };
 
-static int exec_subtree(node)
-     Node *node;
+static int
+exec_subtree(Node *node)
 {
     int retval = NOBREAK;
     
@@ -432,8 +433,8 @@ static char *notice_fields;
 static int notice_fields_length = 0;
 static int number_of_fields = 0;
 
-static int exec_fields(node)
-     Node *node;
+static int
+exec_fields(Node *node)
 {
     for (node=node->d.nodes.first; node; node=node->next) {
        var_set_variable_then_free_value(node->d.string_constant,
@@ -448,9 +449,9 @@ static int exec_fields(node)
     return(NOBREAK);
 }
 
-void exec_process_packet(program, notice)
-     Node *program;
-     ZNotice_t *notice;
+void
+exec_process_packet(Node *program,
+                   ZNotice_t *notice)
 {
     notice_fields = notice->z_message;
     notice_fields_length = notice->z_message_len;
index 7eebc20e17e45a8635879b2c08130477325133ee..db691ddd61683dc7e5151867ac03731885a8e31b 100644 (file)
@@ -17,6 +17,6 @@
 #ifndef exec_MODULE
 #define exec_MODULE
 
-extern void exec_process_packet();
+extern void exec_process_packet(Node *, ZNotice_t *);
 
 #endif
index 1f3fc62bb768a7238c8b12d51f91357718d2fc6f..b3ba8fadfa10a06efe5b2502db8ced97d9807eed 100644 (file)
@@ -38,10 +38,9 @@ static const char rcsid_file_c[] = "$Id$";
  *               if necessary.
  */
 
-char *get_home_directory()
+char *get_home_directory(void)
 {
     char *result;
-    char *getenv();
     struct passwd *passwd_entry;
 
     if (result = getenv("HOME"))
@@ -57,10 +56,9 @@ char *get_home_directory()
  *
  */
 
-FILE *locate_file(override_filename, home_dir_filename, fallback_filename)
-     char *override_filename;
-     char *home_dir_filename;
-     char *fallback_filename;
+FILE *locate_file(char *override_filename,
+                 char *home_dir_filename,
+                 char *fallback_filename)
 {
     char *filename;
     FILE *result;
index b0aff1f92345f18e8d99720fa7ae952a8237cbb6..3f185bf091473ad27b4654860f2b90d740302017 100644 (file)
@@ -19,6 +19,6 @@
 
 #include <stdio.h>
 
-extern FILE *locate_file();
+extern FILE *locate_file(char *, char *, char *);
 
 #endif
index c900c9fa95cc11fd9d0b51856f4e255ca48fc05a..923268e5d6d0a95662b6606840716008c0a511c0 100644 (file)
@@ -30,7 +30,8 @@ static const char rcsid_formatter_c[] = "$Id$";
 #define const
 #endif
 
-static int pure_text_length(), env_length();
+static int pure_text_length(char *, char);
+static int env_length(char *);
 
 #ifdef notdef
 static character_class atsign_set = { /* '@' = 0x40 */
@@ -171,17 +172,17 @@ static char brackets[]="()<>[]{}@";
 static char *openbracket[]={"@<","@<","@[","@[","@{","@{","@(","@(","@("};
 static char *closebracket[]={">",">","]","]","}","}",")",")",")"};
 
-static int not_contains(str, set)
-     string str;
-     const character_class set;
+static int
+not_contains(string str,
+            const character_class set)
 {
    while (*str && ! set[*str]) str++;
    return (! *str);
 }
 
-static int pure_text_length(text,terminator)
-     char *text;
-     char terminator;
+static int
+pure_text_length(char *text,
+                char terminator)
 {
    int len=0;
 
@@ -205,8 +206,8 @@ static int pure_text_length(text,terminator)
    }
 }
 
-static char otherside(opener)
-char opener;
+static char
+otherside(char opener)
 {
    switch (opener) {
     case '(':
@@ -227,9 +228,8 @@ char opener;
 /* the char * that str points to is free'd by this function.
  * if you want to keep it, save it yourself
  */
-string verbatim(str, bracketsonly)
-     string str;
-     int bracketsonly;
+string
+verbatim(string str, int bracketsonly)
 {
    char *temp,*temp2;
    int bracketnum,len;
@@ -306,8 +306,8 @@ string verbatim(str, bracketsonly)
    or the default terminator \0.  The text will not be modified,
    and @@ will be counted twice */
 
-string protect(str)
-     string str;
+string
+protect(string str)
 {
    string temp,temp2,temp3;
    int len,templen;
@@ -375,8 +375,8 @@ string protect(str)
 
 /* str points to a string.  return value is another string
    which is the original with all styles removed. */
-string stylestrip(str)
-     string str;
+string
+stylestrip(string str)
 {
     int templen = 0, otherchar;
     char *temp = (char *) malloc(string_Length(str) + 1);
@@ -418,8 +418,8 @@ string stylestrip(str)
     return(temp);
 }
 
-void free_desc(desc)
-     desctype *desc;
+void
+free_desc(desctype *desc)
 {
     desctype *next_desc;
 
@@ -434,8 +434,8 @@ void free_desc(desc)
 /* text points to beginning of possible env name.  return value is
    length of env name, not including @ or opener, or -1 if not a
    possible env name. */
-static int env_length(text)
-     char *text;
+static int
+env_length(char *text)
 {
    int len=0;
 
@@ -454,9 +454,9 @@ static int env_length(text)
    length of string, up to but not including the passed terminator
    or the default terminators \0 \n @.  This can modify text, and 0
    is a valid return value. */
-static int text_length(text,terminator)
-     char *text;
-     char terminator;
+static int
+text_length(char *text,
+           char terminator)
 {
    int len=0;
 
@@ -482,9 +482,10 @@ static int text_length(text,terminator)
 /* parses str into a desc linked list.  Returns number of strings and
    newlines in *pstr and *pnl */
 
-desctype *disp_get_cmds(str,pstr,pnl)
-char *str;
-int *pstr,*pnl;
+desctype *
+disp_get_cmds(char *str,
+             int *pstr,
+             int *pnl)
 {
    desctype *desc,*here;
    int len;
index 0a76687e8b2c77c3e9b03117e2d2ceded0c301cd..d2cf0f061eb6c4b0e52aa968e59b5fafd9c439e3 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <zephyr/mit-copyright.h>
 
+#include "new_string.h"
+
 #ifndef formatter_MODULE
 #define formatter_MODULE
 
@@ -32,7 +34,10 @@ typedef struct _desctype {
                           ENV, STR, END.  Undefined for EOF */
 } desctype;
 
-extern desctype *disp_get_cmds();
-extern void free_desc();
+extern desctype *disp_get_cmds(char *, int *, int *);
+extern void free_desc(desctype *);
 
+extern string protect(string);
+extern string verbatim(string, int);
+extern string stylestrip(string);
 #endif
index 16e04e61605215eefd9c76038d019e95b178728f..7e3208609d84d6418b7e7787d77e37af70a984da 100644 (file)
@@ -64,7 +64,8 @@ static FILE *input_file;
 
 static int pushback = -1;
 
-static char input()
+static char
+input(void)
 {
     int c;
 
@@ -85,8 +86,8 @@ static char input()
     return(c);
 }
 
-static void unput(c)
-     int c;
+static void
+unput(int c)
 {
 #ifdef DEBUG
     if (pushback != -1) {
@@ -171,8 +172,8 @@ static struct keyword_info keywords[] =   {
  *            a file.  Resets current line # to 1.
  */
 
-void lex_open(file)
-     FILE *file;
+void
+lex_open(FILE *file)
 {
     /*
      * Initialize I/O:
@@ -219,7 +220,8 @@ void lex_open(file)
 
 #define  is_octal_digit(c)           (((c)>='0') && ((c)<='7'))
 
-static char eat_escape_code()
+static char
+eat_escape_code(void)
 {
     int c, coded_char;
 
@@ -269,8 +271,8 @@ static char eat_escape_code()
  *              string we are eating started on.
  */
 
-static char *eat_string(starting_line)
-     int starting_line;
+static char *
+eat_string(int starting_line)
 {
     int c;
     char buffer[500];
@@ -343,8 +345,8 @@ static char *eat_string(starting_line)
  *    instead of doing the above, we just eat the "endshow" & return 0.
  */
 
-static char *eat_show_line(test_for_endshow)
-     int test_for_endshow;
+static char *
+eat_show_line(int test_for_endshow)
 {
     int c;
     int saw_escape_code = 0;
@@ -408,8 +410,8 @@ static char *eat_show_line(test_for_endshow)
  *                   messages.
  */
 
-static char *eat_til_endshow(start_line_no)
-     int start_line_no;
+static char *
+eat_til_endshow(int start_line_no)
 {
     register int c;
     string text_so_far = string_Copy("");
@@ -453,7 +455,8 @@ static char *eat_til_endshow(start_line_no)
  *               returned.
  */
 
-static int handle_show()
+static int
+handle_show(void)
 {
     int c;
     int start_line_no = yylineno;
@@ -483,7 +486,7 @@ static int handle_show()
  * yylex - performs as per. the yacc manual's requirements
  */
 
-int yylex()
+int yylex(void)
 {
     register int c, last_char;
     register char *ptr;
index fd76e8f3d263263c6c6f03b1165a94200f779787..0cda2b4fba2cf27a337fbc3be76a770a38da024d 100644 (file)
@@ -48,12 +48,12 @@ extern int yylineno;
  *            a file.  Resets current line # to 1.
  */
 
-extern void lex_open(/* FILE *file */);
+extern void lex_open(FILE *);
 
 /*
  * yylex - performs as per. the yacc manual's requirements
  */
 
-extern int yylex();
+/* extern int yylex(); */
 
 #endif
index 52b9e7a3741bc22df86cf25feceadd3bef0738f6..3568443a9784ca4df30214eed462e609a008c635 100644 (file)
@@ -40,10 +40,13 @@ static const char rcsid_main_c[] = "$Id$";
 #include "variables.h"
 #include "main.h"
 
-extern void notice_handler();
-static void process_notice(), setup_signals(), detach(), signal_exit();
+void notice_handler(ZNotice_t *);
+static void process_notice(ZNotice_t *, char *);
+static void setup_signals(int);
+static void detach(void);
+static void signal_exit(int);
 #ifdef HAVE_ARES
-static void notice_callback();
+static void notice_callback(void *, int, struct hostent *);
 #endif
 
 /*
@@ -105,7 +108,8 @@ static struct _Node *program = NULL;
  * <<<>>>
  */
 
-static void fake_startup_packet()
+static void
+fake_startup_packet(void)
 {
     ZNotice_t notice;
     struct timezone tz;
@@ -122,7 +126,7 @@ static void fake_startup_packet()
     notice.z_default_format = "Zwgc mark II version $version now running...\n";
     notice.z_recipient = "";
     notice.z_sender = "ZWGC";
-    gettimeofday(&notice.z_time,&tz);
+    Z_gettimeofday(&notice.z_time, &tz);
     notice.z_port = 0;
     notice.z_kind = ACKED;
     notice.z_auth = ZAUTH_YES;
@@ -134,7 +138,8 @@ static void fake_startup_packet()
     process_notice(&notice, NULL);
 }
 
-static void read_in_description_file()
+static void
+read_in_description_file(void)
 {
     FILE *input_file;
     char defdesc[128];
@@ -163,7 +168,8 @@ static void read_in_description_file()
  *                 program with error code 1.
  */
 
-void usage()
+void
+usage(void)
 {
 #ifdef DEBUG
     fprintf(stderr, "\
@@ -185,7 +191,8 @@ zwgc: usage: zwgc [-f <filename>] [-subfile <filename>]\n\
  * <<<>>>
  */
 
-static void run_initprogs()
+static void
+run_initprogs(void)
 {
     /*
      * This code stolen from old zwgc: yuck.  Clean up & fix.  <<<>>>
@@ -214,9 +221,9 @@ static void run_initprogs()
  * main -- the program entry point.  Does parsing & top level control.
  */
 
-int main(argc, argv)
-     int argc;
-     char **argv;
+int
+main(int argc,
+     char **argv)
 {
     char **new;
     register char **current;
@@ -321,8 +328,8 @@ int main(argc, argv)
 #define  USER_SUPPRESS     "SUPPRESS"
 #define  USER_UNSUPPRESS   "UNSUPPRESS"
 
-void notice_handler(notice)
-     ZNotice_t *notice;
+void
+notice_handler(ZNotice_t *notice)
 {
     struct hostent *fromhost = NULL;
 
@@ -343,10 +350,10 @@ void notice_handler(notice)
 }
 
 #ifdef HAVE_ARES
-static void notice_callback(arg, status, fromhost)
-     void *arg;
-     int status;
-     struct hostent *fromhost;
+static void
+notice_callback(void *arg,
+               int status,
+               struct hostent *fromhost)
 {
     ZNotice_t *notice = (ZNotice_t *) arg;
 
@@ -356,9 +363,9 @@ static void notice_callback(arg, status, fromhost)
 }
 #endif
 
-static void process_notice(notice, hostname)
-     ZNotice_t *notice;
-     char *hostname;
+static void
+process_notice(ZNotice_t *notice,
+              char *hostname)
 {
     char *control_opcode;
 
@@ -400,7 +407,7 @@ static void process_notice(notice, hostname)
            free(instance);
            free(recipient);
        } else if (!strcasecmp(control_opcode, USER_EXIT)) {
-           signal_exit();
+           signal_exit(0);
        } else
          printf("zwgc: unknown control opcode %s.\n", control_opcode);
 
@@ -434,21 +441,22 @@ static void process_notice(notice, hostname)
  *
  */
 
-static void signal_exit()
+static void
+signal_exit(int ignored)
 {
     mux_end_loop_p = 1;
 }
 
 /* clean up ALL the waiting children, in case we get hit with
    multiple SIGCHLD's at once, and don't process in time. */
-static RETSIGTYPE signal_child()
+static RETSIGTYPE
+signal_child(int ignored)
 {
 #ifdef HAVE_WAITPID
   int status;
 #else
   union wait status;
 #endif
-  extern int errno;
   int pid, old_errno = errno;
 
   do {
@@ -462,13 +470,14 @@ static RETSIGTYPE signal_child()
 }
 
 /* rewrite the wgfile in case it has gone away */
-static RETSIGTYPE signal_usr1()
+static RETSIGTYPE
+signal_usr1(int ignored)
 {
     write_wgfile();
 }
 
-static void setup_signals(dofork)
-     int dofork;
+static void
+setup_signals(int dofork)
 {
 #ifdef _POSIX_VERSION
     struct sigaction sa;
@@ -525,7 +534,8 @@ static void setup_signals(dofork)
 
 /* detach() taken from old zwgc, with lots of stuff ripped out */
 
-static void detach()
+static void
+detach(void)
 {
   /* detach from terminal and fork. */
   register int i;
index 7b6405dfbd4d4efc4537d84ebba2378406481f72..3d6ea05b53c198e265dd6d7114d6def62cd92a55 100644 (file)
@@ -33,7 +33,7 @@ extern char *location_override;
  *                 program with error code 1.
  */
 
-extern void usage();
+extern void usage(void);
 
 /* USRDESC points to a file (relative to user's homedir) which has a user's
    description file */
index 0e37ebc274b28ea607038d92a9470452a7012d17..341e6e679c11ccfee2993fc5a98baa1a9a8f166f 100644 (file)
@@ -62,10 +62,10 @@ static int max_source = -1;
  */
 
 static fd_set input_sources;
-static void (*input_handler[MAX_SOURCES])();
+static void (*input_handler[MAX_SOURCES])(void *);
 static pointer input_handler_arg[MAX_SOURCES];
 
-static int check_tty();
+static int check_tty(void);
 
 /*
  *    void mux_init()
@@ -74,7 +74,8 @@ static int check_tty();
  *                 any other mux call.
  */
 
-void mux_init()
+void
+mux_init(void)
 {
     int i;
 
@@ -96,10 +97,10 @@ void mux_init()
  *                 argument arg.
  */
 
-void mux_add_input_source(descriptor, handler, arg)
-     int descriptor;
-     void (*handler)();
-     pointer arg;
+void
+mux_add_input_source(int descriptor,
+                         void (*handler)(void *),
+                         pointer arg)
 {
 #ifdef DEBUG
     if(descriptor < 0 || descriptor >= MAX_SOURCES)
@@ -128,7 +129,8 @@ void mux_add_input_source(descriptor, handler, arg)
  *                 true, we return.
  */
 
-void mux_loop()
+void
+mux_loop(void)
 {
     int i, nfds;
     fd_set inputs, outputs;
@@ -203,7 +205,8 @@ void mux_loop()
     }
 }
 
-static int check_tty()
+static int
+check_tty(void)
 {
     register int result;
     int pgrp;
index 3654a3fb32f286d4ca1c67decf1ce734457f655d..230f9df6241e07a2923431de5f938c188790971b 100644 (file)
@@ -38,7 +38,7 @@ extern int mux_end_loop_p;
  *                 any other mux call.
  */
 
-extern void mux_init();
+extern void mux_init(void);
 
 /*
  *    void mux_add_input_source(int descriptior; void (*handler)(); void *arg)
@@ -50,7 +50,7 @@ extern void mux_init();
  *                 argument arg.
  */
 
-extern void mux_add_input_source();
+extern void mux_add_input_source(int, void (*)(void *), void *);
 
 /*
  *    void mux_loop()
@@ -67,6 +67,6 @@ extern void mux_add_input_source();
  *                 true, we return.
  */
 
-extern void mux_loop();
+extern void mux_loop(void);
 
 #endif
index 98aa02bdee6bed81a7c3f838f486f6cb7cfac55f..906a2b900d5c9611cdaf567f62f0579ef6a5bcb9 100644 (file)
@@ -56,9 +56,7 @@ typedef char *string;
  *                 string_Copy("foo").
  */
 
-string string__CreateFromData(data, length)
-     char *data;
-     int length;
+string string__CreateFromData(char *data, int length)
 {
     string result;
 
@@ -79,8 +77,8 @@ string string__CreateFromData(data, length)
  *                 freed eventually.
  */
 
-string string__Copy(s)
-     string s;
+string
+string__Copy(string s)
 {
     int length;
     string result;
@@ -103,8 +101,9 @@ string string__Copy(s)
  *                 returns string_Copy("abcdef").
  */
 
-string string__Concat(a, b)
-     string a, b;
+string
+string__Concat(string a,
+              string b)
 {
     string result;
     int a_length, b_size, result_size;
@@ -133,8 +132,9 @@ string string__Concat(a, b)
  *                 only faster.  I.e., uses realloc instead of malloc+memcpy.
  */
 
-string string__Concat2(a, b)
-     string a, b;
+string
+string__Concat2(string a,
+               string b)
 {
     int a_length = string_Length(a);
     int b_size = string_Length(b)+1;
@@ -159,8 +159,8 @@ string string__Concat2(a, b)
  *                 S is returned as a convenience.
  */
 
-string string_Downcase(s)
-     string s;
+string
+string_Downcase(string s)
 {
     char *ptr;
 
@@ -181,8 +181,8 @@ string string_Downcase(s)
  *                 S is returned as a convenience.
  */
 
-string string_Upcase(s)
-     string s;
+string
+string_Upcase(string s)
 {
     char *ptr;
 
index 2ad7851e4d20b6b009f210727c575f39de7afcf9..ea1010559706a0168c37b4007973e3733f96e959 100644 (file)
@@ -51,7 +51,7 @@ typedef char *string;
  *                 string_Copy("foo").
  */
 
-extern string string__CreateFromData();
+extern string string__CreateFromData(char *, int);
 #ifdef DEBUG_MEMORY
 #define string_CreateFromData(data,length) (set_module(__FILE__,__LINE__),\
                                    string__CreateFromData(data,length))
@@ -65,7 +65,7 @@ extern string string__CreateFromData();
  *                 freed eventually.
  */
 
-extern string string__Copy(/* string s */);
+extern string string__Copy(string);
 #ifdef DEBUG_MEMORY
 #define string_Copy(data)  (set_module(__FILE__,__LINE__),\
                            string__Copy(data))
@@ -81,7 +81,7 @@ extern string string__Copy(/* string s */);
  *                 returns string_Copy("abcdef").
  */
 
-extern string string__Concat(/* string a, b */);
+extern string string__Concat(string, string);
 #ifdef DEBUG_MEMORY
 #define string_Concat(a,b)  (set_module(__FILE__,__LINE__),\
                             string__Concat(a,b))
@@ -101,7 +101,7 @@ extern string string__Concat(/* string a, b */);
  *                 only faster.  I.e., uses realloc instead of malloc+bcopy.
  */
 
-extern string string__Concat2(/* string a, b */);
+extern string string__Concat2(string, string);
 #ifdef DEBUG_MEMORY
 #define string_Concat2(a,b)  (set_module(__FILE__,__LINE__),\
                              string__Concat2(a,b))
@@ -118,7 +118,7 @@ extern string string__Concat2(/* string a, b */);
  *                 S is returned as a convenience.
  */
 
-extern string string_Downcase();
+extern string string_Downcase(string);
 
 /*
  *    string string_Upcase(string s):
@@ -129,6 +129,6 @@ extern string string_Downcase();
  *                 S is returned as a convenience.
  */
 
-extern string string_Upcase();
+extern string string_Upcase(string);
 
 #endif
index f3603d36e1ba17736abccb4c472861cfeb2952bb..f04225edc408efd0f483db2bfc29417c9fe2a3e3 100644 (file)
@@ -60,8 +60,8 @@ static int last_node_in_current_bunch_used = -1;
  *                 string on the heap when node_DestroyAllNodes is called.
  */
 
-static Node *node_create(opcode)
-     int opcode;
+static Node *
+node_create(int opcode)
 {
     Node *result;
 
@@ -102,7 +102,8 @@ static Node *node_create(opcode)
  *
  */
 
-void node_DestroyAllNodes()
+void
+node_DestroyAllNodes(void)
 {
     struct _bunch_of_nodes *next_bunch;
     int i, last_node_used_in_this_bunch;
@@ -132,9 +133,9 @@ void node_DestroyAllNodes()
 /*                                                                          */
 /****************************************************************************/
 
-Node *node_create_string_constant(opcode, text)
-     int opcode;
-     string text;
+Node *
+node_create_string_constant(int opcode,
+                           string text)
 {
     Node *n;
 
@@ -143,8 +144,8 @@ Node *node_create_string_constant(opcode, text)
     return(n);
 }
 
-Node *node_create_noary(opcode)
-     int opcode;
+Node *
+node_create_noary(int opcode)
 {
     Node *n;
 
@@ -152,9 +153,9 @@ Node *node_create_noary(opcode)
     return(n);
 }
 
-Node *node_create_unary(opcode, arg)
-     int opcode;
-     Node *arg;
+Node *
+node_create_unary(int opcode,
+                 Node *arg)
 {
     Node *n;
 
@@ -163,10 +164,10 @@ Node *node_create_unary(opcode, arg)
     return(n);
 }
 
-Node *node_create_binary(opcode, first_arg, second_arg)
-     int opcode;
-     Node *first_arg;
-     Node *second_arg;
+Node *
+node_create_binary(int opcode,
+                  Node *first_arg,
+                  Node *second_arg)
 {
     Node *n;
 
@@ -191,8 +192,8 @@ Node *node_create_binary(opcode, first_arg, second_arg)
  *                 the address of the (previously) last node.
  */
 
-Node *reverse_list_of_nodes(list)
-     Node *list;
+Node *
+reverse_list_of_nodes(Node *list)
 {
     Node *next_node;
     Node *head = NULL;
@@ -220,9 +221,9 @@ Node *reverse_list_of_nodes(list)
 
 #ifdef DEBUG
 
-static void print_stuff(node, format_string)
-     Node *node;
-     string format_string;
+static void
+print_stuff(Node *node,
+           string format_string)
 {
     char c;
 
@@ -311,8 +312,7 @@ static string how_to_print[] = {
     "match %1\n%2",
     "default\n%2" };
 
-void node_display(node)
-     Node *node;
+void node_display(Node *node)
 {
     int opcode = LAST_EXPR_OPCODE + 1;
 
index 4fdf678f40eca72125160f4ecadf4b2ef3dd51bc..556719b68c3c0933a77ec777166ba2a7df7db509 100644 (file)
@@ -100,13 +100,13 @@ typedef struct _Node {
 
 /* Function externs */
 
-extern void node_DestroyAllNodes();
+extern void node_DestroyAllNodes(void);
 
-extern Node *node_create_string_constant();
+extern Node *node_create_string_constant(int, string);
 
-extern Node *node_create_noary();
-extern Node *node_create_unary();
-extern Node *node_create_binary();
+extern Node *node_create_noary(int);
+extern Node *node_create_unary(int, Node *);
+extern Node *node_create_binary(int, Node *, Node *);
 
 /*
  *    Node *reverse_list_of_nodes(Node *list)
@@ -117,10 +117,10 @@ extern Node *node_create_binary();
  *                 the address of the (previously) last node.
  */
 
-extern Node *reverse_list_of_nodes();
+extern Node *reverse_list_of_nodes(Node *);
 
 #ifdef DEBUG
-extern void node_display();
+extern void node_display(Node *);
 #endif
 
 #endif
index 4e09167cd7cc46bbdc3ac70f3a73fffaeb6424e6..b3a660c9ea40d573c8a3a1983de7c6ae76906ad4 100644 (file)
@@ -38,9 +38,9 @@ static const char rcsid_notice_c[] = "$Id$";
  *        Effects: Returns the # of nulls in data[0]..data[length-1]
  */
 
-int count_nulls(data, length)
-     char *data;
-     int length;
+int
+count_nulls(char *data,
+           int length)
 {
     int count = 0;
 
@@ -66,9 +66,9 @@ int count_nulls(data, length)
  *                 remain.  (this is the case when *length_p == 0)
  */
 
-string get_next_field(data_p, length_p)
-     char **data_p;
-     int *length_p;
+string
+get_next_field(char **data_p,
+              int *length_p)
 {
     char *data = *data_p;
     int length = *length_p;
@@ -98,10 +98,9 @@ string get_next_field(data_p, length_p)
  *                 "" is returned.
  */
 
-string get_field(data, length, num)
-     char *data;
-     int length;
-     int num;
+string get_field(char *data,
+                int length,
+                int num)
 {
     /*
      * While num>1 and there are fields left, skip a field & decrement num:
@@ -132,9 +131,9 @@ string get_field(data, length, num)
  *                be freed.
  */
 
-string convert_nulls_to_newlines(data, length)
-     char *data;
-     int length;
+string
+convert_nulls_to_newlines(char *data,
+                         int length)
 {
     char *result, *ptr;
     char c;
@@ -158,8 +157,8 @@ string convert_nulls_to_newlines(data, length)
  *                 eventually.
  */
 
-static string z_kind_to_ascii(z_kind)
-     ZNotice_Kind_t z_kind;
+static string
+z_kind_to_ascii(ZNotice_Kind_t z_kind)
 {
     string result;
 
@@ -217,8 +216,8 @@ static string z_kind_to_ascii(z_kind)
  *                 eventually.
  */
 
-static string z_auth_to_ascii(z_auth)
-     int z_auth;
+static string
+z_auth_to_ascii(int z_auth)
 {
     string result;
 
@@ -249,9 +248,9 @@ static string z_auth_to_ascii(z_auth)
  *        Effects:
  */
 
-char *decode_notice(notice, hostname)
-     ZNotice_t *notice;
-     char *hostname;
+char *
+decode_notice(ZNotice_t *notice,
+             char *hostname)
 {
     char *temp;
     string time, notyear, year, date_string, time_string;
index 7a9faf55861edbc9a3368cb0ae43f4d08ac8cfde..ad6635d61a6c3892bba60ca3bd76853fc9597767 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef notice_MODULE
 #define notice_MODULE
 
+#include <zephyr/zephyr.h>
 #include "new_string.h"
 
 /*
@@ -25,7 +26,7 @@
  *        Effects: Returns the # of nulls in data[0]..data[length-1]
  */
 
-extern int count_nulls();
+extern int count_nulls(char *, int);
 
 /*
  *    string get_next_field(char **data_p, int *length_p)
@@ -42,7 +43,7 @@ extern int count_nulls();
  *                 remain.  (this is the case when *length_p == 0)
  */
 
-extern string get_next_field();
+extern string get_next_field(char **, int *);
 
 /*
  *    string get_field(char *data, int length, int num)
@@ -55,7 +56,7 @@ extern string get_next_field();
  *                 "" is returned.
  */
 
-extern string get_field();
+extern string get_field(char *, int, int);
 
 /*
  *    string convert_nulls_to_newlines(data, length)
@@ -66,9 +67,9 @@ extern string get_field();
  *                be freed.
  */
 
-extern string convert_nulls_to_newlines();
+extern string convert_nulls_to_newlines(char *, int);
 
 
-extern char *decode_notice();
+extern char *decode_notice(ZNotice_t *, char *);
 
 #endif
index 8e0d5f67a5b76615f84eaeb851c9d6f5a77ba073..92724ddcc370e9aa2ad174001c4c932645b868f2 100644 (file)
@@ -31,7 +31,7 @@
  *                 is reported to the user via stderr. 
  */
 
-extern void report_parse_error();
+extern void report_parse_error(char *, int);
 
 /*
  *    struct _Node *parse_file(FILE *input_file)
@@ -49,6 +49,6 @@ extern void report_parse_error();
  *                 is closed before this routine returns.
  */
 
-extern struct _Node *parse_file();
+extern struct _Node *parse_file(FILE *);
 
 #endif
index 6f539851e0ba264efe174e5fad0482d7d88617a7..30f4088d5ca5f679e328f7a84d64b968ac5a42fa 100644 (file)
@@ -31,7 +31,7 @@ static const char rcsid_parser_y[] = "$Id$";
 #include "node.h"
 #include "zwgc.h"
 
-static void yyerror();
+static void yyerror(char *);
 
 /*
  * the_program - local variable used to communicate the program's node
@@ -320,9 +320,9 @@ static int error_occured = 0;
  *                 is reported to the user via stderr. 
  */
 
-void report_parse_error(error_message, line_number)
-     char *error_message;
-     int line_number;
+void
+report_parse_error(char *error_message,
+                  int line_number)
 {
     if (error_occured)
       return;
@@ -338,8 +338,7 @@ void report_parse_error(error_message, line_number)
  *            stack overflow errors.
  */
  
-static void yyerror(message)
-     char *message;
+static void yyerror(char *message)
 {
     report_parse_error(message, yylineno);
 }
@@ -360,8 +359,8 @@ static void yyerror(message)
  *                 is closed before this routine returns.
  */
 
-struct _Node *parse_file(input_file)
-     FILE *input_file;
+struct _Node *
+parse_file(FILE *input_file)
 {
     the_program = NULL;
     error_occured = 0;
index 0244dac5a6604a8427a22a7fb10fea07d4b7cf4a..55d6274f7feb057c9a5a140824c05810f6ce2995 100644 (file)
@@ -37,10 +37,10 @@ static const char rcsid_port_c[] = "$Id$";
 /*                                                                          */
 /****************************************************************************/
 
-static string port_get(p)
-     port *p;
+static string
+port_get(port *p)
 {
-    char *(*get_proc)();
+    char *(*get_proc)(port *, char **);
     char *error = NULL;
     char *result;
 
@@ -65,12 +65,12 @@ static string port_get(p)
       return(result);
 }
 
-static void port_put(p, data, length)
-     port *p;
-     char *data;
-     int length;
+static void
+port_put(port *p,
+        char *data,
+        int length)
 {
-    char *(*put_proc)();
+    char *(*put_proc)(port *, char *, int);
     char *error;
 
     if (p->status & OUTPUT_CLOSED) {
@@ -91,10 +91,10 @@ static void port_put(p, data, length)
       var_set_variable("error", error);
 }
 
-static void port_close_input(p)
-     port *p;
+static void
+port_close_input(port *p)
 {
-    char *(*close_input_proc)();
+    char *(*close_input_proc)(port *);
     char *error;
 
     if (p->status & INPUT_CLOSED)
@@ -109,10 +109,10 @@ static void port_close_input(p)
       var_set_variable("error", error);
 }
 
-static void port_close_output(p)
-     port *p;
+static void
+port_close_output(port *p)
 {
-    char *(*close_output_proc)();
+    char *(*close_output_proc)(port *);
     char *error;
 
     if (p->status & OUTPUT_CLOSED)
@@ -146,14 +146,15 @@ static port_dictionary port_dict = NULL;
  *                 any other port call is made.
  */
 
-static void close_port_from_binding(b)
-     port_dictionary_binding *b;
+static void
+close_port_from_binding(port_dictionary_binding *b)
 {
     port_close_input(&(b->value));
     port_close_output(&(b->value));
 }
 
-void init_ports()
+void
+init_ports(void)
 {
     if (port_dict) {
        port_dictionary_Enumerate(port_dict, close_port_from_binding);
@@ -176,8 +177,8 @@ void init_ports()
  *                 various fields correctly.
  */
 
-static port *create_named_port(name)
-     string name;
+static port *
+create_named_port(string name)
 {
     int already_exists;
     port_dictionary_binding *binding;
@@ -200,8 +201,8 @@ static port *create_named_port(name)
  *                 it.  Otherwise returns NULL.
  */
 
-static port *get_named_port(name)
-     string name;
+static port *
+get_named_port(string name)
 {
     port_dictionary_binding *binding;
 
@@ -230,8 +231,8 @@ static port *get_named_port(name)
  *                 on the heap & must be eventually freed.
  */
 
-string read_from_port(name)
-     string name;
+string
+read_from_port(string name)
 {
     port *p;
 
@@ -253,10 +254,10 @@ string read_from_port(name)
  *                 occurs, $error is set to the error message.
  */
 
-void write_on_port(name, text, length)
-     string name;
-     char *text;
-     int length;
+void
+write_on_port(string name,
+             char *text,
+             int length)
 {
     port *p;
 
@@ -280,8 +281,8 @@ void write_on_port(name, text, length)
  *                 occurs, $error is set to the error message.
  */
 
-void close_port_input(name)
-     string name;
+void
+close_port_input(string name)
 {
     port_dictionary_binding *binding;
 
@@ -306,8 +307,8 @@ void close_port_input(name)
  *                 occurs, $error is set to the error message.
  */
 
-void close_port_output(name)
-     string name;
+void
+close_port_output(string name)
 {
     port_dictionary_binding *binding;
 
@@ -326,9 +327,9 @@ void close_port_output(name)
 /*                                                                          */
 /****************************************************************************/
 
-static string get_file(p, error_p)
-     port *p;
-     char **error_p;
+static string
+get_file(port *p,
+        char **error_p)
 {
     char buffer[10000]; /* <<<>>> */
 
@@ -352,10 +353,10 @@ static string get_file(p, error_p)
     return(string_Copy(buffer));
 }
 
-static char *put_file(p, text, length)
-     port *p;
-     string text;
-     int length;
+static char *
+put_file(port *p,
+        string text,
+        int length)
 {
     if (!p->data.file.output_connector)
       return(NULL);
@@ -370,8 +371,8 @@ static char *put_file(p, text, length)
     return(NULL);
 }
 
-static char *close_file_input(p)
-     port *p;
+static char *
+close_file_input(port *p)
 {
     errno = 0;
     if (p->data.file.input_connector) {
@@ -385,8 +386,8 @@ static char *close_file_input(p)
     return(NULL);
 }
 
-static char *close_file_output(p)
-     port *p;
+static char *
+close_file_output(port *p)
 {
     errno = 0;
     if (p->data.file.output_connector) {
@@ -400,10 +401,9 @@ static char *close_file_output(p)
     return(NULL);
 }
 
-void create_port_from_files(name, input, output)
-     string name;
-     FILE *input;
-     FILE *output;
+void create_port_from_files(string name,
+                           FILE *input,
+                           FILE *output)
 {
     port *p = create_named_port(name);
 
@@ -434,9 +434,9 @@ void create_port_from_files(name, input, output)
 /*                                                                          */
 /****************************************************************************/
 
-void create_subprocess_port(name, argv)
-     string name;
-     char **argv;
+void
+create_subprocess_port(string name,
+                      char **argv)
 {
     int pid;
     int to_child_descriptors[2];
@@ -477,9 +477,9 @@ void create_subprocess_port(name, argv)
     create_port_from_files(name, in, out);
 }
 
-void create_file_append_port(name, filename)
-     string name;
-     string filename;
+void
+create_file_append_port(string name,
+                       string filename)
 {
     FILE *out;
     int oumask;
@@ -497,9 +497,9 @@ void create_file_append_port(name, filename)
     create_port_from_files(name, 0, out);
 }
 
-void create_file_input_port(name, filename)
-     string name;
-     string filename;
+void
+create_file_input_port(string name,
+                      string filename)
 {
     FILE *in;
 
@@ -513,9 +513,9 @@ void create_file_input_port(name, filename)
     create_port_from_files(name, in, 0);
 }
 
-void create_file_output_port(name, filename)
-     string name;
-     string filename;
+void
+create_file_output_port(string name,
+                       string filename)
 {
     FILE *out;
     int oumask;
@@ -539,9 +539,9 @@ void create_file_output_port(name, filename)
 /*                                                                          */
 /****************************************************************************/
 
-static string get_filter(p, error_p)
-     port *p;
-     char **error_p;
+static string
+get_filter(port *p,
+          char **error_p)
 {
     string result;
 
@@ -555,10 +555,10 @@ static string get_filter(p, error_p)
     return(result);
 }
 
-static char *put_filter(p, text, length)
-     port *p;
-     string text;
-     int length;
+static char *
+put_filter(port *p,
+          string text,
+          int length)
 {
     string input;
     string output;
@@ -573,8 +573,8 @@ static char *put_filter(p, text, length)
     return(NULL);
 }
 
-static char *close_filter_input(p)
-     port *p;
+static char *
+close_filter_input(port *p)
 {
     while (!string_stack_empty(p->data.filter.waiting_packets))
       string_stack_pop(p->data.filter.waiting_packets);
@@ -583,15 +583,15 @@ static char *close_filter_input(p)
 }
 
 /*ARGSUSED*/
-static char *close_filter_output(p)
-     port *p;
+static char *
+close_filter_output(port *p)
 {
     return(NULL);
 }
 
-void create_port_from_filter(name, filter)
-     string name;
-     string (*filter)();
+void
+create_port_from_filter(string name,
+                       string (*filter)(string))
 {
     port *p = create_named_port(name);
 
@@ -610,10 +610,10 @@ void create_port_from_filter(name, filter)
 /*                                                                          */
 /****************************************************************************/
 
-static char *put_output(p, text, length)
-     port *p;
-     string text;
-     int length;
+static char *
+put_output(port *p,
+          string text,
+          int length)
 {
     string input;
     char *error;
@@ -625,15 +625,15 @@ static char *put_output(p, text, length)
 }
 
 /*ARGSUSED*/
-static char *close_output(p)
-     port *p;
+static char *
+close_output(port *p)
 {
     return(NULL);
 }
 
-void create_port_from_output_proc(name, output)
-     string name;
-     char *(*output)();
+void
+create_port_from_output_proc(string name,
+                            char *(*output)(string))
 {
 #ifdef SABER /* Yes, it's another ANSI incompatiblity */
     port *p;
index 0cf4591300e996c5d1d3f84748823681a7c2e0ca..d7da9d3e52c441a0e69055f1cda2b4396df377b3 100644 (file)
@@ -28,18 +28,18 @@ union port__data {
     } file;
     struct {
        string_stack waiting_packets;
-       string (*filter)();
+       string (*filter)(string);
     } filter;
     struct {
-       char *(*output)();
+       char *(*output)(string);
     } output;
 };
 
-typedef struct {                /* PRIVATE */
-    char *(*get)();
-    char *(*put)();
-    char *(*close_input)();
-    char *(*close_output)();
+typedef struct port__struct {                /* PRIVATE */
+    char *(*get)(struct port__struct *, char **);
+    char *(*put)(struct port__struct *, char *, int);
+    char *(*close_input)(struct port__struct *);
+    char *(*close_output)(struct port__struct *);
 #define  INPUT_CLOSED   0x1
 #define  OUTPUT_CLOSED  0x2
 #define  PORT_CLOSED    0x3
@@ -54,7 +54,7 @@ typedef struct {                /* PRIVATE */
  *                 any other port call is made.
  */
 
-extern void init_ports();
+extern void init_ports(void);
 
 /*
  *    string read_from_port(string name)
@@ -68,7 +68,7 @@ extern void init_ports();
  *                 on the heap & must be eventually freed.
  */
 
-extern string read_from_port();
+extern string read_from_port(string);
 
 /*
  *    void write_on_port(string name, char *text, int length)
@@ -80,7 +80,7 @@ extern string read_from_port();
  *                 occurs, $error is set to the error message.
  */
 
-extern void write_on_port();
+extern void write_on_port(string, char *, int);
 
 /*
  *    void close_port_input(string name)
@@ -94,7 +94,7 @@ extern void write_on_port();
  *                 occurs, $error is set to the error message.
  */
 
-extern void close_port_input();
+extern void close_port_input(string);
 
 /*
  *    void close_port_output(string name)
@@ -108,17 +108,17 @@ extern void close_port_input();
  *                 occurs, $error is set to the error message.
  */
 
-extern void close_port_output();
+extern void close_port_output(string);
 
 
-extern void create_subprocess_port();
-extern void create_file_append_port();
-extern void create_file_input_port();
-extern void create_file_output_port();
-extern void create_port_from_filter();
-extern void create_port_from_output_proc();
+extern void create_subprocess_port(string, char **);
+extern void create_file_append_port(string, string);
+extern void create_file_input_port(string, string);
+extern void create_file_output_port(string, string);
+extern void create_port_from_filter(string, string (*)(string));
+extern void create_port_from_output_proc(string, char *(*)(string));
 
-extern void init_standard_ports();
-extern void create_port_from_files();
+extern void init_standard_ports(int *, char **);
+extern void create_port_from_files(string, FILE *, FILE *);
 
 #endif
index d3a2cb5356ec81b31f285780f7489ca8fba0a7a9..a9314ab5fd98c8a1963781db9a19500edf4482b2 100644 (file)
@@ -20,9 +20,9 @@ static const char rcsid_regexp_c[] = "$Id$";
 
 #include "regexp.h"
 
-int ed_regexp_match_p(test_string, pattern)
-     string test_string;
-     string pattern;
+int
+ed_regexp_match_p(string test_string,
+                 string pattern)
 {
     regex_t RE;
     int retval;
index 24299982a0c93720924c535a037133428297208c..d5efcc2ef71911221d1d64e5b055b180cd39cc58 100644 (file)
@@ -19,6 +19,6 @@
 
 #include "new_string.h"
 
-extern int ed_regexp_match_p();
+extern int ed_regexp_match_p(string, string);
 
 #endif
index 526e02cdb53f557fa42e0d6748db8ef7ed4b06c8..f679f4e4d5f81d7246b29801b1da99ce8cda2cee 100644 (file)
@@ -32,22 +32,22 @@ static const char rcsid_standard_ports_c[] = "$Id$";
 #include "main.h"
 #include <zephyr/zephyr.h>
 
-extern string tty_filter();
-extern int tty_filter_init();
+extern char *tty_filter(string, int);
+extern int tty_filter_init(char *, char, int *, char **);
 
 #ifndef X_DISPLAY_MISSING
-extern char *X_driver();
-extern int X_driver_init();
+extern char *X_driver(string);
+extern int X_driver_init(char *, char, int *, char **);
 #endif
 
-extern void usage();
+extern void usage(void);
 
 /*
  *
  */
 
-char *plain_driver(input)
-     string input;
+char *
+plain_driver(string input)
 {
     string processed_input = tty_filter(input, 0);
 
@@ -61,8 +61,8 @@ char *plain_driver(input)
  *
  */
 
-char *tty_driver(input)
-     string input;
+char *
+tty_driver(string input)
 {
     string processed_input = tty_filter(input, 1);
 
@@ -76,8 +76,8 @@ char *tty_driver(input)
  *
  */
 
-string noop_filter(input)
-     string input;
+string
+noop_filter(string input)
 {
     return(input);
 }
@@ -86,8 +86,8 @@ string noop_filter(input)
  *
  */
 
-string plain_filter(input)
-     string input;
+string
+plain_filter(string input)
 {
     return(tty_filter(input, 0));
 }
@@ -96,8 +96,8 @@ string plain_filter(input)
  *
  */
 
-string fancy_filter(input)
-     string input;
+string
+fancy_filter(string input)
 {
     return(tty_filter(input, 1));
 }
@@ -118,13 +118,13 @@ static struct standard_port_info {
 #define        DISABLED        2
 
     int port_setup_status;
-    int (*port_init)();
+    int (*port_init)(char *, char, int *, char **);
 #define  INPUT_DESC  0
 #define  OUTPUT_DESC 1
 #define  FILTER      2
 #define  OUTPUT_PROC 3
     int type;
-    char *(*function)();
+    char *(*function)(string);
     int setup_arg;
 } standard_port_info_table[] = {
 #ifndef X_DISPLAY_MISSING
@@ -148,8 +148,8 @@ static struct standard_port_info {
  * <<<>>>
  */
 
-static struct standard_port_info *get_standard_port_info(port_name)
-     string port_name;
+static struct standard_port_info *
+get_standard_port_info(string port_name)
 {
     struct standard_port_info *p;
 
@@ -169,8 +169,8 @@ static struct standard_port_info *get_standard_port_info(port_name)
  *                  returns -1.
  */
 
-static int boolean_value_of(text)
-     string text;
+static int
+boolean_value_of(string text)
 {
     if (!text)
        return(-1);                     /* not set */
@@ -190,9 +190,8 @@ static int boolean_value_of(text)
  *
  */
 
-void init_standard_ports(pargc, argv)
-     int *pargc;
-     char **argv;
+void init_standard_ports(int *pargc,
+                        char **argv)
 {
     struct standard_port_info *p;
     string first_working_port = "";
index b2786ff675d5f91ec0ad6bfa8038f4445e2c7cec..daee49ca29c4cc8f37bc91da2de74af3aaa6c8ee 100644 (file)
@@ -43,10 +43,10 @@ static char rcsid_string_dictionary_aux_c[] = "$Id$";
  *                 heap.
  */
 
-void string__dictionary_Set(d, key, value)
-     string_dictionary d;
-     string key;
-     string value;
+void
+string__dictionary_Set(string_dictionary d,
+                      string key,
+                      string value)
 {
     string_dictionary_binding *binding;
     int already_exists;
@@ -67,9 +67,9 @@ void string__dictionary_Set(d, key, value)
  *                 disappear later if key is rebound.
  */
 
-char *string_dictionary_Fetch(d, key)
-     string_dictionary d;
-     string key;
+char *
+string_dictionary_Fetch(string_dictionary d,
+                       string key)
 {
     string_dictionary_binding *binding;
 
@@ -87,14 +87,14 @@ char *string_dictionary_Fetch(d, key)
  *                 all value's in the dictionary.
  */
 
-static void free_value_of_binding(b)
-     string_dictionary_binding *b;
+static void
+free_value_of_binding(string_dictionary_binding *b)
 {
     free(b->value);
 }
 
-void string_dictionary_SafeDestroy(d)
-     string_dictionary d;
+void
+string_dictionary_SafeDestroy(string_dictionary d)
 {
     string_dictionary_Enumerate(d, free_value_of_binding);
     string_dictionary_Destroy(d);
index 84fac3364366d53a18c366844d784e8e227ec160..e058721c00c7a9c526b83e648afe8aa84afb6919 100644 (file)
@@ -25,7 +25,7 @@
  *                 heap.
  */
 
-extern void string__dictionary_Set();
+extern void string__dictionary_Set(string_dictionary, string, string);
 #ifdef DEBUG_MEMORY
 #define string_dictionary_Set(a,b,c)         (set_module(__FILE__,__LINE__),\
                                              string__dictionary_Set(a,b,c))
@@ -42,7 +42,8 @@ extern void string__dictionary_Set();
  *                 disappear later if key is rebound.
  */
 
-extern char *string_dictionary_Fetch();
+extern char *string_dictionary_Fetch(string_dictionary,
+                                    string);
 
 /*
  *    void string_dictionary_SafeDestroy(string_dictionary d)
@@ -51,6 +52,6 @@ extern char *string_dictionary_Fetch();
  *                 all value's in the dictionary.
  */
 
-extern void string_dictionary_SafeDestroy();
+extern void string_dictionary_SafeDestroy(string_dictionary);
 
 #endif
index e72963ebf608847c9fcc149d176e62542290ae5a..cfe932e151426e54dcad0db1576532c7a36b6e72 100644 (file)
@@ -44,15 +44,16 @@ static char rcsid_subscriptions_c[] = "$Id$";
  */
 static int_dictionary puntable_addresses_dict = 0;
 
-static void init_puntable_dict()
+static void
+init_puntable_dict(void)
 {
     puntable_addresses_dict = int_dictionary_Create(33);
 }
 
-static string address_to_string(class, instance, recipient)
-     string class;
-     string instance;
-     string recipient;
+static string
+address_to_string(string class,
+                 string instance,
+                 string recipient)
 {
     string result;
 
@@ -75,10 +76,9 @@ static string address_to_string(class, instance, recipient)
     return(result);
 }
 
-int puntable_address_p(class, instance, recipient)
-     string class;
-     string instance;
-     string recipient;
+int puntable_address_p(string class,
+                      string instance,
+                      string recipient)
 {
     string temp;
 
@@ -95,10 +95,9 @@ int puntable_address_p(class, instance, recipient)
     return(0);
 }
 
-void punt(class, instance, recipient)
-     string class;
-     string instance;
-     string recipient;
+void punt(string class,
+         string instance,
+         string recipient)
 {
     string temp;
 
@@ -110,10 +109,9 @@ void punt(class, instance, recipient)
     free(temp);
 }
 
-void unpunt(class, instance, recipient)
-     string class;
-     string instance;
-     string recipient;
+void unpunt(string class,
+           string instance,
+           string recipient)
 {
     string temp;
     int_dictionary_binding *binding;
@@ -146,9 +144,9 @@ static ZSubscription_t subscription_list[BATCH_SIZE];
 static int unsubscription_list_size = 0;
 static ZSubscription_t unsubscription_list[BATCH_SIZE];
 
-static void free_subscription_list(list, number_of_elements)
-     ZSubscription_t *list;
-     int number_of_elements;
+static void
+free_subscription_list(ZSubscription_t *list,
+                      int number_of_elements)
 {
     int i;
 
@@ -159,7 +157,8 @@ static void free_subscription_list(list, number_of_elements)
     }
 }
 
-static void flush_subscriptions()
+static void
+flush_subscriptions(void)
 {
       TRAP(ZSubscribeTo(subscription_list,subscription_list_size, 0),
           "while subscribing");
@@ -168,7 +167,8 @@ static void flush_subscriptions()
     subscription_list_size = 0;
 }
 
-static void flush_unsubscriptions()
+static void
+flush_unsubscriptions(void)
 {
     if (unsubscription_list_size)
       TRAP(ZUnsubscribeTo(unsubscription_list, unsubscription_list_size, 0),
@@ -178,10 +178,10 @@ static void flush_unsubscriptions()
     unsubscription_list_size = 0;
 }
 
-static void subscribe(class, instance, recipient)
-     string class;
-     string instance;
-     string recipient;
+static void
+subscribe(string class,
+         string instance,
+         string recipient)
 {
     subscription_list[subscription_list_size].zsub_class = string_Copy(class);
     subscription_list[subscription_list_size].zsub_classinst= string_Copy(instance);
@@ -191,10 +191,10 @@ static void subscribe(class, instance, recipient)
       flush_subscriptions();
 }
 
-static void unsubscribe(class, instance, recipient)
-     string class;
-     string instance;
-     string recipient;
+static void
+unsubscribe(string class,
+           string instance,
+           string recipient)
 {
     unsubscription_list[unsubscription_list_size].zsub_class = string_Copy(class);
     unsubscription_list[unsubscription_list_size].zsub_classinst
@@ -219,7 +219,8 @@ static void unsubscribe(class, instance, recipient)
 
 char ourhost[MAXHOSTNAMELEN],ourhostcanon[MAXHOSTNAMELEN];
 
-static void inithosts()
+static void
+inithosts(void)
 {
     struct hostent *hent;
     if (gethostname(ourhost, sizeof(ourhost)-1) == -1) {
@@ -236,8 +237,8 @@ static void inithosts()
     return;
 }
 
-static void macro_sub(str)
-     char *str;
+static void
+macro_sub(char *str)
 {
     static int initedhosts = 0;
 
@@ -256,8 +257,8 @@ static void macro_sub(str)
 #define  UNSUBSCRIBE_CHARACTER  '!'
 #define  PUNT_CHARACTER         '-'
 
-static void load_subscriptions_from_file(file)
-     FILE *file;
+static void
+load_subscriptions_from_file(FILE *file)
 {
     char line[BUFSIZ];
     char class_buffer[BUFSIZ], instance[BUFSIZ], recipient[BUFSIZ];
@@ -319,7 +320,8 @@ static void load_subscriptions_from_file(file)
 
 #define DEFSUBS "/dev/null"
 
-static void load_subscriptions()
+static void
+load_subscriptions(void)
 {
     FILE *subscriptions_file;
 
@@ -343,7 +345,7 @@ int zwgc_active = 0;
 static ZSubscription_t *saved_subscriptions = NULL;
 static int number_of_saved_subscriptions;
 
-void zwgc_shutdown()
+void zwgc_shutdown(void)
 {
     if (!zwgc_active)
       return;
@@ -367,7 +369,7 @@ void zwgc_shutdown()
     zwgc_active = 0;
 }
 
-void zwgc_startup()
+void zwgc_startup(void)
 {
     if (zwgc_active)
       return;
index 88f52c2f25df25171a5c8b3f8b056b3af96d40dd..91cb360797c88124794fb5ffe9fdbff051e4dedb 100644 (file)
 
 extern int zwgc_active;
 
-extern int puntable_address_p(/* string class, instance, recipient */);
-extern void punt();
-extern void unpunt();
-extern void zwgc_shutdown();
-extern void zwgc_startup();
+extern int puntable_address_p(string, string, string);
+extern void punt(string, string, string);
+extern void unpunt(string, string, string);
+extern void zwgc_shutdown(void);
+extern void zwgc_startup(void);
 
 #define USRSUBS ".zephyr.subs"
 
index ebbd913fcb0194f4327d96aa63986844dd46777d..d50614ce7fce97c47a76595bff4e3029de8e28a2 100644 (file)
@@ -38,9 +38,9 @@ static char rcsid_substitute_c[] = "$Id$";
  *                 The returned string must not be freed.
  */
 
-static string eat_dollar_sign_stuff(lookup, text_ptr)
-     string (*lookup)();
-     string *text_ptr;                 /* Input/Output parameter */
+static string
+eat_dollar_sign_stuff(string (*lookup)(string),
+                     string *text_ptr)                 /* Input/Output parameter */
 {
     char c;
     char closing_brace = 0;
@@ -132,9 +132,9 @@ static string eat_dollar_sign_stuff(lookup, text_ptr)
  *                 modified in any way or freed.
  */
 
-string substitute(lookup, text)
-     string (*lookup)();
-     string text;
+string
+substitute(string (*lookup)(string),
+          string text)
 {
     string result_so_far = string_Copy("");
     char *p, *temp;
index 5c0bb554d87a936a050605eeede69dc97c91ea91..925454afd695b6066a13b17847ced9eb4c0677bd 100644 (file)
@@ -40,6 +40,6 @@
  *                 modified in any way or freed.
  */
 
-extern string substitute();
+extern string substitute(string (*)(string), string);
 
 #endif
index b5b791a8946c6c6a6a615ae31d1aedaeb0d33c9b..34f0d4cb230f6abe31e79401eaf9e0388279f4eb 100644 (file)
@@ -23,9 +23,9 @@ static const char rcsid_text_operations_c[] = "$Id$";
 #include "text_operations.h"
 #include "char_stack.h"
 
-string lany(text_ptr, str)
-     string *text_ptr;
-     string str;
+string
+lany(string *text_ptr,
+     string str)
 {
     string result, whats_left;
     char *p = *text_ptr;
@@ -40,9 +40,9 @@ string lany(text_ptr, str)
     return(result);
 }
 
-string lbreak(text_ptr, set)
-     string *text_ptr;
-     character_class set;
+string
+lbreak(string *text_ptr,
+       const character_class set)
 {
     string result, whats_left;
     char *p = *text_ptr;
@@ -57,9 +57,9 @@ string lbreak(text_ptr, set)
     return(result);
 }
 
-string lspan(text_ptr, set)
-     string *text_ptr;
-     character_class set;
+string
+lspan(string *text_ptr,
+      character_class set)
 {
     string result, whats_left;
     char *p = *text_ptr;
@@ -74,9 +74,9 @@ string lspan(text_ptr, set)
     return(result);
 }
 
-string rany(text_ptr, str)
-     string *text_ptr;
-     string str;
+string
+rany(string *text_ptr,
+     string str)
 {
     string result, whats_left;
     string text = *text_ptr;
@@ -92,9 +92,9 @@ string rany(text_ptr, str)
     return(result);
 }
 
-string rbreak(text_ptr, set)
-     string *text_ptr;
-     character_class set;
+string
+rbreak(string *text_ptr,
+       character_class set)
 {
     string result, whats_left;
     string text = *text_ptr;
@@ -110,9 +110,9 @@ string rbreak(text_ptr, set)
     return(result);
 }
 
-string rspan(text_ptr, set)
-     string *text_ptr;
-     character_class set;
+string
+rspan(string *text_ptr,
+      character_class set)
 {
     string result, whats_left;
     string text = *text_ptr;
index 960e2abc56ed73f17680074192c025effe80c777..0e1c152b1ab2634b875665a6c7ac192b83f30c59 100644 (file)
 
 #include "character_class.h"
 
-extern string protect();
-extern string verbatim();
-extern string stylestrip();
-extern string lany();
-extern string lbreak();
-extern string lspan();
-extern string rany();
-extern string rbreak();
-extern string rspan();
+extern string lany(string *, string);
+extern string lbreak(string *, const character_class);
+extern string lspan(string *, character_class);
+extern string rany(string *, string);
+extern string rbreak(string *, character_class);
+extern string rspan(string *, character_class);
 
 #endif
index 72a67476caa3f9fe5f96e98973c2a8113ba519cf..f2b6024cfee4123c2d67458dc82e6a6e909a1a42 100644 (file)
@@ -24,6 +24,10 @@ static const char rcsid_tty_filter_c[] = "$Id$";
 /*                         The tty & plain filters:                         */
 /*                                                                          */
 /****************************************************************************/
+#define HAVE_TERMCAP_H
+#ifdef HAVE_TERMCAP_H
+#include <termcap.h>
+#endif
 
 #include "new_memory.h"
 #include "new_string.h"
@@ -33,7 +37,7 @@ static const char rcsid_tty_filter_c[] = "$Id$";
 #include "error.h"
 
 /***************************************************************************/
-
+#ifndef HAVE_TERMCAP_H
 extern int tgetent();
 extern char *tgetstr(),*getenv();
 #ifdef linux
@@ -42,6 +46,7 @@ extern speed_t ospeed;
 extern short ospeed;
 #endif
 char PC;
+#endif
 
 /* Dictionary naming convention:
 
@@ -76,19 +81,18 @@ static char code_buf[10240], *code_buf_pos = code_buf, *code;
                   *code_buf_pos++ = 0, TD_SET(k, code))
 
 static int
-tty_outc(c)
-    int c;
+tty_outc(int c)
 {
     *code_buf_pos++ = c;
     return 0;
 }
 
 /* ARGSUSED */
-int tty_filter_init(drivername, notfirst, pargc, argv)
-char *drivername;
-char notfirst;
-int *pargc;
-char **argv;
+int
+tty_filter_init(char *drivername,
+               char notfirst,
+               int *pargc,
+               char **argv)
 {
     static char st_buf[128];
     char tc_buf[1024], *p = st_buf, *tmp, *term;
@@ -201,10 +205,10 @@ char **argv;
 
 
 
-static int fixed_string_eq(pattern, text, text_length)
-     string pattern;
-     char *text;
-     int text_length;
+static int
+fixed_string_eq(string pattern,
+               char *text,
+               int text_length)
 {
     while (*pattern && text_length>0 && *pattern == *text) {
        pattern++;
@@ -228,8 +232,8 @@ typedef struct _tty_str_info {
     unsigned int ignore: 1;
 } tty_str_info;
 
-static void free_info(info)
-     tty_str_info *info;
+static void
+free_info(tty_str_info *info)
 {
     tty_str_info *next_info;
 
@@ -240,10 +244,10 @@ static void free_info(info)
     }
 }
 
-static int do_mode_change(current_mode_p, text, text_length)
-     tty_str_info *current_mode_p;
-     char *text;
-     int text_length;
+static int
+do_mode_change(tty_str_info *current_mode_p,
+              char *text,
+              int text_length)
 {
     /* alignment commands: */
     if (fixed_string_eq("left", text, text_length) ||
@@ -279,8 +283,8 @@ static int do_mode_change(current_mode_p, text, text_length)
     return 0;
 }
 
-static tty_str_info *convert_desc_to_tty_str_info(desc)
-     desctype *desc;
+static tty_str_info *
+convert_desc_to_tty_str_info(desctype *desc)
 {
     tty_str_info *temp;
     tty_str_info *result = NULL;
@@ -367,10 +371,10 @@ static tty_str_info *convert_desc_to_tty_str_info(desc)
 
 #define  max(a,b)                ((a)>(b)?(a):(b))
 
-static int line_width(left_width, center_width, right_width)
-     int left_width;
-     int center_width;
-     int right_width;
+static int
+line_width(int left_width,
+          int center_width,
+          int right_width)
 {
     if (center_width>0) {
        if (left_width==0 && right_width==0)
@@ -384,8 +388,8 @@ static int line_width(left_width, center_width, right_width)
     }
 }
 
-static int calc_max_line_width(info)
-     tty_str_info *info;
+static int
+calc_max_line_width(tty_str_info *info)
 {
     int max_line_width = 0;
     int left = 0;
@@ -432,9 +436,9 @@ static int calc_max_line_width(info)
     return(max_line_width);
 }
 
-string tty_filter(text, use_fonts)
-     string text;
-     int use_fonts;
+string
+tty_filter(string text,
+          int use_fonts)
 {
     string text_copy = string_Copy(text);
     string result_so_far = string_Copy("");
index cda09d6e6ac2e11db2887d91a11d578944d0bc78..a444b440a2e9f6d1f9e3d3ae2e78070a68563988 100644 (file)
@@ -56,8 +56,8 @@ static string_dictionary number_variable_dict = NULL;
  *        Effects: Returns true iff text matches [0-9]*.  ("" matches...)
  */
 
-static int is_digits(text)
-     string text;
+static int
+is_digits(string text)
 {
     for (; *text; text++)
       if (!isdigit(*text))
@@ -83,7 +83,8 @@ static int is_digits(text)
  *        Effects: Sets all description langauge variables to "".
  */
 
-void var_clear_all_variables()
+void
+var_clear_all_variables(void)
 {
     if (non_number_variable_dict) {
        string_dictionary_SafeDestroy(non_number_variable_dict);
@@ -104,8 +105,8 @@ void var_clear_all_variables()
  *                 call.  DO NOT FREE THIS STRING.
  */
 
-string var_get_variable(name)
-     string name;
+string
+var_get_variable(string name)
 {
     char *result;
     int field_to_get;
@@ -150,9 +151,9 @@ string var_get_variable(name)
  *                 to have the value value.
  */
 
-void var_set_variable(name, value)
-     string name;
-     string value;
+void
+var_set_variable(string name,
+                string value)
 {
     string_dictionary_Set(is_number_variable(name) ? number_variable_dict
                          : non_number_variable_dict, name, value);
@@ -167,9 +168,9 @@ void var_set_variable(name, value)
  *                 to have as its value number's ascii representation.
  */
 
-void var_set_variable_to_number(name, number)
-     string name;
-     int number;
+void
+var_set_variable_to_number(string name,
+                          int number)
 {
     char buffer[20];
 
@@ -190,9 +191,9 @@ void var_set_variable_to_number(name, number)
  *                 convenience reasons.
  */
 
-void var_set_variable_then_free_value(name, value)
-     string name;
-     string value;
+void
+var_set_variable_then_free_value(string name,
+                                string value)
 {
     string_dictionary_binding *binding;
     int exists;
@@ -229,9 +230,9 @@ void var_set_variable_then_free_value(name, value)
  *                 data or var_clear_all_variables is called.
  */
 
-void var_set_number_variables_to_fields(data, length)
-     char *data;
-     int length;
+void
+var_set_number_variables_to_fields(char *data,
+                                  int length)
 {
     fields_data = data;
     fields_data_length = length;
index 6962341e2d2ec5a680f85eab951b44eee227defe..b0be99b1ca20e1eeb2b80532c4cec3148e1318ce 100644 (file)
@@ -27,7 +27,7 @@
  *        Effects: Sets all description langauge variables to "".
  */
 
-extern void var_clear_all_variables();
+extern void var_clear_all_variables(void);
 
 /*
  *    string var_get_variable(string name)
@@ -38,7 +38,7 @@ extern void var_clear_all_variables();
  *                 call.  DO NOT FREE THIS STRING.
  */
 
-extern string var_get_variable();
+extern string var_get_variable(string);
 
 /*
  *    void var_set_variable(string name, value)
@@ -49,7 +49,7 @@ extern string var_get_variable();
  *                 to have the value value.
  */
 
-extern void var_set_variable();
+extern void var_set_variable(string, string);
 
 /*
  *    void var_set_variable_to_number(string name; int number)
@@ -60,7 +60,7 @@ extern void var_set_variable();
  *                 to have as its value number's ascii representation.
  */
 
-extern void var_set_variable_to_number();
+extern void var_set_variable_to_number(string, int);
 
 /*
  *    void var_set_variable_then_free_value(string name, value)
@@ -75,7 +75,7 @@ extern void var_set_variable_to_number();
  *                 convenience reasons.
  */
 
-extern void var_set_variable_then_free_value();
+extern void var_set_variable_then_free_value(string, string);
 
 /*
  *    void var_set_number_variables_to_fields(char *data, int length)
@@ -91,6 +91,6 @@ extern void var_set_variable_then_free_value();
  *                 data or var_clear_all_variables is called.
  */
 
-extern void var_set_number_variables_to_fields();
+extern void var_set_number_variables_to_fields(char *, int);
 
 #endif
index cadfc3d94f3f34315d0488869c09646ffac95da4..b6019a96191c68d9eafbea8c59bbdf4dcefa1a7e 100644 (file)
@@ -42,21 +42,20 @@ static const char rcsid_xcut_c[] = "$Id$";
  *
  */
 
-extern char *xmarkGetText();
-
 extern long ttl;
 
 static char *selected_text=NULL;
 static Window selecting_in = 0;
 
-char *getSelectedText()
+char *
+getSelectedText(void)
 {
    return(selected_text);
 }
 
 #ifdef notdef
-static string x_gram_to_string(gram)
-     x_gram *gram;
+static string
+x_gram_to_string(x_gram *gram)
 {
     int i, index, len;
     int last_y = -1;
@@ -86,27 +85,27 @@ static string x_gram_to_string(gram)
  */
 
 /*ARGSUSED*/
-Bool isShiftButton1(dpy,event,arg)
-     Display *dpy;
-     XEvent *event;
-     char *arg;
+Bool
+isShiftButton1(Display *dpy,
+              XEvent *event,
+              char *arg)
 {
    return(event->xbutton.state & (ShiftMask|Button1Mask));
 }
 
 /*ARGSUSED*/
-Bool isShiftButton3(dpy,event,arg)
-     Display *dpy;
-     XEvent *event;
-     char *arg;
+Bool
+isShiftButton3(Display *dpy,
+              XEvent *event,
+              char *arg)
 {
    return(event->xbutton.state & (ShiftMask|Button3Mask));
 }
 
-void getLastEvent(dpy,state,event)
-     Display *dpy;
-     unsigned int state;
-     XEvent *event;
+void
+getLastEvent(Display *dpy,
+            unsigned int state,
+            XEvent *event)
 {
    XEvent xev;
 
@@ -119,11 +118,11 @@ void getLastEvent(dpy,state,event)
    }
 }
 
-void xunmark(dpy,w,gram,desc_context)
-     Display *dpy;
-     Window w;
-     x_gram *gram;
-     XContext desc_context;
+void
+xunmark(Display *dpy,
+       Window w,
+       x_gram *gram,
+       XContext desc_context)
 {
    if (gram == NULL)
      if (XFindContext(dpy, w, desc_context, (caddr_t *) &gram))
@@ -144,11 +143,11 @@ void xunmark(dpy,w,gram,desc_context)
 
 static int current_pressop = PRESSOP_NONE;
 
-void xdestroygram(dpy,w,desc_context,gram)
-     Display *dpy;
-     Window w;
-     XContext desc_context;
-     x_gram *gram;
+void
+xdestroygram(Display *dpy,
+            Window w,
+            XContext desc_context,
+            x_gram *gram)
 {
     struct timeval now;
 
@@ -176,10 +175,10 @@ void xdestroygram(dpy,w,desc_context,gram)
     }
 }
 
-void xcut(dpy,event,desc_context)
-     Display *dpy;
-     XEvent *event;
-     XContext desc_context;
+void
+xcut(Display *dpy,
+     XEvent *event,
+     XContext desc_context)
 {
     x_gram *gram;
     Window w = event->xany.window;
index 33e389a7c4c6c53437ec89a37c488172879b301b..4a5a0aed839c4c3dad543411a75dfdbf8086cd69 100644 (file)
@@ -27,24 +27,24 @@ static const char rcsid_xerror_c[] = "$Id$";
 int xerror_happened;
 
 /*ARGSUSED*/
-static int xerrortrap(dpy,xerrev)
-     Display *dpy;
-     XErrorEvent *xerrev;
+static int
+xerrortrap(Display *dpy,
+          XErrorEvent *xerrev)
 {
    xerror_happened = 1;
    return 0;
 }
 
 /*ARGSUSED*/
-void begin_xerror_trap(dpy)
-     Display *dpy;
+void
+begin_xerror_trap(Display *dpy)
 {
    xerror_happened = 0;
    XSetErrorHandler(xerrortrap);
 }
 
-void end_xerror_trap(dpy)
-     Display *dpy;
+void
+end_xerror_trap(Display *dpy)
 {
    XSync(dpy,False);
    XSetErrorHandler(NULL);
index d5a42e77ef79e7214759e2bcdda896d6d174e7a0..ea6702ede70f492d9945e345a8e6ea829db82e9e 100644 (file)
@@ -22,7 +22,7 @@ static const char rcsid_xerror_h[] = "$Id$";
 
 extern int xerror_happened;
 
-void begin_xerror_trap();
-void end_xerror_trap();
+void begin_xerror_trap(Display *);
+void end_xerror_trap(Display *);
 
 #endif
index 1c796f33a889756235c63393073f239fbb6090ec..7285834fa1bee065652d92897434e68d2f27a870 100644 (file)
@@ -43,10 +43,11 @@ x_gram *oldgram = NULL;
    (STARTCHAR != -1) && (ENDCHAR != -1) && \
    (STARTPIXEL != -1) && (ENDPIXEL != -1))
 
-void xmarkSetBound(gram,x,y,which)
-     x_gram *gram;
-     int x,y;
-     int which;
+void
+xmarkSetBound(x_gram *gram,
+             int x,
+             int y,
+             int which)
 {
    int i,xofs,yofs;
    XFontStruct *font;
@@ -136,8 +137,9 @@ void xmarkSetBound(gram,x,y,which)
 }
 
 /* needs both bounds to be valid (!= -1) */
-static int xmarkNearest(x,y)
-     int x,y;
+static int
+xmarkNearest(int x,
+            int y)
 {
    int middle;
 
@@ -157,11 +159,14 @@ static int xmarkNearest(x,y)
    }
 }
 
-void xmarkExpose(dpy,w,gram,b1,p1,b2,p2)
-     Display *dpy;
-     Window w;
-     x_gram *gram;
-     unsigned int b1,p1,b2,p2;
+void
+xmarkExpose(Display *dpy,
+           Window w,
+           x_gram *gram,
+           unsigned int b1,
+           unsigned int p1,
+           unsigned int b2,
+           unsigned int p2)
 {
 #define swap(x,y) temp=(x); (x)=(y); (y)=temp
    int i,temp;
@@ -226,11 +231,11 @@ void xmarkExpose(dpy,w,gram,b1,p1,b2,p2)
 
 /* Public functions: */
 
-void xmarkRedraw(dpy,w,gram,range)
-     Display *dpy;
-     Window w;
-     x_gram *gram;
-     int range;
+void
+xmarkRedraw(Display *dpy,
+           Window w,
+           x_gram *gram,
+           int range)
 {
 #define ob1 ((unsigned int) oldblock[XMARK_START_BOUND])
 #define ob2 ((unsigned int) oldblock[XMARK_END_BOUND])
@@ -262,7 +267,8 @@ void xmarkRedraw(dpy,w,gram,range)
 }
 
 /* needs both bounds to be valid (!= -1) */
-int xmarkSecond()
+int
+xmarkSecond(void)
 {
    if (STARTBLOCK > ENDBLOCK)
      return(XMARK_START_BOUND);
@@ -278,7 +284,8 @@ int xmarkSecond()
    }
 }
 
-void xmarkClear()
+void
+xmarkClear(void)
 {
    oldblock[0]=markblock[0];
    oldblock[1]=markblock[1];
@@ -295,9 +302,10 @@ void xmarkClear()
    markgram=NULL;
 }
 
-int xmarkExtendFromFirst(gram,x,y)
-     x_gram *gram;
-     int x,y;
+int
+xmarkExtendFromFirst(x_gram *gram,
+                    int x,
+                    int y)
 {
    if (markgram != gram) {
       xmarkClear();
@@ -317,9 +325,10 @@ int xmarkExtendFromFirst(gram,x,y)
    }
 }
 
-int xmarkExtendFromNearest(gram,x,y)
-     x_gram *gram;
-     int x,y;
+int
+xmarkExtendFromNearest(x_gram *gram,
+                      int x,
+                      int y)
 {
    int bound;
 
@@ -341,7 +350,8 @@ int xmarkExtendFromNearest(gram,x,y)
    }
 }
 
-char *xmarkGetText()
+char *
+xmarkGetText(void)
 {
     int i, index, len;
     int last_y = -1;
index f440cde0ff9fe8baadb2a606b1db67d7b55c3e0c..55c00c2cd673b2e514987338e91748107e444832 100644 (file)
@@ -41,11 +41,12 @@ extern x_gram *markgram;
 #define STARTPIXEL (markpixel[XMARK_START_BOUND])
 #define ENDPIXEL   (markpixel[XMARK_END_BOUND])
 
-extern void xmarkSetBound();
-extern int xmarkSecond();
-extern void xmarkRedraw();
-extern void xmarkClear();
-extern int xmarkExtendFromStart();
-extern int xmarkExtendFromNearest();
+extern void xmarkSetBound(x_gram *, int, int, int);
+extern int xmarkSecond(void);
+extern void xmarkRedraw(Display *, Window, x_gram *, int);
+extern void xmarkClear(void);
+extern int xmarkExtendFromFirst(x_gram *, int, int);
+extern int xmarkExtendFromNearest(x_gram *, int, int);
+extern char *xmarkGetText(void);
 
 #endif
index 1549956a3bfdfcb2b85c8e1f962d54de9fbb5567..2bd3f266d7ea822497fe7d4e90ffa1137ff4da34 100644 (file)
@@ -28,8 +28,8 @@ x_gram *bottom_gram = NULL;
 x_gram *unlinked = NULL;
 int reverse_stack = 0;
 
-void add_to_bottom(gram)
-     x_gram *gram;
+void
+add_to_bottom(x_gram *gram)
 {
    if (bottom_gram) {
       bottom_gram->below = gram;
@@ -44,17 +44,19 @@ void add_to_bottom(gram)
 }
 
 /*ARGSUSED*/
-void pull_to_top(gram)
-     x_gram *gram;
-{}
+void
+pull_to_top(x_gram *gram)
+{
+}
 
 /*ARGSUSED*/
-void push_to_bottom(gram)
-     x_gram *gram;
-{}
+void
+push_to_bottom(x_gram *gram)
+{
+}
 
-void delete_gram(gram)
-     x_gram *gram;
+void
+delete_gram(x_gram *gram)
 {
    if (gram == bottom_gram) {
       if (gram->above) {
@@ -82,8 +84,8 @@ void delete_gram(gram)
    gram->above = gram;
 }
 
-void unlink_gram(gram)
-     x_gram *gram;
+void
+unlink_gram(x_gram *gram)
 {
    delete_gram(gram);
 
@@ -111,8 +113,8 @@ x_gram *bottom_gram=NULL;
 static x_gram *top_gram=NULL;
 
 #ifdef DEBUG
-void print_gram_list(str)
-char *str;
+void
+print_gram_list(char *str)
 {
    x_gram *gram;
    char buf[80];
@@ -135,8 +137,8 @@ char *str;
 }
 #endif
 
-void pull_to_top(gram)
-x_gram *gram;
+void
+pull_to_top(x_gram *gram)
 {
    if (gram==top_gram) {
       /* already here */
@@ -166,8 +168,8 @@ x_gram *gram;
 #endif
 }
 
-void push_to_bottom(gram)
-x_gram *gram;
+void
+push_to_bottom(x_gram *gram)
 {
    if (gram==bottom_gram) {
       /* already here */
@@ -199,8 +201,8 @@ x_gram *gram;
 #endif
 }
 
-void unlink_gram(gram)
-x_gram *gram;
+void
+unlink_gram(x_gram *gram)
 {
    if (top_gram==bottom_gram) {
       /* the only gram in the stack */
@@ -222,8 +224,8 @@ x_gram *gram;
 }
 
 #ifdef notdef
-void add_to_top(gram)
-x_gram *gram;
+void
+add_to_top(x_gram *gram)
 {
    if (top_gram==NULL) {
       gram->above=NULL;
@@ -242,8 +244,8 @@ x_gram *gram;
 }
 #endif
 
-void add_to_bottom(gram)
-x_gram *gram;
+void
+add_to_bottom(x_gram *gram)
 {
    if (bottom_gram==NULL) {
       gram->above=NULL;
index 061d3d552054b89f64032a091d0afadd548b4f06..0976821611c6128ce457f4558d75f52d9f342766 100644 (file)
@@ -24,10 +24,10 @@ extern x_gram *bottom_gram; /* for testing against NULL */
 extern x_gram *unlinked;
 extern int reverse_stack; /* is reverse stack on? */
 
-extern void add_to_bottom(/* x_gram */);
-extern void delete_gram(/* x_gram */);
-extern void unlink_gram(/* x_gram */);
-extern void pull_to_top(/* x_gram */);
-extern void push_to_bottom(/* x_gram */);
+extern void add_to_bottom(x_gram *);
+extern void delete_gram(x_gram *);
+extern void unlink_gram(x_gram *);
+extern void pull_to_top(x_gram *);
+extern void push_to_bottom(x_gram *);
 
 #endif /* _XREVSTACK_H_ */
index 9a686587319170ad62aae11dbcdefd3a0ba7d9d1..2579dc4af34c353eb788d7e551e4cd2a6f06f0cf 100644 (file)
@@ -30,7 +30,7 @@ static const char rcsid_xselect_c[] = "$Id$";
 #include "new_string.h"
 #include "xselect.h"
 
-extern char *getSelectedText();
+extern char *getSelectedText(void);
 
 static Time ownership_start = CurrentTime;
 static Time ownership_end = CurrentTime;
@@ -52,10 +52,10 @@ static struct _ZAtom {
 
 /* internal static functions */
 
-static void xselNotify(dpy,selreq,property)
-     Display *dpy;
-     XSelectionRequestEvent *selreq;
-     Atom property;
+static void
+xselNotify(Display *dpy,
+          XSelectionRequestEvent *selreq,
+          Atom property)
 {
    XSelectionEvent ev;
 
@@ -82,11 +82,12 @@ static Atom RequestAtoms[] = {
   XChangeProperty(dpy,w,PROP(property,target),(type),(format), \
                  PropModeReplace, (unsigned char *) (data),(size))
 
-static void xselSetProperties(dpy,w,property,target,selreq)
-     Display *dpy;
-     Window w;
-     Atom property,target;
-     XSelectionRequestEvent *selreq;
+static void
+xselSetProperties(Display *dpy,
+                 Window w,
+                 Atom property,
+                 Atom target,
+                 XSelectionRequestEvent *selreq)
 {
    if (target==ZA_TARGETS) {
 
@@ -136,8 +137,8 @@ static void xselSetProperties(dpy,w,property,target,selreq)
 
 /* global functions */
 
-void xicccmInitAtoms(dpy)
-     Display *dpy;
+void
+xicccmInitAtoms(Display *dpy)
 {
    int i;
 
@@ -148,10 +149,10 @@ void xicccmInitAtoms(dpy)
        RequestAtoms[i] = *(pRequestAtoms[i]);
 }
 
-int xselGetOwnership(dpy,w,time)
-     Display *dpy;
-     Window w;
-     Time time;
+int
+xselGetOwnership(Display *dpy,
+                Window w,
+                Time time)
 {
    int temp;
 
@@ -165,10 +166,10 @@ int xselGetOwnership(dpy,w,time)
 }
 
 /* Get the selection.  Return !0 if success, 0 if fail */
-int xselProcessSelection(dpy,w,event)
-     Display *dpy;
-     Window w;
-     XEvent *event;
+int
+xselProcessSelection(Display *dpy,
+                    Window w,
+                    XEvent *event)
 {
    XSelectionRequestEvent *selreq = &(event->xselectionrequest);
 
@@ -191,16 +192,16 @@ int xselProcessSelection(dpy,w,event)
    return(1);
 }
 
-void xselOwnershipLost(time)
-     Time time;
+void
+xselOwnershipLost(Time time)
 {
    ownership_end = time;
 }
 
 /*ARGSUSED*/
-void xselGiveUpOwnership(dpy,w)
-     Display *dpy;
-     Window w;
+void
+xselGiveUpOwnership(Display *dpy,
+                   Window w)
 {
    XSetSelectionOwner(dpy,XA_PRIMARY,None,ownership_start);
 
index aa2a3fd139b0a542d9d0853de96e5f6abce788df..f8fa964219c32b459f9ae9afa132893bb8378ceb 100644 (file)
 #ifndef _XSELECT_H_
 #define _XSELECT_H_
 
-extern void xicccmInitAtoms();
-extern int xselGetOwnership();
-extern int xselProcessSelection();
-extern void xselOwnershipLost();
-extern void xselGiveUpOwnership();
+extern void xicccmInitAtoms(Display *);
+extern int xselGetOwnership(Display *, Window, Time);
+extern int xselProcessSelection(Display *, Window, XEvent *);
+extern void xselOwnershipLost(Time);
+extern void xselGiveUpOwnership(Display *, Window);
 
-extern int xwmprotoDelete();
-
-extern Atom XA_WM_PROTOCOLS,XA_WM_DELETE_WINDOW;
+extern Atom XA_WM_PROTOCOLS, XA_WM_DELETE_WINDOW;
 
 #endif
index d970cccaa3ac89bb23cb7fec0cd2995f3310e775..68c64eb7eb21d3c7a59ebb13f6203dd029fdd057 100644 (file)
@@ -26,9 +26,11 @@ static const char rcsid_xshow_c[] = "$Id$";
 #include <X11/Xresource.h>
 #include "pointer_dictionary.h"
 #include "new_memory.h"
+#include "new_string.h"
 #include "formatter.h"
 #include "variables.h"
 #include "zwgc.h"
+#include "X_driver.h"
 #include "X_fonts.h"
 #include "X_gram.h"
 #include "xmode_stack.h"
@@ -41,10 +43,9 @@ static pointer_dictionary colorname_dict = NULL;
 extern int internal_border_width;
 extern unsigned long default_bgcolor;
 extern unsigned long default_fgcolor;
-extern unsigned long x_string_to_color();
 
 void
-xshowinit()
+xshowinit(void)
 {
     desc_context = XUniqueContext();
 }
@@ -55,9 +56,9 @@ struct res_dict_type {
     char *             resclass;
 };
 
-static char *xres_get_resource (restype, style)
-    struct res_dict_type *restype;
-    char *style;
+static char *
+xres_get_resource(struct res_dict_type *restype,
+                 char *style)
 {
    char *desc;
    pointer_dictionary_binding *binding;
@@ -102,10 +103,10 @@ static struct res_dict_type fgcolor_resources = {
 };
 
 /*ARGSUSED*/
-char *mode_to_colorname (dpy, style, mode)
-    Display *dpy;
-    char *style;
-    xmode *mode;
+char *
+mode_to_colorname (Display *dpy,
+                  char *style,
+                  xmode *mode)
 {
     char *desc, *result;
 
@@ -116,16 +117,15 @@ char *mode_to_colorname (dpy, style, mode)
     return result;
 }
 
-void fixup_and_draw(dpy, style, auxblocks, blocks, num, lines, numlines,
-                   beepcount)
-     Display *dpy;
-     char *style;
-     xblock *blocks;
-     xauxblock *auxblocks;
-     int num;
-     xlinedesc *lines;
-     int numlines;
-     int beepcount;
+void
+fixup_and_draw(Display *dpy,
+              char *style,
+              xauxblock *auxblocks,
+              xblock *blocks,
+              int num,
+              xlinedesc *lines,
+              int numlines,
+              int beepcount)
 {
     int gram_xalign = 1;
     int gram_yalign = 1;
@@ -338,8 +338,8 @@ void fixup_and_draw(dpy, style, auxblocks, blocks, num, lines, numlines,
 }
 
 /* Silly almost-but-not-quite-useless helper function */
-char *no_dots_downcase_var(str)
-     char *str;
+char *
+no_dots_downcase_var(char *str)
 {
    register char *var, *var2;
 
@@ -354,11 +354,11 @@ char *no_dots_downcase_var(str)
 #define MODE_TO_FONT(dpy,style,mode) \
   get_font((dpy),(style),(mode)->font?(mode)->font:(mode)->substyle, \
           (mode)->size, (mode)->bold+(mode)->italic*2)
-void xshow(dpy, desc, numstr, numnl)
-     Display *dpy;
-     desctype *desc;
-     int numstr;
-     int numnl;
+void
+xshow(Display *dpy,
+      desctype *desc,
+      int numstr,
+      int numnl)
 {
     XFontStruct *font;
     xmode_stack modes = xmode_stack_create();
@@ -535,10 +535,10 @@ void xshow(dpy, desc, numstr, numnl)
       free(style);
 }
 
-static void xhandleevent(dpy, w, event)
-     Display *dpy;
-     Window w;
-     XEvent *event;
+static void
+xhandleevent(Display *dpy,
+            Window w,
+            XEvent *event)
 {
     x_gram *gram;
     
@@ -553,8 +553,8 @@ static void xhandleevent(dpy, w, event)
     XFlush(dpy);
 }
 
-void x_get_input(dpy)
-     Display *dpy;
+void
+x_get_input(Display *dpy)
 {
     XEvent event;
     
index 9ad8dbe4aabc78bc2c72c5114e6ccfa8845f5860..e1497d455ca4dcb3f230c10bd01849c3a059b007 100644 (file)
@@ -58,11 +58,11 @@ static unsigned short zephyr_port = 0;
  *                 modified in any way.
  */
 
-static string get_zwgc_port_number_filename()
+static string
+get_zwgc_port_number_filename(void)
 {
     static char buffer[40];
     char *temp;
-    char *getenv();
 
     if (temp = getenv("WGFILE"))
       return(temp);
@@ -76,7 +76,8 @@ static string get_zwgc_port_number_filename()
  *  Write out the port number to the wg file.
  */
 
-void write_wgfile()
+void
+write_wgfile(void)
 {
     char *name = get_zwgc_port_number_filename();
     FILE *port_file;
@@ -95,8 +96,8 @@ void write_wgfile()
  *
  */
 
-static void handle_zephyr_input(notice_handler)
-     void (*notice_handler)();
+static void
+handle_zephyr_input(void (*notice_handler)(ZNotice_t *))
 {
     ZNotice_t *notice;
     struct sockaddr_in from;
@@ -124,8 +125,7 @@ static void handle_zephyr_input(notice_handler)
  *
  */
 
-void zephyr_init(notice_handler)
-     void (*notice_handler)();
+void zephyr_init(void (*notice_handler)(ZNotice_t *))
 {
     char *temp;
     char *exposure;
@@ -197,7 +197,7 @@ void zephyr_init(notice_handler)
     /*
      * <<<>>>
      */
-    mux_add_input_source(ZGetFD(), (void (*)())handle_zephyr_input,
+    mux_add_input_source(ZGetFD(), (void (*)(void *))handle_zephyr_input,
                         notice_handler);
     zephyr_inited = 1;
     return;
@@ -207,7 +207,7 @@ void zephyr_init(notice_handler)
  *
  */
 
-void finalize_zephyr() /* <<<>>> */
+void finalize_zephyr(void) /* <<<>>> */
 {
     string temp;
 
index 98265df6d9a4ee99af1ec621921e1d969fa71161..e821bfd9b3ebb2d4bf0de2c6f44cb13b529bf11e 100644 (file)
@@ -17,8 +17,8 @@
 #ifndef zephyr_MODULE
 #define zephyr_MODULE
 
-extern void zephyr_init();
-extern void finalize_zephyr();
-extern void write_wgfile();
+extern void zephyr_init(void(*)(ZNotice_t *));
+extern void finalize_zephyr(void);
+extern void write_wgfile(void);
 
 #endif