Browse Source

Add prototypes for internal functions

Change inline to __inline
OPENBSD_2_0
tholo 28 years ago
parent
commit
6ea1ec00cf
4 changed files with 29 additions and 28 deletions
  1. +18
    -17
      src/lib/libc/stdlib/getenv.c
  2. +3
    -3
      src/lib/libc/stdlib/malloc.c
  3. +5
    -5
      src/lib/libc/stdlib/qsort.c
  4. +3
    -3
      src/lib/libc/stdlib/radixsort.c

+ 18
- 17
src/lib/libc/stdlib/getenv.c View File

@ -33,26 +33,12 @@
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)getenv.c 5.8 (Berkeley) 2/23/91";*/ /*static char *sccsid = "from: @(#)getenv.c 5.8 (Berkeley) 2/23/91";*/
static char *rcsid = "$Id: getenv.c,v 1.1.1.1 1995/10/18 08:42:17 deraadt Exp $";
static char *rcsid = "$Id: getenv.c,v 1.2 1996/03/25 22:16:38 tholo Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
/*
* getenv --
* Returns ptr to value associated with name, if any, else NULL.
*/
char *
getenv(name)
const char *name;
{
int offset;
char *__findenv();
return(__findenv(name, &offset));
}
/* /*
* __findenv -- * __findenv --
* Returns pointer to value associated with name, if any, else NULL. * Returns pointer to value associated with name, if any, else NULL.
@ -64,14 +50,15 @@ getenv(name)
*/ */
char * char *
__findenv(name, offset) __findenv(name, offset)
register char *name;
register const char *name;
int *offset; int *offset;
{ {
extern char **environ; extern char **environ;
register int len; register int len;
register char **P, *C; register char **P, *C;
register const char *cp;
for (C = name, len = 0; *C && *C != '='; ++C, ++len);
for (cp = name, len = 0; *cp != '\0' && *cp != '='; ++cp, ++len);
for (P = environ; *P; ++P) for (P = environ; *P; ++P)
if (!strncmp(*P, name, len)) if (!strncmp(*P, name, len))
if (*(C = *P + len) == '=') { if (*(C = *P + len) == '=') {
@ -80,3 +67,17 @@ __findenv(name, offset)
} }
return(NULL); return(NULL);
} }
/*
* getenv --
* Returns ptr to value associated with name, if any, else NULL.
*/
char *
getenv(name)
const char *name;
{
int offset;
char *__findenv();
return(__findenv(name, &offset));
}

+ 3
- 3
src/lib/libc/stdlib/malloc.c View File

@ -59,9 +59,6 @@ static char *rcsid = "$NetBSD: malloc.c,v 1.6 1996/01/17 02:45:25 jtc Exp $";
#define NULL 0 #define NULL 0
static void morecore();
static int findbucket();
/* /*
* The overhead on a block is at least 4 bytes. When free, this space * The overhead on a block is at least 4 bytes. When free, this space
* contains a pointer to the next free block, and the bottom two bits must * contains a pointer to the next free block, and the bottom two bits must
@ -88,6 +85,9 @@ union overhead {
#define ov_size ovu.ovu_size #define ov_size ovu.ovu_size
}; };
static void morecore __P((int));
static int findbucket __P((union overhead *, int));
#define MAGIC 0xef /* magic # on accounting info */ #define MAGIC 0xef /* magic # on accounting info */
#define RMAGIC 0x5555 /* magic # on range info */ #define RMAGIC 0x5555 /* magic # on range info */


+ 5
- 5
src/lib/libc/stdlib/qsort.c View File

@ -33,14 +33,14 @@
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
/*static char sccsid[] = "from: @(#)qsort.c 8.1 (Berkeley) 6/4/93";*/ /*static char sccsid[] = "from: @(#)qsort.c 8.1 (Berkeley) 6/4/93";*/
static char *rcsid = "$Id: qsort.c,v 1.1.1.1 1995/10/18 08:42:18 deraadt Exp $";
static char *rcsid = "$Id: qsort.c,v 1.2 1996/03/25 22:16:40 tholo Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
static inline char *med3 __P((char *, char *, char *, int (*)()));
static inline void swapfunc __P((char *, char *, int, int));
static __inline char *med3 __P((char *, char *, char *, int (*)()));
static __inline void swapfunc __P((char *, char *, int, int));
#define min(a, b) (a) < (b) ? a : b #define min(a, b) (a) < (b) ? a : b
@ -61,7 +61,7 @@ static inline void swapfunc __P((char *, char *, int, int));
#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \ #define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1; es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
static inline void
static __inline void
swapfunc(a, b, n, swaptype) swapfunc(a, b, n, swaptype)
char *a, *b; char *a, *b;
int n, swaptype; int n, swaptype;
@ -82,7 +82,7 @@ swapfunc(a, b, n, swaptype)
#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) #define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
static inline char *
static __inline char *
med3(a, b, c, cmp) med3(a, b, c, cmp)
char *a, *b, *c; char *a, *b, *c;
int (*cmp)(); int (*cmp)();


+ 3
- 3
src/lib/libc/stdlib/radixsort.c View File

@ -36,7 +36,7 @@
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
/*static char sccsid[] = "from: @(#)radixsort.c 8.1 (Berkeley) 6/4/93";*/ /*static char sccsid[] = "from: @(#)radixsort.c 8.1 (Berkeley) 6/4/93";*/
static char *rcsid = "$Id: radixsort.c,v 1.1.1.1 1995/10/18 08:42:19 deraadt Exp $";
static char *rcsid = "$Id: radixsort.c,v 1.2 1996/03/25 22:16:39 tholo Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
/* /*
@ -61,7 +61,7 @@ typedef struct {
int sn, si; int sn, si;
} stack; } stack;
static inline void simplesort
static __inline void simplesort
__P((const u_char **, int, int, const u_char *, u_int)); __P((const u_char **, int, int, const u_char *, u_int));
static void r_sort_a __P((const u_char **, int, int, const u_char *, u_int)); static void r_sort_a __P((const u_char **, int, int, const u_char *, u_int));
static void r_sort_b __P((const u_char **, static void r_sort_b __P((const u_char **,
@ -295,7 +295,7 @@ r_sort_b(a, ta, n, i, tr, endch)
} }
} }
static inline void
static __inline void
simplesort(a, n, b, tr, endch) /* insertion sort */ simplesort(a, n, b, tr, endch) /* insertion sort */
register const u_char **a; register const u_char **a;
int n, b; int n, b;


Loading…
Cancel
Save