]> git.sur5r.net Git - openldap/blob - include/ac/unistd.h
d62d3b86bde7dc8331091c13d7efc67d80001a30
[openldap] / include / ac / unistd.h
1 /* Generic unistd.h */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms are permitted only
8  * as authorized by the OpenLDAP Public License.  A copy of this
9  * license is available at http://www.OpenLDAP.org/license.html or
10  * in file LICENSE in the top-level directory of the distribution.
11  */
12
13 #ifndef _AC_UNISTD_H
14 #define _AC_UNISTD_H
15
16 #if HAVE_SYS_TYPES_H
17 #       include <sys/types.h>
18 #endif
19
20 #if HAVE_UNISTD_H
21 #       include <unistd.h>
22 #endif
23
24 /* note: callers of crypt(3) should include <ac/crypt.h> */
25
26 #ifdef __MINGW32__
27 #   undef LDAP_F_PRE
28 #   ifdef LIBLUTIL_DECL
29 #       define LDAP_F_PRE       extern __declspec(LIBLUTIL_DECL)
30 #   else
31 #       define LDAP_F_PRE       extern
32 #   endif
33 #endif
34
35 #ifndef HAVE_GETPASS
36 LDAP_F(char*)(getpass) LDAP_P((const char *getpass));
37 #else
38 LDAP_F(char*)(getpass)();
39 #endif
40
41 /* getopt() defines may be in separate include file */
42 #if HAVE_GETOPT_H
43 #       include <getopt.h>
44
45 #elif !defined(HAVE_GETOPT)
46         /* no getopt, assume we need getopt-compat.h */
47 #       include <getopt-compat.h>
48
49 #else
50         /* assume we need to declare these externs */
51         extern char *optarg;
52         extern int optind, opterr, optopt;
53 #endif
54
55 #ifndef HAVE_TEMPNAM
56         LDAP_F(char *)(tempnam) LDAP_P((
57                 const char *tmpdir,
58                 const char *prefix));
59 #endif
60
61 /* This is never even checked for or implemented if not present */
62 #if 0
63 #ifndef HAVE_MKTEMP
64         LDAP_F(char *)(mktemp) LDAP_P((char *));
65 #endif
66 #endif
67
68 /* use lutil file locking */
69 #define ldap_lockf(x)   lutil_lockf(x)
70 #define ldap_unlockf(x) lutil_unlockf(x)
71 #include <lutil_lockf.h>
72
73 #endif /* _AC_UNISTD_H */