@@ -1,3 +1,4 @@
+/* $Header$ */
/* File : _c2type.c
Author : Richard A. O'Keefe.
Updated: 23 April 1984
abs(i){
return i < 0 ? -i : i;
}
#include <time.h>
#define DATE_STR "??? ??? ?? ??:??:?? ????\n"
#ifndef NOFLOAT
#include <ctype.h>
atoi(s)
register char *s;
{
long atol(s)
int
bcmp(b1, b2, n)
register char *b1, *b2;
bcopy(old, new, n)
register char *old, *new;
register int n;
bfill(dst, len, fill)
register char *dst;
register int len;
bmove(dst, src, len)
char *dst, *src;
int len;
bzero(b, l)
register char *b;
#define ALIGN(sz) (((sz) + (sizeof(long) - 1) / sizeof(long)) * sizeof(long))
char *
calloc(nelem, elsize)
#include <sys/types.h>
#include <sys/dir.h>
/* From Andy Tanenbaum's book "Computer Networks",
rewritten in C
*/
extern struct tm *localtime();
extern double modf();
static char *cvt();
char *getenv();
char *index();
ffc(i)
register int i;
ffs(i)
extern char *ecvt();
char *getenv(name)
register char *name;
#define UTMPFILE "/etc/utmp"
#ifdef __USG
#include <stdio.h>
#define ERR(s, c) if(opterr){\
fputs(argv[0], stderr);\
static int monthsize[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
char *index(s, c)
register char *s, c;
isatty(f)
char buf[128];
ltol3(cp, lp, n)
register char *cp;
register long *lp;
extern double frexp();
#define YEARSIZE(year) ((year) % 4 ? 365 : 366)
#define CLICK_SIZE 16
#if EM_WSIZE == EM_PSIZE
memccpy(dst, src, c, n)
register char *dst, *src;
memchr(s, c, n)
char *s;
memcmp(s1, s2, n)
register char *s1, *s2;
memcpy(s1, s2, n)
memset(s, c, n)
/* mktemp - make a name for a temporary file */
char *mktemp(template)
static int bs;
static char *bp;
static char *bufp;
#include <sys/stat.h>
/* perror(s) print the current error message. */
extern int errno;
/*
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
*
static qsort1();
static int (*qcompar)();
static qexchange();
static long seed = 1L;
int rand()
char *rindex(s, c)
#include <signal.h>
#include <setjmp.h>
char *strcat(s1, s2)
char *strchr(s, c)
int strcmp(s1, s2)
char *strcpy(s1, s2)
strcspn(string, notin)
char *string;
int strlen(s)
char *strncat(s1, s2, n)
int n;
strncmp(s1, s2, n)
char
*strncpy(s1, s2, n)
strpbrk(string, brk)
register char *string, *brk;
char *strrchr(s, c)
strspn(string, in)
/* find first occurrence of wanted in s */
strstr(s, wanted)
extern char *strpbrk();
swab(from, to, nbytes)
register char *from, *to;
/* system V, so no /etc/ttys file. In this case, scan the
/etc/utmp file
#ifdef __BSD4_2
struct timeval {
long tv_sec, tv_usec;
@@ -1 +1,2 @@
_cleanup(){}
#include <sgtty.h>
int gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {
return ioctl(fildes,TIOCGETP,argp) ;
typedef int (*callvec)() ;
int stty(fildes,argp) int fildes ; struct sgttyb *argp ; {
return ioctl(fildes,TIOCSETP,argp) ;
* return offset in file.
#include <sys/timeb.h>
time_t time(timpt) time_t *timpt ; {
clearerr(iop)
unsigned char _sobuf[BUFSIZ];
fclose(fp)
FILE *fdopen(fd,mode)
fgetc(f)
char *fgets(str, n, file)
_fillbuf(iop)
extern char *fcvt();
#define PMODE 0666
fprintf (file, fmt, args)
fputc(c, iop)
fputs(s,file)
fread(ptr, size, count, file)
int fscanf (fp, format, args)
fwrite(ptr, size, count, file)
#undef getchar
* get entry from group file
getpw(uid, buf)
* get entry from password file
char *gets(str)