declare variables extern and define only once (from ralph)
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Mon, 4 Jul 1994 06:08:39 +0000 (22:08 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Mon, 4 Jul 1994 06:08:39 +0000 (22:08 -0800)
SCCS-vsn: lib/libc/stdio/local.h 8.3
SCCS-vsn: lib/libc/stdlib/atexit.h 8.2
SCCS-vsn: lib/libc/stdlib/atexit.c 8.2

usr/src/lib/libc/stdio/local.h
usr/src/lib/libc/stdlib/atexit.c
usr/src/lib/libc/stdlib/atexit.h

index 27574af..5a64b81 100644 (file)
@@ -7,7 +7,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)local.h     8.2 (Berkeley) %G%
+ *     @(#)local.h     8.3 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
  * in particular, macros and private variables.
  */
 
  * in particular, macros and private variables.
  */
 
-int    __sflush __P((FILE *));
-FILE   *__sfp __P((void));
-int    __srefill __P((FILE *));
-int    __sread __P((void *, char *, int));
-int    __swrite __P((void *, char const *, int));
-fpos_t __sseek __P((void *, fpos_t, int));
-int    __sclose __P((void *));
-void   __sinit __P((void));
-void   _cleanup __P((void));
-void   (*__cleanup) __P((void));
-void   __smakebuf __P((FILE *));
-int    __swhatbuf __P((FILE *, size_t *, int *));
-int    _fwalk __P((int (*)(FILE *)));
-int    __swsetup __P((FILE *));
-int    __sflags __P((const char *, int *));
+extern int     __sflush __P((FILE *));
+extern FILE    *__sfp __P((void));
+extern int     __srefill __P((FILE *));
+extern int     __sread __P((void *, char *, int));
+extern int     __swrite __P((void *, char const *, int));
+extern fpos_t  __sseek __P((void *, fpos_t, int));
+extern int     __sclose __P((void *));
+extern void    __sinit __P((void));
+extern void    _cleanup __P((void));
+extern void    (*__cleanup) __P((void));
+extern void    __smakebuf __P((FILE *));
+extern int     __swhatbuf __P((FILE *, size_t *, int *));
+extern int     _fwalk __P((int (*)(FILE *)));
+extern int     __swsetup __P((FILE *));
+extern int     __sflags __P((const char *, int *));
 
 
-extern int __sdidinit;
+extern int     __sdidinit;
 
 /*
  * Return true iff the given FILE cannot be written now.
 
 /*
  * Return true iff the given FILE cannot be written now.
index 46d3574..43f5bb3 100644 (file)
@@ -9,13 +9,15 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)atexit.c   8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)atexit.c   8.2 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stddef.h>
 #include <stdlib.h>
 #include "atexit.h"
 
 #endif /* LIBC_SCCS and not lint */
 
 #include <stddef.h>
 #include <stdlib.h>
 #include "atexit.h"
 
+struct atexit *__atexit;       /* points to head of LIFO stack */
+
 /*
  * Register a function to be performed at exit.
  */
 /*
  * Register a function to be performed at exit.
  */
index ca204d1..6c27d25 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)atexit.h    8.1 (Berkeley) %G%
+ *     @(#)atexit.h    8.2 (Berkeley) %G%
  */
 
 /* must be at least 32 to guarantee ANSI conformance */
  */
 
 /* must be at least 32 to guarantee ANSI conformance */
@@ -16,4 +16,4 @@ struct atexit {
        void (*fns[ATEXIT_SIZE])();     /* the table itself */
 };
 
        void (*fns[ATEXIT_SIZE])();     /* the table itself */
 };
 
-struct atexit *__atexit;       /* points to head of LIFO stack */
+extern struct atexit *__atexit;        /* points to head of LIFO stack */