/*
* common.h
*
* Copyright (c) 1992 Sun Microsystems, Inc.
* Copyright (c) 1993 Zik Saleeba <zik@zikzak.apana.org.au>
*
* This header shared between the daemon and the client and
* contains the portability code.
* This implementation may be freely copied, modified, and
* redistributed, provided that this comment is retained.
*/
/* $Id: common.h,v 1.7 1993/10/08 18:44:10 zik Exp $ */
#define MESSAGE_SEP "\n---< MESSAGE FOLLOWS >---\n"
#define MSG_SEP (MESSAGE_SEP+1)
#include "config.h"
/*
* Include files
*/
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
#include <ctype.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/param.h>
#include <errno.h>
#ifdef NEW_HEADERS
#include <stdlib.h>
#endif
#ifdef USE_UTMPX
#include <utmpx.h>
#else
#include <utmp.h>
#endif
#ifdef USE_SOCKIO_H
#include <sys/sockio.h>
#else
#include <sys/ioctl.h>
#endif
#ifndef NO_SYS_FILE_H
#include <sys/file.h>
#endif
#ifdef USE_SYSTEMINFO
#include <sys/utsname.h>
#include <sys/systeminfo.h>
#endif
#ifdef NO_GETDTABLESIZE
#include <sys/select.h>
#endif
#ifdef BSD_SIGHANDLERS
#include <sys/wait.h>
#endif
#ifndef NO_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifdef USE_MEMORY_H
#include <memory.h>
#endif
#ifndef _PATH_UTMP
#ifndef UTMP_FILE
#define _PATH_UTMP "/etc/utmp"
#else
#define _PATH_UTMP UTMP_FILE
#endif
#endif
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 256
#endif
#endif
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
#endif
#define DEFAULT_DEST "console"
#define MAX_LOCK_FAILS 180
#ifndef NO_POSIX_MEMFUNCS
#define MEMCMP(d,s,l) memcmp(d,s,l)
#define MEMZERO(d,l) memset(d,'\0',l)
#define MEMSET(d,c,l) memset(d,c,l)
#define MEMCPY(d,s,l) memcpy(d,s,l)
#else
#define MEMCMP(d,s,l) bcmp(d,s,l)
#define MEMZERO(d,l) bzero(d,l)
#define MEMSET(d,c,l) compat_memset(d,c,l)
#define MEMCPY(d,s,l) bcopy(s,d,l)
#endif
#ifndef NO_POSIX_STRFUNCS
#define STRCHR(s,c) strchr(s,c)
#define STRSTR(d,s) strstr(d,s)
#else
#define STRCHR(s,c) index(s,c)
#define STRSTR(d,s) compat_strstr(d,s)
#endif
#ifndef NO_STRCASECMP
#define STRCASECMP(a,b) strcasecmp(a,b)
#define STRNCASECMP(a,b,n) strncasecmp(a,b,n)
#else
#define STRCASECMP(a,b) compat_strcasecmp(a,b)
#define STRNCASECMP(a,b,n) compat_strncasecmp(a,b,n)
#endif
#ifdef SECURE
#define BIND(a,b,c) bindresvport(a,b,c)
#else
#define BIND(a,b,c) bind(a,b,c)
#endif
syntax highlighted by Code2HTML, v. 0.9.1