/*
* Copyright (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
* Copyright (c) 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
#ifndef _PORTABLE_H
#define _PORTABLE_H
/*
* portable.h for LDAP -- this is where we define common stuff to make
* life easier on various Unix systems.
*
* Unless you are porting LDAP to a new platform, you should not need to
* edit this file.
*/
#ifndef SYSV
#define SYSV
#endif
#endif
/*
* under System V, use sysconf() instead of getdtablesize
*/
#if !defined( USE_SYSCONF ) && defined( SYSV )
#define USE_SYSCONF
#endif
/*
* under System V, daemons should use setsid() instead of detaching from their
* tty themselves
*/
#if !defined( USE_SETSID ) && defined( SYSV )
#define USE_SETSID
#endif
/*
* System V has socket options in filio.h
*/
#define NEED_FILIO
#endif
/*
* use lockf() under System V
*/
#define USE_LOCKF
#endif
/*
* on many systems, we should use waitpid() instead of waitN()
*/
#if !defined( USE_WAITPID ) && ( defined( SYSV ) || defined( sunos4 ) || defined( ultrix ) || defined( aix ))
#define USE_WAITPID
#endif
/*
* define the wait status argument type
*/
#else
#define WAITSTATUSTYPE int
#endif
/*
* define the flags for wait
*/
#ifdef sunos5
#else
#endif
/*
* defined the options for openlog (syslog)
*/
#ifdef ultrix
#else
#endif
/*
* some systems don't have the BSD re_comp and re_exec routines
*/
#ifndef NEED_BSDREGEX
#if ( defined( SYSV ) || defined( VMS ) || defined( netbsd ) || defined( freebsd ) || defined( linux )) && !defined(sgi)
#define NEED_BSDREGEX
#endif
#endif
/*
* many systems do not have the setpwfile() library routine... we just
* enable use for those systems we know have it.
*/
#ifndef HAVE_SETPWFILE
#define HAVE_SETPWFILE
#endif
#endif
/*
* Are sys_errlist and sys_nerr declared in stdio.h?
*/
#ifndef SYSERRLIST_IN_STDIO
#if defined( freebsd )
#define SYSERRLIST_IN_STDIO
#endif
#endif
/*
* Is snprintf() part of the standard C runtime library?
*/
#if !defined(HAVE_SNPRINTF)
#define HAVE_SNPRINTF
#endif
#endif
/*
* Async IO. Use a non blocking implementation of connect() and
* dns functions
*/
#if !defined(LDAP_ASYNC_IO)
#define LDAP_ASYNC_IO
#endif /* _WINDOWS */
#endif
/*
* for select()
*/
#else
#endif
#if !defined(FD_SET)
#endif /* !FD_SET */
#endif /* !WINSOCK && !_WINDOWS && !macintosh */
/*
* for connect() -- must we block signals when calling connect()? This
* is necessary on some buggy UNIXes.
*/
#if !defined(LDAP_CONNECT_MUST_NOT_BE_INTERRUPTED) && \
#endif
/*
* for signal() -- what do signal handling functions return?
*/
#ifndef SIG_FN
#ifdef sunos5
#else /* sunos5 */
# ifdef BSD
# if (BSD >= 199006) || defined(NeXT) || defined(OSF1) || defined(sun) || defined(ultrix) || defined(apollo) || defined(POSIX_SIGNALS)
# else
# endif
# else /* BSD */
# endif /* BSD */
#endif /* sunos5 */
#endif /* SIG_FN */
/*
* toupper and tolower macros are different under bsd and sys v
*/
#else
#endif
/*
* put a cover on the tty-related ioctl calls we need to use
*/
#define TERMFLAG_TYPE int
#else
#define USE_TERMIOS
#endif
( !defined( HAVE_TIME_R ))
#define HAVE_TIME_R
#endif
#define HAVE_GETPWNAM_R
#define HAVE_GETGRNAM_R
#endif
int strcasecmp(const char *, const char *);
#ifdef SNI
int strncasecmp(const char *, const char *, int);
#endif /* SNI */
#ifdef LINUX1_2
int strncasecmp(const char *, const char *, size_t);
#endif /* LINUX1_2 */
#endif /* SNI || LINUX1_2 */
#else /* UNIX */
/* Maybe this is for another version of AIX?
Commenting out for AIX 4.1 for Nova
Replaced with following to lines, stolen from the #else below
#define GETHOSTBYNAME_BUF_T struct hostent_data
*/
#define GETHOSTBYNAME( n, r, b, l, e ) \
#else
#include <stdio.h> /* BUFSIZ */
#endif
(defined(AIX) && !defined(USE_REENTRANT_LIBC))
#else
#endif
#else
#define HAVE_STRTOK_R
char *strtok_r(char *, const char *, char **);
#endif /* STRTOK */
#endif /* UNIX */
extern char *strdup();
#endif /* ultrix || nextstep */
#endif /* sunos4 || osf */
#endif
/*
* Define a portable type for IPv4 style Internet addresses (32 bits):
*/
#if ( defined(sunos5) && defined(_IN_ADDR_T)) || \
#else
typedef unsigned long nsldapi_in_addr_t;
#endif
#ifdef SUNOS4
int strcasecmp(char *, char *);
int strncasecmp(char *, char *, int);
void perror(char *);
int re_exec(char *);
int socket(int, int, int);
void bzero(char *, int);
unsigned long inet_addr(char *);
int getdtablesize();
#endif /* SUNOS4 */
/* #if defined(SUNOS4) || defined(SNI) */
#if defined(SUNOS4)
#endif /* SUNOS4 || SNI */
/*
* SAFEMEMCPY is an overlap-safe copy from s to d of n bytes
* This is moved to lber.h in Solaris
*/
#ifndef _SOLARIS_SDK
#ifdef macintosh
#else /* macintosh */
#ifdef sunos4
#else /* sunos4 */
#endif /* sunos4 */
#endif /* macintosh */
#endif /* ifndef _SOLARIS_SDK */
#ifdef _WINDOWS
#ifndef MAXPATHLEN
#endif
/* We'd like this number to be prime for the hash
* into the Connection table */
#include "dirent.h"
#include <string.h> /*for strcmpi()*/
#include <time.h> /*for ctime()*/
#endif /* XP_OS2 */
#endif /* _PORTABLE_H */