/*
 * 5799-WZQ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:common.h 12.0$ */
/* $ACIS:common.h 12.0$ */
/* $Source: /ibm/acis/usr/src/ibm/rvd/client/RCS/common.h,v $ */

#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
static char *rcsidcommon = "$Header:common.h 12.0$";
#endif

/*
 * $Header:common.h 12.0$
 * $ACIS:common.h 12.0$
 * $Author: root $
 * $Source: /ibm/acis/usr/src/ibm/rvd/client/RCS/common.h,v $
 */
#ifndef _COMMON_H_
#define _COMMON_H_

#define TRUE	(1)
#define FALSE	(0)

#define DIGITS	"0123456789"

#define NL '\n'			     /* newline */
#define CC '#'			     /* comment character */

#define NULL 0
#define NIL '\0'		     /* NULL byte */

#define abs(_v_) ((_v_) < 0 ? -(_v_) : (_v_))

extern int errno;		     /* C global error code */
extern unsigned long rvderrno;	     /* RVD global error code (see common.c) */
#define seterr(_e_,_r_) (rvderrno=(_r_),errno=(_e_))

#define ERROR (-1)		     /* generic unspecified error */
#define EBADFS 100		     /* fsck failure condition */

#include <sys/param.h>
#define ZCHAR ((char *)NULL)

caddr_t malloc(/*bytes*/);
caddr_t calloc(/*numelem,sizelem*/);

#include <stdio.h>
typedef FILE file_t, *file_p;
#define ZFILE ((file_t *)NULL)

#include <errno.h>
#include <ctype.h>

#include <strings.h>
#define indexc(s,c) index(s,c)
#define rindxc(s,c) rindex(s,c)

#include <sys/file.h>
#include <sys/stat.h>

#include <sys/dir.h>
#include <netinet/in.h>
typedef struct sockaddr_in sinaddr_t, *sinaddr_p;
#define ZSINADDR ((sinaddr_t *)NULL)

sinaddr_p serverbyname(/*hostname*/);

typedef struct in_addr inaddr_t, *inaddr_p;
#define ZINADDR ((inaddr_t *)NULL)

caddr_t inet_ntoa(/*inaddr_t*/);
caddr_t serverbyaddr(/*inaddr_t*/);

#define FSCK    "/etc/fsck","fsck","-p"

#define rawdev(_d_,_b_)	((char *)sprintf((_d_), "/dev/r%s", basename(_b_)))

#include <signal.h>
void signals_on();
void signals_off();

void alarmClock(/*seconds*/);
#ifdef _COMMON_C_
int handle_alarm();
#endif

void etype(/*fmt,args*/);	     /* a la printf() */
void panic(/*msg*/);

void common_debugOn();
void common_debugOff();

int isWorkstation();		     /* 0=no, else type-code */
int stricmp();			     /* case ignored strcmp() */

caddr_t strc2s(/*char*/);
caddr_t itoa(/*int*/);
caddr_t basename(/*path*/);
caddr_t indexs(/*string,pattern*/);
caddr_t uppers(/*string*/);

sinaddr_p in2sock(/*inaddr_t*/);

#endif
