From 2a869f5a99f537b246ba8640502e2a86117cb6e8 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 25 Oct 1998 01:41:42 +0000 Subject: [PATCH] merged with autoconf branch --- COPYRIGHT | 19 +- INSTALL | 135 +- Make-common.dist | 298 - Make-common.gmake | 343 - Makefile | 425 -- Makefile.in | 31 + README | 42 +- acconfig.h | 138 + aclocal.m4 | 395 + build/Make-append | 96 - build/README-unproto | 3 - build/dir.mk | 47 + build/info.mk | 6 + build/lib.mk | 42 + build/man.mk | 45 + build/platforms/Make-setup | 68 - build/platforms/Makefile | 46 - build/platforms/aix-cc/Make-platform | 18 - build/platforms/aix-gcc/Make-platform | 19 - build/platforms/hpux-c89/Make-platform | 27 - build/platforms/hpux-cc/Make-platform | 33 - build/platforms/hpux-gcc/Make-platform | 28 - build/platforms/irix-cc/Make-platform | 29 - build/platforms/irix-gcc/Make-platform | 29 - build/platforms/ncr-mp-ras-2-cc/Make-platform | 34 - build/platforms/netbsd-cc/Make-platform | 17 - build/platforms/netbsd-gcc/Make-platform | 16 - build/platforms/nextstep-cc/Make-platform | 15 - build/platforms/openbsd-cc/Make-platform | 33 - build/platforms/openbsd-gcc/Make-platform | 34 - build/platforms/osf1-cc/Make-platform | 24 - build/platforms/osf1-gcc/Make-platform | 25 - build/platforms/sco-cc/Make-platform | 23 - build/platforms/sco-gcc/Make-platform | 22 - build/platforms/sunos4-cc/Make-platform | 25 - build/platforms/sunos4-gcc/Make-platform | 19 - build/platforms/sunos5-cc/Make-platform | 29 - build/platforms/sunos5-gcc/Make-platform | 28 - build/platforms/sunos56-cc/Make-platform | 29 - build/platforms/sunos56-gcc/Make-platform | 28 - build/platforms/ultrix-cc/Make-platform | 16 - build/platforms/ultrix-gcc/Make-platform | 16 - build/platforms/vms/Makefile | 31 - build/platforms/vms/make.com | 95 - build/rules.mk | 28 + build/srv.mk | 73 + build/top.mk | 108 + build/uname.sh | 109 - build/unproto/Makefile | 123 - build/unproto/README | 160 - build/unproto/acc.sh | 35 - build/unproto/cpp.sh | 35 - build/unproto/error.c | 97 - build/unproto/error.h | 6 - build/unproto/example.c | 222 - build/unproto/example.out | 271 - build/unproto/hash.c | 54 - build/unproto/stdarg.h | 90 - build/unproto/stddef.h | 23 - build/unproto/stdlib.h | 53 - build/unproto/strsave.c | 71 - build/unproto/symbol.c | 144 - build/unproto/symbol.h | 11 - build/unproto/tok_class.c | 432 -- build/unproto/tok_io.c | 612 -- build/unproto/tok_pool.c | 103 - build/unproto/token.h | 55 - build/unproto/unproto.1 | 152 - build/unproto/unproto.c | 999 --- build/unproto/varargs.c | 32 - build/unproto/vstring.c | 122 - build/unproto/vstring.h | 15 - build/version | 2 +- clients/Make-template | 84 - clients/Makefile.in | 6 + clients/fax500/Make-template | 77 - clients/fax500/Makefile.in | 40 + clients/fax500/faxtotpc.c | 10 +- clients/fax500/main.c | 29 +- clients/fax500/rp500.c | 20 +- clients/fax500/xrpcomp | 2 +- clients/finger/Make-template | 62 - clients/finger/Makefile.in | 22 + clients/finger/main.c | 36 +- clients/gopher/Make-template | 79 - clients/gopher/Makefile.in | 42 + clients/gopher/detach.c | 26 +- clients/gopher/go500.c | 67 +- clients/gopher/go500gw.c | 72 +- clients/gopher/setproctitle.c | 2 + clients/mail500/Make-template | 61 - clients/mail500/Makefile.in | 23 + clients/mail500/main.c | 31 +- clients/rcpt500/Make-template | 60 - clients/rcpt500/Makefile.in | 25 + clients/rcpt500/cmds.c | 4 +- clients/rcpt500/help.c | 11 +- clients/rcpt500/main.c | 27 +- clients/rcpt500/query.c | 37 +- clients/rcpt500/rcpt500.h | 14 +- clients/tools/Make-template | 105 - clients/tools/Makefile.in | 70 + clients/tools/ldapdelete.c | 20 +- clients/tools/ldapdelete.dsp | 91 + clients/tools/ldapdelete.dsw | 74 + clients/tools/ldapmodify.c | 62 +- clients/tools/ldapmodify.dsp | 91 + clients/tools/ldapmodify.dsw | 89 + clients/tools/ldapmodrdn.c | 26 +- clients/tools/ldapmodrdn.dsp | 91 + clients/tools/ldapmodrdn.dsw | 74 + clients/tools/ldapsearch.c | 64 +- clients/tools/ldapsearch.dsp | 91 + clients/tools/ldapsearch.dsw | 89 + clients/ud/Make-template | 78 - clients/ud/Makefile.in | 28 + clients/ud/auth.c | 57 +- clients/ud/edit.c | 31 +- clients/ud/find.c | 12 +- clients/ud/globals.c | 4 +- clients/ud/group.c | 11 +- clients/ud/help.c | 9 +- clients/ud/main.c | 85 +- clients/ud/mod.c | 22 +- clients/ud/print.c | 23 +- clients/ud/string_to_key.c | 28 +- clients/ud/ud.h | 13 +- clients/ud/util.c | 50 +- configure | 6655 +++++++++++++++++ configure.in | 917 +++ contrib/saucer/Make-template | 54 - doc/Make-template | 95 - doc/Makefile.in | 6 + doc/guides/Make-template | 29 - doc/man/Make-template | 84 - doc/man/Makefile.in | 6 + doc/man/man1/Make-template | 56 - doc/man/man1/Makefile.in | 6 + doc/man/man1/ldapdelete.1 | 7 +- doc/man/man1/ldapmodify.1 | 7 +- doc/man/man1/ldapmodrdn.1 | 7 +- doc/man/man1/ldapsearch.1 | 7 +- doc/man/man1/ud.1 | 7 +- doc/man/man3/Make-template | 56 - doc/man/man3/Makefile.in | 6 + doc/man/man3/cldap_close.3 | 7 +- doc/man/man3/cldap_open.3 | 7 +- doc/man/man3/cldap_search_s.3 | 7 +- doc/man/man3/cldap_setretryinfo.3 | 7 +- doc/man/man3/lber-decode.3 | 7 +- doc/man/man3/lber-encode.3 | 7 +- doc/man/man3/ldap.3 | 7 +- doc/man/man3/ldap_abandon.3 | 7 +- doc/man/man3/ldap_add.3 | 7 +- doc/man/man3/ldap_bind.3 | 7 +- doc/man/man3/ldap_cache.3 | 7 +- doc/man/man3/ldap_charset.3 | 7 +- doc/man/man3/ldap_compare.3 | 7 +- doc/man/man3/ldap_delete.3 | 7 +- doc/man/man3/ldap_disptmpl.3 | 7 +- doc/man/man3/ldap_entry2text.3 | 7 +- doc/man/man3/ldap_error.3 | 7 +- doc/man/man3/ldap_first_attribute.3 | 7 +- doc/man/man3/ldap_first_entry.3 | 7 +- doc/man/man3/ldap_friendly.3 | 7 +- doc/man/man3/ldap_get_dn.3 | 7 +- doc/man/man3/ldap_get_values.3 | 7 +- doc/man/man3/ldap_getfilter.3 | 7 +- doc/man/man3/ldap_modify.3 | 7 +- doc/man/man3/ldap_modrdn.3 | 7 +- doc/man/man3/ldap_open.3 | 7 +- doc/man/man3/ldap_result.3 | 7 +- doc/man/man3/ldap_search.3 | 7 +- doc/man/man3/ldap_searchprefs.3 | 7 +- doc/man/man3/ldap_sort.3 | 7 +- doc/man/man3/ldap_ufn.3 | 7 +- doc/man/man3/ldap_url.3 | 7 +- doc/man/man3/regex.3 | 326 - doc/man/man5/Make-template | 56 - doc/man/man5/Makefile.in | 6 + doc/man/man5/ldapfilter.conf.5 | 7 +- doc/man/man5/ldapfriendly.5 | 7 +- doc/man/man5/ldapsearchprefs.conf.5 | 7 +- doc/man/man5/ldaptemplates.conf.5 | 7 +- doc/man/man5/ldif.5 | 7 +- doc/man/man5/slapd.conf.5 | 7 +- doc/man/man5/slapd.replog.5 | 7 +- doc/man/man5/ud.conf.5 | 7 +- doc/man/man8/Make-template | 56 - doc/man/man8/Makefile.in | 6 + doc/man/man8/centipede.8 | 7 +- doc/man/man8/chlog2replog.8 | 7 +- doc/man/man8/edb2ldif.8 | 7 +- doc/man/man8/go500.8 | 7 +- doc/man/man8/go500gw.8 | 7 +- doc/man/man8/in.xfingerd.8 | 7 +- doc/man/man8/ldapd.8 | 7 +- doc/man/man8/ldbmcat.8 | 7 +- doc/man/man8/ldif.8 | 7 +- doc/man/man8/ldif2ldbm.8 | 7 +- doc/man/man8/mail500.8 | 7 +- doc/man/man8/rcpt500.8 | 7 +- doc/man/man8/slapd.8 | 7 +- doc/man/man8/slurpd.8 | 7 +- doc/rfc/Make-template | 29 - include/Make-template | 71 - include/Makefile.in | 49 + include/ac/alloca.h | 24 + include/ac/ctype.h | 16 + include/ac/dirent.h | 23 + include/ac/errno.h | 19 + include/ac/krb.h | 21 + include/ac/regex.h | 23 + include/ac/signal.h | 14 + include/ac/socket.h | 100 + include/ac/string.h | 34 + include/ac/syslog.h | 23 + include/ac/termios.h | 32 + include/ac/time.h | 15 + include/ac/unistd.h | 26 + include/ac/wait.h | 25 + include/avl.h | 46 +- include/disptmpl.h | 144 +- include/getopt-compat.h | 14 + include/lber.h | 129 +- include/ldap.h | 360 +- include/ldap_cdefs.h | 36 + include/ldapconfig.h.edit | 28 +- include/ldapconfig.h.nt | 302 + include/ldbm.h | 113 +- include/ldif.h | 26 +- include/lthread.h | 209 +- include/lthread_rdwr.h | 22 +- include/lutil.h | 10 +- include/lutil_md5.h | 35 +- include/lutil_sha1.h | 40 +- include/portable.h | 206 - include/portable.h.bot | 8 + include/portable.h.in | 464 ++ include/portable.h.nt | 485 ++ include/portable.h.top | 32 + include/proto-lber.h | 102 - include/proto-ldap.h | 276 - include/srchpref.h | 45 +- libraries/Make-template | 86 - libraries/Makefile.in | 7 + libraries/libavl/Make-template | 65 - libraries/libavl/Makefile.in | 15 + libraries/libavl/avl.c | 23 +- libraries/libavl/libavl.dsp | 86 + libraries/libavl/libavl.dsw | 29 + libraries/libavl/testavl.c | 35 +- libraries/libavl/testavl.dsp | 87 + libraries/libavl/testavl.dsw | 44 + libraries/liblber/Make-template | 76 - libraries/liblber/Makefile.in | 18 + libraries/liblber/bprint.c | 27 +- libraries/liblber/decode.c | 71 +- libraries/liblber/dtest.c | 23 +- libraries/liblber/dtest.dsp | 89 + libraries/liblber/dtest.dsw | 44 + libraries/liblber/encode.c | 97 +- libraries/liblber/etest.c | 35 +- libraries/liblber/etest.dsp | 89 + libraries/liblber/etest.dsw | 44 + libraries/liblber/idtest.c | 2 + libraries/liblber/idtest.dsp | 89 + libraries/liblber/idtest.dsw | 44 + libraries/liblber/io.c | 83 +- libraries/liblber/liblber.dsp | 98 + libraries/liblber/liblber.dsw | 29 + libraries/libldap/Make-template | 94 - libraries/libldap/Makefile.in | 45 + libraries/libldap/abandon.c | 34 +- libraries/libldap/add.c | 21 +- libraries/libldap/addentry.c | 20 +- libraries/libldap/bind.c | 27 +- libraries/libldap/cache.c | 84 +- libraries/libldap/charset.c | 40 +- libraries/libldap/cldap.c | 56 +- libraries/libldap/compare.c | 18 +- libraries/libldap/delete.c | 18 +- libraries/libldap/disptmpl.c | 42 +- libraries/libldap/dsparse.c | 37 +- libraries/libldap/error.c | 17 +- libraries/libldap/free.c | 20 +- libraries/libldap/friendly.c | 26 +- libraries/libldap/getattr.c | 20 +- libraries/libldap/getdn.c | 35 +- libraries/libldap/getdxbyname.c | 44 +- libraries/libldap/getentry.c | 20 +- libraries/libldap/getfilter.c | 63 +- libraries/libldap/getvalues.c | 19 +- libraries/libldap/kbind.c | 43 +- libraries/libldap/ldap-int.h | 104 +- libraries/libldap/libldap.dsp | 218 + libraries/libldap/libldap.dsw | 29 + libraries/libldap/ltest.dsp | 87 + libraries/libldap/ltest.dsw | 74 + libraries/libldap/modify.c | 14 +- libraries/libldap/modrdn.c | 14 +- libraries/libldbm/Makefile.in | 16 + libraries/libldif/Makefile.in | 11 + libraries/liblthread/Makefile.in | 15 + libraries/liblutil/Makefile.in | 11 + libraries/msdos/winsock/include/file.h | 4 - libraries/msdos/winsock/include/filio.h | 4 - libraries/msdos/winsock/include/in.h | 4 - libraries/msdos/winsock/include/ioctl.h | 4 - libraries/msdos/winsock/include/krb/des.h | 59 - libraries/msdos/winsock/include/krb/krb.h | 500 -- .../winsock/include/krb/mit/arpa/nameser.h | 257 - .../msdos/winsock/include/krb/mit/conf-pc.h | 76 - .../msdos/winsock/include/krb/mit/conf.h | 77 - .../msdos/winsock/include/krb/mit/hesiod.h | 110 - .../msdos/winsock/include/krb/mit/lsh_pwd.h | 56 - .../msdos/winsock/include/krb/mit/mit_copy.h | 22 - .../msdos/winsock/include/krb/mit/osconf.h | 59 - .../msdos/winsock/include/krb/mit/resolv.h | 144 - .../msdos/winsock/include/krb/mit/wshelper.h | 62 - .../msdos/winsock/include/net/_sys/filio.h | 4 - .../msdos/winsock/include/net/_sys/ioctl.h | 4 - libraries/msdos/winsock/include/net/netdb.h | 4 - libraries/msdos/winsock/include/param.h | 4 - libraries/msdos/winsock/include/select.h | 4 - libraries/msdos/winsock/include/socket.h | 4 - libraries/msdos/winsock/include/time.h | 4 - libraries/msdos/winsock/include/wsa.h | 132 - libraries/msdos/winsock/include/wsa/errno.c | 21 - libraries/msdos/winsock/include/wsa/errno.rc | 57 - .../msdos/winsock/include/wsa/winsock.def | 84 - libraries/msdos/winsock/include/wsa/winsock.h | 906 --- libraries/msdos/winsock/ltest/console.c | 257 - libraries/msdos/winsock/ltest/console.h | 19 - libraries/msdos/winsock/ltest/inpdlg.dlg | 14 - libraries/msdos/winsock/ltest/inpdlg.h | 1 - libraries/msdos/winsock/ltest/ltest.def | 9 - libraries/msdos/winsock/ltest/ltest.mak | 140 - libraries/msdos/winsock/ltest/ltest.rc | 22 - libraries/msdos/winsock/ltest/ltest32.mak | 348 - libraries/msdos/winsock/ltest/ltest32.mdp | Bin 37376 -> 0 bytes libraries/msdos/winsock/ltest/textwind.c | 130 - libraries/msdos/winsock/ltest/textwind.h | 13 - libraries/msdos/winsock/winkit/readme.txt | 182 - libraries/msdos/winsock/winkit/windowskit.cmd | 1 - libraries/msdos/winsock/winkit/windowskit.mak | 172 - libraries/msdos/winsock/wsa/errno.c | 21 - libraries/msdos/winsock/wsa/errno.rc | 57 - libraries/msdos/winsock/wsa/winsock.def | 84 - libraries/msdos/winsock/wsa/winsock.h | 826 -- libraries/vms/Make-template | 48 - libraries/vms/README.VMS | 16 - libraries/vms/getopt.c | 106 - libraries/vms/strings.c | 97 - libraries/vms/ucx_select.h | 28 - servers/Make-template | 88 - servers/Makefile.in | 7 + servers/ldapd/Makefile.in | 51 + servers/ldapd/abandon.c | 8 +- servers/ldapd/add.c | 9 +- servers/ldapd/association.c | 23 +- servers/ldapd/bind.c | 32 +- servers/ldapd/certificate.c | 13 +- servers/ldapd/common.h | 24 +- servers/ldapd/compare.c | 10 +- servers/ldapd/delete.c | 10 +- servers/ldapd/detach.c | 29 +- servers/ldapd/error.c | 10 +- servers/ldapd/kerberos.c | 18 +- servers/ldapd/main.c | 108 +- servers/ldapd/message.c | 21 +- servers/ldapd/modify.c | 12 +- servers/ldapd/modrdn.c | 10 +- servers/ldapd/proto-ldapd.h | 134 +- servers/ldapd/request.c | 67 +- servers/ldapd/result.c | 39 +- servers/ldapd/search.c | 94 +- servers/ldapd/setproctitle.c | 2 + servers/ldapd/syntax.c | 18 +- servers/ldapd/util.c | 15 +- servers/slapd/Makefile.in | 112 + servers/slapd/abandon.c | 6 +- servers/slapd/acl.c | 16 +- servers/slapd/aclparse.c | 19 +- servers/slapd/add.c | 11 +- servers/slapd/attr.c | 23 +- servers/slapd/ava.c | 9 +- servers/slapd/back-ldbm/Makefile.in | 36 + servers/slapd/back-ldbm/abandon.c | 2 + servers/slapd/back-ldbm/add.c | 9 +- servers/slapd/back-ldbm/attr.c | 11 +- servers/slapd/back-ldbm/back-ldbm.h | 8 +- servers/slapd/back-ldbm/bind.c | 68 +- servers/slapd/back-ldbm/cache.c | 42 +- servers/slapd/back-ldbm/close.c | 7 +- servers/slapd/back-ldbm/compare.c | 9 +- servers/slapd/back-ldbm/config.c | 9 +- servers/slapd/back-ldbm/dbcache.c | 27 +- servers/slapd/back-ldbm/delete.c | 9 +- servers/slapd/back-ldbm/dn2id.c | 15 +- servers/slapd/back-ldbm/filterindex.c | 9 +- servers/slapd/back-ldbm/group.c | 13 +- servers/slapd/back-ldbm/id2children.c | 11 +- servers/slapd/back-ldbm/id2entry.c | 13 +- servers/slapd/back-ldbm/idl.c | 18 +- servers/slapd/back-ldbm/index.c | 13 +- servers/slapd/back-ldbm/init.c | 17 +- servers/slapd/back-ldbm/kerberos.c | 19 +- servers/slapd/back-ldbm/modify.c | 9 +- servers/slapd/back-ldbm/modrdn.c | 9 +- servers/slapd/back-ldbm/nextid.c | 10 +- servers/slapd/back-ldbm/proto-back-ldbm.h | 115 +- servers/slapd/back-ldbm/search.c | 9 +- servers/slapd/back-ldbm/unbind.c | 7 +- servers/slapd/back-passwd/Makefile.in | 28 + servers/slapd/back-passwd/config.c | 12 +- servers/slapd/back-passwd/search.c | 13 +- servers/slapd/back-shell/Makefile.in | 30 + servers/slapd/back-shell/abandon.c | 9 +- servers/slapd/back-shell/add.c | 9 +- servers/slapd/back-shell/bind.c | 9 +- servers/slapd/back-shell/compare.c | 9 +- servers/slapd/back-shell/config.c | 9 +- servers/slapd/back-shell/delete.c | 9 +- servers/slapd/back-shell/fork.c | 9 +- servers/slapd/back-shell/init.c | 7 +- servers/slapd/back-shell/modify.c | 9 +- servers/slapd/back-shell/modrdn.c | 9 +- servers/slapd/back-shell/result.c | 9 +- servers/slapd/back-shell/search.c | 9 +- servers/slapd/back-shell/shell.h | 11 + servers/slapd/back-shell/unbind.c | 9 +- servers/slapd/backend.c | 30 +- servers/slapd/bind.c | 15 +- servers/slapd/ch_malloc.c | 8 +- servers/slapd/charray.c | 9 +- servers/slapd/compare.c | 7 +- servers/slapd/config.c | 9 +- servers/slapd/configinfo.c | 9 +- servers/slapd/connection.c | 38 +- servers/slapd/daemon.c | 98 +- servers/slapd/delete.c | 9 +- servers/slapd/detach.c | 32 +- servers/slapd/dn.c | 14 +- servers/slapd/entry.c | 11 +- servers/slapd/filter.c | 23 +- servers/slapd/filterentry.c | 11 +- servers/slapd/init.c | 14 +- servers/slapd/lock.c | 26 +- servers/slapd/main.c | 27 +- servers/slapd/modify.c | 12 +- servers/slapd/modrdn.c | 9 +- servers/slapd/monitor.c | 13 +- servers/slapd/operation.c | 9 +- servers/slapd/phonetic.c | 20 +- servers/slapd/proto-slap.h | 184 +- servers/slapd/repl.c | 12 +- servers/slapd/result.c | 37 +- servers/slapd/schema.c | 9 +- servers/slapd/schemaparse.c | 9 +- servers/slapd/search.c | 9 +- servers/slapd/shell-backends/Make-template | 62 - servers/slapd/shell-backends/Makefile.in | 24 + servers/slapd/shell-backends/passwd-shell.c | 20 +- servers/slapd/shell-backends/shellutil.c | 46 +- servers/slapd/shell-backends/shellutil.h | 11 +- servers/slapd/slap.h | 23 +- servers/slapd/slapd.conf | 4 +- servers/slapd/str2filter.c | 9 +- servers/slapd/strdup.c | 18 - servers/slapd/tempnam.c | 38 - servers/slapd/tools/Makefile.in | 154 + servers/slapd/tools/centipede.c | 35 +- servers/slapd/tools/chlog2replog.c | 7 +- servers/slapd/tools/edb2ldif.c | 10 +- servers/slapd/tools/ldapsyntax.c | 8 +- servers/slapd/tools/ldapsyntax.h | 16 +- servers/slapd/tools/ldbmcat.c | 15 +- servers/slapd/tools/ldbmtest.c | 39 +- servers/slapd/tools/ldif.c | 10 +- servers/slapd/tools/ldif2id2children.c | 9 +- servers/slapd/tools/ldif2id2entry.c | 9 +- servers/slapd/tools/ldif2index.c | 9 +- servers/slapd/tools/ldif2ldbm.c | 10 +- servers/slapd/tools/sizecount.c | 2 + servers/slapd/unbind.c | 7 +- servers/slapd/value.c | 18 +- servers/slurpd/Make-template | 81 - servers/slurpd/Makefile.in | 38 + servers/slurpd/admin.c | 8 +- servers/slurpd/args.c | 19 +- servers/slurpd/ch_malloc.c | 7 +- servers/slurpd/config.c | 32 +- servers/slurpd/detach.c | 31 +- servers/slurpd/fm.c | 85 +- servers/slurpd/globals.c | 10 +- servers/slurpd/globals.h | 14 +- servers/slurpd/ldap_op.c | 66 +- servers/slurpd/lock.c | 34 +- servers/slurpd/main.c | 49 +- servers/slurpd/re.c | 33 +- servers/slurpd/reject.c | 11 +- servers/slurpd/replica.c | 12 +- servers/slurpd/replog.c | 36 +- servers/slurpd/ri.c | 36 +- servers/slurpd/rq.c | 29 +- servers/slurpd/sanity.c | 14 +- servers/slurpd/slurp.h | 29 +- servers/slurpd/st.c | 10 +- servers/slurpd/tsleep.c | 8 +- tests/Make-template | 37 - tests/Makefile.in | 27 + 512 files changed, 16781 insertions(+), 17334 deletions(-) delete mode 100644 Make-common.dist delete mode 100644 Make-common.gmake delete mode 100644 Makefile create mode 100644 Makefile.in create mode 100644 acconfig.h create mode 100644 aclocal.m4 delete mode 100644 build/Make-append delete mode 100644 build/README-unproto create mode 100644 build/dir.mk create mode 100644 build/info.mk create mode 100644 build/lib.mk create mode 100644 build/man.mk delete mode 100644 build/platforms/Make-setup delete mode 100644 build/platforms/Makefile delete mode 100644 build/platforms/aix-cc/Make-platform delete mode 100644 build/platforms/aix-gcc/Make-platform delete mode 100644 build/platforms/hpux-c89/Make-platform delete mode 100644 build/platforms/hpux-cc/Make-platform delete mode 100644 build/platforms/hpux-gcc/Make-platform delete mode 100644 build/platforms/irix-cc/Make-platform delete mode 100644 build/platforms/irix-gcc/Make-platform delete mode 100644 build/platforms/ncr-mp-ras-2-cc/Make-platform delete mode 100644 build/platforms/netbsd-cc/Make-platform delete mode 100644 build/platforms/netbsd-gcc/Make-platform delete mode 100644 build/platforms/nextstep-cc/Make-platform delete mode 100644 build/platforms/openbsd-cc/Make-platform delete mode 100644 build/platforms/openbsd-gcc/Make-platform delete mode 100644 build/platforms/osf1-cc/Make-platform delete mode 100644 build/platforms/osf1-gcc/Make-platform delete mode 100644 build/platforms/sco-cc/Make-platform delete mode 100644 build/platforms/sco-gcc/Make-platform delete mode 100644 build/platforms/sunos4-cc/Make-platform delete mode 100644 build/platforms/sunos4-gcc/Make-platform delete mode 100644 build/platforms/sunos5-cc/Make-platform delete mode 100644 build/platforms/sunos5-gcc/Make-platform delete mode 100644 build/platforms/sunos56-cc/Make-platform delete mode 100644 build/platforms/sunos56-gcc/Make-platform delete mode 100644 build/platforms/ultrix-cc/Make-platform delete mode 100644 build/platforms/ultrix-gcc/Make-platform delete mode 100644 build/platforms/vms/Makefile delete mode 100644 build/platforms/vms/make.com create mode 100644 build/rules.mk create mode 100644 build/srv.mk create mode 100644 build/top.mk delete mode 100644 build/uname.sh delete mode 100644 build/unproto/Makefile delete mode 100644 build/unproto/README delete mode 100755 build/unproto/acc.sh delete mode 100755 build/unproto/cpp.sh delete mode 100644 build/unproto/error.c delete mode 100644 build/unproto/error.h delete mode 100644 build/unproto/example.c delete mode 100644 build/unproto/example.out delete mode 100644 build/unproto/hash.c delete mode 100644 build/unproto/stdarg.h delete mode 100644 build/unproto/stddef.h delete mode 100644 build/unproto/stdlib.h delete mode 100644 build/unproto/strsave.c delete mode 100644 build/unproto/symbol.c delete mode 100644 build/unproto/symbol.h delete mode 100644 build/unproto/tok_class.c delete mode 100644 build/unproto/tok_io.c delete mode 100644 build/unproto/tok_pool.c delete mode 100644 build/unproto/token.h delete mode 100644 build/unproto/unproto.1 delete mode 100644 build/unproto/unproto.c delete mode 100644 build/unproto/varargs.c delete mode 100644 build/unproto/vstring.c delete mode 100644 build/unproto/vstring.h delete mode 100644 clients/Make-template create mode 100644 clients/Makefile.in delete mode 100644 clients/fax500/Make-template create mode 100644 clients/fax500/Makefile.in delete mode 100644 clients/finger/Make-template create mode 100644 clients/finger/Makefile.in delete mode 100644 clients/gopher/Make-template create mode 100644 clients/gopher/Makefile.in delete mode 100644 clients/mail500/Make-template create mode 100644 clients/mail500/Makefile.in delete mode 100644 clients/rcpt500/Make-template create mode 100644 clients/rcpt500/Makefile.in delete mode 100644 clients/tools/Make-template create mode 100644 clients/tools/Makefile.in create mode 100644 clients/tools/ldapdelete.dsp create mode 100644 clients/tools/ldapdelete.dsw create mode 100644 clients/tools/ldapmodify.dsp create mode 100644 clients/tools/ldapmodify.dsw create mode 100644 clients/tools/ldapmodrdn.dsp create mode 100644 clients/tools/ldapmodrdn.dsw create mode 100644 clients/tools/ldapsearch.dsp create mode 100644 clients/tools/ldapsearch.dsw delete mode 100644 clients/ud/Make-template create mode 100644 clients/ud/Makefile.in create mode 100755 configure create mode 100644 configure.in delete mode 100644 contrib/saucer/Make-template delete mode 100644 doc/Make-template create mode 100644 doc/Makefile.in delete mode 100644 doc/guides/Make-template delete mode 100644 doc/man/Make-template create mode 100644 doc/man/Makefile.in delete mode 100644 doc/man/man1/Make-template create mode 100644 doc/man/man1/Makefile.in delete mode 100644 doc/man/man3/Make-template create mode 100644 doc/man/man3/Makefile.in delete mode 100644 doc/man/man3/regex.3 delete mode 100644 doc/man/man5/Make-template create mode 100644 doc/man/man5/Makefile.in delete mode 100644 doc/man/man8/Make-template create mode 100644 doc/man/man8/Makefile.in delete mode 100644 doc/rfc/Make-template delete mode 100644 include/Make-template create mode 100644 include/Makefile.in create mode 100644 include/ac/alloca.h create mode 100644 include/ac/ctype.h create mode 100644 include/ac/dirent.h create mode 100644 include/ac/errno.h create mode 100644 include/ac/krb.h create mode 100644 include/ac/regex.h create mode 100644 include/ac/signal.h create mode 100644 include/ac/socket.h create mode 100644 include/ac/string.h create mode 100644 include/ac/syslog.h create mode 100644 include/ac/termios.h create mode 100644 include/ac/time.h create mode 100644 include/ac/unistd.h create mode 100644 include/ac/wait.h create mode 100644 include/getopt-compat.h create mode 100644 include/ldap_cdefs.h create mode 100644 include/ldapconfig.h.nt delete mode 100644 include/portable.h create mode 100644 include/portable.h.bot create mode 100644 include/portable.h.in create mode 100644 include/portable.h.nt create mode 100644 include/portable.h.top delete mode 100644 include/proto-lber.h delete mode 100644 include/proto-ldap.h delete mode 100644 libraries/Make-template create mode 100644 libraries/Makefile.in delete mode 100644 libraries/libavl/Make-template create mode 100644 libraries/libavl/Makefile.in create mode 100644 libraries/libavl/libavl.dsp create mode 100644 libraries/libavl/libavl.dsw create mode 100644 libraries/libavl/testavl.dsp create mode 100644 libraries/libavl/testavl.dsw delete mode 100644 libraries/liblber/Make-template create mode 100644 libraries/liblber/Makefile.in create mode 100644 libraries/liblber/dtest.dsp create mode 100644 libraries/liblber/dtest.dsw create mode 100644 libraries/liblber/etest.dsp create mode 100644 libraries/liblber/etest.dsw create mode 100644 libraries/liblber/idtest.dsp create mode 100644 libraries/liblber/idtest.dsw create mode 100644 libraries/liblber/liblber.dsp create mode 100644 libraries/liblber/liblber.dsw delete mode 100644 libraries/libldap/Make-template create mode 100644 libraries/libldap/Makefile.in create mode 100644 libraries/libldap/libldap.dsp create mode 100644 libraries/libldap/libldap.dsw create mode 100644 libraries/libldap/ltest.dsp create mode 100644 libraries/libldap/ltest.dsw create mode 100644 libraries/libldbm/Makefile.in create mode 100644 libraries/libldif/Makefile.in create mode 100644 libraries/liblthread/Makefile.in create mode 100644 libraries/liblutil/Makefile.in delete mode 100644 libraries/msdos/winsock/include/file.h delete mode 100644 libraries/msdos/winsock/include/filio.h delete mode 100644 libraries/msdos/winsock/include/in.h delete mode 100644 libraries/msdos/winsock/include/ioctl.h delete mode 100644 libraries/msdos/winsock/include/krb/des.h delete mode 100644 libraries/msdos/winsock/include/krb/krb.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/arpa/nameser.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/conf-pc.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/conf.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/hesiod.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/lsh_pwd.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/mit_copy.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/osconf.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/resolv.h delete mode 100644 libraries/msdos/winsock/include/krb/mit/wshelper.h delete mode 100644 libraries/msdos/winsock/include/net/_sys/filio.h delete mode 100644 libraries/msdos/winsock/include/net/_sys/ioctl.h delete mode 100644 libraries/msdos/winsock/include/net/netdb.h delete mode 100644 libraries/msdos/winsock/include/param.h delete mode 100644 libraries/msdos/winsock/include/select.h delete mode 100644 libraries/msdos/winsock/include/socket.h delete mode 100644 libraries/msdos/winsock/include/time.h delete mode 100644 libraries/msdos/winsock/include/wsa.h delete mode 100644 libraries/msdos/winsock/include/wsa/errno.c delete mode 100644 libraries/msdos/winsock/include/wsa/errno.rc delete mode 100644 libraries/msdos/winsock/include/wsa/winsock.def delete mode 100644 libraries/msdos/winsock/include/wsa/winsock.h delete mode 100644 libraries/msdos/winsock/ltest/console.c delete mode 100644 libraries/msdos/winsock/ltest/console.h delete mode 100644 libraries/msdos/winsock/ltest/inpdlg.dlg delete mode 100644 libraries/msdos/winsock/ltest/inpdlg.h delete mode 100644 libraries/msdos/winsock/ltest/ltest.def delete mode 100644 libraries/msdos/winsock/ltest/ltest.mak delete mode 100644 libraries/msdos/winsock/ltest/ltest.rc delete mode 100644 libraries/msdos/winsock/ltest/ltest32.mak delete mode 100644 libraries/msdos/winsock/ltest/ltest32.mdp delete mode 100644 libraries/msdos/winsock/ltest/textwind.c delete mode 100644 libraries/msdos/winsock/ltest/textwind.h delete mode 100644 libraries/msdos/winsock/winkit/readme.txt delete mode 100644 libraries/msdos/winsock/winkit/windowskit.cmd delete mode 100644 libraries/msdos/winsock/winkit/windowskit.mak delete mode 100644 libraries/msdos/winsock/wsa/errno.c delete mode 100644 libraries/msdos/winsock/wsa/errno.rc delete mode 100644 libraries/msdos/winsock/wsa/winsock.def delete mode 100644 libraries/msdos/winsock/wsa/winsock.h delete mode 100644 libraries/vms/Make-template delete mode 100644 libraries/vms/README.VMS delete mode 100644 libraries/vms/getopt.c delete mode 100644 libraries/vms/strings.c delete mode 100644 libraries/vms/ucx_select.h delete mode 100644 servers/Make-template create mode 100644 servers/Makefile.in create mode 100644 servers/ldapd/Makefile.in create mode 100644 servers/slapd/Makefile.in create mode 100644 servers/slapd/back-ldbm/Makefile.in create mode 100644 servers/slapd/back-passwd/Makefile.in create mode 100644 servers/slapd/back-shell/Makefile.in delete mode 100644 servers/slapd/shell-backends/Make-template create mode 100644 servers/slapd/shell-backends/Makefile.in delete mode 100644 servers/slapd/strdup.c delete mode 100644 servers/slapd/tempnam.c create mode 100644 servers/slapd/tools/Makefile.in delete mode 100644 servers/slurpd/Make-template create mode 100644 servers/slurpd/Makefile.in delete mode 100644 tests/Make-template create mode 100644 tests/Makefile.in diff --git a/COPYRIGHT b/COPYRIGHT index 2a2265a38c..e450f67a48 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -12,13 +12,14 @@ distribution. Information concerning is available at This work also contains materials derived from public sources. -University of Michagan LDAP v3.3 Copyright Notice - Copyright (c) 1992-1996 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. +Portions Copyright (c) 1992-1996 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. diff --git a/INSTALL b/INSTALL index 89b169ce3d..39eeaef160 100644 --- a/INSTALL +++ b/INSTALL @@ -17,72 +17,50 @@ these steps: If you are reading this file, you probably have already done this! - 2. copy Make-common.dist or Make-common.gmake to Make.common + 2. Type: + % ./configure --help - 3. edit the files Make-common and include/ldapconfig.h.edit to configure - the software for your site (the files are well-commented): + to list available configuration options. A description of + these options is provided in the 'CONFIGURE OPTIONS' section + below. - % vi Make-common - % vi include/ldapconfig.h.edit + The configure script will also use your environmental + variables for determining compiler/linker options. - Note that you should NOT need to edit the Makefile located at the - top of the distribution. + These environment variables are used: + CC C Compiler (cc, ecgs) + CFLAGS C Flags (-ansi) + CPPFLAGS CPP Flags (-I/path/include -Ddef) + LDFLAGS LDFLAGS (-L/path/lib -llib) - If you just want to see if things will build, you can leave the - configuration alone and change it later. You may want to consult - the appropriate platform makefile (build/*/Make-platform) for - platform-specific defaults. + A list of defines and other options are noted in the + 'DEFINES and FLAGS' comments below. - If you have the ISODE package built and want to build the - LDAP-to-X.500 server (ldapd), be sure to uncomment the appropriate - lines near the end of the Make-common file. By default only the - stand-alone server, LDAP libraries and client software are built. + 3. edit the file include/ldapconfig.h.edit to configure + the software for your site (the files are well-commented): - 4. make the software: + % vi include/ldapconfig.h.edit - % make + 4. Configure the build system - If all goes well, then make will figure out what platform you are on, - pick a compiler to use, construct Makefiles, and build everything. - If you see a message like "unknown platform..." LDAP has probably not - been set up to build on your machine. See the file build/PORTS for - hints on what to do in that case. - - Note that if your make does not use the Bourne (sh) shell by - default when executing internal scripts (reportedly the case on SGI - machines at least), you will need to run the make explicitly from - within a Bourne shell. If you a syntax error such as "Missing ]" - when you do the make under your usual shell, try this: - - % sh - $ make - - If you don't like the some of the platform-specific options chosen - by the automatic build process (such as the compiler to use, etc), - you can intervene and edit them before anything is actually compiled - by explicitly doing a "make platform" step, editing the .make-platform - file (actually a link to the file to be edited), and then doing a - regular make: - - % make platform - % vi .make-platform - % make + % [env settings] ./configure [options] - If you want to choose the build platform yourself from among those that - the distribution supports, cd to the appropriate directory underneath - build/platforms and make from there. For example, if you are on a - machine running SunOS 4.1.4 and you want to force the use of the cc - compiler, you would do this: + If all goes well, the configure script with auto-detect the + appropriate settings. Use configure enable/with options and/or + environment variables to obtain desired results. - % cd build/platforms/sunos4-cc - % make + 5. Build dependencies - If you want to run some simple tests after the build is complete, you - can do this: + % make depend - % make test + 6. Build the system + + % make - 5. install the binaries and man pages. You may need to be superuser to + If all goes well, the system will build as configured. If not, + return to step 4 after reviewing the enable/with options settings. + + 7. install the binaries and man pages. You may need to be superuser to do this (depending on where you are installing things): % su @@ -104,34 +82,47 @@ these steps: Building LDAP For More Than One Platform It is now possible to build LDAP for more than one platform from the same -source tree. This is accomplished by some rules in the Makefiles that -create a shadow (linked) directory tree where the binaries are placed. +source tree. This is accomplished by using make(1) VPATH support. If +your make(1) program is old and doesn't have VPATH support, install GNU +Make. Follow these steps for each different platform: - 1. move to the directory that matches the platform and compiler you - want to build for and type make. The directories are all located - underneath the build/platforms directory. If your platform is not - there, you may need to do a port - see the build/PORTS file for - more information. For a Sun running SunOS 4.1.4, you might do - this: + 1. Create a directory for the platform object files. - % cd build/platforms/sunos4-cc - % make links + % mkdir obj-platform - This will create a linked source area. + 2. Change your working directory to the platform object directory. + % cd obj-platform - 2. move to the new directory and make as for a single platform. Follow steps - 1-4 above to accomplish this. For example: + 3. Configure the build system - % cd obj-sunos4-cc - % make + % [env settings] ../configure --src-dir=.. [options] + + ( replace ".." with the appropriate path ) + + 4. Continue as above (starting at step 6). + + Note: make depend in VPATH environment is not yet supported. + + +CONFIGURE OPTIONS + +Regrettably, this section has not been written (yet). See +"./configure --help" for current list of options. + + +DEFINES and FLAGS - That's all there is to it. You can also create the linked source area(s) - by just typing "make links" at the top of the distribution, in which case - the Makefile will try to automatically determine the platform and - compiler. +The configure script will also use your environmental +variables for determining compiler/linker options. This can +be used to manual specify features and compilation options. +Supported Environmental Variables + CC C Compiler (cc, ecgs) + CFLAGS C Flags (-ansi) + CPPFLAGS CPP Flags (-I/path/include -Ddef) + LDFLAGS LDFLAGS (-L/path/lib -llib) End of OpenLDAP INSTALL file. diff --git a/Make-common.dist b/Make-common.dist deleted file mode 100644 index a938182695..0000000000 --- a/Make-common.dist +++ /dev/null @@ -1,298 +0,0 @@ -#----------------------------------------------------------------------------- -# Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA -# All rights reserved. -# -# Redistribution and use in source and binary forms are permitted only -# as authorized by the OpenLDAP Public License. A copy of this -# license is available at http://www.OpenLDAP.org/license.html or -# in file LICENSE in the top-level directory of the distribution. -# -# This work is derived from the University of Michigan LDAP v3.3 -# distribution. Information concerning is available at -# http://www.umich.edu/~dirsvcs/ldap/ldap.html. -# -# This work also contains materials derived from public sources. -#----------------------------------------------------------------------------- -# 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. -#----------------------------------------------------------------------------- -# LDAP common Make defines (included in all but top-level Makefile) - -############################################################################# -## Edit the following variables to have appropriate values for your system ## -############################################################################# - -# -# Note: Some make(1) programs do not understand the FOO?=BAR syntax. -# -# On such systems, you should use copy Make-common.gmake to Make-common -# and use gmake to build the distribution. -# - -############################################################################# -## LDAP install paths ## -############################################################################# -# by default, everything is installed below INSTROOT -# config files, etc. are put in ETCDIR -# include files get put in INCLUDEDIR -# libraries are put in LIBDIR -# man pages are put under MANDIR -# programs end-users will run are put in BINDIR -# programs sysadmins will run are put in SBINDIR -# servers are put in LIBEXECDIR -# pid/args files are put in RUNDIR -# -# Per platform defaults override these. -# -LDAP_PREFIX?= /usr/local -LDAP_INSTROOT?= $(LDAP_PREFIX) -LDAP_ETCDIR?= $(LDAP_INSTROOT)/etc/ldap -LDAP_INCDIR?= $(LDAP_INSTROOT)/include -LDAP_LIBDIR?= $(LDAP_INSTROOT)/lib -LDAP_MANDIR?= $(LDAP_INSTROOT)/man -LDAP_BINDIR?= $(LDAP_INSTROOT)/bin -LDAP_SBINDIR?=$(LDAP_INSTROOT)/sbin -LDAP_LIBEXECDIR?= $(LDAP_INSTROOT)/libexec -LDAP_RUNDIR?= $(LDAP_ETCDIR) - -############################################################################# -## General compiler options ## -############################################################################# -# Passed to every compile (cc or gcc). This is where you put -O or -g, etc. -#EXTRACFLAGS=-O -g -#EXTRACFLAGS=-O -EXTRACFLAGS?=-g -# Passed to every link (ld). Include -g here if you did in EXTRACFLAGS. -EXTRALDFLAGS?=-g - -############################################################################# -## If you are NOT using Kerberos authentication, you can skip this section.## -############################################################################# -# -# Otherwise, to enable kerberos authentication, uncomment KERBEROS (and -# AFSKERBEROS if you are running the AFS version of kerberos). Also -# uncomment and change the various KRB* lines to point to where the -# kerberos libraries and include files are installed at your site. -# -# *** NOTE *** -# If you have an MIT Kerberos V distribution and you compiled it with -krb4 -# flag which enables Kerberos IV compatibility, uncomment KERBEROS_V - -# this will make sure all your includes can be found where they actually are - -# in this case /usr/local/kerberos/include/kerberosIV - simple change of -# KRBINCLUDEFLAG will _not_ work. Also uncomment the correct KRBLIBS define. -# -# For Kerberos V with Kerberos IV compatibility uncomment the following line -#KERBEROS=-DKERBEROS -DKERBEROS_V -# For Kerberos IV uncomment the following line -#KERBEROS=-DKERBEROS -# -#AFSKERBEROS=-DAFSKERBEROS -#KRBINCLUDEFLAG = -I/usr/local/kerberos/include -#KRBLIBFLAG = -L/usr/local/kerberos/lib -# For Kerberos V with Kerberos IV compatibility uncomment the following line -#KRBLIBS = -lkrb4 -lkrb5 -ldes425 -# For Kerberos IV uncomment the following line -#KRBLIBS = -lkrb -ldes - -############################################################################# -## ISODE is required ONLY to build the ldap <-> X.500 server (ldapd) ## -## If you don't want to build it, you can skip this section. ## -############################################################################# -# -# To build the ldap server, uncomment the HAVEISODE line, -# and the section describing build settings for your version of isode. -# -#HAVEISODE = yes -# If you compiled ISODE with TURBO_DISK defined, uncomment this -#ISODETURBOLIBS = -lgdbm -# uncomment these to have ldapd "pretty print" protocol elements w/debugging -#PEPSY_DUMP=-DPEPSY_DUMP -#PEPSY=/usr/local/ic/bin/pepsy -# uncommment this line to have ldapd load PP syntax handlers -# you'll also need to add -lpp to ISODEBASELIBS below -#LDAP_USE_PP=-DLDAP_USE_PP -# uncomment NO_SETPROCTITLE to have ldapd NOT change its title -#NO_SETPROCTITLE=-DNOSETPROCTITLE -# -# ISODE Consortium release build settings -# You should change the next line so that ICRELEASE matches the (integer) -# version number of whatever IC release you have, e.g. 1, 2, or 3 and -# also uncomment the next 5 lines. -#ICRELEASE=-DICRELEASE=1 -#ISODEPACKAGE=-DISODEPACKAGE=IC -#ISODEINCLUDEFLAG= -I/usr/local/ic/include/isode -I/usr/local/ic/include -#ISODELIBFLAG = -L/usr/local/ic/lib -#ISODEBASELIBS = -lisode -# -# Freely available ISODE 8.0 release build settings (uncomment the next 4 lines) -#ISODEPACKAGE=-DISODEPACKAGE -#ISODEINCLUDEFLAG= -I/usr/local/isode/include -#ISODELIBFLAG = -L/usr/local/isode/lib -#ISODEBASELIBS = -ldsap -lisode -# -# NEXOR ISODE release build settings (uncomment the next 4 lines) -#ISODEPACKAGE=-DISODEPACKAGE=XT -#ISODEINCLUDEFLAG= -I/usr/include/isode -#ISODELIBFLAG = -L/usr/local/lib -L/usr/sunlink/osi/lib -#ISODEBASELIBS = -lxtpp -lresolv -lxtdsap -lxtisode -losi - -############################################################################# -## If you don't want to run slapd, skip this section. ## -############################################################################# -# -# To build slapd (the stand-alone ldap daemon), uncomment the MAKESLAPD -# line and select the SLAPD_BACKENDS you want to use. If you enable the -# LDBM backend, also select one of the LDBM backends. -MAKESLAPD= yes -# -# remove the defines for backends you don't want to enable -SLAPD_BACKENDS= -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD -# -# If you have included -DLDAP_LDBM in the SLAPD_BACKENDS line, -# which low-level database package to use must be specified. You -# may want to overide the platform settings by disabling the lines -# below and hardcoding the desired settings. -# -# The four choices: Berkeley db b-tree, Berkeley db hash, GNU dbm, or ndbm. -# You will also need to edit the include and lib strings appropriately. -# standard unix ndbm - -# Fallback settings, defaults are set in build/*/Make-platform -# The NDBM interface may not work on some (any) platforms. -# You may be happier with Berkeley DB B-trees. -LDBMBACKEND?=-DLDBM_USE_NDBM -LDBMINCLUDE?= -LDBMLIB?= - -# LDBM Hardcode Setting Examples (may require editing) -# berkeley db btree package -#LDBMLIB=-ldb -#LDBMBACKEND=-DLDBM_USE_DBBTREE -#LDBMINCLUDE=-I/usr/local/db/include -#LDBMLIB?=-ldb -# berkeley db hash package -#LDBMBACKEND=-DLDBM_USE_DBHASH -#LDBMINCLUDE=-I/usr/local/db/include -#LDBMLIB=-ldb -# gnu dbm (gdbm) -#LDBMBACKEND=-DLDBM_USE_GDBM -#LDBMINCLUDE=-I/usr/local/gdbm/include -#LDBMLIB=-lgdbm - -#undef these if you have SleepyCat DB2 installed the updated DBI -#LDBMBACKEND=-DLDBM_USE_DBBTREE -DLDBM_USE_DB2 -#LDBMINCLUDE=-I/usr/local/include -#LDBMLIB=-L/usr/local/lib -ldb - -#undef these if you have SleepyCat DB2 installed (with compat185) -#LDBMBACKEND=-DLDBM_USE_DBBTREE -DLDBM_USE_DB2_COMPAT185 -#LDBMINCLUDE=-I/usr/local/include -#LDBMLIB=-L/usr/local/lib -ldb - -# if you want to use a non-default threads package change the defines below -# to one of: -# -DPOSIX_THREADS (draft 10 or standard) -# -DTHREAD_MIT_PTHREADS (draft 4) -# -DTHREAD_NEXT_CTHREADS -# -DTHREAD_DCE_PTHREADS -# -DTHREAD_SUNOS4_LWP -# -DTHREAD_SUNOS5_LWP -# and select the appropriate library. -THREADS?=-DNO_THREADS -THREADSLIB?= - -# Locations of auxilary programs -# (excepts to below are generally defined in Make-platform) -LDAP_SENDMAIL?=/usr/lib/sendmail -LDAP_EDITOR?=/usr/ucb/vi -LDAP_FINGER?=/usr/ucb/finger - -# For generation of compressed man pages -# (excepts to below are generally defined in Make-platform) -MANCOMPRESS?=cat -MANCOMPRESSSUFFIX?= - -############################################################################# -## The following options are used by the xax500 client. If you haven't ## -## retrieved the xax500 source and dropped it into the "clients" ## -## directory, you can skip this section. ## -############################################################################# -# -# location of your X include files -#XINCLUDES= -I/usr/X11/include -# -# location of your X libraries -#XLIBDIRS=-L/usr/X11/lib -# -# include any extra X libraries you need here -# the following works with sunos 4 and X11R5 -#XLIBS = $(XLIBDIRS) -lXm -lXt -lX11 -# the following has been known to work with Solaris 2.4 and X11R6 -#XLIBS = $(XLIBDIRS) -lXm -lXext -lSM -lICE -lXpm -lXt -lX11 - -############################################################################# -## If you don't want to do auto-translation of character sets, skip this ## -############################################################################# -# -# Otherwise, uncomment this line and set the following options. -#STR_TRANSLATION=-DSTR_TRANSLATION -# -# remove the defines for LDAP client library T.61 character translation -# you do not need. If you use LDAP_CHARSET_8859, replace the '1' in "88591" -# with the number of the particular character set you use. E.g., use "88594" -# if you use the ISO 8859-4 chracter set. -#LIBLDAP_CHARSETS=-DLDAP_CHARSET_8859="88591" -# -# uncomment one these lines to enable automatic T.61 translation by default -#LIBLDAP_DEF_CHARSET=-DLDAP_DEFAULT_CHARSET=LDAP_CHARSET_8859 - -############################################################################# -## General options ## -############################################################################# -# uncomment this line to enable debugging code (a good idea) -LDAP_DEBUG=-DLDAP_DEBUG - -# uncomment this line to turn on a few U of Michigan specific things -#UOFM=-DUOFM - -# uncomment this line to delete a few printfs in the lber and ldap libraries. -#NO_USERINTERFACE=-DNO_USERINTERFACE - -# uncomment this line to include Connectionless LDAP support -#CLDAP=-DCLDAP - -# uncomment this line to eliminate local caching support in the libldap -#NO_CACHE=-DNO_CACHE - -# uncomment this line to do reverse lookups (useful for doing ACLs -# by host/domain names) -LDAP_REVERSE_LOOKUP=-DREVERSE_LOOKUP - -# uncomment this line to enable support for LDAP referrals in libldap -LDAP_REFERRALS=-DLDAP_REFERRALS - -# uncomment this line to enable ACL by groups -# LDAP_ACLGROUP=-DACLGROUP - -# uncomment these lines to enable support for CRYPT, SHA1, and/or MD5 passwords -# in LDBM. Crypt uses platform provided crypt(3). -# LDAP_CRYPT=-DLDAP_CRYPT -DLDAP_SHA1 -DLDAP_MD5 -# LDAP_CRYPT_LIB?= -# and comment this line out -LDAP_CRYPT_LIB= - -# uncomment these lines to enable support fro tcp_wrappers in servers. -# Requires tcp_wrappers. -# LDAP_TCP_WRAPPERS=-DTCP_WRAPPERS -I/usr/local/include -# LDAP_TCP_WRAPPERS_LIB=-L/usr/local/lib -lwrap - -# uncomment this line to use soundex for approximate matches in slapd. -# the default is to use the metaphone algorithm. -#PHONETIC=-DSOUNDEX diff --git a/Make-common.gmake b/Make-common.gmake deleted file mode 100644 index fcbbd5fa1c..0000000000 --- a/Make-common.gmake +++ /dev/null @@ -1,343 +0,0 @@ -#----------------------------------------------------------------------------- -# Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA -# All rights reserved. -# -# Redistribution and use in source and binary forms are permitted only -# as authorized by the OpenLDAP Public License. A copy of this -# license is available at http://www.OpenLDAP.org/license.html or -# in file LICENSE in the top-level directory of the distribution. -# -# This work is derived from the University of Michigan LDAP v3.3 -# distribution. Information concerning is available at -# http://www.umich.edu/~dirsvcs/ldap/ldap.html. -# -# This work also contains materials derived from public sources. -#----------------------------------------------------------------------------- -# 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. -#----------------------------------------------------------------------------- -# LDAP common Make defines (included in all but top-level Makefile) - -############################################################################# -## Edit the following variables to have appropriate values for your system ## -############################################################################# - -# -# This template should be used by systems with Gnu Make. -# -# If Gnu make is not installed as make, you must uncomment out -# this line. -#MAKE=gmake - -############################################################################# -## LDAP install paths ## -############################################################################# -# by default, everything is installed below INSTROOT -# config files, etc. are put in ETCDIR -# include files get put in INCLUDEDIR -# libraries are put in LIBDIR -# man pages are put under MANDIR -# programs end-users will run are put in BINDIR -# programs sysadmins will run are put in SBINDIR -# servers are put in LIBEXECDIR -# pid/args files are put in RUNDIR -# -# Per platform defaults override these. -# -ifndef LDAP_PREFIX -LDAP_PREFIX= /usr/local -endif -ifndef LDAP_INSTROOT -LDAP_INSTROOT= $(LDAP_PREFIX) -endif -ifndef LDAP_ETCDIR -LDAP_ETCDIR= $(LDAP_INSTROOT)/etc/ldap -endif -ifndef LDAP_INCDIR -LDAP_INCDIR= $(LDAP_INSTROOT)/include -endif -ifndef LDAP_LIBDIR -LDAP_LIBDIR= $(LDAP_INSTROOT)/lib -endif -ifndef LDAP_MANDIR -LDAP_MANDIR= $(LDAP_INSTROOT)/man -endif -ifndef LDAP_BINDIR -LDAP_BINDIR= $(LDAP_INSTROOT)/bin -endif -ifndef LDAP_SBINDIR -LDAP_SBINDIR=$(LDAP_INSTROOT)/sbin -endif -ifndef LDAP_LIBEXECDIR -LDAP_LIBEXECDIR= $(LDAP_INSTROOT)/libexec -endif -ifndef LDAP_RUNDIR -LDAP_RUNDIR= $(LDAP_ETCDIR) -endif - -############################################################################# -## General compiler options ## -############################################################################# -# Passed to every compile (cc or gcc). This is where you put -O or -g, etc. -#EXTRACFLAGS=-O -g -#EXTRACFLAGS=-O -ifndef EXTRACFLAGS -EXTRACFLAGS?=-g -endif -# Passed to every link (ld). Include -g here if you did in EXTRACFLAGS. -ifndef EXTRALDFLAGS -EXTRALDFLAGS=-g -endif - -############################################################################# -## If you are NOT using Kerberos authentication, you can skip this section.## -############################################################################# -# -# Otherwise, to enable kerberos authentication, uncomment KERBEROS (and -# AFSKERBEROS if you are running the AFS version of kerberos). Also -# uncomment and change the various KRB* lines to point to where the -# kerberos libraries and include files are installed at your site. -# -# *** NOTE *** -# If you have an MIT Kerberos V distribution and you compiled it with -krb4 -# flag which enables Kerberos IV compatibility, uncomment KERBEROS_V - -# this will make sure all your includes can be found where they actually are - -# in this case /usr/local/kerberos/include/kerberosIV - simple change of -# KRBINCLUDEFLAG will _not_ work. Also uncomment the correct KRBLIBS define. -# -# For Kerberos V with Kerberos IV compatibility uncomment the following line -#KERBEROS=-DKERBEROS -DKERBEROS_V -# For Kerberos IV uncomment the following line -#KERBEROS=-DKERBEROS -# -#AFSKERBEROS=-DAFSKERBEROS -#KRBINCLUDEFLAG = -I/usr/local/kerberos/include -#KRBLIBFLAG = -L/usr/local/kerberos/lib -# For Kerberos V with Kerberos IV compatibility uncomment the following line -#KRBLIBS = -lkrb4 -lkrb5 -ldes425 -# For Kerberos IV uncomment the following line -#KRBLIBS = -lkrb -ldes - -############################################################################# -## ISODE is required ONLY to build the ldap <-> X.500 server (ldapd) ## -## If you don't want to build it, you can skip this section. ## -############################################################################# -# -# To build the ldap server, uncomment the HAVEISODE line, -# and the section describing build settings for your version of isode. -# -#HAVEISODE = yes -# If you compiled ISODE with TURBO_DISK defined, uncomment this -#ISODETURBOLIBS = -lgdbm -# uncomment these to have ldapd "pretty print" protocol elements w/debugging -#PEPSY_DUMP=-DPEPSY_DUMP -#PEPSY=/usr/local/ic/bin/pepsy -# uncommment this line to have ldapd load PP syntax handlers -# you'll also need to add -lpp to ISODEBASELIBS below -#LDAP_USE_PP=-DLDAP_USE_PP -# uncomment NO_SETPROCTITLE to have ldapd NOT change its title -#NO_SETPROCTITLE=-DNOSETPROCTITLE -# -# ISODE Consortium release build settings -# You should change the next line so that ICRELEASE matches the (integer) -# version number of whatever IC release you have, e.g. 1, 2, or 3 and -# also uncomment the next 5 lines. -#ICRELEASE=-DICRELEASE=1 -#ISODEPACKAGE=-DISODEPACKAGE=IC -#ISODEINCLUDEFLAG= -I/usr/local/ic/include/isode -I/usr/local/ic/include -#ISODELIBFLAG = -L/usr/local/ic/lib -#ISODEBASELIBS = -lisode -# -# Freely available ISODE 8.0 release build settings (uncomment the next 4 lines) -#ISODEPACKAGE=-DISODEPACKAGE -#ISODEINCLUDEFLAG= -I/usr/local/isode/include -#ISODELIBFLAG = -L/usr/local/isode/lib -#ISODEBASELIBS = -ldsap -lisode -# -# NEXOR ISODE release build settings (uncomment the next 4 lines) -#ISODEPACKAGE=-DISODEPACKAGE=XT -#ISODEINCLUDEFLAG= -I/usr/include/isode -#ISODELIBFLAG = -L/usr/local/lib -L/usr/sunlink/osi/lib -#ISODEBASELIBS = -lxtpp -lresolv -lxtdsap -lxtisode -losi - -############################################################################# -## If you don't want to run slapd, skip this section. ## -############################################################################# -# -# To build slapd (the stand-alone ldap daemon), uncomment the MAKESLAPD -# line and select the SLAPD_BACKENDS you want to use. If you enable the -# LDBM backend, also select one of the LDBM backends. -MAKESLAPD= yes -# -# remove the defines for backends you don't want to enable -SLAPD_BACKENDS= -DLDAP_LDBM -DLDAP_SHELL -DLDAP_PASSWD -# -# If you have included -DLDAP_LDBM in the SLAPD_BACKENDS line, -# which low-level database package to use must be specified. You -# may want to overide the platform settings by disabling the lines -# below and hardcoding the desired settings. -# -# The four choices: Berkeley db b-tree, Berkeley db hash, GNU dbm, or ndbm. -# You will also need to edit the include and lib strings appropriately. -# standard unix ndbm - -# Fallback settings, defaults are set in build/*/Make-platform -# The NDBM interface may not work on some (any) platforms. -# You may be happier with Berkeley DB B-trees. -ifndef LDBMBACKEND -LDBMBACKEND=-DLDBM_USE_NDBM -endif -ifndef LDBMINCLUDE -LDBMINCLUDE= -endif -ifndef LDBMLIB -LDBMLIB= -endif - -# LDBM Hardcode Setting Examples (may require editing) -# berkeley db btree package -#LDBMLIB=-ldb -#LDBMBACKEND=-DLDBM_USE_DBBTREE -#LDBMINCLUDE=-I/usr/local/db/include -#LDBMLIB?=-ldb -# berkeley db hash package -#LDBMBACKEND=-DLDBM_USE_DBHASH -#LDBMINCLUDE=-I/usr/local/db/include -#LDBMLIB=-ldb -# gnu dbm (gdbm) -#LDBMBACKEND=-DLDBM_USE_GDBM -#LDBMINCLUDE=-I/usr/local/gdbm/include -#LDBMLIB=-lgdbm - -#undef these if you have SleepyCat DB2 installed the updated DBI -#LDBMBACKEND=-DLDBM_USE_DBBTREE -DLDBM_USE_DB2 -#LDBMINCLUDE=-I/usr/local/include -#LDBMLIB=-L/usr/local/lib -ldb - -#undef these if you have SleepyCat DB2 installed (with compat185) -#LDBMBACKEND=-DLDBM_USE_DBBTREE -DLDBM_USE_DB2_COMPAT185 -#LDBMINCLUDE=-I/usr/local/include -#LDBMLIB=-L/usr/local/lib -ldb - -# if you want to use a non-default threads package change the defines below -# to one of: -# -DPOSIX_THREADS (draft 10 or standard) -# -DTHREAD_MIT_PTHREADS (draft 4) -# -DTHREAD_NEXT_CTHREADS -# -DTHREAD_DCE_PTHREADS -# -DTHREAD_SUNOS4_LWP -# -DTHREAD_SUNOS5_LWP -# and select the appropriate library. - -ifndef THREADS -THREADS=-DNO_THREADS -endif -ifndef THREADSLIB -THREADSLIB= -endif - -# Locations of auxilary programs -# (excepts to below are generally defined in Make-platform) -ifndef LDAP_SENDMAIL -LDAP_SENDMAIL=/usr/lib/sendmail -endif -ifndef LDAP_EDITOR -LDAP_EDITOR=/usr/ucb/vi -endif -ifndef LDAP_FINGER -LDAP_FINGER=/usr/ucb/finger -endif - -# For generation of compressed man pages -# (excepts to below are generally defined in Make-platform) -ifndef MANCOMPRESS -MANCOMPRESS=cat -endif -ifndef MANCOMPRESSSUFFIX -MANCOMPRESSSUFFIX= -endif - -############################################################################# -## The following options are used by the xax500 client. If you haven't ## -## retrieved the xax500 source and dropped it into the "clients" ## -## directory, you can skip this section. ## -############################################################################# -# -# location of your X include files -#XINCLUDES= -I/usr/X11/include -# -# location of your X libraries -#XLIBDIRS=-L/usr/X11/lib -# -# include any extra X libraries you need here -# the following works with sunos 4 and X11R5 -#XLIBS = $(XLIBDIRS) -lXm -lXt -lX11 -# the following has been known to work with Solaris 2.4 and X11R6 -#XLIBS = $(XLIBDIRS) -lXm -lXext -lSM -lICE -lXpm -lXt -lX11 - -############################################################################# -## If you don't want to do auto-translation of character sets, skip this ## -############################################################################# -# -# Otherwise, uncomment this line and set the following options. -#STR_TRANSLATION=-DSTR_TRANSLATION -# -# remove the defines for LDAP client library T.61 character translation -# you do not need. If you use LDAP_CHARSET_8859, replace the '1' in "88591" -# with the number of the particular character set you use. E.g., use "88594" -# if you use the ISO 8859-4 chracter set. -#LIBLDAP_CHARSETS=-DLDAP_CHARSET_8859="88591" -# -# uncomment one these lines to enable automatic T.61 translation by default -#LIBLDAP_DEF_CHARSET=-DLDAP_DEFAULT_CHARSET=LDAP_CHARSET_8859 - -############################################################################# -## General options ## -############################################################################# -# uncomment this line to enable debugging code (a good idea) -LDAP_DEBUG=-DLDAP_DEBUG - -# uncomment this line to turn on a few U of Michigan specific things -#UOFM=-DUOFM - -# uncomment this line to delete a few printfs in the lber and ldap libraries. -#NO_USERINTERFACE=-DNO_USERINTERFACE - -# uncomment this line to include Connectionless LDAP support -#CLDAP=-DCLDAP - -# uncomment this line to eliminate local caching support in the libldap -#NO_CACHE=-DNO_CACHE - -# uncomment this line to do reverse lookups (useful for doing ACLs -# by host/domain names) -LDAP_REVERSE_LOOKUP=-DREVERSE_LOOKUP - -# uncomment this line to enable support for LDAP referrals in libldap -LDAP_REFERRALS=-DLDAP_REFERRALS - -# uncomment this line to enable ACL by groups -# LDAP_ACLGROUP=-DACLGROUP - -# uncomment these lines to enable support for CRYPT, SHA1, and/or MD5 passwords -# in LDBM. Crypt uses platform provided crypt(3). -# LDAP_CRYPT=-DLDAP_CRYPT -DLDAP_SHA1 -DLDAP_MD5 -# LDAP_CRYPT_LIB= -# and comment this line out -LDAP_CRYPT_LIB= - -# uncomment these lines to enable support fro tcp_wrappers in servers. -# Requires tcp_wrappers. -# LDAP_TCP_WRAPPERS=-DTCP_WRAPPERS -I/usr/local/include -# LDAP_TCP_WRAPPERS_LIB=-L/usr/local/lib -lwrap - -# uncomment this line to use soundex for approximate matches in slapd. -# the default is to use the metaphone algorithm. -#PHONETIC=-DSOUNDEX diff --git a/Makefile b/Makefile deleted file mode 100644 index d910580217..0000000000 --- a/Makefile +++ /dev/null @@ -1,425 +0,0 @@ -# You will usually NOT need to edit this file at all: instead, edit the -# Make-common file. See the LDAP INSTALL file for more information. -#----------------------------------------------------------------------------- -# Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA -# All rights reserved. -# -# Redistribution and use in source and binary forms are permitted only -# as authorized by the OpenLDAP Public License. A copy of this -# license is available at http://www.OpenLDAP.org/license.html or -# in file LICENSE in the top-level directory of the distribution. -# -# This work is derived from the University of Michigan LDAP v3.3 -# distribution. Information concerning is available at -# http://www.umich.edu/~dirsvcs/ldap/ldap.html. -# -# This work also contains materials derived from public sources. -#----------------------------------------------------------------------------- -# 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. -#----------------------------------------------------------------------------- -# LDAP lightweight X.500 Directory access top level makefile -# -############################################################################ -# # -# Usually you will not need to edit anything in this file # -# # -############################################################################ -# -# Note that these definitions of standard Unix utilities are only used -# in this Makefile. The Make-common (and .make-platform) files have a -# similar set of definitions that are used in all the other LDAP Makefiles. -# -RM=rm -f -MV=mv -f -CP=cp -CAT=cat -PWD=pwd -TAIL=tail -CHMOD=chmod -FIND=find -SED=sed -LN=ln -s -MKDIR=mkdir -GREP=grep -DIRNAME=dirname -BASENAME=basename -TAR=tar -COMPRESS=compress -CO=co -CI=ci - - -SRCDIRS= include libraries clients servers doc -TESTDIR= tests - -# -# LDAPSRC is used by the links rule -# -LDAPSRC= .. - - -# -# rules to make the software -# - -all: makeconfig - @echo "making all" - @for i in $(SRCDIRS); do \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ - ( cd $$i; $(MAKE) $(MFLAGS) all ); \ - done - -lib-only: makeconfig - @echo "making libraries only" - @echo " cd include; $(MAKE) $(MFLAGS) all"; \ - cd include; $(MAKE) $(MFLAGS) all - @echo " cd libraries; $(MAKE) $(MFLAGS) all"; \ - cd libraries; $(MAKE) $(MFLAGS) all - - -# -# rules to install the software -# - -install: makeconfig - @for i in $(SRCDIRS); do \ - echo; echo "cd $$i; $(MAKE) $(MFLAGS) install"; \ - ( cd $$i; $(MAKE) $(MFLAGS) install ); \ - done - -inst-lib: makeconfig - @echo "cd libraries; $(MAKE) $(MFLAGS) install" - @( cd libraries; $(MAKE) $(MFLAGS) install ) - - -# -# rules to test the LDAP software -# -test: all - @echo " cd $(TESTDIR); $(MAKE) $(MFLAGS) all"; \ - ( cd $(TESTDIR); $(MAKE) $(MFLAGS) all ); - -# -# rules to make clean -# - -clean: FORCE - @if [ -f .makefiles ]; then \ - for i in $(SRCDIRS) $(TESTDIR); do \ - echo; echo "cd $$i; $(MAKE) $(MFLAGS) clean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ - done; \ - fi; \ - ( for d in ./obj-*; do \ - if [ $$d != "./obj-*" ]; then \ - ( echo "making clean in $$d..."; \ - cd $$d; $(MAKE) $(MFLAGS) clean; ) \ - else \ - exit 0; \ - fi; \ - done ) - -veryclean: FORCE - @echo; echo "cd build; $(MAKE) $(MFLAGS) -f Make-template veryclean"; \ - ( cd build; $(MAKE) $(MFLAGS) -f Make-template veryclean ); \ - if [ -f .makefiles ]; then \ - for i in $(SRCDIRS) $(TESTDIR); do \ - echo; echo "cd $$i; $(MAKE) $(MFLAGS) veryclean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \ - done; \ - echo "finding and removing Makefiles..."; \ - for i in `$(FIND) . -type d -print`; do \ - if [ -f $$i/Make-template ]; then \ - echo "removing file $$i/Makefile"; \ - $(RM) $$i/Makefile; \ - fi; \ - done; \ - echo "removing file .makefiles"; \ - $(RM) .makefiles; \ - fi; \ - ( for d in ./obj-*; do \ - if [ $$d != "./obj-*" ]; then \ - echo "removing $$d..."; $(RM) -r $$d; \ - else \ - exit 0; \ - fi; \ - done ); \ - if [ -f .make-platform ]; then \ - echo "removing link .make-platform"; \ - $(RM) .make-platform; \ - else \ - exit 0; \ - fi - - -# -# rules to make depend -# -# -depend: makeconfig - @echo "making depend everywhere"; \ - echo " cd include; $(MAKE) $(MFLAGS) all"; \ - ( cd include; $(MAKE) $(MFLAGS) all ); \ - for i in $(SRCDIRS); do \ - echo; echo "cd $$i; $(MAKE) $(MFLAGS) depend"; \ - ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ - done; - @echo " "; echo Remember to \"make depend\" after each \"make makefiles\" - -# -# rules to check out and in Make-template files -# -co-mktmpls: FORCE - @echo "checking out Make-template files..."; \ - for mkfile in `$(FIND) . -name Make-template -type f -print`; do \ - $(CO) -l $$mkfile; \ - done - -ci-mktmpls: FORCE - @echo "enter a one-word log message:"; \ - read logmsg; \ - echo "checking in Make-template files..."; \ - for mkfile in `$(FIND) . -name Make-template -type f -print`; do \ - $(CI) -m$$logmsg -u $$mkfile; \ - done - - -lib-depend: makeconfig - @echo "cd libraries; $(MAKE) $(MFLAGS) depend" - @( cd libraries; $(MAKE) $(MFLAGS) depend )" - -# -# rules to cut a new ldap distribution -# -distribution: makeconfig checkin tar - -checkin: FORCE - @-VERSION=V`cat ./build/version | $(SED) -e 's/\.//'` ; \ - echo "Checking in version $$VERSION"; \ - for i in `$(FIND) . -name \*,v -print | \ - $(SED) -e 's%RCS/%%' -e 's%,v%%'`; \ - do ( \ - ci -m"pre-version $$VERSION check-in" -u $$i; \ - rcs -N$$VERSION: $$i ) \ - done - -tar: veryclean -# $(RM) ./Make-common; \ -# $(CP) ./Make-common.dist ./Make-common; \ -# $(CHMOD) 644 ./Make-common; \ -# $(RM) ./include/ldapconfig.h.edit; \ -# $(CP) ./include/ldapconfig.h.dist ./include/ldapconfig.h.edit; \ -# $(CHMOD) 644 ./include/ldapconfig.h.edit; - @PWD=`pwd`; \ - BASE=`$(BASENAME) $$PWD`; XFILE=/tmp/ldap-x.$$$$; \ - ( cd .. ; $(CAT) $$BASE/exclude >$$XFILE; \ - $(FIND) $$BASE -name RCS -print >> $$XFILE ; \ - $(FIND) $$BASE -name CVS -print >> $$XFILE ; \ - $(FIND) $$BASE -name obj-\* -print >> $$XFILE ; \ - $(FIND) $$BASE -name tags -print >> $$XFILE ; \ - $(TAR) cvfX ./$$BASE.tar $$XFILE $$BASE; \ - ); \ - $(RM) $$XFILE; \ - echo "compressing ../$$BASE.tar..."; \ - $(COMPRESS) ../$$BASE.tar - -# -# rule to force check for change of platform -# -platform: FORCE - @if [ -f .make-platform ]; then \ - echo "removing old link .make-platform"; \ - $(RM) .make-platform; \ - fi; \ - $(MAKE) $(MFLAGS) .make-platform - - -makeconfig: .makefiles buildtools - -.make-platform: - @if [ -f /usr/bin/swconfig ]; then \ - UNAME=./build/uname.sh; \ - elif [ -f /bin/uname ]; then \ - UNAME=/bin/uname; \ - elif [ -f /usr/bin/uname ]; then \ - UNAME=/usr/bin/uname; \ - else \ - UNAME=./build/uname.sh; \ - fi; \ - if [ -z "$$UNAME" ]; then \ - echo "unknown platform (no $$UNAME or /usr/bin/uname)"; \ - echo "see the file build/PORTS for more information."; \ - exit 1; \ - else \ - OS=`$$UNAME -s` ; OSRELEASE=`$$UNAME -r` ; \ - OSVERSION=`$$UNAME -v` ; \ - case $$OS in \ - SunOS) \ - if [ $$OSRELEASE -gt "5" -o $$OSRELEASE -lt "4" ]; then \ - echo "SunOS release $$OSRELEASE unknown..."; exit 1; \ - fi; \ - if [ $$OSRELEASE -ge "5" ]; then \ - MINORVER=`echo $$OSRELEASE|sed 's/^.*\.//'` ; \ - if [ $$MINORVER -ge "6" ]; then \ - PLATFORM="sunos56" ; \ - else \ - PLATFORM="sunos5"; \ - fi; \ - else \ - PLATFORM="sunos4"; \ - fi; \ - ;; \ - ULTRIX) \ - PLATFORM="ultrix" \ - ;; \ - OSF1) \ - PLATFORM="osf1" \ - ;; \ - AIX) \ - PLATFORM="aix" \ - ;; \ - HP-UX) \ - PLATFORM="hpux" \ - ;; \ - Linux) \ - PLATFORM="linux" \ - ;; \ - NetBSD) \ - PLATFORM="netbsd" \ - ;; \ - OpenBSD) \ - PLATFORM="openbsd" \ - ;; \ - FreeBSD) \ - MAJRELEASE=`echo $$OSRELEASE | sed 's/\..*//'` ; \ - if [ $$MAJRELEASE -lt 3 ]; then \ - PLATFORM="freebsd2" ; \ - else \ - PLATFORM="freebsd3" ; \ - fi; \ - ;; \ - NeXTSTEP) \ - PLATFORM="nextstep" \ - ;; \ - SCO) \ - PLATFORM="sco" \ - ;; \ - IRIX|IRIX64) \ - PLATFORM="irix" \ - ;; \ - *) echo "unknown platform ($$OS $$OSVERSION $$OSRELEASE)..."; \ - echo "see the file build/PORTS for more information."; \ - exit 1; \ - ;; \ - esac; \ - fi; \ - CC="$(CC)"; \ - OLDIFS="$$IFS"; \ - IFS=":"; \ - for dir in $$PATH; do \ - if [ -f $$dir/gcc ]; then \ - CC=gcc; \ - break; \ - fi; \ - done; \ - IFS="$$OLDIFS"; \ - $(LN) ./build/platforms/$$PLATFORM-$$CC/Make-platform .make-platform; \ - echo ""; \ - echo "** Set platform to $$PLATFORM with compiler $$CC..."; \ - echo "" - -Make-common: Make-common.dist - @if [ -f Make-common ]; then \ - echo "Make-common.dist newer than Make-common, check for new options" ;\ - echo "or touch Make-common to ignore."; \ - exit 1; \ - fi; \ - echo "Copy Make-common.dist or Make-common.gmake to Make-common"; \ - echo " Edit as needed before making!" ; \ - exit 1 -# -# rule to build Makefiles by concatenating Make-template file in each -# subdirectory with global Make-common, .make-platform, and -# build/Make-append files -# -.makefiles: Make-common .make-platform build/Make-append - @echo "making Makefiles..."; \ - HDRFILE=/tmp/Makehdr.$$$$; \ - DEFSFILE=/tmp/Makedefs.$$$$; \ - $(CAT) build/Make-append ./.make-platform ./Make-common > $$DEFSFILE; \ - echo "# --------------------------------------------------------" > $$HDRFILE; \ - echo "# This file was automatically generated. Do not edit it." >> $$HDRFILE; \ - echo "# Instead, edit the Make-common file (located in the root" >> $$HDRFILE; \ - echo "# (of the LDAP distribution). See the LDAP INSTALL file" >> $$HDRFILE; \ - echo "# for more information." >> $$HDRFILE; \ - echo "# --------------------------------------------------------" >> $$HDRFILE; \ - echo "#" >> $$HDRFILE; \ - for i in `$(FIND) . -type d -print`; do \ - if [ -f $$i/Make-template ]; then \ - echo " creating $$i/Makefile"; \ - $(RM) $$i/Makefile; \ - $(CAT) $$HDRFILE $$i/Make-template $$DEFSFILE > $$i/Makefile; \ - fi; \ - done; \ - $(RM) .makefiles; \ - touch .makefiles; \ - $(RM) $$HDRFILE $$DEFSFILE - -# -# rule to always build makefiles -# -makefiles: FORCE - $(RM) .makefiles - $(MAKE) $(MFLAGS) .makefiles - @echo "Please \"make depend\" before building." - -# -# rule to create any tools we need to build everything else -# -buildtools: FORCE - @echo "making buildtools" - @echo " cd build; $(MAKE) $(MFLAGS)" - @( cd build; $(MAKE) $(MFLAGS) ) - -# -# rule to make a shadow (linked) build area -# -links: FORCE - @if [ -f /usr/bin/swconfig ]; then \ - UNAME=./build/uname.sh; \ - elif [ -f /bin/uname ]; then \ - UNAME=/bin/uname; \ - elif [ -f /usr/bin/uname ]; then \ - UNAME=/usr/bin/uname; \ - else \ - UNAME=./build/uname.sh; \ - fi; \ - if [ ! -z "$(DEST)" ]; then \ - DEST="$(DEST)"; \ - else \ - DEST=./obj-`$$UNAME -s`-`$$UNAME -r` ; \ - fi; \ - echo "making links in $$DEST..."; \ - LINKLIST=/tmp/ldaplinklist.$$$$; \ - $(RM) $$LINKLIST; \ - $(MKDIR) $$DEST; \ - cd $$DEST; $(LN) $(LDAPSRC) .src; \ - $(LN) .src/Makefile . ; \ - $(CP) .src/Make-common . ; $(CHMOD) 644 ./Make-common; \ - for d in build $(SRCDIRS) $(TESTDIR); do \ - ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ - $(LN) .src/Make-template . ; \ - $(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \ - -f Make-template links ) ; \ - done; \ - echo ""; echo "Now type:"; echo " cd $$DEST"; echo "and make there" - -FORCE: diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000000..adb827bd1f --- /dev/null +++ b/Makefile.in @@ -0,0 +1,31 @@ +# Master Makefile for OpenLDAP +# Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +# COPYING RESTRICTIONS APPLY, See COPYRIGHT file + +SUBDIRS= include libraries clients servers # contrib +CLEANDIRS= tests +INSTALLDIRS= doc + +makefiles: FORCE + ./config.status + +${srcdir}/configure: configure.in aclocal.m4 + cd ${srcdir} && autoconf + +# autoheader might not change portable.h.in, so touch a stamp file +${srcdir}/include/portable.h.in: stamp-h.in +${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h \ + ${srcdir}/include/portable.h.top ${srcdir}/include/portable.h.bot + cd ${srcdir} && autoheader + @echo timestamp > ${srcdir}/stamp-h.in + +./include/portable.h: stamp-h +stamp-h: config.h.in config.status + ./config.status + +Makefile: Makefile.in config.status + ./config.status + +config.status: configure + ./config.status --recheck + diff --git a/README b/README index 58d9dd856b..1236676d41 100644 --- a/README +++ b/README @@ -16,11 +16,25 @@ MAKING AND INSTALLING THE DISTRIBUTION You should be able to make and install the distribution with a pretty standard default configuration by typing the following commands - % cp Make-common.dist to Make-common - Note: if using gmake, instead copy Make-common.gmake to Make-common - Edit Make-common as desired. + % ./configure --help + This will list the available options. + The configure script will also use your environmental + variables for determining compiler/linker options. + These environment variables are used: + CC C compiler (cc, ecgs) + CFLAGS C Flags (-ansi) + CPPFLAGS CPP Flags (-I -D) + LDFLAGS LDFLAGS (-L -l) + + % [env settings] ./configure [options] + this will configure the build system + + % make depend + this will create dependency information + % make this will build the system + % su # make install @@ -28,27 +42,7 @@ MAKING AND INSTALLING THE DISTRIBUTION works. You will probably want to do a little configuration to suit your - site, though. There are two files you might want to edit: - - Make-common.dist - contains distribution defaults. This file is used to - contruct Make-common and should not be edited except to - add new features/options to the distribution. - - Make-common.gmake - contains distribution defaults (with GNU make compatibility). - This file can be used to contruct Make-common and should not - be edited except to add new features/options to the distribution. - - Make-common - contains default definitions for where things will be - installed, where to find various things, etc. These defaults - are used in absense of platform-specific defaults. You may - hardcode settings in Make-common if you desire. You will - need to edit this file to enable optional features. - - build/*/Make-platform - contains platform-specific defaults. + site, though. There are one file you might want to edit: include/ldapconfig.h.edit This file contains #defines used by many parts of the diff --git a/acconfig.h b/acconfig.h new file mode 100644 index 0000000000..72737b44fa --- /dev/null +++ b/acconfig.h @@ -0,0 +1,138 @@ +/* acconfig.h + Descriptive text for the C preprocessor macros that + the distributed Autoconf macros can define. + + Leave the following blank line there!! Autoheader needs it. */ + + +/* define this if toupper() requires tolower() check */ +#undef C_UPPER_LOWER + +/* define this if sys_errlist is not defined in stdio.h or errno.h */ +#undef DECL_SYS_ERRLIST + +/* define if you have berkeley db */ +#undef HAVE_BERKELEY_DB + +/* define if you have berkeley db2 */ +#undef HAVE_BERKELEY_DB2 + +/* define if you have crypt */ +#undef HAVE_CRYPT + +/* define if you have DCE */ +#undef HAVE_DCE + +/* define if you have GDBM */ +#undef HAVE_GDBM + +/* define if you have Kerberos */ +#undef HAVE_KERBEROS + +/* define if you have LinuxThreads */ +#undef HAVE_LINUX_THREADS + +/* define if you have Sun LWP (SunOS style) */ +#undef HAVE_LWP + +/* define if you have -lncurses */ +#undef HAVE_NCURSES + +/* define if you have NDBM */ +#undef HAVE_NDBM + +/* define if you have Mach CThreads */ +#undef HAVE_MACH_CTHREADS + +/* define if you have a preemptive POSIX Threads implementation */ +#undef HAVE_PREEMPTIVE_PTHREADS + +/* define if you have POSIX Threads */ +#undef HAVE_PTHREADS + +/* define if your POSIX Threads implementatin is circa Draft 4 */ +#undef HAVE_PTHREADS_D4 + +/* define if you have -lwrap */ +#undef HAVE_TCPD + +/* define if you have -ltermcap */ +#undef HAVE_TERMCAP + +/* define if you have Sun LWP (Solaris style) */ +#undef HAVE_THR + +/* define this for connectionless LDAP support */ +#undef LDAP_CONNECTIONLESS + +/* define this to add debugging code */ +#undef LDAP_DEBUG + +/* define this for LDAP DNS support */ +#undef LDAP_DNS + +/* define this to remove -lldap cache support */ +#undef LDAP_NOCACHE + +/* define this for LDAP referrals support */ +#undef LDAP_REFERRALS + +/* define this for LDAP User Interface support */ +#undef LDAP_LIBUI + +/* define this to use DB2 in native mode */ +#undef LDBM_USE_DB2 + +/* define this to use DB2 in compat185 mode */ +#undef LDBM_USE_DB2_COMPAT185 + +/* define this to use DBBTREE w/ LDBM backend */ +#undef LDBM_USE_DBBTREE + +/* define this to use DBHASH w/ LDBM backend */ +#undef LDBM_USE_DBHASH + +/* define this to use GDBM w/ LDBM backend */ +#undef LDBM_USE_GDBM + +/* define this to use NDBM w/ LDBM backend */ +#undef LDBM_USE_NDBM + +/* define this if you want no termcap support */ +#undef NO_TERMCAP + +/* define this if you want no thread support */ +#undef NO_THREADS + +/* define this if the thread package is preemptive */ +#undef PREEMPTIVE_THREADS + +/* define this for ACL Group support */ +#undef SLAPD_ACLGROUPS + +/* define this for crypt(3) password support */ +#undef SLAPD_CRYPT + +/* define this to use SLAPD LDBM backend */ +#undef SLAPD_LDBM + +/* define this for MD5 password support */ +#undef SLAPD_MD5 + +/* define this to use SLAPD passwd backend */ +#undef SLAPD_PASSWD + +/* define this for phonetic support */ +#undef SLAPD_PHONETIC + +/* define this for Reverse Lookup support */ +#undef SLAPD_RLOOKUPS + +/* define this for SHA1 password support */ +#undef SLAPD_SHA1 + +/* define this to use SLAPD shell backend */ +#undef SLAPD_SHELL + + +/* Leave that blank line there!! Autoheader needs it. */ diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000000..6e8e2e667c --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,395 @@ +dnl +dnl OpenLDAP Autoconf Macros +dnl +dnl -------------------------------------------------------------------- +dnl Restricted form of AC_ARG_ENABLE that limits user options +dnl +dnl $1 = option name +dnl $2 = help-string +dnl $3 = default value (auto) +dnl $4 = allowed values (auto yes no) +AC_DEFUN([OL_ARG_ENABLE], [# OpenLDAP --enable-$1 + AC_ARG_ENABLE($1,[$2 (]ifelse($3,,auto,$3)[)],[ + ol_arg=invalid + for ol_val in ifelse($4,,[auto yes no],[$4]) ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + AC_MSG_ERROR(bad value $enableval for --enable-$1) + fi + ol_enable_$1="$ol_arg" +], +[ ol_enable_$1=ifelse($3,,"auto","$3")])dnl +dnl AC_VERBOSE(OpenLDAP -enable-$1 $ol_enable_$1) +# end --enable-$1 +])dnl +dnl +dnl -------------------------------------------------------------------- +dnl Restricted form of AC_ARG_WITH that limits user options +dnl +dnl $1 = option name +dnl $2 = help-string +dnl $3 = default value (no) +dnl $4 = allowed values (yes or no) +AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1 + AC_ARG_WITH($1,[$2 (]ifelse($3,,yes,$3)[)],[ + ol_arg=invalid + for ol_val in ifelse($4,,[yes no],[$4]) ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + AC_MSG_ERROR(bad value $withval for --with-$1) + fi + ol_with_$1="$ol_arg" +], +[ ol_with_$1=ifelse($3,,"no","$3")])dnl +dnl AC_VERBOSE(OpenLDAP --with-$1 $ol_with_$1) +# end --with-$1 +])dnl +dnl +dnl ==================================================================== +dnl Check if db.h is Berkeley DB2 +dnl +dnl defines ol_cv_header_db2 to 'yes' or 'no' +dnl +dnl uses: +dnl AC_CHECK_HEADERS(db.h) +dnl +AC_DEFUN([OL_HEADER_BERKELEY_DB2], +[AC_CHECK_HEADERS(db.h) +if test $ac_cv_header_db_h = yes ; then + AC_CACHE_CHECK([if db.h is DB2], [ol_cv_header_db2],[ + AC_EGREP_CPP(__db_version_2,[ +# include + /* this check could be improved */ +# ifdef DB_VERSION_MAJOR +# if DB_VERSION_MAJOR == 2 + __db_version_2 +# endif +# endif + ], ol_cv_header_db2=yes, ol_cv_header_db2=no)]) +else + ol_cv_header_db2=no +fi +])dnl +dnl -------------------------------------------------------------------- +dnl Check if Berkeley DB2 library exists +dnl Check for dbopen in standard libraries or -ldb +dnl +dnl defines ol_cv_lib_db2 to '-ldb' or 'no' +dnl +dnl uses: +dnl AC_CHECK_LIB(db,db_open) +dnl +AC_DEFUN([OL_LIB_BERKELEY_DB2], +[AC_CACHE_CHECK([for DB2 library], [ol_cv_lib_db2], +[ ol_LIBS="$LIBS" + AC_CHECK_LIB(db,db_open,[ol_cv_lib_db2=-ldb],[ol_cv_lib_db2=no]) + LIBS="$ol_LIBS" +]) +])dnl +dnl +dnl -------------------------------------------------------------------- +dnl Check if Berkeley db2 exists +dnl +dnl defines ol_cv_berkeley_db2 to 'yes' or 'no' +dnl +dnl uses: +dnl OL_LIB_BERKELEY_DB2 +dnl OL_HEADER_BERKELEY_DB2 +dnl +AC_DEFUN([OL_BERKELEY_DB2], +[AC_REQUIRE([OL_LIB_BERKELEY_DB2]) + AC_REQUIRE([OL_HEADER_BERKELEY_DB2]) + AC_CACHE_CHECK([for Berkeley DB2], [ol_cv_berkeley_db2], [ + if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then + ol_cv_berkeley_db2=no + else + ol_cv_berkeley_db2=yes + fi +]) + if test $ol_cv_berkeley_db2 = yes ; then + AC_DEFINE(HAVE_BERKELEY_DB2,1) + fi +])dnl +dnl +dnl ==================================================================== +dnl Check for db.h/db_185.h is Berkeley DB +dnl +dnl defines ol_cv_header_db to 'yes' or 'no' +dnl +dnl uses: +dnl OL_HEADER_BERKELEY_DB2 +dnl AC_CHECK_HEADERS(db_185.h) +dnl +AC_DEFUN([OL_HEADER_BERKELEY_DB], +[AC_REQUIRE([OL_HEADER_BERKELEY_DB2]) +AC_CHECK_HEADERS(db_185.h) +if test $ol_cv_header_db2 = yes ; then + dnl db.h is db2! + + ol_cv_header_db=$ac_cv_header_db_185_h +else + ol_cv_header_db=$ac_cv_header_db_h +fi +])dnl +dnl +dnl -------------------------------------------------------------------- +dnl Check if Berkeley DB library exists +dnl Check for dbopen in standard libraries or -ldb +dnl +dnl defines ol_cv_lib_db to 'yes' or '-ldb' or 'no' +dnl 'yes' implies dbopen is in $LIBS +dnl +dnl uses: +dnl AC_CHECK_FUNC(dbopen) +dnl AC_CHECK_LIB(db,dbopen) +dnl +AC_DEFUN([OL_LIB_BERKELEY_DB], +[AC_CACHE_CHECK([for Berkeley DB library], [ol_cv_lib_db], +[ ol_LIBS="$LIBS" + AC_CHECK_FUNC(dbopen,[ol_cv_lib_db=yes], [ + AC_CHECK_LIB(db,dbopen,[ol_cv_lib_db=-ldb],[ol_cv_lib_db=no]) + ]) + LIBS="$ol_LIBS" +]) +])dnl +dnl +dnl -------------------------------------------------------------------- +dnl Check if Berkeley DB exists +dnl +dnl defines ol_cv_berkeley_db to 'yes' or 'no' +dnl +dnl uses: +dnl OL_LIB_BERKELEY_DB +dnl OL_HEADER_BERKELEY_DB +dnl +AC_DEFUN([OL_BERKELEY_DB], +[AC_REQUIRE([OL_LIB_BERKELEY_DB]) + AC_REQUIRE([OL_HEADER_BERKELEY_DB]) + AC_CACHE_CHECK([for Berkeley DB], [ol_cv_berkeley_db], [ + if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then + ol_cv_berkeley_db=no + else + ol_cv_berkeley_db=yes + fi +]) + if test $ol_cv_berkeley_db = yes ; then + AC_DEFINE(HAVE_BERKELEY_DB,1) + fi +])dnl +dnl +dnl ==================================================================== +dnl Check if GDBM library exists +dnl Check for gdbm_open in standard libraries or -lgdbm +dnl +dnl defines ol_cv_lib_gdbm to 'yes' or '-lgdbm' or 'no' +dnl 'yes' implies gdbm_open is in $LIBS +dnl +dnl uses: +dnl AC_CHECK_FUNC(gdbm_open) +dnl AC_CHECK_LIB(gdbm,gdbm_open) +dnl +AC_DEFUN([OL_LIB_GDBM], +[AC_CACHE_CHECK(for GDBM library, [ol_cv_lib_gdbm], +[ ol_LIBS="$LIBS" + AC_CHECK_FUNC(gdbm_open,[ol_cv_lib_gdbm=yes], [ + AC_CHECK_LIB(gdbm,gdbm_open,[ol_cv_lib_gdbm=-lgdbm],[ol_cv_lib_gdbm=no]) + ]) + LIBS="$ol_LIBS" +]) +])dnl +dnl +dnl -------------------------------------------------------------------- +dnl Check if GDBM exists +dnl +dnl defines ol_cv_gdbm to 'yes' or 'no' +dnl +dnl uses: +dnl OL_LIB_GDBM +dnl AC_CHECK_HEADERS(gdbm.h) +dnl +AC_DEFUN([OL_GDBM], +[AC_REQUIRE([OL_LIB_GDBM]) + AC_CHECK_HEADERS(gdbm.h) + AC_CACHE_CHECK(for db, [ol_cv_gdbm], [ + if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then + ol_cv_gdbm=no + else + ol_cv_gdbm=yes + fi +]) + if test $ol_cv_gdbm = yes ; then + AC_DEFINE(HAVE_GDBM,1) + fi +])dnl +dnl +dnl ==================================================================== +dnl Check if NDBM library exists +dnl Check for dbm_open in standard libraries or -lndbm or -ldbm +dnl +dnl defines ol_cv_lib_ndbm to 'yes' or '-lndbm' or -ldbm or 'no' +dnl 'yes' implies ndbm_open is in $LIBS +dnl +dnl uses: +dnl AC_CHECK_FUNC(dbm_open) +dnl AC_CHECK_LIB(ndbm,dbm_open) +dnl AC_CHECK_LIB(dbm,dbm_open) +dnl +dnl restrictions: +dnl should also check SVR4 case: dbm_open() in -lucb but that +dnl would requiring dealing with -L/usr/ucblib +dnl +AC_DEFUN([OL_LIB_NDBM], +[AC_CACHE_CHECK(for NDBM library, [ol_cv_lib_ndbm], +[ ol_LIBS="$LIBS" + AC_CHECK_FUNC(dbm_open,[ol_cv_lib_ndbm=yes], [ + AC_CHECK_LIB(ndbm,dbm_open,[ol_cv_lib_ndbm=-lndbm], [ + AC_CHECK_LIB(dbm,dbm_open,[ol_cv_lib_ndbm=-ldbm], + [ol_cv_lib_ndbm=no])dnl + ]) + ]) + LIBS="$ol_LIBS" +]) +])dnl +dnl +dnl -------------------------------------------------------------------- +dnl Check if NDBM exists +dnl +dnl defines ol_cv_ndbm to 'yes' or 'no' +dnl +dnl uses: +dnl OL_LIB_NDBM +dnl AC_CHECK_HEADERS(ndbm.h) +dnl +dnl restrictions: +dnl Doesn't handle SVR4 case (see above) +dnl +AC_DEFUN([OL_NDBM], +[AC_REQUIRE([OL_LIB_NDBM]) + AC_CHECK_HEADERS(ndbm.h) + AC_CACHE_CHECK(for db, [ol_cv_ndbm], [ + if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then + ol_cv_ndbm=no + else + ol_cv_ndbm=yes + fi +]) + if test $ol_cv_ndbm = yes ; then + AC_DEFINE(HAVE_NDBM,1) + fi +])dnl +dnl +dnl ==================================================================== +dnl Check POSIX Thread version +dnl +dnl defines ol_cv_posix_version to 'final' or 'draft' or 'unknown' +dnl 'unknown' implies that the version could not be detected +dnl or that pthreads.h does exist. Existance of pthreads.h +dnl should be tested separately. +dnl +AC_DEFUN([OL_POSIX_THREAD_VERSION], +[AC_CACHE_CHECK([POSIX thread version],[ol_cv_pthread_version],[ + AC_EGREP_CPP(final,[ +# include + /* this check could be improved */ +# ifdef PTHREAD_ONCE_INIT + final +# endif + ], ol_pthread_final=yes, ol_pthread_final=no) + + AC_EGREP_CPP(draft4,[ +# include + /* this check could be improved */ +# ifdef pthread_once_init + draft4 +# endif + ], ol_pthread_draft4=yes, ol_pthread_draft4=no) + + if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then + ol_cv_pthread_version=final + elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then + ol_cv_pthread_version=draft4 + else + ol_cv_pthread_version=unknown + fi +]) +])dnl +dnl +dnl -------------------------------------------------------------------- +dnl Check LinuxThread +dnl +dnl defines ol_cv_linux_threads to 'yes' or 'no' +dnl 'no' implies pthreads.h is not LinuxThreads or pthreads.h +dnl doesn't exists. Existance of pthread.h should separately +dnl checked. +dnl +AC_DEFUN([OL_LINUX_THREADS], +[ +AC_CACHE_CHECK([for LinuxThreads], [ol_cv_linux_threads], [ + res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` + if test "$res" -gt 0 ; then + ol_cv_linux_threads=yes + else + ol_cv_linux_threads=no + fi +]) +])dnl +dnl +dnl ==================================================================== +dnl Check if toupper() requires islower() to be called first +AC_DEFUN([OL_C_UPPER_LOWER], +[ +AC_MSG_CHECKING([if toupper() requires islower()]) +AC_CACHE_VAL(ol_cv_c_upper_lower,[ + AC_TRY_RUN([ +#include +main() +{ + if ('C' == toupper('C')) + exit(0); + else + exit(1); +}], + [ol_cv_c_upper_lower=no], + [ol_cv_c_upper_lower=yes], + [ol_cv_c_upper_lower=safe])]) +AC_MSG_RESULT($ol_cv_c_upper_lower) +if test $ol_cv_c_upper_lower != no ; then + AC_DEFINE(C_UPPER_LOWER,1) +fi +]) + +dnl ==================================================================== +dnl Check for declaration of sys_errlist in one of stdio.h and errno.h. +dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration. +dnl Reported by Keith Bostic. +AC_DEFUN([OL_SYS_ERRLIST], +[ +AC_MSG_CHECKING([declaration of sys_errlist]) +AC_CACHE_VAL(ol_cv_dcl_sys_errlist,[ + AC_TRY_COMPILE([ +#include +#include +#include ], + [char *c = (char *) *sys_errlist], + [ol_cv_dcl_sys_errlist=yes], + [ol_cv_dcl_sys_errlist=no])]) +AC_MSG_RESULT($ol_cv_dcl_sys_errlist) + +# It's possible (for near-UNIX clones) that sys_errlist doesn't exist +if test $ol_cv_dcl_sys_errlist = no ; then + AC_DEFINE(DECL_SYS_ERRLIST,1) + AC_MSG_CHECKING([existence of sys_errlist]) + AC_CACHE_VAL(ol_cv_have_sys_errlist,[ + AC_TRY_LINK([#include ], + [char *c = (char *) *sys_errlist], + [ol_cv_have_sys_errlist=yes], + [ol_cv_have_sys_errlist=no])]) + AC_MSG_RESULT($ol_cv_have_sys_errlist) +fi +])dnl diff --git a/build/Make-append b/build/Make-append deleted file mode 100644 index bd782ee9ab..0000000000 --- a/build/Make-append +++ /dev/null @@ -1,96 +0,0 @@ -#----------------------------------------------------------------------------- -# Do NOT edit this file -- it is automatically appended to all Makefiles -# except the LDAP top-level Makefile. See the LDAP INSTALL file for more -# information. -#----------------------------------------------------------------------------- -# Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA -# All rights reserved. -# -# Redistribution and use in source and binary forms are permitted only -# as authorized by the OpenLDAP Public License. A copy of this -# license is available at http://www.OpenLDAP.org/license.html or -# in file LICENSE in the top-level directory of the distribution. -# -# This work is derived from the University of Michigan LDAP v3.3 -# distribution. Information concerning is available at -# http://www.umich.edu/~dirsvcs/ldap/ldap.html. -# -# This work also contains materials derived from public sources. -#----------------------------------------------------------------------------- -# 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. -# -# LDAP standard Make defines (appended to all but top-level Makefile) -# -#----------------------------------------------------------------------------- - -# DEFS are included in CFLAGS -DEFS = $(PLATFORMCFLAGS) $(LDAP_DEBUG) $(KERBEROS) $(AFSKERBEROS) \ - $(UOFM) $(UOFA) $(NO_USERINTERFACE) $(CLDAP) $(NO_CACHE) \ - $(LDAP_REFERRALS) $(LDAP_DNS) $(STR_TRANSLATION) \ - $(LIBLDAP_CHARSETS) $(LIBLDAP_DEF_CHARSET) - -# LDBMDEFS are included by servers (though only slapd only cares) -# and libldbm -LDBMDEFS = $(SLAPD_BACKENDS) $(LDBMBACKEND) $(LDBMINCLUDE) - -# SERVERDEFS are added to server builds CFLAGS (in addition to DEFS) -SERVERDEFS = $(ISODEPACKAGE) $(ICRELEASE) $(LDAP_USE_PP) \ - $(NO_SETPROCTITLE) $(PEPSY_DUMP) \ - $(LDAP_REVERSE_LOOKUP) $(LDAP_CRYPT) $(LDAP_ACLGROUP) \ - $(LDAP_TCP_WRAPPERS) \ - $(PHONETIC) $(LDBMDEFS) -# -# ISODELIBS are used in server/ldapd builds -# -ISODELIBS = $(ISODEBASELIBS) -lm $(ISODETURBOLIBS) - -# ACFLAGS are added to CFLAGS but not passed to mkdep, lint, etc -ACFLAGS = $(EXTRACFLAGS) $(UNPROTOCFLAGS) - -# ALDFLAGS are always placed near the beginning of all linker (cc -o) commands -ALDFLAGS = $(EXTRALDFLAGS) $(PLATFORMLDFLAGS) - -# ALIBS are always placed at the end of all linker (cc -o) commands -ALIBS = $(PLATFORMLIBS) - -# -# default definitions for Unix utilities (may be over-ridden in Make-platform) -CC = cc -MAKE = make -RANLIB = ranlib -AR = ar -RM = rm -f -MV = mv -f -CP = cp -CHMOD = chmod -CAT = cat -LN = ln -s -HARDLN = ln -TAIL = tail -SED = sed -LINT = lint -5LINT = lint -MKDIR = mkdir -INSTALL = install -INSTALLFLAGS = -c -BASENAME= basename -DIRNAME = dirname -MKDEP = $(LDAPSRC)/build/mkdep -s -f Makefile -PWD = pwd -DATE = date -HOSTNAME= hostname - - -# -# empty target used to force rules to be invoked -# -FORCE: - diff --git a/build/README-unproto b/build/README-unproto deleted file mode 100644 index 05def5e9ca..0000000000 --- a/build/README-unproto +++ /dev/null @@ -1,3 +0,0 @@ -The unproto code was obtained from: - - ftp://ftp.win.tue.nl/pub/unix/unproto5.shar.Z diff --git a/build/dir.mk b/build/dir.mk new file mode 100644 index 0000000000..40d2556842 --- /dev/null +++ b/build/dir.mk @@ -0,0 +1,47 @@ +##--------------------------------------------------------------------------- +## +## Makes subdirectories +## + + +all-common: all-local FORCE + @echo "Making all in `$(PWD)`" + @for i in $(SUBDIRS) $(ALLDIRS); do \ + echo " Entering subdirectory $$i"; \ + ( cd $$i; $(MAKE) $(MFLAGS) all ); \ + echo " "; \ + done + +install-common: install-local FORCE + @echo "Making install in `$(PWD)`" + @for i in $(SUBDIRS) $(INSTALLDIRS); do \ + echo " Entering subdirectory $$i"; \ + ( cd $$i; $(MAKE) $(MFLAGS) install ); \ + echo " "; \ + done + +clean-common: clean-local FORCE + @echo "Making clean in `$(PWD)`" + @for i in $(SUBDIRS) $(CLEANDIRS); do \ + echo " Entering subdirectory $$i"; \ + ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ + echo " "; \ + done + +veryclean-common: veryclean-local FORCE + @echo "Making veryclean in `$(PWD)`" + @for i in $(SUBDIRS) $(CLEANDIRS); do \ + echo " Entering subdirectory $$i"; \ + ( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \ + echo " "; \ + done + +depend-common: depend-local FORCE + @echo "Making depend in `$(PWD)`" + @for i in $(SUBDIRS) $(DEPENDDIRS); do \ + echo " Entering subdirectory $$i"; \ + ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ + echo " "; \ + done + +Makefile: $(top_srcdir)/build/dir.mk diff --git a/build/info.mk b/build/info.mk new file mode 100644 index 0000000000..17c77375d5 --- /dev/null +++ b/build/info.mk @@ -0,0 +1,6 @@ +##--------------------------------------------------------------------------- +## +## Makefile Template for Non-Source Directories +## + +Makefile: $(top_srcdir)/build/info.mk diff --git a/build/lib.mk b/build/lib.mk new file mode 100644 index 0000000000..b96c162cf6 --- /dev/null +++ b/build/lib.mk @@ -0,0 +1,42 @@ +##--------------------------------------------------------------------------- +## +## Makefile Template for Libraries +## + +all-common: $(LIBRARY) $(PROGRAMS) + +$(LIBRARY): version.o + $(AR) ru $@ $(OBJS) version.o + @$(RANLIB) $@; \ + $(RM) ../$@; \ + (d=`$(PWD)` ; $(LN_S) `$(BASENAME) $$d`/$@ ../$@) + +version.c: $(OBJS) $(srcdir)/Version.c + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` \ + h=`$(HOSTNAME)` t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +install-common: all-common install-local + +lint: lint-local FORCE + $(LINT) $(DEFS) $(DEFINES) $(SRCS) + +lint5: lint5-local FORCE + $(5LINT) $(DEFS) $(DEFINES) $(SRCS) + +clean-common: clean-local + $(RM) $(LIBRARY) ../$(LIBRARY) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) \ + *.o a.out core version.c + +depend-common: depend-local + $(MKDEP) $(DEFS) $(DEFINES) $(SRCS) + +veryclean-common: veryclean-local clean-common + +lint-local: FORCE +lint5-local: FORCE + +Makefile: $(top_srcdir)/build/lib.mk diff --git a/build/man.mk b/build/man.mk new file mode 100644 index 0000000000..ee6e277dcd --- /dev/null +++ b/build/man.mk @@ -0,0 +1,45 @@ +##--------------------------------------------------------------------------- +## +## Makefile Template for Manual Pages +## + +MANDIR=$(mandir)/man$(MANSECT) + +install-common: all-common install-local + -$(MKDIR) -p $(MANDIR) + @TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \ + VERSION=`$(CAT) $(VERSIONFILE)`; \ + for page in *.$(MANSECT); do \ + $(SED) -e "s%LDVERSION%$$VERSION%" \ + -e 's%ETCDIR%$(sysconfdir)%' \ + -e 's%SYSCONFDIR%$(sysconfdir)%' \ + -e 's%SBINDIR%$(sbindir)%' \ + -e 's%BINDIR%$(bindir)%' \ + -e 's%LIBDIR%$(libdir)%' \ + -e 's%LIBEXECDIR%$(libexecdir)%' \ + $$page | $(MANCOMPRESS) > $$TMPMAN; \ + echo "installing $(MANDIR)/$$page"; \ + $(RM) $(MANDIR)/$$page $(MANDIR)/$$page$(MANCOMPRESSSUFFIX); \ + $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(MANDIR)/$$page$(MANCOMPRESSSUFFIX); \ + if [ -f "$$page.links" ]; then \ + for link in `$(CAT) $$page.links`; do \ + echo "installing $(MANDIR)/$$link as link to $$page"; \ + $(RM) $(INSTDIR)/$$link $(MANDIR)/$$link$(MANCOMPRESSSUFFIX); \ + ln -sf $$page$(MANCOMPRESSSUFFIX) $(MANDIR)/$$link$(MANCOMPRESSSUFFIX); \ + done; \ + fi; \ + done; \ + $(RM) $$TMPMAN + +all-common: all-local +clean-common: clean-local +veryclean-common: veryclean-local clean-local +depend-common: depend-local +lint: lint-local +lint5: lint5-local + +# these could be empty +lint-local: FORCE +lint5-local: FORCE + +Makefile: $(top_srcdir)/build/lib.mk diff --git a/build/platforms/Make-setup b/build/platforms/Make-setup deleted file mode 100644 index 9e0991908e..0000000000 --- a/build/platforms/Make-setup +++ /dev/null @@ -1,68 +0,0 @@ -# -# You should NOT need to edit this file at all: if you just type make -# in this directory, LDAP will be built for this platform using this -# compiler. If you type make links a build area will be created for -# you under ./obj. You should # cd in there and edit the Make-common file -# before building. See the LDAP INSTALL file for more information. -# -#----------------------------------------------------------------------------- -# 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. -# -# LDAP lightweight X.500 Directory access platform setup makefile -# -#----------------------------------------------------------------------------- -# -############################################################################ -# # -# You should not have to edit anything in this file # -# # -############################################################################ -LN=ln -s -RM=rm -f -SED=sed -PWD=pwd - -LDAPSRC= ../../.. - -all: platform - ( cd $(LDAPSRC); $(MAKE) $(MFLAGS) ) - -install: platform - ( cd $(LDAPSRC); $(MAKE) $(MFLAGS) install ) - -platform: FORCE - @PWD=`$(PWD)`; \ - PLATFORMCC=`basename $$PWD`; \ - PLATFORM=`echo $$PLATFORMCC | $(SED) 's/-.*$$//'`; \ - CC=`echo $$PLATFORMCC | $(SED) 's/^.*-//'`; \ - echo "** Setting platform to $$PLATFORM and compiler $$CC"; \ - ( cd $(LDAPSRC); \ - $(RM) .make-platform; \ - $(LN) build/platforms/$$PLATFORMCC/Make-platform .make-platform ) - -links: FORCE - @PWD=`$(PWD)`; \ - PLATFORMCC=`basename $$PWD`; \ - DEST=./obj-$$PLATFORMCC; \ - PLATFORM=`echo $$PLATFORMCC | $(SED) 's/-.*$$//'`; \ - CC=`echo $$PLATFORMCC | $(SED) 's/^.*-//'`; \ - echo "** Setting platform to $$PLATFORM and compiler $$CC"; \ - ( cd $(LDAPSRC); $(MAKE) $(MFLAGS) DEST=$$DEST links; \ - cd $$DEST; \ - $(LN) .src/build/platforms/$$PLATFORMCC/Make-platform .make-platform ); \ - $(LN) $(LDAPSRC)/$$DEST . - -clean: FORCE - -veryclean: - -$(RM) -r ./obj-* - -FORCE: diff --git a/build/platforms/Makefile b/build/platforms/Makefile deleted file mode 100644 index 5cd6cecc90..0000000000 --- a/build/platforms/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP build/platforms Makefile -# -#----------------------------------------------------------------------------- - -############################################################################ -# # -# You should not have to edit anything below this point # -# # -############################################################################ - -all: FORCE - - -install: FORCE - -clean: FORCE - @echo "making clean in `pwd`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" -a -f $$i/Makefile ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ - fi; \ - done - -veryclean: FORCE - @echo "making veryclean in `pwd`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" -a -f $$i/Makefile ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) veryclean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) veryclean ); \ - fi; \ - done - -FORCE: - diff --git a/build/platforms/aix-cc/Make-platform b/build/platforms/aix-cc/Make-platform deleted file mode 100644 index cb2e2fd0ba..0000000000 --- a/build/platforms/aix-cc/Make-platform +++ /dev/null @@ -1,18 +0,0 @@ -# -# LDAP AIX standard cc Make-platform file -# - - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- - -# install with BSD semantics -INSTALL=/usr/ucb/install - -PLATFORMCFLAGS= -Daix diff --git a/build/platforms/aix-gcc/Make-platform b/build/platforms/aix-gcc/Make-platform deleted file mode 100644 index 29a7774e25..0000000000 --- a/build/platforms/aix-gcc/Make-platform +++ /dev/null @@ -1,19 +0,0 @@ -# -# LDAP AIX standard cc Make-platform file -# - - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC = gcc - -# install with BSD commandline -INSTALL=/usr/ucb/install - -PLATFORMCFLAGS= -Daix diff --git a/build/platforms/hpux-c89/Make-platform b/build/platforms/hpux-c89/Make-platform deleted file mode 100644 index f3d502e59b..0000000000 --- a/build/platforms/hpux-c89/Make-platform +++ /dev/null @@ -1,27 +0,0 @@ -# -# HP-UX optional c89 Make-platform file -# - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC=c89 - -# ranlib not needed under HP-UX -RANLIB = "" - -# install under HP-UX is not like on BSD systems, so we use our own script -INSTALL=$(LDAPSRC)/build/install.sh - -# we need to link a separate library to get ndbm routines under HP/UX -LDBMLIB=-lndbm - -# we need to link in the V3 library to get sigset() -PLATFORMLIBS= -lV3 - -PLATFORMCFLAGS= -Dhpux -Aa -D_HPUX_SOURCE diff --git a/build/platforms/hpux-cc/Make-platform b/build/platforms/hpux-cc/Make-platform deleted file mode 100644 index 3c813670ef..0000000000 --- a/build/platforms/hpux-cc/Make-platform +++ /dev/null @@ -1,33 +0,0 @@ -# -# LDAP HP-UX standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -# ranlib not needed under HP-UX -RANLIB = "" - -# install under HP-UX is not like on BSD systems, so we use our own script -INSTALL=$(LDAPSRC)/build/install.sh - -# we need to link a separate library to get ndbm routines under HP/UX -LDBMLIB=-lndbm - -PLATFORMCFLAGS= -Dhpux - -# we need to link in the V3 library to get sigset() -PLATFORMLIBS= -lV3 - -# -# the HP-UX cc compiler doesn't understand function prototypes, so we -# need the unproto preprocessor -# -NEEDUNPROTO=yes -UNPROTOCFLAGS=-tp,$(LDAPSRC)/build/unproto/cpp diff --git a/build/platforms/hpux-gcc/Make-platform b/build/platforms/hpux-gcc/Make-platform deleted file mode 100644 index 2c3d77d7f8..0000000000 --- a/build/platforms/hpux-gcc/Make-platform +++ /dev/null @@ -1,28 +0,0 @@ -# -# LDAP HP-UX gcc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC=gcc - -# ranlib not needed under HP-UX -RANLIB = "" - -# install under HP-UX is not like on BSD systems, so we use our own script -INSTALL=$(LDAPSRC)/build/install.sh - -# we need to link a separate library to get ndbm routines under HP/UX -LDBMLIB=-lndbm - -# we need to link in the V3 library to get sigset() -PLATFORMLIBS= -lV3 - -PLATFORMCFLAGS= -Dhpux diff --git a/build/platforms/irix-cc/Make-platform b/build/platforms/irix-cc/Make-platform deleted file mode 100644 index c4b195515b..0000000000 --- a/build/platforms/irix-cc/Make-platform +++ /dev/null @@ -1,29 +0,0 @@ -# -# LDAP IRIX standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -# ranlib not needed under IRIX -RANLIB = "" - -# be explicit about which CC to use -CC=cc - -# give full path to hostname since it may not be in user's path -HOSTNAME=/usr/bsd/hostname - -# don't count on a BSD install being present or first in path -INSTALL=$(LDAPSRC)/build/install.sh - -PLATFORMCFLAGS=-DUSE_WAITPID -PLATFORMLIBS= -THREADS= -THREADSLIB= diff --git a/build/platforms/irix-gcc/Make-platform b/build/platforms/irix-gcc/Make-platform deleted file mode 100644 index 96f698d132..0000000000 --- a/build/platforms/irix-gcc/Make-platform +++ /dev/null @@ -1,29 +0,0 @@ -# -# LDAP IRIX standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -# ranlib not needed under IRIX -RANLIB = "" - -# be explicit about which CC to use -CC=gcc - -# give full path to hostname since it may not be in user's path -HOSTNAME=/usr/bsd/hostname - -# don't count on a BSD install being present or first in path -INSTALL=$(LDAPSRC)/build/install.sh - -PLATFORMCFLAGS=-DUSE_WAITPID -PLATFORMLIBS= -THREADS= -THREADSLIB= diff --git a/build/platforms/ncr-mp-ras-2-cc/Make-platform b/build/platforms/ncr-mp-ras-2-cc/Make-platform deleted file mode 100644 index ce98b2c0b4..0000000000 --- a/build/platforms/ncr-mp-ras-2-cc/Make-platform +++ /dev/null @@ -1,34 +0,0 @@ -# -# LDAP SVR4 standard cc Make-platform file -# -# Uses the std SVR4 stuff whenever possible. -# Some references to the BSD compatibility required. -# - -# -# add any platform-specific overrides below here -# - -# compiler to use, e.g. CC=cc or CC=gcc -CC = cc - -# flags added to every compile -# Use the BSD include files but only after the SVR4 files. -PLATFORMCFLAGS= -DSYSV -DSVR4 -I/usr/include -I/usr/ucbinclude - -# flags added to every link -PLATFORMLDFLAGS = - -# extra libraries needed (added to the end of all link commands) -PLATFORMLIBS = -lnsl -lnet -lsocket - -# ndbm library, needed if not in libc (e.g. LDBMLIB=-lndbm) -LDBMLIB = -L/usr/ucblib -lucb - -# BSD-like install command; if necessary, you can use a script -INSTALL = /usr/ucb/install - -# command to convert libraries for efficient random access; -RANLIB = "" - -# other commands - see the file build/Make-append for a list diff --git a/build/platforms/netbsd-cc/Make-platform b/build/platforms/netbsd-cc/Make-platform deleted file mode 100644 index e176e6d6a3..0000000000 --- a/build/platforms/netbsd-cc/Make-platform +++ /dev/null @@ -1,17 +0,0 @@ -# -# LDAP NetBSD cc Make-platform file -# on NetBSD, cc is gcc -# - - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC = gcc - -PLATFORMCFLAGS= -Dnetbsd diff --git a/build/platforms/netbsd-gcc/Make-platform b/build/platforms/netbsd-gcc/Make-platform deleted file mode 100644 index b66f8304f6..0000000000 --- a/build/platforms/netbsd-gcc/Make-platform +++ /dev/null @@ -1,16 +0,0 @@ -# -# LDAP NetBSD GNU C Make-platform file -# - - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC = gcc - -PLATFORMCFLAGS= -Dnetbsd diff --git a/build/platforms/nextstep-cc/Make-platform b/build/platforms/nextstep-cc/Make-platform deleted file mode 100644 index 1105e6c493..0000000000 --- a/build/platforms/nextstep-cc/Make-platform +++ /dev/null @@ -1,15 +0,0 @@ -# -# LDAP NeXTSTEP cc Make-platform file -# - - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -PLATFORMCFLAGS= -Dnextstep -PLATFORMLDFLAGS= -all_load diff --git a/build/platforms/openbsd-cc/Make-platform b/build/platforms/openbsd-cc/Make-platform deleted file mode 100644 index 6ac7dc6800..0000000000 --- a/build/platforms/openbsd-cc/Make-platform +++ /dev/null @@ -1,33 +0,0 @@ -# LDAP OpenBSD cc Make-platform file -# on OpenBSD, cc is gcc -# - - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC = gcc - -PLATFORMCFLAGS= -Dopenbsd - -.include - -.if (${KERBEROS} == "yes") -KERBEROS=-DKERBEROS -KRBINCLUDEFLAG = -I/usr/include/kerberosIV -KRBLIBS = -lkrb -ldes -.endif - -LDBMBACKEND=-DLDBM_USE_DBBTREE - -THREADS=-DNO_THREADS - -LDAP_SENDMAIL=/usr/sbin/sendmail -LDAP_EDITOR=/usr/bin/vi -LDAP_FINGER=/usr/bin/finger - diff --git a/build/platforms/openbsd-gcc/Make-platform b/build/platforms/openbsd-gcc/Make-platform deleted file mode 100644 index 02ac3bffce..0000000000 --- a/build/platforms/openbsd-gcc/Make-platform +++ /dev/null @@ -1,34 +0,0 @@ -# -# LDAP OpenBSD GNU C Make-platform file -# - - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC = gcc - -PLATFORMCFLAGS= -Dopenbsd - -.include - -.if (${KERBEROS} == "yes") -KERBEROS=-DKERBEROS -KRBINCLUDEFLAG = -I/usr/include/kerberosIV -KRBLIBS = -lkrb -ldes -.endif - -# Use DB BTREE -LDBMBACKEND=-DLDBM_USE_DBBTREE - -THREADS=-DNO_THREADS - -LDAP_SENDMAIL=/usr/sbin/sendmail -LDAP_EDITOR=/usr/bin/vi -LDAP_FINGER=/usr/bin/finger - diff --git a/build/platforms/osf1-cc/Make-platform b/build/platforms/osf1-cc/Make-platform deleted file mode 100644 index 2fd6b205c3..0000000000 --- a/build/platforms/osf1-cc/Make-platform +++ /dev/null @@ -1,24 +0,0 @@ -# -# LDAP OSF1 standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- - -# Even though prototypes are supported by the compiler, OSF's CC doesn't -# seem to define __STDC__ so we explicitly defined NEEDPROTOS here. -PLATFORMCFLAGS= -Dosf1 -DNEEDPROTOS -PLATFORMLDFLAGS= - -THREADS= -DTHREAD_DCE_PTHREADS -THREADSLIB= -lpthreads - -# the BSD-like install under OSF/1 is called installbsd -INSTALL=installbsd diff --git a/build/platforms/osf1-gcc/Make-platform b/build/platforms/osf1-gcc/Make-platform deleted file mode 100644 index ea71755e71..0000000000 --- a/build/platforms/osf1-gcc/Make-platform +++ /dev/null @@ -1,25 +0,0 @@ -# -# LDAP OSF1 gcc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- - -CC = gcc - -PLATFORMCFLAGS= -Dosf1 -PLATFORMLDFLAGS= - -THREADS= -DTHREAD_DCE_PTHREADS -THREADSLIB= -lpthreads - -# the BSD-like install under OSF/1 is called installbsd -INSTALL=installbsd - diff --git a/build/platforms/sco-cc/Make-platform b/build/platforms/sco-cc/Make-platform deleted file mode 100644 index 31ff05d498..0000000000 --- a/build/platforms/sco-cc/Make-platform +++ /dev/null @@ -1,23 +0,0 @@ -# -# LDAP SCO standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -# ranlib not needed under SCO -RANLIB = "" - -# be explicit about which CC to use -CC=/bin/cc - -# don't count on /usr/ucb/install being present or first in path -INSTALL=$(LDAPSRC)/build/install.sh - -PLATFORMCFLAGS= -DSCO -DNEED_BSDREGEX -DSYSV -DNOTERMCAP -PLATFORMLIBS= -lsocket -lnsl_s diff --git a/build/platforms/sco-gcc/Make-platform b/build/platforms/sco-gcc/Make-platform deleted file mode 100644 index 1abaa79e00..0000000000 --- a/build/platforms/sco-gcc/Make-platform +++ /dev/null @@ -1,22 +0,0 @@ -# -# LDAP SCO gcc Make-platform file -# - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -# ranlib not needed under SCO -RANLIB = "" - -CC=gcc - -# don't count on /usr/ucb/install being present or first in path -INSTALL=$(LDAPSRC)/build/install.sh - -PLATFORMCFLAGS= -DSCO -DNEED_BSDREGEX -DSYSV -DNOTERMCAP -PLATFORMLIBS= -lsocket -lnsl_s diff --git a/build/platforms/sunos4-cc/Make-platform b/build/platforms/sunos4-cc/Make-platform deleted file mode 100644 index 6f94bd4808..0000000000 --- a/build/platforms/sunos4-cc/Make-platform +++ /dev/null @@ -1,25 +0,0 @@ -# -# LDAP SunOS standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -5LINT = /usr/5bin/lint - -PLATFORMCFLAGS= -Dsunos4 -THREADS= -DTHREAD_SUNOS4_LWP -THREADSLIB=-llwp - -# -# the SunOS 4 cc compiler doesn't understand function prototypes, so we -# need the unproto preprocessor -# -NEEDUNPROTO=yes -UNPROTOCFLAGS=-Qpath $(LDAPSRC)/build/unproto diff --git a/build/platforms/sunos4-gcc/Make-platform b/build/platforms/sunos4-gcc/Make-platform deleted file mode 100644 index 81c97f93c8..0000000000 --- a/build/platforms/sunos4-gcc/Make-platform +++ /dev/null @@ -1,19 +0,0 @@ -# -# LDAP SunOS GNU C Make-platform file -# - - -# -# add any platform-specific overrides below here -# - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC = gcc -5LINT = /usr/5bin/lint - -PLATFORMCFLAGS= -Dsunos4 -THREADS= -DTHREAD_SUNOS4_LWP -THREADSLIB=-llwp diff --git a/build/platforms/sunos5-cc/Make-platform b/build/platforms/sunos5-cc/Make-platform deleted file mode 100644 index beaad9fe91..0000000000 --- a/build/platforms/sunos5-cc/Make-platform +++ /dev/null @@ -1,29 +0,0 @@ -# -# LDAP SunOS5 standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -# ranlib not needed under SunOS5 -RANLIB = "" - -# be explicit about which CC to use -CC=cc - -# give full path to hostname since it may not be in user's path -HOSTNAME=/usr/ucb/hostname - -# don't count on /usr/ucb/install being present or first in path -INSTALL=$(LDAPSRC)/build/install.sh - -PLATFORMCFLAGS= -Dsunos5 -D_REENTRANT -PLATFORMLIBS= -lsocket -lnsl -lgen -THREADS= -DTHREAD_SUNOS5_LWP -THREADSLIB=-lthread diff --git a/build/platforms/sunos5-gcc/Make-platform b/build/platforms/sunos5-gcc/Make-platform deleted file mode 100644 index 20c5e4756b..0000000000 --- a/build/platforms/sunos5-gcc/Make-platform +++ /dev/null @@ -1,28 +0,0 @@ -# -# LDAP SunOS5 GNU C Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC = gcc - -# ranlib not needed under SunOS5 -RANLIB = "" - -# give full path to hostname since it may not be in user's path -HOSTNAME=/usr/ucb/hostname - -# don't count on /usr/ucb/install being present or first in path -INSTALL=$(LDAPSRC)/build/install.sh - -PLATFORMCFLAGS= -Dsunos5 -D_REENTRANT -PLATFORMLIBS= -lsocket -lnsl -lgen -THREADS= -DTHREAD_SUNOS5_LWP -THREADSLIB=-lthread diff --git a/build/platforms/sunos56-cc/Make-platform b/build/platforms/sunos56-cc/Make-platform deleted file mode 100644 index 8e88e751f3..0000000000 --- a/build/platforms/sunos56-cc/Make-platform +++ /dev/null @@ -1,29 +0,0 @@ -# -# LDAP SunOS5 standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -# ranlib not needed under SunOS5 -RANLIB = "" - -# be explicit about which CC to use -CC=cc - -# give full path to hostname since it may not be in user's path -HOSTNAME=/bin/hostname - -# don't count on /usr/ucb/install being present or first in path -INSTALL=$(LDAPSRC)/build/install.sh - -PLATFORMCFLAGS= -Dsunos5 -D__SunOS_5_6 -D_REENTRANT -PLATFORMLIBS= -lsocket -lnsl -lgen -THREADS= -DTHREAD_SUNOS5_LWP -THREADSLIB=-lthread diff --git a/build/platforms/sunos56-gcc/Make-platform b/build/platforms/sunos56-gcc/Make-platform deleted file mode 100644 index 5f0d80aa2a..0000000000 --- a/build/platforms/sunos56-gcc/Make-platform +++ /dev/null @@ -1,28 +0,0 @@ -# -# LDAP SunOS5 GNU C Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- -CC = gcc - -# ranlib not needed under SunOS5 -RANLIB = "" - -# give full path to hostname since it may not be in user's path -HOSTNAME=/bin/hostname - -# don't count on /usr/ucb/install being present or first in path -INSTALL=$(LDAPSRC)/build/install.sh - -PLATFORMCFLAGS= -Dsunos5 -D__SunOS_5_6 -D_REENTRANT -PLATFORMLIBS= -lsocket -lnsl -lgen -THREADS= -DTHREAD_SUNOS5_LWP -THREADSLIB=-lthread diff --git a/build/platforms/ultrix-cc/Make-platform b/build/platforms/ultrix-cc/Make-platform deleted file mode 100644 index 8139f5f848..0000000000 --- a/build/platforms/ultrix-cc/Make-platform +++ /dev/null @@ -1,16 +0,0 @@ -# -# LDAP Ultrix standard cc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- - -PLATFORMCFLAGS= -Dultrix -YSYSTEM_FIVE -PLATFORMLDFLAGS= -YSYSTEM_FIVE diff --git a/build/platforms/ultrix-gcc/Make-platform b/build/platforms/ultrix-gcc/Make-platform deleted file mode 100644 index 976e069a62..0000000000 --- a/build/platforms/ultrix-gcc/Make-platform +++ /dev/null @@ -1,16 +0,0 @@ -# -# LDAP Ultrix standard gcc Make-platform file -# - -# -# add any platform-specific overrides below here -# - - -# -# ------------------------------------------------------------------------- -# you will probably not need to edit anything below this point -# ------------------------------------------------------------------------- - -CC= gcc -PLATFORMCFLAGS= -Dultrix diff --git a/build/platforms/vms/Makefile b/build/platforms/vms/Makefile deleted file mode 100644 index 65467d23d9..0000000000 --- a/build/platforms/vms/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP build/platforms/vms Makefile (do nothing) -# -#----------------------------------------------------------------------------- -# -############################################################################ -# # -# You should not have to edit anything in this file # -# # -############################################################################ -LDAPSRC= ../../.. - -all: FORCE - -links: FORCE - -clean: FORCE - -veryclean: FORCE - -FORCE: diff --git a/build/platforms/vms/make.com b/build/platforms/vms/make.com deleted file mode 100644 index 01fe3265a4..0000000000 --- a/build/platforms/vms/make.com +++ /dev/null @@ -1,95 +0,0 @@ -$! 30-Nov-1995 ldap V3.2 Craig Watkins Innosoft International, Inc. -$! -$! This is a crude make procedure to build the ldap libraries and the test -$! program. This should work with DECC or VAXC compilers. -$! -$! This links with UCX libraries so that it should work on any TCP/IP -$! package that has UCX emulation. This has been tested with MultiNet. -$! You may have to change the LINK to find your copy of UCX$IPC.OLB. -$! -$ ARCH = "VAX" -$ if f$getsyi("hw_model") .GE. 1024 then ARCH = "ALPHA" -$ ! -$ ! If we are on an alpha/axp, we need to use DECC -- otherwise, your choice -$ COMPILER = "VAXC" -$ if ARCH .eqs. "ALPHA" then COMPILER = "DECC" -$ ! -$ if COMPILER .eqs. "VAXC" -$ then -$ define arpa sys$library: -$ define sys sys$library: -$ define netinet sys$library: -$! This assumes your default compiler is VAXC; if not, add /VAXC below -$ cc_switches = "/include=([---.include],[---.libraries.vms])/define=(LDAP_DEBUG,CLDAP,LDAP_REFERRALS,STR_TRANSLATION,LDAP_CHARSET_8859=88591)" -$! -$ else -$! -$ cc_switches = "/decc/standard=vaxc/include=([---.include],[---.libraries.vms])/define=(__STDC__,LDAP_DEBUG,CLDAP,LDAP_REFERRALS,STR_TRANSLATION,LDAP_CHARSET_8859=88591) -$ endif -$ ! -$ cc 'CC_SWITCHES' 'P1' [---.libraries.liblber]io -$ cc 'CC_SWITCHES' 'P1' [---.libraries.liblber]encode -$ cc 'CC_SWITCHES' 'P1' [---.libraries.liblber]decode -$ cc 'CC_SWITCHES' 'P1' [---.libraries.liblber]version -$ ! -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]ABANDON -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]ADD -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]ADDENTRY -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]BIND -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]CACHE -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]CHARSET -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]CLDAP -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]COMPARE -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]DELETE -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]DISPTMPL -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]DSPARSE -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]ERROR -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]FREE -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]FRIENDLY -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]GETATTR -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]GETDN -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]GETDXBYNAME -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]GETENTRY -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]GETFILTER -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]GETVALUES -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]KBIND -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]MODIFY -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]MODRDN -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]OPEN -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]OS-IP -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]REGEX -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]REQUEST -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]RESULT -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]SBIND -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]SEARCH -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]SORT -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]SRCHPREF -$ cc 'CC_SWITCHES' 'P1' /define="TEMPLATEFILE=""LDAP_ETC:ldaptemplates.conf""" - - [---.libraries.libldap]TMPLOUT -$!CC 'CC_SWITCHES' 'P1' [---.libraries.libldap]TMPLTEST -$ cc 'CC_SWITCHES' 'P1' /define="FILTERFILE=""LDAP_ETC:ldapfilter.conf""" - - [---.libraries.libldap]UFN -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]UNBIND -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]VERSION -$ ! -$ cc 'CC_SWITCHES' 'P1' [---.libraries.vms]getopt -$ cc 'CC_SWITCHES' 'P1' [---.libraries.vms]strings -$ ! -$ library/create/log ldap.olb *.obj -$ ! -$ cc 'CC_SWITCHES' 'P1' [---.libraries.libldap]TEST -$ ! -$ if COMPILER .eqs. "VAXC" -$ then -$! -$ link test, sys$input/opt -ldap.olb/lib -sys$library:ucx$ipc.olb/lib -sys$share:vaxcrtl.exe/share -$! -$ else -$! -$ link test, sys$input/opt -ldap.olb/lib -$ endif -$! diff --git a/build/rules.mk b/build/rules.mk new file mode 100644 index 0000000000..aaf164799d --- /dev/null +++ b/build/rules.mk @@ -0,0 +1,28 @@ +##--------------------------------------------------------------------------- +## +## Makefile Template for Programs +## + +all-common: all-local $(PROGRAMS) + +install-common: all-common install-local + +clean-common: clean-local + $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o a.out core + +veryclean-common: veryclean-local clean-local + +depend-common: depend-local + $(MKDEP) $(DEFS) $(DEFINES) $(SRCS) + +lint: lint-local + $(LINT) $(DEFS) $(DEFINES) $(SRCS) + +lint5: lint5-local + $(5LINT) $(DEFS) $(DEFINES) $(SRCS) + +# these could be empty +lint-local: FORCE +lint5-local: FORCE + +Makefile: $(top_srcdir)/build/rules.mk diff --git a/build/srv.mk b/build/srv.mk new file mode 100644 index 0000000000..7bef5bebf4 --- /dev/null +++ b/build/srv.mk @@ -0,0 +1,73 @@ +##--------------------------------------------------------------------------- +## +## Makefile Template for Servers +## + +all-common: FORCE + @if [ "$(BUILD_SRV)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) all-srv; \ + else \ + echo "run configure with $(BUILD_OPT) to build $(PROGRAMS)"; \ + fi + +clean-common: FORCE + @if [ "$(BUILD_SRV)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) clean-srv; \ + else \ + echo "run configure with $(BUILD_OPT) to clean $(PROGRAMS)"; \ + fi + +veryclean-common: FORCE + @if [ "$(BUILD_SRV)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) veryclean-srv; \ + else \ + echo "run configure with $(BUILD_OPT) to very clean $(PROGRAMS)"; \ + fi + +lint-common: FORCE + @if [ "$(BUILD_SRV)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) lint-srv; \ + else \ + echo "run configure with $(BUILD_OPT) to lint $(PROGRAMS)"; \ + fi + +5lint-common: FORCE + @if [ "$(BUILD_SRV)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) 5lint-srv; \ + else \ + echo "run configure with $(BUILD_OPT) to 5lint $(PROGRAMS)"; \ + fi + +depend-common: FORCE + @if [ "$(BUILD_SRV)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) depend-srv; \ + else \ + echo "run configure with $(BUILD_OPT) to depend $(PROGRAMS)"; \ + fi + +install-common: FORCE + @if [ "$(BUILD_SRV)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) install-srv; \ + else \ + echo "run configure with $(BUILD_OPT) to install $(PROGRAMS)"; \ + fi + +all-srv: all-local + +install-srv: all-srv install-local + +lint-srv: lint-local + $(LINT) $(DEFS) $(DEFINES) $(SRCS) + +5lint-srv: lint5-local + $(5LINT) $(DEFS) $(DEFINES) $(SRCS) + +clean-srv: clean-local + $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) *.o a.out core + +depend-srv: depend-local + $(MKDEP) $(DEFS) $(DEFINES) $(SRCS) + +veryclean-srv: clean-srv veryclean-local + +Makefile: $(top_srcdir)/build/srv.mk diff --git a/build/top.mk b/build/top.mk new file mode 100644 index 0000000000..a94504895f --- /dev/null +++ b/build/top.mk @@ -0,0 +1,108 @@ +## +## Copyright 1998 The OpenLDAP Foundation +## COPYING RESTRICTIONS APPLY. See COPYRIGHT File in top level directory +## of this package for details. +## +@SET_MAKE@ + +SHELL = /bin/sh + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@/ldap +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ + +MV = mv +LN = ln +LN_S = @LN_S@ +RM = rm -f +MAKEINFO = @MAKEINFO@ +RANLIB = @RANLIB@ +AR = ar + +LINT = lint +5LINT = 5lint +MKDEP = $(top_srcdir)/build/mkdep + +# Misc UNIX commands used in makefiles +SED = sed +DATE = date +HOSTNAME = uname -n +BASENAME = basename +PWD = pwd +CAT = cat +MKDIR = mkdir +CHMOD = chmod + +# Misc UNIX commands used in programs +EDITOR = @EDITOR@ +FINGER = @FINGER@ +SENDMAIL = @SENDMAIL@ + +# Version +VERSIONFILE = $(top_srcdir)/build/version + +INCLUDEDIR = $(top_srcdir)/include +LDAP_INCPATH = -I$(LDAP_INCDIR) -I$(INCLUDEDIR) +LDAP_LIBPATH = -L$(LDAP_LIBDIR) + +LDAP_LIBS = $(LDAP_LIBPATH) -lldif -lldap -llber +LDAP_LIBDEPEND = $(LDAP_LIBDIR)/libldif.a $(LDAP_LIBDIR)/libldap.a $(LDAP_LIBDIR)/liblber.a + +# AutoConfig generated +AC_CC = @CC@ +AC_DEFS = @CPPFLAGS@ @DEFS@ +AC_LIBS = @LDFLAGS@ @LIBS@ +AC_CFLAGS = @CFLAGS@ +AC_LDFLAGS = + +KRB_LIBS = @KRB_LIBS@ +TERMCAP_LIBS = @TERMCAP_LIBS@ + +# Our Defaults +CC = $(AC_CC) +DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS) +LIBS = $(LDAP_LIBS) $(XLIBS) $(AC_LIBS) + +CFLAGS = $(AC_CFLAGS) $(DEFS) $(DEFINES) +LDFLAGS = $(AC_LDFLAGS) + +all: all-common FORCE +install: install-common FORCE +clean: clean-common FORCE +veryclean: veryclean-common FORCE +depend: depend-common FORCE + +# empty local rules +all-local: +install-local: +clean-local: +veryclean-local: +depend-local: +lint-local: +lint5-local: + +Makefile: Makefile.in $(top_srcdir)/build/top.mk + +# empty rule for forcing rules +FORCE: + +##--------------------------------------------------------------------------- diff --git a/build/uname.sh b/build/uname.sh deleted file mode 100644 index fbb58ddd5c..0000000000 --- a/build/uname.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/sh -# simple BSD-like uname replacement for those systems without it -# -# Copyright (c) 1995 The Regents of the University of Michigan -# - - -# -# if /bin/uname or /usr/bin/uname exists, just use it -# ...unless we are on SCO, where the provided uname is bad -# -if [ ! -f /usr/bin/swconfig ]; then - if [ -f /bin/uname ]; then - exec /bin/uname $* - fi - - if [ -f /usr/bin/uname ]; then - exec /usr/bin/uname $* - fi -fi - - -# -# flags to keep track of what to output -# -PRINT_SYSTEM=0 -PRINT_VERSION=0 -PRINT_RELEASE=0 - -# -# process arguments -# -USAGE="usage: $0 [-s] [-v] [-r]" - -while [ $# != 0 ]; do - case "$1" in - -s) - PRINT_SYSTEM=1 - ;; - -v) - PRINT_VERSION=1 - ;; - -r) - PRINT_RELEASE=1 - ;; - *) - echo "$USAGE" - exit 1 - ;; - esac - shift -done - - -# -# print system name by default -# -if [ $PRINT_VERSION = "0" -a $PRINT_RELEASE = "0" ]; then - PRINT_SYSTEM=1 -fi - - -# -# default to unknown everything... -# -SYSTEM="Unknown-System" -VERSION="Unknown-Version" -RELEASE="Unknown-Release" - -# -# check to see if we are on a machine that runs NextSTEP or SCO -# -if [ -r /NextApps ]; then - SYSTEM="NeXTSTEP" -elif [ -f /usr/bin/swconfig ]; then - SYSTEM="SCO" -fi - - -# -# output requested information -# -OUTPUT=0 -if [ $PRINT_SYSTEM = "1" ]; then - echo -n "$SYSTEM" - OUTPUT=1 -fi - -if [ $PRINT_VERSION = "1" ]; then - if [ $OUTPUT = "1" ]; then - echo -n " $VERSION" - else - echo -n "$VERSION" - OUTPUT=1 - fi -fi - -if [ $PRINT_RELEASE = "1" ]; then - if [ $OUTPUT = "1" ]; then - echo -n " $RELEASE" - else - echo -n "$RELEASE" - OUTPUT=1 - fi -fi - -echo - -exit 0 diff --git a/build/unproto/Makefile b/build/unproto/Makefile deleted file mode 100644 index 2d7a98c7da..0000000000 --- a/build/unproto/Makefile +++ /dev/null @@ -1,123 +0,0 @@ -# @(#) Makefile 1.6 93/06/18 22:29:40 - -## BEGIN CONFIGURATION STUFF - -# In the unlikely case that your compiler has no hooks for alternate -# compiler passes, use a "cc cflags -E file.c | unproto >file.i" -# pipeline, then "cc cflags -c file.i" to compile the resulting -# intermediate file. -# -# Otherwise, the "/lib/cpp | unproto" pipeline can be packaged as an -# executable shell script (see the provided "cpp.sh" script) that should -# be installed as "/whatever/cpp". This script should then be specified -# to the C compiler as a non-default preprocessor. -# -# PROG = unproto -# PIPE = - -# The overhead and problems of shell script interpretation can be -# eliminated by having the unprototyper program itself open the pipe to -# the preprocessor. In that case, define the PIPE_THROUGH_CPP macro as -# the path name of the default C preprocessor (usually "/lib/cpp"), -# install the unprototyper as "/whatever/cpp" and specify that to the C -# compiler as a non-default preprocessor. -# -PROG = cpp -PIPE = -DPIPE_THROUGH_CPP=\"/lib/cpp\" - -# Some compilers complain about some #directives. The following is only a -# partial solution, because the directives are still seen by /lib/cpp. -# Be careful with filtering out #pragma, because some pre-ANSI compilers -# (SunOS) rely on its use. -# -# SKIP = -DIGNORE_DIRECTIVES=\"pragma\",\"foo\",\"bar\" -# -SKIP = - -# The bell character code depends on the character set. With ASCII, it is -# 7. Specify a string constant with exactly three octal digits. If you -# change this definition, you will have to update the example.out file. -# -BELL = -DBELL=\"007\" - -# Some C compilers have problems with "void". The nature of the problems -# depends on the age of the compiler. -# -# If your compiler does not understand "void" at all, compile with -# -DMAP_VOID. The unprototyper will replace "void *" by "char *", a -# (void) argument list by an empty one, and will replace all other -# instances of "void" by "int". -# -# If your compiler has problems with "void *" only, compile with -# -DMAP_VOID_STAR. The unprototyper will replace "void *" by "char *", -# and will replace a (void) argument list by an empty one. All other -# instances of "void" will be left alone. -# -# If neither of these are defined, (void) argument lists will be replaced -# by empty ones. -# -# MAP = -DMAP_VOID_STAR - -# Now that we have brought up the subject of antique C compilers, here's -# a couple of aliases that may be useful, too. -# -# ALIAS = -Dstrchr=index - -# If you need support for functions that implement ANSI-style variable -# length argument lists, edit the stdarg.h file provided with this -# package so that it contains the proper definitions for your machine. - -## END CONFIGURATION STUFF - -SHELL = /bin/sh - -CFILES = unproto.c tok_io.c tok_class.c tok_pool.c vstring.c symbol.c error.c \ - hash.c strsave.c -HFILES = error.h token.h vstring.h symbol.h -SCRIPTS = cpp.sh acc.sh -SAMPLES = stdarg.h stddef.h stdlib.h varargs.c example.c example.out -SOURCES = README $(CFILES) $(HFILES) Makefile $(SCRIPTS) $(SAMPLES) -FILES = $(SOURCES) unproto.1 -OBJECTS = tok_io.o tok_class.o tok_pool.o unproto.o vstring.o symbol.o error.o \ - hash.o strsave.o - -CFLAGS = -O $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -#CFLAGS = -O $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -p -Dstatic= -#CFLAGS = -g $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DDEBUG - -$(PROG): $(OBJECTS) - $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(MALLOC) - -# For linting, enable all bells and whistles. - -lint: - lint -DPIPE_THROUGH_CPP=\"foo\" -DIGNORE_DIRECTIVES=\"foo\",\"bar\" \ - $(BELL) -DMAP_VOID $(ALIAS) $(CFILES) - -# Testing requires that the program is compiled with -DDEBUG. - -test: $(PROG) cpp example.c example.out - ./cpp example.c >example.tmp - @echo the following diff command should produce no output - diff -b example.out example.tmp - rm -f example.tmp - -shar: $(FILES) - @shar $(FILES) - -archive: - $(ARCHIVE) $(SOURCES) - -clean: - rm -f *.o core cpp unproto mon.out varargs.o varargs example.tmp - -error.o : error.c token.h error.h Makefile -hash.o : hash.c Makefile -strsave.o : strsave.c error.h Makefile -symbol.o : symbol.c error.h token.h symbol.h Makefile -tok_class.o : tok_class.c error.h vstring.h token.h symbol.h Makefile -tok_io.o : tok_io.c token.h vstring.h error.h Makefile -tok_pool.o : tok_pool.c token.h vstring.h error.h Makefile -unproto.o : unproto.c vstring.h stdarg.h token.h error.h symbol.h Makefile -varargs.o : varargs.c stdarg.h Makefile -vstring.o : vstring.c vstring.h Makefile diff --git a/build/unproto/README b/build/unproto/README deleted file mode 100644 index 10748743ec..0000000000 --- a/build/unproto/README +++ /dev/null @@ -1,160 +0,0 @@ -@(#) README 1.6 93/06/18 22:29:34 - -unproto - Compile ANSI C with traditional UNIX C compiler - -Description: ------------- - -This is a filter that sits in between the UNIX C preprocessor and the -next UNIX C compiler stage, on the fly transforming ANSI C syntax to -old C syntax. Line number information is preserved so that compiler -diagnostics still make sense. It runs at roughly the same speed as -/lib/cpp, so it has negligible impact on compilation time. - -Typically, the program is invoked by the native UNIX C compiler as an -alternate preprocessor. The unprototyper in turn invokes the native C -preprocessor and massages its output. Similar tricks can be used with -the lint(1) command. Details are given below. - -The filter rewrites ANSI-style function headings, function pointer -types and type casts, function prototypes, and combinations thereof. -Unlike some other unprototypers, this one is fully recursive and does -not depend on source file layout (see the example.c file). - -Besides the rewriting of argument lists, the program does the following -transformations: string concatenation, conversion of \a and \x escape -sequences to their octal equivalents, translation of the __TIME__ and -__DATE__ macros, optional mapping of `void *' to `char *', and optional -mapping of plain `void' to `int'. - -The unprototyper provides hooks for compilers that require special -tricks for variadic functions (fortunately, many don't). -support is provided for sparc, mips, mc68k, 80x86, vax, and others. - -The program has been tested with SunOS 4.1.1 (sparc), Ultrix 4.0 and -4.2 (mips), and Microport System V Release 2 (80286). It should work -with almost every PCC-based UNIX C compiler. - -Restrictions: -------------- - -A description of restrictions and workarounds can be found in the -unproto.1 manual page. - -Problems fixed with this release: ---------------------------------- - -Prototypes and definitions of functions returning pointer to function -were not rewritten to old style. - -Operation: ----------- - -This package implements a non-default C preprocessor (the output from -the default C preprocessor being piped through the unprototyper). How -one tells the C compiler to use a non-default preprocessor program is -somewhat compiler-dependent: - - SunOS 4.x: cc -Qpath directory_with_alternate_cpp ... - - Ultrix 4.x: cc -tp -hdirectory_with_alternate_cpp -B ... - - System V.2: cc -Bdirectory_with_alternate_cpp/ -tp ... - -Examples of these, and others, can be found in the acc.sh shell script -that emulates an ANSI C compiler. Your C compiler manual page should -provide the necessary information. - -A more portable, but less efficient, approach relies on the observation -that almost every UNIX C compiler supports the -E (write preprocessor -output to stdout) and -P options (preprocess file.c into file.i). Just -add the following lines to your Makefiles: - - .c.o: - $(CC) $(CFLAGS) -E $*.c | unproto >$*.i # simulate -P option - $(CC) $(CFLAGS) -c $*.i - rm -f $*.i - -On some systems the lint(1) command is just a shell script, and writing -a version that uses the unprototyper should not be too hard. With SunOS -4.x, /usr/bin/lint is not a shell script, but it does accept the same -syntax as the cc(1) command for the specification of a non-default -compiler pass. - -You may have to do some research on the lint command provided with your -own machine. - -Configuration: --------------- - -Check the contents of the `stdarg.h' file provided with this package. -This file serves a dual purpose: (1) on systems that do not provide a -stdarg.h file, it should be included by C source files that implements -ANSI-style variadic functions; (2) it is also used to configure the -unprototyper so that it emits the proper magic when it sees `...'. - -The `stdarg.h' file has support for sparc, mips, and for compilers that -pass arguments via the stack (typical for 80*86, mc68k and vax). It -gives general hints for other compilers. - -The other sample header files (stddef.h and stdlib.h) are not required -to build the unprototyper. - -The `varargs.c' file provided with this package can be used to verify -that the `stdarg.h' file has been set up correctly. - -If your C compiler has no hooks for an alternate preprocessor (the -unprototyper will be used as: `cc cflags -E file.c | unproto >file.i'), -build the `unproto' executable without the `PIPE_THROUGH_CPP' feature. -Details are given in the Makefile. - -Otherwise, the `cpp.sh' shell script can be used to set up the pipe -between the native C preprocessor and the unprototyper command. The -script assumes that the unprototyper binary is called `unproto', and -that it was compiled without the `PIPE_THROUGH_CPP' feature. See the -Makefile and the `cpp.sh' script for details and for a description of -possible problems with this approach. - -The overhead and problems of shell-script interpretation can be avoided -by letting the unprototyper itself pipe its standard input through the -C preprocessor. For this mode of operation, the unprototyper binary -should be called `cpp', and the `unproto.c' source file should be -compiled with the `PIPE_THROUGH_CPP' macro defined as the absolute -pathname of the native C preprocessor (usually `/lib/cpp'). See the -Makefile for details. - -Installation: -------------- - -Install the `unproto.1' manual page in a suitable place. If your system -does not provide a `stdarg.h' file, find a suitable place for the one -provided with the unprototyper and install it there. The same goes for -the sample stddef.h and stdlib.h files; make sure that the definitions -in there apply to your environment. Most or all of the latter files are -already part of Ultrix 4.x and SunOS 4.1.1. - -The ANSI float.h and limits.h files can be generated with the config -program by Steve Pemberton (comp.sources.misc volume 10, issue 62, -available from ftp.uu.net as comp.sources.misc/volume10/config42.Z). - -If you run the unprototyper with "cc -E" just install the `unproto' -binary; the `cpp' and `acc' shell scripts will not be needed. - -If you use the `cpp' shell script to pipe the preprocessor output -through the unprototyper program, install the `unproto' binary in a -place where the `cpp' shell script can find it, and install the `cpp' -shell script in a suitable place. Edit the `acc' shell script and -install it in a suitable place. From now on, type `acc' instead of -`cc'. - -If the unprototyper itself opens the pipe to the C preprocessor (i.e. -the unprototyper was built with the `PIPE_THROUGH_CPP' macro defined), -install the `cpp' unprototyper binary in a suitable place. Edit the -`acc' shell script and install it in a suitable place. From now on, -type `acc' instead of `cc'. - - Wietse Venema - wietse@wzv.win.tue.nl - Mathematics and Computing Science - Eindhoven University of Technology - The Netherlands diff --git a/build/unproto/acc.sh b/build/unproto/acc.sh deleted file mode 100755 index 124e700d01..0000000000 --- a/build/unproto/acc.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -# @(#) acc.sh 1.1 93/06/18 22:29:42 -# -# Script to emulate most of an ANSI C compiler with a traditional UNIX -# C compiler. - -# INCDIR should be the directory with auxiliary include files from the -# unproto source distribution (stdarg.h, stdlib.h, stddef.h, and other -# stuff that is missing from your compilation environment). With Ultrix -# 4.[0-2] you need unproto's stdarg.h even though the system provides -# one. -# -INCDIR=. - -# CPPDIR should be the directory with the unprototypeing cpp filter -# (preferably the version with the PIPE_THROUGH_CPP feature). -# -CPPDIR=. - -# DEFINES: you will want to define volatile and const, and maybe even -# __STDC__. -# -DEFINES="-Dvolatile= -Dconst= -D__STDC__" - -# Possible problem: INCDIR should be listed after the user-specified -I -# command-line options, not before them as we do here. This is a problem -# only if you attempt to redefine system libraries. -# -# Choose one of the commands below that is appropriate for your system. -# -exec cc -Qpath ${CPPDIR} -I${INCDIR} ${DEFINES} "$@" # SunOS 4.x -exec cc -tp -h${CPPDIR} -B -I${INCDIR} ${DEFINES} "$@" # Ultrix 4.2 -exec cc -Yp,${CPPDIR} -I${INCDIR} ${DEFINES} "$@" # M88 SysV.3 -exec cc -B${CPPDIR}/ -tp -I${INCDIR} ${DEFINES} "$@" # System V.2 diff --git a/build/unproto/cpp.sh b/build/unproto/cpp.sh deleted file mode 100755 index a0391461ea..0000000000 --- a/build/unproto/cpp.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -# @(#) cpp.sh 1.3 92/01/15 21:53:22 - -# Unprototypeing preprocessor for pre-ANSI C compilers. On some systems, -# this script can be as simple as: -# -# /lib/cpp "$@" | unproto -# -# However, some cc(1) drivers specify output file names on the -# preprocessor command line, so this shell script must be prepared to -# intercept them. Depending on the driver program, the cpp options may -# even go before or after the file name argument(s). The script below -# tries to tackle all these cases. -# -# You may want to add -Ipath_to_stdarg.h_file, -Dvoid=, -Dvolatile=, -# and even -D__STDC__. - -cpp_args="" - -while : -do - case $1 in - "") break;; - -*) cpp_args="$cpp_args $1";; - *) cpp_args="$cpp_args $1" - case $2 in - ""|-*) ;; - *) exec 1> $2 || exit 1; shift;; - esac;; - esac - shift -done - -/lib/cpp $cpp_args | unproto diff --git a/build/unproto/error.c b/build/unproto/error.c deleted file mode 100644 index 667d978cbb..0000000000 --- a/build/unproto/error.c +++ /dev/null @@ -1,97 +0,0 @@ -/*++ -/* NAME -/* error 3 -/* SUMMARY -/* diagnostics -/* PACKAGE -/* unproto -/* SYNOPSIS -/* #include "error.h" -/* -/* int errcount; -/* -/* void error(text) -/* char *text; -/* -/* void error_where(path, line, text) -/* char *path; -/* int line; -/* char *text; -/* -/* void fatal(text) -/* char *text; -/* DESCRIPTION -/* The routines in this file print a diagnostic (text). Some also -/* terminate the program. Upon each error*() call, the errcount variable -/* is incremented. -/* -/* error() provides a default context, i.e. the source-file -/* coordinate of the last read token. -/* -/* error_where() allows the caller to explicitly specify context: path -/* is a source-file name, and line is a line number. -/* -/* fatal() is like error() but terminates the program with a non-zero -/* exit status. -/* -/* context is ignored if the line number is zero or if the path -/* is an empty string. -/* AUTHOR(S) -/* Wietse Venema -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* LAST MODIFICATION -/* 92/01/15 21:53:10 -/* VERSION/RELEASE -/* 1.2 -/*--*/ - -static char error_sccsid[] = "@(#) error.c 1.2 92/01/15 21:53:10"; - -/* C library */ - -#include - -extern void exit(); - -/* Application-specific stuff */ - -#include "token.h" -#include "error.h" - -int errcount = 0; /* error counter */ - -/* error - report problem (implicit context) */ - -void error(text) -char *text; -{ - error_where(in_path, in_line, text); -} - -/* error_where - report problem (explicit context) */ - -void error_where(path, line, text) -char *path; -int line; -char *text; -{ - errcount++; - - /* Suppress context info if there is none. */ - - if (line && path[0]) - fprintf(stderr, "%s, line %d: ", path, line); - - fprintf(stderr, "%s\n", text); -} - -/* fatal - report problem and terminate unsuccessfully */ - -void fatal(text) -char *text; -{ - error(text); - exit(1); -} diff --git a/build/unproto/error.h b/build/unproto/error.h deleted file mode 100644 index dfb27e9067..0000000000 --- a/build/unproto/error.h +++ /dev/null @@ -1,6 +0,0 @@ -/* @(#) error.h 1.2 92/01/15 21:53:14 */ - -extern int errcount; /* error counter */ -extern void error(); /* default context */ -extern void error_where(); /* user-specified context */ -extern void fatal(); /* fatal error */ diff --git a/build/unproto/example.c b/build/unproto/example.c deleted file mode 100644 index bf2f838f2a..0000000000 --- a/build/unproto/example.c +++ /dev/null @@ -1,222 +0,0 @@ - /* - * @(#) example.c 1.5 93/06/18 22:29:46 - * - * Examples of things that can be done with the unproto package - */ - -typedef char *charstar; - - /* - * New-style argument list with structured argument, one field being pointer - * to function returning pointer to function with function-pointer argument - */ - -x(struct { - struct { - int (*(*foo) (int (*arg1) (double))) (float arg2); - } foo; -} baz) { - return (0); -} - - /* New-style function-pointer declaration. */ - -int (*(*bar0) (float)) (int); - - /* Old-style argument list with new-style argument type. */ - -baz0(bar) -int (*(*bar) (float)) (int); -{} - - /* - * New-style argument list with new-style argument type, declaration - * embedded within block. Plus a couple assignments with function calls that - * look like casts. - */ - -foo(int (*(*bar) (float)) (int)) -{ - int (*baz) (int) = (int (*) (int)) 0, - y = (y * (*baz) (y)), - *(*z) (int) = (int *(*) (int)) 0; - - struct { int (*foo)(int); } *(*s)(int) = - (struct { int (*foo)(int); } *(*)(int)) 0; - - { - y = (y * (*baz) (y)); - } - { - z = (int *(*) (int)) 0; - } - { - s = (struct { int (*foo)(int); } *(*)(int)) 0; - } - - return (0); -} - -/* Multiple declarations in one statement */ - -test1() -{ - int foo2,*(*(*bar)(int))(float),*baz(double); -} - -/* Discriminate declarations from executable statements */ - -test2(charstar y) -{ - int foo = 5,atoi(charstar); - - foo = 5,atoi(y); -} - -/* Declarations without explicit type */ - -test3,test4(int); - -test5(int y) -{ - { - test3; - } - { - test4(y); - } -} - -test6[1],test7(int); - -test7(int x) -{ - { - test6[1]; - } - { - test7(x); - } -} - -/* Checking a complicated cast */ - -struct { - struct { - int (*f)(int), o; - } bar; -} (*baz2)(int) = (struct { struct { int (*f)(int), o; } bar; } (*)(int)) 0; - -/* Distinguish things with the same shape but with different meaning */ - -test8(x) -{ - { - struct { - int foo; - } bar(charstar); - } - { - do { - int foo; - } while (x); - } -} - -/* Do not think foo(*bar) is a function pointer declaration */ - -test9(char *bar) -{ - foo(*bar); -} - -/* another couple of special-cased words. */ - -test10(int x) -{ - { - int test10(int); - do test10(x); - while (x); - } - { - return test10(x); - } -} - -test11(int *x) -{ - while (*x) - (putchar(*x++)); -} - -test11a(int *x) -{ - for (*x;;) - (putchar(*x++)); -} - -/* #include directive between stuff that requires lookahead */ - -test12() -{ - char *x = "\xf\0002\002\02\2" /* foo */ -#include "/dev/null" - "\abar"; - - printf("foo" /* 1 */ "bar" /* 2 */ "baz"); - - *x = '\a'; - *x = '\xff'; -} - -int test13(void); - -/* line continuations in the middle of tokens */ - -te\ -st14(); -charstar test15 = "foo\ -bar"; -char test16 = "foo\\ -abar"; - -/* Array dimensions with unexpanded macros */ - -test17(charstar foo[bar]){} - -int (*(*test18[bar])(charstar))(charstar) = \ - (int (*(*[bar])(charstar))(charstar)) 0; - -/* Function returning pointer to function */ - -int (*(*test19(long))(int))(double); - -/* GCC accepts the following stuff, K&R C does not... */ - -void test20(int test21(double)) {} - -void test22(struct { int foo; } test23(short)) {} - -/* Do not blindly rewrite (*name(stuff))(otherstuff) */ - -void test23() -{ - int (*test24(int)) (int), - y = (*test24(2)) (3), - z = ((*test24(2)) (3)); -} - -/* Function returning pointer to function */ - -int (*(*test25(long foo))(int bar))(double baz){ /* body */ } - -int (*(*test26(foo))())() -long foo; -{ /* body */ } - -#define ARGSTR() struct {int l; char c[1];} - -void functie(ARGSTR() *cmdlin, ARGSTR() *c1) -{ -} diff --git a/build/unproto/example.out b/build/unproto/example.out deleted file mode 100644 index 0b14e1b8ae..0000000000 --- a/build/unproto/example.out +++ /dev/null @@ -1,271 +0,0 @@ -# 1 "example.c" - - - - - - -typedef char *charstar; - - - - - - -x( - - - -baz) -# 14 "example.c" -struct { - struct { - int (*(*foo)())(); - } foo; -} baz; -# 18 "example.c" -{/*1*/ - /* end dcls */return (0); -}/*1*/ - - - -int (*(*bar0)())(); - - - -baz0(bar) -int (*(*bar)())(); -{/*1*/}/*1*/ - - - - - - - -foo(bar) -# 38 "example.c" -int (*(*bar)())(); -{/*1*/ - int (*baz)()= (int (*)()) 0, - y = (y * (*baz)(y)), - *(*z)()= (int *(*)()) 0; - - struct {/*2*/ int (*foo)(); }/*2*/ *(*s)()= - (struct { int (*foo)(); } *(*)()) 0; - - /* end dcls */{/*2*/ - y /* end dcls */= (y * (*baz)(y)); - }/*2*/ - {/*2*/ - z /* end dcls */= (int *(*)()) 0; - }/*2*/ - {/*2*/ - s /* end dcls */= (struct { int (*foo)(); } *(*)()) 0; - }/*2*/ - - return (0); -}/*1*/ - - - -test1() -{/*1*/ - int foo2,*(*(*bar)())(),*baz(); -}/*1*/ - - - -test2(y) -# 69 "example.c" -charstar y; -{/*1*/ - int foo = 5,atoi(); - - foo /* end dcls */= 5,atoi(y); -}/*1*/ - - - -test3,test4(); - -test5(y) -# 80 "example.c" -int y; -{/*1*/ - /* end dcls */{/*2*/ - test3/* end dcls */; - }/*2*/ - {/*2*/ - test4/* end dcls */(y); - }/*2*/ -}/*1*/ - -test6[1],test7(); - -test7(x) -# 92 "example.c" -int x; -{/*1*/ - /* end dcls */{/*2*/ - test6/* end dcls */[1]; - }/*2*/ - {/*2*/ - test7/* end dcls */(x); - }/*2*/ -}/*1*/ - - - -struct {/*1*/ - struct {/*2*/ - int (*f)(), o; - }/*2*/ bar; -}/*1*/ (*baz2)()= (struct { struct { int (*f)(), o; } bar; } (*)()) 0; - - - -test8(x) -{/*1*/ - /* end dcls */{/*2*/ - struct {/*3*/ - int foo; - }/*3*/ bar(); - }/*2*/ - {/*2*/ - /* end dcls */do {/*3*/ - int foo; - }/*3*/ while (x); - }/*2*/ -}/*1*/ - - - -test9(bar) -# 128 "example.c" -char *bar; -{/*1*/ - foo/* end dcls */(*bar); -}/*1*/ - - - -test10(x) -# 135 "example.c" -int x; -{/*1*/ - /* end dcls */{/*2*/ - int test10(); - /* end dcls */do test10(x); - while (x); - }/*2*/ - {/*2*/ - /* end dcls */return test10(x); - }/*2*/ -}/*1*/ - -test11(x) -# 147 "example.c" -int *x; -{/*1*/ - /* end dcls */while (*x) - (putchar(*x++)); -}/*1*/ - -test11a(x) -# 153 "example.c" -int *x; -{/*1*/ - /* end dcls */for (*x;;) - (putchar(*x++)); -}/*1*/ - - - -test12() -{/*1*/ - char *x = -# 1 "/dev/null" 1 -# 165 "example.c" 2 -# 163 "example.c" -"\017\0002\002\002\002\007bar" - - ; - - printf/* end dcls */("foobarbaz" ); - - *x = '\007'; - *x = '\377'; -}/*1*/ - -int test13(); - - - -test14(); - -charstar test15 = "foobar"; - -char test16 = "foo\007bar"; - - - - -test17(foo) -# 186 "example.c" -charstar foo[bar]; -# 186 "example.c" -{/*1*/}/*1*/ - -int (*(*test18[bar])())()= (int (*(*[bar])())()) 0; - - - - -int (*(*test19())())(); - - - -void test20(test21) -# 197 "example.c" -int test21(); -# 197 "example.c" -{/*1*/}/*1*/ - -void test22(test23) -# 199 "example.c" -struct { int foo; } test23(); -# 199 "example.c" -{/*1*/}/*1*/ - - - -void test23() -{/*1*/ - int (*test24())(), - y = (*test24(2)) (3), - z = ((*test24(2))(3)); -}/*1*/ - - - -int (*(*test25(foo))())() -# 212 "example.c" -long foo; -# 212 "example.c" -{/*1*/ }/*1*/ - -int (*(*test26(foo))())() -long foo; -{/*1*/ }/*1*/ - - - -void functie(cmdlin,c1) -# 220 "example.c" -struct {int l; char c[1];} *cmdlin; -# 220 "example.c" -struct {int l; char c[1];} *c1; -{/*1*/ -}/*1*/ diff --git a/build/unproto/hash.c b/build/unproto/hash.c deleted file mode 100644 index 153f6b7df9..0000000000 --- a/build/unproto/hash.c +++ /dev/null @@ -1,54 +0,0 @@ -/*++ -/* NAME -/* hash 3 -/* SUMMARY -/* compute hash value for string -/* SYNOPSIS -/* int hash(string, size) -/* char *string; -/* int size; -/* DESCRIPTION -/* This function computes for the given null-terminated string an -/* integer hash value in the range 0..size-1. -/* SEE ALSO -/* .fi -/* Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman: Compilers: -/* principles, techniques and tools; Addison-Wesley, Amsterdam, 1986. -/* AUTHOR(S) -/* Wietse Venema -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* -/* Originally written by: P. J. Weinberger at Bell Labs. -/* LAST MODIFICATION -/* 92/01/15 21:53:12 -/* VERSION/RELEASE -/* %I -/*--*/ - -static char hash_sccsid[] = "@(#) hash.c 1.1 92/01/15 21:53:12"; - -/* hash - hash a string; original author: P. J. Weinberger at Bell Labs. */ - -int hash(s, size) -register char *s; -unsigned size; -{ - register unsigned long h = 0; - register unsigned long g; - - /* - * For a performance comparison with the hash function presented in K&R, - * first edition, see the "Dragon" book by Aho, Sethi and Ullman. - */ - - while (*s) { - h = (h << 4) + *s++; - if (g = (h & 0xf0000000)) { - h ^= (g >> 24); - h ^= g; - } - } - return (h % size); -} diff --git a/build/unproto/stdarg.h b/build/unproto/stdarg.h deleted file mode 100644 index 20f6fe7727..0000000000 --- a/build/unproto/stdarg.h +++ /dev/null @@ -1,90 +0,0 @@ - /* - * @(#) stdarg.h 1.4 93/06/18 22:29:44 - * - * Sample stdarg.h file for use with the unproto filter. - * - * This file serves two purposes. - * - * 1 - On systems that do not have a /usr/include/stdarg.h file, it should be - * included by C source files that implement ANSI-style variadic functions. - * Ultrix 4.[0-2] comes with stdarg.h but still needs the one that is - * provided with the unproto filter. - * - * 2 - To configure the unprototyper itself. If the _VA_ALIST_ macro is - * defined, its value will appear in the place of the "..." at the end of - * argument lists of variadic function *definitions* (not declarations). - * Some compilers (such as Greenhills m88k) have a non-empty va_dcl - * definition in the system header file varargs.h. If that is the case, - * define "_VA_DCL_" with the same value as va_dcl. If _VA_DCL_ is defined, - * the unprototyper will emit its value just before the opening "{". - * - * Compilers that always pass arguments via the stack can use the default code - * at the end of this file (this usually applies for the vax, mc68k and - * 80*86 architectures). - * - * Special tricks are needed for compilers that pass some or all function - * arguments via registers. Examples of the latter are given for the mips - * and sparc architectures. Usually the compiler special-cases an argument - * declaration such as "va_alist" or "__builtin_va_alist". For inspiration, - * see the local /usr/include/varargs.h file. - * - * You can use the varargs.c program provided with the unproto package to - * verify that the stdarg.h file has been set up correctly. - */ - -#ifdef sparc /* tested with SunOS 4.1.1 */ - -#define _VA_ALIST_ "__builtin_va_alist" -typedef char *va_list; -#define va_start(ap, p) (ap = (char *) &__builtin_va_alist) -#define va_arg(ap, type) ((type *) __builtin_va_arg_incr((type *) ap))[0] -#define va_end(ap) - -#else -#ifdef mips /* tested with Ultrix 4.0 and 4.2 */ - -#define _VA_ALIST_ "va_alist" -#include "/usr/include/stdarg.h" - -#else -#ifdef m88k /* Motorola SYSTEM V/88 R32V3 */ - -#define _VA_ALIST_ "va_alist" -#define _VA_DCL_ "va_type va_alist;" -typedef struct _va_struct { - int va_narg; - int *va_stkaddr; - int *va_iregs; -} va_list; -#define va_start(ap, p) \ -((ap).va_narg=(int *)&va_alist-va_stkarg, \ - (ap).va_stkaddr=va_stkarg, \ - (ap).va_iregs=(int *)va_intreg) -#define va_end(p) -#if defined(LittleEndian) -#define va_arg(p,mode) \ - (*(mode *)_gh_va_arg(&p, va_align(mode), va_regtyp(mode), sizeof(mode))) -#else /* defined(LittleEndian) */ -#define va_arg(p,mode) ( \ - (p).va_narg += ((p).va_narg & (va_align(mode) == 8)) + \ - (sizeof(mode)+3)/4, \ - ((mode *)((va_regtyp(mode) && (p).va_narg <= 8 ? \ - (p).va_iregs: \ - (p).va_stkaddr) + (p).va_narg))[-1]) -#endif /* defined(LittleEndian) */ - -#else -#ifdef hpux -#include - -#else /* vax, mc68k, 80*86 */ - -typedef char *va_list; -#define va_start(ap, p) (ap = (char *) (&(p)+1)) -#define va_arg(ap, type) ((type *) (ap += sizeof(type)))[-1] -#define va_end(ap) - -#endif /* hpux */ -#endif /* m88k */ -#endif /* mips */ -#endif /* sparc */ diff --git a/build/unproto/stddef.h b/build/unproto/stddef.h deleted file mode 100644 index 97dbc01048..0000000000 --- a/build/unproto/stddef.h +++ /dev/null @@ -1,23 +0,0 @@ -/* @(#) stddef.h 1.1 92/02/15 17:25:46 */ - -#ifndef _stddef_h_ -#define _stddef_h_ - -/* NULL is also defined in */ - -#ifndef NULL -#define NULL 0 -#endif - -/* Structure member offset - some compilers barf on this. */ - -#define offsetof(type, member) ((size_t) &((type *)0)->member) - -/* Some of the following types may already be defined in . */ - -/* #include */ -/* typedef long ptrdiff_t; /* type of pointer difference */ -/* typedef unsigned short wchar_t; /* wide character type */ -/* typedef unsigned size_t; /* type of sizeof */ - -#endif /* _stddef_h_ */ diff --git a/build/unproto/stdlib.h b/build/unproto/stdlib.h deleted file mode 100644 index 78d99dd983..0000000000 --- a/build/unproto/stdlib.h +++ /dev/null @@ -1,53 +0,0 @@ -/* @(#) stdlib.h 1.1 92/02/15 17:25:45 */ - -#ifndef _stdlib_h_ -#define _stdlib_h_ - -/* NULL is also defined in */ - -#ifndef NULL -#define NULL 0 -#endif - -/* - * Some functions in this file will be missing from the typical pre-ANSI - * UNIX library. Some pre-ANSI UNIX library functions have return types - * that differ from what ANSI requires. - */ - -extern double atof(); -extern int atoi(); -extern long atol(); -extern double strtod(); -extern long strtol(); -extern unsigned long strtoul(); -extern int rand(); -extern void srand(); -extern char *calloc(); -extern char *malloc(); -extern char *realloc(); -extern void free(); -extern void abort(); -extern void exit(); -extern int atextit(); -extern int system(); -extern char *getenv(); -extern char *bsearch(); -extern void qsort(); -extern int abs(); -extern long labs(); - -typedef struct { - int quot; - int rem; -} div_t; - -typedef struct { - long quot; - long rem; -} ldiv_t; - -extern div_t div(); -extern ldiv_t ldiv(); - -#endif /* _stdlib_h_ */ diff --git a/build/unproto/strsave.c b/build/unproto/strsave.c deleted file mode 100644 index c2a4b15e5b..0000000000 --- a/build/unproto/strsave.c +++ /dev/null @@ -1,71 +0,0 @@ -/*++ -/* NAME -/* strsave 3 -/* SUMMARY -/* maintain unique copy of a string -/* SYNOPSIS -/* char *strsave(string) -/* char *string; -/* DESCRIPTION -/* This function returns a pointer to an unique copy of its -/* argument. -/* DIAGNOSTISC -/* strsave() calls fatal() when it runs out of memory. -/* AUTHOR(S) -/* Wietse Venema -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* LAST MODIFICATION -/* 92/01/15 21:53:13 -/* VERSION/RELEASE -/* 1.1 -/*--*/ - -static char strsave_sccsid[] = "@(#) strsave.c 1.1 92/01/15 21:53:13"; - -/* C library */ - -extern char *strcpy(); -extern char *malloc(); - -/* Application-specific stuff */ - -#include "error.h" - -#define STR_TABSIZE 100 - -struct string { - char *strval; /* unique string copy */ - struct string *next; /* next one in hash chain */ -}; - -static struct string *str_tab[STR_TABSIZE] = {0,}; - -/* More string stuff. Maybe it should go to an #include file. */ - -#define STREQ(x,y) (*(x) == *(y) && strcmp((x),(y)) == 0) - -/* strsave - save unique copy of string */ - -char *strsave(str) -register char *str; -{ - register struct string *s; - register int where = hash(str, STR_TABSIZE); - - /* Look for existing entry. */ - - for (s = str_tab[where]; s; s = s->next) - if (STREQ(str, s->strval)) - return (s->strval); - - /* Add new entry. */ - - if ((s = (struct string *) malloc(sizeof(*s))) == 0 - || (s->strval = malloc(strlen(str) + 1)) == 0) - fatal("out of memory"); - s->next = str_tab[where]; - str_tab[where] = s; - return (strcpy(s->strval, str)); -} diff --git a/build/unproto/symbol.c b/build/unproto/symbol.c deleted file mode 100644 index ce9f7d9a01..0000000000 --- a/build/unproto/symbol.c +++ /dev/null @@ -1,144 +0,0 @@ -/*++ -/* NAME -/* symbol 3 -/* SUMMARY -/* rudimentary symbol table package -/* SYNOPSIS -/* #include "symbol.h" -/* -/* void sym_init() -/* -/* void sym_enter(name, type) -/* char *name; -/* int type; -/* -/* struct symbol *sym_find(name) -/* char *name; -/* DESCRIPTION -/* This is a rudimentary symbol-table package, just enough to -/* keep track of a couple of C keywords. -/* -/* sym_init() primes the table with C keywords. At present, most of -/* the keywords that have to do with types are left out. -/* We need a different strategy to detect type definitions because -/* we do not keep track of typedef names. -/* -/* sym_enter() adds an entry to the symbol table. -/* -/* sym_find() locates a symbol table entry (it returns 0 if -/* it is not found). -/* AUTHOR(S) -/* Wietse Venema -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* LAST MODIFICATION -/* 92/02/15 18:59:56 -/* VERSION/RELEASE -/* 1.4 -/*--*/ - -static char symbol_sccsid[] = "@(#) symbol.c 1.4 92/02/15 18:59:56"; - -/* C library */ - -extern char *strcpy(); -extern char *malloc(); - -/* Application-specific stuff */ - -#include "error.h" -#include "token.h" -#include "symbol.h" - -#define SYM_TABSIZE 20 - -static struct symbol *sym_tab[SYM_TABSIZE] = {0,}; - -/* More string stuff. Maybe it should go to an #include file. */ - -#define STREQ(x,y) (*(x) == *(y) && strcmp((x),(y)) == 0) - -/* sym_enter - enter symbol into table */ - -void sym_enter(name, type) -char *name; -int type; -{ - struct symbol *s; - int where; - - if ((s = (struct symbol *) malloc(sizeof(*s))) == 0 - || (s->name = malloc(strlen(name) + 1)) == 0) - fatal("out of memory"); - (void) strcpy(s->name, name); - s->type = type; - - where = hash(name, SYM_TABSIZE); - s->next = sym_tab[where]; - sym_tab[where] = s; -} - -/* sym_find - locate symbol definition */ - -struct symbol *sym_find(name) -register char *name; -{ - register struct symbol *s; - - /* - * This function is called for almost every "word" token, so it better be - * fast. - */ - - for (s = sym_tab[hash(name, SYM_TABSIZE)]; s; s = s->next) - if (STREQ(name, s->name)) - return (s); - return (0); -} - - /* - * Initialization data for symbol table. We do not enter keywords for types. - * We use a different strategy to detect type declarations because we do not - * keep track of typedef names. - */ - -struct sym { - char *name; - int tokno; -}; - -static struct sym syms[] = { - "if", TOK_CONTROL, - "else", TOK_CONTROL, - "for", TOK_CONTROL, - "while", TOK_CONTROL, - "do", TOK_CONTROL, - "switch", TOK_CONTROL, - "case", TOK_CONTROL, - "default", TOK_CONTROL, - "return", TOK_CONTROL, - "continue", TOK_CONTROL, - "break", TOK_CONTROL, - "goto", TOK_CONTROL, - "struct", TOK_COMPOSITE, - "union", TOK_COMPOSITE, - "__DATE__", TOK_DATE, - "__TIME__", TOK_TIME, -#if defined(MAP_VOID_STAR) || defined(MAP_VOID) - "void", TOK_VOID, -#endif - "asm", TOK_OTHER, - 0, -}; - -/* sym_init - enter known keywords into symbol table */ - -void sym_init() -{ - register struct sym *p; - - for (p = syms; p->name; p++) - sym_enter(p->name, p->tokno); -} - diff --git a/build/unproto/symbol.h b/build/unproto/symbol.h deleted file mode 100644 index 0711c1f4dc..0000000000 --- a/build/unproto/symbol.h +++ /dev/null @@ -1,11 +0,0 @@ -/* @(#) symbol.h 1.1 91/09/22 21:21:42 */ - -struct symbol { - char *name; /* symbol name */ - int type; /* symbol type */ - struct symbol *next; -}; - -extern void sym_enter(); /* add symbol to table */ -extern struct symbol *sym_find(); /* locate symbol */ -extern void sym_init(); /* prime the table */ diff --git a/build/unproto/tok_class.c b/build/unproto/tok_class.c deleted file mode 100644 index 38ccd0d76e..0000000000 --- a/build/unproto/tok_class.c +++ /dev/null @@ -1,432 +0,0 @@ -/*++ -/* NAME -/* tok_class 3 -/* SUMMARY -/* token classification -/* PACKAGE -/* unproto -/* SYNOPSIS -/* #include "token.h" -/* -/* void tok_unget(t) -/* struct token *t; -/* -/* struct token *tok_class() -/* DESCRIPTION -/* tok_class() collects single and composite tokens, and -/* recognizes keywords. -/* At present, the only composite tokens are ()-delimited, -/* comma-separated lists, and non-whitespace tokens with attached -/* whitespace or comment tokens. -/* -/* Source transformations are: __DATE__ and __TIME__ are rewritten -/* to string constants with the current date and time, respectively. -/* Multiple string constants are concatenated. Optionally, "void *" -/* is mapped to "char *", and plain "void" to "int". -/* -/* tok_unget() implements an arbitrary amount of token pushback. -/* Only tokens obtained through tok_class() should be given to -/* tok_unget(). This function accepts a list of tokens in -/* last-read-first order. -/* DIAGNOSTICS -/* The code complains if input terminates in the middle of a list. -/* BUGS -/* Does not preserve white space at the beginning of a list element -/* or after the end of a list. -/* AUTHOR(S) -/* Wietse Venema -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* LAST MODIFICATION -/* 92/01/15 21:53:02 -/* VERSION/RELEASE -/* 1.4 -/*--*/ - -static char class_sccsid[] = "@(#) tok_class.c 1.4 92/01/15 21:53:02"; - -/* C library */ - -#include - -extern char *strcpy(); -extern long time(); -extern char *ctime(); - -/* Application-specific stuff */ - -#include "error.h" -#include "vstring.h" -#include "token.h" -#include "symbol.h" - -static struct token *tok_list(); -static void tok_list_struct(); -static void tok_list_append(); -static void tok_strcat(); -static void tok_time(); -static void tok_date(); -static void tok_space_append(); - -#if defined(MAP_VOID_STAR) || defined(MAP_VOID) -static void tok_void(); /* rewrite void keyword */ -#endif - -static struct token *tok_buf = 0; /* token push-back storage */ - -/* TOK_PREPEND - add token to LIFO queue, return head */ - -#define TOK_PREPEND(list,t) (t->next = list, list = t) - -/* tok_space_append - append trailing space except at start of or after list */ - -static void tok_space_append(list, t) -register struct token *list; -register struct token *t; -{ - - /* - * The head/tail fields of a token do triple duty. They are used to keep - * track of the members that make up a (list); to keep track of the - * non-blank tokens that make up one list member; and, finally, to tack - * whitespace and comment tokens onto the non-blank tokens that make up - * one list member. - * - * Within a (list), white space and comment tokens are always tacked onto - * the non-blank tokens to avoid parsing complications later on. For this - * reason, blanks and comments at the beginning of a list member are - * discarded because there is no token to tack them onto. (Well, we could - * start each list member with a dummy token, but that would mess up the - * whole unprototyper). - * - * Blanks or comments that follow a (list) are discarded, because the - * head/tail fields of a (list) are already being used for other - * purposes. - * - * Newlines within a (list) are discarded because they can mess up the - * output when we rewrite function headers. The output routines will - * regenerate discarded newlines, anyway. - */ - - if (list == 0 || list->tokno == TOK_LIST) { - tok_free(t); - } else { - tok_list_append(list, t); - } -} - -/* tok_class - discriminate single tokens, keywords, and composite tokens */ - -struct token *tok_class() -{ - register struct token *t; - register struct symbol *s; - - /* - * Use push-back token, if available. Push-back tokens are already - * canonical and can be passed on to the caller without further - * inspection. - */ - - if (t = tok_buf) { - tok_buf = t->next; - t->next = 0; - return (t); - } - /* Read a new token and canonicalize it. */ - - if (t = tok_get()) { - switch (t->tokno) { - case '(': /* beginning of list */ - t = tok_list(t); - break; - case TOK_WORD: /* look up keyword */ - if ((s = sym_find(t->vstr->str))) { - switch (s->type) { - case TOK_TIME: /* map __TIME__ to string */ - tok_time(t); - tok_strcat(t); /* look for more strings */ - break; - case TOK_DATE: /* map __DATE__ to string */ - tok_date(t); - tok_strcat(t); /* look for more strings */ - break; -#if defined(MAP_VOID_STAR) || defined(MAP_VOID) - case TOK_VOID: /* optionally map void types */ - tok_void(t); - break; -#endif - default: /* other keyword */ - t->tokno = s->type; - break; - } - } - break; - case '"': /* string, look for more */ - tok_strcat(t); - break; - } - } - return (t); -} - -/* tok_list - collect ()-delimited, comma-separated list of tokens */ - -static struct token *tok_list(t) -struct token *t; -{ - register struct token *list = tok_alloc(); - char *filename; - int lineno; - - /* Save context of '(' for diagnostics. */ - - filename = t->path; - lineno = t->line; - - list->tokno = TOK_LIST; - list->head = list->tail = t; - list->path = t->path; - list->line = t->line; -#ifdef DEBUG - strcpy(list->vstr->str, "LIST"); -#endif - - /* - * Read until the matching ')' is found, accounting for structured stuff - * (enclosed by '{' and '}' tokens). Break the list up at each ',' token, - * and try to preserve as much whitespace as possible. Newlines are - * discarded so that they will not mess up the layout when we rewrite - * argument lists. The output routines will regenerate discarded - * newlines. - */ - - while (t = tok_class()) { /* skip blanks */ - switch (t->tokno) { - case ')': /* end of list */ - tok_list_append(list, t); - return (list); - case '{': /* struct/union type */ - tok_list_struct(list->tail, t); - break; - case TOK_WSPACE: /* preserve trailing blanks */ - tok_space_append(list->tail->tail, t); /* except after list */ - break; - case '\n': /* fix newlines later */ - tok_free(t); - break; - case ',': /* list separator */ - tok_list_append(list, t); - break; - default: /* other */ - tok_list_append(list->tail, t); - break; - } - } - error_where(filename, lineno, "unmatched '('"); - return (list); /* do not waste any data */ -} - -/* tok_list_struct - collect structured type info within list */ - -static void tok_list_struct(list, t) -register struct token *list; -register struct token *t; -{ - char *filename; - int lineno; - - /* - * Save context of '{' for diagnostics. This routine is called by the one - * that collects list members. If the '}' is not found, the list - * collector will not see the closing ')' either. - */ - - filename = t->path; - lineno = t->line; - - tok_list_append(list, t); - - /* - * Collect tokens until the matching '}' is found. Try to preserve as - * much whitespace as possible. Newlines are discarded so that they do - * not interfere when rewriting argument lists. The output routines will - * regenerate discarded newlines. - */ - - while (t = tok_class()) { - switch (t->tokno) { - case TOK_WSPACE: /* preserve trailing blanks */ - tok_space_append(list->tail, t); /* except after list */ - break; - case '\n': /* fix newlines later */ - tok_free(t); - break; - case '{': /* recurse */ - tok_list_struct(list, t); - break; - case '}': /* done */ - tok_list_append(list, t); - return; - default: /* other */ - tok_list_append(list, t); - break; - } - } - error_where(filename, lineno, "unmatched '{'"); -} - -/* tok_strcat - concatenate multiple string constants */ - -static void tok_strcat(t1) -register struct token *t1; -{ - register struct token *t2; - register struct token *lookahead = 0; - - /* - * Read ahead past whitespace, comments and newlines. If we find a string - * token, concatenate it with the previous one and push back the - * intervening tokens (thus preserving as much information as possible). - * If we find something else, push back all lookahead tokens. - */ - -#define PUSHBACK_AND_RETURN { if (lookahead) tok_unget(lookahead); return; } - - while (t2 = tok_class()) { - switch (t2->tokno) { - case TOK_WSPACE: /* read past comments/blanks */ - case '\n': /* read past newlines */ - TOK_PREPEND(lookahead, t2); - break; - case '"': /* concatenate string tokens */ - if (vs_strcpy(t1->vstr, - t1->vstr->str + strlen(t1->vstr->str) - 1, - t2->vstr->str + 1) == 0) - fatal("out of memory"); - tok_free(t2); - PUSHBACK_AND_RETURN; - default: /* something else, push back */ - tok_unget(t2); - PUSHBACK_AND_RETURN; - } - } - PUSHBACK_AND_RETURN; /* hit EOF */ -} - -#if defined(MAP_VOID_STAR) || defined(MAP_VOID) - -/* tok_void - support for compilers that have problems with "void" */ - -static void tok_void(t) -register struct token *t; -{ - register struct token *t2; - register struct token *lookahead = 0; - - /* - * Look ahead beyond whitespace, comments and newlines until we see a '*' - * token. If one is found, replace "void" by "char". If we find something - * else, and if "void" should always be mapped, replace "void" by "int". - * Always push back the lookahead tokens. - * - * XXX The code also replaces the (void) argument list; this must be - * accounted for later on. The alternative would be to add (in unproto.c) - * TOK_VOID cases all over the place and that would be too error-prone. - */ - -#define PUSHBACK_AND_RETURN { if (lookahead) tok_unget(lookahead); return; } - - while (t2 = tok_class()) { - switch (TOK_PREPEND(lookahead, t2)->tokno) { - case TOK_WSPACE: /* read past comments/blanks */ - case '\n': /* read past newline */ - break; - case '*': /* "void *" -> "char *" */ - if (vs_strcpy(t->vstr, t->vstr->str, "char") == 0) - fatal("out of memory"); - PUSHBACK_AND_RETURN; - default: -#ifdef MAP_VOID /* plain "void" -> "int" */ - if (vs_strcpy(t->vstr, t->vstr->str, "int") == 0) - fatal("out of memory"); -#endif - PUSHBACK_AND_RETURN; - } - } - PUSHBACK_AND_RETURN; /* hit EOF */ -} - -#endif - -/* tok_time - rewrite __TIME__ to "hh:mm:ss" string constant */ - -static void tok_time(t) -struct token *t; -{ - long now; - char *cp; - char buf[BUFSIZ]; - - /* - * Using sprintf() to select parts of a string is gross, but this should - * be fast enough. - */ - - (void) time(&now); - cp = ctime(&now); - sprintf(buf, "\"%.8s\"", cp + 11); - if (vs_strcpy(t->vstr, t->vstr->str, buf) == 0) - fatal("out of memory"); - t->tokno = buf[0]; -} - -/* tok_date - rewrite __DATE__ to "Mmm dd yyyy" string constant */ - -static void tok_date(t) -struct token *t; -{ - long now; - char *cp; - char buf[BUFSIZ]; - - /* - * Using sprintf() to select parts of a string is gross, but this should - * be fast enough. - */ - - (void) time(&now); - cp = ctime(&now); - sprintf(buf, "\"%.3s %.2s %.4s\"", cp + 4, cp + 8, cp + 20); - if (vs_strcpy(t->vstr, t->vstr->str, buf) == 0) - fatal("out of memory"); - t->tokno = buf[0]; -} - -/* tok_unget - push back one or more possibly composite tokens */ - -void tok_unget(t) -register struct token *t; -{ - register struct token *next; - - do { - next = t->next; - TOK_PREPEND(tok_buf, t); - } while (t = next); -} - -/* tok_list_append - append data to list */ - -static void tok_list_append(h, t) -struct token *h; -struct token *t; -{ - if (h->head == 0) { - h->head = h->tail = t; - } else { - h->tail->next = t; - h->tail = t; - } -} diff --git a/build/unproto/tok_io.c b/build/unproto/tok_io.c deleted file mode 100644 index 74ae6bcfee..0000000000 --- a/build/unproto/tok_io.c +++ /dev/null @@ -1,612 +0,0 @@ -/*++ -/* NAME -/* tok_io 3 -/* SUMMARY -/* token I/O -/* PACKAGE -/* unproto -/* SYNOPSIS -/* #include "token.h" -/* -/* struct token *tok_get() -/* -/* void tok_flush(t) -/* struct token *t; -/* -/* void tok_show(t) -/* struct token *t; -/* -/* void tok_show_ch(t) -/* struct token *t; -/* -/* void put_str(s) -/* char *s; -/* -/* void put_ch(c) -/* int c; -/* -/* void put_nl() -/* -/* char *in_path; -/* int in_line; -/* DESCRIPTION -/* These functions read from stdin and write to stdout. The -/* tokenizer keeps track of where the token appeared in the input -/* stream; on output, this information is used to preserve correct -/* line number information (even after lots of token lookahead or -/* after function-header rewriting) so that diagnostics from the -/* next compiler stage make sense. -/* -/* tok_get() reads the next token from standard input. It returns -/* a null pointer when the end of input is reached. -/* -/* tok_show() displays the contents of a (possibly composite) token -/* on the standard output. -/* -/* tok_show_ch() displays the contents of a single-character token -/* on the standard output. The character should not be a newline. -/* -/* tok_flush() displays the contents of a (possibly composite) token -/* on the standard output and makes it available for re-use. -/* -/* put_str() writes a null-terminated string to standard output. -/* There should be no newline characters in the string argument. -/* -/* put_ch() writes one character to standard output. The character -/* should not be a newline. -/* -/* put_nl() outputs a newline character and adjusts the program's idea of -/* the current output line. -/* -/* The in_path and in_line variables contain the file name and -/* line number of the most recently read token. -/* BUGS -/* The tokenizer is just good enough for the unproto filter. -/* As a benefit, it is quite fast. -/* AUTHOR(S) -/* Wietse Venema -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* LAST MODIFICATION -/* 92/01/15 21:52:59 -/* VERSION/RELEASE -/* 1.3 -/*--*/ - -static char io_sccsid[] = "@(#) tok_io.c 1.3 92/01/15 21:52:59"; - -/* C library */ - -#include -#include - -extern char *strchr(); -extern char *malloc(); -extern char *realloc(); -extern char *strcpy(); - -/* Application-specific stuff */ - -#include "token.h" -#include "vstring.h" -#include "error.h" - -extern char *strsave(); /* XXX need include file */ - -/* Stuff to keep track of original source file name and position */ - -static char def_path[] = ""; /* default path name */ - -char *in_path = def_path; /* current input file name */ -int in_line = 1; /* current input line number */ - -static char *out_path = def_path; /* last name in output line control */ -static int out_line = 1; /* current output line number */ -int last_ch; /* type of last output */ - -/* Forward declarations */ - -static int read_quoted(); -static void read_comment(); -static int backslash_newline(); -static char *read_hex(); -static char *read_octal(); -static void fix_line_control(); - - /* - * Character input with one level of pushback. The INPUT() macro recursively - * strips backslash-newline pairs from the input stream. The UNPUT() macro - * should be used only for characters obtained through the INPUT() macro. - * - * After skipping a backslash-newline pair, the input line counter is not - * updated, and we continue with the same logical source line. We just - * update a counter with the number of backslash-newline sequences that must - * be accounted for (backslash_newline() updates the counter). At the end of - * the logical source line, an appropriate number of newline characters is - * pushed back (in tok_get()). I do not know how GCC handles this, but it - * seems to produce te same output. - * - * Because backslash_newline() recursively calls itself (through the INPUT() - * macro), we will run out of stack space, given a sufficiently long - * sequence of backslash-newline pairs. - */ - -static char in_char = 0; /* push-back storage */ -static int in_flag = 0; /* pushback available */ -static int nl_compensate = 0; /* line continuation kluge */ - -#define INPUT(c) (in_flag ? (in_flag = 0, c = in_char) : \ - (c = getchar()) != '\\' ? c : \ - (c = getchar()) != '\n' ? (ungetc(c, stdin), c = '\\') : \ - (c = backslash_newline())) -#define UNPUT(c) (in_flag = 1, in_char = c) - -/* Directives that should be ignored. */ - -#ifdef IGNORE_DIRECTIVES - -static char *ignore_directives[] = { - IGNORE_DIRECTIVES, - 0, -}; - -#endif - -/* Modified string and ctype stuff. */ - -#define STREQUAL(x,y) (*(x) == *(y) && strcmp((x),(y)) == 0) - -#define ISALNUM(c) (isalnum(c) || (c) == '_') -#define ISALPHA(c) (isalpha(c) || (c) == '_') -#define ISSPACE(c) (isspace(c) && c != '\n') -#define ISDOT(c) (c == '.') -#define ISHEX(c) (isdigit(c) || strchr("abcdefABCDEF", c) != 0) -#define ISOCTAL(c) (isdigit(c) && (c) != '8' && (c) != '9') - -/* Collect all characters that satisfy one condition */ - -#define COLLECT(v,c,cond) { \ - register struct vstring *vs = v; \ - register char *cp = vs->str; \ - *cp++ = c; \ - while (INPUT(c) != EOF) { \ - if (cond) { \ - if (VS_ADDCH(vs, cp, c) == 0) \ - fatal("out of memory"); \ - } else { \ - UNPUT(c); \ - break; \ - } \ - } \ - *cp = 0; \ - } - -/* Ensure that output line information is correct */ - -#define CHECK_LINE_CONTROL(p,l) { if (out_path != (p) || out_line != (l)) \ - fix_line_control((p),(l)); } - -/* do_control - parse control line */ - -static int do_control() -{ - struct token *t; - int line; - char *path; - - /* Make sure that the directive shows up in the right place. */ - - CHECK_LINE_CONTROL(in_path, in_line); - - while (t = tok_get()) { - switch (t->tokno) { - - case TOK_WSPACE: - /* Ignore blanks after "#" token. */ - tok_free(t); - break; - - case TOK_NUMBER: - - /* - * Line control is of the form: number pathname junk. Since we - * have no idea what junk the preprocessor may generate, we copy - * all line control tokens to stdout. - */ - - put_str("# "); - line = atoi(t->vstr->str); /* extract line number */ - tok_flush(t); - while ((t = tok_get()) && t->tokno == TOK_WSPACE) - tok_flush(t); /* copy white space */ - if (t) { /* extract path name */ - path = (t->tokno == '"') ? strsave(t->vstr->str) : in_path; - do { - tok_flush(t); /* copy until newline */ - } while (t->tokno != '\n' && (t = tok_get())); - } - out_line = in_line = line; /* synchronize */ - out_path = in_path = path; /* synchronize */ - return; - -#ifdef IGNORE_DIRECTIVES - - case TOK_WORD: - - /* - * Optionally ignore other #directives. This is only a partial - * solution, because the preprocessor will still see them. - */ - { - char **cpp; - char *cp = t->vstr->str; - - for (cpp = ignore_directives; *cpp; cpp++) { - if (STREQUAL(cp, *cpp)) { - do { - tok_free(t); - } while (t->tokno != '\n' && (t = tok_get())); - return; - } - } - } - /* FALLTHROUGH */ -#endif - default: - /* Pass through. */ - put_ch('#'); - do { - tok_flush(t); - } while (t->tokno != '\n' && (t = tok_get())); - return; - - case 0: - /* Hit EOF, punt. */ - put_ch('#'); - return; - } - } -} - -/* backslash_newline - fix up things after reading a backslash-newline pair */ - -static int backslash_newline() -{ - register int c; - - nl_compensate++; - return (INPUT(c)); -} - -/* tok_get - get next token */ - -static int last_tokno = '\n'; - -struct token *tok_get() -{ - register struct token *t; - register int c; - int d; - - /* - * Get one from the pool and fill it in. The loop is here in case we hit - * a preprocessor control line, which happens in a minority of all cases. - * We update the token input path and line info *after* backslash-newline - * processing or the newline compensation would go wrong. - */ - - t = tok_alloc(); - - for (;;) { - if ((INPUT(c)) == EOF) { - tok_free(t); - return (0); - } else if ((t->line = in_line, t->path = in_path), !isascii(c)) { - t->vstr->str[0] = c; - t->vstr->str[1] = 0; - t->tokno = TOK_OTHER; - break; - } else if (ISSPACE(c)) { - COLLECT(t->vstr, c, ISSPACE(c)); - t->tokno = TOK_WSPACE; - break; - } else if (ISALPHA(c)) { - COLLECT(t->vstr, c, ISALNUM(c)); - t->tokno = TOK_WORD; - break; - } else if (isdigit(c)) { - COLLECT(t->vstr, c, isdigit(c)); - t->tokno = TOK_NUMBER; - break; - } else if (c == '"' || c == '\'') { - t->tokno = read_quoted(t->vstr, c); /* detect missing end quote */ - break; - } else if (ISDOT(c)) { - COLLECT(t->vstr, c, ISDOT(c)); - t->tokno = TOK_OTHER; - break; - } else if (c == '#' && last_tokno == '\n') { - do_control(); - continue; - } else { - t->vstr->str[0] = c; - if (c == '\n') { - in_line++; - if (nl_compensate > 0) { /* compensation for bs-nl */ - UNPUT('\n'); - nl_compensate--; - } - } else if (c == '/') { - if ((INPUT(d)) == '*') { - t->vstr->str[1] = d; /* comment */ - read_comment(t->vstr); - t->tokno = TOK_WSPACE; - break; - } else { - if (d != EOF) - UNPUT(d); - } - } else if (c == '\\') { - t->vstr->str[1] = (INPUT(c) == EOF ? 0 : c); - t->vstr->str[2] = 0; - t->tokno = TOK_OTHER; - break; - } - t->vstr->str[1] = 0; - t->tokno = c; - break; - } - } - last_tokno = t->tokno; - t->end_line = in_line; - return (t); -} - -/* read_quoted - read string or character literal, canonicalize escapes */ - -static int read_quoted(vs, ch) -register struct vstring *vs; -int ch; -{ - register char *cp = vs->str; - register int c; - int ret = TOK_OTHER; - - *cp++ = ch; - - /* - * Clobber the token type in case of a premature newline or EOF. This - * prevents us from attempting to concatenate string constants with - * broken ones that have no closing quote. - */ - - while (INPUT(c) != EOF) { - if (c == '\n') { /* newline in string */ - UNPUT(c); - break; - } - if (VS_ADDCH(vs, cp, c) == 0) /* store character */ - fatal("out of memory"); - if (c == ch) { /* closing quote */ - ret = c; - break; - } - if (c == '\\') { /* parse escape sequence */ - if ((INPUT(c)) == EOF) { /* EOF, punt */ - break; - } else if (c == 'a') { /* \a -> audible bell */ - if ((cp = vs_strcpy(vs, cp, BELL)) == 0) - fatal("out of memory"); - } else if (c == 'x') { /* \xhh -> \nnn */ - cp = read_hex(vs, cp); - } else if (ISOCTAL(c) && ch != '\'') { - cp = read_octal(vs, cp, c); /* canonicalize \octal */ - } else { - if (VS_ADDCH(vs, cp, c) == 0) /* \other: leave alone */ - fatal("out of memory"); - } - } - } - *cp = 0; - return (ret); -} - -/* read_comment - stuff a whole comment into one huge token */ - -static void read_comment(vs) -register struct vstring *vs; -{ - register char *cp = vs->str + 2; /* skip slash star */ - register int c; - register int d; - - while (INPUT(c) != EOF) { - if (VS_ADDCH(vs, cp, c) == 0) - fatal("out of memory"); - if (c == '*') { - if ((INPUT(d)) == '/') { - if (VS_ADDCH(vs, cp, d) == 0) - fatal("out of memory"); - break; - } else { - if (d != EOF) - UNPUT(d); - } - } else if (c == '\n') { - in_line++; - } else if (c == '\\') { - if ((INPUT(d)) != EOF && VS_ADDCH(vs, cp, d) == 0) - fatal("out of memory"); - } - } - *cp = 0; -} - -/* read_hex - rewrite hex escape to three-digit octal escape */ - -static char *read_hex(vs, cp) -struct vstring *vs; -register char *cp; -{ - register int c; - register int i; - char buf[BUFSIZ]; - int len; - unsigned val; - - /* - * Eat up all subsequent hex digits. Complain later when there are too - * many. - */ - - for (i = 0; i < sizeof(buf) && (INPUT(c) != EOF) && ISHEX(c); i++) - buf[i] = c; - buf[i] = 0; - - if (i < sizeof(buf) && c) - UNPUT(c); - - /* - * Convert hex form to three-digit octal form. The three-digit form is - * used so that strings can be concatenated without problems. Complain - * about malformed input; truncate the result to at most three octal - * digits. - */ - - if (i == 0) { - error("\\x escape sequence without hexadecimal digits"); - if (VS_ADDCH(vs, cp, 'x') == 0) - fatal("out of memory"); - } else { - (void) sscanf(buf, "%x", &val); - sprintf(buf, "%03o", val); - if ((len = strlen(buf)) > 3) - error("\\x escape sequence yields non-character value"); - if ((cp = vs_strcpy(vs, cp, buf + len - 3)) == 0) - fatal("out of memory"); - } - return (cp); -} - -/* read_octal - convert octal escape to three-digit format */ - -static char obuf[] = "00123"; - -static char *read_octal(vs, cp, c) -register struct vstring *vs; -register char *cp; -register int c; -{ - register int i; - -#define buf_input (obuf + 2) - - /* Eat up at most three octal digits. */ - - buf_input[0] = c; - for (i = 1; i < 3 && (INPUT(c) != EOF) && ISOCTAL(c); i++) - buf_input[i] = c; - buf_input[i] = 0; - - if (i < 3 && c) - UNPUT(c); - - /* - * Leave three-digit octal escapes alone. Convert one-digit and two-digit - * octal escapes to three-digit form by prefixing them with a suitable - * number of '0' characters. This is done so that strings can be - * concatenated without problems. - */ - - if ((cp = vs_strcpy(vs, cp, buf_input + i - 3)) == 0) - fatal("out of memory"); - return (cp); -} - -/* put_nl - emit newline and adjust output line count */ - -void put_nl() -{ - put_ch('\n'); - out_line++; -} - -/* fix_line_control - to adjust path and/or line count info in output */ - -static void fix_line_control(path, line) -register char *path; -register int line; -{ - - /* - * This function is called sporadically, so it should not be a problem - * that we repeat some of the tests that preceded this function call. - * - * Emit a newline if we are not at the start of a line. - * - * If we switch files, or if we jump backwards, emit line control. If we - * jump forward, emit the proper number of newlines to compensate. - */ - - if (last_ch != '\n') /* terminate open line */ - put_nl(); - if (path != out_path || line < out_line) { /* file switch or back jump */ - printf("# %d %s\n", out_line = line, out_path = path); - last_ch = '\n'; - } else { /* forward jump */ - while (line > out_line) - put_nl(); - } -} - -/* tok_show_ch - output single-character token (not newline) */ - -void tok_show_ch(t) -register struct token *t; -{ - CHECK_LINE_CONTROL(t->path, t->line); - - put_ch(t->tokno); /* show token contents */ -} - -/* tok_show - output (possibly composite) token */ - -void tok_show(t) -register struct token *t; -{ - register struct token *p; - - if (t->tokno == TOK_LIST) { - register struct token *s; - - /* - * This branch is completely in terms of tok_xxx() primitives, so - * there is no need to check the line control information. - */ - - for (s = t->head; s; s = s->next) { - tok_show_ch(s); /* '(' or ',' or ')' */ - for (p = s->head; p; p = p->next) - tok_show(p); /* show list element */ - } - } else { - register char *cp = t->vstr->str; - - /* - * Measurements show that it pays off to give special treatment to - * single-character tokens. Note that both types of token may cause a - * change of output line number. - */ - - CHECK_LINE_CONTROL(t->path, t->line); - if (cp[1] == 0) { - put_ch(*cp); /* single-character token */ - } else { - put_str(cp); /* multi_character token */ - } - out_line = t->end_line; /* may span multiple lines */ - for (p = t->head; p; p = p->next) - tok_show(p); /* trailing blanks */ - } -} diff --git a/build/unproto/tok_pool.c b/build/unproto/tok_pool.c deleted file mode 100644 index e2ed107ce7..0000000000 --- a/build/unproto/tok_pool.c +++ /dev/null @@ -1,103 +0,0 @@ -/*++ -/* NAME -/* tok_pool 3 -/* SUMMARY -/* maintain pool of unused token structures -/* PACKAGE -/* unproto -/* SYNOPSIS -/* #include "token.h" -/* -/* struct token *tok_alloc() -/* -/* void tok_free(t) -/* struct token *t; -/* DESCRIPTION -/* tok_alloc() and tok_free() maintain a pool of unused token -/* structures. -/* -/* tok_alloc() takes the first free token structure from the pool -/* or allocates a new one if the pool is empty. -/* -/* tok_free() adds a (possibly composite) token structure to the pool. -/* BUGS -/* The pool never shrinks. -/* AUTHOR(S) -/* Wietse Venema -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* LAST MODIFICATION -/* 92/01/15 21:53:04 -/* VERSION/RELEASE -/* 1.2 -/*--*/ - -static char pool_sccsid[] = "@(#) tok_pool.c 1.2 92/01/15 21:53:04"; - -/* C library */ - -extern char *malloc(); - -/* Application-specific stuff */ - -#include "token.h" -#include "vstring.h" -#include "error.h" - -#define TOKLEN 5 /* initial string buffer length */ - -struct token *tok_pool = 0; /* free token pool */ - -/* tok_alloc - allocate token structure from pool or heap */ - -struct token *tok_alloc() -{ - register struct token *t; - - if (tok_pool) { /* re-use an old one */ - t = tok_pool; - tok_pool = t->next; - } else { /* create a new one */ - if ((t = (struct token *) malloc(sizeof(struct token))) == 0 - || (t->vstr = vs_alloc(TOKLEN)) == 0) - fatal("out of memory"); - } - t->next = t->head = t->tail = 0; -#ifdef DEBUG - strcpy(t->vstr->str, "BUSY"); -#endif - return (t); -} - -/* tok_free - return (possibly composite) token to pool of free tokens */ - -void tok_free(t) -register struct token *t; -{ -#ifdef DEBUG - /* Check if we are freeing free token */ - - register struct token *p; - - for (p = tok_pool; p; p = p->next) - if (p == t) - fatal("freeing free token"); -#endif - - /* Free neighbours and subordinates first */ - - if (t->next) - tok_free(t->next); - if (t->head) - tok_free(t->head); - - /* Free self */ - - t->next = tok_pool; - t->head = t->tail = 0; - tok_pool = t; -#ifdef DEBUG - strcpy(t->vstr->str, "FREE"); -#endif -} diff --git a/build/unproto/token.h b/build/unproto/token.h deleted file mode 100644 index bb2f50a106..0000000000 --- a/build/unproto/token.h +++ /dev/null @@ -1,55 +0,0 @@ -/* @(#) token.h 1.4 92/01/15 21:53:17 */ - -struct token { - int tokno; /* token value, see below */ - char *path; /* file name */ - int line; /* line number at token start */ - int end_line; /* line number at token end */ - struct vstring *vstr; /* token contents */ - struct token *next; - struct token *head; - struct token *tail; -}; - -/* Special token values */ - -#define TOK_LIST 256 /* () delimited list */ -#define TOK_WORD 257 /* keyword or identifier */ -#define TOK_NUMBER 258 /* one or more digits */ -#define TOK_WSPACE 259 /* comment, white space, not newline */ -#define TOK_OTHER 260 /* other token */ -#define TOK_CONTROL 261 /* flow control keyword */ -#define TOK_COMPOSITE 262 /* struct or union keyword */ -#define TOK_DATE 263 /* date: Mmm dd yyyy */ -#define TOK_TIME 264 /* time: hh:mm:ss */ -#define TOK_VOID 265 /* void keyword */ - -/* Input/output functions and macros */ - -extern struct token *tok_get(); /* read next single token */ -extern void tok_show(); /* display (composite) token */ -extern struct token *tok_class(); /* classify tokens */ -extern void tok_unget(); /* stuff token back into input */ -extern void put_nl(); /* print newline character */ -extern void tok_show_ch(); /* emit single-character token */ - -#define tok_flush(t) (tok_show(t), tok_free(t)) - -#ifdef DEBUG -#define put_ch(c) (putchar(last_ch = c),fflush(stdout)) -#define put_str(s) (fputs(s,stdout),last_ch = 0,fflush(stdout)) -#else -#define put_ch(c) putchar(last_ch = c) -#define put_str(s) (fputs(s,stdout),last_ch = 0) -#endif - -/* Memory management */ - -struct token *tok_alloc(); /* allocate token storage */ -extern void tok_free(); /* re-cycle storage */ - -/* Context */ - -extern char *in_path; /* current input path name */ -extern int in_line; /* current input line number */ -extern int last_ch; /* type of last output */ diff --git a/build/unproto/unproto.1 b/build/unproto/unproto.1 deleted file mode 100644 index 31490c36fb..0000000000 --- a/build/unproto/unproto.1 +++ /dev/null @@ -1,152 +0,0 @@ -.TH UNPROTO 1 -.ad -.fi -.SH NAME -unproto -\- -compile ANSI C with traditional UNIX C compiler -.SH PACKAGE -.na -.nf -unproto -.SH SYNOPSIS -.na -.nf -/somewhere/cpp ... - -cc cflags -E file.c | unproto >file.i; cc cflags -c file.i -.SH DESCRIPTION -.ad -.fi -This document describes a filter that sits in between the UNIX -C preprocessor and the next UNIX C compiler stage, on the fly rewriting -ANSI-style syntax to old-style syntax. Typically, the program is -invoked by the native UNIX C compiler as an alternate preprocessor. -The unprototyper in turn invokes the native C preprocessor and -massages its output. Similar tricks can be used with the lint(1) -command. - -Language constructs that are always rewritten: -.TP -function headings, prototypes, pointer types -ANSI-C style function headings, function prototypes, function -pointer types and type casts are rewritten to old style. - support is provided for functions with variable-length -argument lists. -.TP -character and string constants -The \\a and \\x escape sequences are rewritten to their (three-digit) -octal equivalents. - -Multiple string tokens are concatenated; an arbitrary number of -whitespace or comment tokens may appear between successive -string tokens. - -Within string constants, octal escape sequences are rewritten to the -three-digit \\ddd form, so that string concatenation produces correct -results. -.TP -date and time -The __DATE__ and __TIME__ tokens are replaced by string constants -of the form "Mmm dd yyyy" and "hh:mm:ss", respectively. The result -is subjected to string concatenation, just like any other string -constant. -.PP -Language constructs that are rewritten only if the program has been -configured to do so: -.TP -void types -The unprototyper can be configured to rewrite "void *" to "char *", -and even to rewrite plain "void" to "int". -These features are configurable because many traditional UNIX C -compilers do not need them. - -Note: (void) argument lists are always replaced by empty ones. -.PP -ANSI C constructs that are not rewritten because the traditional -UNIX C preprocessor provides suitable workarounds: -.TP -const and volatile -Use the "-Dconst=" and/or "-Dvolatile=" preprocessor directives to -get rid of unimplemented keywords. -.TP -token pasting and stringizing -The traditional UNIX C preprocessor provides excellent alternatives. -For example: - -.nf -.ne 2 -#define string(bar) "bar" /* instead of: # x */ -#define paste(x,y) x/**\/y /* instead of: x##y */ -.fi - -There is a good reason why the # and ## operators are not implemented -in the unprototyper. -After program text has gone through a non-ANSI C preprocessor, all -information about the grouping of the operands of # and ## is lost. -Thus, if the unprototyper were to perform these operations, it would -produce correct results only in the most trivial cases. Operands -with embedded blanks, operands that expand to null tokens, and nested -use of # and/or ## would cause all kinds of obscure problems. -.PP -Unsupported ANSI features: -.TP -trigraphs and #pragmas -Trigraphs are useful only for systems with broken character sets. -If the local compiler chokes on #pragma, insert a blank before the -"#" character, and enclose the offending directive between #ifdef -and #endif. -.SH SEE ALSO -.na -.nf -.ad -.fi -cc(1), how to specify a non-default C preprocessor. -Some versions of the lint(1) command are implemented as a shell -script. It should require only minor modification for integration -with the unprototyper. Other versions of the lint(1) command accept -the same command syntax as the C compiler for the specification of a -non-default preprocessor. Some research may be needed. -.SH FILES -.na -.nf -/wherever/stdarg.h, provided with the unproto filter. -.SH DIAGNOSTICS -.ad -.fi -Problems are reported on the standard error stream. -A non-zero exit status means that there was a problem. -.SH BUGS -.ad -.fi -The unprototyper should be run on preprocessed source only: -unexpanded macros may confuse the program. - -Declarations of (object) are misunderstood and will result in -syntax errors: the objects between parentheses disappear. - -Sometimes does not preserve whitespace after parentheses and commas. -This is a purely aesthetical matter, and the compiler should not care. -Whitespace within string constants is, of course, left intact. - -Does not generate explicit type casts for function-argument -expressions. The lack of explicit conversions between integral -and/or pointer argument types should not be a problem in environments -where sizeof(int) == sizeof(long) == sizeof(pointer). A more serious -problem is the lack of automatic type conversions between integral and -floating-point argument types. Let lint(1) be your friend. -.SH AUTHOR(S) -.na -.nf -Wietse Venema (wietse@wzv.win.tue.nl) -Eindhoven University of Technology -Department of Mathematics and Computer Science -Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -.SH LAST MODIFICATION -.na -.nf -93/06/18 22:29:37 -.SH VERSION/RELEASE -.na -.nf -1.6 diff --git a/build/unproto/unproto.c b/build/unproto/unproto.c deleted file mode 100644 index 2b2e7648b7..0000000000 --- a/build/unproto/unproto.c +++ /dev/null @@ -1,999 +0,0 @@ -/*++ -/* NAME -/* unproto 1 -/* SUMMARY -/* compile ANSI C with traditional UNIX C compiler -/* PACKAGE -/* unproto -/* SYNOPSIS -/* /somewhere/cpp ... -/* -/* cc cflags -E file.c | unproto >file.i; cc cflags -c file.i -/* DESCRIPTION -/* This document describes a filter that sits in between the UNIX -/* C preprocessor and the next UNIX C compiler stage, on the fly rewriting -/* ANSI-style syntax to old-style syntax. Typically, the program is -/* invoked by the native UNIX C compiler as an alternate preprocessor. -/* The unprototyper in turn invokes the native C preprocessor and -/* massages its output. Similar tricks can be used with the lint(1) -/* command. -/* -/* Language constructs that are always rewritten: -/* .TP -/* function headings, prototypes, pointer types -/* ANSI-C style function headings, function prototypes, function -/* pointer types and type casts are rewritten to old style. -/* support is provided for functions with variable-length -/* argument lists. -/* .TP -/* character and string constants -/* The \\a and \\x escape sequences are rewritten to their (three-digit) -/* octal equivalents. -/* -/* Multiple string tokens are concatenated; an arbitrary number of -/* whitespace or comment tokens may appear between successive -/* string tokens. -/* -/* Within string constants, octal escape sequences are rewritten to the -/* three-digit \\ddd form, so that string concatenation produces correct -/* results. -/* .TP -/* date and time -/* The __DATE__ and __TIME__ tokens are replaced by string constants -/* of the form "Mmm dd yyyy" and "hh:mm:ss", respectively. The result -/* is subjected to string concatenation, just like any other string -/* constant. -/* .PP -/* Language constructs that are rewritten only if the program has been -/* configured to do so: -/* .TP -/* void types -/* The unprototyper can be configured to rewrite "void *" to "char *", -/* and even to rewrite plain "void" to "int". -/* These features are configurable because many traditional UNIX C -/* compilers do not need them. -/* -/* Note: (void) argument lists are always replaced by empty ones. -/* .PP -/* ANSI C constructs that are not rewritten because the traditional -/* UNIX C preprocessor provides suitable workarounds: -/* .TP -/* const and volatile -/* Use the "-Dconst=" and/or "-Dvolatile=" preprocessor directives to -/* get rid of unimplemented keywords. -/* .TP -/* token pasting and stringizing -/* The traditional UNIX C preprocessor provides excellent alternatives. -/* For example: -/* -/* .nf -/* .ne 2 -/* #define string(bar) "bar" /* instead of: # x */ -/* #define paste(x,y) x/**\/y /* instead of: x##y */ -/* .fi -/* -/* There is a good reason why the # and ## operators are not implemented -/* in the unprototyper. -/* After program text has gone through a non-ANSI C preprocessor, all -/* information about the grouping of the operands of # and ## is lost. -/* Thus, if the unprototyper were to perform these operations, it would -/* produce correct results only in the most trivial cases. Operands -/* with embedded blanks, operands that expand to null tokens, and nested -/* use of # and/or ## would cause all kinds of obscure problems. -/* .PP -/* Unsupported ANSI features: -/* .TP -/* trigraphs and #pragmas -/* Trigraphs are useful only for systems with broken character sets. -/* If the local compiler chokes on #pragma, insert a blank before the -/* "#" character, and enclose the offending directive between #ifdef -/* and #endif. -/* SEE ALSO -/* .ad -/* .fi -/* cc(1), how to specify a non-default C preprocessor. -/* Some versions of the lint(1) command are implemented as a shell -/* script. It should require only minor modification for integration -/* with the unprototyper. Other versions of the lint(1) command accept -/* the same command syntax as the C compiler for the specification of a -/* non-default preprocessor. Some research may be needed. -/* FILES -/* /wherever/stdarg.h, provided with the unproto filter. -/* DIAGNOSTICS -/* Problems are reported on the standard error stream. -/* A non-zero exit status means that there was a problem. -/* BUGS -/* The unprototyper should be run on preprocessed source only: -/* unexpanded macros may confuse the program. -/* -/* Declarations of (object) are misunderstood and will result in -/* syntax errors: the objects between parentheses disappear. -/* -/* Sometimes does not preserve whitespace after parentheses and commas. -/* This is a purely aesthetical matter, and the compiler should not care. -/* Whitespace within string constants is, of course, left intact. -/* -/* Does not generate explicit type casts for function-argument -/* expressions. The lack of explicit conversions between integral -/* and/or pointer argument types should not be a problem in environments -/* where sizeof(int) == sizeof(long) == sizeof(pointer). A more serious -/* problem is the lack of automatic type conversions between integral and -/* floating-point argument types. Let lint(1) be your friend. -/* AUTHOR(S) -/* Wietse Venema (wietse@wzv.win.tue.nl) -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* LAST MODIFICATION -/* 93/06/18 22:29:37 -/* VERSION/RELEASE -/* 1.6 -/*--*/ - -static char unproto_sccsid[] = "@(#) unproto.c 1.6 93/06/18 22:29:37"; - -/* C library */ - -#include -#include -#include -#include - -extern void exit(); -extern int optind; -extern char *optarg; -extern int getopt(); - -/* Application-specific stuff */ - -#include "vstring.h" -#include "stdarg.h" -#include "token.h" -#include "error.h" -#include "symbol.h" - -/* Forward declarations. */ - -static struct token *dcl_flush(); -static void block_flush(); -static void block_dcls(); -static struct token *show_func_ptr_type(); -static struct token *show_struct_type(); -static void show_arg_name(); -static void show_type(); -static void pair_flush(); -static void check_cast(); -static void show_empty_list(); - -#define check_cast_flush(t) (check_cast(t), tok_free(t)) - -#ifdef PIPE_THROUGH_CPP -static int pipe_stdin_through_cpp(); -#endif - -/* Disable debugging printfs while preserving side effects. */ - -#ifdef DEBUG -#define DPRINTF printf -#else -#define DPRINTF (void) -#endif - -/* An attempt to make some complicated expressions a bit more readable. */ - -#define STREQ(x,y) (*(x) == *(y) && !strcmp((x),(y))) - -#define LAST_ARG_AND_EQUAL(s,c) ((s)->next && (s)->next->next == 0 \ - && (s)->head && ((s)->head == (s)->tail) \ - && (STREQ((s)->head->vstr->str, (c)))) - -#define LIST_BEGINS_WITH_STAR(s) (s->head->head && s->head->head->tokno == '*') - -#define IS_FUNC_PTR_TYPE(s) (s->tokno == TOK_LIST && s->next \ - && s->next->tokno == TOK_LIST \ - && LIST_BEGINS_WITH_STAR(s)) - -/* What to look for to detect a (void) argument list. */ - -#ifdef MAP_VOID -#define VOID_ARG "int" /* bare "void" is mapped to "int" */ -#else -#define VOID_ARG "void" /* bare "void" is left alone */ -#endif - -/* main - driver */ - -int main(argc, argv) -int argc; -char **argv; -{ - register struct token *t; -#ifdef PIPE_THROUGH_CPP /* pipe through /lib/cpp */ - int cpp_status; - int wait_pid; - int cpp_pid; - - cpp_pid = pipe_stdin_through_cpp(argv); -#endif - - sym_init(); /* prime the symbol table */ - - while (t = tok_class()) { - if (t = dcl_flush(t)) { /* try declaration */ - if (t->tokno == '{') { /* examine rejected token */ - block_flush(t); /* body */ - } else { - tok_flush(t); /* other, recover */ - } - } - } - -#ifdef PIPE_THROUGH_CPP /* pipe through /lib/cpp */ - while ((wait_pid = wait(&cpp_status)) != -1 && wait_pid != cpp_pid) - /* void */ ; - return (errcount != 0 || wait_pid != cpp_pid || cpp_status != 0); -#else - return (errcount != 0); -#endif -} - -#ifdef PIPE_THROUGH_CPP /* pipe through /lib/cpp */ - -/* pipe_stdin_through_cpp - avoid shell script overhead */ - -static int pipe_stdin_through_cpp(argv) -char **argv; -{ - int pipefds[2]; - int pid; - char **cpptr = argv; - int i; - struct stat st; - - /* - * The code that sets up the pipe requires that file descriptors 0,1,2 - * are already open. All kinds of mysterious things will happen if that - * is not the case. The following loops makes sure that descriptors 0,1,2 - * are set up properly. - */ - - for (i = 0; i < 3; i++) { - if (fstat(i, &st) == -1 && open("/dev/null", 2) != i) { - perror("open /dev/null"); - exit(1); - } - } - - /* - * With most UNIX implementations, the second non-option argument to - * /lib/cpp specifies the output file. If an output file other than - * stdout is specified, we must force /lib/cpp to write to stdout, and we - * must redirect our own standard output to the specified output file. - */ - -#define IS_OPTION(cp) ((cp)[0] == '-' && (cp)[1] != 0) - - /* Skip to first non-option argument, if any. */ - - while (*++cpptr && IS_OPTION(*cpptr)) - /* void */ ; - - /* - * Assume that the first non-option argument is the input file name. The - * next argument could be the output destination or an option (System V - * Release 2 /lib/cpp gets the options *after* the file arguments). - */ - - if (*cpptr && *++cpptr && **cpptr != '-') { - - /* - * The first non-option argument is followed by another argument that - * is not an option ("-stuff") or a hyphen ("-"). Redirect our own - * standard output before we clobber the file name. - */ - - if (freopen(*cpptr, "w", stdout) == 0) { - perror(*cpptr); - exit(1); - } - /* Clobber the file name argument so that /lib/cpp writes to stdout */ - - *cpptr = "-"; - } - /* Set up the pipe that connects /lib/cpp to our standard input. */ - - if (pipe(pipefds)) { - perror("pipe"); - exit(1); - } - switch (pid = fork()) { - case -1: /* error */ - perror("fork"); - exit(1); - /* NOTREACHED */ - case 0: /* child */ - (void) close(pipefds[0]); /* close reading end */ - (void) close(1); /* connect stdout to pipe */ - if (dup(pipefds[1]) != 1) - fatal("dup() problem"); - (void) close(pipefds[1]); /* close redundant fd */ - (void) execv(PIPE_THROUGH_CPP, argv); - perror(PIPE_THROUGH_CPP); - exit(1); - /* NOTREACHED */ - default: /* parent */ - (void) close(pipefds[1]); /* close writing end */ - (void) close(0); /* connect stdin to pipe */ - if (dup(pipefds[0]) != 0) - fatal("dup() problem"); - close(pipefds[0]); /* close redundant fd */ - return (pid); - } -} - -#endif - -/* show_arg_names - display function argument names */ - -static void show_arg_names(t) -register struct token *t; -{ - register struct token *s; - - /* Do argument names, but suppress void and rewrite trailing ... */ - - if (LAST_ARG_AND_EQUAL(t->head, VOID_ARG)) { - show_empty_list(t); /* no arguments */ - } else { - for (s = t->head; s; s = s->next) { /* foreach argument... */ - if (LAST_ARG_AND_EQUAL(s, "...")) { -#ifdef _VA_ALIST_ /* see ./stdarg.h */ - tok_show_ch(s); /* ',' */ - put_str(_VA_ALIST_); /* varargs magic */ -#endif - } else { - tok_show_ch(s); /* '(' or ',' or ')' */ - show_arg_name(s); /* extract argument name */ - } - } - } -} - -/* show_arg_types - display function argument types */ - -static void show_arg_types(t) -register struct token *t; -{ - register struct token *s; - - /* Do argument types, but suppress void and trailing ... */ - - if (!LAST_ARG_AND_EQUAL(t->head, VOID_ARG)) { - for (s = t->head; s; s = s->next) { /* foreach argument... */ - if (LAST_ARG_AND_EQUAL(s, "...")) { -#ifdef _VA_DCL_ /* see ./stdarg.h */ - put_str(_VA_DCL_); /* varargs magic */ - put_nl(); /* make output look nicer */ -#endif - } else { - if (s->head != s->tail) { /* really new-style argument? */ - show_type(s); /* rewrite type info */ - put_ch(';'); - put_nl(); /* make output look nicer */ - } - } - } - } -} - -/* header_flush - rewrite new-style function heading to old style */ - -static void header_flush(t) -register struct token *t; -{ - show_arg_names(t); /* show argument names */ - put_nl(); /* make output look nicer */ - show_arg_types(t); /* show argument types */ - tok_free(t); /* discard token */ -} - -/* fpf_header_names - define func returning ptr to func, no argument types */ - -static void fpf_header_names(list) -struct token *list; -{ - register struct token *s; - register struct token *p; - - /* - * Recurse until we find the argument list. Account for the rare case - * that list is a comma-separated list (which should be a syntax error). - * Display old-style fuction argument names. - */ - - for (s = list->head; s; s = s->next) { - tok_show_ch(s); /* '(' or ',' or ')' */ - for (p = s->head; p; p = p->next) { - if (p->tokno == TOK_LIST) { - if (IS_FUNC_PTR_TYPE(p)) { /* recurse */ - fpf_header_names(p); - show_empty_list(p = p->next); - } else { /* display argument names */ - show_arg_names(p); - } - } else { /* pass through other stuff */ - tok_show(p); - } - } - } -} - -/* fpf_header_types - define func returning ptr to func, argument types only */ - -static void fpf_header_types(list) -struct token *list; -{ - register struct token *s; - register struct token *p; - - /* - * Recurse until we find the argument list. Account for the rare case - * that list is a comma-separated list (which should be a syntax error). - * Display old-style function argument types. - */ - - for (s = list->head; s; s = s->next) { - for (p = s->head; p; p = p->next) { - if (p->tokno == TOK_LIST) { - if (IS_FUNC_PTR_TYPE(p)) { /* recurse */ - fpf_header_types(p); - p = p->next; - } else { /* display argument types */ - show_arg_types(p); - } - } - } - } -} - -/* fpf_header - define function returning pointer to function */ - -static void fpf_header(l1, l2) -struct token *l1; -struct token *l2; -{ - fpf_header_names(l1); /* strip argument types */ - show_empty_list(l2); /* strip prototype */ - put_nl(); /* nicer output */ - fpf_header_types(l1); /* show argument types */ -} - -/* skip_enclosed - skip over enclosed tokens */ - -static struct token *skip_enclosed(p, stop) -register struct token *p; -register int stop; -{ - register int start = p->tokno; - - /* Always return a pointer to the last processed token, never NULL. */ - - while (p->next) { - p = p->next; - if (p->tokno == start) { - p = skip_enclosed(p, stop); /* recurse */ - } else if (p->tokno == stop) { - break; /* done */ - } - } - return (p); -} - -/* show_arg_name - extract argument name from argument type info */ - -static void show_arg_name(s) -register struct token *s; -{ - if (s->head) { - register struct token *p; - register struct token *t = 0; - - /* Find the last interesting item. */ - - for (p = s->head; p; p = p->next) { - if (p->tokno == TOK_WORD) { - t = p; /* remember last word */ - } else if (p->tokno == '{') { - p = skip_enclosed(p, '}'); /* skip structured stuff */ - } else if (p->tokno == '[') { - break; /* dimension may be a macro */ - } else if (IS_FUNC_PTR_TYPE(p)) { - t = p; /* or function pointer */ - p = p->next; - } - } - - /* Extract argument name from last interesting item. */ - - if (t) { - if (t->tokno == TOK_LIST) - show_arg_name(t->head); /* function pointer, recurse */ - else - tok_show(t); /* print last word */ - } - } -} - -/* show_type - rewrite type to old-style syntax */ - -static void show_type(s) -register struct token *s; -{ - register struct token *p; - - /* - * Rewrite (*stuff)(args) to (*stuff)(). Rewrite word(args) to word(), - * but only if the word was preceded by a word, '*' or '}'. Leave - * anything else alone. - */ - - for (p = s->head; p; p = p->next) { - if (IS_FUNC_PTR_TYPE(p)) { - p = show_func_ptr_type(p, p->next); /* function pointer type */ - } else { - register struct token *q; - register struct token *r; - - tok_show(p); /* other */ - if ((p->tokno == TOK_WORD || p->tokno == '*' || p->tokno == '}') - && (q = p->next) && q->tokno == TOK_WORD - && (r = q->next) && r->tokno == TOK_LIST) { - tok_show(q); /* show name */ - show_empty_list(p = r); /* strip args */ - } - } - } -} - -/* show_func_ptr_type - display function_pointer type using old-style syntax */ - -static struct token *show_func_ptr_type(t1, t2) -struct token *t1; -struct token *t2; -{ - register struct token *s; - - /* - * Rewrite (list1) (list2) to (list1) (). Account for the rare case that - * (list1) is a comma-separated list. That should be an error, but we do - * not want to waste any information. - */ - - for (s = t1->head; s; s = s->next) { - tok_show_ch(s); /* '(' or ',' or ')' */ - show_type(s); /* recurse */ - } - show_empty_list(t2); - return (t2); -} - -/* show_empty_list - display opening and closing parentheses (if available) */ - -static void show_empty_list(t) -register struct token *t; -{ - tok_show_ch(t->head); /* opening paren */ - if (t->tail->tokno == ')') - tok_show_ch(t->tail); /* closing paren */ -} - -/* show_struct_type - display structured type, rewrite function-pointer types */ - -static struct token *show_struct_type(p) -register struct token *p; -{ - tok_show(p); /* opening brace */ - - while (p->next) { /* XXX cannot return 0 */ - p = p->next; - if (IS_FUNC_PTR_TYPE(p)) { - p = show_func_ptr_type(p, p->next); /* function-pointer member */ - } else if (p->tokno == '{') { - p = show_struct_type(p); /* recurse */ - } else { - tok_show(p); /* other */ - if (p->tokno == '}') { - return (p); /* done */ - } - } - } - DPRINTF("/* missing '}' */"); - return (p); -} - -/* is_func_ptr_cast - recognize function-pointer type cast */ - -static int is_func_ptr_cast(t) -register struct token *t; -{ - register struct token *p; - - /* - * Examine superficial structure. Require (list1) (list2). Require that - * list1 begins with a star. - */ - - if (!IS_FUNC_PTR_TYPE(t)) - return (0); - - /* - * Make sure that there is no name in (list1). Do not worry about - * unexpected tokens, because the compiler will complain anyway. - */ - - for (p = t->head->head; p; p = p->next) { - switch (p->tokno) { - case TOK_LIST: /* recurse */ - return (is_func_ptr_cast(p)); - case TOK_WORD: /* name in list */ - return (0); - case '[': - return (1); /* dimension may be a macro */ - } - } - return (1); /* no name found */ -} - -/* check_cast - display ()-delimited, comma-separated list */ - -static void check_cast(t) -struct token *t; -{ - register struct token *s; - register struct token *p; - - /* - * Rewrite function-pointer types and function-pointer casts. Do not - * blindly rewrite (*list1)(list2) to (*list1)(). Function argument lists - * are about the only thing we can discard without provoking diagnostics - * from the compiler. - */ - - for (s = t->head; s; s = s->next) { - tok_show_ch(s); /* '(' or ',' or ')' */ - for (p = s->head; p; p = p->next) { - switch (p->tokno) { - case TOK_LIST: - if (is_func_ptr_cast(p)) { /* not: IS_FUNC_PTR_TYPE(p) */ - p = show_func_ptr_type(p, p->next); - } else { - check_cast(p); /* recurse */ - } - break; - case '{': - p = show_struct_type(p); /* rewrite func. ptr. types */ - break; - default: - tok_show(p); - break; - } - } - } -} - -/* block_dcls - on the fly rewrite decls/initializers at start of block */ - -static void block_dcls() -{ - register struct token *t; - - /* - * Away from the top level, a declaration should be preceded by type or - * storage-class information. That is why inside blocks, structs and - * unions we insist on reading one word before passing the _next_ token - * to the dcl_flush() function. - * - * Struct and union declarations look the same everywhere: we make an - * exception for these more regular constructs and pass the "struct" and - * "union" tokens to the type_dcl() function. - */ - - while (t = tok_class()) { - switch (t->tokno) { - case TOK_WSPACE: /* preserve white space */ - case '\n': /* preserve line count */ - tok_flush(t); - break; - case TOK_WORD: /* type declarations? */ - tok_flush(t); /* advance to next token */ - t = tok_class(); /* null return is ok */ - /* FALLTRHOUGH */ - case TOK_COMPOSITE: /* struct or union */ - if ((t = dcl_flush(t)) == 0) - break; - /* FALLTRHOUGH */ - default: /* end of declarations */ - DPRINTF("/* end dcls */"); - /* FALLTRHOUGH */ - case '}': /* end of block */ - tok_unget(t); - return; - } - } -} - -/* block_flush - rewrite struct, union or statement block on the fly */ - -static void block_flush(t) -register struct token *t; -{ - static int count = 0; - - tok_flush(t); - DPRINTF("/*%d*/", ++count); - - /* - * Rewrite function pointer types in declarations and function pointer - * casts in initializers at start of block. - */ - - block_dcls(); - - /* Remainder of block: only rewrite function pointer casts. */ - - while (t = tok_class()) { - if (t->tokno == TOK_LIST) { - check_cast_flush(t); - } else if (t->tokno == '{') { - block_flush(t); - } else { - tok_flush(t); - if (t->tokno == '}') { - DPRINTF("/*%d*/", count--); - return; - } - } - } - DPRINTF("/* missing '}' */"); -} - -/* pair_flush - on the fly rewrite casts in grouped stuff */ - -static void pair_flush(t, start, stop) -register struct token *t; -register int start; -register int stop; -{ - tok_flush(t); - - while (t = tok_class()) { - if (t->tokno == start) { /* recurse */ - pair_flush(t, start, stop); - } else if (t->tokno == TOK_LIST) { /* expression or cast */ - check_cast_flush(t); - } else { /* other, copy */ - tok_flush(t); - if (t->tokno == stop) { /* done */ - return; - } - } - } - DPRINTF("/* missing '%c' */", stop); -} - -/* initializer - on the fly rewrite casts in initializer */ - -static void initializer() -{ - register struct token *t; - - while (t = tok_class()) { - switch (t->tokno) { - case ',': /* list separator */ - case ';': /* list terminator */ - tok_unget(t); - return; - case TOK_LIST: /* expression or cast */ - check_cast_flush(t); - break; - case '[': /* array subscript, may nest */ - pair_flush(t, '[', ']'); - break; - case '{': /* structured data, may nest */ - pair_flush(t, '{', '}'); - break; - default: /* other, just copy */ - tok_flush(t); - break; - } - } -} - -/* func_ptr_dcl_flush - rewrite function pointer stuff */ - -static struct token *func_ptr_dcl_flush(list) -register struct token *list; -{ - register struct token *t; - register struct token *t2; - - /* - * Ignore blanks and newlines because we are too lazy to maintain more - * than one token worth of lookahead. The output routines will regenerate - * discarded newline tokens. - */ - - while (t = tok_class()) { - switch (t->tokno) { - case TOK_WSPACE: - case '\n': - tok_free(t); - break; - case TOK_LIST: - /* Function pointer or function returning pointer to function. */ - while ((t2 = tok_class()) /* skip blanks etc. */ - &&(t2->tokno == TOK_WSPACE || t2->tokno == '\n')) - tok_free(t2); - switch (t2 ? t2->tokno : 0) { - case '{': /* function heading (new) */ - fpf_header(list, t); - break; - case TOK_WORD: /* function heading (old) */ - tok_show(list); - tok_show(t); - break; - default: /* func pointer type */ - (void) show_func_ptr_type(list, t); - break; - } - tok_free(list); - tok_free(t); - if (t2) - tok_unget(t2); - return (0); - default: /* not a declaration */ - tok_unget(t); - return (list); - } - } - - /* Hit EOF; must be mistake, but do not waste any information. */ - - return (list); -} - -/* function_dcl_flush - rewrite function { heading, type declaration } */ - -static struct token *function_dcl_flush(list) -register struct token *list; -{ - register struct token *t; - - /* - * Ignore blanks and newlines because we are too lazy to maintain more - * than one token worth of lookahead. The output routines will regenerate - * ignored newline tokens. - */ - - while (t = tok_class()) { - switch (t->tokno) { - case TOK_WSPACE: - case '\n': - tok_free(t); - break; - case '{': - /* Function heading: word (list) { -> old style heading */ - header_flush(list); - tok_unget(t); - return (0); - case TOK_WORD: - /* Old-style function heading: word (list) word... */ - tok_flush(list); - tok_unget(t); - return (0); - case TOK_LIST: - /* Function pointer: word (list1) (list2) -> word (list1) () */ - tok_flush(list); - show_empty_list(t); - tok_free(t); - return (0); - case ',': - case ';': - /* Function type declaration: word (list) -> word () */ - show_empty_list(list); - tok_free(list); - tok_unget(t); - return (0); - default: - /* Something else, reject the list. */ - tok_unget(t); - return (list); - } - } - - /* Hit EOF; must be mistake, but do not waste any information. */ - - return (list); -} - -/* dcl_flush - parse declaration on the fly, return rejected token */ - -static struct token *dcl_flush(t) -register struct token *t; -{ - register int got_word; - - /* - * Away from the top level, type or storage-class information is required - * for an (extern or forward) function type declaration or a variable - * declaration. - * - * With our naive word-counting approach, this means that the caller should - * read one word before passing the next token to us. This is how we - * distinguish, for example, function declarations from function calls. - * - * An exception are structs and unions, because they look the same at any - * level. The caller should give is the "struct" or "union" token. - */ - - for (got_word = 0; t; t = tok_class()) { - switch (t->tokno) { - case TOK_WSPACE: /* advance past blanks */ - case '\n': /* advance past newline */ - case '*': /* indirection: keep trying */ - tok_flush(t); - break; - case TOK_WORD: /* word: keep trying */ - case TOK_COMPOSITE: /* struct or union */ - got_word = 1; - tok_flush(t); - break; - default: - - /* - * Function pointer types can be preceded by zero or more words - * (at least one when not at the top level). Other stuff can be - * accepted only after we have seen at least one word (two words - * when not at the top level). See also the above comment on - * structs and unions. - */ - - if (t->tokno == TOK_LIST && LIST_BEGINS_WITH_STAR(t)) { - if (t = func_ptr_dcl_flush(t)) { - return (t); /* reject token */ - } else { - got_word = 1; /* for = and [ and , and ; */ - } - } else if (got_word == 0) { - return (t); /* reject token */ - } else { - switch (t->tokno) { - case TOK_LIST: /* function type */ - if (t = function_dcl_flush(t)) - return (t); /* reject token */ - break; - case '[': /* dimension, does not nest */ - pair_flush(t, '[', ']'); - break; - case '=': /* initializer follows */ - tok_flush(t); - initializer(); /* rewrite casts */ - break; - case '{': /* struct, union, may nest */ - block_flush(t); /* use code for stmt blocks */ - break; - case ',': /* separator: keep trying */ - got_word = 0; - tok_flush(t); - break; - case ';': /* terminator: succeed */ - tok_flush(t); - return (0); - default: /* reject token */ - return (t); - } - } - } - } - return (0); /* hit EOF */ -} diff --git a/build/unproto/varargs.c b/build/unproto/varargs.c deleted file mode 100644 index 4ca56d8155..0000000000 --- a/build/unproto/varargs.c +++ /dev/null @@ -1,32 +0,0 @@ - /* - * @(#) varargs.c 1.1 91/09/01 23:08:45 - * - * This program can be used to verify that the stdarg.h file is set up - * correctly for your system. If it works, it should print one line with the - * text "stdarg.h works". - */ - -#include -#include "stdarg.h" - -main(int argc, char *argv[]) -{ - varargs_test("%s %s\n", "stdarg.h", "works"); -} - -varargs_test(char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - while (*fmt) { - if (strncmp("%s", fmt, 2) == 0) { - fputs(va_arg(ap, char *), stdout); - fmt += 2; - } else { - putchar(*fmt); - fmt++; - } - } - va_end(ap); -} diff --git a/build/unproto/vstring.c b/build/unproto/vstring.c deleted file mode 100644 index 220bd530fe..0000000000 --- a/build/unproto/vstring.c +++ /dev/null @@ -1,122 +0,0 @@ -/*++ -/* NAME -/* vs_alloc(), VS_ADDCH() -/* SUMMARY -/* auto-resizing string library -/* PACKAGE -/* vstring -/* SYNOPSIS -/* #include "vstring.h" -/* -/* struct vstring *vs_alloc(len) -/* int len; -/* -/* int VS_ADDCH(vs, wp, ch) -/* struct vstring *vs; -/* char *wp; -/* int ch; -/* -/* char *vs_strcpy(vp, dst, src) -/* struct vstring *vp; -/* char *dst; -/* char *src; -/* DESCRIPTION -/* These functions and macros implement a small library for -/* arbitrary-length strings that grow automatically when -/* they fill up. The allocation strategy is such that there -/* will always be place for the terminating null character. -/* -/* vs_alloc() allocates storage for a variable-length string -/* of at least "len" bytes. -/* -/* VS_ADDCH() adds a character to a variable-length string -/* and automagically extends the string if fills up. -/* \fIvs\fP is a pointer to a vstring structure; \fIwp\fP -/* the current write position in the corresponding character -/* array; \fIch\fP the character value to be written. -/* Note that VS_ADDCH() is a macro that evaluates some -/* arguments more than once. -/* -/* vs_strcpy() appends a null-terminated string to a variable-length -/* string. \fIsrc\fP provides the data to be copied; \fIvp\fP is the -/* target, and \fIdst\fP the current write position within the target. -/* The result is null-terminated. The return value is the new write -/* position. -/* DIAGNOSTICS -/* VS_ADDCH() returns zero if it was unable to dynamically -/* resize a string. -/* -/* vs_alloc() returns a null pointer in case of problems. -/* -/* vs_strcpy() returns a null pointer if the request failed. -/* BUGS -/* Auto-resizing may change the address of the string data in -/* a vstring structure. Beware of dangling pointers. -/* AUTHOR(S) -/* Wietse Venema -/* Eindhoven University of Technology -/* Department of Mathematics and Computer Science -/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands -/* LAST MODIFICATION -/* 92/01/15 21:53:06 -/* VERSION/RELEASE -/* 1.3 -/*--*/ - -static char vstring_sccsid[] = "@(#) vstring.c 1.3 92/01/15 21:53:06"; - -/* C library */ - -extern char *malloc(); -extern char *realloc(); - -/* Application-specific stuff */ - -#include "vstring.h" - -/* vs_alloc - initial string allocation */ - -struct vstring *vs_alloc(len) -int len; -{ - register struct vstring *vp; - - if (len < 1 - || (vp = (struct vstring *) malloc(sizeof(struct vstring))) == 0 - || (vp->str = malloc(len)) == 0) - return (0); - vp->last = vp->str + len - 1; - return (vp); -} - -/* vs_realloc - extend string, update write pointer */ - -char *vs_realloc(vp, cp) -register struct vstring *vp; -char *cp; -{ - int where = cp - vp->str; - int len = vp->last - vp->str + 1; - - if ((vp->str = realloc(vp->str, len *= 2)) == 0) - return (0); - vp->last = vp->str + len - 1; - return (vp->str + where); -} - -/* vs_strcpy - copy string */ - -char *vs_strcpy(vp, dst, src) -register struct vstring *vp; -register char *dst; -register char *src; -{ - while (*src) { - if (VS_ADDCH(vp, dst, *src) == 0) - return (0); - src++; - } - *dst = '\0'; - return (dst); -} - diff --git a/build/unproto/vstring.h b/build/unproto/vstring.h deleted file mode 100644 index c2e1f88a77..0000000000 --- a/build/unproto/vstring.h +++ /dev/null @@ -1,15 +0,0 @@ -/* @(#) vstring.h 1.2 92/01/15 21:53:19 */ - -struct vstring { - char *str; /* string value */ - char *last; /* last position */ -}; - -extern struct vstring *vs_alloc(); /* initial allocation */ -extern char *vs_realloc(); /* string extension */ -extern char *vs_strcpy(); /* copy string */ - -/* macro to add one character to auto-resized string */ - -#define VS_ADDCH(vs,wp,c) \ - ((wp < (vs)->last || (wp = vs_realloc(vs,wp))) ? (*wp++ = c) : 0) diff --git a/build/version b/build/version index eb39e5382f..19e2c5948a 100644 --- a/build/version +++ b/build/version @@ -1 +1 @@ -3.3 +1.1-devel diff --git a/clients/Make-template b/clients/Make-template deleted file mode 100644 index 8be29e500e..0000000000 --- a/clients/Make-template +++ /dev/null @@ -1,84 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP clients Makefile -# -#----------------------------------------------------------------------------- - -############################################################################ -# # -# You should not have to edit anything below this point # -# # -############################################################################ - -all: FORCE - @echo "making all in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ - ( cd $$i; $(MAKE) $(MFLAGS) all ); \ - fi; \ - done - - -# -# rules to install the software -# - -install: FORCE - @echo "making install in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ - ( cd $$i; $(MAKE) $(MFLAGS) install ); \ - fi; \ - done - -# -# rules to make clean -# - -clean: FORCE - @echo "making clean in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ - fi; \ - done - -veryclean: clean - -# -# rules to make depend -# -# - -depend: FORCE - @echo "making depend in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ - ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ - fi; \ - done - -links: - @echo "making links in `$(PWD)`"; \ - for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/CVS" ]; then \ - d=`basename $$i`; \ - ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ - $(LN) ../.src/$$d/Make-template . ; \ - $(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \ - -f Make-template links ) ; \ - fi; \ - done diff --git a/clients/Makefile.in b/clients/Makefile.in new file mode 100644 index 0000000000..f4856e8713 --- /dev/null +++ b/clients/Makefile.in @@ -0,0 +1,6 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## Clients Makefile.in for OpenLDAP + +SUBDIRS= tools ud finger gopher mail500 fax500 rcpt500 diff --git a/clients/fax500/Make-template b/clients/fax500/Make-template deleted file mode 100644 index f80e4a3920..0000000000 --- a/clients/fax500/Make-template +++ /dev/null @@ -1,77 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# X.500 ldap fax mailer makefile -# -#----------------------------------------------------------------------------- -LDAPSRC = ../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -SRCS = rp500.c main.c faxtotpc.c -OBJS = rp500.o main.o faxtotpc.o - -INCLUDES= -I$(HDIR) -DEFINES = $(DEFS) - -CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS) -LIBS = -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -all: rp500 fax500 - -rp500: rpversion.o - $(CC) $(ALDFLAGS) -o $@ faxtotpc.o rp500.o rpversion.o \ - -L$(LDIR) $(LIBS) - -fax500: fax5version.o - $(CC) $(ALDFLAGS) -o $@ main.o fax5version.o faxtotpc.o \ - -L$(LDIR) $(LIBS) - -rpversion.c: faxtotpc.o rp500.o $(LDIR)/libldap.a - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Versionrp.c > $@) - -fax5version.c: main.o faxtotpc.o $(LDIR)/libldap.a - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@ ) - -install: rp500 xrpcomp fax500 FORCE - -$(MKDIR) -p $(LDAP_ETCDIR) $(LDAP_BINDIR) $(LDAP_LIBEXECDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 rp500 $(LDAP_LIBEXECDIR) - $(SED) -e 's%ETCDIR%$(LDAP_LIBEXECDIR)%' xrpcomp > /tmp/xrpcomp.tmp - $(INSTALL) $(INSTALLFLAGS) -m 755 /tmp/xrpcomp.tmp $(LDAP_BINDIR)/xrpcomp - $(RM) /tmp/xrpcomp.tmp - $(INSTALL) $(INSTALLFLAGS) -m 755 fax500 $(LDAP_LIBEXECDIR) - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) *.o core a.out rpversion.c fax5version.c rp500 fax500 - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/README .src/xrpcomp .src/*.[ch] . - diff --git a/clients/fax500/Makefile.in b/clients/fax500/Makefile.in new file mode 100644 index 0000000000..302d1c93aa --- /dev/null +++ b/clients/fax500/Makefile.in @@ -0,0 +1,40 @@ +PROGRAMS= rp500 fax500 + +SRCS= main.c faxtotpc.c rp500.c +XSRCS=fax5version.c rpversion.c + +FAX5OBJS = main.o faxtotpc.o +RPOBJS = rp500.o faxtotpc.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +rp500 : rpversion.o + $(CC) $(LDFLAGS) -o $@ $(RPOBJS) rpversion.o $(LIBS) + +fax500 : fax5version.o + $(CC) $(LDFLAGS) -o $@ $(RPOBJS) fax5version.o $(LIBS) + +rpversion.c: ${RPOBJS} $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Versionrp.c > $@) + +fax5version.c: ${FAX5OBJS} $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +install: $(PROGRAMS) xrpcomp FORCE + -$(MKDIR) -p $(libexecdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 rp500 $(libexecdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 fax500 $(libexecdir) + $(SED) -e 's%LIBEXECDIR%$(libexecdir)%' $(srcdir)/xrpcomp > /tmp/xrpcomp.tmp + $(INSTALL) $(INSTALLFLAGS) -m 755 /tmp/xrpcomp.tmp $(libexecdir)/xrpcomp + $(RM) /tmp/xrpcomp.tmp diff --git a/clients/fax500/faxtotpc.c b/clients/fax500/faxtotpc.c index d4631b43e6..10d3ce2411 100644 --- a/clients/fax500/faxtotpc.c +++ b/clients/fax500/faxtotpc.c @@ -19,15 +19,13 @@ * faxtotpc() returns a pointer to a string allocated with malloc(3). */ +#include "portable.h" + #include -#include #include -#include - -#ifdef ultrix -extern char *strdup(); -#endif +#include +#include #define TPCDOMAIN "tpc.int" diff --git a/clients/fax500/main.c b/clients/fax500/main.c index 197b59a217..cb458ccb3a 100644 --- a/clients/fax500/main.c +++ b/clients/fax500/main.c @@ -10,24 +10,27 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" #include -#include #include -#include -#include -#include -#include + +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_PARAM_H #include +#endif + #include -#include -#include #include -#include -#include "portable.h" #include "lber.h" #include "ldap.h" +#include #define USER 0 #define GROUP_ERRORS 1 @@ -921,14 +924,14 @@ send_message( to ) char **to; { int pid; -#ifndef USE_WAITPID +#ifndef HAVE_WAITPID WAITSTATUSTYPE status; #endif /* parent */ if ( pid = fork() ) { -#ifdef USE_WAITPID +#ifdef HAVE_WAITPID waitpid( pid, (int *) NULL, 0 ); #else wait4( pid, &status, WAIT_FLAGS, 0 ); @@ -953,7 +956,7 @@ send_group( group, ngroup ) char **argv; int argc; char *iargv[7]; -#ifndef USE_WAITPID +#ifndef HAVE_WAITPID WAITSTATUSTYPE status; #endif @@ -976,7 +979,7 @@ send_group( group, ngroup ) /* parent */ if ( pid = fork() ) { -#ifdef USE_WAITPID +#ifdef HAVE_WAITPID waitpid( pid, (int *) NULL, 0 ); #else wait4( pid, &status, WAIT_FLAGS, 0 ); diff --git a/clients/fax500/rp500.c b/clients/fax500/rp500.c index 46be50f772..540554cfba 100644 --- a/clients/fax500/rp500.c +++ b/clients/fax500/rp500.c @@ -10,19 +10,19 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include + +#include + #include #include diff --git a/clients/fax500/xrpcomp b/clients/fax500/xrpcomp index 39c59e38aa..4a8d809d8c 100644 --- a/clients/fax500/xrpcomp +++ b/clients/fax500/xrpcomp @@ -1,6 +1,6 @@ #! /bin/sh -RP500=ETCDIR/rp500 +RP500=%LIBEXECDIR%/rp500 NAME="$1" if [ -z "$NAME" ]; then diff --git a/clients/finger/Make-template b/clients/finger/Make-template deleted file mode 100644 index fbcefd8cdf..0000000000 --- a/clients/finger/Make-template +++ /dev/null @@ -1,62 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# X.500 ldap finger daemon makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC = ../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -SRCS = main.c -OBJS = main.o - -INCLUDES=-I$(HDIR) -DEFINES = $(DEFS) - -CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS) -LIBS = -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -all: in.xfingerd - -in.xfingerd: version.o - $(CC) $(ALDFLAGS) -o $@ $(OBJS) version.o \ - -L$(LDIR) $(LIBS) - -version.c: $(OBJS) $(LDIR)/libldap.a - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -install: in.xfingerd FORCE - -$(MKDIR) -p $(LDAP_LIBEXECDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 in.xfingerd $(LDAP_LIBEXECDIR) - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) *.o core a.out version.c in.xfingerd - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/README .src/*.[ch] . - diff --git a/clients/finger/Makefile.in b/clients/finger/Makefile.in new file mode 100644 index 0000000000..951d5684b4 --- /dev/null +++ b/clients/finger/Makefile.in @@ -0,0 +1,22 @@ +SRCS= main.c +XSRCS= version.c +OBJS= main.o +PROGRAMS= in.xfingerd + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +in.xfingerd : version.o + $(CC) $(LDFLAGS) -o $@ version.o $(OBJS) $(LIBS) + +version.c: ${OBJS} ${LDAP_LIBDEPEND} + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +install: $(PROGRAMS) FORCE + -$(MKDIR) -p $(libexecdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 in.xfingerd $(libexecdir) diff --git a/clients/finger/main.c b/clients/finger/main.c index 5acb901d1f..90d3f0c0ed 100644 --- a/clients/finger/main.c +++ b/clients/finger/main.c @@ -10,33 +10,27 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef aix -#include -#endif /* aix */ #include +#include +#include +#include +#include +#include +#include + +#include + #include "lber.h" #include "ldap.h" #include "disptmpl.h" -#include "portable.h" #include "ldapconfig.h" -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ int dosyslog = 1; char *ldaphost = LDAPHOST; @@ -176,11 +170,13 @@ static do_query() exit( 1 ); } -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF tblsize = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE tblsize = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + tblsize = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if (tblsize > FD_SETSIZE) { diff --git a/clients/gopher/Make-template b/clients/gopher/Make-template deleted file mode 100644 index 0ab0cfad82..0000000000 --- a/clients/gopher/Make-template +++ /dev/null @@ -1,79 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# gopher to x.500 gateway makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC = ../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -SRCS = go500.c go500gw.c detach.c setproctitle.c -OBJS = go500.o go500gw.o detach.o setproctitle.o -GOOBJS = go500.o detach.o goversion.o setproctitle.o -GWOBJS = go500gw.o detach.o gwversion.o setproctitle.o - -INCLUDES= -I$(HDIR) -DEFINES = $(DEFS) - -CFLAGS = $(INCLUDES) $(DEFS) $(ACFLAGS) -LIBS = -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -DLIBS = $(LDIR)/libldap.a $(LDIR)/liblber.a - -all: go500gw go500 - -go500gw: gwversion.o - $(CC) $(ALDFLAGS) -o $@ $(GWOBJS) -L$(LDIR) $(LIBS) - -go500: goversion.o - $(CC) $(ALDFLAGS) -o $@ $(GOOBJS) -L$(LDIR) $(LIBS) - -goversion.c: go500.o detach.o setproctitle.o $(DLIBS) - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -gwversion.c: go500gw.o detach.o setproctitle.o $(DLIBS) - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Versiongw.c > $@) - -install: go500 go500gw go500gw.help FORCE - -$(MKDIR) -p $(LDAP_ETCDIR) $(LDAP_LIBEXECDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 go500 $(LDAP_LIBEXECDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 go500gw $(LDAP_LIBEXECDIR) - -$(MV) $(LDAP_ETCDIR)/go500gw.help $(LDAP_ETCDIR)/go500gw.help- - $(INSTALL) $(INSTALLFLAGS) -m 644 go500gw.help $(LDAP_ETCDIR) - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) *.o core a.out gwversion.c goversion.c go500gw go500 - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/README .src/*.help .src/*.[ch] . - diff --git a/clients/gopher/Makefile.in b/clients/gopher/Makefile.in new file mode 100644 index 0000000000..d6f4aacf8e --- /dev/null +++ b/clients/gopher/Makefile.in @@ -0,0 +1,42 @@ +## +## Makefile for gopher clients +## +PROGRAMS= go500gw go500 + +SRCS= detach.c go500.c go500gw.c setproctitle.c +XSRCS= gwversion.o goversion.o +GOOBJS = go500.o detach.o setproctitle.o +GWOBJS = go500gw.o detach.o setproctitle.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + + +go500 : goversion.o + $(CC) $(LDFLAGS) -o $@ $(GOOBJS) goversion.o $(LIBS) + +go500gw : gwversion.o + $(CC) $(LDFLAGS) -o $@ $(GWOBJS) gwversion.o $(LIBS) + +goversion.c: ${GOOBJS} $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +gwversion.c: ${GWOBJS} $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Versiongw.c > $@) + +install: $(PROGRAMS) go500gw.help FORCE + -$(MKDIR) -p $(libexecdir) $(sysconfdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 go500 $(libexecdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 go500gw $(libexecdir) + -$(MV) $(sysconfdir)/go500gw.help $(sysconfdir)/go500gw.help- + $(INSTALL) $(INSTALLFLAGS) -m 644 go500gw.help $(sysconfdir) diff --git a/clients/gopher/detach.c b/clients/gopher/detach.c index 09997c1298..8a8baa670c 100644 --- a/clients/gopher/detach.c +++ b/clients/gopher/detach.c @@ -10,28 +10,29 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include +#include + #include #include #include -#include -#include "portable.h" -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ +#include detach( debug ) int debug; { int i, sd, nbits; -#ifdef USE_SYSCONF +#if defined( HAVE_SYSCONF ) nbits = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif defined( HAVE_GETDTABLESIZE ) nbits = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + nbits = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if (nbits > FD_SETSIZE) { @@ -39,7 +40,6 @@ int debug; } #endif /* FD_SETSIZE*/ - if ( debug == 0 || !(isatty( 1 )) ) { for ( i = 0; i < 5; i++ ) { switch ( fork() ) { @@ -73,14 +73,14 @@ int debug; (void) dup2( sd, 2 ); close( sd ); -#ifdef USE_SETSID +#ifdef HAVE_SETSID (void) setsid(); -#else /* USE_SETSID */ +#else /* HAVE_SETSID */ if ( (sd = open( "/dev/tty", O_RDWR )) != -1 ) { (void) ioctl( sd, TIOCNOTTY, NULL ); (void) close( sd ); } -#endif /* USE_SETSID */ +#endif /* HAVE_SETSID */ } (void) signal( SIGPIPE, SIG_IGN ); diff --git a/clients/gopher/go500.c b/clients/gopher/go500.c index 42cb5e4f6d..6a8a70c528 100644 --- a/clients/gopher/go500.c +++ b/clients/gopher/go500.c @@ -10,33 +10,30 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_PARAM_H #include -#include -#include -#include -#include -#include -#include +#endif + #include -#include -#ifdef aix -#include -#endif /* aix */ -#include -#include "portable.h" + #include "ldapconfig.h" #include "lber.h" #include "ldap.h" #include "disptmpl.h" -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ - int debug; int dosyslog; int inetd; @@ -52,7 +49,7 @@ char myhost[MAXHOSTNAMELEN]; int myport; static set_socket(); -static SIG_FN wait4child(); +static RETSIGTYPE wait4child(); static do_queries(); static do_error(); static do_search(); @@ -78,7 +75,7 @@ char **argv; struct hostent *hp; struct sockaddr_in from; int fromlen; - SIG_FN wait4child(); + RETSIGTYPE wait4child(); extern char *optarg; extern char **Argv; extern int Argc; @@ -140,11 +137,13 @@ char **argv; } #endif -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF dtblsize = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE dtblsize = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + dtblsize = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if (dtblsize > FD_SETSIZE) { @@ -177,7 +176,7 @@ char **argv; s = set_socket( port ); /* arrange to reap children */ - (void) signal( SIGCHLD, (void *) wait4child ); + (void) SIGNAL( SIGCHLD, wait4child ); } else { myport = GO500_PORT; @@ -299,20 +298,24 @@ int port; return( s ); } -static SIG_FN +static RETSIGTYPE wait4child() { +#ifndef HAVE_WAITPID WAITSTATUSTYPE status; +#endif if ( debug ) printf( "parent: catching child status\n" ); -#ifdef USE_WAITPID + +#ifdef HAVE_WAITPID while (waitpid ((pid_t) -1, 0, WAIT_FLAGS) > 0) -#else /* USE_WAITPID */ - while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 ) -#endif /* USE_WAITPID */ - ; /* NULL */ + ; /* NULL */ +#else + while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 ) + ; /* NULL */ +#endif - (void) signal( SIGCHLD, (void *) wait4child ); + (void) SIGNAL( SIGCHLD, wait4child ); } static diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index 6d1ed89bf1..df804c5024 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -10,33 +10,29 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include + #include -#include -#include -#ifdef aix -#include -#endif /* aix */ -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ +#ifdef HAVE_SYS_PARAM_H +#include +#endif #include "lber.h" #include "ldap.h" #include "disptmpl.h" -#include "portable.h" #include "ldapconfig.h" int debug; @@ -54,7 +50,7 @@ char *friendlyfile = FRIENDLYFILE; int rdncount = GO500GW_RDNCOUNT; static set_socket(); -static SIG_FN wait4child(); +static RETSIGTYPE wait4child(); static do_queries(); static do_menu(); static do_list(); @@ -87,7 +83,7 @@ char **argv; struct hostent *hp; struct sockaddr_in from; int fromlen; - SIG_FN wait4child(); + RETSIGTYPE wait4child(); extern char *optarg; extern char **Argv; extern int Argc; @@ -152,11 +148,13 @@ char **argv; } } -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF dtblsize = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE dtblsize = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + dtblsize = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if ( dtblsize > FD_SETSIZE ) { @@ -200,7 +198,7 @@ char **argv; s = set_socket( port ); /* arrange to reap children */ - (void) signal( SIGCHLD, (void *) wait4child ); + (void) SIGNAL( SIGCHLD, wait4child ); } if ( inetd ) { @@ -324,20 +322,24 @@ int port; return( s ); } -static SIG_FN +static RETSIGTYPE wait4child() { - WAITSTATUSTYPE status; +#ifndef HAVE_WAITPID + WAITSTATUSTYPE status; +#endif + + if ( debug ) printf( "parent: catching child status\n" ); - if ( debug ) printf( "parent: catching child status\n" ); -#ifdef USE_WAITPID - while (waitpid ((pid_t) -1, 0, WAIT_FLAGS) > 0) -#else /* USE_WAITPID */ - while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 ) -#endif /* USE_WAITPID */ - ; /* NULL */ +#ifdef HAVE_WAITPID + while (waitpid ((pid_t) -1, NULL, WAIT_FLAGS) > 0) + ; /* NULL */ +#else + while (wait3( &status, WAIT_FLAGS, 0 ) > 0 ) + ; /* NULL */ +#endif - (void) signal( SIGCHLD, (void *) wait4child ); + (void) SIGNAL( SIGCHLD, wait4child ); } static do_queries( s ) diff --git a/clients/gopher/setproctitle.c b/clients/gopher/setproctitle.c index c7f832604d..555b8a9286 100644 --- a/clients/gopher/setproctitle.c +++ b/clients/gopher/setproctitle.c @@ -10,6 +10,8 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + char **Argv; /* pointer to original (main's) argv */ int Argc; /* original argc */ diff --git a/clients/mail500/Make-template b/clients/mail500/Make-template deleted file mode 100644 index 54fc974526..0000000000 --- a/clients/mail500/Make-template +++ /dev/null @@ -1,61 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# X.500 ldap mailer makefile -# -#----------------------------------------------------------------------------- -LDAPSRC = ../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -SRCS = main.c -OBJS = main.o - -INCLUDES= -I$(HDIR) -DEFINES = $(DEFS) - -CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS) -LDFLAGS = -L$(LDIR) -LIBS = -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -all: mail500 - -mail500: version.o - $(CC) $(ALDFLAGS) -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) - -version.c: $(OBJS) $(LDIR)/libldap/libldap.a - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -install: mail500 FORCE - -$(MKDIR) -p $(LDAP_LIBEXECDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 mail500 $(LDAP_LIBEXECDIR) - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) *.o core a.out version.c mail500 - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/README .src/sendmail.cf .src/*.[ch] . - diff --git a/clients/mail500/Makefile.in b/clients/mail500/Makefile.in new file mode 100644 index 0000000000..53bee9af94 --- /dev/null +++ b/clients/mail500/Makefile.in @@ -0,0 +1,23 @@ +PROGRAMS= mail500 + +SRCS= main.c +XSRCS= version.c +OBJS= main.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +mail500 : version.o + $(CC) $(LDFLAGS) -o $@ version.o $(OBJS) $(LIBS) + +version.c: ${OBJS} $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +install: $(PROGRAMS) FORCE + -$(MKDIR) -p $(libexecdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 mail500 $(libexecdir) diff --git a/clients/mail500/main.c b/clients/mail500/main.c index 5fdea96201..534eb0111d 100644 --- a/clients/mail500/main.c +++ b/clients/mail500/main.c @@ -10,18 +10,23 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include #include -#include -#include -#include -#include + +#include +#include +#include +#include + +#ifdef HAVE_SYS_PARAM_H #include +#endif + #include -#include + #include -#include "portable.h" #include "lber.h" #include "ldap.h" @@ -1029,7 +1034,7 @@ send_message( to ) char **to; { int pid; -#ifndef USE_WAITPID +#ifndef HAVE_WAITPID WAITSTATUSTYPE status; #endif @@ -1048,7 +1053,7 @@ send_message( to ) /* parent */ if ( pid = fork() ) { -#ifdef USE_WAITPID +#ifdef HAVE_WAITPID waitpid( pid, (int *) NULL, 0 ); #else wait4( pid, &status, WAIT_FLAGS, 0 ); @@ -1073,7 +1078,7 @@ send_group( group, ngroup ) char **argv; int argc; char *iargv[7]; -#ifndef USE_WAITPID +#ifndef HAVE_WAITPID WAITSTATUSTYPE status; #endif @@ -1108,7 +1113,7 @@ send_group( group, ngroup ) /* parent */ if ( pid = fork() ) { -#ifdef USE_WAITPID +#ifdef HAVE_WAITPID waitpid( pid, (int *) NULL, 0 ); #else wait4( pid, &status, WAIT_FLAGS, 0 ); @@ -1136,7 +1141,7 @@ send_errors( err, nerr ) int fd[2]; char *argv[8]; char buf[1024]; -#ifndef USE_WAITPID +#ifndef HAVE_WAITPID WAITSTATUSTYPE status; #endif @@ -1255,7 +1260,7 @@ send_errors( err, nerr ) } fclose( fp ); -#ifdef USE_WAITPID +#ifdef HAVE_WAITPID waitpid( pid, (int *) NULL, 0 ); #else wait4( pid, &status, WAIT_FLAGS, 0 ); diff --git a/clients/rcpt500/Make-template b/clients/rcpt500/Make-template deleted file mode 100644 index ef1b3e752f..0000000000 --- a/clients/rcpt500/Make-template +++ /dev/null @@ -1,60 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# X.500 ldap rcpt500 mail query responder makefile -# -#----------------------------------------------------------------------------- -LDAPSRC = ../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -SRCS= main.c cmds.c help.c query.c -OBJS= main.o cmds.o help.o query.o - -INCLUDES= -I$(HDIR) -DEFINES = $(DEFS) -CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS) -LIBS = -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -all: rcpt500 - -rcpt500: version.o - $(CC) $(ALDFLAGS) -o $@ $(OBJS) version.o -L$(LDIR) $(LIBS) - -version.c: $(OBJS) $(LDIR)/libldap.a - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -install: rcpt500 rcpt500.help FORCE - -$(MKDIR) -p $(LDAP_ETCDIR) $(LDAP_LIBEXECDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 rcpt500 $(LDAP_LIBEXECDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 rcpt500.help $(LDAP_ETCDIR) - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) *.o core a.out version.c rcpt500 - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/README .src/*.[ch] .src/*.help . - diff --git a/clients/rcpt500/Makefile.in b/clients/rcpt500/Makefile.in new file mode 100644 index 0000000000..1744d815c9 --- /dev/null +++ b/clients/rcpt500/Makefile.in @@ -0,0 +1,25 @@ +PROGRAMS= rcpt500 +SRCS= main.c cmds.c help.c query.c +XSRCS= version.c +OBJS= main.o cmds.o help.o query.o +HDRS= rcpt500.h + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +rcpt500 : version.o + $(CC) $(LDFLAGS) -o $@ version.o $(OBJS) $(LIBS) + +version.c: ${OBJS} $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +install: $(PROGRAMS) rcpt500.help FORCE + -$(MKDIR) -p $(libexecdir) $(sysconfdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 rcpt500 $(libexecdir) + -$(MV) $(sysconfdir)/rcpt500.help $(sysconfdir)/rcpt500.help- + $(INSTALL) $(INSTALLFLAGS) -m 644 rcpt500.help $(sysconfdir) diff --git a/clients/rcpt500/cmds.c b/clients/rcpt500/cmds.c index fe89309567..8b5a938f2e 100644 --- a/clients/rcpt500/cmds.c +++ b/clients/rcpt500/cmds.c @@ -6,7 +6,9 @@ * All Rights Reserved */ -#include +#include "portable.h" + +#include #include "rcpt500.h" struct command cmds[] = { diff --git a/clients/rcpt500/help.c b/clients/rcpt500/help.c index 0f541ab9be..b789da2343 100644 --- a/clients/rcpt500/help.c +++ b/clients/rcpt500/help.c @@ -6,12 +6,17 @@ * All Rights Reserved */ +#include "portable.h" + #include -#include -#include + +#include +#include + +#ifdef HAVE_FCNTL_H #include +#endif -#include "portable.h" #include "ldapconfig.h" #include "rcpt500.h" diff --git a/clients/rcpt500/main.c b/clients/rcpt500/main.c index 3e65ac233b..b29920ff40 100644 --- a/clients/rcpt500/main.c +++ b/clients/rcpt500/main.c @@ -6,24 +6,24 @@ * All Rights Reserved */ +#include "portable.h" + #include #include -#include -#include #include -#include "portable.h" +#include +#include + + #include "ldapconfig.h" #include "rcpt500.h" -#ifdef ultrix -extern char *strdup(); -#endif - int dosyslog = 0; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int do_cldap = 0; -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ + int derefaliases = 1; int sizelimit = RCPT500_SIZELIMIT; int rdncount = RCPT500_RDNCOUNT; @@ -78,11 +78,12 @@ main( argc, argv ) dosyslog = 1; break; case 'U': -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS do_cldap = 1; -#else /* CLDAP */ - fprintf( stderr, "Compile with -DCLDAP for -U support\n" ); -#endif /* CLDAP */ +#else /* LDAP_CONNECTIONLESS */ + fprintf( stderr, + "Compile with -DLDAP_CONNECTIONLESS for -U support\n" ); +#endif /* LDAP_CONNECTIONLESS */ break; case 'b': searchbase = optarg; diff --git a/clients/rcpt500/query.c b/clients/rcpt500/query.c index 1ac78c17c9..85b0f5b5f8 100644 --- a/clients/rcpt500/query.c +++ b/clients/rcpt500/query.c @@ -6,18 +6,21 @@ * All Rights Reserved */ +#include "portable.h" + #include -#include -#include #include -#include + +#include +#include +#include #include "lber.h" #include "ldap.h" -#include "portable.h" -#include "ldapconfig.h" #include "disptmpl.h" + #include "rcpt500.h" +#include "ldapconfig.h" extern int dosyslog; extern int do_cldap; @@ -77,11 +80,11 @@ query_cmd( msgp, reply ) /* * open connection to LDAP server and bind as dapuser */ -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_cldap ) ldp = cldap_open( ldaphost, ldapport ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ ldp = ldap_open( ldaphost, ldapport ); if ( ldp == NULL ) { @@ -91,9 +94,9 @@ query_cmd( msgp, reply ) return( 0 ); } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( !do_cldap ) -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( ldap_simple_bind_s( ldp, dapuser, NULL ) != LDAP_SUCCESS ) { report_ldap_err( ldp, reply ); close_ldap( ldp ); @@ -110,11 +113,11 @@ query_cmd( msgp, reply ) matches = 0; #ifdef RCPT500_UFN -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( !do_cldap && strchr( msgp->msg_arg, ',' ) != NULL ) { -#else /* CLDAP */ +#else /* LDAP_CONNECTIONLESS */ if ( strchr( msgp->msg_arg, ',' ) != NULL ) { -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ struct timeval tv; ldap_ufn_setprefix( ldp, searchbase ); @@ -133,12 +136,12 @@ query_cmd( msgp, reply ) for ( lfi = ldap_getfirstfilter( lfdp, "rcpt500", msgp->msg_arg ); lfi != NULL; lfi = ldap_getnextfilter( lfdp )) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_cldap ) rc = cldap_search_s( ldp, searchbase, LDAP_SCOPE_SUBTREE, lfi->lfi_filter, attrs, 0, &ldmsgp, dapuser ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ rc = ldap_search_s( ldp, searchbase, LDAP_SCOPE_SUBTREE, lfi->lfi_filter, attrs, 0, &ldmsgp ); @@ -220,11 +223,11 @@ query_cmd( msgp, reply ) void close_ldap( LDAP *ld ) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_cldap ) cldap_close( ld ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ ldap_unbind( ld ); } @@ -319,7 +322,7 @@ do_read( ldp, dn, reply, tmpll ) rc = ldap_entry2text_search( ldp, dn, searchbase, NULLMSG, tmpll, - defattrs, defvals, (void *)append_text, (void *)reply, "\n", + defattrs, defvals, append_text, (void *)reply, "\n", rdncount, LDAP_DISP_OPT_DOSEARCHACTIONS ); return( rc ); diff --git a/clients/rcpt500/rcpt500.h b/clients/rcpt500/rcpt500.h index 537f92c1c4..8b3a5ea17d 100644 --- a/clients/rcpt500/rcpt500.h +++ b/clients/rcpt500/rcpt500.h @@ -6,6 +6,10 @@ * All Rights Reserved */ +#include + +LDAP_BEGIN_DECL + struct msginfo { char *msg_subject; char *msg_replyto; /* actually could be from From: line */ @@ -16,8 +20,8 @@ struct msginfo { }; struct command { - char *cmd_text; /* text for command, e.g. "HELP" */ - int (*cmd_handler)(); /* pointer to handler function */ + char *cmd_text; /* text for command, e.g. "HELP" */ + int (*cmd_handler)LDAP_P(()); /* pointer to handler function */ }; @@ -27,10 +31,12 @@ struct command { /* * functions */ -int help_cmd(); -int query_cmd(); +int help_cmd LDAP_P(()); +int query_cmd LDAP_P(()); /* * externs */ extern struct command cmds[]; + +LDAP_END_DECL diff --git a/clients/tools/Make-template b/clients/tools/Make-template deleted file mode 100644 index 09504f9136..0000000000 --- a/clients/tools/Make-template +++ /dev/null @@ -1,105 +0,0 @@ -#---------------------------------------------------------------------------- -# 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. -# -# LDAP tools makefile -# -#----------------------------------------------------------------------------- -LDAPSRC = ../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -SRCS = ldapsearch.c ldapmodify.c ldapdelete.c ldapmodrdn.c -OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o - -INCLUDES= -I$(HDIR) -DEFINES = $(DEFS) - -CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS) -LIBS = -lldap -llber -lldif $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -all: ldapsearch ldapmodify ldapdelete ldapmodrdn ldapadd - -ldapsearch: ldsversion.o - $(CC) $(ALDFLAGS) -o $@ ldapsearch.o ldsversion.o \ - -L$(LDIR) $(LIBS) - -ldapmodify: ldmversion.o - $(CC) $(ALDFLAGS) -o $@ ldapmodify.o ldmversion.o \ - -L$(LDIR) $(LIBS) - -ldapdelete: lddversion.o - $(CC) $(ALDFLAGS) -o $@ ldapdelete.o lddversion.o -L$(LDIR) $(LIBS) - -ldapmodrdn: ldrversion.o - $(CC) $(ALDFLAGS) -o $@ ldapmodrdn.o ldrversion.o -L$(LDIR) $(LIBS) - -ldapadd: ldapmodify - $(RM) $@ - $(HARDLN) ldapmodify ldapadd - -ldsversion.c: ldapsearch.o - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Versionlds.c > $@) - -ldmversion.c: ldapmodify.o - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Versionldm.c > $@) - -lddversion.c: ldapdelete.o - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Versionldd.c > $@) - -ldrversion.c: ldapmodrdn.o - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Versionldr.c > $@) - -install: ldapsearch ldapmodify ldapdelete ldapmodrdn ldapadd FORCE - -$(MKDIR) -p $(LDAP_BINDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 ldapsearch $(LDAP_BINDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 ldapmodify $(LDAP_BINDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 ldapdelete $(LDAP_BINDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 ldapmodrdn $(LDAP_BINDIR) - $(RM) $(LDAP_BINDIR)/ldapadd - $(HARDLN) $(LDAP_BINDIR)/ldapmodify $(LDAP_BINDIR)/ldapadd - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) *.o core a.out ld*version.c ldapsearch ldapmodify ldapdelete \ - ldapmodrdn ldapadd - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/*.[ch] . - diff --git a/clients/tools/Makefile.in b/clients/tools/Makefile.in new file mode 100644 index 0000000000..9133a26410 --- /dev/null +++ b/clients/tools/Makefile.in @@ -0,0 +1,70 @@ +## +## Makefile for LDAP tools +## +SRCS = ldapsearch.c ldapmodify.c ldapdelete.c ldapmodrdn.c +OBJS = ldapsearch.o ldapmodify.o ldapdelete.o ldapmodrdn.o +XLIBS = -llber -lldap + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +XSRCS = ldsversion.c ldmversion.c lddversion.c ldrversion.c + +PROGRAMS = ldapsearch ldapmodify ldapdelete ldapmodrdn ldapadd + +ldapsearch: ldsversion.o + $(CC) $(LDFLAGS) -o $@ ldapsearch.o ldsversion.o $(LIBS) + +ldapmodify: ldmversion.o + $(CC) $(LDFLAGS) -o $@ ldapmodify.o ldmversion.o $(LIBS) + +ldapdelete: lddversion.o + $(CC) $(LDFLAGS) -o $@ ldapdelete.o lddversion.o $(LIBS) + +ldapmodrdn: ldrversion.o + $(CC) $(LDFLAGS) -o $@ ldapmodrdn.o ldrversion.o $(LIBS) + +ldapadd: ldapmodify + $(RM) $@ + $(LN) ldapmodify ldapadd + +ldsversion.c: ldapsearch.o $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Versionlds.c > $@) + +ldmversion.c: ldapmodify.o $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Versionldm.c > $@) + +lddversion.c: ldapdelete.o $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Versionldd.c > $@) + +ldrversion.c: ldapmodrdn.o $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Versionldr.c > $@) + +installlocal: ldapsearch ldapmodify ldapdelete ldapmodrdn ldapadd FORCE + -$(MKDIR) -p $(bindir) + $(INSTALL) $(INSTALLFLAGS) -m 755 ldapsearch $(bindir) + $(INSTALL) $(INSTALLFLAGS) -m 755 ldapmodify $(bindir) + $(INSTALL) $(INSTALLFLAGS) -m 755 ldapdelete $(bindir) + $(INSTALL) $(INSTALLFLAGS) -m 755 ldapmodrdn $(bindir) + $(RM) $(BINDIR)/ldapadd + $(LN) $(BINDIR)/ldapmodify $(bindir)/ldapadd diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 29a372df59..36a325c850 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -1,10 +1,13 @@ /* ldapdelete.c - simple program to delete an entry using LDAP */ +#include "portable.h" + #include -#include #include #include -#include + +#include +#include #include #include @@ -26,15 +29,18 @@ extern int ldap_debug, lber_debug; #define safe_realloc( ptr, size ) ( ptr == NULL ? malloc( size ) : \ realloc( ptr, size )) +static int dodelete LDAP_P(( + LDAP *ld, + char *dn)); main( argc, argv ) int argc; char **argv; { char *usage = "usage: %s [-n] [-v] [-k] [-d debug-level] [-f file] [-h ldaphost] [-p ldapport] [-D binddn] [-w passwd] [dn]...\n"; - char *p, buf[ 4096 ]; + char buf[ 4096 ]; FILE *fp; - int i, rc, kerberos, linenum, authmethod; + int i, rc, kerberos, authmethod; extern char *optarg; extern int optind; @@ -135,9 +141,9 @@ main( argc, argv ) } -dodelete( ld, dn ) - LDAP *ld; - char *dn; +static int dodelete( + LDAP *ld, + char *dn) { int rc; diff --git a/clients/tools/ldapdelete.dsp b/clients/tools/ldapdelete.dsp new file mode 100644 index 0000000000..2cdee1025d --- /dev/null +++ b/clients/tools/ldapdelete.dsp @@ -0,0 +1,91 @@ +# Microsoft Developer Studio Project File - Name="ldapdelete" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ldapdelete - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ldapdelete.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ldapdelete.mak" CFG="ldapdelete - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ldapdelete - Win32 Release" (based on\ + "Win32 (x86) Console Application") +!MESSAGE "ldapdelete - Win32 Debug" (based on\ + "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ldapdelete - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release\ldapdelete" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libldap.lib liblber.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "ldapdelete - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug\ldapdelete" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libldap.lib liblber.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug" + +!ENDIF + +# Begin Target + +# Name "ldapdelete - Win32 Release" +# Name "ldapdelete - Win32 Debug" +# Begin Source File + +SOURCE=.\ldapdelete.c +# End Source File +# End Target +# End Project diff --git a/clients/tools/ldapdelete.dsw b/clients/tools/ldapdelete.dsw new file mode 100644 index 0000000000..48462a373e --- /dev/null +++ b/clients/tools/ldapdelete.dsw @@ -0,0 +1,74 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "ldapdelete"=.\ldapdelete.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name liblber + End Project Dependency + Begin Project Dependency + Project_Dep_Name libldap + End Project Dependency + Begin Project Dependency + Project_Dep_Name liblutil + End Project Dependency +}}} + +############################################################################### + +Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c index 9d9cd2263f..9734ab674e 100644 --- a/clients/tools/ldapmodify.c +++ b/clients/tools/ldapmodify.c @@ -1,16 +1,24 @@ /* ldapmodify.c - generic program to modify or add entries using LDAP */ +#include "portable.h" + #include -#include #include #include -#include + +#include +#include +#include + #include + +#ifdef HAVE_SYS_FILE_H #include +#endif +#ifdef HAVE_FCNTL_H #include -#ifndef VMS -#include -#endif /* VMS */ +#endif + #include #include #include @@ -50,33 +58,19 @@ extern int ldap_debug, lber_debug; #define T_DELETEOLDRDNSTR "deleteoldrdn" -#ifdef NEEDPROTOS -static int process_ldapmod_rec( char *rbuf ); -static int process_ldif_rec( char *rbuf ); -static void addmodifyop( LDAPMod ***pmodsp, int modop, char *attr, - char *value, int vlen ); -static int domodify( char *dn, LDAPMod **pmods, int newentry ); -static int dodelete( char *dn ); -static int domodrdn( char *dn, char *newrdn, int deleteoldrdn ); -static void freepmods( LDAPMod **pmods ); -static int fromfile( char *path, struct berval *bv ); -static char *read_one_record( FILE *fp ); -#else /* NEEDPROTOS */ -static int process_ldapmod_rec(); -static int process_ldif_rec(); -static void addmodifyop(); -static int domodify(); -static int dodelete(); -static int domodrdn(); -static void freepmods(); -static int fromfile(); -static char *read_one_record(); -#endif /* NEEDPROTOS */ - - -main( argc, argv ) - int argc; - char **argv; +static int process_ldapmod_rec LDAP_P(( char *rbuf )); +static int process_ldif_rec LDAP_P(( char *rbuf )); +static void addmodifyop LDAP_P(( LDAPMod ***pmodsp, int modop, char *attr, + char *value, int vlen )); +static int domodify LDAP_P(( char *dn, LDAPMod **pmods, int newentry )); +static int dodelete LDAP_P(( char *dn )); +static int domodrdn LDAP_P(( char *dn, char *newrdn, int deleteoldrdn )); +static void freepmods LDAP_P(( LDAPMod **pmods )); +static int fromfile LDAP_P(( char *path, struct berval *bv )); +static char *read_one_record LDAP_P(( FILE *fp )); + + +main( int argc, char **argv ) { char *infile, *rbuf, *start, *p, *q; FILE *fp; @@ -612,7 +606,7 @@ domodify( char *dn, LDAPMod **pmods, int newentry ) for ( j = 0; pmods[ i ]->mod_bvalues[ j ] != NULL; ++j ) { bvp = pmods[ i ]->mod_bvalues[ j ]; notascii = 0; - for ( k = 0; k < bvp->bv_len; ++k ) { + for ( k = 0; (unsigned long) k < bvp->bv_len; ++k ) { if ( !isascii( bvp->bv_val[ k ] )) { notascii = 1; break; @@ -760,7 +754,7 @@ fromfile( char *path, struct berval *bv ) eof = feof( fp ); fclose( fp ); - if ( rlen != bv->bv_len ) { + if ( (unsigned long) rlen != bv->bv_len ) { perror( path ); free( bv->bv_val ); return( -1 ); diff --git a/clients/tools/ldapmodify.dsp b/clients/tools/ldapmodify.dsp new file mode 100644 index 0000000000..e50f69b266 --- /dev/null +++ b/clients/tools/ldapmodify.dsp @@ -0,0 +1,91 @@ +# Microsoft Developer Studio Project File - Name="ldapmodify" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ldapmodify - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ldapmodify.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ldapmodify.mak" CFG="ldapmodify - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ldapmodify - Win32 Release" (based on\ + "Win32 (x86) Console Application") +!MESSAGE "ldapmodify - Win32 Debug" (based on\ + "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ldapmodify - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libldap.lib liblber.lib libldif.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "ldapmodify - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug\ldapmodify" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libldap.lib liblber.lib libldif.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug" + +!ENDIF + +# Begin Target + +# Name "ldapmodify - Win32 Release" +# Name "ldapmodify - Win32 Debug" +# Begin Source File + +SOURCE=.\ldapmodify.c +# End Source File +# End Target +# End Project diff --git a/clients/tools/ldapmodify.dsw b/clients/tools/ldapmodify.dsw new file mode 100644 index 0000000000..64470316b9 --- /dev/null +++ b/clients/tools/ldapmodify.dsw @@ -0,0 +1,89 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "ldapmodify"=.\ldapmodify.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name liblber + End Project Dependency + Begin Project Dependency + Project_Dep_Name libldap + End Project Dependency + Begin Project Dependency + Project_Dep_Name liblutil + End Project Dependency + Begin Project Dependency + Project_Dep_Name libldif + End Project Dependency +}}} + +############################################################################### + +Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libldif"=..\..\libraries\libldif\libldif.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index 0cf4a23ee5..8eae7ff01f 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -1,10 +1,14 @@ /* ldapmodrdn.c - generic program to modify an entry's RDN using LDAP */ +#define DISABLE_BRIDGE +#include "portable.h" + #include -#include #include #include -#include + +#include +#include #include #include @@ -26,16 +30,20 @@ extern int ldap_debug, lber_debug; #define safe_realloc( ptr, size ) ( ptr == NULL ? malloc( size ) : \ realloc( ptr, size )) +static int domodrdn LDAP_P(( + LDAP *ld, + char *dn, + char *rdn, + int remove)); /* flag: remove old RDN */ main( argc, argv ) int argc; char **argv; { char *usage = "usage: %s [-nvkc] [-d debug-level] [-h ldaphost] [-p ldapport] [-D binddn] [-w passwd] [ -f file | < entryfile | dn newrdn ]\n"; - char *myname,*infile, *p, *entrydn, *rdn, buf[ 4096 ]; + char *myname,*infile, *entrydn, *rdn, buf[ 4096 ]; FILE *fp; int rc, i, kerberos, remove, havedn, authmethod; - LDAPMod **pmods; extern char *optarg; extern int optind; @@ -167,11 +175,11 @@ main( argc, argv ) exit( rc ); } -domodrdn( ld, dn, rdn, remove ) - LDAP *ld; - char *dn; - char *rdn; - int remove; /* flag: remove old RDN */ +static int domodrdn( + LDAP *ld, + char *dn, + char *rdn, + int remove) /* flag: remove old RDN */ { int i; diff --git a/clients/tools/ldapmodrdn.dsp b/clients/tools/ldapmodrdn.dsp new file mode 100644 index 0000000000..013f8b682a --- /dev/null +++ b/clients/tools/ldapmodrdn.dsp @@ -0,0 +1,91 @@ +# Microsoft Developer Studio Project File - Name="ldapmodrdn" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ldapmodrdn - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ldapmodrdn.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ldapmodrdn.mak" CFG="ldapmodrdn - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ldapmodrdn - Win32 Release" (based on\ + "Win32 (x86) Console Application") +!MESSAGE "ldapmodrdn - Win32 Debug" (based on\ + "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ldapmodrdn - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libldap.lib liblber.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\libraries\Release" + +!ELSEIF "$(CFG)" == "ldapmodrdn - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug\ldapmodrdn" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libldap.lib liblber.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug" + +!ENDIF + +# Begin Target + +# Name "ldapmodrdn - Win32 Release" +# Name "ldapmodrdn - Win32 Debug" +# Begin Source File + +SOURCE=.\ldapmodrdn.c +# End Source File +# End Target +# End Project diff --git a/clients/tools/ldapmodrdn.dsw b/clients/tools/ldapmodrdn.dsw new file mode 100644 index 0000000000..8514026638 --- /dev/null +++ b/clients/tools/ldapmodrdn.dsw @@ -0,0 +1,74 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "ldapmodrdn"=.\ldapmodrdn.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name liblber + End Project Dependency + Begin Project Dependency + Project_Dep_Name libldap + End Project Dependency + Begin Project Dependency + Project_Dep_Name liblutil + End Project Dependency +}}} + +############################################################################### + +Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 723d767662..97ad7568b8 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -1,7 +1,12 @@ +#include "portable.h" + #include -#include #include -#include + +#include +#include +#include +#include #include #include @@ -16,7 +21,7 @@ extern int ldap_debug, lber_debug; #endif /* LDAP_DEBUG */ -usage( s ) +static void usage( s ) char *s; { fprintf( stderr, "usage: %s [options] filter [attributes...]\nwhere:\n", s ); @@ -45,7 +50,7 @@ char *s; fprintf( stderr, " -z size lim\tsize limit (in entries) for search\n" ); fprintf( stderr, " -D binddn\tbind dn\n" ); fprintf( stderr, " -w passwd\tbind passwd (for simple authentication)\n" ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS fprintf( stderr, " -k\t\tuse Kerberos instead of Simple Password authentication\n" ); #endif fprintf( stderr, " -h host\tldap server\n" ); @@ -53,6 +58,25 @@ char *s; exit( 1 ); } +static void print_entry LDAP_P(( + LDAP *ld, + LDAPMessage *entry, + int attrsonly)); + +static int write_ldif_value LDAP_P(( + char *type, + char *value, + unsigned long vallen )); + +static int dosearch LDAP_P(( + LDAP *ld, + char *base, + int scope, + char **attrs, + int attrsonly, + char *filtpatt, + char *value)); + static char *binddn = LDAPSEARCH_BINDDN; static char *passwd = LDAPSEARCH_BIND_CRED; static char *base = LDAPSEARCH_BASE; @@ -87,7 +111,7 @@ char **argv; scope = LDAP_SCOPE_SUBTREE; while (( i = getopt( argc, argv, -#ifdef KERBEROS +#ifdef HAVE_KERBEROS "KknuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:" #else "nuvtRABLD:s:f:h:b:d:p:F:a:w:l:z:S:" @@ -107,7 +131,7 @@ char **argv; fprintf( stderr, "compile with -DLDAP_DEBUG for debugging\n" ); #endif /* LDAP_DEBUG */ break; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case 'k': /* use kerberos bind */ kerberos = 2; break; @@ -296,16 +320,16 @@ char **argv; } -dosearch( ld, base, scope, attrs, attrsonly, filtpatt, value ) - LDAP *ld; - char *base; - int scope; - char **attrs; - int attrsonly; - char *filtpatt; - char *value; +static int dosearch( + LDAP *ld, + char *base, + int scope, + char **attrs, + int attrsonly, + char *filtpatt, + char *value) { - char filter[ BUFSIZ ], **val; + char filter[ BUFSIZ ]; int rc, first, matches; LDAPMessage *res, *e; @@ -373,10 +397,10 @@ dosearch( ld, base, scope, attrs, attrsonly, filtpatt, value ) } -print_entry( ld, entry, attrsonly ) - LDAP *ld; - LDAPMessage *entry; - int attrsonly; +void print_entry( + LDAP *ld, + LDAPMessage *entry, + int attrsonly) { char *a, *dn, *ufn, tmpfname[ 64 ]; int i, j, notascii; @@ -438,7 +462,7 @@ print_entry( ld, entry, attrsonly ) } else { notascii = 0; if ( !allow_binary ) { - for ( j = 0; j < bvals[ i ]->bv_len; ++j ) { + for ( j = 0; (unsigned long) j < bvals[ i ]->bv_len; ++j ) { if ( !isascii( bvals[ i ]->bv_val[ j ] )) { notascii = 1; break; diff --git a/clients/tools/ldapsearch.dsp b/clients/tools/ldapsearch.dsp new file mode 100644 index 0000000000..87e9db537a --- /dev/null +++ b/clients/tools/ldapsearch.dsp @@ -0,0 +1,91 @@ +# Microsoft Developer Studio Project File - Name="ldapsearch" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ldapsearch - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ldapsearch.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ldapsearch.mak" CFG="ldapsearch - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ldapsearch - Win32 Release" (based on\ + "Win32 (x86) Console Application") +!MESSAGE "ldapsearch - Win32 Debug" (based on\ + "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ldapsearch - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release\ldapsearch" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libldap.lib liblber.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "ldapsearch - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug\ldapsearch" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W4 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libldap.lib liblber.lib libldif.lib liblutil.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug" + +!ENDIF + +# Begin Target + +# Name "ldapsearch - Win32 Release" +# Name "ldapsearch - Win32 Debug" +# Begin Source File + +SOURCE=.\ldapsearch.c +# End Source File +# End Target +# End Project diff --git a/clients/tools/ldapsearch.dsw b/clients/tools/ldapsearch.dsw new file mode 100644 index 0000000000..7790a0bfcc --- /dev/null +++ b/clients/tools/ldapsearch.dsw @@ -0,0 +1,89 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "ldapsearch"=.\ldapsearch.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name liblber + End Project Dependency + Begin Project Dependency + Project_Dep_Name libldap + End Project Dependency + Begin Project Dependency + Project_Dep_Name libldif + End Project Dependency + Begin Project Dependency + Project_Dep_Name liblutil + End Project Dependency +}}} + +############################################################################### + +Project: "liblber"=..\..\libraries\liblber\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libldap"=..\..\libraries\libldap\libldap.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libldif"=..\..\libraries\libldif\libldif.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "liblutil"=..\..\libraries\liblutil\liblutil.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/clients/ud/Make-template b/clients/ud/Make-template deleted file mode 100644 index 695c5abb8d..0000000000 --- a/clients/ud/Make-template +++ /dev/null @@ -1,78 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# ud makefile -# -# Use -DUOFM for University of Michigan specifics like: -# if ud should know about noBatchUpdates -# Use -DDOS if building for a DOS machine -# Use -DNOTERMCAP if there is no termcap library -# also need to redefine/undefine the Makefile TERMLIB variable -#----------------------------------------------------------------------------- -LDAPSRC = ../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -SRCS= main.c find.c mod.c print.c auth.c util.c help.c\ - string_to_key.c group.c edit.c globals.c -OBJS= main.o find.o mod.o print.o auth.o util.o help.o\ - string_to_key.o group.o globals.o edit.o -HDRS= ud.h - -INCLUDES= -I$(HDIR) $(KRBINCLUDEFLAG) -DEFINES= $(DEFS) -DDEBUG -TERMLIB= -ltermcap - -CFLAGS= ${INCLUDES} ${DEFINES} ${ACFLAGS} -LIBS= ${TERMLIB} -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -PURIFY= -#PURIFY=purify - -all: ud - -ud : version.o - $(PURIFY) ${CC} $(ALDFLAGS) -o $@ version.o ${OBJS} -L${LDIR} ${LIBS} - -version.c: ${OBJS} $(LDIR)/libldap/libldap.a - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -install: ud FORCE - -$(MKDIR) -p $(LDAP_BINDIR) - -mv -f $(LDAP_BINDIR)/ud $(LDAP_BINDIR)/ud- - $(INSTALL) $(INSTALLFLAGS) -m 775 ud $(LDAP_BINDIR) - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) $(OBJS) core ud tags version.o version.c - $(RM) *_pure_*.o ud.pure_hardlink ud.pure_linkinfo - -tags: FORCE - $(CTAGS) $(SRCS) ${HDRS} - -lint: FORCE - $(LINT) -Dlint $(INCLUDES) $(DEFINES) $(SRCS) version.c | \ - egrep -v "string_to_key|but not defined" - -5lint: FORCE - $(5LINT) -Dlint $(INCLUDES) $(DEFINES) $(SRCS) version.c - -links: - @$(LN) .src/README .src/etc.ud.conf .src/*.[ch] . - diff --git a/clients/ud/Makefile.in b/clients/ud/Makefile.in new file mode 100644 index 0000000000..1c72cf0e22 --- /dev/null +++ b/clients/ud/Makefile.in @@ -0,0 +1,28 @@ +SRCS= main.c find.c mod.c print.c auth.c util.c help.c \ + string_to_key.c group.c edit.c globals.c +XSRCS= version.c +OBJS= main.o find.o mod.o print.o auth.o util.o help.o \ + string_to_key.o group.o globals.o edit.o +HDRS= ud.h +PROGRAMS= ud + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +XLIBS = $(TERMCAP_LIBS) + +ud : version.o + $(CC) $(LDFLAGS) -o $@ version.o $(OBJS) $(LIBS) + +version.c: ${OBJS} $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +install: $(PROGRAMS) FORCE + -$(MKDIR) -p $(bindir) + -mv -f $(bindir)/ud $(bindir)/ud- + $(INSTALL) $(INSTALLFLAGS) -m 775 ud $(bindir) diff --git a/clients/ud/auth.c b/clients/ud/auth.c index a947c23729..8f14aa7a2f 100644 --- a/clients/ud/auth.c +++ b/clients/ud/auth.c @@ -10,23 +10,20 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include #include -#include -#include -#include -#ifdef KERBEROS -#include -#ifdef KERBEROS_V -#include -#else -#include -#endif /* KERBEROS_V */ -#endif /* KERBEROS */ + +#include +#include +#include +#include #include #include #include + #include "ud.h" extern LDAP *ld; /* our LDAP descriptor */ @@ -37,12 +34,14 @@ extern char *mygetpass(); /* getpass() passwds are too short */ extern int debug; /* debug flag */ #endif -#ifdef KERBEROS +#ifdef HAVE_KERBEROS static char tktpath[20]; /* ticket file path */ static int kinit(); static int valid_tgt(); #endif +static void set_bound_dn(); + auth(who, implicit) char *who; int implicit; @@ -54,7 +53,7 @@ int implicit; int name_provided; /* was a name passed in? */ struct passwd *pw; /* for getting user id */ char uidname[20]; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS char **krbnames; /* for kerberos names */ int kinited, ikrb; char buf[5]; @@ -71,7 +70,6 @@ int implicit; extern void printbase(); /* used to pretty-print a base */ extern int bind_status; extern void Free(); - static void set_bound_dn(); #ifdef DEBUG if (debug & D_TRACE) @@ -136,7 +134,7 @@ int implicit; rdns = ldap_explode_dn(Entry.DN, TRUE); printf(" Authenticating to the directory as \"%s\"...\n", *rdns ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS /* * First, if the user has a choice of auth methods, ask which * one they want to use. if they want kerberos, ask which @@ -235,7 +233,7 @@ int implicit; (void) ldap_value_free(rdns); return(0); } -#ifdef KERBEROS +#ifdef HAVE_KERBEROS } (void) ldap_value_free(krbnames); #endif @@ -245,13 +243,13 @@ int implicit; if (ld->ld_errno == LDAP_NO_SUCH_ATTRIBUTE) fprintf(stderr, " Entry has no password\n"); else if (ld->ld_errno == LDAP_INVALID_CREDENTIALS) -#ifdef KERBEROS +#ifdef HAVE_KERBEROS if ( authmethod == LDAP_AUTH_KRBV4 ) { fprintf(stderr, " The Kerberos credentials are invalid.\n"); } else { #endif fprintf(stderr, " The password you provided is incorrect.\n"); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS } #endif else @@ -280,12 +278,12 @@ int implicit; return(0); } -#ifdef KERBEROS +#ifdef HAVE_KERBEROS #define FIVEMINS ( 5 * 60 ) #define TGT "krbtgt" -str2upper( s ) +static void str2upper( s ) char *s; { char *p; @@ -313,12 +311,12 @@ static valid_tgt( names ) return( 0 ); } -#ifdef AFSKERBEROS +#ifdef HAVE_AFS_KERBEROS /* * realm must be uppercase for krb_ routines */ str2upper( realm ); -#endif /* AFSKERBEROS */ +#endif /* HAVE_AFS_KERBEROS */ /* * check ticket file for a valid ticket granting ticket @@ -357,7 +355,7 @@ krbgetpass( user, inst, realm, pw, key ) return(-1); } -#ifdef AFSKERBEROS +#ifdef HAVE_AFS_KERBEROS strcpy( lcrealm, realm ); for ( p = lcrealm; *p != '\0'; ++p ) { if ( isupper( *p )) { @@ -366,9 +364,9 @@ krbgetpass( user, inst, realm, pw, key ) } ka_StringToKey( passwd, lcrealm, key ); -#else /* AFSKERBEROS */ +#else /* HAVE_AFS_KERBEROS */ string_to_key( passwd, key ); -#endif /* AFSKERBEROS */ +#endif /* HAVE_AFS_KERBEROS */ return( 0 ); } @@ -388,12 +386,12 @@ static kinit( kname ) return( -1 ); } -#ifdef AFSKERBEROS +#ifdef HAVE_AFS_KERBEROS /* * realm must be uppercase for krb_ routines */ str2upper( realm ); -#endif /* AFSKERBEROS */ +#endif /* HAVE_AFS_KERBEROS */ rc = krb_get_in_tkt( name, inst, realm, TGT, realm, DEFAULT_TKT_LIFE, krbgetpass, NULL, NULL ); @@ -413,7 +411,7 @@ static kinit( kname ) return( 0 ); } -destroy_tickets() +void destroy_tickets(void) { if ( *tktpath != '\0' ) { unlink( tktpath ); @@ -421,8 +419,7 @@ destroy_tickets() } #endif -static void set_bound_dn(s) -char *s; +static void set_bound_dn(char *s) { extern void Free(); extern char *bound_dn; diff --git a/clients/ud/edit.c b/clients/ud/edit.c index eb8969c533..f8a094361a 100644 --- a/clients/ud/edit.c +++ b/clients/ud/edit.c @@ -10,14 +10,18 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include #include -#include -#include -#include + +#include +#include +#include +#include + #include -#include -#include + #include #include #include @@ -29,6 +33,12 @@ extern LDAP *ld; extern LDAPMessage *find(); +static int load_editor(); +static int modifiable(); +static int print_attrs_and_values(); +static int ovalues(); +static int write_entry(); + static char *entry_temp_file; #ifdef DEBUG @@ -42,8 +52,6 @@ char *who; char *dn, **rdns; /* distinguished name */ char name[MED_BUF_SIZE]; /* entry to modify */ extern int bind_status; - static int load_editor(); - static int write_entry(); #ifdef DEBUG if (debug & D_TRACE) @@ -110,7 +118,6 @@ static load_editor() static char template[MED_BUF_SIZE]; extern char * mktemp(); extern int isgroup(), fatal(); - static int print_attrs_and_values(); int pid; int status; int rc; @@ -168,16 +175,16 @@ static load_editor() } if ((pid = fork()) == 0) { /* child - edit the Directory entry */ - (void) signal(SIGINT, SIG_IGN); + (void) SIGNAL(SIGINT, SIG_IGN); (void) execlp(editor, editor, entry_temp_file, NULL); /*NOTREACHED*/ (void) fatal(editor); } else if (pid > 0) { /* parent - wait until the child proc is done editing */ - handler = signal(SIGINT, SIG_IGN); + handler = SIGNAL(SIGINT, SIG_IGN); (void) wait(&status); - (void) signal(SIGINT, handler); + (void) SIGNAL(SIGINT, handler); } else { fatal("fork"); @@ -191,7 +198,6 @@ FILE *fp; struct attribute attrs[]; short flag; { - static int modifiable(); register int i, j; for (i = 0; attrs[i].quipu_name != NULL; i++) { @@ -238,7 +244,6 @@ static write_entry() LDAPMod *mods[MAX_ATTRS + 1]; LDAPMod *modp = NULL; - static int ovalues(); extern char * code_to_str(); extern void free_mod_struct(); diff --git a/clients/ud/find.c b/clients/ud/find.c index 7d4930b5d6..e7ad965c50 100644 --- a/clients/ud/find.c +++ b/clients/ud/find.c @@ -10,13 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#ifndef __STDC__ -#include -#endif + +#include +#include +#include #include #include diff --git a/clients/ud/globals.c b/clients/ud/globals.c index 121f36be21..6c6f74f979 100644 --- a/clients/ud/globals.c +++ b/clients/ud/globals.c @@ -10,6 +10,8 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include #include "ud.h" @@ -42,7 +44,7 @@ struct attribute attrlist[] = { #ifdef UOFM { "multiLineDescription", "Description", change_field, ATTR_FLAG_PERSON | ATTR_FLAG_GROUP | ATTR_FLAG_READ | ATTR_FLAG_PERSON_MOD | ATTR_FLAG_GROUP_MOD | ATTR_FLAG_IS_MULTILINE }, #endif -#ifdef KERBEROS +#ifdef HAVE_KERBEROS { "krbName", "Kerberos name", NULL, ATTR_FLAG_PERSON | ATTR_FLAG_READ }, #endif { "description", "Brief description", NULL, ATTR_FLAG_PERSON | ATTR_FLAG_GROUP | ATTR_FLAG_READ }, diff --git a/clients/ud/group.c b/clients/ud/group.c index 5d6ed6d684..eee8a6b621 100644 --- a/clients/ud/group.c +++ b/clients/ud/group.c @@ -11,9 +11,12 @@ * */ +#include "portable.h" + #include -#include -#include + +#include +#include #include #include @@ -34,6 +37,8 @@ extern LDAP *ld; extern void Free(); +static char * bind_and_fetch(); + void add_group(name) char *name; { @@ -206,7 +211,6 @@ void remove_group(name) char *name; { char *dn, tmp[BUFSIZ]; - static char * bind_and_fetch(); #ifdef DEBUG if (debug & D_TRACE) { @@ -257,7 +261,6 @@ char *name; char *values[2], *group_name; LDAPMod mod, *mods[2]; static char *actions[] = { "join", "resign from", NULL }; - static char * bind_and_fetch(); #ifdef DEBUG if (debug & D_TRACE) { diff --git a/clients/ud/help.c b/clients/ud/help.c index a305679386..5905c74157 100644 --- a/clients/ud/help.c +++ b/clients/ud/help.c @@ -10,10 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include +#include #include #include diff --git a/clients/ud/main.c b/clients/ud/main.c index 5f2b848e65..53465fc602 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -16,35 +16,26 @@ * Simon Fraser University, Academic Computing Services */ +#include "portable.h" + #include -#include -#if defined(NeXT) #include -#include -#else NeXT -#include -#endif NeXT -#include -#include -#ifndef DOS -#if defined( NeXT ) || defined( ultrix ) || defined( osf1 ) || (defined(SunOS) && SunOS < 40) -#include -#else /* defined( NeXT ) || defined( ultrix ) etc. */ -#include -#endif /* defined( NeXT ) || defined( ultrix ) etc. */ -#endif /* !DOS */ -#if defined( aix ) || defined( __NetBSD__ ) \ - || defined( __FreeBSD__ ) || defined( linux ) -#include -#endif /* aix || __NetBSD__ */ -#include -#include #include -#include +#include + +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_FILE_H +#include +#endif + #include #include #include -#include "portable.h" #include "ud.h" #ifndef lint @@ -279,7 +270,7 @@ do_commands() printf(" Thank you!\n"); ldap_unbind(ld); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS destroy_tickets(); #endif exit(0); @@ -541,7 +532,7 @@ initialize_client() char *term; /* for tty set-up */ char *config; /* config file to use */ static char bp[1024]; /* for tty set-up */ - extern SIG_FN attn(); /* ^C signal handler */ + extern RETSIGTYPE attn(); /* ^C signal handler */ extern char *getenv(); extern void Free(); @@ -666,12 +657,12 @@ initialize_client() lpp = DEFAULT_TTY_HEIGHT; col_size = DEFAULT_TTY_WIDTH; - (void) signal(SIGINT, attn); + (void) SIGNAL (SIGINT, attn); -#if !defined(DOS) && !defined(NOTERMCAP) +#ifndef NO_TERMCAP { struct winsize win; /* for tty set-up */ - extern SIG_FN chwinsz(); /* WINSZ signal handler */ + extern RETSIGTYPE chwinsz(); /* WINSZ signal handler */ if (((term = getenv("TERM")) == NULL) || (tgetent(bp, term) <= 0)) return; @@ -691,54 +682,36 @@ initialize_client() col_size = DEFAULT_TTY_WIDTH; } } - (void) signal(SIGWINCH, chwinsz); + (void) SIGNAL (SIGWINCH, chwinsz); } #endif } -SIG_FN attn() +RETSIGTYPE attn() { fflush(stderr); fflush(stdout); printf("\n\n INTERRUPTED!\n"); -#if defined(DOS) || defined(SYSV) - (void) signal(SIGINT, attn); -#endif + + (void) SIGNAL (SIGINT, attn); + longjmp(env, 1); } -#if !defined(DOS) && !defined(NOTERMCAP) -SIG_FN chwinsz() +#ifndef NO_TERMCAP +RETSIGTYPE chwinsz() { struct winsize win; - (void) signal(SIGWINCH, SIG_IGN); + (void) SIGNAL (SIGWINCH, SIG_IGN); if (ioctl(fileno(stdout), TIOCGWINSZ, &win) != -1) { if (win.ws_row != 0) lpp = win.ws_row; if (win.ws_col != 0) col_size = win.ws_col; } - (void) signal(SIGWINCH, chwinsz); -} -#endif - -#if defined(NO_CACHE) - -void ldap_uncache_entry( LDAP *ld, char *dn ) -{ - -} -int ldap_enable_cache( LDAP *ld, long timeout, long maxmem ) -{ - return 0; + (void) SIGNAL (SIGWINCH, chwinsz); } - -void ldap_flush_cache( LDAP *ld ) -{ - -} - -#endif /* NO_CACHE */ +#endif diff --git a/clients/ud/mod.c b/clients/ud/mod.c index 45492d5966..c946bb8045 100644 --- a/clients/ud/mod.c +++ b/clients/ud/mod.c @@ -10,14 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#ifndef __STDC__ -#include -#endif -#include + +#include +#include +#include #include #include @@ -28,6 +27,10 @@ extern int verbose; extern LDAP *ld; extern LDAPMessage *find(); +extern void * Malloc(); + +static char * get_URL(); +static int check_URL(); #ifdef DEBUG extern int debug; @@ -383,9 +386,6 @@ char *id, *prompt; static char line[LINE_SIZE]; /* raw line from user */ static char buffer[MAX_DESC_LINES * LINE_SIZE]; /* holds ALL of the lines we get */ - extern void * Malloc(); - static char * get_URL(); - #ifdef DEBUG if (debug & D_TRACE) printf("->get_value(%s, %s)\n", id, prompt); @@ -755,8 +755,6 @@ int group; static char * get_URL() { char *rvalue, label[MED_BUF_SIZE], url[MED_BUF_SIZE]; - static int check_URL(); - extern void * Malloc(); if (verbose) { printf(" First, enter the URL. (Example: http://www.us.itd.umich.edu/users/).\n"); diff --git a/clients/ud/print.c b/clients/ud/print.c index 4185bdaef3..5ff0f6b2d9 100644 --- a/clients/ud/print.c +++ b/clients/ud/print.c @@ -10,15 +10,17 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#ifndef __STDC__ -#include -#endif -#include + +#include +#include +#include + #include #include + #include "ud.h" #ifdef DEBUG @@ -32,6 +34,9 @@ extern void * Malloc(); extern void Free(); extern char * my_ldap_dn2ufn(); +static char *time2text(); +static long gtime(); + /* * When displaying entries, display only these attributes, and in this * order. @@ -191,7 +196,6 @@ print_an_entry() char is_a_group, **order; char *sub_list[MAX_VALUES], buf[SMALL_BUF_SIZE]; extern int col_size, isaurl(), isadn(); - static char *time2text(); #ifdef DEBUG if (debug & D_TRACE) @@ -555,7 +559,6 @@ time2text( char *ldtimestr, int dateonly ) struct tm t; char *p, *timestr, zone, *fmterr = "badly formatted time"; time_t gmttime; - static long gtime(); memset( (char *)&t, 0, sizeof( struct tm )); if ( strlen( ldtimestr ) < 13 ) { @@ -595,9 +598,7 @@ time2text( char *ldtimestr, int dateonly ) /* gtime.c - inverse gmtime */ -#if !defined( MACOS ) && !defined( _WIN32 ) && !defined( DOS ) -#include -#endif /* !MACOS */ +#include /* gtime(): the inverse of localtime(). This routine was supplied by Mike Accetta at CMU many years ago. diff --git a/clients/ud/string_to_key.c b/clients/ud/string_to_key.c index f1adfa8f0a..d886969e5e 100644 --- a/clients/ud/string_to_key.c +++ b/clients/ud/string_to_key.c @@ -1,4 +1,6 @@ -#if defined(KERBEROS) && !defined(openbsd) +#include "portable.h" + +#if defined(HAVE_KERBEROS) && !defined(openbsd) /* * $Source: /repo/OpenLDAP/pkg/ldap/clients/ud/string_to_key.c,v $ * $Author: kurt $ @@ -24,35 +26,19 @@ * spm 8/85 MIT project athena */ -#ifdef KERBEROS_V -#include -#include -#else -#include -#include -#endif /* KERBEROS_V */ - #include - -/* #include "des_internal.h" */ -#if 1 -#ifdef KERBEROS_V -#include -#else -#include -#endif /* KERBEROS_V */ -#endif /* 1 */ +#include extern int des_debug; extern int des_debug_print(); extern void des_fixup_key_parity(); -#ifndef AFSKERBEROS +#ifndef HAVE_AFS_KERBEROS #define WORLDPEACEINOURTIME #endif #if defined(WORLDPEACEINOURTIME) /* Use original, not ifs version */ -#ifndef KERBEROS_V +#ifndef HAVE_KERBEROS_V /* * convert an arbitrary length string to a DES key */ @@ -139,7 +125,7 @@ des_string_to_key(str,key) *((unsigned long *) key+1)); } -#endif /* KERBEROS_V */ +#endif /* HAVE_KERBEROS_V */ #else /* Use ifs version */ #if 0 diff --git a/clients/ud/ud.h b/clients/ud/ud.h index 40b6ecff7a..9a54cafae3 100644 --- a/clients/ud/ud.h +++ b/clients/ud/ud.h @@ -10,14 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #ifdef DOS -#include "protoud.h" -#define strncasecmp(a, b, n) strnicmp(a, b, n) -#define strcasecmp(a, b) stricmp(a, b) #define MAX_VALUES 8 #else #define MAX_VALUES 1000 -#endif /* end of DOS ifdef */ +#endif /* !DOS */ /***************************************************************************** ** @@ -87,7 +86,7 @@ /* * Authentication method we will be using. */ -#ifdef KERBEROS +#ifdef HAVE_KERBEROS #define UD_AUTH_METHOD LDAP_AUTH_KRBV4 #else #define UD_AUTH_METHOD LDAP_AUTH_SIMPLE @@ -136,6 +135,8 @@ #define ATTR_FLAG_IS_A_BOOL 0x4000 #define ATTR_FLAG_IS_MULTILINE 0x8000 +LDAP_BEGIN_DECL + /* * These are the structures we use when parsing an answer we get from the LDAP * server. @@ -156,3 +157,5 @@ struct entry { char *name; struct attribute attrs[MAX_ATTRS]; }; + +LDAP_END_DECL diff --git a/clients/ud/util.c b/clients/ud/util.c index 0dd3c53c35..ea0bbd1256 100644 --- a/clients/ud/util.c +++ b/clients/ud/util.c @@ -10,41 +10,25 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#ifdef DOS -#include -#endif -#include -#if defined( NeXT ) #include -#endif -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include #include #include - #include -#if !defined(DOS) && !defined( VMS) -#include -#endif -#include "portable.h" -#ifdef USE_TERMIOS -#include -#else /* USE_TERMIOS */ -#include -#endif /* USE_TERMIOS */ - #include "ud.h" -#if defined(VMS) -#define getch getchar -#endif - #ifdef DEBUG extern int debug; #endif @@ -77,7 +61,7 @@ char *prompt; register char *p; register int c; FILE *fi; - SIG_FN (*sig)(); + RETSIGTYPE (*sig)(); #ifdef DEBUG if (debug & D_TRACE) @@ -96,7 +80,7 @@ char *prompt; fi = stdin; else setbuf(fi, (char *)NULL); - sig = signal(SIGINT, SIG_IGN); + sig = SIGNAL (SIGINT, SIG_IGN); if (fi != stdin) { if (GETATTR(fileno(fi), &ttyb) < 0) perror("GETATTR"); @@ -150,7 +134,7 @@ char *prompt; if (SETATTR(fileno(fi), &ttyb) < 0) perror("SETATTR"); } - (void) signal(SIGINT, sig); + (void) SIGNAL (SIGINT, sig); if (fi != stdin) (void) fclose(fi); else @@ -233,7 +217,7 @@ char *s; { if (errno != 0) perror(s); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS destroy_tickets(); #endif exit(-1); @@ -597,13 +581,15 @@ unsigned int size; void Free(ptr) char *ptr; { - extern int free(); - +#ifndef STDC_HEADERS if (free(ptr) < 0) { perror("free"); exit(-1); /*NOTREACHED*/ } +#else + free(ptr); +#endif return; } diff --git a/configure b/configure new file mode 100755 index 0000000000..8c6062121e --- /dev/null +++ b/configure @@ -0,0 +1,6655 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.12 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_default_prefix=/usr/local +ac_help="$ac_help + --enable-debug enable debugging (yes)" +ac_help="$ac_help + --enable-libui enable library user interface (yes)" +ac_help="$ac_help + --enable-cache enable caching (yes)" +ac_help="$ac_help + --enable-dns enable dns support (no)" +ac_help="$ac_help + --enable-referrals enable referrals (yes)" +ac_help="$ac_help + --enable-cldap enable connectionless ldap (no)" +ac_help="$ac_help + --with-kerberos use Kerberos (auto)" +ac_help="$ac_help + --with-threads use threads (auto)" +ac_help="$ac_help + --with-preemptive thread implementation is preemptive (auto)" +ac_help="$ac_help + --enable-ldapd enable building ldapd (no)" +ac_help="$ac_help + --enable-slapd enable building slapd (yes)" +ac_help="$ac_help + --enable-aclgroup enable ACL group support (auto)" +ac_help="$ac_help + --enable-crypt enable crypt(3) passwords (auto)" +ac_help="$ac_help + --enable-md5 enable MD5 passwords (auto)" +ac_help="$ac_help + --enable-sha1 enable SHA1 passwords (auto)" +ac_help="$ac_help + --enable-wrappers enable tcp wrapper support (no)" +ac_help="$ac_help + --enable-phonetic enable phonetic/soundex (no)" +ac_help="$ac_help + --enable-rlookups enable reverse lookups (auto)" +ac_help="$ac_help + --enable-ldbm enable ldbm backend (yes)" +ac_help="$ac_help + --with-ldbm-api use LDBM API (auto)" +ac_help="$ac_help + --with-ldbm-type use LDBM type (auto)" +ac_help="$ac_help + --enable-passwd enable passwd backend (no)" +ac_help="$ac_help + --enable-shell enable shell backend (no)" +ac_help="$ac_help + --enable-slurpd enable building slurpd (auto)" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.12" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=include/ldap.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +ac_aux_dir= +for ac_dir in build $srcdir/build; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +echo $ac_n "checking configure arguments""... $ac_c" 1>&6 +echo "configure:591: checking configure arguments" >&5 + + +# OpenLDAP --enable-debug + # Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; } + fi + ol_enable_debug="$ol_arg" + +else + ol_enable_debug="yes" +fi +# end --enable-debug +# OpenLDAP --enable-libui + # Check whether --enable-libui or --disable-libui was given. +if test "${enable_libui+set}" = set; then + enableval="$enable_libui" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-libui" 1>&2; exit 1; } + fi + ol_enable_libui="$ol_arg" + +else + ol_enable_libui="yes" +fi +# end --enable-libui +# OpenLDAP --enable-cache + # Check whether --enable-cache or --disable-cache was given. +if test "${enable_cache+set}" = set; then + enableval="$enable_cache" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; } + fi + ol_enable_cache="$ol_arg" + +else + ol_enable_cache="yes" +fi +# end --enable-cache +# OpenLDAP --enable-dns + # Check whether --enable-dns or --disable-dns was given. +if test "${enable_dns+set}" = set; then + enableval="$enable_dns" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; } + fi + ol_enable_dns="$ol_arg" + +else + ol_enable_dns="no" +fi +# end --enable-dns +# OpenLDAP --enable-referrals + # Check whether --enable-referrals or --disable-referrals was given. +if test "${enable_referrals+set}" = set; then + enableval="$enable_referrals" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; } + fi + ol_enable_referrals="$ol_arg" + +else + ol_enable_referrals="yes" +fi +# end --enable-referrals +# OpenLDAP --enable-cldap + # Check whether --enable-cldap or --disable-cldap was given. +if test "${enable_cldap+set}" = set; then + enableval="$enable_cldap" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; } + fi + ol_enable_cldap="$ol_arg" + +else + ol_enable_cldap="no" +fi +# end --enable-cldap + +# OpenLDAP --with-kerberos + # Check whether --with-kerberos or --without-kerberos was given. +if test "${with_kerberos+set}" = set; then + withval="$with_kerberos" + + ol_arg=invalid + for ol_val in auto k5 k4 afs yes no ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; } + fi + ol_with_kerberos="$ol_arg" + +else + ol_with_kerberos="auto" +fi +# end --with-kerberos + +# OpenLDAP --with-threads + # Check whether --with-threads or --without-threads was given. +if test "${with_threads+set}" = set; then + withval="$with_threads" + + ol_arg=invalid + for ol_val in auto posix mach lwp yes no manual ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; } + fi + ol_with_threads="$ol_arg" + +else + ol_with_threads="auto" +fi +# end --with-threads + +# OpenLDAP --with-preemptive + # Check whether --with-preemptive or --without-preemptive was given. +if test "${with_preemptive+set}" = set; then + withval="$with_preemptive" + + ol_arg=invalid + for ol_val in auto yes no manual ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-preemptive" 1>&2; exit 1; } + fi + ol_with_preemptive="$ol_arg" + +else + ol_with_preemptive="auto" +fi +# end --with-preemptive + + + +# OpenLDAP --enable-ldapd + # Check whether --enable-ldapd or --disable-ldapd was given. +if test "${enable_ldapd+set}" = set; then + enableval="$enable_ldapd" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; } + fi + ol_enable_ldapd="$ol_arg" + +else + ol_enable_ldapd="no" +fi +# end --enable-ldapd + +# OpenLDAP --enable-slapd + # Check whether --enable-slapd or --disable-slapd was given. +if test "${enable_slapd+set}" = set; then + enableval="$enable_slapd" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; } + fi + ol_enable_slapd="$ol_arg" + +else + ol_enable_slapd="yes" +fi +# end --enable-slapd +# OpenLDAP --enable-aclgroup + # Check whether --enable-aclgroup or --disable-aclgroup was given. +if test "${enable_aclgroup+set}" = set; then + enableval="$enable_aclgroup" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-aclgroup" 1>&2; exit 1; } + fi + ol_enable_aclgroup="$ol_arg" + +else + ol_enable_aclgroup="auto" +fi +# end --enable-aclgroup +# OpenLDAP --enable-crypt + # Check whether --enable-crypt or --disable-crypt was given. +if test "${enable_crypt+set}" = set; then + enableval="$enable_crypt" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; } + fi + ol_enable_crypt="$ol_arg" + +else + ol_enable_crypt="auto" +fi +# end --enable-crypt +# OpenLDAP --enable-md5 + # Check whether --enable-md5 or --disable-md5 was given. +if test "${enable_md5+set}" = set; then + enableval="$enable_md5" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-md5" 1>&2; exit 1; } + fi + ol_enable_md5="$ol_arg" + +else + ol_enable_md5="auto" +fi +# end --enable-md5 +# OpenLDAP --enable-sha1 + # Check whether --enable-sha1 or --disable-sha1 was given. +if test "${enable_sha1+set}" = set; then + enableval="$enable_sha1" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-sha1" 1>&2; exit 1; } + fi + ol_enable_sha1="$ol_arg" + +else + ol_enable_sha1="auto" +fi +# end --enable-sha1 +# OpenLDAP --enable-wrappers + # Check whether --enable-wrappers or --disable-wrappers was given. +if test "${enable_wrappers+set}" = set; then + enableval="$enable_wrappers" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; } + fi + ol_enable_wrappers="$ol_arg" + +else + ol_enable_wrappers="no" +fi +# end --enable-wrappers +# OpenLDAP --enable-phonetic + # Check whether --enable-phonetic or --disable-phonetic was given. +if test "${enable_phonetic+set}" = set; then + enableval="$enable_phonetic" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; } + fi + ol_enable_phonetic="$ol_arg" + +else + ol_enable_phonetic="no" +fi +# end --enable-phonetic +# OpenLDAP --enable-rlookups + # Check whether --enable-rlookups or --disable-rlookups was given. +if test "${enable_rlookups+set}" = set; then + enableval="$enable_rlookups" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; } + fi + ol_enable_rlookups="$ol_arg" + +else + ol_enable_rlookups="auto" +fi +# end --enable-rlookups + +# OpenLDAP --enable-ldbm + # Check whether --enable-ldbm or --disable-ldbm was given. +if test "${enable_ldbm+set}" = set; then + enableval="$enable_ldbm" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; } + fi + ol_enable_ldbm="$ol_arg" + +else + ol_enable_ldbm="yes" +fi +# end --enable-ldbm +# OpenLDAP --with-ldbm_api + # Check whether --with-ldbm_api or --without-ldbm_api was given. +if test "${with_ldbm_api+set}" = set; then + withval="$with_ldbm_api" + + ol_arg=invalid + for ol_val in auto db2 db gdbm ndbm manual ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; } + fi + ol_with_ldbm_api="$ol_arg" + +else + ol_with_ldbm_api="auto" +fi +# end --with-ldbm_api + +# OpenLDAP --with-ldbm_type + # Check whether --with-ldbm_type or --without-ldbm_type was given. +if test "${with_ldbm_type+set}" = set; then + withval="$with_ldbm_type" + + ol_arg=invalid + for ol_val in auto btree hash ; do + if test "$withval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; } + fi + ol_with_ldbm_type="$ol_arg" + +else + ol_with_ldbm_type="auto" +fi +# end --with-ldbm_type + + +# OpenLDAP --enable-passwd + # Check whether --enable-passwd or --disable-passwd was given. +if test "${enable_passwd+set}" = set; then + enableval="$enable_passwd" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; } + fi + ol_enable_passwd="$ol_arg" + +else + ol_enable_passwd="no" +fi +# end --enable-passwd +# OpenLDAP --enable-shell + # Check whether --enable-shell or --disable-shell was given. +if test "${enable_shell+set}" = set; then + enableval="$enable_shell" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; } + fi + ol_enable_shell="$ol_arg" + +else + ol_enable_shell="no" +fi +# end --enable-shell + +# OpenLDAP --enable-slurpd + # Check whether --enable-slurpd or --disable-slurpd was given. +if test "${enable_slurpd+set}" = set; then + enableval="$enable_slurpd" + + ol_arg=invalid + for ol_val in auto yes no ; do + if test "$enableval" = "$ol_val" ; then + ol_arg="$ol_val" + fi + done + if test "$ol_arg" = "invalid" ; then + { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; } + fi + ol_enable_slurpd="$ol_arg" + +else + ol_enable_slurpd="auto" +fi +# end --enable-slurpd + +if test $ol_enable_slapd = no ; then + if test $ol_enable_ldbm = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2; + fi + if test $ol_enable_passwd = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2; + fi + if test $ol_enable_shell = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2; + fi + if test $ol_enable_aclgroup = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_aclgroup argument" 1>&2; + fi + if test $ol_enable_crypt = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_crypt argument" 1>&2; + fi + if test $ol_enable_md5 = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_md5 argument" 1>&2; + fi + if test $ol_enable_sha1 = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_sha1 argument" 1>&2; + fi + if test $ol_enable_wrappers = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2; + fi + if test $ol_enable_phonetic = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2; + fi + if test $ol_enable_rlookups = yes ; then + echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2; + fi + if test $ol_with_ldbm_api != auto ; then + echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2; + fi + if test $ol_with_ldbm_type != auto ; then + echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2; + fi + if test $ol_enable_slurpd = yes ; then + { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }; + fi + + # force settings to no + ol_enable_ldbm=no + ol_enable_shell=no + ol_enable_passwd=no + ol_enable_aclgroup=no + ol_enable_crypt=no + ol_enable_md5=no + ol_enable_sha1=no + ol_enable_wrappers=no + ol_enable_phonetic=no + ol_enable_rlookups=no + ol_with_ldbm_api=no + ol_with_ldbm_type=no + ol_enable_slurpd=no + +elif test $ol_enable_ldbm = no ; then + + if test $ol_with_ldbm_api != auto ; then + echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2; + fi + + if test $ol_with_ldbm_type != auto ; then + echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2; + fi + + if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then + { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }; + fi + + ol_with_ldbm_api=no + ol_with_ldbm_type=no + +else + + if test $ol_with_ldbm_api = gdbm -a \ + $ol_with_ldbm_type = btree ; then + { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }; + fi + if test $ol_with_ldbm_api = ndbm -a \ + $ol_with_ldbm_type = btree ; then + { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }; + fi +fi + +if test $ol_enable_slurpd = yes ; then + if test $ol_with_threads = no ; then + { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }; + fi +fi + +echo "$ac_t""done" 1>&6 + +## Initialize vars +LDAP_LIBS= +LDBM_LIBS= +LTHREAD_LIBS= +LUTIL_LIBS= + +LDAPD_LIBS= +SLAPD_LIBS= +SLURPD_LIBS= + +BUILD_LDAPD=no +BUILD_SLAPD=no +BUILD_SLURPD=no + +BUILD_LDBM=no +BUILD_PASSWD=no +BUILD_SHELL=no + +KRB_LIBS= +TERMCAP_LIBS= + + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:1203: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1234: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1286: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:1313: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +# Extract the first word of "sendmail", so it can be a program name with args. +set dummy sendmail; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1343: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$SENDMAIL" in + /*) + ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc$ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_SENDMAIL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail" + ;; +esac +fi +SENDMAIL="$ac_cv_path_SENDMAIL" +if test -n "$SENDMAIL"; then + echo "$ac_t""$SENDMAIL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "vi", so it can be a program name with args. +set dummy vi; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1375: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$EDITOR" in + /*) + ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH:/usr/ucb$ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_EDITOR="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi" + ;; +esac +fi +EDITOR="$ac_cv_path_EDITOR" +if test -n "$EDITOR"; then + echo "$ac_t""$EDITOR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Extract the first word of "finger", so it can be a program name with args. +set dummy finger; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1407: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$FINGER" in + /*) + ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH:/usr/ucb$ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_FINGER="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger" + ;; +esac +fi +FINGER="$ac_cv_path_FINGER" +if test -n "$FINGER"; then + echo "$ac_t""$FINGER" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1440: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1469: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + ac_prog_rejected=no + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1517: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1551: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1556: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1580: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1608: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 +echo "configure:1670: checking whether ${CC-cc} needs -traditional" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_pattern="Autoconf.*'x'" + cat > conftest.$ac_ext < +Autoconf TIOCGETP +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_prog_gcc_traditional=yes +else + rm -rf conftest* + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat > conftest.$ac_ext < +Autoconf TCGETA +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi + +echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + +echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:1717: checking for AIX" >&5 +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF +#define _ALL_SOURCE 1 +EOF + +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:1741: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:1763: checking for minix/config.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + MINIX=yes +else + echo "$ac_t""no" 1>&6 +MINIX= +fi + +if test "$MINIX" = yes; then + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_1_SOURCE 2 +EOF + + cat >> confdefs.h <<\EOF +#define _MINIX 1 +EOF + +fi + + + + +echo $ac_n "checking for socket""... $ac_c" 1>&6 +echo "configure:1814: checking for socket" >&5 +if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char socket(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_socket) || defined (__stub___socket) +choke me +#else +socket(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_socket=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_socket=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 +echo "configure:1861: checking for main in -lsocket" >&5 +ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6 +echo "configure:1904: checking for main in -lnet" >&5 +ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6 +echo "configure:1947: checking for main in -lnsl_s" >&5 +ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl_s $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 +echo "configure:1990: checking for main in -lnsl" >&5 +ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6 +echo "configure:2033: checking for socket in -linet" >&5 +ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-linet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6 +echo "configure:2080: checking for main in -lgen" >&5 +ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgen $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + +fi + + +echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6 +echo "configure:2127: checking for sigset in -lV3" >&5 +ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lV3 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + +if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then + for ac_hdr in kerberosIV/krb.h kerberosIV/des.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2179: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_kerberosIV_krb_h = yes ; then + echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6 +echo "configure:2218: checking for main in -lkrb4" >&5 +ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_k5=yes +else + echo "$ac_t""no" 1>&6 +have_k5=no +fi + + + if test $have_k5 = yes ; then + ol_with_kerberos=found + ol_link_kerberos=yes + + cat >> confdefs.h <<\EOF +#define HAVE_KERBEROS 1 +EOF + + + KRB_LIBS="-lkrb4 -lkrb5 -ldes425" + fi + fi +fi +if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then + for ac_hdr in krb.h des.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2273: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_krb_h = yes ; then + echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6 +echo "configure:2312: checking for main in -lkrb" >&5 +ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lkrb -ldes $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_k4=yes +else + echo "$ac_t""no" 1>&6 +have_k4=no +fi + + + if test $have_k4 = yes ; then + ol_with_kerberos=found + ol_link_kerberos=yes + + cat >> confdefs.h <<\EOF +#define HAVE_KERBEROS 1 +EOF + + + KRB_LIBS="-lkrb -ldes" + fi + fi +fi + + +ol_link_threads=no +if test $ol_with_threads = auto -o $ol_with_threads = posix ; then + for ac_hdr in pthread.h sched.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2370: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_header_pthread_h = yes ; then + echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6 +echo "configure:2409: checking POSIX thread version" >&5 +if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < + /* this check could be improved */ +# ifdef PTHREAD_ONCE_INIT + final +# endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "final" >/dev/null 2>&1; then + rm -rf conftest* + ol_pthread_final=yes +else + rm -rf conftest* + ol_pthread_final=no +fi +rm -f conftest* + + + cat > conftest.$ac_ext < + /* this check could be improved */ +# ifdef pthread_once_init + draft4 +# endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "draft4" >/dev/null 2>&1; then + rm -rf conftest* + ol_pthread_draft4=yes +else + rm -rf conftest* + ol_pthread_draft4=no +fi +rm -f conftest* + + + if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then + ol_cv_pthread_version=final + elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then + ol_cv_pthread_version=draft4 + else + ol_cv_pthread_version=unknown + fi + +fi + +echo "$ac_t""$ol_cv_pthread_version" 1>&6 + + + if test $ol_cv_pthread_version = final ; then + elif test $ol_cv_pthread_version = draft4 ; then + cat >> confdefs.h <<\EOF +#define HAVE_PTHREADS_D4 1 +EOF + + else + { echo "configure: error: unknown pthread version" 1>&2; exit 1; } + fi + + # consider threads found + ol_with_threads=found + + +echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6 +echo "configure:2486: checking for LinuxThreads" >&5 +if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` + if test "$res" -gt 0 ; then + ol_cv_linux_threads=yes + else + ol_cv_linux_threads=no + fi + +fi + +echo "$ac_t""$ol_cv_linux_threads" 1>&6 + + + if test $ol_cv_linux_threads = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_LINUX_THREADS 1 +EOF + + fi + + + echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 +echo "configure:2512: checking for pthread_create" >&5 +if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_create(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_create) || defined (__stub___pthread_create) +choke me +#else +pthread_create(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_pthread_create=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_pthread_create=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_link_threads=yes +else + echo "$ac_t""no" 1>&6 +fi + + + if test $ol_link_threads = no ; then + echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6 +echo "configure:2562: checking for pthread_create with -pthread" >&5 +if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + save_LIBS="$LIBS" + LIBS="-pthread $LIBS" + cat > conftest.$ac_ext < +int main() { + + pthread_create((pthread_t*) 0, + (pthread_attr_t*) 0, 0, 0); + +; return 0; } +EOF +if { (eval echo configure:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + ol_cv_pthread_flag=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_pthread_flag=no +fi +rm -f conftest* + LIBS="$save_LIBS" + +fi + +echo "$ac_t""$ol_cv_pthread_flag" 1>&6 + + if test $ol_cv_pthread_flag = yes ; then + LTHREAD_LIBS="$LTHREAD_LIBS -pthread" + ol_link_threads=posix + fi + fi + + if test $ol_link_threads = no ; then + save_LIBS="$LIBS" + echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 +echo "configure:2605: checking for pthread_create in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + ol_link_threads=posix + LTHREAD_LIBS="$LTHREAD_LIBS -lpthread" +else + echo "$ac_t""no" 1>&6 +fi + + LIBS="$save_LIBS" + fi + + if test $ol_link_threads = no ; then + save_LIBS="$LIBS" + echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 +echo "configure:2652: checking for pthread_create in -lc_r" >&5 +ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lc_r $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + ol_link_threads=posix + LTHREAD_LIBS="$LTHREAD_LIBS -lc_r" +else + echo "$ac_t""no" 1>&6 +fi + + LIBS="$save_LIBS" + fi + + if test $ol_link_threads = no ; then + save_LIBS="$LIBS" + echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 +echo "configure:2699: checking for pthread_create in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread if test $ol_with_preemptive = auto ; then + ol_with_preemptive=yes + fi + -lmach -lexc -lc $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + cat >> confdefs.h <<\EOF +#define HAVE_DCE 1 +EOF + + ol_link_threads=posix + LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc" +else + echo "$ac_t""no" 1>&6 +fi + + LIBS="$save_LIBS" + fi + + if test $ol_link_threads != no ; then + cat >> confdefs.h <<\EOF +#define HAVE_PTHREADS 1 +EOF + + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + LIBS="$LTHREAD_LIBS $LIBS" + + for ac_func in sched_yield pthread_yield +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2763: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test $ac_cv_func_sched_yield = no -a \ + $ac_cv_func_pthread_yield = no ; then + + echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2 + { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; } + fi + + for ac_func in pthread_kill +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2826: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test $ol_with_preemptive = auto ; then + echo $ac_n "checking for preemptive Pthread implementation""... $ac_c" 1>&6 +echo "configure:2881: checking for preemptive Pthread implementation" >&5 + if test "$cross_compiling" = yes; then + + { echo "configure: error: crossing compiling: use --with-preemptive=yes|no|manual" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +#include +#include +#include +#ifndef NULL +#define NULL 0 +#endif + +int task(arg) + int *arg; +{ + struct timeval tv; + + tv.tv_sec=4; + tv.tv_usec=0; + select(0, NULL, NULL, NULL, &tv); + + tv.tv_sec=6; + tv.tv_usec=0; + select(0, NULL, NULL, NULL, &tv); + + exit(1); /* if we exit here, the select blocked the whole process */ +} + +main(argc, argv) +int argc; char **argv; +{ + pthread_t t; + pthread_create(&t, NULL, (void *) task, NULL); + +#if HAVE_SCHED_YIELD + sched_yield(); /* make sure task runs first */ +#else +#if defined(HAVE_PTHREAD_YIELD) + pthread_yield(); /* make sure task runs first */ +#endif +#endif + exit(0); +} + +EOF +if { (eval echo configure:2931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ol_pthread_preemptive=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_pthread_preemptive=no +fi +rm -fr conftest* +fi + + echo "$ac_t""$ol_pthread_preemptive" 1>&6 + + if test $ol_pthread_preemptive = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_PREEMPTIVE_PTHREADS 1 +EOF + + ol_with_preemptive=yes + fi + fi + + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + else + { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; } + fi + fi + + if test $ol_with_threads = posix ; then + { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; } + fi +fi + +if test $ol_with_threads = auto -o $ol_with_threads = cthreads ; then + for ac_hdr in mach/cthreads.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2971: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + if test $ac_cv_header_lwp_lwp_h = yes ; then + echo $ac_n "checking for cthread_fork in -llwp""... $ac_c" 1>&6 +echo "configure:3009: checking for cthread_fork in -llwp" >&5 +ac_lib_var=`echo lwp'_'cthread_fork | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-llwp $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_cthreads=yes +else + echo "$ac_t""no" 1>&6 +have_cthreads=no +fi + + + if test $have_cthreads = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_MACH_CTHREADS 1 +EOF + + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + fi + fi +fi + +if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then + for ac_hdr in thread.h synch.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3065: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + if test $ac_cv_header_lwp_lwp_h = yes ; then + echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6 +echo "configure:3103: checking for thr_create in -lthread" >&5 +ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lthread $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_lwp=yes +else + echo "$ac_t""no" 1>&6 +have_lwp=no +fi + + + if test $have_lwp = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_THR 1 +EOF + + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + + if test $ol_with_preemptive = auto ; then + ol_with_preemptive=yes + fi + fi + fi + + for ac_hdr in lwp/lwp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3161: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then + echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6 +echo "configure:3199: checking for lwp_create in -llwp" >&5 +ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-llwp $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_lwp=yes +else + echo "$ac_t""no" 1>&6 +have_lwp=no +fi + + + if test $have_lwp = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_LWP 1 +EOF + + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + + if test $ol_with_preemptive = auto ; then + ol_with_preemptive=no + fi + fi + fi +fi + +if test $ol_with_preemptive = yes ; then + cat >> confdefs.h <<\EOF +#define PREEMPTIVE_THREADS 1 +EOF + +fi + +if test $ol_with_threads = manual ; then + $ol_link_threads=yes + + echo "configure: warning: thread defines and link options must be set manually" 1>&2 + + for ac_hdr in pthread.h sched.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3270: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + for ac_func in sched_yield pthread_yield +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3309: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6 +echo "configure:3363: checking for LinuxThreads" >&5 +if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` + if test "$res" -gt 0 ; then + ol_cv_linux_threads=yes + else + ol_cv_linux_threads=no + fi + +fi + +echo "$ac_t""$ol_cv_linux_threads" 1>&6 + + + for ac_hdr in mach/cthreads.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3384: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + for ac_hdr in lwp/lwp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3424: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + for ac_hdr in thread.h synch.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3464: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +fi + +if test $ol_link_threads = no ; then + if test $ol_with_threads = yes ; then + { echo "configure: error: no suitable thread support" 1>&2; exit 1; } + fi + + if test $ol_with_threads = auto ; then + echo "configure: warning: no suitable thread support, disabling threads" 1>&2 + $ol_with_threads = no + fi + + cat >> confdefs.h <<\EOF +#define NO_THREADS 1 +EOF + + cat >> confdefs.h <<\EOF +#define PREEMPTIVE_THREADS 1 +EOF + + LTHREAD_LIBS="" +fi + +ol_link_ldbm=no +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then + echo $ac_n "checking for DB2 library""... $ac_c" 1>&6 +echo "configure:3526: checking for DB2 library" >&5 +if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_LIBS="$LIBS" + echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6 +echo "configure:3532: checking for db_open in -ldb" >&5 +ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldb $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_db2=-ldb +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_db2=no +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_db2" 1>&6 + +for ac_hdr in db.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3582: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +if test $ac_cv_header_db_h = yes ; then + echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6 +echo "configure:3620: checking if db.h is DB2" >&5 +if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < + /* this check could be improved */ +# ifdef DB_VERSION_MAJOR +# if DB_VERSION_MAJOR == 2 + __db_version_2 +# endif +# endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "__db_version_2" >/dev/null 2>&1; then + rm -rf conftest* + ol_cv_header_db2=yes +else + rm -rf conftest* + ol_cv_header_db2=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ol_cv_header_db2" 1>&6 +else + ol_cv_header_db2=no +fi + + + + echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6 +echo "configure:3658: checking for Berkeley DB2" >&5 +if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test $ol_cv_lib_db2 = no -o $ol_cv_header_db2 = no ; then + ol_cv_berkeley_db2=no + else + ol_cv_berkeley_db2=yes + fi + +fi + +echo "$ac_t""$ol_cv_berkeley_db2" 1>&6 + if test $ol_cv_berkeley_db2 = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_BERKELEY_DB2 1 +EOF + + fi + + + if test $ol_cv_berkeley_db2 = yes ; then + ol_link_ldbm=db2 + ol_with_ldbm_api=db2 + + if test $ol_with_ldbm_type = hash ; then + cat >> confdefs.h <<\EOF +#define LDBM_USE_DBHASH 1 +EOF + + else + cat >> confdefs.h <<\EOF +#define LDBM_USE_DBBTREE 1 +EOF + + fi + + if test $ol_cv_lib_db2 != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2" + fi + fi +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then + echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6 +echo "configure:3704: checking for Berkeley DB library" >&5 +if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_LIBS="$LIBS" + echo $ac_n "checking for dbopen""... $ac_c" 1>&6 +echo "configure:3710: checking for dbopen" >&5 +if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dbopen(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dbopen) || defined (__stub___dbopen) +choke me +#else +dbopen(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_dbopen=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_dbopen=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_db=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6 +echo "configure:3757: checking for dbopen in -ldb" >&5 +ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldb $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_db=-ldb +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_db=no +fi + + +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_db" 1>&6 + + +for ac_hdr in db_185.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3811: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +if test $ol_cv_header_db2 = yes ; then + + ol_cv_header_db=$ac_cv_header_db_185_h +else + ol_cv_header_db=$ac_cv_header_db_h +fi + + + + echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6 +echo "configure:3857: checking for Berkeley DB" >&5 +if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test $ol_cv_lib_db = no -o $ol_cv_header_db = no ; then + ol_cv_berkeley_db=no + else + ol_cv_berkeley_db=yes + fi + +fi + +echo "$ac_t""$ol_cv_berkeley_db" 1>&6 + if test $ol_cv_berkeley_db = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_BERKELEY_DB 1 +EOF + + fi + + + if test $ol_cv_berkeley_db = yes ; then + ol_link_ldbm=db + ol_with_ldbm_api=db + + if test $ol_with_ldbm_type = hash ; then + cat >> confdefs.h <<\EOF +#define LDBM_USE_DBHASH 1 +EOF + + else + cat >> confdefs.h <<\EOF +#define LDBM_USE_DBBTREE 1 +EOF + + fi + + if test $ol_cv_lib_db != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db" + fi + fi +fi + +if test $ol_with_ldbm_api = manual ; then + $ol_link_ldbm=yes + + echo "configure: warning: LDBM defines and link options must be set manually" 1>&2 + + for ac_hdr in db.h db_185.h gdbm.h ndbm.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3910: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +fi + +if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then + echo "configure: warning: Could not find LDBM with BTREE support" 1>&2; + $ol_with_ldbm_api=none +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then + echo $ac_n "checking for GDBM library""... $ac_c" 1>&6 +echo "configure:3955: checking for GDBM library" >&5 +if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_LIBS="$LIBS" + echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6 +echo "configure:3961: checking for gdbm_open" >&5 +if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gdbm_open(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gdbm_open) || defined (__stub___gdbm_open) +choke me +#else +gdbm_open(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_gdbm_open=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_gdbm_open=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_gdbm=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6 +echo "configure:4008: checking for gdbm_open in -lgdbm" >&5 +ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lgdbm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_gdbm=-lgdbm +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_gdbm=no +fi + + +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_gdbm" 1>&6 + + + for ac_hdr in gdbm.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:4062: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking for db""... $ac_c" 1>&6 +echo "configure:4099: checking for db" >&5 +if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then + ol_cv_gdbm=no + else + ol_cv_gdbm=yes + fi + +fi + +echo "$ac_t""$ol_cv_gdbm" 1>&6 + if test $ol_cv_gdbm = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_GDBM 1 +EOF + + fi + + + if test $ol_cv_gdbm = yes ; then + ol_link_ldbm=gdbm + ol_with_ldbm_api=gdbm + + if test $ol_cv_lib_gdbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm" + fi + fi +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then + echo $ac_n "checking for NDBM library""... $ac_c" 1>&6 +echo "configure:4133: checking for NDBM library" >&5 +if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ol_LIBS="$LIBS" + echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 +echo "configure:4139: checking for dbm_open" >&5 +if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dbm_open(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_dbm_open) || defined (__stub___dbm_open) +choke me +#else +dbm_open(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_dbm_open=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_dbm_open=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_ndbm=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6 +echo "configure:4186: checking for dbm_open in -lndbm" >&5 +ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lndbm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_ndbm=-lndbm +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 +echo "configure:4225: checking for dbm_open in -ldbm" >&5 +ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldbm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ol_cv_lib_ndbm=-ldbm +else + echo "$ac_t""no" 1>&6 +ol_cv_lib_ndbm=no +fi + +fi + + +fi + + LIBS="$ol_LIBS" + +fi + +echo "$ac_t""$ol_cv_lib_ndbm" 1>&6 + + + for ac_hdr in ndbm.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:4281: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking for db""... $ac_c" 1>&6 +echo "configure:4318: checking for db" >&5 +if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then + ol_cv_ndbm=no + else + ol_cv_ndbm=yes + fi + +fi + +echo "$ac_t""$ol_cv_ndbm" 1>&6 + if test $ol_cv_ndbm = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_NDBM 1 +EOF + + fi + + + if test $ol_cv_ndbm = yes ; then + ol_link_ldbm=ndbm + ol_with_ldbm_api=ndbm + + if test $ol_with_ldbm_api = ndbm ; then + echo "configure: warning: Attempting to use NDBM. Functionality will be limited." 1>&2 + fi + + if test $ol_cv_lib_ndbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm" + fi + fi +fi + +if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then + echo "configure: warning: could not find suitable LDBM backend" 1>&2 + if test $ol_enable_ldbm = yes ; then + { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; } + fi + + echo "configure: warning: disabling LDBM" 1>&2 + $ol_enable_ldbm=no +fi + +if test $ol_enable_wrappers = yes ; then + echo $ac_n "checking for hosts_access in -lwrap""... $ac_c" 1>&6 +echo "configure:4366: checking for hosts_access in -lwrap" >&5 +ac_lib_var=`echo wrap'_'hosts_access | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lwrap $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_wrappers=yes +else + echo "$ac_t""no" 1>&6 +have_wrappers=no +fi + + + if test $have_wrappers = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_TCPD 1 +EOF + + SLAPD_LIBS="$SLAPD_LIBS -lwrap" + else + echo "configure: warning: could not find -lwrap" 1>&2 + if test $ol_enable_wrappers = yes ; then + { echo "configure: error: could not find wrappers" 1>&2; exit 1; } + fi + + echo "configure: warning: disabling wrappers support" 1>&2 + ol_enable_wrappers=no + fi + +fi + +# ud needs termcap (should insert check here) +ol_link_termcap=no +for ac_hdr in termcap.h ncurses.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:4431: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +if test $ol_link_termcap = no ; then + echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6 +echo "configure:4470: checking for tputs in -ltermcap" >&5 +ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ltermcap $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_termcap=yes +else + echo "$ac_t""no" 1>&6 +have_termcap=no +fi + + if test $have_termcap = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_TERMCAP 1 +EOF + + ol_link_termcap=yes + TERMCAP_LIBS=-ltermcap + fi +fi + +if test $ol_link_termcap = no ; then + echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 +echo "configure:4522: checking for initscr in -lncurses" >&5 +ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lncurses $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_ncurses=yes +else + echo "$ac_t""no" 1>&6 +have_ncurses=no +fi + + if test $have_ncurses = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_NCURSES 1 +EOF + + ol_link_termcap=yes + TERMCAP_LIBS=-lncurses + fi +fi + +if test $ol_link_termcap = no ; then + cat >> confdefs.h <<\EOF +#define NO_TERMCAP 1 +EOF + + TERMCAP_LIBS= +fi + +# FreeBSD (and others) have crypt(3) in -lcrypt +if test $ol_enable_crypt != no ; then + echo $ac_n "checking for crypt""... $ac_c" 1>&6 +echo "configure:4583: checking for crypt" >&5 +if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char crypt(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_crypt) || defined (__stub___crypt) +choke me +#else +crypt(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_crypt=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_crypt=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_crypt=yes +else + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 +echo "configure:4630: checking for crypt in -lcrypt" >&5 +ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lcrypt $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LUTIL_LIBS="$LUTIL_LIBS -lcrypt" + have_crypt=yes +else + echo "$ac_t""no" 1>&6 +have_crypt=no +fi + +fi + + + if test $have_crypt = yes ; then + cat >> confdefs.h <<\EOF +#define HAVE_CRYPT 1 +EOF + + else + echo "configure: warning: could not find crypt" 1>&2 + if test $ol_enable_crypt = yes ; then + { echo "configure: error: could not find crypt" 1>&2; exit 1; } + fi + + echo "configure: warning: disabling crypt support" 1>&2 + ol_enable_crypt=no + fi +fi + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:4691: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + + +if test $ac_cv_header_stdc != yes; then + echo "configure: warning: could not locate Standard C headers" 1>&2 +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:4804: checking for $ac_hdr that defines DIR" >&5 +if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_hdr> +int main() { +DIR *dirp = 0; +; return 0; } +EOF +if { (eval echo configure:4817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:4842: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldir $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -ldir" +else + echo "$ac_t""no" 1>&6 +fi + +else +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:4883: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lx $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lx" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:4925: checking for sys/wait.h that is POSIX.1 compatible" >&5 +if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +int main() { +int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; +; return 0; } +EOF +if { (eval echo configure:4946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_sys_wait_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 +if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +for ac_hdr in \ + stddef.h \ + errno.h \ + fcntl.h \ + filio.h \ + getopt.h \ + limits.h \ + malloc.h \ + regex.h \ + sgtty.h \ + sys/file.h \ + sys/errno.h \ + sys/ioctl.h \ + sys/param.h \ + sys/socket.h \ + sys/syslog.h \ + sys/time.h \ + sys/types.h \ + syslog.h \ + termios.h \ + unistd.h \ + +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:4991: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:5001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +echo "configure:5029: checking for uid_t in sys/types.h" >&5 +if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "uid_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_uid_t=yes +else + rm -rf conftest* + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_type_uid_t" 1>&6 +if test $ac_cv_type_uid_t = no; then + cat >> confdefs.h <<\EOF +#define uid_t int +EOF + + cat >> confdefs.h <<\EOF +#define gid_t int +EOF + +fi + +echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 +echo "configure:5063: checking type of array argument to getgroups" >&5 +if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_type_getgroups=cross +else + cat > conftest.$ac_ext < +#define NGID 256 +#undef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) +main() +{ + gid_t gidset[NGID]; + int i, n; + union { gid_t gval; long lval; } val; + + val.lval = -1; + for (i = 0; i < NGID; i++) + gidset[i] = val.gval; + n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, + gidset); + /* Exit non-zero if getgroups seems to require an array of ints. This + happens when gid_t is short but getgroups modifies an array of ints. */ + exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); +} + +EOF +if { (eval echo configure:5096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_type_getgroups=gid_t +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_type_getgroups=int +fi +rm -fr conftest* +fi + +if test $ac_cv_type_getgroups = cross; then + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_getgroups=gid_t +else + rm -rf conftest* + ac_cv_type_getgroups=int +fi +rm -f conftest* + +fi +fi + +echo "$ac_t""$ac_cv_type_getgroups" 1>&6 +cat >> confdefs.h <&6 +echo "configure:5134: checking for mode_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_mode_t=yes +else + rm -rf conftest* + ac_cv_type_mode_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_mode_t" 1>&6 +if test $ac_cv_type_mode_t = no; then + cat >> confdefs.h <<\EOF +#define mode_t int +EOF + +fi + +echo $ac_n "checking for off_t""... $ac_c" 1>&6 +echo "configure:5167: checking for off_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_off_t=yes +else + rm -rf conftest* + ac_cv_type_off_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_off_t" 1>&6 +if test $ac_cv_type_off_t = no; then + cat >> confdefs.h <<\EOF +#define off_t long +EOF + +fi + +echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:5200: checking for pid_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes +else + rm -rf conftest* + ac_cv_type_pid_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_pid_t" 1>&6 +if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF +#define pid_t int +EOF + +fi + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:5233: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:5255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 +echo "configure:5274: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + +echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 +echo "configure:5307: checking for uid_t in sys/types.h" >&5 +if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "uid_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_uid_t=yes +else + rm -rf conftest* + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_type_uid_t" 1>&6 +if test $ac_cv_type_uid_t = no; then + cat >> confdefs.h <<\EOF +#define uid_t int +EOF + + cat >> confdefs.h <<\EOF +#define gid_t int +EOF + +fi + +echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 +echo "configure:5341: checking for st_blksize in struct stat" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { +struct stat s; s.st_blksize; +; return 0; } +EOF +if { (eval echo configure:5354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_st_blksize=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_st_blksize=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6 +if test $ac_cv_struct_st_blksize = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ST_BLKSIZE 1 +EOF + +fi + +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:5375: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:5389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + +echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 +echo "configure:5410: checking whether struct tm is in sys/time.h or time.h" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { +struct tm *tp; tp->tm_sec; +; return 0; } +EOF +if { (eval echo configure:5423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_tm=time.h +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_tm=sys/time.h +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_tm" 1>&6 +if test $ac_cv_struct_tm = sys/time.h; then + cat >> confdefs.h <<\EOF +#define TM_IN_SYS_TIME 1 +EOF + +fi + + + +echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6 +echo "configure:5446: checking if toupper() requires islower()" >&5 +if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test "$cross_compiling" = yes; then + ol_cv_c_upper_lower=safe +else + cat > conftest.$ac_ext < +main() +{ + if ('C' == toupper('C')) + exit(0); + else + exit(1); +} +EOF +if { (eval echo configure:5467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ol_cv_c_upper_lower=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ol_cv_c_upper_lower=yes +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ol_cv_c_upper_lower" 1>&6 +if test $ol_cv_c_upper_lower != no ; then + cat >> confdefs.h <<\EOF +#define C_UPPER_LOWER 1 +EOF + +fi + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:5490: checking for working const" >&5 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:5544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + + + +echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 +echo "configure:5567: checking for 8-bit clean memcmp" >&5 +if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_clean=no +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_func_memcmp_clean=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_memcmp_clean=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 +test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" + +echo $ac_n "checking for strftime""... $ac_c" 1>&6 +echo "configure:5603: checking for strftime" >&5 +if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strftime(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_strftime) || defined (__stub___strftime) +choke me +#else +strftime(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_strftime=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_strftime=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_STRFTIME 1 +EOF + +else + echo "$ac_t""no" 1>&6 +# strftime is in -lintl on SCO UNIX. +echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 +echo "configure:5653: checking for strftime in -lintl" >&5 +ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lintl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_STRFTIME 1 +EOF + +LIBS="-lintl $LIBS" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking for vprintf""... $ac_c" 1>&6 +echo "configure:5699: checking for vprintf" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char vprintf(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_vprintf) || defined (__stub___vprintf) +choke me +#else +vprintf(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_vprintf=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_vprintf=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_VPRINTF 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_func_vprintf" != yes; then +echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 +echo "configure:5751: checking for _doprnt" >&5 +if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _doprnt(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub__doprnt) || defined (__stub____doprnt) +choke me +#else +_doprnt(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func__doprnt=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func__doprnt=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_DOPRNT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 +echo "configure:5804: checking for wait3 that fills in rusage" >&5 +if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_wait3_rusage=no +else + cat > conftest.$ac_ext < +#include +#include +#include +/* HP-UX has wait3 but does not fill in rusage at all. */ +main() { + struct rusage r; + int i; + /* Use a field that we can force nonzero -- + voluntary context switches. + For systems like NeXT and OSF/1 that don't set it, + also use the system CPU time. And page faults (I/O) for Linux. */ + r.ru_nvcsw = 0; + r.ru_stime.tv_sec = 0; + r.ru_stime.tv_usec = 0; + r.ru_majflt = r.ru_minflt = 0; + switch (fork()) { + case 0: /* Child. */ + sleep(1); /* Give up the CPU. */ + _exit(0); + case -1: _exit(0); /* What can we do? */ + default: /* Parent. */ + wait3(&i, 0, &r); + sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines. */ + exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 + && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); + } +} +EOF +if { (eval echo configure:5843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_func_wait3_rusage=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_wait3_rusage=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6 +if test $ac_cv_func_wait3_rusage = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_WAIT3 1 +EOF + +fi + + +for ac_func in \ + bcopy \ + getopt \ + flock \ + gethostname \ + gettimeofday \ + getdtablesize \ + lockf \ + memcpy \ + memmove \ + mkstemp \ + mktime \ + select \ + setpwfile \ + setsid \ + signal \ + sigset \ + socket \ + strerror \ + strstr \ + strrchr \ + strsep \ + strtod \ + strtol \ + strtoul \ + sysconf \ + tempnam \ + waitpid \ + +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5897: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +for ac_func in getopt strdup tempnam +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:5953: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:5981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +LIBOBJS="$LIBOBJS ${ac_func}.o" +fi +done + + + +# Check Configuration + +echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 +echo "configure:6011: checking declaration of sys_errlist" >&5 +if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include +#include +int main() { +char *c = (char *) *sys_errlist +; return 0; } +EOF +if { (eval echo configure:6027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ol_cv_dcl_sys_errlist=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_dcl_sys_errlist=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6 + +# It's possible (for near-UNIX clones) that sys_errlist doesn't exist +if test $ol_cv_dcl_sys_errlist = no ; then + cat >> confdefs.h <<\EOF +#define DECL_SYS_ERRLIST 1 +EOF + + echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 +echo "configure:6048: checking existence of sys_errlist" >&5 + if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +int main() { +char *c = (char *) *sys_errlist +; return 0; } +EOF +if { (eval echo configure:6061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + ol_cv_have_sys_errlist=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ol_cv_have_sys_errlist=no +fi +rm -f conftest* +fi + + echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6 +fi + + + +if test $ol_enable_debug != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_DEBUG 1 +EOF + +fi +if test $ol_enable_libui = yes ; then + cat >> confdefs.h <<\EOF +#define LDAP_LIBUI 1 +EOF + +fi +if test $ol_enable_cache = no ; then + cat >> confdefs.h <<\EOF +#define LDAP_NOCACHE 1 +EOF + +fi +if test $ol_enable_dns != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_DNS 1 +EOF + +fi +if test $ol_enable_referrals != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_REFERRALS 1 +EOF + +fi +if test $ol_enable_cldap != no ; then + cat >> confdefs.h <<\EOF +#define LDAP_CONNECTIONLESS 1 +EOF + +fi + +if test $ol_enable_aclgroup != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_ACLGROUP 1 +EOF + +fi + +if test $ol_enable_crypt != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_CRYPT 1 +EOF + +fi + +if test $ol_enable_md5 != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_MD5 1 +EOF + +fi + +if test $ol_enable_sha1 != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_SHA1 1 +EOF + +fi + +if test $ol_enable_phonetic != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_PHONETIC 1 +EOF + +fi + +if test $ol_enable_rlookups != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_RLOOKUPS 1 +EOF + +fi + +if test $ol_link_ldbm != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_LDBM 1 +EOF + + BUILD_SLAPD=yes + BUILD_LDBM=yes +fi + +if test $ol_enable_passwd != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_PASSWD 1 +EOF + + BUILD_SLAPD=yes + BUILD_PASSWD=yes +fi + +if test $ol_enable_shell != no ; then + cat >> confdefs.h <<\EOF +#define SLAPD_SHELL 1 +EOF + + BUILD_SLAPD=yes + BUILD_SHELL=yes +fi + +if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \ + $BUILD_SLAPD = yes ; then + BUILD_SLURPD=yes +fi + + + + + + + + + + + + + + + + + + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.12" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "\ +Makefile:build/top.mk:Makefile.in:build/dir.mk \ +doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \ +doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \ +doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \ +doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \ +doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \ +doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \ +clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \ +clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \ +clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \ +clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \ +clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \ +clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \ +clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \ +clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \ +include/Makefile:build/top.mk:include/Makefile.in \ +libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \ +libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \ +libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \ +libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \ +libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \ +libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \ +libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \ +libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \ +servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \ +servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \ +servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \ +servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \ +servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \ +servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \ +servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \ +servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \ +servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \ +tests/Makefile:build/top.mk:tests/Makefile.in \ + include/portable.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@LN_S@%$LN_S%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@RANLIB@%$RANLIB%g +s%@SET_MAKE@%$SET_MAKE%g +s%@SENDMAIL@%$SENDMAIL%g +s%@EDITOR@%$EDITOR%g +s%@FINGER@%$FINGER%g +s%@CC@%$CC%g +s%@CPP@%$CPP%g +s%@LIBOBJS@%$LIBOBJS%g +s%@BUILD_LDAPD@%$BUILD_LDAPD%g +s%@BUILD_SLAPD@%$BUILD_SLAPD%g +s%@BUILD_LDBM@%$BUILD_LDBM%g +s%@BUILD_PASSWD@%$BUILD_PASSWD%g +s%@BUILD_SHELL@%$BUILD_SHELL%g +s%@BUILD_SLURPD@%$BUILD_SLURPD%g +s%@LDAP_LIBS@%$LDAP_LIBS%g +s%@LDAPD_LIBS@%$LDAPD_LIBS%g +s%@SLAPD_LIBS@%$SLAPD_LIBS%g +s%@SLURPD_LIBS@%$SLURPD_LIBS%g +s%@LDBM_LIBS@%$LDBM_LIBS%g +s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g +s%@LUTIL_LIBS@%$LUTIL_LIBS%g +s%@KRB_LIBS@%$KRB_LIBS%g +s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +date > stamp-h +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000000..e938e98fae --- /dev/null +++ b/configure.in @@ -0,0 +1,917 @@ +dnl Copyright 1998 The OpenLDAP Foundation. All Rights Reserved. +dnl +dnl Redistribution and use in source and binary forms are permitted only +dnl as authorized by the OpenLDAP Public License. A copy of this +dnl license is available at http://www.OpenLDAP.org/license.html or +dnl in file LICENSE in the top-level directory of the distribution. +dnl ---- +dnl Configure.in for OpenLDAP +dnl +AC_INIT(include/ldap.h) +dnl +dnl +AC_PREREQ(2.10)dnl Required Autoconf version +dnl Do not use AutoConf 2.12; it produces a configuration script +dnl that causes an "internal 2K buffer" error on HPUX when run +dnl with /bin/sh. Autoconf 2.10 seems to be okay. +AC_CONFIG_AUX_DIR(build) +AC_CONFIG_HEADER(include/portable.h)dnl +dnl +dnl Start Args +AC_MSG_CHECKING(configure arguments) +AC_PREFIX_DEFAULT(/usr/local) + +dnl General "enable" options +OL_ARG_ENABLE(debug,[ --enable-debug enable debugging], yes)dnl +dnl OL_ARG_ENABLE(syslog,[ --enable-syslog enable syslog support], auto)dnl +OL_ARG_ENABLE(libui,[ --enable-libui enable library user interface], yes)dnl +OL_ARG_ENABLE(cache,[ --enable-cache enable caching], yes)dnl +OL_ARG_ENABLE(dns,[ --enable-dns enable dns support], no)dnl +OL_ARG_ENABLE(referrals,[ --enable-referrals enable referrals], yes)dnl +OL_ARG_ENABLE(cldap,[ --enable-cldap enable connectionless ldap], no)dnl + +dnl General "with" options +OL_ARG_WITH(kerberos,[ --with-kerberos use Kerberos], + auto, [auto k5 k4 afs yes no]) +OL_ARG_WITH(threads,[ --with-threads use threads], + auto, [auto posix mach lwp yes no manual] ) +OL_ARG_WITH(preemptive,[ --with-preemptive thread implementation is preemptive], + auto, [auto yes no manual] ) + +dnl Server options + +dnl LDAPD OPTIONS +OL_ARG_ENABLE(ldapd,[ --enable-ldapd enable building ldapd], no)dnl + +dnl SLAPD OPTIONS +OL_ARG_ENABLE(slapd,[ --enable-slapd enable building slapd], yes)dnl +OL_ARG_ENABLE(aclgroup,[ --enable-aclgroup enable ACL group support], auto)dnl +OL_ARG_ENABLE(crypt,[ --enable-crypt enable crypt(3) passwords], auto)dnl +OL_ARG_ENABLE(md5,[ --enable-md5 enable MD5 passwords], auto)dnl +OL_ARG_ENABLE(sha1,[ --enable-sha1 enable SHA1 passwords], auto)dnl +OL_ARG_ENABLE(wrappers,[ --enable-wrappers enable tcp wrapper support], no)dnl +OL_ARG_ENABLE(phonetic,[ --enable-phonetic enable phonetic/soundex], no)dnl +OL_ARG_ENABLE(rlookups,[ --enable-rlookups enable reverse lookups], auto)dnl + +dnl SLAPD Backend options +OL_ARG_ENABLE(ldbm,[ --enable-ldbm enable ldbm backend], yes)dnl +OL_ARG_WITH(ldbm_api,[ --with-ldbm-api use LDBM API], auto, + [auto db2 db gdbm ndbm manual]) +OL_ARG_WITH(ldbm_type,[ --with-ldbm-type use LDBM type], auto, + [auto btree hash]) + +OL_ARG_ENABLE(passwd,[ --enable-passwd enable passwd backend], no)dnl +OL_ARG_ENABLE(shell,[ --enable-shell enable shell backend], no)dnl + +dnl SLURPD OPTIONS +OL_ARG_ENABLE(slurpd,[ --enable-slurpd enable building slurpd], auto)dnl + +if test $ol_enable_slapd = no ; then + dnl SLAPD was specificallly disabled + if test $ol_enable_ldbm = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_ldbm argument]); + fi + if test $ol_enable_passwd = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_passwd argument]); + fi + if test $ol_enable_shell = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_shell argument]); + fi + if test $ol_enable_aclgroup = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_aclgroup argument]); + fi + if test $ol_enable_crypt = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_crypt argument]); + fi + if test $ol_enable_md5 = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_md5 argument]); + fi + if test $ol_enable_sha1 = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_sha1 argument]); + fi + if test $ol_enable_wrappers = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_wrappers argument]); + fi + if test $ol_enable_phonetic = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_phonetic argument]); + fi + if test $ol_enable_rlookups = yes ; then + AC_MSG_WARN([slapd disabled, ignoring --enable_rlookups argument]); + fi + if test $ol_with_ldbm_api != auto ; then + AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_api argument]); + fi + if test $ol_with_ldbm_type != auto ; then + AC_MSG_WARN([slapd disabled, ignoring --with_ldbm_type argument]); + fi + if test $ol_enable_slurpd = yes ; then + AC_MSG_ERROR([slurpd requires slapd]); + fi + + # force settings to no + ol_enable_ldbm=no + ol_enable_shell=no + ol_enable_passwd=no + ol_enable_aclgroup=no + ol_enable_crypt=no + ol_enable_md5=no + ol_enable_sha1=no + ol_enable_wrappers=no + ol_enable_phonetic=no + ol_enable_rlookups=no + ol_with_ldbm_api=no + ol_with_ldbm_type=no + ol_enable_slurpd=no + +elif test $ol_enable_ldbm = no ; then + dnl SLAPD without LDBM + + if test $ol_with_ldbm_api != auto ; then + AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_api argument]); + fi + + if test $ol_with_ldbm_type != auto ; then + AC_MSG_WARN([LDBM disabled, ignoring --with_ldbm_type argument]); + fi + + if test $ol_enable_passwd = no -a $ol_enable_shell = no ; then + AC_MSG_ERROR([slapd requires a backend]); + fi + + ol_with_ldbm_api=no + ol_with_ldbm_type=no + +else + dnl SLAPD with LDBM + + if test $ol_with_ldbm_api = gdbm -a \ + $ol_with_ldbm_type = btree ; then + AC_MSG_ERROR([GDBM only supports LDBM type hash]); + fi + if test $ol_with_ldbm_api = ndbm -a \ + $ol_with_ldbm_type = btree ; then + AC_MSG_ERROR([NDBM only supports LDBM type hash]); + fi +fi + +if test $ol_enable_slurpd = yes ; then + dnl SLURPD was specifically enabled + if test $ol_with_threads = no ; then + AC_MSG_ERROR([slurpd requires threads]); + fi +fi + +AC_MSG_RESULT(done) + +## Initialize vars +LDAP_LIBS= +LDBM_LIBS= +LTHREAD_LIBS= +LUTIL_LIBS= + +LDAPD_LIBS= +SLAPD_LIBS= +SLURPD_LIBS= + +BUILD_LDAPD=no +BUILD_SLAPD=no +BUILD_SLURPD=no + +BUILD_LDBM=no +BUILD_PASSWD=no +BUILD_SHELL=no + +KRB_LIBS= +TERMCAP_LIBS= + +dnl ---------------------------------------------------------------- +dnl Checks for programs + +AC_PROG_LN_S +AC_PROG_INSTALL +AC_PROG_RANLIB +AC_PROG_MAKE_SET + +AC_PATH_PROG(SENDMAIL, sendmail, /usr/lib/sendmail, + $PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc) +AC_PATH_PROG(EDITOR, vi, /usr/ucb/vi, $PATH:/usr/ucb) +AC_PATH_PROG(FINGER, finger, /usr/ucb/finger, $PATH:/usr/ucb) + +dnl Checks the compiler and UNIX Variants +AC_PROG_CC +AC_PROG_GCC_TRADITIONAL + +AC_AIX +AC_ISC_POSIX +AC_MINIX + +dnl ---------------------------------------------------------------- +dnl Checks for libraries + +dnl Find socket() +dnl Likely combinations: +dnl -lsocket [ -lnsl_s | -lnsl ] +dnl -linet + +AC_CHECK_FUNC(socket, :, [ +dnl +dnl hopefully we won't include too many libraries +dnl + AC_CHECK_LIB(socket, main) + AC_CHECK_LIB(net, main) + AC_CHECK_LIB(nsl_s, main) + AC_CHECK_LIB(nsl, main) + AC_CHECK_LIB(inet, socket) + AC_CHECK_LIB(gen, main) +]) + +dnl HP-UX requires -lV3 +AC_CHECK_LIB(V3, sigset) + +if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then + AC_CHECK_HEADERS(kerberosIV/krb.h kerberosIV/des.h) + + if test $ac_cv_header_kerberosIV_krb_h = yes ; then + AC_CHECK_LIB(krb4, main, [have_k5=yes], [have_k5=no], + [-lkrb5 -ldes425]) + + if test $have_k5 = yes ; then + ol_with_kerberos=found + ol_link_kerberos=yes + + AC_DEFINE(HAVE_KERBEROS) + + KRB_LIBS="-lkrb4 -lkrb5 -ldes425" + fi + fi +fi +if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then + AC_CHECK_HEADERS(krb.h des.h) + + if test $ac_cv_header_krb_h = yes ; then + AC_CHECK_LIB(krb, main, [have_k4=yes], [have_k4=no], [-ldes]) + + if test $have_k4 = yes ; then + ol_with_kerberos=found + ol_link_kerberos=yes + + AC_DEFINE(HAVE_KERBEROS) + + KRB_LIBS="-lkrb -ldes" + fi + fi +fi + + +ol_link_threads=no +if test $ol_with_threads = auto -o $ol_with_threads = posix ; then + AC_CHECK_HEADERS(pthread.h sched.h) + + if test $ac_cv_header_pthread_h = yes ; then + OL_POSIX_THREAD_VERSION + + if test $ol_cv_pthread_version = final ; then + dnl AC_DEFINE(HAVE_PTHREADS_FINAL) + elif test $ol_cv_pthread_version = draft4 ; then + AC_DEFINE(HAVE_PTHREADS_D4) + else + AC_MSG_ERROR([unknown pthread version]) + fi + + # consider threads found + ol_with_threads=found + + OL_LINUX_THREADS + + if test $ol_cv_linux_threads = yes ; then + AC_DEFINE(HAVE_LINUX_THREADS,1) + fi + + dnl Now the hard part, how to link + + dnl A few platforms have pthread support in standard libraries + AC_CHECK_FUNC(pthread_create,[ol_link_threads=yes]) + + if test $ol_link_threads = no ; then + dnl try -pthread + AC_CACHE_CHECK([for pthread_create with -pthread], + [ol_cv_pthread_flag], [ + dnl save the CPPFLAGS + save_LIBS="$LIBS" + LIBS="-pthread $LIBS" + AC_TRY_LINK([#include ],[ + pthread_create((pthread_t*) 0, + (pthread_attr_t*) 0, 0, 0); + ], ol_cv_pthread_flag=yes, ol_cv_pthread_flag=no) + dnl restore the LIBS + LIBS="$save_LIBS" + ]) + + if test $ol_cv_pthread_flag = yes ; then + LTHREAD_LIBS="$LTHREAD_LIBS -pthread" + ol_link_threads=posix + fi + fi + + if test $ol_link_threads = no ; then + dnl try -lpthread + save_LIBS="$LIBS" + AC_CHECK_LIB(pthread, pthread_create, [ + ol_link_threads=posix + LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"]) + LIBS="$save_LIBS" + fi + + if test $ol_link_threads = no ; then + dnl try -lc_r + save_LIBS="$LIBS" + AC_CHECK_LIB(c_r, pthread_create, [ + ol_link_threads=posix + LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"]) + LIBS="$save_LIBS" + fi + + if test $ol_link_threads = no ; then + dnl try DEC Threads + save_LIBS="$LIBS" + AC_CHECK_LIB(pthread, pthread_create, [ + AC_DEFINE(HAVE_DCE) + ol_link_threads=posix + LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"],, + if test $ol_with_preemptive = auto ; then + ol_with_preemptive=yes + fi + [-lmach -lexc -lc]) + LIBS="$save_LIBS" + fi + + if test $ol_link_threads != no ; then + AC_DEFINE(HAVE_PTHREADS) + + dnl save DEFS/LIBS + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + LIBS="$LTHREAD_LIBS $LIBS" + + dnl All POSIX Thread (final) implementations should have + dnl sched_yield instead of pthread yield. + dnl check for both + AC_CHECK_FUNCS(sched_yield pthread_yield) + + if test $ac_cv_func_sched_yield = no -a \ + $ac_cv_func_pthread_yield = no ; then + + AC_MSG_WARN([could not locate sched_yield() or pthread_yield()]) + AC_MSG_ERROR([POSIX Threads are not usable]) + fi + + dnl Check functions for compatibility + AC_CHECK_FUNCS(pthread_kill) +dnl AC_CHECK_FUNCS( +dnl pthread_attr_create pthread_attr_init \ +dnl pthread_attr_destroy pthread_attr_delete \ +dnl pthread_attr_setdetachstate pthread_attr_setdetach_np \ +dnl ) + + dnl Check PREEMPTIVE Implementation + if test $ol_with_preemptive = auto ; then + AC_MSG_CHECKING([for preemptive Pthread implementation]) + AC_TRY_RUN([ +#include +#include +#include +#include +#ifndef NULL +#define NULL 0 +#endif + +int task(arg) + int *arg; +{ + struct timeval tv; + + tv.tv_sec=4; + tv.tv_usec=0; + select(0, NULL, NULL, NULL, &tv); + + tv.tv_sec=6; + tv.tv_usec=0; + select(0, NULL, NULL, NULL, &tv); + + exit(1); /* if we exit here, the select blocked the whole process */ +} + +main(argc, argv) +int argc; char **argv; +{ + pthread_t t; + pthread_create(&t, NULL, (void *) task, NULL); + +#if HAVE_SCHED_YIELD + sched_yield(); /* make sure task runs first */ +#else +#if defined(HAVE_PTHREAD_YIELD) + pthread_yield(); /* make sure task runs first */ +#endif +#endif + exit(0); +} + ], [ol_pthread_preemptive=yes], [ol_pthread_preemptive=no], [ + AC_MSG_ERROR([crossing compiling: use --with-preemptive=yes|no|manual])]) + AC_MSG_RESULT($ol_pthread_preemptive) + + if test $ol_pthread_preemptive = yes ; then + AC_DEFINE(HAVE_PREEMPTIVE_PTHREADS) + ol_with_preemptive=yes + fi + fi + + dnl restore DEFS/LIBS + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + else + AC_MSG_ERROR([could not link with POSIX Threads]) + fi + fi + + if test $ol_with_threads = posix ; then + AC_MSG_ERROR([could not locate POSIX Threads]) + fi +fi + +if test $ol_with_threads = auto -o $ol_with_threads = cthreads ; then + dnl check for Mach CThreads + AC_CHECK_HEADERS(mach/cthreads.h) + if test $ac_cv_header_lwp_lwp_h = yes ; then + AC_CHECK_LIB(lwp, cthread_fork, [have_cthreads=yes], [have_cthreads=no]) + + if test $have_cthreads = yes ; then + AC_DEFINE(HAVE_MACH_CTHREADS) + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + fi + fi +fi + +if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then + dnl check for SunOS5 LWP + AC_CHECK_HEADERS(thread.h synch.h) + if test $ac_cv_header_lwp_lwp_h = yes ; then + AC_CHECK_LIB(thread, thr_create, [have_lwp=yes], [have_lwp=no]) + + if test $have_lwp = yes ; then + AC_DEFINE(HAVE_THR) + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + + if test $ol_with_preemptive = auto ; then + ol_with_preemptive=yes + fi + fi + fi + + dnl check for SunOS4 LWP + AC_CHECK_HEADERS(lwp/lwp.h) + if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then + AC_CHECK_LIB(lwp, lwp_create, [have_lwp=yes], [have_lwp=no]) + + if test $have_lwp = yes ; then + AC_DEFINE(HAVE_LWP) + LTHREAD_LIBS="$LTHREAD_LIBS -llwp" + + if test $ol_with_preemptive = auto ; then + ol_with_preemptive=no + fi + fi + fi +fi + +if test $ol_with_preemptive = yes ; then + AC_DEFINE(PREEMPTIVE_THREADS,1) +fi + +if test $ol_with_threads = manual ; then + dnl User thinks he can manually configure threads. + $ol_link_threads=yes + + AC_MSG_WARN([thread defines and link options must be set manually]) + + AC_CHECK_HEADERS(pthread.h sched.h) + AC_CHECK_FUNCS(sched_yield pthread_yield) + OL_LINUX_THREADS + + AC_CHECK_HEADERS(mach/cthreads.h) + AC_CHECK_HEADERS(lwp/lwp.h) + AC_CHECK_HEADERS(thread.h synch.h) +fi + +if test $ol_link_threads = no ; then + if test $ol_with_threads = yes ; then + AC_MSG_ERROR([no suitable thread support]) + fi + + if test $ol_with_threads = auto ; then + AC_MSG_WARN([no suitable thread support, disabling threads]) + $ol_with_threads = no + fi + + AC_DEFINE(NO_THREADS,1) + AC_DEFINE(PREEMPTIVE_THREADS,1) + LTHREAD_LIBS="" +fi + +ol_link_ldbm=no +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then + OL_BERKELEY_DB2 + + if test $ol_cv_berkeley_db2 = yes ; then + ol_link_ldbm=db2 + ol_with_ldbm_api=db2 + + if test $ol_with_ldbm_type = hash ; then + AC_DEFINE(LDBM_USE_DBHASH,1) + else + AC_DEFINE(LDBM_USE_DBBTREE,1) + fi + + dnl $ol_cv_lib_db2 should be yes or -ldb + dnl (it could be no, but that would be an error + if test $ol_cv_lib_db2 != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2" + fi + fi +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then + OL_BERKELEY_DB + + if test $ol_cv_berkeley_db = yes ; then + ol_link_ldbm=db + ol_with_ldbm_api=db + + if test $ol_with_ldbm_type = hash ; then + AC_DEFINE(LDBM_USE_DBHASH,1) + else + AC_DEFINE(LDBM_USE_DBBTREE,1) + fi + + dnl $ol_cv_lib_db should be yes or -ldb + dnl (it could be no, but that would be an error + if test $ol_cv_lib_db != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db" + fi + fi +fi + +if test $ol_with_ldbm_api = manual ; then + dnl User thinks he can manually configure LDBM api. + $ol_link_ldbm=yes + + AC_MSG_WARN([LDBM defines and link options must be set manually]) + + AC_CHECK_HEADERS(db.h db_185.h gdbm.h ndbm.h) +fi + +if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then + AC_MSG_WARN(Could not find LDBM with BTREE support); + $ol_with_ldbm_api=none +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then + OL_GDBM + + if test $ol_cv_gdbm = yes ; then + ol_link_ldbm=gdbm + ol_with_ldbm_api=gdbm + + if test $ol_cv_lib_gdbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm" + fi + fi +fi + +if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then + OL_NDBM + + if test $ol_cv_ndbm = yes ; then + ol_link_ldbm=ndbm + ol_with_ldbm_api=ndbm + + if test $ol_with_ldbm_api = ndbm ; then + AC_WARN([Attempting to use NDBM. Functionality will be limited.]) + fi + + if test $ol_cv_lib_ndbm != yes ; then + LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm" + fi + fi +fi + +if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then + AC_MSG_WARN(could not find suitable LDBM backend) + if test $ol_enable_ldbm = yes ; then + AC_MSG_ERROR(select appropriate LDBM options or disable) + fi + + AC_MSG_WARN(disabling LDBM) + $ol_enable_ldbm=no +fi + +if test $ol_enable_wrappers = yes ; then + AC_CHECK_LIB(wrap, hosts_access, + [have_wrappers=yes], [have_wrappers=no]) + + if test $have_wrappers = yes ; then + AC_DEFINE(HAVE_TCPD) + SLAPD_LIBS="$SLAPD_LIBS -lwrap" + else + AC_MSG_WARN(could not find -lwrap) + if test $ol_enable_wrappers = yes ; then + AC_MSG_ERROR(could not find wrappers, select appropriate options or disable) + fi + + AC_MSG_WARN(disabling wrappers support) + ol_enable_wrappers=no + fi + +fi + +# ud needs termcap (should insert check here) +ol_link_termcap=no +AC_CHECK_HEADERS(termcap.h ncurses.h) + +if test $ol_link_termcap = no ; then + AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no]) + if test $have_termcap = yes ; then + AC_DEFINE(HAVE_TERMCAP) + ol_link_termcap=yes + TERMCAP_LIBS=-ltermcap + fi +fi + +if test $ol_link_termcap = no ; then + AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no]) + if test $have_ncurses = yes ; then + AC_DEFINE(HAVE_NCURSES) + ol_link_termcap=yes + TERMCAP_LIBS=-lncurses + fi +fi + +if test $ol_link_termcap = no ; then + AC_DEFINE(NO_TERMCAP,1) + TERMCAP_LIBS= +fi + +# FreeBSD (and others) have crypt(3) in -lcrypt +if test $ol_enable_crypt != no ; then + AC_CHECK_FUNC(crypt, [have_crypt=yes], [ + AC_CHECK_LIB(crypt, crypt, [LUTIL_LIBS="$LUTIL_LIBS -lcrypt" + have_crypt=yes], [have_crypt=no])]) + + if test $have_crypt = yes ; then + AC_DEFINE(HAVE_CRYPT) + else + AC_MSG_WARN(could not find crypt) + if test $ol_enable_crypt = yes ; then + AC_MSG_ERROR(could not find crypt, select appropriate options or disable) + fi + + AC_MSG_WARN(disabling crypt support) + ol_enable_crypt=no + fi +fi + +dnl ---------------------------------------------------------------- +dnl Checks for header files. +AC_HEADER_STDC + +if test $ac_cv_header_stdc != yes; then + AC_MSG_WARN([could not locate Standard C headers]) +fi + +AC_HEADER_DIRENT +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS( \ + stddef.h \ + errno.h \ + fcntl.h \ + filio.h \ + getopt.h \ + limits.h \ + malloc.h \ + regex.h \ + sgtty.h \ + sys/file.h \ + sys/errno.h \ + sys/ioctl.h \ + sys/param.h \ + sys/socket.h \ + sys/syslog.h \ + sys/time.h \ + sys/types.h \ + syslog.h \ + termios.h \ + unistd.h \ +) + +dnl ---------------------------------------------------------------- +dnl Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_GETGROUPS +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIGNAL +AC_TYPE_SIZE_T +AC_TYPE_UID_T +AC_STRUCT_ST_BLKSIZE +AC_HEADER_TIME +AC_STRUCT_TM + +OL_C_UPPER_LOWER +AC_C_CONST + +dnl AC_CHECK_SIZEOF(short) +dnl AC_CHECK_SIZEOF(int) +dnl AC_CHECK_SIZEOF(long) + +dnl ---------------------------------------------------------------- +dnl Checks for library functions. +AC_FUNC_MEMCMP +AC_FUNC_STRFTIME +AC_FUNC_VPRINTF +AC_FUNC_WAIT3 + +AC_CHECK_FUNCS( \ + bcopy \ + getopt \ + flock \ + gethostname \ + gettimeofday \ + getdtablesize \ + lockf \ + memcpy \ + memmove \ + mkstemp \ + mktime \ + select \ + setpwfile \ + setsid \ + signal \ + sigset \ + socket \ + strerror \ + strstr \ + strrchr \ + strsep \ + strtod \ + strtol \ + strtoul \ + sysconf \ + tempnam \ + waitpid \ +) + +AC_REPLACE_FUNCS(getopt strdup tempnam) + +dnl ---------------------------------------------------------------- +# Check Configuration +OL_SYS_ERRLIST + +dnl ---------------------------------------------------------------- +dnl Sort out defines + +if test $ol_enable_debug != no ; then + AC_DEFINE(LDAP_DEBUG,1) +fi +dnl if test $ol_enable_syslog != no ; then +dnl AC_DEFINE(LDAP_SYSLOG,1) +dnl fi +if test $ol_enable_libui = yes ; then + AC_DEFINE(LDAP_LIBUI,1) +fi +if test $ol_enable_cache = no ; then + AC_DEFINE(LDAP_NOCACHE,1) +fi +if test $ol_enable_dns != no ; then + AC_DEFINE(LDAP_DNS,1) +fi +if test $ol_enable_referrals != no ; then + AC_DEFINE(LDAP_REFERRALS,1) +fi +if test $ol_enable_cldap != no ; then + AC_DEFINE(LDAP_CONNECTIONLESS,1) +fi + +if test $ol_enable_aclgroup != no ; then + AC_DEFINE(SLAPD_ACLGROUP,1) +fi + +if test $ol_enable_crypt != no ; then + AC_DEFINE(SLAPD_CRYPT,1) +fi + +if test $ol_enable_md5 != no ; then + AC_DEFINE(SLAPD_MD5,1) +fi + +if test $ol_enable_sha1 != no ; then + AC_DEFINE(SLAPD_SHA1,1) +fi + +if test $ol_enable_phonetic != no ; then + AC_DEFINE(SLAPD_PHONETIC,1) +fi + +if test $ol_enable_rlookups != no ; then + AC_DEFINE(SLAPD_RLOOKUPS,1) +fi + +if test $ol_link_ldbm != no ; then + AC_DEFINE(SLAPD_LDBM,1) + BUILD_SLAPD=yes + BUILD_LDBM=yes +fi + +if test $ol_enable_passwd != no ; then + AC_DEFINE(SLAPD_PASSWD,1) + BUILD_SLAPD=yes + BUILD_PASSWD=yes +fi + +if test $ol_enable_shell != no ; then + AC_DEFINE(SLAPD_SHELL,1) + BUILD_SLAPD=yes + BUILD_SHELL=yes +fi + +if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \ + $BUILD_SLAPD = yes ; then + BUILD_SLURPD=yes +fi + +dnl ---------------------------------------------------------------- + +AC_SUBST(BUILD_LDAPD) +AC_SUBST(BUILD_SLAPD) + AC_SUBST(BUILD_LDBM) + AC_SUBST(BUILD_PASSWD) + AC_SUBST(BUILD_SHELL) +AC_SUBST(BUILD_SLURPD) + + +AC_SUBST(LDAP_LIBS) +AC_SUBST(LDAPD_LIBS) +AC_SUBST(SLAPD_LIBS) +AC_SUBST(SLURPD_LIBS) +AC_SUBST(LDBM_LIBS) +AC_SUBST(LTHREAD_LIBS) +AC_SUBST(LUTIL_LIBS) + +AC_SUBST(KRB_LIBS) +AC_SUBST(TERMCAP_LIBS) + +dnl ---------------------------------------------------------------- +dnl final output +dnl + +dnl AC_OUTPUT( \ +dnl contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \ +dnl contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \ +dnl contrib/whois++/Makefile:build/top.mk:contrib/whois++/Makefile.in:build/rules.mk \ +dnl [date > stamp-h]) + +AC_OUTPUT( \ +Makefile:build/top.mk:Makefile.in:build/dir.mk \ +doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \ +doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \ +doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \ +doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \ +doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \ +doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \ +clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \ +clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \ +clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \ +clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \ +clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \ +clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \ +clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \ +clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \ +include/Makefile:build/top.mk:include/Makefile.in \ +libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk \ +libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk \ +libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk \ +libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk \ +libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk \ +libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk \ +libraries/liblthread/Makefile:build/top.mk:libraries/liblthread/Makefile.in:build/lib.mk \ +libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk \ +servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \ +servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \ +servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \ +servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \ +servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \ +servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \ +servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \ +servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \ +servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \ +tests/Makefile:build/top.mk:tests/Makefile.in \ +,[date > stamp-h]) diff --git a/contrib/saucer/Make-template b/contrib/saucer/Make-template deleted file mode 100644 index 96f6a6ac05..0000000000 --- a/contrib/saucer/Make-template +++ /dev/null @@ -1,54 +0,0 @@ -# Makefile for LDAP "saucer" client - -HDIR = $(LDAPSRC)/include -INSTMAN = $(MANDIR)/man$(SECT) -LDAPSRC = ../.. -LDIR = $(LDAPSRC)/libraries -SECT = 1 -VERFILE = $(LDAPSRC)/build/version - -CFLAGS = -I$(HDIR) $(DEFINES) $(ACFLAGS) -SRCS = main.c -OBJS = $(SRCS:.c=.o) -LIBS = -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -all: saucer - -saucer: $(OBJS) - $(CC) $(ALDFLAGS) -o $@ $(OBJS) -L$(LDIR) $(LIBS) - -protoize: $(SRCS) - protoize -c "$(CFLAGS)" $(SRCS) - -unprotoize: $(SRCS) - unprotoize -c "$(CFLAGS)" $(SRCS) - -install: saucer FORCE - -$(MKDIR) -p $(LDAP_BINDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 saucer $(LDAP_BINDIR) - -$(MKDIR) -p $(LDAP_MANDIR) - @TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \ - VERSION=`$(CAT) $(VERFILE)`; \ - for page in *.$(SECT); do \ - $(SED) -e 's%ETCDIR%$(LDAP_ETCDIR)%' -e "s%LDVERSION%$$VERSION%" \ - $$page | $(MANCOMPRESS) > $$TMPMAN; \ - echo "installing $(INSTMAN)/$$page"; \ - $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(LDAP_INSTMAN)/$$page$(MANCOMPRESSSUFFIX); \ - done; \ - $(RM) $$TMPMAN - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) *.o core a.out saucer - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/*.[ch] . - diff --git a/doc/Make-template b/doc/Make-template deleted file mode 100644 index 6ed4c5d2aa..0000000000 --- a/doc/Make-template +++ /dev/null @@ -1,95 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP doc Makefile -# -#----------------------------------------------------------------------------- - -############################################################################ -# # -# You should not have to edit anything below this point # -# # -############################################################################ - -all: FORCE - @echo "making all in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" -a -f $$i/Makefile ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ - ( cd $$i; $(MAKE) $(MFLAGS) all ); \ - fi; \ - done - - -install: FORCE - @echo "making install in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" -a -f $$i/Makefile ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ - ( cd $$i; $(MAKE) $(MFLAGS) install ); \ - fi; \ - done - - -clean: FORCE - @echo "making clean in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" -a -f $$i/Makefile ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ - fi; \ - done - - -veryclean: clean - - -depend: FORCE - @echo "making depend in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" -a -f $$i/Makefile ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ - ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ - fi; \ - done - - -lint: FORCE - @echo "making lint in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" -a -f $$i/Makefile ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) lint"; \ - ( cd $$i; $(MAKE) $(MFLAGS) lint ); \ - fi; \ - done - - -5lint: FORCE - @echo "making 5lint in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" -a -f $$i/Makefile ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) 5lint"; \ - ( cd $$i; $(MAKE) $(MFLAGS) 5lint ); \ - fi; \ - done - - -links: - @echo "making links in `$(PWD)`"; \ - for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/CVS" ]; then \ - d=`basename $$i`; \ - ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ - $(LN) ../.src/$$d/Make-template . ; \ - $(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \ - -f Make-template links ) ; \ - fi; \ - done diff --git a/doc/Makefile.in b/doc/Makefile.in new file mode 100644 index 0000000000..c349a064e4 --- /dev/null +++ b/doc/Makefile.in @@ -0,0 +1,6 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## doc Makefile.in for OpenLDAP + +SUBDIRS= man diff --git a/doc/guides/Make-template b/doc/guides/Make-template deleted file mode 100644 index f54d68ac70..0000000000 --- a/doc/guides/Make-template +++ /dev/null @@ -1,29 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP doc/guides makefile -# -#----------------------------------------------------------------------------- - -all: FORCE - -install: FORCE - -lint: FORCE - -5lint: FORCE - -clean: FORCE - -depend: FORCE - -links: - @$(LN) .src/*.txt . diff --git a/doc/man/Make-template b/doc/man/Make-template deleted file mode 100644 index 8d7f5bf1fa..0000000000 --- a/doc/man/Make-template +++ /dev/null @@ -1,84 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP doc/man makefile -# -#----------------------------------------------------------------------------- - -############################################################################ -# # -# You should not have to edit anything below this point # -# # -############################################################################ - -all: FORCE - @echo "making all in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ - ( cd $$i; $(MAKE) $(MFLAGS) all ); \ - fi; \ - done - - -# -# rules to install the software -# - -install: FORCE - @echo "making install in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ - ( cd $$i; $(MAKE) $(MFLAGS) install ); \ - fi; \ - done - -# -# rules to make clean -# - -clean: FORCE - @echo "making clean in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ - fi; \ - done - -veryclean: clean - -# -# rules to make depend -# -# - -depend: FORCE - @echo "making depend in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ - ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ - fi; \ - done - -links: - @echo "making links in `$(PWD)`"; \ - for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/CVS" ]; then \ - d=`basename $$i`; \ - ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ - $(LN) ../.src/$$d/Make-template . ; \ - $(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \ - -f Make-template links ) ; \ - fi; \ - done diff --git a/doc/man/Makefile.in b/doc/man/Makefile.in new file mode 100644 index 0000000000..662e4a4c88 --- /dev/null +++ b/doc/man/Makefile.in @@ -0,0 +1,6 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## man Makefile.in for OpenLDAP + +SUBDIRS= man1 man3 man5 man8 diff --git a/doc/man/man1/Make-template b/doc/man/man1/Make-template deleted file mode 100644 index b3e63181a2..0000000000 --- a/doc/man/man1/Make-template +++ /dev/null @@ -1,56 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP man1 makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC= ../../.. -SECT=1 -INSTDIR=$(LDAP_MANDIR)/man$(SECT) -VERSIONFILE = $(LDAPSRC)/build/version - -all: FORCE - -install: FORCE - -$(MKDIR) -p $(INSTDIR) - @TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \ - VERSION=`$(CAT) $(VERSIONFILE)`; \ - for page in *.$(SECT); do \ - $(SED) -e "s%LDVERSION%$$VERSION%" \ - -e 's%ETCDIR%$(LDAP_ETCDIR)%' \ - -e 's%SBINDIR%$(LDAP_SBINDIR)%' \ - -e 's%BINDIR%$(LDAP_BINDIR)%' \ - -e 's%LIBEXECDIR%$(LDAP_LIBEXECDIR)%' \ - $$page | $(MANCOMPRESS) > $$TMPMAN; \ - echo "installing $(INSTDIR)/$$page"; \ - $(RM) $(INSTDIR)/$$page $(INSTDIR)/$$page$(MANCOMPRESSSUFFIX); \ - $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page$(MANCOMPRESSSUFFIX); \ - if [ -f "$$page.links" ]; then \ - for link in `$(CAT) $$page.links`; do \ - echo "installing $(INSTDIR)/$$link as link to $$page"; \ - $(RM) $(INSTDIR)/$$link $(INSTDIR)/$$link$(MANCOMPRESSSUFFIX); \ - ln -sf $$page$(MANCOMPRESSSUFFIX) $(INSTDIR)/$$link$(MANCOMPRESSSUFFIX); \ - done; \ - fi; \ - done; \ - $(RM) $$TMPMAN - -clean: FORCE - -depend: FORCE - -lint: FORCE - -5lint: FORCE - -links: - @$(LN) .src/*.$(SECT) .src/*links . diff --git a/doc/man/man1/Makefile.in b/doc/man/man1/Makefile.in new file mode 100644 index 0000000000..a257cd6dda --- /dev/null +++ b/doc/man/man1/Makefile.in @@ -0,0 +1,6 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## man1 Makefile.in for OpenLDAP + +MANSECT=1 diff --git a/doc/man/man1/ldapdelete.1 b/doc/man/man1/ldapdelete.1 index ea2f4726c2..43ae6033ee 100644 --- a/doc/man/man1/ldapdelete.1 +++ b/doc/man/man1/ldapdelete.1 @@ -1,4 +1,4 @@ -.TH LDAPDELETE 1 "13 November 1995" "U-M LDAP LDVERSION" +.TH LDAPDELETE 1 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldapdelete \- ldap delete entry tool .SH SYNOPSIS @@ -107,3 +107,8 @@ Kille, S., ISODE Consortium, March 1995. .SH BUGS There is no interactive mode, but there probably should be. +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man1/ldapmodify.1 b/doc/man/man1/ldapmodify.1 index 3ffbe59a92..679f672a27 100644 --- a/doc/man/man1/ldapmodify.1 +++ b/doc/man/man1/ldapmodify.1 @@ -1,4 +1,4 @@ -.TH LDAPMODIFY 1 "13 November 1995" "U-M LDAP LDVERSION" +.TH LDAPMODIFY 1 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldapmodify, ldapadd \- ldap modify entry and ldap add entry tools .SH SYNOPSIS @@ -299,3 +299,8 @@ Kille, S., ISODE Consortium, March 1995. .SH BUGS There is no interactive mode, but there probably should be. +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man1/ldapmodrdn.1 b/doc/man/man1/ldapmodrdn.1 index 8468e7a4e5..86d76655bd 100644 --- a/doc/man/man1/ldapmodrdn.1 +++ b/doc/man/man1/ldapmodrdn.1 @@ -1,4 +1,4 @@ -.TH LDAPMODRDN 1 "13 November 1995" "U-M LDAP LDVERSION" +.TH LDAPMODRDN 1 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldapmodrdn \- ldap modify entry RDN tool .SH SYNOPSIS @@ -130,3 +130,8 @@ Kille, S., ISODE Consortium, March 1995. .SH BUGS There is no interactive mode, but there probably should be. +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man1/ldapsearch.1 b/doc/man/man1/ldapsearch.1 index 2d66334d80..84facf394d 100644 --- a/doc/man/man1/ldapsearch.1 +++ b/doc/man/man1/ldapsearch.1 @@ -1,4 +1,4 @@ -.TH LDAPSEARCH 1 "29 March 1996" "U-M LDAP LDVERSION" +.TH LDAPSEARCH 1 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldapsearch \- ldap search tool .SH SYNOPSIS @@ -289,3 +289,8 @@ Howes, T., .SM RFC 1558, University of Michigan, December 1993. +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man1/ud.1 b/doc/man/man1/ud.1 index 43284a7f74..1c74bf8f35 100644 --- a/doc/man/man1/ud.1 +++ b/doc/man/man1/ud.1 @@ -1,4 +1,4 @@ -.TH UD 1 "18 March 1993" "U-M LDAP LDVERSION" +.TH UD 1 "22 September 1998" "OpenLDAP LDVERSION" .UC 6 .SH NAME ud \- interactive X.500 Directory Server query program @@ -71,3 +71,8 @@ uses the ldap_perror() routine to print an informative diagnostic. Too numerous to mention. .SH AUTHOR Bryan Beecher, University of Michigan +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/Make-template b/doc/man/man3/Make-template deleted file mode 100644 index 233699ac43..0000000000 --- a/doc/man/man3/Make-template +++ /dev/null @@ -1,56 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP man3 makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC= ../../.. -SECT=3 -INSTDIR=$(LDAP_MANDIR)/man$(SECT) -VERSIONFILE = $(LDAPSRC)/build/version - -all: FORCE - -install: FORCE - -$(MKDIR) -p $(INSTDIR) - @TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \ - VERSION=`$(CAT) $(VERSIONFILE)`; \ - for page in *.$(SECT); do \ - $(SED) -e "s%LDVERSION%$$VERSION%" \ - -e 's%ETCDIR%$(LDAP_ETCDIR)%' \ - -e 's%SBINDIR%$(LDAP_SBINDIR)%' \ - -e 's%BINDIR%$(LDAP_BINDIR)%' \ - -e 's%LIBEXECDIR%$(LDAP_LIBEXECDIR)%' \ - $$page | $(MANCOMPRESS) > $$TMPMAN; \ - echo "installing $(INSTDIR)/$$page"; \ - $(RM) $(INSTDIR)/$$page $(INSTDIR)/$$page$(MANCOMPRESSSUFFIX); \ - $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page$(MANCOMPRESSSUFFIX); \ - if [ -f "$$page.links" ]; then \ - for link in `$(CAT) $$page.links`; do \ - echo "installing $(INSTDIR)/$$link as link to $$page"; \ - $(RM) $(INSTDIR)/$$link $(INSTDIR)/$$link$(MANCOMPRESSSUFFIX); \ - ln -sf $$page$(MANCOMPRESSSUFFIX) $(INSTDIR)/$$link$(MANCOMPRESSSUFFIX); \ - done; \ - fi; \ - done; \ - $(RM) $$TMPMAN - -clean: FORCE - -depend: FORCE - -lint: FORCE - -5lint: FORCE - -links: - @$(LN) .src/*.$(SECT) .src/*links . diff --git a/doc/man/man3/Makefile.in b/doc/man/man3/Makefile.in new file mode 100644 index 0000000000..23c961b3c3 --- /dev/null +++ b/doc/man/man3/Makefile.in @@ -0,0 +1,6 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## man3 Makefile.in for OpenLDAP + +MANSECT=3 diff --git a/doc/man/man3/cldap_close.3 b/doc/man/man3/cldap_close.3 index 7896ba0923..fae64eac3a 100644 --- a/doc/man/man3/cldap_close.3 +++ b/doc/man/man3/cldap_close.3 @@ -1,4 +1,4 @@ -.TH CLDAP_CLOSE 3 "18 November 1994" "U-M LDAP LDVERSION" +.TH CLDAP_CLOSE 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME cldap_close \- Dispose of Connectionless LDAP Pointer .SH SYNOPSIS @@ -28,3 +28,8 @@ returned by a previous call to .BR cldap_open (3), .BR cldap_search_s (3), .BR cldap_setretryinfo (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/cldap_open.3 b/doc/man/man3/cldap_open.3 index 738bda2324..131bae6eaa 100644 --- a/doc/man/man3/cldap_open.3 +++ b/doc/man/man3/cldap_open.3 @@ -1,4 +1,4 @@ -.TH CLDAP_OPEN 3 "18 November 1994" "U-M LDAP LDVERSION" +.TH CLDAP_OPEN 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME cldap_open \- Prepare for Connectionless LDAP Communication .SH SYNOPSIS @@ -51,3 +51,8 @@ will return NULL and errno will be set appropriately. .BR cldap_setretryinfo (3), .BR cldap_close (3), .BR udp (4p) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/cldap_search_s.3 b/doc/man/man3/cldap_search_s.3 index 1c4da546f9..48b18fbaf1 100644 --- a/doc/man/man3/cldap_search_s.3 +++ b/doc/man/man3/cldap_search_s.3 @@ -1,4 +1,4 @@ -.TH CLDAP_SEARCH_S 3 "18 November 1994" "U-M LDAP LDVERSION" +.TH CLDAP_SEARCH_S 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME cldap_search_s \- Connectionless LDAP Search .SH SYNOPSIS @@ -103,3 +103,8 @@ for more information. .BR cldap_setretryinfo (3), .BR cldap_close (3), .BR udp (4p) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/cldap_setretryinfo.3 b/doc/man/man3/cldap_setretryinfo.3 index 55ef67159d..80d510e115 100644 --- a/doc/man/man3/cldap_setretryinfo.3 +++ b/doc/man/man3/cldap_setretryinfo.3 @@ -1,4 +1,4 @@ -.TH CLDAP_SETRETRYINFO 3 "18 November 1994" "U-M LDAP LDVERSION" +.TH CLDAP_SETRETRYINFO 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME cldap_setretryinfo \- Set Connectionless LDAP Request Retransmission Parameters .SH SYNOPSIS @@ -40,3 +40,8 @@ algorithm used. .BR cldap_open (3), .BR cldap_search_s (3), .BR cldap_close (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/lber-decode.3 b/doc/man/man3/lber-decode.3 index e05fb33c4b..e885337a38 100644 --- a/doc/man/man3/lber-decode.3 +++ b/doc/man/man3/lber-decode.3 @@ -1,4 +1,4 @@ -.TH LBER-DECODE 3 "18 November 1994" +.TH LBER_DECODE 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ber_get_next, ber_skiptag, ber_peek_tag, ber_scanf, ber_get_int, ber_get_stringb, ber_get_stringa, ber_get_null, ber_get_boolean, ber_get_bitstring, ber_first_element, ber_next_element \- LBER simplified Basic Encoding Rules library routines for decoding .SH SYNOPSIS @@ -356,3 +356,8 @@ Syntax Notation One, International Organization for Standardization, International Standard 8825. .SH AUTHOR Tim Howes, University of Michigan +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/lber-encode.3 b/doc/man/man3/lber-encode.3 index 01304810b7..7d6806b245 100644 --- a/doc/man/man3/lber-encode.3 +++ b/doc/man/man3/lber-encode.3 @@ -1,4 +1,4 @@ -.TH LBER-ENCODE 3 "15 June 1992" +.TH LBER_ENCODE 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ber_alloc, ber_flush, ber_printf, ber_put_int, ber_put_ostring, ber_put_string, ber_put_null, ber_put_boolean, ber_put_bitstring, ber_start_seq, ber_start_set, ber_put_seq, ber_put_set \- LBER simplified Basic Encoding Rules library routines for encoding .SH SYNOPSIS @@ -313,3 +313,8 @@ Syntax Notation One, International Organization for Standardization, International Standard 8825. .SH AUTHOR Tim Howes, University of Michigan +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap.3 b/doc/man/man3/ldap.3 index 8f2c20e9e0..53d3a68213 100644 --- a/doc/man/man3/ldap.3 +++ b/doc/man/man3/ldap.3 @@ -1,4 +1,4 @@ -.TH LDAP 3 "13 November 1995" "U-M LDAP LDVERSION" +.TH LDAP 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap - Lightweight Directory Access Protocol package .SH SYNOPSIS @@ -499,3 +499,8 @@ terminate a connectionless LDAP session .SH AUTHORS Tim Howes, Mark Smith, Gordon Good, Lance Sloan, and Steve Rothwell from the University of Michigan, along with help from lots of others. +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_abandon.3 b/doc/man/man3/ldap_abandon.3 index 770513cb3d..080f77e73b 100644 --- a/doc/man/man3/ldap_abandon.3 +++ b/doc/man/man3/ldap_abandon.3 @@ -1,4 +1,4 @@ -.TH LDAP_ABANDON 3 "1 December 1994" "U-M LDAP LDVERSION" +.TH LDAP_ABANDON 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_abandon \- Abandon an LDAP operation in progress .SH SYNOPSIS @@ -40,3 +40,8 @@ for details. .BR ldap(3), .BR ldap_result(3), .B ldap_error(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_add.3 b/doc/man/man3/ldap_add.3 index 85290ad94e..9c1460406a 100644 --- a/doc/man/man3/ldap_add.3 +++ b/doc/man/man3/ldap_add.3 @@ -1,4 +1,4 @@ -.TH LDAP_ADD 3 "15 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_ADD 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_add, ldap_add_s \- Perform an LDAP add operation .SH SYNOPSIS @@ -58,3 +58,8 @@ directly (LDAP_SUCCESS if everything went ok, some error otherwise). .SH SEE ALSO .BR ldap(3), .B ldap_modify(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_bind.3 b/doc/man/man3/ldap_bind.3 index c172b28c3a..7f4540d4ce 100644 --- a/doc/man/man3/ldap_bind.3 +++ b/doc/man/man3/ldap_bind.3 @@ -1,4 +1,4 @@ -.TH LDAP_BIND 3 "28 March 1996" "U-M LDAP LDVERSION" +.TH LDAP_BIND 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_bind, ldap_bind_s, ldap_simple_bind, ldap_simple_bind_s, ldap_kerberos_bind_s, ldap_kerberos_bind1, ldap_kerberos_bind1_s, ldap_kerberos_bind2, ldap_kerberos_bind2_s, ldap_unbind, ldap_unbind_s, ldap_set_rebind_proc \- LDAP bind routines .SH SYNOPSIS @@ -194,3 +194,8 @@ for more information. .BR ldap(3), .BR ldap_error(3), .BR ldap_open(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_cache.3 b/doc/man/man3/ldap_cache.3 index fbc8b0fcb0..b6cd00c20b 100644 --- a/doc/man/man3/ldap_cache.3 +++ b/doc/man/man3/ldap_cache.3 @@ -1,4 +1,4 @@ -.TH LDAP_CACHE 3 "14 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_CACHE 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_enable_cache, ldap_disable_cache, ldap_destroy_cache, ldap_flush_cache, ldap_uncache_entry, ldap_uncache_request, ldap_set_cache_options \- LDAP client caching routines .SH SYNOPSIS @@ -115,3 +115,8 @@ void and return nothing. .BR ldap_search (3), .BR ldap_compare (3), .BR cldap_search_s (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_charset.3 b/doc/man/man3/ldap_charset.3 index c926b07e6a..7cad320fee 100644 --- a/doc/man/man3/ldap_charset.3 +++ b/doc/man/man3/ldap_charset.3 @@ -1,4 +1,4 @@ -.TH LDAP_CHARSET 3 "28 March 1996" "U-M LDAP LDVERSION" +.TH LDAP_CHARSET 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_set_string_translators, ldap_t61_to_8859, @@ -125,3 +125,8 @@ For example, you would not want to translate a binary attributes such as jpegPhoto. .SH SEE ALSO .BR ldap (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_compare.3 b/doc/man/man3/ldap_compare.3 index 3df8ca9c6b..7edf1b2684 100644 --- a/doc/man/man3/ldap_compare.3 +++ b/doc/man/man3/ldap_compare.3 @@ -1,4 +1,4 @@ -.TH LDAP_COMPARE 3 "15 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_COMPARE 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_compare, ldap_compare_s \- Perform an LDAP compare operation .SH SYNOPSIS @@ -49,3 +49,8 @@ There is no way to compare binary values, but there should be. .SH SEE ALSO .BR ldap(3), .BR ldap_error(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_delete.3 b/doc/man/man3/ldap_delete.3 index 3149890d84..c978e1abf4 100644 --- a/doc/man/man3/ldap_delete.3 +++ b/doc/man/man3/ldap_delete.3 @@ -1,4 +1,4 @@ -.TH LDAP_DELETE 3 "15 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_DELETE 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_delete, ldap_delete_s \- Perform an LDAP delete operation .SH SYNOPSIS @@ -46,3 +46,8 @@ non-negative message id of the request if things went ok. .SH SEE ALSO .BR ldap(3), .BR ldap_error(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_disptmpl.3 b/doc/man/man3/ldap_disptmpl.3 index 03c1e656ec..d8f918d61b 100644 --- a/doc/man/man3/ldap_disptmpl.3 +++ b/doc/man/man3/ldap_disptmpl.3 @@ -1,4 +1,4 @@ -.TH LDAP_DISPTMPL 3 "13 December 1994" "U-M LDAP LDVERSION" +.TH LDAP_DISPTMPL 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_init_templates, ldap_init_templates_buf, ldap_free_templates, ldap_first_disptmpl, ldap_next_disptmpl, ldap_oc2template, ldap_tmplattrs, ldap_first_tmplrow, ldap_next_tmplrow, ldap_first_tmplcol, ldap_next_tmplcol, \- LDAP display template routines .SH SYNOPSIS @@ -448,3 +448,8 @@ upon error. .BR ldap (3), .BR ldap_entry2text (3), .BR ldaptemplates.conf (5) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_entry2text.3 b/doc/man/man3/ldap_entry2text.3 index 54454253a1..381bc925b9 100644 --- a/doc/man/man3/ldap_entry2text.3 +++ b/doc/man/man3/ldap_entry2text.3 @@ -1,4 +1,4 @@ -.TH LDAP_ENTRY2TEXT 3 "13 November 1994" "U-M LDAP %LDVERSION%" +.TH LDAP_ENTRY2TEXT 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_entry2text, ldap_entry2text_search, ldap_vals2text \- LDAP entry display routines .SH SYNOPSIS @@ -324,3 +324,8 @@ ETCDIR/ldaptemplates.conf .BR ldap (3), .BR ldap_disptmpl (3), .BR ldaptemplates.conf (5) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_error.3 b/doc/man/man3/ldap_error.3 index c517b7e6e3..8d3b9b68d8 100644 --- a/doc/man/man3/ldap_error.3 +++ b/doc/man/man3/ldap_error.3 @@ -1,4 +1,4 @@ -.TH LDAP_ERROR 3 "15 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_ERROR 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_perror, ld_errno, ldap_result2error, ldap_errlist, ldap_err2string \- LDAP protocol error handling routines .SH SYNOPSIS @@ -217,3 +217,8 @@ library routine. .SH SEE ALSO .BR ldap(3), .BR perror(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_first_attribute.3 b/doc/man/man3/ldap_first_attribute.3 index 452a928bf1..8646ed364d 100644 --- a/doc/man/man3/ldap_first_attribute.3 +++ b/doc/man/man3/ldap_first_attribute.3 @@ -1,4 +1,4 @@ -.TH LDAP_FIRST_ATTRIBUTE 3 "25 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_FIRST_ATTRIBUTE 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_first_attribute, ldap_next_attribute \- step through LDAP entry attributes .SH SYNOPSIS @@ -77,3 +77,8 @@ be freed by the caller via .BR ldap_first_entry(3), .BR ldap_get_values(3), .BR ldap_error(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_first_entry.3 b/doc/man/man3/ldap_first_entry.3 index 368ad0ffff..7f6c58c37c 100644 --- a/doc/man/man3/ldap_first_entry.3 +++ b/doc/man/man3/ldap_first_entry.3 @@ -1,4 +1,4 @@ -.TH LDAP_FIRST_ENTRY 3 "25 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_FIRST_ENTRY 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_first_entry, ldap_next_entry, ldap_count_entries \- LDAP result entry parsing and counting routines .SH SYNOPSIS @@ -81,3 +81,8 @@ for a description of possible error codes. .BR ldap_first_attribute(3), .BR ldap_get_values(3), .BR ldap_get_dn(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_friendly.3 b/doc/man/man3/ldap_friendly.3 index 1cf254b475..889cd5b132 100644 --- a/doc/man/man3/ldap_friendly.3 +++ b/doc/man/man3/ldap_friendly.3 @@ -1,4 +1,4 @@ -.TH LDAP_FRIENDLY 3 "11 October 1993" "U-M LDAP LDVERSION" +.TH LDAP_FRIENDLY 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_friendly_name, ldap_free_friendlymap \- LDAP unfriendly to friendly name mapping routine .SH SYNOPSIS @@ -66,3 +66,8 @@ format, or if the \fImap\fP parameter is NULL. ETCDIR/ldapfriendly.conf .SH SEE ALSO .BR ldap (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_get_dn.3 b/doc/man/man3/ldap_get_dn.3 index 55530fcbd4..0536578e74 100644 --- a/doc/man/man3/ldap_get_dn.3 +++ b/doc/man/man3/ldap_get_dn.3 @@ -1,4 +1,4 @@ -.TH LDAP_GET_DN 3 "16 June 1995" "U-M LDAP LDVERSION" +.TH LDAP_GET_DN 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_get_dn, ldap_explode_dn, ldap_dn2ufn, ldap_is_dns_dn, ldap_explode_dns \- LDAP DN handling routines .SH SYNOPSIS @@ -114,3 +114,8 @@ These routines malloc memory that the caller must free. .BR ldap_first_entry(3), .BR ldap_error(3), .BR ldap_value_free(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_get_values.3 b/doc/man/man3/ldap_get_values.3 index ac0dcdb6b3..794b172aee 100644 --- a/doc/man/man3/ldap_get_values.3 +++ b/doc/man/man3/ldap_get_values.3 @@ -1,4 +1,4 @@ -.TH LDAP_GET_VALUES 3 "25 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_GET_VALUES 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_get_values, ldap_get_values_len, ldap_count_values \- LDAP attribute value handling routines .SH SYNOPSIS @@ -97,3 +97,8 @@ These routines malloc memory that the caller must free. .BR ldap_first_entry(3), .BR ldap_first_attribute(3), .BR ldap_error(3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_getfilter.3 b/doc/man/man3/ldap_getfilter.3 index 67a8df3ccd..c2562731e8 100644 --- a/doc/man/man3/ldap_getfilter.3 +++ b/doc/man/man3/ldap_getfilter.3 @@ -1,4 +1,4 @@ -.TH LDAP_GETFILTER 3 "28 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_GETFILTER 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_init_getfilter, ldap_init_getfilter_buf, ldap_getfilter_free, ldap_getfirstfilter, ldap_getnextfilter, ldap_build_filter \- LDAP filter generating routines @@ -191,3 +191,8 @@ ETCDIR/ldapfilter.conf .SH SEE ALSO .BR ldap (3), .BR ldapfilter.conf (5) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_modify.3 b/doc/man/man3/ldap_modify.3 index baf71a3736..8e265e63f6 100644 --- a/doc/man/man3/ldap_modify.3 +++ b/doc/man/man3/ldap_modify.3 @@ -1,4 +1,4 @@ -.TH LDAP_MODIFY 3 "15 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_MODIFY 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_modify, ldap_modify_s \- Perform an LDAP modify operation .SH SYNOPSIS @@ -111,3 +111,8 @@ field of \fIld\fP. .BR ldap (3), .BR ldap_error (3), .BR ldap_add (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_modrdn.3 b/doc/man/man3/ldap_modrdn.3 index 1b382758f1..9c97385d2c 100644 --- a/doc/man/man3/ldap_modrdn.3 +++ b/doc/man/man3/ldap_modrdn.3 @@ -1,4 +1,4 @@ -.TH LDAP_MODRDN 3 "1 December 1994" "U-M LDAP LDVERSION" +.TH LDAP_MODRDN 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_modrdn, ldap_modrdn_s, ldap_modrdn2, ldap_modrdn2_s \- Perform an LDAP modify RDN operation .SH SYNOPSIS @@ -73,3 +73,8 @@ for more details. .SH SEE ALSO .BR ldap (3), .BR ldap_error (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_open.3 b/doc/man/man3/ldap_open.3 index 746e66509a..7c19bc9b12 100644 --- a/doc/man/man3/ldap_open.3 +++ b/doc/man/man3/ldap_open.3 @@ -1,4 +1,4 @@ -.TH LDAP_OPEN 3 "28 March 1996" "U-M LDAP LDVERSION" +.TH LDAP_OPEN 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_init, ldap_open \- Initialize the LDAP library and open a connection to an LDAP server .SH SYNOPSIS @@ -111,3 +111,8 @@ in the LDAP structure. .BR ldap (3), .BR ldap_bind (3), .BR errno (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_result.3 b/doc/man/man3/ldap_result.3 index 306e8be44c..4a3039b896 100644 --- a/doc/man/man3/ldap_result.3 +++ b/doc/man/man3/ldap_result.3 @@ -1,4 +1,4 @@ -.TH LDAP_RESULT 3 "26 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_RESULT 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_result \- Wait for the result of an LDAP operation .SH SYNOPSIS @@ -104,3 +104,8 @@ can be freed by calling .BR ldap (3), .BR ldap_search (3), .BR select (2) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_search.3 b/doc/man/man3/ldap_search.3 index e1a7022bcd..8a149aa9b6 100644 --- a/doc/man/man3/ldap_search.3 +++ b/doc/man/man3/ldap_search.3 @@ -1,4 +1,4 @@ -.TH LDAP_SEARCH 3 "23 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_SEARCH 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_search, ldap_search_s, ldap_search_st \- Perform an LDAP search operation .SH SYNOPSIS @@ -114,3 +114,8 @@ in . .BR ldap_result (3), .BR ldap_getfilter (3), .BR ldap_error (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_searchprefs.3 b/doc/man/man3/ldap_searchprefs.3 index 98b6e78d77..f33ff61ce2 100644 --- a/doc/man/man3/ldap_searchprefs.3 +++ b/doc/man/man3/ldap_searchprefs.3 @@ -1,4 +1,4 @@ -.TH SEARCHPREFS 3 "13 June 1994" "U-M LDAP LDVERSION" +.TH SEARCHPREFS 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_init_searchprefs, ldap_init_searchprefs_buf, ldap_free_searchprefs, ldap_first_searchobj, ldap_next_searchobj \- LDAP search preference configuration routeines .SH SYNOPSIS @@ -156,3 +156,8 @@ OSI-DS-23, April 1992. Information Processing - Open Systems Interconnection - The Directory, International Organization for Standardization. International Standard 9594, (1988). +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_sort.3 b/doc/man/man3/ldap_sort.3 index f56122af0b..2f2c173f54 100644 --- a/doc/man/man3/ldap_sort.3 +++ b/doc/man/man3/ldap_sort.3 @@ -1,4 +1,4 @@ -.TH LDAP_SORT 3 "14 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_SORT 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_sort_entries, ldap_sort_values, ldap_sort_strcasecmp \- LDAP sorting routines .SH SYNOPSIS @@ -99,3 +99,8 @@ The return values for all of these functions are declared in the .BR ldap_search (3), .BR ldap_result (3), .BR qsort (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_ufn.3 b/doc/man/man3/ldap_ufn.3 index 6fe1a5123d..f2db01d764 100644 --- a/doc/man/man3/ldap_ufn.3 +++ b/doc/man/man3/ldap_ufn.3 @@ -1,4 +1,4 @@ -.TH LDAP_UFN 3 "23 November 1994" "U-M LDAP LDVERSION" +.TH LDAP_UFN 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_ufn_search_s, ldap_ufn_search_c, ldap_ufn_search_ct, ldap_ufn_setfilter, ldap_ufn_setfilter, ldap_ufn_setprefix, ldap_ufn_timeout \- Perform an LDAP user friendly search operation .SH SYNOPSIS @@ -128,3 +128,8 @@ in . .BR ldap_getfilter (3), .BR ldapfilter.conf (5), .BR ldap_error (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/ldap_url.3 b/doc/man/man3/ldap_url.3 index 7e04bcc337..f4debb98bc 100644 --- a/doc/man/man3/ldap_url.3 +++ b/doc/man/man3/ldap_url.3 @@ -1,4 +1,4 @@ -.TH LDAP_URL 3 "28 March 1996" "U-M LDAP LDVERSION" +.TH LDAP_URL 3 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldap_is_ldap_url, ldap_url_parse, @@ -134,3 +134,8 @@ Currently available at this URL: .nf ftp://ds.internic.net/internet-drafts/draft-ietf-asid-ldap-format-03.txt .fi +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man3/regex.3 b/doc/man/man3/regex.3 deleted file mode 100644 index ba9cc388bd..0000000000 --- a/doc/man/man3/regex.3 +++ /dev/null @@ -1,326 +0,0 @@ -.TH regex 3 local -.DA Jun 19 1986 -.SH NAME -re_comp, re_exec, re_subs, re_modw, re_fail \- regular expression handling -.SH ORIGIN -Dept. of Computer Science -.br -York University -.SH SYNOPSIS -.B char *re_comp(pat) -.br -.B char *pat; -.PP -.B re_exec(str) -.br -.B char *str; -.PP -.B re_subs(src, dst) -.br -.B char *src; -.br -.B char *dst; -.PP -.B void re_fail(msg, op) -.br -.B char *msg; -.br -.B char op; -.PP -.B void re_modw(str) -.br -.B char *str; - -.SH DESCRIPTION -.PP -These functions implement -.IR ed (1)-style -partial regular expressions and supporting facilities. -.PP -.I Re_comp -compiles a pattern string into an internal form (a deterministic finite-state -automaton) to be executed by -.I re_exec -for pattern matching. -.I Re_comp -returns 0 if the pattern is compiled successfully, otherwise it returns an -error message string. If -.I re_comp -is called with a 0 or a \fInull\fR string, it returns without changing the -currently compiled regular expression. -.sp -.I Re_comp -supports the same limited set of -.I regular expressions -found in -.I ed -and Berkeley -.IR regex (3) -routines: -.sp -.if n .in +1.6i -.if t .in +1i -.de Ti -.if n .ti -1.6i -.if t .ti -1i -.. -.if n .ta 0.8i +0.8i +0.8i -.if t .ta 0.5i +0.5i +0.5i -.Ti -[1] \fIchar\fR Matches itself, unless it is a special -character (meta-character): \fB. \\ [ ] * + ^ $\fR - -.Ti -[2] \fB.\fR Matches \fIany\fR character. - -.Ti -[3] \fB\\\fR Matches the character following it, except -when followed by a digit 1 to 9, \fB(\fR, fB)\fR, \fB<\fR or \fB>\fR. -(see [7], [8] and [9]) It is used as an escape character for all -other meta-characters, and itself. When used -in a set ([4]), it is treated as an ordinary -character. - -.Ti -[4] \fB[\fIset\fB]\fR Matches one of the characters in the set. -If the first character in the set is \fB^\fR, -it matches a character NOT in the set. A -shorthand -.IR S - E -is used to specify a set of -characters -.I S -up to -.IR E , -inclusive. The special -characters \fB]\fR and \fB-\fR have no special -meaning if they appear as the first chars -in the set. -.nf - examples: match: - [a-z] any lowercase alpha - [^]-] any char except ] and - - [^A-Z] any char except - uppercase alpha - [a-zA-Z0-9] any alphanumeric -.fi - -.Ti -[5] \fB*\fR Any regular expression form [1] to [4], followed by -closure char (*) matches zero or more matches of -that form. - -.Ti -[6] \fB+\fR Same as [5], except it matches one or more. - -.Ti -[7] A regular expression in the form [1] to [10], enclosed -as \\(\fIform\fR\\) matches what form matches. The enclosure -creates a set of tags, used for [8] and for -pattern substitution in -.I re_subs. -The tagged forms are numbered -starting from 1. - -.Ti -[8] A \\ followed by a digit 1 to 9 matches whatever a -previously tagged regular expression ([7]) matched. - -.Ti -[9] \fB\\<\fR Matches the beginning of a \fIword\fR, -that is, an empty string followed by a -letter, digit, or _ and not preceded by -a letter, digit, or _ . -.Ti - \fB\\>\fR Matches the end of a \fIword\fR, -that is, an empty string preceded -by a letter, digit, or _ , and not -followed by a letter, digit, or _ . - -.Ti -[10] A composite regular expression -\fIxy\fR where \fIx\fR and \fIy\fR -are in the form of [1] to [10] matches the longest -match of \fIx\fR followed by a match for \fIy\fR. - -.Ti -[11] \fB^ $\fR a regular expression starting with a \fB^\fR character -and/or ending with a \fB$\fR character, restricts the -pattern matching to the beginning of the line, -and/or the end of line [anchors]. Elsewhere in the -pattern, \fB^\fR and \fB$\fR are treated as ordinary characters. -.if n .in -1.6i -.if t .in -1i - -.PP -.I Re_exec -executes the internal form produced by -.I re_comp -and searches the argument string for the regular expression described -by the internal -form. -.I Re_exec -returns 1 if the last regular expression pattern is matched within the string, -0 if no match is found. In case of an internal error (corrupted internal -form), -.I re_exec -calls the user-supplied -.I re_fail -and returns 0. -.PP -The strings passed to both -.I re_comp -and -.I re_exec -may have trailing or embedded newline characters. The strings -must be terminated by nulls. -.PP -.I Re_subs -does -.IR ed -style -pattern substitution, after a successful match is found by -.I re_exec. -The source string parameter to -.I re_subs -is copied to the destination string with the following interpretation; -.sp -.if n .in +1.6i -.if t .in +1i -.Ti -[1] & Substitute the entire matched string in the destination. - -.Ti -[2] \\\fIn\fR Substitute the substring matched by a tagged subpattern -numbered \fIn\fR, where \fIn\fR is between 1 to 9, inclusive. - -.Ti -[3] \\\fIchar\fR Treat the next character literally, -unless the character is a digit ([2]). -.if n .in -1.6i -.if t .in -1i - -.PP -If the copy operation with the substitutions is successful, -.I re_subs -returns 1. -If the source string is corrupted, or the last call to -.I re_exec -fails, it returns 0. - -.I Re_modw -is used to -add new characters into an internal table to -change the re_exec's understanding of what -a \fIword\fR should look like, when matching with \fB\\<\fR and \fB\\>\fR -constructs. If the string parameter is 0 or null string, -the table is reset back to the default, which contains \fBA-Z a-z 0-9 _\fR . - -.I Re_fail -is a user-supplied routine to handle internal errors. -.I re_exec -calls -.I re_fail -with an error message string, and the opcode character that caused the error. -The default -.I re_fail -routine simply prints the message and the opcode character to -.I stderr -and invokes -.IR exit (2). -.SH EXAMPLES -In the examples below, the -.I nfaform -describes the internal form after the pattern is compiled. For additional -details, refer to the sources. -.PP -.ta 0.5i +0.5i +0.5i -.nf -foo*.* - nfaform: CHR f CHR o CLO CHR o END CLO ANY END END - matches: \fIfo foo fooo foobar fobar foxx ...\fR - -fo[ob]a[rz] - nfaform: CHR f CHR o CCL 2 o b CHR a CCL 2 r z END - matches: \fIfobar fooar fobaz fooaz\fR - -foo\\\\+ - nfaform: CHR f CHR o CHR o CHR \\ CLO CHR \\ END END - matches: \fIfoo\\ foo\\\\ foo\\\\\\ ...\fR - -\\(foo\\)[1-3]\\1 (same as foo[1-3]foo, but takes less internal space) - nfaform: BOT 1 CHR f CHR o CHR o EOT 1 CCL 3 1 2 3 REF 1 END - matches: \fIfoo1foo foo2foo foo3foo\fR - -\\(fo.*\\)-\\1 - nfaform: BOT 1 CHR f CHR o CLO ANY END EOT 1 CHR - REF 1 END - matches: \fIfoo-foo fo-fo fob-fob foobar-foobar ...\fR -.SH DIAGNOSTICS -.I Re_comp -returns one of the following strings if an error occurs: -.PP -.nf -.in +0.5i -\fINo previous regular expression, -Empty closure, -Illegal closure, -Cyclical reference, -Undetermined reference, -Unmatched \e(, -Missing ], -Null pattern inside \e(\e), -Null pattern inside \e<\e>, -Too many \e(\e) pairs, -Unmatched \e)\fP. -.in -0.5i -.fi -.SH REFERENCES -.if n .ta 3i -.if t .ta 1.8i -.nf -\fISoftware tools\fR Kernighan & Plauger -\fISoftware tools in Pascal\fR Kernighan & Plauger -\fIGrep sources\fR [rsx-11 C dist] David Conroy -\fIEd - text editor\fR Unix Programmer's Manual -\fIAdvanced editing on Unix\fR B. W. Kernighan -\fIRegExp sources\fR Henry Spencer -.fi -.SH "HISTORY AND NOTES" -These routines are derived from various implementations -found in -.I "Software Tools" -books, and David Conroy's -.I grep. -They are NOT derived from licensed/restricted software. -For more interesting/academic/complicated implementations, -see Henry Spencer's -.I regexp -routines (V8), or -.I "GNU Emacs" -pattern -matching module. -.PP -The -.I re_comp -and -.I re_exec -routines perform -.I almost -as well as their licensed counterparts, sometimes better. -In very few instances, they -are about 10% to 15% slower. -.SH AUTHOR -Ozan S. Yigit (oz) -.br -usenet: utzoo!yetti!oz -.br -bitnet: oz@yusol || oz@yuyetti -.SH "SEE ALSO" -ed(1), ex(1), egrep(1), fgrep(1), grep(1), regex(3) -.SH BUGS -These routines are \fIPublic Domain\fR. You can get them -in source. -.br -The internal storage for the \fInfa form\fR is not checked for -overflows. Currently, it is 1024 bytes. -.br -Others, no doubt. diff --git a/doc/man/man5/Make-template b/doc/man/man5/Make-template deleted file mode 100644 index ad3000ee03..0000000000 --- a/doc/man/man5/Make-template +++ /dev/null @@ -1,56 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP man5 makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC= ../../.. -SECT=5 -INSTDIR=$(LDAP_MANDIR)/man$(SECT) -VERSIONFILE = $(LDAPSRC)/build/version - -all: FORCE - -install: FORCE - -$(MKDIR) -p $(INSTDIR) - @TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \ - VERSION=`$(CAT) $(VERSIONFILE)`; \ - for page in *.$(SECT); do \ - $(SED) -e "s%LDVERSION%$$VERSION%" \ - -e 's%ETCDIR%$(LDAP_ETCDIR)%' \ - -e 's%SBINDIR%$(LDAP_SBINDIR)%' \ - -e 's%BINDIR%$(LDAP_BINDIR)%' \ - -e 's%LIBEXECDIR%$(LDAP_LIBEXECDIR)%' \ - $$page | $(MANCOMPRESS) > $$TMPMAN; \ - echo "installing $(INSTDIR)/$$page"; \ - $(RM) $(INSTDIR)/$$page $(INSTDIR)/$$page$(MANCOMPRESSSUFFIX); \ - $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page$(MANCOMPRESSSUFFIX); \ - if [ -f "$$page.links" ]; then \ - for link in `$(CAT) $$page.links`; do \ - echo "installing $(INSTDIR)/$$link as link to $$page"; \ - $(RM) $(INSTDIR)/$$link $(INSTDIR)/$$link$(MANCOMPRESSSUFFIX); \ - ln -sf $$page$(MANCOMPRESSSUFFIX) $(INSTDIR)/$$link$(MANCOMPRESSSUFFIX); \ - done; \ - fi; \ - done; \ - $(RM) $$TMPMAN - -clean: FORCE - -depend: FORCE - -lint: FORCE - -5lint: FORCE - -links: - @$(LN) .src/*.$(SECT) .src/*links . diff --git a/doc/man/man5/Makefile.in b/doc/man/man5/Makefile.in new file mode 100644 index 0000000000..71b08fd6a9 --- /dev/null +++ b/doc/man/man5/Makefile.in @@ -0,0 +1,6 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## man5 Makefile.in for OpenLDAP + +MANSECT=5 diff --git a/doc/man/man5/ldapfilter.conf.5 b/doc/man/man5/ldapfilter.conf.5 index 954bc2fd4d..ff70b7cf35 100644 --- a/doc/man/man5/ldapfilter.conf.5 +++ b/doc/man/man5/ldapfilter.conf.5 @@ -1,4 +1,4 @@ -.TH LDAPFILTER.CONF 5 "21 September 1994" "U-M LDAP LDVERSION" +.TH LDAPFILTER.CONF 5 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldapfilter.conf \- configuration file for LDAP get filter routines .SH SYNOPSIS @@ -196,3 +196,8 @@ ETCDIR/ldapfilter.conf .SH SEE ALSO .BR ldap (3), .BR ldap_getfilter (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man5/ldapfriendly.5 b/doc/man/man5/ldapfriendly.5 index 088fd13560..f3aaf877d0 100644 --- a/doc/man/man5/ldapfriendly.5 +++ b/doc/man/man5/ldapfriendly.5 @@ -1,4 +1,4 @@ -.TH LDAPFRIENDLY 5 "24 November 1994" "U-M LDAP LDVERSION" +.TH LDAPFRIENDLY 5 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldapfriendly \- configuration file for LDAP friendly routines .SH SYNOPSIS @@ -24,3 +24,8 @@ ETCDIR/ldapfriendly .SH SEE ALSO .BR ldap (3), .BR ldap_friendly_name (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man5/ldapsearchprefs.conf.5 b/doc/man/man5/ldapsearchprefs.conf.5 index 7f58505ed3..db8c09a0d1 100644 --- a/doc/man/man5/ldapsearchprefs.conf.5 +++ b/doc/man/man5/ldapsearchprefs.conf.5 @@ -1,4 +1,4 @@ -.TH LDAPSEARCHPREFS.CONF 5 "1 December 1994" "U-M LDAP LDVERSION" +.TH LDAPSEARCHPREFS.CONF 5 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldapsearchprefs.conf \- configuration file for LDAP search preference routines .SH SYNOPSIS @@ -244,3 +244,8 @@ ETCDIR/ldapsearchprefs.conf .SH SEE ALSO .BR ldap (3). .BR ldap-searchprefs (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man5/ldaptemplates.conf.5 b/doc/man/man5/ldaptemplates.conf.5 index 5b6579eb34..2c07b08394 100644 --- a/doc/man/man5/ldaptemplates.conf.5 +++ b/doc/man/man5/ldaptemplates.conf.5 @@ -1,4 +1,4 @@ -.TH LDAPTEMPLATES.CONF 5 "13 December 1994" "U-M LDAP LDVERSION" +.TH LDAPTEMPLATES.CONF 5 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldaptemplates.conf \- configuration file for LDAP display template routines .SH SYNOPSIS @@ -273,3 +273,8 @@ ETCDIR/ldaptemplates.conf .SH SEE ALSO .BR ldap (3), .BR ldap_disptmpl (3) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man5/ldif.5 b/doc/man/man5/ldif.5 index 3eaba3b54c..1a81714bef 100644 --- a/doc/man/man5/ldif.5 +++ b/doc/man/man5/ldif.5 @@ -1,4 +1,4 @@ -.TH LDIF 5 "13 November 1995" "U-M LDAP LDVERSION" +.TH LDIF 5 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldif \- LDAP Data Interchange Format .SH DESCRIPTION @@ -105,3 +105,8 @@ base 64. .BR ldbmcat (8) .LP "The SLAPD and SLURPD Administrator's Guide" +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man5/slapd.conf.5 b/doc/man/man5/slapd.conf.5 index e0e6249d02..06c5063151 100644 --- a/doc/man/man5/slapd.conf.5 +++ b/doc/man/man5/slapd.conf.5 @@ -1,4 +1,4 @@ -.TH SLAPD.CONF 5 "13 November 1995" "U-M LDAP LDVERSION" +.TH SLAPD.CONF 5 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME slapd.conf \- configuration file for slapd, the stand-alone LDAP daemon .SH SYNOPSIS @@ -338,3 +338,8 @@ ETCDIR/slapd.conf .BR slurpd (8), .LP "The SLAPD and SLURPD Administrator's Guide" +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man5/slapd.replog.5 b/doc/man/man5/slapd.replog.5 index 83d0cc69fd..996f278991 100644 --- a/doc/man/man5/slapd.replog.5 +++ b/doc/man/man5/slapd.replog.5 @@ -1,4 +1,4 @@ -.TH SLAPD.REPLOG 5 "11 April 1995" "U-M LDAP LDVERSION" +.TH SLAPD.REPLOG 5 "22 September 1998" "OpenLDAP LDVERSION" .SH NAME slapd.replog \- slapd replication log format .SH SYNOPSIS @@ -156,3 +156,8 @@ slapd.replog.lock .BR ldif (5), .BR slapd (8), .BR slurpd (8) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man5/ud.conf.5 b/doc/man/man5/ud.conf.5 index 13575bf7ea..88f450581d 100644 --- a/doc/man/man5/ud.conf.5 +++ b/doc/man/man5/ud.conf.5 @@ -1,4 +1,4 @@ -.TH UD.CONF 5 "18 March 1993" "U-M LDAP LDVERSION" +.TH UD.CONF 5 "22 September 1998" "OpenLDAP LDVERSION" .UC 6 .SH NAME ud.conf \- ud configuration file @@ -94,3 +94,8 @@ ud(1), ldap(3) .SH AUTHOR Bryan Beecher, University of Michigan +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/Make-template b/doc/man/man8/Make-template deleted file mode 100644 index 6b7f5109f8..0000000000 --- a/doc/man/man8/Make-template +++ /dev/null @@ -1,56 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP man8 makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC= ../../.. -SECT=8 -INSTDIR=$(LDAP_MANDIR)/man$(SECT) -VERSIONFILE = $(LDAPSRC)/build/version - -all: FORCE - -install: FORCE - -$(MKDIR) -p $(INSTDIR) - @TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \ - VERSION=`$(CAT) $(VERSIONFILE)`; \ - for page in *.$(SECT); do \ - $(SED) -e "s%LDVERSION%$$VERSION%" \ - -e 's%ETCDIR%$(LDAP_ETCDIR)%' \ - -e 's%SBINDIR%$(LDAP_SBINDIR)%' \ - -e 's%BINDIR%$(LDAP_BINDIR)%' \ - -e 's%LIBEXECDIR%$(LDAP_LIBEXECDIR)%' \ - $$page | $(MANCOMPRESS) > $$TMPMAN; \ - echo "installing $(INSTDIR)/$$page"; \ - $(RM) $(INSTDIR)/$$page $(INSTDIR)/$$page$(MANCOMPRESSSUFFIX) ; \ - $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(INSTDIR)/$$page$(MANCOMPRESSSUFFIX); \ - if [ -f "$$page.links" ]; then \ - for link in `$(CAT) $$page.links`; do \ - echo "installing $(INSTDIR)/$$link as link to $$page"; \ - $(RM) $(INSTDIR)/$$link $(INSTDIR)/$$link$(MANCOMPRESSSUFFIX) ; \ - ln -sf $$page$(MANCOMPRESSSUFFIX) $(INSTDIR)/$$link$(MANCOMPRESSSUFFIX); \ - done; \ - fi; \ - done; \ - $(RM) $$TMPMAN - -clean: FORCE - -depend: FORCE - -lint: FORCE - -5lint: FORCE - -links: - @$(LN) .src/*.$(SECT) .src/*links . diff --git a/doc/man/man8/Makefile.in b/doc/man/man8/Makefile.in new file mode 100644 index 0000000000..35a93b83a6 --- /dev/null +++ b/doc/man/man8/Makefile.in @@ -0,0 +1,6 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## man8 Makefile.in for OpenLDAP + +MANSECT=8 diff --git a/doc/man/man8/centipede.8 b/doc/man/man8/centipede.8 index c189b0cdb5..a36356d1e8 100644 --- a/doc/man/man8/centipede.8 +++ b/doc/man/man8/centipede.8 @@ -1,4 +1,4 @@ -.TH CENTIPEDE 8C "2 December 1995" "U-M LDAP LDVERSION" +.TH CENTIPEDE 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME centipede \- LDAP centroid index generation and maintenance program .SH SYNOPSIS @@ -152,3 +152,8 @@ etc.). A future version may also allow weights to be generated. .BR slapd (8) .LP "The SLAPD and SLURPD Administrator's Guide" +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/chlog2replog.8 b/doc/man/man8/chlog2replog.8 index 980c9ac967..15f295d5d6 100644 --- a/doc/man/man8/chlog2replog.8 +++ b/doc/man/man8/chlog2replog.8 @@ -1,4 +1,4 @@ -.TH CHLOG2REPLOG 8C "26 April 1996" "U-M LDAP LDVERSION" +.TH CHLOG2REPLOG 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME chlog2replog \- convert an X.500 DSA-style changelog to an LDAP-style replication log @@ -100,3 +100,8 @@ give this command: .BR slapd (8), .LP "The SLAPD and SLURPD Administrator's Guide" +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/edb2ldif.8 b/doc/man/man8/edb2ldif.8 index b222fbc438..6b93f10f67 100644 --- a/doc/man/man8/edb2ldif.8 +++ b/doc/man/man8/edb2ldif.8 @@ -1,4 +1,4 @@ -.TH EDB2LDIF 8C "12 November 1995" "U-M LDAP LDVERSION" +.TH EDB2LDIF 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME edb2ldif \- QUIPU EDB file to LDIF conversion tool .SH SYNOPSIS @@ -97,3 +97,8 @@ Specify an attribute that should not be converted. You can include as many "The SLAPD and SLURPD Administrator's Guide" .LP Volume 5 of The ISODE Manual +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/go500.8 b/doc/man/man8/go500.8 index d0dd686372..26f2b040d9 100644 --- a/doc/man/man8/go500.8 +++ b/doc/man/man8/go500.8 @@ -1,4 +1,4 @@ -.TH GO500 8C "27 November 1994" "U-M LDAP LDVERSION" +.TH GO500 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME go500 \- Local Gopher index search to X.500 search gateway .SH SYNOPSIS @@ -168,3 +168,8 @@ include file. .BR inetd (8), .BR gopherd (8), .BR go500gw (8) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/go500gw.8 b/doc/man/man8/go500gw.8 index 92ce2608d5..5186c64dbb 100644 --- a/doc/man/man8/go500gw.8 +++ b/doc/man/man8/go500gw.8 @@ -1,4 +1,4 @@ -.TH GO500GW 8C "27 November 1994" "U-M LDAP LDVERSION" +.TH GO500GW 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME go500gw \- General Gopher to X.500 gateway for browsing and searching .SH SYNOPSIS @@ -168,3 +168,8 @@ include file. .BR inetd (8), .BR gopherd (8), .BR go500 (8) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/in.xfingerd.8 b/doc/man/man8/in.xfingerd.8 index 40b1e1b3d6..1b92f6aa99 100644 --- a/doc/man/man8/in.xfingerd.8 +++ b/doc/man/man8/in.xfingerd.8 @@ -1,4 +1,4 @@ -.TH IN.XFINGERD 8C "27 November 1994" "U-M LDAP LDVERSION" +.TH IN.XFINGERD 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME in.xfingerd \- Finger to LDAP/X.500 gateway daemon .SH SYNOPSIS @@ -77,3 +77,8 @@ for your site. .BR ldap (3), .BR ldap_getfilter (3), .BR inetd (8), +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/ldapd.8 b/doc/man/man8/ldapd.8 index 82350d16e8..b8704f68f1 100644 --- a/doc/man/man8/ldapd.8 +++ b/doc/man/man8/ldapd.8 @@ -1,4 +1,4 @@ -.TH LDAPD 8C "15 June 1992" "U-M LDAP LDVERSION" +.TH LDAPD 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldapd \- LDAP X.500 Protocol Daemon .SH SYNOPSIS @@ -125,3 +125,8 @@ in the local dsaptailor file. .BR inetd (8) .LP Volume 5 of The ISODE Manual +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/ldbmcat.8 b/doc/man/man8/ldbmcat.8 index 0f48e895b9..96c9350309 100644 --- a/doc/man/man8/ldbmcat.8 +++ b/doc/man/man8/ldbmcat.8 @@ -1,4 +1,4 @@ -.TH LDBMCAT 8C "13 November 1995" "U-M LDAP LDVERSION" +.TH LDBMCAT 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldbmcat \- LDBM to LDIF database format conversion utility .SH SYNOPSIS @@ -59,3 +59,8 @@ mode) when you do this to ensure consistency of the database. .BR slapd (8) .LP "The SLAPD and SLURPD Administrator's Guide" +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/ldif.8 b/doc/man/man8/ldif.8 index 69fd0dffc6..034e7abc35 100644 --- a/doc/man/man8/ldif.8 +++ b/doc/man/man8/ldif.8 @@ -1,4 +1,4 @@ -.TH LDIF 8C "15 November 1995" "U-M LDAP LDVERSION" +.TH LDIF 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldif \- convert arbitrary data to LDIF format .SH SYNOPSIS @@ -46,3 +46,8 @@ containing a single value. .BR slapd (8) .LP "The SLAPD and SLURPD Administrator's Guide" +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/ldif2ldbm.8 b/doc/man/man8/ldif2ldbm.8 index 9747356bd3..a34d8d34cb 100644 --- a/doc/man/man8/ldif2ldbm.8 +++ b/doc/man/man8/ldif2ldbm.8 @@ -1,4 +1,4 @@ -.TH LDIF2LDBM 8C "13 November 1995" "U-M LDAP LDVERSION" +.TH LDIF2LDBM 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME ldif2ldbm, ldif2index, ldif2id2entry, ldif2id2children \- LDIF to LDBM database format conversion utilities .SH SYNOPSIS @@ -111,3 +111,8 @@ give this command: .BR edb2ldif (8) .LP "The SLAPD and SLURPD Administrator's Guide" +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/mail500.8 b/doc/man/man8/mail500.8 index 9fe5a4acb9..c517b1470d 100644 --- a/doc/man/man8/mail500.8 +++ b/doc/man/man8/mail500.8 @@ -1,4 +1,4 @@ -.TH MAIL500 8C "30 November 1994" "U-M LDAP LDVERSION" +.TH MAIL500 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME mail500 \- X.500 capable mailer .LP @@ -285,3 +285,8 @@ but not to fax500. .BR ldap(3), .BR sendmail.cf(5), .BR sendmail(8), +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/rcpt500.8 b/doc/man/man8/rcpt500.8 index f991514b49..a8d71566cf 100644 --- a/doc/man/man8/rcpt500.8 +++ b/doc/man/man8/rcpt500.8 @@ -1,4 +1,4 @@ -.TH RCPT500 8C "16 December 1994" "U-M LDAP LDVERSION" +.TH RCPT500 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME rcpt500 \- mail to X.500 gateway program .SH SYNOPSIS @@ -84,3 +84,8 @@ help file .BR ldap (3), .BR aliases (5), .BR sendmail (8) +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/slapd.8 b/doc/man/man8/slapd.8 index 989bd59c8b..e63ca7450e 100644 --- a/doc/man/man8/slapd.8 +++ b/doc/man/man8/slapd.8 @@ -1,4 +1,4 @@ -.TH SLAPD 8C "6 November 1995" "U-M LDAP LDVERSION" +.TH SLAPD 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME slapd \- Stand-alone LDAP Daemon .SH SYNOPSIS @@ -102,3 +102,8 @@ on voluminous debugging which will be printed on standard error, type: .SH BUGS When using the LDBM database backend, the Modify RDN operation does not update the attribute values in the entry that are affected by the change. +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/man/man8/slurpd.8 b/doc/man/man8/slurpd.8 index 99658a69d0..d2f7e4945a 100644 --- a/doc/man/man8/slurpd.8 +++ b/doc/man/man8/slurpd.8 @@ -1,4 +1,4 @@ -.TH SLURPD 8C "6 November 1995" "U-M LDAP LDVERSION" +.TH SLURPD 8C "22 September 1998" "OpenLDAP LDVERSION" .SH NAME slurpd \- Standalone LDAP Update Replication Daemon .SH SYNOPSIS @@ -149,3 +149,8 @@ on voluminous debugging which will be printed on standard error, type: .BR slapd (8) .LP "The SLAPD and SLURPD Administrator's Guide" +.SH ACKNOWLEDGEMENTS +.B OpenLDAP +is developed and maintained by The OpenLDAP Project (http://www.openldap.org/). +.B OpenLDAP +is derived from University of Michigan LDAP 3.3 Release. diff --git a/doc/rfc/Make-template b/doc/rfc/Make-template deleted file mode 100644 index 62e794d09f..0000000000 --- a/doc/rfc/Make-template +++ /dev/null @@ -1,29 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP doc/rfc makefile -# -#----------------------------------------------------------------------------- - -all: FORCE - -install: FORCE - -lint: FORCE - -5lint: FORCE - -clean: FORCE - -depend: FORCE - -links: - @$(LN) .src/*.txt . diff --git a/include/Make-template b/include/Make-template deleted file mode 100644 index 8244b1a630..0000000000 --- a/include/Make-template +++ /dev/null @@ -1,71 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP include file makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC=.. - -all: ldapconfig.h FORCE - @if [ ! -z "$(SYSEXITSPATH)" -a ! -r sysexits.h ]; then \ - echo "$(LN) $(SYSEXITSPATH) sysexits.h"; \ - $(LN) $(SYSEXITSPATH) sysexits.h; \ - else \ - exit 0; \ - fi - -ldapconfig.h: ldapconfig.h.edit Makefile - @$(RM) $@ - @echo "/*" > $@; \ - echo " * This file was automatically generated. Do not edit it." >> $@; \ - echo " * Instead, edit the file ldapconfig.h.edit. See the LDAP" >> $@; \ - echo " * INSTALL file for more information." >> $@; \ - echo " */ " >> $@; \ - echo "" >> $@; \ - $(SED) -e 's;%ETCDIR%;$(LDAP_ETCDIR);' \ - -e 's;%BINDIR%;$(LDAP_BINDIR);' \ - -e 's;%SBINDIR%;$(LDAP_SBINDIR);' \ - -e 's;%LIBEXECDIR%;$(LDAP_LIBEXECDIR);' \ - -e 's;%RUNDIR%;$(LDAP_RUNDIR);' \ - -e 's;%EDITOR%;$(LDAP_EDITOR);' \ - -e 's;%FINGER%;$(LDAP_FINGER);' \ - -e 's;%SENDMAIL%;$(LDAP_SENDMAIL);' \ - ldapconfig.h.edit >> $@; \ - $(CHMOD) 444 $@ - -install: all FORCE - -$(MKDIR) -p $(LDAP_INCDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 ldap.h $(LDAP_INCDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 lber.h $(LDAP_INCDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 proto-lber.h $(LDAP_INCDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 proto-ldap.h $(LDAP_INCDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 disptmpl.h $(LDAP_INCDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 srchpref.h $(LDAP_INCDIR) - -depend: FORCE - -clean: FORCE - -veryclean: clean - $(RM) ldapconfig.h - @if [ ! -z "$(SYSEXITSPATH)" ]; then \ - echo "$(RM) sysexits.h"; \ - $(RM) sysexits.h; \ - else \ - exit 0; \ - fi - -links: - @echo "making links in `$(PWD)` - @$(LN) .src/*.h . - @cp .src/ldapconfig.h.edit . - @-$(RM) ldapconfig.h diff --git a/include/Makefile.in b/include/Makefile.in new file mode 100644 index 0000000000..2fc4e8b936 --- /dev/null +++ b/include/Makefile.in @@ -0,0 +1,49 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, See COPYRIGHT file +## +## include Makefile.in for OpenLDAP + +all-local: ldapconfig.h FORCE + +install-local: FORCE + -$(MKDIR) -p $(includedir) + $(INSTALL) $(INSTALLFLAGS) -m 644 ldap.h $(includedir) + $(INSTALL) $(INSTALLFLAGS) -m 644 lber.h $(includedir) + $(INSTALL) $(INSTALLFLAGS) -m 644 ldap_cdefs.h $(includedir) + $(INSTALL) $(INSTALLFLAGS) -m 644 disptmpl.h $(includedir) + $(INSTALL) $(INSTALLFLAGS) -m 644 srchpref.h $(includedir) + +clean-local: FORCE + $(RM) ldapconfig.h + +veryclean-local: clean-local FORCE + $(RM) portable.h + +depend-local: ldapconfig.h FORCE + +ldapconfig.h: $(srcdir)/ldapconfig.h.edit Makefile + @$(RM) $@ + @echo "Making ldapconfig.h" + @echo "/*" > $@; \ + echo " * This file was automatically generated. Do not edit it." >> $@; \ + echo " * Instead, edit the file ldapconfig.h.edit. See the LDAP" >> $@; \ + echo " * INSTALL file for more information." >> $@; \ + echo " */ " >> $@; \ + echo "" >> $@; \ + $(SED) \ + -e 's;%SYSCONFDIR%;$(sysconfdir);' \ + -e 's;%BINDIR%;$(bindir);' \ + -e 's;%SBINDIR%;$(sbindir);' \ + -e 's;%LIBEXECDIR%;$(libexecdir);' \ + -e 's;%RUNDIR%;$(localstatedir);' \ + -e 's;%EDITOR%;$(EDITOR);' \ + -e 's;%FINGER%;$(FINGER);' \ + -e 's;%SENDMAIL%;$(SENDMAIL);' \ + $(srcdir)/ldapconfig.h.edit >> $@; \ + $(CHMOD) 444 $@ + +all-common: all-local +install-common: all-common install-local +clean-common: clean-local +veryclean-common: veryclean-local +depend-common: depend-local diff --git a/include/ac/alloca.h b/include/ac/alloca.h new file mode 100644 index 0000000000..80bcd44fee --- /dev/null +++ b/include/ac/alloca.h @@ -0,0 +1,24 @@ +/* Generic alloca.h */ + +#ifndef _AC_ALLOCA_H +#define _AC_ALLOCA_H + +/* AIX requires this to be the first thing in the file. */ +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX +#pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + + +#endif /* _AC_ALLOCA_H */ diff --git a/include/ac/ctype.h b/include/ac/ctype.h new file mode 100644 index 0000000000..e16a5ec80f --- /dev/null +++ b/include/ac/ctype.h @@ -0,0 +1,16 @@ +/* Generic ctype.h */ + +#ifndef _AC_CTYPE_H +#define _AC_CTYPE_H + +#include + +#ifdef C_UPPER_LOWER +# define TOUPPER(c) (islower(c) ? toupper(c) : (c)) +# define TOLOWER(c) (islower(c) ? toupper(c) : (c)) +#else +# define TOUPPER(c) toupper(c) +# define TOLOWER(c) tolower(c) +#endif + +#endif /* _AC_CTYPE_H */ diff --git a/include/ac/dirent.h b/include/ac/dirent.h new file mode 100644 index 0000000000..b6ec697318 --- /dev/null +++ b/include/ac/dirent.h @@ -0,0 +1,23 @@ +/* Generic dirent.h */ + +#ifndef _AC_DIRENT_H +#define _AC_DIRENT_H + +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +#endif /* _AC_DIRENT_H */ diff --git a/include/ac/errno.h b/include/ac/errno.h new file mode 100644 index 0000000000..b083cbbdf5 --- /dev/null +++ b/include/ac/errno.h @@ -0,0 +1,19 @@ +/* Generic errno.h */ + +#ifndef _AC_ERRNO_H +#define _AC_ERRNO_H + +#if defined( HAVE_ERRNO_H ) +# include +#elif defined( HAVE_SYS_ERRNO_H ) +# include +#endif + +#ifdef DECL_SYS_ERRLIST +extern int sys_nerr; +extern char *sys_errlist[]; +#endif + +/* use _POSIX_VERSION for POSIX.1 code */ + +#endif /* _AC_ERRNO_H */ diff --git a/include/ac/krb.h b/include/ac/krb.h new file mode 100644 index 0000000000..d371350354 --- /dev/null +++ b/include/ac/krb.h @@ -0,0 +1,21 @@ +/* Generic krb.h */ + +#ifndef _AC_KRB_H +#define _AC_KRB_H + +#if defined( HAVE_KERBEROS ) + +#if defined( HAVE_KERBEROSIV_KRB_H ) +#include +#elif defined( HAVE_KRB_H ) +#include +#endif + +#if defined( HAVE_KERBEROSIV_DES_H ) +#include +#elif defined( HAVE_DES_H ) +#include +#endif + +#endif /* HAVE_KERBEROS */ +#endif /* _AC_KRB_H */ diff --git a/include/ac/regex.h b/include/ac/regex.h new file mode 100644 index 0000000000..cc21e66215 --- /dev/null +++ b/include/ac/regex.h @@ -0,0 +1,23 @@ +/* + * Generic Regex + */ +#ifndef _AC_REGEX_H_ +#define _AC_REGEX_H_ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifndef HAVE_REGEX_H +/* NO POSIX REGEX!! + you'll need to install a POSIX compatible REGEX library. + Either Henry Spencer's or GNU regex will do. + + For NT: http://people.delphi.com/gjc/hs_regex.html +*/ +#else + /* have regex.h, assume it's POSIX compliant */ +# include +#endif /* regex.h */ + +#endif /* _AC_REGEX_H_ */ diff --git a/include/ac/signal.h b/include/ac/signal.h new file mode 100644 index 0000000000..56597a0bfe --- /dev/null +++ b/include/ac/signal.h @@ -0,0 +1,14 @@ +/* Generic signal.h */ + +#ifndef _AC_SIGNAL_H +#define _AC_SIGNAL_H + +#include + +#ifdef HAVE_SIGSET +#define SIGNAL sigset +#else +#define SIGNAL signal +#endif + +#endif /* _AC_SIGNAL_H */ diff --git a/include/ac/socket.h b/include/ac/socket.h new file mode 100644 index 0000000000..1527d02e5f --- /dev/null +++ b/include/ac/socket.h @@ -0,0 +1,100 @@ +/* + * Generic socket.h + */ + +#ifndef _AC_SOCKET_H_ +#define _AC_SOCKET_H_ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_SYS_SOCKET_H +#include + +#ifdef HAVE_SYS_SELECT_H +#include +#endif + +#include +#include +#include +#include +#include +#endif + +#ifdef HAVE_WINSOCK2 +#include +#elif HAVE_WINSOCK +#include +#else +#define WSACleanup() +#endif + +#ifdef HAVE_PCNFS +#include +#endif /* HAVE_PCNFS */ + +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK ((unsigned long) 0x7f000001) +#endif + +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 64 +#endif + +#ifdef MACOS +#define tcp_close( s ) tcpclose( s ) +#else /* MACOS */ +#ifdef DOS +#ifdef PCNFS +#define tcp_close( s ) close( s ) +#endif /* PCNFS */ +#ifdef NCSA +#define tcp_close( s ) netclose( s ); netshut() +#endif /* NCSA */ +#ifdef WINSOCK +#define tcp_close( s ) closesocket( s ); +#endif /* WINSOCK */ +#else /* DOS */ +#define tcp_close( s ) close( s ) +#endif /* DOS */ +#endif /* MACOS */ + +#if !defined(__alpha) || defined(VMS) +#define AC_HTONL( l ) htonl( l ) +#define AC_NTOHL( l ) ntohl( l ) +#else /* __alpha && !VMS */ +/* + * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the + * lower-order 32-bits of a (64-bit) long, so we define correct versions + * here. + */ +#define AC_HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \ + | htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 )) + +#define AC_NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \ + | ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 )) + +#endif /* __alpha && !VMS */ + +#ifndef BYTE_ORDER +/* + * Definitions for byte order, according to byte significance from low + * address to high. + */ +#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ +#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ +#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ + +/* assume autoconf's AC_C_BIGENDIAN has been run */ +/* if it hasn't, we assume (maybe falsely) the order is LITTLE ENDIAN */ +#ifdef WORDS_BIGENDIAN +#define BYTE_ORDER BIG_ENDIAN +#else +#define BYTE_ORDER LITTLE_ENDIAN +#endif + +#endif /* BYTE_ORDER */ + +#endif /* _AC_SOCKET_H_ */ diff --git a/include/ac/string.h b/include/ac/string.h new file mode 100644 index 0000000000..147976fc68 --- /dev/null +++ b/include/ac/string.h @@ -0,0 +1,34 @@ +/* Generic string.h */ + +#ifndef _AC_STRING_H +#define _AC_STRING_H + +#ifdef STDC_HEADERS +# include +#else +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +# endif + char *strchr (), *strrchr (); + +# ifndef HAVE_MEMCPY +# define memcpy(d, s, n) bcopy ((s), (d), (n)) +# define memmove(d, s, n) bcopy ((s), (d), (n)) +# endif +#endif + +#ifndef SAFEMEMCPY +# if defined( HAVE_MEMMOVE ) +# define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n)) +# elif defined( HAVE_BCOPY ) +# define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n)) +# elif defined( MACOS ) +# define SAFEMEMCPY( d, s, n ) BlockMoveData((Ptr)(s), (Ptr)(d), (n)) +# else + /* nothing left but memcpy() */ +# define SAFEMEMCPY( d, s, n ) memcpy((d), (s), (n)) +# endif +#endif + +#endif /* _AC_STRING_H */ diff --git a/include/ac/syslog.h b/include/ac/syslog.h new file mode 100644 index 0000000000..c7afb100ba --- /dev/null +++ b/include/ac/syslog.h @@ -0,0 +1,23 @@ +/* + * Generic syslog.h + */ +#ifndef _AC_SYSLOG_H_ +#define _AC_SYSLOG_H_ + +#if defined( HAVE_SYSLOG_H ) +#include +#elif defined ( HAVE_SYS_SYSLOG_H ) +#include +#endif + +#if defined( LOG_NDELAY ) && defined( LOG_NOWAIT ) +# define OPENLOG_OPTIONS ( LOG_PID | LOG_NDELAY | LOG_NOWAIT ) +#elif defined( LOG_NDELAY ) +# define OPENLOG_OPTIONS ( LOG_PID | LOG_NDELAY ) +#elif defined( LOG_NOWAIT ) +# define OPENLOG_OPTIONS ( LOG_PID | LOG_NOWAIT ) +#else +# define OPENLOG_OPTIONS ( LOG_PID ) +#endif + +#endif /* _AC_SYSLOG_H_ */ diff --git a/include/ac/termios.h b/include/ac/termios.h new file mode 100644 index 0000000000..f1d2118a1d --- /dev/null +++ b/include/ac/termios.h @@ -0,0 +1,32 @@ +/* Generic termios.h */ + +#ifndef _AC_TERMIOS_H +#define _AC_TERMIOS_H + +#ifdef HAVE_SGTTY_H +#include + +#ifdef HAVE_SYS_IOCTL_H +#include +#endif + +#define TERMIO_TYPE struct sgttyb +#define TERMFLAG_TYPE int +#define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop)) +#define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop)) +#define GETFLAGS( tio ) ((tio).sg_flags) +#define SETFLAGS( tio, flags ) ((tio).sg_flags = (flags)) + +#elif HAVE_TERMIOS_H +#include + +#define TERMIO_TYPE struct termios +#define TERMFLAG_TYPE tcflag_t +#define GETATTR( fd, tiop ) tcgetattr((fd), (tiop)) +#define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop)) +#define GETFLAGS( tio ) ((tio).c_lflag) +#define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags)) + +#endif /* HAVE_TERMIOS_H */ + +#endif /* _AC_TERMIOS_H */ diff --git a/include/ac/time.h b/include/ac/time.h new file mode 100644 index 0000000000..ba18790a4c --- /dev/null +++ b/include/ac/time.h @@ -0,0 +1,15 @@ +/* Generic time.h */ + +#ifndef _AC_TIME_H +#define _AC_TIME_H + +#if TIME_WITH_SYS_TIME +# include +# include +#elif HAVE_SYS_TIME_H +# include +#else +# include +#endif + +#endif /* _AC_TIME_H */ diff --git a/include/ac/unistd.h b/include/ac/unistd.h new file mode 100644 index 0000000000..5e4501f589 --- /dev/null +++ b/include/ac/unistd.h @@ -0,0 +1,26 @@ +/* Generic unistd.h */ + +#ifndef _AC_UNISTD_H +#define _AC_UNISTD_H + +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + +/* getopt() defines may be in separate include file */ +#if HAVE_GETOPT_H +# include +#endif + +#ifndef HAVE_GETOPT +/* no getopt, assume we need getopt-compat.h */ +# include +#endif + +/* use _POSIX_VERSION for POSIX.1 code */ + +#endif /* _AC_UNISTD_H */ diff --git a/include/ac/wait.h b/include/ac/wait.h new file mode 100644 index 0000000000..af2eb5b18a --- /dev/null +++ b/include/ac/wait.h @@ -0,0 +1,25 @@ +/* Generic wait.h */ + +#ifndef _AC_WAIT_H +#define _AC_WAIT_H + +#include + +#if HAVE_SYS_WAIT_H +# include +#endif + +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +#ifdef WCONTINUED +# define WAIT_FLAGS ( WNOHANG | WUNTRACED | WCONTINUED ) +#else +# define WAIT_FLAGS ( WNOHANG | WUNTRACED ) +#endif + +#endif /* _AC_WAIT_H */ diff --git a/include/avl.h b/include/avl.h index b649f51283..eb8b8836fc 100644 --- a/include/avl.h +++ b/include/avl.h @@ -15,10 +15,14 @@ #ifndef _AVL #define _AVL +#include + /* * this structure represents a generic avl tree node. */ +LDAP_BEGIN_DECL + typedef struct avlnode { caddr_t avl_data; signed char avl_bf; @@ -36,13 +40,39 @@ typedef struct avlnode { /* avl routines */ #define avl_getone(x) ((x) == 0 ? 0 : (x)->avl_data) #define avl_onenode(x) ((x) == 0 || ((x)->avl_left == 0 && (x)->avl_right == 0)) -extern int avl_insert(); -extern caddr_t avl_delete(); -extern caddr_t avl_find(); -extern caddr_t avl_getfirst(); -extern caddr_t avl_getnext(); -extern int avl_dup_error(); -extern int avl_apply(); + +/* looks like this function pointer is not used consistently */ +/* typedef int (*IFP)LDAP_P((caddr_t, caddr_t)); */ +typedef int (*IFP)(); + +LDAP_F int +avl_free LDAP_P(( Avlnode *root, IFP dfree )); + +LDAP_F int +avl_insert LDAP_P((Avlnode **, caddr_t, IFP, IFP)); + +LDAP_F caddr_t +avl_delete LDAP_P((Avlnode **, caddr_t, IFP)); + +LDAP_F caddr_t +avl_find LDAP_P((Avlnode *, caddr_t, IFP)); + +LDAP_F caddr_t +avl_getfirst LDAP_P((Avlnode *)); + +#ifdef AVL_REENTRANT +LDAP_F caddr_t +avl_getnext LDAP_P((Avlnode *, caddr_t )); +#else +LDAP_F caddr_t +avl_getnext LDAP_P((void)); +#endif + +LDAP_F int +avl_dup_error LDAP_P((void)); + +LDAP_F int +avl_apply LDAP_P((Avlnode *, IFP, caddr_t, int, int)); /* apply traversal types */ #define AVL_PREORDER 1 @@ -51,6 +81,6 @@ extern int avl_apply(); /* what apply returns if it ran out of nodes */ #define AVL_NOMORE (-6) -typedef int (*IFP)(); +LDAP_END_DECL #endif /* _AVL */ diff --git a/include/disptmpl.h b/include/disptmpl.h index 7c592109b1..8ba58eff6f 100644 --- a/include/disptmpl.h +++ b/include/disptmpl.h @@ -16,10 +16,9 @@ #ifndef _DISPTMPL_H #define _DISPTMPL_H -#ifdef __cplusplus -extern "C" { -#endif +#include +LDAP_BEGIN_DECL #define LDAP_TEMPLATE_VERSION 1 @@ -221,110 +220,95 @@ struct ldap_disptmpl { #define LDAP_DTMPL_BUFSIZ 8192 -#ifndef NEEDPROTOS +typedef int (*writeptype) LDAP_P(( void *writeparm, char *p, int len )); -typedef int (*writeptype)(); +LDAP_F int +ldap_init_templates LDAP_P(( char *file, struct ldap_disptmpl **tmpllistp )); -int ldap_init_templates(); -int ldap_init_templates_buf(); -void ldap_free_templates(); -struct ldap_disptmpl *ldap_first_disptmpl(); -struct ldap_disptmpl *ldap_next_disptmpl(); -struct ldap_disptmpl *ldap_name2template(); -struct ldap_disptmpl *ldap_oc2template(); -char **ldap_tmplattrs(); -struct ldap_tmplitem *ldap_first_tmplrow(); -struct ldap_tmplitem *ldap_next_tmplrow(); -struct ldap_tmplitem *ldap_first_tmplcol(); -struct ldap_tmplitem *ldap_next_tmplcol(); -int ldap_entry2text_search(); -int ldap_entry2text(); -int ldap_vals2text(); -int ldap_entry2html_search(); -int ldap_entry2html(); -int ldap_vals2html(); +LDAP_F int +ldap_init_templates_buf LDAP_P(( char *buf, + long buflen, + struct ldap_disptmpl **tmpllistp )); -#else /* !NEEDPROTOS */ +LDAP_F void +ldap_free_templates LDAP_P(( struct ldap_disptmpl *tmpllist )); -typedef int (*writeptype)( void *writeparm, char *p, int len ); +LDAP_F struct ldap_disptmpl * +ldap_first_disptmpl LDAP_P(( struct ldap_disptmpl *tmpllist )); -LDAPFUNCDECL int -ldap_init_templates( char *file, struct ldap_disptmpl **tmpllistp ); +LDAP_F struct ldap_disptmpl * +ldap_next_disptmpl LDAP_P(( struct ldap_disptmpl *tmpllist, + struct ldap_disptmpl *tmpl )); -LDAPFUNCDECL int -ldap_init_templates_buf( char *buf, long buflen, - struct ldap_disptmpl **tmpllistp ); +LDAP_F struct ldap_disptmpl * +ldap_name2template LDAP_P(( char *name, + struct ldap_disptmpl *tmpllist )); -LDAPFUNCDECL void -ldap_free_templates( struct ldap_disptmpl *tmpllist ); +LDAP_F struct ldap_disptmpl * +ldap_oc2template LDAP_P(( char **oclist, + struct ldap_disptmpl *tmpllist )); -LDAPFUNCDECL struct ldap_disptmpl * -ldap_first_disptmpl( struct ldap_disptmpl *tmpllist ); +LDAP_F char ** +ldap_tmplattrs LDAP_P(( struct ldap_disptmpl *tmpl, + char **includeattrs, + int exclude, + unsigned long syntaxmask )); -LDAPFUNCDECL struct ldap_disptmpl * -ldap_next_disptmpl( struct ldap_disptmpl *tmpllist, - struct ldap_disptmpl *tmpl ); +LDAP_F struct ldap_tmplitem * +ldap_first_tmplrow LDAP_P(( struct ldap_disptmpl *tmpl )); -LDAPFUNCDECL struct ldap_disptmpl * -ldap_name2template( char *name, struct ldap_disptmpl *tmpllist ); +LDAP_F struct ldap_tmplitem * +ldap_next_tmplrow LDAP_P(( struct ldap_disptmpl *tmpl, + struct ldap_tmplitem *row )); -LDAPFUNCDECL struct ldap_disptmpl * -ldap_oc2template( char **oclist, struct ldap_disptmpl *tmpllist ); +LDAP_F struct ldap_tmplitem * +ldap_first_tmplcol LDAP_P(( struct ldap_disptmpl *tmpl, + struct ldap_tmplitem *row )); -LDAPFUNCDECL char ** -ldap_tmplattrs( struct ldap_disptmpl *tmpl, char **includeattrs, int exclude, - unsigned long syntaxmask ); +LDAP_F struct ldap_tmplitem * +ldap_next_tmplcol LDAP_P(( struct ldap_disptmpl *tmpl, + struct ldap_tmplitem *row, + struct ldap_tmplitem *col )); -LDAPFUNCDECL struct ldap_tmplitem * -ldap_first_tmplrow( struct ldap_disptmpl *tmpl ); - -LDAPFUNCDECL struct ldap_tmplitem * -ldap_next_tmplrow( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row ); - -LDAPFUNCDECL struct ldap_tmplitem * -ldap_first_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row ); - -LDAPFUNCDECL struct ldap_tmplitem * -ldap_next_tmplcol( struct ldap_disptmpl *tmpl, struct ldap_tmplitem *row, - struct ldap_tmplitem *col ); - -LDAPFUNCDECL int -ldap_entry2text( LDAP *ld, char *buf, LDAPMessage *entry, +LDAP_F int +ldap_entry2text LDAP_P(( LDAP *ld, + char *buf, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts ); + unsigned long opts )); -LDAPFUNCDECL int -ldap_vals2text( LDAP *ld, char *buf, char **vals, char *label, int labelwidth, +LDAP_F int +ldap_vals2text LDAP_P(( LDAP *ld, + char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, void *writeparm, - char *eol, int rdncount ); + char *eol, int rdncount )); -LDAPFUNCDECL int -ldap_entry2text_search( LDAP *ld, char *dn, char *base, LDAPMessage *entry, +LDAP_F int +ldap_entry2text_search LDAP_P(( LDAP *ld, + char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts ); + unsigned long opts )); -LDAPFUNCDECL int -ldap_entry2html( LDAP *ld, char *buf, LDAPMessage *entry, +LDAP_F int +ldap_entry2html LDAP_P(( LDAP *ld, + char *buf, LDAPMessage *entry, struct ldap_disptmpl *tmpl, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts, char *urlprefix, char *base ); + unsigned long opts, char *urlprefix, char *base )); -LDAPFUNCDECL int -ldap_vals2html( LDAP *ld, char *buf, char **vals, char *label, int labelwidth, +LDAP_F int +ldap_vals2html LDAP_P(( LDAP *ld, + char *buf, char **vals, char *label, int labelwidth, unsigned long syntaxid, writeptype writeproc, void *writeparm, - char *eol, int rdncount, char *urlprefix ); + char *eol, int rdncount, char *urlprefix )); -LDAPFUNCDECL int -ldap_entry2html_search( LDAP *ld, char *dn, char *base, LDAPMessage *entry, +LDAP_F int +ldap_entry2html_search LDAP_P(( LDAP + *ld, char *dn, char *base, LDAPMessage *entry, struct ldap_disptmpl *tmpllist, char **defattrs, char ***defvals, writeptype writeproc, void *writeparm, char *eol, int rdncount, - unsigned long opts, char *urlprefix ); -#endif /* !NEEDPROTOS */ - + unsigned long opts, char *urlprefix )); -#ifdef __cplusplus -} -#endif +LDAP_END_DECL #endif /* _DISPTMPL_H */ diff --git a/include/getopt-compat.h b/include/getopt-compat.h new file mode 100644 index 0000000000..b82dc9fd8c --- /dev/null +++ b/include/getopt-compat.h @@ -0,0 +1,14 @@ +/* + * getopt(3) declarations + */ +#ifndef _GETOPT_COMPAT_H +#define _GETOPT_COMPAT_H + +#include + +extern char *optarg; +extern int optind, opterr, optopt; + +LDAP_F int getopt LDAP_P((int, char * const [], const char *)); + +#endif /* _GETOPT_COMPAT_H */ diff --git a/include/lber.h b/include/lber.h index fa3e94855e..6f7c165e37 100644 --- a/include/lber.h +++ b/include/lber.h @@ -13,13 +13,9 @@ #ifndef _LBER_H #define _LBER_H -#ifdef __cplusplus -extern "C" { -#endif +#include -#if !defined( NEEDPROTOS ) && defined(__STDC__) -#define NEEDPROTOS 1 -#endif +LDAP_BEGIN_DECL /* BER classes and mask */ #define LBER_CLASS_UNIVERSAL 0x00 @@ -58,12 +54,9 @@ extern "C" { #define OLD_LBER_SEQUENCE 0x10L /* w/o constructed bit - broken */ #define OLD_LBER_SET 0x11L /* w/o constructed bit - broken */ -#ifdef NEEDPROTOS -typedef int (*BERTranslateProc)( char **bufp, unsigned long *buflenp, - int free_input ); -#else /* NEEDPROTOS */ -typedef int (*BERTranslateProc)(); -#endif /* NEEDPROTOS */ +typedef int (*BERTranslateProc) LDAP_P(( char **bufp, + unsigned long *buflenp, + int free_input )); typedef struct berelement { char *ber_buf; @@ -123,62 +116,78 @@ struct berval { char *bv_val; }; -#ifndef NEEDPROTOS -extern BerElement *ber_alloc(); -extern BerElement *der_alloc(); -extern BerElement *ber_alloc_t(); -extern BerElement *ber_dup(); extern int lber_debug; -extern void ber_bvfree(); -extern void ber_bvecfree(); -extern struct berval *ber_bvdup(); -extern void ber_dump(); -extern void ber_sos_dump(); -extern void lber_bprint(); -extern void ber_reset(); -extern void ber_init(); -#else /* NEEDPROTOS */ -#if defined(WINSOCK) -#include "proto-lb.h" -#else -#include "proto-lber.h" -#endif -#endif /* NEEDPROTOS */ - -#if !defined(__alpha) || defined(VMS) - -#define LBER_HTONL( l ) htonl( l ) -#define LBER_NTOHL( l ) ntohl( l ) - -#else /* __alpha */ + /* - * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the - * lower-order 32-bits of a (64-bit) long, so we define correct versions - * here. + * in bprint.c: */ -#define LBER_HTONL( l ) (((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \ - | htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 )) +LDAP_F void lber_bprint LDAP_P(( char *data, int len )); -#define LBER_NTOHL( l ) (((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \ - | ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 )) -#endif /* __alpha */ +/* + * in decode.c: + */ +LDAP_F unsigned long ber_get_tag LDAP_P(( BerElement *ber )); +LDAP_F unsigned long ber_skip_tag LDAP_P(( BerElement *ber, unsigned long *len )); +LDAP_F unsigned long ber_peek_tag LDAP_P(( BerElement *ber, unsigned long *len )); +LDAP_F unsigned long ber_get_int LDAP_P(( BerElement *ber, long *num )); +LDAP_F unsigned long ber_get_stringb LDAP_P(( BerElement *ber, char *buf, + unsigned long *len )); +LDAP_F unsigned long ber_get_stringa LDAP_P(( BerElement *ber, char **buf )); +LDAP_F unsigned long ber_get_stringal LDAP_P(( BerElement *ber, struct berval **bv )); +LDAP_F unsigned long ber_get_bitstringa LDAP_P(( BerElement *ber, char **buf, + unsigned long *len )); +LDAP_F unsigned long ber_get_null LDAP_P(( BerElement *ber )); +LDAP_F unsigned long ber_get_boolean LDAP_P(( BerElement *ber, int *boolval )); +LDAP_F unsigned long ber_first_element LDAP_P(( BerElement *ber, unsigned long *len, + char **last )); +LDAP_F unsigned long ber_next_element LDAP_P(( BerElement *ber, unsigned long *len, + char *last )); +LDAP_F unsigned long ber_scanf LDAP_P(( BerElement *ber, char *fmt, ... )); +LDAP_F void ber_bvfree LDAP_P(( struct berval *bv )); +LDAP_F void ber_bvecfree LDAP_P(( struct berval **bv )); +LDAP_F struct berval *ber_bvdup LDAP_P(( struct berval *bv )); +LDAP_F void ber_set_string_translators LDAP_P(( BerElement *ber, + BERTranslateProc encode_proc, BERTranslateProc decode_proc )); +/* + * in encode.c + */ +LDAP_F int ber_put_enum LDAP_P(( BerElement *ber, long num, unsigned long tag )); +LDAP_F int ber_put_int LDAP_P(( BerElement *ber, long num, unsigned long tag )); +LDAP_F int ber_put_ostring LDAP_P(( BerElement *ber, char *str, unsigned long len, + unsigned long tag )); +LDAP_F int ber_put_string LDAP_P(( BerElement *ber, char *str, unsigned long tag )); +LDAP_F int ber_put_bitstring LDAP_P(( BerElement *ber, char *str, + unsigned long bitlen, unsigned long tag )); +LDAP_F int ber_put_null LDAP_P(( BerElement *ber, unsigned long tag )); +LDAP_F int ber_put_boolean LDAP_P(( BerElement *ber, int boolval, + unsigned long tag )); +LDAP_F int ber_start_seq LDAP_P(( BerElement *ber, unsigned long tag )); +LDAP_F int ber_start_set LDAP_P(( BerElement *ber, unsigned long tag )); +LDAP_F int ber_put_seq LDAP_P(( BerElement *ber )); +LDAP_F int ber_put_set LDAP_P(( BerElement *ber )); +LDAP_F int ber_printf LDAP_P(( BerElement *ber, char *fmt, ... )); /* - * SAFEMEMCPY is an overlap-safe copy from s to d of n bytes + * in io.c: */ -#ifdef MACOS -#define SAFEMEMCPY( d, s, n ) BlockMoveData( (Ptr)(s), (Ptr)(d), (n) ) -#else /* MACOS */ -#ifdef sunos4 -#define SAFEMEMCPY( d, s, n ) bcopy( (s), (d), (n) ) -#else /* sunos4 */ -#define SAFEMEMCPY( d, s, n ) memmove( (d), (s), (n) ) -#endif /* sunos4 */ -#endif /* MACOS */ +LDAP_F long ber_read LDAP_P(( BerElement *ber, char *buf, unsigned long len )); +LDAP_F long ber_write LDAP_P(( BerElement *ber, char *buf, unsigned long len, + int nosos )); +LDAP_F void ber_free LDAP_P(( BerElement *ber, int freebuf )); +LDAP_F int ber_flush LDAP_P(( Sockbuf *sb, BerElement *ber, int freeit )); +LDAP_F BerElement *ber_alloc LDAP_P(( void )); +LDAP_F BerElement *der_alloc LDAP_P(( void )); +LDAP_F BerElement *ber_alloc_t LDAP_P(( int options )); +LDAP_F BerElement *ber_dup LDAP_P(( BerElement *ber )); +LDAP_F void ber_dump LDAP_P(( BerElement *ber, int inout )); +LDAP_F void ber_sos_dump LDAP_P(( Seqorset *sos )); +LDAP_F unsigned long ber_get_next LDAP_P(( Sockbuf *sb, unsigned long *len, + BerElement *ber )); +LDAP_F void ber_init LDAP_P(( BerElement *ber, int options )); +LDAP_F void ber_reset LDAP_P(( BerElement *ber, int was_writing )); + +LDAP_END_DECL -#ifdef __cplusplus -} -#endif #endif /* _LBER_H */ diff --git a/include/ldap.h b/include/ldap.h index deae5d4970..0f90b1d508 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -13,29 +13,20 @@ #ifndef _LDAP_H #define _LDAP_H -#ifdef __cplusplus -extern "C" { -#endif - +#include -#ifdef WINSOCK -#include "msdos.h" -#include -#endif - -#if !defined( NEEDPROTOS ) && defined(__STDC__) -#define NEEDPROTOS 1 -#endif +LDAP_BEGIN_DECL #define LDAP_PORT 389 #define LDAP_VERSION1 1 #define LDAP_VERSION2 2 +#define LDAP_VERSION3 3 #define LDAP_VERSION LDAP_VERSION2 -#define COMPAT20 -#define COMPAT30 -#if defined(COMPAT20) || defined(COMPAT30) -#define COMPAT +#define LDAP_COMPAT20 +#define LDAP_COMPAT30 +#if defined(LDAP_COMPAT20) || defined(LDAP_COMPAT30) +#define LDAP_COMPAT #endif #define LDAP_MAX_ATTR_LEN 100 @@ -46,7 +37,8 @@ extern int ldap_debug; #ifdef LDAP_SYSLOG extern int ldap_syslog; extern int ldap_syslog_level; -#endif +#endif /* LDAP_SYSLOG */ + #define LDAP_DEBUG_TRACE 0x001 #define LDAP_DEBUG_PACKETS 0x002 #define LDAP_DEBUG_ARGS 0x004 @@ -61,6 +53,7 @@ extern int ldap_syslog_level; #define LDAP_DEBUG_PARSE 0x800 #define LDAP_DEBUG_ANY 0xffff +/* this doesn't below as part of ldap.h */ #ifdef LDAP_SYSLOG #define Debug( level, fmt, arg1, arg2, arg3 ) \ { \ @@ -453,12 +446,8 @@ typedef struct ldap { int ld_cldaptimeout;/* time between retries */ int ld_refhoplimit; /* limit on referral nesting */ unsigned long ld_options; /* boolean options */ -#ifdef LDAP_DNS #define LDAP_OPT_DNS 0x00000001 /* use DN & DNS */ -#endif /* LDAP_DNS */ -#ifdef LDAP_REFERRALS #define LDAP_OPT_REFERRALS 0x00000002 /* chase referrals */ -#endif /* LDAP_REFERRALS */ #define LDAP_OPT_RESTART 0x00000004 /* restart if EINTR occurs */ /* do not mess with the rest though */ @@ -512,83 +501,264 @@ typedef struct ldap_url_desc { #define LDAP_URL_ERR_BADSCOPE 3 /* URL scope string is invalid */ #define LDAP_URL_ERR_MEM 4 /* can't allocate memory space */ +/* this typedef is never used, only exists to rid of declaration + in function param list warning */ +typedef struct timeval LDAPtv; -#ifndef NEEDPROTOS -extern LDAP *ldap_open(); -extern LDAP *ldap_init(); -#ifdef STR_TRANSLATION -extern void ldap_set_string_translators(); -#ifdef LDAP_CHARSET_8859 -extern int ldap_t61_to_8859(); -extern int ldap_8859_to_t61(); -#endif /* LDAP_CHARSET_8859 */ -#endif /* STR_TRANSLATION */ -extern LDAPMessage *ldap_first_entry(); -extern LDAPMessage *ldap_next_entry(); -extern char *ldap_get_dn(); -extern char *ldap_dn2ufn(); -extern char **ldap_explode_dn(); -extern char *ldap_first_attribute(); -extern char *ldap_next_attribute(); -extern char **ldap_get_values(); -extern struct berval **ldap_get_values_len(); -extern void ldap_value_free(); -extern void ldap_value_free_len(); -extern int ldap_count_values(); -extern int ldap_count_values_len(); -extern char *ldap_err2string(); -extern void ldap_getfilter_free(); -extern LDAPFiltDesc *ldap_init_getfilter(); -extern LDAPFiltDesc *ldap_init_getfilter_buf(); -extern LDAPFiltInfo *ldap_getfirstfilter(); -extern LDAPFiltInfo *ldap_getnextfilter(); -extern void ldap_setfilteraffixes(); -extern void ldap_build_filter(); -extern void ldap_flush_cache(); -extern void ldap_set_cache_options(); -extern void ldap_uncache_entry(); -extern void ldap_uncache_request(); -extern char *ldap_friendly_name(); -extern void ldap_free_friendlymap(); -extern LDAP *cldap_open(); -extern void cldap_setretryinfo(); -extern void cldap_close(); -extern LDAPFiltDesc *ldap_ufn_setfilter(); -extern int ldap_ufn_timeout(); -extern int ldap_sort_entries(); -extern int ldap_sort_values(); -extern int ldap_sort_strcasecmp(); -void ldap_free_urldesc(); -void ldap_set_rebind_proc(); -void ldap_enable_translation(); - - -#if defined(ultrix) || defined(VMS) || defined( nextstep ) -extern char *strdup(); -#endif +/* + * in abandon.c: + */ +LDAP_F int ldap_abandon LDAP_P(( LDAP *ld, int msgid )); -#else /* NEEDPROTOS */ -#if !defined(MACOS) && !defined(DOS) && !defined(_WIN32) && !defined(WINSOCK) -#include -#include -#include -#endif -#if defined(WINSOCK) -#include "proto-ld.h" -#else -#include "proto-ldap.h" -#endif +/* + * in add.c: + */ +LDAP_F int ldap_add LDAP_P(( LDAP *ld, char *dn, LDAPMod **attrs )); +LDAP_F int ldap_add_s LDAP_P(( LDAP *ld, char *dn, LDAPMod **attrs )); -#ifdef VMS -extern char *strdup( const char *s ); -#endif -#if defined(ultrix) || defined( nextstep ) -extern char *strdup(); -#endif +/* + * in bind.c: + */ +LDAP_F int ldap_bind LDAP_P(( LDAP *ld, char *who, char *passwd, int authmethod )); +LDAP_F int ldap_bind_s LDAP_P(( LDAP *ld, char *who, char *cred, int method )); +LDAP_F void ldap_set_rebind_proc LDAP_P(( LDAP *ld, + int (*rebindproc) LDAP_P(( LDAP *ld, char **dnp, char **passwdp, int *authmethodp, int freeit )) +)); -#endif /* NEEDPROTOS */ +/* + * in sbind.c: + */ +LDAP_F int ldap_simple_bind LDAP_P(( LDAP *ld, char *who, char *passwd )); +LDAP_F int ldap_simple_bind_s LDAP_P(( LDAP *ld, char *who, char *passwd )); + +/* + * in kbind.c: + */ +LDAP_F int ldap_kerberos_bind_s LDAP_P(( LDAP *ld, char *who )); +LDAP_F int ldap_kerberos_bind1 LDAP_P(( LDAP *ld, char *who )); +LDAP_F int ldap_kerberos_bind1_s LDAP_P(( LDAP *ld, char *who )); +LDAP_F int ldap_kerberos_bind2 LDAP_P(( LDAP *ld, char *who )); +LDAP_F int ldap_kerberos_bind2_s LDAP_P(( LDAP *ld, char *who )); + + +/* + * in cache.c + */ +LDAP_F int ldap_enable_cache LDAP_P(( LDAP *ld, long timeout, long maxmem )); +LDAP_F void ldap_disable_cache LDAP_P(( LDAP *ld )); +LDAP_F void ldap_set_cache_options LDAP_P(( LDAP *ld, unsigned long opts )); +LDAP_F void ldap_destroy_cache LDAP_P(( LDAP *ld )); +LDAP_F void ldap_flush_cache LDAP_P(( LDAP *ld )); +LDAP_F void ldap_uncache_entry LDAP_P(( LDAP *ld, char *dn )); +LDAP_F void ldap_uncache_request LDAP_P(( LDAP *ld, int msgid )); + +/* + * in compare.c: + */ +LDAP_F int ldap_compare LDAP_P(( LDAP *ld, char *dn, char *attr, char *value )); +LDAP_F int ldap_compare_s LDAP_P(( LDAP *ld, char *dn, char *attr, char *value )); + +/* + * in delete.c: + */ +LDAP_F int ldap_delete LDAP_P(( LDAP *ld, char *dn )); +LDAP_F int ldap_delete_s LDAP_P(( LDAP *ld, char *dn )); + +/* + * in error.c: + */ +LDAP_F int ldap_result2error LDAP_P(( LDAP *ld, LDAPMessage *r, int freeit )); +LDAP_F char *ldap_err2string LDAP_P(( int err )); +LDAP_F void ldap_perror LDAP_P(( LDAP *ld, char *s )); + +/* + * in modify.c: + */ +LDAP_F int ldap_modify LDAP_P(( LDAP *ld, char *dn, LDAPMod **mods )); +LDAP_F int ldap_modify_s LDAP_P(( LDAP *ld, char *dn, LDAPMod **mods )); + +/* + * in modrdn.c: + */ +LDAP_F int ldap_modrdn LDAP_P(( LDAP *ld, char *dn, char *newrdn )); +LDAP_F int ldap_modrdn_s LDAP_P(( LDAP *ld, char *dn, char *newrdn )); +LDAP_F int ldap_modrdn2 LDAP_P(( LDAP *ld, char *dn, char *newrdn, + int deleteoldrdn )); +LDAP_F int ldap_modrdn2_s LDAP_P(( LDAP *ld, char *dn, char *newrdn, + int deleteoldrdn)); + +/* + * in open.c: + */ +LDAP_F LDAP *ldap_open LDAP_P(( char *host, int port )); +LDAP_F LDAP *ldap_init LDAP_P(( char *defhost, int defport )); + +/* + * in getentry.c: + */ +LDAP_F LDAPMessage *ldap_first_entry LDAP_P(( LDAP *ld, LDAPMessage *chain )); +LDAP_F LDAPMessage *ldap_next_entry LDAP_P(( LDAP *ld, LDAPMessage *entry )); +LDAP_F int ldap_count_entries LDAP_P(( LDAP *ld, LDAPMessage *chain )); + +/* + * in addentry.c + */ +LDAP_F LDAPMessage *ldap_delete_result_entry LDAP_P(( LDAPMessage **list, + LDAPMessage *e )); +LDAP_F void ldap_add_result_entry LDAP_P(( LDAPMessage **list, LDAPMessage *e )); + +/* + * in getdn.c + */ +LDAP_F char *ldap_get_dn LDAP_P(( LDAP *ld, LDAPMessage *entry )); +LDAP_F char *ldap_dn2ufn LDAP_P(( char *dn )); +LDAP_F char **ldap_explode_dn LDAP_P(( char *dn, int notypes )); +LDAP_F char **ldap_explode_dns LDAP_P(( char *dn )); +LDAP_F int ldap_is_dns_dn LDAP_P(( char *dn )); + +/* + * in getattr.c + */ +LDAP_F char *ldap_first_attribute LDAP_P(( LDAP *ld, LDAPMessage *entry, + BerElement **ber )); +LDAP_F char *ldap_next_attribute LDAP_P(( LDAP *ld, LDAPMessage *entry, + BerElement *ber )); + +/* + * in getvalues.c + */ +LDAP_F char **ldap_get_values LDAP_P(( LDAP *ld, LDAPMessage *entry, char *target )); +LDAP_F struct berval **ldap_get_values_len LDAP_P(( LDAP *ld, LDAPMessage *entry, + char *target )); +LDAP_F int ldap_count_values LDAP_P(( char **vals )); +LDAP_F int ldap_count_values_len LDAP_P(( struct berval **vals )); +LDAP_F void ldap_value_free LDAP_P(( char **vals )); +LDAP_F void ldap_value_free_len LDAP_P(( struct berval **vals )); + +/* + * in result.c: + */ +LDAP_F int ldap_result LDAP_P(( LDAP *ld, int msgid, int all, + struct timeval *timeout, LDAPMessage **result )); +LDAP_F int ldap_msgfree LDAP_P(( LDAPMessage *lm )); +LDAP_F int ldap_msgdelete LDAP_P(( LDAP *ld, int msgid )); + +/* + * in search.c: + */ +LDAP_F int ldap_search LDAP_P(( LDAP *ld, char *base, int scope, char *filter, + char **attrs, int attrsonly )); +LDAP_F int ldap_search_s LDAP_P(( LDAP *ld, char *base, int scope, char *filter, + char **attrs, int attrsonly, LDAPMessage **res )); +LDAP_F int ldap_search_st LDAP_P(( LDAP *ld, char *base, int scope, char *filter, + char **attrs, int attrsonly, struct timeval *timeout, LDAPMessage **res )); + +/* + * in ufn.c + */ +LDAP_F int ldap_ufn_search_c LDAP_P(( LDAP *ld, char *ufn, char **attrs, + int attrsonly, LDAPMessage **res, int (*cancelproc)( void *cl ), + void *cancelparm )); +LDAP_F int ldap_ufn_search_ct LDAP_P(( LDAP *ld, char *ufn, char **attrs, + int attrsonly, LDAPMessage **res, int (*cancelproc)( void *cl ), + void *cancelparm, char *tag1, char *tag2, char *tag3 )); +LDAP_F int ldap_ufn_search_s LDAP_P(( LDAP *ld, char *ufn, char **attrs, + int attrsonly, LDAPMessage **res )); +LDAP_F LDAPFiltDesc *ldap_ufn_setfilter LDAP_P(( LDAP *ld, char *fname )); +LDAP_F void ldap_ufn_setprefix LDAP_P(( LDAP *ld, char *prefix )); +LDAP_F int ldap_ufn_timeout LDAP_P(( void *tvparam )); + + +/* + * in unbind.c + */ +LDAP_F int ldap_unbind LDAP_P(( LDAP *ld )); +LDAP_F int ldap_unbind_s LDAP_P(( LDAP *ld )); + + +/* + * in getfilter.c + */ +LDAP_F LDAPFiltDesc *ldap_init_getfilter LDAP_P(( char *fname )); +LDAP_F LDAPFiltDesc *ldap_init_getfilter_buf LDAP_P(( char *buf, long buflen )); +LDAP_F LDAPFiltInfo *ldap_getfirstfilter LDAP_P(( LDAPFiltDesc *lfdp, char *tagpat, + char *value )); +LDAP_F LDAPFiltInfo *ldap_getnextfilter LDAP_P(( LDAPFiltDesc *lfdp )); +LDAP_F void ldap_setfilteraffixes LDAP_P(( LDAPFiltDesc *lfdp, char *prefix, char *suffix )); +LDAP_F void ldap_build_filter LDAP_P(( char *buf, unsigned long buflen, + char *pattern, char *prefix, char *suffix, char *attr, + char *value, char **valwords )); + +/* + * in free.c + */ +LDAP_F void ldap_getfilter_free LDAP_P(( LDAPFiltDesc *lfdp )); +LDAP_F void ldap_mods_free LDAP_P(( LDAPMod **mods, int freemods )); + +/* + * in friendly.c + */ +LDAP_F char *ldap_friendly_name LDAP_P(( char *filename, char *uname, + FriendlyMap **map )); +LDAP_F void ldap_free_friendlymap LDAP_P(( FriendlyMap **map )); + + +/* + * in cldap.c + */ +LDAP_F LDAP *cldap_open LDAP_P(( char *host, int port )); +LDAP_F void cldap_close LDAP_P(( LDAP *ld )); +LDAP_F int cldap_search_s LDAP_P(( LDAP *ld, char *base, int scope, char *filter, + char **attrs, int attrsonly, LDAPMessage **res, char *logdn )); +LDAP_F void cldap_setretryinfo LDAP_P(( LDAP *ld, int tries, int timeout )); + + +/* + * in sort.c + */ +LDAP_F int ldap_sort_entries LDAP_P(( LDAP *ld, + LDAPMessage **chain, char *attr, int (*cmp) () )); +LDAP_F int ldap_sort_values LDAP_P(( LDAP *ld, + char **vals, int (*cmp) LDAP_P((const void *, const void *)) )); +LDAP_F int ldap_sort_strcasecmp LDAP_P(( char **a, char **b )); + + +/* + * in url.c + */ +LDAP_F int ldap_is_ldap_url LDAP_P(( char *url )); +LDAP_F int ldap_url_parse LDAP_P(( char *url, LDAPURLDesc **ludpp )); +LDAP_F void ldap_free_urldesc LDAP_P(( LDAPURLDesc *ludp )); +LDAP_F int ldap_url_search LDAP_P(( LDAP *ld, char *url, int attrsonly )); +LDAP_F int ldap_url_search_s LDAP_P(( LDAP *ld, char *url, int attrsonly, + LDAPMessage **res )); +LDAP_F int ldap_url_search_st LDAP_P(( LDAP *ld, char *url, int attrsonly, + struct timeval *timeout, LDAPMessage **res )); + + +/* + * in charset.c + */ +LDAP_F void ldap_set_string_translators LDAP_P(( LDAP *ld, + BERTranslateProc encode_proc, BERTranslateProc decode_proc )); +LDAP_F int ldap_translate_from_t61 LDAP_P(( LDAP *ld, char **bufp, + unsigned long *lenp, int free_input )); +LDAP_F int ldap_translate_to_t61 LDAP_P(( LDAP *ld, char **bufp, + unsigned long *lenp, int free_input )); +LDAP_F void ldap_enable_translation LDAP_P(( LDAP *ld, LDAPMessage *entry, + int enable )); + +LDAP_F int ldap_t61_to_8859 LDAP_P(( char **bufp, unsigned long *buflenp, + int free_input )); +LDAP_F int ldap_8859_to_t61 LDAP_P(( char **bufp, unsigned long *buflenp, + int free_input )); + + +/* + * in msdos/winsock/wsa.c + */ +LDAP_F void ldap_memfree LDAP_P(( void *p )); + +LDAP_END_DECL -#ifdef __cplusplus -} -#endif #endif /* _LDAP_H */ diff --git a/include/ldap_cdefs.h b/include/ldap_cdefs.h new file mode 100644 index 0000000000..2f7ed6e987 --- /dev/null +++ b/include/ldap_cdefs.h @@ -0,0 +1,36 @@ +/* LDAP C Defines */ + +#ifndef _LDAP_CDEFS_H +#define _LDAP_CDEFS_H + +#if defined(__cplusplus) +# define LDAP_BEGIN_DECL extern "C" { +# define LDAP_END_DECL } +#else +# define LDAP_BEGIN_DECL +# define LDAP_END_DECL +#endif + +#if defined(__STDC__) || defined(__cplusplus) + /* ANSI C or C++ */ +# define LDAP_P(protos) protos +# define LDAP_CONCAT1(x,y) x ## y +# define LDAP_CONCAT(x,y) LDAP_CONCAT1(x,y) +# define LDAP_STRING(x) #x /* stringify without expanding x */ +# define LDAP_XSTRING(x) LDAP_STRING(x) /* expand x, then stringify */ +#else /* ! __STDC__ && ! __cplusplus */ + /* traditional C */ +# define LDAP_P(protos) () +# define LDAP_CONCAT(x,y) x/**/y +# define LDAP_STRING(x) "x" +#endif /* __STDC__ || __cplusplus */ + +#ifndef LDAP_F +# ifdef _WIN32 +# define LDAP_F __declspec( dllexport ) +# else /* ! _WIN32 */ +# define LDAP_F extern +# endif /* _WIN32 */ +#endif /* LDAP_FDECL */ + +#endif /* _LDAP_CDEFS_H */ diff --git a/include/ldapconfig.h.edit b/include/ldapconfig.h.edit index ea88f22a5d..8a053cad5b 100644 --- a/include/ldapconfig.h.edit +++ b/include/ldapconfig.h.edit @@ -16,7 +16,7 @@ /* * config.h for LDAP -- edit this file to customize LDAP client behavior. * NO platform-specific definitions should be placed in this file. - * Note that this is NOT used by the LDAP or LBER libraries. + * Note that this IS USED by the LDAP or LBER libraries. */ /* @@ -24,26 +24,26 @@ */ #define DEFAULT_BINDIR "%BINDIR%" #define DEFAULT_SBINDIR "%SBINDIR%" -#define DEFAULT_ETCDIR "%ETCDIR%" +#define DEFAULT_SYSCONFDIR "%SYSCONFDIR%" #define DEFAULT_LIBEXECDIR "%LIBEXECDIR%" /* default ldap host */ #define LDAPHOST "localhost" -#define DEFAULT_LDAPHOST_FILE "%ETCDIR%/ldaphost" +#define DEFAULT_LDAPHOST_FILE "%SYSCONFDIR%/ldaphost" /* default place to start searching */ #define DEFAULT_BASE "o=Your Organization Name, c=US" -#define DEFAULT_BASE_FILE "%ETCDIR%/ldapbase" +#define DEFAULT_BASE_FILE "%SYSCONFDIR%/ldapbase" /* * default binddn and creditials * use files, make sure they are not generally readable */ #define DEFAULT_BINDDN NULL -#define DEFAULT_BINDDN_FILE "%ETCDIR%/ldapbinddn" +#define DEFAULT_BINDDN_FILE "%SYSCONFDIR%/ldapbinddn" #define DEFAULT_BIND_CRED NULL -#define DEFAULT_BIND_CRED_FILE "%ETCDIR%/ldapbindcred" +#define DEFAULT_BIND_CRED_FILE "%SYSCONFDIR%/ldapbindcred" /********************************************************************* * * @@ -59,10 +59,10 @@ /* default count of DN components to show in entry displays */ #define DEFAULT_RDNCOUNT 2 /* default config file locations */ -#define FILTERFILE "%ETCDIR%/ldapfilter.conf" -#define TEMPLATEFILE "%ETCDIR%/ldaptemplates.conf" -#define SEARCHFILE "%ETCDIR%/ldapsearchprefs.conf" -#define FRIENDLYFILE "%ETCDIR%/ldapfriendly" +#define FILTERFILE "%SYSCONFDIR%/ldapfilter.conf" +#define TEMPLATEFILE "%SYSCONFDIR%/ldaptemplates.conf" +#define SEARCHFILE "%SYSCONFDIR%/ldapsearchprefs.conf" +#define FRIENDLYFILE "%SYSCONFDIR%/ldapfriendly" /* * FINGER DEFINITIONS @@ -136,7 +136,7 @@ Please try again later.\r\n" #define GO500GW_BINDDN NULL #define GO500GW_BIND_CRED NULL /* where the helpfile lives */ -#define GO500GW_HELPFILE "%ETCDIR%/go500gw.help" +#define GO500GW_HELPFILE "%SYSCONFDIR%/go500gw.help" /* port on which to listen */ #define GO500GW_PORT 7777 /* timeout on all searches */ @@ -160,7 +160,7 @@ Please try again later.\r\n" #define RCPT500_BINDDN NULL #define RCPT500_BIND_CRED NULL /* where the helpfile lives */ -#define RCPT500_HELPFILE "%ETCDIR%/rcpt500.help" +#define RCPT500_HELPFILE "%SYSCONFDIR%/rcpt500.help" /* maximum number of matches returned */ #define RCPT500_SIZELIMIT 50 /* address replies will appear to come from */ @@ -234,7 +234,7 @@ Please try again later.\r\n" * UD DEFINITIONS */ /* ud configuration file */ -#define UD_CONFIG_FILE "%ETCDIR%/ud.conf" +#define UD_CONFIG_FILE "%SYSCONFDIR%/ud.conf" /* default editor */ #define UD_DEFAULT_EDITOR "%EDITOR%" /* default bbasename of user config file */ @@ -283,7 +283,7 @@ Please try again later.\r\n" * SLAPD DEFINITIONS */ /* location of the default slapd config file */ -#define SLAPD_DEFAULT_CONFIGFILE "%ETCDIR%/slapd.conf" +#define SLAPD_DEFAULT_CONFIGFILE "%SYSCONFDIR%/slapd.conf" /* default max deref depth for aliases */ #define SLAPD_DEFAULT_MAXDEREFDEPTH 15 /* default sizelimit on number of entries from a search */ diff --git a/include/ldapconfig.h.nt b/include/ldapconfig.h.nt new file mode 100644 index 0000000000..d3ba09123b --- /dev/null +++ b/include/ldapconfig.h.nt @@ -0,0 +1,302 @@ +/* + * 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 _LDAP_CONFIG_H +#define _LDAP_CONFIG_H + +/* + * config.h for LDAP -- edit this file to customize LDAP client behavior. + * NO platform-specific definitions should be placed in this file. + * Note that this is NOT used by the LDAP or LBER libraries. + */ + +/* + * SHARED DEFINITIONS - things you should change + */ +#define DEFAULT_BINDIR "C:\\OpenLDAP\\bin" +#define DEFAULT_SBINDIR "C:\\OpenLDAP\\sbin" +#define DEFAULT_ETCDIR "C:\\OpenLDAP\\etc" +#define DEFAULT_LIBEXECDIR "C:\\OpenLDAP\\execdir" + +/* default ldap host */ +#define LDAPHOST "localhost" + +#define DEFAULT_LDAPHOST_FILE "C:\\OpenLDAP\\etc\\ldaphost" +/* default place to start searching */ +#define DEFAULT_BASE "o=Your Organization Name, c=US" +#define DEFAULT_BASE_FILE "C:\\OpenLDAP\\etc\\ldapbase" + +/* + * default binddn and creditials + * use files, make sure they are not generally readable + */ +#define DEFAULT_BINDDN NULL +#define DEFAULT_BINDDN_FILE "C:\\OpenLDAP\\etc\\ldapbinddn" + +#define DEFAULT_BIND_CRED NULL +#define DEFAULT_BIND_CRED_FILE "C:\\OpenLDAP\\etc\\ldapbindcred" + +/********************************************************************* + * * + * You probably do not need to edit anything below this point * + * * + *********************************************************************/ + +/* + * SHARED DEFINITIONS - other things you can change + */ + /* default attribute to use when sorting entries, NULL => sort by DN */ +#define SORT_ATTR NULL + /* default count of DN components to show in entry displays */ +#define DEFAULT_RDNCOUNT 2 + /* default config file locations */ +#define FILTERFILE "C:\\OpenLDAP\\etc\\ldapfilter.conf" +#define TEMPLATEFILE "C:\\OpenLDAP\\etc\\ldaptemplates.conf" +#define SEARCHFILE "C:\\OpenLDAP\\etc\\ldapsearchprefs.conf" +#define FRIENDLYFILE "C:\\OpenLDAP\\etc\\ldapfriendly" + +/* + * FINGER DEFINITIONS + */ + /* who to bind as */ +#define FINGER_BINDDN NULL +#define FINGER_BIND_CRED NULL + /* where to search */ +#define FINGER_BASE DEFAULT_BASE + /* banner to print */ +#define FINGER_BANNER "X.500 Finger Service...\r\n" + /* who to report errors to */ +#define FINGER_ERRORS "System Administrator" + /* what to say if no matches are found */ +#define FINGER_NOMATCH "Search failed to find anything.\r\n" + /* what to say if the service may be unavailable */ +#define FINGER_UNAVAILABLE \ +"The directory service may be temporarily unavailable.\r\n\ +Please try again later.\r\n" + /* printed if a match has no email address - for disptmp default */ +#define FINGER_NOEMAIL1 "None registered in this service." +#define FINGER_NOEMAIL2 NULL +#define FINGER_NOEMAIL { FINGER_NOEMAIL1, FINGER_NOEMAIL2, NULL } + /* maximum number of matches returned */ +#define FINGER_SIZELIMIT 50 + /* max number of hits displayed in full before a list is presented */ +#define FINGER_LISTLIMIT 1 + /* what to exec for "finger @host" */ +#define FINGER_CMD "%FINGER%" + /* how to treat aliases when searching */ +#define FINGER_DEREF LDAP_DEREF_FINDING + /* attribute to use when sorting results */ +#define FINGER_SORT_ATTR SORT_ATTR + /* enable ufn support */ +#define FINGER_UFN + /* timeout for searches */ +#define FINGER_TIMEOUT 60 + /* number of DN components to show in entry displays */ +#define FINGER_RDNCOUNT DEFAULT_RDNCOUNT + +/* + * GO500 GOPHER GATEWAY DEFINITIONS + */ + /* who to bind as */ +#define GO500_BINDDN NULL +#define GO500_BIND_CRED NULL + /* where to search */ +#define GO500_BASE DEFAULT_BASE + /* port on which to listen */ +#define GO500_PORT 5555 + /* how to handle aliases */ +#define GO500_DEREF LDAP_DEREF_FINDING + /* attribute to use when sorting results */ +#define GO500_SORT_ATTR SORT_ATTR + /* timeout for searches */ +#define GO500_TIMEOUT 180 + /* enable ufn support */ +#define GO500_UFN + /* + * only set and uncomment this if your hostname() does not return + * a fully qualified hostname + */ +/* #define GO500_HOSTNAME "fully.qualified.hostname.here" */ + /* number of DN components to show in entry displays */ +#define GO500_RDNCOUNT DEFAULT_RDNCOUNT + +/* + * GO500GW GOPHER GATEWAY DEFINITIONS + */ + /* who to bind as */ +#define GO500GW_BINDDN NULL +#define GO500GW_BIND_CRED NULL + /* where the helpfile lives */ +#define GO500GW_HELPFILE "C:\\OpenLDAP\\etc\\go500gw.help" + /* port on which to listen */ +#define GO500GW_PORT 7777 + /* timeout on all searches */ +#define GO500GW_TIMEOUT 180 + /* enable ufn support */ +#define GO500GW_UFN + /* attribute to use when sorting results */ +#define GO500GW_SORT_ATTR SORT_ATTR + /* + * only set and uncomment this if your hostname() does not return + * a fully qualified hostname + */ +/* #define GO500GW_HOSTNAME "fully.qualified.hostname.here" */ + /* number of DN components to show in entry displays */ +#define GO500GW_RDNCOUNT DEFAULT_RDNCOUNT + +/* + * RCPT500 MAIL RESPONDER GATEWAY DEFINITIONS + */ + /* who to bind as */ +#define RCPT500_BINDDN NULL +#define RCPT500_BIND_CRED NULL + /* where the helpfile lives */ +#define RCPT500_HELPFILE "C:\\OpenLDAP\\etc\\rcpt500.help" + /* maximum number of matches returned */ +#define RCPT500_SIZELIMIT 50 + /* address replies will appear to come from */ +#define RCPT500_FROM "\"Directory Query Program\" " + /* command that will accept an RFC822 message text on standard + input, and send it. sendmail -t does this nicely. */ +#define RCPT500_PIPEMAILCMD "%SENDMAIL% -t" + /* where to search */ +#define RCPT500_BASE DEFAULT_BASE + /* attribute to use when sorting results */ +#define RCPT500_SORT_ATTR SORT_ATTR + /* max number of hits displayed in full before a list is presented */ +#define RCPT500_LISTLIMIT 1 + /* enable ufn support */ +#define RCPT500_UFN + /* number of DN components to show in entry displays */ +#define RCPT500_RDNCOUNT DEFAULT_RDNCOUNT + +/* + * LDAPSEARCH TOOL + */ + /* who to bind as */ +#define LDAPSEARCH_BINDDN NULL +#define LDAPSEARCH_BIND_CRED NULL + /* search base */ +#define LDAPSEARCH_BASE DEFAULT_BASE + +/* + * LDAPMODIFY TOOL + */ + /* who to bind as */ +#define LDAPMODIFY_BINDDN NULL +#define LDAPMODIFY_BIND_CRED NULL + /* search base */ +#define LDAPMODIFY_BASE DEFAULT_BASE + +/* + * LDAPDELETE TOOL + */ + /* who to bind as */ +#define LDAPDELETE_BINDDN NULL +#define LDAPDELETE_BIND_CRED NULL + /* search base */ +#define LDAPDELETE_BASE DEFAULT_BASE + +/* + * LDAPMODRDN TOOL + */ + /* who to bind as */ +#define LDAPMODRDN_BINDDN NULL +#define LDAPMODRDN_BIND_CRED NULL + /* search base */ +#define LDAPMODRDN_BASE DEFAULT_BASE + +/* + * MAIL500 MAILER DEFINITIONS + */ + /* who to bind as */ +#define MAIL500_BINDDN NULL +#define MAIL500_BIND_CRED NULL + /* max number of ambiguous matches reported */ +#define MAIL500_MAXAMBIGUOUS 10 + /* max subscribers allowed (size limit when searching for them ) */ +#define MAIL500_MAXGROUPMEMBERS LDAP_NO_LIMIT + /* timeout for all searches */ +#define MAIL500_TIMEOUT 180 + /* sendmail location - mail500 needs to exec this */ +#define MAIL500_SENDMAIL "%SENDMAIL%" + +/* + * UD DEFINITIONS + */ + /* ud configuration file */ +#define UD_CONFIG_FILE "C:\\OpenLDAP\\etc\\ud.conf" + /* default editor */ +#define UD_DEFAULT_EDITOR "C:\\OpenLDAP\\etc" + /* default bbasename of user config file */ +#define UD_USER_CONFIG_FILE ".udrc" + /* default user to bind as */ +#define UD_BINDDN NULL + /* default password to bind with */ +#define UD_BIND_CRED NULL + /* default search base */ +#define UD_BASE DEFAULT_BASE + /* default base where groups are created */ +#define UD_WHERE_GROUPS_ARE_CREATED "" + /* default base below which all groups live */ +#define UD_WHERE_ALL_GROUPS_LIVE "" + +/* + * FAX500 DEFINITIONS + */ + /* what to bind as */ +#define FAX_BINDDN NULL +#define FAX_BIND_CRED NULL + /* default search base */ +#define FAX_BASE DEFAULT_BASE + /* how long to wait for searches */ +#define FAX_TIMEOUT 180 + /* maximum number of ambiguous matches reported */ +#define FAX_MAXAMBIGUOUS 10 + /* maximum number of members allowed */ +#define FAX_MAXMEMBERS LDAP_NO_LIMIT + /* program to send mail */ +#define FAX_SENDMAIL "%SENDMAIL%" + +/* + * RP500 DEFINITIONS + */ + /* what to bind as */ +#define RP_BINDDN NULL +#define RP_BIND_CRED NULL + /* default search base */ +#define RP_BASE DEFAULT_BASE + + /* prefix to add to non-fully-qualified numbers */ +#define RP_PHONEPREFIX "" + +/* + * SLAPD DEFINITIONS + */ + /* location of the default slapd config file */ +#define SLAPD_DEFAULT_CONFIGFILE "C:\\OpenLDAP\\etc\\slapd.conf" + /* default sizelimit on number of entries from a search */ +#define SLAPD_DEFAULT_SIZELIMIT 500 + /* default timelimit to spend on a search */ +#define SLAPD_DEFAULT_TIMELIMIT 3600 + /* location of the slapd pid file */ +#define SLAPD_PIDFILE "C:\\OpenLDAP\\run\\slapd.pid" + /* location of the slapd args file */ +#define SLAPD_ARGSFILE "C:\\OpenLDAP\\run\\slapd.args" + /* dn of the special "monitor" entry */ +#define SLAPD_MONITOR_DN "cn=monitor" + /* dn of the special "config" entry */ +#define SLAPD_CONFIG_DN "cn=config" + /* minimum max ids that a single index entry can map to in ldbm */ +#define SLAPD_LDBM_MIN_MAXIDS 4000 + +#endif /* _LDAP_CONFIG_H */ diff --git a/include/ldbm.h b/include/ldbm.h index f31f135ff8..0f4c07c3ad 100644 --- a/include/ldbm.h +++ b/include/ldbm.h @@ -3,43 +3,11 @@ #ifndef _LDBM_H_ #define _LDBM_H_ -#ifdef LDBM_USE_GDBM - -/***************************************************************** - * * - * use gdbm if possible * - * * - *****************************************************************/ - -#include - -typedef datum Datum; - -typedef GDBM_FILE LDBM; - -extern gdbm_error gdbm_errno; - -/* for ldbm_open */ -#define LDBM_READER GDBM_READER -#define LDBM_WRITER GDBM_WRITER -#define LDBM_WRCREAT GDBM_WRCREAT -#define LDBM_NEWDB GDBM_NEWDB -#define LDBM_FAST GDBM_FAST - -#define LDBM_SUFFIX ".gdbm" - -/* for ldbm_insert */ -#define LDBM_INSERT GDBM_INSERT -#define LDBM_REPLACE GDBM_REPLACE -#define LDBM_SYNC 0x80000000 - -#else /* end of gdbm */ - -#ifdef LDBM_USE_DBHASH +#ifdef LDBM_USE_DBBTREE /***************************************************************** * * - * use berkeley db hash package * + * use berkeley db btree package * * * *****************************************************************/ @@ -47,26 +15,27 @@ extern gdbm_error gdbm_errno; #include #include -#ifdef LDBM_USE_DB2_COMPAT185 +#ifdef HAVE_DB185_H # include #else # include -# ifdef LDBM_USE_DB2 +# ifdef HAVE_BERKELEY_DB2 # define R_NOOVERWRITE DB_NOOVERWRITE # define DEFAULT_DB_PAGE_SIZE 1024 # endif #endif + typedef DBT Datum; #define dsize size #define dptr data typedef DB *LDBM; -#define DB_TYPE DB_HASH +#define DB_TYPE DB_BTREE /* for ldbm_open */ -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 # define LDBM_READER DB_RDONLY # define LDBM_WRITER 0x00000 /* hopefully */ # define LDBM_WRCREAT (DB_NOMMAP|DB_CREATE|DB_THREAD) @@ -76,25 +45,23 @@ typedef DB *LDBM; # define LDBM_WRITER O_RDWR # define LDBM_WRCREAT (O_RDWR|O_CREAT) # define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) -# define LDBM_FAST 0 #endif -#define LDBM_SUFFIX ".dbh" +# define LDBM_FAST 0 + +#define LDBM_SUFFIX ".dbb" +#define LDBM_ORDERED 1 /* for ldbm_insert */ #define LDBM_INSERT R_NOOVERWRITE #define LDBM_REPLACE 0 #define LDBM_SYNC 0x80000000 -extern int errno; - -#else /* end of db hash */ - -#ifdef LDBM_USE_DBBTREE +#elif defined( LDBM_USE_DBHASH ) /***************************************************************** * * - * use berkeley db btree package * + * use berkeley db hash package * * * *****************************************************************/ @@ -102,7 +69,7 @@ extern int errno; #include #include -#ifdef LDBM_USE_DB2_COMPAT185 +#ifdef HAVE_DB185_H # include #else # include @@ -112,14 +79,13 @@ extern int errno; # endif #endif - typedef DBT Datum; #define dsize size #define dptr data typedef DB *LDBM; -#define DB_TYPE DB_BTREE +#define DB_TYPE DB_HASH /* for ldbm_open */ #ifdef LDBM_USE_DB2 @@ -132,23 +98,48 @@ typedef DB *LDBM; # define LDBM_WRITER O_RDWR # define LDBM_WRCREAT (O_RDWR|O_CREAT) # define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) +# define LDBM_FAST 0 #endif -# define LDBM_FAST 0 - -#define LDBM_SUFFIX ".dbb" -#define LDBM_ORDERED 1 +#define LDBM_SUFFIX ".dbh" /* for ldbm_insert */ #define LDBM_INSERT R_NOOVERWRITE #define LDBM_REPLACE 0 #define LDBM_SYNC 0x80000000 -extern int errno; +#elif defined( HAVE_GDBM ) + +/***************************************************************** + * * + * use gdbm if possible * + * * + *****************************************************************/ + +#include + +typedef datum Datum; + +typedef GDBM_FILE LDBM; + +extern gdbm_error gdbm_errno; + +/* for ldbm_open */ +#define LDBM_READER GDBM_READER +#define LDBM_WRITER GDBM_WRITER +#define LDBM_WRCREAT GDBM_WRCREAT +#define LDBM_NEWDB GDBM_NEWDB +#define LDBM_FAST GDBM_FAST + +#define LDBM_SUFFIX ".gdbm" + +/* for ldbm_insert */ +#define LDBM_INSERT GDBM_INSERT +#define LDBM_REPLACE GDBM_REPLACE +#define LDBM_SYNC 0x80000000 -#else /* end of db btree */ -#ifdef LDBM_USE_NDBM +#elif defined( HAVE_NDBM ) /***************************************************************** * * @@ -157,7 +148,8 @@ extern int errno; *****************************************************************/ #include -#ifndef O_RDONLY + +#ifdef HAVE_FCNTL_H #include #endif @@ -179,10 +171,7 @@ typedef DBM *LDBM; #define LDBM_REPLACE DBM_REPLACE #define LDBM_SYNC 0 -#endif /* ndbm */ -#endif /* db hash */ -#endif /* db btree */ -#endif /* gdbm */ +#endif int ldbm_errno( LDBM ldbm ); LDBM ldbm_open( char *name, int rw, int mode, int dbcachesize ); @@ -194,7 +183,7 @@ Datum ldbm_fetch( LDBM ldbm, Datum key ); int ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ); int ldbm_delete( LDBM ldbm, Datum key ); -#if LDBM_USE_DB2 +#if HAVE_BERKELEY_DB2 void *ldbm_malloc( size_t size ); Datum ldbm_firstkey( LDBM ldbm, DBC **dbch ); Datum ldbm_nextkey( LDBM ldbm, Datum key, DBC *dbcp ); diff --git a/include/ldif.h b/include/ldif.h index 366576c95a..217fe7a678 100644 --- a/include/ldif.h +++ b/include/ldif.h @@ -13,9 +13,9 @@ #ifndef _LDIF_H #define _LDIF_H -#ifdef __cplusplus -extern "C" { -#endif +#include + +LDAP_BEGIN_DECL #define LINE_WIDTH 76 /* maximum length of LDIF lines */ @@ -36,21 +36,11 @@ extern "C" { ((tlen) + 4 + LDIF_BASE64_LEN(vlen) \ + ((LDIF_BASE64_LEN(vlen) + (tlen) + 3) / LINE_WIDTH * 2 )) +int str_parse_line LDAP_P(( char *line, char **type, char **value, int *vlen)); +char * str_getline LDAP_P(( char **next )); +void put_type_and_value LDAP_P(( char **out, char *t, char *val, int vlen )); +char *ldif_type_and_value LDAP_P(( char *type, char *val, int vlen )); -#ifdef NEEDPROTOS -int str_parse_line( char *line, char **type, char **value, int *vlen); -char * str_getline( char **next ); -void put_type_and_value( char **out, char *t, char *val, int vlen ); -char *ldif_type_and_value( char *type, char *val, int vlen ); -#else /* NEEDPROTOS */ -int str_parse_line(); -char * str_getline(); -void put_type_and_value(); -char *ldif_type_and_value(); -#endif /* NEEDPROTOS */ - -#ifdef __cplusplus -} -#endif +LDAP_END_DECL #endif /* _LDIF_H */ diff --git a/include/lthread.h b/include/lthread.h index df13e93aac..cf27dbd88d 100644 --- a/include/lthread.h +++ b/include/lthread.h @@ -3,56 +3,53 @@ #ifndef _LTHREAD_H #define _LTHREAD_H -#if defined ( THREAD_NEXT_CTHREADS ) +#include "portable.h" -#define _THREAD +#if defined( HAVE_PTHREADS ) +/********************************** + * * + * definitions for POSIX Threads * + * * + **********************************/ -#include +#include +#ifdef HAVE_SCHED_H +#include +#endif -typedef cthread_fn_t VFP; -typedef int pthread_attr_t; -typedef cthread_t pthread_t; +LDAP_BEGIN_DECL -/* default attr states */ +#if defined( HAVE_DCE ) +#define pthread_attr_init( a ) pthread_attr_create( a ) +#define pthread_attr_destroy( a ) pthread_attr_delete( a ) +#define pthread_attr_setdetachstate( a, b ) \ + pthread_attr_setdetach_np( a, b ) + +#elif !defined(HAVE_PTHREADS_D4) #define pthread_mutexattr_default NULL #define pthread_condattr_default NULL -/* thread state - joinable or not */ -#define PTHREAD_CREATE_JOINABLE 0 -#define PTHREAD_CREATE_DETACHED 1 -/* thread scope - who is in scheduling pool */ -#define PTHREAD_SCOPE_PROCESS 0 -#define PTHREAD_SCOPE_SYSTEM 1 - -/* mutex attributes and mutex type */ -typedef int pthread_mutexattr_t; -typedef struct mutex pthread_mutex_t; - -/* mutex and condition variable scope - process or system */ -#define PTHREAD_SHARE_PRIVATE 0 -#define PTHREAD_SHARE_PROCESS 1 - -/* condition variable attributes and condition variable type */ -typedef int pthread_condattr_t; -typedef struct condition pthread_cond_t; +#ifdef HAVE_SCHED_YIELD +#define pthread_yield sched_yield +#endif +#endif -#elif defined( THREAD_SUNOS4_LWP ) -/*********************************** - * * - * thread definitions for sunos4 * - * * - ***********************************/ +LDAP_END_DECL -#define _THREAD +#elif defined ( HAVE_MACH_CTHREADS ) +/********************************** + * * + * definitions for Mach CThreads * + * * + **********************************/ -#include -#include +#include -typedef void *(*VFP)(); +LDAP_BEGIN_DECL -/* thread attributes and thread type */ +typedef cthread_fn_t VFP; typedef int pthread_attr_t; -typedef thread_t pthread_t; +typedef cthread_t pthread_t; /* default attr states */ #define pthread_mutexattr_default NULL @@ -67,7 +64,7 @@ typedef thread_t pthread_t; /* mutex attributes and mutex type */ typedef int pthread_mutexattr_t; -typedef mon_t pthread_mutex_t; +typedef struct mutex pthread_mutex_t; /* mutex and condition variable scope - process or system */ #define PTHREAD_SHARE_PRIVATE 0 @@ -75,35 +72,23 @@ typedef mon_t pthread_mutex_t; /* condition variable attributes and condition variable type */ typedef int pthread_condattr_t; -typedef struct lwpcv { - int lcv_created; - cv_t lcv_cv; -} pthread_cond_t; +typedef struct condition pthread_cond_t; -#else /* end sunos4 */ +LDAP_END_DECL -#if defined( THREAD_SUNOS5_LWP ) -/*********************************** - * * - * thread definitions for sunos5 * - * * - ***********************************/ - -#define _THREAD +#elif defined( HAVE_THR ) +/************************************** + * * + * thread definitions for Solaris LWP * + * * + **************************************/ #include #include -typedef void *(*VFP)(); - -/* sunos5 threads are preemptive */ -#define PTHREAD_PREEMPTIVE 1 +LDAP_BEGIN_DECL -#if !defined(__SunOS_5_6) -/* thread attributes and thread type */ -typedef int pthread_attr_t; -typedef thread_t pthread_t; -#endif /* ! sunos56 */ +typedef void *(*VFP)(); /* default attr states */ #define pthread_mutexattr_default NULL @@ -115,75 +100,74 @@ typedef thread_t pthread_t; /* thread scope - who is in scheduling pool */ #define PTHREAD_SCOPE_PROCESS 0 #define PTHREAD_SCOPE_SYSTEM THR_BOUND +/* mutex and condition variable scope - process or system */ +#define PTHREAD_SHARE_PRIVATE USYNC_THREAD +#define PTHREAD_SHARE_PROCESS USYNC_PROCESS + #if !defined(__SunOS_5_6) +/* thread attributes and thread type */ +typedef int pthread_attr_t; +typedef thread_t pthread_t; + /* mutex attributes and mutex type */ typedef int pthread_mutexattr_t; typedef mutex_t pthread_mutex_t; -#endif /* ! sunos56 */ - -/* mutex and condition variable scope - process or system */ -#define PTHREAD_SHARE_PRIVATE USYNC_THREAD -#define PTHREAD_SHARE_PROCESS USYNC_PROCESS -#if !defined(__SunOS_5_6) /* condition variable attributes and condition variable type */ typedef int pthread_condattr_t; typedef cond_t pthread_cond_t; #endif /* ! sunos56 */ -#else /* end sunos5 */ - -#if defined( THREAD_MIT_PTHREADS ) -/*********************************** - * * - * definitions for mit pthreads * - * * - ***********************************/ +LDAP_END_DECL -#define _THREAD +#elif defined( HAVE_LWP ) +/************************************* + * * + * thread definitions for SunOS LWP * + * * + *************************************/ -#include - -#else /* end mit pthreads */ - -#if defined( THREAD_DCE_PTHREADS ) -/*********************************** - * * - * definitions for mit pthreads * - * * - ***********************************/ - -#define _THREAD +#include +#include -#include +LDAP_BEGIN_DECL -/* dce threads are preemptive */ -#define PTHREAD_PREEMPTIVE 1 +typedef void *(*VFP)(); -#define pthread_attr_init( a ) pthread_attr_create( a ) -#define pthread_attr_destroy( a ) pthread_attr_delete( a ) -#define pthread_attr_setdetachstate( a, b ) \ - pthread_attr_setdetach_np( (a), (b) ) +/* thread attributes and thread type */ +typedef int pthread_attr_t; +typedef thread_t pthread_t; -#else /* end dce pthreads */ +/* default attr states */ +#define pthread_mutexattr_default NULL +#define pthread_condattr_default NULL -#if defined( POSIX_THREADS ) +/* thread state - joinable or not */ +#define PTHREAD_CREATE_JOINABLE 0 +#define PTHREAD_CREATE_DETACHED 1 +/* thread scope - who is in scheduling pool */ +#define PTHREAD_SCOPE_PROCESS 0 +#define PTHREAD_SCOPE_SYSTEM 1 -#define _THREAD +/* mutex attributes and mutex type */ +typedef int pthread_mutexattr_t; +typedef mon_t pthread_mutex_t; -#include +/* mutex and condition variable scope - process or system */ +#define PTHREAD_SHARE_PRIVATE 0 +#define PTHREAD_SHARE_PROCESS 1 -#define pthread_mutexattr_default NULL -#define pthread_condattr_default NULL +/* condition variable attributes and condition variable type */ +typedef int pthread_condattr_t; +typedef struct lwpcv { + int lcv_created; + cv_t lcv_cv; +} pthread_cond_t; -#endif /* posix threads */ -#endif /* dce pthreads */ -#endif /* mit pthreads */ -#endif /* sunos5 */ -#endif /* sunos4 */ +LDAP_END_DECL -#ifndef _THREAD +#else /*********************************** * * @@ -192,6 +176,17 @@ typedef cond_t pthread_cond_t; * * ***********************************/ +LDAP_BEGIN_DECL + +#ifndef NO_THREADS +#define NO_THREADS 1 +#endif + +#ifndef PREEMPTIVE_THREADS +/* treat no threads as preemptive */ +#define PREEMPTIVE_THREADS 1 +#endif + typedef void *(*VFP)(); /* thread attributes and thread type */ @@ -221,5 +216,7 @@ typedef int pthread_mutex_t; typedef int pthread_condattr_t; typedef int pthread_cond_t; +LDAP_END_DECL + #endif /* no threads support */ #endif /* _LTHREAD_H */ diff --git a/include/lthread_rdwr.h b/include/lthread_rdwr.h index 59b1df4a09..100e9b62d2 100644 --- a/include/lthread_rdwr.h +++ b/include/lthread_rdwr.h @@ -14,6 +14,10 @@ * */ +#include + +LDAP_BEGIN_DECL + typedef struct rdwr_var { int readers_reading; int writer_writing; @@ -25,16 +29,18 @@ typedef void * pthread_rdwrattr_t; #define pthread_rdwrattr_default NULL; -int pthread_rdwr_init_np(pthread_rdwr_t *rdwrp, pthread_rdwrattr_t *attrp); -int pthread_rdwr_rlock_np(pthread_rdwr_t *rdwrp); -int pthread_rdwr_runlock_np(pthread_rdwr_t *rdwrp); -int pthread_rdwr_wlock_np(pthread_rdwr_t *rdwrp); -int pthread_rdwr_wunlock_np(pthread_rdwr_t *rdwrp); +LDAP_F int pthread_rdwr_init_np LDAP_P((pthread_rdwr_t *rdwrp, pthread_rdwrattr_t *attrp)); +LDAP_F int pthread_rdwr_rlock_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_runlock_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_wlock_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_wunlock_np LDAP_P((pthread_rdwr_t *rdwrp)); #ifdef LDAP_DEBUG -int pthread_rdwr_rchk_np(pthread_rdwr_t *rdwrp); -int pthread_rdwr_wchk_np(pthread_rdwr_t *rdwrp); -int pthread_rdwr_rwchk_np(pthread_rdwr_t *rdwrp); +LDAP_F int pthread_rdwr_rchk_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_wchk_np LDAP_P((pthread_rdwr_t *rdwrp)); +LDAP_F int pthread_rdwr_rwchk_np LDAP_P((pthread_rdwr_t *rdwrp)); #endif /* LDAP_DEBUG */ +LDAP_END_DECL + #endif /* _LTHREAD_RDWR_H */ diff --git a/include/lutil.h b/include/lutil.h index 654450c667..4d8d209b5d 100644 --- a/include/lutil.h +++ b/include/lutil.h @@ -1,12 +1,18 @@ #ifndef _LUTIL_H #define _LUTIL_H 1 +#include /* * Include file for LDAP utility routine */ /* ISC Base64 Routines */ -extern int b64_ntop(u_char const *, size_t, char *, size_t); -extern int b64_pton(char const *, u_char *, size_t); + +LDAP_BEGIN_DECL + +LDAP_F int b64_ntop LDAP_P((u_char const *, size_t, char *, size_t)); +LDAP_F int b64_pton LDAP_P((char const *, u_char *, size_t)); + +LDAP_END_DECL #endif /* _LUTIL_H */ diff --git a/include/lutil_md5.h b/include/lutil_md5.h index ed7181c438..e7d8b0682f 100644 --- a/include/lutil_md5.h +++ b/include/lutil_md5.h @@ -1,7 +1,11 @@ /* See md5.c for explanation and copyright information. */ -#ifndef LDAP_MD5_H -#define LDAP_MD5_H +#ifndef _LDAP_MD5_H_ +#define _LDAP_MD5_H_ + +#include + +LDAP_BEGIN_DECL /* Unlike previous versions of this code, uint32 need not be exactly 32 bits, merely 32 bits or more. Choosing a data type which is 32 @@ -14,20 +18,33 @@ typedef unsigned long uint32; #endif -struct MD5Context { +struct ldap_MD5Context { uint32 buf[4]; uint32 bits[2]; unsigned char in[64]; }; -void ldap_MD5Init(struct MD5Context *context); -void ldap_MD5Update(struct MD5Context *context, unsigned char const *buf, unsigned len); -void ldap_MD5Final(unsigned char digest[16], struct MD5Context *context); -void ldap_MD5Transform(uint32 buf[4], const unsigned char in[64]); +LDAP_F void ldap_MD5Init LDAP_P(( + struct ldap_MD5Context *context)); + +LDAP_F void ldap_MD5Update LDAP_P(( + struct ldap_MD5Context *context, + unsigned char const *buf, + unsigned len)); + +LDAP_F void ldap_MD5Final LDAP_P(( + unsigned char digest[16], + struct ldap_MD5Context *context)); + +LDAP_F void ldap_MD5Transform LDAP_P(( + uint32 buf[4], + const unsigned char in[64])); /* * This is needed to make RSAREF happy on some MS-DOS compilers. */ -typedef struct MD5Context MD5_CTX; +typedef struct ldap_MD5Context ldap_MD5_CTX; + +LDAP_END_DECL -#endif /* !LDAP_MD5_H */ +#endif /* _LDAP_MD5_H_ */ diff --git a/include/lutil_sha1.h b/include/lutil_sha1.h index 7e1da078ac..b20d490305 100644 --- a/include/lutil_sha1.h +++ b/include/lutil_sha1.h @@ -1,6 +1,13 @@ /* This version is based on: * $OpenBSD: sha1.h,v 1.8 1997/07/15 01:54:23 millert Exp $ */ +#ifndef _LDAP_SHA1_H_ +#define _LDAP_SHA1_H_ + +#include + +LDAP_BEGIN_DECL + /* * SHA-1 in C * By Steve Reid @@ -17,12 +24,29 @@ typedef struct { uint32 state[5]; uint32 count[2]; unsigned char buffer[64]; -} SHA1_CTX; +} ldap_SHA1_CTX; -void ldap_SHA1Transform __P((uint32 state[5], const unsigned char buffer[64])); -void ldap_SHA1Init __P((SHA1_CTX *context)); -void ldap_SHA1Update __P((SHA1_CTX *context, const unsigned char *data, u_int len)); -void ldap_SHA1Final __P((unsigned char digest[20], SHA1_CTX *context)); -char *ldap_SHA1End __P((SHA1_CTX *, char *)); -char *ldap_SHA1File __P((char *, char *)); -char *ldap_SHA1Data __P((const unsigned char *, size_t, char *)); +LDAP_F void ldap_SHA1Transform + LDAP_P((uint32 state[5], const unsigned char buffer[64])); + +LDAP_F void ldap_SHA1Init + LDAP_P((ldap_SHA1_CTX *context)); + +LDAP_F void ldap_SHA1Update + LDAP_P((ldap_SHA1_CTX *context, const unsigned char *data, u_int len)); + +LDAP_F void ldap_SHA1Final + LDAP_P((unsigned char digest[20], ldap_SHA1_CTX *context)); + +LDAP_F char *ldap_SHA1End + LDAP_P((ldap_SHA1_CTX *, char *)); + +LDAP_F char *ldap_SHA1File + LDAP_P((char *, char *)); + +LDAP_F char *ldap_SHA1Data + LDAP_P((const unsigned char *, size_t, char *)); + +LDAP_END_DECL + +#endif /* _LDAP_SHA1_H_ */ diff --git a/include/portable.h b/include/portable.h deleted file mode 100644 index 34d725136b..0000000000 --- a/include/portable.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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 -#if defined( hpux ) || defined( sunos5 ) || defined ( sgi ) || defined( SVR4 ) -#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 - */ -#if !defined( NEED_FILIO ) && defined( SYSV ) && !defined( hpux ) -#define NEED_FILIO -#endif - -/* - * use lockf() under System V - */ -#if !defined( USE_LOCKF ) && ( defined( SYSV ) || defined( aix )) -#define USE_LOCKF -#endif - -/* - * on most systems, we should use waitpid() instead of waitN() - */ -#if !defined( USE_WAITPID ) && !defined( nextstep ) -#define USE_WAITPID -#endif - - -/* - * define the wait status argument type - */ -#if ( defined( SunOS ) && SunOS < 40 ) || defined( nextstep ) -#define WAITSTATUSTYPE union wait -#else -#define WAITSTATUSTYPE int -#endif - -/* - * define the flags for wait - */ -#ifdef sunos5 -#define WAIT_FLAGS ( WNOHANG | WUNTRACED | WCONTINUED ) -#else -#define WAIT_FLAGS ( WNOHANG | WUNTRACED ) -#endif - - -/* - * defined the options for openlog (syslog) - */ -#ifdef ultrix -#define OPENLOG_OPTIONS LOG_PID -#else -#define OPENLOG_OPTIONS ( LOG_PID | LOG_NOWAIT ) -#endif - -/* - * many systems do not have the setpwfile() library routine... we just - * enable use for those systems we know have it. - */ -#ifndef HAVE_SETPWFILE -#if defined( sunos4 ) || defined( ultrix ) || defined( __osf__ ) -#define HAVE_SETPWFILE -#endif -#endif - -/* - * Are sys_errlist and sys_nerr declared in stdio.h? - */ -#ifndef SYSERRLIST_IN_STDIO -#if defined( freebsd ) || defined( netbsd ) || defined( openbsd ) || \ - defined( __GLIBC__ ) && ( __GLIBC__ > 1 ) -#define SYSERRLIST_IN_STDIO -#endif -#endif - -/* - * for select() - */ -#if !defined(FD_SET) && !defined(WINSOCK) -#define NFDBITS 32 -#define FD_SETSIZE 32 -#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) -#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) -#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) -#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) -#endif /* FD_SET */ - -#if defined( hpux ) && defined( __STDC__ ) -/* - * Under HP/UX, select seems to want (int *) instead of fd_set. Non-ANSI - * compilers don't like recursive macros, so ignore the problem if __STDC__ - * is not defined. - */ -#define select(a,b,c,d,e) select((a),(int *)(b),(int *)(c),(int *)(d),(e)) -#endif /* hpux && __STDC__ */ - - -/* - * for signal() -- what do signal handling functions return? - */ -#ifndef SIG_FN -#ifdef sunos5 -# define SIG_FN void /* signal-catching functions return void */ -#else /* sunos5 */ -# ifdef BSD -# if (BSD >= 199006) || defined(NeXT) || defined(__osf__) || defined(sun) || defined(ultrix) || defined(apollo) || defined(POSIX_SIGNALS) -# define SIG_FN void /* signal-catching functions return void */ -# else -# define SIG_FN int /* signal-catching functions return int */ -# endif -# else /* BSD */ -# define SIG_FN void /* signal-catching functions return void */ -# endif /* BSD */ -#endif /* sunos5 */ -#endif /* SIG_FN */ - -/* - * call signal or sigset (signal does not block the signal while - * in the handler on sys v and sigset does not exist on bsd) - */ -#if defined(SYSV) && !defined(linux) -#define SIGNAL sigset -#else -#define SIGNAL signal -#endif - -/* - * toupper and tolower macros are different under bsd and sys v - */ -#if defined( SYSV ) && !defined( hpux ) -#define TOUPPER(c) (isascii(c) && islower(c) ? _toupper(c) : (c)) -#define TOLOWER(c) (isascii(c) && isupper(c) ? _tolower(c) : (c)) -#else -#define TOUPPER(c) (isascii(c) && islower(c) ? toupper(c) : (c)) -#define TOLOWER(c) (isascii(c) && isupper(c) ? tolower(c) : (c)) -#endif - -/* - * put a cover on the tty-related ioctl calls we need to use - */ -#if defined( NeXT ) || (defined(SunOS) && SunOS < 40) -#define TERMIO_TYPE struct sgttyb -#define TERMFLAG_TYPE int -#define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop)) -#define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop)) -#define GETFLAGS( tio ) ((tio).sg_flags) -#define SETFLAGS( tio, flags ) ((tio).sg_flags = (flags)) -#else -#define USE_TERMIOS -#define TERMIO_TYPE struct termios -#define TERMFLAG_TYPE tcflag_t -#define GETATTR( fd, tiop ) tcgetattr((fd), (tiop)) -#define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop)) -#define GETFLAGS( tio ) ((tio).c_lflag) -#define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags)) -#endif - - -#if defined( ultrix ) || defined( nextstep ) -extern char *strdup(); -#endif /* ultrix || nextstep */ - -#endif /* _PORTABLE_H */ diff --git a/include/portable.h.bot b/include/portable.h.bot new file mode 100644 index 0000000000..26034fd832 --- /dev/null +++ b/include/portable.h.bot @@ -0,0 +1,8 @@ + +#ifdef HAVE_STDDEF_H +# include +#endif + +#include "ldap_cdefs.h" + +#endif /* _LDAP_PORTABLE_H */ diff --git a/include/portable.h.in b/include/portable.h.in new file mode 100644 index 0000000000..c306baebc4 --- /dev/null +++ b/include/portable.h.in @@ -0,0 +1,464 @@ +/* include/portable.h.in. Generated automatically from configure.in by autoheader. */ +/* +Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA +All rights reserved. + +Redistribution and use in source and binary forms are permitted only +as authorized by the OpenLDAP Public License. A copy of this +license is available at http://www.OpenLDAP.org/license.html or +in file LICENSE in the top-level directory of the distribution. + +This work is derived from the University of Michigan LDAP v3.3 +distribution. Information concerning is available at + http://www.umich.edu/~dirsvcs/ldap/ldap.html. + +This work also contains materials derived from public sources. + +--- + +Portions Copyright (c) 1992-1996 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 _LDAP_PORTABLE_H +#define _LDAP_PORTABLE_H + + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to the type of elements in the array set by `getgroups'. + Usually this is either `int' or `gid_t'. */ +#undef GETGROUPS_T + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if your struct stat has st_blksize. */ +#undef HAVE_ST_BLKSIZE + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define if you have the wait3 system call. */ +#undef HAVE_WAIT3 + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `int' if doesn't define. */ +#undef mode_t + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define to `int' if doesn't define. */ +#undef pid_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define if your declares struct tm. */ +#undef TM_IN_SYS_TIME + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* define this if toupper() requires tolower() check */ +#undef C_UPPER_LOWER + +/* define this if sys_errlist is not defined in stdio.h or errno.h */ +#undef DECL_SYS_ERRLIST + +/* define if you have berkeley db */ +#undef HAVE_BERKELEY_DB + +/* define if you have berkeley db2 */ +#undef HAVE_BERKELEY_DB2 + +/* define if you have crypt */ +#undef HAVE_CRYPT + +/* define if you have DCE */ +#undef HAVE_DCE + +/* define if you have GDBM */ +#undef HAVE_GDBM + +/* define if you have Kerberos */ +#undef HAVE_KERBEROS + +/* define if you have LinuxThreads */ +#undef HAVE_LINUX_THREADS + +/* define if you have Sun LWP (SunOS style) */ +#undef HAVE_LWP + +/* define if you have -lncurses */ +#undef HAVE_NCURSES + +/* define if you have NDBM */ +#undef HAVE_NDBM + +/* define if you have Mach CThreads */ +#undef HAVE_MACH_CTHREADS + +/* define if you have a preemptive POSIX Threads implementation */ +#undef HAVE_PREEMPTIVE_PTHREADS + +/* define if you have POSIX Threads */ +#undef HAVE_PTHREADS + +/* define if your POSIX Threads implementatin is circa Draft 4 */ +#undef HAVE_PTHREADS_D4 + +/* define if you have -lwrap */ +#undef HAVE_TCPD + +/* define if you have -ltermcap */ +#undef HAVE_TERMCAP + +/* define if you have Sun LWP (Solaris style) */ +#undef HAVE_THR + +/* define this for connectionless LDAP support */ +#undef LDAP_CONNECTIONLESS + +/* define this to add debugging code */ +#undef LDAP_DEBUG + +/* define this for LDAP DNS support */ +#undef LDAP_DNS + +/* define this to remove -lldap cache support */ +#undef LDAP_NOCACHE + +/* define this for LDAP referrals support */ +#undef LDAP_REFERRALS + +/* define this for LDAP User Interface support */ +#undef LDAP_LIBUI + +/* define this to use DBBTREE w/ LDBM backend */ +#undef LDBM_USE_DBBTREE + +/* define this to use DBHASH w/ LDBM backend */ +#undef LDBM_USE_DBHASH + +/* define this if you want no termcap support */ +#undef NO_TERMCAP + +/* define this if you want no thread support */ +#undef NO_THREADS + +/* define this if the thread package is preemptive */ +#undef PREEMPTIVE_THREADS + +/* define this for ACL Group support */ +#undef SLAPD_ACLGROUPS + +/* define this for crypt(3) password support */ +#undef SLAPD_CRYPT + +/* define this to use SLAPD LDBM backend */ +#undef SLAPD_LDBM + +/* define this for MD5 password support */ +#undef SLAPD_MD5 + +/* define this to use SLAPD passwd backend */ +#undef SLAPD_PASSWD + +/* define this for phonetic support */ +#undef SLAPD_PHONETIC + +/* define this for Reverse Lookup support */ +#undef SLAPD_RLOOKUPS + +/* define this for SHA1 password support */ +#undef SLAPD_SHA1 + +/* define this to use SLAPD shell backend */ +#undef SLAPD_SHELL + +/* Define if you have the bcopy function. */ +#undef HAVE_BCOPY + +/* Define if you have the flock function. */ +#undef HAVE_FLOCK + +/* Define if you have the getdtablesize function. */ +#undef HAVE_GETDTABLESIZE + +/* Define if you have the gethostname function. */ +#undef HAVE_GETHOSTNAME + +/* Define if you have the getopt function. */ +#undef HAVE_GETOPT + +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define if you have the lockf function. */ +#undef HAVE_LOCKF + +/* Define if you have the memcpy function. */ +#undef HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE + +/* Define if you have the mkstemp function. */ +#undef HAVE_MKSTEMP + +/* Define if you have the mktime function. */ +#undef HAVE_MKTIME + +/* Define if you have the pthread_kill function. */ +#undef HAVE_PTHREAD_KILL + +/* Define if you have the pthread_yield function. */ +#undef HAVE_PTHREAD_YIELD + +/* Define if you have the sched_yield function. */ +#undef HAVE_SCHED_YIELD + +/* Define if you have the select function. */ +#undef HAVE_SELECT + +/* Define if you have the setpwfile function. */ +#undef HAVE_SETPWFILE + +/* Define if you have the setsid function. */ +#undef HAVE_SETSID + +/* Define if you have the signal function. */ +#undef HAVE_SIGNAL + +/* Define if you have the sigset function. */ +#undef HAVE_SIGSET + +/* Define if you have the socket function. */ +#undef HAVE_SOCKET + +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the strrchr function. */ +#undef HAVE_STRRCHR + +/* Define if you have the strsep function. */ +#undef HAVE_STRSEP + +/* Define if you have the strstr function. */ +#undef HAVE_STRSTR + +/* Define if you have the strtod function. */ +#undef HAVE_STRTOD + +/* Define if you have the strtol function. */ +#undef HAVE_STRTOL + +/* Define if you have the strtoul function. */ +#undef HAVE_STRTOUL + +/* Define if you have the sysconf function. */ +#undef HAVE_SYSCONF + +/* Define if you have the tempnam function. */ +#undef HAVE_TEMPNAM + +/* Define if you have the waitpid function. */ +#undef HAVE_WAITPID + +/* Define if you have the header file. */ +#undef HAVE_DB_H + +/* Define if you have the header file. */ +#undef HAVE_DB_185_H + +/* Define if you have the header file. */ +#undef HAVE_DES_H + +/* Define if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_FILIO_H + +/* Define if you have the header file. */ +#undef HAVE_GDBM_H + +/* Define if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define if you have the header file. */ +#undef HAVE_KERBEROSIV_DES_H + +/* Define if you have the header file. */ +#undef HAVE_KERBEROSIV_KRB_H + +/* Define if you have the header file. */ +#undef HAVE_KRB_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_LWP_LWP_H + +/* Define if you have the header file. */ +#undef HAVE_MACH_CTHREADS_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_NCURSES_H + +/* Define if you have the header file. */ +#undef HAVE_NDBM_H + +/* Define if you have the header file. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define if you have the header file. */ +#undef HAVE_REGEX_H + +/* Define if you have the header file. */ +#undef HAVE_SCHED_H + +/* Define if you have the header file. */ +#undef HAVE_SGTTY_H + +/* Define if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define if you have the header file. */ +#undef HAVE_SYNCH_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_ERRNO_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSLOG_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define if you have the header file. */ +#undef HAVE_TERMCAP_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the header file. */ +#undef HAVE_THREAD_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the V3 library (-lV3). */ +#undef HAVE_LIBV3 + +/* Define if you have the gen library (-lgen). */ +#undef HAVE_LIBGEN + +/* Define if you have the inet library (-linet). */ +#undef HAVE_LIBINET + +/* Define if you have the net library (-lnet). */ +#undef HAVE_LIBNET + +/* Define if you have the nsl library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define if you have the nsl_s library (-lnsl_s). */ +#undef HAVE_LIBNSL_S + +/* Define if you have the socket library (-lsocket). */ +#undef HAVE_LIBSOCKET + +#ifdef HAVE_STDDEF_H +# include +#endif + +#include "ldap_cdefs.h" + +#endif /* _LDAP_PORTABLE_H */ diff --git a/include/portable.h.nt b/include/portable.h.nt new file mode 100644 index 0000000000..dac09fdc43 --- /dev/null +++ b/include/portable.h.nt @@ -0,0 +1,485 @@ +/* include/portable.h.in. Generated automatically from configure.in by autoheader. */ +/* +Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA +All rights reserved. + +Redistribution and use in source and binary forms are permitted only +as authorized by the OpenLDAP Public License. A copy of this +license is available at http://www.OpenLDAP.org/license.html or +in file LICENSE in the top-level directory of the distribution. + +This work is derived from the University of Michigan LDAP v3.3 +distribution. Information concerning is available at + http://www.umich.edu/~dirsvcs/ldap/ldap.html. + +This work also contains materials derived from public sources. + +--- + +Portions Copyright (c) 1992-1996 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 _LDAP_PORTABLE_H +#define _LDAP_PORTABLE_H + +/* we installed Henry Spencer's REGEX */ +#define HAVE_REGEX_H 1 + +/* win32 specific stuff */ +#define strcasecmp stricmp +#define strncasecmp strnicmp +#define strdup _strdup + +/* define type for caddr_t */ +typedef char * caddr_t; + +/* we have winsock2 */ +#define HAVE_WINSOCK2 1 + +/* we have winsock */ +#define HAVE_WINSOCK 1 + +/* we have */ +#define HAVE_IO_H 1 + +/* we have */ +#define HAVE_PROCESS_H 1 + +/* --------------------------------------------------- */ + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +/* #undef _ALL_SOURCE */ +#endif + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define to the type of elements in the array set by `getgroups'. + Usually this is either `int' or `gid_t'. */ +/* #undef GETGROUPS_T */ + +/* Define to `int' if doesn't define. */ +#define gid_t long + +/* Define if you don't have vprintf but do have _doprnt. */ +/* #undef HAVE_DOPRNT */ + +/* Define if your struct stat has st_blksize. */ +/* #undef HAVE_ST_BLKSIZE */ + +/* Define if you have the strftime function. */ +#define HAVE_STRFTIME 1 + +/* Define if you have that is POSIX.1 compatible. */ +/* #undef HAVE_SYS_WAIT_H */ + +/* Define if you have the vprintf function. */ +#define HAVE_VPRINTF 1 + +/* Define if you have the wait3 system call. */ +/* #undef HAVE_WAIT3 */ + +/* Define if on MINIX. */ +/* #undef _MINIX */ + +/* Define to `int' if doesn't define. */ +#define mode_t int + +/* Define to `long' if doesn't define. */ +/* #undef off_t */ + +/* Define to `int' if doesn't define. */ +#define pid_t int + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define if you need to in order for stat and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define as the return type of signal handlers (int or void). */ +#define RETSIGTYPE void + +/* Define to `unsigned' if doesn't define. */ +/* #undef size_t */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you can safely include both and . */ +/* #undef TIME_WITH_SYS_TIME */ + +/* Define if your declares struct tm. */ +/* #undef TM_IN_SYS_TIME */ + +/* Define to `int' if doesn't define. */ +#define uid_t long + +/* define this if toupper() requires tolower() */ +#define C_UPPER_LOWER + +/* define this if sys_errlist is not defined in stdio.h or errno.h */ +/* #undef DECL_SYS_ERRLIST */ + +/* define if you have berkeley db */ +/* #undef HAVE_BERKELEY_DB */ + +/* define if you have berkeley db2 */ +/* #undef HAVE_BERKELEY_DB2 */ + +/* define if you have crypt */ +/* #undef HAVE_CRYPT */ + +/* define if you have DCE */ +/* #undef HAVE_DCE */ + +/* define if you have GDBM */ +/* #undef HAVE_GDBM */ + +/* define if you have Kerberos */ +/* #undef HAVE_KERBEROS */ + +/* define if you have LinuxThreads */ +/* #undef HAVE_LINUX_THREADS */ + +/* define if you have Sun LWP (SunOS style) */ +/* #undef HAVE_LWP */ + +/* define if you have -lncurses */ +/* #undef HAVE_NCURSES */ + +/* define if you have NDBM */ +/* #undef HAVE_NDBM */ + +/* define if you have Mach CThreads */ +/* #undef HAVE_MACH_CTHREADS */ + +/* define if you have a preemptive POSIX Threads implementation */ +/* #undef HAVE_PREEMPTIVE_PTHREADS */ + +/* define if you have POSIX Threads */ +/* #undef HAVE_PTHREADS */ + +/* define if your POSIX Threads implementatin is circa Draft 4 */ +/* #undef HAVE_PTHREADS_D4 */ + +/* define if you have -lwrap */ +/* #undef HAVE_TCPD */ + +/* define if you have -ltermcap */ +/* #undef HAVE_TERMCAP */ + +/* define if you have Solaris LWP Threads */ +/* #undef HAVE_THR */ + +/* define this for connectionless LDAP support */ +/* #undef LDAP_CONNECTIONLESS */ + +/* define this to add debugging code */ +#define LDAP_DEBUG 1 + +/* define this for LDAP DNS support */ +/* #undef LDAP_DNS */ + +/* define this to remove -lldap cache support */ +/* #undef LDAP_NOCACHE */ + +/* define this for LDAP referrals support */ +#define LDAP_REFERRALS 1 + +/* define this for LDAP User Interface support */ +/* #undef LDAP_LIBUI */ + +/* define this to use DBBTREE w/ LDBM backend */ +/* #undef LDBM_USE_DBBTREE */ + +/* define this to use DBHASH w/ LDBM backend */ +/* #undef LDBM_USE_DBHASH */ + +/* define this if you want no termcap support */ +#define NO_TERMCAP 1 + +/* define this if you want no thread support */ +#define NO_THREADS 1 + +/* define this if the thread package is preemptive */ +#define PREEMPTIVE_THREADS 1 + +/* define this for ACL Group support */ +#define SLAPD_ACLGROUPS + +/* define this for crypt(3) password support */ +/* #undef SLAPD_CRYPT */ + +/* define this to use SLAPD LDBM backend */ +/* #undef SLAPD_LDBM */ + +/* define this for MD5 password support */ +#define SLAPD_MD5 1 + +/* define this to use SLAPD passwd backend */ +/* #undef SLAPD_PASSWD */ + +/* define this for phonetic support */ +/* #undef SLAPD_PHONETIC */ + +/* define this for Reverse Lookup support */ +#define SLAPD_RLOOKUPS 1 + +/* define this for SHA1 password support */ +#define SLAPD_SHA1 1 + +/* define this to use SLAPD shell backend */ +/* #undef SLAPD_SHELL */ + +/* Define if you have the bcopy function. */ +/* #undef HAVE_BCOPY */ + +/* Define if you have the flock function. */ +/* #undef HAVE_FLOCK */ + +/* Define if you have the getdtablesize function. */ +/* #undef HAVE_GETDTABLESIZE */ + +/* Define if you have the gethostname function. */ +#define HAVE_GETHOSTNAME 1 + +/* define if you have the getopt function */ +/* #undef HAVE_GETOPT */ + +/* Define if you have the gettimeofday function. */ +/* #undef HAVE_GETTIMEOFDAY */ + +/* Define if you have the lockf function. */ +/* #undef HAVE_LOCKF */ + +/* Define if you have the memcpy function. */ +#define HAVE_MEMCPY 1 + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE 1 + +/* Define if you have the mkstemp function. */ +/* #undef HAVE_MKSTEMP */ + +/* Define if you have the mktime function. */ +#define HAVE_MKTIME 1 + +/* Define if you have the pthread_kill function. */ +/* #undef HAVE_PTHREAD_KILL */ + +/* Define if you have the pthread_yield function. */ +/* #undef HAVE_PTHREAD_YIELD */ + +/* Define if you have the sched_yield function. */ +/* #undef HAVE_SCHED_YIELD */ + +/* Define if you have the select function. */ +#define HAVE_SELECT 1 + +/* Define if you have the setpwfile function. */ +/* #undef HAVE_SETPWFILE */ + +/* Define if you have the setsid function. */ +/* #undef HAVE_SETSID */ + +/* Define if you have the signal function. */ +#define HAVE_SIGNAL 1 + +/* Define if you have the sigset function. */ +/* #undef HAVE_SIGSET */ + +/* Define if you have the socket function. */ +#define HAVE_SOCKET 1 + +/* Define if you have the strdup function. */ +#define HAVE_STRDUP 1 + +/* Define if you have the strerror function. */ +#define HAVE_STRERROR 1 + +/* Define if you have the strrchr function. */ +#define HAVE_STRRCHR 1 + +/* Define if you have the strsep function. */ +/* #undef HAVE_STRSEP */ + +/* Define if you have the strstr function. */ +#define HAVE_STRSTR 1 + +/* Define if you have the strtod function. */ +#define HAVE_STRTOD 1 + +/* Define if you have the strtol function. */ +#define HAVE_STRTOL 1 + +/* Define if you have the strtoul function. */ +#define HAVE_STRTOUL 1 + +/* Define if you have the sysconf function. */ +/* #undef HAVE_SYSCONF */ + +/* Define if you have the waitpid function. */ +#define HAVE_WAITPID 1 + +/* Define if you have the header file. */ +/* #undef HAVE_DB_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_DB_185_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_DES_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_DIRENT_H */ + +/* Define if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_FILIO_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_GDBM_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_GETOPT_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_KERBEROSIV_DES_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_KERBEROSIV_KRB_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_KRB_H */ + +/* Define if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_LWP_LWP_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_MACH_CTHREADS_H */ + +/* Define if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_NCURSES_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_NDBM_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_NDIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_PTHREAD_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_REGEX_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SCHED_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SGTTY_H */ + +/* Define if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_SYNCH_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_ERRNO_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_FILE_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_IOCTL_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_PARAM_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_SOCKET_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_SYSLOG_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_SYS_TIME_H */ + +/* Define if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_SYSLOG_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_TERMCAP_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_TERMIOS_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_THREAD_H */ + +/* Define if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define if you have the V3 library (-lV3). */ +/* #undef HAVE_LIBV3 */ + +/* Define if you have the gen library (-lgen). */ +/* #undef HAVE_LIBGEN */ + +/* Define if you have the inet library (-linet). */ +/* #undef HAVE_LIBINET */ + +/* Define if you have the net library (-lnet). */ +/* #undef HAVE_LIBNET */ + +/* Define if you have the nsl library (-lnsl). */ +/* #undef HAVE_LIBNSL */ + +/* Define if you have the nsl_s library (-lnsl_s). */ +/* #undef HAVE_LIBNSL_S */ + +/* Define if you have the socket library (-lsocket). */ +/* #undef HAVE_LIBSOCKET */ + +#ifdef HAVE_STDDEF_H +# include +#endif + +#include "ldap_cdefs.h" + +#endif /* _LDAP_PORTABLE_H */ diff --git a/include/portable.h.top b/include/portable.h.top new file mode 100644 index 0000000000..32d793a5c8 --- /dev/null +++ b/include/portable.h.top @@ -0,0 +1,32 @@ +/* +Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA +All rights reserved. + +Redistribution and use in source and binary forms are permitted only +as authorized by the OpenLDAP Public License. A copy of this +license is available at http://www.OpenLDAP.org/license.html or +in file LICENSE in the top-level directory of the distribution. + +This work is derived from the University of Michigan LDAP v3.3 +distribution. Information concerning is available at + http://www.umich.edu/~dirsvcs/ldap/ldap.html. + +This work also contains materials derived from public sources. + +--- + +Portions Copyright (c) 1992-1996 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 _LDAP_PORTABLE_H +#define _LDAP_PORTABLE_H + diff --git a/include/proto-lber.h b/include/proto-lber.h deleted file mode 100644 index c84687200b..0000000000 --- a/include/proto-lber.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * lber-proto.h - * function prototypes for lber library - */ - -#ifdef LDAP_DEBUG -extern int lber_debug; -#endif - -#ifndef LDAPFUNCDECL -#ifdef _WIN32 -#define LDAPFUNCDECL __declspec( dllexport ) -#else /* _WIN32 */ -#define LDAPFUNCDECL -#endif /* _WIN32 */ -#endif /* LDAPFUNCDECL */ - -/* - * in bprint.c: - */ -LDAPFUNCDECL void lber_bprint( char *data, int len ); - -/* - * in decode.c: - */ -LDAPFUNCDECL unsigned long ber_get_tag( BerElement *ber ); -LDAPFUNCDECL unsigned long ber_skip_tag( BerElement *ber, unsigned long *len ); -LDAPFUNCDECL unsigned long ber_peek_tag( BerElement *ber, unsigned long *len ); -LDAPFUNCDECL unsigned long ber_get_int( BerElement *ber, long *num ); -LDAPFUNCDECL unsigned long ber_get_stringb( BerElement *ber, char *buf, - unsigned long *len ); -LDAPFUNCDECL unsigned long ber_get_stringa( BerElement *ber, char **buf ); -LDAPFUNCDECL unsigned long ber_get_stringal( BerElement *ber, struct berval **bv ); -LDAPFUNCDECL unsigned long ber_get_bitstringa( BerElement *ber, char **buf, - unsigned long *len ); -LDAPFUNCDECL unsigned long ber_get_null( BerElement *ber ); -LDAPFUNCDECL unsigned long ber_get_boolean( BerElement *ber, int *boolval ); -LDAPFUNCDECL unsigned long ber_first_element( BerElement *ber, unsigned long *len, - char **last ); -LDAPFUNCDECL unsigned long ber_next_element( BerElement *ber, unsigned long *len, - char *last ); -#if defined( MACOS ) || defined( BC31 ) || defined( _WIN32 ) -LDAPFUNCDECL unsigned long ber_scanf( BerElement *ber, char *fmt, ... ); -#else -LDAPFUNCDECL unsigned long ber_scanf(); -#endif -LDAPFUNCDECL void ber_bvfree( struct berval *bv ); -LDAPFUNCDECL void ber_bvecfree( struct berval **bv ); -LDAPFUNCDECL struct berval *ber_bvdup( struct berval *bv ); -#ifdef STR_TRANSLATION -LDAPFUNCDECL void ber_set_string_translators( BerElement *ber, - BERTranslateProc encode_proc, BERTranslateProc decode_proc ); -#endif /* STR_TRANSLATION */ - -/* - * in encode.c - */ -LDAPFUNCDECL int ber_put_enum( BerElement *ber, long num, unsigned long tag ); -LDAPFUNCDECL int ber_put_int( BerElement *ber, long num, unsigned long tag ); -LDAPFUNCDECL int ber_put_ostring( BerElement *ber, char *str, unsigned long len, - unsigned long tag ); -LDAPFUNCDECL int ber_put_string( BerElement *ber, char *str, unsigned long tag ); -LDAPFUNCDECL int ber_put_bitstring( BerElement *ber, char *str, - unsigned long bitlen, unsigned long tag ); -LDAPFUNCDECL int ber_put_null( BerElement *ber, unsigned long tag ); -LDAPFUNCDECL int ber_put_boolean( BerElement *ber, int boolval, - unsigned long tag ); -LDAPFUNCDECL int ber_start_seq( BerElement *ber, unsigned long tag ); -LDAPFUNCDECL int ber_start_set( BerElement *ber, unsigned long tag ); -LDAPFUNCDECL int ber_put_seq( BerElement *ber ); -LDAPFUNCDECL int ber_put_set( BerElement *ber ); -#if defined( MACOS ) || defined( BC31 ) || defined( _WIN32 ) -LDAPFUNCDECL int ber_printf( BerElement *ber, char *fmt, ... ); -#else -LDAPFUNCDECL int ber_printf(); -#endif - -/* - * in io.c: - */ -LDAPFUNCDECL long ber_read( BerElement *ber, char *buf, unsigned long len ); -LDAPFUNCDECL long ber_write( BerElement *ber, char *buf, unsigned long len, - int nosos ); -LDAPFUNCDECL void ber_free( BerElement *ber, int freebuf ); -LDAPFUNCDECL int ber_flush( Sockbuf *sb, BerElement *ber, int freeit ); -LDAPFUNCDECL BerElement *ber_alloc( void ); -LDAPFUNCDECL BerElement *der_alloc( void ); -LDAPFUNCDECL BerElement *ber_alloc_t( int options ); -LDAPFUNCDECL BerElement *ber_dup( BerElement *ber ); -LDAPFUNCDECL void ber_dump( BerElement *ber, int inout ); -LDAPFUNCDECL void ber_sos_dump( Seqorset *sos ); -LDAPFUNCDECL unsigned long ber_get_next( Sockbuf *sb, unsigned long *len, - BerElement *ber ); -LDAPFUNCDECL void ber_init( BerElement *ber, int options ); -LDAPFUNCDECL void ber_reset( BerElement *ber, int was_writing ); - -#ifdef NEEDGETOPT -/* - * in getopt.c - */ -int getopt( int nargc, char **nargv, char *ostr ); -#endif /* NEEDGETOPT */ diff --git a/include/proto-ldap.h b/include/proto-ldap.h deleted file mode 100644 index 971ab5b34e..0000000000 --- a/include/proto-ldap.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * proto-ldap.h - * function prototypes for ldap library - */ - - -#ifndef LDAPFUNCDECL -#ifdef _WIN32 -#define LDAPFUNCDECL __declspec( dllexport ) -#else /* _WIN32 */ -#define LDAPFUNCDECL -#endif /* _WIN32 */ -#endif /* LDAPFUNCDECL */ - - -/* - * in abandon.c: - */ -LDAPFUNCDECL int ldap_abandon( LDAP *ld, int msgid ); - -/* - * in add.c: - */ -LDAPFUNCDECL int ldap_add( LDAP *ld, char *dn, LDAPMod **attrs ); -LDAPFUNCDECL int ldap_add_s( LDAP *ld, char *dn, LDAPMod **attrs ); - -/* - * in bind.c: - */ -LDAPFUNCDECL int ldap_bind( LDAP *ld, char *who, char *passwd, int authmethod ); -LDAPFUNCDECL int ldap_bind_s( LDAP *ld, char *who, char *cred, int method ); -#ifdef LDAP_REFERRALS -LDAPFUNCDECL void ldap_set_rebind_proc( LDAP *ld, int (*rebindproc)( LDAP *ld, - char **dnp, char **passwdp, int *authmethodp, int freeit )); -#endif /* LDAP_REFERRALS */ - -/* - * in sbind.c: - */ -LDAPFUNCDECL int ldap_simple_bind( LDAP *ld, char *who, char *passwd ); -LDAPFUNCDECL int ldap_simple_bind_s( LDAP *ld, char *who, char *passwd ); - -/* - * in kbind.c: - */ -LDAPFUNCDECL int ldap_kerberos_bind_s( LDAP *ld, char *who ); -LDAPFUNCDECL int ldap_kerberos_bind1( LDAP *ld, char *who ); -LDAPFUNCDECL int ldap_kerberos_bind1_s( LDAP *ld, char *who ); -LDAPFUNCDECL int ldap_kerberos_bind2( LDAP *ld, char *who ); -LDAPFUNCDECL int ldap_kerberos_bind2_s( LDAP *ld, char *who ); - - -#ifndef NO_CACHE -/* - * in cache.c - */ -LDAPFUNCDECL int ldap_enable_cache( LDAP *ld, long timeout, long maxmem ); -LDAPFUNCDECL void ldap_disable_cache( LDAP *ld ); -LDAPFUNCDECL void ldap_set_cache_options( LDAP *ld, unsigned long opts ); -LDAPFUNCDECL void ldap_destroy_cache( LDAP *ld ); -LDAPFUNCDECL void ldap_flush_cache( LDAP *ld ); -LDAPFUNCDECL void ldap_uncache_entry( LDAP *ld, char *dn ); -LDAPFUNCDECL void ldap_uncache_request( LDAP *ld, int msgid ); -#endif /* !NO_CACHE */ - -/* - * in compare.c: - */ -LDAPFUNCDECL int ldap_compare( LDAP *ld, char *dn, char *attr, char *value ); -LDAPFUNCDECL int ldap_compare_s( LDAP *ld, char *dn, char *attr, char *value ); - -/* - * in delete.c: - */ -LDAPFUNCDECL int ldap_delete( LDAP *ld, char *dn ); -LDAPFUNCDECL int ldap_delete_s( LDAP *ld, char *dn ); - -/* - * in error.c: - */ -LDAPFUNCDECL int ldap_result2error( LDAP *ld, LDAPMessage *r, int freeit ); -LDAPFUNCDECL char *ldap_err2string( int err ); -LDAPFUNCDECL void ldap_perror( LDAP *ld, char *s ); - -/* - * in modify.c: - */ -LDAPFUNCDECL int ldap_modify( LDAP *ld, char *dn, LDAPMod **mods ); -LDAPFUNCDECL int ldap_modify_s( LDAP *ld, char *dn, LDAPMod **mods ); - -/* - * in modrdn.c: - */ -LDAPFUNCDECL int ldap_modrdn( LDAP *ld, char *dn, char *newrdn ); -LDAPFUNCDECL int ldap_modrdn_s( LDAP *ld, char *dn, char *newrdn ); -LDAPFUNCDECL int ldap_modrdn2( LDAP *ld, char *dn, char *newrdn, - int deleteoldrdn ); -LDAPFUNCDECL int ldap_modrdn2_s( LDAP *ld, char *dn, char *newrdn, - int deleteoldrdn); - -/* - * in open.c: - */ -LDAPFUNCDECL LDAP *ldap_open( char *host, int port ); -LDAPFUNCDECL LDAP *ldap_init( char *defhost, int defport ); - -/* - * in getentry.c: - */ -LDAPFUNCDECL LDAPMessage *ldap_first_entry( LDAP *ld, LDAPMessage *chain ); -LDAPFUNCDECL LDAPMessage *ldap_next_entry( LDAP *ld, LDAPMessage *entry ); -LDAPFUNCDECL int ldap_count_entries( LDAP *ld, LDAPMessage *chain ); - -/* - * in addentry.c - */ -LDAPFUNCDECL LDAPMessage *ldap_delete_result_entry( LDAPMessage **list, - LDAPMessage *e ); -LDAPFUNCDECL void ldap_add_result_entry( LDAPMessage **list, LDAPMessage *e ); - -/* - * in getdn.c - */ -LDAPFUNCDECL char *ldap_get_dn( LDAP *ld, LDAPMessage *entry ); -LDAPFUNCDECL char *ldap_dn2ufn( char *dn ); -LDAPFUNCDECL char **ldap_explode_dn( char *dn, int notypes ); -LDAPFUNCDECL char **ldap_explode_dns( char *dn ); -LDAPFUNCDECL int ldap_is_dns_dn( char *dn ); - -/* - * in getattr.c - */ -LDAPFUNCDECL char *ldap_first_attribute( LDAP *ld, LDAPMessage *entry, - BerElement **ber ); -LDAPFUNCDECL char *ldap_next_attribute( LDAP *ld, LDAPMessage *entry, - BerElement *ber ); - -/* - * in getvalues.c - */ -LDAPFUNCDECL char **ldap_get_values( LDAP *ld, LDAPMessage *entry, char *target ); -LDAPFUNCDECL struct berval **ldap_get_values_len( LDAP *ld, LDAPMessage *entry, - char *target ); -LDAPFUNCDECL int ldap_count_values( char **vals ); -LDAPFUNCDECL int ldap_count_values_len( struct berval **vals ); -LDAPFUNCDECL void ldap_value_free( char **vals ); -LDAPFUNCDECL void ldap_value_free_len( struct berval **vals ); - -/* - * in result.c: - */ -LDAPFUNCDECL int ldap_result( LDAP *ld, int msgid, int all, - struct timeval *timeout, LDAPMessage **result ); -LDAPFUNCDECL int ldap_msgfree( LDAPMessage *lm ); -LDAPFUNCDECL int ldap_msgdelete( LDAP *ld, int msgid ); - -/* - * in search.c: - */ -LDAPFUNCDECL int ldap_search( LDAP *ld, char *base, int scope, char *filter, - char **attrs, int attrsonly ); -LDAPFUNCDECL int ldap_search_s( LDAP *ld, char *base, int scope, char *filter, - char **attrs, int attrsonly, LDAPMessage **res ); -LDAPFUNCDECL int ldap_search_st( LDAP *ld, char *base, int scope, char *filter, - char **attrs, int attrsonly, struct timeval *timeout, LDAPMessage **res ); - -/* - * in ufn.c - */ -LDAPFUNCDECL int ldap_ufn_search_c( LDAP *ld, char *ufn, char **attrs, - int attrsonly, LDAPMessage **res, int (*cancelproc)( void *cl ), - void *cancelparm ); -LDAPFUNCDECL int ldap_ufn_search_ct( LDAP *ld, char *ufn, char **attrs, - int attrsonly, LDAPMessage **res, int (*cancelproc)( void *cl ), - void *cancelparm, char *tag1, char *tag2, char *tag3 ); -LDAPFUNCDECL int ldap_ufn_search_s( LDAP *ld, char *ufn, char **attrs, - int attrsonly, LDAPMessage **res ); -LDAPFUNCDECL LDAPFiltDesc *ldap_ufn_setfilter( LDAP *ld, char *fname ); -LDAPFUNCDECL void ldap_ufn_setprefix( LDAP *ld, char *prefix ); -LDAPFUNCDECL int ldap_ufn_timeout( void *tvparam ); - - -/* - * in unbind.c - */ -LDAPFUNCDECL int ldap_unbind( LDAP *ld ); -LDAPFUNCDECL int ldap_unbind_s( LDAP *ld ); - - -/* - * in getfilter.c - */ -LDAPFUNCDECL LDAPFiltDesc *ldap_init_getfilter( char *fname ); -LDAPFUNCDECL LDAPFiltDesc *ldap_init_getfilter_buf( char *buf, long buflen ); -LDAPFUNCDECL LDAPFiltInfo *ldap_getfirstfilter( LDAPFiltDesc *lfdp, char *tagpat, - char *value ); -LDAPFUNCDECL LDAPFiltInfo *ldap_getnextfilter( LDAPFiltDesc *lfdp ); -LDAPFUNCDECL void ldap_setfilteraffixes( LDAPFiltDesc *lfdp, char *prefix, char *suffix ); -LDAPFUNCDECL void ldap_build_filter( char *buf, unsigned long buflen, - char *pattern, char *prefix, char *suffix, char *attr, - char *value, char **valwords ); - -/* - * in free.c - */ -LDAPFUNCDECL void ldap_getfilter_free( LDAPFiltDesc *lfdp ); -LDAPFUNCDECL void ldap_mods_free( LDAPMod **mods, int freemods ); - -/* - * in friendly.c - */ -LDAPFUNCDECL char *ldap_friendly_name( char *filename, char *uname, - FriendlyMap **map ); -LDAPFUNCDECL void ldap_free_friendlymap( FriendlyMap **map ); - - -/* - * in cldap.c - */ -LDAPFUNCDECL LDAP *cldap_open( char *host, int port ); -LDAPFUNCDECL void cldap_close( LDAP *ld ); -LDAPFUNCDECL int cldap_search_s( LDAP *ld, char *base, int scope, char *filter, - char **attrs, int attrsonly, LDAPMessage **res, char *logdn ); -LDAPFUNCDECL void cldap_setretryinfo( LDAP *ld, int tries, int timeout ); - - -/* - * in sort.c - */ -LDAPFUNCDECL int ldap_sort_entries( LDAP *ld, LDAPMessage **chain, char *attr, - int (*cmp)() ); -LDAPFUNCDECL int ldap_sort_values( LDAP *ld, char **vals, int (*cmp)() ); -LDAPFUNCDECL int ldap_sort_strcasecmp( char **a, char **b ); - - -/* - * in url.c - */ -LDAPFUNCDECL int ldap_is_ldap_url( char *url ); -LDAPFUNCDECL int ldap_url_parse( char *url, LDAPURLDesc **ludpp ); -LDAPFUNCDECL void ldap_free_urldesc( LDAPURLDesc *ludp ); -LDAPFUNCDECL int ldap_url_search( LDAP *ld, char *url, int attrsonly ); -LDAPFUNCDECL int ldap_url_search_s( LDAP *ld, char *url, int attrsonly, - LDAPMessage **res ); -LDAPFUNCDECL int ldap_url_search_st( LDAP *ld, char *url, int attrsonly, - struct timeval *timeout, LDAPMessage **res ); - - -/* - * in charset.c - */ -#ifdef STR_TRANSLATION -LDAPFUNCDECL void ldap_set_string_translators( LDAP *ld, - BERTranslateProc encode_proc, BERTranslateProc decode_proc ); -LDAPFUNCDECL int ldap_translate_from_t61( LDAP *ld, char **bufp, - unsigned long *lenp, int free_input ); -LDAPFUNCDECL int ldap_translate_to_t61( LDAP *ld, char **bufp, - unsigned long *lenp, int free_input ); -LDAPFUNCDECL void ldap_enable_translation( LDAP *ld, LDAPMessage *entry, - int enable ); - -#ifdef LDAP_CHARSET_8859 -LDAPFUNCDECL int ldap_t61_to_8859( char **bufp, unsigned long *buflenp, - int free_input ); -LDAPFUNCDECL int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, - int free_input ); -#endif /* LDAP_CHARSET_8859 */ -#endif /* STR_TRANSLATION */ - - -#ifdef WINSOCK -/* - * in msdos/winsock/wsa.c - */ -LDAPFUNCDECL void ldap_memfree( void *p ); -#endif /* WINSOCK */ diff --git a/include/srchpref.h b/include/srchpref.h index c3fcbc51f5..6b26b06d41 100644 --- a/include/srchpref.h +++ b/include/srchpref.h @@ -17,10 +17,9 @@ #ifndef _SRCHPREF_H #define _SRCHPREF_H -#ifdef __cplusplus -extern "C" { -#endif +#include +LDAP_BEGIN_DECL struct ldap_searchattr { char *sa_attrlabel; @@ -71,36 +70,26 @@ struct ldap_searchobj { #define LDAP_SEARCHPREF_ERR_FILE 4 -#ifndef NEEDPROTOS -int ldap_init_searchprefs(); -int ldap_init_searchprefs_buf(); -void ldap_free_searchprefs(); -struct ldap_searchobj *ldap_first_searchobj(); -struct ldap_searchobj *ldap_next_searchobj(); +LDAP_F int +ldap_init_searchprefs LDAP_P(( char *file, + struct ldap_searchobj **solistp )); -#else /* !NEEDPROTOS */ +LDAP_F int +ldap_init_searchprefs_buf LDAP_P(( char *buf, + long buflen, + struct ldap_searchobj **solistp )); -LDAPFUNCDECL int -ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp ); +LDAP_F void +ldap_free_searchprefs LDAP_P(( struct ldap_searchobj *solist )); -LDAPFUNCDECL int -ldap_init_searchprefs_buf( char *buf, long buflen, - struct ldap_searchobj **solistp ); +LDAP_F struct ldap_searchobj * +ldap_first_searchobj LDAP_P(( struct ldap_searchobj *solist )); -LDAPFUNCDECL void -ldap_free_searchprefs( struct ldap_searchobj *solist ); +LDAP_F struct ldap_searchobj * +ldap_next_searchobj LDAP_P(( struct ldap_searchobj *sollist, + struct ldap_searchobj *so )); -LDAPFUNCDECL struct ldap_searchobj * -ldap_first_searchobj( struct ldap_searchobj *solist ); -LDAPFUNCDECL struct ldap_searchobj * -ldap_next_searchobj( struct ldap_searchobj *sollist, - struct ldap_searchobj *so ); +LDAP_END_DECL -#endif /* !NEEDPROTOS */ - - -#ifdef __cplusplus -} -#endif #endif /* _SRCHPREF_H */ diff --git a/libraries/Make-template b/libraries/Make-template deleted file mode 100644 index 95169e554e..0000000000 --- a/libraries/Make-template +++ /dev/null @@ -1,86 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP libraries Makefile -# -#----------------------------------------------------------------------------- - -############################################################################ -# # -# You should not have to edit anything below this point # -# # -############################################################################ - -# -# rules to make the software -# - -all: FORCE - @echo "making all in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ - ( cd $$i; $(MAKE) $(MFLAGS) all ); \ - fi; \ - done - - -# -# rules to install the software -# - -install: FORCE - @echo "making install in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ - ( cd $$i; $(MAKE) $(MFLAGS) install ); \ - fi; \ - done - -# -# rules to make clean -# -clean: FORCE - @echo "making clean in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ - fi; \ - done - -veryclean: clean - -# -# rules to make depend -# -# -depend: FORCE - @echo "making depend in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo; echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ - ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ - fi; \ - done - -links: - @echo "making links in `$(PWD)`"; \ - for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/CVS" ]; then \ - d=`basename $$i`; \ - ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ - $(LN) ../.src/$$d/Make-template . ; \ - $(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \ - -f Make-template links ) ; \ - fi; \ - done diff --git a/libraries/Makefile.in b/libraries/Makefile.in new file mode 100644 index 0000000000..49f47807d0 --- /dev/null +++ b/libraries/Makefile.in @@ -0,0 +1,7 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, see COPYRIGHT file +## +## Libraries Makefile for OpenLDAP + +SUBDIRS= libavl liblber libldap libldif libldbm liblthread liblutil + diff --git a/libraries/libavl/Make-template b/libraries/libavl/Make-template deleted file mode 100644 index 53248a0987..0000000000 --- a/libraries/libavl/Make-template +++ /dev/null @@ -1,65 +0,0 @@ -#----------------------------------------------------------------------------- -# Copyright (c) 1995 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. -# -# avl library makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC = ../.. - -SRCS = avl.c -OBJS = avl.o - -HDIR = ../../include - -INCLUDES= -I$(HDIR) -DEFINES = $(DEFS) - -CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS) - -all: libavl.a - -libavl.a: version.o - $(AR) ruv $@ $(OBJS) version.o - @if [ ! -z "$(RANLIB)" ]; then \ - $(RANLIB) $@; \ - fi; \ - $(RM) ../$@; \ - $(LN) libavl/$@ ../$@ - -testavl: libavl.a testavl.o - $(CC) $(ALDFLAGS) -o $@ testavl.o -L. -lavl $(ALIBS) - -version.c: $(OBJS) - $(RM) $@ - (u=$${USER-root} v=`$(CAT) ../../build/version` d=`$(PWD)` \ - h=`$(HOSTNAME)` t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -install: all - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) libavl.a ../libavl.a testavl *.o core a.out version.c - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/*.[ch] . - diff --git a/libraries/libavl/Makefile.in b/libraries/libavl/Makefile.in new file mode 100644 index 0000000000..7dca5eb04b --- /dev/null +++ b/libraries/libavl/Makefile.in @@ -0,0 +1,15 @@ +## +## LIBAVL +## + +SRCS = avl.c testavl.c +XSRCS = version.c +OBJS = avl.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +LIBRARY = libavl.a +XPROGRAMS = testavl + +testavl: $(LIBRARY) testavl.o diff --git a/libraries/libavl/avl.c b/libraries/libavl/avl.c index 6f89a15b00..30938263d1 100644 --- a/libraries/libavl/avl.c +++ b/libraries/libavl/avl.c @@ -11,35 +11,38 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; static char avl_version[] = "AVL library version 1.0\n"; #endif -#include #include #include +#include + #include "avl.h" #define ROTATERIGHT(x) { \ Avlnode *tmp;\ - if ( *x == NULL || (*x)->avl_left == NULL ) {\ + if ( *(x) == NULL || (*(x))->avl_left == NULL ) {\ (void) printf("RR error\n"); exit(1); \ }\ - tmp = (*x)->avl_left;\ - (*x)->avl_left = tmp->avl_right;\ - tmp->avl_right = *x;\ - *x = tmp;\ + tmp = (*(x))->avl_left;\ + (*(x))->avl_left = tmp->avl_right;\ + tmp->avl_right = *(x);\ + *(x) = tmp;\ } #define ROTATELEFT(x) { \ Avlnode *tmp;\ - if ( *x == NULL || (*x)->avl_right == NULL ) {\ + if ( *(x) == NULL || (*(x))->avl_right == NULL ) {\ (void) printf("RL error\n"); exit(1); \ }\ - tmp = (*x)->avl_right;\ - (*x)->avl_right = tmp->avl_left;\ + tmp = (*(x))->avl_right;\ + (*(x))->avl_right = tmp->avl_left;\ tmp->avl_left = *x;\ - *x = tmp;\ + *(x) = tmp;\ } /* diff --git a/libraries/libavl/libavl.dsp b/libraries/libavl/libavl.dsp new file mode 100644 index 0000000000..107059441a --- /dev/null +++ b/libraries/libavl/libavl.dsp @@ -0,0 +1,86 @@ +# Microsoft Developer Studio Project File - Name="libavl" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libavl - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libavl.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libavl.mak" CFG="libavl - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libavl - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libavl - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe + +!IF "$(CFG)" == "libavl - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libavl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\Debug" +# PROP Intermediate_Dir "Debug\libavl" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /Z7 /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libavl - Win32 Release" +# Name "libavl - Win32 Debug" +# Begin Source File + +SOURCE=.\avl.c +# End Source File +# Begin Source File + +SOURCE=..\..\include\avl.h +# End Source File +# End Target +# End Project diff --git a/libraries/libavl/libavl.dsw b/libraries/libavl/libavl.dsw new file mode 100644 index 0000000000..a3ea4fd280 --- /dev/null +++ b/libraries/libavl/libavl.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libavl"=.\libavl.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/libraries/libavl/testavl.c b/libraries/libavl/testavl.c index 71939f4985..5e69e6f3f6 100644 --- a/libraries/libavl/testavl.c +++ b/libraries/libavl/testavl.c @@ -1,20 +1,17 @@ /* testavl.c - Test Tim Howes AVL code */ -#include -#include -#include "avl.h" -char *strdup( s ) -char *s; -{ - char *new; +#include "portable.h" - if ( (new = (char *) malloc( strlen( s ) + 1 )) == NULL ) - return( NULL ); +#include +#include - strcpy( new, s ); +#include +#include - return( new ); -} +#include "avl.h" + +static void ravl_print LDAP_P(( Avlnode *root, int depth )); +static void myprint LDAP_P(( Avlnode *root )); main( argc, argv ) int argc; @@ -24,7 +21,6 @@ char **argv; char command[ 10 ]; char name[ 80 ]; char *p; - int free(), strcmp(); printf( "> " ); while ( fgets( command, sizeof( command ), stdin ) != NULL ) { @@ -39,7 +35,7 @@ char **argv; case 't': /* traverse with first, next */ printf( "***\n" ); for ( p = (char * ) avl_getfirst( tree ); - p != NULL; p = (char *) avl_getnext( tree, p ) ) + p != NULL; p = (char *) avl_getnext( /* tree, p */ ) ) printf( "%s\n", p ); printf( "***\n" ); break; @@ -60,7 +56,7 @@ char **argv; exit( 0 ); name[ strlen( name ) - 1 ] = '\0'; if ( avl_insert( &tree, strdup( name ), strcmp, - avl_dup_error ) != OK ) + avl_dup_error ) != 0 ) printf( "\nNot inserted!\n" ); break; case 'd': /* delete */ @@ -85,9 +81,7 @@ char **argv; /* NOTREACHED */ } -static ravl_print( root, depth ) -Avlnode *root; -int depth; +static void ravl_print( Avlnode *root, int depth ) { int i; @@ -103,15 +97,14 @@ int depth; ravl_print( root->avl_left, depth+1 ); } -myprint( root ) -Avlnode *root; +static void myprint( Avlnode *root ) { printf( "********\n" ); if ( root == 0 ) printf( "\tNULL\n" ); else - ( void ) ravl_print( root, 0 ); + ravl_print( root, 0 ); printf( "********\n" ); } diff --git a/libraries/libavl/testavl.dsp b/libraries/libavl/testavl.dsp new file mode 100644 index 0000000000..b6501e9acd --- /dev/null +++ b/libraries/libavl/testavl.dsp @@ -0,0 +1,87 @@ +# Microsoft Developer Studio Project File - Name="testavl" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=testavl - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "testavl.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "testavl.mak" CFG="testavl - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "testavl - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "testavl - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "testavl - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release\testavl" +# PROP Intermediate_Dir "Release\testavl" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "testavl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "testavl_" +# PROP BASE Intermediate_Dir "testavl_" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug\testavl" +# PROP Intermediate_Dir "Debug\testavl" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "testavl - Win32 Release" +# Name "testavl - Win32 Debug" +# Begin Source File + +SOURCE=.\testavl.c +# End Source File +# End Target +# End Project diff --git a/libraries/libavl/testavl.dsw b/libraries/libavl/testavl.dsw new file mode 100644 index 0000000000..8829d3b5b6 --- /dev/null +++ b/libraries/libavl/testavl.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libavl"=.\libavl.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "testavl"=.\testavl.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libavl + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/libraries/liblber/Make-template b/libraries/liblber/Make-template deleted file mode 100644 index 5ef929a01c..0000000000 --- a/libraries/liblber/Make-template +++ /dev/null @@ -1,76 +0,0 @@ -#----------------------------------------------------------------------------- -# Copyright (c) 1990 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. -# -# lightweight ber library makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC = ../.. -SRCS = decode.c encode.c io.c bprint.c -OBJS = decode.o encode.o io.o bprint.o - -HDIR = ../../include - -INCLUDES= -I$(HDIR) -DEFINES = $(DEFS) -CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS) - -all: liblber.a - -liblber.a: version.o - $(AR) ruv $@ $(OBJS) version.o - @if [ ! -z "$(RANLIB)" ]; then \ - $(RANLIB) $@; \ - fi; \ - $(RM) ../$@; \ - $(LN) liblber/$@ ../$@ - -idtest: idtest.o - $(CC) $(ALDFLAGS) -o $@ idtest.c $(ISODEINCLUDEFLAG) \ - $(KRBINCLUDEFLAG) $(ISODELIBFLAG) $(ISODELIBS) \ - $(KRBLIBLFAG) $(KRBLIBS) $(ALIBS) - -etest: liblber.a etest.o - $(CC) $(ALDFLAGS) -o $@ etest.o ./liblber.a $(ALIBS) - -dtest: liblber.a dtest.o - $(CC) $(ALDFLAGS) -o $@ dtest.o ./liblber.a $(ALIBS) - -version.c: $(OBJS) - $(RM) $@ - (u=$${USER-root} v=`$(CAT) ../../build/version` d=`$(PWD)` \ - h=`$(HOSTNAME)` t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -install: liblber.a FORCE - -$(MKDIR) -p $(LDAP_LIBDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 liblber.a $(LDAP_LIBDIR) - @if [ ! -z "$(RANLIB)" ]; then \ - (cd /tmp; $(RANLIB) $(LDAP_LIBDIR)/liblber.a) \ - fi - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) liblber.a ../liblber.a *.o core a.out version.c dtest etest idtest - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/ldap* .src/*.[ch] . - diff --git a/libraries/liblber/Makefile.in b/libraries/liblber/Makefile.in new file mode 100644 index 0000000000..1a93680fb9 --- /dev/null +++ b/libraries/liblber/Makefile.in @@ -0,0 +1,18 @@ +## +## LIBLBER +## + +SRCS = decode.c encode.c io.c bprint.c +OBJS = decode.o encode.o io.o bprint.o +XSRCS = version.c + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +LIBRARY = liblber.a + +install-local: $(LIBRARY) FORCE + -$(MKDIR) -p $(libdir) + $(INSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(libdir) + @(cd /tmp; $(RANLIB) $(libdir)/$(LIBRARY)) + diff --git a/libraries/liblber/bprint.c b/libraries/liblber/bprint.c index e4b6fd27ea..882facd70d 100644 --- a/libraries/liblber/bprint.c +++ b/libraries/liblber/bprint.c @@ -1,20 +1,26 @@ + +#include "portable.h" + +#if defined( LDAP_DEBUG ) && defined( LDAP_LIBUI ) #include -#include -#include + +#include +#include +#endif /* LDAP_DEBUG && LDAP_LIBUI */ + #include "lber.h" /* * Print arbitrary stuff, for debugging. */ -#ifdef LDAP_DEBUG - -#ifndef NO_USERINTERFACE -#define BPLEN 48 void lber_bprint( char *data, int len ) { +#if defined( LDAP_DEBUG ) && defined( LDAP_LIBUI ) +#define BPLEN 48 + static char hexdig[] = "0123456789abcdef"; char out[ BPLEN ]; int i = 0; @@ -49,12 +55,7 @@ lber_bprint( char *data, int len ) } out[ i++ ] = ' '; } + +#endif /* LDAP_DEBUG && LDAP_LIBUI */ } -#else /* NO_USERINTERFACE */ -void -lber_bprint( char *data, int len ) -{ -} -#endif /* NO_USERINTERFACE */ -#endif diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index 2fd2a6252b..9162339cc7 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -11,46 +11,27 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#ifdef MACOS -#include -#include -#include "macos.h" -#else /* MACOS */ -#if defined(NeXT) || defined(VMS) || defined(__FreeBSD__) +#ifdef STDC_HEADERS #include -#else /* next || vms || freebsd */ -#include -#endif /* next || vms || freebsd */ -#if defined(BC31) || defined(_WIN32) #include -#else /* BC31 || _WIN32 */ +#else #include -#endif /* BC31 || _WIN32 */ -#include -#include -#include -#ifdef PCNFS -#include -#endif /* PCNFS */ -#endif /* MACOS */ - -#if defined( DOS ) || defined( _WIN32 ) -#include "msdos.h" -#endif /* DOS */ - -#include +#endif + +#include +#include + #include "lber.h" #ifdef LDAP_DEBUG int lber_debug; #endif -#ifdef NEEDPROTOS -static int ber_getnint( BerElement *ber, long *num, int len ); -#endif /* NEEDPROTOS */ - +static int ber_getnint LDAP_P(( BerElement *ber, long *num, int len )); /* return the tag - LBER_DEFAULT returned means trouble */ unsigned long @@ -130,7 +111,7 @@ ber_skip_tag( BerElement *ber, unsigned long *len ) if ( ber_read( ber, (char *) &netlen + diff, noctets ) != noctets ) return( LBER_DEFAULT ); - *len = LBER_NTOHL( netlen ); + *len = AC_NTOHL( netlen ); } else { *len = lc; } @@ -179,10 +160,10 @@ ber_getnint( BerElement *ber, long *num, int len ) sign = (0x80 & *(p+diff) ); if ( sign && len < sizeof(long) ) { for ( i = 0; i < diff; i++ ) { - *(p+i) = 0xff; + *(p+i) = (unsigned char) 0xff; } } - *num = LBER_NTOHL( netnum ); + *num = AC_NTOHL( netnum ); return( len ); } @@ -195,7 +176,7 @@ ber_get_int( BerElement *ber, long *num ) if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT ) return( LBER_DEFAULT ); - if ( ber_getnint( ber, num, (int)len ) != len ) + if ( (unsigned long) ber_getnint( ber, num, (int)len ) != len ) return( LBER_DEFAULT ); else return( tag ); @@ -214,7 +195,7 @@ ber_get_stringb( BerElement *ber, char *buf, unsigned long *len ) if ( datalen > (*len - 1) ) return( LBER_DEFAULT ); - if ( ber_read( ber, buf, datalen ) != datalen ) + if ( (unsigned long) ber_read( ber, buf, datalen ) != datalen ) return( LBER_DEFAULT ); buf[datalen] = '\0'; @@ -253,7 +234,7 @@ ber_get_stringa( BerElement *ber, char **buf ) if ( (*buf = (char *) malloc( (size_t)datalen + 1 )) == NULL ) return( LBER_DEFAULT ); - if ( ber_read( ber, *buf, datalen ) != datalen ) + if ( (unsigned long) ber_read( ber, *buf, datalen ) != datalen ) return( LBER_DEFAULT ); (*buf)[datalen] = '\0'; @@ -286,7 +267,7 @@ ber_get_stringal( BerElement *ber, struct berval **bv ) if ( ((*bv)->bv_val = (char *) malloc( (size_t)len + 1 )) == NULL ) return( LBER_DEFAULT ); - if ( ber_read( ber, (*bv)->bv_val, len ) != len ) + if ( (unsigned long) ber_read( ber, (*bv)->bv_val, len ) != len ) return( LBER_DEFAULT ); ((*bv)->bv_val)[len] = '\0'; (*bv)->bv_len = len; @@ -323,7 +304,7 @@ ber_get_bitstringa( BerElement *ber, char **buf, unsigned long *blen ) if ( ber_read( ber, (char *)&unusedbits, 1 ) != 1 ) return( LBER_DEFAULT ); - if ( ber_read( ber, *buf, datalen ) != datalen ) + if ( (unsigned long) ber_read( ber, *buf, datalen ) != datalen ) return( LBER_DEFAULT ); *blen = datalen * 8 - unusedbits; @@ -385,16 +366,16 @@ ber_next_element( BerElement *ber, unsigned long *len, char *last ) /* VARARGS */ unsigned long -ber_scanf( -#if defined( MACOS ) || defined( BC31 ) || defined( _WIN32 ) - BerElement *ber, char *fmt, ... ) +ber_scanf +#ifdef STDC_HEADERS + ( BerElement *ber, char *fmt, ... ) #else - va_alist ) + ( va_alist ) va_dcl #endif { va_list ap; -#if !defined( MACOS ) && !defined( BC31 ) && !defined( _WIN32 ) +#ifndef STDC_HEADERS BerElement *ber; char *fmt; #endif @@ -405,7 +386,7 @@ va_dcl long *l, rc, tag; unsigned long len; -#if defined( MACOS ) || defined( BC31 ) || defined( _WIN32 ) +#if STDC_HEADERS va_start( ap, fmt ); #else va_start( ap ); @@ -539,9 +520,9 @@ va_dcl break; default: -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI fprintf( stderr, "unknown fmt %c\n", *fmt ); -#endif /* NO_USERINTERFACE */ +#endif /* LDAP_LIBUI */ rc = LBER_DEFAULT; break; } diff --git a/libraries/liblber/dtest.c b/libraries/liblber/dtest.c index cd63b9f89a..57f43c3dbf 100644 --- a/libraries/liblber/dtest.c +++ b/libraries/liblber/dtest.c @@ -11,40 +11,43 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#ifdef MACOS #include + +#include +#include + +#ifdef HAVE_CONSOLE_H #include -#else /* MACOS */ -#include -#include #endif /* MACOS */ + #include "lber.h" -static usage( char *name ) +static void usage( char *name ) { fprintf( stderr, "usage: %s fmt\n", name ); } main( int argc, char **argv ) { - long i, i2, num; + long i; unsigned long len; int tag; - char *str, *s1, *s2; BerElement ber; Sockbuf sb; extern char *optarg; -#ifdef MACOS +#ifdef HAVE_CONSOLE_H ccommand( &argv ); cshow( stdout ); #endif /* MACOS */ - bzero( &sb, sizeof(sb) ); + memset( &sb, 0, sizeof(sb) ); sb.sb_sd = 0; sb.sb_ber.ber_buf = NULL; + if ( (tag = ber_get_next( &sb, &len, &ber )) == -1 ) { perror( "ber_get_next" ); exit( 1 ); diff --git a/libraries/liblber/dtest.dsp b/libraries/liblber/dtest.dsp new file mode 100644 index 0000000000..e4c1c3ec83 --- /dev/null +++ b/libraries/liblber/dtest.dsp @@ -0,0 +1,89 @@ +# Microsoft Developer Studio Project File - Name="dtest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=dtest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "dtest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "dtest.mak" CFG="dtest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "dtest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "dtest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "dtest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release\dtest" +# PROP Intermediate_Dir "Release\dtest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 liblber.lib ws2_32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "dtest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "dtest___" +# PROP BASE Intermediate_Dir "dtest___" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug\dtest" +# PROP Intermediate_Dir "Debug\dtest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 liblber.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "dtest - Win32 Release" +# Name "dtest - Win32 Debug" +# Begin Source File + +SOURCE=.\dtest.c +# End Source File +# End Target +# End Project diff --git a/libraries/liblber/dtest.dsw b/libraries/liblber/dtest.dsw new file mode 100644 index 0000000000..ba86f70635 --- /dev/null +++ b/libraries/liblber/dtest.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "dtest"=.\dtest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name liblber + End Project Dependency +}}} + +############################################################################### + +Project: "liblber"=.\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index c8a95e2a19..c31bd3ce21 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -11,45 +11,32 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#ifdef MACOS -#include -#include -#include "macos.h" -#else /* MACOS */ -#if defined(NeXT) || defined(VMS) || defined(__FreeBSD__) #include -#else /* next || vms || freebsd */ -#include -#endif /* next || vms || freebsd */ -#if defined( BC31 ) || defined( _WIN32 ) + +#ifdef STDC_HEADERS #include -#else /* BC31 || _WIN32 */ +#else #include -#endif /* BC31 || _WIN32 */ -#include -#include -#include -#ifdef PCNFS -#include -#endif /* PCNFS */ -#endif /* MACOS */ -#ifndef VMS -#include #endif -#include + +#include +#include + #include "lber.h" -#if defined( DOS ) || defined( _WIN32 ) -#include "msdos.h" -#endif /* DOS */ +static int ber_put_len LDAP_P(( BerElement *ber, + unsigned long len, int nosos )); -#ifdef NEEDPROTOS -static int ber_put_len( BerElement *ber, unsigned long len, int nosos ); -static int ber_start_seqorset( BerElement *ber, unsigned long tag ); -static int ber_put_seqorset( BerElement *ber ); -static int ber_put_int_or_enum( BerElement *ber, long num, unsigned long tag ); -#endif /* NEEDPROTOS */ +static int ber_start_seqorset LDAP_P(( BerElement *ber, + unsigned long tag )); + +static int ber_put_seqorset LDAP_P(( BerElement *ber )); + +static int ber_put_int_or_enum LDAP_P(( BerElement *ber, + long num, unsigned long tag )); static int @@ -77,7 +64,7 @@ ber_put_tag( BerElement *ber, unsigned long tag, int nosos ) taglen = ber_calc_taglen( tag ); - ntag = LBER_HTONL( tag ); + ntag = AC_HTONL( tag ); return( ber_write( ber, ((char *) &ntag) + sizeof(long) - taglen, taglen, nosos ) ); @@ -123,7 +110,7 @@ ber_put_len( BerElement *ber, unsigned long len, int nosos ) */ if ( len <= 127 ) { - netlen = LBER_HTONL( len ); + netlen = AC_HTONL( len ); return( ber_write( ber, (char *) &netlen + sizeof(long) - 1, 1, nosos ) ); } @@ -140,7 +127,7 @@ ber_put_len( BerElement *ber, unsigned long len, int nosos ) if ( len & mask ) break; } - lenlen = ++i; + lenlen = (unsigned char) ++i; if ( lenlen > 4 ) return( -1 ); lenlen |= 0x80; @@ -150,7 +137,7 @@ ber_put_len( BerElement *ber, unsigned long len, int nosos ) return( -1 ); /* write the length itself */ - netlen = LBER_HTONL( len ); + netlen = AC_HTONL( len ); if ( ber_write( ber, (char *) &netlen + (sizeof(long) - i), i, nosos ) != i ) return( -1 ); @@ -201,7 +188,7 @@ ber_put_int_or_enum( BerElement *ber, long num, unsigned long tag ) if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 ) return( -1 ); i++; - netnum = LBER_HTONL( num ); + netnum = AC_HTONL( num ); if ( ber_write( ber, (char *) &netnum + (sizeof(long) - i), i, 0 ) != i ) return( -1 ); @@ -257,7 +244,7 @@ ber_put_ostring( BerElement *ber, char *str, unsigned long len, #endif /* STR_TRANSLATION */ if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 || - ber_write( ber, str, len, 0 ) != len ) { + (unsigned long) ber_write( ber, str, len, 0 ) != len ) { rc = -1; } else { /* return length of tag + length + contents */ @@ -293,7 +280,7 @@ ber_put_bitstring( BerElement *ber, char *str, return( -1 ); len = ( blen + 7 ) / 8; - unusedbits = len * 8 - blen; + unusedbits = (unsigned char) ((len * 8) - blen); if ( (lenlen = ber_put_len( ber, len + 1, 0 )) == -1 ) return( -1 ); @@ -409,7 +396,7 @@ ber_put_seqorset( BerElement *ber ) */ len = (*sos)->sos_clen; - netlen = LBER_HTONL( len ); + netlen = AC_HTONL( len ); if ( sizeof(long) > 4 && len > 0xFFFFFFFFL ) return( -1 ); @@ -458,12 +445,14 @@ ber_put_seqorset( BerElement *ber ) /* the tag */ taglen = ber_calc_taglen( (*sos)->sos_tag ); - ntag = LBER_HTONL( (*sos)->sos_tag ); + ntag = AC_HTONL( (*sos)->sos_tag ); SAFEMEMCPY( (*sos)->sos_first, (char *) &ntag + sizeof(long) - taglen, taglen ); if ( ber->ber_options & LBER_USE_DER ) { - ltag = (lenlen == 1) ? len : 0x80 + (lenlen - 1); + ltag = (lenlen == 1) + ? (unsigned char) len + : 0x80 + (lenlen - 1); } /* one byte of length length */ @@ -519,31 +508,31 @@ ber_put_set( BerElement *ber ) /* VARARGS */ int -ber_printf( -#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) - BerElement *ber, char *fmt, ... ) -#else /* MACOS || _WIN32 || BC31 */ - va_alist ) +ber_printf +#ifdef STDC_HEADERS + ( BerElement *ber, char *fmt, ... ) +#else + ( va_alist ) va_dcl -#endif /* MACOS || _WIN32 || BC31 */ +#endif { va_list ap; -#if !defined( MACOS ) && !defined( _WIN32 ) && !defined( BC31 ) +#ifndef STDC_HEADERS BerElement *ber; char *fmt; -#endif /* !MACOS && !_WIN32 && !BC31 */ +#endif char *s, **ss; struct berval **bv; int rc, i; unsigned long len; -#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) +#ifdef STDC_HEADERS va_start( ap, fmt ); -#else /* MACOS || _WIN32 || BC31 */ +#else va_start( ap ); ber = va_arg( ap, BerElement * ); fmt = va_arg( ap, char * ); -#endif /* MACOS || _WIN32 || BC31 */ +#endif for ( rc = 0; *fmt && rc != -1; fmt++ ) { switch ( *fmt ) { @@ -625,9 +614,9 @@ va_dcl break; default: -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI fprintf( stderr, "unknown fmt %c\n", *fmt ); -#endif /* NO_USERINTERFACE */ +#endif /* LDAP_LIBUI */ rc = -1; break; } diff --git a/libraries/liblber/etest.c b/libraries/liblber/etest.c index 50ac00d4bf..ae1321b568 100644 --- a/libraries/liblber/etest.c +++ b/libraries/liblber/etest.c @@ -4,28 +4,31 @@ * All rights reserved. */ +#include "portable.h" + #include -#include -#ifdef MACOS -#include -#include -#include + +#include +#include + +#ifdef HAVE_CONSOLE_H #include -#else /* MACOS */ -#include -#include -#endif /* MACOS */ +#endif /* HAVE_CONSOLE_H */ + #include "lber.h" -static usage( char *name ) +static void usage( char *name ) { fprintf( stderr, "usage: %s fmtstring\n", name ); } main( int argc, char **argv ) { - int i, num, len; - char *s, *p; +#ifdef notdef + int i, len; + char *s, *p; +#endif + int num; Seqorset *sos = NULLSEQORSET; BerElement *ber; Sockbuf sb; @@ -36,11 +39,11 @@ main( int argc, char **argv ) exit( 1 ); } - bzero( &sb, sizeof(sb) ); + memset( &sb, 0, sizeof(sb) ); sb.sb_sd = 1; sb.sb_ber.ber_buf = NULL; -#ifdef MACOS +#ifdef HAVE_CONSOLE_H ccommand( &argv ); cshow( stdout ); @@ -151,9 +154,9 @@ main( int argc, char **argv ) break; default: -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI fprintf( stderr, "unknown fmt %c\n", *fmt ); -#endif /* NO_USERINTERFACE */ +#endif /* LDAP_LIBUI */ rc = -1; break; } diff --git a/libraries/liblber/etest.dsp b/libraries/liblber/etest.dsp new file mode 100644 index 0000000000..574f154bb5 --- /dev/null +++ b/libraries/liblber/etest.dsp @@ -0,0 +1,89 @@ +# Microsoft Developer Studio Project File - Name="etest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=etest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "etest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "etest.mak" CFG="etest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "etest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "etest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "etest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release\etest" +# PROP Intermediate_Dir "Release\etest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 liblber.lib ws2_32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "etest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "etest___" +# PROP BASE Intermediate_Dir "etest___" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug\etest" +# PROP Intermediate_Dir "Debug\etest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 liblber.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "etest - Win32 Release" +# Name "etest - Win32 Debug" +# Begin Source File + +SOURCE=.\etest.c +# End Source File +# End Target +# End Project diff --git a/libraries/liblber/etest.dsw b/libraries/liblber/etest.dsw new file mode 100644 index 0000000000..2cf4d7231b --- /dev/null +++ b/libraries/liblber/etest.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "etest"=.\etest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name liblber + End Project Dependency +}}} + +############################################################################### + +Project: "liblber"=.\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/libraries/liblber/idtest.c b/libraries/liblber/idtest.c index 1ad58fae79..937cfd5f14 100644 --- a/libraries/liblber/idtest.c +++ b/libraries/liblber/idtest.c @@ -11,6 +11,8 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include #include #include diff --git a/libraries/liblber/idtest.dsp b/libraries/liblber/idtest.dsp new file mode 100644 index 0000000000..1d2543be80 --- /dev/null +++ b/libraries/liblber/idtest.dsp @@ -0,0 +1,89 @@ +# Microsoft Developer Studio Project File - Name="idtest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=idtest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "idtest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "idtest.mak" CFG="idtest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "idtest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "idtest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "idtest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release\idtest" +# PROP Intermediate_Dir "Release\idtest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 liblber.lib ws2_32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "idtest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "idtest___" +# PROP BASE Intermediate_Dir "idtest___" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug\idtest" +# PROP Intermediate_Dir "Debug\idtest" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 liblber.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "idtest - Win32 Release" +# Name "idtest - Win32 Debug" +# Begin Source File + +SOURCE=.\idtest.c +# End Source File +# End Target +# End Project diff --git a/libraries/liblber/idtest.dsw b/libraries/liblber/idtest.dsw new file mode 100644 index 0000000000..c0323785ed --- /dev/null +++ b/libraries/liblber/idtest.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "idtest"=.\idtest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name liblber + End Project Dependency +}}} + +############################################################################### + +Project: "liblber"=.\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 731c0cf8f2..798448f421 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -11,50 +11,29 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include #include -#include -#include - -#if defined( DOS ) || defined( _WIN32 ) -#include "msdos.h" -#endif /* DOS || _WIN32 */ -#ifdef MACOS -#include "macos.h" -#else /* MACOS */ -#include -#include -#include -#include -#ifdef PCNFS -#include -#endif /* PCNFS */ -#endif /* MACOS */ +#include +#include +#include +#include +#include -#ifndef VMS -#include +#ifdef HAVE_IO_H +#include #endif -#include -#include "lber.h" -#ifdef _WIN32 -#include -#include -#endif /* _WIN32 */ +#include "lber.h" -#ifdef NEEDPROTOS -static int ber_realloc( BerElement *ber, unsigned long len ); -static int ber_filbuf( Sockbuf *sb, long len ); -static long BerRead( Sockbuf *sb, char *buf, long len ); +static int ber_realloc LDAP_P(( BerElement *ber, unsigned long len )); +static int ber_filbuf LDAP_P(( Sockbuf *sb, long len )); +static long BerRead LDAP_P(( Sockbuf *sb, char *buf, long len )); #ifdef PCNFS -static int BerWrite( Sockbuf *sb, char *buf, long len ); +static int BerWrite LDAP_P(( Sockbuf *sb, char *buf, long len )); #endif /* PCNFS */ -#else -int ber_filbuf(); -long BerRead(); -static int ber_realloc(); -#endif /* NEEDPROTOS */ #define bergetc( sb, len ) ( sb->sb_ber.ber_end > sb->sb_ber.ber_ptr ? \ (unsigned char)*sb->sb_ber.ber_ptr++ : \ @@ -130,9 +109,9 @@ int ber_filbuf( Sockbuf *sb, long len ) { short rc; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int addrlen; -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( sb->sb_ber.ber_buf == NULL ) { if ( (sb->sb_ber.ber_buf = (char *) malloc( READBUFSIZ )) == @@ -143,7 +122,7 @@ ber_filbuf( Sockbuf *sb, long len ) } if ( sb->sb_naddr > 0 ) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS rc = udp_read(sb, sb->sb_ber.ber_buf, READBUFSIZ, addrlen ); #ifdef LDAP_DEBUG if ( lber_debug ) { @@ -153,14 +132,13 @@ ber_filbuf( Sockbuf *sb, long len ) lber_bprint( sb->sb_ber.ber_buf, rc ); } #endif /* LDAP_DEBUG */ -#else /* CLDAP */ +#else /* LDAP_CONNECTIONLESS */ rc = -1; -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ } else { rc = read( sb->sb_sd, sb->sb_ber.ber_buf, - ((sb->sb_options & LBER_NO_READ_AHEAD) && - (len < READBUFSIZ)) ? - len : READBUFSIZ ); + ((sb->sb_options & LBER_NO_READ_AHEAD) && (len < READBUFSIZ)) ? + len : READBUFSIZ ); } if ( rc > 0 ) { @@ -185,7 +163,7 @@ BerRead( Sockbuf *sb, char *buf, long len ) break; return( c ); } - *buf++ = c; + *buf++ = (char) c; nread++; len--; } @@ -315,17 +293,18 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit ) nwritten = 0; do { if (sb->sb_naddr > 0) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS rc = udp_write( sb, ber->ber_buf + nwritten, (size_t)towrite ); -#else /* CLDAP */ +#else /* LDAP_CONNECTIONLESS */ rc = -1; -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( rc <= 0 ) return( -1 ); + /* fake error if write was not atomic */ if (rc < towrite) { -#if !defined( MACOS ) && !defined( DOS ) +#ifdef EMSGSIZE errno = EMSGSIZE; #endif return( -1 ); @@ -355,7 +334,7 @@ ber_alloc_t( int options ) if ( (ber = (BerElement *) calloc( 1, sizeof(BerElement) )) == NULLBER ) return( NULLBER ); ber->ber_tag = LBER_DEFAULT; - ber->ber_options = options; + ber->ber_options = (char) options; return( ber ); } @@ -391,7 +370,7 @@ ber_init( BerElement *ber, int options ) { (void) memset( (char *)ber, '\0', sizeof( BerElement )); ber->ber_tag = LBER_DEFAULT; - ber->ber_options = options; + ber->ber_options = (char) options; } @@ -543,7 +522,7 @@ ber_get_next( Sockbuf *sb, unsigned long *len, BerElement *ber ) noctets ) { return( LBER_DEFAULT ); } - *len = LBER_NTOHL( netlen ); + *len = AC_NTOHL( netlen ); } else { *len = lc; } @@ -562,7 +541,7 @@ ber_get_next( Sockbuf *sb, unsigned long *len, BerElement *ber ) #endif /* DOS && !_WIN32 */ if ( ( sb->sb_options & LBER_MAX_INCOMING_SIZE ) && - *len > sb->sb_max_incoming ) { + *len > (unsigned long) sb->sb_max_incoming ) { return( LBER_DEFAULT ); } diff --git a/libraries/liblber/liblber.dsp b/libraries/liblber/liblber.dsp new file mode 100644 index 0000000000..996c57c717 --- /dev/null +++ b/libraries/liblber/liblber.dsp @@ -0,0 +1,98 @@ +# Microsoft Developer Studio Project File - Name="liblber" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=liblber - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "liblber.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "liblber.mak" CFG="liblber - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "liblber - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "liblber - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe + +!IF "$(CFG)" == "liblber - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "liblber - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\Debug" +# PROP Intermediate_Dir "Debug\liblber" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /W4 /GX /Z7 /Od /I "..\..\include" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "liblber - Win32 Release" +# Name "liblber - Win32 Debug" +# Begin Source File + +SOURCE=.\bprint.c +# End Source File +# Begin Source File + +SOURCE=.\decode.c +# End Source File +# Begin Source File + +SOURCE=.\encode.c +# End Source File +# Begin Source File + +SOURCE=.\io.c +# End Source File +# Begin Source File + +SOURCE=..\..\include\lber.h +# End Source File +# End Target +# End Project diff --git a/libraries/liblber/liblber.dsw b/libraries/liblber/liblber.dsw new file mode 100644 index 0000000000..a3ac447307 --- /dev/null +++ b/libraries/liblber/liblber.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "liblber"=.\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/libraries/libldap/Make-template b/libraries/libldap/Make-template deleted file mode 100644 index a100e22825..0000000000 --- a/libraries/libldap/Make-template +++ /dev/null @@ -1,94 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP library makefile -# -#----------------------------------------------------------------------------- - -LDAPSRC = ../.. - -SRCS = bind.c open.c result.c error.c compare.c search.c \ - modify.c add.c modrdn.c delete.c abandon.c ufn.c cache.c \ - getfilter.c sbind.c kbind.c unbind.c friendly.c cldap.c \ - free.c disptmpl.c srchpref.c dsparse.c tmplout.c sort.c \ - getdn.c getentry.c getattr.c getvalues.c addentry.c \ - request.c getdxbyname.c os-ip.c url.c charset.c -OBJS = bind.o open.o result.o error.o compare.o search.o \ - modify.o add.o modrdn.o delete.o abandon.o ufn.o cache.o \ - getfilter.o sbind.o kbind.o unbind.o friendly.o cldap.o \ - free.o disptmpl.o srchpref.o dsparse.o tmplout.o sort.o \ - getdn.o getentry.o getattr.o getvalues.o addentry.o \ - request.o getdxbyname.o os-ip.o url.o charset.o - -HDIR = ../../include - -INCLUDES= -I$(HDIR) $(KRBINCLUDEFLAG) -DEFINES = $(DEFS) - -CFLAGS = $(INCLUDES) $(DEFINES) $(ACFLAGS) -LIBS = -L. -L../liblber -lldap -llber $(KRBLIBFLAG) $(KRBLIBS) $(ALIBS) - -all: libldap.a ltest ttest - -libldap.a: version.o - $(AR) ruv $@ $(OBJS) version.o - @if [ ! -z "$(RANLIB)" ]; then \ - $(RANLIB) $@; \ - fi; \ - $(RM) ../$@; \ - $(LN) libldap/$@ ../$@ - -ltest: libldap.a test.o ../liblber/liblber.a - $(CC) $(ALDFLAGS) -o $@ test.o $(LIBS) - -ttest: libldap.a tmpltest.o ../liblber/liblber.a - $(CC) $(ALDFLAGS) -o $@ tmpltest.o $(LIBS) - -version.c: $(OBJS) - $(RM) $@ - (u=$${USER-root} v=`$(CAT) ../../build/version` d=`$(PWD)` \ - h=`$(HOSTNAME)` t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -install: libldap.a ldapfilter.conf ldapfriendly ldaptemplates.conf ldapsearchprefs.conf FORCE - -$(MKDIR) -p $(LDAP_LIBDIR) $(LDAP_ETCDIR) - $(INSTALL) $(INSTALLFLAGS) -m 644 libldap.a $(LDAP_LIBDIR) - @if [ ! -z "$(RANLIB)" ]; then \ - (cd /tmp; $(RANLIB) $(LDAP_LIBDIR)/libldap.a) \ - fi - -$(MKDIR) -p $(LDAP_ETCDIR) - -$(MV) $(LDAP_ETCDIR)/ldapfriendly $(LDAP_ETCDIR)/ldapfriendly- - $(INSTALL) $(INSTALLFLAGS) -m 644 ldapfriendly $(LDAP_ETCDIR) - -$(MV) $(LDAP_ETCDIR)/ldapfilter.conf $(LDAP_ETCDIR)/ldapfilter.conf- - $(INSTALL) $(INSTALLFLAGS) -m 644 ldapfilter.conf $(LDAP_ETCDIR) - -$(MV) $(LDAP_ETCDIR)/ldaptemplates.conf $(LDAP_ETCDIR)/ldaptemplates.conf- - $(INSTALL) $(INSTALLFLAGS) -m 644 ldaptemplates.conf $(LDAP_ETCDIR) - -$(MV) $(LDAP_ETCDIR)/ldapsearchprefs.conf $(LDAP_ETCDIR)/ldapsearchprefs.conf- - $(INSTALL) $(INSTALLFLAGS) -m 644 ldapsearchprefs.conf $(LDAP_ETCDIR) - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) libldap.a ../libldap.a ltest ttest *.o core a.out *.log version.c - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/*.[ch] .src/ldapfriendly .src/ldapfilter.conf \ - .src/ldaptemplates.conf .src/ldapsearchprefs.conf . - diff --git a/libraries/libldap/Makefile.in b/libraries/libldap/Makefile.in new file mode 100644 index 0000000000..d18c4e0a9f --- /dev/null +++ b/libraries/libldap/Makefile.in @@ -0,0 +1,45 @@ +## +## Makefile.in for LDAP -lldap +## +LIBRARY = libldap.a +PROGRAMS = ltest ttest + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + + +SRCS = bind.c open.c result.c error.c compare.c search.c \ + modify.c add.c modrdn.c delete.c abandon.c ufn.c cache.c \ + getfilter.c sbind.c kbind.c unbind.c friendly.c cldap.c \ + free.c disptmpl.c srchpref.c dsparse.c tmplout.c sort.c \ + getdn.c getentry.c getattr.c getvalues.c addentry.c \ + request.c getdxbyname.c os-ip.c url.c charset.c +OBJS = bind.o open.o result.o error.o compare.o search.o \ + modify.o add.o modrdn.o delete.o abandon.o ufn.o cache.o \ + getfilter.o sbind.o kbind.o unbind.o friendly.o cldap.o \ + free.o disptmpl.o srchpref.o dsparse.o tmplout.o sort.o \ + getdn.o getentry.o getattr.o getvalues.o addentry.o \ + request.o getdxbyname.o os-ip.o url.o charset.o + +LIBS = -L$(LDAP_LIBDIR) -lldap -llber $(AC_LIBS) +LIBLBER = ../liblber/liblber.a + +ltest: $(LIBRARY) test.o $(LIBLBER) + $(CC) $(LDFLAGS) -o $@ test.o $(LIBS) +ttest: $(LIBRARY) tmpltest.o $(LIBLBER) + $(CC) $(LDFLAGS) -o $@ tmpltest.o $(LIBS) + +CFFILES= ldapfilter.conf ldapfriendly ldaptemplates.conf ldapsearchprefs.conf + +install-local: $(LIBRARY) $(CFFILES) FORCE + -$(MKDIR) -p $(libdir) + $(INSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(libdir) + @(cd /tmp; $(RANLIB) $(libdir)/$(LIBRARY)) + -$(MKDIR) -p $(sysconfdir) + @for i in $(CFFILES); do \ + echo "installing $$i in $(sysconfdir)"; \ + if test -f $(sysconfdir)/$$i; then \ + $(MV) $(sysconfdir)/$$i $(sysconfdir)/$$i-; \ + fi; \ + $(INSTALL) $(INSTALLFLAGS) -m 644 $$i $(sysconfdir); \ + done diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index 64a3e419a5..533695f3b5 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -5,37 +5,25 @@ * abandon.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include #include -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif - -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#endif /* DOS */ - -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ +#include +#include +#include #include "lber.h" #include "ldap.h" #include "ldap-int.h" -#ifdef NEEDPROTOS -static int do_abandon( LDAP *ld, int origid, int msgid ); -#else /* NEEDPROTOS */ -static int do_abandon(); -#endif /* NEEDPROTOS */ +static int do_abandon LDAP_P(( LDAP *ld, int origid, int msgid )); + /* * ldap_abandon - perform an ldap (and X.500) abandon operation. Parameters: * @@ -111,18 +99,18 @@ do_abandon( LDAP *ld, int origid, int msgid ) err = -1; ld->ld_errno = LDAP_NO_MEMORY; } else { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( ld->ld_sb.sb_naddr > 0 ) { err = ber_printf( ber, "{isti}", ++ld->ld_msgid, ld->ld_cldapdn, LDAP_REQ_ABANDON, msgid ); } else { -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ err = ber_printf( ber, "{iti}", ++ld->ld_msgid, LDAP_REQ_ABANDON, msgid ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( err == -1 ) { ld->ld_errno = LDAP_ENCODING_ERROR; diff --git a/libraries/libldap/add.c b/libraries/libldap/add.c index 143e36e161..73e84964c1 100644 --- a/libraries/libldap/add.c +++ b/libraries/libldap/add.c @@ -5,26 +5,17 @@ * add.c */ -#ifndef lint +#include "portable.h" + +#ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include - -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ - -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#endif /* DOS */ -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif /* !MACOS && !DOS */ +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/addentry.c b/libraries/libldap/addentry.c index a0fc4174e6..ce85e8cb35 100644 --- a/libraries/libldap/addentry.c +++ b/libraries/libldap/addentry.c @@ -5,25 +5,19 @@ * addentry.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/bind.c b/libraries/libldap/bind.c index 0a0487349e..aec1a3b568 100644 --- a/libraries/libldap/bind.c +++ b/libraries/libldap/bind.c @@ -5,27 +5,18 @@ * bind.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include "msdos.h" -#ifdef NCSA -#include "externs.h" -#endif /* NCSA */ -#else /* DOS */ -#include -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -54,7 +45,7 @@ ldap_bind( LDAP *ld, char *dn, char *passwd, int authmethod ) * name DistinguishedName, -- who * authentication CHOICE { * simple [0] OCTET STRING -- passwd -#ifdef KERBEROS +#ifdef HAVE_KERBEROS * krbv42ldap [1] OCTET STRING * krbv42dsa [2] OCTET STRING #endif @@ -69,7 +60,7 @@ ldap_bind( LDAP *ld, char *dn, char *passwd, int authmethod ) case LDAP_AUTH_SIMPLE: return( ldap_simple_bind( ld, dn, passwd ) ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case LDAP_AUTH_KRBV41: return( ldap_kerberos_bind1( ld, dn ) ); @@ -106,7 +97,7 @@ ldap_bind_s( LDAP *ld, char *dn, char *passwd, int authmethod ) case LDAP_AUTH_SIMPLE: return( ldap_simple_bind_s( ld, dn, passwd ) ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case LDAP_AUTH_KRBV4: return( ldap_kerberos_bind_s( ld, dn ) ); diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index 2e47d68694..8216461c1e 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -5,61 +5,40 @@ * cache.c - local caching support for LDAP */ -#ifndef NO_CACHE +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1993 The Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include #include -#ifdef MACOS -#include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#ifdef NCSA -#include "externs.h" -#endif /* NCSA */ -#ifdef WINSOCK -#include -#endif /* WINSOCK */ -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ +#include +#include +#include #include "lber.h" #include "ldap.h" #include "ldap-int.h" -#ifdef NEEDPROTOS -static int cache_hash( BerElement *ber ); -static LDAPMessage *msg_dup( LDAPMessage *msg ); -static int request_cmp( BerElement *req1, BerElement *req2 ); -static int chain_contains_dn( LDAPMessage *msg, char *dn ); -static long msg_size( LDAPMessage *msg ); -static void check_cache_memused( LDAPCache *lc ); -static void uncache_entry_or_req( LDAP *ld, char *dn, int msgid ); -#else /* NEEDPROTOS */ -static int cache_hash(); -static LDAPMessage *msg_dup(); -static int request_cmp(); -static int chain_contains_dn(); -static long msg_size(); -static void check_cache_memused(); -static void uncache_entry_or_req(); -#endif /* NEEDPROTOS */ +#ifndef LDAP_NOCACHE + +static int cache_hash LDAP_P(( BerElement *ber )); +static LDAPMessage *msg_dup LDAP_P(( LDAPMessage *msg )); +static int request_cmp LDAP_P(( BerElement *req1, BerElement *req2 )); +static int chain_contains_dn LDAP_P(( LDAPMessage *msg, char *dn )); +static long msg_size LDAP_P(( LDAPMessage *msg )); +static void check_cache_memused LDAP_P(( LDAPCache *lc )); +static void uncache_entry_or_req LDAP_P(( LDAP *ld, char *dn, int msgid )); +#endif int ldap_enable_cache( LDAP *ld, long timeout, long maxmem ) { +#ifndef LDAP_NOCACHE if ( ld->ld_cache == NULLLDCACHE ) { if (( ld->ld_cache = (LDAPCache *)malloc( sizeof( LDAPCache ))) == NULLLDCACHE ) { @@ -75,15 +54,20 @@ ldap_enable_cache( LDAP *ld, long timeout, long maxmem ) check_cache_memused( ld->ld_cache ); ld->ld_cache->lc_enabled = 1; return( 0 ); +#else + return( -1 ); +#endif } void ldap_disable_cache( LDAP *ld ) { +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULLLDCACHE ) { ld->ld_cache->lc_enabled = 0; } +#endif } @@ -91,26 +75,31 @@ ldap_disable_cache( LDAP *ld ) void ldap_set_cache_options( LDAP *ld, unsigned long opts ) { +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULLLDCACHE ) { ld->ld_cache->lc_options = opts; } +#endif } void ldap_destroy_cache( LDAP *ld ) { +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULLLDCACHE ) { ldap_flush_cache( ld ); free( (char *)ld->ld_cache ); ld->ld_cache = NULLLDCACHE; } +#endif } void ldap_flush_cache( LDAP *ld ) { +#ifndef LDAP_NOCACHE int i; LDAPMessage *m, *next; @@ -135,29 +124,36 @@ ldap_flush_cache( LDAP *ld ) } ld->ld_cache->lc_memused = sizeof( LDAPCache ); } +#endif } void ldap_uncache_request( LDAP *ld, int msgid ) { +#ifndef LDAP_NOCACHE Debug( LDAP_DEBUG_TRACE, "ldap_uncache_request %d ld_cache %lx\n", msgid, (long) ld->ld_cache, 0 ); uncache_entry_or_req( ld, NULL, msgid ); +#endif } void ldap_uncache_entry( LDAP *ld, char *dn ) { +#ifndef LDAP_NOCACHE Debug( LDAP_DEBUG_TRACE, "ldap_uncache_entry %s ld_cache %lx\n", dn, (long) ld->ld_cache, 0 ); uncache_entry_or_req( ld, dn, 0 ); +#endif } +#ifndef LDAP_NOCACHE + static void uncache_entry_or_req( LDAP *ld, char *dn, /* if non-NULL, uncache entry */ @@ -214,10 +210,12 @@ uncache_entry_or_req( LDAP *ld, } } +#endif void ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) { +#ifndef LDAP_NOCACHE LDAPMessage *new; long len; @@ -254,12 +252,14 @@ ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype, BerElement *request } else { ld->ld_errno = LDAP_NO_MEMORY; } +#endif } void ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) { +#ifndef LDAP_NOCACHE LDAPMessage *m, **mp, *req, *new, *prev; int err, keep; @@ -360,6 +360,7 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) Debug( LDAP_DEBUG_TRACE, "artc: msgid not in request list\n", 0, 0, 0 ); } +#endif } @@ -373,6 +374,7 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ) int ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) { +#ifndef LDAP_NOCACHE LDAPMessage *m, *new, *prev, *next; BerElement reqber; int first, hash; @@ -446,8 +448,12 @@ ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ) Debug( LDAP_DEBUG_TRACE, "cc: result returned from cache\n", 0, 0, 0 ); return( 0 ); +#else + return( -1 ); +#endif } +#ifndef LDAP_NOCACHE static int cache_hash( BerElement *ber ) @@ -526,7 +532,9 @@ request_cmp( BerElement *req1, BerElement *req2 ) /* * check remaining length and bytes if necessary */ - if (( len = r1.ber_end - r1.ber_ptr ) != r2.ber_end - r2.ber_ptr ) { + if (( len = r1.ber_end - r1.ber_ptr ) != + (unsigned long) (r2.ber_end - r2.ber_ptr) ) + { return( -1 ); /* different lengths */ } return( memcmp( r1.ber_ptr, r2.ber_ptr, (size_t)len )); diff --git a/libraries/libldap/charset.c b/libraries/libldap/charset.c index d5b74006f5..8371c62e3b 100644 --- a/libraries/libldap/charset.c +++ b/libraries/libldap/charset.c @@ -5,13 +5,7 @@ * charset.c */ -#if defined( DOS ) || defined( _WIN32 ) -/* - * This MUST precede "#ifdef STR_TRANSLATION" - * because STR_TRANSLATION and friends are defined in msdos.h. - */ -#include "msdos.h" -#endif /* DOS */ +#include "portable.h" #ifdef STR_TRANSLATION @@ -20,19 +14,16 @@ static char copyright[] = "@(#) Copyright (c) 1995 Regents of the University of #endif #include -#include - -#ifdef MACOS #include -#include "macos.h" -#endif /* MACOS */ -#if !defined(MACOS) && !defined(DOS) && !defined( _WIN32 ) && !defined(VMS) -#include -#include -#include +#include +#include +#include + +#ifdef HAVE_SYS_PARAM_H #include #endif + #include "lber.h" #include "ldap.h" #include "ldap-int.h" @@ -159,7 +150,7 @@ ldap_translate_to_t61( LDAP *ld, char **bufp, unsigned long *lenp, #include #include -#include +#include /* Character set used: ISO 8859-1, ISO 8859-2, ISO 8859-3, ... */ /* #define ISO_8859 1 */ @@ -171,17 +162,10 @@ ldap_translate_to_t61( LDAP *ld, char **bufp, unsigned long *lenp, typedef unsigned char Byte; typedef struct { Byte a, b; } Couple; -#ifdef NEEDPROTOS -static Byte *c_to_hh( Byte *o, Byte c ); -static Byte *c_to_cc( Byte *o, Couple *cc, Byte c ); -static int hh_to_c( Byte *h ); -static Byte *cc_to_t61( Byte *o, Byte *s ); -#else /* NEEDPROTOS */ -static Byte *c_to_hh(); -static Byte *c_to_cc(); -static int hh_to_c(); -static Byte *cc_to_t61(); -#endif /* NEEDPROTOS */ +static Byte *c_to_hh LDAP_P(( Byte *o, Byte c )); +static Byte *c_to_cc LDAP_P(( Byte *o, Couple *cc, Byte c )); +static int hh_to_c LDAP_P(( Byte *h )); +static Byte *cc_to_t61 LDAP_P(( Byte *o, Byte *s )); /* Character choosed as base in diacritics alone: NO-BREAK SPACE. diff --git a/libraries/libldap/cldap.c b/libraries/libldap/cldap.c index 806a6ce91c..3f2fe861a0 100644 --- a/libraries/libldap/cldap.c +++ b/libraries/libldap/cldap.c @@ -5,30 +5,21 @@ * cldap.c - synchronous, retrying interface to the cldap protocol */ +#include "portable.h" -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990, 1994 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include "msdos.h" -#else /* DOS */ -#include -#include -#include -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -37,10 +28,6 @@ static char copyright[] = "@(#) Copyright (c) 1990, 1994 Regents of the Universi #define DEF_CLDAP_TIMEOUT 3 #define DEF_CLDAP_TRIES 4 -#ifndef INADDR_LOOPBACK -#define INADDR_LOOPBACK ((unsigned long) 0x7f000001) -#endif - struct cldap_retinfo { int cri_maxtries; @@ -49,17 +36,14 @@ struct cldap_retinfo { long cri_timeout; }; -#ifdef NEEDPROTOS -static int add_addr( LDAP *ld, struct sockaddr *sap ); -static int cldap_result( LDAP *ld, int msgid, LDAPMessage **res, - struct cldap_retinfo *crip, char *base ); -static int cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber, - LDAPMessage **res, char *base ); -#else /* NEEDPROTOS */ -static int add_addr(); -static int cldap_result(); -static int cldap_parsemsg(); -#endif /* NEEDPROTOS */ +static int add_addr LDAP_P(( + LDAP *ld, struct sockaddr *sap )); +static int cldap_result LDAP_P(( + LDAP *ld, int msgid, LDAPMessage **res, + struct cldap_retinfo *crip, char *base )); +static int cldap_parsemsg LDAP_P(( + LDAP *ld, int msgid, BerElement *ber, + LDAPMessage **res, char *base )); /* * cldap_open - initialize and connect to an ldap server. A magic cookie to @@ -240,7 +224,7 @@ cldap_search_s( LDAP *ld, char *base, int scope, char *filter, char **attrs, attrsonly )) == -1 ) { return( ld->ld_errno ); } -#ifndef NO_CACHE +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULL && ld->ld_responses != NULL ) { Debug( LDAP_DEBUG_TRACE, "cldap_search_s res from cache\n", 0, 0, 0 ); @@ -248,7 +232,7 @@ cldap_search_s( LDAP *ld, char *base, int scope, char *filter, char **attrs, ld->ld_responses = ld->ld_responses->lm_next; return( ldap_result2error( ld, *res, 0 )); } -#endif /* NO_CACHE */ +#endif /* LDAP_NOCACHE */ ret = cldap_result( ld, msgid, res, &cri, base ); } while (ret == -1); @@ -504,11 +488,11 @@ cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber, } #endif /* LDAP_DEBUG */ -#ifndef NO_CACHE +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULL ) { ldap_add_result_to_cache( ld, ldm ); } -#endif /* NO_CACHE */ +#endif /* LDAP_NOCACHE */ if ( chain == NULL ) { chain = ldm; @@ -534,4 +518,4 @@ cldap_parsemsg( LDAP *ld, int msgid, BerElement *ber, *res = chain; return(( *res == NULLMSG ) ? rc : ldap_result2error( ld, *res, 0 )); } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ diff --git a/libraries/libldap/compare.c b/libraries/libldap/compare.c index ba9f89850c..4d89f59e7a 100644 --- a/libraries/libldap/compare.c +++ b/libraries/libldap/compare.c @@ -5,21 +5,17 @@ * compare.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include - -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -63,7 +59,7 @@ ldap_compare( LDAP *ld, char *dn, char *attr, char *value ) return( -1 ); } -#ifndef NO_CACHE +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULL ) { if ( ldap_check_cache( ld, LDAP_REQ_COMPARE, ber ) == 0 ) { ber_free( ber, 1 ); @@ -72,7 +68,7 @@ ldap_compare( LDAP *ld, char *dn, char *attr, char *value ) } ldap_add_request_to_cache( ld, LDAP_REQ_COMPARE, ber ); } -#endif /* NO_CACHE */ +#endif /* LDAP_NOCACHE */ /* send the message */ return ( ldap_send_initial_request( ld, LDAP_REQ_COMPARE, dn, ber )); diff --git a/libraries/libldap/delete.c b/libraries/libldap/delete.c index 75344ddd88..eb8f589198 100644 --- a/libraries/libldap/delete.c +++ b/libraries/libldap/delete.c @@ -5,25 +5,17 @@ * delete.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include - -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include "msdos.h" -#endif /* DOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/disptmpl.c b/libraries/libldap/disptmpl.c index 1385ef587b..f4aa230313 100644 --- a/libraries/libldap/disptmpl.c +++ b/libraries/libldap/disptmpl.c @@ -13,41 +13,29 @@ * 7 March 1994 by Mark C Smith */ +#include "portable.h" + #include -#include -#include #include -#ifdef MACOS -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include -#include "msdos.h" -#else /* DOS */ -#include + +#include +#include +#include +#include + +#ifdef HAVE_SYS_FILE_H #include -#ifndef VMS -#include -#endif /* VMS */ -#endif /* DOS */ -#endif /* MACOS */ +#endif #include "lber.h" #include "ldap.h" #include "disptmpl.h" -#ifndef NEEDPROTOS -static void free_disptmpl(); -static int read_next_tmpl(); -int next_line_tokens(); -void free_strarray(); -#else /* !NEEDPROTOS */ -static void free_disptmpl( struct ldap_disptmpl *tmpl ); -static int read_next_tmpl( char **bufp, long *blenp, - struct ldap_disptmpl **tmplp, int dtversion ); -int next_line_tokens( char **bufp, long *blenp, char ***toksp ); -void free_strarray( char **sap ); -#endif /* !NEEDPROTOS */ +static void free_disptmpl LDAP_P(( struct ldap_disptmpl *tmpl )); +static int read_next_tmpl LDAP_P(( char **bufp, long *blenp, + struct ldap_disptmpl **tmplp, int dtversion )); +int next_line_tokens LDAP_P(( char **bufp, long *blenp, char ***toksp )); +void free_strarray LDAP_P(( char **sap )); static char *tmploptions[] = { "addable", "modrdn", diff --git a/libraries/libldap/dsparse.c b/libraries/libldap/dsparse.c index 1771d7283e..86ccf71360 100644 --- a/libraries/libldap/dsparse.c +++ b/libraries/libldap/dsparse.c @@ -15,37 +15,26 @@ * 7 March 1994 by Mark C Smith */ +#include "portable.h" + #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include -#include "msdos.h" -#else /* DOS */ -#include + +#include +#include +#include + +#ifdef HAVE_SYS_FILE_H #include -#include -#endif /* DOS */ -#endif /* MACOS */ +#endif #include "lber.h" #include "ldap.h" -#ifndef NEEDPROTOS -int next_line_tokens(); -void free_strarray(); -static int next_line(); -static char *next_token(); -#else /* !NEEDPROTOS */ -int next_line_tokens( char **bufp, long *blenp, char ***toksp ); -void free_strarray( char **sap ); -static int next_line( char **bufp, long *blenp, char **linep ); -static char *next_token( char ** sp ); -#endif /* !NEEDPROTOS */ +int next_line_tokens LDAP_P(( char **bufp, long *blenp, char ***toksp )); +void free_strarray LDAP_P(( char **sap )); +static int next_line LDAP_P(( char **bufp, long *blenp, char **linep )); +static char *next_token LDAP_P(( char ** sp )); diff --git a/libraries/libldap/error.c b/libraries/libldap/error.c index f731ec8ecd..26c8778047 100644 --- a/libraries/libldap/error.c +++ b/libraries/libldap/error.c @@ -1,14 +1,11 @@ +#include "portable.h" + #include -#include #include -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -83,7 +80,7 @@ ldap_err2string( int err ) return( "Unknown error" ); } -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI void ldap_perror( LDAP *ld, char *s ) { @@ -122,7 +119,7 @@ ldap_perror( LDAP *ld, char *s ) { } -#endif /* NO_USERINTERFACE */ +#endif /* !LDAP_LIBUI */ int diff --git a/libraries/libldap/free.c b/libraries/libldap/free.c index d7a13228e6..d0e47686e5 100644 --- a/libraries/libldap/free.c +++ b/libraries/libldap/free.c @@ -6,26 +6,18 @@ * link in lots of extra code when not using certain features */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1994 The Regents of the University of Michigan.\nAll rights reserved.\n"; #endif - #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/friendly.c b/libraries/libldap/friendly.c index 5d77f0be1c..0f5aa6acad 100644 --- a/libraries/libldap/friendly.c +++ b/libraries/libldap/friendly.c @@ -5,28 +5,20 @@ * friendly.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#endif /* MACOS */ - -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#endif /* DOS */ - -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#include -#endif + +#include +#include +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -40,9 +32,7 @@ ldap_friendly_name( char *filename, char *uname, FriendlyMap **map ) char buf[BUFSIZ]; if ( map == NULL ) { -#if !defined( MACOS ) && !defined( DOS ) errno = EINVAL; -#endif return( uname ); } diff --git a/libraries/libldap/getattr.c b/libraries/libldap/getattr.c index f893529e8c..2975e674e0 100644 --- a/libraries/libldap/getattr.c +++ b/libraries/libldap/getattr.c @@ -5,25 +5,19 @@ * getattr.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index b213c89948..fc2b326477 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -5,26 +5,19 @@ * getdn.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include -#include #include -#ifdef MACOS -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ +#include +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -252,19 +245,3 @@ ldap_is_dns_dn( char *dn ) strchr( dn, ',' ) == NULL ); } - -#if defined( ultrix ) || defined( NeXT ) - -char *strdup( char *s ) -{ - char *p; - - if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL ) - return( NULL ); - - strcpy( p, s ); - - return( p ); -} - -#endif /* ultrix */ diff --git a/libraries/libldap/getdxbyname.c b/libraries/libldap/getdxbyname.c index ed5dcf4fe1..0290cf4037 100644 --- a/libraries/libldap/getdxbyname.c +++ b/libraries/libldap/getdxbyname.c @@ -1,47 +1,27 @@ -#ifdef LDAP_DNS /* * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. * * ldap_getdxbyname - retrieve DX records from the DNS (from TXT records for now) */ -#include -#include -#include -#ifdef MACOS -#include -#include "macos.h" -#endif /* MACOS */ - -#if !defined(MACOS) && !defined(DOS) && !defined( _WIN32 ) -#include -#include -#include -#include -#include -#include -#include -#include -#endif -#include "lber.h" -#include "ldap.h" -#include "ldap-int.h" +#include "portable.h" -#if defined( DOS ) || defined( _WIN32 ) -#include "msdos.h" -#endif /* DOS */ +#ifdef LDAP_DNS +#include +#include -#ifdef NEEDPROTOS -static char ** decode_answer( unsigned char *answer, int len ); -#else /* NEEDPROTOS */ -static char **decode_answer(); -#endif /* NEEDPROTOS */ +#include +#include +#include +#include -extern int h_errno; -extern char *h_errlist[]; +#include "lber.h" +#include "ldap.h" +#include "ldap-int.h" +static char ** decode_answer LDAP_P(( unsigned char *answer, int len )); #define MAX_TO_SORT 32 diff --git a/libraries/libldap/getentry.c b/libraries/libldap/getentry.c index f3f896e7b8..5d7776dea1 100644 --- a/libraries/libldap/getentry.c +++ b/libraries/libldap/getentry.c @@ -5,25 +5,19 @@ * getentry.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include -#include -#ifdef MACOS #include -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ + +#include +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/getfilter.c b/libraries/libldap/getfilter.c index a2f9267968..3e5ea7b511 100644 --- a/libraries/libldap/getfilter.c +++ b/libraries/libldap/getfilter.c @@ -5,49 +5,32 @@ * getfilter.c -- optional add-on to libldap */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include #include -#include -#include -#include -#include - -#ifdef MACOS -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include -#include "msdos.h" -#else /* DOS */ -#include + +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_FILE_H #include -#include -#ifndef VMS -#include -#endif /* VMS */ -#endif /* DOS */ -#endif /* MACOS */ +#endif #include "lber.h" #include "ldap.h" -#ifdef NEEDPROTOS -static int break_into_words( char *str, char *delims, char ***wordsp ); -int next_line_tokens( char **bufp, long *blenp, char ***toksp ); -void free_strarray( char **sap ); -#else /* NEEDPROTOS */ -static int break_into_words(); -int next_line_tokens(); -void free_strarray(); -#endif /* NEEDPROTOS */ - -#if !defined( MACOS ) && !defined( DOS ) -extern int errno; -#endif +static int break_into_words LDAP_P(( char *str, char *delims, char ***wordsp )); +int next_line_tokens LDAP_P(( char **bufp, long *blenp, char ***toksp )); +void free_strarray LDAP_P(( char **sap )); #define FILT_MAX_LINE_LEN 1024 @@ -138,16 +121,14 @@ ldap_init_getfilter_buf( char *buf, long buflen ) nextflp->lfl_tag = strdup( tag ); nextflp->lfl_pattern = tok[ 0 ]; if ( (rc = regcomp( &re, nextflp->lfl_pattern, 0 )) != 0 ) { -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI char error[512]; regerror(rc, &re, error, sizeof(error)); ldap_getfilter_free( lfdp ); fprintf( stderr, "bad regular expresssion %s, %s\n", nextflp->lfl_pattern, error ); -#if !defined( MACOS ) && !defined( DOS ) errno = EINVAL; -#endif -#endif /* NO_USERINTERFACE */ +#endif /* LDAP_LIBUI */ free_strarray( tok ); return( NULL ); } @@ -196,9 +177,7 @@ ldap_init_getfilter_buf( char *buf, long buflen ) } else { free_strarray( tok ); ldap_getfilter_free( lfdp ); -#if !defined( MACOS ) && !defined( DOS ) errno = EINVAL; -#endif return( NULL ); } free( tok[ 2 ] ); @@ -215,9 +194,7 @@ ldap_init_getfilter_buf( char *buf, long buflen ) default: free_strarray( tok ); ldap_getfilter_free( lfdp ); -#if !defined( MACOS ) && !defined( DOS ) errno = EINVAL; -#endif return( NULL ); } } @@ -409,14 +386,16 @@ ldap_build_filter( char *filtbuf, unsigned long buflen, char *pattern, *f++ = *p; } - if ( f - filtbuf > buflen ) { + if ( (unsigned long) (f - filtbuf) > buflen ) { /* sanity check */ --f; break; } } - if ( suffix != NULL && ( f - filtbuf ) < buflen ) { + if ( suffix != NULL && ( + (unsigned long) ( f - filtbuf ) < buflen ) ) + { strcpy( f, suffix ); } else { *f = '\0'; diff --git a/libraries/libldap/getvalues.c b/libraries/libldap/getvalues.c index 52802aa6ca..c3131ade09 100644 --- a/libraries/libldap/getvalues.c +++ b/libraries/libldap/getvalues.c @@ -5,26 +5,19 @@ * getvalues.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include -#include #include -#ifdef MACOS -#include "macos.h" -#else /* MACOS */ -#if defined( DOS ) || defined( _WIN32 ) -#include -#include "msdos.h" -#else /* DOS */ -#include -#include -#endif /* DOS */ -#endif /* MACOS */ +#include +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/kbind.c b/libraries/libldap/kbind.c index 22e731e518..2831226ed8 100644 --- a/libraries/libldap/kbind.c +++ b/libraries/libldap/kbind.c @@ -5,36 +5,21 @@ * kbind.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif -#ifdef KERBEROS +#ifdef HAVE_KERBEROS #include -#include #include -#ifdef MACOS -#include "macos.h" -#else /* MACOS */ -#ifdef DOS -#include "msdos.h" -#endif /* DOS */ - -#ifdef KERBEROS_V -#include -#else -#include -#endif /* KERBEROS_V */ - -#include -#if !defined(DOS) && !defined( _WIN32 ) -#include -#endif /* !DOS && !_WIN32 */ -#include -#include -#endif /* MACOS */ +#include +#include +#include +#include #include "lber.h" #include "ldap.h" @@ -118,11 +103,11 @@ ldap_kerberos_bind1( LDAP *ld, char *dn ) free( cred ); -#ifndef NO_CACHE +#ifndef LDAP_NOCACHE if ( ld->ld_cache != NULL ) { ldap_flush_cache( ld ); } -#endif /* !NO_CACHE */ +#endif /* !LDAP_NOCACHE */ /* send the message */ return ( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber )); @@ -270,10 +255,10 @@ ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) Debug( LDAP_DEBUG_TRACE, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 ); if ( (err = krb_get_tf_realm( tkt_string(), realm )) != KSUCCESS ) { -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI fprintf( stderr, "krb_get_tf_realm failed (%s)\n", krb_err_txt[err] ); -#endif /* NO_USERINTERFACE */ +#endif /* LDAP_LIBUI */ ld->ld_errno = LDAP_INVALID_CREDENTIALS; return( NULL ); } @@ -286,9 +271,9 @@ ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) if ( (err = krb_mk_req( &ktxt, service, krbinstance, realm, 0 )) != KSUCCESS ) { -#ifndef NO_USERINTERFACE +#ifdef LDAP_LIBUI fprintf( stderr, "krb_mk_req failed (%s)\n", krb_err_txt[err] ); -#endif /* NO_USERINTERFACE */ +#endif /* LDAP_LIBUI */ ld->ld_errno = LDAP_INVALID_CREDENTIALS; return( NULL ); } @@ -305,4 +290,4 @@ ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len ) } #endif /* !AUTHMAN */ -#endif /* KERBEROS */ +#endif /* HAVE_KERBEROS */ diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h index e841a35b5b..5a3fe703a2 100644 --- a/libraries/libldap/ldap-int.h +++ b/libraries/libldap/ldap-int.h @@ -22,69 +22,45 @@ #endif /* LDAP_DNS */ #endif /* LDAP_REFERRALS */ - +LDAP_BEGIN_DECL /* * in cache.c */ -#ifdef NEEDPROTOS -void ldap_add_request_to_cache( LDAP *ld, unsigned long msgtype, - BerElement *request ); -void ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result ); -int ldap_check_cache( LDAP *ld, unsigned long msgtype, BerElement *request ); -#else /* NEEDPROTOS */ -void ldap_add_request_to_cache(); -void ldap_add_result_to_cache(); -int ldap_check_cache(); -#endif /* NEEDPROTOS */ - - -#ifdef KERBEROS +void ldap_add_request_to_cache LDAP_P(( LDAP *ld, unsigned long msgtype, + BerElement *request )); +void ldap_add_result_to_cache LDAP_P(( LDAP *ld, LDAPMessage *result )); +int ldap_check_cache LDAP_P(( LDAP *ld, unsigned long msgtype, BerElement *request )); + + +#ifdef HAVE_KERBEROS /* * in kerberos.c */ -#ifdef NEEDPROTOS -char *ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, - int *len ); -#else /* NEEDPROTOS */ -char *ldap_get_kerberosv4_credentials(); -#endif /* NEEDPROTOS */ +char *ldap_get_kerberosv4_credentials LDAP_P(( LDAP *ld, char *who, char *service, + int *len )); -#endif /* KERBEROS */ +#endif /* HAVE_KERBEROS */ /* * in open.c */ -#ifdef NEEDPROTOS int open_ldap_connection( LDAP *ld, Sockbuf *sb, char *host, int defport, char **krbinstancep, int async ); -#else /* NEEDPROTOS */ -int open_ldap_connection(); -#endif /* NEEDPROTOS */ /* * in os-ip.c */ -#ifdef NEEDPROTOS int ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, int port, int async ); void ldap_close_connection( Sockbuf *sb ); -#else /* NEEDPROTOS */ -int ldap_connect_to_host(); -void ldap_close_connection(); -#endif /* NEEDPROTOS */ -#ifdef KERBEROS -#ifdef NEEDPROTOS +#ifdef HAVE_KERBEROS char *ldap_host_connected_to( Sockbuf *sb ); -#else /* NEEDPROTOS */ -char *host_connected_to(); -#endif /* NEEDPROTOS */ -#endif /* KERBEROS */ +#endif /* HAVE_KERBEROS */ #ifdef LDAP_REFERRALS -#ifdef NEEDPROTOS int do_ldap_select( LDAP *ld, struct timeval *timeout ); void *ldap_new_select_info( void ); void ldap_free_select_info( void *sip ); @@ -93,35 +69,18 @@ void ldap_mark_select_read( LDAP *ld, Sockbuf *sb ); void ldap_mark_select_clear( LDAP *ld, Sockbuf *sb ); int ldap_is_read_ready( LDAP *ld, Sockbuf *sb ); int ldap_is_write_ready( LDAP *ld, Sockbuf *sb ); -#else /* NEEDPROTOS */ -int do_ldap_select(); -void *ldap_new_select_info(); -void ldap_free_select_info(); -void ldap_mark_select_write(); -void ldap_mark_select_read(); -void ldap_mark_select_clear(); -int ldap_is_read_ready(); -int ldap_is_write_ready(); -#endif /* NEEDPROTOS */ #endif /* LDAP_REFERRALS */ /* * in request.c */ -#ifdef NEEDPROTOS int ldap_send_initial_request( LDAP *ld, unsigned long msgtype, char *dn, BerElement *ber ); BerElement *ldap_alloc_ber_with_options( LDAP *ld ); void ldap_set_ber_options( LDAP *ld, BerElement *ber ); -#else /* NEEDPROTOS */ -int ldap_send_initial_request(); -BerElement *ldap_alloc_ber_with_options(); -void ldap_set_ber_options(); -#endif /* NEEDPROTOS */ #if defined( LDAP_REFERRALS ) || defined( LDAP_DNS ) -#ifdef NEEDPROTOS int ldap_send_server_request( LDAP *ld, BerElement *ber, int msgid, LDAPRequest *parentreq, LDAPServer *srvlist, LDAPConn *lc, int bind ); @@ -132,60 +91,32 @@ void ldap_free_request( LDAP *ld, LDAPRequest *lr ); void ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ); void ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all ); void ldap_dump_requests_and_responses( LDAP *ld ); -#else /* NEEDPROTOS */ -int ldap_send_server_request(); -LDAPConn *ldap_new_connection(); -LDAPRequest *ldap_find_request_by_msgid(); -void ldap_free_request(); -void ldap_free_connection(); -void ldap_dump_connection(); -void ldap_dump_requests_and_responses(); -#endif /* NEEDPROTOS */ #endif /* LDAP_REFERRALS || LDAP_DNS */ #ifdef LDAP_REFERRALS -#ifdef NEEDPROTOS int ldap_chase_referrals( LDAP *ld, LDAPRequest *lr, char **errstrp, int *hadrefp ); int ldap_append_referral( LDAP *ld, char **referralsp, char *s ); -#else /* NEEDPROTOS */ -int ldap_chase_referrals(); -int ldap_append_referral(); -#endif /* NEEDPROTOS */ #endif /* LDAP_REFERRALS */ /* * in search.c */ -#ifdef NEEDPROTOS BerElement *ldap_build_search_req( LDAP *ld, char *base, int scope, char *filter, char **attrs, int attrsonly ); -#else /* NEEDPROTOS */ -BerElement *ldap_build_search_req(); -#endif /* NEEDPROTOS */ /* * in unbind.c */ -#ifdef NEEDPROTOS int ldap_ld_free( LDAP *ld, int close ); int ldap_send_unbind( LDAP *ld, Sockbuf *sb ); -#else /* NEEDPROTOS */ -int ldap_ld_free(); -int ldap_send_unbind(); -#endif /* NEEDPROTOS */ - #ifdef LDAP_DNS /* * in getdxbyname.c */ -#ifdef NEEDPROTOS char **ldap_getdxbyname( char *domain ); -#else /* NEEDPROTOS */ -char **ldap_getdxbyname(); -#endif /* NEEDPROTOS */ #endif /* LDAP_DNS */ #if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET ) @@ -197,16 +128,11 @@ char **ldap_getdxbyname(); * hodges@stanford.edu 5-Feb-96 */ #if LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET -#ifdef NEEDPROTOS extern int ldap_t61_to_8859( char **bufp, unsigned long *buflenp, int free_input ); extern int ldap_8859_to_t61( char **bufp, unsigned long *buflenp, int free_input ); -#else /* NEEDPROTOS */ -extern -int ldap_t61_to_8859(); -extern -int ldap_8859_to_t61(); -#endif /* NEEDPROTOS */ #endif /* LDAP_CHARSET_8859 == LDAP_DEFAULT_CHARSET */ + +LDAP_END_DECL #endif /* STR_TRANSLATION && LDAP_DEFAULT_CHARSET */ diff --git a/libraries/libldap/libldap.dsp b/libraries/libldap/libldap.dsp new file mode 100644 index 0000000000..4d6d5fccc5 --- /dev/null +++ b/libraries/libldap/libldap.dsp @@ -0,0 +1,218 @@ +# Microsoft Developer Studio Project File - Name="libldap" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libldap - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libldap.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libldap.mak" CFG="libldap - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libldap - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libldap - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe + +!IF "$(CFG)" == "libldap - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libldap - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "..\Debug" +# PROP Intermediate_Dir "Debug\libldap" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /W4 /GX /Z7 /Od /I "..\..\include" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libldap - Win32 Release" +# Name "libldap - Win32 Debug" +# Begin Source File + +SOURCE=.\abandon.c +# End Source File +# Begin Source File + +SOURCE=.\add.c +# End Source File +# Begin Source File + +SOURCE=.\addentry.c +# End Source File +# Begin Source File + +SOURCE=.\bind.c +# End Source File +# Begin Source File + +SOURCE=.\cache.c +# End Source File +# Begin Source File + +SOURCE=.\charset.c +# End Source File +# Begin Source File + +SOURCE=.\cldap.c +# End Source File +# Begin Source File + +SOURCE=.\compare.c +# End Source File +# Begin Source File + +SOURCE=.\delete.c +# End Source File +# Begin Source File + +SOURCE=.\disptmpl.c +# End Source File +# Begin Source File + +SOURCE=.\dsparse.c +# End Source File +# Begin Source File + +SOURCE=.\error.c +# End Source File +# Begin Source File + +SOURCE=.\free.c +# End Source File +# Begin Source File + +SOURCE=.\friendly.c +# End Source File +# Begin Source File + +SOURCE=.\getattr.c +# End Source File +# Begin Source File + +SOURCE=.\getdn.c +# End Source File +# Begin Source File + +SOURCE=.\getdxbyname.c +# End Source File +# Begin Source File + +SOURCE=.\getentry.c +# End Source File +# Begin Source File + +SOURCE=.\getfilter.c +# End Source File +# Begin Source File + +SOURCE=.\getvalues.c +# End Source File +# Begin Source File + +SOURCE=.\kbind.c +# End Source File +# Begin Source File + +SOURCE=".\ldap-int.h" +# End Source File +# Begin Source File + +SOURCE=.\modify.c +# End Source File +# Begin Source File + +SOURCE=.\modrdn.c +# End Source File +# Begin Source File + +SOURCE=.\open.c +# End Source File +# Begin Source File + +SOURCE=".\os-ip.c" +# End Source File +# Begin Source File + +SOURCE=.\request.c +# End Source File +# Begin Source File + +SOURCE=.\result.c +# End Source File +# Begin Source File + +SOURCE=.\sbind.c +# End Source File +# Begin Source File + +SOURCE=.\search.c +# End Source File +# Begin Source File + +SOURCE=.\sort.c +# End Source File +# Begin Source File + +SOURCE=.\srchpref.c +# End Source File +# Begin Source File + +SOURCE=.\ufn.c +# End Source File +# Begin Source File + +SOURCE=.\unbind.c +# End Source File +# Begin Source File + +SOURCE=.\url.c +# End Source File +# End Target +# End Project diff --git a/libraries/libldap/libldap.dsw b/libraries/libldap/libldap.dsw new file mode 100644 index 0000000000..067d25e554 --- /dev/null +++ b/libraries/libldap/libldap.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "libldap"=.\libldap.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/libraries/libldap/ltest.dsp b/libraries/libldap/ltest.dsp new file mode 100644 index 0000000000..ca59106786 --- /dev/null +++ b/libraries/libldap/ltest.dsp @@ -0,0 +1,87 @@ +# Microsoft Developer Studio Project File - Name="ltest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 5.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=ltest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ltest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ltest.mak" CFG="ltest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ltest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "ltest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "ltest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release\ltest" +# PROP Intermediate_Dir "Release\ltest" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 libldap.lib liblber.lib liblutil.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "ltest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "ltest___" +# PROP BASE Intermediate_Dir "ltest___" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug\ltest" +# PROP Intermediate_Dir "Debug\ltest" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 libldap.lib liblber.lib liblutil.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "ltest - Win32 Release" +# Name "ltest - Win32 Debug" +# Begin Source File + +SOURCE=.\test.c +# End Source File +# End Target +# End Project diff --git a/libraries/libldap/ltest.dsw b/libraries/libldap/ltest.dsw new file mode 100644 index 0000000000..6cc5a01052 --- /dev/null +++ b/libraries/libldap/ltest.dsw @@ -0,0 +1,74 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "liblber"=..\liblber\liblber.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "libldap"=.\libldap.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "liblutil"=..\liblutil\liblutil.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "ltest"=.\ltest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libldap + End Project Dependency + Begin Project Dependency + Project_Dep_Name liblber + End Project Dependency + Begin Project Dependency + Project_Dep_Name liblutil + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/libraries/libldap/modify.c b/libraries/libldap/modify.c index 63f1cdc023..42ffde0f2f 100644 --- a/libraries/libldap/modify.c +++ b/libraries/libldap/modify.c @@ -5,21 +5,17 @@ * modify.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include - -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldap/modrdn.c b/libraries/libldap/modrdn.c index 1532f86917..434ecb5d0b 100644 --- a/libraries/libldap/modrdn.c +++ b/libraries/libldap/modrdn.c @@ -5,21 +5,17 @@ * modrdn.c */ +#include "portable.h" + #ifndef lint static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n"; #endif #include -#include - -#ifdef MACOS -#include "macos.h" -#endif /* MACOS */ -#if !defined( MACOS ) && !defined( DOS ) -#include -#include -#endif +#include +#include +#include #include "lber.h" #include "ldap.h" diff --git a/libraries/libldbm/Makefile.in b/libraries/libldbm/Makefile.in new file mode 100644 index 0000000000..dd1c842bba --- /dev/null +++ b/libraries/libldbm/Makefile.in @@ -0,0 +1,16 @@ +## +## Makefile for -lldbm +## + +LIBRARY = libldbm.a +XPROGRAMS = testldbm +SRCS = ldbm.c +OBJS = ldbm.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +XLIBS = @LDBM_LIBS@ -lavl + +testldbm: libldbm.a testldbm.o + $(CC) $(LDFLAGS) -o $@ testldbm.o $(LIBS) diff --git a/libraries/libldif/Makefile.in b/libraries/libldif/Makefile.in new file mode 100644 index 0000000000..c1560a31b4 --- /dev/null +++ b/libraries/libldif/Makefile.in @@ -0,0 +1,11 @@ +## +## Makefile for -lldif +## + +LIBRARY = libldif.a +SRCS = line64.c +OBJS = line64.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + diff --git a/libraries/liblthread/Makefile.in b/libraries/liblthread/Makefile.in new file mode 100644 index 0000000000..a76fb6c315 --- /dev/null +++ b/libraries/liblthread/Makefile.in @@ -0,0 +1,15 @@ +## +## Makefile for -llthread +## + +LIBRARY = liblthread.a +XSRCS = version.c +SRCS = rdwr.c thread.c stack.c +OBJS = rdwr.o thread.o stack.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +XLIBS = @LTHREAD_LIBS@ + + diff --git a/libraries/liblutil/Makefile.in b/libraries/liblutil/Makefile.in new file mode 100644 index 0000000000..9596b2af7b --- /dev/null +++ b/libraries/liblutil/Makefile.in @@ -0,0 +1,11 @@ +## +## Makefile for -lutil +## + +LIBRARY = liblutil.a +SRCS = base64.c md5.c sha1.c +OBJS = base64.o md5.o sha1.o @LIBOBJS@ + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + diff --git a/libraries/msdos/winsock/include/file.h b/libraries/msdos/winsock/include/file.h deleted file mode 100644 index cead0808d2..0000000000 --- a/libraries/msdos/winsock/include/file.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * This file is intentionally empty. Some compilers require the presence of - * an include file, even if the "#ifdef"s exclude it from actual use. PTUI ! - */ diff --git a/libraries/msdos/winsock/include/filio.h b/libraries/msdos/winsock/include/filio.h deleted file mode 100644 index cead0808d2..0000000000 --- a/libraries/msdos/winsock/include/filio.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * This file is intentionally empty. Some compilers require the presence of - * an include file, even if the "#ifdef"s exclude it from actual use. PTUI ! - */ diff --git a/libraries/msdos/winsock/include/in.h b/libraries/msdos/winsock/include/in.h deleted file mode 100644 index cead0808d2..0000000000 --- a/libraries/msdos/winsock/include/in.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * This file is intentionally empty. Some compilers require the presence of - * an include file, even if the "#ifdef"s exclude it from actual use. PTUI ! - */ diff --git a/libraries/msdos/winsock/include/ioctl.h b/libraries/msdos/winsock/include/ioctl.h deleted file mode 100644 index cead0808d2..0000000000 --- a/libraries/msdos/winsock/include/ioctl.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * This file is intentionally empty. Some compilers require the presence of - * an include file, even if the "#ifdef"s exclude it from actual use. PTUI ! - */ diff --git a/libraries/msdos/winsock/include/krb/des.h b/libraries/msdos/winsock/include/krb/des.h deleted file mode 100644 index 6afe20873d..0000000000 --- a/libraries/msdos/winsock/include/krb/des.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 1987, 1988 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - * - * Include file for the Data Encryption Standard library. - */ - -/* only do the whole thing once */ -#ifndef DES_DEFS -#define DES_DEFS - -#include - -typedef unsigned char des_cblock[8]; /* crypto-block size */ -/* Key schedule */ -typedef struct des_ks_struct { des_cblock _; } des_key_schedule[16]; - -#define DES_KEY_SZ (sizeof(des_cblock)) -#define DES_ENCRYPT 1 -#define DES_DECRYPT 0 - -#ifndef NCOMPAT -#define C_Block des_cblock -#define Key_schedule des_key_schedule -#define ENCRYPT DES_ENCRYPT -#define DECRYPT DES_DECRYPT -#define KEY_SZ DES_KEY_SZ -#define string_to_key des_string_to_key -#define read_pw_string des_read_pw_string -#define random_key des_random_key -#define pcbc_encrypt des_pcbc_encrypt -#define key_sched des_key_sched -#define cbc_encrypt des_cbc_encrypt -#define cbc_cksum des_cbc_cksum -#define C_Block_print des_cblock_print -#define quad_cksum des_quad_cksum -typedef struct des_ks_struct bit_64; -#endif - -#define des_cblock_print(x) des_cblock_print_file(x, stdout) - -int des_check_key_parity(des_cblock); -int des_is_weak_key(des_cblock); - -/* Function prototypes */ -int des_key_sched(des_cblock,des_key_schedule); -int des_ecb_encrypt(unsigned long*,unsigned long*,des_key_schedule,int); -int des_pcbc_encrypt(des_cblock*,des_cblock*,long,des_key_schedule, - des_cblock*,int); - -unsigned long des_cbc_cksum(des_cblock*,des_cblock*,long, - des_key_schedule,des_cblock*); - -int des_is_weak_key(des_cblock); -void des_fixup_key_parity(des_cblock); -int des_check_key_parity(des_cblock); -#endif /* DES_DEFS */ diff --git a/libraries/msdos/winsock/include/krb/krb.h b/libraries/msdos/winsock/include/krb/krb.h deleted file mode 100644 index 128255cec9..0000000000 --- a/libraries/msdos/winsock/include/krb/krb.h +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Copyright 1987, 1988 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - * - * Include file for the Kerberos library. - */ - -/* Only one time, please */ -#ifndef KRB_DEFS -#define KRB_DEFS - -#include -#include - -/* Need some defs from des.h */ -#include - -/* Text describing error codes */ -#define MAX_KRB_ERRORS 256 -#ifndef WINDOWS -extern char *krb_err_txt[MAX_KRB_ERRORS]; -#else -extern char FAR *krb_err_txt[MAX_KRB_ERRORS]; -#endif - - -/* These are not defined for at least SunOS 3.3 and Ultrix 2.2 */ -#if defined(ULTRIX022) || (defined(SunOS) && SunOS < 40) -#define FD_ZERO(p) ((p)->fds_bits[0] = 0) -#define FD_SET(n, p) ((p)->fds_bits[0] |= (1 << (n))) -#define FD_ISSET(n, p) ((p)->fds_bits[0] & (1 << (n))) -#endif /* ULTRIX022 || SunOS */ - -/* General definitions */ -#define KSUCCESS 0 -#define KFAILURE 255 - -#ifdef NO_UIDGID_T -typedef unsigned short uid_t; -typedef unsigned short gid_t; -#endif /* NO_UIDGID_T */ - -/* - * Kerberos specific definitions - * - * KRBLOG is the log file for the kerberos master server. KRB_CONF is - * the configuration file where different host machines running master - * and slave servers can be found. KRB_MASTER is the name of the - * machine with the master database. The admin_server runs on this - * machine, and all changes to the db (as opposed to read-only - * requests, which can go to slaves) must go to it. KRB_HOST is the - * default machine * when looking for a kerberos slave server. Other - * possibilities are * in the KRB_CONF file. KRB_REALM is the name of - * the realm. - */ - -#ifdef notdef -this is server - only, does not belong here; -#define KRBLOG "/kerberos/kerberos.log" -are these used anyplace '?'; -#define VX_KRB_HSTFILE "/etc/krbhst" -#define PC_KRB_HSTFILE "\\kerberos\\krbhst" -#endif -#ifdef IBMPC -#define KRB_CONF "%s\\kerb\\krb.con" -#define KRB_RLM_TRANS "%s\\KERB\\krbrealm.con" -#else -#define KRB_CONF "/etc/krb.conf" -#define KRB_RLM_TRANS "/etc/krb.realms" -#endif -#define KRB_MASTER "kerberos.mit.edu" -#define KRB_REALM "ATHENA.MIT.EDU" -#define KRB_HOST KRB_MASTER - -/* The maximum sizes for aname, realm, sname, and instance +1 */ -#define ANAME_SZ 40 -#define REALM_SZ 40 -#define SNAME_SZ 40 -#define INST_SZ 40 -/* include space for '.' and '@' */ -#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2) -#define KKEY_SZ 100 -#define VERSION_SZ 1 -#define MSG_TYPE_SZ 1 -#define DATE_SZ 26 /* RTI date output */ - -#define MAX_HSTNM 100 - -#ifndef DEFAULT_TKT_LIFE /* allow compile-time override */ -#define DEFAULT_TKT_LIFE 96 /* default lifetime for krb_mk_req - & co., 8 hrs */ -#endif - -/* Definition of text structure used to pass text around */ -#define MAX_KTXT_LEN 1250 - -struct ktext { - int length; /* Length of the text */ - unsigned char dat[MAX_KTXT_LEN]; /* The data itself */ - unsigned long mbz; /* zero to catch runaway strings */ -}; - -typedef struct ktext far *KTEXT; -typedef struct ktext far *KTEXT_FP; -typedef struct ktext KTEXT_ST; - - -/* Definitions for send_to_kdc */ -#define CLIENT_KRB_TIMEOUT 10 /* time between retries */ /* changed from 4, 8-14-94 pbh */ -#define CLIENT_KRB_RETRY 5 /* retry this many times */ -#define CLIENT_KRB_BUFLEN 512 /* max unfragmented packet */ - -/* Definitions for ticket file utilities */ -#define R_TKT_FIL 0 -#define W_TKT_FIL 1 - -/* Definitions for cl_get_tgt */ -#ifdef PC -#define CL_GTGT_INIT_FILE "\\kerberos\\k_in_tkts" -#else -#define CL_GTGT_INIT_FILE "/etc/k_in_tkts" -#endif /* PC */ - -/* Parameters for rd_ap_req */ -/* Maximum alloable clock skew in seconds */ -#define CLOCK_SKEW 5*60 -/* Filename for readservkey */ -#define KEYFILE "/etc/srvtab" - -/* Structure definition for rd_ap_req */ - -struct auth_dat { - unsigned char k_flags; /* Flags from ticket */ - char pname[ANAME_SZ]; /* Principal's name */ - char pinst[INST_SZ]; /* His Instance */ - char prealm[REALM_SZ]; /* His Realm */ - unsigned long checksum; /* Data checksum (opt) */ - C_Block session; /* Session Key */ - int life; /* Life of ticket */ - unsigned long time_sec; /* Time ticket issued */ - unsigned long address; /* Address in ticket */ - KTEXT_ST reply; /* Auth reply (opt) */ -}; - -typedef struct auth_dat AUTH_DAT; - -/* Structure definition for credentials returned by get_cred */ - -struct credentials { - char service[ANAME_SZ]; /* Service name */ - char instance[INST_SZ]; /* Instance */ - char realm[REALM_SZ]; /* Auth domain */ - C_Block session; /* Session key */ - int lifetime; /* Lifetime */ - int kvno; /* Key version number */ - KTEXT_ST ticket_st; /* The ticket itself */ - long issue_date; /* The issue time */ - char pname[ANAME_SZ]; /* Principal's name */ - char pinst[INST_SZ]; /* Principal's instance */ -}; - -typedef struct credentials CREDENTIALS; - -/* Structure definition for rd_private_msg and rd_safe_msg */ - -struct msg_dat { - unsigned char far *app_data; /* pointer to appl data */ - unsigned long app_length; /* length of appl data */ - unsigned long hash; /* hash to lookup replay */ - int swap; /* swap bytes? */ - long time_sec; /* msg timestamp seconds */ - unsigned char time_5ms; /* msg timestamp 5ms units */ -}; - -typedef struct msg_dat MSG_DAT; - - -/* Location of ticket file for save_cred and get_cred */ -#define TKT_FILE tkt_string() -#define TKT_ENV "KERBEROS_TICKETS" -typedef struct { - unsigned buf_size; - unsigned dummy; - unsigned eof_ptr; - int sema; /* semaphore 0 - OK, -1 - lock write, +ve lock read */ -} tkt_header; - -tkt_header far *tkt_ptr(void); - -#define KM_TKFILE 0 -#define KM_KRBMEM 1 - -#define TKT_ROOT "/tmp/tkt" /* not used in OS/2 anyway */ - -/* Error codes returned from the KDC */ -#define KDC_OK 0 /* Request OK */ -#define KDC_NAME_EXP 1 /* Principal expired */ -#define KDC_SERVICE_EXP 2 /* Service expired */ -#define KDC_AUTH_EXP 3 /* Auth expired */ -#define KDC_PKT_VER 4 /* Protocol version unknown */ -#define KDC_P_MKEY_VER 5 /* Wrong master key version */ -#define KDC_S_MKEY_VER 6 /* Wrong master key version */ -#define KDC_BYTE_ORDER 7 /* Byte order unknown */ -#define KDC_PR_UNKNOWN 8 /* Principal unknown */ -#define KDC_PR_N_UNIQUE 9 /* Principal not unique */ -#define KDC_NULL_KEY 10 /* Principal has null key */ -#define KDC_GEN_ERR 20 /* Generic error from KDC */ - - -/* Values returned by get_credentials */ -#define GC_OK 0 /* Retrieve OK */ -#define RET_OK 0 /* Retrieve OK */ -#define GC_TKFIL 21 /* Can't read ticket file */ -#define RET_TKFIL 21 /* Can't read ticket file */ -#define GC_NOTKT 22 /* Can't find ticket or TGT */ -#define RET_NOTKT 22 /* Can't find ticket or TGT */ - - -/* Values returned by mk_ap_req */ -#define MK_AP_OK 0 /* Success */ -#define MK_AP_TGTEXP 26 /* TGT Expired */ - -/* Values returned by rd_ap_req */ -#define RD_AP_OK 0 /* Request authentic */ -#define RD_AP_UNDEC 31 /* Can't decode authenticator */ -#define RD_AP_EXP 32 /* Ticket expired */ -#define RD_AP_NYV 33 /* Ticket not yet valid */ -#define RD_AP_REPEAT 34 /* Repeated request */ -#define RD_AP_NOT_US 35 /* The ticket isn't for us */ -#define RD_AP_INCON 36 /* Request is inconsistent */ -#define RD_AP_TIME 37 /* delta_t too big */ -#define RD_AP_BADD 38 /* Incorrect net address */ -#define RD_AP_VERSION 39 /* protocol version mismatch */ -#define RD_AP_MSG_TYPE 40 /* invalid msg type */ -#define RD_AP_MODIFIED 41 /* message stream modified */ -#define RD_AP_ORDER 42 /* message out of order */ -#define RD_AP_UNAUTHOR 43 /* unauthorized request */ - -/* Values returned by get_pw_tkt */ -#define GT_PW_OK 0 /* Got password changing tkt */ -#define GT_PW_NULL 51 /* Current PW is null */ -#define GT_PW_BADPW 52 /* Incorrect current password */ -#define GT_PW_PROT 53 /* Protocol Error */ -#define GT_PW_KDCERR 54 /* Error returned by KDC */ -#define GT_PW_NULLTKT 55 /* Null tkt returned by KDC */ - - -/* Values returned by send_to_kdc */ -#define SKDC_OK 0 /* Response received */ -#define SKDC_RETRY 56 /* Retry count exceeded */ -#define SKDC_CANT 57 /* Can't send request */ - -/* - * Values returned by get_intkt - * (can also return SKDC_* and KDC errors) - */ - -#define INTK_OK 0 /* Ticket obtained */ -#define INTK_W_NOTALL 61 /* Not ALL tickets returned */ -#define INTK_BADPW 62 /* Incorrect password */ -#define INTK_PROT 63 /* Protocol Error */ -#define INTK_ERR 70 /* Other error */ - -/* Values returned by get_adtkt */ -#define AD_OK 0 /* Ticket Obtained */ -#define AD_NOTGT 71 /* Don't have tgt */ - -/* Error codes returned by ticket file utilities */ -#define NO_TKT_FIL 76 /* No ticket file found */ -#define TKT_FIL_ACC 77 /* Couldn't access tkt file */ -#define TKT_FIL_LCK 78 /* Couldn't lock ticket file */ -#define TKT_FIL_FMT 79 /* Bad ticket file format */ -#define TKT_FIL_INI 80 /* tf_init not called first */ - -/* Error code returned by kparse_name */ -#define KNAME_FMT 81 /* Bad Kerberos name format */ - -/* Error code returned by krb_mk_safe */ -#define SAFE_PRIV_ERROR -1 /* syscall error */ - -/* - * macros for byte swapping; also scratch space - * u_quad 0-->7, 1-->6, 2-->5, 3-->4, 4-->3, 5-->2, 6-->1, 7-->0 - * u_long 0-->3, 1-->2, 2-->1, 3-->0 - * u_short 0-->1, 1-->0 - */ - -#define swap_u_16(x) {\ - unsigned long _krb_swap_tmp[4];\ - _swab(((char *) x) +0, ((char *) _krb_swap_tmp) +14 ,2); \ - _swab(((char *) x) +2, ((char *) _krb_swap_tmp) +12 ,2); \ - _swab(((char *) x) +4, ((char *) _krb_swap_tmp) +10 ,2); \ - _swab(((char *) x) +6, ((char *) _krb_swap_tmp) +8 ,2); \ - _swab(((char *) x) +8, ((char *) _krb_swap_tmp) +6 ,2); \ - _swab(((char *) x) +10,((char *) _krb_swap_tmp) +4 ,2); \ - _swab(((char *) x) +12,((char *) _krb_swap_tmp) +2 ,2); \ - _swab(((char *) x) +14,((char *) _krb_swap_tmp) +0 ,2); \ - bcopy((char *)_krb_swap_tmp,(char *)x,16);\ - } - -#define swap_u_12(x) {\ - unsigned long _krb_swap_tmp[4];\ - _swab(( char *) x, ((char *) _krb_swap_tmp) +10 ,2); \ - _swab(((char *) x) +2, ((char *) _krb_swap_tmp) +8 ,2); \ - _swab(((char *) x) +4, ((char *) _krb_swap_tmp) +6 ,2); \ - _swab(((char *) x) +6, ((char *) _krb_swap_tmp) +4 ,2); \ - _swab(((char *) x) +8, ((char *) _krb_swap_tmp) +2 ,2); \ - _swab(((char *) x) +10,((char *) _krb_swap_tmp) +0 ,2); \ - bcopy((char *)_krb_swap_tmp,(char *)x,12);\ - } - -#define swap_C_Block(x) {\ - unsigned long _krb_swap_tmp[4];\ - _swab(( char *) x, ((char *) _krb_swap_tmp) +6 ,2); \ - _swab(((char *) x) +2,((char *) _krb_swap_tmp) +4 ,2); \ - _swab(((char *) x) +4,((char *) _krb_swap_tmp) +2 ,2); \ - _swab(((char *) x) +6,((char *) _krb_swap_tmp) ,2); \ - bcopy((char *)_krb_swap_tmp,(char *)x,8);\ - } -#define swap_u_quad(x) {\ - unsigned long _krb_swap_tmp[4];\ - _swab(( char *) &x, ((char *) _krb_swap_tmp) +6 ,2); \ - _swab(((char *) &x) +2,((char *) _krb_swap_tmp) +4 ,2); \ - _swab(((char *) &x) +4,((char *) _krb_swap_tmp) +2 ,2); \ - _swab(((char *) &x) +6,((char *) _krb_swap_tmp) ,2); \ - bcopy((char *)_krb_swap_tmp,(char *)&x,8);\ - } - -#define swap_u_long(x) {\ - unsigned long _krb_swap_tmp[4];\ - _swab((char *) &x, ((char *) _krb_swap_tmp) +2 ,2); \ - _swab(((char *) &x) +2,((char *) _krb_swap_tmp),2); \ - x = _krb_swap_tmp[0]; \ - } - -#define swap_u_short(x) {\ - unsigned short _krb_swap_sh_tmp; \ - _swab((char *) &x, ( &_krb_swap_sh_tmp) ,2); \ - x = (unsigned short) _krb_swap_sh_tmp; \ - } - -/* Kerberos ticket flag field bit definitions */ -#define K_FLAG_ORDER 0 /* bit 0 --> lsb */ -#define K_FLAG_1 /* reserved */ -#define K_FLAG_2 /* reserved */ -#define K_FLAG_3 /* reserved */ -#define K_FLAG_4 /* reserved */ -#define K_FLAG_5 /* reserved */ -#define K_FLAG_6 /* reserved */ -#define K_FLAG_7 /* reserved, bit 7 --> msb */ - -char *tkt_string(); - -#ifdef OLDNAMES -#define krb_mk_req mk_ap_req -#define krb_rd_req rd_ap_req -#define krb_kntoln an_to_ln -#define krb_set_key set_serv_key -#define krb_get_cred get_credentials -#define krb_mk_priv mk_private_msg -#define krb_rd_priv rd_private_msg -#define krb_mk_safe mk_safe_msg -#define krb_rd_safe rd_safe_msg -#define krb_mk_err mk_appl_err_msg -#define krb_rd_err rd_appl_err_msg -#define krb_ck_repl check_replay -#define krb_get_pw_in_tkt get_in_tkt -#define krb_get_svc_in_tkt get_svc_in_tkt -#define krb_get_pw_tkt get_pw_tkt -#define krb_realmofhost krb_getrealm -#define krb_get_phost get_phost -#define krb_get_krbhst get_krbhst -#define krb_get_lrealm get_krbrlm -#endif /* OLDNAMES */ - -/* Defines for krb_sendauth and krb_recvauth */ - -#define KOPT_DONT_MK_REQ 0x00000001 /* don't call krb_mk_req */ -#define KOPT_DO_MUTUAL 0x00000002 /* do mutual auth */ - -#define KOPT_DONT_CANON 0x00000004 /* - * don't canonicalize inst as - * a hostname - */ - -#define KRB_SENDAUTH_VLEN 8 /* length for version strings */ - -#ifdef ATHENA_COMPAT -#define KOPT_DO_OLDSTYLE 0x00000008 /* use the old-style protocol */ -#endif /* ATHENA_COMPAT */ - -#ifdef WINDOWS -#include -int gettimeofday(struct timeval *tv, struct timezone *tz); -void tkt_free(tkt_header FAR* hdr); -int krb_get_tf_fullname(char *tf, char *name, char *inst, char *realm); -/* Windows prototypes */ -int FAR PASCAL krb_sendauth(long,int,KTEXT_FP,LPSTR,LPSTR,LPSTR,unsigned long, - MSG_DAT FAR *,CREDENTIALS FAR *, Key_schedule FAR *, - struct sockaddr_in FAR *,struct sockaddr_in FAR *, LPSTR); -char FAR* FAR* FAR get_krb_err_txt(void); -/* 2-22-93, pbh */ -int FAR krb_get_tf_realm(char FAR *,char FAR *); -int FAR tf_init(char FAR*,int); -int FAR tf_get_pname(char FAR*); -int FAR tf_get_pinst(char FAR*); -int FAR tf_get_cred(CREDENTIALS FAR*); -void FAR tf_close(void); -int FAR tf_save_cred(char FAR*,char FAR*,char FAR*,C_Block,int,int,KTEXT,long); -BOOL FAR k_isinst(char FAR *s); -BOOL FAR k_isrealm(char FAR *s); -BOOL FAR k_isname(char FAR *s); -int FAR set_krb_debug( int ); /* Warning, unique to Windows! */ -int FAR set_krb_ap_req_debug( int ); /* Warning, unique to Windows! */ -LPSTR FAR PASCAL get_krb_err_txt_entry( int i); /* Warning, unique to Windows! */ -int FAR PASCAL krb_mk_req(KTEXT,LPSTR,LPSTR,LPSTR,long); -LPSTR FAR PASCAL krb_getrealm( char FAR *host); -/* end 2-22-93, pbh */ - -#ifdef WINSOCK -#define bcopy(a,b,c) memcpy( (b), (a), (c) ) -#define bzero(a,b) memset( (a), 0, (b) ) -#endif /* WINSOCK */ - - -/* -#ifdef __cplusplus -int printf(char far*,...); -#else -int printf(); -#endif -*/ - -int FAR kname_parse(char FAR*,char FAR*,char FAR*,char FAR*); -int FAR krb_get_pw_in_tkt(char FAR*,char FAR*,char FAR*,char FAR*,char FAR*,int,char FAR*); -int FAR dest_tkt(void); -int FAR krb_get_lrealm(LPSTR ,int); - -int FAR krb_use_kerbmem(); -int FAR krb_check_tgt(); -int FAR krb_check_serv(char *); - -int FAR krb_get_cred(char FAR*,char FAR*,char FAR*,CREDENTIALS FAR*); -int FAR send_to_kdc(KTEXT,KTEXT,char FAR*); - -#define MIT_PWD_DLL_CLASS "MITPasswordWndDLL" - -#else /* end of WINDOWS start of DOS */ - -/* DOS prototypes */ -int krb_get_in_tkt(char *, char *, char *, char *, char *, int, int (*)(), int (*)(), char *); -long krb_mk_priv( u_char *, u_char *, u_long, Key_schedule, C_Block, - struct sockaddr_in *, struct sockaddr_in *); -char* krb_getrealm( char *host); -char* krb_realmofhost( char *host); -int krb_get_tf_realm(char*,char*); -int krb_get_tf_fullname(char*,char*,char*,char*); -int get_ad_tkt(char*,char*,char*,int); -int krb_get_cred(char*,char*,char*,CREDENTIALS*); -int krb_get_krbhst(char*,char*,int); -int krb_get_lrealm(char*,int); -char* krb_get_phost(char*); -int krb_mk_req(KTEXT,char*,char*,char*,long); -int krb_set_lifetime(int); - -#ifndef WINSOCK -int krb_net_read(int,char*,int); -int krb_net_write(int,char*,int); -#else -int krb_net_read(SOCKET,char*,int); -int krb_net_write(SOCKET,char*,int); -#endif /*winsock*/ - -KTEXT pkt_cipher(KTEXT); -int pkt_clen(KTEXT); -long krb_rd_priv(unsigned char*,unsigned long,Key_schedule,C_Block, - struct sockaddr_in*, struct sockaddr_in*,MSG_DAT*); -int save_credentials(char*,char*,char*,C_Block,int,int,KTEXT,long); -int send_to_kdc(KTEXT,KTEXT,char*); -int krb_sendauth(long,int,KTEXT,char*,char*,char*,u_long, - MSG_DAT*,CREDENTIALS*,Key_schedule, - struct sockaddr_in*,struct sockaddr_in*,char*); -int tf_init(char*,int); -int tf_get_pname(char*); -int tf_get_pinst(char*); -int tf_get_cred(CREDENTIALS*); -void tf_close(void); -int tf_save_cred(char*,char*,char*,C_Block,int,int,KTEXT,long); -int kname_parse(char*,char*,char*,char*); -int krb_get_pw_in_tkt(char*,char*,char*,char*,char*,int,char*); -int dest_tkt(void); - -int krb_use_kerbmem(); -int krb_check_tgt(); -int krb_check_serv(char *); - -#endif /* WINDOWS */ -#endif /* KRB_DEFS */ diff --git a/libraries/msdos/winsock/include/krb/mit/arpa/nameser.h b/libraries/msdos/winsock/include/krb/mit/arpa/nameser.h deleted file mode 100644 index bc6ffcb06e..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/arpa/nameser.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) 1983, 1989 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)nameser.h 5.25 (Berkeley) 4/3/91 - */ - -#ifndef _NAMESER_H_ -#define _NAMESER_H_ - -/* - * Define constants based on rfc883 - */ -#define PACKETSZ 512 /* maximum packet size */ -#define MAXDNAME 256 /* maximum domain name */ -#define MAXCDNAME 255 /* maximum compressed domain name */ -#define MAXLABEL 63 /* maximum length of domain label */ - /* Number of bytes of fixed size data in query structure */ -#define QFIXEDSZ 4 - /* number of bytes of fixed size data in resource record */ -#define RRFIXEDSZ 10 - -/* - * Internet nameserver port number - */ -#define NAMESERVER_PORT 53 - -/* - * Currently defined opcodes - */ -#define QUERY 0x0 /* standard query */ -#define IQUERY 0x1 /* inverse query */ -#define STATUS 0x2 /* nameserver status query */ -/*#define xxx 0x3 /* 0x3 reserved */ - /* non standard */ -#define UPDATEA 0x9 /* add resource record */ -#define UPDATED 0xa /* delete a specific resource record */ -#define UPDATEDA 0xb /* delete all nemed resource record */ -#define UPDATEM 0xc /* modify a specific resource record */ -#define UPDATEMA 0xd /* modify all named resource record */ - -#define ZONEINIT 0xe /* initial zone transfer */ -#define ZONEREF 0xf /* incremental zone referesh */ - -/* - * Currently defined response codes - */ -#define NOERROR 0 /* no error */ -#define FORMERR 1 /* format error */ -#define SERVFAIL 2 /* server failure */ -#define NXDOMAIN 3 /* non existent domain */ -#define NOTIMP 4 /* not implemented */ -#define REFUSED 5 /* query refused */ - /* non standard */ -#define NOCHANGE 0xf /* update failed to change db */ - -/* - * Type values for resources and queries - */ -#define T_A 1 /* host address */ -#define T_NS 2 /* authoritative server */ -#define T_MD 3 /* mail destination */ -#define T_MF 4 /* mail forwarder */ -#define T_CNAME 5 /* connonical name */ -#define T_SOA 6 /* start of authority zone */ -#define T_MB 7 /* mailbox domain name */ -#define T_MG 8 /* mail group member */ -#define T_MR 9 /* mail rename name */ -#define T_NULL 10 /* null resource record */ -#define T_WKS 11 /* well known service */ -#define T_PTR 12 /* domain name pointer */ -#define T_HINFO 13 /* host information */ -#define T_MINFO 14 /* mailbox information */ -#define T_MX 15 /* mail routing information */ -#define T_TXT 16 /* text strings */ - /* non standard */ -#define T_UINFO 100 /* user (finger) information */ -#define T_UID 101 /* user ID */ -#define T_GID 102 /* group ID */ -#define T_UNSPEC 103 /* Unspecified format (binary data) */ - /* Query type values which do not appear in resource records */ -#define T_AXFR 252 /* transfer zone of authority */ -#define T_MAILB 253 /* transfer mailbox records */ -#define T_MAILA 254 /* transfer mail agent records */ -#define T_ANY 255 /* wildcard match */ - -/* - * Values for class field - */ - -#define C_IN 1 /* the arpa internet */ -#define C_CHAOS 3 /* for chaos net at MIT */ -#define C_HS 4 /* for Hesiod name server at MIT */ - /* Query class values which do not appear in resource records */ -#define C_ANY 255 /* wildcard match */ - -/* - * Status return codes for T_UNSPEC conversion routines - */ -#define CONV_SUCCESS 0 -#define CONV_OVERFLOW -1 -#define CONV_BADFMT -2 -#define CONV_BADCKSUM -3 -#define CONV_BADBUFLEN -4 - -#ifndef BYTE_ORDER -#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */ -#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */ -#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */ - -#if defined(vax) || defined(ns32000) || defined(sun386) || defined(MIPSEL) || \ - defined(BIT_ZERO_ON_RIGHT) -#define BYTE_ORDER LITTLE_ENDIAN - -#endif -#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \ - defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \ - defined(MIPSEB) || defined (BIT_ZERO_ON_LEFT) -#define BYTE_ORDER BIG_ENDIAN -#endif -#endif /* BYTE_ORDER */ - -#ifndef BYTE_ORDER - /* you must determine what the correct bit order is for your compiler */ - #define BYTE_ORDER LITTLE_ENDIAN /* for Intel x86 series */ -#endif -/* - * Structure for query header, the order of the fields is machine and - * compiler dependent, in our case, the bits within a byte are assignd - * least significant first, while the order of transmition is most - * significant first. This requires a somewhat confusing rearrangement. - */ - -#ifdef _WINDLL -/* define UNIX types */ -#include -#endif - -typedef struct { - u_short id; /* query identification number */ -#if BYTE_ORDER == BIG_ENDIAN - /* fields in third byte */ - u_char qr:1; /* response flag */ - u_char opcode:4; /* purpose of message */ - u_char aa:1; /* authoritive answer */ - u_char tc:1; /* truncated message */ - u_char rd:1; /* recursion desired */ - /* fields in fourth byte */ - u_char ra:1; /* recursion available */ - u_char pr:1; /* primary server required (non standard) */ - u_char unused:2; /* unused bits */ - u_char rcode:4; /* response code */ -#endif -#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN - /* fields in third byte */ - u_char rd:1; /* recursion desired */ - u_char tc:1; /* truncated message */ - u_char aa:1; /* authoritive answer */ - u_char opcode:4; /* purpose of message */ - u_char qr:1; /* response flag */ - /* fields in fourth byte */ - u_char rcode:4; /* response code */ - u_char unused:2; /* unused bits */ - u_char pr:1; /* primary server required (non standard) */ - u_char ra:1; /* recursion available */ -#endif - /* remaining bytes */ - u_short qdcount; /* number of question entries */ - u_short ancount; /* number of answer entries */ - u_short nscount; /* number of authority entries */ - u_short arcount; /* number of resource entries */ -} HEADER; - -/* - * Defines for handling compressed domain names - */ -#define INDIR_MASK 0xc0 - -/* - * Structure for passing resource records around. - */ -struct rrec { - short r_zone; /* zone number */ - short r_class; /* class number */ - short r_type; /* type number */ - u_long r_ttl; /* time to live */ - int r_size; /* size of data area */ - char *r_data; /* pointer to data */ -}; - -extern u_short _getshort(); -extern u_long _getlong(); - -/* - * Inline versions of get/put short/long. - * Pointer is advanced; we assume that both arguments - * are lvalues and will already be in registers. - * cp MUST be u_char *. - */ -#define GETSHORT(s, cp) { \ - (s) = *(cp)++ << 8; \ - (s) |= *(cp)++; \ -} - -#define GETLONG(l, cp) { \ - (l) = *(cp)++ << 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; \ -} - - -#define PUTSHORT(s, cp) { \ - *(cp)++ = (s) >> 8; \ - *(cp)++ = (s); \ -} - -/* - * Warning: PUTLONG destroys its first argument. - */ -#define PUTLONG(l, cp) { \ - (cp)[3] = l; \ - (cp)[2] = (l >>= 8); \ - (cp)[1] = (l >>= 8); \ - (cp)[0] = l >> 8; \ - (cp) += sizeof(u_long); \ -} - -#endif /* !_NAMESER_H_ */ diff --git a/libraries/msdos/winsock/include/krb/mit/conf-pc.h b/libraries/msdos/winsock/include/krb/mit/conf-pc.h deleted file mode 100644 index 4c779aa730..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/conf-pc.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 1988 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - * - * Machine-type definitions: IBM PC 8086 - */ - -#include - -#ifndef IBMPC - #define IBMPC -#endif - -#if defined(__WINDOWS__) && !defined(WINDOWS) -#define WINDOWS -#endif - -#if defined(__OS2__) && !defined(OS2) -#define OS2 -#endif - -#ifndef OS2 -#define BITS16 -#define CROSSMSDOS -/* OS/2 is 32 bit!!!! */ -#else -#define BITS32 -#endif -#define LSBFIRST - -#define index(s,c) strchr(s,c) /* PC version of index */ -#define rindex(s,c) strrchr(s,c) - -typedef unsigned char u_char; -typedef unsigned long u_long; -typedef unsigned short u_short; -typedef short uid_t; - -#if !defined(WINDOWS) && !defined(DWORD) -typedef long DWORD; -#endif - -#ifdef OS2 -typedef char *LPSTR; -typedef char *LPBYTE; -typedef char *CHARPTR; -typedef char *LPINT; -typedef unsigned int WORD; - -#define far -#define near -#define FAR -#define PASCAL -#include -#define lstrcpy strcpy -#define lstrlen strlen -#define lstrcmp strcmp -#define lstrcpyn strncpy -#endif - -#if defined(OS2) || defined(WINDOWS) -#define creat _creat -#define read _read -#define write _write -#define open _open -#define close _close -#define stat(x,y) _stat(x,y) -#define putch _putch -#define getch _getch -#endif - -#ifdef WINDOWS -#include -#endif diff --git a/libraries/msdos/winsock/include/krb/mit/conf.h b/libraries/msdos/winsock/include/krb/mit/conf.h deleted file mode 100644 index cd33f6ebe9..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/conf.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 1988 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - * - * Configuration info for operating system, hardware description, - * language implementation, C library, etc. - * - * This file should be included in (almost) every file in the Kerberos - * sources, and probably should *not* be needed outside of those - * sources. (How do we deal with /usr/include/des.h and - * /usr/include/krb.h?) - */ - -#ifndef _CONF_H_ -#define _CONF_H_ - -#include - -#include "osconf.h" - -#ifdef SHORTNAMES -#include "names.h" -#endif - -/* - * Language implementation-specific definitions - */ - -/* special cases */ -#ifdef __HIGHC__ -/* broken implementation of ANSI C */ -#undef __STDC__ -#endif - -#if !defined(__STDC__) && !defined(__BORLANDC__) -#define const -#define volatile -#define signed -typedef char *pointer; /* pointer to generic data */ -#define PROTOTYPE(p) () -#else -typedef void *pointer; -#define PROTOTYPE(p) p -#endif - -/* Does your compiler understand "void"? */ -#ifdef notdef -#define void int -#endif - -/* - * A few checks to see that necessary definitions are included. - */ - -/* byte order */ -/* #define LSBFIRST */ -/* #define BITS16 */ -/* #define CROSSMSDOS */ - -#ifndef MSBFIRST -#ifndef LSBFIRST -#error byte order not defined -#endif -#endif - -/* machine size */ -#ifndef BITS16 -#ifndef BITS32 -#error number of bits? -#endif -#endif - -/* end of checks */ - -#endif /* _CONF_H_ */ diff --git a/libraries/msdos/winsock/include/krb/mit/hesiod.h b/libraries/msdos/winsock/include/krb/mit/hesiod.h deleted file mode 100644 index 5bc39e8d36..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/hesiod.h +++ /dev/null @@ -1,110 +0,0 @@ -/* This file contains definitions for use by the Hesiod name service and - * applications. - * - * For copying and distribution information, see the file . - * - * Original version by Steve Dyer, IBM/Project Athena. - * - * Vendor History - * - * Revision 1.6 90/07/20 13:09:16 probe - * Incorrect declaration of hes_getpwnam() - * - * Revision 1.5 90/07/11 16:49:12 probe - * Patches from - * Added missing declarations - * - * Revision 1.5 90/07/09 18:44:30 mar - * mention hes_getservbyname(), hes_getpwent() - * - * Revision 1.4 88/08/07 23:18:00 treese - * Second-public-distribution - * - * Revision 1.3 88/08/07 21:52:39 treese - * First public distribution - * - * Revision 1.2 88/06/05 19:51:32 treese - * Cleaned up for public distribution - * - */ - -/* Configuration information. */ - -#ifndef _HESIOD_ -#define _HESIOD_ - -#ifdef WINDOWS -#include -#endif - -#if !defined(WINDOWS) && !defined(_WINDOWS) -#define HESIOD_CONF "/etc/hesiod.conf" /* Configuration file. */ -#else -#define HESIOD_CONF "c:\\net\\tcp\\hesiod.cfg" -#endif - -#define DEF_RHS ".Athena.MIT.EDU" /* Defaults if HESIOD_CONF */ -#define DEF_LHS ".ns" /* file is not present. */ - -/* Error codes. */ - -#define HES_ER_UNINIT -1 /* uninitialized */ -#define HES_ER_OK 0 /* no error */ -#define HES_ER_NOTFOUND 1 /* Hesiod name not found by server */ -#define HES_ER_CONFIG 2 /* local problem (no config file?) */ -#define HES_ER_NET 3 /* network problem */ - -/* Declaration of routines */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(WINDOWS) && !defined(_WINDOWS) -char *hes_to_bind(); -char **hes_resolve(); -int hes_error(); -#else -#ifndef _WSHELPER_ -LPSTR FAR PASCAL hes_to_bind(LPSTR HesiodName, LPSTR HesiodNameType); -LPSTR * FAR PASCAL hes_resolve(LPSTR HesiodName, LPSTR HesiodNameType); -int FAR PASCAL hes_error(void); -#endif -#endif - - -/* For use in getting post-office information. */ - -#if !defined(WINDOWS) && !defined(_WINDOWS) -struct hes_postoffice { - char *po_type; - char *po_host; - char *po_name; -}; -#else -struct hes_postoffice { - LPSTR po_type; - LPSTR po_host; - LPSTR po_name; -}; -#endif - -/* Other routines */ - -#if !defined(WINDOWS) && !defined(_WINDOWS) -struct hes_postoffice *hes_getmailhost(); -struct servent *hes_getservbyname(); -struct passwd *hes_getpwnam(); -struct passwd *hes_getpwuid(); -#else -struct hes_postoffice FAR * WINAPI hes_getmailhost(LPSTR user); -struct servent FAR * WINAPI hes_getservbyname(LPSTR name, LPSTR proto); -struct passwd FAR * WINAPI hes_getpwnam(LPSTR nam); -struct passwd FAR * WINAPI hes_getpwuid(int uid); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _HESIOD_ */ diff --git a/libraries/msdos/winsock/include/krb/mit/lsh_pwd.h b/libraries/msdos/winsock/include/krb/mit/lsh_pwd.h deleted file mode 100644 index c51a2965e6..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/lsh_pwd.h +++ /dev/null @@ -1,56 +0,0 @@ -/* LSH_PWD.H this is the include file for the LSH_PWD.C */ - -/* Included from krb.h - CRS 940805 */ - -#ifndef __LSH_PWD__ -#define __LSH_PWD__ - -// Definition of the info structure that is passed to tell the dialog box what state it -// should be in. - -#include - -typedef struct { - int dlgtype; -#define DLGTYPE_PASSWD 0 -#define DLGTYPE_CHPASSWD 1 - int dlgstatemax; // I am not sure what this is yet. STUFF TO DO! - LPSTR title; // The title on the Dialog box - for Renewing or Initializing. - LPSTR principal; -} LSH_DLGINFO, FAR *LPLSH_DLGINFO; - - -// Some defines swiped from leash.h -// These are necessary but they must be kept sync'ed with leash.h -#define HELPFILE "kerberos.hlp" -#define PASSWORDCHAR '#' - -#define DLGHT(ht) (HIWORD(GetDialogBaseUnits())*(ht)/8) -#define DLGWD(wd) (LOWORD(GetDialogBaseUnits())*(wd)/4) - -// external variables -#ifdef PDLL -long lsh_errno; -char *err_context; /* error context */ -char FAR *kadm_info; /* to get info from the kadm* files */ -long dlgu; /* dialog units */ -#ifdef WINSOCK -HINSTANCE hinstWinSock = NULL; -#endif // WINSOCK -#endif // PDLL - -// local macros stolen from leash.h -#ifndef MAKEWORD -#define MAKEWORD(low, high) ((WORD)(((BYTE)(low)) | (((UINT)((BYTE)(high))) << 8))) -#endif /*MAKEWORD*/ - - -// Function Prototypes. -int FAR PASCAL _export Lsh_Enter_Password_Dialog(HWND hParent, LPLSH_DLGINFO lpdlginfo); -int FAR PASCAL _export Lsh_Change_Password_Dialog(HWND hParent, LPLSH_DLGINFO lpdlginfo); -int lsh_com_err_proc (LPSTR whoami, long code, LPSTR fmt, va_list args); -int _export DoNiftyErrorReport(long errnum, LPSTR what); -LONG FAR PASCAL _export MITPwdWinProcDLL(HWND hWnd, WORD message, WORD wParam, LONG lParam); -BOOL FAR PASCAL _export PasswordProcDLL(HWND hDialog, WORD message, WORD wParam, LONG lParam); -LONG FAR PASCAL _export lsh_get_lsh_errno( LONG FAR *err_val); -#endif __LSH_PWD__ diff --git a/libraries/msdos/winsock/include/krb/mit/mit_copy.h b/libraries/msdos/winsock/include/krb/mit/mit_copy.h deleted file mode 100644 index b47de92f81..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/mit_copy.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright (C) 1989 by the Massachusetts Institute of Technology - - Export of this software from the United States of America is assumed - to require a specific license from the United States Government. - It is the responsibility of any person or organization contemplating - export to obtain such a license before exporting. - -WITHIN THAT CONSTRAINT, permission to use, copy, modify, and -distribute this software and its documentation for any purpose and -without fee is hereby granted, provided that the above copyright -notice appear in all copies and that both that copyright notice and -this permission notice appear in supporting documentation, and that -the name of M.I.T. not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. M.I.T. makes no representations about the suitability of -this software for any purpose. It is provided "as is" without express -or implied warranty. - - */ - - diff --git a/libraries/msdos/winsock/include/krb/mit/osconf.h b/libraries/msdos/winsock/include/krb/mit/osconf.h deleted file mode 100644 index ac614b0c6d..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/osconf.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 1988 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - * - * Athena configuration. - */ - -#include - -#ifndef _OSCONF_H_ -#define _OSCONF_H_ - -#if defined(IBMPC) && !defined(PC) -#define PC -#endif - -#ifdef tahoe -#include "conf-bsdtahoe.h" -#else /* !tahoe */ -#ifdef vax -#include "conf-bsdvax.h" -#else /* !vax */ -#if defined(mips) && defined(ultrix) -#include "conf-ultmips2.h" -#else /* !Ultrix MIPS-2 */ -#ifdef ibm032 -#include "conf-bsdibm032.h" -#else /* !ibm032 */ -#ifdef apollo -#include "conf-bsdapollo.h" -#else /* !apollo */ -#ifdef sun -#ifdef sparc -#include "conf-bsdsparc.h" -#else /* sun but not sparc */ -#ifdef i386 -#include "conf-bsd386i.h" -#else /* sun but not (sparc or 386i) */ -#include "conf-bsdm68k.h" -#endif /* i386 */ -#endif /* sparc */ -#else /* !sun */ -#ifdef pyr -#include "conf-pyr.h" -#else -#if defined(PC) || defined(__MSDOS__) || defined(OS2) -#include "conf-pc.h" -#endif /* PC */ -#endif /* pyr */ -#endif /* sun */ -#endif /* apollo */ -#endif /* ibm032 */ -#endif /* mips */ -#endif /* vax */ -#endif /* tahoe */ - -#endif /* _OSCONF_H_ */ diff --git a/libraries/msdos/winsock/include/krb/mit/resolv.h b/libraries/msdos/winsock/include/krb/mit/resolv.h deleted file mode 100644 index ebe0a281d8..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/resolv.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - WSHelper DNS/Hesiod Library for WINSOCK - resolv.h -*/ - -/* - * Copyright (c) 1983, 1987, 1989 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)resolv.h 5.15 (Berkeley) 4/3/91 - */ - -#ifndef _RESOLV_H_ -#define _RESOLV_H_ - -/* - * Resolver configuration file. - * Normally not present, but may contain the address of the - * inital name server(s) to query and the domain search list. - */ - -#ifndef _PATH_RESCONF -#if !defined(WINDOWS) && !defined(_WINDOWS) -#define _PATH_RESCONF "/etc/resolv.conf" -#else -#define _PATH_RESCONF "c:\\net\\tcp\\resolv.cfg" -#endif -#endif - -#ifndef MAXDNAME -#include -#endif - -/* - * Global defines and variables for resolver stub. - */ -#define MAXNS 3 /* max # name servers we'll track */ -#define MAXDFLSRCH 3 /* # default domain levels to try */ -#define MAXDNSRCH 6 /* max # domains in search path */ -#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ - -#define RES_TIMEOUT 5 /* min. seconds between retries */ - -// new -#define MAXMXRECS 8 - -struct mxent { - int numrecs; - u_short pref[MAXMXRECS]; - char FAR * FAR * hostname; -}; - -struct state { - int retrans; /* retransmition time interval */ - int retry; /* number of times to retransmit */ - long options; /* option flags - see below. */ - int nscount; /* number of name servers */ - struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ -#define nsaddr nsaddr_list[0] /* for backward compatibility */ - u_short id; /* current packet id */ - char defdname[MAXDNAME]; /* default domain */ - char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ -}; - -/* - * Resolver options - */ -#define RES_INIT 0x0001 /* address initialized */ -#define RES_DEBUG 0x0002 /* print debug messages */ -#define RES_AAONLY 0x0004 /* authoritative answers only */ -#define RES_USEVC 0x0008 /* use virtual circuit */ -#define RES_PRIMARY 0x0010 /* query primary server only */ -#define RES_IGNTC 0x0020 /* ignore trucation errors */ -#define RES_RECURSE 0x0040 /* recursion desired */ -#define RES_DEFNAMES 0x0080 /* use default domain name */ -#define RES_STAYOPEN 0x0100 /* Keep TCP socket open */ -#define RES_DNSRCH 0x0200 /* search up local domain tree */ - -#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH) - -extern struct state _res; - -#include - -/* Private routines shared between libc/net, named, nslookup and others. */ -#define dn_skipname __dn_skipname -#define fp_query __fp_query -#define hostalias __hostalias -#define putlong __putlong -#define putshort __putshort -#define p_class __p_class -#define p_time __p_time -#define p_type __p_type - -#if !defined(WINDOWS) && !defined(_WINDOWS) -__BEGIN_DECLS -int __dn_skipname __P((const u_char *, const u_char *)); -void __fp_query __P((char *, FILE *)); -char *__hostalias __P((const char *)); -void __putlong __P((u_long, u_char *)); -void __putshort __P((u_short, u_char *)); -char *__p_class __P((int)); -char *__p_time __P((u_long)); -char *__p_type __P((int)); - -int dn_comp __P((const u_char *, u_char *, int, u_char **, u_char **)); -int dn_expand __P((const u_char *, const u_char *, const u_char *, - u_char *, int)); -int res_init __P((void)); -int res_mkquery __P((int, const char *, int, int, const char *, int, - const struct rrec *, char *, int)); -int res_send __P((const char *, int, char *, int)); -__END_DECLS -#endif - -#endif /* !_RESOLV_H_ */ diff --git a/libraries/msdos/winsock/include/krb/mit/wshelper.h b/libraries/msdos/winsock/include/krb/mit/wshelper.h deleted file mode 100644 index 971c85a490..0000000000 --- a/libraries/msdos/winsock/include/krb/mit/wshelper.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - WSHelper DNS/Hesiod Library for WINSOCK - wshelper.h -*/ - -#ifndef _WSHELPER_ -#define _WSHELPER_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int FAR PASCAL res_mkquery(int op, char FAR *dname, int qclass, int type, - char FAR *data, int datalen, struct rrec FAR *newrr, - char FAR *buf, int buflen); - -int FAR PASCAL res_send(char FAR *msg, int msglen, char FAR *answer, int anslen); - -int FAR PASCAL res_init(); - -int FAR PASCAL dn_comp(char FAR *exp_dn, char FAR *comp_dn, int length, - char FAR * FAR *dnptrs, char FAR * FAR *lastdnptr); - -int FAR PASCAL dn_expand(char FAR *msg, char FAR *eomorig, char FAR *comp_dn, - char FAR *exp_dn, int length); - -struct hostent FAR* FAR PASCAL rgethostbyname(char FAR *name); - -struct hostent FAR* FAR PASCAL rgethostbyaddr(char FAR *addr, int len, int type); - -LPSTR FAR PASCAL hes_to_bind(char FAR *HesiodName, char FAR *HesiodNameType); - -LPSTR * FAR PASCAL hes_resolve(char FAR *HesiodName, char FAR *HesiodNameType); - -int FAR PASCAL hes_error(void); - -void FAR PASCAL res_setopts(long opts); - -long FAR PASCAL res_getopts(void); - -unsigned long FAR PASCAL inet_aton(register const char *cp, struct in_addr *addr); - -LPSTR FAR PASCAL gethinfobyname(LPSTR name); - -LPSTR FAR PASCAL getmxbyname(LPSTR name); - -LPSTR FAR PASCAL getrecordbyname(LPSTR name, int rectype); - -DWORD FAR PASCAL rrhost( LPSTR lpHost ); - -struct servent FAR * FAR PASCAL rgetservbyname(LPSTR name, LPSTR proto); - -#ifdef __cplusplus -} -#endif - -#endif /* _WSHELPER_ */ - diff --git a/libraries/msdos/winsock/include/net/_sys/filio.h b/libraries/msdos/winsock/include/net/_sys/filio.h deleted file mode 100644 index f352fdd480..0000000000 --- a/libraries/msdos/winsock/include/net/_sys/filio.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _SOCKET -#include -#endif - diff --git a/libraries/msdos/winsock/include/net/_sys/ioctl.h b/libraries/msdos/winsock/include/net/_sys/ioctl.h deleted file mode 100644 index f352fdd480..0000000000 --- a/libraries/msdos/winsock/include/net/_sys/ioctl.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _SOCKET -#include -#endif - diff --git a/libraries/msdos/winsock/include/net/netdb.h b/libraries/msdos/winsock/include/net/netdb.h deleted file mode 100644 index f352fdd480..0000000000 --- a/libraries/msdos/winsock/include/net/netdb.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _SOCKET -#include -#endif - diff --git a/libraries/msdos/winsock/include/param.h b/libraries/msdos/winsock/include/param.h deleted file mode 100644 index cead0808d2..0000000000 --- a/libraries/msdos/winsock/include/param.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * This file is intentionally empty. Some compilers require the presence of - * an include file, even if the "#ifdef"s exclude it from actual use. PTUI ! - */ diff --git a/libraries/msdos/winsock/include/select.h b/libraries/msdos/winsock/include/select.h deleted file mode 100644 index cead0808d2..0000000000 --- a/libraries/msdos/winsock/include/select.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * This file is intentionally empty. Some compilers require the presence of - * an include file, even if the "#ifdef"s exclude it from actual use. PTUI ! - */ diff --git a/libraries/msdos/winsock/include/socket.h b/libraries/msdos/winsock/include/socket.h deleted file mode 100644 index cead0808d2..0000000000 --- a/libraries/msdos/winsock/include/socket.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * This file is intentionally empty. Some compilers require the presence of - * an include file, even if the "#ifdef"s exclude it from actual use. PTUI ! - */ diff --git a/libraries/msdos/winsock/include/time.h b/libraries/msdos/winsock/include/time.h deleted file mode 100644 index cead0808d2..0000000000 --- a/libraries/msdos/winsock/include/time.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * This file is intentionally empty. Some compilers require the presence of - * an include file, even if the "#ifdef"s exclude it from actual use. PTUI ! - */ diff --git a/libraries/msdos/winsock/include/wsa.h b/libraries/msdos/winsock/include/wsa.h deleted file mode 100644 index 808697c57c..0000000000 --- a/libraries/msdos/winsock/include/wsa.h +++ /dev/null @@ -1,132 +0,0 @@ -/* wsa.h */ -/* - * Copyright (c) 1993 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 _MSDOS_H -#define _MSDOS_H - -/* - * NOTE: This file should be included via ldap.h. Many symbols are - * defined here that are needed BEFORE anything else is included. - * Be careful !!! - */ -/* - * The following are defined within the Integrated Development Environment - * of Microsoft's Visual C++ Compiler (v1.52c) - * (Options/Project/Compiler/Preprocessor/Symbols and Macros to Define) - * But there's a (buffer length) limit to how long this list can be, so - * I'm doing the rest here in msdos.h - * WINSOCK, DOS, NEEDPROTOS, NO_USERINTERFACE - */ -/* - * MIT's krb.h doesn't use the symbols provided by Microsoft. - * It needs __MSDOS__ and WINDOWS. Normally _WINDOWS is provided by MS - * but it's based on having the prolog/epilog optimization switches set - * in a way that we don't set them. So define it manually. - * - * kbind.c needs __MSDOS__ for krb.h to include osconf.h - * which includes conf-pc.h which defines byte order and such - */ -#define __MSDOS__ -/* - * conf-pc.h wants WINDOWS rather than _WINDOWS which Microsoft provides - */ -#define WINDOWS - -/* - * Where two of the config files live in the windows environment - * There are two others also; ldfriend.cfg, & srchpref.cfg - * These names are different that the unix names due to 8.3 rule - */ -#define FILTERFILE "ldfilter.cfg" -#define TEMPLATEFILE "disptmpl.cfg" -/* - * These are not automatically defined for us even though we're a DLL. They - * are triggered by prolog/epilog configuration options that we don't use. - * But be careful not to redefine them for other apps that include this file. - */ -#ifndef _WINDLL -/* - * Needed by wshelper.h - */ -#define _WINDLL -#endif - -#ifndef _WINDOWS -/* - * Needed by authlib.h via kerberos.c via AUTHMAN - */ -#define _WINDOWS 1 -#endif - -/* - * KERBEROS must be defined as a preprocessor symbol in the compiler. - * It's too late to define it in this file. - */ - -/* - * AUTHMAN - Use Authlib.dll as a higher level interface to krbv4win.dll - * (kerberos). If defined, get_kerberosv4_credentials in kerberos.c is - * used and authlib.dll (and krbv4win.dll) are dynamically loaded and used. - * If AUTHMAN is not defined, the get_kerberosv4_credentials in - * kbind.c works just fine, but requires the presence of krbv4win.dll at - * load time. - */ -/* don't want to be dependent on authman - * #define AUTHMAN - */ - -/* - * define WSHELPER if you want wsockip.c to use rgethostbyaddr() (in - * WSHELPER.DLL) rather than gethostbyaddr(). You might want this if your - * gethostbyaddr() returns the WRONG host name and you want to use - * kerberos authentication (need host name to form service ticket - * request). Most won't want kerberos, and of those, there might actually - * be some vendors who really do the lookup rather than use cached info - * from gethostbyname() calls. - */ -#define WSHELPER -/* - * The new slapd stuff - */ -#define LDAP_REFERRALS -/* - * LDAP character string translation routines - * I compiled and tested these and they seemed to work. - * The thing to test with is: - * cn=Charset Test Entry, ou=SWITCHdirectory, o=SWITCH, c=CH - * - * I'm disabling it for release. -#define STR_TRANSLATION -#define LDAP_CHARSET_8859 88591 -#define LDAP_DEFAULT_CHARSET LDAP_CHARSET_8859 - */ - - - -#define LDAP_DEBUG -#include - - -#include -#include -#ifndef _WIN32 -#define memcpy( a, b, n ) _fmemcpy( a, b, n ) -#define strcpy( a, b ) _fstrcpy( a, b ) -#define strchr( a, c ) _fstrchr( a, c ) -#endif /* !_WIN32 */ -#define strcasecmp(a,b) stricmp(a,b) -#define strncasecmp(a,b,len) strnicmp(a,b,len) - -#endif /* _MSDOS_H */ - - diff --git a/libraries/msdos/winsock/include/wsa/errno.c b/libraries/msdos/winsock/include/wsa/errno.c deleted file mode 100644 index cb49c5fe62..0000000000 --- a/libraries/msdos/winsock/include/wsa/errno.c +++ /dev/null @@ -1,21 +0,0 @@ -#include - -/* Copies string corresponding to the error code provided */ -/* into buf, maximum length len. Returns length actually */ -/* copied to buffer, or zero if error code is unknown. */ -/* String resources should be present for each error code */ -/* using the value of the code as the string ID (except for */ -/* error = 0, which is mapped to WSABASEERR to keep it with */ -/* the others). The DLL is free to use any string IDs that */ -/* are less than WSABASEERR for its own use. The LibMain */ -/* procedure of the DLL is presumed to have saved its */ -/* HINSTANCE in the global variable hInst. */ - -int PASCAL FAR WSAsperror (int errorcode, char far * buf, int len) -{ - if (errorcode == 0) - errorcode = WSABASEERR; - if (errorcode < WSABASEERR) - return 0; - return LoadString(hInst,errorcode,buf,len); -} diff --git a/libraries/msdos/winsock/include/wsa/errno.rc b/libraries/msdos/winsock/include/wsa/errno.rc deleted file mode 100644 index 1252957877..0000000000 --- a/libraries/msdos/winsock/include/wsa/errno.rc +++ /dev/null @@ -1,57 +0,0 @@ -#include - -STRINGTABLE -BEGIN - WSABASEERR, "[0] No Error" - WSAEINTR, "[10004] Interrupted system call" - WSAEBADF, "[10009] Bad file number" - WSAEACCES, "[10013] Permission denied" - WSAEFAULT, "[10014] Bad address" - WSAEINVAL, "[10022] Invalid argument" - WSAEMFILE, "[10024] Too many open files" - WSAEWOULDBLOCK, "[10035] Operation would block" - WSAEINPROGRESS, "[10036] Operation now in progress" - WSAEALREADY, "[10037] Operation already in progress" - WSAENOTSOCK, "[10038] Socket operation on non-socket" - WSAEDESTADDRREQ, "[10039] Destination address required" - WSAEMSGSIZE, "[10040] Message too long" - WSAEPROTOTYPE, "[10041] Protocol wrong type for socket" - WSAENOPROTOOPT, "[10042] Bad protocol option" - WSAEPROTONOSUPPORT, "[10043] Protocol not supported" - WSAESOCKTNOSUPPORT, "[10044] Socket type not supported" - WSAEOPNOTSUPP, "[10045] Operation not supported on socket" - WSAEPFNOSUPPORT, "[10046] Protocol family not supported" - WSAEAFNOSUPPORT, "[10047] Address family not supported by protocol family" - WSAEADDRINUSE, "[10048] Address already in use" - WSAEADDRNOTAVAIL, "[10049] Can't assign requested address" - WSAENETDOWN, "[10050] Network is down" - WSAENETUNREACH, "[10051] Network is unreachable" - WSAENETRESET, "[10052] Net dropped connection or reset" - WSAECONNABORTED, "[10053] Software caused connection abort" - WSAECONNRESET, "[10054] Connection reset by peer" - WSAENOBUFS, "[10055] No buffer space available" - WSAEISCONN, "[10056] Socket is already connected" - WSAENOTCONN, "[10057] Socket is not connected" - WSAESHUTDOWN, "[10058] Can't send after socket shutdown" - WSAETOOMANYREFS, "[10059] Too many references, can't splice" - WSAETIMEDOUT, "[10060] Connection timed out" - WSAECONNREFUSED, "[10061] Connection refused" - WSAELOOP, "[10062] Too many levels of symbolic links" - WSAENAMETOOLONG, "[10063] File name too long" - WSAEHOSTDOWN, "[10064] Host is down" - WSAEHOSTUNREACH, "[10065] No Route to Host" - WSAENOTEMPTY, "[10066] Directory not empty" - WSAEPROCLIM, "[10067] Too many processes" - WSAEUSERS, "[10068] Too many users" - WSAEDQUOT, "[10069] Disc Quota Exceeded" - WSAESTALE, "[10070] Stale NFS file handle" - WSAEREMOTE, "[10071] Too many levels of remote in path" - WSASYSNOTREADY, "[10091] Network SubSystem is unavailable" - WSAVERNOTSUPPORTED, "[10092] WINSOCK DLL Version out of range" - WSANOTINITIALIZED, "[10093] Successful WSASTARTUP not yet performed" - WSAHOST_NOT_FOUND, "[11001] Host not found" - WSATRY_AGAIN, "[11002] Non-Authoritative Host not found" - WSANO_RECOVERY, "[11003] Non-Recoverable errors: FORMERR, REFUSED, NOTIMP" - WSANO_DATA, "[11004] Valid name, no data record of requested -type" -END diff --git a/libraries/msdos/winsock/include/wsa/winsock.def b/libraries/msdos/winsock/include/wsa/winsock.def deleted file mode 100644 index 0aa0953284..0000000000 --- a/libraries/msdos/winsock/include/wsa/winsock.def +++ /dev/null @@ -1,84 +0,0 @@ -; -; File: winsock.def -; System: MS-Windows 3.x -; Summary: Module definition file for Windows Sockets DLL. -; - -LIBRARY WINSOCK ; Application's module name - -DESCRIPTION 'BSD Socket API for Windows' - -EXETYPE WINDOWS ; required for all windows applications - -STUB 'WINSTUB.EXE' ; generates error message if application - ; is run without Windows - -;CODE can be FIXED in memory because of potential upcalls -CODE PRELOAD FIXED - -;DATA must be SINGLE and at a FIXED location since this is a DLL -DATA PRELOAD FIXED SINGLE - -HEAPSIZE 1024 -STACKSIZE 16384 - -; All functions that will be called by any Windows routine -; must be exported. Any additional exports beyond those defined -; here must have ordinal numbers 1000 or above. - -EXPORTS - accept @1 - bind @2 - closesocket @3 - connect @4 - getpeername @5 - getsockname @6 - getsockopt @7 - htonl @8 - htons @9 - inet_addr @10 - inet_ntoa @11 - ioctlsocket @12 - listen @13 - ntohl @14 - ntohs @15 - recv @16 - recvfrom @17 - select @18 - send @19 - sendto @20 - setsockopt @21 - shutdown @22 - socket @23 - - gethostbyaddr @51 - gethostbyname @52 - getprotobyname @53 - getprotobynumber @54 - getservbyname @55 - getservbyport @56 - gethostname @57 - - WSAAsyncSelect @101 - WSAAsyncGetHostByAddr @102 - WSAAsyncGetHostByName @103 - WSAAsyncGetProtoByNumber @104 - WSAAsyncGetProtoByName @105 - WSAAsyncGetServByPort @106 - WSAAsyncGetServByName @107 - WSACancelAsyncRequest @108 - WSASetBlockingHook @109 - WSAUnhookBlockingHook @110 - WSAGetLastError @111 - WSASetLastError @112 - WSACancelBlockingCall @113 - WSAIsBlocking @114 - WSAStartup @115 - WSACleanup @116 - - __WSAFDIsSet @151 - - WEP @500 RESIDENTNAME - -;eof - diff --git a/libraries/msdos/winsock/include/wsa/winsock.h b/libraries/msdos/winsock/include/wsa/winsock.h deleted file mode 100644 index c73fe4ca16..0000000000 --- a/libraries/msdos/winsock/include/wsa/winsock.h +++ /dev/null @@ -1,906 +0,0 @@ -/* WINSOCK.H--definitions to be used with the WINSOCK.DLL - * - * This header file corresponds to version 1.1 of the Windows Sockets specification. - * - * This file includes parts which are Copyright (c) 1982-1986 Regents - * of the University of California. All rights reserved. The - * Berkeley Software License Agreement specifies the terms and - * conditions for redistribution. - * - * Change log: - * - * Fri Apr 23 16:31:01 1993 Mark Towfiq (towfiq@Microdyne.COM) - * New version from David Treadwell which adds extern "C" around - * __WSAFDIsSet() and removes "const" from buf param of - * WSAAsyncGetHostByAddr(). Added change log. - * - * Sat May 15 10:55:00 1993 David Treadwell (davidtr@microsoft.com) - * Fix the IN_CLASSC macro to account for class-D multicasts. - * Add AF_IPX == AF_NS. - * - */ - -#ifndef _WINSOCKAPI_ -#define _WINSOCKAPI_ - -/* - * Pull in WINDOWS.H if necessary - */ -#ifndef _INC_WINDOWS -#include -#endif /* _INC_WINDOWS */ - -/* - * Basic system type definitions, taken from the BSD file sys/types.h. - */ -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; - -/* - * The new type to be used in all - * instances which refer to sockets. - */ -typedef u_int SOCKET; - -/* - * Select uses arrays of SOCKETs. These macros manipulate such - * arrays. FD_SETSIZE may be defined by the user before including - * this file, but the default here should be >= 64. - * - * CAVEAT IMPLEMENTOR and USER: THESE MACROS AND TYPES MUST BE - * INCLUDED IN WINSOCK.H EXACTLY AS SHOWN HERE. - */ -#ifndef FD_SETSIZE -#define FD_SETSIZE 64 -#endif /* FD_SETSIZE */ - -typedef struct fd_set { - u_int fd_count; /* how many are SET? */ - SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */ -} fd_set; - -#ifdef __cplusplus -extern "C" { -#endif - -extern int PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR *); - -#ifdef __cplusplus -} -#endif - - -#define FD_CLR(fd, set) do { \ - u_int __i; \ - for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \ - if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \ - while (__i < ((fd_set FAR *)(set))->fd_count-1) { \ - ((fd_set FAR *)(set))->fd_array[__i] = \ - ((fd_set FAR *)(set))->fd_array[__i+1]; \ - __i++; \ - } \ - ((fd_set FAR *)(set))->fd_count--; \ - break; \ - } \ - } \ -} while(0) - -#define FD_SET(fd, set) do { \ - if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) \ - ((fd_set FAR *)(set))->fd_array[((fd_set FAR *)(set))->fd_count++]=(fd);\ -} while(0) - -#define FD_ZERO(set) (((fd_set FAR *)(set))->fd_count=0) - -#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set FAR *)(set)) - -/* - * Structure used in select() call, taken from the BSD file sys/time.h. - */ -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; - -/* - * Operations on timevals. - * - * NB: timercmp does not work for >= or <=. - */ -#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -#define timercmp(tvp, uvp, cmp) \ - ((tvp)->tv_sec cmp (uvp)->tv_sec || \ - (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) -#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 - -/* - * Commands for ioctlsocket(), taken from the BSD file fcntl.h. - * - * - * Ioctl's have the command encoded in the lower word, - * and the size of any in or out parameters in the upper - * word. The high 2 bits of the upper word are used - * to encode the in/out status of the parameter; for now - * we restrict parameters to at most 128 bytes. - */ -#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ -#define IOC_VOID 0x20000000 /* no parameters */ -#define IOC_OUT 0x40000000 /* copy out parameters */ -#define IOC_IN 0x80000000 /* copy in parameters */ -#define IOC_INOUT (IOC_IN|IOC_OUT) - /* 0x20000000 distinguishes new & - old ioctl's */ -#define _IO(x,y) (IOC_VOID|((x)<<8)|(y)) - -#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) - -#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) - -#define FIONREAD _IOR('f', 127, u_long) /* get # bytes to read */ -#define FIONBIO _IOW('f', 126, u_long) /* set/clear non-blocking i/o */ -#define FIOASYNC _IOW('f', 125, u_long) /* set/clear async i/o */ - -/* Socket I/O Controls */ -#define SIOCSHIWAT _IOW('s', 0, u_long) /* set high watermark */ -#define SIOCGHIWAT _IOR('s', 1, u_long) /* get high watermark */ -#define SIOCSLOWAT _IOW('s', 2, u_long) /* set low watermark */ -#define SIOCGLOWAT _IOR('s', 3, u_long) /* get low watermark */ -#define SIOCATMARK _IOR('s', 7, u_long) /* at oob mark? */ - -/* - * Structures returned by network data base library, taken from the - * BSD file netdb.h. All addresses are supplied in host order, and - * returned in network order (suitable for use in system calls). - */ - -struct hostent { - char FAR * h_name; /* official name of host */ - char FAR * FAR * h_aliases; /* alias list */ - short h_addrtype; /* host address type */ - short h_length; /* length of address */ - char FAR * FAR * h_addr_list; /* list of addresses */ -#define h_addr h_addr_list[0] /* address, for backward compat */ -}; - -/* - * It is assumed here that a network number - * fits in 32 bits. - */ -struct netent { - char FAR * n_name; /* official name of net */ - char FAR * FAR * n_aliases; /* alias list */ - short n_addrtype; /* net address type */ - u_long n_net; /* network # */ -}; - -struct servent { - char FAR * s_name; /* official service name */ - char FAR * FAR * s_aliases; /* alias list */ - short s_port; /* port # */ - char FAR * s_proto; /* protocol to use */ -}; - -struct protoent { - char FAR * p_name; /* official protocol name */ - char FAR * FAR * p_aliases; /* alias list */ - short p_proto; /* protocol # */ -}; - -/* - * Constants and structures defined by the internet system, - * Per RFC 790, September 1981, taken from the BSD file netinet/in.h. - */ - -/* - * Protocols - */ -#define IPPROTO_IP 0 /* dummy for IP */ -#define IPPROTO_ICMP 1 /* control message protocol */ -#define IPPROTO_GGP 2 /* gateway^2 (deprecated) */ -#define IPPROTO_TCP 6 /* tcp */ -#define IPPROTO_PUP 12 /* pup */ -#define IPPROTO_UDP 17 /* user datagram protocol */ -#define IPPROTO_IDP 22 /* xns idp */ -#define IPPROTO_ND 77 /* UNOFFICIAL net disk proto */ - -#define IPPROTO_RAW 255 /* raw IP packet */ -#define IPPROTO_MAX 256 - -/* - * Port/socket numbers: network standard functions - */ -#define IPPORT_ECHO 7 -#define IPPORT_DISCARD 9 -#define IPPORT_SYSTAT 11 -#define IPPORT_DAYTIME 13 -#define IPPORT_NETSTAT 15 -#define IPPORT_FTP 21 -#define IPPORT_TELNET 23 -#define IPPORT_SMTP 25 -#define IPPORT_TIMESERVER 37 -#define IPPORT_NAMESERVER 42 -#define IPPORT_WHOIS 43 -#define IPPORT_MTP 57 - -/* - * Port/socket numbers: host specific functions - */ -#define IPPORT_TFTP 69 -#define IPPORT_RJE 77 -#define IPPORT_FINGER 79 -#define IPPORT_TTYLINK 87 -#define IPPORT_SUPDUP 95 - -/* - * UNIX TCP sockets - */ -#define IPPORT_EXECSERVER 512 -#define IPPORT_LOGINSERVER 513 -#define IPPORT_CMDSERVER 514 -#define IPPORT_EFSSERVER 520 - -/* - * UNIX UDP sockets - */ -#define IPPORT_BIFFUDP 512 -#define IPPORT_WHOSERVER 513 -#define IPPORT_ROUTESERVER 520 - /* 520+1 also used */ - -/* - * Ports < IPPORT_RESERVED are reserved for - * privileged processes (e.g. root). - */ -#define IPPORT_RESERVED 1024 - -/* - * Link numbers - */ -#define IMPLINK_IP 155 -#define IMPLINK_LOWEXPER 156 -#define IMPLINK_HIGHEXPER 158 - -/* - * Internet address (old style... should be updated) - */ -struct in_addr { - union { - struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; - struct { u_short s_w1,s_w2; } S_un_w; - u_long S_addr; - } S_un; -#define s_addr S_un.S_addr - /* can be used for most tcp & ip code */ -#define s_host S_un.S_un_b.s_b2 - /* host on imp */ -#define s_net S_un.S_un_b.s_b1 - /* network */ -#define s_imp S_un.S_un_w.s_w2 - /* imp */ -#define s_impno S_un.S_un_b.s_b4 - /* imp # */ -#define s_lh S_un.S_un_b.s_b3 - /* logical host */ -}; - -/* - * Definitions of bits in internet address integers. - * On subnets, the decomposition of addresses to host and net parts - * is done according to subnet mask, not the masks here. - */ -#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0) -#define IN_CLASSA_NET 0xff000000 -#define IN_CLASSA_NSHIFT 24 -#define IN_CLASSA_HOST 0x00ffffff -#define IN_CLASSA_MAX 128 - -#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000) -#define IN_CLASSB_NET 0xffff0000 -#define IN_CLASSB_NSHIFT 16 -#define IN_CLASSB_HOST 0x0000ffff -#define IN_CLASSB_MAX 65536 - -#define IN_CLASSC(i) (((long)(i) & 0xe0000000) == 0xc0000000) -#define IN_CLASSC_NET 0xffffff00 -#define IN_CLASSC_NSHIFT 8 -#define IN_CLASSC_HOST 0x000000ff - -#define INADDR_ANY (u_long)0x00000000 -#define INADDR_LOOPBACK 0x7f000001 -#define INADDR_BROADCAST (u_long)0xffffffff -#define INADDR_NONE 0xffffffff - -/* - * Socket address, internet style. - */ -struct sockaddr_in { - short sin_family; - u_short sin_port; - struct in_addr sin_addr; - char sin_zero[8]; -}; - -#define WSADESCRIPTION_LEN 256 -#define WSASYS_STATUS_LEN 128 - -typedef struct WSAData { - WORD wVersion; - WORD wHighVersion; - char szDescription[WSADESCRIPTION_LEN+1]; - char szSystemStatus[WSASYS_STATUS_LEN+1]; - unsigned short iMaxSockets; - unsigned short iMaxUdpDg; - char FAR * lpVendorInfo; -} WSADATA; - -typedef WSADATA FAR *LPWSADATA; - -/* - * Options for use with [gs]etsockopt at the IP level. - */ -#define IP_OPTIONS 1 /* set/get IP per-packet options */ -#define IP_MULTICAST_IF 2 /* set/get IP multicast interface */ -#define IP_MULTICAST_TTL 3 /* set/get IP multicast timetolive */ -#define IP_MULTICAST_LOOP 4 /* set/get IP multicast loopback */ -#define IP_ADD_MEMBERSHIP 5 /* add an IP group membership */ -#define IP_DROP_MEMBERSHIP 6 /* drop an IP group membership */ - -#define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ -#define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ -#define IP_MAX_MEMBERSHIPS 20 /* per socket; must fit in one mbuf */ - -/* - * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. - */ -struct ip_mreq { - struct in_addr imr_multiaddr; /* IP multicast address of group */ - struct in_addr imr_interface; /* local IP address of interface */ -}; - -/* - * Definitions related to sockets: types, address families, options, - * taken from the BSD file sys/socket.h. - */ - -/* - * This is used instead of -1, since the - * SOCKET type is unsigned. - */ -#define INVALID_SOCKET (SOCKET)(~0) -#define SOCKET_ERROR (-1) - -/* - * Types - */ -#define SOCK_STREAM 1 /* stream socket */ -#define SOCK_DGRAM 2 /* datagram socket */ -#define SOCK_RAW 3 /* raw-protocol interface */ -#define SOCK_RDM 4 /* reliably-delivered message */ -#define SOCK_SEQPACKET 5 /* sequenced packet stream */ - -/* - * Option flags per-socket. - */ -#define SO_DEBUG 0x0001 /* turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_REUSEADDR 0x0004 /* allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_DONTROUTE 0x0010 /* just use interface addresses */ -#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ -#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ - -#define SO_DONTLINGER (u_int)(~SO_LINGER) - -/* - * Additional options. - */ -#define SO_SNDBUF 0x1001 /* send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ -#define SO_SNDLOWAT 0x1003 /* send low-water mark */ -#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ -#define SO_SNDTIMEO 0x1005 /* send timeout */ -#define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ - -/* - * Options for connect and disconnect data and options. Used only by - * non-TCP/IP transports such as DECNet, OSI TP4, etc. - */ -#define SO_CONNDATA 0x7000 -#define SO_CONNOPT 0x7001 -#define SO_DISCDATA 0x7002 -#define SO_DISCOPT 0x7003 -#define SO_CONNDATALEN 0x7004 -#define SO_CONNOPTLEN 0x7005 -#define SO_DISCDATALEN 0x7006 -#define SO_DISCOPTLEN 0x7007 - -/* - * Option for opening sockets for synchronous access. - */ -#define SO_OPENTYPE 0x7008 - -#define SO_SYNCHRONOUS_ALERT 0x10 -#define SO_SYNCHRONOUS_NONALERT 0x20 - -/* - * Other NT-specific options. - */ -#define SO_MAXDG 0x7009 -#define SO_MAXPATHDG 0x700A - -/* - * TCP options. - */ -#define TCP_NODELAY 0x0001 -#define TCP_BSDURGENT 0x7000 - -/* - * Address families. - */ -#define AF_UNSPEC 0 /* unspecified */ -#define AF_UNIX 1 /* local to host (pipes, portals) */ -#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ -#define AF_IMPLINK 3 /* arpanet imp addresses */ -#define AF_PUP 4 /* pup protocols: e.g. BSP */ -#define AF_CHAOS 5 /* mit CHAOS protocols */ -#define AF_IPX 6 /* IPX and SPX */ -#define AF_NS 6 /* XEROX NS protocols */ -#define AF_ISO 7 /* ISO protocols */ -#define AF_OSI AF_ISO /* OSI is ISO */ -#define AF_ECMA 8 /* european computer manufacturers */ -#define AF_DATAKIT 9 /* datakit protocols */ -#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ -#define AF_SNA 11 /* IBM SNA */ -#define AF_DECnet 12 /* DECnet */ -#define AF_DLI 13 /* Direct data link interface */ -#define AF_LAT 14 /* LAT */ -#define AF_HYLINK 15 /* NSC Hyperchannel */ -#define AF_APPLETALK 16 /* AppleTalk */ -#define AF_NETBIOS 17 /* NetBios-style addresses */ - -#define AF_MAX 18 - -/* - * Structure used by kernel to store most - * addresses. - */ -struct sockaddr { - u_short sa_family; /* address family */ - char sa_data[14]; /* up to 14 bytes of direct address */ -}; - -/* - * Structure used by kernel to pass protocol - * information in raw sockets. - */ -struct sockproto { - u_short sp_family; /* address family */ - u_short sp_protocol; /* protocol */ -}; - -/* - * Protocol families, same as address families for now. - */ -#define PF_UNSPEC AF_UNSPEC -#define PF_UNIX AF_UNIX -#define PF_INET AF_INET -#define PF_IMPLINK AF_IMPLINK -#define PF_PUP AF_PUP -#define PF_CHAOS AF_CHAOS -#define PF_NS AF_NS -#define PF_IPX AF_IPX -#define PF_ISO AF_ISO -#define PF_OSI AF_OSI -#define PF_ECMA AF_ECMA -#define PF_DATAKIT AF_DATAKIT -#define PF_CCITT AF_CCITT -#define PF_SNA AF_SNA -#define PF_DECnet AF_DECnet -#define PF_DLI AF_DLI -#define PF_LAT AF_LAT -#define PF_HYLINK AF_HYLINK -#define PF_APPLETALK AF_APPLETALK - -#define PF_MAX AF_MAX - -/* - * Structure used for manipulating linger option. - */ -struct linger { - u_short l_onoff; /* option on/off */ - u_short l_linger; /* linger time */ -}; - -/* - * Level number for (get/set)sockopt() to apply to socket itself. - */ -#define SOL_SOCKET 0xffff /* options for socket level */ - -/* - * Maximum queue length specifiable by listen. - */ -#define SOMAXCONN 5 - -#define MSG_OOB 0x1 /* process out-of-band data */ -#define MSG_PEEK 0x2 /* peek at incoming message */ -#define MSG_DONTROUTE 0x4 /* send without using routing tables */ - -#define MSG_MAXIOVLEN 16 - -#define MSG_PARTIAL 0x8000 /* partial send or recv for message xport */ - -/* - * Define constant based on rfc883, used by gethostbyxxxx() calls. - */ -#define MAXGETHOSTSTRUCT 1024 - -/* - * Define flags to be used with the WSAAsyncSelect() call. - */ -#define FD_READ 0x01 -#define FD_WRITE 0x02 -#define FD_OOB 0x04 -#define FD_ACCEPT 0x08 -#define FD_CONNECT 0x10 -#define FD_CLOSE 0x20 - -/* - * All Windows Sockets error constants are biased by WSABASEERR from - * the "normal" - */ -#define WSABASEERR 10000 -/* - * Windows Sockets definitions of regular Microsoft C error constants - */ -#define WSAEINTR (WSABASEERR+4) -#define WSAEBADF (WSABASEERR+9) -#define WSAEACCES (WSABASEERR+13) -#define WSAEFAULT (WSABASEERR+14) -#define WSAEINVAL (WSABASEERR+22) -#define WSAEMFILE (WSABASEERR+24) - -/* - * Windows Sockets definitions of regular Berkeley error constants - */ -#define WSAEWOULDBLOCK (WSABASEERR+35) -#define WSAEINPROGRESS (WSABASEERR+36) -#define WSAEALREADY (WSABASEERR+37) -#define WSAENOTSOCK (WSABASEERR+38) -#define WSAEDESTADDRREQ (WSABASEERR+39) -#define WSAEMSGSIZE (WSABASEERR+40) -#define WSAEPROTOTYPE (WSABASEERR+41) -#define WSAENOPROTOOPT (WSABASEERR+42) -#define WSAEPROTONOSUPPORT (WSABASEERR+43) -#define WSAESOCKTNOSUPPORT (WSABASEERR+44) -#define WSAEOPNOTSUPP (WSABASEERR+45) -#define WSAEPFNOSUPPORT (WSABASEERR+46) -#define WSAEAFNOSUPPORT (WSABASEERR+47) -#define WSAEADDRINUSE (WSABASEERR+48) -#define WSAEADDRNOTAVAIL (WSABASEERR+49) -#define WSAENETDOWN (WSABASEERR+50) -#define WSAENETUNREACH (WSABASEERR+51) -#define WSAENETRESET (WSABASEERR+52) -#define WSAECONNABORTED (WSABASEERR+53) -#define WSAECONNRESET (WSABASEERR+54) -#define WSAENOBUFS (WSABASEERR+55) -#define WSAEISCONN (WSABASEERR+56) -#define WSAENOTCONN (WSABASEERR+57) -#define WSAESHUTDOWN (WSABASEERR+58) -#define WSAETOOMANYREFS (WSABASEERR+59) -#define WSAETIMEDOUT (WSABASEERR+60) -#define WSAECONNREFUSED (WSABASEERR+61) -#define WSAELOOP (WSABASEERR+62) -#define WSAENAMETOOLONG (WSABASEERR+63) -#define WSAEHOSTDOWN (WSABASEERR+64) -#define WSAEHOSTUNREACH (WSABASEERR+65) -#define WSAENOTEMPTY (WSABASEERR+66) -#define WSAEPROCLIM (WSABASEERR+67) -#define WSAEUSERS (WSABASEERR+68) -#define WSAEDQUOT (WSABASEERR+69) -#define WSAESTALE (WSABASEERR+70) -#define WSAEREMOTE (WSABASEERR+71) - -#define WSAEDISCON (WSABASEERR+101) - -/* - * Extended Windows Sockets error constant definitions - */ -#define WSASYSNOTREADY (WSABASEERR+91) -#define WSAVERNOTSUPPORTED (WSABASEERR+92) -#define WSANOTINITIALISED (WSABASEERR+93) - -/* - * Error return codes from gethostbyname() and gethostbyaddr() - * (when using the resolver). Note that these errors are - * retrieved via WSAGetLastError() and must therefore follow - * the rules for avoiding clashes with error numbers from - * specific implementations or language run-time systems. - * For this reason the codes are based at WSABASEERR+1001. - * Note also that [WSA]NO_ADDRESS is defined only for - * compatibility purposes. - */ - -#define h_errno WSAGetLastError() - -/* Authoritative Answer: Host not found */ -#define WSAHOST_NOT_FOUND (WSABASEERR+1001) -#define HOST_NOT_FOUND WSAHOST_NOT_FOUND - -/* Non-Authoritative: Host not found, or SERVERFAIL */ -#define WSATRY_AGAIN (WSABASEERR+1002) -#define TRY_AGAIN WSATRY_AGAIN - -/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ -#define WSANO_RECOVERY (WSABASEERR+1003) -#define NO_RECOVERY WSANO_RECOVERY - -/* Valid name, no data record of requested type */ -#define WSANO_DATA (WSABASEERR+1004) -#define NO_DATA WSANO_DATA - -/* no address, look for MX record */ -#define WSANO_ADDRESS WSANO_DATA -#define NO_ADDRESS WSANO_ADDRESS - -/* - * Windows Sockets errors redefined as regular Berkeley error constants. - * These are commented out in Windows NT to avoid conflicts with errno.h. - * Use the WSA constants instead. - */ -#if 0 -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEINPROGRESS -#define EALREADY WSAEALREADY -#define ENOTSOCK WSAENOTSOCK -#define EDESTADDRREQ WSAEDESTADDRREQ -#define EMSGSIZE WSAEMSGSIZE -#define EPROTOTYPE WSAEPROTOTYPE -#define ENOPROTOOPT WSAENOPROTOOPT -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -#define EOPNOTSUPP WSAEOPNOTSUPP -#define EPFNOSUPPORT WSAEPFNOSUPPORT -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#define EADDRINUSE WSAEADDRINUSE -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#define ENETDOWN WSAENETDOWN -#define ENETUNREACH WSAENETUNREACH -#define ENETRESET WSAENETRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNRESET WSAECONNRESET -#define ENOBUFS WSAENOBUFS -#define EISCONN WSAEISCONN -#define ENOTCONN WSAENOTCONN -#define ESHUTDOWN WSAESHUTDOWN -#define ETOOMANYREFS WSAETOOMANYREFS -#define ETIMEDOUT WSAETIMEDOUT -#define ECONNREFUSED WSAECONNREFUSED -#define ELOOP WSAELOOP -#define ENAMETOOLONG WSAENAMETOOLONG -#define EHOSTDOWN WSAEHOSTDOWN -#define EHOSTUNREACH WSAEHOSTUNREACH -#define ENOTEMPTY WSAENOTEMPTY -#define EPROCLIM WSAEPROCLIM -#define EUSERS WSAEUSERS -#define EDQUOT WSAEDQUOT -#define ESTALE WSAESTALE -#define EREMOTE WSAEREMOTE -#endif - -/* Socket function prototypes */ - -#ifdef __cplusplus -extern "C" { -#endif - -SOCKET PASCAL FAR accept (SOCKET s, struct sockaddr FAR *addr, - int FAR *addrlen); - -int PASCAL FAR bind (SOCKET s, const struct sockaddr FAR *addr, int namelen); - -int PASCAL FAR closesocket (SOCKET s); - -int PASCAL FAR connect (SOCKET s, const struct sockaddr FAR *name, int namelen); - -int PASCAL FAR ioctlsocket (SOCKET s, long cmd, u_long FAR *argp); - -int PASCAL FAR getpeername (SOCKET s, struct sockaddr FAR *name, - int FAR * namelen); - -int PASCAL FAR getsockname (SOCKET s, struct sockaddr FAR *name, - int FAR * namelen); - -int PASCAL FAR getsockopt (SOCKET s, int level, int optname, - char FAR * optval, int FAR *optlen); - -u_long PASCAL FAR htonl (u_long hostlong); - -u_short PASCAL FAR htons (u_short hostshort); - -unsigned long PASCAL FAR inet_addr (const char FAR * cp); - -char FAR * PASCAL FAR inet_ntoa (struct in_addr in); - -int PASCAL FAR listen (SOCKET s, int backlog); - -u_long PASCAL FAR ntohl (u_long netlong); - -u_short PASCAL FAR ntohs (u_short netshort); - -int PASCAL FAR recv (SOCKET s, char FAR * buf, int len, int flags); - -int PASCAL FAR recvfrom (SOCKET s, char FAR * buf, int len, int flags, - struct sockaddr FAR *from, int FAR * fromlen); - -int PASCAL FAR select (int nfds, fd_set FAR *readfds, fd_set FAR *writefds, - fd_set FAR *exceptfds, const struct timeval FAR *timeout); - -int PASCAL FAR send (SOCKET s, const char FAR * buf, int len, int flags); - -int PASCAL FAR sendto (SOCKET s, const char FAR * buf, int len, int flags, - const struct sockaddr FAR *to, int tolen); - -int PASCAL FAR setsockopt (SOCKET s, int level, int optname, - const char FAR * optval, int optlen); - -int PASCAL FAR shutdown (SOCKET s, int how); - -SOCKET PASCAL FAR socket (int af, int type, int protocol); - -/* Database function prototypes */ - -struct hostent FAR * PASCAL FAR gethostbyaddr(const char FAR * addr, - int len, int type); - -struct hostent FAR * PASCAL FAR gethostbyname(const char FAR * name); - -int PASCAL FAR gethostname (char FAR * name, int namelen); - -struct servent FAR * PASCAL FAR getservbyport(int port, const char FAR * proto); - -struct servent FAR * PASCAL FAR getservbyname(const char FAR * name, - const char FAR * proto); - -struct protoent FAR * PASCAL FAR getprotobynumber(int proto); - -struct protoent FAR * PASCAL FAR getprotobyname(const char FAR * name); - -/* Microsoft Windows Extension function prototypes */ - -int PASCAL FAR WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData); - -int PASCAL FAR WSACleanup(void); - -void PASCAL FAR WSASetLastError(int iError); - -int PASCAL FAR WSAGetLastError(void); - -BOOL PASCAL FAR WSAIsBlocking(void); - -int PASCAL FAR WSAUnhookBlockingHook(void); - -FARPROC PASCAL FAR WSASetBlockingHook(FARPROC lpBlockFunc); - -int PASCAL FAR WSACancelBlockingCall(void); - -HANDLE PASCAL FAR WSAAsyncGetServByName(HWND hWnd, u_int wMsg, - const char FAR * name, - const char FAR * proto, - char FAR * buf, int buflen); - -HANDLE PASCAL FAR WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, int port, - const char FAR * proto, char FAR * buf, - int buflen); - -HANDLE PASCAL FAR WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg, - const char FAR * name, char FAR * buf, - int buflen); - -HANDLE PASCAL FAR WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg, - int number, char FAR * buf, - int buflen); - -HANDLE PASCAL FAR WSAAsyncGetHostByName(HWND hWnd, u_int wMsg, - const char FAR * name, char FAR * buf, - int buflen); - -HANDLE PASCAL FAR WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg, - const char FAR * addr, int len, int type, - char FAR * buf, int buflen); - -int PASCAL FAR WSACancelAsyncRequest(HANDLE hAsyncTaskHandle); - -int PASCAL FAR WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, - long lEvent); - -int PASCAL FAR WSARecvEx (SOCKET s, char FAR * buf, int len, int FAR *flags); - -#ifdef __cplusplus -} -#endif - -/* Microsoft Windows Extended data types */ -typedef struct sockaddr SOCKADDR; -typedef struct sockaddr *PSOCKADDR; -typedef struct sockaddr FAR *LPSOCKADDR; - -typedef struct sockaddr_in SOCKADDR_IN; -typedef struct sockaddr_in *PSOCKADDR_IN; -typedef struct sockaddr_in FAR *LPSOCKADDR_IN; - -typedef struct linger LINGER; -typedef struct linger *PLINGER; -typedef struct linger FAR *LPLINGER; - -typedef struct in_addr IN_ADDR; -typedef struct in_addr *PIN_ADDR; -typedef struct in_addr FAR *LPIN_ADDR; - -typedef struct fd_set FD_SET; -typedef struct fd_set *PFD_SET; -typedef struct fd_set FAR *LPFD_SET; - -typedef struct hostent HOSTENT; -typedef struct hostent *PHOSTENT; -typedef struct hostent FAR *LPHOSTENT; - -typedef struct servent SERVENT; -typedef struct servent *PSERVENT; -typedef struct servent FAR *LPSERVENT; - -typedef struct protoent PROTOENT; -typedef struct protoent *PPROTOENT; -typedef struct protoent FAR *LPPROTOENT; - -typedef struct timeval TIMEVAL; -typedef struct timeval *PTIMEVAL; -typedef struct timeval FAR *LPTIMEVAL; - -/* - * Windows message parameter composition and decomposition - * macros. - * - * WSAMAKEASYNCREPLY is intended for use by the Windows Sockets implementation - * when constructing the response to a WSAAsyncGetXByY() routine. - */ -#define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error) -/* - * WSAMAKESELECTREPLY is intended for use by the Windows Sockets implementation - * when constructing the response to WSAAsyncSelect(). - */ -#define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error) -/* - * WSAGETASYNCBUFLEN is intended for use by the Windows Sockets application - * to extract the buffer length from the lParam in the response - * to a WSAGetXByY(). - */ -#define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam) -/* - * WSAGETASYNCERROR is intended for use by the Windows Sockets application - * to extract the error code from the lParam in the response - * to a WSAGetXByY(). - */ -#define WSAGETASYNCERROR(lParam) HIWORD(lParam) -/* - * WSAGETSELECTEVENT is intended for use by the Windows Sockets application - * to extract the event code from the lParam in the response - * to a WSAAsyncSelect(). - */ -#define WSAGETSELECTEVENT(lParam) LOWORD(lParam) -/* - * WSAGETSELECTERROR is intended for use by the Windows Sockets application - * to extract the error code from the lParam in the response - * to a WSAAsyncSelect(). - */ -#define WSAGETSELECTERROR(lParam) HIWORD(lParam) - -#endif /* _WINSOCKAPI_ */ - - - \ No newline at end of file diff --git a/libraries/msdos/winsock/ltest/console.c b/libraries/msdos/winsock/ltest/console.c deleted file mode 100644 index 2cacc0d325..0000000000 --- a/libraries/msdos/winsock/ltest/console.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * console.c -- simple windows console emulator for Winsock testing - * 27 June 1993 by Mark C Smith - */ -#include -#include -#include -#include "console.h" - -static char *argv[] = { "console", "rearwindow", 0 }; /* */ -char szAppName[20]; -char szLineBuf[512]; -HWND hInst; -HWND hWndMain, hWndOutputEdit; -HANDLE hAccel; - -int reg_classes( void ); -void unreg_classes( void ); - - - -int PASCAL -WinMain( HANDLE hInstance, HANDLE hPrevInst, LPSTR lpszCmdLine, int nCmdShow) -{ - MSG msg; - int rc; - - strcpy( szAppName, "console"); - - hInst = hInstance; - if ( !hPrevInst ) { - if (( rc = reg_classes()) != 0 ) { - MessageBox(0, "Couldn't register window classes", NULL, MB_ICONEXCLAMATION); - return( rc ); - } - } - - hWndMain = CreateWindow( - szAppName, /* Window class name */ - "Console", /* Window's title */ - WS_CAPTION | /* Title and Min/Max */ - WS_SYSMENU | /* Add system menu box */ - WS_MINIMIZEBOX | /* Add minimize box */ - WS_MAXIMIZEBOX | /* Add maximize box */ - WS_THICKFRAME | /* thick sizeable frame */ - WS_CLIPCHILDREN | /* don't draw in child windows areas */ - WS_OVERLAPPED, - CW_USEDEFAULT, 0, /* Use default X, Y */ - CW_USEDEFAULT, 0, /* Use default X, Y */ - 0, /* Parent window's handle */ - 0, /* Default to Class Menu */ - hInst, /* Instance of window */ - NULL ); /* Create struct for WM_CREATE */ - - if( !hWndMain ) { - MessageBox( 0, "Couldn't create main window", NULL, MB_ICONEXCLAMATION); - return( -1 ); - } - - ShowWindow( hWndMain, nCmdShow ); - - hAccel = LoadAccelerators( hInst, szAppName ); - - if (( hWndOutputEdit = new_editwindow( hWndMain, "console output" )) == NULL ) { - MessageBox( 0, "Couldn't create output window", NULL, MB_ICONEXCLAMATION); - return( -1 ); - } - - while( GetMessage( &msg, 0, 0, 0 )) { - if( TranslateAccelerator( hWndMain, hAccel, &msg )) { - continue; - } - - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - unreg_classes(); - return( msg.wParam ); -} - -LONG FAR PASCAL -WndProc( HWND hWnd, WORD msg, WORD wParam, LONG lParam ) -{ - HDC hDC; - PAINTSTRUCT ps; - - switch( msg ) { - case WM_COMMAND: - switch( wParam ) { - case IDM_F_OPENLDAP: - ldapmain( 2, argv ); - break; - - case IDM_F_EXIT: - PostQuitMessage( 0 ); - break; - - default: - return( DefWindowProc( hWnd, msg, wParam, lParam )); - } - - case WM_CREATE: - break; - - case WM_MOVE: - break; - - case WM_SIZE: - break; - - case WM_PAINT: - memset( &ps, 0x00, sizeof( PAINTSTRUCT )); - hDC = BeginPaint( hWnd, &ps ); - SetBkMode(hDC, TRANSPARENT); - - EndPaint(hWnd, &ps); - break; - - case WM_CLOSE: - DestroyWindow(hWnd); - if ( hWnd == hWndMain ) { - PostQuitMessage( 0 ); - } - break; - - default: - return( DefWindowProc( hWnd, msg, wParam, lParam )); - } - - return( 0L ); -} - -int -reg_classes( void ) -{ - WNDCLASS wndclass; - memset( &wndclass, 0x00, sizeof( WNDCLASS )); - - - wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNWINDOW; - wndclass.lpfnWndProc = WndProc; - wndclass.cbClsExtra = 0; - wndclass.cbWndExtra = 0; - wndclass.hInstance = hInst; - wndclass.hIcon = LoadIcon(hInst, "CONSOLE"); - wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); - wndclass.hbrBackground = (HBRUSH)( COLOR_WINDOW+1 ); - wndclass.lpszMenuName = szAppName; /* Menu Name is App Name */ - wndclass.lpszClassName = szAppName; /* Class Name is App Name */ - if( !RegisterClass( &wndclass )) { - return( -1 ); - } - - return( 0 ); -} - -void -unreg_classes( void ) -{ - UnregisterClass( szAppName, hInst ); -} - - -char * -getline( char *line, int len, FILE *s, char *prompt ) -{ - FARPROC lpfnDlgProc; - int nRc; - - printf( prompt ); - - lpfnDlgProc = MakeProcInstance((FARPROC)GetLineDlgProc, hInst); - nRc = DialogBox(hInst, MAKEINTRESOURCE(200), hWndMain, lpfnDlgProc); - FreeProcInstance(lpfnDlgProc); - if ( !nRc ) { - return( NULL ); - } - strncpy( line, szLineBuf, len ); - printf( "%s\n", line ); - return( line ); -} - - - -void -perror( char *msg ) -{ - printf( "%s: error %d\n", msg, WSAGetLastError()); -} - -void -appexit( int rc ) -{ - printf( "exit( %d )\n", rc ); -} - -int -fprintf( FILE *f, char *fmt, void *a1, void *a2, void *a3, void *a4, - void *a5 ) -{ - printf( fmt, a1, a2, a3, a4, a5 ); -} - -int -printf( char *fmt, void *a1, void *a2, void *a3, void *a4, void *a5 ) -{ - char *p, *send, buf[ 1024 ], *crlf = "\r\n"; - - sprintf( buf, fmt, a1, a2, a3, a4, a5 ); - - send = buf; - for ( p = buf; *p != '\0'; ++p ) { - if ( *p == '\n' ) { - *p = '\0'; - SendMessage( hWndOutputEdit, EM_REPLACESEL, 0, (long)send ); - SendMessage( hWndOutputEdit, EM_REPLACESEL, 0, (long)crlf ); - send = p + 1; - } - } - - if ( p > send ) { - SendMessage( hWndOutputEdit, EM_REPLACESEL, 0, (long)send ); - } -} - -BOOL FAR PASCAL -GetLineDlgProc(HWND hWndDlg, WORD Message, WORD wParam, LONG lParam) -{ - switch(Message) { - case WM_INITDIALOG: - /* cwCenter(hWndDlg, 0); */ - break; - - case WM_CLOSE: - /* Closing the Dialog behaves the same as Cancel */ - PostMessage(hWndDlg, WM_COMMAND, IDCANCEL, 0L); - break; - - case WM_COMMAND: - switch(wParam) { - case IDOK: - SendDlgItemMessage( hWndDlg, DLG_GETLINE_TEXT, WM_GETTEXT, sizeof( szLineBuf), - (long)szLineBuf ); - EndDialog(hWndDlg, TRUE); - break; - case IDCANCEL: - EndDialog(hWndDlg, FALSE); - break; - } - break; - - default: - return FALSE; - } - return TRUE; -} diff --git a/libraries/msdos/winsock/ltest/console.h b/libraries/msdos/winsock/ltest/console.h deleted file mode 100644 index 03f48bf082..0000000000 --- a/libraries/msdos/winsock/ltest/console.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * console.h -- defines for a simple windows console emulator - * 27 June 1993 by Mark C Smith - */ - -#define IDM_FILE 1000 -#define IDM_F_OPENLDAP 1050 -#define IDM_F_EXIT 1100 -#define DLG_GETLINE_TEXT 102 - -#define exit( e ) appexit( e ); return( e ) - -void perror( char *msg ); -int printf( char *fmt, ... ); -int fprintf( FILE *f, char *fmt, ... ); -void appexit( int rc ); -char *getline( char *line, int len, FILE *s, char *prompt ); -LONG FAR PASCAL WndProc( HWND, WORD, WORD, LONG ); -BOOL FAR PASCAL GetLineDlgProc(HWND hWndDlg, WORD Message, WORD wParam, LONG lParam); diff --git a/libraries/msdos/winsock/ltest/inpdlg.dlg b/libraries/msdos/winsock/ltest/inpdlg.dlg deleted file mode 100644 index de0c641d44..0000000000 --- a/libraries/msdos/winsock/ltest/inpdlg.dlg +++ /dev/null @@ -1,14 +0,0 @@ -DLGINCLUDE RCDATA DISCARDABLE -BEGIN - "INPDLG.H\0" -END - -200 DIALOG 14, 28, 313, 34 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Getline" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Input:", 101, 2, 3, 20, 8 - EDITTEXT DLG_GETLINE_TEXT, 25, 2, 245, 26, ES_AUTOHSCROLL - PUSHBUTTON "Enter", IDOK, 275, 6, 33, 14 -END diff --git a/libraries/msdos/winsock/ltest/inpdlg.h b/libraries/msdos/winsock/ltest/inpdlg.h deleted file mode 100644 index 2838cc5bd5..0000000000 --- a/libraries/msdos/winsock/ltest/inpdlg.h +++ /dev/null @@ -1 +0,0 @@ -#define DLG_GETLINE_TEXT 102 diff --git a/libraries/msdos/winsock/ltest/ltest.def b/libraries/msdos/winsock/ltest/ltest.def deleted file mode 100644 index 27416cd32a..0000000000 --- a/libraries/msdos/winsock/ltest/ltest.def +++ /dev/null @@ -1,9 +0,0 @@ -NAME CONSOLE -EXETYPE WINDOWS -STUB 'C:\windows\WINSTUB.EXE' -CODE PRELOAD MOVEABLE -DATA PRELOAD MOVEABLE MULTIPLE -HEAPSIZE 32768 -EXPORTS WndProc @1 - TEditWndProc @2 - GetLineDlgProc @3 diff --git a/libraries/msdos/winsock/ltest/ltest.mak b/libraries/msdos/winsock/ltest/ltest.mak deleted file mode 100644 index df5e9a6d92..0000000000 --- a/libraries/msdos/winsock/ltest/ltest.mak +++ /dev/null @@ -1,140 +0,0 @@ -# Microsoft Visual C++ generated build script - Do not modify - -PROJ = LTEST -DEBUG = 1 -PROGTYPE = 0 -CALLER = -ARGS = -DLLS = -D_RCDEFINES = -d_DEBUG -R_RCDEFINES = -dNDEBUG -ORIGIN = MSVC -ORIGIN_VER = 1.00 -PROJPATH = E:\SRC\LDAP-3.3B1\LIBRAR~1\MSDOS\WINSOCK\LTEST\ -USEMFC = 0 -CC = cl -CPP = cl -CXX = cl -CCREATEPCHFLAG = -CPPCREATEPCHFLAG = -CUSEPCHFLAG = -CPPUSEPCHFLAG = -FIRSTC = CONSOLE.C -FIRSTCPP = -RC = rc -CFLAGS_D_WEXE = /nologo /G2 /W3 /Gf /Zi /AL /Od /D "_DEBUG" /D "DOS" /D "NEEDPROTOS" /D "WINSOCK" /I "..\h" /I "..\winsock" /FR /GA /Fd"LIBLDAP.PDB" -CFLAGS_R_WEXE = /nologo /W3 /AM /O1 /D "NDEBUG" /D "DOS" /D "NEEDPROTOS" /D "WINSOCK" /I "..\winsock" /FR /GA -LFLAGS_D_WEXE = /NOLOGO /NOD /PACKC:61440 /STACK:10240 /ALIGN:16 /ONERROR:NOEXE /CO -LFLAGS_R_WEXE = /NOLOGO /NOD /PACKC:61440 /STACK:10240 /ALIGN:16 /ONERROR:NOEXE -LIBS_D_WEXE = oldnames libw llibcew commdlg.lib olecli.lib olesvr.lib shell.lib -LIBS_R_WEXE = oldnames libw mlibcew commdlg.lib olecli.lib olesvr.lib shell.lib -RCFLAGS = /nologo -RESFLAGS = /nologo -RUNFLAGS = -DEFFILE = LTEST.DEF -OBJS_EXT = -LIBS_EXT = ..\..\..\LIBLDAP\LIBLDAP.LIB ..\..\..\LIBLDAP\WINSOCK.LIB -!if "$(DEBUG)" == "1" -CFLAGS = $(CFLAGS_D_WEXE) -LFLAGS = $(LFLAGS_D_WEXE) -LIBS = $(LIBS_D_WEXE) -MAPFILE = nul -RCDEFINES = $(D_RCDEFINES) -!else -CFLAGS = $(CFLAGS_R_WEXE) -LFLAGS = $(LFLAGS_R_WEXE) -LIBS = $(LIBS_R_WEXE) -MAPFILE = nul -RCDEFINES = $(R_RCDEFINES) -!endif -!if [if exist MSVC.BND del MSVC.BND] -!endif -SBRS = CONSOLE.SBR \ - TEXTWIND.SBR \ - GETOPT.SBR \ - TEST.SBR - - -LIBLDAP_DEP = - -WINSOCK_DEP = - -CONSOLE_DEP = c:\msvc\include\winsock.h \ - e:\src\ldap-3.3b1\librar~1\msdos\winsock\ltest\console.h - - -TEXTWIND_DEP = e:\src\ldap-3.3b1\librar~1\msdos\winsock\ltest\console.h \ - e:\src\ldap-3.3b1\librar~1\msdos\winsock\ltest\textwind.h - - -LTEST_RCDEP = e:\src\ldap-3.3b1\librar~1\msdos\winsock\ltest\console.h \ - e:\src\ldap-3.3b1\librar~1\msdos\winsock\ltest\inpdlg.dlg - - -GETOPT_DEP = e:\src\ldap-3.3b1\include\lber.h \ - e:\src\ldap-3.3b1\include\proto-lb.h - - -TEST_DEP = e:\src\ldap-3.3b1\include\msdos.h \ - c:\msvc\include\winsock.h \ - e:\src\ldap-3.3b1\include\sys/socket.h \ - e:\src\ldap-3.3b1\include\sys/file.h \ - e:\src\ldap-3.3b1\include\lber.h \ - e:\src\ldap-3.3b1\include\proto-lb.h \ - e:\src\ldap-3.3b1\include\ldap.h \ - e:\src\ldap-3.3b1\include\proto-ld.h - - -all: $(PROJ).EXE $(PROJ).BSC - -CONSOLE.OBJ: CONSOLE.C $(CONSOLE_DEP) - $(CC) $(CFLAGS) $(CCREATEPCHFLAG) /c CONSOLE.C - -TEXTWIND.OBJ: TEXTWIND.C $(TEXTWIND_DEP) - $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c TEXTWIND.C - -LTEST.RES: LTEST.RC $(LTEST_RCDEP) - $(RC) $(RCFLAGS) $(RCDEFINES) -r LTEST.RC - -GETOPT.OBJ: ..\..\..\MACINTOS\GETOPT.C $(GETOPT_DEP) - $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\..\..\MACINTOS\GETOPT.C - -TEST.OBJ: ..\..\..\LIBLDAP\TEST.C $(TEST_DEP) - $(CC) $(CFLAGS) $(CUSEPCHFLAG) /c ..\..\..\LIBLDAP\TEST.C - - -$(PROJ).EXE:: LTEST.RES - -$(PROJ).EXE:: CONSOLE.OBJ TEXTWIND.OBJ GETOPT.OBJ TEST.OBJ $(OBJS_EXT) $(DEFFILE) - echo >NUL @<<$(PROJ).CRF -CONSOLE.OBJ + -TEXTWIND.OBJ + -GETOPT.OBJ + -TEST.OBJ + -$(OBJS_EXT) -$(PROJ).EXE -$(MAPFILE) -c:\msvc\lib\+ -c:\msvc\mfc\lib\+ -c:\src\lib\+ -e:.\+ -..\..\..\LIBLDAP\LIBLDAP.LIB+ -..\..\..\LIBLDAP\WINSOCK.LIB+ -$(LIBS) -$(DEFFILE); -<< - link $(LFLAGS) @$(PROJ).CRF - $(RC) $(RESFLAGS) LTEST.RES $@ - @copy $(PROJ).CRF MSVC.BND - -$(PROJ).EXE:: LTEST.RES - if not exist MSVC.BND $(RC) $(RESFLAGS) LTEST.RES $@ - -run: $(PROJ).EXE - $(PROJ) $(RUNFLAGS) - - -$(PROJ).BSC: $(SBRS) - bscmake @<< -/o$@ $(SBRS) -<< diff --git a/libraries/msdos/winsock/ltest/ltest.rc b/libraries/msdos/winsock/ltest/ltest.rc deleted file mode 100644 index 60622a5220..0000000000 --- a/libraries/msdos/winsock/ltest/ltest.rc +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include "console.h" - - -CONSOLE MENU - BEGIN - POPUP "&File" - BEGIN - MENUITEM "&Open LDAP", IDM_F_OPENLDAP - MENUITEM SEPARATOR - MENUITEM "E&xit\tAlt+F4", IDM_F_EXIT - END - END - - -CONSOLE ACCELERATORS - BEGIN - VK_F12, IDM_F_OPENLDAP, VIRTKEY, CONTROL - VK_F4, IDM_F_EXIT, ALT, VIRTKEY - END - -#include "inpdlg.dlg" diff --git a/libraries/msdos/winsock/ltest/ltest32.mak b/libraries/msdos/winsock/ltest/ltest32.mak deleted file mode 100644 index 586018c653..0000000000 --- a/libraries/msdos/winsock/ltest/ltest32.mak +++ /dev/null @@ -1,348 +0,0 @@ -# Microsoft Developer Studio Generated NMAKE File, Format Version 4.10 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -!IF "$(CFG)" == "" -CFG=LTEST - Win32 Debug -!MESSAGE No configuration specified. Defaulting to LTEST - Win32 Debug. -!ENDIF - -!IF "$(CFG)" != "LTEST - Win32 Release" && "$(CFG)" != "LTEST - Win32 Debug" -!MESSAGE Invalid configuration "$(CFG)" specified. -!MESSAGE You can specify a configuration when running NMAKE on this makefile -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "LTEST32.MAK" CFG="LTEST - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "LTEST - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "LTEST - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE -!ERROR An invalid configuration is specified. -!ENDIF - -!IF "$(OS)" == "Windows_NT" -NULL= -!ELSE -NULL=nul -!ENDIF -################################################################################ -# Begin Project -# PROP Target_Last_Scanned "LTEST - Win32 Debug" -CPP=cl.exe -RSC=rc.exe -MTL=mktyplib.exe - -!IF "$(CFG)" == "LTEST - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -OUTDIR=.\Release -INTDIR=.\Release - -ALL : "$(OUTDIR)\LTEST32.exe" - -CLEAN : - -@erase "$(INTDIR)\console.obj" - -@erase "$(INTDIR)\getopt.obj" - -@erase "$(INTDIR)\ltest.res" - -@erase "$(INTDIR)\test.obj" - -@erase "$(INTDIR)\textwind.obj" - -@erase "$(OUTDIR)\LTEST32.exe" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /W3 /O1 /I "..\winsock" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DOS" /D "NEEDPROTOS" /D "WINSOCK" /FR /YX /c -# ADD CPP /nologo /W3 /O1 /I "..\..\..\..\include" /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "DOS" /D "NEEDPROTOS" /D "WINSOCK" /YX /c -# SUBTRACT CPP /Fr -CPP_PROJ=/nologo /ML /W3 /O1 /I "..\..\..\..\include" /I "." /D "WIN32" /D\ - "NDEBUG" /D "_WINDOWS" /D "DOS" /D "NEEDPROTOS" /D "WINSOCK"\ - /Fp"$(INTDIR)/LTEST32.pch" /YX /Fo"$(INTDIR)/" /c -CPP_OBJS=.\Release/ -CPP_SBRS=.\. -# ADD BASE MTL /nologo /D "NDEBUG" /win32 -# ADD MTL /nologo /D "NDEBUG" /win32 -MTL_PROJ=/nologo /D "NDEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/ltest.res" /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/LTEST32.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /stack:0x2800 /subsystem:windows /machine:IX86 -# ADD LINK32 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /stack:0x2800 /subsystem:windows /machine:IX86 -LINK32_FLAGS=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib\ - comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib\ - odbc32.lib odbccp32.lib /nologo /stack:0x2800 /subsystem:windows\ - /incremental:no /pdb:"$(OUTDIR)/LTEST32.pdb" /machine:IX86 /def:".\ltest.def"\ - /out:"$(OUTDIR)/LTEST32.exe" -DEF_FILE= \ - ".\ltest.def" -LINK32_OBJS= \ - "$(INTDIR)\console.obj" \ - "$(INTDIR)\getopt.obj" \ - "$(INTDIR)\ltest.res" \ - "$(INTDIR)\test.obj" \ - "$(INTDIR)\textwind.obj" \ - "..\..\..\..\..\..\MSDEV\LIB\WSOCK32.LIB" \ - "..\..\..\libldap\Debug\ldap32.lib" - -"$(OUTDIR)\LTEST32.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ELSEIF "$(CFG)" == "LTEST - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -OUTDIR=.\Debug -INTDIR=.\Debug - -ALL : "$(OUTDIR)\LTEST32.exe" - -CLEAN : - -@erase "$(INTDIR)\console.obj" - -@erase "$(INTDIR)\getopt.obj" - -@erase "$(INTDIR)\ltest.res" - -@erase "$(INTDIR)\test.obj" - -@erase "$(INTDIR)\textwind.obj" - -@erase "$(OUTDIR)\LTEST32.exe" - -@erase "$(OUTDIR)\LTEST32.ilk" - -@erase "$(OUTDIR)\LTEST32.pdb" - -@erase ".\LIBLDAP.IDB" - -@erase ".\LIBLDAP.PDB" - -"$(OUTDIR)" : - if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" - -# ADD BASE CPP /nologo /W3 /Gm /Zi /Od /Gf /I "..\h" /I "..\winsock" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DOS" /D "NEEDPROTOS" /D "WINSOCK" /FR /YX /Fd"LIBLDAP.PDB" /c -# ADD CPP /nologo /W3 /Gm /Zi /Od /Gf /I "..\h" /I "..\..\..\..\include" /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DOS" /D "NEEDPROTOS" /D "WINSOCK" /YX /Fd"LIBLDAP.PDB" /c -# SUBTRACT CPP /Fr -CPP_PROJ=/nologo /MLd /W3 /Gm /Zi /Od /Gf /I "..\h" /I "..\..\..\..\include" /I\ - "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "DOS" /D "NEEDPROTOS" /D "WINSOCK"\ - /Fp"$(INTDIR)/LTEST32.pch" /YX /Fo"$(INTDIR)/" /Fd"LIBLDAP.PDB" /c -CPP_OBJS=.\Debug/ -CPP_SBRS=.\. -# ADD BASE MTL /nologo /D "_DEBUG" /win32 -# ADD MTL /nologo /D "_DEBUG" /win32 -MTL_PROJ=/nologo /D "_DEBUG" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -RSC_PROJ=/l 0x409 /fo"$(INTDIR)/ltest.res" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -BSC32_FLAGS=/nologo /o"$(OUTDIR)/LTEST32.bsc" -BSC32_SBRS= \ - -LINK32=link.exe -# ADD BASE LINK32 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /stack:0x2800 /subsystem:windows /debug /machine:IX86 -# ADD LINK32 oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /stack:0x2800 /subsystem:windows /debug /machine:IX86 -LINK32_FLAGS=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib\ - comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib\ - odbc32.lib odbccp32.lib /nologo /stack:0x2800 /subsystem:windows\ - /incremental:yes /pdb:"$(OUTDIR)/LTEST32.pdb" /debug /machine:IX86\ - /def:".\ltest.def" /out:"$(OUTDIR)/LTEST32.exe" -DEF_FILE= \ - ".\ltest.def" -LINK32_OBJS= \ - "$(INTDIR)\console.obj" \ - "$(INTDIR)\getopt.obj" \ - "$(INTDIR)\ltest.res" \ - "$(INTDIR)\test.obj" \ - "$(INTDIR)\textwind.obj" \ - "..\..\..\..\..\..\MSDEV\LIB\WSOCK32.LIB" \ - "..\..\..\libldap\Debug\ldap32.lib" - -"$(OUTDIR)\LTEST32.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - -!ENDIF - -.c{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_OBJS)}.obj: - $(CPP) $(CPP_PROJ) $< - -.c{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cpp{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -.cxx{$(CPP_SBRS)}.sbr: - $(CPP) $(CPP_PROJ) $< - -################################################################################ -# Begin Target - -# Name "LTEST - Win32 Release" -# Name "LTEST - Win32 Debug" - -!IF "$(CFG)" == "LTEST - Win32 Release" - -!ELSEIF "$(CFG)" == "LTEST - Win32 Debug" - -!ENDIF - -################################################################################ -# Begin Source File - -SOURCE=.\console.c -DEP_CPP_CONSO=\ - ".\console.h"\ - - -"$(INTDIR)\console.obj" : $(SOURCE) $(DEP_CPP_CONSO) "$(INTDIR)" - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\textwind.c -DEP_CPP_TEXTW=\ - ".\console.h"\ - ".\textwind.h"\ - - -"$(INTDIR)\textwind.obj" : $(SOURCE) $(DEP_CPP_TEXTW) "$(INTDIR)" - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\ltest.rc - -!IF "$(CFG)" == "LTEST - Win32 Release" - - -"$(INTDIR)\ltest.res" : $(SOURCE) "$(INTDIR)" - $(RSC) $(RSC_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "LTEST - Win32 Debug" - -DEP_RSC_LTEST=\ - ".\console.h"\ - ".\inpdlg.dlg"\ - - -"$(INTDIR)\ltest.res" : $(SOURCE) $(DEP_RSC_LTEST) "$(INTDIR)" - $(RSC) $(RSC_PROJ) $(SOURCE) - - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE="\src\ldap-3.3b1\libraries\macintos\getopt.c" -DEP_CPP_GETOP=\ - "..\..\..\..\include\lber.h"\ - "..\..\..\..\include\proto-lb.h"\ - "..\..\..\..\include\proto-lber.h"\ - - -"$(INTDIR)\getopt.obj" : $(SOURCE) $(DEP_CPP_GETOP) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE="\src\ldap-3.3b1\libraries\libldap\test.c" -DEP_CPP_TEST_=\ - "..\..\..\..\include\lber.h"\ - "..\..\..\..\include\ldap.h"\ - "..\..\..\..\include\msdos.h"\ - "..\..\..\..\include\proto-lb.h"\ - "..\..\..\..\include\proto-lber.h"\ - "..\..\..\..\include\proto-ld.h"\ - "..\..\..\..\include\proto-ldap.h"\ - ".\console.h"\ - {$(INCLUDE)}"\sys\stat.h"\ - {$(INCLUDE)}"\sys\types.h"\ - -NODEP_CPP_TEST_=\ - "..\..\..\libldap\macos.h"\ - "..\..\..\libldap\msdos.h"\ - - -"$(INTDIR)\test.obj" : $(SOURCE) $(DEP_CPP_TEST_) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=.\ltest.def - -!IF "$(CFG)" == "LTEST - Win32 Release" - -!ELSEIF "$(CFG)" == "LTEST - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE="\src\ldap-3.3b1\libraries\libldap\Debug\ldap32.lib" - -!IF "$(CFG)" == "LTEST - Win32 Release" - -!ELSEIF "$(CFG)" == "LTEST - Win32 Debug" - -!ENDIF - -# End Source File -################################################################################ -# Begin Source File - -SOURCE=\MSDEV\LIB\WSOCK32.LIB - -!IF "$(CFG)" == "LTEST - Win32 Release" - -!ELSEIF "$(CFG)" == "LTEST - Win32 Debug" - -!ENDIF - -# End Source File -# End Target -# End Project -################################################################################ diff --git a/libraries/msdos/winsock/ltest/ltest32.mdp b/libraries/msdos/winsock/ltest/ltest32.mdp deleted file mode 100644 index 5cd47fdf5f9982f76a1bcc2128cea3367fd8218a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37376 zcmeHQZ)_aLb$>_l_)oMXTGSuMO1x(5t0L)+)Sspl)1>@!lthOVuRK{|&R0mw+a-C? z^7gR1Cy_-9tBswgiDEO3<0xs68ii5#Ljvf73%Gy)^Fs;0|*F^@Pj`XMFFWr zfe5Ir^!H|G_m0aGMWKL^nzPby-|f8l?VC4m-ptLu*?T5?qPLNnXq2dd)UoL_@OyP^ zY7MMx>e{Qye}$5Cl0Hv+h;^}5{8d`nJQ@fGynCCc&Z?$W4Kz^;b&O}zr-svqj;6-X z4E@WykNGx{q~-2&v>Gmv@@pT7VT0hl_H8!`}1)+M6p;a(JL*P_rH;& zyTeJEe3@uFrjtKJ*$;Q+FuNp*<6n&Ew=3{B`!1fRM{sR;&MaKe5)&1V;Y9xJIDIL^ zd+G%rFB`#&*TL(k;*ARFP?nE4jf8lf#5*0qYZiQ~<$Dy@63>MhzeTV`C@V z0ntC_XyDPju$Qy4o zc9e~_M^}iKF3!xDj#(<0E@Qe$+Ar?EGsOLw#QjK&PDLqrt9L*=}zLl&7Gu+-(vkGLwrl(=Og%AMLk#B{We@nOqw%} z>CS0cPxmS=t}x!8gm^b3-g6S~$H?b)+k$gc&%1Fg5h}!3W%V&?{y0uUA#N9Jg!PaC z?o^HcU~d(*hiZS9JyYDr)Z;W3;ytzh>N&=1{|2Fl(RQ}G%g1t}FUIN5L%yr>zPrCE z_=J5jAK!NXHIGs2y|)|CkAI#c)=ySPXM>Vl(atU%$F(mBzLwuDfsfNdHc1V@<3mGY zJhtnoe%KBJBrTg*oS(L>zz+HTozN=xTR!&wo!?jAguG3XzJl{Uq&N+V`WywFN8)-9 z;G99ZlSpHr8ShDOPJv#Ip*~0k=)`HWFjp!T%AhOdvh8?$H}>z1x37VRQ=ImO`nmx= zt{>IZkNFutTECsR9@cL(Q7Tv!!|w-4y8OmD;QmpF+x2bupl6fRC~@CmP#la~+x{y* z$rEcNYy$4LK#EZl?5R2)84_>j2Jkw8H<^%43fEi~4u(-*3*~zYc&yhh;IU5G_Xc*- zB<@eQZ=v74{`DN%nP{}+qT3Ta1G^*Fkql`X*>i(sw`~l=PnO!WKaPSHoKW+q8lD@R*yJD4QkJ zuk+iim$pzZ?*fE z*6?kK@bLm%oQ|&H>xl3*3ch1&_#TPy`SY%?tl`@g;o~;zq+#%N&`sD^pR}0)*o=k5 z#~qv(B)#XQ9K9gv0nkg5o&)_8NiTtZQ_?G--;(tC@5A><`sS;!e@SouK~DJ5pVqO@ z?GbsKA&;;tIqwYGXIq5NpC?x52La!s5k8);#o^h5d2GPfDfxnNgKaHNT_N8uP%pOA zMeySQ2DuKPSLaz>OFnKx z1lPCssyod4T;wn!Q+1MU^yqvX-3orEej)1Z9l&uahoEzY;R|T zzS`fJYfKWSJ!|C5dUjd!g+;q&L_4+L>jN(*9{-wOKp~h^?f4g!m%o=CPZTZF)ruv2 zr@$QZ>t@0Cf!v01F>gT6#`iMod+5_SwEv3?OZ2b)>HgztZ4(VA=}GwePSH;OJmd!O z_~^s=s-(}qlA~*qz7F~gNfY|}O{O8of8+c<(wBk9K4%5=n=dEDyzxIk!+yl~rMsZn zzE7D8VkUB7UUx2_n%Y>=jZ-3Q-!$&C{9LtO2UsW^++Us+?a=hw70g{SKb7-^+Ira) zR~xcz&F8!KHuyNPo|-nGC;omooUltX#o3CZd-zH$3>xD`)!%#o`53Qz19)OyS(z@Q z853wn0d}W759zA@<|uT@cn9m?)%~7;ukC4bMz2^NJBUP8Rvs#6=RA0zoei-D?zeAa zT<668>@&bWiEED|^=^Ak=yRXYQ~cgt=!lb;f7R+UMVa>@-{*aO{_Z{SaAJGjE#z{-*_ZX@lKvL94RwP{(G`KpQo(*X6;5$dG9Y^Ux(+WfvD5 z2iZs9Xhw?ii46HC;A?sS-%aGdhQverdUydJ-~K^-U=h!-H^RrfqDs7O!IcX7ZLmJ6 z*8hB8sn-8mGHU&g`-fWpQ|o`2jbI+H*8kM{U+w%{t^fJ`B3L(4>wlO)s`WpfV201T z)%u@YPgLuFYW+{G|E+nRsn-9nZl~7&KJoRxZCIh?HPRheXWofbLXOu^$7az$8`i#f z3676{`wRap{))9Ru^~icvsK{v+d!L)SxXKx7c;fu>LbC`A;;7&1UV>uc_%;J_ZG{h zHePgft2kSlH%lIu0(Mj$5|Qk6uc)GY@GH z@8IaAkmV(?bV-)t#Uf&&rWduG>DU1V!k+?$(UQ5K7d#CiG=Ff4&#w~sI?g%$Ux z74>`I+3NF5Tr`~-%f1v8e+5~ceikCU5P~VDW$Mf~IHlCL6f*J#NzXH5tC zsVDpoz_LAHiQXAYzRSBZ4ho{3Oru^qeGHbZzF5)HLor%@EIl@cVrUh#(O(LS(T?kY z3)Ne2=T~-*7YmN<+B10Yb>P6-c4iypCFuMx6cC340#C^OtfSzAV&0A`Nz;;{OV!rsDrp{2%&)ivRQDl2!blivLsbe=7bD z`>0g>pNjvZ>>ohA__&jm!RKkyD7V(a8x*NtPejwu$_X6i+4Nko{M-D&>BDis% z+t{Uoql4zKKj4YC-mcGLAHox)(Ua5-Zgp%94Ybo2UJq)j)_>v2u=uzmSW;E%ziRzgt^cb1 z-xz1r{%^JayCtLcf2;l9i1ZXQWPYB*NA12)75}OBf2;l9;(KoR{8#P&UbFvQ#eb^! z&${b7YW-L3|E^tM{Ur8(KZW<)B=8QVee?yq$>snZ6tf!jXLD$vO|1W69hr8HogT@a z){@%U(NjkbYm*~mBZJuyF_!N=D6zqA!nw2@aaZxV^Z0?+C1vs{4N)}Lh#giW@m7*a~Y-73*Fn}zS<%dvy zm!m!VdlwG(_4aB#Ze`kCbUkyvAF>$sC0FY~D>^2J=;~H~2@PI0ru#$n26e_o=xAOq z%oR&!|L9cT7ojn8roTIt_mzkbV6ZFR+OpCd}PA#WLaIe8>?WcpAZN^o=s zZ%E9~yN2!NSvz*&f)AKS%&v*uv5%P&B!2QN6$~;c@e` zCMI_t-)jGQ{HQJ0JugfS%nz-QP|rsyd_!W0OHmen$%KI~-c-Fti85p;L&}$v&{o5V&SIsZ)O6{mVzprcPm0E*wJY z33vFx;G)5629u9V_xK4MLMP!j%<;(U>YzNLpVeY zBe#s?X%E|E9j0b$+H_LuFtnE)+q09_^mv074G1g;h#;na-kD-M( zSh?$QbOiNTzuE!Y1L_rT?Mgp$_LFR|_F}1w`Ed&A{!Oo1wSJd)s8;pc*8l6jq7(0z zQ}2IV8;`~B2m3U<|51*G>ZCNFG@vw~G@vw~G@vw~G@vw~G@vw~G@vw~H1H|bKnlN0 z)QjKDI*eb1IZA&_U&MQ!`{)?;;}^~Tl)n5auDPljzs*QI-No;3RUfXX_zxBTq2fQp z<1zV=3=i;B{6{qgOvQhMQDQ3oL&bj}Y;e>02^Ie_sp3CY2Nl)}>QM0?_PTKyD*j_~ zLjgM~{v!;Es)=<90y`cM%oMO~D5^)re{8bf|5U3Wn_B~aMgufRL-_UYG>zbwOiyfX Lb!@WQx6%IsYXDqY diff --git a/libraries/msdos/winsock/ltest/textwind.c b/libraries/msdos/winsock/ltest/textwind.c deleted file mode 100644 index 80f522f73c..0000000000 --- a/libraries/msdos/winsock/ltest/textwind.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * textwind.c - */ -#include -#include -#include "console.h" -#include "textwind.h" - -static BOOL windclassreg = FALSE; -extern HWND hInst; - -/* - * local prototypes - */ -BOOL register_editclass( void ); - - -HWND -new_editwindow( HWND hParent, char *lpszTitle ) -{ - HWND hWnd, hEditWnd; - RECT r; - - /* - * register text edit window class if we have not already done so - */ - if ( !windclassreg && !register_editclass()) { - return( NULL ); - } - - /* - * create an instance of text edit window - */ - hWnd = CreateWindow( WINDCLASS_TEDIT, lpszTitle != NULL ? lpszTitle : "Untitled", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - hParent, NULL, hInst, NULL ); - - if ( !hWnd ) { - return( NULL ); - } - - /* - * create a child Edit controls that fills the text edit window - */ - GetClientRect( hWnd, (LPRECT)&r ); - hEditWnd = CreateWindow( "Edit", NULL, - WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_MULTILINE, - 0, 0, r.right - r.left, r.bottom - r.top, hWnd, IDC_EDIT, hInst, NULL ); - - if ( !hEditWnd ) { - DestroyWindow( hWnd ); - return( NULL ); - } - - /* - * add edit control to property list of window - */ - if( !SetProp( hWnd, "hEditWnd", hEditWnd )) { - DestroyWindow( hWnd ); - return( NULL ); - } - - if ( lpszTitle != NULL ) { - SetWindowText( hWnd, lpszTitle ); - } - - /* - * show and draw the new window - */ - ShowWindow( hWnd, SW_SHOWNORMAL ); - UpdateWindow( hWnd ); - return( hEditWnd ); -} - - -BOOL -register_editclass() -{ - WNDCLASS wc; - - memset( &wc, 0x00, sizeof(WNDCLASS) ); - - wc.style = CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNWINDOW; - wc.lpfnWndProc = TEditWndProc; - wc.hInstance = hInst; - wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1 ); - wc.lpszClassName = WINDCLASS_TEDIT; - return( windclassreg = RegisterClass( &wc )); -} - - -void -memory_error( void ) -{ - MessageBox( GetFocus(), "Out of memory", "Sample", MB_ICONHAND | MB_OK ); -} - - -long FAR PASCAL TEditWndProc( HWND hWnd, unsigned message, WORD wParam, LONG lParam ) -{ - HWND hEditWnd; - - hEditWnd = GetProp( hWnd, "hEditWnd" ); - - switch( message ) { - case WM_COMMAND: - switch( wParam ) { - case IDC_EDIT: - if ( HIWORD( lParam ) == EN_ERRSPACE ) { - memory_error(); - } - break; - } - break; - - case WM_SETFOCUS: - SetFocus( hEditWnd ); - break; - - case WM_SIZE: - MoveWindow( hEditWnd, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE ); - break; - - default: - return( DefWindowProc( hWnd, message, wParam, lParam )); - } - - return( NULL ); -} diff --git a/libraries/msdos/winsock/ltest/textwind.h b/libraries/msdos/winsock/ltest/textwind.h deleted file mode 100644 index b61cb8a4a2..0000000000 --- a/libraries/msdos/winsock/ltest/textwind.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * textwind.h - */ - -#define WINDCLASS_TEDIT "TextClass" -#define IDC_EDIT 100 - -/* - * prototypes - */ -HWND new_editwindow( HWND hParent, char *lpszTtitle ); -void memory_error( void ); -long FAR PASCAL TEditWndProc( HWND hWnd, unsigned message, WORD wParam, LONG lParam ); diff --git a/libraries/msdos/winsock/winkit/readme.txt b/libraries/msdos/winsock/winkit/readme.txt deleted file mode 100644 index 5dffc1cf87..0000000000 --- a/libraries/msdos/winsock/winkit/readme.txt +++ /dev/null @@ -1,182 +0,0 @@ - -LDAP (Lightweight Directory Access Protocol) API for Windows/Winsock - -The lber and ldap client libraries have been ported to Microsoft Windows -in the form of Windows Dynamic Link libraries called LIBLDAP.DLL (16Bit) -and Ldap32.dll (32Bit). The LTest program is also provided in both -formats. - -A Windows Sockets API (version 1.1 conformant) TCP/IP WINSOCK.DLL or -WSOCK32.DLL is required for the DLL to run. - -Our intent is that this "kit" include everything you'll need to make use -of the ldap client API from your 16Bit or 32Bit application. If you -find something missing or have a suggestion for improvement, send email -to the "bug reporting" address at the bottom of this file. - -To use this "kit" - - 1) Get to a DOS prompt - - 2) Create the directory you want this to live in (e.g. \ldap) - and cd into it. We will refer to that directory simply as - "\ldap" from now on, but it could be anywhere and have any name - you desire. - - 3) Use "pkunzip -d" to extract the files. The "-d" is NECESSARY to - preserve the subdirectories and avoid file name collisions. - - 4) We have included only the files you need to use and test - libldap.dll and ldap32.dll. If you want the entire distribution, - with source, you can get it from: - - ftp://terminator.rs.itd.umich.edu/ldap/ldap-3.3.tar.Z - -The following files are included in this distribution: - - 16Bit binaries and libs - BINARIES/DEBUG/LIBLDAP.DLL - BINARIES/DEBUG/LIBLDAP.LIB - BINARIES/RELEASE/LIBLDAP.DLL - BINARIES/RELEASE/LIBLDAP.LIB - - BINARIES/DEBUG/LTEST.EXE - - 32Bit binaries and libs - BINARIES/DEBUG/LDAP32.DLL - BINARIES/DEBUG/LDAP32.LIB - BINARIES/RELEASE/LDAP32.DLL - BINARIES/RELEASE/LDAP32.LIB - - BINARIES/DEBUG/LTEST32.EXE - - Include files - INCKIT/MSDOS.H - INCKIT/LBER.H - INCKIT/LDAP.H - INCKIT/PROTO-LD.H - INCKIT/PROTO-LB.H - INCKIT/SRCHPREF.H - INCKIT/DISPTMPL.H - - Sample Configuration files - SRCHPREF.CFG - DISPTMPL.CFG - LDFRIEND.CFG - LDFILTER.CFG - - Man pages in the form of Windows HLP files - LIBLDAP.HLP - old format hlp file - LDAP32.HLP - new format hlp file, both have same content - -16Bit versions - - Libldap.dll was compiled with KERBEROS, AUTHMAN, WSHELPER, WIN32, - _WINDOWS,& LDAP_REFERRALS defined. Even if you do not need kerberos - authentication, (see below for more information on kerberos) this - dll should work correctly for you. - - LDAP_REFERRALS makes libldap.dll capable of handling referrals - returned by a slapd server. - -32Bit versions - - The 32Bit version is NOT SAFE for MULTIPLE THREADS at this time. - Not more than one thread per application may make use of the - ldap routines. - - Ldap32.dll was compiled with LDAP_REFERRALS defined and is capable - of handling referrals returned by a slapd server. - - -WRITING APPLICATIONS THAT USE LIBLDAP.DLL or LDAP32.DLL - - All of the normal LDAP and LBER calls documented in the help file - should work, except for ldap_perror (this is not supported under - Windows since you will want to use an application-defined dialog; - you can use ldap_err2string to obtain an error string to display in - a message box or dialog). - - The man pages are included in this kit in the form of windows HLP files. - The official source man pages are available via the web at: - - http://www.umich.edu/ldap/doc/man/ - - Any memory that you obtain as the result of a call to an LIBLDAP.DLL - routine should NOT be freed by calling the free() routine in your C - library. Instead, use the the new utility routine ldap_memfree or - the appropriate ldap ...free routine. This is so the malloc/calloc - and free routines all come from the same library (the one in - libldap) rather than using libldap's malloc/calloc and the calling - program's free. Microsoft's VC++ 4.0 compiler (in debug mode) - FORCED me to be compulsive about this for the application I used to - test. - - To be friendly under Windows, you should use the asynchronous LDAP - calls whenever possible. - - One limitation of the current LIBLDAP.DLL is that each X.500 LDAP - result message has to be smaller than 64K bytes. Ldap32.dll does - NOT have this limitation. - - To compile the ldap dlls we define the following preprocessor variables. - - WINSOCK, DOS, NEEDPROTOS, NO_USERINTERFACE, KERBEROS - - Presumably you don't need KERBEROS. You may need some/all the others - to take the right path through the include files. Also note that a - few more preprocessor variables are defined in msdos.h. This means that - msdos.h must be included before ldap.h or lber.h. - - -LTest and LTtest32 - - The LTest.exe and LTest32.exe programs are test interfaces to libldap - and ldap32 respectively. By default they connect to the host - "truelies". This host name is contained in a string resource in the - exe file. You may easily "customize" this to be the name of whatever - server you're using with AppStudio or any Windows resource editor. - -Kerberos Information - - Libldap.dll was compiled with KERBEROS, AUTHMAN, WSHELPER, & - LDAP_REFERRALS defined. If you do not need kerberos authentication, - this dll should still work correctly for you. Libldap.dll - dynamically loads and uses the dlls needed for kerberos - authentication (Authlib.dll, Krbv4win.dll, & WSHelper.dll). If - Libldap.dll is unable to load the needed dlls, execution continues - without error, but without kerberos authentication capability. - - AUTHMAN allows libldap.dll to make use of Authlib.dll (which - requires KrbV4Win.dll & WSHelper.dll) if they are ALL in the "PATH". - If these are not available, kerberos authentication can not succede, - but libldap.dll will execute without error. - - WSHELPER means that if WSHelper.dll is in the "PATH", it will be - dynamically loaded and used to do the gethostbyaddr() call required - for kerberos authentication to work. (This is used because so many - vendor implementations of gethostbyaddr return WRONG results. We - are working with all vendors we can get to listen to get these - implementations fixed.) If WSHelper.dll is not in the "PATH" - libldap.dll does not fail to execute correctly. - - Ldap32.dll does NOT have the ability to do kerberos authentication - because none of Authlib.dll, krbv4win.dll or wshelper.dll have been - ported to 32Bits at this time. - - For further information on using kerberos with the ldap DLLs send - email to ldap-support@umich.edu. - -BUG REPORTING - - Bug reports should be sent to bug-ldap@umich.edu. - - -Miscellaneous - - Build testing was done on Windows NT workstation 3.51 (build 1057 - service pack 2) on an NTFS file system (which supports long - filenames) using Microsoft Visual C++ 1.52c (16 bit) and Visual C++ - 4.0 (32 bit). - -README Last updated 11 January 1996 by Steve Rothwell diff --git a/libraries/msdos/winsock/winkit/windowskit.cmd b/libraries/msdos/winsock/winkit/windowskit.cmd deleted file mode 100644 index bcaa22776a..0000000000 --- a/libraries/msdos/winsock/winkit/windowskit.cmd +++ /dev/null @@ -1 +0,0 @@ -nmake /f WindowsKit.Mak all diff --git a/libraries/msdos/winsock/winkit/windowskit.mak b/libraries/msdos/winsock/winkit/windowskit.mak deleted file mode 100644 index 7ba81542e9..0000000000 --- a/libraries/msdos/winsock/winkit/windowskit.mak +++ /dev/null @@ -1,172 +0,0 @@ -# -# makefile.nmake stub makefile for nmake -# 15 Dec 1995 : sgr -# -# :[:] [... ] -# -# [] -# -# $@ Current target's full name (path, base, extension) -# $$@ Current target's full name (path, base, extension) -# (Valid only as a dependent in a dependency.) -# $* Current target's path & base name minus extension -# $** All dependents of the current target. -# $? All dependents with a later timestamp than the current target. -# $< Dependent file with a later timestamp that the current target. -# (Valid only in commands in inference rules.) -# -# Modifiers $(@F) -# B Base name -# F Base name + extension (Full name) -# D Drive + directory -# R Drive + directory + base name (Reusable name) - -ROOT = ..\..\..\.. -HELP = $(ROOT)\windows\help -LDAP = $(ROOT)\librar~1\libldap -LTEST = $(ROOT)\librar~1\msdos\winsock\ltest -WINSOCK = $(ROOT)\librar~1\msdos\winsock -MAININC = $(ROOT)\include -LINCL = incKit -BIN = binaries -BINARIES = \ - $(BIN)\debug\libldap.dll \ - $(BIN)\debug\libldap.lib \ - $(BIN)\release\libldap.dll \ - $(BIN)\release\libldap.lib \ - $(BIN)\debug\ltest.exe \ - $(BIN)\debug\ldap32.dll \ - $(BIN)\debug\ldap32.lib \ - $(BIN)\release\ldap32.dll \ - $(BIN)\release\ldap32.lib \ - $(BIN)\debug\ltest32.exe \ - libldap.hlp \ - ldap32.hlp - -all: WinLdap.zip - -WinLdap.zip : \ - $(BINARIES) \ -# Using Wax500 as a test case, only the -# following include files are needed to make -# a non-kerberized ldap32.dll -# or a kerberized libldap.dll - $(LINCL)\disptmpl.h \ - $(LINCL)\lber.h \ - $(LINCL)\ldap.h \ - $(LINCL)\msdos.h \ - $(LINCL)\proto-ld.h \ - $(LINCL)\proto-lb.h \ - $(LINCL)\srchpref.h \ - srchpref.cfg \ - disptmpl.cfg \ - ldfriend.cfg \ - ldfilter.cfg \ - readme.txt - -!pkzip -P -u $@ $? - del *.cfg - -$(BIN)\debug\libldap.dll : $(LDAP)\debug\libldap.dll - -@md $(@D) - -copy $? $@ - -$(BIN)\debug\libldap.lib : $(LDAP)\debug\libldap.lib - -@md $(@D) - -copy $? $@ - -$(BIN)\debug\ltest.exe : $(LTEST)\ltest.exe - -@md $(@D) - -copy $? $@ - -$(BIN)\debug\ldap32.dll : $(LDAP)\debug\ldap32.dll - -@md $(@D) - -copy $? $@ - -$(BIN)\debug\ldap32.lib : $(LDAP)\debug\ldap32.lib - -@md $(@D) - -copy $? $@ - -$(BIN)\debug\ltest32.exe : $(LTEST)\debug\ltest32.exe - -@md $(@D) - -copy $? $@ - -$(BIN)\release\libldap.dll : $(LDAP)\release\libldap.dll - -@md $(@D) - -copy $? $@ - -$(BIN)\release\libldap.lib : $(LDAP)\release\libldap.lib - -@md $(@D) - -copy $? $@ - -$(BIN)\release\ldap32.dll : $(LDAP)\release\ldap32.dll - -@md $(@D) - -copy $? $@ - -$(BIN)\release\ldap32.lib : $(LDAP)\release\ldap32.lib - -@md $(@D) - -copy $? $@ - -$(LINCL)\disptmpl.h : $(MAININC)\disptmpl.h - -@md $(@D) - -copy $? $@ - -$(LINCL)\lber.h : $(MAININC)\lber.h - -@md $(@D) - -copy $? $@ - -$(LINCL)\ldap.h : $(MAININC)\ldap.h - -@md $(@D) - -copy $? $@ - -$(LINCL)\msdos.h : $(MAININC)\msdos.h - -@md $(@D) - -copy $? $@ - -$(LINCL)\proto-ld.h : $(MAININC)\proto-ld.h - -@md $(@D) - -copy $? $@ - -$(LINCL)\proto-lb.h : $(MAININC)\proto-lb.h - -@md $(@D) - -copy $? $@ - -$(LINCL)\srchpref.h : $(MAININC)\srchpref.h - -@md $(@D) - -copy $? $@ - -libldap.hlp : $(HELP)\build\libldap.hlp - -copy $? $@ - -ldap32.hlp : $(HELP)\ldap32.hlp - -copy $? $@ - -srchpref.cfg : $(LDAP)\ldapsearchprefs.conf - -copy $** $@ - -ldfilter.cfg : $(LDAP)\ldapfilter.conf - -copy $** $@ - -disptmpl.cfg : $(LDAP)\ldaptemplates.conf - -copy $** $@ - -ldfriend.cfg : $(LDAP)\ldapfriendly - -copy $** $@ - - -$(LDAP)\debug\libldap.dll : -$(LDAP)\debug\libldap.lib : -$(LDAP)\release\libldap.dll : -$(LDAP)\release\libldap.lib : -$(LTEST)\ltest.exe : -$(LDAP)\debug\ldap32.dll : -$(LDAP)\debug\ldap32.lib : -$(LDAP)\release\ldap32.dll : -$(LDAP)\release\ldap32.lib : -$(LTEST)\debug\ltest32.exe : -$(HELP)\build\libldap.hlp : -$(HELP)\ldap32.hlp : -$(LDAP)\ldapsearchprefs.conf : -$(LDAP)\ldapfilter.conf : -$(LDAP)\ldaptemplates.conf : -$(LDAP)\ldapfriendly : -readme.txt : diff --git a/libraries/msdos/winsock/wsa/errno.c b/libraries/msdos/winsock/wsa/errno.c deleted file mode 100644 index cb49c5fe62..0000000000 --- a/libraries/msdos/winsock/wsa/errno.c +++ /dev/null @@ -1,21 +0,0 @@ -#include - -/* Copies string corresponding to the error code provided */ -/* into buf, maximum length len. Returns length actually */ -/* copied to buffer, or zero if error code is unknown. */ -/* String resources should be present for each error code */ -/* using the value of the code as the string ID (except for */ -/* error = 0, which is mapped to WSABASEERR to keep it with */ -/* the others). The DLL is free to use any string IDs that */ -/* are less than WSABASEERR for its own use. The LibMain */ -/* procedure of the DLL is presumed to have saved its */ -/* HINSTANCE in the global variable hInst. */ - -int PASCAL FAR WSAsperror (int errorcode, char far * buf, int len) -{ - if (errorcode == 0) - errorcode = WSABASEERR; - if (errorcode < WSABASEERR) - return 0; - return LoadString(hInst,errorcode,buf,len); -} diff --git a/libraries/msdos/winsock/wsa/errno.rc b/libraries/msdos/winsock/wsa/errno.rc deleted file mode 100644 index 1252957877..0000000000 --- a/libraries/msdos/winsock/wsa/errno.rc +++ /dev/null @@ -1,57 +0,0 @@ -#include - -STRINGTABLE -BEGIN - WSABASEERR, "[0] No Error" - WSAEINTR, "[10004] Interrupted system call" - WSAEBADF, "[10009] Bad file number" - WSAEACCES, "[10013] Permission denied" - WSAEFAULT, "[10014] Bad address" - WSAEINVAL, "[10022] Invalid argument" - WSAEMFILE, "[10024] Too many open files" - WSAEWOULDBLOCK, "[10035] Operation would block" - WSAEINPROGRESS, "[10036] Operation now in progress" - WSAEALREADY, "[10037] Operation already in progress" - WSAENOTSOCK, "[10038] Socket operation on non-socket" - WSAEDESTADDRREQ, "[10039] Destination address required" - WSAEMSGSIZE, "[10040] Message too long" - WSAEPROTOTYPE, "[10041] Protocol wrong type for socket" - WSAENOPROTOOPT, "[10042] Bad protocol option" - WSAEPROTONOSUPPORT, "[10043] Protocol not supported" - WSAESOCKTNOSUPPORT, "[10044] Socket type not supported" - WSAEOPNOTSUPP, "[10045] Operation not supported on socket" - WSAEPFNOSUPPORT, "[10046] Protocol family not supported" - WSAEAFNOSUPPORT, "[10047] Address family not supported by protocol family" - WSAEADDRINUSE, "[10048] Address already in use" - WSAEADDRNOTAVAIL, "[10049] Can't assign requested address" - WSAENETDOWN, "[10050] Network is down" - WSAENETUNREACH, "[10051] Network is unreachable" - WSAENETRESET, "[10052] Net dropped connection or reset" - WSAECONNABORTED, "[10053] Software caused connection abort" - WSAECONNRESET, "[10054] Connection reset by peer" - WSAENOBUFS, "[10055] No buffer space available" - WSAEISCONN, "[10056] Socket is already connected" - WSAENOTCONN, "[10057] Socket is not connected" - WSAESHUTDOWN, "[10058] Can't send after socket shutdown" - WSAETOOMANYREFS, "[10059] Too many references, can't splice" - WSAETIMEDOUT, "[10060] Connection timed out" - WSAECONNREFUSED, "[10061] Connection refused" - WSAELOOP, "[10062] Too many levels of symbolic links" - WSAENAMETOOLONG, "[10063] File name too long" - WSAEHOSTDOWN, "[10064] Host is down" - WSAEHOSTUNREACH, "[10065] No Route to Host" - WSAENOTEMPTY, "[10066] Directory not empty" - WSAEPROCLIM, "[10067] Too many processes" - WSAEUSERS, "[10068] Too many users" - WSAEDQUOT, "[10069] Disc Quota Exceeded" - WSAESTALE, "[10070] Stale NFS file handle" - WSAEREMOTE, "[10071] Too many levels of remote in path" - WSASYSNOTREADY, "[10091] Network SubSystem is unavailable" - WSAVERNOTSUPPORTED, "[10092] WINSOCK DLL Version out of range" - WSANOTINITIALIZED, "[10093] Successful WSASTARTUP not yet performed" - WSAHOST_NOT_FOUND, "[11001] Host not found" - WSATRY_AGAIN, "[11002] Non-Authoritative Host not found" - WSANO_RECOVERY, "[11003] Non-Recoverable errors: FORMERR, REFUSED, NOTIMP" - WSANO_DATA, "[11004] Valid name, no data record of requested -type" -END diff --git a/libraries/msdos/winsock/wsa/winsock.def b/libraries/msdos/winsock/wsa/winsock.def deleted file mode 100644 index 0aa0953284..0000000000 --- a/libraries/msdos/winsock/wsa/winsock.def +++ /dev/null @@ -1,84 +0,0 @@ -; -; File: winsock.def -; System: MS-Windows 3.x -; Summary: Module definition file for Windows Sockets DLL. -; - -LIBRARY WINSOCK ; Application's module name - -DESCRIPTION 'BSD Socket API for Windows' - -EXETYPE WINDOWS ; required for all windows applications - -STUB 'WINSTUB.EXE' ; generates error message if application - ; is run without Windows - -;CODE can be FIXED in memory because of potential upcalls -CODE PRELOAD FIXED - -;DATA must be SINGLE and at a FIXED location since this is a DLL -DATA PRELOAD FIXED SINGLE - -HEAPSIZE 1024 -STACKSIZE 16384 - -; All functions that will be called by any Windows routine -; must be exported. Any additional exports beyond those defined -; here must have ordinal numbers 1000 or above. - -EXPORTS - accept @1 - bind @2 - closesocket @3 - connect @4 - getpeername @5 - getsockname @6 - getsockopt @7 - htonl @8 - htons @9 - inet_addr @10 - inet_ntoa @11 - ioctlsocket @12 - listen @13 - ntohl @14 - ntohs @15 - recv @16 - recvfrom @17 - select @18 - send @19 - sendto @20 - setsockopt @21 - shutdown @22 - socket @23 - - gethostbyaddr @51 - gethostbyname @52 - getprotobyname @53 - getprotobynumber @54 - getservbyname @55 - getservbyport @56 - gethostname @57 - - WSAAsyncSelect @101 - WSAAsyncGetHostByAddr @102 - WSAAsyncGetHostByName @103 - WSAAsyncGetProtoByNumber @104 - WSAAsyncGetProtoByName @105 - WSAAsyncGetServByPort @106 - WSAAsyncGetServByName @107 - WSACancelAsyncRequest @108 - WSASetBlockingHook @109 - WSAUnhookBlockingHook @110 - WSAGetLastError @111 - WSASetLastError @112 - WSACancelBlockingCall @113 - WSAIsBlocking @114 - WSAStartup @115 - WSACleanup @116 - - __WSAFDIsSet @151 - - WEP @500 RESIDENTNAME - -;eof - diff --git a/libraries/msdos/winsock/wsa/winsock.h b/libraries/msdos/winsock/wsa/winsock.h deleted file mode 100644 index 13eb70a501..0000000000 --- a/libraries/msdos/winsock/wsa/winsock.h +++ /dev/null @@ -1,826 +0,0 @@ -/* WINSOCK.H--definitions to be used with the WINSOCK.DLL - * - * This header file corresponds to version 1.1 of the Windows Sockets specification. - * - * This file includes parts which are Copyright (c) 1982-1986 Regents - * of the University of California. All rights reserved. The - * Berkeley Software License Agreement specifies the terms and - * conditions for redistribution. - */ - -#ifndef _WINSOCKAPI_ -#define _WINSOCKAPI_ - -/* - * Pull in WINDOWS.H if necessary - */ -#ifndef _INC_WINDOWS -#include -#endif /* _INC_WINDOWS */ - -/* - * Basic system type definitions, taken from the BSD file sys/types.h. - */ -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; - -/* - * The new type to be used in all - * instances which refer to sockets. - */ -typedef u_int SOCKET; - -/* - * Select uses arrays of SOCKETs. These macros manipulate such - * arrays. FD_SETSIZE may be defined by the user before including - * this file, but the default here should be >= 64. - * - * CAVEAT IMPLEMENTOR and USER: THESE MACROS AND TYPES MUST BE - * INCLUDED IN WINSOCK.H EXACTLY AS SHOWN HERE. - */ -#ifndef FD_SETSIZE -#define FD_SETSIZE 64 -#endif /* FD_SETSIZE */ - -typedef struct fd_set { - u_short fd_count; /* how many are SET? */ - SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */ -} fd_set; - -extern int PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR *); - -#define FD_CLR(fd, set) do { \ - u_int __i; \ - for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count ; __i++) { \ - if (((fd_set FAR *)(set))->fd_array[__i] == fd) { \ - while (__i < ((fd_set FAR *)(set))->fd_count-1) { \ - ((fd_set FAR *)(set))->fd_array[__i] = \ - ((fd_set FAR *)(set))->fd_array[__i+1]; \ - __i++; \ - } \ - ((fd_set FAR *)(set))->fd_count--; \ - break; \ - } \ - } \ -} while(0) - -#define FD_SET(fd, set) do { \ - if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) \ - ((fd_set FAR *)(set))->fd_array[((fd_set FAR *)(set))->fd_count++]=fd;\ -} while(0) - -#define FD_ZERO(set) (((fd_set FAR *)(set))->fd_count=0) - -#define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)fd, (fd_set FAR *)set) - -/* - * Structure used in select() call, taken from the BSD file sys/time.h. - */ -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; - -/* - * Operations on timevals. - * - * NB: timercmp does not work for >= or <=. - */ -#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -#define timercmp(tvp, uvp, cmp) \ - ((tvp)->tv_sec cmp (uvp)->tv_sec || \ - (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) -#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 - -/* - * Commands for ioctlsocket(), taken from the BSD file fcntl.h. - * - * - * Ioctl's have the command encoded in the lower word, - * and the size of any in or out parameters in the upper - * word. The high 2 bits of the upper word are used - * to encode the in/out status of the parameter; for now - * we restrict parameters to at most 128 bytes. - */ -#define IOCPARM_MASK 0x7f /* parameters must be < 128 bytes */ -#define IOC_VOID 0x20000000 /* no parameters */ -#define IOC_OUT 0x40000000 /* copy out parameters */ -#define IOC_IN 0x80000000 /* copy in parameters */ -#define IOC_INOUT (IOC_IN|IOC_OUT) - /* 0x20000000 distinguishes new & - old ioctl's */ -#define _IO(x,y) (IOC_VOID|(x<<8)|y) - -#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y) - -#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y) - -#define FIONREAD _IOR('f', 127, u_long) /* get # bytes to read */ -#define FIONBIO _IOW('f', 126, u_long) /* set/clear non-blocking i/o */ -#define FIOASYNC _IOW('f', 125, u_long) /* set/clear async i/o */ - -/* Socket I/O Controls */ -#define SIOCSHIWAT _IOW('s', 0, u_long) /* set high watermark */ -#define SIOCGHIWAT _IOR('s', 1, u_long) /* get high watermark */ -#define SIOCSLOWAT _IOW('s', 2, u_long) /* set low watermark */ -#define SIOCGLOWAT _IOR('s', 3, u_long) /* get low watermark */ -#define SIOCATMARK _IOR('s', 7, u_long) /* at oob mark? */ - -/* - * Structures returned by network data base library, taken from the - * BSD file netdb.h. All addresses are supplied in host order, and - * returned in network order (suitable for use in system calls). - */ - -struct hostent { - char FAR * h_name; /* official name of host */ - char FAR * FAR * h_aliases; /* alias list */ - short h_addrtype; /* host address type */ - short h_length; /* length of address */ - char FAR * FAR * h_addr_list; /* list of addresses */ -#define h_addr h_addr_list[0] /* address, for backward compat */ -}; - -/* - * It is assumed here that a network number - * fits in 32 bits. - */ -struct netent { - char FAR * n_name; /* official name of net */ - char FAR * FAR * n_aliases; /* alias list */ - short n_addrtype; /* net address type */ - u_long n_net; /* network # */ -}; - -struct servent { - char FAR * s_name; /* official service name */ - char FAR * FAR * s_aliases; /* alias list */ - short s_port; /* port # */ - char FAR * s_proto; /* protocol to use */ -}; - -struct protoent { - char FAR * p_name; /* official protocol name */ - char FAR * FAR * p_aliases; /* alias list */ - short p_proto; /* protocol # */ -}; - -/* - * Constants and structures defined by the internet system, - * Per RFC 790, September 1981, taken from the BSD file netinet/in.h. - */ - -/* - * Protocols - */ -#define IPPROTO_IP 0 /* dummy for IP */ -#define IPPROTO_ICMP 1 /* control message protocol */ -#define IPPROTO_GGP 2 /* gateway^2 (deprecated) */ -#define IPPROTO_TCP 6 /* tcp */ -#define IPPROTO_PUP 12 /* pup */ -#define IPPROTO_UDP 17 /* user datagram protocol */ -#define IPPROTO_IDP 22 /* xns idp */ -#define IPPROTO_ND 77 /* UNOFFICIAL net disk proto */ - -#define IPPROTO_RAW 255 /* raw IP packet */ -#define IPPROTO_MAX 256 - -/* - * Port/socket numbers: network standard functions - */ -#define IPPORT_ECHO 7 -#define IPPORT_DISCARD 9 -#define IPPORT_SYSTAT 11 -#define IPPORT_DAYTIME 13 -#define IPPORT_NETSTAT 15 -#define IPPORT_FTP 21 -#define IPPORT_TELNET 23 -#define IPPORT_SMTP 25 -#define IPPORT_TIMESERVER 37 -#define IPPORT_NAMESERVER 42 -#define IPPORT_WHOIS 43 -#define IPPORT_MTP 57 - -/* - * Port/socket numbers: host specific functions - */ -#define IPPORT_TFTP 69 -#define IPPORT_RJE 77 -#define IPPORT_FINGER 79 -#define IPPORT_TTYLINK 87 -#define IPPORT_SUPDUP 95 - -/* - * UNIX TCP sockets - */ -#define IPPORT_EXECSERVER 512 -#define IPPORT_LOGINSERVER 513 -#define IPPORT_CMDSERVER 514 -#define IPPORT_EFSSERVER 520 - -/* - * UNIX UDP sockets - */ -#define IPPORT_BIFFUDP 512 -#define IPPORT_WHOSERVER 513 -#define IPPORT_ROUTESERVER 520 - /* 520+1 also used */ - -/* - * Ports < IPPORT_RESERVED are reserved for - * privileged processes (e.g. root). - */ -#define IPPORT_RESERVED 1024 - -/* - * Link numbers - */ -#define IMPLINK_IP 155 -#define IMPLINK_LOWEXPER 156 -#define IMPLINK_HIGHEXPER 158 - -/* - * Internet address (old style... should be updated) - */ -struct in_addr { - union { - struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b; - struct { u_short s_w1,s_w2; } S_un_w; - u_long S_addr; - } S_un; -#define s_addr S_un.S_addr - /* can be used for most tcp & ip code */ -#define s_host S_un.S_un_b.s_b2 - /* host on imp */ -#define s_net S_un.S_un_b.s_b1 - /* network */ -#define s_imp S_un.S_un_w.s_w2 - /* imp */ -#define s_impno S_un.S_un_b.s_b4 - /* imp # */ -#define s_lh S_un.S_un_b.s_b3 - /* logical host */ -}; - -/* - * Definitions of bits in internet address integers. - * On subnets, the decomposition of addresses to host and net parts - * is done according to subnet mask, not the masks here. - */ -#define IN_CLASSA(i) (((long)(i) & 0x80000000) == 0) -#define IN_CLASSA_NET 0xff000000 -#define IN_CLASSA_NSHIFT 24 -#define IN_CLASSA_HOST 0x00ffffff -#define IN_CLASSA_MAX 128 - -#define IN_CLASSB(i) (((long)(i) & 0xc0000000) == 0x80000000) -#define IN_CLASSB_NET 0xffff0000 -#define IN_CLASSB_NSHIFT 16 -#define IN_CLASSB_HOST 0x0000ffff -#define IN_CLASSB_MAX 65536 - -#define IN_CLASSC(i) (((long)(i) & 0xc0000000) == 0xc0000000) -#define IN_CLASSC_NET 0xffffff00 -#define IN_CLASSC_NSHIFT 8 -#define IN_CLASSC_HOST 0x000000ff - -#define INADDR_ANY (u_long)0x00000000 -#define INADDR_LOOPBACK 0x7f000001 -#define INADDR_BROADCAST (u_long)0xffffffff -#define INADDR_NONE 0xffffffff - -/* - * Socket address, internet style. - */ -struct sockaddr_in { - short sin_family; - u_short sin_port; - struct in_addr sin_addr; - char sin_zero[8]; -}; - -#define WSADESCRIPTION_LEN 256 -#define WSASYS_STATUS_LEN 128 - -typedef struct WSAData { - WORD wVersion; - WORD wHighVersion; - char szDescription[WSADESCRIPTION_LEN+1]; - char szSystemStatus[WSASYS_STATUS_LEN+1]; - unsigned short iMaxSockets; - unsigned short iMaxUdpDg; - char FAR * lpVendorInfo; -} WSADATA; - -typedef WSADATA FAR *LPWSADATA; - -/* - * Options for use with [gs]etsockopt at the IP level. - */ -#define IP_OPTIONS 1 /* set/get IP per-packet options */ - -/* - * Definitions related to sockets: types, address families, options, - * taken from the BSD file sys/socket.h. - */ - -/* - * This is used instead of -1, since the - * SOCKET type is unsigned. - */ -#define INVALID_SOCKET (SOCKET)(~0) -#define SOCKET_ERROR (-1) - -/* - * Types - */ -#define SOCK_STREAM 1 /* stream socket */ -#define SOCK_DGRAM 2 /* datagram socket */ -#define SOCK_RAW 3 /* raw-protocol interface */ -#define SOCK_RDM 4 /* reliably-delivered message */ -#define SOCK_SEQPACKET 5 /* sequenced packet stream */ - -/* - * Option flags per-socket. - */ -#define SO_DEBUG 0x0001 /* turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_REUSEADDR 0x0004 /* allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_DONTROUTE 0x0010 /* just use interface addresses */ -#define SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */ -#define SO_USELOOPBACK 0x0040 /* bypass hardware when possible */ -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ - -#define SO_DONTLINGER (u_int)(~SO_LINGER) - -/* - * Additional options. - */ -#define SO_SNDBUF 0x1001 /* send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ -#define SO_SNDLOWAT 0x1003 /* send low-water mark */ -#define SO_RCVLOWAT 0x1004 /* receive low-water mark */ -#define SO_SNDTIMEO 0x1005 /* send timeout */ -#define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ - -/* - * TCP options. - */ -#define TCP_NODELAY 0x0001 - -/* - * Address families. - */ -#define AF_UNSPEC 0 /* unspecified */ -#define AF_UNIX 1 /* local to host (pipes, portals) */ -#define AF_INET 2 /* internetwork: UDP, TCP, etc. */ -#define AF_IMPLINK 3 /* arpanet imp addresses */ -#define AF_PUP 4 /* pup protocols: e.g. BSP */ -#define AF_CHAOS 5 /* mit CHAOS protocols */ -#define AF_NS 6 /* XEROX NS protocols */ -#define AF_ISO 7 /* ISO protocols */ -#define AF_OSI AF_ISO /* OSI is ISO */ -#define AF_ECMA 8 /* european computer manufacturers */ -#define AF_DATAKIT 9 /* datakit protocols */ -#define AF_CCITT 10 /* CCITT protocols, X.25 etc */ -#define AF_SNA 11 /* IBM SNA */ -#define AF_DECnet 12 /* DECnet */ -#define AF_DLI 13 /* Direct data link interface */ -#define AF_LAT 14 /* LAT */ -#define AF_HYLINK 15 /* NSC Hyperchannel */ -#define AF_APPLETALK 16 /* AppleTalk */ -#define AF_NETBIOS 17 /* NetBios-style addresses */ - -#define AF_MAX 18 - -/* - * Structure used by kernel to store most - * addresses. - */ -struct sockaddr { - u_short sa_family; /* address family */ - char sa_data[14]; /* up to 14 bytes of direct address */ -}; - -/* - * Structure used by kernel to pass protocol - * information in raw sockets. - */ -struct sockproto { - u_short sp_family; /* address family */ - u_short sp_protocol; /* protocol */ -}; - -/* - * Protocol families, same as address families for now. - */ -#define PF_UNSPEC AF_UNSPEC -#define PF_UNIX AF_UNIX -#define PF_INET AF_INET -#define PF_IMPLINK AF_IMPLINK -#define PF_PUP AF_PUP -#define PF_CHAOS AF_CHAOS -#define PF_NS AF_NS -#define PF_ISO AF_ISO -#define PF_OSI AF_OSI -#define PF_ECMA AF_ECMA -#define PF_DATAKIT AF_DATAKIT -#define PF_CCITT AF_CCITT -#define PF_SNA AF_SNA -#define PF_DECnet AF_DECnet -#define PF_DLI AF_DLI -#define PF_LAT AF_LAT -#define PF_HYLINK AF_HYLINK -#define PF_APPLETALK AF_APPLETALK - -#define PF_MAX AF_MAX - -/* - * Structure used for manipulating linger option. - */ -struct linger { - u_short l_onoff; /* option on/off */ - u_short l_linger; /* linger time */ -}; - -/* - * Level number for (get/set)sockopt() to apply to socket itself. - */ -#define SOL_SOCKET 0xffff /* options for socket level */ - -/* - * Maximum queue length specifiable by listen. - */ -#define SOMAXCONN 5 - -#define MSG_OOB 0x1 /* process out-of-band data */ -#define MSG_PEEK 0x2 /* peek at incoming message */ -#define MSG_DONTROUTE 0x4 /* send without using routing tables */ - -#define MSG_MAXIOVLEN 16 - -/* - * Define constant based on rfc883, used by gethostbyxxxx() calls. - */ -#define MAXGETHOSTSTRUCT 1024 - -/* - * Define flags to be used with the WSAAsyncSelect() call. - */ -#define FD_READ 0x01 -#define FD_WRITE 0x02 -#define FD_OOB 0x04 -#define FD_ACCEPT 0x08 -#define FD_CONNECT 0x10 -#define FD_CLOSE 0x20 - -/* - * All Windows Sockets error constants are biased by WSABASEERR from - * the "normal" - */ -#define WSABASEERR 10000 -/* - * Windows Sockets definitions of regular Microsoft C error constants - */ -#define WSAEINTR (WSABASEERR+4) -#define WSAEBADF (WSABASEERR+9) -#define WSAEACCES (WSABASEERR+13) -#define WSAEFAULT (WSABASEERR+14) -#define WSAEINVAL (WSABASEERR+22) -#define WSAEMFILE (WSABASEERR+24) - -/* - * Windows Sockets definitions of regular Berkeley error constants - */ -#define WSAEWOULDBLOCK (WSABASEERR+35) -#define WSAEINPROGRESS (WSABASEERR+36) -#define WSAEALREADY (WSABASEERR+37) -#define WSAENOTSOCK (WSABASEERR+38) -#define WSAEDESTADDRREQ (WSABASEERR+39) -#define WSAEMSGSIZE (WSABASEERR+40) -#define WSAEPROTOTYPE (WSABASEERR+41) -#define WSAENOPROTOOPT (WSABASEERR+42) -#define WSAEPROTONOSUPPORT (WSABASEERR+43) -#define WSAESOCKTNOSUPPORT (WSABASEERR+44) -#define WSAEOPNOTSUPP (WSABASEERR+45) -#define WSAEPFNOSUPPORT (WSABASEERR+46) -#define WSAEAFNOSUPPORT (WSABASEERR+47) -#define WSAEADDRINUSE (WSABASEERR+48) -#define WSAEADDRNOTAVAIL (WSABASEERR+49) -#define WSAENETDOWN (WSABASEERR+50) -#define WSAENETUNREACH (WSABASEERR+51) -#define WSAENETRESET (WSABASEERR+52) -#define WSAECONNABORTED (WSABASEERR+53) -#define WSAECONNRESET (WSABASEERR+54) -#define WSAENOBUFS (WSABASEERR+55) -#define WSAEISCONN (WSABASEERR+56) -#define WSAENOTCONN (WSABASEERR+57) -#define WSAESHUTDOWN (WSABASEERR+58) -#define WSAETOOMANYREFS (WSABASEERR+59) -#define WSAETIMEDOUT (WSABASEERR+60) -#define WSAECONNREFUSED (WSABASEERR+61) -#define WSAELOOP (WSABASEERR+62) -#define WSAENAMETOOLONG (WSABASEERR+63) -#define WSAEHOSTDOWN (WSABASEERR+64) -#define WSAEHOSTUNREACH (WSABASEERR+65) -#define WSAENOTEMPTY (WSABASEERR+66) -#define WSAEPROCLIM (WSABASEERR+67) -#define WSAEUSERS (WSABASEERR+68) -#define WSAEDQUOT (WSABASEERR+69) -#define WSAESTALE (WSABASEERR+70) -#define WSAEREMOTE (WSABASEERR+71) - -/* - * Extended Windows Sockets error constant definitions - */ -#define WSASYSNOTREADY (WSABASEERR+91) -#define WSAVERNOTSUPPORTED (WSABASEERR+92) -#define WSANOTINITIALISED (WSABASEERR+93) - -/* - * Error return codes from gethostbyname() and gethostbyaddr() - * (when using the resolver). Note that these errors are - * retrieved via WSAGetLastError() and must therefore follow - * the rules for avoiding clashes with error numbers from - * specific implementations or language run-time systems. - * For this reason the codes are based at WSABASEERR+1001. - * Note also that [WSA]NO_ADDRESS is defined only for - * compatibility purposes. - */ - -#define h_errno WSAGetLastError() - -/* Authoritative Answer: Host not found */ -#define WSAHOST_NOT_FOUND (WSABASEERR+1001) -#define HOST_NOT_FOUND WSAHOST_NOT_FOUND - -/* Non-Authoritative: Host not found, or SERVERFAIL */ -#define WSATRY_AGAIN (WSABASEERR+1002) -#define TRY_AGAIN WSATRY_AGAIN - -/* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ -#define WSANO_RECOVERY (WSABASEERR+1003) -#define NO_RECOVERY WSANO_RECOVERY - -/* Valid name, no data record of requested type */ -#define WSANO_DATA (WSABASEERR+1004) -#define NO_DATA WSANO_DATA - -/* no address, look for MX record */ -#define WSANO_ADDRESS WSANO_DATA -#define NO_ADDRESS WSANO_ADDRESS - -/* - * Windows Sockets errors redefined as regular Berkeley error constants - */ -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EINPROGRESS WSAEINPROGRESS -#define EALREADY WSAEALREADY -#define ENOTSOCK WSAENOTSOCK -#define EDESTADDRREQ WSAEDESTADDRREQ -#define EMSGSIZE WSAEMSGSIZE -#define EPROTOTYPE WSAEPROTOTYPE -#define ENOPROTOOPT WSAENOPROTOOPT -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -#define EOPNOTSUPP WSAEOPNOTSUPP -#define EPFNOSUPPORT WSAEPFNOSUPPORT -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#define EADDRINUSE WSAEADDRINUSE -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#define ENETDOWN WSAENETDOWN -#define ENETUNREACH WSAENETUNREACH -#define ENETRESET WSAENETRESET -#define ECONNABORTED WSAECONNABORTED -#define ECONNRESET WSAECONNRESET -#define ENOBUFS WSAENOBUFS -#define EISCONN WSAEISCONN -#define ENOTCONN WSAENOTCONN -#define ESHUTDOWN WSAESHUTDOWN -#define ETOOMANYREFS WSAETOOMANYREFS -#define ETIMEDOUT WSAETIMEDOUT -#define ECONNREFUSED WSAECONNREFUSED -#define ELOOP WSAELOOP -#define ENAMETOOLONG WSAENAMETOOLONG -#define EHOSTDOWN WSAEHOSTDOWN -#define EHOSTUNREACH WSAEHOSTUNREACH -#define ENOTEMPTY WSAENOTEMPTY -#define EPROCLIM WSAEPROCLIM -#define EUSERS WSAEUSERS -#define EDQUOT WSAEDQUOT -#define ESTALE WSAESTALE -#define EREMOTE WSAEREMOTE - -/* Socket function prototypes */ - -#ifdef __cplusplus -extern "C" { -#endif - -SOCKET PASCAL FAR accept (SOCKET s, struct sockaddr FAR *addr, - int FAR *addrlen); - -int PASCAL FAR bind (SOCKET s, const struct sockaddr FAR *addr, int namelen); - -int PASCAL FAR closesocket (SOCKET s); - -int PASCAL FAR connect (SOCKET s, const struct sockaddr FAR *name, int namelen); - -int PASCAL FAR ioctlsocket (SOCKET s, long cmd, u_long FAR *argp); - -int PASCAL FAR getpeername (SOCKET s, struct sockaddr FAR *name, - int FAR * namelen); - -int PASCAL FAR getsockname (SOCKET s, struct sockaddr FAR *name, - int FAR * namelen); - -int PASCAL FAR getsockopt (SOCKET s, int level, int optname, - char FAR * optval, int FAR *optlen); - -u_long PASCAL FAR htonl (u_long hostlong); - -u_short PASCAL FAR htons (u_short hostshort); - -unsigned long PASCAL FAR inet_addr (const char FAR * cp); - -char FAR * PASCAL FAR inet_ntoa (struct in_addr in); - -int PASCAL FAR listen (SOCKET s, int backlog); - -u_long PASCAL FAR ntohl (u_long netlong); - -u_short PASCAL FAR ntohs (u_short netshort); - -int PASCAL FAR recv (SOCKET s, char FAR * buf, int len, int flags); - -int PASCAL FAR recvfrom (SOCKET s, char FAR * buf, int len, int flags, - struct sockaddr FAR *from, int FAR * fromlen); - -int PASCAL FAR select (int nfds, fd_set FAR *readfds, fd_set FAR *writefds, - fd_set FAR *exceptfds, const struct timeval FAR *timeout); - -int PASCAL FAR send (SOCKET s, const char FAR * buf, int len, int flags); - -int PASCAL FAR sendto (SOCKET s, const char FAR * buf, int len, int flags, - const struct sockaddr FAR *to, int tolen); - -int PASCAL FAR setsockopt (SOCKET s, int level, int optname, - const char FAR * optval, int optlen); - -int PASCAL FAR shutdown (SOCKET s, int how); - -SOCKET PASCAL FAR socket (int af, int type, int protocol); - -/* Database function prototypes */ - -struct hostent FAR * PASCAL FAR gethostbyaddr(const char FAR * addr, - int len, int type); - -struct hostent FAR * PASCAL FAR gethostbyname(const char FAR * name); - -int PASCAL FAR gethostname (char FAR * name, int namelen); - -struct servent FAR * PASCAL FAR getservbyport(int port, const char FAR * proto); - -struct servent FAR * PASCAL FAR getservbyname(const char FAR * name, - const char FAR * proto); - -struct protoent FAR * PASCAL FAR getprotobynumber(int proto); - -struct protoent FAR * PASCAL FAR getprotobyname(const char FAR * name); - -/* Microsoft Windows Extension function prototypes */ - -int PASCAL FAR WSAStartup(WORD wVersionRequired, LPWSADATA lpWSAData); - -int PASCAL FAR WSACleanup(void); - -void PASCAL FAR WSASetLastError(int iError); - -int PASCAL FAR WSAGetLastError(void); - -BOOL PASCAL FAR WSAIsBlocking(void); - -int PASCAL FAR WSAUnhookBlockingHook(void); - -FARPROC PASCAL FAR WSASetBlockingHook(FARPROC lpBlockFunc); - -int PASCAL FAR WSACancelBlockingCall(void); - -HANDLE PASCAL FAR WSAAsyncGetServByName(HWND hWnd, u_int wMsg, - const char FAR * name, - const char FAR * proto, - char FAR * buf, int buflen); - -HANDLE PASCAL FAR WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, int port, - const char FAR * proto, char FAR * buf, - int buflen); - -HANDLE PASCAL FAR WSAAsyncGetProtoByName(HWND hWnd, u_int wMsg, - const char FAR * name, char FAR * buf, - int buflen); - -HANDLE PASCAL FAR WSAAsyncGetProtoByNumber(HWND hWnd, u_int wMsg, - int number, char FAR * buf, - int buflen); - -HANDLE PASCAL FAR WSAAsyncGetHostByName(HWND hWnd, u_int wMsg, - const char FAR * name, char FAR * buf, - int buflen); - -HANDLE PASCAL FAR WSAAsyncGetHostByAddr(HWND hWnd, u_int wMsg, - const char FAR * addr, int len, int type, - const char FAR * buf, int buflen); - -int PASCAL FAR WSACancelAsyncRequest(HANDLE hAsyncTaskHandle); - -int PASCAL FAR WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, - long lEvent); - -#ifdef __cplusplus -} -#endif - -/* Microsoft Windows Extended data types */ -typedef struct sockaddr SOCKADDR; -typedef struct sockaddr *PSOCKADDR; -typedef struct sockaddr FAR *LPSOCKADDR; - -typedef struct sockaddr_in SOCKADDR_IN; -typedef struct sockaddr_in *PSOCKADDR_IN; -typedef struct sockaddr_in FAR *LPSOCKADDR_IN; - -typedef struct linger LINGER; -typedef struct linger *PLINGER; -typedef struct linger FAR *LPLINGER; - -typedef struct in_addr IN_ADDR; -typedef struct in_addr *PIN_ADDR; -typedef struct in_addr FAR *LPIN_ADDR; - -typedef struct fd_set FD_SET; -typedef struct fd_set *PFD_SET; -typedef struct fd_set FAR *LPFD_SET; - -typedef struct hostent HOSTENT; -typedef struct hostent *PHOSTENT; -typedef struct hostent FAR *LPHOSTENT; - -typedef struct servent SERVENT; -typedef struct servent *PSERVENT; -typedef struct servent FAR *LPSERVENT; - -typedef struct protoent PROTOENT; -typedef struct protoent *PPROTOENT; -typedef struct protoent FAR *LPPROTOENT; - -typedef struct timeval TIMEVAL; -typedef struct timeval *PTIMEVAL; -typedef struct timeval FAR *LPTIMEVAL; - -/* - * Windows message parameter composition and decomposition - * macros. - * - * WSAMAKEASYNCREPLY is intended for use by the Windows Sockets implementation - * when constructing the response to a WSAAsyncGetXByY() routine. - */ -#define WSAMAKEASYNCREPLY(buflen,error) MAKELONG(buflen,error) -/* - * WSAMAKESELECTREPLY is intended for use by the Windows Sockets implementation - * when constructing the response to WSAAsyncSelect(). - */ -#define WSAMAKESELECTREPLY(event,error) MAKELONG(event,error) -/* - * WSAGETASYNCBUFLEN is intended for use by the Windows Sockets application - * to extract the buffer length from the lParam in the response - * to a WSAGetXByY(). - */ -#define WSAGETASYNCBUFLEN(lParam) LOWORD(lParam) -/* - * WSAGETASYNCERROR is intended for use by the Windows Sockets application - * to extract the error code from the lParam in the response - * to a WSAGetXByY(). - */ -#define WSAGETASYNCERROR(lParam) HIWORD(lParam) -/* - * WSAGETSELECTEVENT is intended for use by the Windows Sockets application - * to extract the event code from the lParam in the response - * to a WSAAsyncSelect(). - */ -#define WSAGETSELECTEVENT(lParam) LOWORD(lParam) -/* - * WSAGETSELECTERROR is intended for use by the Windows Sockets application - * to extract the error code from the lParam in the response - * to a WSAAsyncSelect(). - */ -#define WSAGETSELECTERROR(lParam) HIWORD(lParam) - -#endif /* _WINSOCKAPI_ */ - diff --git a/libraries/vms/Make-template b/libraries/vms/Make-template deleted file mode 100644 index 2d7ef4e572..0000000000 --- a/libraries/vms/Make-template +++ /dev/null @@ -1,48 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP libraries/vms Makefile -# -#----------------------------------------------------------------------------- - -############################################################################ -# # -# You should not have to edit anything below this point # -# # -############################################################################ - -# -# rules to make the software -# - -all: FORCE - -# -# rules to install the software -# - -install: all - -# -# rules to make clean -# - -clean: FORCE - -veryclean: clean - -# -# rules to make depend -# -# -depend: FORCE - -links: diff --git a/libraries/vms/README.VMS b/libraries/vms/README.VMS deleted file mode 100644 index 4cb3b6aeb4..0000000000 --- a/libraries/vms/README.VMS +++ /dev/null @@ -1,16 +0,0 @@ -LDAP VMS README - -The lber and ldap client libraries and the ldap server ldapd have been -ported to VMS. While we at the University of Michigan have no way to -test under VMS, the necessary code changes have been incorporated. - -Please see the file ldap/build/platforms/vms/make.com for some very basic -build instructions. - - -BUG REPORTING - - Bug reports should be sent to bug-ldap@umich.edu. They will be - passed on to those who did the LDAP VMS port. - -README Last updated 15 December 1994 Mark Smith diff --git a/libraries/vms/getopt.c b/libraries/vms/getopt.c deleted file mode 100644 index 814ab18c80..0000000000 --- a/libraries/vms/getopt.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)getopt.c 4.12 (Berkeley) 6/1/90"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#include "lber.h" -#define index strchr -#define rindex strrchr - -/* - * get option letter from argument vector - */ -int opterr = 1, /* if error message should be printed */ - optind = 1, /* index into parent argv vector */ - optopt; /* character checked for validity */ -char *optarg; /* argument associated with option */ - -#define BADCH (int)'?' -#define EMSG "" - -getopt(nargc, nargv, ostr) - int nargc; - char **nargv, *ostr; -{ - static char *place = EMSG; /* option letter processing */ - register char *oli; /* option letter list index */ - char *p; - - if (!*place) { /* update scanning pointer */ - if (optind >= nargc || *(place = nargv[optind]) != '-') { - place = EMSG; - return(EOF); - } - if (place[1] && *++place == '-') { /* found "--" */ - ++optind; - place = EMSG; - return(EOF); - } - } /* option letter okay? */ - if ((optopt = (int)*place++) == (int)':' || - !(oli = index(ostr, optopt))) { - /* - * if the user didn't specify '-' as an option, - * assume it means EOF. - */ - if (optopt == (int)'-') - return(EOF); - if (!*place) - ++optind; - if (opterr) { - if (!(p = rindex(*nargv, '/'))) - p = *nargv; - else - ++p; - (void)fprintf(stderr, "%s: illegal option -- %c\n", - p, optopt); - } - return(BADCH); - } - if (*++oli != ':') { /* don't need argument */ - optarg = NULL; - if (!*place) - ++optind; - } - else { /* need an argument */ - if (*place) /* no white space */ - optarg = place; - else if (nargc <= ++optind) { /* no arg */ - place = EMSG; - if (!(p = rindex(*nargv, '/'))) - p = *nargv; - else - ++p; - if (opterr) - (void)fprintf(stderr, - "%s: option requires an argument -- %c\n", - p, optopt); - return(BADCH); - } - else /* white space */ - optarg = nargv[optind]; - place = EMSG; - ++optind; - } - return(optopt); /* dump back option letter */ -} diff --git a/libraries/vms/strings.c b/libraries/vms/strings.c deleted file mode 100644 index e96ceb3b02..0000000000 --- a/libraries/vms/strings.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * strings.c - */ -#include -#include - - -#ifndef NO_GLOBALS -/* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. - */ -/* - * This array is designed for mapping upper and lower case letter - * together for a case independent comparison. The mappings are - * based upon ascii character sequences. - */ -static char charmap[] = { - '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', - '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', - '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', - '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', - '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', - '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', - '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', - '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', - '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', - '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', - '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', - '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', - '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', - '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', - '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', - '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', - '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', - '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', - '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', - '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', - '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', - '\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\333', '\334', '\335', '\336', '\337', - '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', - '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', - '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', - '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', -}; - -int -strcasecmp(s1, s2) - register char *s1, *s2; -{ - register char *cm = charmap; - - while (cm[*s1] == cm[*s2++]) - if (*s1++ == '\0') - return(0); - return(cm[*s1] - cm[*--s2]); -} - -int -strncasecmp(s1, s2, n) - register char *s1, *s2; - register long n; -{ - register char *cm = charmap; - - while (--n >= 0 && cm[*s1] == cm[*s2++]) - if (*s1++ == '\0') - return(0); - return(n < 0 ? 0 : cm[*s1] - cm[*--s2]); -} -#endif NO_GLOBALS - - -char * -strdup( p ) - char *p; -{ - char *r; - - r = (char *) malloc( strlen( p ) + 1 ); - if ( r != NULL ) { - strcpy( r, p ); - } - - return( r ); -} - -void bcopy (void * src, void *dest, int n) { - memmove(dest, src, n); -} diff --git a/libraries/vms/ucx_select.h b/libraries/vms/ucx_select.h deleted file mode 100644 index a45e3ab382..0000000000 --- a/libraries/vms/ucx_select.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Select uses bit masks of file descriptors in longs. These macros - * manipulate such bit fields. - * - * FD_SETSIZE is the number file descriptors select() is able to - * deal with. For DEC TCP/IP on VMS this is currently 32. - */ -#define FD_SETSIZE 32 -#define NBBY 8 /* number of bits in a byte */ - -typedef long fd_mask; -#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ - -#ifndef howmany -#define howmany(x, y) (((x)+((y)-1))/(y)) -#endif - -typedef struct fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} fd_set; - -#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) -#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) -#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) -#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) - -#define getdtablesize() FD_SETSIZE - diff --git a/servers/Make-template b/servers/Make-template deleted file mode 100644 index 6dbca325ad..0000000000 --- a/servers/Make-template +++ /dev/null @@ -1,88 +0,0 @@ -#----------------------------------------------------------------------------- -# 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. -# -# LDAP servers Makefile -# -#----------------------------------------------------------------------------- - -############################################################################ -# # -# You should not have to edit anything below this point # -# # -############################################################################ - -# -# rules to make the software -# - -all: FORCE - @echo "making all in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ - ( cd $$i; $(MAKE) $(MFLAGS) all ); \ - fi; \ - done - - -# -# rules to install the software -# - -install: FORCE - @echo "making install in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo " cd $$i; $(MAKE) $(MFLAGS) install"; \ - ( cd $$i; $(MAKE) $(MFLAGS) install ); \ - fi; \ - done - -# -# rules to make clean -# - -clean: FORCE - @echo "making clean in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ - ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ - fi; \ - done - -veryclean: clean - -# -# rules to make depend -# -# - -depend: FORCE - @echo "making depend in `$(PWD)`" - @for i in *; do \ - if [ -d $$i -a $$i != "CVS" ]; then \ - echo " cd $$i; $(MAKE) $(MFLAGS) depend"; \ - ( cd $$i; $(MAKE) $(MFLAGS) depend ); \ - fi; \ - done - -links: - @echo "making links in `$(PWD)`"; \ - for i in .src/*; do \ - if [ -d $$i -a $$i != ".src/CVS" ]; then \ - d=`basename $$i`; \ - ( $(MKDIR) $$d; cd $$d; $(LN) ../.src/$$d .src; \ - $(LN) ../.src/$$d/Make-template . ; \ - $(MAKE) $(MFLAGS) MKDIR="$(MKDIR)" LN="$(LN)" \ - -f Make-template links ) ; \ - fi; \ - done diff --git a/servers/Makefile.in b/servers/Makefile.in new file mode 100644 index 0000000000..6829e7bbb3 --- /dev/null +++ b/servers/Makefile.in @@ -0,0 +1,7 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, see COPYRIGHT file +## +## servers Makefile.in for OpenLDAP + +SUBDIRS= ldapd slapd slurpd + diff --git a/servers/ldapd/Makefile.in b/servers/ldapd/Makefile.in new file mode 100644 index 0000000000..fc2db5a5cf --- /dev/null +++ b/servers/ldapd/Makefile.in @@ -0,0 +1,51 @@ +## +## Makefile.in for ldapd +## +PROGRAMS=ldapd +XPROGRAMS=sldapd +SRCS = main.c detach.c setproctitle.c request.c bind.c result.c error.c \ + search.c util.c compare.c message.c add.c delete.c modrdn.c modify.c \ + abandon.c syntax.c association.c kerberos.c certificate.c +OBJS = main.o detach.o setproctitle.o request.o bind.o result.o error.o \ + search.o util.o compare.o message.o add.o delete.o modrdn.o modify.o \ + abandon.o syntax.o association.o kerberos.o LDAP_tables.o \ + certificate.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +BUILD_OPT = "--enable-ldapd" +BUILD_SRV = @BUILD_LDAPD@ + +XLIBS= @LDAPD_LIBS@ + +all-local: $(PROGRAMS) + +ldapd: version.o + $(CC) $(LDFLAGS) -o $@ $(OBJS) version.o $(LIBS) + +sldapd: version.o + $(CC) $(LDFLAGS) -static -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) -lresolv + +version.c: $(OBJS) $(LDIR)/liblber/liblber.a + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +request.o: LDAP-types.h + +LDAP_tables.c: ldap.py + @if [ ! -z "$(PEPSY)" ]; then \ + $(PEPSY) -A ldap.py; \ + else \ + touch LDAP_tables.c LDAP-types.h; \ + fi + +LDAP-types.h: LDAP_tables.c + +install-local: FORCE + @$(MKDIR) -p $(libexecdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 ldapd $(LDAP_LIBEXECDIR) diff --git a/servers/ldapd/abandon.c b/servers/ldapd/abandon.c index 3e51192590..899bf3f449 100644 --- a/servers/ldapd/abandon.c +++ b/servers/ldapd/abandon.c @@ -10,15 +10,19 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include + +#include + #include #include #include #include #include #include -#include -#include + #include "lber.h" #include "ldap.h" #include "common.h" diff --git a/servers/ldapd/add.c b/servers/ldapd/add.c index cc76223a73..08bf49404b 100644 --- a/servers/ldapd/add.c +++ b/servers/ldapd/add.c @@ -10,20 +10,23 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include + +#include + #include #include #include #include #include #include -#include -#include #include "lber.h" #include "ldap.h" #include "common.h" -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 extern int ldap_compat; #define ADDTAG (ldap_compat == 20 ? OLD_LDAP_RES_ADD : LDAP_RES_ADD) #else diff --git a/servers/ldapd/association.c b/servers/ldapd/association.c index cea7b959a1..a24871b7db 100644 --- a/servers/ldapd/association.c +++ b/servers/ldapd/association.c @@ -10,27 +10,32 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include + +#include +#include +#include +#include + #include #include -#include -#include -#include -#include -#include #include "lber.h" #include "ldap.h" + #if ISODEPACKAGE == IC #include #else #include #endif #include "common.h" -#ifdef SVR4 -#if !defined(_AIX) && !defined(__osf__) && !defined(linux) -#include + +#ifdef HAVE_SYS_IOCTL_H +#include #endif +#ifdef HAVE_SYS_FILIO_H +#include #endif #ifdef __hpux diff --git a/servers/ldapd/bind.c b/servers/ldapd/bind.c index db76ff0bf7..defcb19e0a 100644 --- a/servers/ldapd/bind.c +++ b/servers/ldapd/bind.c @@ -10,21 +10,23 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include + #include #include #include #include #include + #include "lber.h" #include "ldap.h" #include "common.h" -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 extern int ldap_compat; #define BINDTAG (ldap_compat == 20 ? OLD_LDAP_RES_BIND : LDAP_RES_BIND) #else @@ -75,7 +77,7 @@ do_bind( LDAP_PROTOCOL_ERROR, NULL, "Decoding error" ); return( 0 ); } -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) method = ber_skip_tag( ber, &len ); else @@ -141,7 +143,7 @@ do_bind_real( struct DSError dse; char *dn = dsaconn->c_dn; int err; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS u_long nonce; #endif extern DN ldap_str2dn(); @@ -155,10 +157,10 @@ do_bind_real( } switch ( dsaconn->c_method ) { -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_AUTH_SIMPLE: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_AUTH_SIMPLE_30: #endif case LDAP_AUTH_SIMPLE: /* x.500 simple authentication */ @@ -176,11 +178,11 @@ do_bind_real( ba.dba_version = DBA_VERSION_V1988; break; -#ifdef KERBEROS -#ifdef COMPAT20 +#ifdef HAVE_KERBEROS +#ifdef LDAP_COMPAT20 case OLD_LDAP_AUTH_KRBV4: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_AUTH_KRBV41_30: #endif case LDAP_AUTH_KRBV41: /* kerberos authentication to ldap server */ @@ -188,10 +190,10 @@ do_bind_real( dsaconn->c_credlen ) ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_AUTH_KRBV42: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_AUTH_KRBV42_30: #endif case LDAP_AUTH_KRBV42: /* kerberos authentication to x500 dsa */ @@ -254,7 +256,7 @@ do_bind_real( Debug( LDAP_DEBUG_TRACE, "dap_bind successful\n", 0, 0, 0 ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS /* XXX why doesn't this work?? if ( dsaconn->c_method == LDAP_AUTH_KRBV42 && kerberos_check_mutual( &br, nonce ) != 0 ) { diff --git a/servers/ldapd/certificate.c b/servers/ldapd/certificate.c index 228d65a6e8..1299b0cf55 100644 --- a/servers/ldapd/certificate.c +++ b/servers/ldapd/certificate.c @@ -3,18 +3,21 @@ * donated by Eric Rosenquist and BNR */ +#include "portable.h" + #include -#include -#include -#include -#include -#include + +#include +#include +#include + #include #include #include #include #include #include + #include "lber.h" #include "ldap.h" #include "common.h" diff --git a/servers/ldapd/common.h b/servers/ldapd/common.h index 9239a72f7d..82ef371fbc 100644 --- a/servers/ldapd/common.h +++ b/servers/ldapd/common.h @@ -10,6 +10,9 @@ * is provided ``as is'' without express or implied warranty. */ +#ifndef _LDAPD_COMMON_H +#define _LDAPD_COMMON_H 1 + /* * This structure represents an association to a dsa. There is one of * these for each association open (a new association is made for each @@ -41,32 +44,17 @@ struct msg { LDAPMod *m_mods; /* for modify operations only */ BerElement *m_ber; /* the unparsed ber for the op */ struct conn *m_conn; /* connection structure */ -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int m_cldap; /* connectionless transport? (CLDAP) */ struct sockaddr m_clientaddr; /* client address (if using CLDAP) */ DN m_searchbase; /* base used in search */ -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ struct msg *m_next; }; #define DEFAULT_TIMEOUT 3600 /* idle client connections */ #define DEFAULT_REFERRAL_TIMEOUT 900 /* DSA connections */ -#ifdef NEEDPROTOS #include "proto-ldapd.h" -#else -extern struct msg *add_msg(); -extern struct msg *get_msg(); -extern struct msg *get_cldap_msg(); -extern int del_msg(); - -extern struct conn *conn_getfd(); -extern struct conn *conn_find(); -extern struct conn *conn_dup(); -extern void conn_del(); -extern AttributeValue ldap_str2AttrV(); -extern DN ldap_str2dn(); -extern void ldap_str2alg(); -extern void ldap_print_algid(); -#endif /* don't need protos */ +#endif diff --git a/servers/ldapd/compare.c b/servers/ldapd/compare.c index 88ac1604f7..7cf0833d10 100644 --- a/servers/ldapd/compare.c +++ b/servers/ldapd/compare.c @@ -10,20 +10,24 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include + +#include + #include #include #include #include #include #include -#include -#include + #include "lber.h" #include "ldap.h" #include "common.h" -#ifdef COMPAT20 +#ifdef HAVE_COMPAT20 extern int ldap_compat; #define COMPTAG (ldap_compat == 20 ? OLD_LDAP_RES_COMPARE : LDAP_RES_COMPARE) #else diff --git a/servers/ldapd/delete.c b/servers/ldapd/delete.c index 57fe76ec07..008f341ee3 100644 --- a/servers/ldapd/delete.c +++ b/servers/ldapd/delete.c @@ -10,20 +10,24 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include + #include #include #include #include #include #include -#include -#include + +#include + #include "lber.h" #include "ldap.h" #include "common.h" -#ifdef COMPAT20 +#ifdef HAVE_COMPAT20 extern int ldap_compat; #define DELTAG (ldap_compat == 20 ? OLD_LDAP_RES_DELETE : LDAP_RES_DELETE) #else diff --git a/servers/ldapd/detach.c b/servers/ldapd/detach.c index ca45fda1a0..672ccfda13 100644 --- a/servers/ldapd/detach.c +++ b/servers/ldapd/detach.c @@ -10,20 +10,17 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#ifdef SVR4 + +#include +#include + #include -#endif /* svr4 */ #include #include #include -#include -#include "portable.h" - -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ detach() @@ -33,11 +30,13 @@ detach() extern int ldap_debug; #endif -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF nbits = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE nbits = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + nbits = FD_SETSIZE +#endif #ifdef FD_SETSIZE if( nbits > FD_SETSIZE ) { @@ -80,14 +79,14 @@ detach() (void) dup2( sd, 2 ); close( sd ); -#ifdef USE_SETSID +#ifdef HAVE_SETSID setsid(); -#else /* USE_SETSID */ +#else /* HAVE_SETSID */ if ( (sd = open( "/dev/tty", O_RDWR )) != -1 ) { (void) ioctl( sd, TIOCNOTTY, NULL ); (void) close( sd ); } -#endif /* USE_SETSID */ +#endif /* HAVE_SETSID */ #ifdef LDAP_DEBUG } #endif diff --git a/servers/ldapd/error.c b/servers/ldapd/error.c index e35448c3f1..5974817988 100644 --- a/servers/ldapd/error.c +++ b/servers/ldapd/error.c @@ -10,14 +10,18 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include + +#include +#include + #include #include #include #include -#include -#include -#include + #include "lber.h" #include "ldap.h" diff --git a/servers/ldapd/kerberos.c b/servers/ldapd/kerberos.c index 5304d3d0a9..5f7d9767a1 100644 --- a/servers/ldapd/kerberos.c +++ b/servers/ldapd/kerberos.c @@ -10,24 +10,22 @@ * is provided ``as is'' without express or implied warranty. */ -#ifdef KERBEROS +#include "portable.h" + +#ifdef HAVE_KERBEROS #include -#include -#ifdef KERBEROS_V -#include -#else -#include -#endif /* KERBEROS_V */ -#include -#include -#include + +#include +#include + #include #if ISODEPACKAGE == IC #include #else #include #endif + #include "lber.h" #include "ldap.h" #include "common.h" diff --git a/servers/ldapd/main.c b/servers/ldapd/main.c index 1be869fbc6..f5f421e512 100644 --- a/servers/ldapd/main.c +++ b/servers/ldapd/main.c @@ -17,32 +17,26 @@ * University of Minnesota Microcomputer Workstation and Networks Center */ +#include "portable.h" + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef _AIX -#include -#endif -#include + +#include +#include +#include +#include +#include +#include +#include + #include #include -#include "portable.h" + #include "lber.h" #include "ldap.h" #include "common.h" -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ - -#ifdef TCP_WRAPPERS +#ifdef HAVE_TCPD #include int allow_severity = LOG_INFO; @@ -52,8 +46,8 @@ int deny_severity = LOG_NOTICE; void log_and_exit(); static set_socket(); static do_queries(); -static SIG_FN wait4child(); -#ifdef CLDAP +static RETSIGTYPE wait4child(); +#ifdef LDAP_CONNECTIONLESS static udp_init(); #endif @@ -61,18 +55,18 @@ static udp_init(); int ldap_debug; #endif int version; -#ifdef COMPAT +#ifdef LDAP_COMPAT int ldap_compat; #endif int dosyslog; int do_tcp = 1; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int do_udp = 0; #endif int idletime = DEFAULT_TIMEOUT; int referral_connection_timeout = DEFAULT_REFERRAL_TIMEOUT; struct timeval conn_start_tv; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS char *krb_ldap_service = "ldapserver"; char *krb_x500_service = "x500dsa"; char *krb_x500_instance; @@ -89,13 +83,13 @@ static usage( name ) char *name; { fprintf( stderr, "usage: %s [-d debuglvl] [-p port] [-l] [-c dsa] [-r referraltimeout]", name ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS fprintf( stderr, " [ -U | -t timeout ]" ); #else fprintf( stderr, " [ -t timeout ]" ); #endif fprintf( stderr, " [-I]" ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS fprintf( stderr, " [-i dsainstance]" ); #endif fprintf( stderr, "\n" ); @@ -106,7 +100,7 @@ int argc; char **argv; { int tcps, ns; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int udps; #endif int myport = LDAP_PORT; @@ -118,7 +112,7 @@ char **argv; int len; int dsapargc; char **dsapargv; - SIG_FN wait4child(); + RETSIGTYPE wait4child(); #ifndef NOSETPROCTITLE char title[80]; extern char **Argv; @@ -146,7 +140,7 @@ char **argv; dsapargv[2] = 0; dsapargv[3] = 0; dsapargc = 1; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS kerberos_keyfile = ""; #endif @@ -185,7 +179,7 @@ char **argv; idletime = atoi( optarg ); break; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case 'f': /* kerberos key file */ kerberos_keyfile = strdup( optarg ); break; @@ -201,7 +195,7 @@ char **argv; RunFromInetd = 1; break; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS case 'U': /* UDP only (no TCP) */ do_tcp = 0; do_udp = 1; @@ -213,7 +207,7 @@ char **argv; break; #endif /* NOTYET */ -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ default: usage( argv[0] ); @@ -226,7 +220,7 @@ char **argv; exit( 1 ); } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_udp && !do_tcp && idletime != DEFAULT_TIMEOUT ) { usage( argv[ 0 ] ); exit( 1 ); @@ -235,11 +229,13 @@ char **argv; Debug( LDAP_DEBUG_TRACE, "%s", Versionstr, 0, 0 ); -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF dtblsize = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE dtblsize = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + dtblsize = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if( dtblsize > FD_SETSIZE ) { @@ -305,17 +301,17 @@ char **argv; len = sizeof( socktype ); getsockopt( ns, SOL_SOCKET, SO_TYPE, &socktype, &len ); if ( socktype == SOCK_DGRAM ) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS Debug( LDAP_DEBUG_ARGS, "CLDAP request from unknown (%s)\n", inet_ntoa( from.sin_addr ), 0, 0 ); conn_start_tv.tv_sec = 0; udp_init( 0, 0 ); do_queries( ns, 1 ); -#else /* CLDAP */ +#else /* LDAP_CONNECTIONLESS */ Debug( LDAP_DEBUG_ARGS, - "Compile with -DCLDAP for UDP support\n",0,0,0 ); -#endif /* CLDAP */ + "Compile with -DLDAP_CONNECTIONLESS for UDP support\n",0,0,0 ); +#endif /* LDAP_CONNECTIONLESS */ exit( 0 ); } @@ -349,7 +345,7 @@ char **argv; if ( do_tcp ) tcps = set_socket( myport, 0 ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_udp ) udps = udp_init( myport, 1 ); #endif @@ -360,7 +356,7 @@ char **argv; */ #ifndef NOSETPROCTITLE -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS sprintf( title, "listening %s/%s %d", do_tcp ? "tcp" : "", do_udp ? "udp" : "", myport ); #else @@ -373,7 +369,7 @@ char **argv; FD_ZERO( &readfds ); if ( do_tcp ) FD_SET( tcps, &readfds ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_udp ) FD_SET( udps, &readfds ); #endif @@ -385,7 +381,7 @@ char **argv; continue; } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( do_udp && FD_ISSET( udps, &readfds ) ) { do_queries( udps, 1 ); } @@ -407,7 +403,7 @@ char **argv; hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr), sizeof(from.sin_addr.s_addr), AF_INET ); -#ifdef TCP_WRAPPERS +#ifdef HAVE_TCPD if ( !hosts_ctl("ldapd", (hp == NULL) ? "unknown" : hp->h_name, inet_ntoa( from.sin_addr ), STRING_UNKNOWN ) { @@ -496,10 +492,10 @@ do_queries( int rc, i; struct timeval timeout; Sockbuf sb; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS struct sockaddr saddr, faddr; struct sockaddr *saddrlist[ 1 ]; -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ Debug( LDAP_DEBUG_TRACE, "do_queries%s\n", udp ? " udp" : "", 0, 0 ); @@ -521,7 +517,7 @@ do_queries( (void) memset( (void *) &sb, '\0', sizeof( sb ) ); sb.sb_sd = clientsock; sb.sb_naddr = ( udp ) ? 1 : 0; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS sb.sb_addrs = (void **)saddrlist; sb.sb_fromaddr = &faddr; sb.sb_useaddr = saddrlist[ 0 ] = &saddr; @@ -645,18 +641,20 @@ static set_socket( return( s ); } -static SIG_FN wait4child() +static RETSIGTYPE wait4child() { - WAITSTATUSTYPE status; +#ifndef HAVE_WAITPID + WAITSTATUSTYPE status; +#endif Debug( LDAP_DEBUG_TRACE, "parent: catching child status\n", 0, 0, 0 ); -#ifdef USE_WAITPID - while( waitpid( (pid_t) -1, 0, WAIT_FLAGS ) > 0 ) +#ifdef HAVE_WAITPID + while( waitpid( (pid_t) -1, NULL, WAIT_FLAGS ) > 0 ) ; /* NULL */ #else - while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 ) - ; /* NULL */ + while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 ) + ; /* NULL */ #endif (void) SIGNAL( SIGCHLD, (void *) wait4child ); @@ -682,7 +680,7 @@ log_and_exit( int exitcode ) } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS static int udp_init( int port, diff --git a/servers/ldapd/message.c b/servers/ldapd/message.c index 19e07f64a4..4456295c2e 100644 --- a/servers/ldapd/message.c +++ b/servers/ldapd/message.c @@ -10,13 +10,16 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include + #include #include + #include "lber.h" #include "ldap.h" #include "common.h" @@ -49,7 +52,7 @@ struct msg *add_msg( new->m_conn->c_refcnt++; new->m_next = NULL; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS new->m_cldap = udp; new->m_searchbase = NULLDN; @@ -106,11 +109,11 @@ del_msg( struct msg *m ) conn_free( cur->m_conn ); modlist_free( cur->m_mods ); ber_free( cur->m_ber, 1 ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( cur->m_searchbase != NULLDN ) { dn_free( cur->m_searchbase ); } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ free( (char *) cur ); return( 0 ); @@ -146,7 +149,7 @@ send_msg( } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS struct msg * get_cldap_msg( int msgid, @@ -169,4 +172,4 @@ get_cldap_msg( return( tmp ); } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ diff --git a/servers/ldapd/modify.c b/servers/ldapd/modify.c index bbfd5ed82a..d2197c4039 100644 --- a/servers/ldapd/modify.c +++ b/servers/ldapd/modify.c @@ -10,16 +10,20 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include + +#include +#include + #include #include #include #include #include #include -#include -#include + #include "lber.h" #include "ldap.h" #include "common.h" @@ -39,7 +43,7 @@ extern short ldap_rtl_syntax; extern short ldap_octetstring_syntax; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 extern int ldap_compat; #define MODTAG (ldap_compat == 20 ? OLD_LDAP_RES_MODIFY : LDAP_RES_MODIFY) #else diff --git a/servers/ldapd/modrdn.c b/servers/ldapd/modrdn.c index d3d939eeb5..33ae4f8406 100644 --- a/servers/ldapd/modrdn.c +++ b/servers/ldapd/modrdn.c @@ -10,20 +10,24 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include + +#include + #include #include #include #include #include #include -#include -#include + #include "lber.h" #include "ldap.h" #include "common.h" -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 extern int ldap_compat; #define MODRDNTAG (ldap_compat == 20 ? OLD_LDAP_RES_MODRDN : LDAP_RES_MODRDN) #else diff --git a/servers/ldapd/proto-ldapd.h b/servers/ldapd/proto-ldapd.h index 9556c84e3d..a317c1ccfd 100644 --- a/servers/ldapd/proto-ldapd.h +++ b/servers/ldapd/proto-ldapd.h @@ -1,158 +1,160 @@ -#ifndef _PROTO_LDAPD -#define _PROTO_LDAPD +#ifndef _PROTO_LDAPD_H +#define _PROTO_LDAPD_H + +#include /* * abandon.c */ -int do_abandon( struct conn *dsaconn, BerElement *ber, int msgid ); +int do_abandon LDAP_P(( struct conn *dsaconn, BerElement *ber, int msgid )); /* * add.c */ -int do_add( Sockbuf *clientsb, struct msg *m, BerElement *ber ); +int do_add LDAP_P(( Sockbuf *clientsb, struct msg *m, BerElement *ber )); /* * association.c */ -struct conn *conn_dup( struct conn *cn ); -int conn_init(); -void conn_free( struct conn *conn ); -void conn_del( struct conn *conn ); -void conn_badfds(); -struct conn *conn_getfd( fd_set *fds ); -void conn_add( struct conn *new ); -struct conn *conn_find( struct conn *c ); -void conn_add( struct conn *new ); -void conn_close(); -int isclosed( int ad ); +struct conn *conn_dup LDAP_P(( struct conn *cn )); +int conn_init LDAP_P(()); +void conn_free LDAP_P(( struct conn *conn )); +void conn_del LDAP_P(( struct conn *conn )); +void conn_badfds LDAP_P(()); +struct conn *conn_getfd LDAP_P(( fd_set *fds )); +void conn_add LDAP_P(( struct conn *new )); +struct conn *conn_find LDAP_P(( struct conn *c )); +void conn_add LDAP_P(( struct conn *new )); +void conn_close LDAP_P(()); +int isclosed LDAP_P(( int ad )); /* * bind.c */ -int do_bind( Sockbuf *clientsb, struct msg *m, BerElement *ber, int *bound ); -int do_bind_real( struct conn *dsaconn, int *bound, char **matched ); +int do_bind LDAP_P(( Sockbuf *clientsb, struct msg *m, BerElement *ber, int *bound )); +int do_bind_real LDAP_P(( struct conn *dsaconn, int *bound, char **matched )); /* * certificate.c */ -int ldap_certif_print( PS ps, struct certificate *parm, int format ); -void ldap_print_algid( PS ps, struct alg_id *parm, int format ); -struct certificate *ldap_str2cert( char *str ); -void ldap_str2alg( char *str, struct alg_id *alg ); -void certif_init(); +int ldap_certif_print LDAP_P(( PS ps, struct certificate *parm, int format )); +void ldap_print_algid LDAP_P(( PS ps, struct alg_id *parm, int format )); +struct certificate *ldap_str2cert LDAP_P(( char *str )); +void ldap_str2alg LDAP_P(( char *str, struct alg_id *alg )); +void certif_init LDAP_P(()); /* * compare.c */ -int do_compare( Sockbuf *clientsb, struct msg *m, BerElement *ber ); +int do_compare LDAP_P(( Sockbuf *clientsb, struct msg *m, BerElement *ber )); /* * delete.c */ -int do_delete( Sockbuf *clientsb, struct msg *m, BerElement *ber ); +int do_delete LDAP_P(( Sockbuf *clientsb, struct msg *m, BerElement *ber )); /* * error.c */ -void print_error( struct DSError *e ); -int x500err2ldaperr( struct DSError *e, char **matched ); +void print_error LDAP_P(( struct DSError *e )); +int x500err2ldaperr LDAP_P(( struct DSError *e, char **matched )); /* * kerberos.c */ -int kerberosv4_ldap_auth( char *cred, long len ); +int kerberosv4_ldap_auth LDAP_P(( char *cred, long len )); /* * main.c */ -void log_and_exit( int exitcode ); +void log_and_exit LDAP_P(( int exitcode )); /* * message.c */ -struct msg *add_msg( int msgid, int msgtype, BerElement *ber, - struct conn *dsaconn, int udp, struct sockaddr *clientaddr ); -struct msg *get_msg( int uniqid ); -int del_msg( struct msg *m ); -void send_msg( struct conn *conn, Sockbuf *clientsb, int err, char *str ); -struct msg * get_cldap_msg( int msgid, int msgtype, struct sockaddr *fromaddr ); +struct msg *add_msg LDAP_P(( int msgid, int msgtype, BerElement *ber, + struct conn *dsaconn, int udp, struct sockaddr *clientaddr )); +struct msg *get_msg LDAP_P(( int uniqid )); +int del_msg LDAP_P(( struct msg *m )); +void send_msg LDAP_P(( struct conn *conn, Sockbuf *clientsb, int err, char *str )); +struct msg * get_cldap_msg LDAP_P(( int msgid, int msgtype, struct sockaddr *fromaddr )); /* * modify.c */ -int do_modify( Sockbuf *clientsb, struct msg *m, BerElement *ber ); -Attr_Sequence get_as( Sockbuf *clientsb, unsigned long op, struct msg *m, - char *type, struct berval **bvals ); -void modlist_free( LDAPMod *mods ); +int do_modify LDAP_P(( Sockbuf *clientsb, struct msg *m, BerElement *ber )); +Attr_Sequence get_as LDAP_P(( Sockbuf *clientsb, unsigned long op, struct msg *m, + char *type, struct berval **bvals )); +void modlist_free LDAP_P(( LDAPMod *mods )); /* * modrdn.c */ -int do_modrdn( Sockbuf *clientsb, struct msg *m, BerElement *ber ); +int do_modrdn LDAP_P(( Sockbuf *clientsb, struct msg *m, BerElement *ber )); /* * request.c */ -void client_request( Sockbuf *clientsb, struct conn *dsaconn, int udp ); -int do_request( Sockbuf *clientsb, struct msg *m, BerElement *ber, - int *bound ); -int initiate_dap_operation( int op, struct msg *m, void *arg ); +void client_request LDAP_P(( Sockbuf *clientsb, struct conn *dsaconn, int udp )); +int do_request LDAP_P(( Sockbuf *clientsb, struct msg *m, BerElement *ber, + int *bound )); +int initiate_dap_operation LDAP_P(( int op, struct msg *m, void *arg )); /* * result.c */ -void dsa_response( struct conn *dsaconn, Sockbuf *clientsb ); -int send_ldap_msgresult( Sockbuf *sb, unsigned long tag, struct msg *m, - int err, char *matched, char *text ); -int send_ldap_result( Sockbuf *sb, unsigned long tag, int msgid, int err, - char *matched, char *text ); +void dsa_response LDAP_P(( struct conn *dsaconn, Sockbuf *clientsb )); +int send_ldap_msgresult LDAP_P(( Sockbuf *sb, unsigned long tag, struct msg *m, + int err, char *matched, char *text )); +int send_ldap_result LDAP_P(( Sockbuf *sb, unsigned long tag, int msgid, int err, + char *matched, char *text )); /* * search.c */ -int do_search( Sockbuf *clientsb, struct msg *m, BerElement *ber ); +int do_search LDAP_P(( Sockbuf *clientsb, struct msg *m, BerElement *ber )); /* * syntax.c */ -void get_syntaxes(); -int dn_print_real( PS ps, DN dn, int format); -void ldap_dn_print( PS ps, DN dn, DN base, int format); -int encode_dn( BerElement *ber, DN dn, DN base); -int encode_attrs( BerElement *ber, Attr_Sequence as ); -AttributeValue bv_octet2AttrV( struct berval *bv ); -AttributeValue bv_asn2AttrV( struct berval *bv ); -AttributeValue ldap_strdn2AttrV( char *dnstr ); -DN ldap_str2dn( char *str ); -RDN ldap_str2rdn( char *rdnstr ); -AttributeValue ldap_str_at2AttrV( char *str, AttributeType type ); -AttributeValue ldap_str2AttrV( char *value, short syntax ); +void get_syntaxes LDAP_P(()); +int dn_print_real LDAP_P(( PS ps, DN dn, int format)); +void ldap_dn_print LDAP_P(( PS ps, DN dn, DN base, int format)); +int encode_dn LDAP_P(( BerElement *ber, DN dn, DN base)); +int encode_attrs LDAP_P(( BerElement *ber, Attr_Sequence as )); +AttributeValue bv_octet2AttrV LDAP_P(( struct berval *bv )); +AttributeValue bv_asn2AttrV LDAP_P(( struct berval *bv )); +AttributeValue ldap_strdn2AttrV LDAP_P(( char *dnstr )); +DN ldap_str2dn LDAP_P(( char *str )); +RDN ldap_str2rdn LDAP_P(( char *rdnstr )); +AttributeValue ldap_str_at2AttrV LDAP_P(( char *str, AttributeType type )); +AttributeValue ldap_str2AttrV LDAP_P(( char *value, short syntax )); /* * util.c */ -void bprint( char *data, int len ); -void charlist_free( char **cl ); -int get_ava( BerElement *ber, AVA *tava ); -int chase_referral( Sockbuf *clientsb, struct msg *m, struct DSError *err, - char **matched ); +void bprint LDAP_P(( char *data, int len )); +void charlist_free LDAP_P(( char **cl )); +int get_ava LDAP_P(( BerElement *ber, AVA *tava )); +int chase_referral LDAP_P(( Sockbuf *clientsb, struct msg *m, struct DSError *err, + char **matched )); #endif /* _proto_ldapd */ diff --git a/servers/ldapd/request.c b/servers/ldapd/request.c index 51b1d13fa1..77d59eb2f5 100644 --- a/servers/ldapd/request.c +++ b/servers/ldapd/request.c @@ -10,25 +10,22 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include + #include #include #include #include -#ifdef __hpux -#include -#else -#include -#endif + #include "lber.h" #include "ldap.h" #include "common.h" @@ -74,7 +71,7 @@ client_request( static int bound; extern char *bound_dn, *bound_pw; struct PSAPaddr *psap_cpy(); -#ifdef COMPAT +#ifdef LDAP_COMPAT extern int ldap_compat; #endif @@ -92,7 +89,7 @@ client_request( log_and_exit( 1 ); } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( udp && dosyslog ) { syslog( LOG_INFO, "UDP request from unknown (%s)", inet_ntoa( ((struct sockaddr_in *) @@ -105,7 +102,7 @@ client_request( trace_ber( tag, len, ber.ber_buf, stderr, 1, 1 ); #endif -#ifdef COMPAT +#ifdef LDAP_COMPAT /* * This tag should be a normal SEQUENCE tag. In release 2.0 this * tag is 0x10. In the new stuff this is 0x30. To distinguish @@ -159,7 +156,7 @@ client_request( return; } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( udp ) { char *logdn = NULL; @@ -172,16 +169,16 @@ client_request( free( logdn ); } } -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) tag = ber_skip_tag( &ber, &len ); else #endif tag = ber_peek_tag( &ber, &len ); if ( !udp && bound == 0 && tag != LDAP_REQ_BIND -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 && tag != OLD_LDAP_REQ_BIND #endif ) { @@ -191,7 +188,7 @@ client_request( return; } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if (udp && tag != LDAP_REQ_SEARCH && tag != LDAP_REQ_ABANDON ) { send_ldap_result( clientsb, tag, msgid, LDAP_OPERATIONS_ERROR, NULL, "Only search is supported over UDP/CLDAP" ); @@ -216,7 +213,7 @@ client_request( copyofber = ber_dup( &ber ); m = add_msg( msgid, tag, copyofber, dsaconn, udp, -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS (struct sockaddr *)clientsb->sb_fromaddr ); #else NULL ); @@ -257,17 +254,17 @@ do_request( Debug( LDAP_DEBUG_TRACE, "do_request\n", 0, 0, 0 ); switch ( m->m_msgtype ) { -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_BIND: #endif case LDAP_REQ_BIND: resp_required = do_bind( clientsb, m, ber, bound ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_UNBIND: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_REQ_UNBIND_30: #endif case LDAP_REQ_UNBIND: @@ -275,55 +272,55 @@ do_request( log_and_exit( 0 ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_ADD: #endif case LDAP_REQ_ADD: resp_required = do_add( clientsb, m, ber ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_DELETE: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_REQ_DELETE_30: #endif case LDAP_REQ_DELETE: resp_required = do_delete( clientsb, m, ber ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_MODRDN: #endif case LDAP_REQ_MODRDN: resp_required = do_modrdn( clientsb, m, ber ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_MODIFY: #endif case LDAP_REQ_MODIFY: resp_required = do_modify( clientsb, m, ber ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_COMPARE: #endif case LDAP_REQ_COMPARE: resp_required = do_compare( clientsb, m, ber ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_SEARCH: #endif case LDAP_REQ_SEARCH: resp_required = do_search( clientsb, m, ber ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_ABANDON: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_REQ_ABANDON_30: #endif case LDAP_REQ_ABANDON: diff --git a/servers/ldapd/result.c b/servers/ldapd/result.c index 3f77032342..22eb9b933c 100644 --- a/servers/ldapd/result.c +++ b/servers/ldapd/result.c @@ -10,25 +10,24 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include +#include + #include #include #include -#ifdef __hpux -#include -#else -#include -#endif + #include "lber.h" #include "ldap.h" #include "common.h" extern int dosyslog; -#ifdef COMPAT +#ifdef LDAP_COMPAT extern int ldap_compat; #endif @@ -131,7 +130,7 @@ dsa_response( return; } if ( m->m_msgtype == LDAP_REQ_SEARCH -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 || m->m_msgtype == OLD_LDAP_REQ_SEARCH #endif ) @@ -154,7 +153,7 @@ dsa_response( int bound, rc; switch ( m->m_msgtype ) { -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_REQ_ADD: case OLD_LDAP_REQ_MODIFY: case OLD_LDAP_REQ_MODRDN: @@ -162,7 +161,7 @@ dsa_response( case OLD_LDAP_REQ_COMPARE: case OLD_LDAP_REQ_SEARCH: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_REQ_DELETE_30: #endif case LDAP_REQ_ADD: @@ -283,7 +282,7 @@ send_ldap_msgresult( char *text ) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( m->m_cldap ) { SAFEMEMCPY( (char *)sb->sb_useaddr, &m->m_clientaddr, sizeof( struct sockaddr )); @@ -308,19 +307,19 @@ send_ldap_result( { BerElement *ber; int rc; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int cldap; #endif extern int version; -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS cldap = ( sb->sb_naddr > 0 ); #endif Debug( LDAP_DEBUG_TRACE, "send_ldap_result\n", 0, 0, 0 ); if ( tag == LBER_DEFAULT ) -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 tag = ldap_compat == 20 ? OLD_LBER_SEQUENCE : LBER_SEQUENCE; #else tag = LBER_SEQUENCE; @@ -332,20 +331,20 @@ send_ldap_result( } if ( version != 1 ) { -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 if ( ldap_compat == 20 ) { rc = ber_printf( ber, "t{it{tess}}", OLD_LBER_SEQUENCE, msgid, tag, LBER_INTEGER, err, matched ? matched : "", text ); } else #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) { rc = ber_printf( ber, "{it{{ess}}}", msgid, tag, err, matched ? matched : "", text ); } else #endif -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( cldap ) { rc = ber_printf( ber, "{is{t{ess}}}", msgid, "", tag, err, matched ? matched : "", text ); diff --git a/servers/ldapd/search.c b/servers/ldapd/search.c index b250d6371a..c923ce4720 100644 --- a/servers/ldapd/search.c +++ b/servers/ldapd/search.c @@ -10,16 +10,20 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include + +#include +#include + #include #include #include #include #include #include -#include -#include + #include "lber.h" #include "ldap.h" #include "common.h" @@ -28,7 +32,7 @@ static get_filter(); static get_filter_list(); static get_substring_filter(); -#ifdef COMPAT +#ifdef LDAP_COMPAT extern int version; extern int ldap_compat; #define SEARCHRESTAG (ldap_compat == 20 ? OLD_LDAP_RES_SEARCH_RESULT : LDAP_RES_SEARCH_RESULT) @@ -182,11 +186,11 @@ do_search( rc = initiate_dap_operation( OP_SEARCH, m, &sa ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( m->m_cldap ) m->m_searchbase = sa.sra_baseobject; else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ dn_free( sa.sra_baseobject ); filter_free( sa.sra_filter ); @@ -240,14 +244,14 @@ static get_filter( BerElement *ber, Filter *filt ) err = 0; switch (tag = ber_peek_tag( ber, &len )) { -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_EQUALITY: #endif case LDAP_FILTER_EQUALITY: Debug( LDAP_DEBUG_ARGS, "EQUALITY\n", 0, 0, 0 ); f->flt_type = FILTER_ITEM; f->FUITEM.fi_type = FILTERITEM_EQUALITY; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) (void) ber_skip_tag( ber, &len ); #endif @@ -258,7 +262,7 @@ static get_filter( BerElement *ber, Filter *filt ) } break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_SUBSTRINGS: #endif case LDAP_FILTER_SUBSTRINGS: @@ -266,14 +270,14 @@ static get_filter( BerElement *ber, Filter *filt ) err = get_substring_filter( ber, f ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_GE: #endif case LDAP_FILTER_GE: Debug( LDAP_DEBUG_ARGS, "GE\n", 0, 0, 0 ); f->flt_type = FILTER_ITEM; f->FUITEM.fi_type = FILTERITEM_GREATEROREQUAL; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) (void) ber_skip_tag( ber, &len ); #endif @@ -283,14 +287,14 @@ static get_filter( BerElement *ber, Filter *filt ) } break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_LE: #endif case LDAP_FILTER_LE: Debug( LDAP_DEBUG_ARGS, "LE\n", 0, 0, 0 ); f->flt_type = FILTER_ITEM; f->FUITEM.fi_type = FILTERITEM_LESSOREQUAL; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) (void) ber_skip_tag( ber, &len ); #endif @@ -301,10 +305,10 @@ static get_filter( BerElement *ber, Filter *filt ) } break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_PRESENT: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_FILTER_PRESENT_30: #endif case LDAP_FILTER_PRESENT: @@ -312,7 +316,7 @@ static get_filter( BerElement *ber, Filter *filt ) f->flt_type = FILTER_ITEM; f->FUITEM.fi_type = FILTERITEM_PRESENT; len = sizeof(typestr); -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) (void) ber_skip_tag( ber, &len ); #endif @@ -323,14 +327,14 @@ static get_filter( BerElement *ber, Filter *filt ) return( LDAP_UNDEFINED_TYPE ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_APPROX: #endif case LDAP_FILTER_APPROX: Debug( LDAP_DEBUG_ARGS, "APPROX\n", 0, 0, 0 ); f->flt_type = FILTER_ITEM; f->FUITEM.fi_type = FILTERITEM_APPROX; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) (void) ber_skip_tag( ber, &len ); #endif @@ -341,7 +345,7 @@ static get_filter( BerElement *ber, Filter *filt ) } break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_AND: #endif case LDAP_FILTER_AND: @@ -350,7 +354,7 @@ static get_filter( BerElement *ber, Filter *filt ) err = get_filter_list( ber, f ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_OR: #endif case LDAP_FILTER_OR: @@ -359,7 +363,7 @@ static get_filter( BerElement *ber, Filter *filt ) err = get_filter_list( ber, f ); break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_FILTER_NOT: #endif case LDAP_FILTER_NOT: @@ -389,7 +393,7 @@ static get_filter_list( BerElement *ber, Filter f ) Debug( LDAP_DEBUG_TRACE, "get_filter_list\n", 0, 0, 0 ); -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) (void) ber_skip_tag( ber, &len ); #endif @@ -422,7 +426,7 @@ static get_substring_filter( BerElement *ber, Filter f ) Debug( LDAP_DEBUG_TRACE, "get_substring_filter\n", 0, 0, 0 ); -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) (void) ber_skip_tag( ber, &len ); #endif @@ -444,7 +448,7 @@ static get_substring_filter( BerElement *ber, Filter f ) tag = ber_next_element( ber, &len, last ) ) { AV_Sequence avs, any_end; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) { if ( ber_scanf( ber, "{a}", &valstr ) == LBER_ERROR ) { return( LDAP_PROTOCOL_ERROR ); @@ -466,10 +470,10 @@ static get_substring_filter( BerElement *ber, Filter f ) return( LDAP_OPERATIONS_ERROR ); switch ( tag ) { -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_SUBSTRING_INITIAL: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_SUBSTRING_INITIAL_30: #endif case LDAP_SUBSTRING_INITIAL: @@ -482,10 +486,10 @@ static get_substring_filter( BerElement *ber, Filter f ) f->FUITEM.UNSUB.fi_sub_initial = avs; break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_SUBSTRING_ANY: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_SUBSTRING_ANY_30: #endif case LDAP_SUBSTRING_ANY: @@ -500,10 +504,10 @@ static get_substring_filter( BerElement *ber, Filter f ) any_end = avs; break; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 case OLD_LDAP_SUBSTRING_FINAL: #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_SUBSTRING_FINAL_30: #endif case LDAP_SUBSTRING_FINAL: @@ -546,7 +550,7 @@ search_result( correlate_search_results( sr ); } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( m->m_cldap ) { if ((ber = der_alloc()) == NULLBER ) { send_ldap_msgresult( sb, SEARCHRESTAG, m, @@ -565,9 +569,9 @@ search_result( for ( e = sr->CSR_entries; e != NULLENTRYINFO; e = e->ent_next ) { Debug( LDAP_DEBUG_ARGS, "\tentry:\n", 0, 0, 0 ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( !m->m_cldap ) -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ if ( (ber = der_alloc()) == NULLBER ) { send_ldap_msgresult( sb, SEARCHRESTAG, m, @@ -575,7 +579,7 @@ search_result( return; } -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 if ( version == 1 ) { if ( ber_printf( ber, "t{it{", OLD_LBER_SEQUENCE, m->m_msgid, OLD_LDAP_RES_SEARCH_ENTRY ) == -1 ) { @@ -585,7 +589,7 @@ search_result( } } else #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) { if ( ber_printf( ber, "{it{{", m->m_msgid, LDAP_RES_SEARCH_ENTRY ) == -1 ) { @@ -595,11 +599,11 @@ search_result( } } else #endif -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( m->m_cldap ) rc = ber_printf( ber, "t{", LDAP_RES_SEARCH_ENTRY ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ rc = ber_printf( ber, "{it{", m->m_msgid, LDAP_RES_SEARCH_ENTRY ); @@ -609,10 +613,10 @@ search_result( return; } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( m->m_cldap ) rc = encode_dn( ber, e->ent_dn, m->m_searchbase ); -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ else rc = encode_dn( ber, e->ent_dn, NULLDN ); @@ -628,7 +632,7 @@ search_result( return; } -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 if ( version == 1 ) { if ( ber_printf( ber, "}}" ) == -1 ) { send_ldap_msgresult( sb, SEARCHRESTAG, m, @@ -638,7 +642,7 @@ search_result( } } else #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( ldap_compat == 30 ) { if ( ber_printf( ber, "}}}" ) == -1 ) { send_ldap_msgresult( sb, SEARCHRESTAG, m, @@ -648,11 +652,11 @@ search_result( } } else #endif -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( m->m_cldap ) rc = ber_printf( ber, "}" ); else -#endif /* CLDAP */ +#endif /* LDAP_CONNECTIONLESS */ rc = ber_printf( ber, "}}" ); if ( rc == -1 ) { @@ -667,7 +671,7 @@ search_result( ber->ber_buf, stderr, 0, 0 ); #endif -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( !m->m_cldap ) #endif (void) ber_flush( sb, ber, 1 ); @@ -688,7 +692,7 @@ search_result( Debug( LDAP_DEBUG_ARGS, "\tresult:\n", 0, 0, 0 ); -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( m->m_cldap ) { if ( ber_printf( ber, "t{ess}}}", SEARCHRESTAG, rc, "", "" ) == -1 ) { diff --git a/servers/ldapd/setproctitle.c b/servers/ldapd/setproctitle.c index e1022ee75b..a3f4bc3a3e 100644 --- a/servers/ldapd/setproctitle.c +++ b/servers/ldapd/setproctitle.c @@ -1,3 +1,5 @@ +#include "portable.h" + #ifndef NOSETPROCTITLE /* * Copyright (c) 1990,1991 Regents of the University of Michigan. diff --git a/servers/ldapd/syntax.c b/servers/ldapd/syntax.c index 8569478eeb..5124e1400f 100644 --- a/servers/ldapd/syntax.c +++ b/servers/ldapd/syntax.c @@ -10,17 +10,21 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include + +#include +#include +#include + #include #include #include #include #include #include -#include -#include + #include "lber.h" #include "ldap.h" #include "common.h" @@ -544,7 +548,7 @@ int encode_attrs( BerElement *ber, Attr_Sequence as ) { PS ps; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 extern int ldap_compat; #endif @@ -555,7 +559,7 @@ encode_attrs( BerElement *ber, Attr_Sequence as ) if ( str_setup( ps, NULLCP, 0, 0 ) == NOTOK ) return( -1 ); -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 if ( ber_printf( ber, "t{", ldap_compat == 20 ? OLD_LBER_SEQUENCE : LBER_SEQUENCE ) == -1 ) { #else @@ -570,7 +574,7 @@ encode_attrs( BerElement *ber, Attr_Sequence as ) AttrT_print( ps, as->attr_type, EDBOUT ); *ps->ps_ptr = '\0'; -#ifdef COMPAT20 +#ifdef LDAP_COMPAT20 if ( ber_printf( ber, "t{st[", ldap_compat == 20 ? OLD_LBER_SEQUENCE : LBER_SEQUENCE, ps->ps_base, ldap_compat == 20 ? OLD_LBER_SET : LBER_SET ) == -1 ) { diff --git a/servers/ldapd/util.c b/servers/ldapd/util.c index 27ecea9a5a..965d1cd78c 100644 --- a/servers/ldapd/util.c +++ b/servers/ldapd/util.c @@ -10,15 +10,20 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include +#include +#include + #include -#include -#include + #include #include + #include "lber.h" #include "ldap.h" #include "common.h" diff --git a/servers/slapd/Makefile.in b/servers/slapd/Makefile.in new file mode 100644 index 0000000000..55d3cedf34 --- /dev/null +++ b/servers/slapd/Makefile.in @@ -0,0 +1,112 @@ +## +## Makefile.in for slapd +## +PROGRAMS=slapd +XPROGRAMS=libbackends.a .backend +SRCS = main.c daemon.c connection.c search.c filter.c add.c charray.c \ + attr.c entry.c config.c backend.c result.c operation.c \ + dn.c compare.c modify.c delete.c modrdn.c ch_malloc.c \ + value.c ava.c bind.c unbind.c abandon.c filterentry.c \ + phonetic.c acl.c str2filter.c aclparse.c init.c \ + detach.c repl.c lock.c \ + suffixAlias.c schema.c schemaparse.c monitor.c configinfo.c +OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \ + attr.o entry.o config.o backend.o result.o operation.o \ + dn.o compare.o modify.o delete.o modrdn.o ch_malloc.o \ + value.o ava.o bind.o unbind.o abandon.o filterentry.o \ + phonetic.o acl.o str2filter.o aclparse.o init.o \ + detach.o repl.o lock.o \ + suffixalias.o schema.o schemaparse.o monitor.o configinfo.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +BUILD_OPT = "--enable-slapd" +BUILD_SRV = @BUILD_SLAPD@ + +all-local: FORCE + $(MAKE) $(MFLAGS) backendslib + $(MAKE) $(MFLAGS) slapd + (cd tools; $(MAKE) $(MFLAGS) all) + +XLIBS = @SLAPD_LIBS@ libbackends.a \ + -lavl -llutil -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@ @LUTIL_LIBS@ + +slapd: version.o + $(CC) $(LDFLGS) -o $@ $(OBJS) version.o $(LIBS) + +backendslib: FORCE + @for i in back-*; do \ + if [ -d $$i ]; then \ + echo " "; echo " cd $$i; $(MAKE) $(MFLAGS) all"; \ + ( cd $$i; $(MAKE) $(MFLAGS) all ); \ + fi; \ + done; \ + echo " "; \ + $(MAKE) $(MFLAGS) libbackends.a + +libbackends.a: .backend + @$(RM) -r tmp + @$(MKDIR) tmp + @-for i in back-*/*.a; do \ + ( \ + cd tmp; \ + $(AR) x ../$$i; \ + pre=`echo $$i | sed -e 's/\/.*$$//' -e 's/back-//'`; \ + for j in *.o; do \ + mv $$j $${pre}$$j; \ + done; \ + $(AR) ruv libbackends.a *.o 2>&1 | grep -v truncated; \ + $(RM) *.o __.SYMDEF; \ + echo "added backend library $$i"; \ + ); \ + done + @mv -f tmp/libbackends.a ./libbackends.a + @$(RM) -r tmp + @if [ ! -z "$(RANLIB)" ]; then \ + $(RANLIB) libbackends.a; \ + fi + @ls -l libbackends.a + +version.c: libbackends.a $(OBJS) $(LDAP_LIBDEPEND) \ + $(LDAP_LIBDIR)/libldbm.a \ + $(LDAP_LIBDIR)/libavl.a \ + $(LDAP_LIBDIR)/libldif.a \ + $(LDAP_LIBDIR)/liblutil.a \ + $(LDAP_LIBDIR)/liblthread.a + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +clean-local: FORCE + @for i in back-* tools; do \ + if [ -d $$i ]; then \ + echo; echo " cd $$i; $(MAKE) $(MFLAGS) clean"; \ + ( cd $$i; $(MAKE) $(MFLAGS) clean ); \ + fi; \ + done + +install-local: install-slapd install-conf install-tools + +install-slapd: FORCE + @-$(MKDIR) $(libexecdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 slapd $(libexecdir) + +install-conf: FORCE + @-$(MKDIR) -p $(sysconfdir) + $(SED) -e 's;%SYSCONFDIR%;$(sysconfdir);' slapd.conf > /tmp/slapd.$$ + -$(MV) $(sysconfdir)/slapd.conf $(sysconfdir)/slapd.conf- + $(INSTALL) $(INSTALLFLAGS) -m 644 /tmp/slapd.$$ $(sysconfdir)/slapd.conf + $(RM) -f /tmp/slapd.$$ + -$(MV) $(sysconfdir)/slapd.at.conf $(sysconfdir)/slapd.at.conf- + $(INSTALL) $(INSTALLFLAGS) -m 644 slapd.at.conf $(sysconfdir) + -$(MV) $(sysconfdir)/slapd.oc.conf $(sysconfdir)/slapd.oc.conf- + $(INSTALL) $(INSTALLFLAGS) -m 644 slapd.oc.conf $(sysconfdir) + +install-tools: FORCE + @-$(MKDIR) $(sbindir) + (cd tools; $(MAKE) $(MFLAGS) install) + diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index d6f7291c78..fb9d1be4b2 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -12,9 +12,11 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include +#include + #include "slap.h" extern Backend *select_backend(); diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 435ae709a0..15d02dfd52 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -1,12 +1,12 @@ /* acl.c - routines to parse and check acl's */ +#include "portable.h" + #include -#include -#include -#include -#include -#include -#include + +#include +#include +#include #include "slap.h" @@ -360,7 +360,7 @@ acl_access_allowed( return( (b->a_access & ~ACL_SELF) >= access ); } -#ifdef ACLGROUP +#ifdef SLAPD_ACLGROUPS if ( b->a_group != NULL && op->o_dn != NULL ) { char buf[512]; @@ -384,7 +384,7 @@ acl_access_allowed( return( (b->a_access & ~ACL_SELF) >= access ); } } -#endif /* ACLGROUP */ +#endif /* SLAPD_ACLGROUPS */ } if ( odn ) free( odn ); diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index 3d853222c6..4e92136f92 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -1,17 +1,16 @@ /* acl.c - routines to parse and check acl's */ +#include "portable.h" #include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include #include "slap.h" -#include "portable.h" extern Filter *str2filter(); extern struct acl *global_acl; @@ -209,11 +208,11 @@ parse_acl( } else if ( strcasecmp( left, "dnattr" ) == 0 ) { b->a_dnattr = strdup( right ); -#ifdef ACLGROUP +#ifdef SLAPD_ACLGROUPS } else if ( strcasecmp( left, "group" ) == 0 ) { regtest(fname, lineno, right); b->a_group = dn_upcase(strdup( right )); -#endif /* ACLGROUP */ +#endif /* SLAPD_ACLGROUPS */ } else if ( strcasecmp( left, "domain" ) == 0 ) { char *s; regtest(fname, lineno, right); diff --git a/servers/slapd/add.c b/servers/slapd/add.c index b05acd47fc..110e3d365d 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -10,11 +10,14 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include +#include + #include "slap.h" extern Backend *select_backend(); diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 7686d94767..1aa2392395 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -1,15 +1,24 @@ /* attr.c - routines for dealing with attributes */ +#include "portable.h" + #include -#include -#include + +#ifdef HAVE_FCNTL_H #include -#include -#include -#include +#endif + +#include +#include +#include +#include + +#ifdef HAVE_SYS_PARAM_H #include +#endif + #include -#include "portable.h" + #include "slap.h" extern char **charray_dup(); @@ -298,7 +307,7 @@ attr_syntax_config( a->asi_names = charray_dup( argv ); argv[lasti] = save; - switch ( avl_insert( &attr_syntaxes, a, attr_syntax_cmp, + switch ( avl_insert( &attr_syntaxes, (caddr_t) a, attr_syntax_cmp, attr_syntax_dup ) ) { case -1: /* duplicate - different syntaxes */ Debug( LDAP_DEBUG_ARGS, "%s: line %d: duplicate attribute\n", diff --git a/servers/slapd/ava.c b/servers/slapd/ava.c index ef0487c7aa..1e10339cb2 100644 --- a/servers/slapd/ava.c +++ b/servers/slapd/ava.c @@ -1,9 +1,12 @@ /* ava.c - routines for dealing with attribute value assertions */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" int diff --git a/servers/slapd/back-ldbm/Makefile.in b/servers/slapd/back-ldbm/Makefile.in new file mode 100644 index 0000000000..9ad580055f --- /dev/null +++ b/servers/slapd/back-ldbm/Makefile.in @@ -0,0 +1,36 @@ +SRCS = idl.c add.c search.c cache.c dbcache.c dn2id.c id2entry.c \ + index.c id2children.c nextid.c abandon.c compare.c group.c \ + modify.c modrdn.c delete.c init.c config.c bind.c attr.c \ + filterindex.c unbind.c kerberos.c close.c alias.c +OBJS = idl.o add.o search.o cache.o dbcache.o dn2id.o id2entry.o \ + index.o id2children.o nextid.o abandon.o compare.o group.o \ + modify.o modrdn.o delete.o init.o config.o bind.o attr.o \ + filterindex.o unbind.o kerberos.o close.o alias.o + +LDAP_INCDIR= ../../../include +LDAP_LIBDIR= ../../../libraries + +BUILD_OPT = "--enable-ldbm" +BUILD_SRV = @BUILD_LDBM@ + +XINCPATH = -I.. -I$(srcdir)/.. + +PROGRAMS = libback-ldbm.a + +all-local: FORCE + $(MAKE) $(MFLAGS) libback-ldbm.a + +libback-ldbm.a: version.o + $(AR) ruv $@ $(OBJS) version.o + @$(RANLIB) $@ + @touch ../.backend + +version.c: $(OBJS) $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` \ + h=`$(HOSTNAME)` t=`$(DATE)`; \ + $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + diff --git a/servers/slapd/back-ldbm/abandon.c b/servers/slapd/back-ldbm/abandon.c index 8ed2dfd5cb..8f1ca0e040 100644 --- a/servers/slapd/back-ldbm/abandon.c +++ b/servers/slapd/back-ldbm/abandon.c @@ -1,5 +1,7 @@ /* abandon.c - ldbm backend abandon routine */ +#include "portable.h" + ldbm_back_abandon() { } diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 797398ad4b..eebcf4a257 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -1,9 +1,12 @@ /* add.c - ldap ldbm back-end add routine */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" diff --git a/servers/slapd/back-ldbm/attr.c b/servers/slapd/back-ldbm/attr.c index d0bb831c26..ea9694857f 100644 --- a/servers/slapd/back-ldbm/attr.c +++ b/servers/slapd/back-ldbm/attr.c @@ -1,9 +1,12 @@ /* attr.c - backend routines for dealing with attributes */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" @@ -141,7 +144,7 @@ attr_index_config( a->ai_indexmask |= INDEX_FROMINIT; } - switch (avl_insert( &li->li_attrs, a, ainfo_cmp, ainfo_dup )) { + switch (avl_insert( &li->li_attrs, (caddr_t) a, ainfo_cmp, ainfo_dup )) { case 1: /* duplicate - updating init version */ free( a->ai_type ); free( (char *) a ); diff --git a/servers/slapd/back-ldbm/back-ldbm.h b/servers/slapd/back-ldbm/back-ldbm.h index e3099ab21a..dda1ff8452 100644 --- a/servers/slapd/back-ldbm/back-ldbm.h +++ b/servers/slapd/back-ldbm/back-ldbm.h @@ -5,9 +5,11 @@ #include "ldbm.h" +LDAP_BEGIN_DECL + #define DEFAULT_CACHE_SIZE 1000 -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 # define DEFAULT_DBCACHE_SIZE (100 * DEFAULT_DB_PAGE_SIZE) #else # define DEFAULT_DBCACHE_SIZE 100000 @@ -114,8 +116,8 @@ struct ldbminfo { pthread_cond_t li_dbcache_cv; }; -#ifdef NEEDPROTOS #include "proto-back-ldbm.h" -#endif + +LDAP_END_DECL #endif /* _back_ldbm_h_ */ diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index 8207cb59e9..d1224a2dfd 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -1,45 +1,35 @@ /* bind.c - ldbm backend bind and unbind routines */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" -#ifdef KERBEROS -#ifdef KERBEROS_V -#include -#else -#include -#endif /* KERBEROS_V */ -#endif /* KERBEROS */ - -#ifdef LDAP_CRYPT -/* change for crypted passwords -- lukeh */ -#ifdef __NeXT__ -extern char *crypt (char *key, char *salt); -#else -#include -#endif -#endif /* LDAP_CRYPT */ -#ifdef LDAP_SHA1 +#ifdef SLAPD_SHA1 #include -#endif /* LDAP_SHA1 */ -#ifdef LDAP_MD5 +#endif /* SLAPD_SHA1 */ + +#ifdef SLAPD_MD5 #include -#endif /* LDAP_MD5 */ +#endif /* SLAPD_MD5 */ #include extern Attribute *attr_find(); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS extern int krbv4_ldap_auth(); #endif -#ifdef LDAP_CRYPT +#ifdef SLAPD_CRYPT pthread_mutex_t crypt_mutex; static int @@ -63,17 +53,19 @@ crypted_value_find( return ( 0 ); } pthread_mutex_unlock( &crypt_mutex ); -#ifdef LDAP_MD5 +#ifdef SLAPD_MD5 } else if ( syntax != SYNTAX_BIN && strncasecmp( "{MD5}", vals[i]->bv_val, (sizeof("{MD5}") - 1 ) ) == 0 ) { - MD5_CTX MD5context; + ldap_MD5_CTX MD5context; unsigned char MD5digest[20]; char base64digest[29]; /* ceiling(sizeof(input)/3) * 4 + 1 */ char *userpassword = vals[i]->bv_val + sizeof("{MD5}") - 1; ldap_MD5Init(&MD5context); - ldap_MD5Update(&MD5context, cred->bv_val, strlen(cred->bv_val)); + ldap_MD5Update(&MD5context, + (unsigned char *) cred->bv_val, + strlen(cred->bv_val)); ldap_MD5Final(MD5digest, &MD5context); if (b64_ntop(MD5digest, sizeof(MD5digest), @@ -85,18 +77,20 @@ crypted_value_find( if (strcmp(userpassword, base64digest) == 0) { return ( 0 ); } -#endif /* LDAP_MD5 */ -#ifdef LDAP_SHA1 +#endif /* SLAPD_MD5 */ +#ifdef SLAPD_SHA1 } else if ( syntax != SYNTAX_BIN && strncasecmp( "{SHA}", vals[i]->bv_val, (sizeof("{SHA}") - 1 ) ) == 0 ) { - SHA1_CTX SHA1context; + ldap_SHA1_CTX SHA1context; unsigned char SHA1digest[20]; char base64digest[29]; /* ceiling(sizeof(input)/3) * 4 + 1 */ char *userpassword = vals[i]->bv_val + sizeof("{SHA}") - 1; ldap_SHA1Init(&SHA1context); - ldap_SHA1Update(&SHA1context, cred->bv_val, strlen(cred->bv_val)); + ldap_SHA1Update(&SHA1context, + (unsigned char *) cred->bv_val, + strlen(cred->bv_val)); ldap_SHA1Final(SHA1digest, &SHA1context); if (b64_ntop(SHA1digest, sizeof(SHA1digest), @@ -108,7 +102,7 @@ crypted_value_find( if (strcmp(userpassword, base64digest) == 0) { return ( 0 ); } -#endif /* LDAP_SHA1 */ +#endif /* SLAPD_SHA1 */ } else { if ( value_cmp( vals[i], v, syntax, normalize ) == 0 ) { return( 0 ); @@ -118,7 +112,7 @@ crypted_value_find( return( 1 ); } -#endif /* LDAP_CRYPT */ +#endif /* SLAPD_CRYPT */ int ldbm_back_bind( @@ -135,7 +129,7 @@ ldbm_back_bind( Attribute *a; int rc; char *matched = NULL; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS char krbname[MAX_K_NAME_SZ + 1]; AUTH_DAT ad; #endif @@ -193,7 +187,7 @@ ldbm_back_bind( goto return_results; } -#ifdef LDAP_CRYPT +#ifdef SLAPD_CRYPT if ( crypted_value_find( a->a_vals, cred, a->a_syntax, 0, cred ) != 0 ) #else if ( value_find( a->a_vals, cred, a->a_syntax, 0 ) != 0 ) @@ -212,7 +206,7 @@ ldbm_back_bind( rc = 0; break; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case LDAP_AUTH_KRBV41: if ( krbv4_ldap_auth( be, cred, &ad ) != LDAP_SUCCESS ) { send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS, diff --git a/servers/slapd/back-ldbm/cache.c b/servers/slapd/back-ldbm/cache.c index 4e0b061576..940a226b84 100644 --- a/servers/slapd/back-ldbm/cache.c +++ b/servers/slapd/back-ldbm/cache.c @@ -1,9 +1,12 @@ /* cache.c - routines to maintain an in-core cache of entries */ +#include "portable.h" + #include -#include -#include + +#include #include "slap.h" + #include "back-ldbm.h" static int cache_delete_entry_internal(); @@ -132,8 +135,9 @@ cache_add_entry_lock( /* set cache mutex */ pthread_mutex_lock( &cache->c_mutex ); - if ( avl_insert( &cache->c_dntree, e, cache_entrydn_cmp, avl_dup_error ) - != 0 ) { + if ( avl_insert( &cache->c_dntree, (caddr_t) e, + cache_entrydn_cmp, avl_dup_error ) != 0 ) + { Debug( LDAP_DEBUG_TRACE, "====> cache_add_entry lock: entry %20s id %d already in dn cache\n", e->e_dn, e->e_id, 0 ); @@ -144,15 +148,17 @@ cache_add_entry_lock( } /* id tree */ - if ( avl_insert( &cache->c_idtree, e, cache_entryid_cmp, avl_dup_error ) - != 0 ) { + if ( avl_insert( &cache->c_idtree, (caddr_t) e, + cache_entryid_cmp, avl_dup_error ) != 0 ) + { Debug( LDAP_DEBUG_ANY, "====> entry %20s id %d already in id cache\n", e->e_dn, e->e_id, 0 ); /* delete from dn tree inserted above */ - if ( avl_delete( &cache->c_dntree, e, cache_entrydn_cmp ) - == NULL ) { + if ( avl_delete( &cache->c_dntree, (caddr_t) e, + cache_entrydn_cmp ) == NULL ) + { Debug( LDAP_DEBUG_ANY, "====> can't delete from dn cache\n", 0, 0, 0 ); } @@ -226,9 +232,9 @@ cache_find_entry_dn2id( e.e_dn = dn; - if ( (ep = (Entry *) avl_find( cache->c_dntree, &e, cache_entrydn_cmp )) - != NULL ) { - + if ( (ep = (Entry *) avl_find( cache->c_dntree, (caddr_t) &e, + cache_entrydn_cmp )) != NULL ) + { Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_dn2id: found dn: %s\n", dn, 0, 0); @@ -307,9 +313,9 @@ cache_find_entry_id( e.e_id = id; - if ( (ep = (Entry *) avl_find( cache->c_idtree, &e, cache_entryid_cmp )) - != NULL ) { - + if ( (ep = (Entry *) avl_find( cache->c_idtree, (caddr_t) &e, + cache_entryid_cmp )) != NULL ) + { Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_dn2id: found id: %ld rw: %d\n", id, rw, 0); @@ -407,12 +413,16 @@ cache_delete_entry_internal( ) { /* dn tree */ - if ( avl_delete( &cache->c_dntree, e, cache_entrydn_cmp ) == NULL ) { + if ( avl_delete( &cache->c_dntree, (caddr_t) e, cache_entrydn_cmp ) + == NULL ) + { return( -1 ); } /* id tree */ - if ( avl_delete( &cache->c_idtree, e, cache_entryid_cmp ) == NULL ) { + if ( avl_delete( &cache->c_idtree, (caddr_t) e, cache_entryid_cmp ) + == NULL ) + { return( -1 ); } diff --git a/servers/slapd/back-ldbm/close.c b/servers/slapd/back-ldbm/close.c index d6758e143b..f300d9f92d 100644 --- a/servers/slapd/back-ldbm/close.c +++ b/servers/slapd/back-ldbm/close.c @@ -1,8 +1,11 @@ /* close.c - close ldbm backend */ +#include "portable.h" + #include -#include -#include + +#include + #include "slap.h" #include "back-ldbm.h" diff --git a/servers/slapd/back-ldbm/compare.c b/servers/slapd/back-ldbm/compare.c index b0974ffdbb..e98f83dd94 100644 --- a/servers/slapd/back-ldbm/compare.c +++ b/servers/slapd/back-ldbm/compare.c @@ -1,9 +1,12 @@ /* compare.c - ldbm backend compare routine */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" diff --git a/servers/slapd/back-ldbm/config.c b/servers/slapd/back-ldbm/config.c index 241303630c..0e087dc0b1 100644 --- a/servers/slapd/back-ldbm/config.c +++ b/servers/slapd/back-ldbm/config.c @@ -1,9 +1,12 @@ /* config.c - ldbm backend configuration file routine */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index 56c259c869..ff09593f93 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -1,22 +1,29 @@ /* ldbmcache.c - maintain a cache of open ldbm files */ +#include "portable.h" + #include -#include -#include -#include -#include -#include + +#include +#include +#include +#include + #include -#include -#include "portable.h" + +#ifdef HAVE_SYS_PARAM_H +#include +#endif + #include "slap.h" -#include "ldapconfig.h" #include "back-ldbm.h" +#include "ldapconfig.h" -#ifndef SYSERRLIST_IN_STDIO +#ifdef DECL_SYS_ERRLIST extern int sys_nerr; extern char *sys_errlist[]; #endif + extern time_t currenttime; extern pthread_mutex_t currenttime_mutex; @@ -176,7 +183,7 @@ ldbm_cache_fetch( ) { Datum data; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &data, 0, sizeof( data ) ); #endif diff --git a/servers/slapd/back-ldbm/delete.c b/servers/slapd/back-ldbm/delete.c index b6ffa79e0e..a7997e0f3f 100644 --- a/servers/slapd/back-ldbm/delete.c +++ b/servers/slapd/back-ldbm/delete.c @@ -1,9 +1,12 @@ /* delete.c - ldbm backend delete routine */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" diff --git a/servers/slapd/back-ldbm/dn2id.c b/servers/slapd/back-ldbm/dn2id.c index 0a7edac280..ff56ba616b 100644 --- a/servers/slapd/back-ldbm/dn2id.c +++ b/servers/slapd/back-ldbm/dn2id.c @@ -1,9 +1,12 @@ /* dn2id.c - routines to deal with the dn2id index */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" @@ -24,7 +27,7 @@ dn2id_add( Datum key, data; struct ldbminfo *li = (struct ldbminfo *) be->be_private; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); memset( &data, 0, sizeof( data ) ); #endif @@ -69,7 +72,7 @@ dn2id( ID id; Datum key, data; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); memset( &data, 0, sizeof( data ) ); #endif @@ -126,7 +129,7 @@ dn2id_delete( Datum key; int rc; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); #endif diff --git a/servers/slapd/back-ldbm/filterindex.c b/servers/slapd/back-ldbm/filterindex.c index 55aada54e4..ffb9292b42 100644 --- a/servers/slapd/back-ldbm/filterindex.c +++ b/servers/slapd/back-ldbm/filterindex.c @@ -1,9 +1,12 @@ /* filterindex.c - generate the list of candidate entries from a filter */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" diff --git a/servers/slapd/back-ldbm/group.c b/servers/slapd/back-ldbm/group.c index 042dc56860..536a48dd6b 100644 --- a/servers/slapd/back-ldbm/group.c +++ b/servers/slapd/back-ldbm/group.c @@ -1,9 +1,12 @@ /* compare.c - ldbm backend compare routine */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" @@ -11,8 +14,8 @@ extern Attribute *attr_find(); -#ifdef ACLGROUP -/* return 0 IFF edn is a value in member attribute +#ifdef SLAPD_ACLGROUPS +/* return 0 IFF edn is a value in uniqueMember attribute * of entry with bdn AND that entry has an objectClass * value of groupOfNames */ diff --git a/servers/slapd/back-ldbm/id2children.c b/servers/slapd/back-ldbm/id2children.c index 7210eece0d..b25a14c54d 100644 --- a/servers/slapd/back-ldbm/id2children.c +++ b/servers/slapd/back-ldbm/id2children.c @@ -1,8 +1,11 @@ /* id2children.c - routines to deal with the id2children index */ +#include "portable.h" + #include -#include -#include + +#include + #include "slap.h" #include "back-ldbm.h" @@ -23,7 +26,7 @@ id2children_add( IDList *idl; char buf[20]; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); memset( &data, 0, sizeof( data ) ); #endif @@ -68,7 +71,7 @@ has_children( IDList *idl; char buf[20]; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); #endif diff --git a/servers/slapd/back-ldbm/id2entry.c b/servers/slapd/back-ldbm/id2entry.c index cbec89b050..b2f0aebf8d 100644 --- a/servers/slapd/back-ldbm/id2entry.c +++ b/servers/slapd/back-ldbm/id2entry.c @@ -1,8 +1,11 @@ /* id2entry.c - routines to deal with the id2entry index */ +#include "portable.h" + #include -#include -#include + +#include + #include "slap.h" #include "back-ldbm.h" @@ -21,7 +24,7 @@ id2entry_add( Backend *be, Entry *e ) Datum key, data; int len, rc, flags; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); memset( &data, 0, sizeof( data ) ); #endif @@ -73,7 +76,7 @@ id2entry_delete( Backend *be, Entry *e ) /* XXX - check for writer lock - should also check no reader pending */ assert(pthread_rdwr_wchk_np(&e->e_rdwr)); -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); #endif @@ -114,7 +117,7 @@ id2entry( Backend *be, ID id, int rw ) Datum key, data; Entry *e; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); memset( &data, 0, sizeof( data ) ); #endif diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index b693c0ce4e..88f089116f 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -1,10 +1,12 @@ /* idl.c - ldap id list handling routines */ +#include "portable.h" + #include -#include -#ifdef CLDAP -#include -#endif + +#include +#include + #include "slap.h" #include "ldapconfig.h" #include "back-ldbm.h" @@ -59,7 +61,7 @@ idl_fetch_one( char *kstr; int i, nids; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &k2, 0, sizeof( k2 ) ); memset( &data, 0, sizeof( data ) ); #endif @@ -86,7 +88,7 @@ idl_fetch( char *kstr; int i, nids; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &k2, 0, sizeof( k2 ) ); memset( &data, 0, sizeof( data ) ); #endif @@ -180,7 +182,7 @@ idl_store( Datum data; struct ldbminfo *li = (struct ldbminfo *) be->be_private; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &data, 0, sizeof( data ) ); #endif @@ -302,7 +304,7 @@ idl_insert_key( char *kstr; Datum k2; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &k2, 0, sizeof( k2 ) ); #endif diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index bf1f55de35..0581fc1a1e 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -1,9 +1,12 @@ /* index.c - routines for dealing with attribute indexes */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" @@ -105,7 +108,7 @@ index_read( char *realval, *tmpval; char buf[BUFSIZ]; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); #endif @@ -179,7 +182,7 @@ add_value( char *realval, *tmpval, *s; char buf[BUFSIZ]; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 memset( &key, 0, sizeof( key ) ); #endif diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index de8c59a236..65fda43785 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -1,9 +1,12 @@ /* init.c - initialize ldbm backend */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" @@ -15,9 +18,9 @@ ldbm_back_init( char *argv[ 4 ]; int i; -#ifdef LDAP_CRYPT +#ifdef SLAPD_CRYPT extern pthread_mutex_t crypt_mutex; -#endif /* LDAP_CRYPT */ +#endif /* SLAPD_CRYPT */ /* allocate backend-specific stuff */ li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) ); @@ -63,9 +66,9 @@ ldbm_back_init( pthread_mutex_init( &li->li_cache.c_mutex, pthread_mutexattr_default ); pthread_mutex_init( &li->li_nextid_mutex, pthread_mutexattr_default ); pthread_mutex_init( &li->li_dbcache_mutex, pthread_mutexattr_default ); -#ifdef LDAP_CRYPT +#ifdef SLAPD_CRYPT pthread_mutex_init( &crypt_mutex, pthread_mutexattr_default ); -#endif /* LDAP_CRYPT */ +#endif /* SLAPD_CRYPT */ pthread_cond_init( &li->li_dbcache_cv, pthread_condattr_default ); for ( i = 0; i < MAXDBCACHE; i++ ) { pthread_mutex_init( &li->li_dbcache[i].dbc_mutex, diff --git a/servers/slapd/back-ldbm/kerberos.c b/servers/slapd/back-ldbm/kerberos.c index d07138bed7..14ab368db5 100644 --- a/servers/slapd/back-ldbm/kerberos.c +++ b/servers/slapd/back-ldbm/kerberos.c @@ -1,19 +1,18 @@ /* kerberos.c - ldbm backend kerberos bind routines */ +#include "portable.h" + +#ifdef HAVE_KERBEROS + #include -#include -#include -#include + +#include +#include +#include + #include "slap.h" #include "back-ldbm.h" -#ifdef KERBEROS -#ifdef KERBEROS_V -#include -#else -#include -#endif /* KERBEROS_V */ - #define LDAP_KRB_PRINCIPAL "ldapserver" extern char *ldap_srvtab; diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index df94146736..666547f1c9 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -1,9 +1,12 @@ /* modify.c - ldbm backend modify routine */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index 26c96709ae..1555383045 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -1,9 +1,12 @@ /* modrdn.c - ldbm backend modrdn routine */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" diff --git a/servers/slapd/back-ldbm/nextid.c b/servers/slapd/back-ldbm/nextid.c index e51f4d84e7..b16100a3f0 100644 --- a/servers/slapd/back-ldbm/nextid.c +++ b/servers/slapd/back-ldbm/nextid.c @@ -1,9 +1,15 @@ /* id.c - keep track of the next id to be given out */ +#include "portable.h" + #include -#include -#include + +#include + +#ifdef HAVE_SYS_PARAM_H #include +#endif + #include "slap.h" #include "back-ldbm.h" diff --git a/servers/slapd/back-ldbm/proto-back-ldbm.h b/servers/slapd/back-ldbm/proto-back-ldbm.h index c679c4e564..96eabe5850 100644 --- a/servers/slapd/back-ldbm/proto-back-ldbm.h +++ b/servers/slapd/back-ldbm/proto-back-ldbm.h @@ -1,125 +1,130 @@ #ifndef _PROTO_BACK_LDBM #define _PROTO_BACK_LDBM +#include + +LDAP_BEGIN_DECL + /* * alias.c */ -Entry *derefAlias_r ( +Entry *derefAlias_r LDAP_P(( Backend *be, Connection *conn, Operation *op, - Entry *e ); -char *derefDN ( + Entry *e )); +char *derefDN LDAP_P(( Backend *be, Connection *conn, Operation *op, - char *dn ); + char *dn )); /* * attr.c */ -void attr_masks( struct ldbminfo *li, char *type, int *indexmask, - int *syntaxmask ); -void attr_index_config( struct ldbminfo *li, char *fname, int lineno, - int argc, char **argv, int init ); +void attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask, + int *syntaxmask )); +void attr_index_config LDAP_P(( struct ldbminfo *li, char *fname, int lineno, + int argc, char **argv, int init )); /* * cache.c */ -void cache_set_state( struct cache *cache, Entry *e, int state ); -void cache_return_entry_r( struct cache *cache, Entry *e ); -void cache_return_entry_w( struct cache *cache, Entry *e ); -int cache_add_entry_lock( struct cache *cache, Entry *e, int state ); -ID cache_find_entry_dn2id( Backend *be, struct cache *cache, char *dn ); -Entry * cache_find_entry_id( struct cache *cache, ID id, int rw ); -int cache_delete_entry( struct cache *cache, Entry *e ); +void cache_set_state LDAP_P(( struct cache *cache, Entry *e, int state )); +void cache_return_entry_r LDAP_P(( struct cache *cache, Entry *e )); +void cache_return_entry_w LDAP_P(( struct cache *cache, Entry *e )); +int cache_add_entry_lock LDAP_P(( struct cache *cache, Entry *e, int state )); +ID cache_find_entry_dn2id LDAP_P(( Backend *be, struct cache *cache, char *dn )); +Entry * cache_find_entry_id LDAP_P(( struct cache *cache, ID id, int rw )); +int cache_delete_entry LDAP_P(( struct cache *cache, Entry *e )); /* * dbcache.c */ -struct dbcache * ldbm_cache_open( Backend *be, char *name, char *suffix, - int flags ); -void ldbm_cache_close( Backend *be, struct dbcache *db ); -void ldbm_cache_flush_all( Backend *be ); -Datum ldbm_cache_fetch( struct dbcache *db, Datum key ); -int ldbm_cache_store( struct dbcache *db, Datum key, Datum data, int flags ); -int ldbm_cache_delete( struct dbcache *db, Datum key ); +struct dbcache * ldbm_cache_open LDAP_P(( Backend *be, char *name, char *suffix, + int flags )); +void ldbm_cache_close LDAP_P(( Backend *be, struct dbcache *db )); +void ldbm_cache_flush_all LDAP_P(( Backend *be )); +Datum ldbm_cache_fetch LDAP_P(( struct dbcache *db, Datum key )); +int ldbm_cache_store LDAP_P(( struct dbcache *db, Datum key, Datum data, int flags )); +int ldbm_cache_delete LDAP_P(( struct dbcache *db, Datum key )); /* * dn2id.c */ -int dn2id_add( Backend *be, char *dn, ID id ); -ID dn2id( Backend *be, char *dn ); -int dn2id_delete( Backend *be, char *dn ); -Entry * dn2entry_r( Backend *be, char *dn, char **matched ); -Entry * dn2entry_w( Backend *be, char *dn, char **matched ); +int dn2id_add LDAP_P(( Backend *be, char *dn, ID id )); +ID dn2id LDAP_P(( Backend *be, char *dn )); +int dn2id_delete LDAP_P(( Backend *be, char *dn )); +Entry * dn2entry_r LDAP_P(( Backend *be, char *dn, char **matched )); +Entry * dn2entry_w LDAP_P(( Backend *be, char *dn, char **matched )); /* * filterindex.c */ -IDList * filter_candidates( Backend *be, Filter *f ); +IDList * filter_candidates LDAP_P(( Backend *be, Filter *f )); /* * id2children.c */ -int id2children_add( Backend *be, Entry *p, Entry *e ); -int has_children( Backend *be, Entry *p ); +int id2children_add LDAP_P(( Backend *be, Entry *p, Entry *e )); +int has_children LDAP_P(( Backend *be, Entry *p )); /* * id2entry.c */ -int id2entry_add( Backend *be, Entry *e ); -int id2entry_delete( Backend *be, Entry *e ); -Entry * id2entry( Backend *be, ID id, int rw ); -Entry * id2entry_r( Backend *be, ID id ); -Entry * id2entry_w( Backend *be, ID id ); +int id2entry_add LDAP_P(( Backend *be, Entry *e )); +int id2entry_delete LDAP_P(( Backend *be, Entry *e )); +Entry * id2entry LDAP_P(( Backend *be, ID id, int rw )); +Entry * id2entry_r LDAP_P(( Backend *be, ID id )); +Entry * id2entry_w LDAP_P(( Backend *be, ID id )); /* * idl.c */ -IDList * idl_alloc( int nids ); -IDList * idl_allids( Backend *be ); -void idl_free( IDList *idl ); -IDList * idl_fetch( Backend *be, struct dbcache *db, Datum key ); -int idl_insert_key( Backend *be, struct dbcache *db, Datum key, ID id ); -int idl_insert( IDList **idl, ID id, int maxids ); -IDList * idl_intersection( Backend *be, IDList *a, IDList *b ); -IDList * idl_union( Backend *be, IDList *a, IDList *b ); -IDList * idl_notin( Backend *be, IDList *a, IDList *b ); -ID idl_firstid( IDList *idl ); -ID idl_nextid( IDList *idl, ID id ); +IDList * idl_alloc LDAP_P(( int nids )); +IDList * idl_allids LDAP_P(( Backend *be )); +void idl_free LDAP_P(( IDList *idl )); +IDList * idl_fetch LDAP_P(( Backend *be, struct dbcache *db, Datum key )); +int idl_insert_key LDAP_P(( Backend *be, struct dbcache *db, Datum key, ID id )); +int idl_insert LDAP_P(( IDList **idl, ID id, int maxids )); +IDList * idl_intersection LDAP_P(( Backend *be, IDList *a, IDList *b )); +IDList * idl_union LDAP_P(( Backend *be, IDList *a, IDList *b )); +IDList * idl_notin LDAP_P(( Backend *be, IDList *a, IDList *b )); +ID idl_firstid LDAP_P(( IDList *idl )); +ID idl_nextid LDAP_P(( IDList *idl, ID id )); /* * index.c */ -int index_add_entry( Backend *be, Entry *e ); -int index_add_mods( Backend *be, LDAPMod *mods, ID id ); -IDList * index_read( Backend *be, char *type, int indextype, char *val ); -int index_add_values( Backend *be, char *type, struct berval **vals, ID id ); +int index_add_entry LDAP_P(( Backend *be, Entry *e )); +int index_add_mods LDAP_P(( Backend *be, LDAPMod *mods, ID id )); +IDList * index_read LDAP_P(( Backend *be, char *type, int indextype, char *val )); +int index_add_values LDAP_P(( Backend *be, char *type, struct berval **vals, ID id )); /* * kerberos.c */ -#ifdef KERBEROS -/* krbv4_ldap_auth( Backend *be, struct berval *cred, AUTH_DAT *ad ); */ +#ifdef HAVE_KERBEROS +/* krbv4_ldap_auth LDAP_P(( Backend *be, struct berval *cred, AUTH_DAT *ad )); */ #endif /* * nextid.c */ -ID next_id( Backend *be ); -void next_id_return( Backend *be, ID id ); -ID next_id_get( Backend *be ); +ID next_id LDAP_P(( Backend *be )); +void next_id_return LDAP_P(( Backend *be, ID id )); +ID next_id_get LDAP_P(( Backend *be )); +LDAP_END_DECL #endif diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 9c93a5f816..5f0cf3a6fb 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -1,9 +1,12 @@ /* search.c - ldbm backend search function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" diff --git a/servers/slapd/back-ldbm/unbind.c b/servers/slapd/back-ldbm/unbind.c index 9f3421d5ee..6330b4db20 100644 --- a/servers/slapd/back-ldbm/unbind.c +++ b/servers/slapd/back-ldbm/unbind.c @@ -1,8 +1,11 @@ /* unbind.c - handle an ldap unbind operation */ +#include "portable.h" + #include -#include -#include + +#include + #include "slap.h" int diff --git a/servers/slapd/back-passwd/Makefile.in b/servers/slapd/back-passwd/Makefile.in new file mode 100644 index 0000000000..47b4a782fe --- /dev/null +++ b/servers/slapd/back-passwd/Makefile.in @@ -0,0 +1,28 @@ +SRCS = search.c config.c +OBJS = search.o config.o + +LDAP_INCDIR= ../../../include +LDAP_LIBDIR= ../../../libraries + +BUILD_OPT = "--enable-passwd" +BUILD_SRV = @BUILD_PASSWD@ + +PROGRAMS= libback-passwd.a + +XINCPATH = -I.. -I$(srcdir)/.. + +all-local: FORCE + $(MAKE) $(MFLAGS) libback-passwd.a + +libback-passwd.a: version.o + $(AR) ruv $@ $(OBJS) version.o + @$(RANLIB) $@ + @touch ../.backend + +version.c: $(OBJS) $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) diff --git a/servers/slapd/back-passwd/config.c b/servers/slapd/back-passwd/config.c index 5a26ff0fb6..839af28cab 100644 --- a/servers/slapd/back-passwd/config.c +++ b/servers/slapd/back-passwd/config.c @@ -1,11 +1,13 @@ /* config.c - passwd backend configuration file routine */ -#include -#include -#include -#include -#include #include "portable.h" + +#include + +#include +#include +#include + #include "slap.h" passwd_back_config( diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index 11c1d8e719..7c32656ec2 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -1,12 +1,15 @@ /* search.c - /etc/passwd backend search function */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include +#include + #include -#include "portable.h" + #include "slap.h" extern time_t currenttime; diff --git a/servers/slapd/back-shell/Makefile.in b/servers/slapd/back-shell/Makefile.in new file mode 100644 index 0000000000..0ae8b98180 --- /dev/null +++ b/servers/slapd/back-shell/Makefile.in @@ -0,0 +1,30 @@ +SRCS = init.c config.c fork.c search.c bind.c unbind.c add.c delete.c \ + modify.c modrdn.c compare.c abandon.c result.c +OBJS = init.o config.o fork.o search.o bind.o unbind.o add.o delete.o \ + modify.o modrdn.o compare.o abandon.o result.o + +LDAP_INCDIR= ../../../include +LDAP_LIBDIR= ../../../libraries + +BUILD_OPT = "--enable-shell" +BUILD_SRV = @BUILD_SHELL@ + +PROGRAMS = libback-shell.a + +XINCPATH = -I.. -I$(srcdir)/.. + +all-local: FORCE + $(MAKE) $(MFLAGS) libback-shell.a + +libback-shell.a: version.o + $(AR) ruv $@ $(OBJS) version.o + @$(RANLIB) $@ + @touch ../.backend + +version.c: $(OBJS) $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) diff --git a/servers/slapd/back-shell/abandon.c b/servers/slapd/back-shell/abandon.c index fc9d6a40b6..36e81963a9 100644 --- a/servers/slapd/back-shell/abandon.c +++ b/servers/slapd/back-shell/abandon.c @@ -1,10 +1,13 @@ /* abandon.c - shell backend abandon function */ +#include "portable.h" + #include -#include -#include -#include #include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/add.c b/servers/slapd/back-shell/add.c index 89f054cc9c..c798e8c6c1 100644 --- a/servers/slapd/back-shell/add.c +++ b/servers/slapd/back-shell/add.c @@ -1,9 +1,12 @@ /* add.c - shell backend add function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/bind.c b/servers/slapd/back-shell/bind.c index dea149e410..33bcd9df97 100644 --- a/servers/slapd/back-shell/bind.c +++ b/servers/slapd/back-shell/bind.c @@ -1,9 +1,12 @@ /* bind.c - shell backend bind function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/compare.c b/servers/slapd/back-shell/compare.c index 48dfbb553b..ed93c411d9 100644 --- a/servers/slapd/back-shell/compare.c +++ b/servers/slapd/back-shell/compare.c @@ -1,9 +1,12 @@ /* compare.c - shell backend compare function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/config.c b/servers/slapd/back-shell/config.c index 5d2fa1c19a..10aee26a2c 100644 --- a/servers/slapd/back-shell/config.c +++ b/servers/slapd/back-shell/config.c @@ -1,9 +1,12 @@ /* config.c - shell backend configuration file routine */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/delete.c b/servers/slapd/back-shell/delete.c index 0dc3439c00..75760ed271 100644 --- a/servers/slapd/back-shell/delete.c +++ b/servers/slapd/back-shell/delete.c @@ -1,9 +1,12 @@ /* delete.c - shell backend delete function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/fork.c b/servers/slapd/back-shell/fork.c index aff0e5bbe4..14eaca4349 100644 --- a/servers/slapd/back-shell/fork.c +++ b/servers/slapd/back-shell/fork.c @@ -1,9 +1,12 @@ /* fork.c - fork and exec a process, connecting stdin/out w/pipes */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" forkandexec( diff --git a/servers/slapd/back-shell/init.c b/servers/slapd/back-shell/init.c index 1df9c4b265..0865887123 100644 --- a/servers/slapd/back-shell/init.c +++ b/servers/slapd/back-shell/init.c @@ -1,8 +1,11 @@ /* init.c - initialize shell backend */ +#include "portable.h" + #include -#include -#include + +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/modify.c b/servers/slapd/back-shell/modify.c index d05b79639d..ce2c7bfd07 100644 --- a/servers/slapd/back-shell/modify.c +++ b/servers/slapd/back-shell/modify.c @@ -1,9 +1,12 @@ /* modify.c - shell backend modify function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/modrdn.c b/servers/slapd/back-shell/modrdn.c index 9fd793317d..f3f00217ad 100644 --- a/servers/slapd/back-shell/modrdn.c +++ b/servers/slapd/back-shell/modrdn.c @@ -1,9 +1,12 @@ /* modrdn.c - shell backend modrdn function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/result.c b/servers/slapd/back-shell/result.c index 675aa1f144..3d18e23baa 100644 --- a/servers/slapd/back-shell/result.c +++ b/servers/slapd/back-shell/result.c @@ -1,9 +1,12 @@ /* result.c - shell backend result reading function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/search.c b/servers/slapd/back-shell/search.c index 749b112a94..969215883b 100644 --- a/servers/slapd/back-shell/search.c +++ b/servers/slapd/back-shell/search.c @@ -1,9 +1,12 @@ /* search.c - shell backend search function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/back-shell/shell.h b/servers/slapd/back-shell/shell.h index 5ef493c045..6228b6408e 100644 --- a/servers/slapd/back-shell/shell.h +++ b/servers/slapd/back-shell/shell.h @@ -1,5 +1,12 @@ /* shell.h - shell backend header file */ +#ifndef SLAPD_SHELL_H +#define SLAPD_SHELL_H + +#include + +LDAP_BEGIN_DECL + struct shellinfo { char **si_bind; /* cmd + args to exec for bind */ char **si_unbind; /* cmd + args to exec for unbind */ @@ -11,3 +18,7 @@ struct shellinfo { char **si_delete; /* cmd + args to exec for delete */ char **si_abandon; /* cmd + args to exec for abandon */ }; + +LDAP_END_DECL + +#endif diff --git a/servers/slapd/back-shell/unbind.c b/servers/slapd/back-shell/unbind.c index 649fe96c13..93c6889468 100644 --- a/servers/slapd/back-shell/unbind.c +++ b/servers/slapd/back-shell/unbind.c @@ -1,9 +1,12 @@ /* unbind.c - shell backend unbind function */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "shell.h" diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 076910a4e5..eab281a624 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -1,14 +1,18 @@ /* backend.c - routines for dealing with back-end databases */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include + #include "slap.h" -#ifdef LDAP_LDBM +#ifdef SLAPD_LDBM extern int ldbm_back_bind(); extern int ldbm_back_unbind(); extern int ldbm_back_search(); @@ -24,12 +28,12 @@ extern int ldbm_back_close(); extern int ldbm_back_group(); #endif -#ifdef LDAP_PASSWD +#ifdef SLAPD_PASSWD extern int passwd_back_search(); extern int passwd_back_config(); #endif -#ifdef LDAP_SHELL +#ifdef SLAPD_SHELL extern int shell_back_bind(); extern int shell_back_unbind(); extern int shell_back_search(); @@ -73,7 +77,7 @@ new_backend( be->be_timelimit = deftime; foundit = 0; -#ifdef LDAP_LDBM +#ifdef SLAPD_LDBM if ( strcasecmp( type, "ldbm" ) == 0 ) { be->be_bind = ldbm_back_bind; be->be_unbind = ldbm_back_unbind; @@ -87,7 +91,7 @@ new_backend( be->be_config = ldbm_back_config; be->be_init = ldbm_back_init; be->be_close = ldbm_back_close; -#ifdef ACLGROUP +#ifdef SLAPD_ACLGROUPS be->be_group = ldbm_back_group; #endif be->be_type = "ldbm"; @@ -95,7 +99,7 @@ new_backend( } #endif -#ifdef LDAP_PASSWD +#ifdef SLAPD_PASSWD if ( strcasecmp( type, "passwd" ) == 0 ) { be->be_bind = NULL; be->be_unbind = NULL; @@ -109,7 +113,7 @@ new_backend( be->be_config = passwd_back_config; be->be_init = NULL; be->be_close = NULL; -#ifdef ACLGROUP +#ifdef SLAPD_ACLGROUPS be->be_group = NULL; #endif be->be_type = "passwd"; @@ -117,7 +121,7 @@ new_backend( } #endif -#ifdef LDAP_SHELL +#ifdef SLAPD_SHELL if ( strcasecmp( type, "shell" ) == 0 ) { be->be_bind = shell_back_bind; be->be_unbind = shell_back_unbind; @@ -131,7 +135,7 @@ new_backend( be->be_config = shell_back_config; be->be_init = shell_back_init; be->be_close = NULL; -#ifdef ACLGROUP +#ifdef SLAPD_ACLGROUPS be->be_group = NULL; #endif be->be_type = "shell"; @@ -276,7 +280,7 @@ be_unbind( } } -#ifdef ACLGROUP +#ifdef SLAPD_ACLGROUPS int be_group(Backend *be, char *bdn, char *edn) { diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 5f6ec17621..5c1e264636 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -12,10 +12,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" extern Backend *select_backend(); @@ -51,7 +54,7 @@ do_bind( * } */ -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 /* * in version 3.0 there is an extra SEQUENCE tag after the * BindRequest SEQUENCE tag. @@ -80,13 +83,13 @@ do_bind( "decoding error" ); return; } -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { switch ( method ) { case LDAP_AUTH_SIMPLE_30: method = LDAP_AUTH_SIMPLE; break; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS case LDAP_AUTH_KRBV41_30: method = LDAP_AUTH_KRBV41; break; diff --git a/servers/slapd/ch_malloc.c b/servers/slapd/ch_malloc.c index 43ec4c9adb..9ce0ed80ec 100644 --- a/servers/slapd/ch_malloc.c +++ b/servers/slapd/ch_malloc.c @@ -1,8 +1,12 @@ /* ch_malloc.c - malloc routines that test returns from malloc and friends */ +#include "portable.h" + #include -#include -#include + +#include +#include + #include "slap.h" char * diff --git a/servers/slapd/charray.c b/servers/slapd/charray.c index f3a888826c..7edb80c848 100644 --- a/servers/slapd/charray.c +++ b/servers/slapd/charray.c @@ -1,9 +1,12 @@ /* charray.c - routines for dealing with char * arrays */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" void diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index 248c8b1ec7..d31f2655a4 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -10,9 +10,12 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include + +#include + #include "slap.h" extern Backend *select_backend(); diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 6c03ebb5fd..f7aa3b688c 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -1,9 +1,12 @@ /* config.c - configuration file handling routines */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "ldapconfig.h" diff --git a/servers/slapd/configinfo.c b/servers/slapd/configinfo.c index c1719efde8..744d611ad8 100644 --- a/servers/slapd/configinfo.c +++ b/servers/slapd/configinfo.c @@ -10,10 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "ldapconfig.h" diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index b4f10bbe9b..15f2dfd0bd 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1,11 +1,13 @@ -#include -#include -#include -#include -#include -#include -#include #include "portable.h" + +#include + +#include +#include +#include +#include +#include + #include "slap.h" extern Operation *op_add(); @@ -16,10 +18,6 @@ extern long ops_initiated; extern long ops_completed; extern pthread_mutex_t ops_mutex; extern pthread_t listener_tid; -#ifndef SYSERRLIST_IN_STDIO -extern int sys_nerr; -extern char *sys_errlist[]; -#endif struct co_arg { Connection *co_conn; @@ -50,7 +48,7 @@ connection_operation( struct co_arg *arg ) do_bind( arg->co_conn, arg->co_op ); break; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_REQ_UNBIND_30: #endif case LDAP_REQ_UNBIND: @@ -61,7 +59,7 @@ connection_operation( struct co_arg *arg ) do_add( arg->co_conn, arg->co_op ); break; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_REQ_DELETE_30: #endif case LDAP_REQ_DELETE: @@ -84,7 +82,7 @@ connection_operation( struct co_arg *arg ) do_search( arg->co_conn, arg->co_op ); break; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_REQ_ABANDON_30: #endif case LDAP_REQ_ABANDON: @@ -175,7 +173,7 @@ connection_activity( return; } -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { (void) ber_skip_tag( ber, &len ); } @@ -203,30 +201,30 @@ connection_activity( pthread_attr_init( &attr ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); -#ifndef THREAD_MIT_PTHREADS +#if !defined(HAVE_PTHREADS_D4) && !defined(HAVE_DCE) /* POSIX_THREADS or compatible * This is a draft 10 or standard pthreads implementation */ if ( pthread_create( &arg->co_op->o_tid, &attr, - (void *) connection_operation, (void *) arg ) != 0 ) { + connection_operation, (void *) arg ) != 0 ) { Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 ); } else { pthread_mutex_lock( &active_threads_mutex ); active_threads++; pthread_mutex_unlock( &active_threads_mutex ); } -#else /* !THREAD_MIT_PTHREAD */ +#else /* pthread draft4 */ /* * This is a draft 4 or earlier pthreads implementation */ if ( pthread_create( &arg->co_op->o_tid, attr, - (void *) connection_operation, (void *) arg ) != 0 ) { + connection_operation, (void *) arg ) != 0 ) { Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 ); } else { pthread_mutex_lock( &active_threads_mutex ); active_threads++; pthread_mutex_unlock( &active_threads_mutex ); } -#endif /* !THREAD_MIT_PTHREAD */ +#endif /* pthread draft4 */ pthread_attr_destroy( &attr ); } diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 509ed6a275..b9a11efb70 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -5,44 +5,36 @@ * Added locking of new_conn_mutex when traversing the c[] array. */ +#include "portable.h" + #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef _AIX -#include -#endif + +#include +#include +#include +#include +#include +#include +#include + #include "slap.h" -#include "portable.h" #include "ldapconfig.h" -#ifdef NEED_FILIO + +#ifdef HAVE_SYS_FILIO_H #include -#else /* NEED_FILIO */ +#elif HAVE_SYS_IOCTL_H #include -#endif /* NEED_FILIO */ -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ +#endif -#ifdef TCP_WRAPPERS +#ifdef HAVE_TCPD #include int allow_severity = LOG_INFO; int deny_severity = LOG_NOTICE; -#endif /* TCP_WRAPPERS */ +#endif /* TCP Wrappers */ extern Operation *op_add(); -#ifndef SYSERRLIST_IN_STDIO -extern int sys_nerr; -extern char *sys_errlist[]; -#endif extern time_t currenttime; extern pthread_mutex_t currenttime_mutex; extern int active_threads; @@ -77,14 +69,14 @@ slapd_daemon( FILE *fp; int on = 1; -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF dtblsize = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE dtblsize = getdtablesize(); -#endif /* USE_SYSCONF */ - /* - * Add greg@greg.rim.or.jp - */ +#else + dtblsize = FD_SETSIZE +#endif + #ifdef FD_SETSIZE if(dtblsize > FD_SETSIZE) { dtblsize = FD_SETSIZE; @@ -149,20 +141,20 @@ slapd_daemon( } (void) SIGNAL( SIGPIPE, SIG_IGN ); -#ifdef linux +#ifdef HAVE_LINUX_THREADS /* * LinuxThreads are implemented using SIGUSR1/USR2, * so we'll use SIGSTKFLT and SIGUNUSED */ - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); - (void) SIGNAL( SIGUNUSED, (void *) set_shutdown ); -#else /* !linux */ - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); - (void) SIGNAL( SIGUSR2, (void *) set_shutdown ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); + (void) SIGNAL( SIGUNUSED, set_shutdown ); +#else /* !linux */ + (void) SIGNAL( SIGUSR1, do_nothing ); + (void) SIGNAL( SIGUSR2, set_shutdown ); #endif /* !linux */ - (void) SIGNAL( SIGTERM, (void *) set_shutdown ); - (void) SIGNAL( SIGINT, (void *) set_shutdown ); - (void) SIGNAL( SIGHUP, (void *) set_shutdown ); + (void) SIGNAL( SIGTERM, set_shutdown ); + (void) SIGNAL( SIGINT, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); Debug( LDAP_DEBUG_ANY, "slapd starting\n", 0, 0, 0 ); #ifdef SLAPD_PIDFILE @@ -220,7 +212,7 @@ slapd_daemon( Debug( LDAP_DEBUG_CONNS, "before select active_threads %d\n", active_threads, 0, 0 ); -#if defined(PTHREAD_PREEMPTIVE) || defined(NO_THREADS) +#ifdef PREEMPTIVE_THREADS tvp = NULL; #else tvp = active_threads ? &zero : NULL; @@ -282,7 +274,7 @@ slapd_daemon( char *s; client_addr = inet_ntoa( from.sin_addr ); -#if defined(REVERSE_LOOKUP) || defined(TCP_WRAPPERS) +#if defined(SLAPD_RLOOKUPS) || defined(HAVE_TCPD) hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr), sizeof(from.sin_addr.s_addr), AF_INET ); @@ -307,7 +299,7 @@ slapd_daemon( client_addr = NULL; } -#ifdef TCP_WRAPPERS +#ifdef HAVE_TCPD if(!hosts_ctl("slapd", client_name, client_addr, STRING_UNKNOWN)) { @@ -323,7 +315,7 @@ slapd_daemon( pthread_mutex_unlock( &new_conn_mutex ); continue; } -#endif /* TCP_WRAPPERS */ +#endif /* HAVE_TCPD */ Statslog( LDAP_DEBUG_STATS, "conn=%d fd=%d connection from %s (%s) accepted.\n", @@ -422,33 +414,33 @@ set_shutdown() { Debug( LDAP_DEBUG_ANY, "slapd got shutdown signal\n", 0, 0, 0 ); slapd_shutdown = 1; -#ifdef linux +#ifdef HAVE_LINUX_THREADS /* * LinuxThreads are implemented using SIGUSR1/USR2, * so we'll use SIGSTKFLT and SIGUNUSED */ pthread_kill( listener_tid, SIGSTKFLT ); - (void) SIGNAL( SIGUNUSED, (void *) set_shutdown ); + (void) SIGNAL( SIGUNUSED, set_shutdown ); #else /* !linux */ pthread_kill( listener_tid, SIGUSR1 ); - (void) SIGNAL( SIGUSR2, (void *) set_shutdown ); + (void) SIGNAL( SIGUSR2, set_shutdown ); #endif /* !linux */ - (void) SIGNAL( SIGTERM, (void *) set_shutdown ); - (void) SIGNAL( SIGINT, (void *) set_shutdown ); - (void) SIGNAL( SIGHUP, (void *) set_shutdown ); + (void) SIGNAL( SIGTERM, set_shutdown ); + (void) SIGNAL( SIGINT, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); } static void do_nothing() { Debug( LDAP_DEBUG_TRACE, "slapd got do_nothing signal\n", 0, 0, 0 ); -#ifdef linux +#ifdef HAVE_LINUX_THREADS /* * LinuxThreads are implemented using SIGUSR1/USR2, * so we'll use SIGSTKFLT and SIGUNUSED */ - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); #else /* !linux */ - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); #endif /* !linux */ } diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 001d8e161c..477e6f35f1 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -10,10 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" extern Backend *select_backend(); diff --git a/servers/slapd/detach.c b/servers/slapd/detach.c index 4b77122347..dd6db49d69 100644 --- a/servers/slapd/detach.c +++ b/servers/slapd/detach.c @@ -10,21 +10,17 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#ifdef SVR4 + +#include +#include + #include -#endif /* svr4 */ #include #include #include -#include -#include "portable.h" - -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ - detach() { @@ -33,11 +29,13 @@ detach() extern int ldap_debug; #endif -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF nbits = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE nbits = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + nbits = FD_SETSIZE +#endif #ifdef FD_SETSIZE if ( nbits > FD_SETSIZE ) { @@ -49,7 +47,7 @@ detach() if ( ldap_debug == 0 ) { #endif for ( i = 0; i < 5; i++ ) { -#if defined( sunos5 ) && defined( THREAD_SUNOS5_LWP ) +#if defined( HAVE_LWP_THR ) switch ( fork1() ) { #else switch ( fork() ) { @@ -86,14 +84,14 @@ detach() (void) dup2( sd, 2 ); close( sd ); -#ifdef USE_SETSID +#ifdef HAVE_SETSID setsid(); -#else /* USE_SETSID */ +#else /* HAVE_SETSID */ if ( (sd = open( "/dev/tty", O_RDWR )) != -1 ) { (void) ioctl( sd, TIOCNOTTY, NULL ); (void) close( sd ); } -#endif /* USE_SETSID */ +#endif /* HAVE_SETSID */ #ifdef LDAP_DEBUG } #endif diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 7b76fe985a..d67aca70ac 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -1,12 +1,14 @@ /* dn.c - routines for dealing with distinguished names */ -#include -#include -#include -#include -#include -#include #include "portable.h" + +#include + +#include +#include +#include +#include + #include "slap.h" static char **dn_explode(); diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index 72ef4b1684..c0474e2023 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -1,10 +1,13 @@ /* entry.c - routines for dealing with entries */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include +#include + #include "slap.h" void entry_free(); diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index 64bfef197d..be8a8ea242 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -1,9 +1,12 @@ /* filter.c - routines for parsing and dealing with filters */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" static int get_filter_list(); @@ -54,7 +57,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) err = 0; *fstr = NULL; f->f_choice = ber_peek_tag( ber, &len ); -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: @@ -192,7 +195,7 @@ get_filter_list( Connection *conn, BerElement *ber, Filter **f, char **fstr ) Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 ); -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { (void) ber_skip_tag( ber, &len ); } @@ -233,7 +236,7 @@ get_substring_filter( Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 ); -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { (void) ber_skip_tag( ber, &len ); } @@ -251,7 +254,7 @@ get_substring_filter( sprintf( *fstr, "(%s=", f->f_sub_type ); for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; tag = ber_next_element( ber, &len, last ) ) { -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { rc = ber_scanf( ber, "{a}", &val ); } else @@ -269,7 +272,7 @@ get_substring_filter( value_normalize( val, syntax ); switch ( tag ) { -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_SUBSTRING_INITIAL_30: #endif case LDAP_SUBSTRING_INITIAL: @@ -283,7 +286,7 @@ get_substring_filter( strcat( *fstr, val ); break; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_SUBSTRING_ANY_30: #endif case LDAP_SUBSTRING_ANY: @@ -295,7 +298,7 @@ get_substring_filter( strcat( *fstr, val ); break; -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 case LDAP_SUBSTRING_FINAL_30: #endif case LDAP_SUBSTRING_FINAL: diff --git a/servers/slapd/filterentry.c b/servers/slapd/filterentry.c index 3aa261751f..ac0a943d02 100644 --- a/servers/slapd/filterentry.c +++ b/servers/slapd/filterentry.c @@ -1,10 +1,13 @@ /* filterentry.c - apply a filter to an entry */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include +#include + #include "slap.h" extern Attribute *attr_find(); diff --git a/servers/slapd/init.c b/servers/slapd/init.c index 94c47b4143..81384199e3 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -1,13 +1,13 @@ /* init.c - initialize various things */ +#include "portable.h" + #include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include + #include "portable.h" #include "slap.h" diff --git a/servers/slapd/lock.c b/servers/slapd/lock.c index 305fb5b91c..aee7c31cfb 100644 --- a/servers/slapd/lock.c +++ b/servers/slapd/lock.c @@ -1,15 +1,15 @@ /* lock.c - routines to open and apply an advisory lock to a file */ -#include -#include -#include #include "portable.h" -#ifdef USE_LOCKF -#include -#endif + +#include + +#include +#include +#include + #include #include -#include #include "slap.h" FILE * @@ -27,10 +27,10 @@ lock_fopen( char *fname, char *type, FILE **lfp ) } /* acquire the lock */ -#ifdef USE_LOCKF - while ( lockf( fileno( *lfp ), F_LOCK, 0 ) != 0 ) { -#else +#ifdef HAVE_FLOCK while ( flock( fileno( *lfp ), LOCK_EX ) != 0 ) { +#else + while ( lockf( fileno( *lfp ), F_LOCK, 0 ) != 0 ) { #endif ; /* NULL */ } @@ -38,10 +38,10 @@ lock_fopen( char *fname, char *type, FILE **lfp ) /* open the log file */ if ( (fp = fopen( fname, type )) == NULL ) { Debug( LDAP_DEBUG_ANY, "could not open \"%s\"\n", fname, 0, 0 ); -#ifdef USE_LOCKF - lockf( fileno( *lfp ), F_ULOCK, 0 ); -#else +#ifdef HAVE_FLOCK flock( fileno( *lfp ), LOCK_UN ); +#else + lockf( fileno( *lfp ), F_ULOCK, 0 ); #endif return( NULL ); } diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 8229fbf26b..bb4c286703 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -1,12 +1,11 @@ -#include -#include -#include -#include -#include -#include -#include -#include #include "portable.h" + +#include + +#include +#include +#include + #include "slap.h" #include "ldapconfig.h" @@ -182,27 +181,27 @@ main( argc, argv ) pthread_attr_init( &attr ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); -#ifndef THREAD_MIT_PTHREADS +#if !defined(HAVE_PTHREADS_D4) && !defined(HAVE_DCE) /* POSIX_THREADS or compatible * This is a draft 10 or standard pthreads implementation */ - if ( pthread_create( &listener_tid, &attr, (void *) slapd_daemon, + if ( pthread_create( &listener_tid, &attr, slapd_daemon, (void *) port ) != 0 ) { Debug( LDAP_DEBUG_ANY, "listener pthread_create failed\n", 0, 0, 0 ); exit( 1 ); } -#else /* !THREAD_MIT_PTHREADS */ +#else /* draft4 */ /* * This is a draft 4 or earlier pthreads implementation */ - if ( pthread_create( &listener_tid, attr, (void *) slapd_daemon, + if ( pthread_create( &listener_tid, attr, slapd_daemon, (void *) port ) != 0 ) { Debug( LDAP_DEBUG_ANY, "listener pthread_create failed\n", 0, 0, 0 ); exit( 1 ); } -#endif /* !THREAD_MIT_PTHREADS */ +#endif /* !draft4 */ pthread_attr_destroy( &attr ); pthread_join( listener_tid, (void *) &status ); pthread_exit( 0 ); @@ -234,7 +233,7 @@ main( argc, argv ) #endif flen = sizeof(from); if ( getpeername( 0, (struct sockaddr *) &from, &flen ) == 0 ) { -#ifdef REVERSE_LOOKUP +#ifdef SLAPD_RLOOKUPS hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr), sizeof(from.sin_addr.s_addr), AF_INET ); #else diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 2d9958362b..235acc536b 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -10,12 +10,14 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include -#include -#include + +#include +#include +#include + #include "slap.h" extern Backend *select_backend(); diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 802dda55ac..4928727817 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -10,10 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" extern Backend *select_backend(); diff --git a/servers/slapd/monitor.c b/servers/slapd/monitor.c index 595095d866..05940823ca 100644 --- a/servers/slapd/monitor.c +++ b/servers/slapd/monitor.c @@ -17,11 +17,14 @@ * Added locking of currenttime_mutex to protect call(s) to localtime(). */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include +#include + #include "slap.h" #include "ldapconfig.h" @@ -192,7 +195,7 @@ monitor_info( Connection *conn, Operation *op ) val.bv_len = strlen( buf ); attr_merge( e, "nbackends", vals ); -#ifdef THREAD_SUNOS5_LWP +#ifdef HAVE_LWP_THR sprintf( buf, "%d", thr_getconcurrency() ); val.bv_val = buf; val.bv_len = strlen( buf ); diff --git a/servers/slapd/operation.c b/servers/slapd/operation.c index 0c62e219ec..b08d679298 100644 --- a/servers/slapd/operation.c +++ b/servers/slapd/operation.c @@ -1,9 +1,12 @@ /* operation.c - routines to deal with pending ldap operations */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" extern time_t currenttime; diff --git a/servers/slapd/phonetic.c b/servers/slapd/phonetic.c index 959e06e1e3..485e3718a7 100644 --- a/servers/slapd/phonetic.c +++ b/servers/slapd/phonetic.c @@ -1,15 +1,17 @@ /* phonetic.c - routines to do phonetic matching */ -#include -#include -#include -#include -#include -#include #include "portable.h" + +#include + +#include +#include +#include +#include + #include "slap.h" -#if !defined(METAPHONE) && !defined(SOUNDEX) +#if !defined(METAPHONE) && !defined(SLAPD_PHONETIC) #define METAPHONE #endif @@ -77,7 +79,7 @@ word_dup( char *w ) #define MAXPHONEMELEN 4 #endif -#if defined(SOUNDEX) +#if defined(SLAPD_PHONETIC) /* lifted from isode-8.0 */ char * @@ -428,4 +430,4 @@ phonetic( char *Word ) } #endif /* metaphone */ -#endif /* soundex */ +#endif /* SLAPD_PHONETIC */ diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 095b785bc9..a1f32ac54e 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -1,218 +1,220 @@ #ifndef _PROTO_SLAP #define _PROTO_SLAP +#include + /* * acl.c */ -int access_allowed( Backend *be, Connection *conn, Operation *op, Entry *e, - char *attr, struct berval *val, char *dn, int access ); +int access_allowed LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e, + char *attr, struct berval *val, char *dn, int access )); -struct acl * acl_get_applicable( Backend *be, Operation *op, Entry *e, - char *attr, char *edn, int nmatches, regmatch_t *matches ); -int acl_access_allowed( struct acl *a, Backend *be, Connection *conn, Entry *e, +struct acl * acl_get_applicable LDAP_P(( Backend *be, Operation *op, Entry *e, + char *attr, char *edn, int nmatches, regmatch_t *matches )); +int acl_access_allowed LDAP_P(( struct acl *a, Backend *be, Connection *conn, Entry *e, struct berval *val, Operation *op, int access, char *edn, - regmatch_t *matches ); + regmatch_t *matches )); -int acl_check_mods( Backend *be, Connection *conn, Operation *op, Entry *e, - LDAPMod *mods ); +int acl_check_mods LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e, + LDAPMod *mods )); /* * aclparse.c */ -void parse_acl( Backend *be, char *fname, int lineno, int argc, char **argv ); -char * access2str( int access ); -int str2access( char *str ); +void parse_acl LDAP_P(( Backend *be, char *fname, int lineno, int argc, char **argv )); +char * access2str LDAP_P(( int access )); +int str2access LDAP_P(( char *str )); /* * attr.c */ -void attr_free( Attribute *a ); -char * attr_normalize( char *s ); -int attr_merge_fast( Entry *e, char *type, struct berval **vals, int nvals, - int naddvals, int *maxvals, Attribute ***a ); -int attr_merge( Entry *e, char *type, struct berval **vals ); -Attribute * attr_find( Attribute *a, char *type ); -int attr_delete( Attribute **attrs, char *type ); -int attr_syntax( char *type ); -void attr_syntax_config( char *fname, int lineno, int argc, char **argv ); +void attr_free LDAP_P(( Attribute *a )); +char * attr_normalize LDAP_P(( char *s )); +int attr_merge_fast LDAP_P(( Entry *e, char *type, struct berval **vals, int nvals, + int naddvals, int *maxvals, Attribute ***a )); +int attr_merge LDAP_P(( Entry *e, char *type, struct berval **vals )); +Attribute * attr_find LDAP_P(( Attribute *a, char *type )); +int attr_delete LDAP_P(( Attribute **attrs, char *type )); +int attr_syntax LDAP_P(( char *type )); +void attr_syntax_config LDAP_P(( char *fname, int lineno, int argc, char **argv )); /* * ava.c */ -int get_ava( BerElement *ber, Ava *ava ); -void ava_free( Ava *ava, int freeit ); +int get_ava LDAP_P(( BerElement *ber, Ava *ava )); +void ava_free LDAP_P(( Ava *ava, int freeit )); /* * backend.c */ -Backend * new_backend( char *type ); -Backend * select_backend( char * dn ); -int be_issuffix( Backend *be, char *suffix ); -int be_isroot( Backend *be, char *dn ); -int be_isroot_pw( Backend *be, char *dn, struct berval *cred ); -void be_close(); +Backend * new_backend LDAP_P(( char *type )); +Backend * select_backend LDAP_P(( char * dn )); +int be_issuffix LDAP_P(( Backend *be, char *suffix )); +int be_isroot LDAP_P(( Backend *be, char *dn )); +int be_isroot_pw LDAP_P(( Backend *be, char *dn, struct berval *cred )); +void be_close LDAP_P(()); /* * ch_malloc.c */ -char * ch_malloc( unsigned long size ); -char * ch_realloc( char *block, unsigned long size ); -char * ch_calloc( unsigned long nelem, unsigned long size ); +char * ch_malloc LDAP_P(( unsigned long size )); +char * ch_realloc LDAP_P(( char *block, unsigned long size )); +char * ch_calloc LDAP_P(( unsigned long nelem, unsigned long size )); /* * charray.c */ -void charray_add( char ***a, char *s ); -void charray_merge( char ***a, char **s ); -void charray_free( char **array ); -int charray_inlist( char **a, char *s ); -char ** charray_dup( char **a ); -char ** str2charray( char *str, char *brkstr ); +void charray_add LDAP_P(( char ***a, char *s )); +void charray_merge LDAP_P(( char ***a, char **s )); +void charray_free LDAP_P(( char **array )); +int charray_inlist LDAP_P(( char **a, char *s )); +char ** charray_dup LDAP_P(( char **a )); +char ** str2charray LDAP_P(( char *str, char *brkstr )); /* * config.c */ -void read_config( char *fname, Backend **bep, FILE *pfp ); +void read_config LDAP_P(( char *fname, Backend **bep, FILE *pfp )); /* * connection.c */ -void connection_activity( Connection *conn ); +void connection_activity LDAP_P(( Connection *conn )); /* * dn.c */ -char * dn_normalize( char *dn ); -char * dn_normalize_case( char *dn ); -char * dn_parent( Backend *be, char *dn ); -int dn_issuffix( char *dn, char *suffix ); -int dn_type( char *dn ); -char * dn_upcase( char *dn ); +char * dn_normalize LDAP_P(( char *dn )); +char * dn_normalize_case LDAP_P(( char *dn )); +char * dn_parent LDAP_P(( Backend *be, char *dn )); +int dn_issuffix LDAP_P(( char *dn, char *suffix )); +int dn_type LDAP_P(( char *dn )); +char * dn_upcase LDAP_P(( char *dn )); /* * entry.c */ -Entry * str2entry( char *s ); -char * entry2str( Entry *e, int *len, int printid ); -void entry_free( Entry *e ); +Entry * str2entry LDAP_P(( char *s )); +char * entry2str LDAP_P(( Entry *e, int *len, int printid )); +void entry_free LDAP_P(( Entry *e )); -int entry_rdwr_lock( Entry *e, int rw ); -int entry_rdwr_rlock( Entry *e ); -int entry_rdwr_wlock( Entry *e ); -int entry_rdwr_unlock( Entry *e, int rw ); -int entry_rdwr_runlock( Entry *e ); -int entry_rdwr_wunlock( Entry *e ); -int entry_rdwr_init( Entry *e ); +int entry_rdwr_lock LDAP_P(( Entry *e, int rw )); +int entry_rdwr_rlock LDAP_P(( Entry *e )); +int entry_rdwr_wlock LDAP_P(( Entry *e )); +int entry_rdwr_unlock LDAP_P(( Entry *e, int rw )); +int entry_rdwr_runlock LDAP_P(( Entry *e )); +int entry_rdwr_wunlock LDAP_P(( Entry *e )); +int entry_rdwr_init LDAP_P(( Entry *e )); /* * filter.c */ -int get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ); -void filter_free( Filter *f ); -void filter_print( Filter *f ); +int get_filter LDAP_P(( Connection *conn, BerElement *ber, Filter **filt, char **fstr )); +void filter_free LDAP_P(( Filter *f )); +void filter_print LDAP_P(( Filter *f )); /* * filterentry.c */ -int test_filter( Backend *be, Connection *conn, Operation *op, Entry *e, - Filter *f ); +int test_filter LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e, + Filter *f )); /* * lock.c */ -FILE * lock_fopen( char *fname, char *type, FILE **lfp ); -int lock_fclose( FILE *fp, FILE *lfp ); +FILE * lock_fopen LDAP_P(( char *fname, char *type, FILE **lfp )); +int lock_fclose LDAP_P(( FILE *fp, FILE *lfp )); /* * monitor.c */ -void monitor_info( Connection *conn, Operation *op ); +void monitor_info LDAP_P(( Connection *conn, Operation *op )); /* * operation.c */ -void op_free( Operation *op ); -Operation * op_add( Operation **olist, BerElement *ber, unsigned long msgid, - unsigned long tag, char *dn, int id, int connid ); -void op_delete( Operation **olist, Operation *op ); +void op_free LDAP_P(( Operation *op )); +Operation * op_add LDAP_P(( Operation **olist, BerElement *ber, unsigned long msgid, + unsigned long tag, char *dn, int id, int connid )); +void op_delete LDAP_P(( Operation **olist, Operation *op )); /* * phonetic.c */ -char * first_word( char *s ); -char * next_word( char *s ); -char * word_dup( char *w ); -char * phonetic( char *s ); +char * first_word LDAP_P(( char *s )); +char * next_word LDAP_P(( char *s )); +char * word_dup LDAP_P(( char *w )); +char * phonetic LDAP_P(( char *s )); /* * repl.c */ -void replog( Backend *be, int optype, char *dn, void *change, int flag ); +void replog LDAP_P(( Backend *be, int optype, char *dn, void *change, int flag )); /* * result.c */ -void send_ldap_result( Connection *conn, Operation *op, int err, char *matched, - char *text ); -void send_ldap_search_result( Connection *conn, Operation *op, int err, - char *matched, char *text, int nentries ); -void close_connection( Connection *conn, int opconnid, int opid ); +void send_ldap_result LDAP_P(( Connection *conn, Operation *op, int err, char *matched, + char *text )); +void send_ldap_search_result LDAP_P(( Connection *conn, Operation *op, int err, + char *matched, char *text, int nentries )); +void close_connection LDAP_P(( Connection *conn, int opconnid, int opid )); /* * schema.c */ -int oc_schema_check( Entry *e ); +int oc_schema_check LDAP_P(( Entry *e )); /* * schemaparse.c */ -void parse_oc( Backend *be, char *fname, int lineno, int argc, char **argv ); +void parse_oc LDAP_P(( Backend *be, char *fname, int lineno, int argc, char **argv )); /* * str2filter.c */ -Filter * str2filter( char *str ); +Filter * str2filter LDAP_P(( char *str )); /* * value.c */ -int value_add_fast( struct berval ***vals, struct berval **addvals, int nvals, - int naddvals, int *maxvals ); -int value_add( struct berval ***vals, struct berval **addvals ); -void value_normalize( char *s, int syntax ); -int value_cmp( struct berval *v1, struct berval *v2, int syntax, - int normalize ); -int value_ncmp( struct berval *v1, struct berval *v2, int syntax, int len, - int normalize ); -int value_find( struct berval **vals, struct berval *v, int syntax, - int normalize ); +int value_add_fast LDAP_P(( struct berval ***vals, struct berval **addvals, int nvals, + int naddvals, int *maxvals )); +int value_add LDAP_P(( struct berval ***vals, struct berval **addvals )); +void value_normalize LDAP_P(( char *s, int syntax )); +int value_cmp LDAP_P(( struct berval *v1, struct berval *v2, int syntax, + int normalize )); +int value_ncmp LDAP_P(( struct berval *v1, struct berval *v2, int syntax, int len, + int normalize )); +int value_find LDAP_P(( struct berval **vals, struct berval *v, int syntax, + int normalize )); /* * suffixAlias.c */ -char *suffixAlias ( char *dn, Operation *op, Backend *be ); +char *suffixAlias LDAP_P(( char *dn, Operation *op, Backend *be )); #endif /* _proto_slap */ diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index 028b191962..4450be5866 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -1,11 +1,15 @@ /* repl.c - log modifications for replication purposes */ +#include "portable.h" + #include -#include -#include + +#include +#include + #include -#include -#include + +#include "slap.h" extern pthread_mutex_t replog_mutex; extern pthread_mutex_t entry2str_mutex; diff --git a/servers/slapd/result.c b/servers/slapd/result.c index e8f4be47d6..06df02159d 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -1,20 +1,17 @@ /* result.c - routines to send ldap results, errors, and referrals */ -#include -#include -#include -#include -#include -#include -#include -#include #include "portable.h" + +#include + +#include +#include +#include +#include +#include + #include "slap.h" -#ifndef SYSERRLIST_IN_STDIO -extern int sys_nerr; -extern char *sys_errlist[]; -#endif extern int active_threads; extern pthread_mutex_t active_threads_mutex; extern pthread_mutex_t new_conn_mutex; @@ -64,7 +61,7 @@ send_ldap_result2( break; } -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( (ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER )) == NULLBER ) { #else @@ -74,13 +71,13 @@ send_ldap_result2( return; } -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( op->o_cldap ) { rc = ber_printf( ber, "{is{t{ess}}}", op->o_msgid, "", tag, err, matched ? matched : "", text ? text : "" ); } else #endif -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { rc = ber_printf( ber, "{it{{ess}}}", op->o_msgid, tag, err, matched ? matched : "", text ? text : "" ); @@ -125,7 +122,7 @@ send_ldap_result2( active_threads--; conn->c_writewaiter = 1; -#ifdef linux +#ifdef HAVE_LINUX_THREADS pthread_kill( listener_tid, SIGSTKFLT ); #else /* !linux */ pthread_kill( listener_tid, SIGUSR1 ); @@ -160,7 +157,7 @@ send_ldap_result( char *text ) { -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS if ( op->o_cldap ) { SAFEMEMCPY( (char *)conn->c_sb.sb_useaddr, &op->o_clientaddr, sizeof( struct sockaddr )); @@ -214,7 +211,7 @@ send_search_entry( edn = dn_normalize_case( strdup( e->e_dn ) ); -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( (ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER )) == NULLBER ) #else @@ -227,7 +224,7 @@ send_search_entry( goto error_return; } -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { rc = ber_printf( ber, "{it{{s{", op->o_msgid, LDAP_RES_SEARCH_ENTRY, e->e_dn ); @@ -316,7 +313,7 @@ send_search_entry( free(edn); -#ifdef COMPAT30 +#ifdef LDAP_COMPAT30 if ( conn->c_version == 30 ) { rc = ber_printf( ber, "}}}}" ); } else diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index 816521d56f..a324a60d1d 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -1,9 +1,12 @@ /* schema.c - routines to enforce schema definitions */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" extern Attribute *attr_find(); diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index 180ed71d00..8f72136abb 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -1,9 +1,12 @@ /* schemaparse.c - routines to parse config file objectclass definitions */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" extern char **str2charray(); diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 0cadfed276..004678e82d 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -10,10 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" #include "ldapconfig.h" diff --git a/servers/slapd/shell-backends/Make-template b/servers/slapd/shell-backends/Make-template deleted file mode 100644 index c4c1f36c49..0000000000 --- a/servers/slapd/shell-backends/Make-template +++ /dev/null @@ -1,62 +0,0 @@ -#----------------------------------------------------------------------------- -# Copyright (c) 1995 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. -# -# makefile for shell backends to use with stand-alone LDAP server -# -#----------------------------------------------------------------------------- -LDAPSRC = ../../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -CMNSRCS = shellutil.c -CMNOBJS = shellutil.o - -PWDSRCS = passwd-shell.c -PWDOBJS = passwd-shell.o pwd-version.o - -INCLUDES= -I. -I.. -I$(HDIR) -DEFINES = $(DEFS) $(THREADS) -CFLAGS = $(INCLUDES) $(THREADSINCLUDE) $(DEFINES) $(ACFLAGS) -LDFLAGS = -L$(LDIR) $(KRBLIBFLAG) -LIBS = -llber $(KRBLIBS) $(ALIBS) - -all: passwd-shell - -passwd-shell: $(PWDOBJS) $(CMNOBJS) - $(CC) $(ALDFLAGS) -o $@ $(PWDOBJS) $(CMNOBJS) \ - $(LDFLAGS) $(LIBS) - -pwd-version.c: $(OBJS) - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < pwd-Version.c > $@) - -install: FORCE - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - $(RM) passwd-shell pwd-version.c *.o core a.out version.c - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @$(LN) .src/*.[ch] . - diff --git a/servers/slapd/shell-backends/Makefile.in b/servers/slapd/shell-backends/Makefile.in new file mode 100644 index 0000000000..8789dede37 --- /dev/null +++ b/servers/slapd/shell-backends/Makefile.in @@ -0,0 +1,24 @@ +PROGRAMS = passwd-shell + +SRCS = passwd-shell.c shellutil.c +XSRCS = pwd-version.c +OBJS = passwd-shell.o shellutil.o + +LDAP_INCDIR= ../../../include +LDAP_LIBDIR= ../../../libraries + +BUILD_OPT = "--enable-shell" +BUILD_SRV = @BUILD_SHELL@ + +all-local: $(PROGRAMS) + +passwd-shell: pwd-version.o + $(CC) $(LDFLAGS) -o $@ $(OBJS) pwd-version.o $(LIBS) + +pwd-version.c: $(OBJS) $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/pwd-Version.c > $@) diff --git a/servers/slapd/shell-backends/passwd-shell.c b/servers/slapd/shell-backends/passwd-shell.c index 2210651dbf..2d7df71c74 100644 --- a/servers/slapd/shell-backends/passwd-shell.c +++ b/servers/slapd/shell-backends/passwd-shell.c @@ -13,27 +13,23 @@ */ -#include +#include "portable.h" + #include -#include #include #include -#include + +#include + #include #include + #include "shellutil.h" #include "passwd-shell.h" -#ifdef LDAP_DEBUG -void debug_printf(); -#else /* LDAP_DEBUG */ -#define debug_printf() -#endif /* LDAP_DEBUG */ - - -static void pwdfile_search( struct ldop *op, FILE *ofp ); -static struct ldentry *pw2entry( struct ldop *op, struct passwd *pw ); +static void pwdfile_search LDAP_P(( struct ldop *op, FILE *ofp )); +static struct ldentry *pw2entry LDAP_P(( struct ldop *op, struct passwd *pw )); static char tmpbuf[ MAXLINELEN * 2 ]; diff --git a/servers/slapd/shell-backends/shellutil.c b/servers/slapd/shell-backends/shellutil.c index 82eea1665b..4f7b469043 100644 --- a/servers/slapd/shell-backends/shellutil.c +++ b/servers/slapd/shell-backends/shellutil.c @@ -14,12 +14,21 @@ */ -#include +#include "portable.h" + #include -#include + +#ifdef STDC_HEADERS #include -#include +#include +#else #include +#endif + +#include + +#include + #include #include #include "shellutil.h" @@ -314,19 +323,30 @@ ecalloc( unsigned nelem, unsigned elsize ) /* VARARGS */ void -debug_printf( va_alist /* char *fmt, args... */ ) +debug_printf +#ifdef STDC_HEADERS + ( char *fmt, ... ) +#else + ( va_alist ) va_dcl +#endif { - char *fmt; va_list ap; - - if ( debugflg ) { - va_start( ap ); - fmt = va_arg( ap, char * ); - fprintf( stderr, "%s: ", progname ); - vfprintf( stderr, fmt, ap ); - va_end( ap ); - } +#ifndef STDC_HEADERS + char *fmt; +#endif + + if ( debugflg ) { +#ifdef STDC_HEADERS + va_start( ap, fmt ); +#else + va_start( ap ); + fmt = va_arg( ap, char * ); +#endif + fprintf( stderr, "%s: ", progname ); + vfprintf( stderr, fmt, ap ); + va_end( ap ); + } } diff --git a/servers/slapd/shell-backends/shellutil.h b/servers/slapd/shell-backends/shellutil.h index 7ea0db057c..58775b2f99 100644 --- a/servers/slapd/shell-backends/shellutil.h +++ b/servers/slapd/shell-backends/shellutil.h @@ -12,6 +12,12 @@ is provided ``as is'' without express or implied warranty. */ +#ifndef SHELLUTIL_H +#define SHELLUTIL_H + +#include + +LDAP_BEGIN_DECL #define MAXLINELEN 512 @@ -69,7 +75,7 @@ struct ldentry { #ifdef LDAP_DEBUG -void debug_printf(); +void debug_printf LDAP_P((char *, ...)); #else /* LDAP_DEBUG */ #define debug_printf() #endif /* LDAP_DEBUG */ @@ -94,3 +100,6 @@ char *estrdup( char *s ); */ extern int debugflg; extern char *progname; + +LDAP_END_DECL +#endif diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 5cffeab89c..150d384e7c 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -3,11 +3,14 @@ #ifndef _SLDAPD_H_ #define _SLDAPD_H_ -#define LDAP_SYSLOG +#include "portable.h" + +#include -#include #include -#include +#include +#include + #undef NDEBUG #include @@ -27,6 +30,8 @@ #define MAXREMATCHES 10 +LDAP_BEGIN_DECL + /* * represents an attribute value assertion (i.e., attr=value) */ @@ -134,7 +139,7 @@ struct access { char *a_dnattr; long a_access; -#ifdef ACLGROUP +#ifdef SLAPD_ACLGROUPS char *a_group; #endif @@ -208,7 +213,7 @@ typedef struct backend { IFP be_init; /* backend init routine */ IFP be_close; /* backend close routine */ -#ifdef ACLGROUP +#ifdef SLAPD_ACLGROUPS IFP be_group; /* backend group member test */ #endif } Backend; @@ -230,7 +235,7 @@ typedef struct op { /* LDAP_AUTH_* */ int o_opid; /* id of this operation */ int o_connid; /* id of conn initiating this op */ -#ifdef CLDAP +#ifdef LDAP_CONNECTIONLESS int o_cldap; /* != 0 if this came in via CLDAP */ struct sockaddr o_clientaddr; /* client address if via CLDAP */ char o_searchbase; /* search base if via CLDAP */ @@ -252,7 +257,7 @@ typedef struct conn { char *c_dn; /* current DN bound to this conn */ pthread_mutex_t c_dnmutex; /* mutex for c_dn field */ int c_authtype; /* auth method used to bind c_dn */ -#ifdef COMPAT +#ifdef LDAP_COMPAT int c_version; /* for compatibility w/2.0, 3.0 */ #endif char *c_addr; /* address of client on this conn */ @@ -284,8 +289,8 @@ typedef struct conn { #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) #endif -#ifdef NEEDPROTOS #include "proto-slap.h" -#endif + +LDAP_END_DECL #endif /* _slap_h_ */ diff --git a/servers/slapd/slapd.conf b/servers/slapd/slapd.conf index c609a793d0..e151fc8981 100644 --- a/servers/slapd/slapd.conf +++ b/servers/slapd/slapd.conf @@ -1,5 +1,5 @@ -include %ETCDIR%/slapd.at.conf -include %ETCDIR%/slapd.oc.conf +include %SYSCONFDIR%/slapd.at.conf +include %SYSCONFDIR%/slapd.oc.conf schemacheck off referral ldap://ldap.itd.umich.edu diff --git a/servers/slapd/str2filter.c b/servers/slapd/str2filter.c index cf95d922e8..60ced1aee2 100644 --- a/servers/slapd/str2filter.c +++ b/servers/slapd/str2filter.c @@ -1,9 +1,12 @@ /* str2filter.c - parse an rfc 1588 string filter */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "slap.h" static char *find_matching_paren(); diff --git a/servers/slapd/strdup.c b/servers/slapd/strdup.c deleted file mode 100644 index a16928a2e8..0000000000 --- a/servers/slapd/strdup.c +++ /dev/null @@ -1,18 +0,0 @@ -#if defined( ultrix ) || defined( nextstep ) - -#include - - -char *strdup( char *s ) -{ - char *p; - - if ( (p = (char *) malloc( strlen( s ) + 1 )) == NULL ) - return( NULL ); - - strcpy( p, s ); - - return( p ); -} - -#endif /* ultrix || nextstep */ diff --git a/servers/slapd/tempnam.c b/servers/slapd/tempnam.c deleted file mode 100644 index 20d108c9d2..0000000000 --- a/servers/slapd/tempnam.c +++ /dev/null @@ -1,38 +0,0 @@ -#if defined( nextstep ) - -#include - -char *tempnam( char *dir, char *pfx ); - -char *tempnam( char *dir, char *pfx ) -{ - char *s; - - if ( dir == NULL ) { - dir = "/tmp"; - } - -/* - * allocate space for dir + '/' + pfx (up to 5 chars) + 6 trailing 'X's + 0 byte - */ - if (( s = (char *)malloc( strlen( dir ) + 14 )) == NULL ) { - return( NULL ); - } - - strcpy( s, dir ); - strcat( s, "/" ); - if ( pfx != NULL ) { - strcat( s, pfx ); - } - strcat( s, "XXXXXX" ); - mktemp( s ); - - if ( *s == '\0' ) { - free( s ); - s = NULL; - } - - return( s ); -} - -#endif /* nextstep */ diff --git a/servers/slapd/tools/Makefile.in b/servers/slapd/tools/Makefile.in new file mode 100644 index 0000000000..67c8dcae7d --- /dev/null +++ b/servers/slapd/tools/Makefile.in @@ -0,0 +1,154 @@ +#----------------------------------------------------------------------------- +# Copyright (c) 1995 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. +# +# Stand alone LDAP server tools makefile +# +#----------------------------------------------------------------------------- +HAVE_ISODE = @HAVE_ISODE@ +BUILD_LDBM = @BUILD_LDBM@ + +LDAP_INCDIR= ../../../include +LDAP_LIBDIR= ../../../libraries + +PROGRAMS=ldif2index ldif2ldbm ldbmcat ldif2id2entry \ + ldif2id2children centipede ldbmtest ldif + +SRCS = centipede.c ldbmcat.c ldbmtest.c sizecount.c \ + ldif.c ldif2id2children.c ldif2id2entry.c ldif2index.c ldif2ldbm.c + +EDB2LDIFSRCS = edb2ldif.c ldapsyntax.c +EDB2LDIFOBJS = edb2ldif.o ldapsyntax.o + +OBJS2 = ../config.o ../ch_malloc.o ../backend.o ../charray.o \ + ../aclparse.o ../schema.o ../result.o ../filterentry.o \ + ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \ + ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \ + ../schemaparse.o + +all-local: build-ldbm build-edb2ldif build-chlog2replog + +build-ldbm: FORCE + @if [ "$(BUILD_LDBM)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) ldbm-tools; \ + else \ + echo "run configure with --with-ldbm to build LDBM tools"; \ + fi + +ldbm-tools: $(PROGRAMS) + +XLIBS = @SLAPD_LIBS@ -lavl -lldbm @LDBM_LIBS@ -llthread @LTHREAD_LIBS@ -llutil @LUTIL_LIBS@ + +build-edb2ldif: FORCE + @if [ "$(HAVE_ISODE)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) edb2ldif; \ + else \ + echo "run configure with --with-isode to build edb2ldif"; \ + fi + +edb2ldif: edb2-vers.o + $(CC) $(LDFLAGS) -o $@ $(EDB2LDIFOBJS) edb2-vers.o $(LIBS) + +edb2-vers.c: $(EDB2LDIFOBJS) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < Vers-edb2.c > $@) + +build-chlog2replog: FORCE + @if [ "$(HAVE_ISODE)" = "yes" ]; then \ + $(MAKE) $(MFLAGS) chlog2replog; \ + else \ + echo "run configure with --with-isode to build chlog2replog"; \ + fi + +chlog2replog: chlog2replog.o ../lock.o ../ch_malloc.o + $(CC) $(LDFLAGS) -o $@ chlog2replog.o ../lock.o ../ch_malloc.o $(LIBS) + +ldif2index: ldif2index.o ../libbackends.a $(OBJS2) + $(CC) $(LDFLAGS) -o $@ ldif2index.o $(OBJS2) ../libbackends.a $(LIBS) + +ldif2ldbm: ldif2ldbm.o ../libbackends.a $(OBJS2) + $(CC) $(LDFLAGS) -o $@ ldif2ldbm.o $(OBJS2) ../libbackends.a $(LIBS) + +ldif2id2entry: ldif2id2entry.o ../libbackends.a $(OBJS2) + $(CC) $(LDFLAGS) -o $@ ldif2id2entry.o $(OBJS2) ../libbackends.a $(LIBS) + +ldif2id2children: ldif2id2children.o ../libbackends.a $(OBJS2) + $(CC) $(LDFLAGS) -o $@ ldif2id2children.o $(OBJS2) ../libbackends.a $(LIBS) + +ldbmcat: ldbmcat.o + $(CC) $(LDFLAGS) -o $@ ldbmcat.o $(LIBS) + +ldif: ldif.o + $(CC) $(LDFLAGS) -o $@ ldif.o $(LIBS) $(LIBS2) + +centipede: centipede.o + $(CC) -o $@ centipede.o $(LIBS) $(KRBLIBFLAG) $(KRBLIBS) + +sizecount: sizecount.o ../phonetic.o ../ch_malloc.o + $(CC) $(LDFLAGS) -o $@ sizecount.o ../phonetic.o ../ch_malloc.o \ + $(LIBS) $(KRBLIBFLAG) $(KRBLIBS) + +ldbmtest: ldbmtest.o ../libbackends.a $(OBJS2) + $(CC) $(LDFLAGS) -o ldbmtest ldbmtest.o $(OBJS2) ../libbackends.a $(LIBS) + +clean-local: FORCE + $(RM) $(PROGRAMS) $(XPROGRAMS) $(XSRCS) edb2-vers.c *.o a.out core + +depend-local: FORCE + @DEPEND=no ; DEPEND_LDBM= ; DEPEND_ISODE= ; \ + if [ "$(BUILD_LDBM)" = "yes" ]; then \ + DEPEND_LDBM="$(SRCS)"; \ + DEPEND=yes ; \ + fi; \ + if [ "$(HAVE_ISODE)" = "yes" ]; then \ + DEPEND_ISODE="$(ISODEINCLUDEFLAG) chlog2replog.c $(EDB2LDIFSRCS)"; \ + DEPEND=yes ; \ + fi; \ + if [ "$$DEPEND" = "yes" ]; then \ + $(MKDEP) $(DEFS) $(DEFINES) $$DEPEND_ISODE $$DEPEND_LDBM; \ + else \ + exit 0; \ + fi + +install-local: install-ldbm install-isode FORCE + +install-ldbm: FORCE + @-$(MKDIR) -p $(sbindir) + @if [ "$(BUILD_LDBM)" = "yes" ]; then \ + $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2ldbm $(sbindir) ; \ + $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2index $(sbindir) ; \ + $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2entry $(sbindir) ; \ + $(INSTALL) $(INSTALLFLAGS) -m 755 ldif2id2children $(sbindir) ; \ + $(INSTALL) $(INSTALLFLAGS) -m 755 ldbmcat $(sbindir) ; \ + $(INSTALL) $(INSTALLFLAGS) -m 755 ldif $(sbindir) ; \ + $(INSTALL) $(INSTALLFLAGS) -m 755 centipede $(sbindir) ; \ + $(INSTALL) $(INSTALLFLAGS) -m 755 ldbmtest $(sbindir) ; \ + else \ + exit 0 ; \ + fi + +install-isode: FORCE + @-$(MKDIR) -p $(sbindir) + @if [ "$(HAVE_ISODE)" = "yes" ]; then \ + $(INSTALL) $(INSTALLFLAGS) -m 755 edb2ldif $(sbindir); \ + $(INSTALL) $(INSTALLFLAGS) -m 755 chlog2replog $(sbindir); \ + else \ + exit 0 ; \ + fi + +all-common: all-local FORCE +install-common: all-common install-local FORCE +depend-common: depend-local FORCE +clean-common: clean-local FORCE +veryclean-common: clean-common veryclean-local FORCE diff --git a/servers/slapd/tools/centipede.c b/servers/slapd/tools/centipede.c index fc2b72aa93..ce1203d2bb 100644 --- a/servers/slapd/tools/centipede.c +++ b/servers/slapd/tools/centipede.c @@ -1,11 +1,16 @@ /* centipede.c - generate and install indexing information (view w/tabstop=4) */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include +#include + #include #include + #include #include @@ -556,10 +561,10 @@ diff_centroids( int amax, acur, dmax, dcur; char **vals; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *ocursorp; DBC *ncursorp; -#endif /* LDBM_USE_DB2 */ +#endif /* HAVE_BERKELEY_DB2 */ if ( verbose ) { printf( "Generating mods for differential %s centroid...", attr ); @@ -605,7 +610,7 @@ diff_centroids( olast.dptr = NULL; nlast.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( okey = ldbm_firstkey( oldbm, &ocursorp ), nkey = ldbm_firstkey( nldbm, &ncursorp ); okey.dptr != NULL && nkey.dptr != NULL; ) @@ -627,7 +632,7 @@ diff_centroids( } nlast = nkey; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 okey = ldbm_nextkey( oldbm, olast, ocursorp ); nkey = ldbm_nextkey( nldbm, nlast, ncursorp ); #else @@ -646,7 +651,7 @@ diff_centroids( } nlast = nkey; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 nkey = ldbm_nextkey( nldbm, nlast, ncursorp ); #else nkey = ldbm_nextkey( nldbm, nlast ); @@ -663,7 +668,7 @@ diff_centroids( } olast = okey; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 okey = ldbm_nextkey( oldbm, olast, ocursorp ); #else okey = ldbm_nextkey( oldbm, olast ); @@ -677,7 +682,7 @@ diff_centroids( return( NULL ); } -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 okey = ldbm_nextkey( oldbm, olast, ocursorp ); #else okey = ldbm_nextkey( oldbm, olast ); @@ -696,7 +701,7 @@ diff_centroids( return( NULL ); } -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 nkey = ldbm_nextkey( nldbm, nlast, ncursorp ); #else nkey = ldbm_nextkey( nldbm, nlast ); @@ -721,7 +726,7 @@ diff_centroids( /* generate list of values to add */ lastkey.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( nldbm, &ncursorp ); key.dptr != NULL; key = ldbm_nextkey( nldbm, lastkey, ncursorp ) ) #else @@ -752,7 +757,7 @@ diff_centroids( /* generate list of values to delete */ lastkey.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( oldbm, &ocursorp ); key.dptr != NULL; key = ldbm_nextkey( oldbm, lastkey, ocursorp ) ) #else @@ -819,7 +824,7 @@ full_centroid( char **vals; int vcur, vmax; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *cursorp; #endif @@ -850,7 +855,7 @@ full_centroid( lastkey.dptr = NULL; vals = NULL; vcur = vmax = 0; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( ldbm, &cursorp ); key.dptr != NULL; key = ldbm_nextkey( ldbm, lastkey, cursorp ) ) #else diff --git a/servers/slapd/tools/chlog2replog.c b/servers/slapd/tools/chlog2replog.c index f9f3b3c5d7..85a9433bab 100644 --- a/servers/slapd/tools/chlog2replog.c +++ b/servers/slapd/tools/chlog2replog.c @@ -16,10 +16,13 @@ * slapd/slurpd locking conventions. */ +#include "portable.h" + #include -#include #include -#include + +#include +#include #include #include diff --git a/servers/slapd/tools/edb2ldif.c b/servers/slapd/tools/edb2ldif.c index d46be1edfd..5e2b3d9a30 100644 --- a/servers/slapd/tools/edb2ldif.c +++ b/servers/slapd/tools/edb2ldif.c @@ -10,11 +10,15 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include #include -#include + +#include +#include +#include + #include #include diff --git a/servers/slapd/tools/ldapsyntax.c b/servers/slapd/tools/ldapsyntax.c index 4fa12c407a..421f4fcd00 100644 --- a/servers/slapd/tools/ldapsyntax.c +++ b/servers/slapd/tools/ldapsyntax.c @@ -10,9 +10,13 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include -#include -#include + +#include +#include + #include #include #include diff --git a/servers/slapd/tools/ldapsyntax.h b/servers/slapd/tools/ldapsyntax.h index ddcf1f2b3e..44a23263ca 100644 --- a/servers/slapd/tools/ldapsyntax.h +++ b/servers/slapd/tools/ldapsyntax.h @@ -10,17 +10,23 @@ * is provided ``as is'' without express or implied warranty. */ +#ifndef LDAPSYNTAX_H +#define LDAPSYNTAX_H 1 + +#include + +LDAP_BEGIN_DECL /* XXX: the "master" LINE_WIDTH #define is in ../slap.h */ #define LINE_WIDTH 76 /* for lines in string rep of an entry */ -#ifdef NEEDPROTOS /* * function prototypes */ -int init_syntaxes( void ); -int av2ldif( FILE *outfp, AV_Sequence av, DN dn, short syntax, - char *attrname, PS str_ps ); +int init_syntaxes LDAP_P(( void )); +int av2ldif LDAP_P(( FILE *outfp, AV_Sequence av, DN dn, short syntax, + char *attrname, PS str_ps )); -#endif /* NEEDPROTOS */ +LDAP_END_DECL +#endif diff --git a/servers/slapd/tools/ldbmcat.c b/servers/slapd/tools/ldbmcat.c index de106e1ac7..59cd4d1179 100644 --- a/servers/slapd/tools/ldbmcat.c +++ b/servers/slapd/tools/ldbmcat.c @@ -1,8 +1,11 @@ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include +#include + #include "ldbm.h" #include "../slap.h" @@ -24,7 +27,7 @@ main( argc, argv ) char *file, *s; int printid = 1; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *cursorp; #endif @@ -46,7 +49,7 @@ main( argc, argv ) last.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( dbp, &cursorp ); key.dptr != NULL; key = ldbm_nextkey( dbp, last, cursorp ) ) #else diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index 13e0f95580..9649eff22b 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -1,16 +1,23 @@ +#include "portable.h" + #include -#include #include -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include + #include -#include #include #include -#include -#include "portable.h" + +#ifdef HAVE_FCNTL_H +#include +#endif + #include "ldapconfig.h" #include "../slap.h" #include "../back-ldbm/back-ldbm.h" @@ -64,7 +71,7 @@ main( argc, argv ) int i; extern char *optarg; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 DBC *cursorp; #endif @@ -155,7 +162,7 @@ main( argc, argv ) } savekey.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( dbc->dbc_db, &cursorp ); key.dptr != NULL; key = ldbm_nextkey( dbc->dbc_db, key, cursorp ) ) @@ -325,7 +332,7 @@ main( argc, argv ) last.dptr = NULL; -#ifdef LDBM_USE_DB2 +#ifdef HAVE_BERKELEY_DB2 for ( key = ldbm_firstkey( dbp, &cursorp ); key.dptr != NULL; key = ldbm_nextkey( dbp, last, cursorp ) ) @@ -467,7 +474,7 @@ get_idlist( fp, data ) p->b_nids = i; } - qsort( (void *) p->b_ids, i, sizeof(ID), (void *) dnid_cmp ); + qsort( (void *) p->b_ids, i, sizeof(ID), dnid_cmp ); } data->dptr = (char *) p; @@ -518,10 +525,12 @@ edit_entry( c, data ) int fd, pid; char tmpname[20]; FILE *fp; +#ifndef HAVE_WAITPID WAITSTATUSTYPE status; +#endif strcpy( tmpname, "/tmp/dbtestXXXXXX" ); -#ifdef ultrix +#ifndef HAVE_MKSTEMP if ( (fd = open( mktemp( tmpname ), O_RDWR, 0600 )) == -1 ) { perror( tmpname ); return; @@ -555,8 +564,8 @@ edit_entry( c, data ) fclose( fp ); -#ifdef USE_WAITPID - if ( waitpid( (pid_t) -1, 0, WAIT_FLAGS ) < 0 ) { +#ifdef HAVE_WAITPID + if ( waitpid( (pid_t) -1, NULL, WAIT_FLAGS ) < 0 ) { #else if ( wait3( &status, WAIT_FLAGS, 0 ) < 0 ) { #endif diff --git a/servers/slapd/tools/ldif.c b/servers/slapd/tools/ldif.c index 4e7eb8cb4d..6f68b77d72 100644 --- a/servers/slapd/tools/ldif.c +++ b/servers/slapd/tools/ldif.c @@ -1,8 +1,10 @@ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include + #include "lber.h" #include "ldap.h" #include "ldif.h" diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index 0bb8e5ec6d..67be503f64 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -1,7 +1,10 @@ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "../slap.h" #include "../back-ldbm/back-ldbm.h" diff --git a/servers/slapd/tools/ldif2id2entry.c b/servers/slapd/tools/ldif2id2entry.c index ec2bf27279..de32fc9d53 100644 --- a/servers/slapd/tools/ldif2id2entry.c +++ b/servers/slapd/tools/ldif2id2entry.c @@ -1,7 +1,10 @@ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "../slap.h" #include "../back-ldbm/back-ldbm.h" diff --git a/servers/slapd/tools/ldif2index.c b/servers/slapd/tools/ldif2index.c index dd03f3dc78..2e4ba0c439 100644 --- a/servers/slapd/tools/ldif2index.c +++ b/servers/slapd/tools/ldif2index.c @@ -1,7 +1,10 @@ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include "../slap.h" #include "ldapconfig.h" diff --git a/servers/slapd/tools/ldif2ldbm.c b/servers/slapd/tools/ldif2ldbm.c index 7ddee31f88..d1da293c09 100644 --- a/servers/slapd/tools/ldif2ldbm.c +++ b/servers/slapd/tools/ldif2ldbm.c @@ -1,8 +1,12 @@ +#include "portable.h" + #include -#include -#include -#include + +#include +#include + #include + #include "../slap.h" #include "../back-ldbm/back-ldbm.h" #include "ldapconfig.h" diff --git a/servers/slapd/tools/sizecount.c b/servers/slapd/tools/sizecount.c index 45d8230100..a653796ba5 100644 --- a/servers/slapd/tools/sizecount.c +++ b/servers/slapd/tools/sizecount.c @@ -1,3 +1,5 @@ +#include "portable.h" + #include #include #include diff --git a/servers/slapd/unbind.c b/servers/slapd/unbind.c index 500006c34f..1b0d820e68 100644 --- a/servers/slapd/unbind.c +++ b/servers/slapd/unbind.c @@ -13,9 +13,12 @@ * */ +#include "portable.h" + #include -#include -#include + +#include + #include "slap.h" extern Backend *select_backend(); diff --git a/servers/slapd/value.c b/servers/slapd/value.c index c9e6fbb577..f5ee5f4777 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -1,12 +1,16 @@ /* value.c - routines for dealing with values */ +#include "portable.h" + #include -#include -#include -#include -#include + +#include +#include +#include +#include + #include -#include "portable.h" + #include "slap.h" int @@ -99,7 +103,7 @@ value_normalize( *d = '\0'; } -#define MIN( a, b ) (a < b ? a : b ) +#define LDAP_MIN( a, b ) ((a) < (b) ? (a) : (b) ) int value_cmp( @@ -133,7 +137,7 @@ value_cmp( break; case SYNTAX_BIN: - rc = memcmp( v1->bv_val, v2->bv_val, MIN( v1->bv_len, + rc = memcmp( v1->bv_val, v2->bv_val, LDAP_MIN( v1->bv_len, v2->bv_len ) ); break; } diff --git a/servers/slurpd/Make-template b/servers/slurpd/Make-template deleted file mode 100644 index 91734c51bb..0000000000 --- a/servers/slurpd/Make-template +++ /dev/null @@ -1,81 +0,0 @@ -#----------------------------------------------------------------------------- -# Copyright (c) 1995 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. -# -# Stand-alone LDAP Update RePlication Daemon makefile -# -#----------------------------------------------------------------------------- -LDAPSRC = ../.. -HDIR = $(LDAPSRC)/include -LDIR = $(LDAPSRC)/libraries -VERSIONFILE = $(LDAPSRC)/build/version - -SRCS = admin.c args.c ch_malloc.c config.c detach.c \ - fm.c globals.c ldap_op.c lock.c main.c re.c \ - reject.c replica.c replog.c ri.c rq.c sanity.c st.c \ - tsleep.c - -OBJS = admin.o args.o ch_malloc.o config.o detach.o \ - fm.o globals.o ldap_op.o lock.o main.o re.o \ - reject.o replica.o replog.o ri.o rq.o sanity.o st.o \ - tsleep.o - -INCLUDES= -I. -I$(HDIR) $(KRBINCLUDEFLAG) -DEFINES = $(DEFS) $(SERVERDEFS) -CFLAGS = $(INCLUDES) $(THREADSINCLUDE) $(DEFINES) $(ACFLAGS) $(THREADS) -LDFLAGS = -L$(LDIR) $(KRBLIBFLAG) -LIBS = -lldap -llber -lm -llthread -lldif $(THREADSLIB) $(KRBLIBS) \ - $(ALIBS) - -all: FORCE - @if [ -z "$(MAKESLAPD)" ]; then \ - echo "uncomment the MAKESLAPD line in Make-common to make slurpd"; \ - exit 0; \ - else \ - $(MAKE) slurpd; \ - fi - -slurpd: version.o - $(CC) $(ALDFLAGS) -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) - -slurpd.pure: version.o - purify $(CC) $(ALDFLAGS) -o $@ $(OBJS) version.o $(LDFLAGS) $(LIBS) - -version.c: $(OBJS) $(LDIR)/liblber/liblber.a $(LDIR)/libldap/libldap.a - $(RM) $@ - (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ - t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ - -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ - -e "s|%VERSION%|$${v}|" \ - < Version.c > $@) - -install: $(LDAP_LIBEXECDIR) $(LDAP_LIBEXECDIR)/slurpd - -$(LDAP_LIBEXECDIR)/slurpd: slurpd - @-$(MKDIR) -p $(LDAP_LIBEXECDIR) - $(INSTALL) $(INSTALLFLAGS) -m 755 slurpd $(LDAP_LIBEXECDIR) - -lint: FORCE - $(LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -5lint: FORCE - $(5LINT) $(INCLUDES) $(DEFINES) $(SRCS) - -clean: FORCE - @echo "making clean in `$(PWD)`" - $(RM) slurpd *.o core a.out version.c - -depend: FORCE - $(MKDEP) $(INCLUDES) $(DEFINES) $(SRCS) - -links: - @echo "making links in `$(PWD)`" - @$(LN) .src/*.[ch] . - diff --git a/servers/slurpd/Makefile.in b/servers/slurpd/Makefile.in new file mode 100644 index 0000000000..30940db12f --- /dev/null +++ b/servers/slurpd/Makefile.in @@ -0,0 +1,38 @@ +## +## Makefile.in for slurpd +## + +PROGRAMS = slurpd +SRCS = admin.c args.c ch_malloc.c config.c detach.c \ + fm.c globals.c ldap_op.c lock.c main.c re.c \ + reject.c replica.c replog.c ri.c rq.c sanity.c st.c \ + tsleep.c +OBJS = admin.o args.o ch_malloc.o config.o detach.o \ + fm.o globals.o ldap_op.o lock.o main.o re.o \ + reject.o replica.o replog.o ri.o rq.o sanity.o st.o \ + tsleep.o + +LDAP_INCDIR= ../../include +LDAP_LIBDIR= ../../libraries + +BUILD_OPT = "--enable-slurpd" +BUILD_SRV = @BUILD_SLURPD@ + +all-local: slurpd + +XLIBS = @SLURPD_LIBS@ -llthread @LTHREAD_LIBS@ + +slurpd: version.o + $(CC) $(LDFLAGS) -o $@ $(OBJS) version.o $(LIBS) + +version.c: $(OBJS) $(LDAP_LIBDEPEND) + $(RM) $@ + (u=$${USER-root} v=`$(CAT) $(VERSIONFILE)` d=`$(PWD)` h=`$(HOSTNAME)` \ + t=`$(DATE)`; $(SED) -e "s|%WHEN%|$${t}|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + -e "s|%VERSION%|$${v}|" \ + < $(srcdir)/Version.c > $@) + +install-local: FORCE + @-$(MKDIR) -p $(libexecdir) + $(INSTALL) $(INSTALLFLAGS) -m 755 slurpd $(libexecdir) diff --git a/servers/slurpd/admin.c b/servers/slurpd/admin.c index 6a58b40c4c..5af8d53cce 100644 --- a/servers/slurpd/admin.c +++ b/servers/slurpd/admin.c @@ -15,9 +15,11 @@ * reconfiguration of slurpd. */ +#include "portable.h" #include -#include + +#include #include "slurp.h" #include "globals.h" @@ -33,9 +35,9 @@ * slurpd receives a USR2 signal, it will dump its replication * queue to the disk file given by SLURPD_DUMPFILE. */ -void +RETSIGTYPE do_admin() { sglob->rq->rq_dump( sglob->rq ); - (void) SIGNAL( SIGUSR2, (void *) do_admin ); + (void) SIGNAL( SIGUSR2, do_admin ); } diff --git a/servers/slurpd/args.c b/servers/slurpd/args.c index fcc7b40bd7..678954bf14 100644 --- a/servers/slurpd/args.c +++ b/servers/slurpd/args.c @@ -14,9 +14,12 @@ * args.c - process command-line arguments, and set appropriate globals. */ +#include "portable.h" + #include -#include -#include + +#include +#include #include #include @@ -30,11 +33,11 @@ usage( char *name ) { fprintf( stderr, "usage: %s\t[-d debug-level] [-s syslog-level]\n", name ); fprintf( stderr, "\t\t[-f slapd-config-file] [-r replication-log-file]\n" ); -#ifdef KERBEROS +#ifdef HAVE_KERBEROS fprintf( stderr, "\t\t[-t tmp-dir] [-o] [-k srvtab-file]\n" ); -#else /* KERBEROS */ +#else /* HAVE_KERBEROS */ fprintf( stderr, "\t\t[-t tmp-dir] [-o]\n" ); -#endif /* KERBEROS */ +#endif /* HAVE_KERBEROS */ } @@ -104,11 +107,11 @@ doargs( g->slurpd_rdir = strdup( optarg ); break; case 'k': /* name of kerberos srvtab file */ -#ifdef KERBEROS +#ifdef HAVE_KERBEROS g->default_srvtab = strdup( optarg ); -#else /* KERBEROS */ +#else /* HAVE_KERBEROS */ fprintf( stderr, "must compile with KERBEROS to use -k option\n" ); -#endif /* KERBEROS */ +#endif /* HAVE_KERBEROS */ break; case 'h': usage( g->myname ); diff --git a/servers/slurpd/ch_malloc.c b/servers/slurpd/ch_malloc.c index 298391e4f3..7b3ddcd840 100644 --- a/servers/slurpd/ch_malloc.c +++ b/servers/slurpd/ch_malloc.c @@ -14,9 +14,12 @@ * ch_malloc.c - malloc() and friends, with check for NULL return. */ +#include "portable.h" + #include -#include -#include + +#include + #include "../slapd/slap.h" diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c index 7a8261e849..7c97aaaac8 100644 --- a/servers/slurpd/config.c +++ b/servers/slurpd/config.c @@ -15,10 +15,12 @@ * config.c - configuration file handling routines */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include #include #include @@ -29,19 +31,11 @@ #define MAXARGS 100 /* Forward declarations */ -#ifdef NEEDPROTOS -static void add_replica( char **, int ); -static int parse_replica_line( char **, int, Ri *); -static void parse_line( char *, int *, char ** ); -static char *getline( FILE * ); -static char *strtok_quote( char *, char * ); -#else /* NEEDPROTOS */ -static void add_replica(); -static int parse_replica_line(); -static void parse_line(); -static char *getline(); -static char *strtok_quote(); -#endif /* NEEDPROTOS */ +static void add_replica LDAP_P(( char **, int )); +static int parse_replica_line LDAP_P(( char **, int, Ri *)); +static void parse_line LDAP_P(( char *, int *, char ** )); +static char *getline LDAP_P(( FILE * )); +static char *strtok_quote LDAP_P(( char *, char * )); /* current config file line # */ static int lineno; @@ -357,13 +351,13 @@ parse_replica_line( strlen( BINDMETHSTR ))) { val = cargv[ i ] + strlen( BINDMETHSTR ) + 1; if ( !strcasecmp( val, KERBEROSSTR )) { -#ifdef KERBEROS +#ifdef HAVE_KERBEROS ri->ri_bind_method = AUTH_KERBEROS; if ( ri->ri_srvtab == NULL ) { ri->ri_srvtab = strdup( sglob->default_srvtab ); } gots |= GOT_METHOD; -#else /* KERBEROS */ +#else /* HAVE_KERBEROS */ fprintf( stderr, "Error: a bind method of \"kerberos\" was\n" ); fprintf( stderr, "specified in the slapd configuration file,\n" ); fprintf( stderr, "but slurpd was not built with kerberos.\n" ); @@ -371,7 +365,7 @@ parse_replica_line( fprintf( stderr, "kerberos support if you wish to use\n" ); fprintf( stderr, "bindmethod=kerberos\n" ); exit( 1 ); -#endif /* KERBEROS */ +#endif /* HAVE_KERBEROS */ } else if ( !strcasecmp( val, SIMPLESTR )) { ri->ri_bind_method = AUTH_SIMPLE; gots |= GOT_METHOD; diff --git a/servers/slurpd/detach.c b/servers/slurpd/detach.c index 4b77122347..0f0d36f580 100644 --- a/servers/slurpd/detach.c +++ b/servers/slurpd/detach.c @@ -10,21 +10,20 @@ * is provided ``as is'' without express or implied warranty. */ +#include "portable.h" + #include + +#include +#include + #include -#ifdef SVR4 #include -#endif /* svr4 */ #include #include #include -#include -#include "portable.h" - -#ifdef USE_SYSCONF -#include -#endif /* USE_SYSCONF */ +#include "portable.h" detach() { @@ -33,11 +32,13 @@ detach() extern int ldap_debug; #endif -#ifdef USE_SYSCONF +#ifdef HAVE_SYSCONF nbits = sysconf( _SC_OPEN_MAX ); -#else /* USE_SYSCONF */ +#elif HAVE_GETDTABLESIZE nbits = getdtablesize(); -#endif /* USE_SYSCONF */ +#else + nbits = FD_SETSIZE; +#endif #ifdef FD_SETSIZE if ( nbits > FD_SETSIZE ) { @@ -49,7 +50,7 @@ detach() if ( ldap_debug == 0 ) { #endif for ( i = 0; i < 5; i++ ) { -#if defined( sunos5 ) && defined( THREAD_SUNOS5_LWP ) +#if HAVE_THR switch ( fork1() ) { #else switch ( fork() ) { @@ -86,14 +87,14 @@ detach() (void) dup2( sd, 2 ); close( sd ); -#ifdef USE_SETSID +#ifdef HAVE_SETSID setsid(); -#else /* USE_SETSID */ +#else /* HAVE_SETSID */ if ( (sd = open( "/dev/tty", O_RDWR )) != -1 ) { (void) ioctl( sd, TIOCNOTTY, NULL ); (void) close( sd ); } -#endif /* USE_SETSID */ +#endif /* HAVE_SETSID */ #ifdef LDAP_DEBUG } #endif diff --git a/servers/slurpd/fm.c b/servers/slurpd/fm.c index e5c0267e9f..2aed9e602e 100644 --- a/servers/slurpd/fm.c +++ b/servers/slurpd/fm.c @@ -14,50 +14,32 @@ * fm.c - file management routines. */ +#include "portable.h" + #include -#include -#include + +#include +#include #include "slurp.h" #include "globals.h" -extern void do_admin(); - -static void set_shutdown(); -void do_nothing(); /* * Externs */ -#ifdef NEEDPROTOS -extern int file_nonempty( char * ); -extern int acquire_lock(char *, FILE **, FILE ** ); -extern int relinquish_lock(char *, FILE *, FILE * ); -#else /* NEEDPROTOS */ -extern int file_nonempty(); -extern int acquire_lock(); -extern int relinquish_lock(); -#endif /* NEEDPROTOS */ +extern RETSIGTYPE do_admin LDAP_P((int)); +extern int file_nonempty LDAP_P(( char * )); +extern int acquire_lock LDAP_P((char *, FILE **, FILE ** )); +extern int relinquish_lock LDAP_P((char *, FILE *, FILE * )); /* * Forward references */ -#ifdef NEEDPROTOS -static char *get_record( FILE * ); -static void populate_queue( char *f ); -static void set_shutdown(); -void do_nothing(); -#else /* NEEDPROTOS */ -static char *get_record(); -static void populate_queue(); -static void set_shutdown(); -void do_nothing(); -#endif /* NEEDPROTOS */ - -#ifndef SYSERRLIST_IN_STDIO -extern char *sys_errlist[]; -#endif /* SYSERRLIST_IN_STDIO */ - +static char *get_record LDAP_P(( FILE * )); +static void populate_queue LDAP_P(( char *f )); +static RETSIGTYPE set_shutdown LDAP_P((int)); +RETSIGTYPE do_nothing LDAP_P((int)); /* @@ -81,19 +63,16 @@ fm( * SIG(UNUSED|USR2) - causes slurpd to read its administrative interface file. * (not yet implemented). */ -#ifdef SIGSTKFLT - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); +#ifdef HAVE_LINUX_THREADS + (void) SIGNAL( SIGSTKFLT, do_nothing ); + (void) SIGNAL( SIGUNUSED, do_admin ); #else - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); + (void) SIGNAL( SIGUSR2, do_admin ); #endif -#ifdef SIGUNUSED - (void) SIGNAL( SIGUNUSED, (void *) do_admin ); -#else - (void) SIGNAL( SIGUSR2, (void *) do_admin ); -#endif - (void) SIGNAL( SIGTERM, (void *) set_shutdown ); - (void) SIGNAL( SIGINT, (void *) set_shutdown ); - (void) SIGNAL( SIGHUP, (void *) set_shutdown ); + (void) SIGNAL( SIGTERM, set_shutdown ); + (void) SIGNAL( SIGINT, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); if ( sglob->one_shot_mode ) { if ( file_nonempty( sglob->slapd_replogfile )) { @@ -162,13 +141,13 @@ fm( /* * Set a global flag which signals that we're shutting down. */ -static void -set_shutdown() +static RETSIGTYPE +set_shutdown(int x) { int i; sglob->slurpd_shutdown = 1; /* set flag */ -#ifdef SIGSTKFLT +#ifdef HAVE_LINUX_THREADS pthread_kill( sglob->fm_tid, SIGSTKFLT ); /* wake up file mgr */ #else pthread_kill( sglob->fm_tid, SIGUSR1 ); /* wake up file mgr */ @@ -179,9 +158,9 @@ set_shutdown() (sglob->replicas[ i ])->ri_wake( sglob->replicas[ i ]); } sglob->rq->rq_unlock( sglob->rq ); /* unlock queue */ - (void) SIGNAL( SIGTERM, (void *) set_shutdown ); /* reinstall handlers */ - (void) SIGNAL( SIGINT, (void *) set_shutdown ); - (void) SIGNAL( SIGHUP, (void *) set_shutdown ); + (void) SIGNAL( SIGTERM, set_shutdown ); /* reinstall handlers */ + (void) SIGNAL( SIGINT, set_shutdown ); + (void) SIGNAL( SIGHUP, set_shutdown ); } @@ -190,13 +169,13 @@ set_shutdown() /* * A do-nothing signal handler. */ -void -do_nothing() +RETSIGTYPE +do_nothing(int i) { -#ifdef SIGSTKFLT - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); +#ifdef HAVE_LINUX_THREADS + (void) SIGNAL( SIGSTKFLT, do_nothing ); #else - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); #endif } diff --git a/servers/slurpd/globals.c b/servers/slurpd/globals.c index f8630323cb..7e2c7081bf 100644 --- a/servers/slurpd/globals.c +++ b/servers/slurpd/globals.c @@ -14,6 +14,8 @@ * globals.c - initialization code for global data */ +#include "portable.h" + #include #include "slurp.h" @@ -60,13 +62,13 @@ Globals *init_globals() fprintf( stderr, "Cannot initialize queue\n" ); exit( 1 ); } -#ifdef KERBEROS +#ifdef HAVE_KERBEROS g->default_srvtab = SRVTAB; -#endif /* KERBEROS */ -#if defined( THREAD_SUNOS4_LWP ) +#endif /* HAVE_KERBEROS */ +#if defined( HAVE_LWP ) g->tsl_list = NULL; mon_create( &g->tsl_mon ); -#endif /* THREAD_SUNOS4_LWP */ +#endif /* HAVE_LWP */ return g; } diff --git a/servers/slurpd/globals.h b/servers/slurpd/globals.h index 5d976ff8a4..1582d1780d 100644 --- a/servers/slurpd/globals.h +++ b/servers/slurpd/globals.h @@ -10,6 +10,8 @@ * is provided ``as is'' without express or implied warranty. */ +#ifndef SLURPD_GLOBALS_H +#define SLURPD_GLOBALS_H 1 /* * globals.h - definition of structure holding global data. @@ -17,6 +19,8 @@ #include "slurp.h" +LDAP_BEGIN_DECL + typedef struct globals { /* Thread ID for file manager thread */ pthread_t fm_tid; @@ -50,11 +54,11 @@ typedef struct globals { St *st; /* Pointer to replication queue */ Rq *rq; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS /* Default name of kerberos srvtab file */ char *default_srvtab; -#endif /* KERBEROS */ -#if defined( THREAD_SUNOS4_LWP ) +#endif /* HAVE_KERBEROS */ +#if defined( HAVE_LWP ) && !defined( HAVE_LWP_THR ) tl_t *tsl_list; mon_t tsl_mon; #endif /* THREAD_SUNOS4_LWP */ @@ -62,3 +66,7 @@ typedef struct globals { extern Globals *sglob; + +LDAP_END_DECL + +#endif /* SLURPD_GLOBALS_H */ diff --git a/servers/slurpd/ldap_op.c b/servers/slurpd/ldap_op.c index 00f18b8351..636b120793 100644 --- a/servers/slurpd/ldap_op.c +++ b/servers/slurpd/ldap_op.c @@ -14,49 +14,41 @@ * ldap_op.c - routines to perform LDAP operations */ +#include "portable.h" + #include -#include -#include -#include - -#ifdef KERBEROS -#ifdef KERBEROS_V -#include -#else -#include -#endif /* KERBEROS_V */ -#endif /* KERBEROS */ + +#include +#include +#include + +#include #include #include -#include "portable.h" #include "slurp.h" /* Forward references */ -static int get_changetype( char * ); -static struct berval **make_singlevalued_berval( char *, int ); -static int op_ldap_add( Ri *, Re *, char ** ); -static int op_ldap_modify( Ri *, Re *, char ** ); -static int op_ldap_delete( Ri *, Re *, char ** ); -static int op_ldap_modrdn( Ri *, Re *, char ** ); -static LDAPMod *alloc_ldapmod(); -static void free_ldapmod( LDAPMod * ); -static void free_ldmarr( LDAPMod ** ); -static int getmodtype( char * ); -static void dump_ldm_array( LDAPMod ** ); -static char **read_krbnames( Ri * ); -static void upcase( char * ); -static int do_bind( Ri *, int * ); -static int do_unbind( Ri * ); +static int get_changetype LDAP_P(( char * )); +static struct berval **make_singlevalued_berval LDAP_P(( char *, int )); +static int op_ldap_add LDAP_P(( Ri *, Re *, char ** )); +static int op_ldap_modify LDAP_P(( Ri *, Re *, char ** )); +static int op_ldap_delete LDAP_P(( Ri *, Re *, char ** )); +static int op_ldap_modrdn LDAP_P(( Ri *, Re *, char ** )); +static LDAPMod *alloc_ldapmod LDAP_P(()); +static void free_ldapmod LDAP_P(( LDAPMod * )); +static void free_ldmarr LDAP_P(( LDAPMod ** )); +static int getmodtype LDAP_P(( char * )); +static void dump_ldm_array LDAP_P(( LDAPMod ** )); +static char **read_krbnames LDAP_P(( Ri * )); +static void upcase LDAP_P(( char * )); +static int do_bind LDAP_P(( Ri *, int * )); +static int do_unbind LDAP_P(( Ri * )); /* External references */ -#ifndef SYSERRLIST_IN_STDIO -extern char *sys_errlist[]; -#endif /* SYSERRLIST_IN_STDIO */ - -extern char *ch_malloc( unsigned long ); +extern char *ch_malloc LDAP_P(( unsigned long )); static char *kattrs[] = {"kerberosName", NULL }; static struct timeval kst = {30L, 0L}; @@ -590,7 +582,7 @@ do_bind( int rc; int ldrc; char msgbuf[ 1024]; -#ifdef KERBEROS +#ifdef HAVE_KERBEROS int retval = 0; int kni, got_tgt; char **krbnames; @@ -598,7 +590,7 @@ do_bind( char realm[ REALM_SZ ]; char name[ ANAME_SZ ]; char instance[ INST_SZ ]; -#endif /* KERBEROS */ +#endif /* HAVE_KERBEROS */ *lderr = 0; @@ -637,12 +629,12 @@ do_bind( switch ( ri->ri_bind_method ) { case AUTH_KERBEROS: -#ifndef KERBEROS +#ifndef HAVE_KERBEROS Debug( LDAP_DEBUG_ANY, "Error: Kerberos bind for %s:%d, but not compiled w/kerberos\n", ri->ri_hostname, ri->ri_port, 0 ); return( BIND_ERR_KERBEROS_FAILED ); -#else /* KERBEROS */ +#else /* HAVE_KERBEROS */ /* * Bind using kerberos. * If "bindprincipal" was given in the config file, then attempt @@ -718,7 +710,7 @@ kexit: if ( krbnames != NULL ) { } return( retval); break; -#endif /* KERBEROS */ +#endif /* HAVE_KERBEROS */ case AUTH_SIMPLE: /* * Bind with a plaintext password. diff --git a/servers/slurpd/lock.c b/servers/slurpd/lock.c index 62aab06784..048c42529c 100644 --- a/servers/slurpd/lock.c +++ b/servers/slurpd/lock.c @@ -14,16 +14,17 @@ * lock.c - routines to open and apply an advisory lock to a file */ +#include "portable.h" + #include -#include -#include + +#include +#include +#include + #include #include -#include -#include "portable.h" -#ifdef USE_LOCKF -#include -#endif + #include "../slapd/slap.h" @@ -48,11 +49,12 @@ lock_fopen( } /* acquire the lock */ -#ifdef USE_LOCKF - while ( lockf( fileno( *lfp ), F_LOCK, 0 ) != 0 ) { +#ifdef HAVE_FLOCK + while ( flock( fileno( *lfp ), LOCK_EX ) != 0 ) #else - while ( flock( fileno( *lfp ), LOCK_EX ) != 0 ) { + while ( lockf( fileno( *lfp ), F_LOCK, 0 ) != 0 ) #endif + { ; /* NULL */ } @@ -60,10 +62,10 @@ lock_fopen( if ( (fp = fopen( fname, type )) == NULL ) { Debug( LDAP_DEBUG_ANY, "Error: could not open \"%s\"\n", fname, 0, 0 ); -#ifdef USE_LOCKF - lockf( fileno( *lfp ), F_ULOCK, 0 ); -#else +#ifdef HAVE_FLOCK flock( fileno( *lfp ), LOCK_UN ); +#else + lockf( fileno( *lfp ), F_ULOCK, 0 ); #endif return( NULL ); } @@ -80,10 +82,10 @@ lock_fclose( ) { /* unlock */ -#ifdef USE_LOCKF - lockf( fileno( lfp ), F_ULOCK, 0 ); -#else +#ifdef HAVE_FLOCK flock( fileno( lfp ), LOCK_UN ); +#else + lockf( fileno( lfp ), F_ULOCK, 0 ); #endif fclose( lfp ); diff --git a/servers/slurpd/main.c b/servers/slurpd/main.c index d4eeb6335b..d780ed3038 100644 --- a/servers/slurpd/main.c +++ b/servers/slurpd/main.c @@ -15,6 +15,8 @@ * main.c - main routine for slurpd. */ +#include "portable.h" + #include #include "slurp.h" @@ -26,9 +28,10 @@ extern void fm(); extern int start_replica_thread( Ri * ); extern Globals *init_globals(); extern int sanity(); -#if defined( THREAD_SUNOS4_LWP ) + +#if defined( HAVE_LWP ) extern void start_lwp_scheduler(); -#endif /* THREAD_SUNOS4_LWP */ +#endif /* HAVE_LWP */ main( int argc, @@ -39,11 +42,11 @@ main( int status; int i; -#ifndef _THREAD +#ifdef NO_THREADS /* Haven't yet written the non-threaded version */ fprintf( stderr, "slurpd currently requires threads support\n" ); exit( 1 ); -#endif /* !_THREAD */ +#else /* * Create and initialize globals. init_globals() also initializes @@ -93,21 +96,20 @@ main( * and if not in one-shot mode. */ #ifdef LDAP_DEBUG - if (( ldap_debug == 0 ) && !sglob->one_shot_mode ) { + if (( ldap_debug == 0 ) && !sglob->one_shot_mode ) #else /* LDAP_DEBUG */ - if ( !sglob->one_shot_mode ) { + if ( !sglob->one_shot_mode ) #endif /* LDAP_DEBUG */ - detach(); + { + detach(); } -#ifdef _THREAD - -#if defined( THREAD_SUNOS4_LWP ) +#if defined( HAVE_LWP ) /* * Need to start a scheduler thread under SunOS 4 */ start_lwp_scheduler(); -#endif /* THREAD_SUNOS4_LWP */ +#endif /* HAVE_LWP */ /* @@ -121,35 +123,37 @@ main( * Start the main file manager thread (in fm.c). */ pthread_attr_init( &attr ); -#ifndef THREAD_MIT_PTHREADS + +#if !defined(HAVE_PTHREADS_D4) && !defined(HAVE_DCE) /* POSIX_THREADS or compatible * This is a draft 10 or standard pthreads implementation */ - if ( pthread_create( &(sglob->fm_tid), &attr, (void *) fm, (void *) NULL ) + if ( pthread_create( &(sglob->fm_tid), &attr, fm, (void *) NULL ) != 0 ) { Debug( LDAP_DEBUG_ANY, "file manager pthread_create failed\n", 0, 0, 0 ); exit( 1 ); } -#else /* !THREAD_MIT_PTHREADS */ +#else /* !PTHREADS_FINAL */ /* * This is a draft 4 or earlier pthreads implementation */ - if ( pthread_create( &(sglob->fm_tid), attr, (void *) fm, (void *) NULL ) + if ( pthread_create( &(sglob->fm_tid), attr, fm, (void *) NULL ) != 0 ) { Debug( LDAP_DEBUG_ANY, "file manager pthread_create failed\n", 0, 0, 0 ); exit( 1 ); } -#endif /* !THREAD_MIT_PTHREADS */ +#endif /* !PTHREADS_FINAL */ + pthread_attr_destroy( &attr ); /* * Wait for the fm thread to finish. */ -#ifdef POSIX_THREADS +#ifdef HAVE_PTHREADS_FINAL pthread_join( sglob->fm_tid, (void *) NULL ); #else pthread_join( sglob->fm_tid, (void *) &status ); @@ -158,7 +162,7 @@ main( * Wait for the replica threads to finish. */ for ( i = 0; sglob->replicas[ i ] != NULL; i++ ) { -#ifdef POSIX_THREADS +#ifdef HAVE_PTHREADS_FINAL pthread_join( sglob->replicas[ i ]->ri_tid, (void *) NULL ); #else pthread_join( sglob->replicas[ i ]->ri_tid, (void *) &status ); @@ -168,12 +172,5 @@ main( sglob->slurpd_shutdown = 1; pthread_exit( 0 ); -#else /* !_THREAD */ - /* - * Non-threaded case. - */ - exit( 0 ); - -#endif /* !_THREAD */ - +#endif /* !NO_THREADS */ } diff --git a/servers/slurpd/re.c b/servers/slurpd/re.c index ea2960f671..36a37538fe 100644 --- a/servers/slurpd/re.c +++ b/servers/slurpd/re.c @@ -18,30 +18,29 @@ */ +#include "portable.h" + #include -#include -#include -#include + +#include +#include +#include #include "../slapd/slap.h" #include "slurp.h" #include "globals.h" /* externs */ -extern char *str_getline( char **next ); -extern void ch_free( char *p ); - -#ifndef SYSERRLIST_IN_STDIO -extern char *sys_errlist[]; -#endif /* SYSERRLIST_IN_STDIO */ +extern char *str_getline LDAP_P(( char **next )); +extern void ch_free LDAP_P(( char *p )); /* Forward references */ -static Rh *get_repl_hosts( char *, int *, char ** ); -static int gettype( char * ); -static int getchangetype( char *); -static int Re_parse( Re *re, char *replbuf ); -static void Re_dump( Re *re, FILE *fp ); -static void warn_unknown_replica( char *, int port ); +static Rh *get_repl_hosts LDAP_P(( char *, int *, char ** )); +static int gettype LDAP_P(( char * )); +static int getchangetype LDAP_P(( char * )); +static int Re_parse LDAP_P(( Re *re, char *replbuf )); +static void Re_dump LDAP_P(( Re *re, FILE *fp )); +static void warn_unknown_replica LDAP_P(( char *, int port )); /* Globals, scoped within this file */ static int nur = 0; /* Number of unknown replicas */ @@ -82,10 +81,10 @@ Re_free( "Warning: freeing re (dn: %s) with nonzero refcnt\n", re->re_dn, 0, 0 ); } -#if !defined( THREAD_SUNOS4_LWP ) +#if !defined( HAVE_LWP ) /* This seems to have problems under SunOS lwp */ pthread_mutex_destroy( &re->re_mutex ); -#endif /* THREAD_SUNOS4_LWP */ +#endif /* HAVE_LWP */ ch_free( re->re_timestamp ); if (( rh = re->re_replicas ) != NULL ) { for ( i = 0; rh[ i ].rh_hostname != NULL; i++ ) { diff --git a/servers/slurpd/reject.c b/servers/slurpd/reject.c index 8ae0dc6363..aa7266740b 100644 --- a/servers/slurpd/reject.c +++ b/servers/slurpd/reject.c @@ -17,21 +17,20 @@ * to a replica LDAP server. */ +#include "portable.h" #include + +#include +#include + #include #include #include -#include #include "slurp.h" #include "globals.h" -#ifndef SYSERRLIST_IN_STDIO -extern char *sys_errlist[]; -#endif /* SYSERRLIST_IN_STDIO */ - - /* * Write a replication record to a reject file. The reject file has the * same name as the replica's private copy of the file but with ".rej" diff --git a/servers/slurpd/replica.c b/servers/slurpd/replica.c index faeddeaa3f..7ce0c54f2b 100644 --- a/servers/slurpd/replica.c +++ b/servers/slurpd/replica.c @@ -15,6 +15,7 @@ * replica.c - code to start up replica threads. */ +#include "portable.h" #include @@ -62,29 +63,30 @@ start_replica_thread( pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); #endif -#ifndef THREAD_MIT_PTHREADS +#if !defined(HAVE_PTHREAD_D4) && !defined(HAVE_DCE) /* POSIX_THREADS or compatible * This is a draft 10 or standard pthreads implementation */ - if ( pthread_create( &(ri->ri_tid), &attr, (void *) replicate, + if ( pthread_create( &(ri->ri_tid), &attr, replicate, (void *) ri ) != 0 ) { Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n", ri->ri_hostname, ri->ri_port, 0 ); pthread_attr_destroy( &attr ); return -1; } -#else /* !THREAD_MIT_PTHREADS */ +#else /* !final */ /* * This is a draft 4 or earlier pthreads implementation */ - if ( pthread_create( &(ri->ri_tid), attr, (void *) replicate, + if ( pthread_create( &(ri->ri_tid), attr, replicate, (void *) ri ) != 0 ) { Debug( LDAP_DEBUG_ANY, "replica \"%s:%d\" pthread_create failed\n", ri->ri_hostname, ri->ri_port, 0 ); pthread_attr_destroy( &attr ); return -1; } -#endif /* !THREAD_MIT_PTHREADS */ +#endif /* !final */ + pthread_attr_destroy( &attr ); return 0; } diff --git a/servers/slurpd/replog.c b/servers/slurpd/replog.c index c3a855cffe..5573215cc5 100644 --- a/servers/slurpd/replog.c +++ b/servers/slurpd/replog.c @@ -15,55 +15,41 @@ * replog.c - routines which read and write replication log files. */ +#include "portable.h" -#include #include -#include -#include -#include + +#include +#include +#include +#include +#include + #include #include #include -#include -#include -#include "portable.h" #include "slurp.h" #include "globals.h" /* * Externs */ -#ifdef NEEDPROTOS -extern FILE *lock_fopen( char *, char *, FILE ** ); -extern char *ch_malloc( unsigned long ); -#else /* NEEDPROTOS */ -extern FILE *lock_fopen(); -extern char *ch_malloc(); -#endif /* NEEDPROTOS */ +extern FILE *lock_fopen LDAP_P(( char *, char *, FILE ** )); +extern char *ch_malloc LDAP_P(( unsigned long )); /* * Forward declarations */ -#ifdef NEEDPROTOS -int file_nonempty( char * ); -#else /* NEEDPROTOS */ -int file_nonempty(); -#endif /* NEEDPROTOS */ +int file_nonempty LDAP_P(( char * )); -#ifndef SYSERRLIST_IN_STDIO -extern char *sys_errlist[]; -#endif - /* * Forward declarations */ static int duplicate_replog( char *, char * ); - - /* * Copy the replication log. Returns 0 on success, 1 if a temporary * error occurs, and -1 if a fatal error occurs. diff --git a/servers/slurpd/ri.c b/servers/slurpd/ri.c index 40d75eac79..4356c85cee 100644 --- a/servers/slurpd/ri.c +++ b/servers/slurpd/ri.c @@ -17,33 +17,23 @@ */ +#include "portable.h" #include -#include +#include #include "slurp.h" #include "globals.h" /* External references */ -#ifdef NEEDPROTOS -extern void write_reject( Ri *, Re *, int, char * ); -extern void do_nothing(); -#else /* NEEDPROTOS */ -extern void write_reject(); -extern void do_nothing(); -#endif /* NEEDPROTOS */ +extern void write_reject LDAP_P(( Ri *, Re *, int, char * )); +extern void do_nothing LDAP_P(()); /* Forward references */ -#ifdef NEEDPROTOS -static int ismine( Ri *, Re * ); -static int isnew( Ri *, Re * ); -void tsleep( time_t ); -#else /* NEEDPROTOS */ -static int ismine(); -static int isnew(); -void tsleep(); -#endif /* NEEDPROTOS */ +static int ismine LDAP_P(( Ri *, Re * )); +static int isnew LDAP_P(( Ri *, Re * )); +void tsleep LDAP_P(( time_t )); /* @@ -60,10 +50,10 @@ Ri_process( int rc ; char *errmsg; -#ifdef SIGSTKFLT - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); +#ifdef HAVE_LINUX_THREADS + (void) SIGNAL( SIGSTKFLT, do_nothing ); #else - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); #endif (void) SIGNAL( SIGPIPE, SIG_IGN ); if ( ri == NULL ) { @@ -161,12 +151,12 @@ Ri_wake( if ( ri == NULL ) { return; } -#ifdef SIGSTKFLT +#ifdef HAVE_LINUX_THREADS pthread_kill( ri->ri_tid, SIGSTKFLT ); - (void) SIGNAL( SIGSTKFLT, (void *) do_nothing ); + (void) SIGNAL( SIGSTKFLT, do_nothing ); #else pthread_kill( ri->ri_tid, SIGUSR1 ); - (void) SIGNAL( SIGUSR1, (void *) do_nothing ); + (void) SIGNAL( SIGUSR1, do_nothing ); #endif } diff --git a/servers/slurpd/rq.c b/servers/slurpd/rq.c index 3fb842d48e..e34572797b 100644 --- a/servers/slurpd/rq.c +++ b/servers/slurpd/rq.c @@ -31,6 +31,8 @@ * */ +#include "portable.h" + #include #include "slurp.h" @@ -38,15 +40,7 @@ /* externs */ -#ifdef NEEDPROTOS -extern void Re_dump( Re *re ); -#else /* NEEDPROTOS */ -extern void Re_dump(); -#endif /* NEEDPROTOS */ - -#ifndef SYSERRLIST_IN_STDIO -extern char *sys_errlist[]; -#endif /* SYSERRLIST_IN_STDIO */ +extern void Re_dump LDAP_P(( Re *re )); /* * Lock the replication queue. @@ -60,9 +54,6 @@ Rq_lock( } - - - /* * Unlock the replication queue. */ @@ -89,8 +80,6 @@ Rq_gethead( } - - /* * Return the next item in the queue. Callers should lock the queue before * calling this routine. @@ -108,8 +97,6 @@ Rq_getnext( } - - /* * Delete the item at the head of the list. The queue should be locked * by the caller before calling this routine. @@ -144,8 +131,6 @@ Rq_delhead( } - - /* * Add an entry to the tail of the replication queue. Locking is handled * internally. When items are added to the queue, this routine wakes @@ -209,8 +194,6 @@ Rq_add( } - - /* * Garbage-collect the replication queue. Locking is handled internally. */ @@ -234,7 +217,6 @@ Rq_gc( } - /* * For debugging: dump the contents of the replication queue to a file. * Locking is handled internally. @@ -268,7 +250,6 @@ Rq_dump( } - /* * Write the contents of a replication queue to a file. Returns zero if * successful, -1 if not. Handles queue locking internally. Callers should @@ -317,8 +298,6 @@ Rq_write( } - - /* * Check to see if the private slurpd replication log needs trimming. * The current criteria are: @@ -391,8 +370,6 @@ Rq_getcount( } - - /* * Allocate and initialize an Rq object. */ diff --git a/servers/slurpd/sanity.c b/servers/slurpd/sanity.c index 04be7db86a..db0d2ed045 100644 --- a/servers/slurpd/sanity.c +++ b/servers/slurpd/sanity.c @@ -18,13 +18,15 @@ * feedback to the users. */ +#include "portable.h" + #include -#include -#include + +#include +#include #include "slurp.h" #include "globals.h" -#include "portable.h" #define FC_DIRBAD 1 #define FC_DIRUNREAD 2 @@ -37,11 +39,7 @@ /* * Forward declarations */ -#ifdef NEEDPROTOS -static unsigned int filecheck( char * ); -#else /* NEEDPROTOS */ -static unsigned int filecheck(); -#endif /* NEEDPROTOS */ +static unsigned int filecheck LDAP_P(( char * )); diff --git a/servers/slurpd/slurp.h b/servers/slurpd/slurp.h index 622cd38374..efc9856502 100644 --- a/servers/slurpd/slurp.h +++ b/servers/slurpd/slurp.h @@ -15,16 +15,18 @@ #ifndef _SLURPD_H_ #define _SLURPD_H_ +#include "portable.h" + #define LDAP_SYSLOG -#include -#include -#include +#include +#include + #include + #include "lber.h" #include "ldap.h" #include "lthread.h" -#include "portable.h" #include "ldapconfig.h" #include "ldif.h" @@ -135,6 +137,7 @@ #define RETRY_SLEEP_TIME 60 +LDAP_BEGIN_DECL /* * **************************************************************************** @@ -317,7 +320,7 @@ typedef struct st { int (*st_unlock)(); /* read status info from disk */ } St; -#if defined( THREAD_SUNOS4_LWP ) +#if defined( HAVE_LWP ) typedef struct tl { thread_t tl_tid; /* thread being managed */ time_t tl_wake; /* time thread should be resumed */ @@ -328,22 +331,18 @@ typedef struct tsl { tl_t *tsl_list; mon_t tsl_mon; } tsl_t; -#endif /* THREAD_SUNOS4_LWP */ +#endif /* HAVE_LWP */ /* * Public functions used to instantiate and initialize queue objects. */ -#ifdef NEEDPROTOS -extern int Ri_init( Ri **ri ); -extern int Rq_init( Rq **rq ); -extern int Re_init( Re **re ); -#else /* NEEDPROTOS */ -extern int Ri_init(); -extern int Rq_init(); -extern int Re_init(); -#endif /* NEEDPROTOS */ +extern int Ri_init LDAP_P(( Ri **ri )); +extern int Rq_init LDAP_P(( Rq **rq )); +extern int Re_init LDAP_P(( Re **re )); + +LDAP_END_DECL #endif /* _SLURPD_H_ */ diff --git a/servers/slurpd/st.c b/servers/slurpd/st.c index e66a28ba1c..d18f5381fd 100644 --- a/servers/slurpd/st.c +++ b/servers/slurpd/st.c @@ -16,19 +16,15 @@ * writing status information to disk. */ - +#include "portable.h" #include -#include -#include +#include +#include #include "slurp.h" #include "globals.h" -#ifndef SYSERRLIST_IN_STDIO -extern char *sys_errlist[]; -#endif /* SYSERRLIST_IN_STDIO */ - /* * Add information about replica host specified by Ri to list * of hosts. diff --git a/servers/slurpd/tsleep.c b/servers/slurpd/tsleep.c index 5dc3ba3dea..bfbdffbfa2 100644 --- a/servers/slurpd/tsleep.c +++ b/servers/slurpd/tsleep.c @@ -24,13 +24,15 @@ * is so much simpler... */ +#include "portable.h" + #include #include "slurp.h" #include "globals.h" -#if defined( THREAD_SUNOS4_LWP ) +#if defined( HAVE_LWP ) extern stkalign_t *get_stack( int * ); extern void free_stack( int ); @@ -140,7 +142,7 @@ start_lwp_scheduler() } -#else /* THREAD_SUNOS4_LWP */ +#else /* !HAVE_LWP */ /* * Here we assume we have fully preemptive threads, and that sleep() @@ -153,7 +155,7 @@ tsleep( { sleep( interval ); } -#endif /* THREAD_SUNOS4_LWP */ +#endif /* !HAVE_LWP */ diff --git a/tests/Make-template b/tests/Make-template deleted file mode 100644 index 46675972d7..0000000000 --- a/tests/Make-template +++ /dev/null @@ -1,37 +0,0 @@ -#----------------------------------------------------------------------------- -# Copyright (c) 1996 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. -# -# LDAP tests Make template file -# -#----------------------------------------------------------------------------- - -SCRIPTSDIR=./scripts - -all: FORCE - @echo "Initiating LDAP tests..."; \ - test -d test-db || $(MKDIR) test-db ; \ - test -d test-repl || $(MKDIR) test-repl ; \ - $(SCRIPTSDIR)/all $(SCRIPTSDIR) - -install: FORCE - -depend: FORCE - -clean: FORCE - $(RM) test-db/[!C]* test-repl/[!C]* *core - -veryclean: clean - -links: - @echo "making links in `$(PWD)`"; \ - $(LN) .src/scripts . ; \ - $(LN) .src/data . ; \ - $(MKDIR) test-db test-repl diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000000..5965bd6d15 --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,27 @@ +## Copyright 1998 The OpenLDAP Foundation, All Rights Reserved. +## COPYING RESTRICTIONS APPLY, see COPYRIGHT file +## +## tests Makefile.in for OpenLDAP + + +SCRIPTSDIR=./scripts + +all-local: FORCE + @echo "Initiating LDAP tests..."; \ + $(MKDIR) -p test-db test-repl ; \ + $(SCRIPTSDIR)/all $(SCRIPTSDIR) + +clean-local: FORCE + $(RM) test-db/[!C]* test-repl/[!C]* *core + +veryclean-local: clean + +depend-local: FORCE + +install-local: FORCE + +all-common: all-local +install-common: install-local +clean-common: clean-local +veryclean-common: veryclean-local +depend-common: depend-local -- 2.39.2