/*
 *   Copyright (C) 1988-2006 Lucent Technologies Inc. and others.
 *   All Rights Reserved.
 */

/* library function return value declarations */

#include <ctype.h>	/* isprint, isupper, etc. */

#include <sys/stat.h>

#if BSD
#if BSD42
#define	isgraph(c)	(isprint(c) && c != ' ')
#endif
#define	strchr		index
#define strrchr		rindex
#undef	tolower		/* BSD toupper and tolower don't test the character */
#undef	toupper
#define	tolower(c)	(isupper(c) ? (c) + ('a' - 'A') : (c))	
#define	toupper(c)	(islower(c) ? (c) - ('a' - 'A') : (c))
#endif

/* private library */
#if defined( __STDC__ ) || defined( __BORLANDC__ )
char	*mybasename(char *path);
char	*mybasename_end(char *path,char *end);
char	*compath(char *pathname);
char	*pathjoin(char *s,char *s2);
char	*getwd(char *dir);
char	*logdir(char *name);
char	*mygetenv(char *variable, char *deflt);
char	*mygetwd(char *dir);

/* alloc.c */
char	*stralloc(char *s);
char	*mymalloc(unsigned size);
char	*mycalloc(unsigned nelem, unsigned size);
char	*myrealloc(char *p, unsigned size);

/* cache.c */
void	uncompressdb(void);

/* mypopen.c */
FILE	*mypopen(char *cmd, char *mode);
int	mypclose(FILE *ptr);

/* vp*.c */
int	vpaccess(char *path, unsigned amode);
FILE	*vpfopen(char *filename, char *type);
void	vpinit(char *currentdir);
int	vpls(char *path, unsigned amode, char *newpath);
int	vpopen(char *path, int oflag);
int	vpstat(char *path, struct stat *statp);
#else
char	*mybasename(), *mybasename_end();
char	*compath(), *getwd(), *logdir(), *mycalloc(), 
	*mygetenv(), *mygetwd(), *mymalloc(), *myrealloc(), *stralloc(),
	*pathjoin();
FILE	*mypopen(), *vpfopen();
void	uncompressdb();
void	vpinit();
#endif

/* standard C library */
#if defined( __STDC__ ) || defined( __BORLANDC__ )
#include <stdlib.h>
#else
char	*ctime(), *getenv(), *mktemp();
long	lseek(), time();
unsigned sleep();
void	exit(), free(), perror(), qsort();
#endif
#if BSD
char	*strcat(), *strcpy(), *strncpy(), *strpbrk(), *strchr(), *strrchr();
char	*strtok();
#else

#include <string.h>	/* string functions */
#endif

/* Programmer's Workbench library (-lPW) */
#if defined( __STDC__ ) || defined( __BORLANDC__ )
char	*regex(char *re, char *subject, ...);
char	*regcmp(char *string1, ...);
#else
char	*regcmp(), *regex();
#endif
