Prototypes (PR#1098).
This commit is contained in:
parent
3131b5c6e5
commit
dde1c1a0be
@ -40,7 +40,7 @@
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/types.h>
|
||||
.Fd #include <sys/timeb.h>
|
||||
.Ft struct timeb *
|
||||
.Ft int
|
||||
.Fn ftime "struct timeb *tp"
|
||||
.Sh DESCRIPTION
|
||||
.Bf -symbolic
|
||||
|
@ -29,13 +29,14 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$Id: ftime.c,v 1.3 1994/05/06 06:42:21 cgd Exp $";
|
||||
static char rcsid[] = "$Id: ftime.c,v 1.4 1995/06/05 19:42:19 pk Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/timeb.h>
|
||||
|
||||
int
|
||||
ftime(tbp)
|
||||
struct timeb *tbp;
|
||||
{
|
||||
|
@ -39,40 +39,44 @@ static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <search.h>
|
||||
|
||||
static char *linear_base();
|
||||
typedef int (*cmp_fn_t) __P((const void *, const void *));
|
||||
static void *linear_base __P((const void *, const void *, size_t *, size_t,
|
||||
cmp_fn_t, int));
|
||||
|
||||
char *
|
||||
void *
|
||||
lsearch(key, base, nelp, width, compar)
|
||||
char *key, *base;
|
||||
u_int *nelp, width;
|
||||
int (*compar)();
|
||||
const void *key, *base;
|
||||
size_t *nelp, width;
|
||||
cmp_fn_t compar;
|
||||
{
|
||||
return(linear_base(key, base, nelp, width, compar, 1));
|
||||
}
|
||||
|
||||
char *
|
||||
void *
|
||||
lfind(key, base, nelp, width, compar)
|
||||
char *key, *base;
|
||||
u_int *nelp, width;
|
||||
int (*compar)();
|
||||
const void *key, *base;
|
||||
size_t *nelp, width;
|
||||
cmp_fn_t compar;
|
||||
{
|
||||
return(linear_base(key, base, nelp, width, compar, 0));
|
||||
}
|
||||
|
||||
static char *
|
||||
static void *
|
||||
linear_base(key, base, nelp, width, compar, add_flag)
|
||||
char *key, *base;
|
||||
u_int *nelp, width;
|
||||
int (*compar)(), add_flag;
|
||||
const void *key, *base;
|
||||
size_t *nelp, width;
|
||||
cmp_fn_t compar;
|
||||
int add_flag;
|
||||
{
|
||||
register char *element, *end;
|
||||
register const char *element, *end;
|
||||
|
||||
end = base + *nelp * width;
|
||||
end = (const char *)base + *nelp * width;
|
||||
for (element = base; element < end; element += width)
|
||||
if (!compar(element, key)) /* key found */
|
||||
return(element);
|
||||
return((void *)element);
|
||||
|
||||
if (!add_flag) /* key not found */
|
||||
return(NULL);
|
||||
@ -83,10 +87,10 @@ linear_base(key, base, nelp, width, compar, add_flag)
|
||||
* appropriately, if there is not enough room in the table
|
||||
* to add a new item. This can't be done as none of these
|
||||
* routines have any method of determining the size of the
|
||||
* table. This comment was isn't in the 1986-87 System V
|
||||
* table. This comment isn't in the 1986-87 System V
|
||||
* manual.
|
||||
*/
|
||||
++*nelp;
|
||||
bcopy(key, end, (int)width);
|
||||
return(end);
|
||||
memcpy((void *)end, key, width);
|
||||
return((void *)end);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
/*static char sccsid[] = "from: @(#)regex.c 5.1 (Berkeley) 3/29/92";*/
|
||||
static char rcsid[] = "$Id: regex.c,v 1.4 1994/02/01 17:45:53 jtc Exp $";
|
||||
static char rcsid[] = "$Id: regex.c,v 1.5 1995/06/05 19:42:25 pk Exp $";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -58,7 +58,7 @@ static char *re_errstr;
|
||||
|
||||
char *
|
||||
re_comp(s)
|
||||
char *s;
|
||||
const char *s;
|
||||
{
|
||||
if (s == NULL)
|
||||
return (NULL);
|
||||
@ -73,7 +73,7 @@ re_comp(s)
|
||||
|
||||
int
|
||||
re_exec(s)
|
||||
char *s;
|
||||
const char *s;
|
||||
{
|
||||
int rc;
|
||||
|
||||
|
@ -44,12 +44,13 @@ static char sccsid[] = "@(#)rexec.c 8.1 (Berkeley) 6/4/93";
|
||||
#include <netdb.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern errno;
|
||||
char *index();
|
||||
int rexecoptions;
|
||||
char *getpass(), *getlogin();
|
||||
|
||||
void ruserpass __P((const char *, char **, char **));
|
||||
|
||||
int
|
||||
rexec(ahost, rport, name, pass, cmd, fd2p)
|
||||
char **ahost;
|
||||
int rport;
|
||||
@ -89,9 +90,9 @@ retry:
|
||||
perror(hp->h_name);
|
||||
return (-1);
|
||||
}
|
||||
port = 0;
|
||||
if (fd2p == 0) {
|
||||
(void) write(s, "", 1);
|
||||
port = 0;
|
||||
} else {
|
||||
char num[8];
|
||||
int s2, sin2len;
|
||||
|
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char *rcsid = "$Id: regexp.c,v 1.3 1993/08/26 00:45:35 jtc Exp $";
|
||||
static char *rcsid = "$Id: regexp.c,v 1.4 1995/06/05 19:42:32 pk Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <regexp.h>
|
||||
@ -175,18 +175,18 @@ static long regsize; /* Code size. */
|
||||
#ifndef STATIC
|
||||
#define STATIC static
|
||||
#endif
|
||||
STATIC char *reg();
|
||||
STATIC char *regbranch();
|
||||
STATIC char *regpiece();
|
||||
STATIC char *regatom();
|
||||
STATIC char *regnode();
|
||||
STATIC char *regnext();
|
||||
STATIC void regc();
|
||||
STATIC void reginsert();
|
||||
STATIC void regtail();
|
||||
STATIC void regoptail();
|
||||
STATIC char *reg __P((int, int *));
|
||||
STATIC char *regbranch __P((int *));
|
||||
STATIC char *regpiece __P((int *));
|
||||
STATIC char *regatom __P((int *));
|
||||
STATIC char *regnode __P((char));
|
||||
STATIC char *regnext __P((char *));
|
||||
STATIC void regc __P((char));
|
||||
STATIC void reginsert __P((char, char *));
|
||||
STATIC void regtail __P((char *, char *));
|
||||
STATIC void regoptail __P((char *, char *));
|
||||
#ifdef STRCSPN
|
||||
STATIC int strcspn();
|
||||
STATIC int strcspn __P((char *, char *));
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -302,7 +302,7 @@ int *flagp;
|
||||
register char *ret;
|
||||
register char *br;
|
||||
register char *ender;
|
||||
register int parno;
|
||||
register int parno = 0;
|
||||
int flags;
|
||||
|
||||
*flagp = HASWIDTH; /* Tentatively. */
|
||||
@ -775,14 +775,14 @@ static char **regendp; /* Ditto for endp. */
|
||||
/*
|
||||
* Forwards.
|
||||
*/
|
||||
STATIC int regtry();
|
||||
STATIC int regmatch();
|
||||
STATIC int regrepeat();
|
||||
STATIC int regtry __P((const regexp *, const char *));
|
||||
STATIC int regmatch __P((char *));
|
||||
STATIC int regrepeat __P((char *));
|
||||
|
||||
#ifdef DEBUG
|
||||
int regnarrate = 0;
|
||||
void regdump();
|
||||
STATIC char *regprop();
|
||||
void regdump __P((regexp *));
|
||||
STATIC char *regprop __P((char *));
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -794,7 +794,6 @@ register const regexp *prog;
|
||||
register const char *string;
|
||||
{
|
||||
register char *s;
|
||||
extern char *strchr();
|
||||
|
||||
/* Be paranoid... */
|
||||
if (prog == NULL || string == NULL) {
|
||||
@ -852,14 +851,14 @@ register const char *string;
|
||||
*/
|
||||
static int /* 0 failure, 1 success */
|
||||
regtry(prog, string)
|
||||
regexp *prog;
|
||||
char *string;
|
||||
const regexp *prog;
|
||||
const char *string;
|
||||
{
|
||||
register int i;
|
||||
register char **sp;
|
||||
register char **ep;
|
||||
|
||||
reginput = string;
|
||||
reginput = (char *)string;
|
||||
regstartp = prog->startp;
|
||||
regendp = prog->endp;
|
||||
|
||||
@ -870,8 +869,8 @@ char *string;
|
||||
*ep++ = NULL;
|
||||
}
|
||||
if (regmatch(prog->program + 1)) {
|
||||
prog->startp[0] = string;
|
||||
prog->endp[0] = reginput;
|
||||
((regexp *)prog)->startp[0] = (char *)string;
|
||||
((regexp *)prog)->endp[0] = reginput;
|
||||
return(1);
|
||||
} else
|
||||
return(0);
|
||||
@ -893,7 +892,6 @@ char *prog;
|
||||
{
|
||||
register char *scan; /* Current node. */
|
||||
char *next; /* Next node. */
|
||||
extern char *strchr();
|
||||
|
||||
scan = prog;
|
||||
#ifdef DEBUG
|
||||
@ -1157,8 +1155,6 @@ register char *p;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
STATIC char *regprop();
|
||||
|
||||
/*
|
||||
- regdump - dump a regexp onto stdout in vaguely comprehensible form
|
||||
*/
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char *rcsid = "$Id: regsub.c,v 1.3 1993/08/26 00:45:37 jtc Exp $";
|
||||
static char *rcsid = "$Id: regsub.c,v 1.4 1995/06/05 19:42:35 pk Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <regexp.h>
|
||||
@ -48,7 +48,6 @@ char *dest;
|
||||
register char c;
|
||||
register int no;
|
||||
register int len;
|
||||
extern char *strncpy();
|
||||
|
||||
if (prog == NULL || source == NULL || dest == NULL) {
|
||||
regerror("NULL parm to regsub");
|
||||
|
Loading…
Reference in New Issue
Block a user