summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>1997-09-14 17:50:06 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>1997-09-14 17:50:06 +0000
commitac16f380e349fa39ec7e26bccb5456cb300006a5 (patch)
treec07ca88af97b4f6b77d28a2dc723d2e4621ed302
parentd33e482744fad80d95cdd89ed380c5b8401e49bf (diff)
Pull in sources from zephyr locker. See /mit/zephyr/repository for
detailed change information.
-rw-r--r--.ATHENA,l1
-rw-r--r--.rconf17
-rw-r--r--FILES687
-rw-r--r--INSTALL80
-rw-r--r--Imakefile29
-rw-r--r--Makefile.athena18
-rw-r--r--Makefile.in49
-rw-r--r--NOTES46
-rw-r--r--OPERATING54
-rw-r--r--README37
-rw-r--r--USING77
-rw-r--r--acconfig.h24
-rw-r--r--aclocal.m421
-rw-r--r--clients/Imakefile20
-rw-r--r--clients/syslogd/Imakefile28
-rw-r--r--clients/syslogd/Makefile.in47
-rw-r--r--clients/syslogd/syslog.3184
-rw-r--r--clients/syslogd/syslog.c206
-rw-r--r--clients/syslogd/syslog.conf20
-rw-r--r--clients/syslogd/syslog.h5
-rw-r--r--clients/syslogd/syslogd.c433
-rw-r--r--clients/xzwrite/GetString.c25
-rw-r--r--clients/xzwrite/Imakefile28
-rw-r--r--clients/xzwrite/Makefile.in57
-rw-r--r--clients/xzwrite/Makefile.old96
-rw-r--r--clients/xzwrite/XZwrite.in (renamed from clients/xzwrite/XZwrite)4
-rw-r--r--clients/xzwrite/bfgets.c2
-rw-r--r--clients/xzwrite/destlist.c23
-rw-r--r--clients/xzwrite/destlist.c.old417
-rw-r--r--clients/xzwrite/gethomedir.c3
-rw-r--r--clients/xzwrite/interface.c23
-rw-r--r--clients/xzwrite/logins.c15
-rw-r--r--clients/xzwrite/util.c25
-rw-r--r--clients/xzwrite/xzwrite-proto.h123
-rw-r--r--clients/xzwrite/xzwrite.c15
-rw-r--r--clients/xzwrite/xzwrite.h2
-rw-r--r--clients/xzwrite/zephyr.c34
-rw-r--r--clients/xzwrite/zephyr.c.old269
-rw-r--r--clients/zaway/Imakefile15
-rw-r--r--clients/zaway/Makefile.in47
-rw-r--r--clients/zaway/zaway.c29
-rw-r--r--clients/zctl/Imakefile16
-rw-r--r--clients/zctl/Makefile.in61
-rw-r--r--clients/zctl/zctl.19
-rw-r--r--clients/zctl/zctl.c51
-rw-r--r--clients/zctl/zctl_cmds.ct3
-rw-r--r--clients/zleave/Imakefile15
-rw-r--r--clients/zleave/Makefile.in47
-rw-r--r--clients/zleave/zleave.c25
-rw-r--r--clients/zlocate/Imakefile15
-rw-r--r--clients/zlocate/Makefile.in47
-rw-r--r--clients/zlocate/zlocate.c22
-rw-r--r--clients/zmailnotify/Imakefile19
-rw-r--r--clients/zmailnotify/Makefile.in47
-rw-r--r--clients/zmailnotify/zmailnotify.c66
-rw-r--r--clients/znol/Imakefile15
-rw-r--r--clients/znol/Makefile.in47
-rw-r--r--clients/znol/znol.c9
-rw-r--r--clients/zpopnotify/Imakefile13
-rw-r--r--clients/zpopnotify/Makefile.in47
-rw-r--r--clients/zpopnotify/zpopnotify.c5
-rw-r--r--clients/zshutdown_notify/Imakefile16
-rw-r--r--clients/zshutdown_notify/Makefile.in47
-rw-r--r--clients/zshutdown_notify/zshutdown_notify.c18
-rw-r--r--clients/zstat/Imakefile15
-rw-r--r--clients/zstat/Makefile.in47
-rw-r--r--clients/zstat/zserver.h4
-rw-r--r--clients/zstat/zstat.c143
-rw-r--r--clients/zwrite/Imakefile15
-rw-r--r--clients/zwrite/Makefile.in47
-rw-r--r--clients/zwrite/zwrite.13
-rw-r--r--clients/zwrite/zwrite.c67
-rwxr-xr-xconfig.guess (renamed from util/autoconf/config.guess)47
-rwxr-xr-xconfig.sub (renamed from util/autoconf/config.sub)52
-rw-r--r--config/.mkdirhier.sh,l1
-rw-r--r--config/Imake.rules267
-rw-r--r--config/Imake.tmpl405
-rwxr-xr-xconfig/mkdirhier.sh24
-rw-r--r--config/site.def178
-rw-r--r--config/zephyr.rules102
-rwxr-xr-xconfigure3824
-rw-r--r--configure.in182
-rwxr-xr-xensure-dir.sh21
-rw-r--r--h/Imakefile11
-rw-r--r--h/config.h.in163
-rw-r--r--h/dyn.h (renamed from libdyn/dyn.h)25
-rw-r--r--h/internal.h96
-rw-r--r--h/sysdep.h193
-rw-r--r--h/zephyr/Imakefile34
-rw-r--r--h/zephyr/mit-copyright.h2
-rw-r--r--h/zephyr/zephyr.h362
-rw-r--r--h/zephyr/zephyr.h.in355
-rw-r--r--h/zephyr/zephyr_conf.h97
-rw-r--r--h/zephyr/zephyr_internal.h96
-rw-r--r--h/zephyr/zsyslog.h22
-rwxr-xr-xinstall.sh (renamed from util/autoconf/install-sh)0
-rw-r--r--lib/Imakefile133
-rw-r--r--lib/Makefile.in61
-rw-r--r--lib/ZAsyncLocate.c8
-rw-r--r--lib/ZCkAuth.c25
-rw-r--r--lib/ZCkIfNot.c10
-rw-r--r--lib/ZClosePort.c8
-rw-r--r--lib/ZCmpUID.c4
-rw-r--r--lib/ZCmpUIDP.c12
-rw-r--r--lib/ZFlsLocs.c4
-rw-r--r--lib/ZFlsSubs.c6
-rw-r--r--lib/ZFmtAuth.c5
-rw-r--r--lib/ZFmtList.c6
-rw-r--r--lib/ZFmtNotice.c2
-rw-r--r--lib/ZFmtRaw.c2
-rw-r--r--lib/ZFmtRawLst.c4
-rw-r--r--lib/ZFmtSmRLst.c4
-rw-r--r--lib/ZFmtSmRaw.c4
-rw-r--r--lib/ZFreeNot.c4
-rw-r--r--lib/ZGetLocs.c4
-rw-r--r--lib/ZGetSender.c11
-rw-r--r--lib/ZGetSubs.c4
-rw-r--r--lib/ZGetWGPort.c3
-rw-r--r--lib/ZIfNotice.c12
-rw-r--r--lib/ZInit.c63
-rw-r--r--lib/ZLocateU.c4
-rw-r--r--lib/ZLocations.c124
-rw-r--r--lib/ZMakeAscii.c47
-rw-r--r--lib/ZMkAuth.c28
-rw-r--r--lib/ZNewLocU.c11
-rw-r--r--lib/ZOpenPort.c4
-rw-r--r--lib/ZParseNot.c92
-rw-r--r--lib/ZPeekIfNot.c4
-rw-r--r--lib/ZPeekNot.c4
-rw-r--r--lib/ZPeekPkt.c4
-rw-r--r--lib/ZPending.c4
-rw-r--r--lib/ZReadAscii.c47
-rw-r--r--lib/ZRecvNot.c4
-rw-r--r--lib/ZRecvPkt.c4
-rw-r--r--lib/ZRetSubs.c65
-rw-r--r--lib/ZSendList.c8
-rw-r--r--lib/ZSendNot.c10
-rw-r--r--lib/ZSendPkt.c4
-rw-r--r--lib/ZSendRLst.c6
-rw-r--r--lib/ZSendRaw.c4
-rw-r--r--lib/ZSetDest.c4
-rw-r--r--lib/ZSetFD.c4
-rw-r--r--lib/ZSetSrv.c4
-rw-r--r--lib/ZSubs.c37
-rw-r--r--lib/ZVariables.c22
-rw-r--r--lib/ZWait4Not.c22
-rw-r--r--lib/ZhmStat.c88
-rw-r--r--lib/Zinternal.c150
-rw-r--r--lib/acl_files.c.old556
-rwxr-xr-xlib/decl7
-rw-r--r--lib/decl.awk9
-rw-r--r--lib/inet_ntoa.c36
-rw-r--r--lib/krb_err.et259
-rw-r--r--lib/lib_headers197
-rw-r--r--lib/mit-copyright.h24
-rw-r--r--lib/strcasecmp.c95
-rw-r--r--libdes/ChangeLog68
-rw-r--r--libdes/Imakefile139
-rw-r--r--libdes/Makefile227
-rw-r--r--libdes/debug_decl.c19
-rw-r--r--libdes/des.h63
-rw-r--r--libdes/desglue.c109
-rw-r--r--libdes/destest.c37
-rw-r--r--libdes/doc/libdes.doc208
-rw-r--r--libdes/enc.c127
-rw-r--r--libdes/f_README69
-rw-r--r--libdes/f_cbc.c198
-rw-r--r--libdes/f_cksum.c108
-rw-r--r--libdes/f_ecb.c95
-rw-r--r--libdes/f_parity.c62
-rw-r--r--libdes/f_pcbc.c207
-rw-r--r--libdes/f_sched.c335
-rw-r--r--libdes/f_tables.c341
-rw-r--r--libdes/f_tables.h223
-rw-r--r--libdes/key_sched.c58
-rw-r--r--libdes/new_rnd_key.c207
-rw-r--r--libdes/quad_cksum.c153
-rw-r--r--libdes/random_key.c97
-rw-r--r--libdes/read_password.c249
-rw-r--r--libdes/string_to_key.c123
-rw-r--r--libdes/util.c36
-rw-r--r--libdes/verify.c275
-rw-r--r--libdes/weak_key.c73
-rw-r--r--libdyn/Imakefile33
-rw-r--r--libdyn/Makefile.in47
-rw-r--r--libdyn/Makefile.old42
-rw-r--r--libdyn/dyn.3m198
-rw-r--r--libdyn/dynP.h13
-rw-r--r--libdyn/dyn_append.c4
-rw-r--r--libdyn/dyn_create.c8
-rw-r--r--libdyn/dyn_debug.c4
-rw-r--r--libdyn/dyn_delete.c6
-rw-r--r--libdyn/dyn_insert.c6
-rw-r--r--libdyn/dyn_paranoid.c4
-rw-r--r--libdyn/dyn_put.c14
-rw-r--r--libdyn/dyn_realloc.c2
-rw-r--r--libdyn/dyn_size.c2
-rw-r--r--libdyn/dyntest.c13
-rw-r--r--logs/ChangeLog.19921670
-rw-r--r--logs/changes.ghudson2153
-rw-r--r--logs/tag.7762
-rw-r--r--patchlevel.h1
-rw-r--r--prototype.c20
-rw-r--r--server/BUGS2
-rw-r--r--server/Imakefile76
-rw-r--r--server/Makefile.in67
-rw-r--r--server/access.c314
-rw-r--r--server/access.h42
-rw-r--r--server/acl.h (renamed from h/zephyr/acl.h)16
-rw-r--r--server/acl_files.c (renamed from lib/acl_files.c)283
-rw-r--r--server/bdump.c2139
-rw-r--r--server/class.c562
-rw-r--r--server/client.c302
-rw-r--r--server/common.c108
-rw-r--r--server/dispatch.c1712
-rw-r--r--server/dispatch.c.auth1078
-rw-r--r--server/hostm.c1045
-rw-r--r--server/kopt.c440
-rw-r--r--server/kopt.c.auth631
-rw-r--r--server/kopt.c.old594
-rw-r--r--server/kstuff.c532
-rw-r--r--server/kstuff.c.auth363
-rw-r--r--server/main.c946
-rw-r--r--server/main.c.auth804
-rw-r--r--server/main.c.old803
-rw-r--r--server/realm.c1086
-rw-r--r--server/server.c2444
-rw-r--r--server/subscr.c2025
-rw-r--r--server/subscr.c.old1384
-rw-r--r--server/timer.c300
-rw-r--r--server/timer.h42
-rw-r--r--server/uloc.c1853
-rw-r--r--server/unix.h110
-rw-r--r--server/version.c18
-rw-r--r--server/version.h1
-rw-r--r--server/zalloc.c175
-rw-r--r--server/zalloc.h22
-rw-r--r--server/zserver.h585
-rw-r--r--server/zserver.h.auth425
-rw-r--r--server/zserver.h.old424
-rw-r--r--server/zsrv_conf.h38
-rw-r--r--server/zsrv_conf.h.auth63
-rw-r--r--server/zsrv_err.et4
-rw-r--r--server/zstring.c253
-rw-r--r--server/zstring.h39
-rw-r--r--tools/makeconfig63
-rwxr-xr-xtools/makepaths15
-rwxr-xr-xtools/zlook241
-rwxr-xr-xtools/zsubscriptions61
-rw-r--r--util/autoconf/.rconf1
-rw-r--r--util/autoconf/COPYING339
-rw-r--r--util/autoconf/ChangeLog1196
-rw-r--r--util/autoconf/ChangeLog.11920
-rw-r--r--util/autoconf/INSTALL167
-rw-r--r--util/autoconf/Makefile207
-rw-r--r--util/autoconf/Makefile.in207
-rw-r--r--util/autoconf/NEWS272
-rw-r--r--util/autoconf/README38
-rw-r--r--util/autoconf/TODO102
-rw-r--r--util/autoconf/acconfig.h248
-rw-r--r--util/autoconf/acfunctions58
-rw-r--r--util/autoconf/acgeneral.m42021
-rw-r--r--util/autoconf/acheaders27
-rw-r--r--util/autoconf/acidentifiers22
-rw-r--r--util/autoconf/acmakevars11
-rw-r--r--util/autoconf/acoldnames.m479
-rw-r--r--util/autoconf/acprograms18
-rw-r--r--util/autoconf/acspecific.m41950
-rwxr-xr-xutil/autoconf/autoconf152
-rw-r--r--util/autoconf/autoconf.info152
-rw-r--r--util/autoconf/autoconf.info-11156
-rw-r--r--util/autoconf/autoconf.info-21214
-rw-r--r--util/autoconf/autoconf.info-31198
-rw-r--r--util/autoconf/autoconf.info-41123
-rw-r--r--util/autoconf/autoconf.info-5607
-rw-r--r--util/autoconf/autoconf.m427
-rwxr-xr-xutil/autoconf/autoconf.sh152
-rw-r--r--util/autoconf/autoconf.texi5125
-rwxr-xr-xutil/autoconf/autoheader250
-rw-r--r--util/autoconf/autoheader.m484
-rwxr-xr-xutil/autoconf/autoheader.sh250
-rwxr-xr-xutil/autoconf/autoreconf127
-rw-r--r--util/autoconf/autoreconf.sh149
-rwxr-xr-xutil/autoconf/autoscan393
-rw-r--r--util/autoconf/autoscan.pl394
-rwxr-xr-xutil/autoconf/autoupdate112
-rw-r--r--util/autoconf/autoupdate.sh112
-rw-r--r--util/autoconf/config.cache17
-rw-r--r--util/autoconf/config.log3
-rwxr-xr-xutil/autoconf/config.status113
-rwxr-xr-xutil/autoconf/configure736
-rw-r--r--util/autoconf/configure.in31
-rwxr-xr-xutil/autoconf/ifnames93
-rw-r--r--util/autoconf/ifnames.sh93
-rw-r--r--util/autoconf/install.texi193
-rw-r--r--util/autoconf/make-stds.texi625
-rwxr-xr-xutil/autoconf/mkinstalldirs32
-rw-r--r--util/autoconf/standards.info60
-rw-r--r--util/autoconf/standards.info-11188
-rw-r--r--util/autoconf/standards.info-21691
-rw-r--r--util/autoconf/standards.texi2409
-rw-r--r--util/autoconf/testsuite/Makefile0
-rw-r--r--util/autoconf/texinfo.tex4355
-rw-r--r--util/configure.in7
-rw-r--r--util/et/ChangeLog69
-rw-r--r--util/et/Makefile.in126
-rw-r--r--util/et/com_err.396
-rw-r--r--util/et/com_err.c133
-rw-r--r--util/et/com_err.h44
-rw-r--r--util/et/com_err.texinfo554
-rw-r--r--util/et/compile_et.179
-rw-r--r--util/et/compile_et.c350
-rwxr-xr-xutil/et/compile_et.sh11
-rw-r--r--util/et/compiler.h14
-rw-r--r--util/et/config.log3
-rwxr-xr-xutil/et/config_script25
-rwxr-xr-xutil/et/configure1200
-rw-r--r--util/et/configure.in26
-rw-r--r--util/et/error_message.c67
-rw-r--r--util/et/error_table.h30
-rw-r--r--util/et/error_table.y230
-rw-r--r--util/et/et_c.awk183
-rw-r--r--util/et/et_h.awk150
-rw-r--r--util/et/et_lex.lex.l23
-rw-r--r--util/et/et_name.c41
-rw-r--r--util/et/init_et.c44
-rw-r--r--util/et/internal.h15
-rw-r--r--util/et/mit-sipb-copyright.h19
-rw-r--r--util/et/test1.et69
-rw-r--r--util/et/test2.et9
-rw-r--r--util/et/test_et.c47
-rw-r--r--util/et/texinfo.tex2077
-rw-r--r--util/et/vfprintf.c45
-rwxr-xr-xutil/reconf18
334 files changed, 15649 insertions, 69478 deletions
diff --git a/.ATHENA,l b/.ATHENA,l
deleted file mode 100644
index b635b3b..0000000
--- a/.ATHENA,l
+++ /dev/null
@@ -1 +0,0 @@
-/afs/rel-eng/project/newsrc \ No newline at end of file
diff --git a/.rconf b/.rconf
deleted file mode 100644
index f9331df..0000000
--- a/.rconf
+++ /dev/null
@@ -1,17 +0,0 @@
-link *
-copy *;d
-
-ignore *.o
-ignore *.a
-ignore */core
-
-ignore .#*
-ignore *~
-ignore *.orig
-ignore *.bak
-ignore *.rej
-ignore *RCS;d
-
-ignore attic
-ignore .rconf
-ignore ATHENA
diff --git a/FILES b/FILES
deleted file mode 100644
index 0cf54e9..0000000
--- a/FILES
+++ /dev/null
@@ -1,687 +0,0 @@
-./server/BUGS
-./server/subscr.c.old
-./server/RCS/dispatch.c,v
-./server/RCS/client.c,v
-./server/RCS/hostm.c,v
-./server/RCS/zserver.h,v
-./server/RCS/version.c,v
-./server/RCS/server.c,v
-./server/RCS/timer.c,v
-./server/RCS/timer.h,v
-./server/RCS/zalloc.c,v
-./server/RCS/class.c,v
-./server/RCS/main.c,v
-./server/RCS/kstuff.c,v
-./server/RCS/subscr.c,v
-./server/RCS/bdump.c,v
-./server/RCS/zsrv_err.et,v
-./server/RCS/zsrv_conf.h,v
-./server/RCS/Imakefile,v
-./server/RCS/default.subscriptions,v
-./server/RCS/common.c,v
-./server/RCS/access.c,v
-./server/RCS/uloc.c,v
-./server/RCS/kopt.c,v
-./server/RCS/unix.h,v
-./server/RCS/access.h,v
-./server/RCS/new_vers.sh,v
-./server/RCS/zstring.h,v
-./server/RCS/zstring.c,v
-./server/RCS/zalloc.h,v
-./server/RCS/zephyrd.8,v
-./server/RCS/acl_files.c,v
-./server/RCS/new.h,v
-./server/Imakefile
-./server/class.c
-./server/subscr.c
-./server/kstuff.c
-./server/acl/class-registry.acl
-./server/acl/iui-filsrv.acl
-./server/acl/iui-hm_ctl.acl
-./server/acl/iui-hm_stat.acl
-./server/acl/iui-login.acl
-./server/acl/iui-operations.acl
-./server/acl/iui-ops.acl
-./server/acl/iui-user_locate.acl
-./server/acl/iui-wg_ctl.acl
-./server/acl/iui-zephyr_admin.acl
-./server/acl/iui-zephyr_ctl.acl
-./server/acl/iui-zmatch_all.acl
-./server/acl/iws-filsrv.acl
-./server/acl/iws-hm_ctl.acl
-./server/acl/iws-hm_stat.acl
-./server/acl/iws-login.acl
-./server/acl/iws-operations.acl
-./server/acl/iws-ops.acl
-./server/acl/iws-user_locate.acl
-./server/acl/iws-wg_ctl.acl
-./server/acl/iws-zephyr_admin.acl
-./server/acl/iws-zephyr_ctl.acl
-./server/acl/iws-zmatch_all.acl
-./server/acl/sub-filsrv.acl
-./server/acl/sub-hm_ctl.acl
-./server/acl/sub-hm_stat.acl
-./server/acl/sub-login.acl
-./server/acl/sub-operations.acl
-./server/acl/sub-ops.acl
-./server/acl/sub-user_locate.acl
-./server/acl/sub-wg_ctl.acl
-./server/acl/sub-zephyr_admin.acl
-./server/acl/sub-zephyr_ctl.acl
-./server/acl/xmt-filsrv.acl
-./server/acl/sub-zmatch_all.acl
-./server/acl/xmt-hm_ctl.acl
-./server/acl/xmt-hm_stat.acl
-./server/acl/xmt-login.acl
-./server/acl/xmt-operations.acl
-./server/acl/xmt-ops.acl
-./server/acl/xmt-user_locate.acl
-./server/acl/xmt-wg_ctl.acl
-./server/acl/xmt-zephyr_admin.acl
-./server/acl/xmt-zephyr_ctl.acl
-./server/acl/xmt-zmatch_all.acl
-./server/uloc.c
-./server/zserver.h.old
-./server/common.c
-./server/default.subscriptions
-./server/access.h
-./server/client.c
-./server/hostm.c
-./server/main.c.old
-./server/dispatch.c
-./server/timer.c
-./server/timer.h
-./server/new_vers.sh
-./server/zstring.h
-./server/server.c
-./server/zstring.c
-./server/unix.h
-./server/access.c
-./server/bdump.c
-./server/kopt.c.old
-./server/zalloc.h
-./server/version.c
-./server/zalloc.c
-./server/zserver.h
-./server/main.c
-./server/zsrv_err.et
-./server/version.h
-./server/kopt.c
-./server/dispatch.c.auth
-./server/zsrv_conf.h
-./server/main.c.auth
-./server/zephyrd.8
-./server/kopt.c.auth
-./server/kstuff.c.auth
-./server/zsrv_conf.h.auth
-./server/zserver.h.auth
-./config/site.def
-./config/RCS/zephyr.rules,v
-./config/RCS/site.def,v
-./config/zephyr.rules
-./Makefile
-./tools/RCS/makeconfig,v
-./tools/RCS/makepaths,v
-./tools/makeconfig
-./tools/zlook
-./tools/zsubscriptions
-./tools/makepaths
-./lib/acl_files.c.old
-./lib/zephyr_err.et
-./lib/strcasecmp.c
-./lib/lib_headers
-./lib/ZRecvNot.c
-./lib/ZPeekIfNot.c
-./lib/ZGetSender.c
-./lib/smwgc.c
-./lib/ZFmtRawLst.c
-./lib/ZOpenPort.c
-./lib/Zinternal.c
-./lib/ZMakeAscii.c
-./lib/ZCkIfNot.c
-./lib/ZPeekNot.c
-./lib/ZCmpUIDP.c
-./lib/ZFlsLocs.c
-./lib/ZPending.c
-./lib/ZSetFD.c
-./lib/RCS/ZClosePort.c,v
-./lib/RCS/ZOpenPort.c,v
-./lib/RCS/ZLocations.c,v
-./lib/RCS/ZFmtRawLst.c,v
-./lib/RCS/ZFmtRaw.c,v
-./lib/RCS/ZPeekPkt.c,v
-./lib/RCS/ZPeekIfNot.c,v
-./lib/RCS/ZPeekNot.c,v
-./lib/RCS/ZRecvNot.c,v
-./lib/RCS/ZPending.c,v
-./lib/RCS/ZSendList.c,v
-./lib/RCS/ZRecvPkt.c,v
-./lib/RCS/ZRetSubs.c,v
-./lib/RCS/ZSendNot.c,v
-./lib/RCS/ZSendPkt.c,v
-./lib/RCS/ZSendRLst.c,v
-./lib/RCS/ZSendRaw.c,v
-./lib/RCS/ZSetFD.c,v
-./lib/RCS/zephyr_err.et,v
-./lib/RCS/ZCmpUIDP.c,v
-./lib/RCS/ZCmpUID.c,v
-./lib/RCS/ZIfNotice.c,v
-./lib/RCS/ZSetDest.c,v
-./lib/RCS/ZSetSrv.c,v
-./lib/RCS/ZLocateU.c,v
-./lib/RCS/ZMakeAscii.c,v
-./lib/RCS/ZFmtNotice.c,v
-./lib/RCS/ZFmtSmRLst.c,v
-./lib/RCS/ZFlsLocs.c,v
-./lib/RCS/ZFlsSubs.c,v
-./lib/RCS/ZFmtAuth.c,v
-./lib/RCS/ZWait4Not.c,v
-./lib/RCS/Zinternal.c,v
-./lib/RCS/ZGetSubs.c,v
-./lib/RCS/ZInit.c,v
-./lib/RCS/ZFmtSmRaw.c,v
-./lib/RCS/ZFreeNot.c,v
-./lib/RCS/ZMkAuth.c,v
-./lib/RCS/ZSubs.c,v
-./lib/RCS/acl_files.c,v
-./lib/RCS/ZNewLocU.c,v
-./lib/RCS/ZCkIfNot.c,v
-./lib/RCS/ZFmtList.c,v
-./lib/RCS/inet_ntoa.c,v
-./lib/RCS/ZParseNot.c,v
-./lib/RCS/ZGetLocs.c,v
-./lib/RCS/smwgc.c,v
-./lib/RCS/ZReadAscii.c,v
-./lib/RCS/ZGetSender.c,v
-./lib/RCS/ZVariables.c,v
-./lib/RCS/ZCkAuth.c,v
-./lib/RCS/krb_err.et,v
-./lib/RCS/ZAsyncLocate.c,v
-./lib/RCS/ZGetWGPort.c,v
-./lib/RCS/Imakefile,v
-./lib/RCS/strcasecmp.c,v
-./lib/RCS/zephyr.1,v
-./lib/ZMkAuth.c
-./lib/ZSendList.c
-./lib/ZGetWGPort.c
-./lib/ZSendRaw.c
-./lib/ZFlsSubs.c
-./lib/ZCkAuth.c
-./lib/ZRecvPkt.c
-./lib/ZRetSubs.c
-./lib/ZSubs.c
-./lib/inet_ntoa.c
-./lib/ZSendPkt.c
-./lib/ZFmtList.c
-./lib/ZFmtNotice.c
-./lib/ZFmtRaw.c
-./lib/ZSendNot.c
-./lib/ZSendRLst.c
-./lib/ZFmtSmRLst.c
-./lib/ZSetDest.c
-./lib/ZSetSrv.c
-./lib/ZParseNot.c
-./lib/ZPeekPkt.c
-./lib/ZFmtSmRaw.c
-./lib/ZFreeNot.c
-./lib/ZGetLocs.c
-./lib/ZGetSubs.c
-./lib/ZInit.c
-./lib/ZVariables.c
-./lib/ZWait4Not.c
-./lib/acl_files.c
-./lib/decl.awk
-./lib/decl
-./lib/ZLocateU.c
-./lib/ZNewLocU.c
-./lib/ZFmtAuth.c
-./lib/ZLocations.c
-./lib/ZCmpUID.c
-./lib/ZClosePort.c
-./lib/ZIfNotice.c
-./lib/ZReadAscii.c
-./lib/krb_err.et
-./lib/Imakefile
-./lib/zephyr.1
-./lib/ZAsyncLocate.c
-./zhm/RCS/zhm.h,v
-./zhm/RCS/queue.c,v
-./zhm/RCS/zhm.c,v
-./zhm/RCS/zhm_client.c,v
-./zhm/RCS/zhm_server.c,v
-./zhm/RCS/Imakefile,v
-./zhm/RCS/zhm.8,v
-./zhm/zhm.c
-./zhm/Imakefile
-./zhm/zhm_server.c
-./zhm/zhm_client.c
-./zhm/TODO
-./zhm/zhm.8
-./zhm/queue.c
-./zhm/zhm.h
-./prototype.c
-./libdes/ChangeLog
-./libdes/Imakefile
-./libdes/debug_decl.c
-./libdes/desglue.c
-./libdes/destest.c
-./libdes/enc.c
-./libdes/Makefile
-./libdes/des.h
-./libdes/f_README
-./libdes/f_cbc.c
-./libdes/f_cksum.c
-./libdes/f_ecb.c
-./libdes/f_parity.c
-./libdes/f_pcbc.c
-./libdes/f_sched.c
-./libdes/f_tables.c
-./libdes/f_tables.h
-./libdes/key_sched.c
-./libdes/new_rnd_key.c
-./libdes/quad_cksum.c
-./libdes/random_key.c
-./libdes/read_password.c
-./libdes/string_to_key.c
-./libdes/util.c
-./libdes/verify.c
-./libdes/weak_key.c
-./libdes/doc/libdes.doc
-./libdes/doc/RCS/libdes.doc,v
-./libdes/RCS/ChangeLog,v
-./libdes/RCS/Imakefile,v
-./libdes/RCS/Makefile,v
-./libdes/RCS/debug_decl.c,v
-./libdes/RCS/des.h,v
-./libdes/RCS/desglue.c,v
-./libdes/RCS/destest.c,v
-./libdes/RCS/enc.c,v
-./libdes/RCS/f_README,v
-./libdes/RCS/f_cbc.c,v
-./libdes/RCS/f_cksum.c,v
-./libdes/RCS/f_ecb.c,v
-./libdes/RCS/f_parity.c,v
-./libdes/RCS/f_pcbc.c,v
-./libdes/RCS/f_sched.c,v
-./libdes/RCS/f_tables.c,v
-./libdes/RCS/f_tables.h,v
-./libdes/RCS/key_sched.c,v
-./libdes/RCS/new_rnd_key.c,v
-./libdes/RCS/quad_cksum.c,v
-./libdes/RCS/random_key.c,v
-./libdes/RCS/util.c,v
-./libdes/RCS/verify.c,v
-./libdes/RCS/read_password.c,v
-./libdes/RCS/string_to_key.c,v
-./libdes/RCS/weak_key.c,v
-./h/zephyr/RCS/zephyr.h,v
-./h/zephyr/RCS/acl.h,v
-./h/zephyr/RCS/zephyr_internal.h,v
-./h/zephyr/RCS/mit-copyright.h,v
-./h/zephyr/RCS/zephyr_conf.h,v
-./h/zephyr/RCS/zsyslog.h,v
-./h/zephyr/RCS/Imakefile,v
-./h/zephyr/zephyr.h
-./h/zephyr/zephyr_internal.h
-./h/zephyr/mit-copyright.h
-./h/zephyr/Imakefile
-./h/zephyr/zsyslog.h
-./h/zephyr/zephyr_conf.h
-./h/zephyr/acl.h
-./h/RCS/Imakefile,v
-./h/Imakefile
-./RCS/Imakefile,v
-./RCS/patchlevel.h,v
-./RCS/Makefile,v
-./clients/RCS/Imakefile,v
-./clients/syslogd/syslog.c.old
-./clients/syslogd/syslog.conf
-./clients/syslogd/RCS/syslogd.c,v
-./clients/syslogd/RCS/Imakefile,v
-./clients/syslogd/RCS/syslog.c,v
-./clients/syslogd/RCS/logger.c,v
-./clients/syslogd/RCS/syslogd.8,v
-./clients/syslogd/Imakefile
-./clients/syslogd/syslog.3
-./clients/syslogd/syslog.c
-./clients/syslogd/syslog.h
-./clients/syslogd/syslogd.8
-./clients/syslogd/syslog_patch.43tahoe
-./clients/syslogd/syslogd.c
-./clients/syslogd/logger.c
-./clients/xzwrite/GetString.c
-./clients/xzwrite/GetString.h
-./clients/xzwrite/destlist.c.old
-./clients/xzwrite/Popup.c
-./clients/xzwrite/associate.c
-./clients/xzwrite/associate.h
-./clients/xzwrite/bfgets.c
-./clients/xzwrite/destlist.c
-./clients/xzwrite/nmalloc.c
-./clients/xzwrite/edit_window.c
-./clients/xzwrite/gethomedir.c
-./clients/xzwrite/yank.c
-./clients/xzwrite/menu_window.c
-./clients/xzwrite/zephyr.c.old
-./clients/xzwrite/nmalloc.h
-./clients/xzwrite/RCS/zephyr.c,v
-./clients/xzwrite/RCS/GetString.c,v
-./clients/xzwrite/RCS/GetString.h,v
-./clients/xzwrite/RCS/Imakefile,v
-./clients/xzwrite/RCS/Popup.c,v
-./clients/xzwrite/RCS/XZwrite,v
-./clients/xzwrite/RCS/associate.c,v
-./clients/xzwrite/RCS/associate.h,v
-./clients/xzwrite/RCS/bfgets.c,v
-./clients/xzwrite/RCS/dest_window.c,v
-./clients/xzwrite/RCS/destlist.c,v
-./clients/xzwrite/RCS/edit_window.c,v
-./clients/xzwrite/RCS/gethomedir.c,v
-./clients/xzwrite/RCS/interface.c,v
-./clients/xzwrite/RCS/logins.c,v
-./clients/xzwrite/RCS/menu_window.c,v
-./clients/xzwrite/RCS/nmalloc.c,v
-./clients/xzwrite/RCS/nmalloc.h,v
-./clients/xzwrite/RCS/resource.c,v
-./clients/xzwrite/RCS/util.c,v
-./clients/xzwrite/RCS/xzwrite.1,v
-./clients/xzwrite/RCS/xzwrite-proto.h,v
-./clients/xzwrite/RCS/xzwrite.c,v
-./clients/xzwrite/RCS/xzwrite.h,v
-./clients/xzwrite/RCS/yank.c,v
-./clients/xzwrite/RCS/xzwrite.bitmap,v
-./clients/xzwrite/resource.c
-./clients/xzwrite/util.c
-./clients/xzwrite/xzwrite-proto.h
-./clients/xzwrite/xzwrite.h
-./clients/xzwrite/Makefile.old
-./clients/xzwrite/xzwrite.1
-./clients/xzwrite/XZwrite
-./clients/xzwrite/xzwrite.bitmap
-./clients/xzwrite/interface.c
-./clients/xzwrite/xzwrite.c
-./clients/xzwrite/Imakefile
-./clients/xzwrite/dest_window.c
-./clients/xzwrite/logins.c
-./clients/xzwrite/zephyr.c
-./clients/zaway/RCS/zaway.c,v
-./clients/zaway/RCS/Imakefile,v
-./clients/zaway/RCS/zaway.1,v
-./clients/zaway/zaway.c
-./clients/zaway/Imakefile
-./clients/zaway/zaway.1
-./clients/zctl/zctl_cmds.ct
-./clients/zctl/RCS/zctl.c,v
-./clients/zctl/RCS/zctl_cmds.ct,v
-./clients/zctl/RCS/Imakefile,v
-./clients/zctl/RCS/zctl.1,v
-./clients/zctl/Imakefile
-./clients/zctl/zctl.1
-./clients/zctl/zctl.c
-./clients/zleave/RCS/zleave.c,v
-./clients/zleave/RCS/Imakefile,v
-./clients/zleave/RCS/zleave.1,v
-./clients/zleave/Imakefile
-./clients/zleave/zleave.1
-./clients/zleave/zleave.c
-./clients/zlocate/RCS/zlocate.c,v
-./clients/zlocate/RCS/Imakefile,v
-./clients/zlocate/RCS/zlocate.1,v
-./clients/zlocate/Imakefile
-./clients/zlocate/zlocate.1
-./clients/zlocate/zlocate.c
-./clients/zmailnotify/RCS/zmailwatch.c,v
-./clients/zmailnotify/RCS/zmwnotify.c,v
-./clients/zmailnotify/RCS/zmailnotify.c,v
-./clients/zmailnotify/RCS/Imakefile,v
-./clients/zmailnotify/RCS/zmailnotify.1,v
-./clients/zmailnotify/zmailnotify.c
-./clients/zmailnotify/Imakefile
-./clients/zmailnotify/zmailnotify.1
-./clients/znol/RCS/znol.c,v
-./clients/znol/RCS/Imakefile,v
-./clients/znol/RCS/znol.1,v
-./clients/znol/Imakefile
-./clients/znol/znol.1
-./clients/znol/znol.c
-./clients/zpopnotify/RCS/zpopnotify.c,v
-./clients/zpopnotify/RCS/Imakefile,v
-./clients/zpopnotify/RCS/zpopnotify.8,v
-./clients/zpopnotify/Imakefile
-./clients/zpopnotify/zpopnotify.8
-./clients/zpopnotify/zpopnotify.c
-./clients/zshutdown_notify/RCS/zshutdown_notify.c,v
-./clients/zshutdown_notify/RCS/Imakefile,v
-./clients/zshutdown_notify/RCS/zshutdown_notify.8,v
-./clients/zshutdown_notify/Imakefile
-./clients/zshutdown_notify/zshutdown_notify.c
-./clients/zshutdown_notify/zshutdown_notify.8
-./clients/zstat/zserver.h
-./clients/zstat/RCS/zstat.c,v
-./clients/zstat/RCS/Imakefile,v
-./clients/zstat/RCS/zserver.h,v
-./clients/zstat/RCS/zstat.8,v
-./clients/zstat/Imakefile
-./clients/zstat/zstat.c
-./clients/zstat/zstat.8
-./clients/zwrite/RCS/zwrite.c,v
-./clients/zwrite/RCS/Imakefile,v
-./clients/zwrite/RCS/zwrite.1,v
-./clients/zwrite/zwrite.c
-./clients/zwrite/Imakefile
-./clients/zwrite/zwrite.1
-./clients/Imakefile
-./zwgc/zwgc_resources
-./zwgc/xcut.c
-./zwgc/main.c
-./zwgc/xmark.c
-./zwgc/notice.c
-./zwgc/parser.h
-./zwgc/lexer.c
-./zwgc/X_driver.h
-./zwgc/Dictionary/Imakefile
-./zwgc/Dictionary/string_dictionary_aux.c
-./zwgc/Dictionary/dictionary.c
-./zwgc/Dictionary/RCS/Imakefile,v
-./zwgc/Dictionary/RCS/dictionary.c,v
-./zwgc/Dictionary/RCS/generate_dictionary_instance,v
-./zwgc/Dictionary/RCS/dictionary.h,v
-./zwgc/Dictionary/RCS/string_dictionary_aux.c,v
-./zwgc/Dictionary/RCS/string_dictionary_aux.h,v
-./zwgc/Dictionary/dictionary.h
-./zwgc/Dictionary/string_dictionary_aux.h
-./zwgc/node.c
-./zwgc/X_fonts.c
-./zwgc/mux.c
-./zwgc/xshow.h
-./zwgc/ulong.h
-./zwgc/xrevstack.c
-./zwgc/node.h
-./zwgc/buffer.c
-./zwgc/parser.y
-./zwgc/substitute.c
-./zwgc/X_fonts.h
-./zwgc/subscriptions.c
-./zwgc/zwgc.h
-./zwgc/X_gram.c
-./zwgc/exec.c
-./zwgc/exec.h
-./zwgc/variables.h
-./zwgc/browser.c
-./zwgc/browser.h
-./zwgc/buffer.h
-./zwgc/display.c
-./zwgc/error.h
-./zwgc/stack.h
-./zwgc/error.c
-./zwgc/zwgc.1
-./zwgc/formatter.c
-./zwgc/variables.c
-./zwgc/xselect.c
-./zwgc/X_gram.h
-./zwgc/eval.h
-./zwgc/xerror.c
-./zwgc/character_class.h
-./zwgc/subscriptions.h
-./zwgc/file.c
-./zwgc/file.h
-./zwgc/formatter.h
-./zwgc/port.c
-./zwgc/lexer.h
-./zwgc/Imakefile
-./zwgc/X_driver.c
-./zwgc/main.h
-./zwgc/mux.h
-./zwgc/notice.h
-./zwgc/pointer.h
-./zwgc/xselect.h
-./zwgc/zephyr.c
-./zwgc/regexp.h
-./zwgc/port.h
-./zwgc/standard_ports.c
-./zwgc/substitute.h
-./zwgc/RCS/Imakefile,v
-./zwgc/RCS/zephyr.vars,v
-./zwgc/RCS/X_driver.h,v
-./zwgc/RCS/tty_filter.c,v
-./zwgc/RCS/X_driver.c,v
-./zwgc/RCS/X_fonts.c,v
-./zwgc/RCS/X_fonts.h,v
-./zwgc/RCS/X_gram.c,v
-./zwgc/RCS/X_gram.h,v
-./zwgc/RCS/browser.c,v
-./zwgc/RCS/browser.h,v
-./zwgc/RCS/buffer.c,v
-./zwgc/RCS/buffer.h,v
-./zwgc/RCS/display.c,v
-./zwgc/RCS/error.c,v
-./zwgc/RCS/error.h,v
-./zwgc/RCS/character_class.c,v
-./zwgc/RCS/eval.c,v
-./zwgc/RCS/character_class.h,v
-./zwgc/RCS/eval.h,v
-./zwgc/RCS/exec.c,v
-./zwgc/RCS/exec.h,v
-./zwgc/RCS/file.c,v
-./zwgc/RCS/file.h,v
-./zwgc/RCS/formatter.c,v
-./zwgc/RCS/formatter.h,v
-./zwgc/RCS/lexer.c,v
-./zwgc/RCS/lexer.h,v
-./zwgc/RCS/main.c,v
-./zwgc/RCS/generate_stack_instance,v
-./zwgc/RCS/main.h,v
-./zwgc/RCS/mux.c,v
-./zwgc/RCS/mux.h,v
-./zwgc/RCS/node.c,v
-./zwgc/RCS/node.h,v
-./zwgc/RCS/notice.c,v
-./zwgc/RCS/notice.h,v
-./zwgc/RCS/parser.h,v
-./zwgc/RCS/parser.y,v
-./zwgc/RCS/pointer.h,v
-./zwgc/RCS/port.c,v
-./zwgc/RCS/port.h,v
-./zwgc/RCS/regexp.c,v
-./zwgc/RCS/regexp.h,v
-./zwgc/RCS/stack.h,v
-./zwgc/RCS/substitute.c,v
-./zwgc/RCS/substitute.h,v
-./zwgc/RCS/xcut.c,v
-./zwgc/RCS/standard_ports.c,v
-./zwgc/RCS/subscriptions.c,v
-./zwgc/RCS/subscriptions.h,v
-./zwgc/RCS/variables.c,v
-./zwgc/RCS/variables.h,v
-./zwgc/RCS/text_operations.c,v
-./zwgc/RCS/text_operations.h,v
-./zwgc/RCS/xrevstack.c,v
-./zwgc/RCS/xmark.c,v
-./zwgc/RCS/xmark.h,v
-./zwgc/RCS/xrevstack.h,v
-./zwgc/RCS/xselect.c,v
-./zwgc/RCS/xselect.h,v
-./zwgc/RCS/xshow.c,v
-./zwgc/RCS/xshow.h,v
-./zwgc/RCS/zephyr.c,v
-./zwgc/RCS/zephyr.h,v
-./zwgc/RCS/zwgc.h,v
-./zwgc/RCS/xerror.c,v
-./zwgc/RCS/xerror.h,v
-./zwgc/RCS/zwgc.el,v
-./zwgc/RCS/ulong.h,v
-./zwgc/RCS/zwgc.desc,v
-./zwgc/RCS/zwgc_resources,v
-./zwgc/RCS/zwgc.1,v
-./zwgc/RCS/generate_instance,v
-./zwgc/text_operations.c
-./zwgc/zephyr.h
-./zwgc/text_operations.h
-./zwgc/tty_filter.c
-./zwgc/xerror.h
-./zwgc/xmark.h
-./zwgc/xrevstack.h
-./zwgc/xshow.c
-./zwgc/zwgc.el
-./zwgc/zephyr.vars
-./zwgc/String/new_string.c
-./zwgc/String/new_string.h
-./zwgc/String/RCS/Imakefile,v
-./zwgc/String/RCS/new_string.c,v
-./zwgc/String/RCS/new_string.h,v
-./zwgc/String/Imakefile
-./zwgc/String/new_string.c.old
-./zwgc/eval.c
-./zwgc/Memory/new_memory.c
-./zwgc/Memory/new_memory.h
-./zwgc/Memory/RCS/Imakefile,v
-./zwgc/Memory/RCS/new_memory.h,v
-./zwgc/Memory/RCS/new_memory.c,v
-./zwgc/Memory/Imakefile
-./zwgc/generate_instance
-./zwgc/zwgc.desc
-./zwgc/character_class.c
-./zwgc/regexp.c
-./Makefile.bak
-./libdyn/README
-./libdyn/dyn.3m
-./libdyn/dyn.h
-./libdyn/dyn_append.c
-./libdyn/dyn_create.c
-./libdyn/dyn_debug.c
-./libdyn/dyn_header.c
-./libdyn/dyn_delete.c
-./libdyn/dyn_paranoid.c
-./libdyn/dyn_put.c
-./libdyn/dyn_realloc.c
-./libdyn/dyn_size.c
-./libdyn/dyn.3
-./libdyn/RCS/Imakefile,v
-./libdyn/RCS/README,v
-./libdyn/RCS/dyn.3,v
-./libdyn/RCS/dyn.h,v
-./libdyn/RCS/dynP.h,v
-./libdyn/RCS/dyn_append.c,v
-./libdyn/RCS/dyn_create.c,v
-./libdyn/RCS/dyn_debug.c,v
-./libdyn/RCS/dyn_delete.c,v
-./libdyn/RCS/dyn_header.c,v
-./libdyn/RCS/dyn_insert.c,v
-./libdyn/RCS/dyn_paranoid.c,v
-./libdyn/RCS/dyn_put.c,v
-./libdyn/RCS/dyn_realloc.c,v
-./libdyn/RCS/dyn_size.c,v
-./libdyn/RCS/dyntest.c,v
-./libdyn/Makefile.old
-./libdyn/Imakefile
-./libdyn/dyn_insert.c
-./libdyn/dynP.h
-./libdyn/dyntest.c
-./Imakefile
-./patchlevel.h
-./logs/tag.77
-./logs/ChangeLog.1992
-./logs/changes.ghudson
-./stdin
-./.rconf
-./FILES
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..88f9dd7
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,80 @@
+This file explains how to build and install Zephyr on a machine. To
+learn how to use Zephyr once you've installed it, read the file USING.
+To learn how to set up Zephyr service at a site, read the file
+OPERATING.
+
+To build and install Zephyr for the Athena environment, run:
+
+ setenv CC "cc" # Or whatever compiler
+ ./configure --enable-athena
+ make
+ make install
+
+(If you're not sure whether your site qualifies as being in the
+"Athena environment," the exact criteria are that you have installed
+versions of Hesiod, Kerberos 4, libss, and libcom_err in /usr/athena,
+and that you want Zephyr to be installed in the Athena directory
+layout.)
+
+To build and install outside the Athena environment, you can run:
+
+ ./configure
+ make
+ make install
+
+This will build Zephyr without Hesiod or Kerberos support, and install
+in /usr/local. To install in a location other than /usr/local, add
+"--prefix=INSTPREFIX" to the configure line, where INSTPREFIX is the
+directory you want to install Zephyr in.
+
+If your site has a Hesiod service with a valid zephyr.sloc entry (or
+you can add one), you can enable Hesiod support by adding the option
+"--with-hesiod=HESPREFIX" to the configure line, where
+HESPREFIX/include and HESPREFIX/lib are the directories you have the
+Hesiod libraries installed in.
+
+If your site has a Kerberos 4 service, you can enable Kerberos support
+by adding the option "--with-krb4=KRBPREFIX" to the configure line,
+where KRBPREFIX/include and KRBPREFIX/lib are the direcetories you
+have the Kerberos libraries installed in.
+
+If you have a make which supports VPATH in a manner compatible with
+GNU make, you can build in a separate directory. Simply invoke the
+configure script from within the build directory and configure will
+locate the source directory for you. (If that doesn't work for some
+reason, you can also specify "--srcdir=SOURCEDIR" on the configuration
+line.)
+
+If configure can't properly find your X11 include or library
+directories, add "--x-includes=INCDIR" and "--x-libraries=LIBDIR" to
+the configure line. To build without X11 support, add "--without-x"
+to the configure line.
+
+If you have Hesiod and/or Kerberos installed such that you can't
+specify a single prefix for both include files and libraries, set the
+environment variables CPPFLAGS and LDFLAGS to include the relevant
+directories, and just configure with "--with-krb4" and
+"--with-hesiod". For instance (for a csh-like shell):
+
+ setenv CPPFLAGS "-I/opt/athena/include"
+ setenv LDFLAGS "-I/opt/athena/arch/sparc/lib"
+ ./configure --with-hesiod --with-krb4
+ make
+ make install
+
+Although it's not necessary for Zephyr to function correctly, you
+should add the following services to /etc/services if possible:
+
+zephyr-clt 2103/udp # Zephyr serv-hm connection
+zephyr-hm 2104/udp # Zephyr hostmanager
+zephyr-hm-srv 2105/udp # Zephyr hm-serv connection
+
+To learn how to use Zephyr, read the file USING and the man pages for
+the various Zephyr programs. To learn how to operate a Zephyr
+service, read the file OPERATING.
+
+We have tried to make Zephyr as portable as is reasonably possible,
+but have not taken into account every possible kind of system. If you
+have any problems building or installing Zephyr according to these
+instructions, please send mail to zephyr-bugs@mit.edu.
+
diff --git a/Imakefile b/Imakefile
deleted file mode 100644
index 463b4d8..0000000
--- a/Imakefile
+++ /dev/null
@@ -1,29 +0,0 @@
-/**/# Copyright 1988,1993 Massachusetts Institute of Technology
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h"
-/**/#
-/**/# $Id$
-
-#define Project
-#ifndef ProjectRules
-#define ProjectRules "config/zephyr.rules"
-#include ProjectRules
-#endif
-
-UTILS = $(D_IMAKE) $(D_ET) $(D_SS)
-#define ISUBDIRS $(UTILS) h libdes lib libdyn clients zhm zwgc
-
-create_dir($(ZLIBDIR))
-
-World::
- make clean
- make Makefile
- make Makefiles
-#ifndef NO_MAKEDEPEND
- make depend
-#endif
- make all
-
-#ifdef NO_IMAKE
-$(IMAKE): $(D_IMAKE)
-#endif
diff --git a/Makefile.athena b/Makefile.athena
deleted file mode 100644
index 0665139..0000000
--- a/Makefile.athena
+++ /dev/null
@@ -1,18 +0,0 @@
-# $Id$
-
-SHELL=/bin/sh
-
-prepare:
- imake -DTOPDIR=`pwd` -I./config
- ${MAKE} Makefiles
-
-clean:
- ${MAKE} clean
-
-all:
- ${MAKE} all
-
-check:
-
-install:
- ${MAKE} install install.man DESTDIR="$$SRVD"
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..96c14d5
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,49 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+bindir=${exec_prefix}/bin
+libdir=${exec_prefix}/lib
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+ENSUREDIR=${srcdir}/ensure-dir.sh
+INSTALL=@INSTALL@
+
+SUBDIRS=lib clients server zhm
+
+all:
+ for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
+
+check clean:
+ for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
+
+install:
+ ${ENSUREDIR} ${DESTDIR}${prefix} 755
+ ${ENSUREDIR} ${DESTDIR}${exec_prefix} 755
+ ${ENSUREDIR} ${DESTDIR}${bindir} 755
+ ${ENSUREDIR} ${DESTDIR}${libdir} 755
+ ${ENSUREDIR} ${DESTDIR}${datadir} 755
+ ${ENSUREDIR} ${DESTDIR}${confdir} 755
+ ${ENSUREDIR} ${DESTDIR}${confdir}/acl 755
+ ${ENSUREDIR} ${DESTDIR}${sbindir} 755
+ ${ENSUREDIR} ${DESTDIR}${includedir} 755
+ ${ENSUREDIR} ${DESTDIR}${includedir}/zephyr 755
+ ${ENSUREDIR} ${DESTDIR}${mandir} 755
+ ${ENSUREDIR} ${DESTDIR}${mandir}/man1 755
+ ${ENSUREDIR} ${DESTDIR}${mandir}/man3 755
+ ${ENSUREDIR} ${DESTDIR}${mandir}/man8 755
+ ${INSTALL} -m 644 ${srcdir}/h/zephyr/mit-copyright.h \
+ ${DESTDIR}${includedir}/zephyr
+ ${INSTALL} -m 644 h/zephyr/zephyr.h ${DESTDIR}${includedir}/zephyr
+ ${INSTALL} -m 644 h/zephyr/zephyr_err.h ${DESTDIR}${includedir}/zephyr
+ for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
+
+.PHONY: all check install clean
+
diff --git a/NOTES b/NOTES
new file mode 100644
index 0000000..5e113ad
--- /dev/null
+++ b/NOTES
@@ -0,0 +1,46 @@
+Please observe the following notes when making changes to the source
+tree.
+
+We use the included ss and et libraries only when configured without
+--enable-athena. configure uses the BUILDTOP make variable to locate
+the top of the build tree in order to refer to automatically generated
+files in lib/ss and lib/et.
+
+lib/dyn and lib/ss are internal libraries, i.e. they are only used by
+programs (xzwrite uses lib/dyn and zctl uses lib/ss), not by the
+Zephyr API. lib/et and lib/zephyr are external libraries; they are
+necessary for linking programs which use Zephyr, so their libraries
+are installed in the library directory. Note that the library built
+in lib/et is named libcom_err.a, not libet.a, and that it is only
+installed if --enable-athena is not used.
+
+The directory h contains header files used internally in the zephyr
+source tree. The directory h/zephyr contains header files containing
+declarations for the Zephyr API. h/zephyr/zephyr_err.h is generated
+from lib/zephyr/zephyr_err.et when lib/zephyr is built.
+h/zephyr/zephyr.h is generated by configure, as is h/config.h. Those
+header files live in the build tree, as do h/com_err.h and h/ss/ss.h
+when --enable-athena is not given as an option to configure. All
+other header files in h live in the source tree.
+
+h/config.h is generated by configure and contains the results of
+configure tests as well as definitions for the installation
+configuration directory and data directory. h/sysdep.h uses
+h/config.h to include various header files or make various external
+declarations which many programs might be interested in. h/internal.h
+contains declarations internal to the "Zephyr system proper," which
+includes the Zephyr library, the server, the hostmanager, and (for
+now) zstat.
+
+Two header files, h/zephyr/zephyr.h and lib/et/com_err.h (when
+--enable-athena is not used) are public header files; that is, they
+are installed with the Zephyr system. As such, these header files may
+need to work with compilers other than the compiler used to build the
+Zephyr system itself. Thus, we use __STDC__ (both in h/sysdep.h and
+in the public header files) to guess whether the compiler will handle
+const, prototypes, and stdarg. This is unfortunately not as reliable
+as using autoconf features like AC_C_CONST.
+
+The Zephyr system version number is kept in server/version.c, and
+should be updated when releases are made.
+
diff --git a/OPERATING b/OPERATING
new file mode 100644
index 0000000..7f23a85
--- /dev/null
+++ b/OPERATING
@@ -0,0 +1,54 @@
+This file explains how to operate a Zephyr service once you have
+installed Zephyr on all the relevant machines and file servers in your
+environment. To learn how to configure, build, and install Zephyr,
+read the file INSTALL.
+
+To set up Zephyr service at a site, follow these steps:
+
+1. Choose the machines you wish to have act as Zephyr servers at your
+site. Expect the server to be CPU-efficient but to consume a bit more
+memory than you might expect (at MIT, with around a thousand
+simultaneous users, the Zephyr server's data size is 40MB). If you
+have a lot of users, the server should have enough memory so that the
+process doesn't swap.
+
+2a. If you configured Zephyr with Hesiod support, make sure your
+Hesiod realm has a "zephyr.sloc" entry containing a record for each
+server. (Each entry should contain the name of the server, nothing
+else.) The Zephyr servers will use the zephyr.sloc entry to find the
+other servers. Host managers will use the zephyr.sloc entry to find
+the Zephyr servers by default; however, you can control the set of
+servers for each host manager by giving each host a
+"<hostname>.cluster" entry containing a record "zcluster <serverset>".
+If such a record is found, the host manager will resolve
+"<serverset>.sloc" instead of "zephyr.sloc".
+
+2b. If you configured Zephyr without Hesiod support, and you have
+multiple Zephyr servers, each server should have a file "server.list"
+in the configuration directory (which is /etc/athena/zephyr if you
+configured with --enable-athena, or /usr/local/etc/zephyr if you
+installed Zephyr in /usr/local and didn't use --enable-athena). This
+file should contain a list of the servers, one per line.
+
+3. If you configured Zephyr with Kerberos 4 support, make a service
+key "zephyr.zephyr@<your realm>" and install a srvtab for that service
+as "srvtab" in the configuration directory of each of your zephyr
+servers.
+
+4. Start zephyrd from the system binary directory (/usr/athena/etc if
+you configured with --enable-athena, /usr/local/sbin if you installed
+in /usr/local and didn't use --enable-athena). zephyrd logs as
+service "local6"; watch the syslogs for error messages. Arrange for
+zephyrd to be run at boot time on your server machines.
+
+5. Each client machine should run zhm (the Zephyr Host Manager) from
+the local system binary directory (/etc/athena for --enable-athena,
+/usr/local/sbin if you installed in /usr/local and didn't use
+--enable-athena). If you built Zephyr without Hesiod support, you
+should start zhm as "zhm server1 server2 server3 ..." so that zhm
+knows where the Zephyr servers are.
+
+You can send a SIGFPE signal to the server process to make it dump its
+subscription database to /var/tmp/zephyr.db. (If /var/tmp didn't
+exist when Zephyr was built, the subscription database will be dumped
+in /usr/tmp or /tmp instead.)
diff --git a/README b/README
new file mode 100644
index 0000000..c1ac647
--- /dev/null
+++ b/README
@@ -0,0 +1,37 @@
+This is the Project Athena Zephyr notification system version 2.0.
+Zephyr allows users to send messages to other users or to groups of
+users. Users can view incoming Zephyr messages as windowgrams
+(transient X windows) or as text on a terminal. Zephyr can optionally
+make use of the Kerberos version 4 security library or the Hesiod
+service name resolution library.
+
+Please note that Zephyr version 2.0 is not compatible with previous
+versions of Zephyr, in two important ways. First, the inter-server
+brain dump protocol has changed, so a version 2.0 Zephyr server and an
+older Zephyr server will not be able to brain dump to each other.
+Second, Zephyr clients built from sources earlier than the January 3,
+1995 snapshot will not be able to send authentic notices through
+version 2.0 Zephyr servers.
+
+Comments, suggestions, bug reports, or patches should go to
+bug-zephyr@mit.edu.
+
+To find out how to configure, build, and install Zephyr, read the file
+INSTALL.
+
+To find out how to operate a Zephyr service, read the file OPERATING.
+
+To find out how to use an existing Zephyr service, read the file
+USING.
+
+Please read the file NOTES before making any modifications to the
+source tree.
+
+LaTeX files for the Zephyr API are located on doc/progman. These
+documents may serve as a useful reference, but they have not been
+under recent maintenance, so they might have become somewhat out of
+date.
+
+--Greg Hudson
+ghudson@mit.edu
+
diff --git a/USING b/USING
new file mode 100644
index 0000000..a0e6b4a
--- /dev/null
+++ b/USING
@@ -0,0 +1,77 @@
+This file explains how to use an existing Zephyr service once you've
+built and installed the Zephyr 2.0 distribution. To learn how to
+build and install Zephyr, read the file INSTALL. To learn how to set
+up Zephyr service at a site, read the file OPERATING.
+
+First, before you can do anything else, your client machine must be
+running zhm from the local system binary directory (/etc/athena/zephyr
+if you built Zephyr with --enable-athena, /usr/local/sbin/zephyr if
+you installed Zephyr in /usr/local and didn't use --enable-athena).
+Only one copy of zhm can be running on a given machine, and it can be
+started by any user. If you're using a machine you don't administer,
+you may want to check if the machine is configured to start up zhm
+automatically at boot time.
+
+Once you have zhm running, you can start receiving zephyrgrams by
+running the command:
+
+ zwgc
+
+"zwgc" stands for "Zephyr WindowGram Client". If you built Zephyr
+with X support and are using an X display, you will receive messages
+as windows on your screen (click on them to get rid of them);
+otherwise, you will receive messages in your terminal as text. Read
+the man page on zwgc to find out how to configure it using the
+.zwgc.desc file in your home directory.
+
+You can send messages to another user with:
+
+ zwrite username
+
+To write to groups of users, you must agree on a "class" and/or
+"instance" to write to (this will be explained in greater detail
+below). At MIT, most users communicate in private groups via classes.
+Suppose a bunch of people wanted to communicate on a class "newclass".
+They would all subscribe to the class with the command:
+
+ zctl add newclass \* \*
+
+and send messages with:
+
+ zwrite -c newclass
+
+The "zctl add" command adds the subscription to the .zephyr.subs file
+in your home directory, so that you will automatically be subscribed
+to the class the next time you run zwgc. If you just want to
+subscribe without adding the subscription to your .zephyr.subs file,
+use "zctl sub" instead of "zctl add".
+
+Now for a bit more explanation about what classes and instances are:
+every Zephyr message is send to a class, an instance, and a recipient,
+commonly written as <class,instance,recipient>. The default class is
+"MESSAGE"; the default instance is "PERSONAL". When you use "zwrite
+username", you are sending a message to <MESSAGE,PERSONAL,username>.
+If you don't specify a username on the zwrite command line, you will
+be sending to the recipient "*", so when you use "zwrite -c newclass",
+you are sending a message to <newclass,PERSONAL,username>.
+
+Similarly, every time you request a subscription, you are subscribing
+to a class, an instance, and a recipient. The recipient must be
+either "*" or your username. The instance can be any string; however,
+if you subscribe to instance "*", you will receive messages to any
+instance as long as the class and recipient also match. The class can
+be any string; "*" has no special meaning for class names. When you
+start zwgc, you are automatically subscribed to
+<MESSAGE,PERSONAL,yourusername> and <MESSAGE,URGENT,yourusername> even
+if you don't explicitly request those subscriptions.
+
+As an example of how you might use these features, at MIT we have
+several frequently-used instances of class MESSAGE, called
+"white-magic", "help", "weather", "tmbg" and so forth. These are
+commonly known as "public" instances because they are not intended to
+exclude anyone. Users can subscribe to individual instances using
+"zctl add message help \*", or they can subscribe to all of them at
+once using "zctl add message \* \*". (If users do this, they can tell
+zwgc to filter out messages from certain instances; see the man page
+for zwgc.) If users want to have semi-private group conversations,
+they use separate classes, as described earlier.
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 0000000..9616ffb
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,24 @@
+/* Define to compile with Hesiod support. */
+#undef ZEPHYR_USES_HESIOD
+
+/* Define to compile with Kerberos support. */
+#undef ZEPHYR_USES_KERBEROS
+
+/* Define to a signed 32-bit integral type. */
+#define ZEPHYR_INT32 long
+
+/* Define if you have the System Resource Controller library. */
+#undef HAVE_SRC
+
+/* Define to "unsigned long" if your system headers don't. */
+#undef ulong
+
+/* Define to a temporary directory on your system. */
+#define FOUND_TMP "/var/tmp"
+
+/* Define to the type of the host system. */
+#define MACHINE_TYPE "unknown"
+
+/* Define if `regcomp' exists and works. */
+#undef HAVE_REGCOMP
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..2a636dd
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,21 @@
+AC_DEFUN(ZEPHYR_FUNC_REGCOMP,
+[AC_MSG_CHECKING(for working regcomp)
+AC_CACHE_VAL(zephyr_cv_func_regcomp,
+[AC_TRY_RUN([
+#include <sys/types.h>
+#include <regex.h>
+int main()
+{
+ regex_t reg;
+ int retval;
+ char errbuf[512];
+
+ retval = regcomp(&reg, "[Ff]rom:", REG_EXTENDED | REG_NOSUB);
+ exit(retval != 0);
+}
+], zephyr_cv_func_regcomp=yes, zephyr_cv_func_regcomp=no,
+ zephyr_cv_func_regcomp=no)])dnl
+AC_MSG_RESULT($zephyr_cv_func_regcomp)
+if test $zephyr_cv_func_regcomp = yes; then
+ AC_DEFINE(HAVE_REGCOMP)
+fi])
diff --git a/clients/Imakefile b/clients/Imakefile
deleted file mode 100644
index c657507..0000000
--- a/clients/Imakefile
+++ /dev/null
@@ -1,20 +0,0 @@
-/**/# Copyright 1988, 1993 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Header$
-/**/#
-
-#ifndef X11_NO_XAW
-XZWRITE=xzwrite
-#endif
-#if defined(HESIOD) && defined(KERBEROS)
-ZMAILNOTIFY= zmailnotify
-#endif
-
-#define ISUBDIRS zaway zctl zleave zlocate znol \
- zmailnotify zpopnotify zshutdown_notify zstat zwrite \
- syslogd xzwrite
diff --git a/clients/syslogd/Imakefile b/clients/syslogd/Imakefile
deleted file mode 100644
index 7700960..0000000
--- a/clients/syslogd/Imakefile
+++ /dev/null
@@ -1,28 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-#ifdef _AIX
-MACHLIBS= -lsrc
-#endif
-
-SRCS = syslogd.c logger.c syslog.c
-
-DOBJS = syslogd.o
-LOBJS= logger.o syslog.o
-
-#ifdef SYSLOG_COMPAT42
-COMPAT = -DCOMPAT42
-SimpleProgram(logger,$(LOBJS),,$(ATHETCDIR))
-#endif
-
-XDEFS = -I. $(COMPAT)
-
-SimpleProgram(syslogd,$(DOBJS) $(ZLIB),$(ZLIBS) $(MACHLIBS),$(ATHRETCDIR))
-install_man(syslogd.8,syslogd.8)
diff --git a/clients/syslogd/Makefile.in b/clients/syslogd/Makefile.in
new file mode 100644
index 0000000..15c64da
--- /dev/null
+++ b/clients/syslogd/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${srcdir} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err @SLIB@
+
+OBJS= syslogd.o
+
+all: syslogd
+
+syslogd: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: syslogd
+ ${INSTALL} -m 755 -s syslogd ${DESTDIR}${sbindir}
+ ${INSTALL} -m 644 ${srcdir}/syslogd.8 ${DESTDIR}${mandir}/man8
+
+clean:
+ rm -f ${OBJS} syslogd
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/syslogd/syslog.3 b/clients/syslogd/syslog.3
deleted file mode 100644
index 8acef78..0000000
--- a/clients/syslogd/syslog.3
+++ /dev/null
@@ -1,184 +0,0 @@
-.\" Copyright (c) 1983 Regents of the University of California.
-.\" All rights reserved. The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
-.\"
-.\" @(#)syslog.3 6.6 (Berkeley) 5/15/86
-.\"
-.TH SYSLOG 3 "May 15, 1986"
-.UC 5
-.SH NAME
-syslog, openlog, closelog, setlogmask \- control system log
-.SH SYNOPSIS
-.B "#include <syslog.h>
-.PP
-.B "openlog(ident, logopt, facility)
-.br
-.B "char *ident;
-.PP
-.B "syslog(priority, message, parameters ... )
-.br
-.B "char *message;
-.PP
-.B "closelog()
-.PP
-.B "setlogmask(maskpri)
-.SH DESCRIPTION
-.I Syslog
-arranges to write
-.I message
-onto the system log maintained by
-.IR syslogd (8).
-The message is tagged with
-.IR priority .
-The message looks like a
-.IR printf (3)
-string except that
-.B %m
-is replaced by the current error message (collected from
-.IR errno ).
-A trailing newline is added if needed.
-This message will be read by
-.IR syslogd (8)
-and written to the system console, log files, or forwarded to
-.I syslogd
-on another host as appropriate.
-.PP
-Priorities are encoded as a
-.I facility
-and a
-.IR level .
-The facility describes the part of the system
-generating the message.
-The level is selected from an ordered list:
-.IP LOG_EMERG \w'LOG_WARNING'u+3
-A panic condition.
-This is normally broadcast to all users.
-.IP LOG_ALERT \w'LOG_WARNING'u+3
-A condition that should be corrected immediately,
-such as a corrupted system database.
-.IP LOG_CRIT \w'LOG_WARNING'u+3
-Critical conditions,
-e.g., hard device errors.
-.IP LOG_ERR \w'LOG_WARNING'u+3
-Errors.
-.IP LOG_WARNING \w'LOG_WARNING'u+3
-Warning messages.
-.IP LOG_NOTICE \w'LOG_WARNING'u+3
-Conditions that are not error conditions,
-but should possibly be handled specially.
-.IP LOG_INFO \w'LOG_WARNING'u+3
-Informational messages.
-.IP LOG_DEBUG \w'LOG_WARNING'u+3
-Messages that contain information
-normally of use only when debugging a program.
-.PP
-If
-.I syslog
-cannot pass the message to
-.IR syslogd ,
-it will attempt to write the message on
-.I /dev/console
-if the LOG_CONS option is set (see below).
-.PP
-If special processing is needed,
-.I openlog
-can be called to initialize the log file.
-The parameter
-.I ident
-is a string that is prepended to every message.
-.I Logopt
-is a bit field indicating logging options.
-Current values for
-.I logopt
-are:
-.IP LOG_PID \w'LOG_WARNING'u+3
-log the process id with each message:
-useful for identifying instantiations of daemons.
-.IP LOG_CONS \w'LOG_WARNING'u+3
-Force writing messages to the console if unable to send it to
-.I syslogd.
-This option is safe to use in daemon processes that have no controlling
-terminal since
-.I syslog
-will fork before opening the console.
-.IP LOG_NDELAY \w'LOG_WARNING'u+3
-Open the connection to
-.I syslogd
-immediately.
-Normally the open is delayed
-until the first message is logged.
-Useful for programs that need to manage the
-order in which file descriptors are allocated.
-.IP LOG_NOWAIT \w'LOG_WARNING'u+3
-Don't wait for children forked to log messages on the console.
-This option should be used by processes that enable notification
-of child termination via SIGCHLD, as
-.I syslog
-may otherwise block waiting for a child whose exit status has already
-been collected.
-.PP
-The
-.I facility
-parameter encodes a default facility to be assigned to all messages
-that do not have an explicit facility encoded:
-.IP LOG_KERN \w'LOG_WARNING'u+3
-Messages generated by the kernel.
-These cannot be generated by any user processes.
-.IP LOG_USER \w'LOG_WARNING'u+3
-Messages generated by random user processes.
-This is the default facility identifier if none is specified.
-.IP LOG_MAIL \w'LOG_WARNING'u+3
-The mail system.
-.IP LOG_DAEMON \w'LOG_WARNING'u+3
-System daemons, such as
-.IR ftpd (8),
-.IR routed (8),
-etc.
-.IP LOG_AUTH \w'LOG_WARNING'u+3
-The authorization system:
-.IR login (1),
-.IR su (1),
-.IR getty (8),
-etc.
-.IP LOG_LPR \w'LOG_WARNING'u+3
-The line printer spooling system:
-.IR lpr (1),
-.IR lpc (8),
-.IR lpd (8),
-etc.
-.IP LOG_LOCAL0 \w'LOG_WARNING'u+3
-Reserved for local use.
-Similarly for LOG_LOCAL1 through LOG_LOCAL7.
-.PP
-.I Closelog
-can be used to close the log file.
-.PP
-.I Setlogmask
-sets the log priority mask to
-.I maskpri
-and returns the previous mask.
-Calls to
-.I syslog
-with a priority not set in
-.I maskpri
-are rejected.
-The mask for an individual priority
-.I pri
-is calculated by the macro LOG_MASK(\fIpri\fP);
-the mask for all priorities up to and including
-.I toppri
-is given by the macro LOG_UPTO(\fItoppri\fP).
-The default allows all priorities to be logged.
-.SH EXAMPLES
-.nf
-syslog(LOG_ALERT, "who: internal error 23");
-
-openlog("ftpd", LOG_PID, LOG_DAEMON);
-setlogmask(LOG_UPTO(LOG_ERR));
-syslog(LOG_INFO, "Connection from host %d", CallingHost);
-
-syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
-.fi
-.SH "SEE ALSO"
-logger(1),
-syslogd(8)
diff --git a/clients/syslogd/syslog.c b/clients/syslogd/syslog.c
deleted file mode 100644
index 378c987..0000000
--- a/clients/syslogd/syslog.c
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (c) 1983, 1988 Regents of the University of California.
- * 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 California at Berkeley. 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)syslog.c 5.14 (Berkeley) 5/20/88";
-#endif /* LIBC_SCCS and not lint */
-
-
-/*
- * SYSLOG -- print message on log file
- *
- * This routine looks a lot like printf, except that it
- * outputs to the log file instead of the standard output.
- * Also:
- * adds a timestamp,
- * prints the module name in front of the message,
- * has some other formatting types (or will sometime),
- * adds a newline on the end of the message.
- *
- * The output of this routine is intended to be read by /etc/syslogd.
- *
- * Author: Eric Allman
- * Modified to use UNIX domain IPC by Ralph Campbell
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/file.h>
-#include <sys/signal.h>
-#include <syslog.h>
-#include <netdb.h>
-#include <string.h>
-
-#define MAXLINE 1024 /* max message size */
-#define NULL 0 /* manifest */
-
-#define PRIFAC(p) (((p) & LOG_FACMASK) >> 3)
- /* XXX should be in <syslog.h> */
-#define IMPORTANT LOG_ERR
-
-static char logname[] = "/dev/log";
-static char ctty[] = "/dev/console";
-
-static int LogFile = -1; /* fd for log */
-static int LogStat = 0; /* status bits, set by openlog() */
-static char *LogTag = "syslog"; /* string to tag the entry with */
-static int LogMask = 0xff; /* mask of priorities to be logged */
-static int LogFacility = LOG_USER; /* default facility code */
-
-static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */
-
-extern int errno, sys_nerr;
-extern char *sys_errlist[];
-
-syslog(pri, fmt, p0, p1, p2, p3, p4)
- int pri;
- char *fmt;
-{
- char buf[MAXLINE + 1], outline[MAXLINE + 1];
- register char *b, *f, *o;
- register int c;
- long now;
- int pid, olderrno = errno;
-
- /* see if we should just throw out this message */
- if ((unsigned) PRIFAC(pri) >= LOG_NFACILITIES ||
- (LOG_MASK(pri & LOG_PRIMASK) & LogMask) == 0 ||
- (pri &~ (LOG_PRIMASK|LOG_FACMASK)) != 0)
- return;
- if (LogFile < 0)
- openlog(LogTag, LogStat | LOG_NDELAY, 0);
-
- /* set default facility if none specified */
- if ((pri & LOG_FACMASK) == 0)
- pri |= LogFacility;
-
- /* build the message */
- o = outline;
- (void)sprintf(o, "<%d>", pri);
- o += strlen(o);
- time(&now);
- (void)sprintf(o, "%.15s ", ctime(&now) + 4);
- o += strlen(o);
- if (LogTag) {
- strcpy(o, LogTag);
- o += strlen(o);
- }
- if (LogStat & LOG_PID) {
- (void)sprintf(o, "[%d]", getpid());
- o += strlen(o);
- }
- if (LogTag) {
- strcpy(o, ": ");
- o += 2;
- }
-
- b = buf;
- f = fmt;
- while ((c = *f++) != '\0' && c != '\n' && b < &buf[MAXLINE]) {
- if (c != '%') {
- *b++ = c;
- continue;
- }
- if ((c = *f++) != 'm') {
- *b++ = '%';
- *b++ = c;
- continue;
- }
- if ((unsigned)olderrno > sys_nerr)
- (void)sprintf(b, "error %d", olderrno);
- else
- strcpy(b, sys_errlist[olderrno]);
- b += strlen(b);
- }
- *b++ = '\n';
- *b = '\0';
- (void)sprintf(o, buf, p0, p1, p2, p3, p4);
- c = strlen(outline);
- if (c > MAXLINE)
- c = MAXLINE;
-
- /* output the message to the local logger */
- if (sendto(LogFile, outline, c, 0, &SyslogAddr, sizeof SyslogAddr) >= 0)
- return;
- if (!(LogStat & LOG_CONS))
- return;
-
- /* output the message to the console */
- pid = vfork();
- if (pid == -1)
- return;
- if (pid == 0) {
- int fd;
-
- signal(SIGALRM, SIG_DFL);
- sigsetmask(sigblock(0L) & ~sigmask(SIGALRM));
- alarm(5);
- fd = open(ctty, O_WRONLY);
- alarm(0);
- strcat(o, "\r");
- o = index(outline, '>') + 1;
- write(fd, o, c + 1 - (o - outline));
- close(fd);
- _exit(0);
- }
- if (!(LogStat & LOG_NOWAIT))
- while ((c = wait((int *)0)) > 0 && c != pid)
- ;
-}
-
-/*
- * OPENLOG -- open system log
- */
-
-openlog(ident, logstat, logfac)
- char *ident;
- int logstat, logfac;
-{
- if (ident != NULL)
- LogTag = ident;
- LogStat = logstat;
- if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0)
- LogFacility = logfac;
- if (LogFile >= 0)
- return;
- SyslogAddr.sa_family = AF_UNIX;
- strncpy(SyslogAddr.sa_data, logname, sizeof SyslogAddr.sa_data);
- if (LogStat & LOG_NDELAY) {
- LogFile = socket(AF_UNIX, SOCK_DGRAM, 0);
- fcntl(LogFile, F_SETFD, 1);
- }
-}
-
-/*
- * CLOSELOG -- close the system log
- */
-
-closelog()
-{
-
- (void) close(LogFile);
- LogFile = -1;
-}
-
-/*
- * SETLOGMASK -- set the log mask level
- */
-setlogmask(pmask)
- int pmask;
-{
- int omask;
-
- omask = LogMask;
- if (pmask != 0)
- LogMask = pmask;
- return (omask);
-}
diff --git a/clients/syslogd/syslog.conf b/clients/syslogd/syslog.conf
deleted file mode 100644
index 52dc6b1..0000000
--- a/clients/syslogd/syslog.conf
+++ /dev/null
@@ -1,20 +0,0 @@
-# Syslog daemon configuration file
-#
-# $Header$
-# $Source$
-# $Author$
-#
-*.alert;kern.debug;auth.notice /dev/console
-*.alert;kern.debug;auth.notice jon
-*.notice;kern.debug /site/usr/adm/messages
-*.notice;kern.debug jon
-mail.info /site/usr/spool/mqueue/syslog
-mail.info jon
-local0.info jon
-# local0 is for rshd
-local1.info /site/usr/adm/sulog
-local1.info jon
-#local1 is for su
-*.panic !*
-local2.debug jon
-
diff --git a/clients/syslogd/syslog.h b/clients/syslogd/syslog.h
index 139742c..eee7ec0 100644
--- a/clients/syslogd/syslog.h
+++ b/clients/syslogd/syslog.h
@@ -19,6 +19,9 @@
#define LOG_LPR (6<<3) /* line printer subsystem */
#define LOG_NEWS (7<<3) /* network news subsystem */
#define LOG_UUCP (8<<3) /* UUCP subsystem */
+#define LOG_CRON (9<<3) /* clock daemon */
+#define LOG_AUTHPRIV (10<<3) /* security/authorization messages (private) */
+#define LOG_FTP (11<<3) /* ftp daemon */
/* other codes through 15 reserved for system use */
#define LOG_LOCAL0 (16<<3) /* reserved for local use */
#define LOG_LOCAL1 (17<<3) /* reserved for local use */
@@ -47,7 +50,7 @@
#define LOG_INFO 6 /* informational */
#define LOG_DEBUG 7 /* debug-level messages */
-#define LOG_PRIMASK 0x0007 /* mask to extract priority part (internal) */
+#define LOG_PRIMASK 0x07 /* mask to extract priority part (internal) */
#define LOG_PRI(p) ((p) & LOG_PRIMASK) /* extract priority */
#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
diff --git a/clients/syslogd/syslogd.c b/clients/syslogd/syslogd.c
index 7a86006..5886fe8 100644
--- a/clients/syslogd/syslogd.c
+++ b/clients/syslogd/syslogd.c
@@ -45,6 +45,8 @@ static char sccsid[] = "@(#)syslogd.c 5.24 (Berkeley) 6/18/88";
* more extensive changes by Eric Allman (again)
* changes for Zephyr and a little dynamic allocation
* by Jon Rochlis (MIT), July 1987
+ * fixes, dynamic allocation, autoconf changes by Greg Hudson (MIT), 1995
+ * Solaris support by John Hawkinson (MIT), 1995
*/
#define MAXLINE 1024 /* maximum line length */
@@ -53,85 +55,51 @@ static char sccsid[] = "@(#)syslogd.c 5.24 (Berkeley) 6/18/88";
#define DEFSPRI (LOG_KERN|LOG_CRIT)
#define TIMERINTVL 30 /* interval for checking flush, mark */
-#ifdef SOLARIS
-#define MSG_BSIZE BUFSIZ
+#if defined(__sun__) && defined(__svr4__)
#define STREAMS_LOG_DRIVER
#endif
+#ifdef STREAMS_LOG_DRIVER
+#undef COMPAT42
+#endif
-#include <stdio.h>
-#include <sys/types.h>
-#include <time.h>
-#ifdef _IBMR2
-#include <sys/select.h>
+#include <sysdep.h>
+#ifdef HAVE_SRC
#include <spc.h> /* For support of the SRC system */
#endif
#include <utmp.h>
-#include <ctype.h>
-#include <string.h>
#include <setjmp.h>
-#include <fcntl.h>
-#include <syslog.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
#include <sys/socket.h>
-#include <sys/file.h>
-#ifndef COMPAT42
-#include <sys/msgbuf.h>
-#endif
-#include <sys/uio.h>
#include <sys/un.h>
-#include <sys/time.h>
#include <sys/resource.h>
-#include <sys/signal.h>
+#include <sys/uio.h>
#include <netdb.h>
-
#ifdef STREAMS_LOG_DRIVER
#include <sys/stream.h>
#include <sys/strlog.h>
#include <sys/log.h>
-
#include <poll.h>
#include <stropts.h>
#endif
-#ifdef POSIX
-#include <termios.h>
-#endif
-
#include <zephyr/zephyr.h>
+#include <com_err.h>
-extern int sys_nerr;
-#ifdef SUNOS
-extern char *sys_errlist[];
-#define strerror(n) sys_errlist[n]
-#endif
-
-#if defined(ultrix) || defined(POSIX)
-#define sighandler_type void
+#ifdef _PATH_VARRUN
+#define PIDDIR _PATH_VARRUN
#else
-#define sighandler_type int
+#define PIDDIR "/etc/"
#endif
#define CTTY "/dev/console"
char *LogName = "/dev/log";
-#ifdef COMPAT42
-char *ConfFile = "/etc/nsyslog.conf";
-char *PidFile = "/etc/nsyslog.pid";
-#else /* !COMPAT42 */
-char *ConfFile = "/etc/syslog.conf";
-char *PidFile = "/etc/syslog.pid";
-#endif /* COMPAT42 */
+char ConfFile[128];
+char PidFile[128];
char ctty[] = CTTY;
#define FDMASK(fd) (1 << (fd))
#define dprintf if (Debug) printf
-#define UNAMESZ ANAME_SZ+INST_SZ+REALM_SZ /* 8 isn't good enough anymore */
-#define UTMPNAMESZ 8
#define MAXUNAMES 20 /* maximum number of user names */
#define MAXFNAME 200 /* max file pathname length */
@@ -159,7 +127,7 @@ struct filed {
time_t f_time; /* time this was last written */
u_char f_pmask[LOG_NFACILITIES+1]; /* priority mask */
union {
- char f_uname[MAXUNAMES][UNAMESZ+1];
+ char *f_uname[MAXUNAMES];
struct {
char f_hname[MAXHOSTNAMELEN+1];
struct sockaddr_in f_addr;
@@ -215,6 +183,7 @@ int LogPort; /* port number for INET connections */
int Initialized = 0; /* set when we have initialized ourselves */
int MarkInterval = 20 * 60; /* interval between marks in seconds */
int MarkSeq = 0; /* mark sequence number */
+time_t now;
ZNotice_t znotice; /* for zephyr notices */
@@ -228,73 +197,95 @@ struct code {
};
struct code PriNames[] = {
- "panic", LOG_EMERG,
- "alert", LOG_ALERT,
- "crit", LOG_CRIT,
- "error", LOG_ERR,
- "warning", LOG_WARNING,
- "notice", LOG_NOTICE,
- "info", LOG_INFO,
- "debug", LOG_DEBUG,
- "none", NOPRI,
- "emerg", LOG_EMERG,
- "err", LOG_ERR,
- "warn", LOG_WARNING,
- NULL, -1
+ { "panic", LOG_EMERG },
+ { "alert", LOG_ALERT },
+ { "crit", LOG_CRIT },
+ { "error", LOG_ERR },
+ { "warning", LOG_WARNING },
+ { "notice", LOG_NOTICE },
+ { "info", LOG_INFO },
+ { "debug", LOG_DEBUG },
+ { "none", NOPRI },
+ { "emerg", LOG_EMERG },
+ { "err", LOG_ERR },
+ { "warn", LOG_WARNING },
+ { NULL, -1 }
};
/* reserved added so zephyr can use this table */
struct code FacNames[] = {
- "kern", LOG_KERN,
- "user", LOG_USER,
- "mail", LOG_MAIL,
- "daemon", LOG_DAEMON,
- "auth", LOG_AUTH,
- "syslog", LOG_SYSLOG,
- "lpr", LOG_LPR,
- "news", LOG_NEWS,
- "uucp", LOG_UUCP,
- "reserved", -1,
- "reserved", -1,
- "reserved", -1,
- "reserved", -1,
- "reserved", -1,
- "reserved", -1,
- "reserved", -1,
- "local0", LOG_LOCAL0,
- "local1", LOG_LOCAL1,
- "local2", LOG_LOCAL2,
- "local3", LOG_LOCAL3,
- "local4", LOG_LOCAL4,
- "local5", LOG_LOCAL5,
- "local6", LOG_LOCAL6,
- "local7", LOG_LOCAL7,
- "security", LOG_AUTH,
- "mark", LOG_MARK,
- NULL, -1
+ { "kern", LOG_KERN },
+ { "user", LOG_USER },
+ { "mail", LOG_MAIL },
+ { "daemon", LOG_DAEMON },
+ { "auth", LOG_AUTH },
+ { "syslog", LOG_SYSLOG },
+ { "lpr", LOG_LPR },
+ { "news", LOG_NEWS },
+ { "uucp", LOG_UUCP },
+ { "cron", LOG_CRON },
+ { "authpriv", LOG_AUTHPRIV },
+ { "ftp", LOG_FTP },
+ { "reserved", -1 },
+ { "reserved", -1 },
+ { "reserved", -1 },
+ { "cron", LOG_CRON },
+ { "local0", LOG_LOCAL0 },
+ { "local1", LOG_LOCAL1 },
+ { "local2", LOG_LOCAL2 },
+ { "local3", LOG_LOCAL3 },
+ { "local4", LOG_LOCAL4 },
+ { "local5", LOG_LOCAL5 },
+ { "local6", LOG_LOCAL6 },
+ { "local7", LOG_LOCAL7 },
+ { "security", LOG_AUTH },
+ { "mark", LOG_MARK },
+ { NULL, -1 }
};
-static sighandler_type
- die(),
- domark(),
- reapchild(),
- init(),
- endtty();
+static void usage __P((void));
+static void untty __P((void));
+static void printline __P((const char *hname, char *msg));
+#ifndef STREAMS_LOG_DRIVER
+static void printsys __P((char *msg));
+#endif
+static void logmsg __P((int pri, const char *msg, const char *from,
+ int flags));
+static void fprintlog __P((register struct filed *f, int flags,
+ const char *msg, int fac, int prilev));
+static RETSIGTYPE endtty __P((int sig));
+static void wallmsg __P((register struct filed *f, struct iovec *iov));
+static RETSIGTYPE reapchild __P((int sig));
+static const char *cvthname __P((struct sockaddr_in *f));
+static RETSIGTYPE domark __P((int sig));
+static void logerror __P((const char *type));
+static RETSIGTYPE die __P((int sig));
+static RETSIGTYPE init __P((int sig));
+static void cfline __P((char *line, register struct filed *f));
+static int decode __P((char *name, struct code *codetab));
+#ifdef HAVE_SRC
+static void handle_src __P((struct srcreq packet));
+static void send_src_reply __P((struct srcreq orig_packet, int rtncode,
+ char *packet, int len));
+#endif
-main(argc, argv)
+int main(argc, argv)
int argc;
char **argv;
{
register int i;
register char *p;
- int funix, inetm = 0, fklog, klogm, len;
+ int funix, inetm = 0, klogm, len;
+#ifndef STREAMS_LOG_DRIVER
struct sockaddr_un sunx, fromunix;
+ int fklog;
+#endif
struct sockaddr_in sin, frominet;
FILE *fp;
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct sigaction action;
#endif
-#ifdef _AIX
+#ifdef HAVE_SRC
int using_src = 1;
struct sockaddr srcsockaddr, fromsrc;
struct srcreq srcreq;
@@ -307,6 +298,8 @@ main(argc, argv)
char line[MSG_BSIZE + 1];
#endif
+ strcpy(ConfFile, "/etc/syslog.conf");
+ sprintf(PidFile, "%ssyslog.pid", PIDDIR);
while (--argc > 0) {
p = *++argv;
if (p[0] != '-')
@@ -314,7 +307,7 @@ main(argc, argv)
switch (p[1]) {
case 'f': /* configuration file */
if (p[2] != '\0')
- ConfFile = &p[2];
+ strcpy(ConfFile, &p[2]);
break;
case 'd': /* debug */
@@ -336,7 +329,7 @@ main(argc, argv)
}
}
-#ifdef _AIX
+#ifdef HAVE_SRC
addrlen = sizeof(struct sockaddr);
if (getsockname(0, &srcsockaddr, &addrlen) < 0) {
using_src = 0;
@@ -351,7 +344,7 @@ main(argc, argv)
#endif
if (!Debug) {
-#ifdef _AIX
+#ifdef HAVE_SRC
/* Don't fork if using SRC;
* SRC will think the program exited */
if (!using_src)
@@ -366,7 +359,7 @@ main(argc, argv)
(void) dup2(0, 2);
untty();
} else {
-#ifdef POSIX
+#ifdef _POSIX_VERSION
static char buf[BUFSIZ];
setvbuf (stdout, buf, _IOLBF, BUFSIZ);
#else
@@ -377,13 +370,13 @@ main(argc, argv)
consfile.f_type = F_CONSOLE;
(void) strcpy(consfile.f_un.f_fname, ctty);
(void) gethostname(LocalHostName, sizeof LocalHostName);
- if (p = strchr(LocalHostName, '.')) {
+ if ((p = strchr(LocalHostName, '.')) != NULL) {
*p++ = '\0';
LocalDomain = p;
}
else
LocalDomain = "";
-#ifdef POSIX
+#ifdef _POSIX_VERSION
action.sa_flags = 0;
sigemptyset(&action.sa_mask);
@@ -412,15 +405,15 @@ main(argc, argv)
(void) signal(SIGALRM, domark);
#endif
(void) alarm(TIMERINTVL);
-
+
#ifndef STREAMS_LOG_DRIVER
(void) unlink(LogName);
sunx.sun_family = AF_UNIX;
(void) strncpy(sunx.sun_path, LogName, sizeof sunx.sun_path);
funix = socket(AF_UNIX, SOCK_DGRAM, 0);
- if (funix < 0 || bind(funix, (struct sockaddr *) &sunx,
- sizeof(sunx.sun_family)+strlen(sunx.sun_path)) < 0 ||
+ if (funix < 0 ||
+ bind(funix, (struct sockaddr *) &sunx, sizeof(sunx)) < 0 ||
chmod(LogName, 0666) < 0) {
(void) sprintf(line, "cannot create %s", LogName);
logerror(line);
@@ -451,7 +444,6 @@ main(argc, argv)
finet = socket(AF_INET, SOCK_DGRAM, 0);
if (finet >= 0) {
struct servent *sp;
- int one = 1;
sp = getservbyname("syslog", "udp");
if (sp == NULL) {
@@ -465,7 +457,7 @@ main(argc, argv)
#ifdef COMPAT42
(void) close(finet);
#else
- if (bind(finet, &sin, sizeof(sin)) < 0) {
+ if (bind(finet, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
logerror("bind");
if (!Debug)
die(0);
@@ -475,25 +467,27 @@ main(argc, argv)
}
#endif /* COMPAT42 */
}
-#if defined(COMPAT42)
+#ifdef COMPAT42
InetInuse = 1;
inetm = 0;
klogm = 0;
-#elif defined(STREAMS_LOG_DRIVER)
+#else
+#ifdef STREAMS_LOG_DRIVER
klogm = 0;
-#else /* !COMPAT42, !STREAMS_LOG_DRIVER */
+#else
if ((fklog = open("/dev/klog", O_RDONLY)) >= 0)
klogm = FDMASK(fklog);
else {
dprintf("can't open /dev/klog (%d)\n", errno);
klogm = 0;
}
+#endif
#endif /* COMPAT42 */
/* tuck my process id away */
fp = fopen(PidFile, "w");
if (fp != NULL) {
- fprintf(fp, "%d\n", getpid());
+ fprintf(fp, "%d\n", (int) getpid());
(void) fclose(fp);
}
@@ -507,19 +501,14 @@ main(argc, argv)
znotice.z_default_format = "Syslog message from $instance, level $opcode:\n$message";
(void) ZInitialize ();
- init();
-#ifdef POSIX
+ init(0);
+#ifdef _POSIX_VERSION
action.sa_handler = init;
sigaction(SIGHUP, &action, NULL);
#else
(void) signal(SIGHUP, init);
#endif
-#ifndef STREAMS_LOG_DRIVER
- dprintf("fdmasks: funix=%d, inetm=%d, klogm=%d\n",
- FDMASK(funix), inetm, klogm);
-#endif
-
for (;;) {
int nfds;
#ifdef STREAMS_LOG_DRIVER
@@ -534,12 +523,12 @@ main(argc, argv)
readfds[POLLFD_unix].revents,
readfds[POLLFD_inet].fd,
readfds[POLLFD_inet].revents);
-
nfds = poll(readfds, 2, INFTIM);
#else /* STREAMS_LOG_DRIVER */
int readfds = FDMASK(funix) | inetm | klogm;
-#ifdef _AIX
+
+#ifdef HAVE_SRC
if (using_src)
readfds |= FDMASK(src_fd);
#endif
@@ -547,16 +536,15 @@ main(argc, argv)
dprintf("readfds = %#x\n", readfds);
nfds = select(20, (fd_set *) &readfds, (fd_set *) NULL,
(fd_set *) NULL, (struct timeval *) NULL);
- dprintf("got a message (%d, %#x)\n", nfds, readfds);
#endif /* STREAMS_LOG_DRIVER */
if (nfds == 0)
continue;
if (nfds < 0) {
if (errno != EINTR)
#ifdef STREAMS_LOG_DRIVER
- logerror("poll");
+ logerror("poll");
#else
- logerror("select");
+ logerror("select");
#endif
continue;
}
@@ -576,7 +564,10 @@ main(argc, argv)
i = getmsg(funix, &ctl, &dat, &flags);
if ((i==0)) {
#if (NLOGARGS != 3)
-#error This section of code assumes that NLOGARGS is 3. If that is not the case, this needs to be editted by hand. Sorry, but sed magic was too much for me.
+ error "This section of code assumes that NLOGARGS is 3.";
+ error "If that's not the case, this needs to be editted";
+ error "by hand. Sorry, but sed magic was too much for";
+ error "me.";
#else
{
char null[] = "", *p;
@@ -599,7 +590,7 @@ main(argc, argv)
} else if (i > 0) {
sprintf(line, "getmsg() > 1 (%X)", i);
logerror(line);
- }
+ }
}
#else /* STREAMS_LOG_DRIVER */
dprintf("got a message (%d, %#x)\n", nfds, readfds);
@@ -623,7 +614,7 @@ main(argc, argv)
printline(LocalHostName, line);
} else if (i < 0 && errno != EINTR)
logerror("recvfrom unix");
- }
+ }
#endif /* STREAMS_LOG_DRIVER */
#ifdef STREAMS_LOG_DRIVER
if (readfds[POLLFD_inet].revents & (POLLIN|POLLPRI)) {
@@ -631,16 +622,15 @@ main(argc, argv)
if (readfds & inetm) {
#endif
len = sizeof frominet;
- i = recvfrom(finet, line, MAXLINE, 0, &frominet, &len);
+ i = recvfrom(finet, line, MAXLINE, 0,
+ (struct sockaddr *) &frominet, &len);
if (i > 0) {
- extern char *cvthname();
-
line[i] = '\0';
printline(cvthname(&frominet), line);
} else if (i < 0 && errno != EINTR)
logerror("recvfrom inet");
}
-#ifdef _AIX
+#ifdef HAVE_SRC
dprintf("%d %d %d\n", using_src, readfds, FDMASK(src_fd));
if (using_src && (readfds & (FDMASK(src_fd)))) {
dprintf("got a src packet\n");
@@ -649,29 +639,33 @@ main(argc, argv)
&len);
dprintf("finished recvfrom, %d\n",i);
}
-/* if (i > 0) {
+#if 0
+ if (i > 0) {
handle_src(srcreq);
} else if (i < 0 && errno != EINTR)
logerror("recvfrom src");
- } */
-#endif /* _AIX */
+ }
+#endif
+#endif /* HAVE_SRC */
}
}
-usage()
+static void usage()
{
fprintf(stderr, "usage: syslogd [-d] [-mmarkinterval] [-ppath] [-fconffile]\n");
exit(1);
}
-untty()
+static void untty()
{
int i;
if (!Debug) {
i = open("/dev/tty", O_RDWR);
if (i >= 0) {
+#ifdef TIOCNOTTY /* Only necessary on old systems. */
(void) ioctl(i, (int) TIOCNOTTY, (char *)0);
+#endif
(void) close(i);
}
}
@@ -682,8 +676,8 @@ untty()
* on the appropriate log files.
*/
-printline(hname, msg)
- char *hname;
+static void printline(hname, msg)
+ const char *hname;
char *msg;
{
register char *p, *q;
@@ -727,7 +721,8 @@ printline(hname, msg)
* Take a raw input line from /dev/klog, split and format similar to syslog().
*/
-printsys(msg)
+#ifndef STREAMS_LOG_DRIVER
+static void printsys(msg)
char *msg;
{
register char *p, *q;
@@ -761,23 +756,22 @@ printsys(msg)
logmsg(pri, line, LocalHostName, flags);
}
}
-
-time_t now;
+#endif
/*
* Log a message to the appropriate log files, users, etc. based on
* the priority.
*/
-logmsg(pri, msg, from, flags)
+static void logmsg(pri, msg, from, flags)
int pri;
- char *msg, *from;
+ const char *msg, *from;
int flags;
{
register struct filed *f;
int fac, prilev, msglen;
- char *timestamp;
-#ifdef POSIX
+ const char *timestamp;
+#ifdef _POSIX_VERSION
sigset_t osig, sig;
#else
int omask;
@@ -785,7 +779,7 @@ logmsg(pri, msg, from, flags)
dprintf("logmsg: pri %o, flags %x, from %s, msg %s\n", pri, flags, from, msg);
-#ifdef POSIX
+#ifdef _POSIX_VERSION
(void) sigemptyset(&sig);
(void) sigaddset(&sig, SIGHUP);
(void) sigaddset(&sig, SIGALRM);
@@ -828,7 +822,7 @@ logmsg(pri, msg, from, flags)
fprintlog(f, flags, (char *)NULL, fac, prilev);
(void) close(f->f_file);
}
-#ifdef POSIX
+#ifdef _POSIX_VERSION
(void) sigprocmask(SIG_SETMASK, &osig, (sigset_t *)0);
#else
(void) sigsetmask(omask);
@@ -855,8 +849,8 @@ logmsg(pri, msg, from, flags)
!strcmp(from, f->f_prevhost)) {
(void) strncpy(f->f_lasttime, timestamp, 15);
f->f_prevcount++;
- dprintf("msg repeated %d times, %d sec of %d\n",
- f->f_prevcount, now - f->f_time,
+ dprintf("msg repeated %d times, %ld sec of %d\n",
+ f->f_prevcount, (long)(now - f->f_time),
repeatinterval[f->f_repeatcount]);
/*
* If domark would have logged this by now,
@@ -876,6 +870,7 @@ logmsg(pri, msg, from, flags)
(void) strncpy(f->f_lasttime, timestamp, 15);
(void) strncpy(f->f_prevhost, from,
sizeof(f->f_prevhost));
+ f->f_prevhost[sizeof(f->f_prevhost) - 1] = 0;
if (msglen < MAXSVLINE) {
f->f_prevlen = msglen;
f->f_prevpri = pri;
@@ -889,23 +884,23 @@ logmsg(pri, msg, from, flags)
}
}
}
-#ifdef POSIX
+#ifdef _POSIX_VERSION
(void) sigprocmask(SIG_SETMASK, &osig, (sigset_t *)0);
#else
(void) sigsetmask(omask);
#endif
}
-fprintlog(f, flags, msg, fac, prilev)
+static void fprintlog(f, flags, msg, fac, prilev)
register struct filed *f;
int flags;
- char *msg;
+ const char *msg;
int fac, prilev;
{
struct iovec iov[6];
register struct iovec *v = iov;
register int l;
- char line[MAXLINE + 1];
+ char line[MAXLINE + MAXHOSTNAMELEN + 21];
char repbuf[80];
char pri_fac_str[35];
int i;
@@ -924,7 +919,7 @@ fprintlog(f, flags, msg, fac, prilev)
v->iov_len = 1;
v++;
if (msg) {
- v->iov_base = msg;
+ v->iov_base = (char *) msg;
v->iov_len = strlen(msg);
} else if (f->f_prevcount > 1) {
(void) sprintf(repbuf, "last message repeated %d times",
@@ -953,9 +948,11 @@ fprintlog(f, flags, msg, fac, prilev)
if (l > MAXLINE)
l = MAXLINE;
#ifdef COMPAT42
- if (sendto(f->f_file, line, l, 0, &f->f_un.f_forw.f_addr,
+ if (sendto(f->f_file, line, l, 0,
+ (struct sockaddr *) &f->f_un.f_forw.f_addr,
#else
- if (sendto(finet, line, l, 0, &f->f_un.f_forw.f_addr,
+ if (sendto(finet, line, l, 0,
+ (struct sockaddr *) &f->f_un.f_forw.f_addr,
#endif
sizeof f->f_un.f_forw.f_addr) != l) {
int e = errno;
@@ -1013,6 +1010,11 @@ fprintlog(f, flags, msg, fac, prilev)
iov[0].iov_base,
iov[2].iov_base,
iov[4].iov_base);
+ if (!msg && f->f_prevcount > 1) {
+ /* Include previous line with Zephyrgram. */
+ sprintf(line + strlen(line), ":\n%*s",
+ f->f_prevlen, f->f_prevline);
+ }
(void) sprintf(pri_fac_str, "%s.%s",
FacNames[fac].c_name,
PriNames[(prilev & LOG_PRIMASK)].c_name);
@@ -1022,7 +1024,7 @@ fprintlog(f, flags, msg, fac, prilev)
znotice.z_opcode = pri_fac_str;
dprintf (" z_opcode %s\n", pri_fac_str);
for (i = 0; i < MAXUNAMES; i++) {
- if (!f->f_un.f_uname[i][0])
+ if (!f->f_un.f_uname[i])
break;
/* map "*" into null recipient and therefore
anybody who is listening */
@@ -1047,16 +1049,16 @@ fprintlog(f, flags, msg, fac, prilev)
f->f_prevcount = 0;
}
-#ifdef POSIX
+#ifdef _POSIX_VERSION
sigjmp_buf ttybuf;
#else
jmp_buf ttybuf;
#endif
-static sighandler_type
-endtty()
+static RETSIGTYPE endtty(sig)
+ int sig;
{
-#ifdef POSIX
+#ifdef _POSIX_VERSION
siglongjmp(ttybuf, 1);
#else
longjmp(ttybuf, 1);
@@ -1070,7 +1072,7 @@ endtty()
* world, or a list of approved users.
*/
-wallmsg(f, iov)
+static void wallmsg(f, iov)
register struct filed *f;
struct iovec *iov;
{
@@ -1081,7 +1083,7 @@ wallmsg(f, iov)
struct utmp ut;
static char p[6+sizeof(ut.ut_line)] = "/dev/";
char greetings[200];
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct sigaction action;
#endif
@@ -1100,7 +1102,7 @@ wallmsg(f, iov)
* and doing notty().
*/
if (fork() == 0) {
-#ifdef POSIX
+#ifdef _POSIX_VERSION
action.sa_flags = 0;
(void) sigemptyset(&action.sa_mask);
@@ -1136,7 +1138,7 @@ wallmsg(f, iov)
/* should we send the message to this user? */
if (f->f_type == F_USERS) {
for (i = 0; i < MAXUNAMES; i++) {
- if (!f->f_un.f_uname[i][0]) {
+ if (!f->f_un.f_uname[i]) {
i = MAXUNAMES;
break;
}
@@ -1156,7 +1158,7 @@ wallmsg(f, iov)
iov[0].iov_len = len;
iov[1].iov_len = 0;
}
-#ifdef POSIX
+#ifdef _POSIX_VERSION
if (sigsetjmp(ttybuf, 1) == 0)
#else
if (setjmp(ttybuf) == 0)
@@ -1184,23 +1186,22 @@ wallmsg(f, iov)
reenter = 0;
}
-static sighandler_type
-reapchild()
+static RETSIGTYPE reapchild(sig)
+ int sig;
{
-#ifdef POSIX
- int status;
- while (waitpid(-1, &status, WNOHANG) > 0) ;
+#ifdef HAVE_WAITPID
+ int status;
+ while (waitpid(-1, &status, WNOHANG) > 0) ;
#else
- union wait status;
- while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0) ;
+ union wait status;
+ while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0) ;
#endif
}
/*
* Return a printable representation of a host address.
*/
-char *
-cvthname(f)
+static const char *cvthname(f)
struct sockaddr_in *f;
{
struct hostent *hp;
@@ -1213,7 +1214,8 @@ cvthname(f)
dprintf("Malformed from address\n");
return ("???");
}
- hp = gethostbyaddr(&f->sin_addr, sizeof(struct in_addr), f->sin_family);
+ hp = gethostbyaddr((const char *) &f->sin_addr, sizeof(struct in_addr),
+ f->sin_family);
if (hp == 0) {
dprintf("Host name for your address (%s) unknown\n",
inet_ntoa(f->sin_addr));
@@ -1224,8 +1226,8 @@ cvthname(f)
return (hp->h_name);
}
-static sighandler_type
-domark()
+static RETSIGTYPE domark(sig)
+ int sig;
{
register struct filed *f;
@@ -1252,24 +1254,19 @@ domark()
/*
* Print syslogd errors some place.
*/
-logerror(type)
- char *type;
+static void logerror(type)
+ const char *type;
{
char buf[100];
- if (errno == 0)
- (void) sprintf(buf, "syslogd: %s", type);
- else if ((unsigned) errno > sys_nerr)
- (void) sprintf(buf, "syslogd: %s: error %d", type, errno);
- else
- (void) sprintf(buf, "syslogd: %s: %s", type, strerror(errno));
+ sprintf(buf, "syslogd: %s", strerror(errno));
errno = 0;
dprintf("%s\n", buf);
logmsg(LOG_SYSLOG|LOG_ERR, buf, LocalHostName, ADDDATE);
}
-static sighandler_type
-die(sig)
+static RETSIGTYPE die(sig)
+ int sig;
{
register struct filed *f;
char buf[100];
@@ -1287,7 +1284,7 @@ die(sig)
logerror(buf);
}
#ifndef STREAMS_LOG_DRIVER
- (void) unlink(LogName);
+ (void) unlink(LogName);
#endif
exit(0);
}
@@ -1296,8 +1293,8 @@ die(sig)
* INIT -- Initialize syslogd from configuration table
*/
-static sighandler_type
-init()
+static RETSIGTYPE init(sig)
+ int sig;
{
register int i;
register FILE *cf;
@@ -1316,7 +1313,6 @@ init()
if (f->f_prevcount)
fprintlog(f, 0, (char *)NULL, f->f_prevfac,
f->f_prevpri);
-
switch (f->f_type) {
case F_FILE:
case F_TTY:
@@ -1326,6 +1322,13 @@ init()
#endif
(void) close(f->f_file);
break;
+
+ case F_USERS:
+ case F_ZEPHYR:
+
+ for (i = 0; i < MAXUNAMES && f->f_un.f_uname[i]; i++)
+ free(f->f_un.f_uname[i]);
+ break;
}
next = f->f_next;
free((char *) f);
@@ -1389,7 +1392,7 @@ init()
break;
case F_USERS:
- for (i = 0; i < MAXUNAMES && *f->f_un.f_uname[i]; i++)
+ for (i = 0; i < MAXUNAMES && f->f_un.f_uname[i]; i++)
printf("%s, ", f->f_un.f_uname[i]);
break;
}
@@ -1405,7 +1408,7 @@ init()
* Crack a configuration file line
*/
-cfline(line, f)
+static void cfline(line, f)
char *line;
register struct filed *f;
{
@@ -1541,15 +1544,18 @@ cfline(line, f)
for (i = 0; i < MAXUNAMES && *p; i++) {
for (q = p; *q && *q != ','; )
q++;
- (void) strncpy(f->f_un.f_uname[i], p, UTMPNAMESZ);
- if ((q - p) > UTMPNAMESZ)
- f->f_un.f_uname[i][UTMPNAMESZ] = '\0';
- else
- f->f_un.f_uname[i][q - p] = '\0';
+ f->f_un.f_uname[i] = malloc(q - p + 1);
+ if (f->f_un.f_uname[i]) {
+ strncpy(f->f_un.f_uname[i], p, q - p);
+ f->f_un.f_uname[i][q - p] = 0;
+ } else {
+ break;
+ }
while (*q == ',' || *q == ' ')
q++;
p = q;
}
+ f->f_un.f_uname[i] = NULL;
f->f_type = F_USERS;
break;
@@ -1557,15 +1563,18 @@ cfline(line, f)
for (i = 0; i < MAXUNAMES && *p; i++) {
for (q = p; *q && *q != ','; )
q++;
- (void) strncpy(f->f_un.f_uname[i], p, UNAMESZ);
- if ((q - p) > UNAMESZ)
- f->f_un.f_uname[i][UNAMESZ] = '\0';
- else
- f->f_un.f_uname[i][q - p] = '\0';
+ f->f_un.f_uname[i] = malloc(q - p + 1);
+ if (f->f_un.f_uname[i]) {
+ strncpy(f->f_un.f_uname[i], p, q - p);
+ f->f_un.f_uname[i][q - p] = 0;
+ } else {
+ break;
+ }
while (*q == ',' || *q == ' ')
q++;
p = q;
}
+ f->f_un.f_uname[i] = NULL;
f->f_type = F_ZEPHYR;
break;
}
@@ -1576,7 +1585,7 @@ cfline(line, f)
* Decode a symbolic name to a numeric value
*/
-decode(name, codetab)
+static int decode(name, codetab)
char *name;
struct code *codetab;
{
@@ -1598,11 +1607,10 @@ decode(name, codetab)
return (-1);
}
-#ifdef _AIX
+#ifdef HAVE_SRC
/* Routines for handling the SRC (System Resource Controller) system */
-void
-handle_src(packet)
+static void handle_src(packet)
struct srcreq packet;
{
void send_src_reply();
@@ -1638,7 +1646,7 @@ handle_src(packet)
break;
case REFRESH:
if (packet.subreq.object == SUBSYSTEM) {
- init();
+ init(0);
send_src_reply(packet, SRC_OK, "", sizeof(struct srcrep));
} else {
send_src_reply(packet, SRC_SUBMSG,
@@ -1649,8 +1657,7 @@ handle_src(packet)
}
}
-void
-send_src_reply(orig_packet, rtncode, packet,len)
+static void send_src_reply(orig_packet, rtncode, packet,len)
struct srcreq orig_packet;
int rtncode;
char *packet;
@@ -1668,4 +1675,4 @@ send_src_reply(orig_packet, rtncode, packet,len)
srcsrpy(srcrrqs(&orig_packet), (char *)&reply, len, cont);
}
-#endif /* _AIX */
+#endif /* HAVE_SRC */
diff --git a/clients/xzwrite/GetString.c b/clients/xzwrite/GetString.c
index 3195c26..85e3463 100644
--- a/clients/xzwrite/GetString.c
+++ b/clients/xzwrite/GetString.c
@@ -12,7 +12,6 @@
static int accepted, cancelled;
static void Accept(), Cancel(), Focus();
-static int HierEvent();
extern void Popup();
@@ -94,30 +93,6 @@ int GetString(getStringWindow, label, value, pop_type, buf, len)
return GETSTRING_CANCEL;
}
-/*
- * I thought I needed this routine becaues XtAppNextEvent was
- * returning events for widgets that should have been blocked by the
- * XtGrabExclusive.. but it turns out that XtDispatch deals with that
- * (correctly) so this code is useless.
- */
-static int HierEvent(w, event)
- Widget w;
- XAnyEvent *event;
-{
- Widget event_w;
-
- event_w = XtWindowToWidget(XtDisplay(w), event->window);
-
- while (event_w = XtParent(event_w)) {
- if (w == event_w)
- return 1;
- else if (XtIsShell(event_w))
- break;
- }
-
- return 0;
-}
-
/* ARGSUSED */
static void Accept(w, e, p, n)
Widget w;
diff --git a/clients/xzwrite/Imakefile b/clients/xzwrite/Imakefile
deleted file mode 100644
index 16d9853..0000000
--- a/clients/xzwrite/Imakefile
+++ /dev/null
@@ -1,28 +0,0 @@
-/**/# Copyright 1990 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-SRCS = interface.c resource.c destlist.c util.c bfgets.c \
- gethomedir.c dest_window.c xzwrite.c edit_window.c zephyr.c\
- GetString.c Popup.c yank.c menu_window.c logins.c
-
-OBJS = interface.o resource.o destlist.o util.o bfgets.o \
- gethomedir.o dest_window.o xzwrite.o edit_window.o zephyr.o\
- GetString.o Popup.o yank.o menu_window.o logins.o
-
-XDEFS=-DXZWRITE_SEARCH_PATHS=\"$(ZLIBDIR)/%N\"
-
-zprogram(xzwrite,$(DYN_LIB) $(LIB_XAW))
-install_man(xzwrite.1,xzwrite.1)
-install_file(xzwrite.bitmap,$(ZLIBDIR))
-
-install::
- $(RM) $(DESTDIR)$(ZLIBDIR)/XZwrite
- sed -e "s,ACLDIR,$(ZLIBDIR)," \
- < XZwrite > $(DESTDIR)$(ZLIBDIR)/XZwrite
diff --git a/clients/xzwrite/Makefile.in b/clients/xzwrite/Makefile.in
new file mode 100644
index 0000000..9d706b6
--- /dev/null
+++ b/clients/xzwrite/Makefile.in
@@ -0,0 +1,57 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -DDATADIR=\"${datadir}\" -I${top_srcdir}/h \
+ -I${BUILDTOP}/h @X_CFLAGS@ @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr -L${BUILDTOP}/lib/dyn @ET_LDFLAGS@ \
+ @X_LIBS@ @LDFLAGS@
+LIBS=-lzephyr -ldyn -lXaw -lXmu -lXt @X_PRE_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@ \
+ @LIBS@ -lcom_err
+
+OBJS= interface.o resource.o destlist.o util.o bfgets.o gethomedir.o \
+ dest_window.o xzwrite.o edit_window.o zephyr.o GetString.o Popup.o \
+ yank.o menu_window.o logins.o
+
+all: xzwrite
+
+xzwrite: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a \
+ ${BUILDTOP}/lib/dyn/libdyn.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: xzwrite XZwrite
+ ${INSTALL} -m 755 -s xzwrite ${DESTDIR}${bindir}
+ ${INSTALL} -m 644 ${srcdir}/xzwrite.1 ${DESTDIR}${mandir}/man1
+ ${INSTALL} -m 644 XZwrite ${DESTDIR}${datadir}
+ ${INSTALL} -m 644 ${srcdir}/xzwrite.bitmap ${DESTDIR}${datadir}
+
+clean:
+ rm -f ${OBJS} xzwrite
+
+${OBJS}: xzwrite.h xzwrite-proto.h ${top_srcdir}/h/sysdep.h
+${OBJS}: ${BUILDTOP}/h/config.h ${BUILDTOP}/h/zephyr/zephyr.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr_err.h
+destlist.o logins.o xzwrite.o zephyr.o: ${top_srcdir}/h/dyn.h
+
+.PHONY: all check install clean
+
diff --git a/clients/xzwrite/Makefile.old b/clients/xzwrite/Makefile.old
deleted file mode 100644
index 82ab462..0000000
--- a/clients/xzwrite/Makefile.old
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Makefile for xzwrite, X11R4
-# Written by Barr3y Jaspan, bjaspan@athena.mit.edu
-# MIT Student Information Processing Board and MIT-Project Athena
-#
-
-SRCS = interface.c resource.c destlist.c util.c bfgets.c \
- gethomedir.c dest_window.c xzwrite.c edit_window.c zephyr.c\
- GetString.c Popup.c yank.c menu_window.c logins.c
-
-OBJS = interface.o resource.o destlist.o util.o bfgets.o \
- gethomedir.o dest_window.o xzwrite.o edit_window.o zephyr.o\
- GetString.o Popup.o yank.o menu_window.o logins.o
-
-HDRS = xzwrite.h GetString.h
-
-DYNLIBDIR = /mit/sipb/$(MACHINE)lib
-X11LIBDIR = /mit/x11/$(MACHINE)lib
-
-TARGET = xzwrite
-INCLUDES= -I/mit/sipb/include -I/mit/x11/include
-DEBUG = -O
-CFLAGS = $(DEBUG) $(INCLUDES)
-LDFLAGS = -L$(DYNLIBDIR) -L$(X11LIBDIR)
-LIBS = -lzephyr -lkrb -ldes -lcom_err -lXaw -lXmu -lXt -lXext -lX11 -ldyn
-CC = gcc
-
-DESTDIR = /afs/.athena.mit.edu/contrib/sipb
-BINDEST = $(DESTDIR)/$(MACHINE)bin
-MANDEST = $(DESTDIR)/man
-RESDEST = $(DESTDIR)/lib/app-defaults
-MANSECT = 1
-
-$(TARGET): $(OBJS)
- $(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
-
-install: bin_install man_install resource_install
-
-clean:
- -rm -f $(OBJS) $(TARGET) *~ core
-
-proto:
- mkproto $(SRCS) $(HDRS) > xzwrite-proto.h
-
-saber:
- #setopt program_name xzwrite
- #load ${CFLAGS} ${LDFLAGS} ${SRCS} -G ${LIBS}
-
-osaber:
- #setopt program_name xzwrite
- #load $(CFLAGS) $(LDFLAGS) -G $(OBJS) $(LIBS)
-
-bin_install: $(TARGET)
- -if [ -f $(BINDEST)/$(TARGET) ]; then \
- mv $(BINDEST)/$(TARGET) $(BINDEST)/.#$(TARGET).old; \
- exit 0; \
- fi
- install -c -s $(TARGET) $(BINDEST)/$(TARGET)
-
-man_install:
- nroff -man $(TARGET).man > \
- $(MANDEST)/cat$(MANSECT)/$(TARGET).$(MANSECT)
- cp $(TARGET).man $(MANDEST)/man$(MANSECT)/$(TARGET).$(MANSECT)
-
-resource_install:
- cp XZwrite $(RESDEST)/XZwrite
-
-depend:
- makedepend -- $(CFLAGS) -- $(SRCS) $(HDRS)
-
-interface.o resource.o destlist.o util.o dest_window.o: xzwrite.h
-xzwrite.o edit_window.o zephyr.o yank.o: xzwrite.h
-dest_window.o: GetString.h
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/clients/xzwrite/XZwrite b/clients/xzwrite/XZwrite.in
index 3fb574f..f7b21c8 100644
--- a/clients/xzwrite/XZwrite
+++ b/clients/xzwrite/XZwrite.in
@@ -1,3 +1,5 @@
+! @configure_input@
+
*resize: on
*allowShellResize: on
@@ -15,7 +17,7 @@
*readAnyone: on
*readXzwrite: on
-*icon.bitmap: ACLDIR/xzwrite.bitmap
+*icon.bitmap: @datadir@/xzwrite.bitmap
*icon.translations: #override\
<BtnDown>: set() \n\
<Btn1Up>: OpenSend() unset() \n\
diff --git a/clients/xzwrite/bfgets.c b/clients/xzwrite/bfgets.c
index 19df253..96636f9 100644
--- a/clients/xzwrite/bfgets.c
+++ b/clients/xzwrite/bfgets.c
@@ -21,7 +21,7 @@ char *bfgets(s, n, iop)
int n;
FILE *iop;
{
- register int c;
+ register int c = 0;
register char *cs;
cs = s;
diff --git a/clients/xzwrite/destlist.c b/clients/xzwrite/destlist.c
index 57a03f0..21b9b89 100644
--- a/clients/xzwrite/destlist.c
+++ b/clients/xzwrite/destlist.c
@@ -1,6 +1,5 @@
-#include <stdio.h>
+#include <sysdep.h>
#include <dyn.h>
-#include <string.h>
#include "xzwrite.h"
@@ -154,7 +153,7 @@ char **dest_add(dest)
*dest->zinst ? dest->zinst : "*",
*dest->zrecip ? dest->zrecip : "*");
- if (DynAdd(dests, &buf) == DYN_NOMEM) {
+ if (DynAdd(dests, (DynPtr) &buf) == DYN_NOMEM) {
Warning("Out of memory adding destination ", buf, ". Skipping.",
NULL);
free(buf);
@@ -173,7 +172,7 @@ char **dest_add_string(s)
if (! parse_into_dest(&dest, s))
return NULL;
- if (DynAdd(dests, &s) == DYN_NOMEM)
+ if (DynAdd(dests, (DynPtr) &s) == DYN_NOMEM)
Warning("Out of memory adding destination ", s, ". Skipping.",
NULL);
@@ -211,9 +210,10 @@ char **delete_dest_index(i)
}
-static int sort_dest_func(c1, c2)
- char **c1, **c2;
+static int sort_dest_func(a1, a2)
+ const void *a1, *a2;
{
+ char **c1 = (char **) a1, **c2 = (char **) a2;
char *s1, *s2, *i1, *i2;
/* A string with a , in it is always less than one without */
@@ -291,7 +291,6 @@ char **sort_destinations()
}
/* Fills in dest from s */
-#define distance(a,b) ((int) b - (int) a)
int parse_into_dest(dest, s)
Dest dest;
char *s;
@@ -311,7 +310,7 @@ int parse_into_dest(dest, s)
/* Check for just class,instance or instace,recipient */
else if ((b=strchr((++a), ','))==0) {
if (defs.class_inst) {
- x = distance(s, a-1);
+ x = a - 1 - s;
if (x >= ZLEN)
return 0;
@@ -320,7 +319,7 @@ int parse_into_dest(dest, s)
strcpy(dest->zinst, a);
strcpy(dest->zrecip, "*"); }
else {
- x = distance(s, a-1);
+ x = a - 1 - s;
if (x >= ZLEN)
return 0;
@@ -333,8 +332,8 @@ int parse_into_dest(dest, s)
/* Otherwise, deal with class,instance,recipent */
else {
++b;
- x = distance(s, a-1);
- y = distance(a, b-1);
+ x = a - 1 - s;
+ y = b - 1 - a;
if (x >= ZLEN || y >= ZLEN)
return 0;
@@ -349,7 +348,6 @@ int parse_into_dest(dest, s)
return 1;
}
-#undef distance
/*
* notice is from <MESSAGE,inst,sender>. If inst is "PERSONAL", add
@@ -362,7 +360,6 @@ int parse_into_dest(dest, s)
void dest_add_reply(notice)
ZNotice_t *notice;
{
- Dest dest;
char **list, *newdest, buf[ZLEN*3+2];
int i, num;
diff --git a/clients/xzwrite/destlist.c.old b/clients/xzwrite/destlist.c.old
deleted file mode 100644
index a81d2c9..0000000
--- a/clients/xzwrite/destlist.c.old
+++ /dev/null
@@ -1,417 +0,0 @@
-#include <stdio.h>
-#include <dyn.h>
-#include <strings.h>
-
-#include "xzwrite.h"
-
-/*
- * The following code extracts keypressed from an X event:
- *
- * keyevent = event->xkey;
- * XLookupString(&keyevent, buffer, 1, NULL, NULL);
- */
-
-/*
- * This entire file could easily be changes so that multiple destination
- * lists could be used. But I don't know that that's necessary for this
- * program.
- */
-
-/* Globals */
-DestRec current_dest;
-
-static DynObject dests;
-extern Defaults defs;
-
-static void get_dest_from_file(), _get_default_dest();
-static int sort_dest_func();
-
-/* A function for debugging */
-void dest_print()
-{
- char **d;
- int i;
-
- d = (char **) DynGet(dests, 0);
- for (i=0; i<DynSize(dests); i++)
- printf("%d %s\n", i, d[i]);
-}
-
-char **dest_text()
-{
- return ((char **) DynGet(dests, 0));
-}
-
-int dest_num()
-{
- return (DynSize(dests));
-}
-
-void dest_set_current_dest(dest)
- Dest dest;
-{
- (void) memcpy((char *) &current_dest, (char *) dest, sizeof(DestRec));
-}
-
-void dest_init()
-{
- dests = DynCreate(sizeof(char *), 0);
- if (! dests)
- Error("Out of memory reading destinations", NULL);
-
- strcpy(current_dest.zclass, DEFAULT_CLASS);
- strcpy(current_dest.zinst, DEFAULT_INST);
- strcpy(current_dest.zrecip, get_username());
-}
-
-char **load_default_dest()
-{
- char *get_home_dir();
-
- if (! *get_home_dir())
- Error("Cannot find your home directory.", NULL);
-
- if (defs.read_xzwrite)
- _get_default_dest(XZWRITE_DEST_FILE);
- if (defs.read_zephyr)
- _get_default_dest(ZEPHYR_FILE);
- if (defs.read_anyone)
- _get_default_dest(ANYONE_FILE);
-
- if (DynSize(dests) == 0) {
- char *def;
-
- Warning("XZwrite: No destinations specified, using default.",
- NULL);
-
- def = (char *) Malloc(strlen("...") + 1, "adding default dests",
- NULL);
- strcpy(def, "...");
- if (DynAdd(dests, (char *) &def) == DYN_NOMEM)
- Error("Out of memory adding default destinations.", NULL);
- }
-
- sort_destinations();
- return ((char **) DynGet(dests, 0));
-}
-
-static void _get_default_dest(s)
- char *s;
-{
- char *filename;
-
- filename = (char *) Malloc(strlen(get_home_dir()) + strlen(s) + 1,
- "While reading file ", s, NULL);
- sprintf(filename, "%s%s", get_home_dir(), s);
- get_dest_from_file(dests, filename);
- free(filename);
-}
-
-static void get_dest_from_file(dests, f)
- DynObject dests;
- char *f;
-{
- FILE *file;
- char *line, buf[BUFSIZ];
- DestRec dest;
-
- if ((file = fopen(f, "r")) == NULL) {
- Warning("Cannot find destinations file ", f, NULL);
- return;
- }
-
- while (bfgets(buf, 80, file)) {
- if (buf[0] == '#' || buf[0] == '\0') {
- if (defs.debug)
- printf("xzwrite: skipping comment or blank line\n");
- continue;
- }
-
- if (! parse_into_dest(&dest, buf)) {
- Warning("Ignoring incorrect destination: ", buf, NULL);
- continue;
- }
-
- line = (char *) Malloc(strlen(buf) + 1, "parsing file ", f, NULL);
- strcpy(line, buf);
- if (DynAdd(dests, (char *) &line) == DYN_NOMEM)
- Error("Out of memory parsing file ", f, NULL);
- }
-
- fclose(file);
-}
-
-char **dest_add(dest)
- Dest dest;
-{
- char *buf;
-
- /* Two extra bytes if instance or recipient are "" */
- buf = (char *) Malloc(strlen(dest->zclass) + strlen(dest->zinst) +
- strlen(dest->zrecip) + 5,
- "while adding destination ", NULL);
- sprintf(buf, "%s,%s,%s", dest->zclass,
- *dest->zinst ? dest->zinst : "*",
- *dest->zrecip ? dest->zrecip : "*");
-
- if (DynAdd(dests, &buf) == DYN_NOMEM) {
- Warning("Out of memory adding destination ", buf, ". Skipping.",
- NULL);
- free(buf);
- }
-
- sort_destinations();
- return ((char **) DynGet(dests, 0));
-}
-
-/* XXX The return/output semantics of this function are not good */
-char **dest_add_string(s)
- char *s;
-{
- DestRec dest;
-
- if (! parse_into_dest(&dest, s))
- return NULL;
-
- if (DynAdd(dests, &s) == DYN_NOMEM)
- Warning("Out of memory adding destination ", s, ". Skipping.",
- NULL);
-
- sort_destinations();
- return ((char **) DynGet(dests, 0));
-}
-
-char **dest_delete_string(s)
- char *s;
-{
- int i;
- char **d;
-
- d = (char **) DynGet(dests, 0);
- for (i=0; i<DynSize(dests); i++) {
- if (! strcmp(s, d[i])) {
- DynDelete(dests, i);
- break;
- }
- }
-
- return ((char **) DynGet(dests, 0));
-}
-
-char **delete_dest_index(i)
- int i;
-{
- int ret;
-
- ret = DynDelete(dests, i);
- if (ret != DYN_OK)
- return NULL;
-
- return ((char **) DynGet(dests, 0));
-}
-
-
-static int sort_dest_func(c1, c2)
- char **c1, **c2;
-{
- char *s1, *s2, *i1, *i2;
-
- /* A string with a , in it is always less than one without */
- s1 = *c1; s2 = *c2;
- i1 = strchr(s1, ',');
- i2 = strchr(s2, ',');
- if (i1 == NULL && i2 != NULL)
- return 1;
- else if (i1 != NULL && i2 == NULL)
- return -1;
- else
- return strcmp(s1, s2);
-}
-
-static int
-binary_find_dest(key)
-char *key;
-{
- register int low = 0, high = DynHigh(dests), mid;
- register int val;
- register char **d;
-
- d = (char **) DynGet(dests, 0);
-
- /* do binary search */
- while (low <= high) {
- mid = (low + high) / 2;
- val = sort_dest_func(&key, &d[mid]);
- if (val < 0) {
- high = mid - 1;
- } else if (val > 0) {
- low = mid + 1;
- } else {
- return (mid);
- }
- }
-
- return -1;
-}
-
-char **sort_destinations()
-{
- register char **d;
- register int idx, idx2;
- int dsiz = DynSize(dests);
-
- d = (char **) DynGet(dests, 0);
- qsort(d, dsiz, sizeof(char *), sort_dest_func);
-
- for (idx = 0; idx < DynSize(dests);) {
- if (d[idx][0] == '!') {
- /* unsubscription */
- char *next = d[idx];
- next++;
- while ((idx2 = binary_find_dest(next)) >= 0) {
- /* found one to nuke */
- DynDelete(dests, idx2);
- if (idx2 <= idx) {
- /* indexes shifted, so restart this pass. */
- idx--;
- if (idx <= 0)
- idx = 0;
- continue;
- }
- }
- /* ok, no more to nuke from this one, so delete it and
- move on. */
- DynDelete(dests, idx);
- continue;
- }
- /* nope, continue on to next unsub */
- idx++;
- }
- return d;
-}
-
-/* Fills in dest from s */
-#define distance(a,b) ((int) b - (int) a)
-int parse_into_dest(dest, s)
- Dest dest;
- char *s;
-{
- char *a, *b;
- int x, y;
-
- /* Check for just recipient */
- if ((a=strchr(s, ','))==0) {
- if (strlen(s) > ZLEN)
- return 0;
- strcpy(dest->zclass, DEFAULT_CLASS);
- strcpy(dest->zinst, DEFAULT_INST);
- strcpy(dest->zrecip, s);
- }
-
- /* Check for just class,instance or instace,recipient */
- else if ((b=strchr((++a), ','))==0) {
- if (defs.class_inst) {
- x = distance(s, a-1);
- if (x >= ZLEN)
- return 0;
-
- strncpy(dest->zclass, s, x);
- dest->zclass[x] = '\0';
- strcpy(dest->zinst, a);
- strcpy(dest->zrecip, "*"); }
- else {
- x = distance(s, a-1);
- if (x >= ZLEN)
- return 0;
-
- strcpy(dest->zclass, DEFAULT_CLASS);
- strncpy(dest->zinst, s, x);
- dest->zinst[x] = '\0';
- strcpy(dest->zrecip, a); }
- }
-
- /* Otherwise, deal with class,instance,recipent */
- else {
- ++b;
- x = distance(s, a-1);
- y = distance(a, b-1);
- if (x >= ZLEN || y >= ZLEN)
- return 0;
-
- strncpy(dest->zclass, s, x);
- dest->zclass[x] = '\0';
- strncpy(dest->zinst, a, y);
- dest->zinst[y] = '\0';
- strcpy(dest->zrecip, b);
- }
- if (!strcmp(dest->zrecip,"*")) *(dest->zrecip) = '\0';
- if (!strcmp(dest->zinst,"*")) *(dest->zinst) = '\0';
-
- return 1;
-}
-#undef distance
-
-/*
- * notice is from <MESSAGE,inst,sender>. If inst is "PERSONAL", add
- * destination string "<sender>" if
- * 1) MESSAGE,PERSONAL,<sender> is not in list, and
- * 2) <sender> is not in list.
- * If inst is not "PERSONAL", add destination string
- * "<MESSAGE,<inst>,<sender>>" if it is not in the list.
- */
-void dest_add_reply(notice)
- ZNotice_t *notice;
-{
- Dest dest;
- char **list, *newdest, buf[ZLEN*3+2];
- int i, num;
-
- list = dest_text();
- num = dest_num();
-
-
- /* A hack so local-realm is less annoying */
- {
- char *r;
-
- r = strchr(notice->z_sender, '@');
- if (r && ! strcmp(r+1, ZGetRealm()))
- *r = '\0';
- }
-
- if (! strcasecmp(notice->z_class_inst, DEFAULT_INST)) {
- sprintf(buf, "message,personal,%s", notice->z_sender);
- for (i=0; i < num; i++) {
- if (! strcasecmp(list[i], buf) ||
- ! strcasecmp(list[i], notice->z_sender))
- return;
- }
-
- newdest = (char *) Malloc(strlen(notice->z_sender) + 1,
- "while adding reply destination", NULL);
- sprintf(newdest, "%s", notice->z_sender);
- }
- else {
- sprintf(buf, "message,%s,%s", notice->z_class_inst,
- notice->z_sender);
- for (i=0; i < num; i++) {
- if (! strcasecmp(list[i], buf))
- return;
- }
-
- newdest = (char *) Malloc(strlen(notice->z_class) +
- strlen(notice->z_class_inst) +
- strlen(notice->z_sender) + 3,
- "while adding reply destintion",
- NULL);
- sprintf(newdest, "%s,%s,%s", notice->z_class,
- notice->z_class_inst, notice->z_sender);
- }
-
- dest_add_string(newdest);
- display_dest();
-
- if (defs.track_logins)
- zeph_subto_logins(&notice->z_sender, 1);
-}
-
diff --git a/clients/xzwrite/gethomedir.c b/clients/xzwrite/gethomedir.c
index 5c3d372..ffd25bf 100644
--- a/clients/xzwrite/gethomedir.c
+++ b/clients/xzwrite/gethomedir.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <pwd.h>
+#include "xzwrite.h"
char *get_home_dir()
{
@@ -8,7 +9,7 @@ char *get_home_dir()
if (h) return h;
- if (h = (char *) getenv("HOME")) return h;
+ if ((h = getenv("HOME")) != NULL) return h;
pwuid = getpwuid(getuid());
return (pwuid->pw_dir);
diff --git a/clients/xzwrite/interface.c b/clients/xzwrite/interface.c
index a92ec3c..d48e73c 100644
--- a/clients/xzwrite/interface.c
+++ b/clients/xzwrite/interface.c
@@ -44,6 +44,9 @@
* getStringCancel - the cancel button
*/
+#include "xzwrite.h"
+#include "GetString.h"
+
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
@@ -59,9 +62,6 @@
#include <zephyr/zephyr.h> /* for ZGetFD() */
-#include "xzwrite.h"
-#include "GetString.h"
-
#define XVCMW XtVaCreateManagedWidget
/* Action Procedure declarations */
@@ -134,17 +134,16 @@ void build_interface(argc, argv)
path1 = (char *) getenv("XFILESEARCHPATH");
if (! path1) path1 = "";
path2 = (char *) malloc(strlen(path1) +
-#ifdef USE_PUTENV
+#ifdef HAVE_PUTENV
strlen("XFILESEARCHPATH=") +
#endif
- strlen(XZWRITE_SEARCH_PATHS) + 2);
+ strlen(DATADIR) + 5);
if (path2 != NULL) {
-#ifdef USE_PUTENV
- sprintf(path2, "XFILESEARCHPATH=%s:%s", path1,
- XZWRITE_SEARCH_PATHS);
+#ifdef HAVE_PUTENV
+ sprintf(path2, "XFILESEARCHPATH=%s:%s/%%N", path1, DATADIR);
putenv(path2);
#else
- sprintf(path2, "%s:%s", path1, XZWRITE_SEARCH_PATHS);
+ sprintf(path2, "%s:%s/%N", path1, DATADIR);
setenv("XFILESEARCHPATH", path2, 1);
free(path2);
#endif
@@ -226,7 +225,7 @@ static void Quit(w, e, p, n)
Cardinal *n;
{
XtDestroyApplicationContext(app_con);
- ZCancelSubscriptions();
+ ZCancelSubscriptions(0);
exit(0);
}
@@ -388,7 +387,7 @@ static void CloseMenu(w, e, p, n)
XtPopdown(menuWindow);
}
-static void set_editor_width (void)
+static void set_editor_width ()
{
int w, c; char m = 'm';
XFontStruct *fs = (XFontStruct *) NULL;
@@ -410,7 +409,7 @@ static void set_editor_width (void)
XtVaSetValues(destForm, XtNwidth, (Dimension)(w*3/8), NULL);
}
-static void set_sendclose_width (void)
+static void set_sendclose_width ()
{
/* make the Close Window button the width of the form */
Dimension wi = 0;
diff --git a/clients/xzwrite/logins.c b/clients/xzwrite/logins.c
index 7f4e17b..66fe825 100644
--- a/clients/xzwrite/logins.c
+++ b/clients/xzwrite/logins.c
@@ -1,19 +1,19 @@
+#include "xzwrite.h"
+
#include <X11/Intrinsic.h> /* for Boolean */
-#include <zephyr/zephyr.h>
#include <dyn.h>
-
-#include "xzwrite.h"
+#include <zephyr/zephyr.h>
extern Defaults defs;
-#define distance(a,b) ((int) b - (int) a)
void logins_deal(notice)
ZNotice_t *notice;
{
- char *newdest;
+ char *newdest, *p;
int d;
- d = distance(notice->z_class_inst, strchr(notice->z_class_inst, '@'));
+ p = strchr(notice->z_class_inst, '@');
+ d = (p) ? p - notice->z_class_inst : strlen(notice->z_class_inst);
newdest = (char *) Malloc(d+1, "while dealing with login/logout notice",
NULL);
strncpy(newdest, notice->z_class_inst, d);
@@ -33,7 +33,6 @@ void logins_deal(notice)
free(newdest);
}
}
-#undef distance
/* Considers a destination with a , and without a . in to be a username */
void logins_subscribe()
@@ -52,7 +51,7 @@ void logins_subscribe()
while (--num) {
parse_into_dest(&dest, list[num]);
if (*dest.zrecip)
- if (DynAdd(users, list + num) != DYN_OK)
+ if (DynAdd(users, (DynPtr)(list + num)) != DYN_OK)
Error("Out of memory subscribing to logins", NULL);
}
diff --git a/clients/xzwrite/util.c b/clients/xzwrite/util.c
index 38c7f13..f52ee7e 100644
--- a/clients/xzwrite/util.c
+++ b/clients/xzwrite/util.c
@@ -1,37 +1,44 @@
#include <stdio.h>
-#include <varargs.h>
#include <pwd.h>
#include "xzwrite.h"
+#ifdef __STDC__
+void Warning(const char *first, ...)
+#else
/*VARARGS*/
void Warning(first, va_alist)
- char *first;
+ const char *first;
va_dcl
+#endif
{
va_list vp;
char *s;
fputs(first, stderr);
- va_start(vp);
+ VA_START(vp, first);
while ((s = va_arg(vp, char *)) != NULL)
fputs(s, stderr);
va_end(vp);
putc('\n', stderr);
}
+#ifdef __STDC__
+void Error(const char *first, ...)
+#else
/*VARARGS*/
void Error(first, va_alist)
- char *first;
+ const char *first;
va_dcl
+#endif
{
va_list vp;
char *s;
fputs(first, stderr);
- va_start(vp);
+ VA_START(vp, first);
while ((s = va_arg(vp, char *)) != NULL)
fputs(s, stderr);
va_end(vp);
@@ -40,10 +47,14 @@ void Error(first, va_alist)
exit(1);
}
+#ifdef __STDC__
+char *Malloc(int n, ...)
+#else
/*VARARGS*/
char *Malloc(n, va_alist)
int n;
va_dcl
+#endif
{
va_list vp;
char *ptr, *s;
@@ -54,7 +65,7 @@ char *Malloc(n, va_alist)
fputs("Out of memory: ", stderr);
- va_start(vp);
+ VA_START(vp, n);
while ((s = va_arg(vp, char *)) != NULL)
fputs(s, stderr);
va_end(vp);
@@ -70,7 +81,7 @@ char *get_username()
if (u) return u;
- if (u = (char *) getenv("USER")) return u;
+ if ((u = getenv("USER")) != NULL) return u;
pwuid = getpwuid(getuid());
if (pwuid)
diff --git a/clients/xzwrite/xzwrite-proto.h b/clients/xzwrite/xzwrite-proto.h
index 0e0b0e6..baeccca 100644
--- a/clients/xzwrite/xzwrite-proto.h
+++ b/clients/xzwrite/xzwrite-proto.h
@@ -1,96 +1,101 @@
+#ifndef __P
#ifdef __STDC__
-# define P(s) s
+# define __P(s) s
#else
-# define P(s) ()
+# define __P(s) ()
+#endif
#endif
/* interface.c */
-void go P((void ));
-void build_interface P((int *argc , char **argv ));
+void go __P((void ));
+void build_interface __P((int *argc , char **argv ));
/* resource.c */
/* destlist.c */
-void dest_print P((void ));
-char **dest_text P((void ));
-int dest_num P((void ));
-void dest_set_current_dest P((Dest dest ));
-void dest_init P((void ));
-char **load_default_dest P((void ));
-char **dest_add P((Dest dest ));
-char **dest_add_string P((char *s ));
-char **dest_delete_string P((char *s ));
-char **delete_dest_index P((int i ));
-char **sort_destinations P((void ));
-int parse_into_dest P((Dest dest , char *s ));
-void dest_add_reply P((ZNotice_t *notice ));
+void dest_print __P((void ));
+char **dest_text __P((void ));
+int dest_num __P((void ));
+void dest_set_current_dest __P((Dest dest ));
+void dest_init __P((void ));
+char **load_default_dest __P((void ));
+char **dest_add __P((Dest dest ));
+char **dest_add_string __P((char *s ));
+char **dest_delete_string __P((char *s ));
+char **delete_dest_index __P((int i ));
+char **sort_destinations __P((void ));
+int parse_into_dest __P((Dest dest , char *s ));
+void dest_add_reply __P((ZNotice_t *notice ));
/* util.c */
-char *get_username P((void ));
+void Warning __P((const char *first, ...));
+void Error __P((const char *first, ...));
+char *Malloc __P((int n, ...));
+char *get_username __P((void ));
/* bfgets.c */
-char *bfgets P((char *s , int n , FILE *iop ));
+char *bfgets __P((char *s , int n , FILE *iop ));
/* gethomedir.c */
-char *get_home_dir P((void ));
+char *get_home_dir __P((void ));
/* dest_window.c */
-void dest_add_reply P((ZNotice_t *notice ));
-void display_dest P((void ));
-void delete_dest P((void ));
-void create_dest P((void ));
-void select_dest P((void ));
+void dest_add_reply __P((ZNotice_t *notice ));
+void display_dest __P((void ));
+void delete_dest __P((void ));
+void create_dest __P((void ));
+void select_dest __P((void ));
/* xzwrite.c */
-int main P((int argc , char **argv ));
-int usage P((void ));
+int main __P((int argc , char **argv ));
+void usage __P((void ));
/* edit_window.c */
-void edit_win_init P((void ));
-void send_message P((void ));
-void edit_set_title P((Dest dest ));
-void edit_clear P((void ));
-void edit_yank_prev P((void ));
-void edit_yank_next P((void ));
-void edit_yank_store P((void ));
+void edit_win_init __P((void ));
+void send_message __P((void ));
+void edit_set_title __P((Dest dest ));
+void edit_clear __P((void ));
+void edit_yank_prev __P((void ));
+void edit_yank_next __P((void ));
+void edit_yank_store __P((void ));
/* zephyr.c */
-void zeph_dispatch P((XtPointer client_data , int *source , XtInputId *input_id ));
-void zeph_init P((void ));
-int zeph_locateable P((char *user ));
-void zeph_subto_logins P((char **users , int num ));
-void zeph_subto_replys P((void ));
-int zeph_send_message P((Dest dest , char *msg ));
-int zeph_ping P((Dest dest ));
-int zeph_pong P((Dest dest ));
-char *zeph_get_signature P((void ));
-void log_message P((Dest dest , char *msg ));
+void zeph_dispatch __P((XtPointer client_data , int *source , XtInputId *input_id ));
+void zeph_init __P((void ));
+int zeph_locateable __P((char *user ));
+void zeph_subto_logins __P((char **users , int num ));
+void zeph_subto_replies __P((void ));
+int zeph_send_message __P((Dest dest , char *msg ));
+int zeph_ping __P((Dest dest ));
+int zeph_pong __P((Dest dest ));
+char *zeph_get_signature __P((void ));
+void log_message __P((Dest dest , char *msg ));
/* GetString.c */
-Widget InitGetString P((Widget parent , char *name ));
-int GetString P((Widget getStringWindow , String label , String value , int pop_type , char *buf , int len ));
+Widget InitGetString __P((Widget parent , char *name ));
+int GetString __P((Widget getStringWindow , String label , String value , int pop_type , char *buf , int len ));
/* Popup.c */
-void Popup P((Widget shell , XtGrabKind GrabType , int pop_type ));
-void PopupSafe P((Widget w , Dimension x , Dimension y , XtGrabKind GrabType ));
-void PopupAtPointer P((Widget w , XtGrabKind GrabType ));
+void Popup __P((Widget shell , XtGrabKind GrabType , int pop_type ));
+void PopupSafe __P((Widget w , Dimension x , Dimension y , XtGrabKind GrabType ));
+void PopupAtPointer __P((Widget w , XtGrabKind GrabType ));
/* yank.c */
-void yank_init P((void ));
-Yank yank_prev P((void ));
-Yank yank_next P((void ));
-void yank_store P((Dest dest , char *msg ));
+void yank_init __P((void ));
+Yank yank_prev __P((void ));
+Yank yank_next __P((void ));
+void yank_store __P((Dest dest , char *msg ));
/* menu_window.c */
-void menu_toggle P((Widget w ));
-void menu_match_defs P((void ));
-void menu_signature P((void ));
+void menu_toggle __P((Widget w ));
+void menu_match_defs __P((void ));
+void menu_signature __P((void ));
/* logins.c */
-void logins_deal P((ZNotice_t *notice ));
-void logins_subscribe P((void ));
-Boolean login_scan_work P((caddr_t client_data ));
+void logins_deal __P((ZNotice_t *notice ));
+void logins_subscribe __P((void ));
+Boolean login_scan_work __P((caddr_t client_data ));
/* xzwrite.h */
diff --git a/clients/xzwrite/xzwrite.c b/clients/xzwrite/xzwrite.c
index 55ea848..318e5e9 100644
--- a/clients/xzwrite/xzwrite.c
+++ b/clients/xzwrite/xzwrite.c
@@ -8,12 +8,10 @@
extern Defaults defs;
DynObject zsigs = NULL;
-#define islower(foo) ((foo) >= 'a' && (foo) <= 'z')
-#define toupper(foo) ((foo)+'A'-'a')
+static void set_signature __P((void));
+static Boolean set_random_zsigs __P((void));
-Boolean set_random_zsigs();
-
-main(argc, argv)
+int main(argc, argv)
int argc;
char **argv;
{
@@ -37,9 +35,10 @@ main(argc, argv)
zeph_subto_replies();
go();
+ return 0;
}
-set_signature()
+static void set_signature()
{
char *sig, sigbfr[BUFSIZ];
@@ -86,7 +85,7 @@ set_signature()
-usage()
+void usage()
{
fprintf(stderr, "Usage: xzwrite [ -toolkitoption ... ] [-s signature] [+d | -d] [+n | -n]\n\t[+v | -v] [+yd | -yd] [+av | -av] [+ci | -ci] [-my yanks]\n\t[+l | -l] [+a | -a] [+x | -x] [+z | -z] [+pong | -pong] [+reply | -reply]\n");
exit(1);
@@ -94,7 +93,7 @@ usage()
#define BUF_SIZE 1024
-Boolean set_random_zsigs()
+static Boolean set_random_zsigs()
{ int x, n;
char z[BUF_SIZE], *z2;
FILE *fp;
diff --git a/clients/xzwrite/xzwrite.h b/clients/xzwrite/xzwrite.h
index 4a8a47c..a9b020b 100644
--- a/clients/xzwrite/xzwrite.h
+++ b/clients/xzwrite/xzwrite.h
@@ -1,4 +1,4 @@
-#include <stdio.h>
+#include <sysdep.h>
#include <X11/Intrinsic.h> /* for String and Boolean */
#define ZLEN 60
diff --git a/clients/xzwrite/zephyr.c b/clients/xzwrite/zephyr.c
index 5d8f6cc..6e25dd5 100644
--- a/clients/xzwrite/zephyr.c
+++ b/clients/xzwrite/zephyr.c
@@ -1,8 +1,9 @@
-#include <zephyr/zephyr.h>
-
#include "xzwrite.h"
#include <string.h>
#include <dyn.h>
+#include <com_err.h>
+
+#include <zephyr/zephyr.h>
static int zeph_send_notice();
extern Defaults defs;
@@ -61,7 +62,7 @@ void zeph_init()
if (retval != ZERR_NONE)
Error("Cannot initialize the Zephyr library.", NULL);
- retval = ZOpenPort((int *) 0);
+ retval = ZOpenPort(NULL);
if (retval != ZERR_NONE)
Error("Cannot open Zephyr port.", NULL);
}
@@ -255,33 +256,6 @@ static int zeph_send_notice(notice, auth)
return SEND_OK;
}
-#ifdef DEBUG
-/* debugging function */
-void zeph_display_subscriptions()
-{
- ZSubscription_t sub;
- int n, retval, i = 1;
-
- retval = ZRetrieveSubscriptions((unsigned short) 0, &n);
- if (retval != ZERR_NONE) {
- Warning(error_message(retval), " while retrieving subscriptions.",
- NULL);
- return;
- }
-
- printf("Retrieving %d subscriptions.\n", n);
-
- while (ZGetSubscriptions(&sub, &i) == ZERR_NONE) {
- if (i != 1)
- Warning("Subscriptions skipped while printing.", NULL);
-
- printf("<%s,%s,%s>\n", sub.class, (*sub.zsub_classinst) ?
- sub.zsub_classinst : "**", (*sub.zsub_recipient) ?
- sub.zsub_recipient : "**");
- }
-}
-#endif
-
void log_message(dest, msg)
Dest dest;
char *msg;
diff --git a/clients/xzwrite/zephyr.c.old b/clients/xzwrite/zephyr.c.old
deleted file mode 100644
index 40d9958..0000000
--- a/clients/xzwrite/zephyr.c.old
+++ /dev/null
@@ -1,269 +0,0 @@
-#include <zephyr/zephyr.h>
-
-#include "xzwrite.h"
-#include <strings.h>
-
-static int zeph_send_notice();
-extern Defaults defs;
-
-/* ARGSUSED */
-void zeph_dispatch(client_data, source, input_id)
- XtPointer client_data;
- int *source;
- XtInputId *input_id;
-{
- ZNotice_t notice;
- struct sockaddr_in from;
- int ret;
-
- while (ZPending() > 0) {
- ret = ZReceiveNotice(&notice, &from);
- if (ret != ZERR_NONE) {
- Warning(error_message(ret), " while receiving Zephyr notice.",
- NULL);
- continue;
- }
-
- if (defs.track_logins &&
- (! strcmp(notice.z_opcode, "USER_LOGIN") ||
- ! strcmp(notice.z_opcode, "USER_LOGOUT")))
- logins_deal(&notice);
-
- else if (defs.auto_reply &&
- ! strcasecmp(notice.z_class, DEFAULT_CLASS) &&
- ! strcasecmp(notice.z_recipient, ZGetSender()))
- dest_add_reply(&notice);
-
- /* Handle the zlocating bug the Zephyr library explicitly. */
- /* Only display bogon zlocate packets in debug mode */
- else if (strcmp(notice.z_class, LOCATE_CLASS) || defs.debug) {
- Warning("XZwrite: Unexpected notice received. ",
- "You can probably ignore this.\n",
- "To: <", notice.z_class, ", ",
- notice.z_class_inst, ", ", (*notice.z_recipient) ?
- notice.z_recipient : "*", ">\n",
- "From: ", notice.z_sender, "\nOpcode: ",
- notice.z_opcode, "\nMessage: ", notice.z_message,
- "\n", NULL);
- }
-
- ZFreeNotice(&notice);
- }
-}
-
-void zeph_init()
-{
- int retval;
-
- retval = ZInitialize();
- if (retval != ZERR_NONE)
- Error("Cannot initialize the Zephyr library.", NULL);
-
- retval = ZOpenPort((int *) 0);
- if (retval != ZERR_NONE)
- Error("Cannot open Zephyr port.", NULL);
-}
-
-int zeph_locateable(user)
- char *user;
-{
- char buf[BUFSIZ];
- int n;
-
- if (strchr(user, '@') == NULL)
- sprintf(buf, "%s@%s", user, ZGetRealm());
- ZLocateUser(buf, &n, ZAUTH);
- return (!! n);
-}
-
-/* XXX This will break on interrealm zephyr */
-void zeph_subto_logins(users, num)
- char **users;
- int num;
-{
- ZSubscription_t *sublist;
- char *name, *realm;
- int rlen, c = 0;
-
- realm = ZGetRealm();
- rlen = strlen(realm);
- sublist = (ZSubscription_t *) Malloc(num*sizeof(ZSubscription_t),
- "while subscribing to logins", NULL);
-
- while (c < num) {
- sublist[c].zsub_class = "login";
- sublist[c].zsub_recipient = "";
- name = (char *) Malloc(strlen(users[c])+rlen+2,
- "while subscribing to login, ", users[c],
- NULL);
- if (strchr(users[c], '@'))
- sprintf(name, "%s", users[c]);
- else
- sprintf(name, "%s@%s", users[c], realm);
- sublist[c].zsub_classinst = name;
- c += 1;
- }
-
- ZSubscribeToSansDefaults(sublist, c, (unsigned short) 0);
- for(; c; --c)
- free(sublist[c-1].zsub_classinst);
- free(sublist);
-}
-
-void zeph_subto_replies()
-{
- ZSubscription_t sub;
-
- sub.zsub_class = "message";
- sub.zsub_classinst = "*";
- sub.zsub_recipient = ZGetSender();
-
- ZSubscribeToSansDefaults(&sub, 1, (unsigned short) 0);
-}
-
-int zeph_send_message(dest, msg)
- Dest dest;
- char *msg;
-{
- ZNotice_t notice;
- int msglen, siglen, ret;
- char *sig_msg;
-
- msglen = strlen(msg);
- siglen = strlen(defs.signature);
- sig_msg = (char *) Malloc(msglen + siglen + 2, "while sending message",
- NULL);
- sprintf(sig_msg, "%s%c%s", defs.signature, '\0', msg);
-
- (void) memset((char *) &notice, 0, sizeof(ZNotice_t));
- notice.z_kind = ACKED;
- notice.z_class = dest->zclass;
- notice.z_class_inst = dest->zinst;
- notice.z_recipient = dest->zrecip;
- notice.z_sender = 0;
- notice.z_opcode = defs.opcode;
- notice.z_port = 0;
- notice.z_message = sig_msg;
- notice.z_message_len = msglen + siglen + 1;
-
- /* This really gross looking mess is brought to you by zwrite.c */
- if (defs.auth) {
- if (*defs.signature)
- notice.z_default_format = "Class $class, Instance $instance:\nTo: @bold($recipient)\n@bold($1) <$sender>\n\n$2";
- else
- notice.z_default_format = "Class $class, Instance $instance:\nTo: @bold($recipient)\n$message";
- }
- else {
- if (*defs.signature)
- notice.z_default_format = "@bold(UNAUTHENTIC) Class $class, Instance $instance:\n@bold($1) <$sender>\n\n$2";
- else
- notice.z_default_format = "@bold(UNAUTHENTIC) Class $class, Instance $instance:\n$message";
- }
-
- ret = zeph_send_notice(&notice, (defs.auth) ? ZAUTH : ZNOAUTH);
- free(sig_msg);
- return ret;
-}
-
-int zeph_ping(dest)
- Dest dest;
-{
- ZNotice_t notice;
-
- (void) memset((char *) &notice, 0, sizeof(ZNotice_t));
- notice.z_kind = ACKED;
- notice.z_class = dest->zclass;
- notice.z_class_inst = dest->zinst;
- notice.z_recipient = dest->zrecip;
- notice.z_opcode = "PING";
-
- /* Should a PING ever be authenticated? */
- return (zeph_send_notice(&notice, ZNOAUTH));
-}
-
-int zeph_pong(dest)
- Dest dest;
-{
- ZNotice_t notice;
-
- (void) memset((char *) &notice, 0, sizeof(ZNotice_t));
- notice.z_kind = ACKED;
- notice.z_class = dest->zclass;
- notice.z_class_inst = dest->zinst;
- notice.z_recipient = dest->zrecip;
- notice.z_opcode = "PING";
- notice.z_message = "PONG";
- notice.z_message_len = 4;
-
- /* Should a PING ever be authenticated? */
- return (zeph_send_notice(&notice, ZNOAUTH));
-}
-
-char *zeph_get_signature()
-{
- char *sig;
-
- sig = ZGetVariable("xzwrite-signature");
- if (! sig) sig = ZGetVariable("zwrite-signature");
- return sig;
-}
-
-static int zeph_send_notice(notice, auth)
- ZNotice_t *notice;
- int (*auth)();
-{
- int retval;
- ZNotice_t retnotice;
-
- /* Send message with appropriate authentication */
- retval = ZSendNotice(notice, auth);
- if (retval != ZERR_NONE) {
- if (defs.debug)
- Warning(error_message(retval), " while sending message.", NULL);
- return SENDFAIL_SEND;
- }
-
- /* Wait for server acknowledgement */
- retval = ZIfNotice(&retnotice, (struct sockaddr_in *) 0,
- ZCompareUIDPred, (char *) &notice->z_uid);
-
- if (retval != ZERR_NONE) {
- if (defs.debug)
- Warning(error_message(retval),
- " while waiting for acknowledgement.", NULL);
- return SENDFAIL_ACK;
- }
-
- /* Make sure someone receives it */
- if (strcmp(retnotice.z_message, ZSRVACK_NOTSENT)==0)
- return SENDFAIL_RECV;
-
- return SEND_OK;
-}
-
-#ifdef DEBUG
-/* debugging function */
-void zeph_display_subscriptions()
-{
- ZSubscription_t sub;
- int n, retval, i = 1;
-
- retval = ZRetrieveSubscriptions((unsigned short) 0, &n);
- if (retval != ZERR_NONE) {
- Warning(error_message(retval), " while retrieving subscriptions.",
- NULL);
- return;
- }
-
- printf("Retrieving %d subscriptions.\n", n);
-
- while (ZGetSubscriptions(&sub, &i) == ZERR_NONE) {
- if (i != 1)
- Warning("Subscriptions skipped while printing.", NULL);
-
- printf("<%s,%s,%s>\n", sub.class, (*sub.zsub_classinst) ?
- sub.zsub_classinst : "**", (*sub.zsub_recipient) ?
- sub.zsub_recipient : "**");
- }
-}
-#endif
diff --git a/clients/zaway/Imakefile b/clients/zaway/Imakefile
deleted file mode 100644
index aabe953..0000000
--- a/clients/zaway/Imakefile
+++ /dev/null
@@ -1,15 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Header$
-/**/#
-
-SRCS = zaway.c
-OBJS = zaway.o
-
-zprogram(zaway,)
-install_man(zaway.1,zaway.1)
diff --git a/clients/zaway/Makefile.in b/clients/zaway/Makefile.in
new file mode 100644
index 0000000..64db77d
--- /dev/null
+++ b/clients/zaway/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zaway.o
+
+all: zaway
+
+zaway: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zaway
+ ${INSTALL} -m 755 -s zaway ${bindir}
+ ${INSTALL} -m 644 ${srcdir}/zaway.1 ${mandir}/man1
+
+clean:
+ rm -f ${OBJS} zaway
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zaway/zaway.c b/clients/zaway/zaway.c
index 8da42c9..5dfdc8d 100644
--- a/clients/zaway/zaway.c
+++ b/clients/zaway/zaway.c
@@ -11,34 +11,23 @@
* "mit-copyright.h".
*/
+#include <sysdep.h>
#include <zephyr/mit-copyright.h>
-
#include <zephyr/zephyr.h>
-
#include <pwd.h>
-#include <string.h>
-#include <signal.h>
+#include <com_err.h>
#ifndef lint
-static char rcsid_zaway_c[] = "$Id$";
+static const char rcsid_zaway_c[] = "$Id$";
#endif
#define MESSAGE_CLASS "MESSAGE"
#define DEFAULT_MSG "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n"
-#ifdef POSIX
-#include <stdlib.h>
-#define SIGNAL_RETURN_TYPE void
-#else
-extern char *getenv(), *malloc(), *realloc();
-extern uid_t getuid();
-#define SIGNAL_RETURN_TYPE int
-#endif
-
-SIGNAL_RETURN_TYPE cleanup();
+RETSIGTYPE cleanup();
u_short port;
-main(argc,argv)
+int main(argc,argv)
int argc;
char *argv[];
{
@@ -50,7 +39,7 @@ main(argc,argv)
register char *ptr;
char awayfile[BUFSIZ],*msg[2],*envptr;
char *find_message();
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct sigaction sa;
#endif
@@ -89,7 +78,7 @@ main(argc,argv)
fprintf(stderr,"File %s not found!\n",awayfile);
exit(1);
}
-#ifdef POSIX
+#ifdef _POSIX_VERSION
(void) sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sa.sa_handler = cleanup;
@@ -101,7 +90,7 @@ main(argc,argv)
(void) signal(SIGTERM, cleanup);
(void) signal(SIGHUP, cleanup);
#endif
- if ((retval = ZSubscribeTo(&sub,1,port)) != ZERR_NONE) {
+ if ((retval = ZSubscribeToSansDefaults(&sub,1,port)) != ZERR_NONE) {
com_err(argv[0],retval,"while subscribing");
exit(1);
}
@@ -199,7 +188,7 @@ char *find_message(notice,fp)
return (ptr);
}
-SIGNAL_RETURN_TYPE cleanup()
+RETSIGTYPE cleanup()
{
ZCancelSubscriptions(port);
exit(1);
diff --git a/clients/zctl/Imakefile b/clients/zctl/Imakefile
deleted file mode 100644
index 69418d6..0000000
--- a/clients/zctl/Imakefile
+++ /dev/null
@@ -1,16 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-SRCS = zctl.c zctl_cmds.c
-OBJS = zctl.o zctl_cmds.o
-
-cmd_table(zctl_cmds)
-zprogram(zctl,$(LIB_SS))
-install_man(zctl.1,zctl.1)
diff --git a/clients/zctl/Makefile.in b/clients/zctl/Makefile.in
new file mode 100644
index 0000000..c9fb8d0
--- /dev/null
+++ b/clients/zctl/Makefile.in
@@ -0,0 +1,61 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+MK_CMDS=@MK_CMDS@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @X_CFLAGS@ @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @SS_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr -lss @LIBS@ -lcom_err
+
+OBJS= zctl.o zctl_cmds.o
+
+all: zctl
+
+zctl: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@ @SSDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+# The Athena mk_cmds insists on writing output to source directory. Bleah.
+# After the patch to fix it goes into an Athena release, replace it with:
+# ${MK_CMDS} ${srcdir}/zctl_cmds.ct
+zctl_cmds.c: zctl_cmds.ct
+ cp ${srcdir}/zctl_cmds.ct /tmp/zctl_cmds.$$$$.ct; \
+ ${MK_CMDS} /tmp/zctl_cmds.$$$$.ct; \
+ if [ -f /tmp/zctl_cmds.$$$$.c ]; then \
+ mv /tmp/zctl_cmds.$$$$.c zctl_cmds.c; \
+ else \
+ mv zctl_cmds.$$$$.c zctl_cmds.c; \
+ fi; \
+ rm -f /tmp/zctl_cmds.$$$$.ct
+
+check:
+
+install: zctl
+ ${INSTALL} -m 755 -s zctl ${DESTDIR}${bindir}
+ ${INSTALL} -m 644 ${srcdir}/zctl.1 ${DESTDIR}${mandir}/man1
+
+clean:
+ rm -f ${OBJS} zctl_cmds.c zctl
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zctl/zctl.1 b/clients/zctl/zctl.1
index 4608dab..6b6e4c0 100644
--- a/clients/zctl/zctl.1
+++ b/clients/zctl/zctl.1
@@ -153,6 +153,11 @@ Delete the definitions of the specified Zephyr variables.
Unsubscribe to \fIclass, instance, recipient\fR, but don't remove this triplet
from the subscriptions file.
.TP
+.B wg_exit
+Tell the WindowGram client,
+.I zwgc(1),
+to exit.
+.TP
.B wg_read
Tell the WindowGram client,
.I zwgc(1),
@@ -269,10 +274,6 @@ Save all current subscriptions to the default subscriptions file.
.TP
.B zctl set exposure none
Set your exposure level to `none', effectively turning off Zephyr.
-.SH BUGS
-The current implementation of the Zephyr server (\fIzephyrd(8)\fR) makes
-no distinction between realm-announced, net-visible and net-announced
-exposure levels.
.SH SEE ALSO
zephyr(1), zwgc(1), zhm(8), zephyrd(8)
gethostbyname(3)
diff --git a/clients/zctl/zctl.c b/clients/zctl/zctl.c
index 3516680..e8aa1cb 100644
--- a/clients/zctl/zctl.c
+++ b/clients/zctl/zctl.c
@@ -11,19 +11,14 @@
* "mit-copyright.h".
*/
+#include <sysdep.h>
#include <zephyr/zephyr.h>
#include <ss/ss.h>
#include <com_err.h>
#include <pwd.h>
#include <netdb.h>
-#include <string.h>
-#include <sys/file.h>
-#include <sys/param.h>
-#ifdef POSIX
-#include <sys/utsname.h>
-#endif
#ifndef lint
-static char *rcsid_zctl_c = "$Id$";
+static const char *rcsid_zctl_c = "$Id$";
#endif
#define SUBSATONCE 7
@@ -60,9 +55,9 @@ main(argc,argv)
{
struct passwd *pwd;
struct hostent *hent;
- char ssline[BUFSIZ],oldsubsname[BUFSIZ],*envptr;
+ char ssline[BUFSIZ],oldsubsname[BUFSIZ],*envptr,*tty = NULL;
int retval,code,i;
-#ifdef POSIX
+#ifdef HAVE_SYS_UTSNAME
struct utsname name;
#endif
@@ -71,20 +66,28 @@ main(argc,argv)
exit (1);
}
- envptr = (char *)getenv("HOME");
+ /* Set hostname and tty for locations. If we support X, use the
+ * DISPLAY environment variable for the tty name. */
+#ifndef X_DISPLAY_MISSING
+ tty = getenv("DISPLAY");
+#endif
+ if ((retval = ZInitLocationInfo(NULL, tty)) != ZERR_NONE)
+ com_err(argv[0], retval, "initializing location information");
+
+ envptr = getenv("HOME");
if (envptr)
- (void) strcpy(subsname,envptr);
+ strcpy(subsname,envptr);
else {
if (!(pwd = getpwuid((int) getuid()))) {
fprintf(stderr,"Who are you?\n");
exit (1);
}
- (void) strcpy(subsname,pwd->pw_dir);
+ strcpy(subsname,pwd->pw_dir);
}
- (void) strcpy(oldsubsname,subsname);
- (void) strcat(oldsubsname,OLD_SUBS);
- (void) strcat(subsname,USERS_SUBS);
+ strcpy(oldsubsname,subsname);
+ strcat(oldsubsname,OLD_SUBS);
+ strcat(subsname,USERS_SUBS);
if (!access(oldsubsname,F_OK) && access(subsname, F_OK)) {
/* only if old one exists and new one does not exist */
printf("The .subscriptions file in your home directory is now being used as\n.zephyr.subs . I will rename it to .zephyr.subs for you.\n");
@@ -92,7 +95,7 @@ main(argc,argv)
com_err(argv[0], errno, "renaming .subscriptions");
}
-#ifdef POSIX
+#ifdef HAVE_SYS_UTSNAME
uname(&name);
strcpy(ourhost, name.nodename);
#else
@@ -205,6 +208,8 @@ wgc_control(argc,argv)
notice.z_opcode = USER_SHUTDOWN;
if (!strcmp(argv[0],"wg_startup"))
notice.z_opcode = USER_STARTUP;
+ if (!strcmp(argv[0],"wg_exit"))
+ notice.z_opcode = USER_EXIT;
if (!notice.z_opcode) {
fprintf(stderr,
"unknown WindowGram client control command %s\n",
@@ -371,10 +376,15 @@ do_hide(argc,argv)
fprintf(stderr, "Usage: %s\n",argv[0]);
return;
}
- if (!strcmp(argv[0],"unhide"))
- exp_level = EXPOSE_REALMVIS;
- else
+ if (!strcmp(argv[0],"unhide")) {
+ exp_level = ZGetVariable("exposure");
+ if (exp_level)
+ exp_level = ZParseExposureLevel(exp_level);
+ if (!exp_level)
+ exp_level = EXPOSE_NONE;
+ } else {
exp_level = EXPOSE_OPSTAFF;
+ }
if ((retval = ZSetLocation(exp_level)) != ZERR_NONE)
ss_perror(sci_idx,retval,"while changing exposure status");
return;
@@ -473,8 +483,7 @@ sub_file(argc,argv)
}
sub.zsub_class = argv[1];
sub.zsub_classinst = argv[2];
- sub.zsub_recipient = (argc == 3)?TOKEN_ME:TOKEN_WILD;
-
+ sub.zsub_recipient = (argc == 3)?TOKEN_ME:argv[3];
if (make_exist(subsname))
return;
diff --git a/clients/zctl/zctl_cmds.ct b/clients/zctl/zctl_cmds.ct
index fe39283..363ca66 100644
--- a/clients/zctl/zctl_cmds.ct
+++ b/clients/zctl/zctl_cmds.ct
@@ -63,6 +63,9 @@
request wgc_control, "Tell the WindowGram to react to incoming notices.",
wg_startup;
+ request wgc_control, "Tell the WindowGram to exit completely.",
+ wg_exit;
+
request hm_control, "Tell the server to flush information about this host.",
hm_flush;
diff --git a/clients/zleave/Imakefile b/clients/zleave/Imakefile
deleted file mode 100644
index aae9ed2..0000000
--- a/clients/zleave/Imakefile
+++ /dev/null
@@ -1,15 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-SRCS = zleave.c
-OBJS = zleave.o
-
-zprogram(zleave,)
-install_man(zleave.1,zleave.1)
diff --git a/clients/zleave/Makefile.in b/clients/zleave/Makefile.in
new file mode 100644
index 0000000..367ce8d
--- /dev/null
+++ b/clients/zleave/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zleave.o
+
+all: zleave
+
+zleave: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zleave
+ ${INSTALL} -m 755 -s zleave ${DESTDIR}${bindir}
+ ${INSTALL} -m 644 ${srcdir}/zleave.1 ${DESTDIR}${mandir}/man1
+
+clean:
+ rm -f ${OBJS} zleave
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zleave/zleave.c b/clients/zleave/zleave.c
index 778f3e2..2484f6a 100644
--- a/clients/zleave/zleave.c
+++ b/clients/zleave/zleave.c
@@ -11,8 +11,8 @@
* "mit-copyright.h".
*/
+#include <sysdep.h>
#include <zephyr/mit-copyright.h>
-
#include <zephyr/zephyr.h>
#ifndef lint
@@ -37,15 +37,6 @@ char copyright[] =
All rights reserved.\n";
#endif /* not lint */
-#ifndef lint
-static char sccsid[] = "@(#)leave.c 5.2 (Berkeley) 12/2/87";
-#endif /* not lint */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include <string.h>
-
#define MESSAGE_CLASS "MESSAGE"
#define INSTANCE "LEAVE"
/*
@@ -69,7 +60,8 @@ int use_zephyr=1, oldpid;
main(argc, argv)
char **argv;
{
- long when, now, diff, hours, minutes;
+ time_t now;
+ long when, diff, hours, minutes;
char *cp;
FILE *fp;
struct tm *nv;
@@ -93,7 +85,8 @@ char **argv;
sub.zsub_class = MESSAGE_CLASS;
sub.zsub_classinst = INSTANCE;
sub.zsub_recipient = ZGetSender();
- if (ZSubscribeTo(&sub,1,(u_short)port) != ZERR_NONE) {
+ if (ZSubscribeToSansDefaults(&sub,1,(u_short)port)
+ != ZERR_NONE) {
fprintf(stderr,
"Subscription error! Writing to your terminal...\n");
use_zephyr = 0;
@@ -212,13 +205,13 @@ int *hp, *mp;
doalarm(nmins)
long nmins;
{
+ time_t daytime;
char *msg1, *msg2, *msg3, *msg4;
register int i;
long slp1, slp2, slp3, slp4;
long seconds, gseconds;
- long daytime;
FILE *fp;
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct sigaction sa;
#endif
@@ -282,7 +275,7 @@ long nmins;
(void) perror("fclose on pid file");
}
-#ifdef POSIX
+#ifdef _POSIX_VERSION
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sa.sa_handler = SIG_IGN;
@@ -407,7 +400,7 @@ long secs;
}
}
-#ifdef V6
+#ifndef HAVE_GETLOGIN
char *getlogin() {
#include <utmp.h>
diff --git a/clients/zlocate/Imakefile b/clients/zlocate/Imakefile
deleted file mode 100644
index 291d74a..0000000
--- a/clients/zlocate/Imakefile
+++ /dev/null
@@ -1,15 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Header$
-/**/#
-
-SRCS = zlocate.c
-OBJS = zlocate.o
-
-zprogram(zlocate,)
-install_man(zlocate.1,zlocate.1)
diff --git a/clients/zlocate/Makefile.in b/clients/zlocate/Makefile.in
new file mode 100644
index 0000000..403578d
--- /dev/null
+++ b/clients/zlocate/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-g
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zlocate.o
+
+all: zlocate
+
+zlocate: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zlocate
+ ${INSTALL} -m 755 -s zlocate ${DESTDIR}${bindir}
+ ${INSTALL} -m 644 ${srcdir}/zlocate.1 ${DESTDIR}${mandir}/man1
+
+clean:
+ rm -f ${OBJS} zlocate
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zlocate/zlocate.c b/clients/zlocate/zlocate.c
index c117cb6..6167896 100644
--- a/clients/zlocate/zlocate.c
+++ b/clients/zlocate/zlocate.c
@@ -11,21 +11,18 @@
* "mit-copyright.h".
*/
-#include <zephyr/zephyr_internal.h>
-#include <signal.h>
+#include <sysdep.h>
+#include <zephyr/zephyr.h>
#include <sys/socket.h>
#if !defined(lint) && !defined(SABER)
-static char rcsid_zlocate_c[] = "$Id$";
+static const char rcsid_zlocate_c[] = "$Id$";
#endif
int numusers=0, numleft=0, parallel=0, oneline=0;
char *whoami;
-#ifdef POSIX
-void
-#endif
-timeout(sig)
+RETSIGTYPE timeout(sig)
{
fprintf (stderr, "%s: no response from server\n", whoami);
exit(1);
@@ -75,9 +72,9 @@ main(argc,argv)
{
char user[BUFSIZ],*whichuser;
ZAsyncLocateData_t ald;
- int retval,i,numlocs,loc,auth;
+ int retval,i,numlocs,numfound,loc,auth;
ZNotice_t notice;
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct sigaction sa;
#endif
@@ -122,6 +119,7 @@ main(argc,argv)
}
numleft = numusers;
+ numfound = 0;
i = 0;
for (loc = 0; loc < argc; loc++) {
@@ -145,11 +143,12 @@ main(argc,argv)
exit(1);
}
print_locs(user,numlocs);
+ numfound += numlocs;
}
}
if (parallel) {
-#ifdef POSIX
+#ifdef _POSIX_VERSION
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sa.sa_handler = timeout;
@@ -171,9 +170,10 @@ main(argc,argv)
if (numlocs >= 0) {
print_locs(whichuser,numlocs);
free(whichuser);
+ numfound += numlocs;
}
ZFreeNotice(&notice);
}
}
- return(0);
+ return((numfound > 0) ? 0 : 1);
}
diff --git a/clients/zmailnotify/Imakefile b/clients/zmailnotify/Imakefile
deleted file mode 100644
index eba7346..0000000
--- a/clients/zmailnotify/Imakefile
+++ /dev/null
@@ -1,19 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-#if defined(KERBEROS)
-XDEFS= -DKPOP
-
-SRCS = zmailnotify.c
-OBJS = zmailnotify.o
-
-zprogram(zmailnotify,)
-install_man(zmailnotify.1,zmailnotify.1)
-#endif
diff --git a/clients/zmailnotify/Makefile.in b/clients/zmailnotify/Makefile.in
new file mode 100644
index 0000000..a742bc9
--- /dev/null
+++ b/clients/zmailnotify/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h -DKPOP @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zmailnotify.o
+
+all: zmailnotify
+
+zmailnotify: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zmailnotify
+ ${INSTALL} -m 755 -s zmailnotify ${DESTDIR}${sbindir}
+ ${INSTALL} -m 644 ${srcdir}/zmailnotify.1 ${DESTDIR}${mandir}/man1
+
+clean:
+ rm -f ${OBJS} zmailnotify
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zmailnotify/zmailnotify.c b/clients/zmailnotify/zmailnotify.c
index 7c5a746..f6575e7 100644
--- a/clients/zmailnotify/zmailnotify.c
+++ b/clients/zmailnotify/zmailnotify.c
@@ -10,25 +10,25 @@
* "mit-copyright.h".
*/
+#include <sysdep.h>
#include <zephyr/mit-copyright.h>
#include <zephyr/zephyr.h>
#ifndef lint
-static char rcsid_zmailnotify_c[] =
+static const char rcsid_zmailnotify_c[] =
"$Id$";
#endif
-#include <sys/uio.h>
#include <sys/socket.h>
-#include <sys/file.h>
-#include <fcntl.h>
#include <pwd.h>
-#include <errno.h>
#include <netdb.h>
-#ifdef Z_HaveHesiod
+#ifdef ZEPHYR_USES_HESIOD
#include <hesiod.h>
#endif
-#include <string.h>
+
+#ifndef ZEPHYR_USES_KERBEROS
+#undef KPOP
+#endif
#ifdef KPOP
#include <krb.h>
@@ -47,6 +47,7 @@ char *PrincipalHostname();
#endif
void get_message(), pop_close(), mail_notify(), fatal_pop_err ();
+int pop_command __P((char *, ...));
#define MAXMAIL 4
struct _mail {
@@ -71,7 +72,7 @@ main(argc, argv)
int i,nbytes,retval,uselock;
struct passwd *pwd;
struct _mail mymail;
-#ifdef Z_HaveHesiod
+#ifdef ZEPHYR_USES_HESIOD
struct hes_postoffice *p;
#endif
@@ -103,7 +104,7 @@ main(argc, argv)
(void) sprintf(lockfile,"%s/.maillock",dir);
host = (char *)getenv("MAILHOST");
-#ifdef Z_HaveHesiod
+#ifdef ZEPHYR_USES_HESIOD
if (host == NULL) {
p = hes_getmailhost(user);
if (p != NULL && strcmp(p->po_type, "POP") == 0)
@@ -122,7 +123,7 @@ main(argc, argv)
}
lock = fopen(lockfile,"r+");
-#ifdef POSIX
+#ifdef _POSIX_VERSION
if (lock) {
struct flock fl;
@@ -163,7 +164,7 @@ main(argc, argv)
if (!nmsgs) {
if (lock) {
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct flock fl;
/* unlock the whole file */
@@ -204,7 +205,7 @@ main(argc, argv)
}
else {
lock = fopen(lockfile,"w");
-#ifdef POSIX
+#ifdef _POSIX_VERSION
if (lock) {
struct flock fl;
@@ -241,7 +242,7 @@ main(argc, argv)
mail_notify(&maillist[nmsgs-i]);
i--;
if (lock) {
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct flock fl;
/* unlock the whole file */
@@ -395,7 +396,6 @@ char *host;
long authopts;
char *host_save;
#endif
- char *get_errmsg();
char *svc_name;
hp = gethostbyname(host);
@@ -429,12 +429,12 @@ char *host;
s = rresvport(&lport);
#endif
if (s < 0) {
- (void) sprintf(Errmsg, "error creating socket: %s", get_errmsg());
+ (void) sprintf(Errmsg, "error creating socket: %s", strerror(errno));
return(NOTOK);
}
if (connect(s, (struct sockaddr *)&sin, sizeof sin) < 0) {
- (void) sprintf(Errmsg, "error during connect: %s", get_errmsg());
+ (void) sprintf(Errmsg, "error during connect: %s", strerror(errno));
(void) close(s);
return(NOTOK);
}
@@ -445,7 +445,7 @@ char *host;
authopts = KOPT_DO_OLDSTYLE;
rem = krb_sendsvc(s,"pop");
if (rem != KSUCCESS) {
- (void) sprintf(Errmsg, "kerberos error: %s", krb_err_txt[rem]);
+ (void) sprintf(Errmsg, "kerberos error: %s", krb_get_err_text(rem));
(void) close(s);
return(NOTOK);
}
@@ -465,7 +465,7 @@ char *host;
free(host_save);
free(ticket);
if (rem != KSUCCESS) {
- (void) sprintf(Errmsg, "kerberos error: %s",krb_err_txt[rem]);
+ (void) sprintf(Errmsg, "kerberos error: %s",krb_get_err_text(rem));
(void) close(s);
return(NOTOK);
}
@@ -474,7 +474,7 @@ char *host;
sfi = fdopen(s, "r");
sfo = fdopen(s, "w");
if (sfi == NULL || sfo == NULL) {
- (void) sprintf(Errmsg, "error in fdopen: %s", get_errmsg());
+ (void) sprintf(Errmsg, "error in fdopen: %s", strerror(errno));
(void) close(s);
return(NOTOK);
}
@@ -482,13 +482,19 @@ char *host;
return(OK);
}
-/*VARARGS1*/
-pop_command(fmt, a, b, c, d)
-char *fmt;
+#ifdef __STDC__
+pop_command(char *fmt, ...)
+#else
+pop_command(fmt, va_alist)
+ va_dcl
+#endif
{
+ va_list args;
char buf[4096];
- (void) sprintf(buf, fmt, a, b, c, d);
+ VA_START(args, fmt);
+ (void) vsprintf(buf, fmt, args);
+ va_end(args);
if (putline(buf, Errmsg, sfo) == NOTOK) return(NOTOK);
@@ -606,20 +612,6 @@ FILE *f;
return(OK);
}
-char *
-get_errmsg()
-{
- extern int errno, sys_nerr;
- extern char *sys_errlist[];
- char *s;
-
- if (errno < sys_nerr)
- s = sys_errlist[errno];
- else
- s = "unknown error";
- return(s);
-}
-
putline(buf, err, f)
char *buf;
char *err;
diff --git a/clients/znol/Imakefile b/clients/znol/Imakefile
deleted file mode 100644
index 40e3833..0000000
--- a/clients/znol/Imakefile
+++ /dev/null
@@ -1,15 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-SRCS = znol.c
-OBJS = znol.o
-
-zprogram(znol,)
-install_man(znol.1,znol.1)
diff --git a/clients/znol/Makefile.in b/clients/znol/Makefile.in
new file mode 100644
index 0000000..597ab3f
--- /dev/null
+++ b/clients/znol/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= znol.o
+
+all: znol
+
+znol: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: znol
+ ${INSTALL} -m 755 -s znol ${DESTDIR}${bindir}
+ ${INSTALL} -m 644 ${srcdir}/znol.1 ${DESTDIR}${mandir}/man1
+
+clean:
+ rm -f ${OBJS} znol
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/znol/znol.c b/clients/znol/znol.c
index 9bc6764..fe29055 100644
--- a/clients/znol/znol.c
+++ b/clients/znol/znol.c
@@ -11,13 +11,13 @@
* "mit-copyright.h".
*/
+#include <sysdep.h>
#include <zephyr/zephyr.h>
#include <pwd.h>
-#include <string.h>
#ifndef lint
-static char rcsid_znol_c[] = "$Id$";
+static const char rcsid_znol_c[] = "$Id$";
#endif
#define SUBSATONCE 7
@@ -142,9 +142,8 @@ main(argc,argv)
*comment_ptr = '\0'; /* Ignore from # onwards */
/* Get rid of old-style nol entries, just in case */
cp = cleanname + strlen(cleanname) - 1;
- if (*cp == '\n')
- *cp = '\0';
- while (*--cp == ' ')
+ *cp = '\0';
+ while(*--cp == ' ')
*cp = '\0';
if (*cleanname == '@' || !*cleanname)
continue;
diff --git a/clients/zpopnotify/Imakefile b/clients/zpopnotify/Imakefile
deleted file mode 100644
index d0f4439..0000000
--- a/clients/zpopnotify/Imakefile
+++ /dev/null
@@ -1,13 +0,0 @@
-/**/# Copyright 1988, 1993 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Id$
-
-SRCS = zpopnotify.c
-OBJS = zpopnotify.o
-
-SimpleProgram(zpopnotify,$(OBJS) $(ZLIB),$(ZLIBS),$(ATHETCDIR))
-install_man(zpopnotify.8,zpopnotify.8)
-create_depend($(SRCS))
diff --git a/clients/zpopnotify/Makefile.in b/clients/zpopnotify/Makefile.in
new file mode 100644
index 0000000..ca38dd7
--- /dev/null
+++ b/clients/zpopnotify/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zpopnotify.o
+
+all: zpopnotify
+
+zpopnotify: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zpopnotify
+ ${INSTALL} -m 755 -s zpopnotify ${DESTDIR}${sbindir}
+ ${INSTALL} -m 644 ${srcdir}/zpopnotify.8 ${DESTDIR}${mandir}/man8
+
+clean:
+ rm -f ${OBJS} zpopnotify
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zpopnotify/zpopnotify.c b/clients/zpopnotify/zpopnotify.c
index ee298ad..ba4e376 100644
--- a/clients/zpopnotify/zpopnotify.c
+++ b/clients/zpopnotify/zpopnotify.c
@@ -11,13 +11,16 @@
* "mit-copyright.h".
*/
-#include <zephyr/mit-copyright.h>
+#include <sysdep.h>
+#include <zephyr/mit-copyright.h>
#include <zephyr/zephyr.h>
+#include <stdio.h>
#include <netdb.h>
#include <string.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <com_err.h>
+#include <errno.h>
#ifndef lint
static char rcsid_zpopnotify_c[] = "$Header$";
diff --git a/clients/zshutdown_notify/Imakefile b/clients/zshutdown_notify/Imakefile
deleted file mode 100644
index 9dc7ace..0000000
--- a/clients/zshutdown_notify/Imakefile
+++ /dev/null
@@ -1,16 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-SRCS = zshutdown_notify.c
-OBJS = zshutdown_notify.o
-
-SimpleProgram(zshutdown_notify,$(OBJS) $(ZLIB),$(ZLIBS),$(ATHRETCDIR))
-install_man(zshutdown_notify.8,zshutdown_notify.8)
-create_depend($(SRCS))
diff --git a/clients/zshutdown_notify/Makefile.in b/clients/zshutdown_notify/Makefile.in
new file mode 100644
index 0000000..0fb5922
--- /dev/null
+++ b/clients/zshutdown_notify/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zshutdown_notify.o
+
+all: zshutdown_notify
+
+zshutdown_notify: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zshutdown_notify
+ ${INSTALL} -m 755 -s zshutdown_notify ${DESTDIR}${lsbindir}
+ ${INSTALL} -m 644 ${srcdir}/zshutdown_notify.8 ${DESTDIR}${mandir}/man8
+
+clean:
+ rm -f ${OBJS} zshutdown_notify
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zshutdown_notify/zshutdown_notify.c b/clients/zshutdown_notify/zshutdown_notify.c
index 99a3fce..e7727e6 100644
--- a/clients/zshutdown_notify/zshutdown_notify.c
+++ b/clients/zshutdown_notify/zshutdown_notify.c
@@ -11,17 +11,15 @@
* "mit-copyright.h".
*/
+#include <sysdep.h>
#include <zephyr/mit-copyright.h>
#include <zephyr/zephyr.h>
-#include <sys/param.h>
#include <sys/socket.h>
#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
#ifndef lint
-static char *rcsid_zshutdown_notify_c =
+static const char *rcsid_zshutdown_notify_c =
"$Id$";
#endif
@@ -31,7 +29,7 @@ static char *rcsid_zshutdown_notify_c =
#define N_DEF_FORMAT "From $sender:\n@bold(Shutdown message from $1 at $time)\n@center(System going down, message is:)\n\n$2\n\n@center(@bold($3))"
#define N_FIELD_CNT 3
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
#define SVC_NAME "rcmd"
#endif
@@ -54,7 +52,7 @@ main(argc,argv)
char msgbuff[BUFSIZ], message[Z_MAXPKTLEN], *ptr;
char scratch[BUFSIZ];
char *msg[N_FIELD_CNT];
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
char tkt_filename[MAXPATHLEN];
char rlm[REALM_SZ];
char hn2[MAXHOSTNAMELEN];
@@ -75,7 +73,7 @@ main(argc,argv)
sprintf(scratch, warning, hostname);
msg[2] = scratch;
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
(void) sprintf(tkt_filename, "/tmp/tkt_zshut_%d", getpid());
krb_set_tkt_string(tkt_filename);
@@ -88,14 +86,14 @@ main(argc,argv)
}
if (retval = krb_get_lrealm(rlm, 1)) {
fprintf(stderr, "%s: can't get local realm: %s\n",
- argv[0], krb_err_txt[retval]);
+ argv[0], krb_get_err_text(retval));
exit(1);
}
if (retval = krb_get_svc_in_tkt(SVC_NAME, hn2, rlm,
SERVER_SERVICE, SERVER_INSTANCE, 1,
KEYFILE)) {
fprintf(stderr, "%s: can't get tickets: %s\n",
- argv[0], krb_err_txt[retval]);
+ argv[0], krb_get_err_text(retval));
exit(1);
}
#endif
@@ -130,7 +128,7 @@ main(argc,argv)
notice.z_default_format = N_DEF_FORMAT;
retval = ZSendList(&notice, msg, N_FIELD_CNT, ZAUTH);
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
(void) dest_tkt();
#endif
diff --git a/clients/zstat/Imakefile b/clients/zstat/Imakefile
deleted file mode 100644
index 9ffd2ac..0000000
--- a/clients/zstat/Imakefile
+++ /dev/null
@@ -1,15 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-SRCS = zstat.c
-OBJS = zstat.o
-
-zprogram(zstat,)
-install_man(zstat.8,zstat.8)
diff --git a/clients/zstat/Makefile.in b/clients/zstat/Makefile.in
new file mode 100644
index 0000000..11b2f92
--- /dev/null
+++ b/clients/zstat/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zstat.o
+
+all: zstat
+
+zstat: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zstat
+ ${INSTALL} -m 755 -s zstat ${DESTDIR}${bindir}
+ ${INSTALL} -m 644 ${srcdir}/zstat.8 ${DESTDIR}${mandir}/man8
+
+clean:
+ rm -f ${OBJS} zstat
+
+${OBJS}: zserver.h ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zstat/zserver.h b/clients/zstat/zserver.h
index 9528840..467b41f 100644
--- a/clients/zstat/zserver.h
+++ b/clients/zstat/zserver.h
@@ -25,8 +25,4 @@
#define ADMIN_KILL_CLT "KILL_CLIENT" /* Opcode: client is dead, remove */
#define ADMIN_STATUS "STATUS" /* Opcode: please send status */
-#define ADMIN_LIMBO "LIMBO" /* Class inst: please send limbo info*/
-#define ADMIN_YOU "YOUR_STATE" /* Class inst: please send your state*/
-#define ADMIN_ME "MY_STATE" /* Class inst: please send my info */
-
#endif /* !__ZSERVER_H__ */
diff --git a/clients/zstat/zstat.c b/clients/zstat/zstat.c
index 10204b4..798baf0 100644
--- a/clients/zstat/zstat.c
+++ b/clients/zstat/zstat.c
@@ -11,58 +11,47 @@
* "mit-copyright.h".
*/
-#include <zephyr/zephyr.h>
-#include <sys/param.h>
+/* There should be library interfaces for the operations in zstat; for now,
+ * however, zstat is more or less internal to the Zephyr system. */
+#include <internal.h>
+
#include <sys/socket.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <string.h>
-#include <signal.h> /* BSD includes this from <sys/param.h>,
- but AIX does not. */
#include "zserver.h"
#if !defined(lint) && !defined(SABER)
-static char rcsid_zstat_c[] = "$Id$";
+static const char rcsid_zstat_c[] = "$Id$";
#endif
-#ifdef __STDC__
-const
-#endif
- char *hm_head[] = { "Current server =",
- "Items in queue:",
- "Client packets received:",
- "Server packets received:",
- "Server changes:",
- "Version:",
- "Looking for a new server:",
- "Time running:",
- "Size:",
- "Machine type:"
+const char *hm_head[] = {
+ "Current server =",
+ "Items in queue:",
+ "Client packets received:",
+ "Server packets received:",
+ "Server changes:",
+ "Version:",
+ "Looking for a new server:",
+ "Time running:",
+ "Size:",
+ "Machine type:"
};
#define HM_SIZE (sizeof(hm_head) / sizeof (char *))
-#ifdef __STDC__
-const
-#endif
- char *srv_head[] = {
- "Current server version =",
- "Packets handled:",
- "Uptime:",
- "Server states:",
+const char *srv_head[] = {
+ "Current server version =",
+ "Packets handled:",
+ "Uptime:",
+ "Server states:",
};
#define SRV_SIZE (sizeof(srv_head) / sizeof (char *))
int outoftime = 0;
-#if defined(ultrix) || defined(POSIX)
-void
-#endif
-timeout()
+RETSIGTYPE timeout()
{
outoftime = 1;
}
int serveronly = 0,hmonly = 0;
-u_short hm_port,srv_port;
+u_short srv_port;
main(argc, argv)
int argc;
@@ -105,19 +94,8 @@ main(argc, argv)
exit(1);
}
- if (!(sp = getservbyname(HM_SVCNAME,"udp"))) {
- fprintf(stderr,"%s/udp: unknown service\n", HM_SVCNAME);
- exit(-1);
- }
-
- hm_port = sp->s_port;
-
- if (!(sp = getservbyname(SERVER_SVCNAME,"udp"))) {
- fprintf(stderr,"%s/udp: unknown service\n",SERVER_SVCNAME);
- exit(-1);
- }
-
- srv_port = sp->s_port;
+ sp = getservbyname(SERVER_SVCNAME,"udp");
+ srv_port = (sp) ? sp->s_port : SERVER_SVC_FALLBACK;
if (optind == argc) {
if (gethostname(hostname, MAXHOSTNAMELEN) < 0) {
@@ -154,79 +132,34 @@ do_stat(host)
hm_stat(host,server)
char *host,*server;
{
+ struct in_addr inaddr;
+ Code_t code;
+
char *line[20],*mp;
int sock,i,nf,ret;
struct hostent *hp;
- struct sockaddr_in sin;
- long runtime;
+ time_t runtime;
struct tm *tim;
ZNotice_t notice;
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct sigaction sa;
#endif
- (void) memset((char *)&sin, 0, sizeof(struct sockaddr_in));
-
- sin.sin_port = hm_port;
-
- if ((sock = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
- perror("socket:");
- exit(-1);
- }
-
- sin.sin_family = AF_INET;
-
- if ((sin.sin_addr.s_addr = inet_addr(host)) == (unsigned)(-1)) {
+ if ((inaddr.s_addr = inet_addr(host)) == (unsigned)(-1)) {
if ((hp = gethostbyname(host)) == NULL) {
fprintf(stderr,"Unknown host: %s\n",host);
exit(-1);
}
- (void) memcpy((char *) &sin.sin_addr, hp->h_addr, hp->h_length);
+ (void) memcpy((char *) &inaddr, hp->h_addr, hp->h_length);
printf("Hostmanager stats: %s\n", hp->h_name);
} else {
printf("Hostmanager stats: %s\n", host);
}
- (void) memset((char *)&notice, 0, sizeof(notice));
- notice.z_kind = STAT;
- notice.z_port = 0;
- notice.z_class = HM_STAT_CLASS;
- notice.z_class_inst = HM_STAT_CLIENT;
- notice.z_opcode = HM_GIMMESTATS;
- notice.z_sender = "";
- notice.z_recipient = "";
- notice.z_default_format = "";
- notice.z_message_len = 0;
-
- if ((ret = ZSetDestAddr(&sin)) != ZERR_NONE) {
- com_err("zstat", ret, "setting destination");
- exit(-1);
- }
- if ((ret = ZSendNotice(&notice, ZNOAUTH)) != ZERR_NONE) {
- com_err("zstat", ret, "sending notice");
- exit(-1);
- }
-#ifdef POSIX
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = 0;
- sa.sa_handler = timeout;
- (void) sigaction(SIGALRM, &sa, (struct sigaction *)0);
-#else
- (void) signal(SIGALRM,timeout);
-#endif
- outoftime = 0;
- (void) alarm(10);
- if (((ret = ZReceiveNotice(&notice, (struct sockaddr_in *) 0))
- != ZERR_NONE) &&
- ret != EINTR) {
- com_err("zstat", ret, "receiving notice");
- return (1);
- }
- (void) alarm(0);
- if (outoftime) {
- fprintf(stderr,"No response after 10 seconds.\n");
- return (1);
+ if ((code = ZhmStat(&inaddr, &notice)) != ZERR_NONE) {
+ com_err("zstat", ret, "getting hostmanager status");
+ exit(-1);
}
mp = notice.z_message;
@@ -268,9 +201,9 @@ srv_stat(host)
struct hostent *hp;
struct sockaddr_in sin;
ZNotice_t notice;
- long runtime;
+ time_t runtime;
struct tm *tim;
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct sigaction sa;
#endif
@@ -317,7 +250,7 @@ srv_stat(host)
exit(-1);
}
-#ifdef POSIX
+#ifdef _POSIX_VERSION
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sa.sa_handler = timeout;
diff --git a/clients/zwrite/Imakefile b/clients/zwrite/Imakefile
deleted file mode 100644
index b07be96..0000000
--- a/clients/zwrite/Imakefile
+++ /dev/null
@@ -1,15 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Id$
-/**/#
-
-SRCS = zwrite.c
-OBJS = zwrite.o
-
-zprogram(zwrite,)
-install_man(zwrite.1,zwrite.1)
diff --git a/clients/zwrite/Makefile.in b/clients/zwrite/Makefile.in
new file mode 100644
index 0000000..9319c24
--- /dev/null
+++ b/clients/zwrite/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+bindir=${exec_prefix}/bin
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zwrite.o
+
+all: zwrite
+
+zwrite: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+check:
+
+install: zwrite
+ ${INSTALL} -m 755 -s zwrite ${DESTDIR}${bindir}
+ ${INSTALL} -m 644 ${srcdir}/zwrite.1 ${DESTDIR}${mandir}/man1
+
+clean:
+ rm -f ${OBJS} zwrite
+
+${OBJS}: ${top_srcdir}/h/sysdep.h ${BUILDTOP}/h/config.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr.h ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/clients/zwrite/zwrite.1 b/clients/zwrite/zwrite.1
index 4dfe47c..dac2954 100644
--- a/clients/zwrite/zwrite.1
+++ b/clients/zwrite/zwrite.1
@@ -164,6 +164,9 @@ and recipient "*".
.br
This argument may not be used in conjunction with the -f option.
.TP
+.B \-F \fIformat\fR
+Allows a user to specify a different default format for the message.
+.TP
.B \-O \fIopcode\fR
Allows a user to specify a different opcode for the message.
Some Zephyr notice display programs may use the opcode to decide how
diff --git a/clients/zwrite/zwrite.c b/clients/zwrite/zwrite.c
index 08d9a00..67badb3 100644
--- a/clients/zwrite/zwrite.c
+++ b/clients/zwrite/zwrite.c
@@ -11,16 +11,14 @@
* "mit-copyright.h".
*/
+#include <sysdep.h>
#include <zephyr/mit-copyright.h>
-
#include <zephyr/zephyr.h>
-#include <string.h>
#include <netdb.h>
#include <pwd.h>
-#include <ctype.h>
#ifndef lint
-static char rcsid_zwrite_c[] = "$Id$";
+static const char rcsid_zwrite_c[] = "$Id$";
#endif /* lint */
#define DEFAULT_CLASS "MESSAGE"
@@ -32,8 +30,8 @@ static char rcsid_zwrite_c[] = "$Id$";
#define MAXRECIPS 100
int nrecips, msgarg, verbose, quiet, nodot;
-char *whoami, *inst, *class, *opcode, *recips[MAXRECIPS];
-int (*auth)();
+char *whoami, *inst, *class, *opcode, *realm, *recips[MAXRECIPS];
+Z_AuthProc auth;
void un_tabify();
char *fix_filsrv_inst();
@@ -43,7 +41,7 @@ main(argc, argv)
char *argv[];
{
int retval, arg, nocheck, nchars, msgsize, filsys, tabexpand;
- char *message, *signature = NULL;
+ char *message, *signature = NULL, *format = NULL;
static char bfr[BUFSIZ], classbfr[BUFSIZ], instbfr[BUFSIZ], sigbfr[BUFSIZ];
static char opbfr[BUFSIZ];
static ZNotice_t notice;
@@ -166,6 +164,18 @@ main(argc, argv)
case 'l': /* literal */
nodot = 1;
break;
+ case 'F':
+ if (arg == argc-1)
+ usage(whoami);
+ arg++;
+ format = argv[arg];
+ break;
+ case 'r':
+ if (arg == argc-1)
+ usage(whoami);
+ arg++;
+ realm = argv[arg];
+ break;
default:
usage(whoami);
}
@@ -211,7 +221,9 @@ main(argc, argv)
notice.z_sender = 0;
notice.z_message_len = 0;
notice.z_recipient = "";
- if (filsys == 1)
+ if (format)
+ notice.z_default_format = format;
+ else if (filsys == 1)
notice.z_default_format = "@bold(Filesystem Operation Message for $instance:)\nFrom: @bold($sender) at $time $date\n$message";
else if (auth == ZAUTH) {
if (signature)
@@ -307,13 +319,18 @@ send_off(notice, real)
int real;
{
int i, success, retval;
- char bfr[BUFSIZ];
+ char bfr[BUFSIZ], realm_recip[BUFSIZ], *cp;
ZNotice_t retnotice;
success = 0;
for (i=0;i<nrecips || !nrecips;i++) {
- notice->z_recipient = nrecips?recips[i]:"";
+ if (realm) {
+ sprintf(realm_recip, "%s@%s", (nrecips) ? recips[i] : "", realm);
+ notice->z_recipient = realm_recip;
+ } else {
+ notice->z_recipient = (nrecips) ? recips[i] : "";
+ }
if (verbose && real)
printf("Sending %smessage, class %s, instance %s, to %s\n",
auth?"authenticated ":"",
@@ -362,23 +379,27 @@ send_off(notice, real)
}
} else if (!strcmp(retnotice.z_message, ZSRVACK_NOTSENT)) {
if (verbose && real && !quiet) {
- if (strcmp(class, DEFAULT_CLASS))
- printf("Not logged in or not subscribing to class %s, instance %s\n",
+ if (strcmp(class, DEFAULT_CLASS)) {
+ fprintf(stderr, "Not logged in or not subscribing to class %s, instance %s\n",
class, inst);
- else
- printf("Not logged in or not subscribing to messages\n");
+ } else {
+ fprintf(stderr,
+ "Not logged in or not subscribing to messages\n");
+ }
}
else if (!quiet) {
- if (!nrecips)
- printf("No one subscribing to class %s, instance %s\n",
- class, inst);
- else {
- if (strcmp(class, DEFAULT_CLASS))
- printf("%s: Not logged in or not subscribing to class %s, instance %s\n",
+ if (!nrecips) {
+ fprintf(stderr,
+ "No one subscribing to class %s, instance %s\n",
+ class, inst);
+ } else {
+ if (strcmp(class, DEFAULT_CLASS)) {
+ fprintf(stderr, "%s: Not logged in or not subscribing to class %s, instance %s\n",
notice->z_recipient, class, inst);
- else
- printf("%s: Not logged in or not subscribing to messages\n",
+ } else {
+ fprintf(stderr, "%s: Not logged in or not subscribing to messages\n",
notice->z_recipient);
+ }
}
}
}
@@ -398,7 +419,7 @@ usage(s)
fprintf(stderr,
"Usage: %s [-a] [-o] [-d] [-v] [-q] [-n] [-t] [-u] [-l]\n\
\t[-c class] [-i inst] [-O opcode] [-f fsname] [-s signature]\n\
-\t[user ...] [-m message]\n", s);
+\t[user ...] [-F format] [-r realm] [-m message]\n", s);
fprintf(stderr,"\t-f and -c are mutually exclusive\n\
\t-f and -i are mutually exclusive\n\
\trecipients must be specified unless -c or -f specifies a class\n\
diff --git a/util/autoconf/config.guess b/config.guess
index bc2cbcb..a3d6a9f 100755
--- a/util/autoconf/config.guess
+++ b/config.guess
@@ -1,6 +1,6 @@
-#!/bin/sh
+#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -59,6 +59,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
+ amiga:NetBSD:*:*)
+ echo m68k-cbm-netbsd${UNAME_RELEASE}
+ exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
@@ -79,6 +82,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
@@ -124,9 +132,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
- *:IRIX:*:*)
- echo mips-sgi-irix${UNAME_RELEASE}
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i[34]86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
@@ -170,6 +181,12 @@ EOF
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
@@ -264,7 +281,7 @@ EOF
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
- i[34]86:BSD/386:*:*)
+ i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
@@ -292,13 +309,13 @@ EOF
fi
exit 0 ;;
i[34]86:*:3.2:*)
- if /bin/uname -X 2>/dev/null >/dev/null ; then
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
- elif test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
else
echo ${UNAME_MACHINE}-unknown-sysv32
fi
@@ -306,6 +323,9 @@ EOF
Intel:Mach:3*:*)
echo i386-unknown-mach3
exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
@@ -365,7 +385,14 @@ main ()
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
- printf ("m68k-sony-newsos\n"); exit (0);
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
#endif
#endif
diff --git a/util/autoconf/config.sub b/config.sub
index bf932cb..5641cc1 100755
--- a/util/autoconf/config.sub
+++ b/config.sub
@@ -1,6 +1,6 @@
-#!/bin/sh
+#! /bin/sh
# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -42,6 +42,15 @@
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
+if [ x$1 = x ]
+then
+ echo Configuration name missing. 1>&2
+ echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+ echo "or $0 ALIAS" 1>&2
+ echo where ALIAS is a recognized configuration type. 1>&2
+ exit 1
+fi
+
# First pass through any local machine types.
case $1 in
*local*)
@@ -104,7 +113,7 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
- -lynx)
+ -lynx*)
os=-lynxos
;;
-ptx*)
@@ -123,7 +132,8 @@ case $basic_machine in
| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
| alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
| powerpc | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
- | pdp11 | mips64el | mips64orion | mips64orionel )
+ | pdp11 | mips64el | mips64orion | mips64orionel \
+ | sparc)
basic_machine=$basic_machine-unknown
;;
# Object if more than one company name word.
@@ -139,7 +149,7 @@ case $basic_machine in
| hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
| pdp11-* | sh-* | powerpc-* | sparc64-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* )
+ | mips64el-* | mips64orion-* | mips64orionel-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -418,6 +428,9 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
@@ -462,6 +475,10 @@ case $basic_machine in
basic_machine=sparc-sun
os=-sunos4
;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
@@ -478,6 +495,10 @@ case $basic_machine in
tower | tower-32)
basic_machine=m68k-ncr
;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
@@ -572,6 +593,9 @@ case $os in
-solaris)
os=-solaris2
;;
+ -unixware* | svr4*)
+ os=-sysv4
+ ;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux|'`
;;
@@ -587,7 +611,7 @@ case $os in
| -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
- | -ptx* | -coff* | -winnt*)
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta | -udi | -eabi)
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
@@ -613,6 +637,13 @@ case $os in
-ctix* | -uts*)
os=-sysv
;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
-triton*)
os=-sysv3
;;
@@ -665,6 +696,9 @@ case $basic_machine in
*-dec | vax-*)
os=-ultrix4.2
;;
+ m68*-apollo)
+ os=-domain
+ ;;
i386-sun)
os=-sunos4.0.2
;;
@@ -734,6 +768,9 @@ case $basic_machine in
*-sgi)
os=-irix
;;
+ *-siemens)
+ os=-sysv4
+ ;;
*-masscomp)
os=-rtu
;;
@@ -785,6 +822,9 @@ case $basic_machine in
-ptx*)
vendor=sequent
;;
+ -vxworks*)
+ vendor=wrs
+ ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
diff --git a/config/.mkdirhier.sh,l b/config/.mkdirhier.sh,l
deleted file mode 100644
index da447b3..0000000
--- a/config/.mkdirhier.sh,l
+++ /dev/null
@@ -1 +0,0 @@
-../ATHENA/config/mkdirhier.sh \ No newline at end of file
diff --git a/config/Imake.rules b/config/Imake.rules
deleted file mode 100644
index 2716eaf..0000000
--- a/config/Imake.rules
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * The following macros are supported
- * ----------------------------------
- * create_dir(dir) - Create a directory hierarchy
- * AnsiCC() - Specify desire for ANSI compiling
- * ProfiledObjectRule() - Build profiled objects/libraries
- * SpecialObject(obj,depends,options) - Build a special object
- *
- * cmd_table(tbl) - build a command table module (tbl.ct)
- * error_table(tbl) - build an error table module (tbl.et)
- *
- * SimpleProgram(prog,objs,libs,dest) - Build/install a program (simple)
- * build_program(prog,objs,ldflags,libs)- Build a program (complex)
- * install_program(prog,instflags,dest) - Install a program (complex)
- * install_script(prog,instflags,dest) - Install a script (complex)
- *
- * SimpleLibrary(base,objs,destdir) - Build/install a library (simple)
- * build_library(base,objs) - Build a library
- * install_library(base,dir) - Install a library
- *
- * SimpleLint(base,srcs) - Build/install a lint library
- *
- * install_man(src,name) - Install man page
- * install_man_links(name,links) - Install man page links
- *
- * install_file(src,dest) - Install file
- *
- * foreach_subdirs(name,subdirs) - Make 'name' in subdirs
- * do_subdirs_imakefile(subdirs) - Make Makefile in subdirs (Athena)
- * do_subdirs_xmakefile(subdirs) - Make Makefile in subdirs (X-style)
- * do_subdirs(subdirs) - Make common instances in subdirs
- */
-
-#define concat2(a,b) a/**/b
-#define concat3(a,b,c) a/**/b/**/c
-
-#define create_dir(dir) @@\
-install_dirs:: $(DESTDIR)dir @@\
-$(DESTDIR)dir:: @@\
- $(MKDIRHIER) $(DESTDIR)dir
-
-#define build_program(prog,objs,ldflags,libs) @@\
-all:: prog @@\
-prog:: objs @@\
- $(LD) ldflags $(LDFLAGS) -o prog objs $(LDPATH) libs $(LDLIBS) @@\
-clean:: @@\
- $(RM) prog @@\
-
-#ifndef static_program
-#define static_program(prog,objs,ldflags,libs) @@\
-build_program(prog,objs,ldflags,libs)
-#endif
-
-#define install_program(prog,instflags,dest) @@\
-install:: @@\
- $(INSTALL) InstPgmFlags instflags prog $(DESTDIR)dest
-
-#define install_script(prog,instflags,dest) @@\
-install:: @@\
- $(INSTALL) InstScriptFlags instflags prog $(DESTDIR)dest
-
-#define install_file(src,dest) @@\
-install:: @@\
- $(INSTALL) -m 0444 src $(DESTDIR)dest
-
-#define SimpleProgram(prog,objs,libs,dest) @@\
-build_program(prog,objs,,libs) @@\
-install_program(prog,,dest)
-
-#define SpecialObject(obj,depends,options) @@\
-obj: depends @@\
- $(RM) $@ @@\
- $(CC) -c $(CFLAGS) options $*.c
-
-#define install_man(src,name) @@\
-install.man:: @@\
- base=`expr name \: '\(.*\)\.'`; \ @@\
- ext=`expr name \: '.*\.\(.*\)'`; \ @@\
- sdir=$(DESTDIR)$(ATHMANDIR)/man`expr name \: '.*\.\(.\)'`; \ @@\
- $(INSTALL) -m 0444 src $${sdir}/`basename name`
-
-#define install_man_links(name,links) @@\
-name.so: @@\
- $(RM) name.so @@\
- sdir=man`expr name \: '.*\.\(.\)'`; \ @@\
- echo ".so $${sdir}/name" > name.so @@\
-clean:: @@\
- $(RM) name.so @@\
-install.man:: name.so @@\
- for i in links; do \ @@\
- sdir=$(DESTDIR)$(ATHMANDIR)/man`expr $$i \: '.*\.\(.\)'`;\ @@\
- $(INSTALL) -m 0444 name.so $${sdir}/$$i;\ @@\
- done
-
-#ifdef NOPROF
-#define ProfiledObjectRule()
-#else
-#define ProfiledObjectRule() @@\
-.c.o: @@\
- $(RM) $@ profiled/$@ @@\
- $(CC) ProfCcFlags -c $(CFLAGS) $*.c @@\
- mv $*.o profiled/$*.o @@\
- $(CC) -c $(CFLAGS) $*.c @@\
-all:: profiled all-prof @@\
-install:: inst-prof @@\
-profiled: @@\
- -mkdir $@
-#endif
-
-#define AnsiCC() @@\
-CC=AnsiCcCmd @@\
-LD=AnsiLdCmd
-
-#define error_table(tbl) @@\
-depend:: concat2(tbl,.c) concat2(tbl,.h) @@\
-concat2(tbl,.o): concat2(tbl,.c) @@\
-concat2(tbl,.c) concat2(tbl,.h): concat2(tbl,.et) @@\
- $(RM) concat2(tbl,.c) concat2(tbl,.h) @@\
- $(ETCMD) concat2(tbl,.et) @@\
-clean:: @@\
- $(RM) concat2(tbl,.c) concat2(tbl,.h)
-
-#define cmd_table(tbl) @@\
-depend:: concat2(tbl,.c) @@\
-concat2(tbl,.o): concat2(tbl,.c) @@\
-concat2(tbl,.c): concat2(tbl,.ct) @@\
- $(RM) concat2(tbl,.c) concat2(tbl,.h) @@\
- $(SSCMD) concat2(tbl,.ct) @@\
-clean:: @@\
- $(RM) concat2(tbl,.c)
-
-#define build_library(base,objs) @@\
-all:: concat3(lib,base,.a) @@\
-concat3(lib,base,.a):: objs @@\
- ar cru concat3(lib,base,.a) objs @@\
- $(RANLIB) concat3(lib,base,.a) @@\
-all-prof:: concat3(lib,base,_p.a) @@\
-concat3(lib,base,_p.a): objs @@\
- cd profiled; ar cru concat3(../lib,base,_p.a) objs @@\
- $(RANLIB) concat3(lib,base,_p.a)
-
-#define install_library(base,dir) @@\
-install:: @@\
- $(RM) concat3($(DESTDIR)dir/lib,base,.a) @@\
- $(INSTALL) -m 0644 concat3(lib,base,.a) $(DESTDIR)dir @@\
- $(RANLIB) concat3($(DESTDIR)dir/lib,base,.a) @@\
-inst-prof:: @@\
- $(RM) concat3($(DESTDIR)dir/lib,base,_p.a) @@\
- $(INSTALL) -m 0644 concat3(lib,base,_p.a) $(DESTDIR)dir @@\
- $(RANLIB) concat3($(DESTDIR)dir/lib,base,_p.a)
-
-#define SimpleLibrary(base,objs,dir) @@\
-build_library(base,objs) @@\
-install_library(base,dir)
-
-
-#ifdef NOLINT
-#define SimpleLint(base,srcs)
-#else
-#define SimpleLint(base,srcs) @@\
-all:: concat3(llib-l,base,.ln) @@\
-concat3(llib-l,base,.ln):: srcs @@\
- LintCmd $(LINTCFLAG)base LintFlags $(LINTFLAGS) srcs @@\
-install:: @@\
- $(INSTALL) concat3(llib-l,base,.ln) $(DESTDIR)/usr/lib/lint/ @@\
-clean:: @@\
- $(RM) concat3(llib-l,base,.ln)
-#endif
-
-#define makefile_target() @@\
-Makefile:: $(ICONFIGFILES) @@\
- -@if [ -f Makefile ]; then \ @@\
- echo " $(RM) Makefile.bak; mv Makefile Makefile.bak"; \ @@\
- $(RM) Makefile.bak; mv Makefile Makefile.bak; \ @@\
- else exit 0; fi @@\
- $(IMAKE) $(IPROJ) $(IFLAGS) -DNEWTOP=$(TOP) -DNEWCWD=$(CWD) @@\
- @@\
-XMakefile:: @@\
- -@if [ -f Makefile ]; then \ @@\
- echo " $(RM) Makefile.bak; mv Makefile Makefile.bak"; \ @@\
- $(RM) Makefile.bak; mv Makefile Makefile.bak; \ @@\
- else exit 0; fi @@\
- $(IMAKE) $(XIFLAGS)
-
-
-#define foreach_subdirs_flags(name,subdirs,flgs) @@\
-name:: FRC @@\
- @for d in subdirs; \ @@\
- do \ @@\
- (cd $$d; echo "### Making" name "in $(CWD)/$$d"; \ @@\
- make $(MFLAGS) flgs DESTDIR=$(DESTDIR) name; \ @@\
- echo "### Done with $(CWD)/$$d"); \ @@\
- done
-
-#define do_subdirs_flags(subdirs,flgs) @@\
- foreach_subdirs_flags(all, subdirs, flgs) @@\
- foreach_subdirs_flags(install, subdirs, flgs) @@\
- foreach_subdirs_flags(clean, subdirs, flgs) @@\
- foreach_subdirs_flags(depend, subdirs, flgs) @@\
-subdirs:: FRC @@\
- @(cd $@; echo "### Making" all "in $(CWD)/$@"; \ @@\
- make $(MFLAGS) flgs DESTDIR=$(DESTDIR) all ; \ @@\
- echo "### Done with $(CWD)/$@")
-
-#define foreach_subdirs(name,subdirs) @@\
- foreach_subdirs_flags(name,subdirs,)
-
-#define do_subdirs(subdirs) @@\
- do_subdirs_flags(subdirs,)
-
-#define do_subdirs_imakefile(subdirs) @@\
- foreach_subdirs(install.man, subdirs) @@\
-Makefiles:: Makefile @@\
- @echo "### Making Makefiles in $(CWD)" @@\
- @-for d in subdirs; \ @@\
- do \ @@\
- case "$$d" in \ @@\
- ./?*/?*/?*/?*) newtop=../../../.. ;; \ @@\
- ./?*/?*/?*) newtop=../../.. ;; \ @@\
- ./?*/?*) newtop=../.. ;; \ @@\
- ./?*) newtop=.. ;; \ @@\
- */?*/?*/?*) newtop=../../../.. ;; \ @@\
- */?*/?*) newtop=../../.. ;; \ @@\
- */?*) newtop=../.. ;; \ @@\
- *) newtop=.. ;; \ @@\
- esac; \ @@\
- ( cd $$d; \ @@\
- echo "### Making Makefile in $(CWD)/$$d"; \ @@\
- if [ -f Makefile ]; then \ @@\
- $(RM) Makefile.bak; \ @@\
- mv Makefile Makefile.bak; fi; \ @@\
- make -f $${newtop}/Makefile TOP=$${newtop}/$(TOP) \ @@\
- CWD=$(CWD)/$$d Makefile; \ @@\
- make $(MFLAGS) Makefiles; \ @@\
- echo "### Done with $(CWD)/$$d" ) ; \ @@\
- done
-
-#define do_subdirs_xmakefile(subdirs) @@\
- foreach_subdirs(install.man,subdirs) @@\
-Makefiles:: Makefile @@\
- @echo "### Making Makefiles in $(CWD)" @@\
- @-for d in subdirs; \ @@\
- do \ @@\
- case "$$d" in \ @@\
- ./?*/?*/?*/?*) newtop=../../../.. ;; \ @@\
- ./?*/?*/?*) newtop=../../.. ;; \ @@\
- ./?*/?*) newtop=../.. ;; \ @@\
- ./?*) newtop=.. ;; \ @@\
- */?*/?*/?*) newtop=../../../.. ;; \ @@\
- */?*/?*) newtop=../../.. ;; \ @@\
- */?*) newtop=../.. ;; \ @@\
- *) newtop=.. ;; \ @@\
- esac; \ @@\
- ( cd $$d; \ @@\
- echo "### Making Makefile in $(CWD)/$$d"; \ @@\
- if [ -f Makefile ]; then \ @@\
- $(RM) Makefile.bak; \ @@\
- mv Makefile Makefile.bak; fi; \ @@\
- make -f $${newtop}/Makefile TOP=$${newtop}/$(TOP) \ @@\
- CWD=$(CWD)/$$d XMakefile; \ @@\
- make $(MFLAGS) Makefiles; \ @@\
- echo "### Done with $(CWD)/$$d" ) ; \ @@\
- done
-
-#define create_depend(files) @@\
-depend:: files @@\
- makedepend $(CFLAGS) files
diff --git a/config/Imake.tmpl b/config/Imake.tmpl
deleted file mode 100644
index 0e8a14d..0000000
--- a/config/Imake.tmpl
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Generic Imake Template
- *
- * Future changes:
- *
- * o Reorganize the structure to employ a config.Imakefile and reduce
- * the complexity of Imake.tmpl. Also, the use of site.def should be
- * re-examined.
- *
- * o Support global project configurations. This can be done by always
- * including a Project.tmpl and altering the include path such that
- * this is found prior to the minimal one in the global templates.
- */
-
-#define ATHENA_RULES
-
-/*
- * WARNING - HACK HACK HACK
- * To allow xmkmf to work with our setup: set CONFDIR to be TOPDIR/config.
- *
- * NEWTOP is still set to . since this is being run from the top of the
- * developer's project tree. However, TOPDIR is simply the top of the
- * Athena source tree, which contains the Imake configuration files.
- */
-#ifdef TOPDIR
-#define UseInstalled
-#define ConfDir TOPDIR/config
-#endif
-
-all::
-
-#include <site.def>
-
-#ifndef ConfDir
-#define ConfDir $(TOP)/config
-#endif
-#ifndef NEWTOP
-#define NEWTOP .
-#endif
-#ifndef NEWCWD
-#define NEWCWD .
-#endif
-#ifndef ALibDir
-#define ALibDir $(ATHBASEDIR)/lib
-#endif
-#ifndef ABinDir
-#define ABinDir $(ATHBASEDIR)/bin
-#endif
-#ifndef AIncDir
-#define AIncDir $(ATHBASEDIR)/include
-#endif
-#ifndef AManDir
-#define AManDir $(ATHBASEDIR)/man
-#endif
-#ifndef AEtcDir
-#define AEtcDir $(ATHBASEDIR)/etc
-#endif
-#ifndef AConfDir
-#define AConfDir /etc/athena
-#endif
-#ifndef ARBinDir
-#define ARBinDir /bin/athena
-#endif
-#ifndef AREtcDir
-#define AREtcDir /etc/athena
-#endif
-#ifndef AthXAppDir
-#define AthXAppDir /usr/athena/lib/X11/app-defaults
-#endif
-#ifndef AthXBitDir
-#define AthXBitDir /usr/athena/lib/X11/bitmaps
-#endif
-#ifndef AthXIncDir
-#define AthXIncDir /usr/athena/include
-#endif
-#ifndef AthXLibDir
-#define AthXLibDir /usr/athena/lib
-#endif
-#ifndef LintCFlag
-#define LintCFlag -o
-#endif
-#ifndef CcCmd
-#define CcCmd cc
-#endif
-#ifndef LdCmd
-#define LdCmd cc
-#endif
-#ifndef AnsiCcCmd
-#define AnsiCcCmd cc
-#endif
-#ifndef AnsiLdCmd
-#define AnsiLdCmd cc
-#endif
-#ifndef AsCmd
-#define AsCmd as
-#endif
-#ifndef RanLibCmd
-#define RanLibCmd ranlib
-#endif
-#ifndef InstPgmFlags
-#define InstPgmFlags -s
-#endif
-#ifndef InstScriptFlags
-#define InstScriptFlags -m 755
-#endif
-#ifndef RmCmd
-#define RmCmd rm -f
-#endif
-#ifndef CpCmd
-#define CpCmd cp -p
-#endif
-#ifndef CcFlags
-#define CcFlags -DPOSIX
-#endif
-#ifndef CDebugFlags
-#define CDebugFlags -O
-#endif
-#ifndef ProfCcFlags
-#define ProfCcFlags -p
-#endif
-#ifndef LdFlags
-#define LdFlags
-#endif
-#ifndef LdPath
-#define LdPath -L$(ATHLIBDIR)
-#endif
-#ifndef LdLibs
-#define LdLibs
-#endif
-#ifndef LintCmd
-#define LintCmd lint
-#endif
-#ifndef LintFlags
-#define LintFlags CcFlags
-#endif
-
-#ifndef ExtraXLibs
-#define ExtraXLibs
-#endif
-
-#ifdef UseInstalled
-# ifndef InstallCmd
-# define InstallCmd install -c
-# endif
-# ifndef EtCmd
-# define EtCmd compile_et
-# endif
-# ifndef SsCmd
-# define SsCmd mk_cmds
-# endif
-# ifndef EtLibs
-# define EtLibs -lcom_err
-# endif
-# ifndef SsLibs
-# define SsLibs -lss
-# endif
-# ifndef KrbLibs
-# define KrbLibs -lkrb -ldes
-# endif
-# ifndef HesLibs
-# define HesLibs -lhesiod
-# endif
-# ifndef ZephyrLibs
-# define ZephyrLibs -lzephyr KrbLibs EtLibs
-# endif
-# ifndef XLibs
-# define XLibs -lX11 -lXext ExtraXLibs
-# endif
-# ifndef XtLibs
-# define XtLibs -lXt XLibs
-# endif
-# ifndef XawLibs
-# define XawLibs -lXaw -lXmu XtLibs
-# endif
-#else /* !UseInstalled */
-# ifndef InstallCmd
-# define InstallCmd $(UTILDIR)install -c
-# endif
-# ifndef EtCmd
-# define EtCmd $(TOP)/athena/athena.lib/et/compile_et
-# endif
-# ifndef SsCmd
-# define SsCmd $(TOP)/athena/athena.lib/ss/mk_cmds
-# endif
-# ifndef EtLibs
-# define EtLibs $(TOP)/athena/athena.lib/et/libcom_err.a
-# endif
-# ifndef SsLibs
-# define SsLibs $(TOP)/athena/athena.lib/ss/libss.a
-# endif
-# ifndef KrbLibs
-# define KrbLibs $(TOP)/athena/athena.lib/kerberos.p10/lib/krb/libkrb.a \
- $(TOP)/athena/athena.lib/kerberos.p10/lib/des/libdes.a
-# endif
-# ifndef HesLibs
-# define HesLibs $(TOP)/athena/athena.lib/hesiod/libhesiod.a
-# endif
-# ifndef ZephyrLibs
-# define ZephyrLibs $(TOP)/athena/athena.lib/zephyr/lib/libzephyr.a \
- KrbLibs EtLibs
-# endif
-# ifndef XLibs
-# define XLibs $(XTOP)/lib/X/libX11.a $(XTOP)/extensions/lib/libXext.a \
- ExtraXLibs
-# endif
-# ifndef XtLibs
-# define XtLibs $(XTOP)/lib/Xt/libXt.a XLibs
-# endif
-# ifndef XawLibs
-# define XawLibs $(XTOP)/lib/Xaw/libXaw.a $(XTOP)/lib/Xmu/libXmu.a XtLibs
-# endif
-#endif /* UseInstalled */
-
-
-SHELL=/bin/sh
-MAKESHELL=/bin/sh
-
-TOP = NEWTOP
-CWD = NEWCWD
-CONFIGSRC = ConfDir
-DESTDIR=
-
-IRULESRC = $(CONFIGSRC)
-
-#ifdef ProjectTop
-PTOP = $(TOP)/ProjectTop
-#endif
-
-#ifdef UseInstalled
-IMAKE= imake
-IFLAGS= -I$(IRULESRC) $(IFLAGS_SH) $(OTHER_IFLAGS) -DTOPDIR=TOPDIR
-XIFLAGS= -I$(ATHXLIBDIR)/X11/config -DUseInstalled
-#else
-UTILDIR=$(TOP)/util/bin/
-IMAKE= $(UTILDIR)imake
-IFLAGS= -I$(IRULESRC) $(IFLAGS_SH) $(OTHER_IFLAGS)
-XTOP=$(TOP)/third/common/X11R4
-XIFLAGS= -I$(XTOP)/config -DTOPDIR=$(XTOP) -DCURDIR=$(CWD)
-#endif
-
-ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- $(IRULESRC)/site.def Imakefile $(PRULEDEP)
-MKDIRHIER= sh $(IRULESRC)/mkdirhier.sh
-
-ATHVERS = $(IRULESRC)/update.conf
-
-ATHBASEDIR=/usr/athena
-
-ATHLIBDIR=ALibDir
-ATHBINDIR=ABinDir
-ATHINCDIR=AIncDir
-ATHETCDIR=AEtcDir
-ATHCONFDIR=AConfDir
-ATHMANDIR=AManDir
-ATHRBINDIR=ARBinDir
-ATHRETCDIR=AREtcDir
-
-/* This should be removed, but too much depends on it */
-ATHNEWDIR=$(ATHBINDIR)
-
-ATHXAPPDIR=AthXAppDir
-ATHXBITDIR=AthXBitDir
-ATHXINCDIR=AthXIncDir
-ATHXLIBDIR=AthXLibDir
-
-#ifdef AfsDir
-AFSDIR=AfsDir
-#endif
-
-LINTCFLAG=LintCFlag
-LINTFLAGS=LintFlags $(DEFINES) -I/usr/athena/include
-
-INSTALL=InstallCmd
-RANLIB=RanLibCmd
-CC=CcCmd
-LD=LdCmd
-AS=AsCmd
-RM=RmCmd
-CP=CpCmd
-
-ETCMD=EtCmd
-SSCMD=SsCmd
-
-LIB_ET = EtLibs
-LIB_SS = SsLibs
-LIB_HES = HesLibs
-LIB_KRB = KrbLibs
-LIB_ZEPHYR = ZephyrLibs
-LIB_X = XLibs
-LIB_XT = XtLibs
-LIB_XAW = XawLibs
-
-CDEBUG=CDebugFlags
-
-CFLAGS=$(CDEBUG) CcFlags $(DEFINES) -I/usr/athena/include
-LDFLAGS=LdFlags $(LDDEFS)
-LDPATH=LdPath
-LDLIBS=LdLibs
-
-#include "Imake.rules"
-
-install:: install_dirs
-install_dirs::
-install::
-install.man::
-
-clean::
-depend::
-
-FRC::
-
-/**/###########################################################################
-/**/# start of Imakefile
-/**/###########################################################################
-
-#ifdef Project
-#define InProject
-#undef Project
-#ifdef ProjectRules
-#include ProjectRules
-#endif
-#endif /* Project */
-
-#include INCLUDE_IMAKEFILE
-
-#if defined(InProject) && !defined(Project)
-#define Project
-#endif
-
-/*
- * PROJECT DECLARATION
- *
- * At the top of the project directory, simply include the following:
- *
- * #define Project
- *
- * If you also want to declare a set of rules that should be included,
- * simply do:
- *
- * #ifndef ProjectRules
- * #define ProjectRules config/extra.rules
- * #include ProjectRules
- * #endif
- *
- * at the top of the project tree.
- *
- *
- * This will declare that directory to be the top of the project tree.
- * The top of the project tree will be in the include path, so if there
- * are additional rules files that are being used by the Imakefiles, you
- * can simply do something like:
- *
- * #include "config/extra.rules"
- *
- * from any Imakefile in the tree.
- *
- * The Make variable $(PTOP) is also set to the top of the project tree,
- * so you can declare dependencies such as $(PTOP)/lib/libfoo.a.
- */
-
-#ifdef Project
-#ifndef ProjectTop
-#define ProjectTop NEWCWD
-#endif
-#ifdef ProjectRules
-PRULES = ProjectRules
-PINC = -DProjectRules=\"$(PRULES)\" -DProjectRuleDep=$(PRULES)
-#ifdef ProjectRuleDep
-PRULEDEP = $(PTOP)/ProjectRuleDep
-#endif
-#endif
-PTOP = $(TOP)/ProjectTop
-IPROJ = -DProject -DProjectTop=ProjectTop -I$(PTOP) $(PINC)
-#endif
-
-#ifdef UseSharedLibs
-IFLAGS_SH = -DUseSharedLibs
-#endif
-
-makefile_target()
-
-clean::
- $(RM) *~ *.o *.a core a.out Makefile.bak
- $(RM) -r profiled
-
-all-prof inst-prof::
-
-#ifdef ISUBDIRS
-do_subdirs_imakefile(ISUBDIRS)
-do_subdirs(ISUBDIRS)
-#endif
-
-#ifdef XSUBDIRS
-do_subdirs_xmakefile(XSUBDIRS)
-do_subdirs(XSUBDIRS)
-#endif
-
-#ifdef SUBDIRS
-do_subdirs(SUBDIRS)
-#endif SUBDIRS
-
-Makefiles::
-
-/**/###########################################################################
-/**/# dependencies generated by makedepend
diff --git a/config/mkdirhier.sh b/config/mkdirhier.sh
deleted file mode 100755
index 739535e..0000000
--- a/config/mkdirhier.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-#
-# create a heirarchy of directories
-#
-
-for f in $*; do
- parts=`echo $f | sed 's,\(.\)/\(.\),\1 \2,g' | sed 's,/$,,'`;
- path="";
- for p in $parts; do
- if [ x"$path" = x ]; then
- dir=$p;
- else
- dir=$path/$p;
- fi;
- if [ ! -d $dir ]; then
- echo mkdir $dir;
- mkdir $dir;
- chmod a+rx $dir;
- fi;
- path=$dir;
- done;
-done
-
diff --git a/config/site.def b/config/site.def
deleted file mode 100644
index cbc0044..0000000
--- a/config/site.def
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * BSD 4.3
- */
-#if (defined(vax) && !defined(ultrix)) || defined(ibm032)
-#define LintCFlag -C
-#define ProfCcFlags -pg
-#endif
-
-#if defined(vax) && !defined(ultrix)
-#define AnsiCcCmd gcc -pipe
-#define AnsiLdCmd gcc -pipe
-#define CcFlags "-Dmemmove(a,b,c)=bcopy(b,a,c)"
-#endif
-
-#ifdef ibm032
-#define AnsiCcCmd cc -Hon=read_only_strings
-#define CcFlags
-#endif
-
-
-/*
- * DECstation ULTRIX
- */
-#ifdef ultrix
-#define SYSLOG_COMPAT42
-#endif
-
-
-/*
- * DEC Alpha OSF/1
- */
-#if defined(__alpha)
-#define RanlibCmd ar -tsl
-#define LintLibFlag -o
-#define LintOpts -ax
-#define LintFlags -DPOSIX -xv -std
-#define CcFlags -DPOSIX -std1
-#define NOLINT /* Until I can install somewhere useful */
-#endif
-
-
-/*
- * IBM AIX
- */
-#if defined(_AIX) && defined(_IBMR2)
-#define NOLINT
-
-#ifdef _AIX32
-#define ARBinDir /usr/bin/athena
-#endif
-
-#define BsdLibs -lbsd
-#define BsdFlags -D_BSD
-
-#define NoBsdArgs \
- /*-Dindex=index_oops*/ /*-Drindex=rindex_oops*/ \
- -Dbcopy=bcopy_oops /*-Dbzero=bzero_oops*/ -Dbcmp=bcmp_oops \
- -Dsignal=signal_oops -Dsigsetmask=sigsetmask_oops \
- -Dsigblock=sigblock_oops -Dsigpause=sigpause_oops \
- /*-Dsetjmp=setjmp_oops*/ -Dlongjmp=longjmp_oops
-#undef NoBsdArgs
-#define NoBsdArgs
-
-#define LdLibs BsdLibs
-#define LintFlags BsdFlags -DAIXV=AIXV -DPOSIX NoBsdArgs
-#define CcFlags LintFlags
-#define CDebugFlags
-#define AnsiCcCmd xlc -qro -D_ALL_SOURCE
-#define CcCmd xlc -qlanglvl=extended -D_ALL_SOURCE
-
-#if !defined(UseInstalled) || defined(UseSharedLibs)
-#define LdPath -L$(ATHLIBDIR)/shared -L$(ATHLIBDIR)
-
-#define static_program(prog,objs,ldflags,libs) @@\
-all:: prog @@\
-prog:: objs @@\
- $(LD) ldflags $(LDFLAGS) -o prog objs -L$(ATHLIBDIR) libs $(LDLIBS) @@\
-clean:: @@\
- $(RM) prog
-#endif
-
-clean::
- $(RM) bind.??*
-
-#endif /* _AIX */
-
-
-/*
- * MAC A/UX
- */
-#ifdef _AUX_SOURCE
-#define NOLINT
-
-/* Do not use -ZP; this undefines other symbols used by the system .h files */
-#define CcFlags -DPOSIX -D_POSIX_SOURCE -D_BSD_SOURCE
-#define LdLibs -lposix
-#define RanLibCmd \:
-#endif
-
-
-/*
- * Sun SUNOS
- */
-
-#if defined(sun) && defined(sparc) && !defined(SOLARIS)
-#define NOLINT
-#define LintFlags -DSUNOS
-#define ProfCcFlags -pg
-#define CDebugFlags -g -O
-#define CcFlags LintFlags -I/usr/openwin/include
-#define LdPath -L/usr/openwin/lib -L$(ATHLIBDIR)
-#define CcCmd gcc
-#define LdCmd gcc
-#define AnsiCcCmd gcc
-#define AnsiLdCmd gcc
-#define AfsDir /usr/transarc
-#define XLibs -L/usr/openwin/lib -lX11 -L/usr/local/lib -lXext -lm
-#define XawLibs -lXaw -lXmu -lXt -static XLibs
-#endif
-
-
-/*
- * Sun SOLARIS
- */
-#if defined(SOLARIS)
-
-#define NoBsdArgs \
- -Dsignal=signal_oops -Dlongjmp=lonjmp_oops -Dsetjmp=setjmp_oops
-/*
-#undef NoBsdArgs
-#define NoBsdArgs -I/usr/ucbinclude
-*/
-
-#define NOLINT
-#define CcFlags -DSOLARIS -DPOSIX \
- -Dsrandom=srand48 -Drandom=lrand48 NoBsdArgs \
- -I/usr/openwin/include
-#define ProfCcFlags -pg
-#define CDebugFlags -O2
-#define LdPath -L/usr/openwin/lib -Xlinker -R/usr/openwin/lib -L$(ATHLIBDIR)
-#define LdLibs -lresolv -lsocket -lnsl -lelf
-#define AnsiCcCmd /usr/gcc/bin/gcc
-#define AnsiLdCmd /usr/gcc/bin/gcc
-#define CcCmd /usr/gcc/bin/gcc -traditional
-#define LdCmd /usr/gcc/bin/gcc
-#define RanLibCmd \:
-#define AfsDir /usr/transarc
-#define ExtraXLibs -lm
-#endif
-
-/*
- * Linux
- */
-#ifdef linux
-#define NOLINT
-#define NOPROF
-#define SYSLOG_COMPAT42
-#endif
-
-/*
- * SGI Irix 5
- */
-#ifdef sgi
-#define CcFlags -DSYSV -DPOSIX
-#define CDebugFlags -O2
-#define RanLibCmd \:
-#endif
-
-/*
- * AFS configuration
- */
-#if !defined(AfsDir) && !defined(NoAFS)
-#ifdef UseInstalled
-#define AfsDir /mit/afsuser/@sys
-#else
-#define AfsDir /usr/transarc /* wrong, but use for now */
-#endif
-#endif
diff --git a/config/zephyr.rules b/config/zephyr.rules
deleted file mode 100644
index 8e3d1bc..0000000
--- a/config/zephyr.rules
+++ /dev/null
@@ -1,102 +0,0 @@
-/**/# Copyright 1993 Massachusetts Institute of Technology
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h"
-/**/#
-/**/# $Id$
-
-/* General system configuration */
-#define KERBEROS /* Has Kerberos installed */
-#define HESIOD /* Has Hesiod installed */
-
-/* Other defines that one may wish to use */
-#if 0
-#define NO_IMAKE /* Need to build imake */
-#define NO_ET /* Need to build com_err library */
-#define NO_SS /* Need to build ss library */
-#endif
-
-#ifndef UseSharedLibs
-#define UseSharedLibs
-#endif
-
-#ifdef NO_IMAKE
-D_IMAKE = $(PTOP)/util/imake
-IMAKE = $(D_IMAKE)/imake
-OTHER_IFLAGS = -DNO_IMAKE
-Makefile Makefiles:: $(IMAKE)
-#endif
-
-#ifdef KERBEROS
-CDEFS_KRB = -DKERBEROS
-ZLIB_KRB = $(LIB_KRB)
-#endif
-
-#ifdef HESIOD
-CDEFS_HES = -DHESIOD
-ZLIB_HES = $(LIB_HES)
-#endif
-
-#ifdef NO_ET
-D_ET = $(PTOP)/util/et
-CDEFS_ET = -I$(D_ET)
-#define EtLibs $(D_ET)/libcom_err.a
-#endif
-
-#ifdef NO_SS
-D_UTIL = $(PTOP)/util
-D_SS = $(D_UTIL)/ss
-CDEFS_SS = -I$(D_UTIL)
-#define SsLibs $(D_SS)/libss.a
-#endif
-
-ZPIDDIR = /var/athena
-ZETCDIR = $(ATHCONFDIR)/zephyr
-ZLIBDIR = $(ATHLIBDIR)/zephyr
-ZINCDIR = $(ATHINCDIR)/zephyr
-ZACLDIR = $(ZETCDIR)/acl
-
-BINC = $(PTOP)/h
-
-ZLIB = $(PTOP)/lib/libzephyr.a
-ZLIBDES = $(PTOP)/libdes/libdes.a
-ZLIBS = $(ZLIB_KRB) $(LIB_ET) $(ZLIB_HES)
-DYN_LIB = $(PTOP)/libdyn/libdyn.a
-
-DEFINES = $(XDEFS) -DX11 -I$(BINC) \
- $(CDEFS_KRB) $(CDEFS_HES) $(CDEFS_ET) $(CDEFS_SS) \
- $(MACHDEFS)
-
-#ifndef _AIX /* AIX ANSI CcCmd doesn't want to compile compile_et output. */
-AnsiCC()
-#endif
-
-/*
- * Supplemental rules
- */
-#define make_err(name) \
-error_table(name) @@\
-all:: concat3($(BINC)/zephyr/,name,.h) @@\
-$(OBJS): concat3($(BINC)/zephyr/,name,.h) @@\
-concat3($(BINC)/zephyr/,name,.h): concat2(name,.h) @@\
- $(RM) $@; $(CP) concat2(name,.h) $@ @@\
-clean:: @@\
- $(RM) concat3($(BINC)/zephyr/,name,.h)
-
-#define zprogram(name,libs) \
-SimpleProgram(name,$(OBJS) $(ZLIB),libs $(ZLIBS),$(ATHBINDIR)) @@\
-create_depend($(SRCS))
-
-
-#if defined(UseInstalled) && defined(NoBrainDamage)
-ATHBINDIR = /mit/zephyr/@sys/bin
-ATHLIBDIR = /mit/zephyr/@sys/lib
-ATHINCDIR = /mit/zephyr/include
-ATHMANDIR = /mit/zephyr/man
-
-ZLIBDIR = /mit/zephyr/configs
-ATHCONFDIR = $(ZLIBDIR)
-ATHETCDIR = $(ATHBINDIR)
-ATHRETCDIR = $(ATHBINDIR)
-
-LDPATH = -L/usr/athena/lib/shared -L/usr/athena/lib
-#endif
diff --git a/configure b/configure
new file mode 100755
index 0000000..508c39c
--- /dev/null
+++ b/configure
@@ -0,0 +1,3824 @@
+#! /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_help="$ac_help
+ --enable-athena Use Athena defaults"
+ac_help="$ac_help
+ --with-hesiod=PREFIX Compile with Hesiod support"
+ac_help="$ac_help
+ --with-krb4=PREFIX Compile with Kerberos 4 support"
+ac_help="$ac_help
+ --with-x use the X Window System"
+
+# 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=server/server.c
+
+# 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
+
+
+
+if test ! -d h; then mkdir h; fi
+if test ! -d h/zephyr; then mkdir h/zephyr; fi
+
+# Check whether --enable-athena or --disable-athena was given.
+if test "${enable_athena+set}" = set; then
+ enableval="$enable_athena"
+ hesiod=yes
+ kerberos=yes
+ if test "${prefix}" = "NONE"; then prefix=/usr/athena; fi
+ datadir=${datadir-'$(prefix)/lib/zephyr'}
+ confdir=${confdir-'/etc/athena/zephyr'}
+ sbindir=${sbindir-'$(exec_prefix)/etc'}
+ lsbindir=${lsbindir-'/etc/athena'}
+ COMPILE_ET=compile_et
+ MK_CMDS=mk_cmds
+ CPPFLAGS="${CPPFLAGS} -I/usr/athena/include"
+ LDFLAGS="${LDFLAGS} -L/usr/athena/lib"
+ INITPROGS=${lsbindir}/zinit
+else
+ datadir=${datadir-'$(prefix)/share/zephyr'}
+ confdir=${confdir-'$(prefix)/etc/zephyr'}
+ sbindir=${sbindir-'$(exec_prefix)/sbin'}
+ lsbindir=${lsbindir-'$(exec_prefix)/sbin'}
+ SUPPORT_LIBS="et ss"
+ ET_LDFLAGS='-L$(BUILDTOP)/lib/et'
+ ETDEP='$(BUILDTOP)/lib/et/libcom_err.a'
+ SS_LDFLAGS='-L$(BUILDTOP)/lib/ss'
+ SSDEP='$(BUILDTOP)/lib/ss/libss.a'
+ COMPILE_ET='$(BUILDTOP)/lib/et/compile_et'
+ MK_CMDS='$(BUILDTOP)/lib/ss/mk_cmds'
+ INITPROGS=true
+ if test ! -d h/ss; then mkdir h/ss; fi
+ cp ${srcdir}/lib/et/com_err.h h
+ cp ${srcdir}/lib/ss/*.h h/ss
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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 $srcdir $srcdir/.. $srcdir/../.." 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.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:628: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`$ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`$ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:649: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`$ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:667: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`$ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+cat >> confdefs.h <<EOF
+#define MACHINE_TYPE "$host"
+EOF
+
+
+# Check whether --with-hesiod or --without-hesiod was given.
+if test "${with_hesiod+set}" = set; then
+ withval="$with_hesiod"
+ hesiod="$withval"
+else
+ hesiod=${hesiod-no}
+fi
+
+
+# Check whether --with-krb4 or --without-krb4 was given.
+if test "${with_krb4+set}" = set; then
+ withval="$with_krb4"
+ kerberos="$withval"
+else
+ kerberos=${kerberos-no}
+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:715: 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:744: 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:792: 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 <<EOF
+#line 802 "configure"
+#include "confdefs.h"
+main(){return(0);}
+EOF
+if { (eval echo configure:806: \"$ac_link\") 1>&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:826: 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:831: 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 <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:840: \"$ac_try\") 1>&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:855: 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
+
+for ac_prog in 'bison -y' byacc
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:887: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$YACC"; then
+ ac_cv_prog_YACC="$YACC" # 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_YACC="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+YACC="$ac_cv_prog_YACC"
+if test -n "$YACC"; then
+ echo "$ac_t""$YACC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
+
+# Extract the first word of "flex", so it can be a program name with args.
+set dummy flex; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:919: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$LEX"; then
+ ac_cv_prog_LEX="$LEX" # 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_LEX="flex"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
+fi
+fi
+LEX="$ac_cv_prog_LEX"
+if test -n "$LEX"; then
+ echo "$ac_t""$LEX" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$LEXLIB"
+then
+ case "$LEX" in
+ flex*) ac_lib=fl ;;
+ *) ac_lib=l ;;
+ esac
+ echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
+echo "configure:952: checking for yywrap in -l$ac_lib" >&5
+ac_lib_var=`echo $ac_lib'_'yywrap | 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="-l$ac_lib $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 960 "configure"
+#include "confdefs.h"
+/* 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 yywrap();
+
+int main() {
+yywrap()
+; return 0; }
+EOF
+if { (eval echo configure:971: \"$ac_link\") 1>&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
+ LEXLIB="-l$ac_lib"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+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:1004: 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:1056: 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 location of temporary directory""... $ac_c" 1>&6
+echo "configure:1084: checking location of temporary directory" >&5
+if test -d /var/tmp; then
+ found_tmp=/var/tmp/
+elif test -d /usr/tmp; then
+ found_tmp=/usr/tmp/
+else
+ found_tmp=/tmp/
+fi
+cat >> confdefs.h <<EOF
+#define FOUND_TMP "${found_tmp}"
+EOF
+
+echo "$ac_t""${found_tmp}" 1>&6
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1099: 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 <<EOF
+#line 1114 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1120: \"$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 <<EOF
+#line 1131 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1137: \"$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 we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:1164: checking for X" >&5
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+ withval="$with_x"
+ :
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ have_x=disabled
+else
+ if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+ # Both variables are already set.
+ have_x=yes
+ else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+ cd conftestdir
+ # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+ cat > Imakefile <<'EOF'
+acfindx:
+ @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+ for ac_extension in a so sl; do
+ if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+ test -f $ac_im_libdir/libX11.$ac_extension; then
+ ac_im_usrlibdir=$ac_im_libdir; break
+ fi
+ done
+ # Screen out bogus values from the imake configuration. They are
+ # bogus both because they are the default anyway, and because
+ # using them would break gcc on systems where it needs fixed includes.
+ case "$ac_im_incroot" in
+ /usr/include) ;;
+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+ esac
+ case "$ac_im_usrlibdir" in
+ /usr/lib | /lib) ;;
+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+ esac
+ fi
+ cd ..
+ rm -fr conftestdir
+fi
+
+if test "$ac_x_includes" = NO; then
+ # Guess where to find include files, by looking for this one X11 .h file.
+ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+ # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 1226 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ for ac_dir in \
+ /usr/X11/include \
+ /usr/X11R6/include \
+ /usr/X11R5/include \
+ /usr/X11R4/include \
+ \
+ /usr/include/X11 \
+ /usr/include/X11R6 \
+ /usr/include/X11R5 \
+ /usr/include/X11R4 \
+ \
+ /usr/local/X11/include \
+ /usr/local/X11R6/include \
+ /usr/local/X11R5/include \
+ /usr/local/X11R4/include \
+ \
+ /usr/local/include/X11 \
+ /usr/local/include/X11R6 \
+ /usr/local/include/X11R5 \
+ /usr/local/include/X11R4 \
+ \
+ /usr/X386/include \
+ /usr/x386/include \
+ /usr/XFree86/include/X11 \
+ \
+ /usr/include \
+ /usr/local/include \
+ /usr/unsupported/include \
+ /usr/athena/include \
+ /usr/local/x11r5/include \
+ /usr/lpp/Xamples/include \
+ \
+ /usr/openwin/include \
+ /usr/openwin/share/include \
+ ; \
+ do
+ if test -r "$ac_dir/$x_direct_test_include"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+ done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+ # Check for the libraries.
+
+ test -z "$x_direct_test_library" && x_direct_test_library=Xt
+ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1300 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:1307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+ /usr/X11/lib \
+ /usr/X11R6/lib \
+ /usr/X11R5/lib \
+ /usr/X11R4/lib \
+ \
+ /usr/lib/X11 \
+ /usr/lib/X11R6 \
+ /usr/lib/X11R5 \
+ /usr/lib/X11R4 \
+ \
+ /usr/local/X11/lib \
+ /usr/local/X11R6/lib \
+ /usr/local/X11R5/lib \
+ /usr/local/X11R4/lib \
+ \
+ /usr/local/lib/X11 \
+ /usr/local/lib/X11R6 \
+ /usr/local/lib/X11R5 \
+ /usr/local/lib/X11R4 \
+ \
+ /usr/X386/lib \
+ /usr/x386/lib \
+ /usr/XFree86/lib/X11 \
+ \
+ /usr/lib \
+ /usr/local/lib \
+ /usr/unsupported/lib \
+ /usr/athena/lib \
+ /usr/local/x11r5/lib \
+ /usr/lpp/Xamples/lib \
+ /lib/usr/lib/X11 \
+ \
+ /usr/openwin/lib \
+ /usr/openwin/share/lib \
+ ; \
+do
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+ # Didn't find X anywhere. Cache the known absence of X.
+ ac_cv_have_x="have_x=no"
+else
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+ fi
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+ echo "$ac_t""$have_x" 1>&6
+ no_x=yes
+else
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+ echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+fi
+
+if test "$no_x" = yes; then
+ # Not all programs may use this symbol, but it does not hurt to define it.
+ cat >> confdefs.h <<\EOF
+#define X_DISPLAY_MISSING 1
+EOF
+
+ X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+ if test -n "$x_includes"; then
+ X_CFLAGS="$X_CFLAGS -I$x_includes"
+ fi
+
+ # It would also be nice to do this for all -L options, not just this one.
+ if test -n "$x_libraries"; then
+ X_LIBS="$X_LIBS -L$x_libraries"
+ # For Solaris; some versions of Sun CC require a space after -R and
+ # others require no space. Words are not sufficient . . . .
+ case "`(uname -sr) 2>/dev/null`" in
+ "SunOS 5"*)
+ echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
+echo "configure:1413: checking whether -R must be followed by a space" >&5
+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
+ cat > conftest.$ac_ext <<EOF
+#line 1416 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ ac_R_nospace=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_R_nospace=no
+fi
+rm -f conftest*
+ if test $ac_R_nospace = yes; then
+ echo "$ac_t""no" 1>&6
+ X_LIBS="$X_LIBS -R$x_libraries"
+ else
+ LIBS="$ac_xsave_LIBS -R $x_libraries"
+ cat > conftest.$ac_ext <<EOF
+#line 1439 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ ac_R_space=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_R_space=no
+fi
+rm -f conftest*
+ if test $ac_R_space = yes; then
+ echo "$ac_t""yes" 1>&6
+ X_LIBS="$X_LIBS -R $x_libraries"
+ else
+ echo "$ac_t""neither works" 1>&6
+ fi
+ fi
+ LIBS="$ac_xsave_LIBS"
+ esac
+ fi
+
+ # Check for system-dependent libraries X programs must link with.
+ # Do this before checking for the system-independent R6 libraries
+ # (-lICE), since we may need -lsocket or whatever for X linking.
+
+ if test "$ISC" = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+ else
+ # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
+ # libraries were built with DECnet support. And karl@cs.umb.edu says
+ # the Alpha needs dnet_stub (dnet does not exist).
+ echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
+echo "configure:1478: checking for dnet_ntoa in -ldnet" >&5
+ac_lib_var=`echo dnet'_'dnet_ntoa | 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="-ldnet $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1486 "configure"
+#include "confdefs.h"
+/* 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 dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:1497: \"$ac_link\") 1>&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
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+ echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
+echo "configure:1519: checking for dnet_ntoa in -ldnet_stub" >&5
+ac_lib_var=`echo dnet_stub'_'dnet_ntoa | 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="-ldnet_stub $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1527 "configure"
+#include "confdefs.h"
+/* 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 dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:1538: \"$ac_link\") 1>&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
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+ # to get the SysV transport functions.
+ # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
+ # needs -lnsl.
+ # The nsl library prevents programs from opening the X display
+ # on Irix 5.2, according to dickey@clark.net.
+ echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
+echo "configure:1567: checking for gethostbyname" >&5
+if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1572 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyname(); below. */
+#include <assert.h>
+/* 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 gethostbyname();
+
+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_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+gethostbyname();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_gethostbyname=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_gethostbyname=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_func_gethostbyname = no; then
+ echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:1616: checking for gethostbyname in -lnsl" >&5
+ac_lib_var=`echo nsl'_'gethostbyname | 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 <<EOF
+#line 1624 "configure"
+#include "confdefs.h"
+/* 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 gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:1635: \"$ac_link\") 1>&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
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ # lieder@skyler.mavd.honeywell.com says without -lsocket,
+ # socket/setsockopt and other routines are undefined under SCO ODT
+ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
+ # on later versions), says simon@lia.di.epfl.ch: it contains
+ # gethostby* variants that don't use the nameserver (or something).
+ # -lsocket must be given before -lnsl if both are needed.
+ # We assume that if connect needs -lnsl, so does gethostbyname.
+ echo $ac_n "checking for connect""... $ac_c" 1>&6
+echo "configure:1665: checking for connect" >&5
+if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1670 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char connect(); below. */
+#include <assert.h>
+/* 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 connect();
+
+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_connect) || defined (__stub___connect)
+choke me
+#else
+connect();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_connect=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_connect=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_func_connect = no; then
+ echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
+echo "configure:1714: checking for connect in -lsocket" >&5
+ac_lib_var=`echo socket'_'connect | 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 $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1722 "configure"
+#include "confdefs.h"
+/* 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 connect();
+
+int main() {
+connect()
+; return 0; }
+EOF
+if { (eval echo configure:1733: \"$ac_link\") 1>&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
+ X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
+ echo $ac_n "checking for remove""... $ac_c" 1>&6
+echo "configure:1757: checking for remove" >&5
+if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1762 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char remove(); below. */
+#include <assert.h>
+/* 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 remove();
+
+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_remove) || defined (__stub___remove)
+choke me
+#else
+remove();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_remove=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_remove=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_func_remove = no; then
+ echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
+echo "configure:1806: checking for remove in -lposix" >&5
+ac_lib_var=`echo posix'_'remove | 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="-lposix $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1814 "configure"
+#include "confdefs.h"
+/* 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 remove();
+
+int main() {
+remove()
+; return 0; }
+EOF
+if { (eval echo configure:1825: \"$ac_link\") 1>&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
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+ echo $ac_n "checking for shmat""... $ac_c" 1>&6
+echo "configure:1849: checking for shmat" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1854 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shmat(); below. */
+#include <assert.h>
+/* 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 shmat();
+
+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_shmat) || defined (__stub___shmat)
+choke me
+#else
+shmat();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_shmat=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_shmat=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test $ac_cv_func_shmat = no; then
+ echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
+echo "configure:1898: checking for shmat in -lipc" >&5
+ac_lib_var=`echo ipc'_'shmat | 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="-lipc $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1906 "configure"
+#include "confdefs.h"
+/* 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 shmat();
+
+int main() {
+shmat()
+; return 0; }
+EOF
+if { (eval echo configure:1917: \"$ac_link\") 1>&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
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+ fi
+
+ # Check for libraries that X11R6 Xt/Xaw programs need.
+ ac_save_LDFLAGS="$LDFLAGS"
+ test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+ # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+ # check for ICE first), but we must link in the order -lSM -lICE or
+ # we get undefined symbols. So assume we have SM if we have ICE.
+ # These have to be linked with before -lX11, unlike the other
+ # libraries we check for below, so use a different variable.
+ # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+ echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
+echo "configure:1950: checking for IceConnectionNumber in -lICE" >&5
+ac_lib_var=`echo ICE'_'IceConnectionNumber | 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="-lICE $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1958 "configure"
+#include "confdefs.h"
+/* 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 IceConnectionNumber();
+
+int main() {
+IceConnectionNumber()
+; return 0; }
+EOF
+if { (eval echo configure:1969: \"$ac_link\") 1>&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
+ X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ LDFLAGS="$ac_save_LDFLAGS"
+
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1994: 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 <<EOF
+#line 1999 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2007: \"$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
+#line 2024 "configure"
+#include "confdefs.h"
+#include <string.h>
+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
+#line 2042 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+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 <<EOF
+#line 2063 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#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:2074: \"$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
+
+echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
+echo "configure:2098: 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 <<EOF
+#line 2103 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#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:2119: \"$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 fcntl.h paths.h termios.h sgtty.h unistd.h libgen.h malloc.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2143: 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
+#line 2148 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2153: \"$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 <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in sys/filio.h sys/ioctl.h sys/time.h sys/file.h sys/utsname.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2183: 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
+#line 2188 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2193: \"$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 <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in sys/select.h sys/msgbuf.h sys/cdefs.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2223: 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
+#line 2228 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2233: \"$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 <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+if test "$no_x" != "yes"; then
+ XCLIENTS=xzwrite
+ ZWGC_LIBX11=-lX11
+fi
+
+
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:2268: 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 <<EOF
+#line 2273 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#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:2290: \"$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 <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+
+echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
+echo "configure:2309: 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
+#line 2314 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+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 size of short""... $ac_c" 1>&6
+echo "configure:2343: checking size of short" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2351 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main()
+{
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", sizeof(short));
+ exit(0);
+}
+EOF
+if { (eval echo configure:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_sizeof_short=`cat conftestval`
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_sizeof_short=0
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$ac_cv_sizeof_short" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_SHORT $ac_cv_sizeof_short
+EOF
+
+
+echo $ac_n "checking size of int""... $ac_c" 1>&6
+echo "configure:2382: checking size of int" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2390 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main()
+{
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", sizeof(int));
+ exit(0);
+}
+EOF
+if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_sizeof_int=`cat conftestval`
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_sizeof_int=0
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$ac_cv_sizeof_int" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+EOF
+
+
+echo $ac_n "checking size of long""... $ac_c" 1>&6
+echo "configure:2421: checking size of long" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2429 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main()
+{
+ FILE *f=fopen("conftestval", "w");
+ if (!f) exit(1);
+ fprintf(f, "%d\n", sizeof(long));
+ exit(0);
+}
+EOF
+if { (eval echo configure:2440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_sizeof_long=`cat conftestval`
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_sizeof_long=0
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$ac_cv_sizeof_long" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+EOF
+
+
+echo $ac_n "checking for 32-bit integer type""... $ac_c" 1>&6
+echo "configure:2460: checking for 32-bit integer type" >&5
+if test "$ac_cv_sizeof_long" = 4; then
+ int32=long
+elif test "$ac_cv_sizeof_int" = 4; then
+ int32=int
+elif test "$ac_cv_sizeof_short" = 4; then
+ int32=short
+else
+ echo "configure: warning: Can't find 32-bit type, using long" 1>&2
+ int32=long
+fi
+cat >> confdefs.h <<EOF
+#define ZEPHYR_INT32 ${int32}
+EOF
+
+echo "$ac_t""${int32}" 1>&6
+
+echo $ac_n "checking for wslen in -lw""... $ac_c" 1>&6
+echo "configure:2478: checking for wslen in -lw" >&5
+ac_lib_var=`echo w'_'wslen | 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="-lw $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2486 "configure"
+#include "confdefs.h"
+/* 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 wslen();
+
+int main() {
+wslen()
+; return 0; }
+EOF
+if { (eval echo configure:2497: \"$ac_link\") 1>&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 w | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lw $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "configure:2525: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | 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="-ldl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2533 "configure"
+#include "confdefs.h"
+/* 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 dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo configure:2544: \"$ac_link\") 1>&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 dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-ldl $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+# If we can't find connect, try looking in -lsocket and -lnsl. The
+# Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
+# libsocket.so which has a bad implementation of gethostbyname (it
+# only looks in /etc/hosts), so we only look for -lsocket if we need
+# it.
+echo $ac_n "checking for connect""... $ac_c" 1>&6
+echo "configure:2578: checking for connect" >&5
+if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2583 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char connect(); below. */
+#include <assert.h>
+/* 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 connect();
+
+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_connect) || defined (__stub___connect)
+choke me
+#else
+connect();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_connect=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_connect=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
+echo "configure:2624: checking for socket in -lsocket" >&5
+ac_lib_var=`echo socket'_'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="-lsocket $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2632 "configure"
+#include "confdefs.h"
+/* 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() {
+socket()
+; return 0; }
+EOF
+if { (eval echo configure:2643: \"$ac_link\") 1>&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 <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lsocket $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+echo "configure:2671: checking for gethostbyname in -lnsl" >&5
+ac_lib_var=`echo nsl'_'gethostbyname | 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 <<EOF
+#line 2679 "configure"
+#include "confdefs.h"
+/* 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 gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:2690: \"$ac_link\") 1>&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 <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lnsl $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+
+# Hesiod needs -lresolv on Sun systems for res_send.
+if test "$hesiod" != "no"; then
+ echo $ac_n "checking for strerror in -l44bsd""... $ac_c" 1>&6
+echo "configure:2723: checking for strerror in -l44bsd" >&5
+ac_lib_var=`echo 44bsd'_'strerror | 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="-l44bsd $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2731 "configure"
+#include "confdefs.h"
+/* 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 strerror();
+
+int main() {
+strerror()
+; return 0; }
+EOF
+if { (eval echo configure:2742: \"$ac_link\") 1>&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 44bsd | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-l44bsd $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for res_send in -lresolv""... $ac_c" 1>&6
+echo "configure:2770: checking for res_send in -lresolv" >&5
+ac_lib_var=`echo resolv'_'res_send | 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="-lresolv $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2778 "configure"
+#include "confdefs.h"
+/* 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 res_send();
+
+int main() {
+res_send()
+; return 0; }
+EOF
+if { (eval echo configure:2789: \"$ac_link\") 1>&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 resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lresolv $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+echo $ac_n "checking for tgetstr in -lcurses""... $ac_c" 1>&6
+echo "configure:2819: checking for tgetstr in -lcurses" >&5
+ac_lib_var=`echo curses'_'tgetstr | 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="-lcurses $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2827 "configure"
+#include "confdefs.h"
+/* 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 tgetstr();
+
+int main() {
+tgetstr()
+; return 0; }
+EOF
+if { (eval echo configure:2838: \"$ac_link\") 1>&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
+ TLIB=-lcurses
+else
+ echo "$ac_t""no" 1>&6
+TLIB=-ltermcap
+fi
+
+echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
+echo "configure:2860: checking for regcmp in -lgen" >&5
+ac_lib_var=`echo gen'_'regcmp | 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 <<EOF
+#line 2868 "configure"
+#include "confdefs.h"
+/* 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 regcmp();
+
+int main() {
+regcmp()
+; return 0; }
+EOF
+if { (eval echo configure:2879: \"$ac_link\") 1>&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
+ RLIB=-lgen
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for srcsrpy in -lsrc""... $ac_c" 1>&6
+echo "configure:2900: checking for srcsrpy in -lsrc" >&5
+ac_lib_var=`echo src'_'srcsrpy | 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="-lsrc $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2908 "configure"
+#include "confdefs.h"
+/* 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 srcsrpy();
+
+int main() {
+srcsrpy()
+; return 0; }
+EOF
+if { (eval echo configure:2919: \"$ac_link\") 1>&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
+ SLIB=-lsrc; cat >> confdefs.h <<\EOF
+#define HAVE_SRC 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+
+
+
+if test "$hesiod" != "no"; then
+ if test "$hesiod" != "yes"; then
+ CPPFLAGS="${CPPFLAGS} -I${hesiod}/include"
+ LDFLAGS="${LDFLAGS} -L${hesiod}/lib"
+ fi
+ cat >> confdefs.h <<\EOF
+#define ZEPHYR_USES_HESIOD 1
+EOF
+
+ echo $ac_n "checking for hes_resolve in -lhesiod""... $ac_c" 1>&6
+echo "configure:2956: checking for hes_resolve in -lhesiod" >&5
+ac_lib_var=`echo hesiod'_'hes_resolve | 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="-lhesiod $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2964 "configure"
+#include "confdefs.h"
+/* 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 hes_resolve();
+
+int main() {
+hes_resolve()
+; return 0; }
+EOF
+if { (eval echo configure:2975: \"$ac_link\") 1>&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="-lhesiod ${LIBS}"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for hes_resolve""... $ac_c" 1>&6
+echo "configure:2994: checking for hes_resolve" >&5
+if eval "test \"`echo '$''{'ac_cv_func_hes_resolve'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2999 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char hes_resolve(); below. */
+#include <assert.h>
+/* 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 hes_resolve();
+
+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_hes_resolve) || defined (__stub___hes_resolve)
+choke me
+#else
+hes_resolve();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_hes_resolve=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_hes_resolve=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'hes_resolve`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+,,
+ { echo "configure: error: Hesiod library not found" 1>&2; exit 1; }
+fi
+
+fi
+
+if test "$kerberos" != "no"; then
+ if test "$kerberos" != "yes"; then
+ CPPFLAGS="${CPPFLAGS} -I${kerberos}/include"
+ LDFLAGS="${LDFLAGS} -L${kerberos}/lib"
+ fi
+ cat >> confdefs.h <<\EOF
+#define ZEPHYR_USES_KERBEROS 1
+EOF
+
+ echo $ac_n "checking for krb_mk_req in -lkrb""... $ac_c" 1>&6
+echo "configure:3056: checking for krb_mk_req in -lkrb" >&5
+ac_lib_var=`echo krb'_'krb_mk_req | 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 <<EOF
+#line 3064 "configure"
+#include "confdefs.h"
+/* 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 krb_mk_req();
+
+int main() {
+krb_mk_req()
+; return 0; }
+EOF
+if { (eval echo configure:3075: \"$ac_link\") 1>&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 krb | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lkrb $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+{ echo "configure: error: Kerberos library not found" 1>&2; exit 1; }
+fi
+
+ LIBS="-lkrb -ldes ${LIBS}"
+else
+ echo "configure: warning: compiling without Kerberos support; Zephyr will be insecure." 1>&2
+fi
+
+if test $ac_cv_prog_gcc = yes; then
+ echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
+echo "configure:3110: 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 <<EOF
+#line 3116 "configure"
+#include "confdefs.h"
+#include <sgtty.h>
+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 <<EOF
+#line 3134 "configure"
+#include "confdefs.h"
+#include <termio.h>
+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 vprintf""... $ac_c" 1>&6
+echo "configure:3156: 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 <<EOF
+#line 3161 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char vprintf(); below. */
+#include <assert.h>
+/* 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:3184: \"$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:3208: 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 <<EOF
+#line 3213 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char _doprnt(); below. */
+#include <assert.h>
+/* 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:3236: \"$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 working regcomp""... $ac_c" 1>&6
+echo "configure:3261: checking for working regcomp" >&5
+if eval "test \"`echo '$''{'zephyr_cv_func_regcomp'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ zephyr_cv_func_regcomp=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3269 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <regex.h>
+int main()
+{
+ regex_t reg;
+ int retval;
+ char errbuf[512];
+
+ retval = regcomp(&reg, "[Ff]rom:", REG_EXTENDED | REG_NOSUB);
+ exit(retval != 0);
+}
+
+EOF
+if { (eval echo configure:3285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ zephyr_cv_func_regcomp=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ zephyr_cv_func_regcomp=no
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$zephyr_cv_func_regcomp" 1>&6
+if test $zephyr_cv_func_regcomp = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_REGCOMP 1
+EOF
+
+fi
+for ac_func in putenv re_comp strchr memcpy memmove waitpid getlogin
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3308: 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 <<EOF
+#line 3313 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* 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:3336: \"$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 <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in strerror random lrand48 gethostid krb_get_err_text krb_log
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3363: 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 <<EOF
+#line 3368 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* 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:3391: \"$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 <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+
+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 <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/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 clients/Makefile clients/syslogd/Makefile
+ clients/xzwrite/Makefile clients/zaway/Makefile clients/zctl/Makefile
+ clients/zleave/Makefile clients/zlocate/Makefile
+ clients/zmailnotify/Makefile clients/znol/Makefile
+ clients/zpopnotify/Makefile clients/zshutdown_notify/Makefile
+ clients/zstat/Makefile clients/zwgc/Makefile clients/zwrite/Makefile
+ lib/Makefile lib/dyn/Makefile lib/et/Makefile lib/ss/Makefile
+ lib/zephyr/Makefile server/Makefile zhm/Makefile
+ clients/xzwrite/XZwrite clients/zwgc/zephyr.vars h/config.h h/zephyr/zephyr.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > 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%@confdir@%$confdir%g
+s%@lsbindir@%$lsbindir%g
+s%@SUPPORT_LIBS@%$SUPPORT_LIBS%g
+s%@ET_LDFLAGS@%$ET_LDFLAGS%g
+s%@ETDEP@%$ETDEP%g
+s%@SS_LDFLAGS@%$SS_LDFLAGS%g
+s%@SSDEP@%$SSDEP%g
+s%@COMPILE_ET@%$COMPILE_ET%g
+s%@MK_CMDS@%$MK_CMDS%g
+s%@INITPROGS@%$INITPROGS%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@CC@%$CC%g
+s%@YACC@%$YACC%g
+s%@LEX@%$LEX%g
+s%@LEXLIB@%$LEXLIB%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@RANLIB@%$RANLIB%g
+s%@CPP@%$CPP%g
+s%@X_CFLAGS@%$X_CFLAGS%g
+s%@X_PRE_LIBS@%$X_PRE_LIBS%g
+s%@X_LIBS@%$X_LIBS%g
+s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
+s%@XCLIENTS@%$XCLIENTS%g
+s%@ZWGC_LIBX11@%$ZWGC_LIBX11%g
+s%@TLIB@%$TLIB%g
+s%@RLIB@%$RLIB%g
+s%@SLIB@%$SLIB%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 <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile clients/Makefile clients/syslogd/Makefile
+ clients/xzwrite/Makefile clients/zaway/Makefile clients/zctl/Makefile
+ clients/zleave/Makefile clients/zlocate/Makefile
+ clients/zmailnotify/Makefile clients/znol/Makefile
+ clients/zpopnotify/Makefile clients/zshutdown_notify/Makefile
+ clients/zstat/Makefile clients/zwgc/Makefile clients/zwrite/Makefile
+ lib/Makefile lib/dyn/Makefile lib/et/Makefile lib/ss/Makefile
+ lib/zephyr/Makefile server/Makefile zhm/Makefile
+ clients/xzwrite/XZwrite clients/zwgc/zephyr.vars"}
+EOF
+cat >> $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 <<EOF
+ CONFIG_HEADERS="h/config.h h/zephyr/zephyr.h"
+EOF
+cat >> $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 <<CEOF' >> $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 <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+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 0000000..9b12934
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,182 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(server/server.c)
+
+if test ! -d h; then mkdir h; fi
+if test ! -d h/zephyr; then mkdir h/zephyr; fi
+
+dnl Command-line option to enable Athena paths.
+AC_ARG_ENABLE(athena,
+ [ --enable-athena Use Athena defaults],
+ [hesiod=yes
+ kerberos=yes
+ if test "${prefix}" = "NONE"; then prefix=/usr/athena; fi
+ datadir=${datadir-'$(prefix)/lib/zephyr'}
+ confdir=${confdir-'/etc/athena/zephyr'}
+ sbindir=${sbindir-'$(exec_prefix)/etc'}
+ lsbindir=${lsbindir-'/etc/athena'}
+ COMPILE_ET=compile_et
+ MK_CMDS=mk_cmds
+ CPPFLAGS="${CPPFLAGS} -I/usr/athena/include"
+ LDFLAGS="${LDFLAGS} -L/usr/athena/lib"
+ INITPROGS=${lsbindir}/zinit],
+ [datadir=${datadir-'$(prefix)/share/zephyr'}
+ confdir=${confdir-'$(prefix)/etc/zephyr'}
+ sbindir=${sbindir-'$(exec_prefix)/sbin'}
+ lsbindir=${lsbindir-'$(exec_prefix)/sbin'}
+ SUPPORT_LIBS="et ss"
+ ET_LDFLAGS='-L$(BUILDTOP)/lib/et'
+ ETDEP='$(BUILDTOP)/lib/et/libcom_err.a'
+ SS_LDFLAGS='-L$(BUILDTOP)/lib/ss'
+ SSDEP='$(BUILDTOP)/lib/ss/libss.a'
+ COMPILE_ET='$(BUILDTOP)/lib/et/compile_et'
+ MK_CMDS='$(BUILDTOP)/lib/ss/mk_cmds'
+ INITPROGS=true
+ if test ! -d h/ss; then mkdir h/ss; fi
+ cp ${srcdir}/lib/et/com_err.h h
+ cp ${srcdir}/lib/ss/*.h h/ss])
+
+AC_SUBST(confdir)
+AC_SUBST(datadir)
+AC_SUBST(sbindir)
+AC_SUBST(lsbindir)
+AC_SUBST(SUPPORT_LIBS)
+AC_SUBST(ET_LDFLAGS)
+AC_SUBST(ETDEP)
+AC_SUBST(SS_LDFLAGS)
+AC_SUBST(SSDEP)
+AC_SUBST(COMPILE_ET)
+AC_SUBST(MK_CMDS)
+AC_SUBST(INITPROGS)
+
+AC_CANONICAL_SYSTEM
+AC_DEFINE_UNQUOTED(MACHINE_TYPE, "$host")
+
+dnl Command-line option to enable Hesiod support
+AC_ARG_WITH(hesiod,
+ [ --with-hesiod=PREFIX Compile with Hesiod support],
+ [hesiod="$withval"], [hesiod=${hesiod-no}])
+
+dnl Command-line option to enable Kerberos support
+AC_ARG_WITH(krb4,
+ [ --with-krb4=PREFIX Compile with Kerberos 4 support],
+ [kerberos="$withval"], [kerberos=${kerberos-no}])
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_YACC
+AC_PROG_LEX
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+
+AC_MSG_CHECKING(location of temporary directory)
+if test -d /var/tmp; then
+ found_tmp=/var/tmp/
+elif test -d /usr/tmp; then
+ found_tmp=/usr/tmp/
+else
+ found_tmp=/tmp/
+fi
+AC_DEFINE_UNQUOTED(FOUND_TMP, "${found_tmp}")
+AC_MSG_RESULT(${found_tmp})
+
+dnl Checks for header files.
+AC_PATH_XTRA
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(fcntl.h paths.h termios.h sgtty.h unistd.h libgen.h malloc.h)
+AC_CHECK_HEADERS(sys/filio.h sys/ioctl.h sys/time.h sys/file.h sys/utsname.h)
+AC_CHECK_HEADERS(sys/select.h sys/msgbuf.h sys/cdefs.h)
+
+if test "$no_x" != "yes"; then
+ XCLIENTS=xzwrite
+ ZWGC_LIBX11=-lX11
+fi
+AC_SUBST(XCLIENTS)
+AC_SUBST(ZWGC_LIBX11)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_SIGNAL
+AC_TYPE_UID_T
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_MSG_CHECKING(for 32-bit integer type)
+if test "$ac_cv_sizeof_long" = 4; then
+ int32=long
+elif test "$ac_cv_sizeof_int" = 4; then
+ int32=int
+elif test "$ac_cv_sizeof_short" = 4; then
+ int32=short
+else
+ AC_WARN([Can't find 32-bit type, using long])
+ int32=long
+fi
+AC_DEFINE_UNQUOTED(ZEPHYR_INT32, ${int32})
+AC_MSG_RESULT(${int32})
+
+AC_CHECK_LIB(w, wslen)
+AC_CHECK_LIB(dl, dlopen)
+
+# If we can't find connect, try looking in -lsocket and -lnsl. The
+# Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
+# libsocket.so which has a bad implementation of gethostbyname (it
+# only looks in /etc/hosts), so we only look for -lsocket if we need
+# it.
+AC_CHECK_FUNC(connect, :, [AC_CHECK_LIB(socket, socket)
+ AC_CHECK_LIB(nsl, gethostbyname)])
+
+# Hesiod needs -lresolv on Sun systems for res_send.
+if test "$hesiod" != "no"; then
+ AC_CHECK_LIB(44bsd, strerror)
+ AC_CHECK_LIB(resolv, res_send)
+fi
+
+AC_CHECK_LIB(curses, tgetstr, [TLIB=-lcurses], [TLIB=-ltermcap])
+AC_CHECK_LIB(gen, regcmp, [RLIB=-lgen])
+AC_CHECK_LIB(src, srcsrpy, [SLIB=-lsrc; AC_DEFINE(HAVE_SRC)])
+AC_SUBST(TLIB)
+AC_SUBST(RLIB)
+AC_SUBST(SLIB)
+
+if test "$hesiod" != "no"; then
+ if test "$hesiod" != "yes"; then
+ CPPFLAGS="${CPPFLAGS} -I${hesiod}/include"
+ LDFLAGS="${LDFLAGS} -L${hesiod}/lib"
+ fi
+ AC_DEFINE(ZEPHYR_USES_HESIOD)
+ AC_CHECK_LIB(hesiod, hes_resolve, LIBS="-lhesiod ${LIBS}",
+ [AC_CHECK_FUNC(hes_resolve),,
+ AC_ERROR(Hesiod library not found)])
+fi
+
+if test "$kerberos" != "no"; then
+ if test "$kerberos" != "yes"; then
+ CPPFLAGS="${CPPFLAGS} -I${kerberos}/include"
+ LDFLAGS="${LDFLAGS} -L${kerberos}/lib"
+ fi
+ AC_DEFINE(ZEPHYR_USES_KERBEROS)
+ AC_CHECK_LIB(krb, krb_mk_req,,
+ [AC_ERROR(Kerberos library not found)], -ldes)
+ LIBS="-lkrb -ldes ${LIBS}"
+else
+ AC_WARN(compiling without Kerberos support; Zephyr will be insecure.)
+fi
+
+dnl Checks for library functions.
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_VPRINTF
+ZEPHYR_FUNC_REGCOMP
+AC_CHECK_FUNCS(putenv re_comp strchr memcpy memmove waitpid getlogin)
+AC_CHECK_FUNCS(strerror random lrand48 gethostid krb_get_err_text krb_log)
+
+AC_CONFIG_HEADER(h/config.h h/zephyr/zephyr.h)
+AC_OUTPUT(Makefile clients/Makefile clients/syslogd/Makefile
+ clients/xzwrite/Makefile clients/zaway/Makefile clients/zctl/Makefile
+ clients/zleave/Makefile clients/zlocate/Makefile
+ clients/zmailnotify/Makefile clients/znol/Makefile
+ clients/zpopnotify/Makefile clients/zshutdown_notify/Makefile
+ clients/zstat/Makefile clients/zwgc/Makefile clients/zwrite/Makefile
+ lib/Makefile lib/dyn/Makefile lib/et/Makefile lib/ss/Makefile
+ lib/zephyr/Makefile server/Makefile zhm/Makefile
+ clients/xzwrite/XZwrite clients/zwgc/zephyr.vars)
+
diff --git a/ensure-dir.sh b/ensure-dir.sh
new file mode 100755
index 0000000..34f03ac
--- /dev/null
+++ b/ensure-dir.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+pathname=$1
+mode=$2
+OLDIFS="${IFS}"; IFS=/; set $pathname; IFS="${OLDIFS}"
+
+case $pathname in
+ /*) partial=/; ;;
+ *) partial=""; ;;
+esac
+
+for i do
+ case i in "") continue; ;; esac
+ partial="${partial}${i}"
+ if [ ! -d ${partial} ]; then
+ mkdir ${partial} || exit 1;
+ chmod ${mode} ${partial}
+ fi
+ partial="${partial}/"
+done
+
diff --git a/h/Imakefile b/h/Imakefile
deleted file mode 100644
index b2260ad..0000000
--- a/h/Imakefile
+++ /dev/null
@@ -1,11 +0,0 @@
-/**/# Copyright 1988,1991 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Zephyr: Imakefile,v 1.1 89/03/23 17:21:13 jtkohl Exp $
-/**/#
-
-#define ISUBDIRS zephyr
diff --git a/h/config.h.in b/h/config.h.in
new file mode 100644
index 0000000..4acfd77
--- /dev/null
+++ b/h/config.h.in
@@ -0,0 +1,163 @@
+/* h/config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define if you don't have vprintf but do have _doprnt. */
+#undef HAVE_DOPRNT
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if you have the vprintf function. */
+#undef HAVE_VPRINTF
+
+/* 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 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define to compile with Hesiod support. */
+#undef ZEPHYR_USES_HESIOD
+
+/* Define to compile with Kerberos support. */
+#undef ZEPHYR_USES_KERBEROS
+
+/* Define to a signed 32-bit integral type. */
+#define ZEPHYR_INT32 long
+
+/* Define if you have the System Resource Controller library. */
+#undef HAVE_SRC
+
+/* Define to "unsigned long" if your system headers don't. */
+#undef ulong
+
+/* Define to a temporary directory on your system. */
+#define FOUND_TMP "/var/tmp"
+
+/* Define to the type of the host system. */
+#define MACHINE_TYPE "unknown"
+
+/* Define if `regcomp' exists and works. */
+#undef HAVE_REGCOMP
+
+/* The number of bytes in a int. */
+#undef SIZEOF_INT
+
+/* The number of bytes in a long. */
+#undef SIZEOF_LONG
+
+/* The number of bytes in a short. */
+#undef SIZEOF_SHORT
+
+/* Define if you have the gethostid function. */
+#undef HAVE_GETHOSTID
+
+/* Define if you have the getlogin function. */
+#undef HAVE_GETLOGIN
+
+/* Define if you have the krb_get_err_text function. */
+#undef HAVE_KRB_GET_ERR_TEXT
+
+/* Define if you have the krb_log function. */
+#undef HAVE_KRB_LOG
+
+/* Define if you have the lrand48 function. */
+#undef HAVE_LRAND48
+
+/* 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 putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the random function. */
+#undef HAVE_RANDOM
+
+/* Define if you have the re_comp function. */
+#undef HAVE_RE_COMP
+
+/* Define if you have the strchr function. */
+#undef HAVE_STRCHR
+
+/* Define if you have the strerror function. */
+#undef HAVE_STRERROR
+
+/* Define if you have the waitpid function. */
+#undef HAVE_WAITPID
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <libgen.h> header file. */
+#undef HAVE_LIBGEN_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <paths.h> header file. */
+#undef HAVE_PATHS_H
+
+/* Define if you have the <sgtty.h> header file. */
+#undef HAVE_SGTTY_H
+
+/* Define if you have the <sys/cdefs.h> header file. */
+#undef HAVE_SYS_CDEFS_H
+
+/* Define if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
+/* Define if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define if you have the <sys/msgbuf.h> header file. */
+#undef HAVE_SYS_MSGBUF_H
+
+/* Define if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
+/* Define if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
+/* Define if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the dl library (-ldl). */
+#undef HAVE_LIBDL
+
+/* Define if you have the krb library (-lkrb). */
+#undef HAVE_LIBKRB
+
+/* Define if you have the nsl library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define if you have the resolv library (-lresolv). */
+#undef HAVE_LIBRESOLV
+
+/* Define if you have the socket library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
+/* Define if you have the w library (-lw). */
+#undef HAVE_LIBW
diff --git a/libdyn/dyn.h b/h/dyn.h
index 25a9a8a..6823b75 100644
--- a/libdyn/dyn.h
+++ b/h/dyn.h
@@ -19,13 +19,12 @@
#ifndef _Dyn_h
#define _Dyn_h
-#ifdef notdef
-typedef void *DynPtr;
-#else
-typedef char *DynPtr;
-#endif
+/* Reliance on <sysdep.h> for __P() below makes this unsuitable for use
+ * outside of the Zephyr source tree. */
+#include <sysdep.h>
-typedef struct _DynObject DynObjectRec, *DynObject;
+typedef char *DynPtr;
+typedef struct _DynObject *DynObject;
/* Function macros */
#define DynHigh(obj) (DynSize(obj) - 1)
@@ -42,10 +41,16 @@ typedef struct _DynObject DynObjectRec, *DynObject;
#define DYN_BADVALUE -1003
/* Function declarations */
-DynObject DynCreate();
-int DynAdd(), DynDelete(), DynDestroy(), DynDebug();
-int DynInsert(), DynParanoid();
-DynPtr DynGet();
+int DynAppend __P((DynObject obj, DynPtr els, int num));
+int DynAdd __P((DynObject obj, DynPtr el));
+DynObject DynCreate __P((int el_size, int inc));
+int DynDebug __P((DynObject obj, int state));
+int DynDelete __P((DynObject obj, int idx));
+int DynDestroy __P((DynObject obj));
+DynPtr DynGet __P((DynObject obj, int num));
+int DynInsert __P((DynObject obj, int idx, DynPtr els, int num));
+int DynParanoid __P((DynObject obj, int state));
+int DynSize __P((DynObject obj));
#endif /* _Dyn_h */
/* DO NOT ADD ANYTHING AFTER THIS #endif */
diff --git a/h/internal.h b/h/internal.h
new file mode 100644
index 0000000..abbf298
--- /dev/null
+++ b/h/internal.h
@@ -0,0 +1,96 @@
+
+#ifndef __INTERNAL_H__
+#define __INTERNAL_H__
+
+#include <sysdep.h>
+#include <zephyr/zephyr.h>
+#include <netdb.h>
+
+#ifdef ZEPHYR_USES_HESIOD
+#include <hesiod.h>
+#endif
+
+#ifndef ZEPHYR_USES_KERBEROS
+#define REALM_SZ MAXHOSTNAMELEN
+#define INST_SZ 0 /* no instances w/o Kerberos */
+#define ANAME_SZ 9 /* size of a username + null */
+#define CLOCK_SKEW 300 /* max time to cache packet ids */
+#endif
+
+#define SERVER_SVC_FALLBACK htons((unsigned short) 2103)
+#define HM_SVC_FALLBACK htons((unsigned short) 2104)
+#define HM_SRV_SVC_FALLBACK htons((unsigned short) 2105)
+
+#define ZAUTH_CKSUM_FAILED (-2) /* Used only by server. */
+#define ZAUTH_UNSET (-3) /* Internal to client library. */
+#define Z_MAXFRAGS 500 /* Max number of packet fragments */
+#define Z_MAXNOTICESIZE 400000 /* Max size of incoming notice */
+#define Z_MAXQUEUESIZE 1500000 /* Max size of input queue notices */
+#define Z_FRAGFUDGE 13 /* Room to for multinotice field */
+#define Z_NOTICETIMELIMIT 30 /* Time to wait for fragments */
+#define Z_INITFILTERSIZE 30 /* Starting size of uid filter */
+
+struct _Z_Hole {
+ struct _Z_Hole *next;
+ int first;
+ int last;
+};
+
+struct _Z_InputQ {
+ struct _Z_InputQ *next;
+ struct _Z_InputQ *prev;
+ ZNotice_Kind_t kind;
+ unsigned ZEPHYR_INT32 timep;
+ int packet_len;
+ char *packet;
+ int complete;
+ struct sockaddr_in from;
+ struct _Z_Hole *holelist;
+ ZUnique_Id_t uid;
+ int auth;
+ int header_len;
+ char *header;
+ int msg_len;
+ char *msg;
+};
+
+extern struct _Z_InputQ *__Q_Head, *__Q_Tail;
+
+extern int __Zephyr_open; /* 0 if FD opened, 1 otherwise */
+extern int __HM_set; /* 0 if dest addr set, 1 otherwise */
+extern int __Zephyr_server; /* 0 if normal client, 1 if server or zhm */
+
+extern ZLocations_t *__locate_list;
+extern int __locate_num;
+extern int __locate_next;
+
+extern ZSubscription_t *__subscriptions_list;
+extern int __subscriptions_num;
+extern int __subscriptions_next;
+
+extern int __Zephyr_port; /* Port number */
+
+typedef Code_t (*Z_SendProc) __P((ZNotice_t *, char *, int, int));
+
+struct _Z_InputQ *Z_GetFirstComplete __P((void));
+struct _Z_InputQ *Z_GetNextComplete __P((struct _Z_InputQ *));
+Code_t Z_XmitFragment __P((ZNotice_t*, char *,int,int));
+void Z_RemQueue __P((struct _Z_InputQ *));
+Code_t Z_AddNoticeToEntry __P((struct _Z_InputQ*, ZNotice_t*, int));
+Code_t Z_FormatAuthHeader __P((ZNotice_t *, char *, int, int *, Z_AuthProc));
+Code_t Z_FormatHeader __P((ZNotice_t *, char *, int, int *, Z_AuthProc));
+Code_t Z_FormatRawHeader __P((ZNotice_t *, char*, int,
+ int*, char **, char **));
+Code_t Z_ReadEnqueue __P((void));
+Code_t Z_ReadWait __P((void));
+Code_t Z_SendLocation __P((char*, char*, Z_AuthProc, char*));
+Code_t Z_SendFragmentedNotice __P((ZNotice_t *notice, int len,
+ Z_AuthProc cert_func,
+ Z_SendProc send_func));
+Code_t Z_WaitForComplete __P((void));
+Code_t Z_WaitForNotice __P((ZNotice_t *notice,
+ int (*pred) __P((ZNotice_t *, void *)), void *arg,
+ int timeout));
+
+#endif /* __INTERNAL_H__ */
+
diff --git a/h/sysdep.h b/h/sysdep.h
new file mode 100644
index 0000000..d39e85e
--- /dev/null
+++ b/h/sysdep.h
@@ -0,0 +1,193 @@
+/* This file is part of the Project Athena Zephyr Notification System.
+ * It contains system-dependent header code.
+ *
+ * Created by: Greg Hudson
+ *
+ * $Source$
+ * $Author$
+ * $Zephyr: /mit/zephyr/src/include/zephyr/RCS/zephyr_conf.h,v 1.8 90/12/21 17:40:40 raeburn Exp $
+ *
+ * Copyright (c) 1988,1991 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, see the file
+ * "mit-copyright.h".
+ */
+
+#ifndef __SYSDEP_H__
+#define __SYSDEP_H__
+
+#include <config.h>
+#include <stdio.h>
+#include <errno.h>
+#include <ctype.h>
+#include <time.h>
+#include <signal.h>
+#include <syslog.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <sys/time.h>
+
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#else
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+char *malloc(), *realloc();
+# endif
+char *getenv(), *strerror(), *ctime(), *strcpy();
+time_t time();
+ZEPHYR_INT32 random();
+#endif
+
+#ifndef HAVE_RANDOM
+#ifdef HAVE_LRAND48
+#define random lrand48
+#define srandom srand48
+#else
+#define random rand
+#define srandom srand
+#endif
+#endif
+
+#ifndef HAVE_STRERROR
+extern char *sys_errlist[];
+# define strerror(x) (sys_errlist[(x)])
+#endif
+
+/* Strings. */
+#ifdef STDC_HEADERS
+# include <string.h>
+#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 memcmp bcmp
+# endif
+# ifndef HAVE_MEMMOVE
+# define memmove(d, s, n) bcopy ((s), (d), (n))
+# endif
+#endif
+
+/* Exit status handling and wait(). */
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+#ifdef HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* Because we have public header files (and our prototypes need to agree with
+ * those header files), use __STDC__ to guess whether the compiler can handle
+ * stdarg, const, and prototypes. */
+#ifdef __STDC__
+# include <stdarg.h>
+# define VA_START(ap, last) va_start(ap, last)
+# ifndef __P
+# define __P(x) x
+# endif
+#else
+# include <varargs.h>
+# define VA_START(ap, last) va_start(ap)
+# define const
+# ifndef __P
+# define __P(x) ()
+# endif
+#endif
+
+/* openlog(). */
+#ifdef LOG_AUTH
+/* A decent syslog */
+#define OPENLOG(str, opts, facility) openlog(str, opts, facility)
+#else
+/* Probably a 4.2-type syslog */
+#define OPENLOG(str, opts, facility) openlog(str, opts)
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#ifdef HAVE_PATHS_H
+# include <paths.h>
+# define TEMP_DIRECTORY _PATH_VARTMP
+#else
+# define TEMP_DIRECTORY FOUND_TMP
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#else
+# ifdef HAVE_SYS_FILE_H
+# include <sys/file.h>
+# endif
+uid_t getuid();
+char *ttyname();
+#ifdef HAVE_GETHOSTID
+ZEPHYR_INT32 gethostid();
+#endif
+#endif
+
+#ifndef STDIN_FILENO
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+#endif
+
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#else
+# ifdef HAVE_SYS_FILIO_H
+# include <sys/filio.h>
+# else
+# ifdef HAVE_SGTTY_H
+# include <sgtty.h>
+# endif
+# ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+# endif
+# endif
+#endif
+
+/* Kerberos compatibility. */
+#ifdef ZEPHYR_USES_KERBEROS
+# include <krb.h>
+# include <krb_err.h>
+# include <des.h>
+# ifndef HAVE_KRB_GET_ERR_TEXT
+# define krb_get_err_text(n) krb_err_txt[n]
+# endif
+# ifndef HAVE_KRB_LOG
+# define krb_log log
+# endif
+#endif
+
+#ifdef HAVE_SYS_UTSNAME_H
+# include <sys/utsname.h>
+#endif
+
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+
+#ifdef HAVE_SYS_MSGBUF_H
+#include <sys/msgbuf.h>
+#endif
+
+#ifndef MSG_BSIZE
+#define MSG_BSIZE BUFSIZ
+#endif
+
+#endif /* __SYSDEP_H__ */
+
diff --git a/h/zephyr/Imakefile b/h/zephyr/Imakefile
deleted file mode 100644
index cfe36e4..0000000
--- a/h/zephyr/Imakefile
+++ /dev/null
@@ -1,34 +0,0 @@
-/**/# Copyright 1988,1991 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Zephyr: /mit/zephyr/src/include/zephyr/RCS/Imakefile,v 1.4 91/03/21 12:16:56 raeburn Exp $
-/**/#
-
-HDRS= acl.h mit-copyright.h zephyr.h zephyr_conf.h zephyr_internal.h zsyslog.h
-CODE= ${HDRS} Imakefile
-
-all depend:: zephyr_paths.h
-
-clean::
- $(RM) zephyr_paths.h
-
-#ifdef KERBEROS
-HaveKerberos=yes
-#endif
-#ifdef HESIOD
-HaveHesiod=yes
-#endif
-
-#define export_as(var,name) name=$(var) ; export name
-#define export_var(var) export_as(var,var)
-
-zephyr_paths.h: Makefile
- export_as(ZLIBDIR,LIBDIR) ; \
- export_as(ATHBINDIR,CLIENTDIR) ; \
- export_var(HaveKerberos) ; \
- export_var(HaveHesiod) ; \
- $(PTOP)/tools/makepaths > zephyr_paths.h
diff --git a/h/zephyr/mit-copyright.h b/h/zephyr/mit-copyright.h
index 73059b3..9b39b21 100644
--- a/h/zephyr/mit-copyright.h
+++ b/h/zephyr/mit-copyright.h
@@ -1,6 +1,6 @@
/*
-Copyright 1987,1988 by the Massachusetts Institute of Technology
+Copyright 1987,1988,1995 by the Massachusetts Institute of Technology
All rights reserved.
diff --git a/h/zephyr/zephyr.h b/h/zephyr/zephyr.h
deleted file mode 100644
index 50c6b43..0000000
--- a/h/zephyr/zephyr.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains global definitions
- *
- * Created by: Robert French
- *
- * $Source$
- * $Author$
- * $Id$
- *
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of
- * Technology. For copying and distribution information, see the
- * file "mit-copyright.h".
- */
-
-#ifndef __ZEPHYR_H__
-#define __ZEPHYR_H__
-
-#include <zephyr/zephyr_conf.h>
-#include <zephyr/zephyr_err.h>
-
-#include <errno.h>
-#include <sys/types.h>
-#include <time.h>
-#include <sys/time.h>
-#include <stdio.h>
-
-#ifndef va_start /* guaranteed to be a macro */
-#if defined(__STDC__) && !defined(ibm032) &&!defined(SABER)
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#define Z_varargs
-#endif
-#endif
-
-#ifdef Z_HaveKerberos
-#include <krb.h>
-#endif
-
-#ifndef IPPROTO_MAX /* Make sure not already included */
-#include <netinet/in.h>
-#endif
-
-#if defined(__STDC__)
-#define Zproto(X) X
-#define Zconst const
-#else
-#define Zproto(X) ()
-#define Zconst /* const */
-#endif
-
-#define ZVERSIONHDR "ZEPH"
-#define ZVERSIONMAJOR 0
-#define ZVERSIONMINOR 2
-
- /* Types */
-
- /* Maximum size packet we can send */
-#define Z_MAXPKTLEN 1024
-
- /* Packet */
- typedef char ZPacket_t[Z_MAXPKTLEN];
-
- /* Maximum size for a notice header */
-#define Z_MAXHEADERLEN 800
-
- /* Maximum number of unknown fields in ZNotice_t */
-#define Z_MAXOTHERFIELDS 10
-
- /* Authentication levels returned by ZCheckAuthentication */
-#define ZAUTH_FAILED (-1)
-#define ZAUTH_YES 1
-#define ZAUTH_NO 0
-#define ZAUTH_CKSUM_FAILED (-2) /* Used only by server. */
-#define ZAUTH_UNSET (-3) /* Internal to client library. */
-
- /* Packet type */
- typedef enum { UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK,
- CLIENTACK, STAT } ZNotice_Kind_t;
- extern Zconst char *ZNoticeKinds[9];
-
- /* Unique ID format */
- typedef struct _ZUnique_Id_t {
- struct in_addr zuid_addr;
- struct timeval tv;
- } ZUnique_Id_t;
-
- /* Checksum */
- typedef u_long ZChecksum_t;
-
-#define ZNUMFIELDS 17
-
- /* Notice definition */
- typedef struct _ZNotice_t {
- char *z_packet;
- char *z_version;
- ZNotice_Kind_t z_kind;
- ZUnique_Id_t z_uid;
-#define z_sender_addr z_uid.zuid_addr
- struct timeval z_time;
- u_short z_port;
- int z_auth;
- int z_checked_auth;
- int z_authent_len;
- char *z_ascii_authent;
- char *z_class;
- char *z_class_inst;
- char *z_opcode;
- char *z_sender;
- char *z_recipient;
- char *z_default_format;
- char *z_multinotice;
- ZUnique_Id_t z_multiuid;
- ZChecksum_t z_checksum;
- int z_num_other_fields;
- char *z_other_fields[Z_MAXOTHERFIELDS];
- caddr_t z_message;
- int z_message_len;
- } ZNotice_t;
-
- /* Subscription structure */
- typedef struct _ZSubscriptions_t {
- char *zsub_recipient;
- /* The following field used to be named "class", but that
- conflicts with C++ */
- char *zsub_class;
- char *zsub_classinst;
- } ZSubscription_t;
-
- /* Function return code */
- typedef int Code_t;
-
- /* Locations structure */
- typedef struct _ZLocations_t {
- char *host;
- char *time;
- char *tty;
- } ZLocations_t;
-
- typedef struct _ZAsyncLocateData_t {
- char *user;
- ZUnique_Id_t uid;
- char *version;
- } ZAsyncLocateData_t;
-
- /* Predicate for async locate */
- extern int ZCompareALDPred Zproto((ZNotice_t *, char *));
-
- /* Socket file descriptor */
- extern int __Zephyr_fd;
-
- /* Port number */
- extern int __Zephyr_port;
-
- /* Destination (hostmanager, usually) addr */
- extern struct sockaddr_in __HM_addr;
-
- /* for ZQLength */
- extern int __Q_CompleteLength;
-
- /* UNIX error codes */
- extern int errno;
-
- /* for ZSetDebug */
-#ifdef Z_DEBUG
- extern void (*__Z_debug_print) Zproto((const char *fmt, va_list args,
- void *closure));
- extern void *__Z_debug_print_closure;
-#endif
-
-#ifdef Z_HaveKerberos
- /* Kerberos error table base */
- extern int krb_err_base;
-
- /* for ZGetRealm */
- extern char __Zephyr_realm[];
-
- /* Session key for last parsed packet - server only */
- extern C_Block __Zephyr_session;
-#else
- /* for ZGetRealm -- you can change this, if you care... */
-#define __Zephyr_realm ("local-realm")
-#endif
-
- /* ZCompareUIDPred definition */
- extern int ZCompareUIDPred Zproto((ZNotice_t *, ZUnique_Id_t *)),
- ZCompareMultiUIDPred Zproto((ZNotice_t *, ZUnique_Id_t *));
-
- /* Defines for ZFormatNotice, et al. */
- typedef Code_t (*Z_AuthProc) Zproto((ZNotice_t*, char *, int, int *));
- extern Code_t ZMakeAuthentication Zproto((ZNotice_t*, char *,int, int*));
-
- /* Random declarations */
- extern char *ZGetSender Zproto((void)), *ZGetVariable Zproto((char *));
- extern int ZGetWGPort Zproto((void));
- extern Code_t ZSetDestAddr Zproto ((struct sockaddr_in *));
- extern Code_t ZFormatNoticeList Zproto((ZNotice_t*, char**, int,
- char **, int*, Z_AuthProc));
- extern Code_t ZParseNotice Zproto((char*, int, ZNotice_t *));
- extern Code_t ZReadAscii Zproto((char*, int, unsigned char*, int));
- extern Code_t ZSendPacket Zproto((char*, int, int));
- extern Code_t ZSendList Zproto((ZNotice_t*, char *[], int, Z_AuthProc));
- extern Code_t ZFormatNotice Zproto((ZNotice_t*, char**, int*, Z_AuthProc));
- extern Code_t ZFormatSmallNotice Zproto ((ZNotice_t*, ZPacket_t, int*,
- Z_AuthProc));
- extern Code_t ZLocateUser Zproto((char *, int *, Z_AuthProc));
- extern Code_t ZRequestLocations Zproto((char *, ZAsyncLocateData_t *, ZNotice_Kind_t, Z_AuthProc));
- extern Code_t ZInitialize Zproto ((void));
- extern Code_t ZSetServerState Zproto((int));
- extern Code_t ZSetFD Zproto ((int));
- extern Code_t ZFormatSmallRawNotice Zproto ((ZNotice_t*, ZPacket_t, int*));
- extern int ZCompareUID Zproto ((ZUnique_Id_t*, ZUnique_Id_t*));
- extern Code_t ZSrvSendRawList Zproto ((ZNotice_t*, char*[], int,
- Code_t (*)(ZNotice_t *, char *,
- int, int)));
- extern Code_t ZMakeAscii Zproto ((char*, int, unsigned char*, int));
- extern Code_t ZReceivePacket Zproto ((ZPacket_t, int*,
- struct sockaddr_in*));
- extern Code_t ZCheckAuthentication Zproto ((ZNotice_t*,
- struct sockaddr_in*));
-#ifdef Z_HaveKerberos
- extern Code_t ZFormatAuthenticNotice Zproto ((ZNotice_t*, char*, int,
- int*, C_Block));
-#endif
- extern Code_t ZFormatRawNotice Zproto ((ZNotice_t *, char**, int *));
-#ifdef Z_DEBUG
-#ifndef Z_varargs
- extern void Z_debug Zproto ((const char *, ...));
-#else
- extern void Z_debug ();
-#endif
-#endif
-
- /* Compatibility */
-#define ZNewLocateUser ZLocateUser
-
-#ifdef Z_HaveKerberos
- /* ZGetSession() macro */
-#define ZGetSession() (__Zephyr_session)
-#endif
-
- /* ZGetFD() macro */
- extern int ZGetFD ();
-#define ZGetFD() __Zephyr_fd
-
- /* ZQLength macro */
- extern int ZQLength ();
-#define ZQLength() __Q_CompleteLength
-
- /* ZGetDestAddr() macro */
- extern struct sockaddr_in ZGetDestAddr ();
-#define ZGetDestAddr() __HM_addr
-
- /* ZGetRealm() macro */
- extern Zconst char * ZGetRealm ();
-#define ZGetRealm() __Zephyr_realm
-
- /* ZSetDebug() macro */
-#ifdef Z_DEBUG
- extern void ZSetDebug Zproto ((void (*)(const char *, va_list, void *),
- void *));
-#define ZSetDebug(proc,closure) (__Z_debug_print=(proc), \
- __Z_debug_print_closure=(closure), \
- (void) 0)
-#else
-#define ZSetDebug(proc,closure)
-#endif
-
- /* Maximum queue length */
-#define Z_MAXQLEN 30
-
- /* Successful function return */
-#define ZERR_NONE 0
-
- /* Hostmanager wait time (in secs) */
-#define HM_TIMEOUT 10
-
- /* Server wait time (in secs) */
-#define SRV_TIMEOUT 30
-
-#define ZAUTH (ZMakeAuthentication)
-#define ZNOAUTH ((Z_AuthProc)0)
-
- /* Packet strings */
-
-#define ZSRVACK_SENT "SENT" /* SERVACK codes */
-#define ZSRVACK_NOTSENT "LOST"
-#define ZSRVACK_FAIL "FAIL"
-
- /* Server internal class */
-#define ZEPHYR_ADMIN_CLASS "ZEPHYR_ADMIN" /* Class */
-
- /* Control codes sent to a server */
-#define ZEPHYR_CTL_CLASS "ZEPHYR_CTL" /* Class */
-
-#define ZEPHYR_CTL_CLIENT "CLIENT" /* Inst: From client */
-#define CLIENT_SUBSCRIBE "SUBSCRIBE" /* Opcode: Subscribe */
-#define CLIENT_SUBSCRIBE_NODEFS "SUBSCRIBE_NODEFS" /* Opcode: Subscribe */
-#define CLIENT_UNSUBSCRIBE "UNSUBSCRIBE" /* Opcode: Unsubsubscribe */
-#define CLIENT_CANCELSUB "CLEARSUB" /* Opcode: Clear all subs */
-#define CLIENT_GIMMESUBS "GIMME" /* Opcode: Give me subs */
-#define CLIENT_GIMMEDEFS "GIMMEDEFS" /* Opcode: Give me default
- * subscriptions */
-
-#define ZEPHYR_CTL_HM "HM" /* Inst: From HM */
-#define HM_BOOT "BOOT" /* Opcode: Boot msg */
-#define HM_FLUSH "FLUSH" /* Opcode: Flush me */
-#define HM_DETACH "DETACH" /* Opcode: Detach me */
-#define HM_ATTACH "ATTACH" /* Opcode: Attach me */
-
- /* Control codes send to a HostManager */
-#define HM_CTL_CLASS "HM_CTL" /* Class */
-
-#define HM_CTL_SERVER "SERVER" /* Inst: From server */
-#define SERVER_SHUTDOWN "SHUTDOWN" /* Opcode: Server shutdown */
-#define SERVER_PING "PING" /* Opcode: PING */
-
-#define HM_CTL_CLIENT "CLIENT" /* Inst: From client */
-#define CLIENT_FLUSH "FLUSH" /* Opcode: Send flush to srv */
-#define CLIENT_NEW_SERVER "NEWSERV" /* Opcode: Find new server */
-
- /* HM Statistics */
-#define HM_STAT_CLASS "HM_STAT" /* Class */
-
-#define HM_STAT_CLIENT "HMST_CLIENT" /* Inst: From client */
-#define HM_GIMMESTATS "GIMMESTATS" /* Opcode: get stats */
-
- /* Login class messages */
-#define LOGIN_CLASS "LOGIN" /* Class */
-
- /* Class Instance is principal of user who is logging in or logging out */
-
-#define EXPOSE_NONE "NONE" /* Opcode: Not visible */
-#define EXPOSE_OPSTAFF "OPSTAFF" /* Opcode: Opstaff visible */
-#define EXPOSE_REALMVIS "REALM-VISIBLE" /* Opcode: Realm visible */
-#define EXPOSE_REALMANN "REALM-ANNOUNCED"/* Opcode: Realm announced */
-#define EXPOSE_NETVIS "NET-VISIBLE" /* Opcode: Net visible */
-#define EXPOSE_NETANN "NET-ANNOUNCED" /* Opcode: Net announced */
-#define LOGIN_USER_LOGIN "USER_LOGIN" /* Opcode: user login
- (from server) */
-#define LOGIN_USER_LOGOUT "USER_LOGOUT" /* Opcode: User logout */
-#define LOGIN_USER_FLUSH "USER_FLUSH" /* Opcode: flush all locs */
-
- /* Locate class messages */
-#define LOCATE_CLASS "USER_LOCATE" /* Class */
-
-#define LOCATE_HIDE "USER_HIDE" /* Opcode: Hide me */
-#define LOCATE_UNHIDE "USER_UNHIDE" /* Opcode: Unhide me */
-
- /* Class Instance is principal of user to locate */
-
-#define LOCATE_LOCATE "LOCATE" /* Opcode: Locate user */
-
- /* WG_CTL class messages */
-#define WG_CTL_CLASS "WG_CTL" /* Class */
-
-#define WG_CTL_USER "USER" /* Inst: User request */
-#define USER_REREAD "REREAD" /* Opcode: Reread desc file */
-#define USER_SHUTDOWN "SHUTDOWN" /* Opcode: Go catatonic */
-#define USER_STARTUP "STARTUP" /* Opcode: Come out of it */
-
-#endif
diff --git a/h/zephyr/zephyr.h.in b/h/zephyr/zephyr.h.in
new file mode 100644
index 0000000..c1bd5f8
--- /dev/null
+++ b/h/zephyr/zephyr.h.in
@@ -0,0 +1,355 @@
+/* This file is part of the Project Athena Zephyr Notification System.
+ * It contains global definitions
+ *
+ * Created by: Robert French
+ *
+ * $Source$
+ * $Author$
+ * $Id$
+ *
+ * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of
+ * Technology. For copying and distribution information, see the
+ * file "mit-copyright.h".
+ */
+
+#ifndef __ZEPHYR_H__
+#define __ZEPHYR_H__
+
+/* Define if Zephyr uses Kerberos support. */
+#undef ZEPHYR_USES_KERBEROS
+
+#include <sys/types.h>
+#include <sys/time.h>
+
+#include <zephyr/zephyr_err.h>
+#ifdef ZEPHYR_USES_KERBEROS
+#include <krb.h>
+#endif
+
+#ifndef IPPROTO_MAX /* Make sure not already included */
+#include <netinet/in.h>
+#endif
+
+/* Use __STDC__ to guess whether we can use stdarg, prototypes, and const.
+ * This is a public header file, so autoconf can't help us here. */
+#ifdef __STDC__
+# include <stdarg.h>
+# define ZP(x) x
+# define ZCONST const
+#else
+# define ZP(x) ()
+# define ZCONST
+#endif
+
+/* Service names */
+#define HM_SVCNAME "zephyr-hm"
+#define HM_SRV_SVCNAME "zephyr-hm-srv"
+#define SERVER_SVCNAME "zephyr-clt"
+#define SERVER_SERVICE "zephyr"
+#define SERVER_INSTANCE "zephyr"
+
+#define ZVERSIONHDR "ZEPH"
+#define ZVERSIONMAJOR 0
+#define ZVERSIONMINOR 2
+
+#define Z_MAXPKTLEN 1024
+#define Z_MAXHEADERLEN 800
+#define Z_MAXOTHERFIELDS 10 /* Max unknown fields in ZNotice_t */
+#define Z_NUMFIELDS 17
+
+/* Authentication levels returned by ZCheckAuthentication */
+#define ZAUTH_FAILED (-1)
+#define ZAUTH_YES 1
+#define ZAUTH_NO 0
+
+typedef char ZPacket_t[Z_MAXPKTLEN];
+
+/* Packet type */
+typedef enum {
+ UNSAFE, UNACKED, ACKED, HMACK, HMCTL, SERVACK, SERVNAK, CLIENTACK, STAT
+} ZNotice_Kind_t;
+extern ZCONST char *ZNoticeKinds[9];
+
+/* Unique ID format */
+typedef struct _ZUnique_Id_t {
+ struct in_addr zuid_addr;
+ struct timeval tv;
+} ZUnique_Id_t;
+
+/* Checksum */
+typedef unsigned long ZChecksum_t;
+
+/* Notice definition */
+typedef struct _ZNotice_t {
+ char *z_packet;
+ char *z_version;
+ ZNotice_Kind_t z_kind;
+ ZUnique_Id_t z_uid;
+#define z_sender_addr z_uid.zuid_addr
+ struct timeval z_time;
+ unsigned short z_port;
+ int z_auth;
+ int z_checked_auth;
+ int z_authent_len;
+ char *z_ascii_authent;
+ char *z_class;
+ char *z_class_inst;
+ char *z_opcode;
+ char *z_sender;
+ char *z_recipient;
+ char *z_default_format;
+ char *z_multinotice;
+ ZUnique_Id_t z_multiuid;
+ ZChecksum_t z_checksum;
+ int z_num_other_fields;
+ char *z_other_fields[Z_MAXOTHERFIELDS];
+ caddr_t z_message;
+ int z_message_len;
+} ZNotice_t;
+
+/* Subscription structure */
+typedef struct _ZSubscriptions_t {
+ char *zsub_recipient;
+ char *zsub_class;
+ char *zsub_classinst;
+} ZSubscription_t;
+
+/* Function return code */
+typedef int Code_t;
+
+/* Locations structure */
+typedef struct _ZLocations_t {
+ char *host;
+ char *time;
+ char *tty;
+} ZLocations_t;
+
+typedef struct _ZAsyncLocateData_t {
+ char *user;
+ ZUnique_Id_t uid;
+ char *version;
+} ZAsyncLocateData_t;
+
+/* for ZSetDebug */
+#ifdef Z_DEBUG
+void (*__Z_debug_print) ZP((ZCONST char *fmt, va_list args, void *closure));
+void *__Z_debug_print_closure;
+#endif
+
+int ZCompareUIDPred ZP((ZNotice_t *, void *));
+int ZCompareMultiUIDPred ZP((ZNotice_t *, void *));
+
+/* Defines for ZFormatNotice, et al. */
+typedef Code_t (*Z_AuthProc) ZP((ZNotice_t*, char *, int, int *));
+Code_t ZMakeAuthentication ZP((ZNotice_t*, char *,int, int*));
+
+char *ZGetSender ZP((void));
+char *ZGetVariable ZP((char *));
+Code_t ZSetVariable ZP((char *var, char *value));
+Code_t ZUnsetVariable ZP((char *var));
+int ZGetWGPort ZP((void));
+Code_t ZSetDestAddr ZP((struct sockaddr_in *));
+Code_t ZFormatNoticeList ZP((ZNotice_t*, char**, int,
+ char **, int*, Z_AuthProc));
+Code_t ZParseNotice ZP((char*, int, ZNotice_t *));
+Code_t ZReadAscii ZP((char*, int, unsigned char*, int));
+Code_t ZReadAscii32 ZP((char *, int, unsigned long *));
+Code_t ZReadAscii16 ZP((char *, int, unsigned short *));
+Code_t ZSendPacket ZP((char*, int, int));
+Code_t ZSendList ZP((ZNotice_t*, char *[], int, Z_AuthProc));
+Code_t ZSrvSendList ZP((ZNotice_t*, char*[], int, Z_AuthProc, Code_t (*)()));
+Code_t ZSendNotice ZP((ZNotice_t *, Z_AuthProc));
+Code_t ZSrvSendNotice ZP((ZNotice_t*, Z_AuthProc, Code_t (*)()));
+Code_t ZFormatNotice ZP((ZNotice_t*, char**, int*, Z_AuthProc));
+Code_t ZFormatSmallNotice ZP((ZNotice_t*, ZPacket_t, int*, Z_AuthProc));
+Code_t ZFormatRawNoticeList ZP((ZNotice_t *notice, char *list[], int nitems,
+ char **buffer, int *ret_len));
+Code_t ZLocateUser ZP((char *, int *, Z_AuthProc));
+Code_t ZRequestLocations ZP((char *, ZAsyncLocateData_t *,
+ ZNotice_Kind_t, Z_AuthProc));
+Code_t ZhmStat ZP((struct in_addr *, ZNotice_t *));
+Code_t ZInitialize ZP((void));
+Code_t ZSetServerState ZP((int));
+Code_t ZSetFD ZP((int));
+Code_t ZFormatSmallRawNotice ZP((ZNotice_t*, ZPacket_t, int*));
+int ZCompareUID ZP((ZUnique_Id_t*, ZUnique_Id_t*));
+Code_t ZSrvSendRawList ZP((ZNotice_t*, char*[], int,
+ Code_t (*)(ZNotice_t *, char *, int, int)));
+Code_t ZMakeAscii ZP((char*, int, unsigned char*, int));
+Code_t ZMakeAscii32 ZP((char *, int, unsigned long));
+Code_t ZMakeAscii16 ZP((char *, int, unsigned int));
+Code_t ZReceivePacket ZP((ZPacket_t, int*, struct sockaddr_in*));
+Code_t ZCheckAuthentication ZP((ZNotice_t*, struct sockaddr_in*));
+Code_t ZInitLocationInfo ZP((char *hostname, char *tty));
+Code_t ZSetLocation ZP((char *exposure));
+Code_t ZUnsetLocation ZP((void));
+Code_t ZFlushMyLocations ZP((void));
+char *ZParseExposureLevel ZP((char *text));
+#ifdef ZEPHYR_USES_KERBEROS
+Code_t ZFormatAuthenticNotice ZP((ZNotice_t*, char*, int, int*, C_Block));
+#endif
+Code_t ZFormatRawNotice ZP((ZNotice_t *, char**, int *));
+Code_t ZRetrieveSubscriptions ZP((unsigned short, int*));
+Code_t ZOpenPort ZP((unsigned short *port));
+Code_t ZClosePort ZP((void));
+Code_t ZFlushLocations ZP((void));
+Code_t ZFlushSubscriptions ZP((void));
+Code_t ZFreeNotice ZP((ZNotice_t *notice));
+Code_t ZParseLocations ZP((register ZNotice_t *notice,
+ register ZAsyncLocateData_t *zald, int *nlocs,
+ char **user));
+int ZCompareALDPred ZP((ZNotice_t *notice, void *zald));
+void ZFreeALD ZP((register ZAsyncLocateData_t *zald));
+Code_t ZCheckIfNotice ZP((ZNotice_t *notice, struct sockaddr_in *from,
+ register int (*predicate) ZP((ZNotice_t *,void *)),
+ void *args));
+Code_t ZPeekPacket ZP((char **buffer, int *ret_len,
+ struct sockaddr_in *from));
+Code_t ZPeekNotice ZP((ZNotice_t *notice, struct sockaddr_in *from));
+Code_t ZIfNotice ZP((ZNotice_t *notice, struct sockaddr_in *from,
+ int (*predicate) ZP((ZNotice_t *, void *)), void *args));
+Code_t ZSubscribeTo ZP((ZSubscription_t *sublist, int nitems,
+ unsigned int port));
+Code_t ZSubscribeToSansDefaults ZP((ZSubscription_t *sublist, int nitems,
+ unsigned int port));
+Code_t ZUnsubscribeTo ZP((ZSubscription_t *sublist, int nitems,
+ unsigned int port));
+Code_t ZCancelSubscriptions ZP((unsigned int port));
+int ZPending ZP((void));
+Code_t ZReceiveNotice ZP((ZNotice_t *notice, struct sockaddr_in *from));
+#ifdef Z_DEBUG
+void Z_debug ZP((ZCONST char *, ...));
+#endif
+
+#undef ZP
+
+/* Compatibility */
+#define ZNewLocateUser ZLocateUser
+
+/* Macros to retrieve Zephyr library values. */
+extern int __Zephyr_fd;
+extern int __Q_CompleteLength;
+extern struct sockaddr_in __HM_addr;
+extern char __Zephyr_realm[];
+#define ZGetFD() __Zephyr_fd
+#define ZQLength() __Q_CompleteLength
+#define ZGetDestAddr() __HM_addr
+#define ZGetRealm() __Zephyr_realm
+
+#ifdef ZEPHYR_USES_KERBEROS
+/* Session key for last parsed packet - server only */
+extern C_Block __Zephyr_session;
+#define ZGetSession() (__Zephyr_session)
+#else
+#define __Zephyr_realm ("local-realm")
+#endif
+
+
+#ifdef Z_DEBUG
+void ZSetDebug ZP((void (*)(ZCONST char *, va_list, void *), void *));
+#define ZSetDebug(proc,closure) (__Z_debug_print=(proc), \
+ __Z_debug_print_closure=(closure), \
+ (void) 0)
+#else
+#define ZSetDebug(proc,closure)
+#endif
+
+/* Maximum queue length */
+#define Z_MAXQLEN 30
+
+/* Successful function return */
+#define ZERR_NONE 0
+
+/* Hostmanager wait time (in secs) */
+#define HM_TIMEOUT 10
+
+/* Server wait time (in secs) */
+#define SRV_TIMEOUT 30
+
+#define ZAUTH (ZMakeAuthentication)
+#define ZNOAUTH ((Z_AuthProc)0)
+
+/* Packet strings */
+#define ZSRVACK_SENT "SENT" /* SERVACK codes */
+#define ZSRVACK_NOTSENT "LOST"
+#define ZSRVACK_FAIL "FAIL"
+
+/* Server internal class */
+#define ZEPHYR_ADMIN_CLASS "ZEPHYR_ADMIN" /* Class */
+
+/* Control codes sent to a server */
+#define ZEPHYR_CTL_CLASS "ZEPHYR_CTL" /* Class */
+
+#define ZEPHYR_CTL_REALM "REALM" /* Inst: From realm */
+#define REALM_ADD_SUBSCRIBE "ADD_SUBSCRIBE" /* Opcode: Add subs */
+#define REALM_REQ_SUBSCRIBE "REQ_SUBSCRIBE" /* Opcode: Request subs */
+#define REALM_SUBSCRIBE "RLM_SUBSCRIBE" /* Opcode: Subscribe realm */
+#define REALM_UNSUBSCRIBE "RLM_UNSUBSCRIBE" /* Opcode: Unsub realm */
+
+#define ZEPHYR_CTL_CLIENT "CLIENT" /* Inst: From client */
+#define CLIENT_SUBSCRIBE "SUBSCRIBE" /* Opcode: Subscribe */
+#define CLIENT_SUBSCRIBE_NODEFS "SUBSCRIBE_NODEFS" /* Opcode: Subscribe */
+#define CLIENT_UNSUBSCRIBE "UNSUBSCRIBE" /* Opcode: Unsubsubscribe */
+#define CLIENT_CANCELSUB "CLEARSUB" /* Opcode: Clear all subs */
+#define CLIENT_GIMMESUBS "GIMME" /* Opcode: Give me subs */
+#define CLIENT_GIMMEDEFS "GIMMEDEFS" /* Opcode: Give me default
+ * subscriptions */
+
+#define ZEPHYR_CTL_HM "HM" /* Inst: From HM */
+#define HM_BOOT "BOOT" /* Opcode: Boot msg */
+#define HM_FLUSH "FLUSH" /* Opcode: Flush me */
+#define HM_DETACH "DETACH" /* Opcode: Detach me */
+#define HM_ATTACH "ATTACH" /* Opcode: Attach me */
+
+/* Control codes send to a HostManager */
+#define HM_CTL_CLASS "HM_CTL" /* Class */
+
+#define HM_CTL_SERVER "SERVER" /* Inst: From server */
+#define SERVER_SHUTDOWN "SHUTDOWN" /* Opcode: Server shutdown */
+#define SERVER_PING "PING" /* Opcode: PING */
+
+#define HM_CTL_CLIENT "CLIENT" /* Inst: From client */
+#define CLIENT_FLUSH "FLUSH" /* Opcode: Send flush to srv */
+#define CLIENT_NEW_SERVER "NEWSERV" /* Opcode: Find new server */
+
+/* HM Statistics */
+#define HM_STAT_CLASS "HM_STAT" /* Class */
+
+#define HM_STAT_CLIENT "HMST_CLIENT" /* Inst: From client */
+#define HM_GIMMESTATS "GIMMESTATS" /* Opcode: get stats */
+
+/* Login class messages */
+#define LOGIN_CLASS "LOGIN" /* Class */
+
+/* Class Instance is principal of user who is logging in or logging out */
+
+#define EXPOSE_NONE "NONE" /* Opcode: Not visible */
+#define EXPOSE_OPSTAFF "OPSTAFF" /* Opcode: Opstaff visible */
+#define EXPOSE_REALMVIS "REALM-VISIBLE" /* Opcode: Realm visible */
+#define EXPOSE_REALMANN "REALM-ANNOUNCED"/* Opcode: Realm announced */
+#define EXPOSE_NETVIS "NET-VISIBLE" /* Opcode: Net visible */
+#define EXPOSE_NETANN "NET-ANNOUNCED" /* Opcode: Net announced */
+#define LOGIN_USER_LOGIN "USER_LOGIN" /* Opcode: user login
+ (from server) */
+#define LOGIN_USER_LOGOUT "USER_LOGOUT" /* Opcode: User logout */
+#define LOGIN_USER_FLUSH "USER_FLUSH" /* Opcode: flush all locs */
+
+/* Locate class messages */
+#define LOCATE_CLASS "USER_LOCATE" /* Class */
+
+#define LOCATE_HIDE "USER_HIDE" /* Opcode: Hide me */
+#define LOCATE_UNHIDE "USER_UNHIDE" /* Opcode: Unhide me */
+
+/* Class Instance is principal of user to locate */
+#define LOCATE_LOCATE "LOCATE" /* Opcode: Locate user */
+
+/* WG_CTL class messages */
+#define WG_CTL_CLASS "WG_CTL" /* Class */
+
+#define WG_CTL_USER "USER" /* Inst: User request */
+#define USER_REREAD "REREAD" /* Opcode: Reread desc file */
+#define USER_SHUTDOWN "SHUTDOWN" /* Opcode: Go catatonic */
+#define USER_STARTUP "STARTUP" /* Opcode: Come out of it */
+#define USER_EXIT "EXIT" /* Opcode: Exit the client */
+
+#endif /* __ZEPHYR_H__ */
diff --git a/h/zephyr/zephyr_conf.h b/h/zephyr/zephyr_conf.h
deleted file mode 100644
index a0d8d83..0000000
--- a/h/zephyr/zephyr_conf.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains configuration definitions.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- * $Zephyr: /mit/zephyr/src/include/zephyr/RCS/zephyr_conf.h,v 1.8 90/12/21 17:40:40 raeburn Exp $
- *
- * Copyright (c) 1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#ifndef __ZEPHYR_CONF_H__
-#define __ZEPHYR_CONF_H__
-
-#ifdef POSIX
-#define POSIX_FLOCK
-#define POSIX_SIGNALS
-#define HAVE_UNISTD_H
-#define HAVE_STDLIB_H
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr_paths.h>
-
-#ifdef Z_HaveKerberos
-#define SERVER_SERVICE "zephyr"
-#define SERVER_INSTANCE "zephyr"
-#define SERVER_SRVTAB "/etc/athena/zephyr/srvtab"
-#endif
-
-/* General filenames */
-#define DEFAULT_VARS_FILE "/etc/athena/zephyr.vars"
-
-/* Service names */
-#define HM_SVCNAME "zephyr-hm"
-#define SERVER_SVCNAME "zephyr-clt"
-
-#if defined(vax) || defined(ibm032)
-#define memset(a,b,c) bzero(a,c)
-#define memmove(a,b,c) bcopy(b,a,c)
-#define memcmp(a,b,c) bcmp(a,b,c)
-#define strchr index
-#define strrchr rindex
-#endif
-
-#ifdef SUNOS
-extern char *sys_errlist[];
-
-#ifndef memmove
-#define memmove(a,b,c) bcopy(b,a,c)
-#endif
-
-#ifndef strerror
-#define strerror(e) (sys_errlist[e])
-#endif
-#endif
-
-#ifdef ultrix
-/* If you are using Ultrix versions prior to 3.0, uncomment the following
- * three lines so that users don't need to specify -DULTRIX22 on their
- * compile lines. */
-
-/* #ifndef ULTRIX22 */
-/* #define ULTRIX22 */
-/* #endif */
-
-#ifdef ULTRIX22
-#define MAXHOSTNAMELEN 64
-typedef int uid_t;
-typedef int gid_t;
-#endif
-#endif
-
-#if defined(macII) || defined(ULTRIX22)
-#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)))
-#define FD_CLR(n, p) ((p)->fds_bits[0] &= ~(1 << (n)))
-#endif
-
-#ifndef Z_HaveKerberos
-#define REALM_SZ MAXHOSTNAMELEN
-#define INST_SZ 0 /* no instances w/o Kerberos */
-#define ANAME_SZ 9 /* size of a username + null */
-#endif
-
-#endif /* __ZEPHYR_CONF_H__ */
diff --git a/h/zephyr/zephyr_internal.h b/h/zephyr/zephyr_internal.h
deleted file mode 100644
index 34d3eee..0000000
--- a/h/zephyr/zephyr_internal.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains internal definitions for the client library.
- *
- * Created by: Robert French
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-/* $Header$ */
-
-#ifndef __ZINTERNAL_H__
-#define __ZINTERNAL_H__
-
-#include <zephyr/zephyr.h>
-#include <string.h>
-#include <sys/types.h> /* for time_t, uid_t, etc */
-
-#ifdef lint
-#include <sys/uio.h> /* to make lint shut up about struct/union iovec */
-#endif
-
-struct _Z_Hole {
- struct _Z_Hole *next;
- int first;
- int last;
-};
-
-struct _Z_InputQ {
- struct _Z_InputQ *next;
- struct _Z_InputQ *prev;
- ZNotice_Kind_t kind;
- unsigned long timep;
- int packet_len;
- char *packet;
- int complete;
- struct sockaddr_in from;
- struct _Z_Hole *holelist;
- ZUnique_Id_t uid;
- int auth;
- int header_len;
- char *header;
- int msg_len;
- char *msg;
-};
-
-extern struct _Z_InputQ *__Q_Head, *__Q_Tail;
-
- /* Maximum number of packet fragments */
-#define Z_MAXFRAGS 500 /* Probably around 350K */
-
- /* Maximum allowable size of an incoming notice */
-#define Z_MAXNOTICESIZE 400000
-
- /* Maximum allowable size of all notices in the input queue */
- /* This is more of a ballpark figure than a hard limit */
-#define Z_MAXQUEUESIZE 1500000
-
- /* Amount of room to leave for multinotice field */
-#define Z_FRAGFUDGE 13 /* 999999/999999 */
-
- /* Amount of time a notice can stay in the queue without being
- * touched by an incoming fragment */
-#define Z_NOTICETIMELIMIT 30 /* seconds */
-
- /* Initial size of old uid buffer. */
-#define Z_INITFILTERSIZE 30 /* uid's */
-
-extern int __Zephyr_open; /* 0 if the library opened the FD, 1 otherwise */
-extern int __HM_set; /* 0 if the library set the dest addr, 1 otherwise */
-extern int __Zephyr_server; /* 0 if normal client, 1 if server */
-
-extern ZLocations_t *__locate_list;
-extern int __locate_num;
-extern int __locate_next;
-
-extern ZSubscription_t *__subscriptions_list;
-extern int __subscriptions_num;
-extern int __subscriptions_next;
-
-#ifdef Z_HaveKerberos
-extern int krb_err_base;
-#endif
-
-extern time_t time Zproto((time_t *));
-extern long random();
-
-extern struct _Z_InputQ *Z_GetFirstComplete();
-extern struct _Z_InputQ *Z_GetNextComplete();
-extern Code_t Z_XmitFragment Zproto((ZNotice_t*, char *,int,int));
-extern void Z_RemQueue Zproto ((struct _Z_InputQ *));
-
-#endif /* !__ZINTERNAL_H__ */
diff --git a/h/zephyr/zsyslog.h b/h/zephyr/zsyslog.h
deleted file mode 100644
index 1b09c4a..0000000
--- a/h/zephyr/zsyslog.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains definitions to deal with old 4.2-style syslog functions.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-/* $Header$ */
-
-#include <syslog.h>
-#ifndef LOG_AUTH
-/* Probably a 4.2-type syslog */
-#define OPENLOG(str, opts, facility) openlog(str, opts)
-#else
-/* A decent syslog */
-#define OPENLOG(str, opts, facility) openlog(str, opts, facility)
-#endif
diff --git a/util/autoconf/install-sh b/install.sh
index ab74c88..ab74c88 100755
--- a/util/autoconf/install-sh
+++ b/install.sh
diff --git a/lib/Imakefile b/lib/Imakefile
deleted file mode 100644
index 6dbe246..0000000
--- a/lib/Imakefile
+++ /dev/null
@@ -1,133 +0,0 @@
-/**/# Copyright 1988, 1993 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Id$
-
-#ifdef KERBEROS
-K_O = krb_err.o ZFmtAuth.o
-K_C = krb_err.c ZFmtAuth.c
-#endif
-
-OBJS = ${K_O} \
- zephyr_err.o \
- ZAsyncLocate.o \
- ZCkAuth.o \
- ZCkIfNot.o \
- ZClosePort.o \
- ZCmpUID.o \
- ZCmpUIDP.o \
- ZFlsLocs.o \
- ZFlsSubs.o \
- ZFmtList.o \
- ZFmtNotice.o \
- ZFmtRaw.o \
- ZFmtRawLst.o \
- ZFmtSmRLst.o \
- ZFmtSmRaw.o \
- ZFreeNot.o \
- ZGetLocs.o \
- ZGetSender.o \
- ZGetSubs.o \
- ZGetWGPort.o \
- ZIfNotice.o \
- ZInit.o \
- ZLocations.o \
- ZMakeAscii.o \
- ZMkAuth.o \
- ZNewLocU.o \
- ZOpenPort.o \
- ZParseNot.o \
- ZPeekIfNot.o \
- ZPeekNot.o \
- ZPeekPkt.o \
- ZPending.o \
- ZReadAscii.o \
- ZRecvNot.o \
- ZRecvPkt.o \
- ZRetSubs.o \
- ZSendList.o \
- ZSendNot.o \
- ZSendPkt.o \
- ZSendRaw.o \
- ZSendRLst.o \
- ZSetDest.o \
- ZSetFD.o \
- ZSetSrv.o \
- ZSubs.o \
- ZVariables.o \
- ZWait4Not.o \
- Zinternal.o \
- acl_files.o
-
-SRCS = ${K_C} \
- zephyr_err.c \
- ZAsyncLocate.c \
- ZCkAuth.c \
- ZCkIfNot.c \
- ZClosePort.c \
- ZCmpUID.c \
- ZCmpUIDP.c \
- ZFlsLocs.c \
- ZFlsSubs.c \
- ZFmtList.c \
- ZFmtNotice.c \
- ZFmtRaw.c \
- ZFmtRawLst.c \
- ZFmtSmRLst.c \
- ZFmtSmRaw.c \
- ZFreeNot.c \
- ZGetLocs.c \
- ZGetSender.c \
- ZGetSubs.c \
- ZGetWGPort.c \
- ZIfNotice.c \
- ZInit.c \
- ZLocations.c \
- ZMakeAscii.c \
- ZMkAuth.c \
- ZNewLocU.c \
- ZOpenPort.c \
- ZParseNot.c \
- ZPeekIfNot.c \
- ZPeekNot.c \
- ZPeekPkt.c \
- ZPending.c \
- ZReadAscii.c \
- ZRecvNot.c \
- ZRecvPkt.c \
- ZRetSubs.c \
- ZSendList.c \
- ZSendNot.c \
- ZSendPkt.c \
- ZSendRaw.c \
- ZSendRLst.c \
- ZSetDest.c \
- ZSetFD.c \
- ZSetSrv.c \
- ZSubs.c \
- ZVariables.c \
- ZWait4Not.c \
- Zinternal.c \
- acl_files.c
-
-SimpleLibrary(zephyr,$(OBJS),$(ATHLIBDIR))
-create_depend($(SRCS))
-
-install_man(zephyr.1,zephyr.1)
-
-make_err(zephyr_err)
-
-#ifdef KERBEROS
-make_err(krb_err)
-install_file($(BINC)/zephyr/krb_err.h,$(ZINCDIR)/krb_err.h)
-#endif
-
-create_dir($(ZINCDIR))
-install_file($(BINC)/zephyr/zephyr.h,$(ZINCDIR)/zephyr.h)
-install_file($(BINC)/zephyr/zephyr_conf.h,$(ZINCDIR)/zephyr_conf.h)
-install_file($(BINC)/zephyr/zephyr_paths.h,$(ZINCDIR)/zephyr_paths.h)
-install_file($(BINC)/zephyr/zephyr_internal.h,$(ZINCDIR)/zephyr_internal.h)
-install_file($(BINC)/zephyr/zephyr_err.h,$(ZINCDIR)/zephyr_err.h)
-install_file($(BINC)/zephyr/mit-copyright.h,$(ZINCDIR)/mit-copyright.h)
diff --git a/lib/Makefile.in b/lib/Makefile.in
new file mode 100644
index 0000000..294c8d0
--- /dev/null
+++ b/lib/Makefile.in
@@ -0,0 +1,61 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+RANLIB=@RANLIB@
+COMPILE_ET=@COMPILE_ET@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -DCONFDIR=\"${confdir}\" -I${top_srcdir}/h \
+ -I${BUILDTOP}/h @CPPFLAGS@
+
+OBJS = zephyr_err.o ZAsyncLocate.o ZCkAuth.o ZCkIfNot.o ZClosePort.o \
+ ZCmpUID.o ZCmpUIDP.o ZFlsLocs.o ZFlsSubs.o ZFmtAuth.o ZFmtList.o \
+ ZFmtNotice.o ZFmtRaw.o ZFmtRawLst.o ZFmtSmRLst.o ZFmtSmRaw.o \
+ ZFreeNot.o ZGetLocs.o ZGetSender.o ZGetSubs.o ZGetWGPort.o ZhmStat.o \
+ ZIfNotice.o ZInit.o ZLocations.o ZMakeAscii.o ZMkAuth.o ZNewLocU.o \
+ ZOpenPort.o ZParseNot.o ZPeekIfNot.o ZPeekNot.o ZPeekPkt.o ZPending.o \
+ ZReadAscii.o ZRecvNot.o ZRecvPkt.o ZRetSubs.o ZSendList.o ZSendNot.o \
+ ZSendPkt.o ZSendRaw.o ZSendRLst.o ZSetDest.o ZSetFD.o ZSetSrv.o \
+ ZSubs.o ZVariables.o ZWait4Not.o Zinternal.o
+
+all: libzephyr.a
+
+libzephyr.a: ${OBJS}
+ ar cru $@ ${OBJS}
+ ${RANLIB} $@
+
+zephyr_err.c ${BUILDTOP}/h/zephyr/zephyr_err.h: zephyr_err.et
+ ${COMPILE_ET} ${srcdir}/zephyr_err.et
+ mv zephyr_err.h ${BUILDTOP}/h/zephyr
+
+check:
+
+install: libzephyr.a
+ ${INSTALL} -m 644 libzephyr.a ${DESTDIR}${libdir}
+ ${INSTALL} -m 644 ${srcdir}/zephyr.1 ${DESTDIR}${mandir}/man1
+
+clean:
+ rm -f ${OBJS} libzephyr.a zephyr_err.c zephyr_err.h
+
+${OBJS}: ${top_srcdir}/h/internal.h ${top_srcdir}/h/sysdep.h
+${OBJS}: ${BUILDTOP}/h/config.h ${BUILDTOP}/h/zephyr/zephyr.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean
+
diff --git a/lib/ZAsyncLocate.c b/lib/ZAsyncLocate.c
index 37f61fa..78b3f2a 100644
--- a/lib/ZAsyncLocate.c
+++ b/lib/ZAsyncLocate.c
@@ -12,12 +12,12 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZAsyncLocate_c[] = "$Id$";
+static const char rcsid_ZAsyncLocate_c[] = "$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
-
Code_t ZRequestLocations(user, zald, kind, auth)
char *user;
register ZAsyncLocateData_t *zald;
@@ -153,7 +153,7 @@ Code_t ZParseLocations(notice,zald,nlocs,user)
int ZCompareALDPred(notice, zald)
ZNotice_t *notice;
- char *zald;
+ void *zald;
{
return(ZCompareUID(&(notice->z_multiuid),
&(((ZAsyncLocateData_t *) zald)->uid)));
diff --git a/lib/ZCkAuth.c b/lib/ZCkAuth.c
index 999950b..8f4816e 100644
--- a/lib/ZCkAuth.c
+++ b/lib/ZCkAuth.c
@@ -17,27 +17,22 @@ static char rcsid_ZCheckAuthentication_c[] =
"$Zephyr: /mit/zephyr/src/lib/RCS/ZCheckAuthentication.c,v 1.14 89/03/24 14:17:38 jtkohl Exp Locker: raeburn $";
#endif
-#include <zephyr/mit-copyright.h>
-#include <sys/param.h>
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
/* Check authentication of the notice.
If it looks authentic but fails the Kerberos check, return -1.
If it looks authentic and passes the Kerberos check, return 1.
If it doesn't look authentic, return 0
- When not using Kerberos, return (looks-authentic-p)
+ When not using Kerberos, return true if the notice claims to be authentic.
Only used by clients; the server uses its own routine.
*/
-int ZCheckAuthentication(notice, from)
+Code_t ZCheckAuthentication(notice, from)
ZNotice_t *notice;
struct sockaddr_in *from;
{
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
int result;
- char srcprincipal[ANAME_SZ+INST_SZ+REALM_SZ+4];
- KTEXT_ST authent;
- AUTH_DAT dat;
ZChecksum_t our_checksum;
CREDENTIALS cred;
@@ -48,17 +43,17 @@ int ZCheckAuthentication(notice, from)
if (!notice->z_auth)
return (ZAUTH_NO);
- if (result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE,
- __Zephyr_realm, &cred))
+ if ((result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE,
+ __Zephyr_realm, &cred)) != 0)
return (ZAUTH_NO);
#ifdef NOENCRYPTION
our_checksum = 0;
#else
- our_checksum = (ZChecksum_t)des_quad_cksum(notice->z_packet, NULL,
- notice->z_default_format+
- strlen(notice->z_default_format)+1-
- notice->z_packet, 0, cred.session);
+ our_checksum = des_quad_cksum(notice->z_packet, NULL,
+ notice->z_default_format+
+ strlen(notice->z_default_format)+1-
+ notice->z_packet, 0, cred.session);
#endif
/* if mismatched checksum, then the packet was corrupted */
return ((our_checksum == notice->z_checksum) ? ZAUTH_YES : ZAUTH_FAILED);
diff --git a/lib/ZCkIfNot.c b/lib/ZCkIfNot.c
index 6ca5ef7..39b0eed 100644
--- a/lib/ZCkIfNot.c
+++ b/lib/ZCkIfNot.c
@@ -12,17 +12,17 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZCheckIfNotice_c[] = "$Id$";
+static const char rcsid_ZCheckIfNotice_c[] = "$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
-
Code_t ZCheckIfNotice(notice, from, predicate, args)
ZNotice_t *notice;
struct sockaddr_in *from;
- register int (*predicate)();
- char *args;
+ register int (*predicate) __P((ZNotice_t *, void *));
+ void *args;
{
ZNotice_t tmpnotice;
Code_t retval;
diff --git a/lib/ZClosePort.c b/lib/ZClosePort.c
index 64e110d..ea39f6f 100644
--- a/lib/ZClosePort.c
+++ b/lib/ZClosePort.c
@@ -12,14 +12,12 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZClosePort_c[] = "$Id$";
+static const char rcsid_ZClosePort_c[] = "$Id$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
-
Code_t ZClosePort()
{
if (__Zephyr_fd >= 0 && __Zephyr_open)
diff --git a/lib/ZCmpUID.c b/lib/ZCmpUID.c
index 85f2b66..ffd065a 100644
--- a/lib/ZCmpUID.c
+++ b/lib/ZCmpUID.c
@@ -16,9 +16,7 @@
static char rcsid_ZCompareUID_c[] = "$Id$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
int ZCompareUID(uid1, uid2)
ZUnique_Id_t *uid1, *uid2;
diff --git a/lib/ZCmpUIDP.c b/lib/ZCmpUIDP.c
index 29bb69b..ca4466a 100644
--- a/lib/ZCmpUIDP.c
+++ b/lib/ZCmpUIDP.c
@@ -16,20 +16,18 @@
static char rcsid_ZCompareUIDPred_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
int ZCompareUIDPred(notice, uid)
ZNotice_t *notice;
- ZUnique_Id_t *uid;
+ void *uid;
{
- return (ZCompareUID(&notice->z_uid, uid));
+ return (ZCompareUID(&notice->z_uid, (ZUnique_Id_t *) uid));
}
int ZCompareMultiUIDPred(notice, uid)
ZNotice_t *notice;
- ZUnique_Id_t *uid;
+ void *uid;
{
- return (ZCompareUID(&notice->z_multiuid, uid));
+ return (ZCompareUID(&notice->z_multiuid, (ZUnique_Id_t *) uid));
}
diff --git a/lib/ZFlsLocs.c b/lib/ZFlsLocs.c
index b5110f8..66c5cbc 100644
--- a/lib/ZFlsLocs.c
+++ b/lib/ZFlsLocs.c
@@ -16,9 +16,7 @@
static char rcsid_ZFlushLocations_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZFlushLocations()
{
diff --git a/lib/ZFlsSubs.c b/lib/ZFlsSubs.c
index 3552ee3..ae0ddb5 100644
--- a/lib/ZFlsSubs.c
+++ b/lib/ZFlsSubs.c
@@ -12,12 +12,12 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZFlushSubscriptions_c[] = "$Id$";
+static const char rcsid_ZFlushSubscriptions_c[] = "$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
-
Code_t ZFlushSubscriptions()
{
register int i;
diff --git a/lib/ZFmtAuth.c b/lib/ZFmtAuth.c
index 42af25a..5ac708a 100644
--- a/lib/ZFmtAuth.c
+++ b/lib/ZFmtAuth.c
@@ -16,10 +16,9 @@
static char rcsid_ZFormatAuthenticNotice_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
Code_t ZFormatAuthenticNotice(notice, buffer, buffer_len, len, session)
ZNotice_t *notice;
register char *buffer;
diff --git a/lib/ZFmtList.c b/lib/ZFmtList.c
index baf2dda..7c4ab93 100644
--- a/lib/ZFmtList.c
+++ b/lib/ZFmtList.c
@@ -12,13 +12,13 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZFormatNoticeList_c[] =
+static const char rcsid_ZFormatNoticeList_c[] =
"$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
-
Code_t ZFormatNoticeList(notice, list, nitems, buffer, ret_len,
cert_routine)
ZNotice_t *notice;
diff --git a/lib/ZFmtNotice.c b/lib/ZFmtNotice.c
index 96147f8..386630d 100644
--- a/lib/ZFmtNotice.c
+++ b/lib/ZFmtNotice.c
@@ -16,7 +16,7 @@
static char rcsid_ZFormatNotice_c[] = "$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZFormatNotice(notice, buffer, ret_len, cert_routine)
register ZNotice_t *notice;
diff --git a/lib/ZFmtRaw.c b/lib/ZFmtRaw.c
index 49d82db..d0921e7 100644
--- a/lib/ZFmtRaw.c
+++ b/lib/ZFmtRaw.c
@@ -16,7 +16,7 @@
static char rcsid_ZFormatRawNotice_c[] = "$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZFormatRawNotice(notice, buffer, ret_len)
register ZNotice_t *notice;
diff --git a/lib/ZFmtRawLst.c b/lib/ZFmtRawLst.c
index 2773f50..7bfa169 100644
--- a/lib/ZFmtRawLst.c
+++ b/lib/ZFmtRawLst.c
@@ -16,9 +16,7 @@
static char rcsid_ZFormatRawNoticeList_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZFormatRawNoticeList(notice, list, nitems, buffer, ret_len)
ZNotice_t *notice;
diff --git a/lib/ZFmtSmRLst.c b/lib/ZFmtSmRLst.c
index 67d50a9..421c76c 100644
--- a/lib/ZFmtSmRLst.c
+++ b/lib/ZFmtSmRLst.c
@@ -16,9 +16,7 @@
static char rcsid_ZFormatRawNoticeList_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZFormatSmallRawNoticeList(notice, list, nitems, buffer, ret_len)
ZNotice_t *notice;
diff --git a/lib/ZFmtSmRaw.c b/lib/ZFmtSmRaw.c
index aa6ac60..4fa554f 100644
--- a/lib/ZFmtSmRaw.c
+++ b/lib/ZFmtSmRaw.c
@@ -16,9 +16,7 @@
static char rcsid_ZFormatRawNotice_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZFormatSmallRawNotice(notice, buffer, ret_len)
ZNotice_t *notice;
diff --git a/lib/ZFreeNot.c b/lib/ZFreeNot.c
index 02622eb..537194d 100644
--- a/lib/ZFreeNot.c
+++ b/lib/ZFreeNot.c
@@ -16,9 +16,7 @@
static char rcsid_ZFreeNotice_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZFreeNotice(notice)
ZNotice_t *notice;
diff --git a/lib/ZGetLocs.c b/lib/ZGetLocs.c
index 57e5842..b322a37 100644
--- a/lib/ZGetLocs.c
+++ b/lib/ZGetLocs.c
@@ -16,9 +16,7 @@
static char rcsid_ZGetLocations_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
#define min(a,b) ((a)<(b)?(a):(b))
diff --git a/lib/ZGetSender.c b/lib/ZGetSender.c
index acff9e0..4b8d0ba 100644
--- a/lib/ZGetSender.c
+++ b/lib/ZGetSender.c
@@ -12,20 +12,19 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZGetSender_c[] =
+static const char rcsid_ZGetSender_c[] =
"$Id$";
#endif
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr_internal.h>
-
#include <pwd.h>
char *ZGetSender()
{
struct passwd *pw;
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ];
static char sender[ANAME_SZ+INST_SZ+REALM_SZ+3] = "";
#else
@@ -36,7 +35,7 @@ char *ZGetSender()
if (*sender)
return (sender);
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
if (krb_get_tf_fullname((char *)TKT_FILE, pname, pinst, prealm) == KSUCCESS)
{
(void) sprintf(sender, "%s%s%s@%s", pname, (pinst[0]?".":""),
diff --git a/lib/ZGetSubs.c b/lib/ZGetSubs.c
index 5dd92c7..c3ed5aa 100644
--- a/lib/ZGetSubs.c
+++ b/lib/ZGetSubs.c
@@ -16,9 +16,7 @@
static char rcsid_ZGetSubscriptions_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
#define min(a,b) ((a)<(b)?(a):(b))
diff --git a/lib/ZGetWGPort.c b/lib/ZGetWGPort.c
index 500a146..1c5ac06 100644
--- a/lib/ZGetWGPort.c
+++ b/lib/ZGetWGPort.c
@@ -16,8 +16,7 @@
static char rcsid_ZGetWGPort_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
int ZGetWGPort()
{
diff --git a/lib/ZIfNotice.c b/lib/ZIfNotice.c
index e49e6bb..80f5a20 100644
--- a/lib/ZIfNotice.c
+++ b/lib/ZIfNotice.c
@@ -12,19 +12,17 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZIfNotice_c[] = "$Id$";
+static const char rcsid_ZIfNotice_c[] = "$Id$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
-
Code_t ZIfNotice(notice, from, predicate, args)
ZNotice_t *notice;
struct sockaddr_in *from;
- int (*predicate)();
- char *args;
+ int (*predicate) __P((ZNotice_t *, void *));
+ void *args;
{
ZNotice_t tmpnotice;
Code_t retval;
diff --git a/lib/ZInit.c b/lib/ZInit.c
index 6082664..6cdd486 100644
--- a/lib/ZInit.c
+++ b/lib/ZInit.c
@@ -17,22 +17,23 @@ static char rcsid_ZInitialize_c[] =
"$Zephyr: /afs/athena.mit.edu/astaff/project/zephyr/src/lib/RCS/ZInitialize.c,v 1.17 89/05/30 18:11:25 jtkohl Exp $";
#endif
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
-#include <netdb.h>
#include <sys/socket.h>
-#include <sys/param.h>
-#ifdef Z_HaveKerberos
-#include "krb_err.h"
+#ifdef ZEPHYR_USES_KERBEROS
+#include <krb_err.h>
#endif
Code_t ZInitialize()
{
struct servent *hmserv;
char addr[4];
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
+ Code_t code;
+ ZNotice_t notice;
+ char *krealm;
int krbval;
+ char d1[ANAME_SZ], d2[INST_SZ];
initialize_krb_error_table();
#endif
@@ -50,26 +51,54 @@ Code_t ZInitialize()
addr[3] = 1;
hmserv = (struct servent *)getservbyname(HM_SVCNAME, "udp");
- if (!hmserv)
- return (ZERR_HMPORT);
-
- __HM_addr.sin_port = hmserv->s_port;
+ __HM_addr.sin_port = (hmserv) ? hmserv->s_port : HM_SVC_FALLBACK;
(void) memcpy((char *)&__HM_addr.sin_addr, addr, 4);
__HM_set = 0;
-#ifdef Z_HaveKerberos
- if ((krbval = krb_get_lrealm(__Zephyr_realm, 1)) != KSUCCESS)
+ /* Initialize the input queue */
+ __Q_Tail = NULL;
+ __Q_Head = NULL;
+
+#ifdef ZEPHYR_USES_KERBEROS
+
+ /* if the application is a server, there might not be a zhm. The
+ code will fall back to something which might not be "right",
+ but this is is ok, since none of the servers call krb_rd_req. */
+
+ if (! __Zephyr_server) {
+ if ((code = ZOpenPort(NULL)) != ZERR_NONE)
+ return(code);
+
+ if ((code = ZhmStat(NULL, &notice)) != ZERR_NONE)
+ return(code);
+
+ ZClosePort();
+
+ /* the first field, which is NUL-terminated, is the server name.
+ If this code ever support a multiplexing zhm, this will have to
+ be made smarter, and probably per-message */
+
+ krealm = krb_realmofhost(notice.z_message);
+
+ ZFreeNotice(&notice);
+ } else {
+ krealm = NULL;
+ }
+
+ if (krealm) {
+ strcpy(__Zephyr_realm, krealm);
+ } else if ((krb_get_tf_fullname(TKT_FILE, d1, d2, __Zephyr_realm)
+ != KSUCCESS) &&
+ ((krbval = krb_get_lrealm(__Zephyr_realm, 1)) != KSUCCESS)) {
return (krbval);
+ }
#endif
/* Get the sender so we can cache it */
(void) ZGetSender();
- /* Initialize the input queue */
- __Q_Tail = NULL;
- __Q_Head = NULL;
-
return (ZERR_NONE);
}
+
diff --git a/lib/ZLocateU.c b/lib/ZLocateU.c
index 6b10ccd..87c2713 100644
--- a/lib/ZLocateU.c
+++ b/lib/ZLocateU.c
@@ -16,9 +16,7 @@
static char rcsid_ZLocateUser_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZLocateUser(user, nlocs)
char *user;
diff --git a/lib/ZLocations.c b/lib/ZLocations.c
index 7701a8d..a0a2d4f 100644
--- a/lib/ZLocations.c
+++ b/lib/ZLocations.c
@@ -18,17 +18,43 @@ static char rcsid_ZLocations_c[] =
"$Zephyr: /afs/athena.mit.edu/astaff/project/zephyr/src/lib/RCS/ZLocations.c,v 1.30 90/12/20 03:04:39 raeburn Exp $";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
#include <pwd.h>
-#include <sys/file.h>
-#include <sys/param.h>
-#include <netdb.h>
-extern char *getenv();
-extern int errno;
+static char host[MAXHOSTNAMELEN], mytty[MAXPATHLEN];
+static int location_info_set = 0;
+
+Code_t ZInitLocationInfo(hostname, tty)
+ char *hostname;
+ char *tty;
+{
+ char *ttyp, *p;
+ struct hostent *hent;
+
+ if (hostname) {
+ strcpy(host, hostname);
+ } else {
+ if (gethostname(host, MAXHOSTNAMELEN) < 0)
+ return (errno);
+ hent = gethostbyname(host);
+ if (hent)
+ (void) strcpy(host, hent->h_name);
+ }
+ if (tty) {
+ strcpy(mytty, tty);
+ } else {
+ ttyp = ttyname(0);
+ if (ttyp) {
+ p = strrchr(ttyp, '/');
+ strcpy(mytty, (p) ? p + 1 : ttyp);
+ } else {
+ strcpy(mytty, "unknown");
+ }
+ }
+ location_info_set = 1;
+ return (ZERR_NONE);
+}
Code_t ZSetLocation(exposure)
char *exposure;
@@ -48,29 +74,42 @@ Code_t ZFlushMyLocations()
return (Z_SendLocation(LOGIN_CLASS, LOGIN_USER_FLUSH, ZAUTH, ""));
}
-static char host[MAXHOSTNAMELEN], mytty[MAXPATHLEN];
-static int reenter = 0;
+char *ZParseExposureLevel(text)
+ char *text;
+{
+ if (!strcasecmp(text, EXPOSE_NONE))
+ return (EXPOSE_NONE);
+ else if (!strcasecmp(text, EXPOSE_OPSTAFF))
+ return (EXPOSE_OPSTAFF);
+ else if (!strcasecmp(text, EXPOSE_REALMVIS))
+ return (EXPOSE_REALMVIS);
+ else if (!strcasecmp(text, EXPOSE_REALMANN))
+ return (EXPOSE_REALMANN);
+ else if (!strcasecmp(text, EXPOSE_NETVIS))
+ return (EXPOSE_NETVIS);
+ else if (!strcasecmp(text, EXPOSE_NETANN))
+ return (EXPOSE_NETANN);
+ else
+ return(NULL);
+}
-Z_SendLocation(class, opcode, auth, format)
+Code_t Z_SendLocation(class, opcode, auth, format)
char *class;
char *opcode;
- int (*auth)();
+ Z_AuthProc auth;
char *format;
{
- char *ttyname(), *ctime();
-
int retval;
- long ourtime;
+ time_t ourtime;
ZNotice_t notice, retnotice;
char *bptr[3];
-#ifdef X11
- char *display;
-#endif /* X11 */
- char *ttyp;
struct hostent *hent;
short wg_port = ZGetWGPort();
- (void) memset((char *)&notice, 0, sizeof(notice));
+ if (!location_info_set)
+ ZInitLocationInfo(NULL, NULL);
+
+ memset((char *)&notice, 0, sizeof(notice));
notice.z_kind = ACKED;
notice.z_port = (u_short) ((wg_port == -1) ? 0 : wg_port);
notice.z_class = class;
@@ -81,51 +120,12 @@ Z_SendLocation(class, opcode, auth, format)
notice.z_num_other_fields = 0;
notice.z_default_format = format;
- /*
- keep track of what we said before so that we can be consistent
- when changing location information.
- This is done mainly for the sake of the WindowGram client.
- */
-
- if (!reenter) {
- if (gethostname(host, MAXHOSTNAMELEN) < 0)
- return (errno);
-
- hent = gethostbyname(host);
- if (hent)
- (void) strcpy(host, hent->h_name);
- bptr[0] = host;
-#ifdef X11
- if ((display = getenv("DISPLAY")) && *display) {
- (void) strcpy(mytty, display);
- bptr[2] = mytty;
- } else {
-#endif /* X11 */
- ttyp = ttyname(0);
- if (ttyp) {
- bptr[2] = strrchr(ttyp, '/');
- if (bptr[2])
- bptr[2]++;
- else
- bptr[2] = ttyp;
- }
- else
- bptr[2] = "unknown";
- (void) strcpy(mytty, bptr[2]);
-#ifdef X11
- }
-#endif /* X11 */
- reenter = 1;
- } else {
- bptr[0] = host;
- bptr[2] = mytty;
- }
-
- ourtime = time((long *)0);
+ bptr[0] = host;
+ ourtime = time((time_t *)0);
bptr[1] = ctime(&ourtime);
bptr[1][strlen(bptr[1])-1] = '\0';
+ bptr[2] = mytty;
-
if ((retval = ZSendList(&notice, bptr, 3, auth)) != ZERR_NONE)
return (retval);
diff --git a/lib/ZMakeAscii.c b/lib/ZMakeAscii.c
index da88fdd..413c515 100644
--- a/lib/ZMakeAscii.c
+++ b/lib/ZMakeAscii.c
@@ -12,11 +12,14 @@
*/
/* $Header$ */
+#include <internal.h>
+#include <assert.h>
+
#ifndef lint
-static char rcsid_ZMakeAscii_c[] = "$Id$";
+static const char rcsid_ZMakeAscii_c[] = "$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
+static char *itox_chars = "0123456789ABCDEF";
Code_t ZMakeAscii(ptr, len, field, num)
register char *ptr;
@@ -25,7 +28,6 @@ Code_t ZMakeAscii(ptr, len, field, num)
int num;
{
int i;
- register char *itox_chars = "0123456789ABCDEF";
for (i=0;i<num;i++) {
/* we need to add "0x" if we are between 4 byte pieces */
@@ -51,3 +53,42 @@ Code_t ZMakeAscii(ptr, len, field, num)
*ptr = '\0';
return ZERR_NONE;
}
+
+Code_t ZMakeAscii32(ptr, len, value)
+ register char *ptr;
+ int len;
+ unsigned long value;
+{
+ if (len < 11)
+ return ZERR_FIELDLEN;
+ *ptr++ = '0';
+ *ptr++ = 'x';
+ *ptr++ = itox_chars[(value >> 28) & 0xf];
+ *ptr++ = itox_chars[(value >> 24) & 0xf];
+ *ptr++ = itox_chars[(value >> 20) & 0xf];
+ *ptr++ = itox_chars[(value >> 16) & 0xf];
+ *ptr++ = itox_chars[(value >> 12) & 0xf];
+ *ptr++ = itox_chars[(value >> 8) & 0xf];
+ *ptr++ = itox_chars[(value >> 4) & 0xf];
+ *ptr++ = itox_chars[(value >> 0) & 0xf];
+ *ptr = 0;
+ return ZERR_NONE;
+}
+
+Code_t ZMakeAscii16(ptr, len, value)
+ register char *ptr;
+ int len;
+ unsigned int value;
+{
+ if (len < 7)
+ return ZERR_FIELDLEN;
+ *ptr++ = '0';
+ *ptr++ = 'x';
+ *ptr++ = itox_chars[(value >> 12) & 0xf];
+ *ptr++ = itox_chars[(value >> 8) & 0xf];
+ *ptr++ = itox_chars[(value >> 4) & 0xf];
+ *ptr++ = itox_chars[(value >> 0) & 0xf];
+ *ptr = 0;
+ return ZERR_NONE;
+}
+
diff --git a/lib/ZMkAuth.c b/lib/ZMkAuth.c
index d027476..18d5014 100644
--- a/lib/ZMkAuth.c
+++ b/lib/ZMkAuth.c
@@ -12,19 +12,20 @@
*/
/* $Id$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZMakeAuthentication_c[] = "$Id$";
+static const char rcsid_ZMakeAuthentication_c[] = "$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
-#ifdef Z_HaveKerberos
-#include "krb_err.h"
+#ifdef ZEPHYR_USES_KERBEROS
+#include <krb_err.h>
static long last_authent_time = 0L;
static KTEXT_ST last_authent;
#endif
Code_t ZResetAuthentication () {
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
last_authent_time = 0L;
#endif
return ZERR_NONE;
@@ -36,13 +37,14 @@ Code_t ZMakeAuthentication(notice, buffer, buffer_len, len)
int buffer_len;
int *len;
{
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
int result;
- long now,time();
+ time_t now;
KTEXT_ST authent;
char *cstart, *cend;
- long checksum;
+ ZChecksum_t checksum;
CREDENTIALS cred;
+ extern unsigned long des_quad_cksum();
now = time(0);
if (last_authent_time == 0 || (now - last_authent_time > 120)) {
@@ -79,18 +81,16 @@ Code_t ZMakeAuthentication(notice, buffer, buffer_len, len)
return(result);
/* Compute a checksum over the header and message. */
- if (result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE,
- __Zephyr_realm, &cred))
+ if ((result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE,
+ __Zephyr_realm, &cred)) != 0)
return result;
checksum = des_quad_cksum(buffer, NULL, cstart - buffer, 0, cred.session);
checksum ^= des_quad_cksum(cend, NULL, buffer + *len - cend, 0,
cred.session);
checksum ^= des_quad_cksum(notice->z_message, NULL, notice->z_message_len,
0, cred.session);
- notice->z_checksum = (ZChecksum_t) checksum;
- checksum = htonl(checksum);
- ZMakeAscii(cstart, buffer + buffer_len - cstart,
- (unsigned char *) &checksum, sizeof(checksum));
+ notice->z_checksum = checksum;
+ ZMakeAscii32(cstart, buffer + buffer_len - cstart, checksum);
return (ZERR_NONE);
#else
diff --git a/lib/ZNewLocU.c b/lib/ZNewLocU.c
index 3231126..87c6dc4 100644
--- a/lib/ZNewLocU.c
+++ b/lib/ZNewLocU.c
@@ -12,19 +12,19 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZNewLocateUser_c[] =
+static const char rcsid_ZNewLocateUser_c[] =
"$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
-
Code_t ZLocateUser(user, nlocs, auth)
char *user;
int *nlocs;
Z_AuthProc auth;
{
- register int retval;
+ Code_t retval;
ZNotice_t notice;
ZAsyncLocateData_t zald;
@@ -34,8 +34,7 @@ Code_t ZLocateUser(user, nlocs, auth)
if ((retval = ZRequestLocations(user, &zald, UNACKED, auth)) != ZERR_NONE)
return(retval);
- retval = Z_WaitForNotice (&notice, ZCompareALDPred,
- (char *) &zald, SRV_TIMEOUT);
+ retval = Z_WaitForNotice (&notice, ZCompareALDPred, &zald, SRV_TIMEOUT);
if (retval == ZERR_NONOTICE)
return ETIMEDOUT;
if (retval != ZERR_NONE)
diff --git a/lib/ZOpenPort.c b/lib/ZOpenPort.c
index 88d2d9f..cae00b8 100644
--- a/lib/ZOpenPort.c
+++ b/lib/ZOpenPort.c
@@ -16,9 +16,7 @@
static char rcsid_ZOpenPort_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
#include <sys/socket.h>
Code_t ZOpenPort(port)
diff --git a/lib/ZParseNot.c b/lib/ZParseNot.c
index 5717d11..daf1b3d 100644
--- a/lib/ZParseNot.c
+++ b/lib/ZParseNot.c
@@ -17,9 +17,7 @@ static char rcsid_ZParseNotice_c[] =
"$Zephyr: /mit/zephyr/src/lib/RCS/ZParseNotice.c,v 1.22 91/03/29 03:34:46 raeburn Exp $";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
/* Assume that strlen is efficient on this machine... */
#define next_field(ptr) ptr += strlen (ptr) + 1
@@ -77,13 +75,8 @@ Code_t ZParseNotice(buffer, len, notice)
ZNotice_t *notice;
{
char *ptr, *end;
+ unsigned long temp;
int maj, numfields, i;
- union {
- int i;
- ZUnique_Id_t uid;
- u_short us;
- ZChecksum_t sum;
- } temp;
#ifdef __LINE__
int lineno;
@@ -92,11 +85,11 @@ Code_t ZParseNotice(buffer, len, notice)
* be used as the "then" part of an "if" statement that also has
* an "else" clause.
*/
-#define BAD {lineno=__LINE__;goto badpkt;}
+#define BAD_PACKET {lineno=__LINE__;goto badpkt;}
/* This one gets lint/compiler complaints. */
/*#define BAD do{lineno=__LINE__;goto badpkt;}while(0)*/
#else
-#define BAD goto badpkt
+#define BAD_PACKET goto badpkt
#endif
(void) memset((char *)notice, 0, sizeof(ZNotice_t));
@@ -121,10 +114,9 @@ Code_t ZParseNotice(buffer, len, notice)
return (ZERR_VERS);
next_field (ptr);
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)&temp.i,
- sizeof(temp.i)) == ZERR_BADFIELD)
- BAD;
- numfields = ntohl((u_long) temp.i);
+ if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
+ BAD_PACKET;
+ numfields = temp;
next_field (ptr);
/*XXX 3 */
@@ -150,63 +142,57 @@ Code_t ZParseNotice(buffer, len, notice)
}
if (numfields) {
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)&temp.i,
- sizeof(temp.i)) == ZERR_BADFIELD)
- BAD;
- notice->z_kind = (ZNotice_Kind_t)ntohl((u_long) temp.i);
+ if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
+ BAD_PACKET;
+ notice->z_kind = temp;
numfields--;
next_field (ptr);
}
else
- BAD;
+ BAD_PACKET;
if (numfields) {
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)&temp.uid,
+ if (ZReadAscii(ptr, end-ptr, (unsigned char *)&notice->z_uid,
sizeof(ZUnique_Id_t)) == ZERR_BADFIELD)
- BAD;
- notice->z_uid = temp.uid;
+ BAD_PACKET;
notice->z_time.tv_sec = ntohl((u_long) notice->z_uid.tv.tv_sec);
notice->z_time.tv_usec = ntohl((u_long) notice->z_uid.tv.tv_usec);
numfields--;
next_field (ptr);
}
else
- BAD;
+ BAD_PACKET;
if (numfields) {
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)&temp.us,
- sizeof(u_short)) ==
- ZERR_BADFIELD)
- BAD;
- notice->z_port = temp.us;
+ if (ZReadAscii16(ptr, end-ptr, &notice->z_port) == ZERR_BADFIELD)
+ BAD_PACKET;
+ notice->z_port = htons(notice->z_port);
numfields--;
next_field (ptr);
}
else
- BAD;
+ BAD_PACKET;
if (numfields) {
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)&temp.i,
- sizeof(int)) == ZERR_BADFIELD)
- BAD;
- notice->z_auth = temp.i;
+ if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
+ BAD_PACKET;
+ notice->z_auth = temp;
numfields--;
next_field (ptr);
}
else
- BAD;
+ BAD_PACKET;
notice->z_checked_auth = ZAUTH_UNSET;
if (numfields) {
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)&temp.i,
- sizeof(int)) == ZERR_BADFIELD)
- BAD;
- notice->z_authent_len = ntohl((u_long) temp.i);
+ if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
+ BAD_PACKET;
+ notice->z_authent_len = temp;
numfields--;
next_field (ptr);
}
else
- BAD;
+ BAD_PACKET;
if (numfields) {
notice->z_ascii_authent = ptr;
@@ -214,7 +200,7 @@ Code_t ZParseNotice(buffer, len, notice)
next_field (ptr);
}
else
- BAD;
+ BAD_PACKET;
if (numfields) {
notice->z_class = ptr;
@@ -265,11 +251,9 @@ Code_t ZParseNotice(buffer, len, notice)
notice->z_default_format = "";
/*XXX*/
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)&temp.sum,
- sizeof(ZChecksum_t))
- == ZERR_BADFIELD)
- BAD;
- notice->z_checksum = ntohl((u_long) temp.sum);
+ if (ZReadAscii32(ptr, end-ptr, &temp) == ZERR_BADFIELD)
+ BAD_PACKET;
+ notice->z_checksum = temp;
numfields--;
next_field (ptr);
@@ -282,10 +266,9 @@ Code_t ZParseNotice(buffer, len, notice)
notice->z_multinotice = "";
if (numfields) {
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)&temp.uid,
+ if (ZReadAscii(ptr, end-ptr, (unsigned char *)&notice->z_multiuid,
sizeof(ZUnique_Id_t)) == ZERR_BADFIELD)
- BAD;
- notice->z_multiuid = temp.uid;
+ BAD_PACKET;
notice->z_time.tv_sec = ntohl((u_long) notice->z_multiuid.tv.tv_sec);
notice->z_time.tv_usec = ntohl((u_long) notice->z_multiuid.tv.tv_usec);
numfields--;
@@ -296,7 +279,6 @@ Code_t ZParseNotice(buffer, len, notice)
for (i=0;i<Z_MAXOTHERFIELDS && numfields;i++,numfields--) {
notice->z_other_fields[i] = ptr;
- numfields--;
next_field (ptr);
}
notice->z_num_other_fields = i;
@@ -304,16 +286,6 @@ Code_t ZParseNotice(buffer, len, notice)
for (i=0;i<numfields;i++)
next_field (ptr);
-#ifdef notdef
- if (ZReadAscii(ptr, end-ptr, (unsigned char *)temp,
- sizeof(ZChecksum_t))
- == ZERR_BADFIELD)
- BAD;
- notice->z_checksum = ntohl(*temp);
- numfields--;
- next_field (ptr);
-#endif
-
notice->z_message = (caddr_t) ptr;
notice->z_message_len = len-(ptr-buffer);
diff --git a/lib/ZPeekIfNot.c b/lib/ZPeekIfNot.c
index a010fa6..11a5ae6 100644
--- a/lib/ZPeekIfNot.c
+++ b/lib/ZPeekIfNot.c
@@ -16,9 +16,7 @@
static char rcsid_ZPeekIfNotice_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZPeekIfNotice(notice, from, predicate, args)
ZNotice_t *notice;
diff --git a/lib/ZPeekNot.c b/lib/ZPeekNot.c
index f789ee1..e1ebb2d 100644
--- a/lib/ZPeekNot.c
+++ b/lib/ZPeekNot.c
@@ -16,9 +16,7 @@
static char rcsid_ZPeekNotice_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZPeekNotice(notice, from)
ZNotice_t *notice;
diff --git a/lib/ZPeekPkt.c b/lib/ZPeekPkt.c
index 439194b..aa21dda 100644
--- a/lib/ZPeekPkt.c
+++ b/lib/ZPeekPkt.c
@@ -16,9 +16,7 @@
static char rcsid_ZPeekPacket_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZPeekPacket(buffer, ret_len, from)
char **buffer;
diff --git a/lib/ZPending.c b/lib/ZPending.c
index 03cc8c7..982f83c 100644
--- a/lib/ZPending.c
+++ b/lib/ZPending.c
@@ -16,9 +16,7 @@
static char rcsid_ZPending_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
int ZPending()
{
diff --git a/lib/ZReadAscii.c b/lib/ZReadAscii.c
index ada78c6..4b4faed 100644
--- a/lib/ZReadAscii.c
+++ b/lib/ZReadAscii.c
@@ -13,17 +13,11 @@
/* $Header$ */
#ifndef lint
-static
-#ifdef __STDC__
- const
-#endif
- char rcsid_ZReadAscii_c[] =
- "$Header$";
+static char rcsid_ZReadAscii_c[] = "$Header$";
#endif /* lint */
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
+#include <assert.h>
#if 0
static __inline__
@@ -42,7 +36,7 @@ Z_cnvt_xtoi (char c)
#define Z_cnvt_xtoi(c) ((temp=(c)-'0'),(temp<10)?temp:((temp-='A'-'9'-1),(temp<16)?temp:-1))
-int ZReadAscii(ptr, len, field, num)
+Code_t ZReadAscii(ptr, len, field, num)
char *ptr;
int len;
unsigned char *field;
@@ -51,9 +45,7 @@ int ZReadAscii(ptr, len, field, num)
int i;
unsigned int hexbyte;
register int c1, c2;
-#ifdef Z_cnvt_xtoi
register unsigned int temp;
-#endif
for (i=0;i<num;i++) {
if (*ptr == ' ') {
@@ -83,3 +75,34 @@ int ZReadAscii(ptr, len, field, num)
return *ptr ? ZERR_BADFIELD : ZERR_NONE;
}
+
+Code_t ZReadAscii32(ptr, len, value_ptr)
+ char *ptr;
+ int len;
+ unsigned long *value_ptr;
+{
+ unsigned char buf[4];
+ Code_t retval;
+
+ retval = ZReadAscii(ptr, len, buf, 4);
+ if (retval != ZERR_NONE)
+ return retval;
+ *value_ptr = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
+ return ZERR_NONE;
+}
+
+Code_t ZReadAscii16(ptr, len, value_ptr)
+ char *ptr;
+ int len;
+ unsigned short *value_ptr;
+{
+ unsigned char buf[2];
+ Code_t retval;
+
+ retval = ZReadAscii(ptr, len, buf, 2);
+ if (retval != ZERR_NONE)
+ return retval;
+ *value_ptr = (buf[0] << 8) | buf[1];
+ return ZERR_NONE;
+}
+
diff --git a/lib/ZRecvNot.c b/lib/ZRecvNot.c
index 34de47b..4cd29bc 100644
--- a/lib/ZRecvNot.c
+++ b/lib/ZRecvNot.c
@@ -16,9 +16,7 @@
static char rcsid_ZReceiveNotice_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZReceiveNotice(notice, from)
ZNotice_t *notice;
diff --git a/lib/ZRecvPkt.c b/lib/ZRecvPkt.c
index 645aeba..13a6959 100644
--- a/lib/ZRecvPkt.c
+++ b/lib/ZRecvPkt.c
@@ -16,9 +16,7 @@
static char rcsid_ZReceivePacket_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZReceivePacket(buffer, ret_len, from)
ZPacket_t buffer;
diff --git a/lib/ZRetSubs.c b/lib/ZRetSubs.c
index 1366b4c..ddbff41 100644
--- a/lib/ZRetSubs.c
+++ b/lib/ZRetSubs.c
@@ -13,18 +13,23 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZRetrieveSubscriptions_c[] =
+static const char rcsid_ZRetrieveSubscriptions_c[] =
"$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
-
static Code_t Z_RetSubs ();
+/* Need STDC definition when possible for unsigned short argument. */
+#ifdef __STDC__
+Code_t ZRetrieveSubscriptions(unsigned short port, int *nsubs)
+#else
Code_t ZRetrieveSubscriptions(port,nsubs)
- u_short port;
+ unsigned short port;
int *nsubs;
+#endif
{
int retval;
ZNotice_t notice;
@@ -33,9 +38,8 @@ Code_t ZRetrieveSubscriptions(port,nsubs)
if (!port) /* use default port */
port = __Zephyr_port;
- if ((retval = ZMakeAscii(asciiport,sizeof(asciiport),
- (unsigned char *)&port,
- sizeof(u_short))) != ZERR_NONE)
+ retval = ZMakeAscii16(asciiport, sizeof(asciiport), ntohs(port));
+ if (retval != ZERR_NONE)
return (retval);
(void) memset((char *)&notice, 0, sizeof(notice));
@@ -63,12 +67,13 @@ Code_t ZRetrieveDefaultSubscriptions(nsubs)
static Code_t Z_RetSubs(notice, nsubs, auth_routine)
register ZNotice_t *notice;
int *nsubs;
- int (*auth_routine)();
+ Z_AuthProc auth_routine;
{
register int i;
int retval,nrecv,gimmeack;
ZNotice_t retnotice;
char *ptr,*end,*ptr2;
+ ZSubscription_t *list = __subscriptions_list;
retval = ZFlushSubscriptions();
@@ -92,7 +97,7 @@ static Code_t Z_RetSubs(notice, nsubs, auth_routine)
nrecv = 0;
gimmeack = 0;
- __subscriptions_list = (ZSubscription_t *) 0;
+ list = (ZSubscription_t *) 0;
while (!nrecv || !gimmeack) {
retval = Z_WaitForNotice (&retnotice, ZCompareMultiUIDPred,
@@ -135,46 +140,50 @@ static Code_t Z_RetSubs(notice, nsubs, auth_routine)
__subscriptions_num = __subscriptions_num / 3;
- __subscriptions_list = (ZSubscription_t *)
- malloc((unsigned)(__subscriptions_num*
- sizeof(ZSubscription_t)));
- if (__subscriptions_num && !__subscriptions_list) {
+ list = (ZSubscription_t *)
+ malloc(__subscriptions_num * sizeof(ZSubscription_t));
+ if (__subscriptions_num && !list) {
ZFreeNotice(&retnotice);
return (ENOMEM);
}
- for (ptr=retnotice.z_message,i = 0; i< __subscriptions_num; i++) {
- __subscriptions_list[i].zsub_class = (char *)
- malloc((unsigned)strlen(ptr)+1);
- if (!__subscriptions_list[i].zsub_class) {
+ ptr = retnotice.z_message;
+ for (i = 0; i < __subscriptions_num; i++) {
+ list[i].zsub_class = (char *)
+ malloc(strlen(ptr) + 1);
+ if (!list[i].zsub_class) {
ZFreeNotice(&retnotice);
return (ENOMEM);
}
- (void) strcpy(__subscriptions_list[i].zsub_class,ptr);
+ strcpy(list[i].zsub_class, ptr);
ptr += strlen(ptr)+1;
- __subscriptions_list[i].zsub_classinst = (char *)
- malloc((unsigned)strlen(ptr)+1);
- if (!__subscriptions_list[i].zsub_classinst) {
+ list[i].zsub_classinst = (char *)
+ malloc(strlen(ptr) + 1);
+ if (!list[i].zsub_classinst) {
ZFreeNotice(&retnotice);
return (ENOMEM);
}
- (void) strcpy(__subscriptions_list[i].zsub_classinst,ptr);
+ strcpy(list[i].zsub_classinst, ptr);
ptr += strlen(ptr)+1;
ptr2 = ptr;
- if (!*ptr2)
- ptr2 = "*";
- __subscriptions_list[i].zsub_recipient = (char *)
- malloc((unsigned)strlen(ptr2)+1);
- if (!__subscriptions_list[i].zsub_recipient) {
+ list[i].zsub_recipient = (char *)
+ malloc(strlen(ptr2) + 2);
+ if (!list[i].zsub_recipient) {
ZFreeNotice(&retnotice);
return (ENOMEM);
}
- (void) strcpy(__subscriptions_list[i].zsub_recipient,ptr2);
+ if (*ptr2 == '@' || *ptr2 == 0) {
+ *list[i].zsub_recipient = '*';
+ strcpy(list[i].zsub_recipient + 1, ptr2);
+ } else {
+ strcpy(list[i].zsub_recipient, ptr2);
+ }
ptr += strlen(ptr)+1;
}
ZFreeNotice(&retnotice);
}
+ __subscriptions_list = list;
__subscriptions_next = 0;
*nsubs = __subscriptions_num;
diff --git a/lib/ZSendList.c b/lib/ZSendList.c
index a7accfb..961975b 100644
--- a/lib/ZSendList.c
+++ b/lib/ZSendList.c
@@ -16,9 +16,7 @@
static char rcsid_ZSendList_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZSendList(notice, list, nitems, cert_routine)
ZNotice_t *notice;
@@ -33,8 +31,8 @@ Code_t ZSrvSendList(notice, list, nitems, cert_routine, send_routine)
ZNotice_t *notice;
char *list[];
int nitems;
- int (*cert_routine)();
- int (*send_routine)();
+ Z_AuthProc cert_routine;
+ Code_t (*send_routine)();
{
Code_t retval;
ZNotice_t newnotice;
diff --git a/lib/ZSendNot.c b/lib/ZSendNot.c
index 3bd6f8a..18d31c0 100644
--- a/lib/ZSendNot.c
+++ b/lib/ZSendNot.c
@@ -16,21 +16,19 @@
static char rcsid_ZSendNotice_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZSendNotice(notice, cert_routine)
ZNotice_t *notice;
- int (*cert_routine)();
+ Z_AuthProc cert_routine;
{
return(ZSrvSendNotice(notice, cert_routine, Z_XmitFragment));
}
Code_t ZSrvSendNotice(notice, cert_routine, send_routine)
ZNotice_t *notice;
- int (*cert_routine)();
- int (*send_routine)();
+ Z_AuthProc cert_routine;
+ Code_t (*send_routine)();
{
Code_t retval;
ZNotice_t newnotice;
diff --git a/lib/ZSendPkt.c b/lib/ZSendPkt.c
index 019b989..d9c92f4 100644
--- a/lib/ZSendPkt.c
+++ b/lib/ZSendPkt.c
@@ -17,9 +17,7 @@ static char rcsid_ZSendPacket_c[] =
"$Zephyr: /mit/zephyr/src/lib/RCS/ZSendPacket.c,v 1.29 91/03/21 11:57:08 raeburn Exp $";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
#include <sys/socket.h>
static int wait_for_hmack();
diff --git a/lib/ZSendRLst.c b/lib/ZSendRLst.c
index b148a11..ef44d4a 100644
--- a/lib/ZSendRLst.c
+++ b/lib/ZSendRLst.c
@@ -16,9 +16,7 @@
static char rcsid_ZSendRawList_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZSendRawList(notice, list, nitems)
ZNotice_t *notice;
@@ -32,7 +30,7 @@ Code_t ZSrvSendRawList(notice, list, nitems, send_routine)
ZNotice_t *notice;
char *list[];
int nitems;
- int (*send_routine)();
+ Code_t (*send_routine)();
{
Code_t retval;
ZNotice_t newnotice;
diff --git a/lib/ZSendRaw.c b/lib/ZSendRaw.c
index b9a633d..72e51e5 100644
--- a/lib/ZSendRaw.c
+++ b/lib/ZSendRaw.c
@@ -16,9 +16,7 @@
static char rcsid_ZSendRawNotice_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZSendRawNotice(notice)
ZNotice_t *notice;
diff --git a/lib/ZSetDest.c b/lib/ZSetDest.c
index dd16436..85e374d 100644
--- a/lib/ZSetDest.c
+++ b/lib/ZSetDest.c
@@ -16,9 +16,7 @@
static char rcsid_ZSetDestAddr_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZSetDestAddr(addr)
struct sockaddr_in *addr;
diff --git a/lib/ZSetFD.c b/lib/ZSetFD.c
index 40388f5..1d048ea 100644
--- a/lib/ZSetFD.c
+++ b/lib/ZSetFD.c
@@ -16,9 +16,7 @@
static char rcsid_ZSetFD_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZSetFD(fd)
int fd;
diff --git a/lib/ZSetSrv.c b/lib/ZSetSrv.c
index bc15016..7e62310 100644
--- a/lib/ZSetSrv.c
+++ b/lib/ZSetSrv.c
@@ -16,9 +16,7 @@
static char rcsid_ZSetServerState_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
Code_t ZSetServerState(state)
int state;
diff --git a/lib/ZSubs.c b/lib/ZSubs.c
index 99939fd..784483d 100644
--- a/lib/ZSubs.c
+++ b/lib/ZSubs.c
@@ -13,16 +13,22 @@
*/
/* $Header$ */
+#include <internal.h>
+
#ifndef lint
-static char rcsid_ZSubscriptions_c[] = "$Id$";
+static const char rcsid_ZSubscriptions_c[] = "$Id$";
#endif
-#include <zephyr/zephyr_internal.h>
+static Code_t Z_Subscriptions __P((register ZSubscription_t *sublist,
+ int nitems, unsigned int port,
+ char *opcode, int authit));
+static Code_t subscr_sendoff __P((ZNotice_t *notice, char **lyst, int num,
+ int authit));
Code_t ZSubscribeTo(sublist, nitems, port)
ZSubscription_t *sublist;
int nitems;
- u_short port;
+ unsigned int port;
{
return (Z_Subscriptions(sublist, nitems, port, CLIENT_SUBSCRIBE, 1));
}
@@ -30,7 +36,7 @@ Code_t ZSubscribeTo(sublist, nitems, port)
Code_t ZSubscribeToSansDefaults(sublist, nitems, port)
ZSubscription_t *sublist;
int nitems;
- u_short port;
+ unsigned int port;
{
return (Z_Subscriptions(sublist, nitems, port, CLIENT_SUBSCRIBE_NODEFS,
1));
@@ -39,30 +45,29 @@ Code_t ZSubscribeToSansDefaults(sublist, nitems, port)
Code_t ZUnsubscribeTo(sublist, nitems, port)
ZSubscription_t *sublist;
int nitems;
- u_short port;
+ unsigned int port;
{
return (Z_Subscriptions(sublist, nitems, port, CLIENT_UNSUBSCRIBE, 1));
}
Code_t ZCancelSubscriptions(port)
- u_short port;
+ unsigned int port;
{
return (Z_Subscriptions((ZSubscription_t *)0, 0, port,
CLIENT_CANCELSUB, 0));
}
-static Code_t subscr_sendoff();
-
/*
* This routine must do its own fragmentation. Subscriptions must
* not be broken across packet boundaries, or else the server will
* mis-interpret them.
*/
+static Code_t
Z_Subscriptions(sublist, nitems, port, opcode, authit)
register ZSubscription_t *sublist;
int nitems;
- u_short port;
+ unsigned int port;
char *opcode;
int authit;
{
@@ -71,6 +76,7 @@ Z_Subscriptions(sublist, nitems, port, opcode, authit)
ZNotice_t notice;
char header[Z_MAXHEADERLEN];
char **list;
+ char *recip;
int hdrlen;
int size_avail = Z_MAXPKTLEN-Z_FRAGFUDGE; /* space avail for data,
adjusted below */
@@ -98,7 +104,7 @@ Z_Subscriptions(sublist, nitems, port, opcode, authit)
retval = Z_FormatHeader(&notice, header, sizeof(header), &hdrlen, ZAUTH);
if (retval != ZERR_NONE && !authit)
retval = Z_FormatHeader(&notice, header, sizeof(header),
- &hdrlen, ZAUTH);
+ &hdrlen, ZNOAUTH);
if (retval != ZERR_NONE) {
free((char *)list);
return(retval);
@@ -112,11 +118,12 @@ Z_Subscriptions(sublist, nitems, port, opcode, authit)
for (i=0;i<nitems;i++) {
list[i*3] = sublist[i].zsub_class;
list[i*3+1] = sublist[i].zsub_classinst;
- if (sublist[i].zsub_recipient && *sublist[i].zsub_recipient &&
- *sublist[i].zsub_recipient != '*')
- list[i*3+2] = ZGetSender();
- else
- list[i*3+2] = "";
+ recip = sublist[i].zsub_recipient;
+ if (recip && *recip == '*')
+ recip++;
+ if (!recip || (*recip != 0 && *recip != '@'))
+ recip = ZGetSender();
+ list[i*3+2] = recip;
}
start = -1;
diff --git a/lib/ZVariables.c b/lib/ZVariables.c
index 06de7bf..36635cd 100644
--- a/lib/ZVariables.c
+++ b/lib/ZVariables.c
@@ -17,15 +17,14 @@
static char rcsid_ZVariables_c[] = "$Header$";
#endif
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr_internal.h>
+#include <internal.h>
#include <ctype.h>
#include <pwd.h>
-static int get_localvarfile();
-static char *get_varval();
-static int varline();
+static int get_localvarfile __P((char *bfr));
+static char *get_varval __P((char *fn, char *val));
+static int varline __P((char *bfr, char *var));
char *ZGetVariable(var)
char *var;
@@ -36,10 +35,11 @@ char *ZGetVariable(var)
if (get_localvarfile(varfile))
return ((char *)0);
- if (ret = get_varval(varfile, var))
+ if ((ret = get_varval(varfile, var)) != ZERR_NONE)
return (ret);
- return (get_varval(DEFAULT_VARS_FILE, var));
+ sprintf(varfile, "%s/zephyr.vars", CONFDIR);
+ return (get_varval(varfile, var));
}
Code_t ZSetVariable(var, value)
@@ -60,7 +60,7 @@ Code_t ZSetVariable(var, value)
if (!(fpout = fopen(varfilebackup, "w")))
return (errno);
- if (fpin = fopen(varfile, "r")) {
+ if ((fpin = fopen(varfile, "r")) != NULL) {
while (fgets(varbfr, sizeof varbfr, fpin) != (char *) 0) {
if (varbfr[strlen(varbfr)-1] < ' ')
varbfr[strlen(varbfr)-1] = '\0';
@@ -96,7 +96,7 @@ Code_t ZUnsetVariable(var)
if (!(fpout = fopen(varfilebackup, "w")))
return (errno);
- if (fpin = fopen(varfile, "r")) {
+ if ((fpin = fopen(varfile, "r")) != NULL) {
while (fgets(varbfr, sizeof varbfr, fpin) != (char *) 0) {
if (varbfr[strlen(varbfr)-1] < ' ')
varbfr[strlen(varbfr)-1] = '\0';
@@ -112,7 +112,7 @@ Code_t ZUnsetVariable(var)
return (ZERR_NONE);
}
-static get_localvarfile(bfr)
+static int get_localvarfile(bfr)
char *bfr;
{
char *envptr;
@@ -123,7 +123,7 @@ static get_localvarfile(bfr)
(void) strcpy(bfr, envptr);
else {
if (!(pwd = getpwuid((int) getuid()))) {
- fprintf(stderr, "Zephyr internal failure: Can't find your entry in /etc/passwd\n");
+ fprintf(stderr, "Zephyr internal failure: Can't determine your home directory.\n");
return (1);
}
(void) strcpy(bfr, pwd->pw_dir);
diff --git a/lib/ZWait4Not.c b/lib/ZWait4Not.c
index c550ae0..7cdb408 100644
--- a/lib/ZWait4Not.c
+++ b/lib/ZWait4Not.c
@@ -12,23 +12,19 @@
* "mit-copyright.h".
*/
-#include <zephyr/mit-copyright.h>
+#include "mit-copyright.h"
#ifndef lint
-static char rcsid_ZWaitForNotice_c[] =
- "$Zephyr$";
+static char rcsid_ZWaitForNotice_c[] = "$Zephyr$";
#endif
-#include <zephyr/zephyr.h>
-#ifdef _AIX
-#include <sys/select.h>
-#endif
+#include <internal.h>
+#include <sys/socket.h>
-Code_t
-Z_WaitForNotice (notice, pred, uid, timeout)
+Code_t Z_WaitForNotice (notice, pred, arg, timeout)
ZNotice_t *notice;
- int (*pred) ();
- ZUnique_Id_t *uid;
+ int (*pred) __P((ZNotice_t *, void *));
+ void *arg;
int timeout;
{
Code_t retval;
@@ -37,7 +33,7 @@ Z_WaitForNotice (notice, pred, uid, timeout)
int i, fd;
retval = ZCheckIfNotice (notice, (struct sockaddr_in *) 0, pred,
- (char *) uid);
+ (char *) arg);
if (retval == ZERR_NONE)
return ZERR_NONE;
if (retval != ZERR_NONOTICE)
@@ -58,7 +54,7 @@ Z_WaitForNotice (notice, pred, uid, timeout)
return errno;
if (i > 0) {
retval = ZCheckIfNotice (notice, (struct sockaddr_in *) 0, pred,
- (char *) uid);
+ (char *) arg);
if (retval != ZERR_NONOTICE) /* includes ZERR_NONE */
return retval;
}
diff --git a/lib/ZhmStat.c b/lib/ZhmStat.c
new file mode 100644
index 0000000..80f8ed4
--- /dev/null
+++ b/lib/ZhmStat.c
@@ -0,0 +1,88 @@
+/* This file is part of the Project Athena Zephyr Notification System.
+ * It contains the ZhmStat() function.
+ *
+ * Created by: Marc Horowitz
+ *
+ * $Source$
+ * $Author$
+ *
+ * Copyright (c) 1996 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, see the file
+ * "mit-copyright.h".
+ */
+
+#include <internal.h>
+#include <sys/socket.h>
+
+static int outoftime = 0;
+
+static RETSIGTYPE timeout()
+{
+ outoftime = 1;
+}
+
+Code_t ZhmStat(hostaddr, notice)
+ struct in_addr *hostaddr;
+ ZNotice_t *notice;
+{
+ struct servent *sp;
+ struct sockaddr_in sin;
+ ZNotice_t req;
+ Code_t code;
+#ifdef _POSIX_VERSION
+ struct sigaction sa;
+#endif
+
+ (void) memset((char *)&sin, 0, sizeof(struct sockaddr_in));
+
+ sp = getservbyname(HM_SVCNAME, "udp");
+
+ sin.sin_port = (sp) ? sp->s_port : HM_SVC_FALLBACK;
+ sin.sin_family = AF_INET;
+
+ if (hostaddr)
+ sin.sin_addr = *hostaddr;
+ else
+ sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ (void) memset((char *)&req, 0, sizeof(req));
+ req.z_kind = STAT;
+ req.z_port = 0;
+ req.z_class = HM_STAT_CLASS;
+ req.z_class_inst = HM_STAT_CLIENT;
+ req.z_opcode = HM_GIMMESTATS;
+ req.z_sender = "";
+ req.z_recipient = "";
+ req.z_default_format = "";
+ req.z_message_len = 0;
+
+ if ((code = ZSetDestAddr(&sin)) != ZERR_NONE)
+ return(code);
+
+ if ((code = ZSendNotice(&req, ZNOAUTH)) != ZERR_NONE)
+ return(code);
+
+#ifdef _POSIX_VERSION
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ sa.sa_handler = timeout;
+ (void) sigaction(SIGALRM, &sa, (struct sigaction *)0);
+#else
+ (void) signal(SIGALRM,timeout);
+#endif
+
+ outoftime = 0;
+ (void) alarm(10);
+
+ if (((code = ZReceiveNotice(notice, (struct sockaddr_in *) 0))
+ != ZERR_NONE) &&
+ code != EINTR)
+ return(code);
+
+ (void) alarm(0);
+
+ if (outoftime)
+ return(ZERR_HMDEAD);
+
+ return(ZERR_NONE);
+}
diff --git a/lib/Zinternal.c b/lib/Zinternal.c
index 7cd24cc..019bafd 100644
--- a/lib/Zinternal.c
+++ b/lib/Zinternal.c
@@ -13,30 +13,16 @@
*/
/* $Header$ */
-#ifndef lint
-static char rcsid_Zinternal_c[] =
- "$Id$";
-static char copyright[] =
- "Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.";
-#endif
-
-#include <zephyr/zephyr_internal.h>
-#include <netdb.h>
+#include <internal.h>
#include <arpa/inet.h>
-#include <sys/param.h>
#include <sys/socket.h>
-#include <sys/ioctl.h>
#include <utmp.h>
-#include <krb.h>
-#ifdef SOLARIS
-#include <sys/filio.h>
-#endif
-
-#ifdef __STDC__
-typedef void *pointer;
-#else
-typedef char *pointer;
+#ifndef lint
+static const char rcsid_Zinternal_c[] =
+ "$Id$";
+static const char copyright[] =
+ "Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.";
#endif
extern char *inet_ntoa ();
@@ -60,17 +46,21 @@ ZSubscription_t *__subscriptions_list;
int __subscriptions_num;
int __subscriptions_next;
-#ifdef Z_HaveKerberos
+#ifdef ZEPHYR_USES_KERBEROS
C_Block __Zephyr_session;
char __Zephyr_realm[REALM_SZ];
#endif
#ifdef Z_DEBUG
-void (*__Z_debug_print) Zproto((const char *fmt, va_list args, void *closure));
+void (*__Z_debug_print) __P((const char *fmt, va_list args, void *closure));
+void *__Z_debug_print_closure;
#endif
#define min(a,b) ((a)<(b)?(a):(b))
+static int Z_AddField __P((char **ptr, char *field, char *end));
+static int find_or_insert_uid __P((ZUnique_Id_t *uid, ZNotice_Kind_t kind));
+
/* Find or insert uid in the old uids buffer. The buffer is a sorted
* circular queue. We make the assumption that most packets arrive in
* order, so we can usually search for a uid or insert it into the buffer
@@ -177,12 +167,13 @@ Code_t Z_GetMyAddr()
int Z_PacketWaiting()
{
- int bytes;
-
- if (ioctl(ZGetFD(), FIONREAD, (char *)&bytes) < 0)
- return (0);
+ struct timeval tv;
+ fd_set read;
- return (bytes > 0);
+ tv.tv_sec = tv.tv_usec = 0;
+ FD_ZERO(&read);
+ FD_SET(ZGetFD(), &read);
+ return (select(ZGetFD() + 1, &read, NULL, NULL, &tv));
}
@@ -266,7 +257,6 @@ Code_t Z_ReadWait()
int from_len, packet_len, part, partof;
char *slash;
Code_t retval;
- static int filter_idx = -1;
register int i;
if (ZGetFD() < 0)
@@ -288,7 +278,7 @@ Code_t Z_ReadWait()
if (packet[i])
goto not_all_null;
#ifdef Z_DEBUG
- Z_debug ("got null packet from %s", inet_ntoa (from.sin_addr.s_addr));
+ Z_debug ("got null packet from %s", inet_ntoa (from.sin_addr));
#endif
return ZERR_NONE;
not_all_null:
@@ -613,7 +603,7 @@ Code_t Z_FormatHeader(notice, buffer, buffer_len, len, cert_routine)
char *buffer;
int buffer_len;
int *len;
- int (*cert_routine)();
+ Z_AuthProc cert_routine;
{
Code_t retval;
static char version[BUFSIZ]; /* default init should be all \0 */
@@ -661,7 +651,7 @@ Code_t Z_FormatAuthHeader(notice, buffer, buffer_len, len, cert_routine)
char *buffer;
int buffer_len;
int *len;
- int (*cert_routine)();
+ Z_AuthProc cert_routine;
{
if (!cert_routine) {
notice->z_auth = 0;
@@ -682,10 +672,6 @@ Code_t Z_FormatRawHeader(notice, buffer, buffer_len, len, cstart, cend)
int *len;
char **cstart, **cend;
{
- union {
- int i;
- ZChecksum_t sum;
- } temp;
char newrecip[BUFSIZ];
char *ptr, *end;
int i;
@@ -714,36 +700,29 @@ Code_t Z_FormatRawHeader(notice, buffer, buffer_len, len, cstart, cend)
(void) strcpy(ptr, notice->z_version);
ptr += strlen(ptr)+1;
- temp.i = htonl((u_long) (ZNUMFIELDS+notice->z_num_other_fields));
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)&temp.i,
- sizeof(temp.i)) == ZERR_FIELDLEN)
+ if (ZMakeAscii32(ptr, end-ptr, Z_NUMFIELDS + notice->z_num_other_fields)
+ == ZERR_FIELDLEN)
return (ZERR_HEADERLEN);
ptr += strlen(ptr)+1;
-
- temp.i = htonl((u_long) notice->z_kind);
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)&temp.i,
- sizeof(temp.i)) == ZERR_FIELDLEN)
+
+ if (ZMakeAscii32(ptr, end-ptr, notice->z_kind) == ZERR_FIELDLEN)
return (ZERR_HEADERLEN);
ptr += strlen(ptr)+1;
-
+
if (ZMakeAscii(ptr, end-ptr, (unsigned char *)&notice->z_uid,
sizeof(ZUnique_Id_t)) == ZERR_FIELDLEN)
return (ZERR_HEADERLEN);
ptr += strlen(ptr)+1;
-
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)&notice->z_port,
- sizeof(u_short)) == ZERR_FIELDLEN)
+
+ if (ZMakeAscii16(ptr, end-ptr, ntohs(notice->z_port)) == ZERR_FIELDLEN)
return (ZERR_HEADERLEN);
ptr += strlen(ptr)+1;
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)&notice->z_auth,
- sizeof(int)) == ZERR_FIELDLEN)
+ if (ZMakeAscii32(ptr, end-ptr, notice->z_auth) == ZERR_FIELDLEN)
return (ZERR_HEADERLEN);
ptr += strlen(ptr)+1;
- temp.i = htonl((u_long) notice->z_authent_len);
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)&temp.i,
- sizeof(temp.i)) == ZERR_FIELDLEN)
+ if (ZMakeAscii32(ptr, end-ptr, notice->z_authent_len) == ZERR_FIELDLEN)
return (ZERR_HEADERLEN);
ptr += strlen(ptr)+1;
@@ -762,8 +741,7 @@ Code_t Z_FormatRawHeader(notice, buffer, buffer_len, len, cstart, cend)
return (ZERR_HEADERLEN);
}
else {
- (void) sprintf(newrecip, "%s@%s", notice->z_recipient,
- __Zephyr_realm);
+ (void) sprintf(newrecip, "%s@%s", notice->z_recipient, __Zephyr_realm);
if (Z_AddField(&ptr, newrecip, end))
return (ZERR_HEADERLEN);
}
@@ -773,9 +751,7 @@ Code_t Z_FormatRawHeader(notice, buffer, buffer_len, len, cstart, cend)
/* copy back the end pointer location for crypto checksum */
if (cstart)
*cstart = ptr;
- temp.sum = htonl(notice->z_checksum);
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)&temp.sum,
- sizeof(temp.sum)) == ZERR_FIELDLEN)
+ if (ZMakeAscii32(ptr, end-ptr, notice->z_checksum) == ZERR_FIELDLEN)
return (ZERR_HEADERLEN);
ptr += strlen(ptr)+1;
if (cend)
@@ -793,19 +769,12 @@ Code_t Z_FormatRawHeader(notice, buffer, buffer_len, len, cstart, cend)
if (Z_AddField(&ptr, notice->z_other_fields[i], end))
return (ZERR_HEADERLEN);
-#ifdef notdef
- temp = htonl(notice->z_checksum);
- if (ZMakeAscii(ptr, end-ptr, (unsigned char *)&temp,
- sizeof(ZChecksum_t)) == ZERR_FIELDLEN)
- return (ZERR_HEADERLEN);
- ptr += strlen(ptr)+1;
-#endif
-
*len = ptr-buffer;
return (ZERR_NONE);
}
+static int
Z_AddField(ptr, field, end)
char **ptr, *field, *end;
{
@@ -904,8 +873,8 @@ void Z_RemQueue(qptr)
Code_t Z_SendFragmentedNotice(notice, len, cert_func, send_func)
ZNotice_t *notice;
int len;
- Code_t (*cert_func)();
- Code_t (*send_func)();
+ Z_AuthProc cert_func;
+ Z_SendProc send_func;
{
ZNotice_t partnotice;
ZPacket_t buffer;
@@ -970,56 +939,50 @@ int wait;
#ifdef Z_DEBUG
/* For debugging printing */
-Zconst char *Zconst ZNoticeKinds[] = { "UNSAFE", "UNACKED", "ACKED", "HMACK",
- "HMCTL", "SERVACK", "SERVNAK",
- "CLIENTACK", "STAT"};
+const char *const ZNoticeKinds[] = {
+ "UNSAFE", "UNACKED", "ACKED", "HMACK", "HMCTL", "SERVACK", "SERVNAK",
+ "CLIENTACK", "STAT"
+};
#endif
#ifdef Z_DEBUG
#undef Z_debug
-#ifdef Z_varargs
-void Z_debug (va_alist) va_dcl
+#ifdef HAVE_STDARG_H
+void Z_debug (const char *format, ...)
{
va_list pvar;
- char *format;
if (!__Z_debug_print)
return;
- va_start (pvar);
- format = va_arg (pvar, char *);
+ va_start (pvar, format);
(*__Z_debug_print) (format, pvar, __Z_debug_print_closure);
va_end (pvar);
}
#else /* stdarg */
-void Z_debug (const char *format, ...)
+void Z_debug (va_alist) va_dcl
{
va_list pvar;
+ char *format;
if (!__Z_debug_print)
return;
- va_start (pvar, format);
+ va_start (pvar);
+ format = va_arg (pvar, char *);
(*__Z_debug_print) (format, pvar, __Z_debug_print_closure);
va_end (pvar);
}
#endif
void Z_debug_stderr (format, args, closure)
-#ifdef __STDC__
- const
-#endif
- char *format;
+ const char *format;
va_list args;
-#ifdef __STDC__
void *closure;
-#else
- char *closure;
-#endif
{
-#ifndef NO_VPRINTF
- vfprintf (stderr, format, args);
+#ifdef HAVE_VPRINTF
+ vfprintf (stderr, format, args);
#else
- _doprnt (format, args, stderr);
+ _doprnt (format, args, stderr);
#endif
- putc ('\n', stderr);
+ putc ('\n', stderr);
}
#undef ZGetFD
@@ -1034,14 +997,13 @@ struct sockaddr_in ZGetDestAddr () { return __HM_addr; }
#undef ZGetRealm
Zconst char * ZGetRealm () { return __Zephyr_realm; }
-#ifdef __STDC__
-#define ARGS (void (*proc)(const char *,va_list,void *), void *arg)
-#else
-#define ARGS (proc, arg) void (*proc)(); char *arg;
-#endif
#undef ZSetDebug
-void ZSetDebug ARGS {
+void ZSetDebug(proc, arg)
+ void (*proc) __P((const char *, va_list, void *));
+ char *arg;
+{
__Z_debug_print = proc;
__Z_debug_print_closure = arg;
}
#endif /* Z_DEBUG */
+
diff --git a/lib/acl_files.c.old b/lib/acl_files.c.old
deleted file mode 100644
index c9c2f7a..0000000
--- a/lib/acl_files.c.old
+++ /dev/null
@@ -1,556 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains functions for maintaining Access Control Lists.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-/* Define this if you really want the ACL-writing code included. */
-/* #define WRITE_ACL */
-
-/*
- * Stolen from lib/acl_files.c because acl_load needs to be externally
- * declared and not statically declared.
- */
-
-#ifndef lint
-static char rcsid_acl_files_c[] = "$Id$";
-#endif
-
-/*** Routines for manipulating access control list files ***/
-
-#include <zephyr/zephyr.h>
-#include <strings.h>
-#include <sys/file.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <sys/param.h> /* for MAXHOSTNAMELEN */
-#include <errno.h>
-
-/* "aname.inst@realm" */
-#define MAX_PRINCIPAL_SIZE (ANAME_SZ + INST_SZ + REALM_SZ + 3)
-#define INST_SEP '.'
-#define REALM_SEP '@'
-
-#define LINESIZE 2048 /* Maximum line length in an acl file */
-
-#define NEW_FILE "%s.~NEWACL~" /* Format for name of altered acl file */
-#define WAIT_TIME 300 /* Maximum time allowed write acl file */
-
-#define CACHED_ACLS 64 /* How many acls to cache */
-#define ACL_LEN 256 /* Twice a reasonable acl length */
-
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#endif
-
-#define COR(a,b) ((a!=NULL)?(a):(b))
-
-/* Canonicalize a principal name */
-/* If instance is missing, it becomes "" */
-/* If realm is missing, it becomes the local realm */
-/* Canonicalized form is put in canon, which must be big enough to hold
- MAX_PRINCIPAL_SIZE characters */
-acl_canonicalize_principal(principal, canon)
- char *principal;
- char *canon;
-{
- char *dot, *atsign, *end;
- int len;
-
- dot = (char *)strchr(principal, INST_SEP);
- atsign = (char *)strchr(principal, REALM_SEP);
-
- /* Maybe we're done already */
- if(dot != NULL && atsign != NULL) {
- if(dot < atsign) {
- /* It's for real */
- /* Copy into canon */
- strncpy(canon, principal, MAX_PRINCIPAL_SIZE);
- canon[MAX_PRINCIPAL_SIZE-1] = '\0';
- return;
- } else {
- /* Nope, it's part of the realm */
- dot = NULL;
- }
- }
-
- /* No such luck */
- end = principal + strlen(principal);
-
- /* Get the principal name */
- len = MIN(ANAME_SZ, COR(dot, COR(atsign, end)) - principal);
- strncpy(canon, principal, len);
- canon += len;
-
- /* Add INST_SEP */
- *canon++ = INST_SEP;
-
- /* Get the instance, if it exists */
- if(dot != NULL) {
- ++dot;
- len = MIN(INST_SZ, COR(atsign, end) - dot);
- strncpy(canon, dot, len);
- canon += len;
- }
-
- /* Add REALM_SEP */
- *canon++ = REALM_SEP;
-
- /* Get the realm, if it exists */
- /* Otherwise, default to local realm */
- if(atsign != NULL) {
- ++atsign;
- len = MIN(REALM_SZ, end - atsign);
- strncpy(canon, atsign, len);
- canon += len;
- *canon++ = '\0';
- }
-#ifdef Z_HaveKerberos
- else if(krb_get_lrealm(canon, 1) != KSUCCESS) {
- strcpy(canon, KRB_REALM);
- }
-#endif
-}
-
-/* Get a lock to modify acl_file */
-/* Return new FILE pointer */
-/* or NULL if file cannot be modified */
-/* REQUIRES WRITE PERMISSION TO CONTAINING DIRECTORY */
-static FILE *acl_lock_file(acl_file)
- char *acl_file;
-{
- struct stat s;
- char new[LINESIZE];
- int nfd;
- FILE *nf;
- int mode;
-
- if(stat(acl_file, &s) < 0) return(NULL);
- mode = s.st_mode;
- sprintf(new, NEW_FILE, acl_file);
- for(;;) {
- /* Open the new file */
- if((nfd = open(new, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0) {
- if(errno == EEXIST) {
- /* Maybe somebody got here already, maybe it's just old */
- if(stat(new, &s) < 0) return(NULL);
- if(time(0) - s.st_ctime > WAIT_TIME) {
- /* File is stale, kill it */
- unlink(new);
- continue;
- } else {
- /* Wait and try again */
- sleep(1);
- continue;
- }
- } else {
- /* Some other error, we lose */
- return(NULL);
- }
- }
-
- /* If we got to here, the lock file is ours and ok */
- /* Reopen it under stdio */
- if((nf = fdopen(nfd, "w")) == NULL) {
- /* Oops, clean up */
- unlink(new);
- }
- return(nf);
- }
-}
-
-/* Commit changes to acl_file written onto FILE *f */
-/* Returns zero if successful */
-/* Returns > 0 if lock was broken */
-/* Returns < 0 if some other error occurs */
-/* Closes f */
-static int acl_commit(acl_file, f)
- char *acl_file;
- FILE *f;
-{
-#ifdef WRITE_ACL
- char new[LINESIZE];
- int ret;
- struct stat s;
-
- sprintf(new, NEW_FILE, acl_file);
- if(fflush(f) < 0
- || fstat(fileno(f), &s) < 0
- || s.st_nlink == 0) {
- acl_abort(acl_file, f);
- return(-1);
- }
-
- ret = rename(new, acl_file);
- fclose(f);
- return(ret);
-#else
- abort ();
-#endif
-}
-
-/* Abort changes to acl_file written onto FILE *f */
-/* Returns 0 if successful, < 0 otherwise */
-/* Closes f */
-static int acl_abort(acl_file, f)
- char *acl_file;
- FILE *f;
-{
-#ifdef WRITE_ACL
- char new[LINESIZE];
- int ret;
- struct stat s;
-
- /* make sure we aren't nuking someone else's file */
- if(fstat(fileno(f), &s) < 0
- || s.st_nlink == 0) {
- fclose(f);
- return(-1);
- } else {
- sprintf(new, NEW_FILE, acl_file);
- ret = unlink(new);
- fclose(f);
- return(ret);
- }
-#else
- abort ();
-#endif
-}
-
-/* Initialize an acl_file */
-/* Creates the file with permissions perm if it does not exist */
-/* Erases it if it does */
-/* Returns return value of acl_commit */
-int
-acl_initialize(acl_file, perm)
- char *acl_file;
- int perm;
-{
- FILE *new;
- int fd;
-
- /* Check if the file exists already */
- if((new = acl_lock_file(acl_file)) != NULL) {
- return(acl_commit(acl_file, new));
- } else {
- /* File must be readable and writable by owner */
- if((fd = open(acl_file, O_CREAT|O_EXCL, perm|0600)) < 0) {
- return(-1);
- } else {
- close(fd);
- return(0);
- }
- }
-}
-
-/* Eliminate all whitespace character in buf */
-/* Modifies its argument */
-static nuke_whitespace(buf)
- char *buf;
-{
- register char *pin, *pout;
-
- for(pin = pout = buf; *pin != '\0'; pin++)
- if(!isspace(*pin)) *pout++ = *pin;
- *pout = '\0'; /* Terminate the string */
-}
-
-/* Hash table stuff */
-
-struct hashtbl {
- int size; /* Max number of entries */
- int entries; /* Actual number of entries */
- char **tbl; /* Pointer to start of table */
-};
-
-/* Make an empty hash table of size s */
-static struct hashtbl *make_hash(size)
- int size;
-{
- struct hashtbl *h;
-
- if(size < 1) size = 1;
- h = (struct hashtbl *) malloc(sizeof(struct hashtbl));
- h->size = size;
- h->entries = 0;
- h->tbl = (char **) calloc(size, sizeof(char *));
- return(h);
-}
-
-/* Destroy a hash table */
-static void
-destroy_hash(h)
- struct hashtbl *h;
-{
- int i;
-
- for(i = 0; i < h->size; i++) {
- if(h->tbl[i] != NULL) free(h->tbl[i]);
- }
- free(h->tbl);
- free(h);
-}
-
-/* Compute hash value for a string */
-static unsigned int
-hashval(s)
- register char *s;
-{
- register unsigned hv;
-
- for(hv = 0; *s != '\0'; s++) {
- hv ^= ((hv << 3) ^ *s);
- }
- return(hv);
-}
-
-/* Add an element to a hash table */
-static add_hash(h, el)
- struct hashtbl *h;
- char *el;
-{
- unsigned hv;
- char *s;
- char **old;
- int i;
-
- /* Make space if it isn't there already */
- if(h->entries + 1 > (h->size >> 1)) {
- old = h->tbl;
- h->tbl = (char **) calloc(h->size << 1, sizeof(char *));
- for(i = 0; i < h->size; i++) {
- if(old[i] != NULL) {
- hv = hashval(old[i]) % (h->size << 1);
- while(h->tbl[hv] != NULL) hv = (hv+1) % (h->size << 1);
- h->tbl[hv] = old[i];
- }
- }
- h->size = h->size << 1;
- free(old);
- }
-
- hv = hashval(el) % h->size;
- while(h->tbl[hv] != NULL && strcmp(h->tbl[hv], el)) hv = (hv+1) % h->size;
- s = (char *) malloc(strlen(el)+1);
- strcpy(s, el);
- h->tbl[hv] = s;
- h->entries++;
-}
-
-/* Returns nonzero if el is in h */
-static int
-check_hash(h, el)
- struct hashtbl *h;
- char *el;
-{
- unsigned hv;
-
- for(hv = hashval(el) % h->size; h->tbl[hv]; hv = (hv + 1) % h->size) {
- if (!strcmp(h->tbl[hv], el)) {
- return 1;
- }
- }
- return 0;
-}
-
-struct acl {
- char filename[LINESIZE]; /* Name of acl file */
- struct hashtbl *acl; /* Acl entries */
-};
-
-static struct acl acl_cache[CACHED_ACLS];
-
-static int acl_cache_count = 0;
-static int acl_cache_next = 0;
-
-/* Returns < 0 if unsuccessful in loading acl */
-/* Returns index into acl_cache otherwise */
-/* Note that if acl is already loaded, this is just a lookup */
-int acl_load(name)
- char *name;
-{
- int i;
- FILE *f;
- char buf[MAX_PRINCIPAL_SIZE];
- char canon[MAX_PRINCIPAL_SIZE];
-
- /* See if it's there already */
- for(i = 0; i < acl_cache_count; i++) {
- if (!strcmp(acl_cache[i].filename, name))
- goto got_it;
- }
-
- /* It isn't, load it in */
- /* maybe there's still room */
- if(acl_cache_count < CACHED_ACLS) {
- i = acl_cache_count++;
- } else {
- /* No room, clean one out */
- i = acl_cache_next;
- acl_cache_next = (acl_cache_next + 1) % CACHED_ACLS;
- if(acl_cache[i].acl) {
- destroy_hash(acl_cache[i].acl);
- acl_cache[i].acl = (struct hashtbl *) 0;
- }
- }
-
- /* Set up the acl */
- strcpy(acl_cache[i].filename, name);
- /* Force reload */
- acl_cache[i].acl = (struct hashtbl *) 0;
-
-got_it:
- /*
- * See if we need to reload the ACL
- */
- if (acl_cache[i].acl == (struct hashtbl *) 0) {
- /* Gotta reload */
- if ((f = fopen(name, "r")) == NULL) {
- return -1;
- }
- if (acl_cache[i].acl) destroy_hash(acl_cache[i].acl);
- acl_cache[i].acl = make_hash(ACL_LEN);
- while(fgets(buf, sizeof(buf), f) != NULL) {
- nuke_whitespace(buf);
- acl_canonicalize_principal(buf, canon);
- add_hash(acl_cache[i].acl, canon);
- }
- fclose(f);
- }
- return(i);
-}
-
-/*
- * This destroys all cached ACL's so that new ones will be loaded in
- * the next time they are requested.
- */
-acl_cache_reset()
-{
- int i;
-
- /* See if it's there already */
- for(i = 0; i < acl_cache_count; i++)
- if (acl_cache[i].acl) {
- destroy_hash(acl_cache[i].acl);
- acl_cache[i].acl = (struct hashtbl *) 0;
- }
- acl_cache_count = 0;
- acl_cache_next = 0;
-}
-
-
-/* Returns nonzero if it can be determined that acl contains principal */
-/* Principal is not canonicalized, and no wildcarding is done */
-acl_exact_match(acl, principal)
- char *acl;
- char *principal;
-{
- int idx;
-
- return((idx = acl_load(acl)) >= 0
- && check_hash(acl_cache[idx].acl, principal));
-}
-
-/* Returns nonzero if it can be determined that acl contains principal */
-/* Recognizes wildcards in acl of the form
- name.*@realm, *.*@realm, and *.*@* */
-acl_check(acl, principal)
- char *acl;
- char *principal;
-{
- char buf[MAX_PRINCIPAL_SIZE];
- char canon[MAX_PRINCIPAL_SIZE];
- char *realm;
-
- acl_canonicalize_principal(principal, canon);
-
- /* Is it there? */
- if (acl_exact_match(acl, canon))
- return 1;
-
- /* Try the wildcards */
- realm = (char *)strchr(canon, REALM_SEP);
- *((char *)strchr(canon, INST_SEP)) = '\0'; /* Chuck the instance */
-
- sprintf(buf, "%s.*%s", canon, realm);
- if(acl_exact_match(acl, buf)) return 1;
-
- sprintf(buf, "*.*%s", realm);
- if(acl_exact_match(acl, buf) || acl_exact_match(acl, "*.*@*")) return(1);
-
- return(0);
-}
-
-/* Adds principal to acl */
-/* Wildcards are interpreted literally */
-acl_add(acl, principal)
- char *acl;
- char *principal;
-{
- int idx;
- int i;
- FILE *new;
- char canon[MAX_PRINCIPAL_SIZE];
-
- acl_canonicalize_principal(principal, canon);
-
- if((new = acl_lock_file(acl)) == NULL) return(-1);
- if((acl_exact_match(acl, canon))
- || (idx = acl_load(acl)) < 0) {
- acl_abort(acl, new);
- return(-1);
- }
- /* It isn't there yet, copy the file and put it in */
- for(i = 0; i < acl_cache[idx].acl->size; i++) {
- if(acl_cache[idx].acl->tbl[i] != NULL) {
- if(fputs(acl_cache[idx].acl->tbl[i], new) == 0
- || putc('\n', new) != '\n') {
- acl_abort(acl, new);
- return(-1);
- }
- }
- }
- fputs(canon, new);
- putc('\n', new);
- return(acl_commit(acl, new));
-}
-
-/* Removes principal from acl */
-/* Wildcards are interpreted literally */
-int
-acl_delete(acl, principal)
- char *acl;
- char *principal;
-{
- int idx;
- int i;
- FILE *new;
- char canon[MAX_PRINCIPAL_SIZE];
-
- acl_canonicalize_principal(principal, canon);
-
- if((new = acl_lock_file(acl)) == NULL) return(-1);
- if((!acl_exact_match(acl, canon))
- || (idx = acl_load(acl)) < 0) {
- acl_abort(acl, new);
- return(-1);
- }
- /* It isn't there yet, copy the file and put it in */
- for(i = 0; i < acl_cache[idx].acl->size; i++) {
- if(acl_cache[idx].acl->tbl[i] != NULL
- && strcmp(acl_cache[idx].acl->tbl[i], canon)) {
- fputs(acl_cache[idx].acl->tbl[i], new);
- putc('\n', new);
- }
- }
- return(acl_commit(acl, new));
-}
diff --git a/lib/decl b/lib/decl
deleted file mode 100755
index c5a410d..0000000
--- a/lib/decl
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/csh -f
-rm -f lib_headers
-foreach i (Z*.c)
- echo $i
- awk -f decl.awk $i >> lib_headers
- echo "" >> lib_headers
-end
diff --git a/lib/decl.awk b/lib/decl.awk
deleted file mode 100644
index 5040249..0000000
--- a/lib/decl.awk
+++ /dev/null
@@ -1,9 +0,0 @@
-BEGIN {
- foo = 0;
-}
-/Z.*\(/ { if (foo != 2) foo = 1; }
-/{/ { foo = 2; }
-{
- if (foo == 1)
- print;
-}
diff --git a/lib/inet_ntoa.c b/lib/inet_ntoa.c
deleted file mode 100644
index df91da9..0000000
--- a/lib/inet_ntoa.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains a version of the standard inet_ntoa function, for use
- * on a Sun 4 with gcc version 1.
- *
- * Created by: Ken Raeburn
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#ifndef lint
-static char rcsid_inet_ntoa_c[] = "$Zephyr$";
-#endif
-
-#if defined (sparc) && __GNUC__ == 1
-/* GCC version 1 passes structures incorrectly on the Sparc.
- This addition will cause things to work correctly if everything
- using inet_ntoa is compiled with gcc. If not, you lose anyways. */
-char *inet_ntoa (addr)
- struct in_addr addr;
-{
- static char buf[16];
- sprintf (buf, "%d.%d.%d.%d",
- addr.S_un.S_un_b.s_b1,
- addr.S_un.S_un_b.s_b2,
- addr.S_un.S_un_b.s_b3,
- addr.S_un.S_un_b.s_b4);
- return buf;
-}
-#endif
diff --git a/lib/krb_err.et b/lib/krb_err.et
deleted file mode 100644
index d03288a..0000000
--- a/lib/krb_err.et
+++ /dev/null
@@ -1,259 +0,0 @@
-# Copyright 1987,1988 Massachusetts Institute of Technology
-#
-# For copying and distribution information, see the file
-# "mit-copyright.h".
-#
-# $Source$
-# $Author$
-# $Header$
-#
- error_table krb
-
- ec KRBET_KSUCCESS,
- "Kerberos successful"
-
- ec KRBET_KDC_NAME_EXP,
- "Kerberos principal expired"
-
- ec KRBET_KDC_SERVICE_EXP,
- "Kerberos service expired"
-
- ec KRBET_KDC_AUTH_EXP,
- "Kerberos auth expired"
-
- ec KRBET_KDC_PKT_VER,
- "Incorrect kerberos master key version"
-
- ec KRBET_KDC_P_MKEY_VER,
- "Incorrect kerberos master key version"
-
- ec KRBET_KDC_S_MKEY_VER,
- "Incorrect kerberos master key version"
-
- ec KRBET_KDC_BYTE_ORDER,
- "Kerberos error: byte order unknown"
-
- ec KRBET_KDC_PR_UNKNOWN,
- "Kerberos principal unknown"
-
- ec KRBET_KDC_PR_N_UNIQUE,
- "Kerberos principal not unique"
-
- ec KRBET_KDC_NULL_KEY,
- "Kerberos principal has null key"
-
- ec KRBET_KRB_RES11,
- "Reserved 11"
-
- ec KRBET_KRB_RES12,
- "Reserved 12"
-
- ec KRBET_KRB_RES13,
- "Reserved 13"
-
- ec KRBET_KRB_RES14,
- "Reserved 14"
-
- ec KRBET_KRB_RES15,
- "Reserved 15"
-
- ec KRBET_KRB_RES16,
- "Reserved 16"
-
- ec KRBET_KRB_RES17,
- "Reserved 17"
-
- ec KRBET_KRB_RES18,
- "Reserved 18"
-
- ec KRBET_KRB_RES19,
- "Reserved 19"
-
- ec KRBET_KDC_GEN_ERR,
- "Generic error from Kerberos KDC"
-
- ec KRBET_GC_TKFIL,
- "Can't read Kerberos ticket file"
-
- ec KRBET_GC_NOTKT,
- "Can't find Kerberos ticket or TGT"
-
- ec KRBET_KRB_RES23,
- "Reserved 23"
-
- ec KRBET_KRB_RES24,
- "Reserved 24"
-
- ec KRBET_KRB_RES25,
- "Reserved 25"
-
- ec KRBET_MK_AP_TGTEXP,
- "Kerberos TGT Expired"
-
- ec KRBET_KRB_RES27,
- "Reserved 27"
-
- ec KRBET_KRB_RES28,
- "Reserved 28"
-
- ec KRBET_KRB_RES29,
- "Reserved 29"
-
- ec KRBET_KRB_RES30,
- "Reserved 30"
-
- ec KRBET_RD_AP_UNDEC,
- "Kerberos error: Can't decode authenticator"
-
- ec KRBET_RD_AP_EXP,
- "Kerberos ticket expired"
-
- ec KRBET_RD_AP_NYV,
- "Kerberos ticket not yet valid"
-
- ec KRBET_RD_AP_REPEAT,
- "Kerberos error: Repeated request"
-
- ec KRBET_RD_AP_NOT_US,
- "The kerberos ticket isn't for us"
-
- ec KRBET_RD_AP_INCON,
- "Kerberos request inconsistent"
-
- ec KRBET_RD_AP_TIME,
- "Kerberos error: delta_t too big"
-
- ec KRBET_RD_AP_BADD,
- "Kerberos error: incorrect net address"
-
- ec KRBET_RD_AP_VERSION,
- "Kerberos protocol version mismatch"
-
- ec KRBET_RD_AP_MSG_TYPE,
- "Kerberos error: invalid msg type"
-
- ec KRBET_RD_AP_MODIFIED,
- "Kerberos error: message stream modified"
-
- ec KRBET_RD_AP_ORDER,
- "Kerberos error: message out of order"
-
- ec KRBET_RD_AP_UNAUTHOR,
- "Kerberos error: unauthorized request"
-
- ec KRBET_KRB_RES44,
- "Reserved 44"
-
- ec KRBET_KRB_RES45,
- "Reserved 45"
-
- ec KRBET_KRB_RES46,
- "Reserved 46"
-
- ec KRBET_KRB_RES47,
- "Reserved 47"
-
- ec KRBET_KRB_RES48,
- "Reserved 48"
-
- ec KRBET_KRB_RES49,
- "Reserved 49"
-
- ec KRBET_KRB_RES50,
- "Reserved 50"
-
- ec KRBET_GT_PW_NULL,
- "Kerberos error: current PW is null"
-
- ec KRBET_GT_PW_BADPW,
- "Kerberos error: Incorrect current password"
-
- ec KRBET_GT_PW_PROT,
- "Kerberos protocol error"
-
- ec KRBET_GT_PW_KDCERR,
- "Error returned by Kerberos KDC"
-
- ec KRBET_GT_PW_NULLTKT,
- "Null Kerberos ticket returned by KDC"
-
- ec KRBET_SKDC_RETRY,
- "Kerberos error: Retry count exceeded"
-
- ec KRBET_SKDC_CANT,
- "Kerberos error: Can't send request"
-
- ec KRBET_KRB_RES58,
- "Reserved 58"
-
- ec KRBET_KRB_RES59,
- "Reserved 59"
-
- ec KRBET_KRB_RES60,
- "Reserved 60"
-
- ec KRBET_INTK_W_NOTALL,
- "Kerberos error: not all tickets returned"
-
- ec KRBET_INTK_BADPW,
- "Kerberos error: incorrect password"
-
- ec KRBET_INTK_PROT,
- "Kerberos error: Protocol Error"
-
- ec KRBET_KRB_RES64,
- "Reserved 64"
-
- ec KRBET_KRB_RES65,
- "Reserved 65"
-
- ec KRBET_KRB_RES66,
- "Reserved 66"
-
- ec KRBET_KRB_RES67,
- "Reserved 67"
-
- ec KRBET_KRB_RES68,
- "Reserved 68"
-
- ec KRBET_KRB_RES69,
- "Reserved 69"
-
- ec KRBET_INTK_ERR,
- "Other error"
-
- ec KRBET_AD_NOTGT,
- "Don't have Kerberos ticket-granting ticket"
-
- ec KRBET_KRB_RES72,
- "Reserved 72"
-
- ec KRBET_KRB_RES73,
- "Reserved 73"
-
- ec KRBET_KRB_RES74,
- "Reserved 74"
-
- ec KRBET_KRB_RES75,
- "Reserved 75"
-
- ec KRBET_NO_TKT_FIL,
- "No ticket file found"
-
- ec KRBET_TKT_FIL_ACC,
- "Couldn't access ticket file"
-
- ec KRBET_TKT_FIL_LCK,
- "Couldn't lock ticket file"
-
- ec KRBET_TKT_FIL_FMT,
- "Bad ticket file format"
-
- ec KRBET_TKT_FIL_INI,
- "tf_init not called first"
-
- ec KRBET_KNAME_FMT,
- "Bad Kerberos name format"
-
- end
-
diff --git a/lib/lib_headers b/lib/lib_headers
deleted file mode 100644
index 8edc1e7..0000000
--- a/lib/lib_headers
+++ /dev/null
@@ -1,197 +0,0 @@
-int ZCheckAuthentication(notice, from)
- ZNotice_t *notice;
- struct sockaddr_in *from;
-
-Code_t ZCheckIfNotice(notice, from, predicate, args)
- ZNotice_t *notice;
- struct sockaddr_in *from;
- int (*predicate)();
- char *args;
-
-Code_t ZClosePort()
-
-int ZCompareUID(uid1, uid2)
- ZUnique_Id_t *uid1, *uid2;
-
-int ZCompareUIDPred(notice, uid)
- ZNotice_t *notice;
- ZUnique_Id_t *uid;
-
-Code_t ZFlushLocations()
-
-Code_t ZFlushSubscriptions()
-
-Code_t ZFormatAuthenticNotice(notice, buffer, buffer_len, len, session)
- ZNotice_t *notice;
- char *buffer;
- int buffer_len;
- int *len;
- C_Block session;
-
-Code_t ZFormatNotice(notice, buffer, ret_len, cert_routine)
- ZNotice_t *notice;
- char **buffer;
- int *ret_len;
- int (*cert_routine)();
-
-Code_t ZFormatNoticeList(notice, list, nitems, buffer, ret_len,
- cert_routine)
- ZNotice_t *notice;
- char *list[];
- int nitems;
- char **buffer;
- int *ret_len;
- int (*cert_routine)();
-
-Code_t ZFormatRawNotice(notice, buffer, ret_len)
- ZNotice_t *notice;
- char **buffer;
- int *ret_len;
-
-Code_t ZFormatRawNoticeList(notice, list, nitems, buffer, ret_len)
- ZNotice_t *notice;
- char *list[];
- int nitems;
- char **buffer;
- int *ret_len;
-
-Code_t ZFormatSmallRawNotice(notice, buffer, ret_len)
- ZNotice_t *notice;
- ZPacket_t buffer;
- int *ret_len;
-
-Code_t ZFormatSmallRawNoticeList(notice, list, nitems, buffer, ret_len)
- ZNotice_t *notice;
- char *list[];
- int nitems;
- ZPacket_t buffer;
- int *ret_len;
-
-Code_t ZFreeNotice(notice)
- ZNotice_t *notice;
-
-Code_t ZGetLocations(location, numlocs)
- ZLocations_t *location;
- int *numlocs;
-
-char *ZGetSender()
-
-Code_t ZGetSubscriptions(subscription, numsubs)
- ZSubscription_t *subscription;
- int *numsubs;
-
-short ZGetWGPort()
-
-Code_t ZIfNotice(notice, from, predicate, args)
- ZNotice_t *notice;
- struct sockaddr_in *from;
- int (*predicate)();
- char *args;
-
-Code_t ZInitialize()
-
-Code_t ZLocateUser(user, nlocs)
- char *user;
- int *nlocs;
-
-Code_t ZSetLocation(exposure)
- char *exposure;
-
-Code_t ZMakeAscii(ptr, len, field, num)
- char *ptr;
- int len;
- unsigned char *field;
- int num;
-
-Code_t ZMakeAuthentication(notice, buffer, buffer_len, len)
- ZNotice_t *notice;
- char *buffer;
- int buffer_len;
- int *len;
-
-Code_t ZOpenPort(port)
- u_short *port;
-
-Code_t ZParseNotice(buffer, len, notice)
- char *buffer;
- int len;
- ZNotice_t *notice;
-
-Code_t ZPeekIfNotice(notice, from, predicate, args)
- ZNotice_t *notice;
- struct sockaddr_in *from;
- int (*predicate)();
- char *args;
-
-Code_t ZPeekNotice(notice, from)
- ZNotice_t *notice;
- struct sockaddr_in *from;
-
-Code_t ZPeekPacket(buffer, ret_len, from)
- char **buffer;
- int *ret_len;
- struct sockaddr_in *from;
-
-int ZPending()
-
-int ZReadAscii(ptr, len, field, num)
- char *ptr;
- int len;
- unsigned char *field;
- int num;
-
-Code_t ZReceiveNotice(notice, from)
- ZNotice_t *notice;
- struct sockaddr_in *from;
-
-Code_t ZReceivePacket(buffer, ret_len, from)
- ZPacket_t buffer;
- int *ret_len;
- struct sockaddr_in *from;
-
-Code_t ZRetrieveSubscriptions(port,nsubs)
- u_short port;
- int *nsubs;
-
-Code_t ZSendList(notice, list, nitems, cert_routine)
- ZNotice_t *notice;
- char *list[];
- int nitems;
- int (*cert_routine)();
-
-Code_t ZSendNotice(notice, cert_routine)
- ZNotice_t *notice;
- int (*cert_routine)();
-
-Code_t ZSendPacket(packet, len, waitforack)
- char *packet;
- int len;
- int waitforack;
-
-Code_t ZSendRawList(notice, list, nitems)
- ZNotice_t *notice;
- char *list[];
- int nitems;
-
-Code_t ZSendRawNotice(notice)
- ZNotice_t *notice;
-
-Code_t ZSetDestAddr(addr)
- struct sockaddr_in *addr;
-
-Code_t ZSetFD(fd)
- int fd;
-
-Code_t ZSetServerState(state)
- int state;
-
-Code_t ZSubscribeTo(sublist, nitems, port)
- ZSubscription_t *sublist;
- int nitems;
- u_short port;
-
-char *ZGetVariable(var)
- char *var;
-
-Code_t Z_GetMyAddr()
-
diff --git a/lib/mit-copyright.h b/lib/mit-copyright.h
new file mode 100644
index 0000000..73059b3
--- /dev/null
+++ b/lib/mit-copyright.h
@@ -0,0 +1,24 @@
+/*
+
+Copyright 1987,1988 by the Massachusetts Institute of Technology
+
+All rights reserved.
+
+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 the Massachusetts
+Institute of Technology (M.I.T.) not be used in advertising or publicity
+pertaining to distribution of the software without specific, written
+prior permission.
+
+M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+*/
diff --git a/lib/strcasecmp.c b/lib/strcasecmp.c
deleted file mode 100644
index 7cefd1c..0000000
--- a/lib/strcasecmp.c
+++ /dev/null
@@ -1,95 +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 this notice is preserved and that due credit is given
- * to the University of California at Berkeley. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific written prior permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87";
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef lint
-#include <sys/types.h>
-#endif
-
-#ifndef __STDC__
-#define const
-#endif
-
-#ifndef lint
-static const char rcsid_strcasecmp_c[] =
- "$Zephyr$";
-#endif
-
-/*
- * 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 const u_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',
-};
-
-strcasecmp(s1, s2)
- const char *s1, *s2;
-{
- register u_char const *cm = charmap,
- *us1 = (u_char const *)s1,
- *us2 = (u_char const *)s2;
-
- while (cm[*us1] == cm[*us2++])
- if (*us1++ == '\0')
- return(0);
- return(cm[*us1] - cm[*--us2]);
-}
-
-strncasecmp(s1, s2, n)
- const char *s1, *s2;
- register int n;
-{
- register u_char const *cm = charmap,
- *us1 = (u_char const *)s1,
- *us2 = (u_char const *)s2;
-
- while (--n >= 0 && cm[*us1] == cm[*us2++])
- if (*us1++ == '\0')
- return(0);
- return(n < 0 ? 0 : cm[*us1] - cm[*--us2]);
-}
diff --git a/libdes/ChangeLog b/libdes/ChangeLog
deleted file mode 100644
index ea3a9c0..0000000
--- a/libdes/ChangeLog
+++ /dev/null
@@ -1,68 +0,0 @@
-Tue Nov 8 12:12:32 1988 William Sommerfeld (wesommer at binkley)
-
- * (util) Remove \ before { and } characters (causes RT
- compiler warning)
-
- * (read_password) Print a newline after saying "try again".
-
- * (read_password) Merge in changes by Jim Bloom to do a clearerr
- after a read fails, and protect against an RTM attack by
- changing gets to fgets.
-
-Fri Sep 16 16:26:55 1988 Bill Sommerfeld (wesommer at ra)
-
- * (read_password) fix dependancies for BSDUNIX.
-
-Mon Sep 12 14:55:23 1988 Bill Sommerfeld (wesommer at ra)
-
- * (*) debug->des_debug
-
- * (*) debug_print() -> des_debug_print()
-
- * (Makefile) add dbg_prt.o to list of files included in build.
-
- * (des.c) remove debug_print; it's in dbg_prt.c
-
- * (des_internal.h) contains definitions of AUTH_DES_ITER,
- s-box structures, which aren't part of the encryption interface.
-
- * (*) #include "conf.h" -> #include "des_internal.h"
-
- * (*) C_Block -> des_cblock
-
- * (*) Key_schedule -> des_key_schedule
-
- * (noop.c) remove #includes for unused include files.
-
- * (des.c, random_key.c, string_to_key.c) add #include of "des_conf.h"
-
-Fri Sep 9 15:46:13 1988 Bill Sommerfeld (wesommer at ra)
-
- * (*) string_to_key() -> des_string_to_key()
-
- * (*) read_pw_string() -> des_read_pw_string()
-
- * (*) random_key() -> des_random_key()
-
- * (*) pcbc_encrypt() -> des_pcbc_encrypt()
-
- * (*) key_sched() -> des_key_sched()
-
- * (*) cbc_encrypt() -> des_cbc_encrypt()
-
- * (*) cbc_cksum() -> des_cbc_cksum()
-
- * (quad_cksum.c) make {four,two}_bytes_vax_to_nets be static to
- avoid namespace pollution.
-
- * (*.c) Rename C_Block_print() to des_cblock_print().
-
- * (make_key_perm.c) Make "key_perm" be static to avoid namespace
- pollution.
-
- * (quad_cksum.c) Make "short_conv" and "long_conv" local
- variables, to avoid namespace pollution.
-
-
-
-
diff --git a/libdes/Imakefile b/libdes/Imakefile
deleted file mode 100644
index 2822baf..0000000
--- a/libdes/Imakefile
+++ /dev/null
@@ -1,139 +0,0 @@
-# $Id$
-#
-# Copyright 1987, 1993 by the Massachusetts Institute of Technology.
-#
-# For copying and distribution information,
-# please see the file <mit-copyright.h>.
-#
-# Imakefile for DES library
-#
-
-all:: $(BINC)/des.h
-
-$(BINC)/des.h: des.h
- $(RM) $@; $(CP) des.h $@
-
-#ifdef MIT_DES
-OTHEROBJS= cbc_encrypt.o cksum.o pcbc_encrypt.o make_key_sched.o des.o \
- key_parity.o
-#else
-OTHEROBJS= f_cbc.o f_cksum.o f_pcbc.o f_sched.o f_ecb.o f_parity.o f_tables.o
-#endif
-DESOBJS= $(OTHEROBJS) key_sched.o debug_decl.o \
- quad_cksum.o random_key.o read_password.o \
- string_to_key.o weak_key.o new_rnd_key.o util.o $(OLDOBJS)
-
-#ifdef ATHENA_RULES
-
-build_library(des,$(DESOBJS))
-
-build_program(enc,enc.o libdes.a,,)
-build_program(destest,destest.o libdes.a,,)
-build_program(verify,verify.o libdes.a,,)
-
-#ifdef MIT_DES
-build_program(make_key_perm,make_key_perm.o misc.o,,)
-build_program(make_odd,make_odd.o misc.o,,)
-build_program(make_p_table,make_p_table.o misc.o,,)
-build_program(make_s_table,make_s_table.o misc.o,,)
-build_program(make_p,make_p.o misc.o,,)
-build_program(make_fp,make_fp.o misc.o,,)
-build_program(make_ip,make_ip.o misc.o,,)
-
-key_perm.h: make_key_perm
- ./make_key_perm key_perm.h
-odd.h: make_odd
- ./make_odd odd.h
-p_table.h: make_p_table
- ./make_p_table p_table.h
-s_table.h: make_s_table
- ./make_s_table s_table.h
-p.c: make_p
- ./make_p p.c
-fp.c: make_fp
- ./make_fp fp.c
-ip.c: make_ip
- ./make_ip ip.c
-
-clean::
- $(RM) ip.c fp.c p.c s_table.h p_table.h odd.h key_perm.h
-
-key_parity.o: odd.h
-key_sched.o: key_perm.h
-des.o: s_table.h p_table.h ip.c fp.c p.c
-misc.o: des_internal.h
-
-make_s_table:: tables.h des_internal.h
-make_p_table:: tables.h des_internal.h
-make_key_perm:: des_internal.h
-make_s:: s_table.h des_internal.h
-#endif
-
-#else /* ATHENA_RULES */
-
-#ifdef OLD_COMPAT
-OLDSRCS= desglue.c
-OLDOBJS= desglue.o
-#else
-OLDSRCS=
-OLDOBJS=
-#endif
-DESSRCS= key_sched.c des.c cbc_encrypt.c pcbc_encrypt.c debug_decl.c \
- cksum.c quad_cksum.c random_key.c read_password.c \
- string_to_key.c weak_key.c key_parity.c new_rnd_key.c util.c $(OLDSRCS)
-
-SRCS= des_internal.h make_key_perm.c make_ip.c make_fp.c make_e.c make_p.c make_s.c \
- make_s_table.c make_p_table.c make_odd.c misc.c \
- key_test.c testit.c verify.c epc_encrypt.c \
- cbc_noop.c enc.c ${DESSRCS}
-
-SRCDIR=$(SRCTOP)/lib/des
-CODE=$(SRCS) Imakefile tables.h des.vaxasm
-
-library_obj_rule()
-
-install_library_target(des,$(DESOBJS),$(DESSRCS),)
-
-library_ro_object(dbg_prt)
-
-/* add other assembler versions here, if you come up with them. */
-#ifdef VAXASM
-library_asm_object(des.o,des.vaxasm)
-#else
-library_ro_object(des)
-library_ro_object(key_sched)
-#endif
-/*
- * misc.o is used by all of the header generators.
- */
-
-host_simple_object(misc.o,misc.c)
-/*
- * Generate include files for use by key_sched & friends.
- */
-
-generate_depend(key_perm.h,make_key_perm,misc.o)
-generate_depend(odd.h,make_odd,misc.o)
-generate_depend(p_table.h,make_p_table,misc.o)
-generate_depend(s_table.h,make_s_table,misc.o)
-generate_depend(p.c,make_p,misc.o)
-generate_depend(fp.c,make_fp,misc.o)
-generate_depend(ip.c,make_ip,misc.o)
-
-misc.o: des_internal.h
-make_s_table: tables.h des_internal.h
-make_p_table: tables.h des_internal.h
-make_key_perm: des_internal.h
-make_s: s_table.h des_internal.h
-
-
-/*
- * verify that the library correctly implements the DES standard.
- * Run this after any change to the source.
- */
-
-test(verify,libdes.a,)
-test(key_test,libdes.a,)
-test(testit,libdes.a,)
-
-#endif /* ATHENA_RULES */
diff --git a/libdes/Makefile b/libdes/Makefile
deleted file mode 100644
index 3e12ea0..0000000
--- a/libdes/Makefile
+++ /dev/null
@@ -1,227 +0,0 @@
-# Makefile generated by imake - do not edit!
-# $XConsortium: imake.c,v 1.86 93/10/11 12:12:36 rws Exp $
-
-all::
-
-SHELL=/bin/sh
-MAKESHELL=/bin/sh
-
-TOP = ../.
-CWD = ./libdes
-CONFIGSRC = /mit/opssrc/zephyr.sunos/production/config
-DESTDIR=
-
-IRULESRC = $(CONFIGSRC)
-
-PTOP = $(TOP)/.
-
-IMAKE= imake
-IFLAGS= -I$(IRULESRC) $(IFLAGS_SH) $(OTHER_IFLAGS) -DTOPDIR=/mit/opssrc/zephyr.sunos/production
-XIFLAGS= -I$(ATHXLIBDIR)/X11/config -DUseInstalled
-
-ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- $(IRULESRC)/site.def Imakefile $(PRULEDEP)
-MKDIRHIER= sh $(IRULESRC)/mkdirhier.sh
-
-ATHVERS = $(IRULESRC)/update.conf
-
-ATHBASEDIR=/usr/athena
-
-ATHLIBDIR=$(ATHBASEDIR)/lib
-ATHBINDIR=$(ATHBASEDIR)/bin
-ATHINCDIR=$(ATHBASEDIR)/include
-ATHETCDIR=$(ATHBASEDIR)/etc
-ATHCONFDIR=/etc/athena
-ATHMANDIR=$(ATHBASEDIR)/man
-ATHRBINDIR=/bin/athena
-ATHRETCDIR=/etc/athena
-
-ATHNEWDIR=$(ATHBINDIR)
-
-ATHXAPPDIR=/usr/athena/lib/X11/app-defaults
-ATHXBITDIR=/usr/athena/lib/X11/bitmaps
-ATHXINCDIR=/usr/athena/include
-ATHXLIBDIR=/usr/athena/lib
-
-AFSDIR=/mit/afsuser/@sys
-
-LINTCFLAG=-o
-LINTFLAGS=-DPOSIX $(DEFINES) -I/usr/athena/include
-
-INSTALL=install -c
-RANLIB=ranlib
-CC=cc
-LD=cc
-AS=as
-RM=rm -f
-CP=cp -p
-
-ETCMD=compile_et
-SSCMD=mk_cmds
-
-LIB_ET = -lcom_err
-LIB_SS = -lss
-LIB_HES = -lhesiod
-LIB_KRB = -lkrb -ldes
-LIB_ZEPHYR = -lzephyr -lkrb -ldes -lcom_err
-LIB_X = -lX11 -lXext
-LIB_XT = -lXt -lX11 -lXext
-LIB_XAW = -lXaw -lXmu -lXt -lX11 -lXext
-
-CDEBUG=-O2
-
-CFLAGS=$(CDEBUG) -DPOSIX $(DEFINES) -I/usr/athena/include
-LDFLAGS= $(LDDEFS)
-LDPATH=-L$(ATHLIBDIR)
-LDLIBS=
-
-install:: install_dirs
-install_dirs::
-install::
-install.man::
-
-clean::
-depend::
-
-FRC::
-
-###########################################################################
-# start of Imakefile
-###########################################################################
-
-# Copyright 1993 Massachusetts Institute of Technology
-# For copying and distribution information, see the file
-# "mit-copyright.h"
-#
-# $Id$
-
-CDEFS_KRB = -DKERBEROS
-ZLIB_KRB = $(LIB_KRB)
-
-CDEFS_HES = -DHESIOD
-ZLIB_HES = $(LIB_HES)
-
-ZPIDDIR = /etc/athena
-ZETCDIR = $(ATHCONFDIR)/zephyr
-ZLIBDIR = $(ATHLIBDIR)/zephyr
-ZINCDIR = $(ATHINCDIR)/zephyr
-ZACLDIR = $(ZETCDIR)/acl
-
-BINC = $(PTOP)/h
-
-ZLIB = $(PTOP)/lib/libzephyr.a
-ZLIBDES = $(PTOP)/libdes/libdes.a
-ZLIBS = $(ZLIB_KRB) $(LIB_ET) $(ZLIB_HES)
-DYN_LIB = $(PTOP)/libdyn/libdyn.a
-
-DEFINES = $(XDEFS) -I$(BINC) \
- $(CDEFS_KRB) $(CDEFS_HES) $(CDEFS_ET) $(CDEFS_SS) \
- $(MACHDEFS)
-
-CC=cc
-LD=cc
-
-ATHBINDIR = /mit/zephyr/@sys/bin
-ATHLIBDIR = /mit/zephyr/@sys/lib
-ATHINCDIR = /mit/zephyr/include
-ATHMANDIR = /mit/zephyr/man
-
-ZLIBDIR = /mit/zephyr/configs
-ATHCONFDIR = $(ZLIBDIR)
-ATHETCDIR = $(ATHBINDIR)
-ATHRETCDIR = $(ATHBINDIR)
-
-LDPATH = -L/usr/athena/lib/shared -L/usr/athena/lib
-
-# $Id$
-#
-# Copyright 1987, 1993 by the Massachusetts Institute of Technology.
-#
-# For copying and distribution information,
-# please see the file <mit-copyright.h>.
-#
-# Imakefile for DES library
-#
-
-all:: $(BINC)/des.h
-
-$(BINC)/des.h: des.h
- $(RM) $@; $(CP) des.h $@
-
-OTHEROBJS= f_cbc.o f_cksum.o f_pcbc.o f_sched.o f_ecb.o f_parity.o f_tables.o
-
-DESOBJS= $(OTHEROBJS) key_sched.o debug_decl.o \
- quad_cksum.o random_key.o read_password.o \
- string_to_key.o weak_key.o new_rnd_key.o util.o $(OLDOBJS)
-
-all:: libdes.a
- libdes.a:: $(DESOBJS)
- ar cru libdes.a $(DESOBJS)
- $(RANLIB) libdes.a
-all-prof:: libdes_p.a
- libdes_p.a: $(DESOBJS)
- cd profiled; ar cru ../libdes_p.a $(DESOBJS)
- $(RANLIB) libdes_p.a
-
-install::
- $(RM) $(DESTDIR)$(ATHLIBDIR)/libdes.a
- $(INSTALL) -m 0644 libdes.a $(DESTDIR)$(ATHLIBDIR)
- $(RANLIB) $(DESTDIR)$(ATHLIBDIR)/libdes.a
-inst-prof::
- $(RM) $(DESTDIR)$(ATHLIBDIR)/libdes_p.a
- $(INSTALL) -m 0644 libdes_p.a $(DESTDIR)$(ATHLIBDIR)
- $(RANLIB) $(DESTDIR)$(ATHLIBDIR)/libdes_p.a
-
-all:: enc
-enc:: enc.o libdes.a
- $(LD) $(LDFLAGS) -o enc enc.o libdes.a $(LDPATH) $(LDLIBS)
-clean::
- $(RM) enc
-
-all:: destest
-destest:: destest.o libdes.a
- $(LD) $(LDFLAGS) -o destest destest.o libdes.a $(LDPATH) $(LDLIBS)
-clean::
- $(RM) destest
-
-all:: verify
-verify:: verify.o libdes.a
- $(LD) $(LDFLAGS) -o verify verify.o libdes.a $(LDPATH) $(LDLIBS)
-clean::
- $(RM) verify
-
-PRULES = "config/zephyr.rules"
-PINC = -DProjectRules=\"$(PRULES)\" -DProjectRuleDep=$(PRULES)
-
-PRULEDEP = $(PTOP)/config/zephyr.rules
-
-PTOP = $(TOP)/.
-IPROJ = -DProject -DProjectTop=. -I$(PTOP) $(PINC)
-
-IFLAGS_SH = -DUseSharedLibs
-
-Makefile:: $(ICONFIGFILES)
- -@if [ -f Makefile ]; then \
- echo " $(RM) Makefile.bak; mv Makefile Makefile.bak"; \
- $(RM) Makefile.bak; mv Makefile Makefile.bak; \
- else exit 0; fi
- $(IMAKE) $(IPROJ) $(IFLAGS) -DNEWTOP=$(TOP) -DNEWCWD=$(CWD)
-
-XMakefile::
- -@if [ -f Makefile ]; then \
- echo " $(RM) Makefile.bak; mv Makefile Makefile.bak"; \
- $(RM) Makefile.bak; mv Makefile Makefile.bak; \
- else exit 0; fi
- $(IMAKE) $(XIFLAGS)
-
-clean::
- $(RM) *~ *.o *.a core a.out Makefile.bak
- $(RM) -r profiled
-
-all-prof inst-prof::
-
-Makefiles::
-
-###########################################################################
-# dependencies generated by makedepend
-
diff --git a/libdes/debug_decl.c b/libdes/debug_decl.c
deleted file mode 100644
index 30401dc..0000000
--- a/libdes/debug_decl.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Declaration of debugging flag.
- */
-
-#ifndef lint
-static char rcsid_debug_decl_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-int des_debug = 0;
diff --git a/libdes/des.h b/libdes/des.h
deleted file mode 100644
index d69f33f..0000000
--- a/libdes/des.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * $Source$
- * $Author$
- * $Header$
- *
- * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Include file for the Data Encryption Standard library.
- */
-
-/* only do the whole thing once */
-#ifndef DES_DEFS
-#define DES_DEFS
-
-#include <mit-copyright.h>
-
-#ifndef KRB_INT32
-#define KRB_INT32 long
-#endif
-#ifndef KRB_UINT32
-#define KRB_UINT32 unsigned KRB_INT32
-#endif
-
-typedef unsigned char des_cblock[8]; /* crypto-block size */
-/* Key schedule */
-typedef struct des_ks_struct { union { long pad; 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)
-
-#if defined(__alpha) || defined(cray)
-typedef int int32;
-typedef unsigned int u_int32;
-#else
-typedef long int32;
-typedef unsigned long u_int32;
-#endif
-
-#endif /* DES_DEFS */
diff --git a/libdes/desglue.c b/libdes/desglue.c
deleted file mode 100644
index 4238b65..0000000
--- a/libdes/desglue.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * $Source$
- * $Author$
- * $Header$
- *
- * Copyright (C) 1988 by the Massachusetts Institute of Technology
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Backwards compatibility module.
- */
-
-#ifndef lint
-static char *rcsid_desglue_c = "$Header$";
-#endif /* lint */
-
-#ifndef NCOMPAT
-#include <des.h>
-
-#undef string_to_key
-#undef read_pw_string
-#undef random_key
-#undef pcbc_encrypt
-#undef key_sched
-#undef cbc_encrypt
-#undef cbc_cksum
-#undef C_Block_print
-#undef quad_cksum
-
-int
-string_to_key(str, key)
- char *str;
- register des_cblock *key;
-{
- return des_string_to_key(str, key);
-}
-
-
-int
-read_pw_string(s, max, prompt, verify)
- char *s;
- int max;
- char *prompt;
- int verify;
-{
- return des_read_pw_string (s, max, prompt, verify);
-}
-
-random_key(key)
- des_cblock *key;
-{
- return des_random_key(key);
-}
-
-pcbc_encrypt(in, out, length, key, iv, encrypt)
- des_cblock *in, *out;
- register long length;
- des_key_schedule key;
- des_cblock *iv;
- int encrypt;
-{
- return des_pcbc_encrypt (in, out, length, key, iv, encrypt);
-}
-
-key_sched(k, s)
- unsigned char *k;
- des_key_schedule s;
-{
- return des_key_sched (k, s);
-}
-
-cbc_encrypt(in, out, length, key, iv, encrypt)
- des_cblock *in, *out;
- register long length;
- des_key_schedule key;
- des_cblock *iv;
- int encrypt;
-{
- return des_cbc_encrypt (in, out, length, key, iv, encrypt);
-}
-
-cbc_cksum(in, out, length, key, iv)
- des_cblock *in; /* >= length bytes of inputtext */
- des_cblock *out; /* >= length bytes of outputtext */
- register long length; /* in bytes */
- des_key_schedule key; /* precomputed key schedule */
- des_cblock *iv; /* 8 bytes of ivec */
-{
- return des_cbc_cksum(in, out, length, key, iv);
-}
-
-C_Block_print(x)
- des_cblock *x;
-{
- return des_cblock_print (x);
-}
-
-unsigned long
-quad_cksum(in,out,length,out_count,c_seed)
- des_cblock *c_seed; /* secret seed, 8 bytes */
- unsigned char *in; /* input block */
- unsigned long *out; /* optional longer output */
- int out_count; /* number of iterations */
- long length; /* original length in bytes */
-{
- return des_quad_cksum(in,out,length,out_count,c_seed);
-}
-#endif
diff --git a/libdes/destest.c b/libdes/destest.c
deleted file mode 100644
index ad6333f..0000000
--- a/libdes/destest.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- */
-
-#ifndef lint
-static char rcsid_destest_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-#include <stdio.h>
-#include <des.h>
-
-char clear[] = "eight bytes";
-char cipher[8];
-char key[8];
-Key_schedule schedule;
-
-main()
-{
- int i;
- string_to_key("good morning!", key);
- i = key_sched(key, schedule);
- if (i) {
- printf("bad schedule (%d)\n", i);
- exit(1);
- }
- for (i = 1; i <= 10000; i++)
- des_ecb_encrypt(clear, cipher, schedule, i&1);
- return 0;
-}
diff --git a/libdes/doc/libdes.doc b/libdes/doc/libdes.doc
deleted file mode 100644
index 70f9f33..0000000
--- a/libdes/doc/libdes.doc
+++ /dev/null
@@ -1,208 +0,0 @@
-
- How to use the Kerberos encryption library.
-
- Revised 10/15/85 spm
-
-1) The following include file is needed:
-
- /projects/auth/include/des.h (VAX)
- --------------- (PC8086)
-
-2) The encryption library that should be linked to is:
-
- /projects/auth/lib/libdes.a (VAX)
-| /projects/auth/ibm/lib/libdes.a (PC8086 cross-compilation environment)
-
-3) For each key that may be simultaneously active,
- allocate (either compile or malloc) a "Key_schedule" struct,
- defined in "des.h"
-
-4) Create key schedules, as needed, prior to using the encryption
- routines, via "des_set_key()".
-
-5) Setup the input and output areas. Make sure to note the restrictions
- on lengths being multiples of eight bytes.
-
-6) Invoke the encryption/decryption routines, "ecb_encrypt()"
- or "cbc_encrypt()"
-
-7) To generate a cryptographic checksum, use "cbc_cksum()"
-/* ---------------------------------------------------------------- */
-
- Routine Interfaces--
-
-/* ----------------------------------------------------------------- */
-
-int
- des_set_key(k,schedule)
- C_Block *k;
- Key_schedule schedule;
-
- Calculates a key schedule from (all) eight bytes of the input key, and
- puts it into the indicated "Key_schedule" struct;
-
- Make sure to pass valid eight bytes, no padding or other processing
- it done.
-
- The key schedule is then used in subsequent encryption/decryption
- operations. Many key schedules may be created and cached for later
- use.
-
- The user is responsible to clear keys and schedules no longer needed
- to prevent their disclosure.
-
-| Checks the parity of the key provided, to make sure it is odd per
-| FIPS spec. Returns 0 value for key ok, 1 for key_parity error.
-
-/* ---------------------------------------------------------------- */
-
-int
- ecb_encrypt(input,output,schedule,encrypt)
- C_Block *input; /* ptr to eight byte input value */
- C_Block *output; /* ptr to eight byte output value */
- int encrypt; /* 0 ==> decrypt, else encrypt */
- Key_schedule schedule; /* addr of key schedule */
-
-This is the low level routine that encrypts or decrypts a single 8-byte
-block in electronic code book mode. Always transforms the input
-data into the output data.
-
-If encrypt is non-zero, the input (cleartext) is encrypted into the
-output (ciphertext) using the specified key_schedule, pre-set via "des_set_key".
-
-If encrypt is zero, the input (now ciphertext) is decrypted into
-the output (now cleartext).
-
-Input and output may be the same space.
-
-Does not return any meaningful value. Void is not used for compatibility
-with other compilers.
-
-/* -------------------------------------------------------------- */
-
-int
- cbc_encrypt(input,output,length,schedule,ivec,encrypt)
-
- C_Block *input; /* ptr to input data */
- C_Block *output; /* ptr to output data */
- int length; /* desired length, in bytes */
- Key_schedule schedule; /* addr of precomputed schedule */
- C_Block *ivec; /* pointer to 8 byte initialization
- * vector
- */
- int encrypt /* 0 ==> decrypt; else encrypt*/
-
-
- If encrypt is non-zero, the routine cipher-block-chain encrypts
- the INPUT (cleartext) into the OUTPUT (ciphertext) using the provided
- key schedule and initialization vector. If the length is not an integral
- multiple of eight bytes, the last block is copied to a temp and zero
- filled (highest addresses). The output is ALWAYS an integral multiple
- of eight bytes.
-
- If encrypt is zero, the routine cipher-block chain decrypts the INPUT
- (ciphertext) into the OUTPUT (cleartext) using the provided key schedule
- and initialization vector. Decryption ALWAYS operates on integral
- multiples of 8 bytes, so will round the length provided up to the
- appropriate multiple. Consequently, it will always produce the rounded-up
- number of bytes of output cleartext. The application must determine if
- the output cleartext was zero-padded due to cleartext lengths not integral
- multiples of 8.
-
- No errors or meaningful value are returned. Void is not used for
- compatibility with other compilers.
-
-
-/* cbc checksum (MAC) only routine ---------------------------------------- */
-int
- cbc_cksum(input,output,length,schedule,ivec)
-
- C_Block *input; /* >= length bytes of inputtext */
- C_Block *output; /* >= length bytes of outputtext */
- int length; /* in bytes */
- Key_schedule schedule; /* precomputed key schedule */
- C_Block *ivec; /* 8 bytes of ivec */
-
-
- Produces a cryptographic checksum, 8 bytes, by cipher-block-chain
- encrypting the input, discarding the ciphertext output, and only retaining
- the last ciphertext 8-byte block. Uses the provided key schedule and ivec.
- The input is effectively zero-padded to an integral multiple of
- eight bytes, though the original input is not modified.
-
- No meaningful value is returned. Void is not used for compatibility
- with other compilers.
-
-
-/* random_key ----------------------------------------*/
-int
- random_key(key)
-
- C_Block *key;
-
- The start for the random number generated is set from the current time
- in microseconds, then the random number generator is invoked
- to create an eight byte output key (not a schedule). The key
- generated is set to odd parity per FIPS spec.
-
- The caller must supply space for the output key, pointed to
- by "*key", then after getting a new key, call the des_set_key()
- routine when needed.
-
- No meaningfull value is returned. Void is not used for compatibility
- with other compilers.
-
-
-/* string_to_key --------------------------------------------*/
-
-int
- string_to_key(str,key)
- register char *str;
- register C_Block *key;
-
- This routines converts an arbitrary length, null terminated string
- to an 8 byte DES key, with each byte parity set to odd, per FIPS spec.
-
- The algorithm is as follows:
-
-| Take the first 8 bytes and remove the parity (leaving 56 bits).
-| Do the same for the second 8 bytes, and the third, etc. Do this for
-| as many sets of 8 bytes as necessary, filling in the remainder of the
-| last set with nulls. Fold the second set back on the first (i.e. bit
-| 0 over bit 55, and bit 55 over bit 0). Fold the third over the second
-| (bit 0 of the third set is now over bit 0 of the first set). Repeat
-| until you have done this to all sets. Xor the folded sets. Break the
-| result into 8 7 bit bytes, and generate odd parity for each byte. You
-| now have 64 bits. Note that DES takes a 64 bit key, and uses only the
-| non parity bits.
-
-
-/* read_password -------------------------------------------*/
-
-read_password(k,prompt,verify)
- C_Block *k;
- char *prompt;
- int verify;
-
-This routine issues the supplied prompt, turns off echo, if possible, and
-reads an input string. If verify is non-zero, it does it again, for use
-in applications such as changing a password. If verify is non-zero, both
-versions are compared, and the input is requested repeatedly until they
-match. Then, the input string is mapped into a valid DES key, internally
-using the string_to_key routine. The newly created key is copied to the
-area pointed to by parameter "k".
-
-No meaningful value is returned. If an error occurs trying to manipulate
-the terminal echo, the routine forces the process to exit.
-
-/* get_line ------------------------*/
-long get_line(p,max)
- char *p;
- long max;
-
-Reads input characters from standard input until either a newline appears or
-else the max length is reached. The characters read are stuffed into
-the string pointed to, which will always be null terminated. The newline
-is not inserted in the string. The max parameter includes the byte needed
-for the null terminator, so allocate and pass one more than the maximum
-string length desired.
diff --git a/libdes/enc.c b/libdes/enc.c
deleted file mode 100644
index 58e9a2d..0000000
--- a/libdes/enc.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- */
-
-#ifndef lint
-static char rcsid_enc_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/file.h>
-#include <fcntl.h>
-
-#include <des.h>
-
-des_key_schedule KEYSCHED;
-des_cblock key = {0,1,2,3,4,5,6,7};
-des_cblock sum;
-char inbuf[512+8]; /* leave room for cksum and len */
-char oubuf[512+8];
-int ind;
-int oud;
-long orig_size;
-
-main(argc,argv)
- int argc;
- char *argv[];
-{
- register int encrypt;
- register long length;
- register int *p;
- u_int32 ivec[2];
- if (argc != 4) {
- fprintf (stderr, "%s: Usage: %s infile outfile mode.\n",
- argv[0], argv[0]);
- exit (1);
- }
- if (!strcmp(argv[3], "e"))
- encrypt = 1;
- else if (!strcmp(argv[3], "d"))
- encrypt = 0;
- else {
- fprintf (stderr, "%s: Mode must be e (encrypt) or d (decrypt).\n",
- argv[0]);
- exit (1);
- }
- if ((ind = open(argv[1], O_RDONLY, 0666)) < 0) {
- fprintf (stderr, "%s: Cannot open %s for input.\n",
- argv[0], argv[1]);
- exit (1);
- }
- if (!strcmp(argv[2], "-"))
- oud = dup(1);
- else if ((oud = open(argv[2], O_CREAT|O_WRONLY, 0666)) < 0) {
- fprintf (stderr, "%s: Cannot open %s for output.\n",
- argv[0], argv[2]);
- exit (1);
- }
-#ifdef notdef
- (void) freopen ("/dev/tty", "r", stdin);
- (void) freopen ("/dev/tty", "w", stdout);
-#endif
- des_read_password (key, "\n\07\07Enter Key> ", 1);
- if (des_key_sched (key, KEYSCHED) < 0) {
- fprintf (stderr, "%s: Key parity error\n", argv[0]);
- exit (1);
- }
- ivec[0] = 0;
- ivec[1] = 0;
- memcpy(sum, key, sizeof(des_cblock));
- for (;;) {
- if ((length = read (ind, inbuf, 512)) < 0) {
- fprintf (stderr, "%s: Error reading from input.\n",
- argv[0]);
- exit (1);
- } else if (length == 0) {
- fprintf (stderr, "\n");
- break;
- }
- if (encrypt) {
-#ifdef notdef
- sum = des_quad_cksum(inbuf,NULL,length,1,sum);
-#endif
- des_quad_cksum(inbuf,sum,length,1,sum);
- orig_size += length;
- fprintf(stderr,
- "\nlength = %d tot length = %d quad_sum = %X %X",
- length, orig_size, *(unsigned long *) sum,
- *((unsigned long *) sum+1));
- fflush(stderr);
- }
- des_pcbc_encrypt (inbuf, oubuf, (long) length, KEYSCHED, ivec,
- encrypt);
- if (!encrypt) {
-#ifdef notdef
- sum = des_quad_cksum(oubuf,NULL,length,1,sum);
-#endif
- des_quad_cksum(oubuf,sum,length,1,sum);
- orig_size += length;
- fprintf(stderr,
- "\nlength = %d tot length = %d quad_sum = %X ",
- length, orig_size, *(unsigned long *) sum,
- *((unsigned long *) sum+1));
- }
- length = (length+7)& ~07;
- write (oud, oubuf, length);
- if (!encrypt)
- p = (int *)&oubuf[length-8];
- else
- p = (int *)&inbuf[length-8];
- ivec[0] = *p++;
- ivec[1] = *p;
- }
-
- fprintf(stderr,"\ntot length = %d quad_sum = %X\n",
- orig_size,sum);
- /* if encrypting, now put the original length and checksum in */
- return 0;
-}
diff --git a/libdes/f_README b/libdes/f_README
deleted file mode 100644
index 0d381e3..0000000
--- a/libdes/f_README
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1990 Dennis Ferguson. All rights reserved.
- *
- * Commercial use is permitted only if products which are derived from
- * or include this software are made available for purchase and/or use
- * in Canada. Otherwise, redistribution and use in source and binary
- * forms are permitted.
- */
-
-Sorry about the poor quality of installation instructions. Included
-here are replacements for the DES portions of Eric Young's kerberos
-DES library replacement. To use this you will need his distribution.
-Untar the latter and:
-
-(1) Copy all .c and .h files into the distribution directory. This will
- overwrite some files and add others.
-
-(2) Apply the patch included here to set_key.c in the distribution directory.
-
-(3) Edit the Imakefile (or the Makefile) to include the following files
- on the SRCS= line:
-
- des_tables.c ecb_buffer.c make_sched.c
-
- Add the following files to the OBJS= line:
-
- des_tables.o ecb_buffer.o make_sched.o
-
- Add the following file to the CODE= line:
-
- des_tables.h
-
-Recompile and you're done.
-
-The salient differences between this DES and Eric Young's are as follows:
-
-(1) There are no dependencies on byte ordering, the ability to do
- unaligned loads and stores, or any other machine dependencies
- that I know of. There are no #ifdef's. The code could probably
- be made faster by adding such things, but not enough to be worth
- it.
-
-(2) Combined S and P tables are used for the inner loop of the cipher
- routine and the E expansion is computed on the fly, like Eric
- Young's code, but the computation is reordered from the standard
- to save instructions.
-
-(3) The initial and final permutations are table driven, and take
- about the same amount of work as a single round of the inner
- loop (i.e. only about 12% of the work done for an ecb encryption
- is spent in the IP and FP code).
-
-(4) Since NTP (for which this DES was originally implemented) uses
- lots of keys to encrypt small things, the key permutation code
- has been well worked over and is quite speedy (the amount of
- work required to permute a key is on the order of that required
- to do a single ECB encryption, more or less).
-
-(5) Since the code required to do an ECB encryption using the tables
- is actually fairly compact, even with lots of inlining, it was
- implemented as a macro and is expanded in situ where needed.
-
-On the one machine I ran a comparison on this code ran 80% faster than
-Eric's, compiled into a slightly smaller space, and did pass destest.
-I suspect this stuff is also faster, and not a lot larger, than the
-library MIT doesn't export with kerberos. You mileage may vary.
-
-The silly copyright was a (probably ineffective) afterthought. If it
-really inconveniences you give me a call.
diff --git a/libdes/f_cbc.c b/libdes/f_cbc.c
deleted file mode 100644
index eba53be..0000000
--- a/libdes/f_cbc.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 1990 Dennis Ferguson. All rights reserved.
- *
- * Commercial use is permitted only if products which are derived from
- * or include this software are made available for purchase and/or use
- * in Canada. Otherwise, redistribution and use in source and binary
- * forms are permitted.
- */
-
-/*
- * des_cbc_encrypt.c - an implementation of the DES cipher function in cbc mode
- */
-#include "des.h"
-#include "f_tables.h"
-
-/*
- * des_cbc_encrypt - {en,de}crypt a stream in CBC mode
- */
-int
-des_cbc_encrypt(in, out, length, schedule, ivec, encrypt)
- des_cblock *in;
- des_cblock *out;
- long length;
- des_key_schedule schedule;
- des_cblock ivec;
- int encrypt;
-{
- register unsigned long left, right;
- register unsigned long temp;
- register u_int32 *kp;
- register unsigned char *ip, *op;
-
- /*
- * Get key pointer here. This won't need to be reinitialized
- */
- kp = (u_int32 *)schedule;
-
- /*
- * Deal with encryption and decryption separately.
- */
- if (encrypt) {
- /*
- * Initialize left and right with the contents of the initial
- * vector.
- */
- ip = (unsigned char *)ivec;
- GET_HALF_BLOCK(left, ip);
- GET_HALF_BLOCK(right, ip);
-
- /*
- * Suitably initialized, now work the length down 8 bytes
- * at a time.
- */
- ip = (unsigned char *)in;
- op = (unsigned char *)out;
- while (length > 0) {
- /*
- * Get more input, xor it in. If the length is
- * greater than or equal to 8 this is straight
- * forward. Otherwise we have to fart around.
- */
- if (length >= 8) {
- left ^= ((*ip++) & 0xff) << 24;
- left ^= ((*ip++) & 0xff) << 16;
- left ^= ((*ip++) & 0xff) << 8;
- left ^= (*ip++) & 0xff;
- right ^= ((*ip++) & 0xff) << 24;
- right ^= ((*ip++) & 0xff) << 16;
- right ^= ((*ip++) & 0xff) << 8;
- right ^= (*ip++) & 0xff;
- length -= 8;
- } else {
- /*
- * Oh, shoot. We need to pad the
- * end with zeroes. Work backwards
- * to do this.
- */
- ip += (int) length;
- switch(length) {
- case 7:
- right ^= (*(--ip) & 0xff) << 8;
- case 6:
- right ^= (*(--ip) & 0xff) << 16;
- case 5:
- right ^= (*(--ip) & 0xff) << 24;
- case 4:
- left ^= *(--ip) & 0xff;
- case 3:
- left ^= (*(--ip) & 0xff) << 8;
- case 2:
- left ^= (*(--ip) & 0xff) << 16;
- case 1:
- left ^= (*(--ip) & 0xff) << 24;
- break;
- }
- length = 0;
- }
-
- /*
- * Encrypt what we have
- */
- DES_DO_ENCRYPT(left, right, temp, kp);
-
- /*
- * Copy the results out
- */
- PUT_HALF_BLOCK(left, op);
- PUT_HALF_BLOCK(right, op);
- }
- } else {
- /*
- * Decrypting is harder than encrypting because of
- * the necessity of remembering a lot more things.
- * Should think about this a little more...
- */
- unsigned long ocipherl, ocipherr;
- unsigned long cipherl, cipherr;
-
- if (length <= 0)
- return 0;
-
- /*
- * Prime the old cipher with ivec.
- */
- ip = (unsigned char *)ivec;
- GET_HALF_BLOCK(ocipherl, ip);
- GET_HALF_BLOCK(ocipherr, ip);
-
- /*
- * Now do this in earnest until we run out of length.
- */
- ip = (unsigned char *)in;
- op = (unsigned char *)out;
- for (;;) { /* check done inside loop */
- /*
- * Read a block from the input into left and
- * right. Save this cipher block for later.
- */
- GET_HALF_BLOCK(left, ip);
- GET_HALF_BLOCK(right, ip);
- cipherl = left;
- cipherr = right;
-
- /*
- * Decrypt this.
- */
- DES_DO_DECRYPT(left, right, temp, kp);
-
- /*
- * Xor with the old cipher to get plain
- * text. Output 8 or less bytes of this.
- */
- left ^= ocipherl;
- right ^= ocipherr;
- if (length > 8) {
- length -= 8;
- PUT_HALF_BLOCK(left, op);
- PUT_HALF_BLOCK(right, op);
- /*
- * Save current cipher block here
- */
- ocipherl = cipherl;
- ocipherr = cipherr;
- } else {
- /*
- * Trouble here. Start at end of output,
- * work backwards.
- */
- op += (int) length;
- switch(length) {
- case 8:
- *(--op) = right & 0xff;
- case 7:
- *(--op) = (right >> 8) & 0xff;
- case 6:
- *(--op) = (right >> 16) & 0xff;
- case 5:
- *(--op) = (right >> 24) & 0xff;
- case 4:
- *(--op) = left & 0xff;
- case 3:
- *(--op) = (left >> 8) & 0xff;
- case 2:
- *(--op) = (left >> 16) & 0xff;
- case 1:
- *(--op) = (left >> 24) & 0xff;
- break;
- }
- break; /* we're done */
- }
- }
- }
-
- /*
- * Done, return nothing.
- */
- return 0;
-}
diff --git a/libdes/f_cksum.c b/libdes/f_cksum.c
deleted file mode 100644
index 5fbc4f9..0000000
--- a/libdes/f_cksum.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 1990 Dennis Ferguson. All rights reserved.
- *
- * Commercial use is permitted only if products which are derived from
- * or include this software are made available for purchase and/or use
- * in Canada. Otherwise, redistribution and use in source and binary
- * forms are permitted.
- */
-
-/*
- * des_cbc_cksum.c - compute an 8 byte checksum using DES in CBC mode
- */
-#include "des.h"
-#include "f_tables.h"
-
-unsigned long
-des_cbc_cksum(in, out, length, schedule, ivec)
- des_cblock *in;
- des_cblock *out;
- long length;
- des_key_schedule schedule;
- des_cblock ivec;
-{
- register unsigned long left, right;
- register unsigned long temp;
- register u_int32 *kp;
- register unsigned char *ip;
- register long len;
-
- /*
- * Initialize left and right with the contents of the initial
- * vector.
- */
- ip = (unsigned char *)ivec;
- GET_HALF_BLOCK(left, ip);
- GET_HALF_BLOCK(right, ip);
-
- /*
- * Suitably initialized, now work the length down 8 bytes
- * at a time.
- */
- ip = (unsigned char *)in;
- len = length;
- while (len > 0) {
- /*
- * Get more input, xor it in. If the length is
- * greater than or equal to 8 this is straight
- * forward. Otherwise we have to fart around.
- */
- if (len >= 8) {
- left ^= ((*ip++) & 0xff) << 24;
- left ^= ((*ip++) & 0xff) << 16;
- left ^= ((*ip++) & 0xff) << 8;
- left ^= (*ip++) & 0xff;
- right ^= ((*ip++) & 0xff) << 24;
- right ^= ((*ip++) & 0xff) << 16;
- right ^= ((*ip++) & 0xff) << 8;
- right ^= (*ip++) & 0xff;
- len -= 8;
- } else {
- /*
- * Oh, shoot. We need to pad the
- * end with zeroes. Work backwards
- * to do this.
- */
- ip += (int) len;
- switch(len) {
- case 7:
- right ^= (*(--ip) & 0xff) << 8;
- case 6:
- right ^= (*(--ip) & 0xff) << 16;
- case 5:
- right ^= (*(--ip) & 0xff) << 24;
- case 4:
- left ^= *(--ip) & 0xff;
- case 3:
- left ^= (*(--ip) & 0xff) << 8;
- case 2:
- left ^= (*(--ip) & 0xff) << 16;
- case 1:
- left ^= (*(--ip) & 0xff) << 24;
- break;
- }
- len = 0;
- }
-
- /*
- * Encrypt what we have
- */
- kp = (u_int32 *)schedule;
- DES_DO_ENCRYPT(left, right, temp, kp);
- }
-
- /*
- * Done. Left and right have the checksum. Put it into
- * the output.
- */
- ip = (unsigned char *)out;
- PUT_HALF_BLOCK(left, ip);
- PUT_HALF_BLOCK(right, ip);
-
- /*
- * Return right. I'll bet the MIT code returns this
- * inconsistantly (with the low order byte of the checksum
- * not always in the low order byte of the long). We won't.
- */
- return right;
-}
diff --git a/libdes/f_ecb.c b/libdes/f_ecb.c
deleted file mode 100644
index a4d0579..0000000
--- a/libdes/f_ecb.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1990 Dennis Ferguson. All rights reserved.
- *
- * Commercial use is permitted only if products which are derived from
- * or include this software are made available for purchase and/or use
- * in Canada. Otherwise, redistribution and use in source and binary
- * forms are permitted.
- */
-
-/*
- * des_ecb_encrypt.c - do an encryption in ECB mode
- */
-#include "des.h"
-#include "f_tables.h"
-
-/*
- * des_ecb_encrypt - {en,de}crypt a block in ECB mode
- */
-int
-des_ecb_encrypt(in, out, schedule, encrypt)
- des_cblock *in;
- des_cblock *out;
- des_key_schedule schedule;
- int encrypt;
-{
- register unsigned long left, right;
- register unsigned long temp;
- register int i;
-
- {
- /*
- * Need a temporary for copying the data in
- */
- register unsigned char *datap;
-
- /*
- * Copy the input block into the registers
- */
- datap = (unsigned char *)in;
- GET_HALF_BLOCK(left, datap);
- GET_HALF_BLOCK(right, datap);
- }
-
- /*
- * Do the initial permutation.
- */
- DES_INITIAL_PERM(left, right, temp);
-
- /*
- * Now the rounds. Use different code depending on whether it
- * is an encryption or a decryption (gross, should keep both
- * sets of keys in the key schedule instead).
- */
- if (encrypt) {
- register u_int32 *kp;
-
- kp = (u_int32 *)schedule;
- for (i = 0; i < 8; i++) {
- DES_SP_ENCRYPT_ROUND(left, right, temp, kp);
- DES_SP_ENCRYPT_ROUND(right, left, temp, kp);
- }
- } else {
- register u_int32 *kp;
-
- /*
- * Point kp past end of schedule
- */
- kp = ((u_int32 *)schedule) + (2 * 16);;
- for (i = 0; i < 8; i++) {
- DES_SP_DECRYPT_ROUND(left, right, temp, kp);
- DES_SP_DECRYPT_ROUND(right, left, temp, kp);
- }
- }
-
- /*
- * Do the final permutation
- */
- DES_FINAL_PERM(left, right, temp);
-
- /*
- * Finally, copy the result out a byte at a time
- */
- {
- register unsigned char *datap;
-
- datap = (unsigned char *)out;
- PUT_HALF_BLOCK(left, datap);
- PUT_HALF_BLOCK(right, datap);
- }
-
- /*
- * return nothing
- */
- return (0);
-}
diff --git a/libdes/f_parity.c b/libdes/f_parity.c
deleted file mode 100644
index 44d2307..0000000
--- a/libdes/f_parity.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * These routines check and fix parity of encryption keys for the DES
- * algorithm.
- *
- * They are a replacement for routines in key_parity.c, that don't require
- * the table building that they do.
- *
- * Mark Eichin -- Cygnus Support
- */
-
-#ifndef lint
-static char rcsid_f_parity_c[] =
- "$Id$";
-#endif
-
-#include "des.h"
-
-/*
- * des_fixup_key_parity: Forces odd parity per byte; parity is bits
- * 8,16,...64 in des order, implies 0, 8, 16, ...
- * vax order.
- */
-#define smask(step) ((1<<step)-1)
-#define pstep(x,step) (((x)&smask(step))^(((x)>>step)&smask(step)))
-#define parity_char(x) pstep(pstep(pstep((x),4),2),1)
-
-void
-des_fixup_key_parity(key)
- register des_cblock key;
-{
- int i;
- for (i=0; i<sizeof(des_cblock); i++)
- {
- key[i] &= 0xfe;
- key[i] |= 1^parity_char(key[i]);
- }
-
- return;
-}
-
-/*
- * des_check_key_parity: returns true iff key has the correct des parity.
- * See des_fix_key_parity for the definition of
- * correct des parity.
- */
-int
-des_check_key_parity(key)
- register des_cblock key;
-{
- int i;
-
- for (i=0; i<sizeof(des_cblock); i++)
- {
- if((key[i] & 1) == parity_char(0xfe&key[i]))
- {
- return 0;
- }
- }
-
- return(1);
-}
-
diff --git a/libdes/f_pcbc.c b/libdes/f_pcbc.c
deleted file mode 100644
index 4b7dc78..0000000
--- a/libdes/f_pcbc.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 1990 Dennis Ferguson. All rights reserved.
- *
- * Commercial use is permitted only if products which are derived from
- * or include this software are made available for purchase and/or use
- * in Canada. Otherwise, redistribution and use in source and binary
- * forms are permitted.
- */
-
-/*
- * des_pcbc_encrypt.c - encrypt a string of characters in error propagation mode
- */
-#include "des.h"
-#include "f_tables.h"
-
-/*
- * des_pcbc_encrypt - {en,de}crypt a stream in PCBC mode
- */
-int
-des_pcbc_encrypt(in, out, length, schedule, ivec, encrypt)
- des_cblock *in;
- des_cblock *out;
- long length;
- des_key_schedule schedule;
- des_cblock ivec;
- int encrypt;
-{
- register unsigned long left, right;
- register unsigned long temp;
- register u_int32 *kp;
- register unsigned char *ip, *op;
-
- /*
- * Copy the key pointer, just once
- */
- kp = (u_int32 *)schedule;
-
- /*
- * Deal with encryption and decryption separately.
- */
- if (encrypt) {
- register unsigned long plainl;
- register unsigned long plainr;
-
- /*
- * Initialize left and right with the contents of the initial
- * vector.
- */
- ip = (unsigned char *)ivec;
- GET_HALF_BLOCK(left, ip);
- GET_HALF_BLOCK(right, ip);
-
- /*
- * Suitably initialized, now work the length down 8 bytes
- * at a time.
- */
- ip = (unsigned char *)in;
- op = (unsigned char *)out;
- while (length > 0) {
- /*
- * Get block of input. If the length is
- * greater than 8 this is straight
- * forward. Otherwise we have to fart around.
- */
- if (length > 8) {
- GET_HALF_BLOCK(plainl, ip);
- GET_HALF_BLOCK(plainr, ip);
- left ^= plainl;
- right ^= plainr;
- length -= 8;
- } else {
- /*
- * Oh, shoot. We need to pad the
- * end with zeroes. Work backwards
- * to do this. We know this is the
- * last block, though, so we don't have
- * to save the plain text.
- */
- ip += (int) length;
- switch(length) {
- case 8:
- right ^= *(--ip) & 0xff;
- case 7:
- right ^= (*(--ip) & 0xff) << 8;
- case 6:
- right ^= (*(--ip) & 0xff) << 16;
- case 5:
- right ^= (*(--ip) & 0xff) << 24;
- case 4:
- left ^= *(--ip) & 0xff;
- case 3:
- left ^= (*(--ip) & 0xff) << 8;
- case 2:
- left ^= (*(--ip) & 0xff) << 16;
- case 1:
- left ^= (*(--ip) & 0xff) << 24;
- break;
- }
- length = 0;
- }
-
- /*
- * Encrypt what we have
- */
- DES_DO_ENCRYPT(left, right, temp, kp);
-
- /*
- * Copy the results out
- */
- PUT_HALF_BLOCK(left, op);
- PUT_HALF_BLOCK(right, op);
-
- /*
- * Xor with the old plain text
- */
- left ^= plainl;
- right ^= plainr;
- }
- } else {
- /*
- * Decrypting is harder than encrypting because of
- * the necessity of remembering a lot more things.
- * Should think about this a little more...
- */
- unsigned long ocipherl, ocipherr;
- unsigned long cipherl, cipherr;
-
- if (length <= 0)
- return 0;
-
- /*
- * Prime the old cipher with ivec.
- */
- ip = (unsigned char *)ivec;
- GET_HALF_BLOCK(ocipherl, ip);
- GET_HALF_BLOCK(ocipherr, ip);
-
- /*
- * Now do this in earnest until we run out of length.
- */
- ip = (unsigned char *)in;
- op = (unsigned char *)out;
- for (;;) { /* check done inside loop */
- /*
- * Read a block from the input into left and
- * right. Save this cipher block for later.
- */
- GET_HALF_BLOCK(left, ip);
- GET_HALF_BLOCK(right, ip);
- cipherl = left;
- cipherr = right;
-
- /*
- * Decrypt this.
- */
- DES_DO_DECRYPT(left, right, temp, kp);
-
- /*
- * Xor with the old cipher to get plain
- * text. Output 8 or less bytes of this.
- */
- left ^= ocipherl;
- right ^= ocipherr;
- if (length > 8) {
- length -= 8;
- PUT_HALF_BLOCK(left, op);
- PUT_HALF_BLOCK(right, op);
- /*
- * Save current cipher block here
- */
- ocipherl = cipherl ^ left;
- ocipherr = cipherr ^ right;
- } else {
- /*
- * Trouble here. Start at end of output,
- * work backwards.
- */
- op += (int) length;
- switch(length) {
- case 8:
- *(--op) = right & 0xff;
- case 7:
- *(--op) = (right >> 8) & 0xff;
- case 6:
- *(--op) = (right >> 16) & 0xff;
- case 5:
- *(--op) = (right >> 24) & 0xff;
- case 4:
- *(--op) = left & 0xff;
- case 3:
- *(--op) = (left >> 8) & 0xff;
- case 2:
- *(--op) = (left >> 16) & 0xff;
- case 1:
- *(--op) = (left >> 24) & 0xff;
- break;
- }
- break; /* we're done */
- }
- }
- }
-
- /*
- * Done, return nothing.
- */
- return 0;
-}
diff --git a/libdes/f_sched.c b/libdes/f_sched.c
deleted file mode 100644
index 82ff800..0000000
--- a/libdes/f_sched.c
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 1990 Dennis Ferguson. All rights reserved.
- *
- * Commercial use is permitted only if products which are derived from
- * or include this software are made available for purchase and/or use
- * in Canada. Otherwise, redistribution and use in source and binary
- * forms are permitted.
- */
-
-/*
- * des_make_sched.c - permute a DES key, returning the resulting key schedule
- */
-#include "des.h"
-#include "f_tables.h"
-/*
- * Permuted choice 1 tables. These are used to extract bits
- * from the left and right parts of the key to form Ci and Di.
- * The code that uses these tables knows which bits from which
- * part of each key are used to form Ci and Di.
- */
-static unsigned long PC1_CL[8] = {
- 0x00000000, 0x00000010, 0x00001000, 0x00001010,
- 0x00100000, 0x00100010, 0x00101000, 0x00101010
-};
-
-static unsigned long PC1_DL[16] = {
- 0x00000000, 0x00100000, 0x00001000, 0x00101000,
- 0x00000010, 0x00100010, 0x00001010, 0x00101010,
- 0x00000001, 0x00100001, 0x00001001, 0x00101001,
- 0x00000011, 0x00100011, 0x00001011, 0x00101011
-};
-
-static unsigned long PC1_CR[16] = {
- 0x00000000, 0x00000001, 0x00000100, 0x00000101,
- 0x00010000, 0x00010001, 0x00010100, 0x00010101,
- 0x01000000, 0x01000001, 0x01000100, 0x01000101,
- 0x01010000, 0x01010001, 0x01010100, 0x01010101
-};
-
-static unsigned long PC1_DR[8] = {
- 0x00000000, 0x01000000, 0x00010000, 0x01010000,
- 0x00000100, 0x01000100, 0x00010100, 0x01010100
-};
-
-
-/*
- * At the start of some iterations of the key schedule we do
- * a circular left shift by one place, while for others we do a shift by
- * two places. This has bits set for the iterations where we do 2 bit
- * shifts, starting at the low order bit.
- */
-#define TWO_BIT_SHIFTS 0x7efc
-
-/*
- * Permuted choice 2 tables. The first actually produces the low order
- * 24 bits of the subkey Ki from the 28 bit value of Ci. The second produces
- * the high order 24 bits from Di. The tables are indexed by six bit
- * segments of Ci and Di respectively. The code is handcrafted to compute
- * the appropriate 6 bit chunks.
- *
- * Note that for ease of computation, the 24 bit values are produced with
- * six bits going into each byte. Note also that the table has been byte
- * rearranged to produce keys which match the order we will apply them
- * in in the des code.
- */
-static unsigned long PC2_C[4][64] = {
- 0x00000000, 0x00000004, 0x00010000, 0x00010004,
- 0x00000400, 0x00000404, 0x00010400, 0x00010404,
- 0x00000020, 0x00000024, 0x00010020, 0x00010024,
- 0x00000420, 0x00000424, 0x00010420, 0x00010424,
- 0x01000000, 0x01000004, 0x01010000, 0x01010004,
- 0x01000400, 0x01000404, 0x01010400, 0x01010404,
- 0x01000020, 0x01000024, 0x01010020, 0x01010024,
- 0x01000420, 0x01000424, 0x01010420, 0x01010424,
- 0x00020000, 0x00020004, 0x00030000, 0x00030004,
- 0x00020400, 0x00020404, 0x00030400, 0x00030404,
- 0x00020020, 0x00020024, 0x00030020, 0x00030024,
- 0x00020420, 0x00020424, 0x00030420, 0x00030424,
- 0x01020000, 0x01020004, 0x01030000, 0x01030004,
- 0x01020400, 0x01020404, 0x01030400, 0x01030404,
- 0x01020020, 0x01020024, 0x01030020, 0x01030024,
- 0x01020420, 0x01020424, 0x01030420, 0x01030424,
-
- 0x00000000, 0x02000000, 0x00000800, 0x02000800,
- 0x00080000, 0x02080000, 0x00080800, 0x02080800,
- 0x00000001, 0x02000001, 0x00000801, 0x02000801,
- 0x00080001, 0x02080001, 0x00080801, 0x02080801,
- 0x00000100, 0x02000100, 0x00000900, 0x02000900,
- 0x00080100, 0x02080100, 0x00080900, 0x02080900,
- 0x00000101, 0x02000101, 0x00000901, 0x02000901,
- 0x00080101, 0x02080101, 0x00080901, 0x02080901,
- 0x10000000, 0x12000000, 0x10000800, 0x12000800,
- 0x10080000, 0x12080000, 0x10080800, 0x12080800,
- 0x10000001, 0x12000001, 0x10000801, 0x12000801,
- 0x10080001, 0x12080001, 0x10080801, 0x12080801,
- 0x10000100, 0x12000100, 0x10000900, 0x12000900,
- 0x10080100, 0x12080100, 0x10080900, 0x12080900,
- 0x10000101, 0x12000101, 0x10000901, 0x12000901,
- 0x10080101, 0x12080101, 0x10080901, 0x12080901,
-
- 0x00000000, 0x00040000, 0x00002000, 0x00042000,
- 0x00100000, 0x00140000, 0x00102000, 0x00142000,
- 0x20000000, 0x20040000, 0x20002000, 0x20042000,
- 0x20100000, 0x20140000, 0x20102000, 0x20142000,
- 0x00000008, 0x00040008, 0x00002008, 0x00042008,
- 0x00100008, 0x00140008, 0x00102008, 0x00142008,
- 0x20000008, 0x20040008, 0x20002008, 0x20042008,
- 0x20100008, 0x20140008, 0x20102008, 0x20142008,
- 0x00200000, 0x00240000, 0x00202000, 0x00242000,
- 0x00300000, 0x00340000, 0x00302000, 0x00342000,
- 0x20200000, 0x20240000, 0x20202000, 0x20242000,
- 0x20300000, 0x20340000, 0x20302000, 0x20342000,
- 0x00200008, 0x00240008, 0x00202008, 0x00242008,
- 0x00300008, 0x00340008, 0x00302008, 0x00342008,
- 0x20200008, 0x20240008, 0x20202008, 0x20242008,
- 0x20300008, 0x20340008, 0x20302008, 0x20342008,
-
- 0x00000000, 0x00000010, 0x08000000, 0x08000010,
- 0x00000200, 0x00000210, 0x08000200, 0x08000210,
- 0x00000002, 0x00000012, 0x08000002, 0x08000012,
- 0x00000202, 0x00000212, 0x08000202, 0x08000212,
- 0x04000000, 0x04000010, 0x0c000000, 0x0c000010,
- 0x04000200, 0x04000210, 0x0c000200, 0x0c000210,
- 0x04000002, 0x04000012, 0x0c000002, 0x0c000012,
- 0x04000202, 0x04000212, 0x0c000202, 0x0c000212,
- 0x00001000, 0x00001010, 0x08001000, 0x08001010,
- 0x00001200, 0x00001210, 0x08001200, 0x08001210,
- 0x00001002, 0x00001012, 0x08001002, 0x08001012,
- 0x00001202, 0x00001212, 0x08001202, 0x08001212,
- 0x04001000, 0x04001010, 0x0c001000, 0x0c001010,
- 0x04001200, 0x04001210, 0x0c001200, 0x0c001210,
- 0x04001002, 0x04001012, 0x0c001002, 0x0c001012,
- 0x04001202, 0x04001212, 0x0c001202, 0x0c001212
-};
-
-static unsigned long PC2_D[4][64] = {
- 0x00000000, 0x02000000, 0x00020000, 0x02020000,
- 0x00000100, 0x02000100, 0x00020100, 0x02020100,
- 0x00000008, 0x02000008, 0x00020008, 0x02020008,
- 0x00000108, 0x02000108, 0x00020108, 0x02020108,
- 0x00200000, 0x02200000, 0x00220000, 0x02220000,
- 0x00200100, 0x02200100, 0x00220100, 0x02220100,
- 0x00200008, 0x02200008, 0x00220008, 0x02220008,
- 0x00200108, 0x02200108, 0x00220108, 0x02220108,
- 0x00000200, 0x02000200, 0x00020200, 0x02020200,
- 0x00000300, 0x02000300, 0x00020300, 0x02020300,
- 0x00000208, 0x02000208, 0x00020208, 0x02020208,
- 0x00000308, 0x02000308, 0x00020308, 0x02020308,
- 0x00200200, 0x02200200, 0x00220200, 0x02220200,
- 0x00200300, 0x02200300, 0x00220300, 0x02220300,
- 0x00200208, 0x02200208, 0x00220208, 0x02220208,
- 0x00200308, 0x02200308, 0x00220308, 0x02220308,
-
- 0x00000000, 0x00001000, 0x00000020, 0x00001020,
- 0x00100000, 0x00101000, 0x00100020, 0x00101020,
- 0x08000000, 0x08001000, 0x08000020, 0x08001020,
- 0x08100000, 0x08101000, 0x08100020, 0x08101020,
- 0x00000004, 0x00001004, 0x00000024, 0x00001024,
- 0x00100004, 0x00101004, 0x00100024, 0x00101024,
- 0x08000004, 0x08001004, 0x08000024, 0x08001024,
- 0x08100004, 0x08101004, 0x08100024, 0x08101024,
- 0x00000400, 0x00001400, 0x00000420, 0x00001420,
- 0x00100400, 0x00101400, 0x00100420, 0x00101420,
- 0x08000400, 0x08001400, 0x08000420, 0x08001420,
- 0x08100400, 0x08101400, 0x08100420, 0x08101420,
- 0x00000404, 0x00001404, 0x00000424, 0x00001424,
- 0x00100404, 0x00101404, 0x00100424, 0x00101424,
- 0x08000404, 0x08001404, 0x08000424, 0x08001424,
- 0x08100404, 0x08101404, 0x08100424, 0x08101424,
-
- 0x00000000, 0x10000000, 0x00010000, 0x10010000,
- 0x00000002, 0x10000002, 0x00010002, 0x10010002,
- 0x00002000, 0x10002000, 0x00012000, 0x10012000,
- 0x00002002, 0x10002002, 0x00012002, 0x10012002,
- 0x00040000, 0x10040000, 0x00050000, 0x10050000,
- 0x00040002, 0x10040002, 0x00050002, 0x10050002,
- 0x00042000, 0x10042000, 0x00052000, 0x10052000,
- 0x00042002, 0x10042002, 0x00052002, 0x10052002,
- 0x20000000, 0x30000000, 0x20010000, 0x30010000,
- 0x20000002, 0x30000002, 0x20010002, 0x30010002,
- 0x20002000, 0x30002000, 0x20012000, 0x30012000,
- 0x20002002, 0x30002002, 0x20012002, 0x30012002,
- 0x20040000, 0x30040000, 0x20050000, 0x30050000,
- 0x20040002, 0x30040002, 0x20050002, 0x30050002,
- 0x20042000, 0x30042000, 0x20052000, 0x30052000,
- 0x20042002, 0x30042002, 0x20052002, 0x30052002,
-
- 0x00000000, 0x04000000, 0x00000001, 0x04000001,
- 0x01000000, 0x05000000, 0x01000001, 0x05000001,
- 0x00000010, 0x04000010, 0x00000011, 0x04000011,
- 0x01000010, 0x05000010, 0x01000011, 0x05000011,
- 0x00080000, 0x04080000, 0x00080001, 0x04080001,
- 0x01080000, 0x05080000, 0x01080001, 0x05080001,
- 0x00080010, 0x04080010, 0x00080011, 0x04080011,
- 0x01080010, 0x05080010, 0x01080011, 0x05080011,
- 0x00000800, 0x04000800, 0x00000801, 0x04000801,
- 0x01000800, 0x05000800, 0x01000801, 0x05000801,
- 0x00000810, 0x04000810, 0x00000811, 0x04000811,
- 0x01000810, 0x05000810, 0x01000811, 0x05000811,
- 0x00080800, 0x04080800, 0x00080801, 0x04080801,
- 0x01080800, 0x05080800, 0x01080801, 0x05080801,
- 0x00080810, 0x04080810, 0x00080811, 0x04080811,
- 0x01080810, 0x05080810, 0x01080811, 0x05080811
-};
-
-
-
-/*
- * Permute the key to give us our key schedule.
- */
-int
-make_key_sched(key, schedule)
- des_cblock *key;
- des_key_schedule schedule;
-{
- register unsigned long c, d;
-
- {
- /*
- * Need a pointer for the keys and a temporary long
- */
- register unsigned char *k;
- register unsigned long tmp;
-
- /*
- * Fetch the key into something we can work with
- */
- k = (unsigned char *)key;
-
- /*
- * The first permutted choice gives us the 28 bits for C0 and
- * 28 for D0. C0 gets 12 bits from the left key and 16 from
- * the right, while D0 gets 16 from the left and 12 from the
- * right. The code knows which bits go where.
- */
- tmp = ((u_int32)(*(k)++)) << 24;
- tmp |= ((u_int32)(*(k)++)) << 16;
- tmp |= ((u_int32)(*(k)++)) << 8;
- tmp |= (u_int32)(*(k)++); /* left part of key */
- c = PC1_CL[(tmp >> 29) & 0x7]
- | (PC1_CL[(tmp >> 21) & 0x7] << 1)
- | (PC1_CL[(tmp >> 13) & 0x7] << 2)
- | (PC1_CL[(tmp >> 5) & 0x7] << 3);
- d = PC1_DL[(tmp >> 25) & 0xf]
- | (PC1_DL[(tmp >> 17) & 0xf] << 1)
- | (PC1_DL[(tmp >> 9) & 0xf] << 2)
- | (PC1_DL[(tmp >> 1) & 0xf] << 3);
-
- tmp = ((u_int32)(*(k)++)) << 24;
- tmp |= ((u_int32)(*(k)++)) << 16;
- tmp |= ((u_int32)(*(k)++)) << 8;
- tmp |= (u_int32)(*(k)++); /* right part of key */
- c |= PC1_CR[(tmp >> 28) & 0xf]
- | (PC1_CR[(tmp >> 20) & 0xf] << 1)
- | (PC1_CR[(tmp >> 12) & 0xf] << 2)
- | (PC1_CR[(tmp >> 4) & 0xf] << 3);
- d |= PC1_DR[(tmp >> 25) & 0x7]
- | (PC1_DR[(tmp >> 17) & 0x7] << 1)
- | (PC1_DR[(tmp >> 9) & 0x7] << 2)
- | (PC1_DR[(tmp >> 1) & 0x7] << 3);
- }
-
- {
- /*
- * Need several temporaries in here
- */
- register unsigned long ltmp, rtmp;
- register u_int32 *k;
- register int two_bit_shifts;
- register int i;
- /*
- * Now iterate to compute the key schedule. Note that we
- * record the entire set of subkeys in 6 bit chunks since
- * they are used that way. At 6 bits/char, we need
- * 48/6 char's/subkey * 16 subkeys/encryption == 128 bytes.
- * The schedule must be this big.
- */
- k = (u_int32 *)schedule;
- two_bit_shifts = TWO_BIT_SHIFTS;
- for (i = 16; i > 0; i--) {
- /*
- * Do the rotation. One bit and two bit rotations
- * are done separately. Note C and D are 28 bits.
- */
- if (two_bit_shifts & 0x1) {
- c = ((c << 2) & 0xffffffc) | (c >> 26);
- d = ((d << 2) & 0xffffffc) | (d >> 26);
- } else {
- c = ((c << 1) & 0xffffffe) | (c >> 27);
- d = ((d << 1) & 0xffffffe) | (d >> 27);
- }
- two_bit_shifts >>= 1;
-
- /*
- * Apply permutted choice 2 to C to get the first
- * 24 bits worth of keys. Note that bits 9, 18, 22
- * and 25 (using DES numbering) in C are unused. The
- * shift-mask stuff is done to delete these bits from
- * the indices, since this cuts the table size in half.
- *
- * The table is torqued, by the way. If the standard
- * byte order for this (high to low order) is 1234,
- * the table actually gives us 4132.
- */
- ltmp = PC2_C[0][((c >> 22) & 0x3f)]
- | PC2_C[1][((c >> 15) & 0xf) | ((c >> 16) & 0x30)]
- | PC2_C[2][((c >> 4) & 0x3) | ((c >> 9) & 0x3c)]
- | PC2_C[3][((c ) & 0x7) | ((c >> 4) & 0x38)];
- /*
- * Apply permutted choice 2 to D to get the other half.
- * Here, bits 7, 10, 15 and 26 go unused. The sqeezing
- * actually turns out to be cheaper here.
- *
- * This table is similarly torqued. If the standard
- * byte order is 5678, the table has the bytes permuted
- * to give us 7685.
- */
- rtmp = PC2_D[0][((d >> 22) & 0x3f)]
- | PC2_D[1][((d >> 14) & 0xf) | ((d >> 15) & 0x30)]
- | PC2_D[2][((d >> 7) & 0x3f)]
- | PC2_D[3][((d ) & 0x3) | ((d >> 1) & 0x3c)];
-
- /*
- * Make up two words of the key schedule, with a
- * byte order which is convenient for the DES
- * inner loop. The high order (first) word will
- * hold bytes 7135 (high to low order) while the
- * second holds bytes 4682.
- */
- *k++ = (ltmp & 0x00ffff00) | (rtmp & 0xff0000ff);
- *k++ = (ltmp & 0xff0000ff) | (rtmp & 0x00ffff00);
- }
- }
- return (0);
-}
diff --git a/libdes/f_tables.c b/libdes/f_tables.c
deleted file mode 100644
index 396c7a8..0000000
--- a/libdes/f_tables.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 1990 Dennis Ferguson. All rights reserved.
- *
- * Commercial use is permitted only if products which are derived from
- * or include this software are made available for purchase and/or use
- * in Canada. Otherwise, redistribution and use in source and binary
- * forms are permitted.
- */
-
-/*
- * des_tables.c - precomputed tables used for the DES cipher function
- */
-
-/*
- * Include the header file so something will complain if the
- * declarations get out of sync
- */
-#include "f_tables.h"
-
-/*
- * These tables may be declared const if you want. Many compilers
- * don't support this, though.
- */
-
-/*
- * The DES algorithm which uses these is intended to be fairly speedy
- * at the expense of some memory. All the standard hacks are used.
- * The S boxes and the P permutation are precomputed into one table.
- * The E box never actually appears explicitly since it is easy to apply
- * this algorithmically as needed. The initial permutation and final
- * (inverse initial) permutation are computed from tables designed to
- * permute one byte at a time. This should run pretty fast on machines
- * with 32 bit words and bit field/multiple bit shift instructions which
- * are fast.
- */
-
-/*
- * The initial permutation array. This is used to compute both the
- * left and the right halves of the initial permutation using bytes
- * from words made from the following operations:
- *
- * ((left & 0x55555555) << 1) | (right & 0x55555555) for left half
- * (left & 0xaaaaaaaa) | ((right & 0xaaaaaaaa) >> 1) for right half
- *
- * The scheme is that we index into the table using each byte. The
- * result from the high order byte is or'd with the result from the
- * next byte shifted left once is or'd with the result from the next
- * byte shifted left twice if or'd with the result from the low order
- * byte shifted left by three. Clear?
- */
-
-unsigned long des_IP_table[256] = {
- 0x00000000, 0x00000010, 0x00000001, 0x00000011,
- 0x00001000, 0x00001010, 0x00001001, 0x00001011,
- 0x00000100, 0x00000110, 0x00000101, 0x00000111,
- 0x00001100, 0x00001110, 0x00001101, 0x00001111,
- 0x00100000, 0x00100010, 0x00100001, 0x00100011,
- 0x00101000, 0x00101010, 0x00101001, 0x00101011,
- 0x00100100, 0x00100110, 0x00100101, 0x00100111,
- 0x00101100, 0x00101110, 0x00101101, 0x00101111,
- 0x00010000, 0x00010010, 0x00010001, 0x00010011,
- 0x00011000, 0x00011010, 0x00011001, 0x00011011,
- 0x00010100, 0x00010110, 0x00010101, 0x00010111,
- 0x00011100, 0x00011110, 0x00011101, 0x00011111,
- 0x00110000, 0x00110010, 0x00110001, 0x00110011,
- 0x00111000, 0x00111010, 0x00111001, 0x00111011,
- 0x00110100, 0x00110110, 0x00110101, 0x00110111,
- 0x00111100, 0x00111110, 0x00111101, 0x00111111,
- 0x10000000, 0x10000010, 0x10000001, 0x10000011,
- 0x10001000, 0x10001010, 0x10001001, 0x10001011,
- 0x10000100, 0x10000110, 0x10000101, 0x10000111,
- 0x10001100, 0x10001110, 0x10001101, 0x10001111,
- 0x10100000, 0x10100010, 0x10100001, 0x10100011,
- 0x10101000, 0x10101010, 0x10101001, 0x10101011,
- 0x10100100, 0x10100110, 0x10100101, 0x10100111,
- 0x10101100, 0x10101110, 0x10101101, 0x10101111,
- 0x10010000, 0x10010010, 0x10010001, 0x10010011,
- 0x10011000, 0x10011010, 0x10011001, 0x10011011,
- 0x10010100, 0x10010110, 0x10010101, 0x10010111,
- 0x10011100, 0x10011110, 0x10011101, 0x10011111,
- 0x10110000, 0x10110010, 0x10110001, 0x10110011,
- 0x10111000, 0x10111010, 0x10111001, 0x10111011,
- 0x10110100, 0x10110110, 0x10110101, 0x10110111,
- 0x10111100, 0x10111110, 0x10111101, 0x10111111,
- 0x01000000, 0x01000010, 0x01000001, 0x01000011,
- 0x01001000, 0x01001010, 0x01001001, 0x01001011,
- 0x01000100, 0x01000110, 0x01000101, 0x01000111,
- 0x01001100, 0x01001110, 0x01001101, 0x01001111,
- 0x01100000, 0x01100010, 0x01100001, 0x01100011,
- 0x01101000, 0x01101010, 0x01101001, 0x01101011,
- 0x01100100, 0x01100110, 0x01100101, 0x01100111,
- 0x01101100, 0x01101110, 0x01101101, 0x01101111,
- 0x01010000, 0x01010010, 0x01010001, 0x01010011,
- 0x01011000, 0x01011010, 0x01011001, 0x01011011,
- 0x01010100, 0x01010110, 0x01010101, 0x01010111,
- 0x01011100, 0x01011110, 0x01011101, 0x01011111,
- 0x01110000, 0x01110010, 0x01110001, 0x01110011,
- 0x01111000, 0x01111010, 0x01111001, 0x01111011,
- 0x01110100, 0x01110110, 0x01110101, 0x01110111,
- 0x01111100, 0x01111110, 0x01111101, 0x01111111,
- 0x11000000, 0x11000010, 0x11000001, 0x11000011,
- 0x11001000, 0x11001010, 0x11001001, 0x11001011,
- 0x11000100, 0x11000110, 0x11000101, 0x11000111,
- 0x11001100, 0x11001110, 0x11001101, 0x11001111,
- 0x11100000, 0x11100010, 0x11100001, 0x11100011,
- 0x11101000, 0x11101010, 0x11101001, 0x11101011,
- 0x11100100, 0x11100110, 0x11100101, 0x11100111,
- 0x11101100, 0x11101110, 0x11101101, 0x11101111,
- 0x11010000, 0x11010010, 0x11010001, 0x11010011,
- 0x11011000, 0x11011010, 0x11011001, 0x11011011,
- 0x11010100, 0x11010110, 0x11010101, 0x11010111,
- 0x11011100, 0x11011110, 0x11011101, 0x11011111,
- 0x11110000, 0x11110010, 0x11110001, 0x11110011,
- 0x11111000, 0x11111010, 0x11111001, 0x11111011,
- 0x11110100, 0x11110110, 0x11110101, 0x11110111,
- 0x11111100, 0x11111110, 0x11111101, 0x11111111
-};
-
-/*
- * The final permutation array. Like the IP array, used
- * to compute both the left and right results from the bytes
- * of words computed from:
- *
- * ((left & 0x0f0f0f0f) << 4) | (right & 0x0f0f0f0f) for left result
- * (left & 0xf0f0f0f0) | ((right & 0xf0f0f0f0) >> 4) for right result
- *
- * The result from the high order byte is shifted left 6 bits and
- * or'd with the result from the next byte shifted left 4 bits, which
- * is or'd with the result from the next byte shifted left 2 bits,
- * which is or'd with the result from the low byte.
- */
-unsigned long des_FP_table[256] = {
- 0x00000000, 0x02000000, 0x00020000, 0x02020000,
- 0x00000200, 0x02000200, 0x00020200, 0x02020200,
- 0x00000002, 0x02000002, 0x00020002, 0x02020002,
- 0x00000202, 0x02000202, 0x00020202, 0x02020202,
- 0x01000000, 0x03000000, 0x01020000, 0x03020000,
- 0x01000200, 0x03000200, 0x01020200, 0x03020200,
- 0x01000002, 0x03000002, 0x01020002, 0x03020002,
- 0x01000202, 0x03000202, 0x01020202, 0x03020202,
- 0x00010000, 0x02010000, 0x00030000, 0x02030000,
- 0x00010200, 0x02010200, 0x00030200, 0x02030200,
- 0x00010002, 0x02010002, 0x00030002, 0x02030002,
- 0x00010202, 0x02010202, 0x00030202, 0x02030202,
- 0x01010000, 0x03010000, 0x01030000, 0x03030000,
- 0x01010200, 0x03010200, 0x01030200, 0x03030200,
- 0x01010002, 0x03010002, 0x01030002, 0x03030002,
- 0x01010202, 0x03010202, 0x01030202, 0x03030202,
- 0x00000100, 0x02000100, 0x00020100, 0x02020100,
- 0x00000300, 0x02000300, 0x00020300, 0x02020300,
- 0x00000102, 0x02000102, 0x00020102, 0x02020102,
- 0x00000302, 0x02000302, 0x00020302, 0x02020302,
- 0x01000100, 0x03000100, 0x01020100, 0x03020100,
- 0x01000300, 0x03000300, 0x01020300, 0x03020300,
- 0x01000102, 0x03000102, 0x01020102, 0x03020102,
- 0x01000302, 0x03000302, 0x01020302, 0x03020302,
- 0x00010100, 0x02010100, 0x00030100, 0x02030100,
- 0x00010300, 0x02010300, 0x00030300, 0x02030300,
- 0x00010102, 0x02010102, 0x00030102, 0x02030102,
- 0x00010302, 0x02010302, 0x00030302, 0x02030302,
- 0x01010100, 0x03010100, 0x01030100, 0x03030100,
- 0x01010300, 0x03010300, 0x01030300, 0x03030300,
- 0x01010102, 0x03010102, 0x01030102, 0x03030102,
- 0x01010302, 0x03010302, 0x01030302, 0x03030302,
- 0x00000001, 0x02000001, 0x00020001, 0x02020001,
- 0x00000201, 0x02000201, 0x00020201, 0x02020201,
- 0x00000003, 0x02000003, 0x00020003, 0x02020003,
- 0x00000203, 0x02000203, 0x00020203, 0x02020203,
- 0x01000001, 0x03000001, 0x01020001, 0x03020001,
- 0x01000201, 0x03000201, 0x01020201, 0x03020201,
- 0x01000003, 0x03000003, 0x01020003, 0x03020003,
- 0x01000203, 0x03000203, 0x01020203, 0x03020203,
- 0x00010001, 0x02010001, 0x00030001, 0x02030001,
- 0x00010201, 0x02010201, 0x00030201, 0x02030201,
- 0x00010003, 0x02010003, 0x00030003, 0x02030003,
- 0x00010203, 0x02010203, 0x00030203, 0x02030203,
- 0x01010001, 0x03010001, 0x01030001, 0x03030001,
- 0x01010201, 0x03010201, 0x01030201, 0x03030201,
- 0x01010003, 0x03010003, 0x01030003, 0x03030003,
- 0x01010203, 0x03010203, 0x01030203, 0x03030203,
- 0x00000101, 0x02000101, 0x00020101, 0x02020101,
- 0x00000301, 0x02000301, 0x00020301, 0x02020301,
- 0x00000103, 0x02000103, 0x00020103, 0x02020103,
- 0x00000303, 0x02000303, 0x00020303, 0x02020303,
- 0x01000101, 0x03000101, 0x01020101, 0x03020101,
- 0x01000301, 0x03000301, 0x01020301, 0x03020301,
- 0x01000103, 0x03000103, 0x01020103, 0x03020103,
- 0x01000303, 0x03000303, 0x01020303, 0x03020303,
- 0x00010101, 0x02010101, 0x00030101, 0x02030101,
- 0x00010301, 0x02010301, 0x00030301, 0x02030301,
- 0x00010103, 0x02010103, 0x00030103, 0x02030103,
- 0x00010303, 0x02010303, 0x00030303, 0x02030303,
- 0x01010101, 0x03010101, 0x01030101, 0x03030101,
- 0x01010301, 0x03010301, 0x01030301, 0x03030301,
- 0x01010103, 0x03010103, 0x01030103, 0x03030103,
- 0x01010303, 0x03010303, 0x01030303, 0x03030303
-};
-
-
-/*
- * The SP table is actually the S boxes and the P permutation
- * table combined. This table is actually reordered from the
- * spec, to match the order of key application we follow.
- */
-unsigned long des_SP_table[8][64] = {
- 0x00100000, 0x02100001, 0x02000401, 0x00000000, /* 7 */
- 0x00000400, 0x02000401, 0x00100401, 0x02100400,
- 0x02100401, 0x00100000, 0x00000000, 0x02000001,
- 0x00000001, 0x02000000, 0x02100001, 0x00000401,
- 0x02000400, 0x00100401, 0x00100001, 0x02000400,
- 0x02000001, 0x02100000, 0x02100400, 0x00100001,
- 0x02100000, 0x00000400, 0x00000401, 0x02100401,
- 0x00100400, 0x00000001, 0x02000000, 0x00100400,
- 0x02000000, 0x00100400, 0x00100000, 0x02000401,
- 0x02000401, 0x02100001, 0x02100001, 0x00000001,
- 0x00100001, 0x02000000, 0x02000400, 0x00100000,
- 0x02100400, 0x00000401, 0x00100401, 0x02100400,
- 0x00000401, 0x02000001, 0x02100401, 0x02100000,
- 0x00100400, 0x00000000, 0x00000001, 0x02100401,
- 0x00000000, 0x00100401, 0x02100000, 0x00000400,
- 0x02000001, 0x02000400, 0x00000400, 0x00100001,
-
- 0x00808200, 0x00000000, 0x00008000, 0x00808202, /* 1 */
- 0x00808002, 0x00008202, 0x00000002, 0x00008000,
- 0x00000200, 0x00808200, 0x00808202, 0x00000200,
- 0x00800202, 0x00808002, 0x00800000, 0x00000002,
- 0x00000202, 0x00800200, 0x00800200, 0x00008200,
- 0x00008200, 0x00808000, 0x00808000, 0x00800202,
- 0x00008002, 0x00800002, 0x00800002, 0x00008002,
- 0x00000000, 0x00000202, 0x00008202, 0x00800000,
- 0x00008000, 0x00808202, 0x00000002, 0x00808000,
- 0x00808200, 0x00800000, 0x00800000, 0x00000200,
- 0x00808002, 0x00008000, 0x00008200, 0x00800002,
- 0x00000200, 0x00000002, 0x00800202, 0x00008202,
- 0x00808202, 0x00008002, 0x00808000, 0x00800202,
- 0x00800002, 0x00000202, 0x00008202, 0x00808200,
- 0x00000202, 0x00800200, 0x00800200, 0x00000000,
- 0x00008002, 0x00008200, 0x00000000, 0x00808002,
-
- 0x00000104, 0x04010100, 0x00000000, 0x04010004, /* 3 */
- 0x04000100, 0x00000000, 0x00010104, 0x04000100,
- 0x00010004, 0x04000004, 0x04000004, 0x00010000,
- 0x04010104, 0x00010004, 0x04010000, 0x00000104,
- 0x04000000, 0x00000004, 0x04010100, 0x00000100,
- 0x00010100, 0x04010000, 0x04010004, 0x00010104,
- 0x04000104, 0x00010100, 0x00010000, 0x04000104,
- 0x00000004, 0x04010104, 0x00000100, 0x04000000,
- 0x04010100, 0x04000000, 0x00010004, 0x00000104,
- 0x00010000, 0x04010100, 0x04000100, 0x00000000,
- 0x00000100, 0x00010004, 0x04010104, 0x04000100,
- 0x04000004, 0x00000100, 0x00000000, 0x04010004,
- 0x04000104, 0x00010000, 0x04000000, 0x04010104,
- 0x00000004, 0x00010104, 0x00010100, 0x04000004,
- 0x04010000, 0x04000104, 0x00000104, 0x04010000,
- 0x00010104, 0x00000004, 0x04010004, 0x00010100,
-
- 0x00000080, 0x01040080, 0x01040000, 0x21000080, /* 5 */
- 0x00040000, 0x00000080, 0x20000000, 0x01040000,
- 0x20040080, 0x00040000, 0x01000080, 0x20040080,
- 0x21000080, 0x21040000, 0x00040080, 0x20000000,
- 0x01000000, 0x20040000, 0x20040000, 0x00000000,
- 0x20000080, 0x21040080, 0x21040080, 0x01000080,
- 0x21040000, 0x20000080, 0x00000000, 0x21000000,
- 0x01040080, 0x01000000, 0x21000000, 0x00040080,
- 0x00040000, 0x21000080, 0x00000080, 0x01000000,
- 0x20000000, 0x01040000, 0x21000080, 0x20040080,
- 0x01000080, 0x20000000, 0x21040000, 0x01040080,
- 0x20040080, 0x00000080, 0x01000000, 0x21040000,
- 0x21040080, 0x00040080, 0x21000000, 0x21040080,
- 0x01040000, 0x00000000, 0x20040000, 0x21000000,
- 0x00040080, 0x01000080, 0x20000080, 0x00040000,
- 0x00000000, 0x20040000, 0x01040080, 0x20000080,
-
- 0x80401000, 0x80001040, 0x80001040, 0x00000040, /* 4 */
- 0x00401040, 0x80400040, 0x80400000, 0x80001000,
- 0x00000000, 0x00401000, 0x00401000, 0x80401040,
- 0x80000040, 0x00000000, 0x00400040, 0x80400000,
- 0x80000000, 0x00001000, 0x00400000, 0x80401000,
- 0x00000040, 0x00400000, 0x80001000, 0x00001040,
- 0x80400040, 0x80000000, 0x00001040, 0x00400040,
- 0x00001000, 0x00401040, 0x80401040, 0x80000040,
- 0x00400040, 0x80400000, 0x00401000, 0x80401040,
- 0x80000040, 0x00000000, 0x00000000, 0x00401000,
- 0x00001040, 0x00400040, 0x80400040, 0x80000000,
- 0x80401000, 0x80001040, 0x80001040, 0x00000040,
- 0x80401040, 0x80000040, 0x80000000, 0x00001000,
- 0x80400000, 0x80001000, 0x00401040, 0x80400040,
- 0x80001000, 0x00001040, 0x00400000, 0x80401000,
- 0x00000040, 0x00400000, 0x00001000, 0x00401040,
-
- 0x10000008, 0x10200000, 0x00002000, 0x10202008, /* 6 */
- 0x10200000, 0x00000008, 0x10202008, 0x00200000,
- 0x10002000, 0x00202008, 0x00200000, 0x10000008,
- 0x00200008, 0x10002000, 0x10000000, 0x00002008,
- 0x00000000, 0x00200008, 0x10002008, 0x00002000,
- 0x00202000, 0x10002008, 0x00000008, 0x10200008,
- 0x10200008, 0x00000000, 0x00202008, 0x10202000,
- 0x00002008, 0x00202000, 0x10202000, 0x10000000,
- 0x10002000, 0x00000008, 0x10200008, 0x00202000,
- 0x10202008, 0x00200000, 0x00002008, 0x10000008,
- 0x00200000, 0x10002000, 0x10000000, 0x00002008,
- 0x10000008, 0x10202008, 0x00202000, 0x10200000,
- 0x00202008, 0x10202000, 0x00000000, 0x10200008,
- 0x00000008, 0x00002000, 0x10200000, 0x00202008,
- 0x00002000, 0x00200008, 0x10002008, 0x00000000,
- 0x10202000, 0x10000000, 0x00200008, 0x10002008,
-
- 0x08000820, 0x00000800, 0x00020000, 0x08020820, /* 8 */
- 0x08000000, 0x08000820, 0x00000020, 0x08000000,
- 0x00020020, 0x08020000, 0x08020820, 0x00020800,
- 0x08020800, 0x00020820, 0x00000800, 0x00000020,
- 0x08020000, 0x08000020, 0x08000800, 0x00000820,
- 0x00020800, 0x00020020, 0x08020020, 0x08020800,
- 0x00000820, 0x00000000, 0x00000000, 0x08020020,
- 0x08000020, 0x08000800, 0x00020820, 0x00020000,
- 0x00020820, 0x00020000, 0x08020800, 0x00000800,
- 0x00000020, 0x08020020, 0x00000800, 0x00020820,
- 0x08000800, 0x00000020, 0x08000020, 0x08020000,
- 0x08020020, 0x08000000, 0x00020000, 0x08000820,
- 0x00000000, 0x08020820, 0x00020020, 0x08000020,
- 0x08020000, 0x08000800, 0x08000820, 0x00000000,
- 0x08020820, 0x00020800, 0x00020800, 0x00000820,
- 0x00000820, 0x00020020, 0x08000000, 0x08020800,
-
- 0x40084010, 0x40004000, 0x00004000, 0x00084010, /* 2 */
- 0x00080000, 0x00000010, 0x40080010, 0x40004010,
- 0x40000010, 0x40084010, 0x40084000, 0x40000000,
- 0x40004000, 0x00080000, 0x00000010, 0x40080010,
- 0x00084000, 0x00080010, 0x40004010, 0x00000000,
- 0x40000000, 0x00004000, 0x00084010, 0x40080000,
- 0x00080010, 0x40000010, 0x00000000, 0x00084000,
- 0x00004010, 0x40084000, 0x40080000, 0x00004010,
- 0x00000000, 0x00084010, 0x40080010, 0x00080000,
- 0x40004010, 0x40080000, 0x40084000, 0x00004000,
- 0x40080000, 0x40004000, 0x00000010, 0x40084010,
- 0x00084010, 0x00000010, 0x00004000, 0x40000000,
- 0x00004010, 0x40084000, 0x00080000, 0x40000010,
- 0x00080010, 0x40004010, 0x40000010, 0x00080010,
- 0x00084000, 0x00000000, 0x40004000, 0x00004010,
- 0x40000000, 0x40080010, 0x40084010, 0x00084000
-};
diff --git a/libdes/f_tables.h b/libdes/f_tables.h
deleted file mode 100644
index db9cbb9..0000000
--- a/libdes/f_tables.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (c) 1990 Dennis Ferguson. All rights reserved.
- *
- * Commercial use is permitted only if products which are derived from
- * or include this software are made available for purchase and/or use
- * in Canada. Otherwise, redistribution and use in source and binary
- * forms are permitted.
- */
-
-/*
- * des_tables.h - declarations to import the DES tables, used internally
- * by some of the library routines.
- */
-#ifndef __DES_TABLES_H__
-#define __DES_TABLES_H__ /* nothing */
-
-/*
- * These may be declared const if you wish. Be sure to change the
- * declarations in des_tables.c as well.
- */
-extern unsigned long des_IP_table[256];
-extern unsigned long des_FP_table[256];
-extern unsigned long des_SP_table[8][64];
-
-/*
- * Use standard shortforms to reference these to save typing
- */
-#define IP des_IP_table
-#define FP des_FP_table
-#define SP des_SP_table
-
-/*
- * Code to do a DES round using the tables. Note that the E expansion
- * is easy to compute algorithmically, especially if done out-of-order.
- * Take a look at its form and compare it to everything involving temp
- * below. Since SP[0-7] don't have any bits in common set it is okay
- * to do the successive xor's.
- *
- * Note too that the SP table has been reordered to match the order of
- * the keys (if the original order of SP was 12345678, the reordered
- * table is 71354682). This is unnecessary, but was done since some
- * compilers seem to like you going through the matrix from beginning
- * to end.
- *
- * There is a difference in the best way to do this depending on whether
- * one is encrypting or decrypting. If encrypting we move forward through
- * the keys and hence should move forward through the table. If decrypting
- * we go back. Part of the need for this comes from trying to emulate
- * existing software which generates a single key schedule and uses it
- * both for encrypting and decrypting. Generating separate encryption
- * and decryption key schedules would allow one to use the same code
- * for both.
- *
- * left, right and temp should be unsigned long values. left and right
- * should be the high and low order parts of the cipher block at the
- * current stage of processing (this makes sense if you read the spec).
- * kp should be an unsigned long pointer which points at the current
- * set of subkeys in the key schedule. It is advanced to the next set
- * (i.e. by 8 bytes) when this is done.
- *
- * This occurs in the innermost loop of the DES function. The four
- * variables should really be in registers.
- *
- * When using this, the inner loop of the DES function might look like:
- *
- * for (i = 0; i < 8; i++) {
- * DES_SP_{EN,DE}CRYPT_ROUND(left, right, temp, kp);
- * DES_SP_{EN,DE}CRYPT_ROUND(right, left, temp, kp);
- * }
- *
- * Note the trick above. You are supposed to do 16 rounds, swapping
- * left and right at the end of each round. By doing two rounds at
- * a time and swapping left and right in the code we can avoid the
- * swaps altogether.
- */
-#define DES_SP_ENCRYPT_ROUND(left, right, temp, kp) \
- (temp) = (((right) >> 11) | ((right) << 21)) ^ *(kp)++; \
- (left) ^= SP[0][((temp) >> 24) & 0x3f] \
- | SP[1][((temp) >> 16) & 0x3f] \
- | SP[2][((temp) >> 8) & 0x3f] \
- | SP[3][((temp) ) & 0x3f]; \
- (temp) = (((right) >> 23) | ((right) << 9)) ^ *(kp)++; \
- (left) ^= SP[4][((temp) >> 24) & 0x3f] \
- | SP[5][((temp) >> 16) & 0x3f] \
- | SP[6][((temp) >> 8) & 0x3f] \
- | SP[7][((temp) ) & 0x3f]
-
-#define DES_SP_DECRYPT_ROUND(left, right, temp, kp) \
- (temp) = (((right) >> 23) | ((right) << 9)) ^ *(--(kp)); \
- (left) ^= SP[7][((temp) ) & 0x3f] \
- | SP[6][((temp) >> 8) & 0x3f] \
- | SP[5][((temp) >> 16) & 0x3f] \
- | SP[4][((temp) >> 24) & 0x3f]; \
- (temp) = (((right) >> 11) | ((right) << 21)) ^ *(--(kp)); \
- (left) ^= SP[3][((temp) ) & 0x3f] \
- | SP[2][((temp) >> 8) & 0x3f] \
- | SP[1][((temp) >> 16) & 0x3f] \
- | SP[0][((temp) >> 24) & 0x3f]
-
-/*
- * Macros to help deal with the initial permutation table. Note
- * the IP table only deals with 32 bits at a time, allowing us to
- * collect the bits we need to deal with each half into an unsigned
- * long. By carefully selecting how the bits are ordered we also
- * take advantages of symmetries in the table so that we can use a
- * single table to compute the permutation of all bytes. This sounds
- * complicated, but if you go through the process of designing the
- * table you'll find the symmetries fall right out.
- *
- * The follow macros compute the set of bits used to index the
- * table for produce the left and right permuted result.
- */
-#define DES_IP_LEFT_BITS(left, right) \
- ((((left) & 0x55555555) << 1) | ((right) & 0x55555555))
-#define DES_IP_RIGHT_BITS(left, right) \
- (((left) & 0xaaaaaaaa) | (((right) & 0xaaaaaaaa) >> 1))
-
-/*
- * The following macro does an in-place initial permutation given
- * the current left and right parts of the block and a single
- * temporary. Use this more as a guide for rolling your own, though.
- * The best way to do the IP depends on the form of the data you
- * are dealing with. If you use this, though, try to make left,
- * right and temp register unsigned longs.
- */
-#define DES_INITIAL_PERM(left, right, temp) \
- (temp) = DES_IP_RIGHT_BITS((left), (right)); \
- (right) = DES_IP_LEFT_BITS((left), (right)); \
- (left) = IP[((right) >> 24) & 0xff] \
- | (IP[((right) >> 16) & 0xff] << 1) \
- | (IP[((right) >> 8) & 0xff] << 2) \
- | (IP[(right) & 0xff] << 3); \
- (right) = IP[((temp) >> 24) & 0xff] \
- | (IP[((temp) >> 16) & 0xff] << 1) \
- | (IP[((temp) >> 8) & 0xff] << 2) \
- | (IP[(temp) & 0xff] << 3)
-
-
-/*
- * Now the final permutation stuff. The same comments apply to
- * this as to the initial permutation, except that we use different
- * bits and shifts.
- */
-#define DES_FP_LEFT_BITS(left, right) \
- ((((left) & 0x0f0f0f0f) << 4) | ((right) & 0x0f0f0f0f))
-#define DES_FP_RIGHT_BITS(left, right) \
- (((left) & 0xf0f0f0f0) | (((right) & 0xf0f0f0f0) >> 4))
-
-
-/*
- * Here is a sample final permutation. Note that there is a trick
- * here. DES requires swapping the left and right parts after the
- * last cipher round but before the final permutation. We do this
- * swapping internally, which is why left and right are confused
- * at the beginning.
- */
-#define DES_FINAL_PERM(left, right, temp) \
- (temp) = DES_FP_RIGHT_BITS((right), (left)); \
- (right) = DES_FP_LEFT_BITS((right), (left)); \
- (left) = (FP[((right) >> 24) & 0xff] << 6) \
- | (FP[((right) >> 16) & 0xff] << 4) \
- | (FP[((right) >> 8) & 0xff] << 2) \
- | FP[(right) & 0xff]; \
- (right) = (FP[((temp) >> 24) & 0xff] << 6) \
- | (FP[((temp) >> 16) & 0xff] << 4) \
- | (FP[((temp) >> 8) & 0xff] << 2) \
- | FP[temp & 0xff]
-
-
-/*
- * Finally, as a sample of how all this might be held together, the
- * following two macros do in-place encryptions and decryptions. left
- * and right are two unsigned long variables which at the beginning
- * are expected to hold the clear (encrypted) block in host byte order
- * (left the high order four bytes, right the low order). At the end
- * they will contain the encrypted (clear) block. temp is an unsigned long
- * used as a temporary. kp is an unsigned long pointer pointing at
- * the start of the key schedule. All these should be in registers.
- *
- * You can probably do better than these by rewriting for particular
- * situations. These aren't bad, though.
- */
-#define DES_DO_ENCRYPT(left, right, temp, kp) \
- do { \
- register int i; \
- DES_INITIAL_PERM((left), (right), (temp)); \
- for (i = 0; i < 8; i++) { \
- DES_SP_ENCRYPT_ROUND((left), (right), (temp), (kp)); \
- DES_SP_ENCRYPT_ROUND((right), (left), (temp), (kp)); \
- } \
- DES_FINAL_PERM((left), (right), (temp)); \
- (kp) -= (2 * 16); \
- } while (0)
-
-#define DES_DO_DECRYPT(left, right, temp, kp) \
- do { \
- register int i; \
- DES_INITIAL_PERM((left), (right), (temp)); \
- (kp) += (2 * 16); \
- for (i = 0; i < 8; i++) { \
- DES_SP_DECRYPT_ROUND((left), (right), (temp), (kp)); \
- DES_SP_DECRYPT_ROUND((right), (left), (temp), (kp)); \
- } \
- DES_FINAL_PERM((left), (right), (temp)); \
- } while (0)
-
-/*
- * These are handy dandy utility thingies for straightening out bytes.
- * Included here because they're used a couple of places.
- */
-#define GET_HALF_BLOCK(lr, ip) \
- (lr) = ((u_int32)(*(ip)++)) << 24; \
- (lr) |= ((u_int32)(*(ip)++)) << 16; \
- (lr) |= ((u_int32)(*(ip)++)) << 8; \
- (lr) |= (u_int32)(*(ip)++)
-
-#define PUT_HALF_BLOCK(lr, op) \
- *(op)++ = ((lr) >> 24) & 0xff; \
- *(op)++ = ((lr) >> 16) & 0xff; \
- *(op)++ = ((lr) >> 8) & 0xff; \
- *(op)++ = (lr) & 0xff
-
-#endif /* __DES_TABLES_H__ */
diff --git a/libdes/key_sched.c b/libdes/key_sched.c
deleted file mode 100644
index 04fc12b..0000000
--- a/libdes/key_sched.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * This routine computes the DES key schedule given a key. The
- * permutations and shifts have been done at compile time, resulting
- * in a direct one-step mapping from the input key to the key
- * schedule.
- *
- * Also checks parity and weak keys.
- *
- * Watch out for the subscripts -- most effectively start at 1 instead
- * of at zero. Maybe some bugs in that area.
- *
- * DON'T change the data types for arrays and such, or it will either
- * break or run slower. This was optimized for Uvax2.
- *
- * In case the user wants to cache the computed key schedule, it is
- * passed as an arg. Also implies that caller has explicit control
- * over zeroing both the key schedule and the key.
- *
- * All registers labeled imply Vax using the Ultrix or 4.2bsd compiler.
- *
- * Originally written 6/85 by Steve Miller, MIT Project Athena.
- */
-
-#ifndef lint
-static char rcsid_key_sched_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-#include <stdio.h>
-#include "des.h"
-
-int
-des_key_sched(k,schedule)
- register des_cblock k;
- des_key_schedule schedule;
-{
- if (!des_check_key_parity(k)) /* bad parity --> return -1 */
- return(-1);
-
- /* check against weak keys */
- if (des_is_weak_key(k))
- return(-2);
-
- make_key_sched(k,schedule);
-
- /* if key was good, return 0 */
- return 0;
-}
diff --git a/libdes/new_rnd_key.c b/libdes/new_rnd_key.c
deleted file mode 100644
index 4ee0218..0000000
--- a/libdes/new_rnd_key.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * New pseudo-random key generator, using DES encryption to make the
- * pseudo-random cycle as hard to break as DES.
- *
- * Written by Mark Lillibridge, MIT Project Athena
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- */
-
-#ifndef lint
-static char rcsid_new_rnd_key_c[] =
- "$Id";
-#endif
-
-#include <mit-copyright.h>
-
-#include <des.h>
-#include <time.h>
-#include <time.h>
-#include <sys/time.h>
-
-extern void des_fixup_key_parity();
-extern int des_is_weak_key();
-
-void des_set_random_generator_seed(), des_set_sequence_number();
-void des_generate_random_block();
-
-/*
- * des_new_random_key: create a random des key
- *
- * Requires: des_set_random_number_generater_seed must be at called least
- * once before this routine is called.
- *
- * Notes: the returned key has correct parity and is guarenteed not
- * to be a weak des key. Des_generate_random_block is used to
- * provide the random bits.
- */
-int
-des_new_random_key(key)
- des_cblock key;
-{
- do {
- des_generate_random_block(key);
- des_fixup_key_parity(key);
- } while (des_is_weak_key(key));
-
- return(0);
-}
-
-/*
- * des_init_random_number_generator:
- *
- * This routine takes a secret key possibly shared by a number
- * of servers and uses it to generate a random number stream that is
- * not shared by any of the other servers. It does this by using the current
- * process id, host id, and the current time to the nearest second. The
- * resulting stream seed is not useful information for cracking the secret
- * key. Moreover, this routine keeps no copy of the secret key.
- * This routine is used for example, by the kerberos server(s) with the
- * key in question being the kerberos master key.
- *
- * Note: this routine calls des_set_random_generator_seed.
- */
-
-void des_init_random_number_generator(key)
- des_cblock key;
-{
- struct { /* This must be 64 bits exactly */
- long process_id;
- long host_id;
- } seed;
- struct timeval time; /* this must also be 64 bits exactly */
- des_cblock new_key;
-
- /*
- * use a host id and process id in generating the seed to ensure
- * that different servers have different streams:
- */
- seed.process_id = getpid();
-#if !defined(SOLARIS)
- seed.host_id = gethostid();
-#endif
-
- /*
- * Generate a tempory value that depends on the key, host_id, and
- * process_id such that it gives no useful information about the key:
- */
- des_set_random_generator_seed(key);
- des_set_sequence_number((unsigned char *)&seed);
- des_new_random_key(new_key);
-
- /*
- * use it to select a random stream:
- */
- des_set_random_generator_seed(new_key);
-
- /*
- * use a time stamp to ensure that a server started later does not reuse
- * an old stream:
- */
- gettimeofday(&time, (struct timezone *)0);
- des_set_sequence_number((unsigned char *)&time);
-
- /*
- * use the time stamp finally to select the final seed using the
- * current random number stream:
- */
- des_new_random_key(new_key);
- des_set_random_generator_seed(new_key);
-}
-
-
-/*
- * This module implements a random number generator faculty such that the next
- * number in any random number stream is very hard to predict without knowing
- * the seed for that stream even given the preceeding random numbers.
- */
-
-/*
- * The secret des key schedule for the current stream of random numbers:
- */
-static des_key_schedule random_sequence_key;
-
-/*
- * The sequence # in the current stream of random numbers:
- */
-static unsigned char sequence_number[8];
-
-/*
- * des_set_random_generator_seed: this routine is used to select a random
- * number stream. The stream that results is
- * totally determined by the passed in key.
- * (I.e., calling this routine again with the
- * same key allows repeating a sequence of
- * random numbers)
- *
- * Requires: key is a valid des key. I.e., has correct parity and is not a
- * weak des key.
- */
-void
-des_set_random_generator_seed(key)
- des_cblock key;
-{
- register int i;
-
- /* select the new stream: (note errors are not possible here...) */
- des_key_sched(key, random_sequence_key);
-
- /* "seek" to the start of the stream: */
- for (i=0; i<8; i++)
- sequence_number[i] = 0;
-}
-
-/*
- * des_set_sequence_number: this routine is used to set the sequence number
- * of the current random number stream. This routine
- * may be used to "seek" within the current random
- * number stream.
- *
- * Note that des_set_random_generator_seed resets the sequence number to 0.
- */
-void
-des_set_sequence_number(new_sequence_number)
- des_cblock new_sequence_number;
-{
- memcpy((char *)sequence_number,
- (char *)new_sequence_number,
- sizeof(sequence_number));
-}
-
-/*
- * des_generate_random_block: routine to return the next random number
- * from the current random number stream.
- * The returned number is 64 bits long.
- *
- * Requires: des_set_random_generator_seed must have been called at least once
- * before this routine is called.
- */
-void des_generate_random_block(block)
- des_cblock block;
-{
- int i;
-
- /*
- * Encrypt the sequence number to get the new random block:
- */
- des_ecb_encrypt(sequence_number, block, random_sequence_key, 1);
-
- /*
- * Increment the sequence number as an 8 byte unsigned number with wrap:
- * (using LSB here)
- */
- for (i=0; i<8; i++) {
- sequence_number[i] = (sequence_number[i] + 1) & 0xff;
- if (sequence_number[i])
- break;
- }
-}
diff --git a/libdes/quad_cksum.c b/libdes/quad_cksum.c
deleted file mode 100644
index 651e843..0000000
--- a/libdes/quad_cksum.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Quadratic Congruential Manipulation Dectection Code
- *
- * ref: "Message Authentication"
- * R.R. Jueneman, S. M. Matyas, C.H. Meyer
- * IEEE Communications Magazine,
- * Sept 1985 Vol 23 No 9 p 29-40
- *
- * This routine, part of the Athena DES library built for the Kerberos
- * authentication system, calculates a manipulation detection code for
- * a message. It is a much faster alternative to the DES-checksum
- * method. No guarantees are offered for its security. Refer to the
- * paper noted above for more information
- *
- * Implementation for 4.2bsd
- * by S.P. Miller Project Athena/MIT
- */
-
-/*
- * Algorithm (per paper):
- * define:
- * message to be composed of n m-bit blocks X1,...,Xn
- * optional secret seed S in block X1
- * MDC in block Xn+1
- * prime modulus N
- * accumulator Z
- * initial (secret) value of accumulator C
- * N, C, and S are known at both ends
- * C and , optionally, S, are hidden from the end users
- * then
- * (read array references as subscripts over time)
- * Z[0] = c;
- * for i = 1...n
- * Z[i] = (Z[i+1] + X[i])**2 modulo N
- * X[n+1] = Z[n] = MDC
- *
- * Then pick
- * N = 2**31 -1
- * m = 16
- * iterate 4 times over plaintext, also use Zn
- * from iteration j as seed for iteration j+1,
- * total MDC is then a 128 bit array of the four
- * Zn;
- *
- * return the last Zn and optionally, all
- * four as output args.
- *
- * Modifications:
- * To inhibit brute force searches of the seed space, this
- * implementation is modified to have
- * Z = 64 bit accumulator
- * C = 64 bit C seed
- * N = 2**63 - 1
- * S = S seed is not implemented here
- * arithmetic is not quite real double integer precision, since we
- * cant get at the carry or high order results from multiply,
- * but nontheless is 64 bit arithmetic.
- */
-
-#ifndef lint
-static char rcsid_quad_cksum_c[] =
- "$Id$";
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#include <mit-copyright.h>
-#include "des.h"
-
-/* Externals */
-extern int des_debug;
-
-/*** Routines ***************************************************** */
-
-unsigned long
-des_quad_cksum(in,out,length,out_count,c_seed)
- des_cblock c_seed; /* secret seed, 8 bytes */
- unsigned char *in; /* input block */
- u_int32 *out; /* optional longer output */
- int out_count; /* number of iterations */
- long length; /* original length in bytes */
-{
-
- /*
- * this routine both returns the low order of the final (last in
- * time) 32bits of the checksum, and if "out" is not a null
- * pointer, a longer version, up to entire 32 bytes of the
- * checksum is written unto the address pointed to.
- */
-
- register u_int32 z;
- register u_int32 z2;
- register u_int32 x;
- register u_int32 x2;
- register unsigned char *p;
- register long len;
- register int i;
-
- /* use all 8 bytes of seed */
-
- z = c_seed[0] +
- ((u_int32)c_seed[1] << 8) +
- ((u_int32)c_seed[2] << 16) +
- ((u_int32)c_seed[3] << 24);
-
- z2 = c_seed[4] +
- ((u_int32)c_seed[5] << 8) +
- ((u_int32)c_seed[6] << 16) +
- ((u_int32)c_seed[7] << 24);
-
- if (out == NULL)
- out_count = 1; /* default */
-
- /* This is repeated n times!! */
- for (i = 1; i <=4 && i<= out_count; i++) {
- len = length;
- p = in;
- while (len) {
- if (len > 1) {
- x = (z + p[0] + (p[1]<<8));
- p += 2;
- len -= 2;
- }
- else {
- x = (z + *(unsigned char *)p++);
- len = 0;
- }
- x2 = z2;
- z = ((x * x) + (x2 * x2)) % 0x7fffffff;
- z2 = (x * (x2+83653421)) % 0x7fffffff; /* modulo */
- if (des_debug & 8)
- printf("%d %d\n",z,z2);
- }
-
- if (out != NULL) {
- *out++ = z;
- *out++ = z2;
- }
- }
- /* return final z value as 32 bit version of checksum */
- return z;
-}
diff --git a/libdes/random_key.c b/libdes/random_key.c
deleted file mode 100644
index 8c20d85..0000000
--- a/libdes/random_key.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * These routines perform encryption and decryption using the DES
- * private key algorithm, or else a subset of it-- fewer inner loops.
- * ( AUTH_DES_ITER defaults to 16, may be less)
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * The key schedule is passed as an arg, as well as the cleartext or
- * ciphertext. The cleartext and ciphertext should be in host order.
- *
- * These routines form the library interface to the des facilities.
- *
- * spm 8/85 MIT project athena
- */
-
-#ifndef lint
-static char rcsid_random_key_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-#include <stdio.h>
-#include <time.h>
-#include <sys/time.h>
-
-#include <des.h>
-
-#ifdef USE_RAND48
-#define random lrand48
-#define srandom srand48
-#endif
-
-/* random_key */
-int
-des_random_key(key)
- des_cblock *key;
-{
- /*
- * create a random des key; should force odd parity per byte;
- * parity is bits 8,16,...64 in des order, implies 0, 8, 16, ...
- * vax order
- */
-
- register unsigned int temp;
- register int odd;
- register unsigned char *c = (unsigned char *) key;
- unsigned long *k = (unsigned long *) key;
- static long p = 0;
- static long n = 0;
-
- int i,j;
-
- static struct timeval time;
-
- if (!p) {
- p = getpid();
-#ifndef SOLARIS
- p ^= gethostid();
-#endif
- }
-
- (void) gettimeofday(&time,(struct timezone *)0);
- /* randomize start */
- srandom(time.tv_usec ^ time.tv_sec ^ p ^ n++);
-
- *k++ = random();
- *k = random();
-
- /* make each byte parity odd */
- for (i = 0; i <= 7; i++) {
- odd = 0;
- temp = (unsigned int) *c;
- /* ignore bit 0, lsb, it will be parity (on vax) */
- /* should do this with a table lookup */
- for (j = 0; j <= 6; j++) {
- temp = temp >> 1;
- odd ^= temp & 01;
- }
- /* set odd parity in lsb */
- if (!odd)
- *c |= 1;
- else
- *c &= ~1;
- c++;
- }
-
- return 0;
-}
diff --git a/libdes/read_password.c b/libdes/read_password.c
deleted file mode 100644
index 59ce622..0000000
--- a/libdes/read_password.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * This routine prints the supplied string to standard
- * output as a prompt, and reads a password string without
- * echoing.
- */
-
-#ifndef lint
-static char rcsid_read_password_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-#include <des.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <signal.h>
-#include <setjmp.h>
-
-#ifdef POSIX
-#include <termios.h>
-#else
-#include <sys/ioctl.h>
-#endif
-
-#ifdef POSIX
-typedef void sigtype;
-static sigjmp_buf env;
-#else
-typedef int sigtype;
-static jmp_buf env;
-#endif
-
-static sigtype sig_restore();
-static push_signals(), pop_signals();
-int des_read_pw_string();
-
-/*** Routines ****************************************************** */
-int
-des_read_password(k,prompt,verify)
- des_cblock *k;
- char *prompt;
- int verify;
-{
- int ok;
- char key_string[BUFSIZ];
-
-#ifdef POSIX
- if (sigsetjmp(env, 1)) {
- ok = -1;
- goto lose;
- }
-#else
- if (setjmp(env)) {
- ok = -1;
- goto lose;
- }
-#endif
-
- ok = des_read_pw_string(key_string, BUFSIZ, prompt, verify);
- if (ok == 0)
- des_string_to_key(key_string, k);
-
-lose:
- memset(key_string, 0, sizeof (key_string));
- return ok;
-}
-
-/*
- * This version just returns the string, doesn't map to key.
- *
- * Returns 0 on success, non-zero on failure.
- */
-
-int
-des_read_pw_string(s,max,prompt,verify)
- char *s;
- int max;
- char *prompt;
- int verify;
-{
- int ok = 0;
- char *ptr;
- char key_string[BUFSIZ];
-#ifdef POSIX
- sigjmp_buf old_env;
- struct termios tty_state;
-#else
- jmp_buf old_env;
- struct sgttyb tty_state;
-#endif
-
- if (max > BUFSIZ) {
- return -1;
- }
-
-#ifdef POSIX
- /* save terminal state */
- if (tcgetattr(0, &tty_state) == -1)
- return -1;
- /* Turn off echo */
- tty_state.c_lflag &= ~ECHO;
- if (tcsetattr(0, TCSANOW, &tty_state) == -1)
- return -1;
-
- memcpy((char *)env, (char *)old_env, sizeof(env));
- if (sigsetjmp(env, 1))
- goto lose;
-#else
- /* save terminal state*/
- if (ioctl(0,TIOCGETP,(char *)&tty_state) == -1)
- return -1;
- /* Turn off echo */
- tty_state.sg_flags &= ~ECHO;
- if (ioctl(0,TIOCSETP,(char *)&tty_state) == -1)
- return -1;
- memcpy((char *)env, (char *)old_env, sizeof(env));
- if (setjmp(env))
- goto lose;
-#endif
- push_signals();
-
- while (!ok) {
- (void) printf(prompt);
- (void) fflush(stdout);
-#ifdef CROSSMSDOS
- h19line(s,sizeof(s),0);
- if (!strlen(s))
- continue;
-#else
- if (!fgets(s, max, stdin)) {
- clearerr(stdin);
- continue;
- }
- if ((ptr = strchr(s, '\n')))
- *ptr = '\0';
-#endif
- if (verify) {
- printf("\nVerifying, please re-enter %s",prompt);
- (void) fflush(stdout);
-#ifdef CROSSMSDOS
- h19line(key_string,sizeof(key_string),0);
- if (!strlen(key_string))
- continue;
-#else
- if (!fgets(key_string, sizeof(key_string), stdin)) {
- clearerr(stdin);
- continue;
- }
- if ((ptr = strchr(key_string, '\n')))
- *ptr = '\0';
-#endif
- if (strcmp(s,key_string)) {
- printf("\n\07\07Mismatch - try again\n");
- (void) fflush(stdout);
- continue;
- }
- }
- ok = 1;
- }
-
-lose:
- if (!ok)
- memset(s, 0, max);
- printf("\n");
-#ifdef POSIX
- /* turn echo back on */
- tty_state.c_lflag |= ECHO;
- if (tcsetattr(0, TCSANOW, &tty_state))
- ok = 0;
-#else
- /* turn echo back on */
- tty_state.sg_flags |= ECHO;
- if (ioctl(0,TIOCSETP,(char *)&tty_state))
- ok = 0;
-#endif
- pop_signals();
- memcpy((char *)old_env, (char *)env, sizeof(env));
-
- if (verify)
- memset(key_string, 0, sizeof (key_string));
- s[max-1] = 0; /* force termination */
- return !ok; /* return nonzero if not okay */
-}
-
-#ifdef POSIX
-/* This can be static since we should never have more than one set saved... */
-static struct sigaction osa[NSIG];
-
-static push_signals()
-{
- register int i;
- struct sigaction nsa;
-
- sigemptyset(&nsa.sa_mask);
- nsa.sa_flags = 0;
- nsa.sa_handler = sig_restore;
-
- for (i=0; i<NSIG; i++)
- sigaction(i, &nsa, &osa[i]);
-}
-
-static pop_signals()
-{
- register int i;
- for (i=0; i<NSIG; i++)
- sigaction(i, &osa[i], (struct sigaction *)0);
-}
-
-static sigtype sig_restore()
-{
- siglongjmp(env, 1);
-}
-
-#else /* !POSIX */
-
-/* This can be static since we should never have more than one set saved... */
-static sigtype (*old_sigfunc[NSIG])();
-
-static push_signals()
-{
- register int i;
- for (i = 0; i < NSIG; i++)
- old_sigfunc[i] = signal(i,sig_restore);
-}
-
-static pop_signals()
-{
- register int i;
- for (i = 0; i < NSIG; i++)
- (void) signal(i,old_sigfunc[i]);
-}
-
-static sigtype
-sig_restore()
-{
- longjmp(env,1);
-}
-
-#endif /* POSIX */
diff --git a/libdes/string_to_key.c b/libdes/string_to_key.c
deleted file mode 100644
index 752de8a..0000000
--- a/libdes/string_to_key.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1985, 1986, 1987, 1988, 1989 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * These routines perform encryption and decryption using the DES
- * private key algorithm, or else a subset of it-- fewer inner loops.
- * (AUTH_DES_ITER defaults to 16, may be less.)
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * The key schedule is passed as an arg, as well as the cleartext or
- * ciphertext. The cleartext and ciphertext should be in host order.
- *
- * These routines form the library interface to the DES facilities.
- *
- * spm 8/85 MIT project athena
- */
-
-#ifndef lint
-static char rcsid_string_to_key_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-#include <stdio.h>
-#include <des.h>
-
-extern int des_debug;
-extern int des_debug_print();
-extern void des_fixup_key_parity();
-
-/*
- * convert an arbitrary length string to a DES key
- */
-int
-des_string_to_key(str,key)
- char *str;
- register des_cblock *key;
-{
- register char *in_str;
- register unsigned temp,i;
- register int j;
- register long length;
- static unsigned char *k_p;
- static int forward;
- register char *p_char;
- static char k_char[64];
- static des_key_schedule key_sked;
- extern unsigned long des_cbc_cksum();
-
- in_str = str;
- forward = 1;
- p_char = k_char;
- length = strlen(str);
-
- /* init key array for bits */
- memset(k_char, 0, sizeof(k_char));
-
-#ifdef DEBUG
- if (des_debug)
- fprintf(stdout,
- "\n\ninput str length = %d string = %s\nstring = 0x ",
- length,str);
-#endif
-
- /* get next 8 bytes, strip parity, xor */
- for (i = 1; i <= length; i++) {
- /* get next input key byte */
- temp = (unsigned int) *str++;
-#ifdef DEBUG
- if (des_debug)
- fprintf(stdout,"%02x ",temp & 0xff);
-#endif
- /* loop through bits within byte, ignore parity */
- for (j = 0; j <= 6; j++) {
- if (forward)
- *p_char++ ^= (int) temp & 01;
- else
- *--p_char ^= (int) temp & 01;
- temp = temp >> 1;
- } while (--j > 0);
-
- /* check and flip direction */
- if ((i%8) == 0)
- forward = !forward;
- }
-
- /* now stuff into the key des_cblock, and force odd parity */
- p_char = k_char;
- k_p = (unsigned char *) key;
-
- for (i = 0; i <= 7; i++) {
- temp = 0;
- for (j = 0; j <= 6; j++)
- temp |= *p_char++ << (1+j);
- *k_p++ = (unsigned char) temp;
- }
-
- /* fix key parity */
- des_fixup_key_parity(key);
-
- /* Now one-way encrypt it with the folded key */
- (void) des_key_sched(key,key_sked);
- (void) des_cbc_cksum((des_cblock *)in_str,key,length,key_sked,key);
- /* erase key_sked */
- memset((char *)key_sked, 0, sizeof(key_sked));
-
- /* now fix up key parity again */
- des_fixup_key_parity(key);
-
- if (des_debug)
- fprintf(stdout,
- "\nResulting string_to_key = 0x%x 0x%x\n",
- *((unsigned long *) key),
- *((unsigned long *) key+1));
-}
diff --git a/libdes/util.c b/libdes/util.c
deleted file mode 100644
index 770ebd1..0000000
--- a/libdes/util.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Miscellaneous debug printing utilities
- */
-
-#ifndef lint
-static char rcsid_util_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-#include <stdio.h>
-#include <des.h>
-
-des_cblock_print_file(x, fp)
- des_cblock *x;
- FILE *fp;
-{
- unsigned char *y = (unsigned char *) x;
- register int i = 0;
- fprintf(fp," 0x { ");
-
- while (i++ < 8) {
- fprintf(fp,"%x",*y++);
- if (i < 8)
- fprintf(fp,", ");
- }
- fprintf(fp," }");
-}
diff --git a/libdes/verify.c b/libdes/verify.c
deleted file mode 100644
index b5e775a..0000000
--- a/libdes/verify.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Program to test the correctness of the DES library
- * implementation.
- *
- * exit returns 0 ==> success
- * -1 ==> error
- */
-
-#ifndef lint
-static char rcsid_verify_c[] =
- "$Id$";
-#endif
-
-#include <mit-copyright.h>
-#include <stdio.h>
-#include <errno.h>
-#include <des.h>
-
-extern char *errmsg();
-extern int errno;
-extern int des_string_to_key();
-extern int des_key_sched();
-extern int des_ecb_encrypt();
-extern int des_cbc_encrypt();
-extern exit();
-char *progname;
-int nflag = 2;
-int vflag;
-int mflag;
-int zflag;
-int pid;
-int des_debug;
-des_key_schedule KS;
-unsigned char cipher_text[64];
-unsigned char clear_text[64] = "Now is the time for all " ;
-unsigned char clear_text2[64] = "7654321 Now is the time for ";
-unsigned char clear_text3[64] = {2,0,0,0, 1,0,0,0};
-unsigned char output[64];
-unsigned char zero_text[8] = {0x0,0,0,0,0,0,0,0};
-unsigned char msb_text[8] = {0x0,0,0,0, 0,0,0,0x40}; /* to ANSI MSB */
-unsigned char *input;
-
-/* 0x0123456789abcdef */
-unsigned char default_key[8] = {
- 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef
-};
-unsigned char key2[8] = { 0x08,0x19,0x2a,0x3b,0x4c,0x5d,0x6e,0x7f };
-unsigned char key3[8] = { 0x80,1,1,1,1,1,1,1 };
-des_cblock s_key;
-unsigned char default_ivec[8] = {
- 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef
-};
-unsigned char *ivec;
-unsigned char zero_key[8] = {1,1,1,1,1,1,1,1}; /* just parity bits */
-int i,j;
-
-/*
- * Can also add :
- * plaintext = 0, key = 0, cipher = 0x8ca64de9c1b123a7 (or is it a 1?)
- */
-
-main(argc,argv)
- int argc;
- char *argv[];
-{
- /* Local Declarations */
- long in_length;
-
- progname=argv[0]; /* salt away invoking program */
-
- /* Assume a u_int32 is four bytes */
- if (sizeof(u_int32) != 4) {
- printf("\nERROR, size of long is %d",sizeof(u_int32));
- exit(-1);
- }
-
- while (--argc > 0 && (*++argv)[0] == '-')
- for (i=1; argv[0][i] != '\0'; i++) {
- switch (argv[0][i]) {
-
- /* debug flag */
- case 'd':
- des_debug=3;
- continue;
-
- case 'z':
- zflag = 1;
- continue;
-
- case 'm':
- mflag = 1;
- continue;
-
- default:
- printf("%s: illegal flag \"%c\" ",
- progname,argv[0][i]);
- exit(1);
- }
- };
-
- if (argc) {
- fprintf(stderr, "Usage: %s [-dmz]\n", progname);
- exit(1);
- }
-
- /* use known input and key */
-
- /* ECB zero text zero key */
- if (zflag) {
- input = zero_text;
- des_key_sched(zero_key,KS);
- printf("plaintext = key = 0, cipher = 0x8ca64de9c1b123a7\n");
- do_encrypt(input,cipher_text);
- printf("\tcipher = (low to high bytes)\n\t\t");
- for (j = 0; j<=7; j++)
- printf("%02x ",cipher_text[j]);
- printf("\n");
- do_decrypt(output,cipher_text);
- return(0);
- }
-
- if (mflag) {
- input = msb_text;
- des_key_sched(key3,KS);
- printf("plaintext = 0x00 00 00 00 00 00 00 40, ");
- printf("key = 0, cipher = 0x??\n");
- do_encrypt(input,cipher_text);
- printf("\tcipher = (low to high bytes)\n\t\t");
- for (j = 0; j<=7; j++) {
- printf("%02x ",cipher_text[j]);
- }
- printf("\n");
- do_decrypt(output,cipher_text);
- return(0);
- }
-
- /* ECB mode Davies and Price */
- {
- input = zero_text;
- des_key_sched(key2,KS);
- printf("Examples per FIPS publication 81, keys ivs and cipher\n");
- printf("in hex. These are the correct answers, see below for\n");
- printf("the actual answers.\n\n");
- printf("Examples per Davies and Price.\n\n");
- printf("EXAMPLE ECB\tkey = 08192a3b4c5d6e7f\n");
- printf("\tclear = 0\n");
- printf("\tcipher = 25 dd ac 3e 96 17 64 67\n");
- printf("ACTUAL ECB\n");
- printf("\tclear \"%s\"\n", input);
- do_encrypt(input,cipher_text);
- printf("\tcipher = (low to high bytes)\n\t\t");
- for (j = 0; j<=7; j++)
- printf("%02x ",cipher_text[j]);
- printf("\n\n");
- do_decrypt(output,cipher_text);
- }
-
- /* ECB mode */
- {
- des_key_sched(default_key,KS);
- input = clear_text;
- ivec = default_ivec;
- printf("EXAMPLE ECB\tkey = 0123456789abcdef\n");
- printf("\tclear = \"Now is the time for all \"\n");
- printf("\tcipher = 3f a4 0e 8a 98 4d 48 15 ...\n");
- printf("ACTUAL ECB\n\tclear \"%s\"",input);
- do_encrypt(input,cipher_text);
- printf("\n\tcipher = (low to high bytes)\n\t\t");
- for (j = 0; j<=7; j++) {
- printf("%02x ",cipher_text[j]);
- }
- printf("\n\n");
- do_decrypt(output,cipher_text);
- }
-
- /* CBC mode */
- printf("EXAMPLE CBC\tkey = 0123456789abcdef");
- printf("\tiv = 1234567890abcdef\n");
- printf("\tclear = \"Now is the time for all \"\n");
- printf("\tcipher =\te5 c7 cd de 87 2b f2 7c\n");
- printf("\t\t\t43 e9 34 00 8c 38 9c 0f\n");
- printf("\t\t\t68 37 88 49 9a 7c 05 f6\n");
-
- printf("ACTUAL CBC\n\tclear \"%s\"\n",input);
- in_length = strlen(input);
- des_cbc_encrypt(input,cipher_text,(long) in_length,KS,ivec,1);
- printf("\tciphertext = (low to high bytes)\n");
- for (i = 0; i <= 7; i++) {
- printf("\t\t");
- for (j = 0; j <= 7; j++) {
- printf("%02x ",cipher_text[i*8+j]);
- }
- printf("\n");
- }
- des_cbc_encrypt(cipher_text,clear_text,(long) in_length,KS,ivec,0);
- printf("\tdecrypted clear_text = \"%s\"\n",clear_text);
-
- printf("EXAMPLE CBC checksum");
- printf("\tkey = 0123456789abcdef\tiv = 1234567890abcdef\n");
- printf("\tclear =\t\t\"7654321 Now is the time for \"\n");
- printf("\tchecksum\t58 d2 e7 7e 86 06 27 33, ");
- printf("or some part thereof\n");
- input = clear_text2;
- des_cbc_cksum(input,cipher_text,(long) strlen(input),KS,ivec,1);
- printf("ACTUAL CBC checksum\n");
- printf("\t\tencrypted cksum = (low to high bytes)\n\t\t");
- for (j = 0; j<=7; j++)
- printf("%02x ",cipher_text[j]);
- printf("\n\n");
- exit(0);
-}
-
-flip(array)
- char *array;
-{
- register int old,new,i,j;
- /* flips the bit order within each byte from 0 lsb to 0 msb */
- for (i = 0; i<=7; i++) {
- old = *array;
- new = 0;
- for (j = 0; j<=7; j++) {
- if (old & 01)
- new = new | 01;
- if (j < 7) {
- old = old >> 1;
- new = new << 1;
- }
- }
- *array = new;
- array++;
- }
-}
-
-do_encrypt(in,out)
- char *in;
- char *out;
-{
- for (i =1; i<=nflag; i++) {
- des_ecb_encrypt(in,out,KS,1);
- if (des_debug) {
- printf("\nclear %s\n",in);
- for (j = 0; j<=7; j++)
- printf("%02X ",in[j] & 0xff);
- printf("\tcipher ");
- for (j = 0; j<=7; j++)
- printf("%02X ",out[j] & 0xff);
- }
- }
-}
-
-do_decrypt(in,out)
- char *out;
- char *in;
- /* try to invert it */
-{
- for (i =1; i<=nflag; i++) {
- des_ecb_encrypt(out,in,KS,0);
- if (des_debug) {
- printf("clear %s\n",in);
- for (j = 0; j<=7; j++)
- printf("%02X ",in[j] & 0xff);
- printf("\tcipher ");
- for (j = 0; j<=7; j++)
- printf("%02X ",out[j] & 0xff);
- }
- }
-}
diff --git a/libdes/weak_key.c b/libdes/weak_key.c
deleted file mode 100644
index 6657c1e..0000000
--- a/libdes/weak_key.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1989 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Under U.S. law, this software may not be exported outside the US
- * without license from the U.S. Commerce department.
- *
- * These routines form the library interface to the DES facilities.
- *
- * Originally written 8/85 by Steve Miller, MIT Project Athena.
- */
-
-#ifndef lint
-static char rcsid_weak_key_c[] =
- "$Id$";
-#endif
-
-#include <des.h>
-
-/*
- * The following are the weak DES keys:
- */
-static des_cblock weak[16] = {
- /* weak keys */
- {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
- {0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe},
- {0x1f,0x1f,0x1f,0x1f,0x0e,0x0e,0x0e,0x0e},
- {0xe0,0xe0,0xe0,0xe0,0xf1,0xf1,0xf1,0xf1},
-
- /* semi-weak */
- {0x01,0xfe,0x01,0xfe,0x01,0xfe,0x01,0xfe},
- {0xfe,0x01,0xfe,0x01,0xfe,0x01,0xfe,0x01},
-
- {0x1f,0xe0,0x1f,0xe0,0x0e,0xf1,0x0e,0xf1},
- {0xe0,0x1f,0xe0,0x1f,0xf1,0x0e,0xf1,0x0e},
-
- {0x01,0xe0,0x01,0xe0,0x01,0xf1,0x01,0xf1},
- {0xe0,0x01,0xe0,0x01,0xf1,0x01,0xf1,0x01},
-
- {0x1f,0xfe,0x1f,0xfe,0x0e,0xfe,0x0e,0xfe},
- {0xfe,0x1f,0xfe,0x1f,0xfe,0x0e,0xfe,0x0e},
-
- {0x01,0x1f,0x01,0x1f,0x01,0x0e,0x01,0x0e},
- {0x1f,0x01,0x1f,0x01,0x0e,0x01,0x0e,0x01},
-
- {0xe0,0xfe,0xe0,0xfe,0xf1,0xfe,0xf1,0xfe},
- {0xfe,0xe0,0xfe,0xe0,0xfe,0xf1,0xfe,0xf1}
-};
-
-/*
- * des_is_weak_key: returns true iff key is a [semi-]weak des key.
- *
- * Requires: key has correct odd parity.
- */
-int
-des_is_weak_key(key)
- des_cblock key;
-{
- int i;
- des_cblock *weak_p = weak;
-
- for (i = 0; i < (sizeof(weak)/sizeof(des_cblock)); i++) {
- if (!memcmp((char *)weak_p++, (char *)key, sizeof(des_cblock)))
- return 1;
- }
-
- return 0;
-}
diff --git a/libdyn/Imakefile b/libdyn/Imakefile
deleted file mode 100644
index 264e582..0000000
--- a/libdyn/Imakefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# This file is part of libdyn.a, the C Dynamic Object library. It
-# contains the Makefile.
-#
-# There are no restrictions on this code; however, if you make any
-# changes, I request that you document them so that I do not get
-# credit or blame for your modifications.
-#
-# Written by Barr3y Jaspan, Student Information Processing Board (SIPB)
-# and MIT-Project Athena, 1989.
-
-OBJS = dyn_create.o dyn_put.o dyn_debug.o dyn_delete.o dyn_size.o \
- dyn_append.o dyn_realloc.o dyn_paranoid.o dyn_insert.o
-
-SRCS = dyn_create.c dyn_put.c dyn_debug.c dyn_delete.c dyn_size.c \
- dyn_append.c dyn_realloc.c dyn_paranoid.c dyn_insert.c
-
-build_library(dyn,$(OBJS))
-create_depend($(SRCS))
-
-#ifdef INSTALL_DYN
-install_library(dyn,$(ATHLIBDIR))
-install_man(dyn.3,dyn.3)
-#endif
-
-build_program(dyntest,dyntest.o libdyn.a,,)
-
-all:: $(BINC)/dyn.h
-
-$(BINC)/dyn.h: dyn.h
- $(RM) $@; $(CP) dyn.h $@
-
-clean::
- $(RM) $(BINC)/dyn.h
diff --git a/libdyn/Makefile.in b/libdyn/Makefile.in
new file mode 100644
index 0000000..40952d0
--- /dev/null
+++ b/libdyn/Makefile.in
@@ -0,0 +1,47 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=../..
+VPATH=@srcdir@
+CC=@CC@
+RANLIB=@RANLIB@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -I${top_srcdir}/h -I${BUILDTOP}/h @CPPFLAGS@
+
+OBJS = dyn_append.o dyn_create.o dyn_debug.o dyn_delete.o dyn_insert.o \
+ dyn_paranoid.o dyn_put.o dyn_realloc.o dyn_size.o
+
+all: libdyn.a dyntest
+
+libdyn.a: ${OBJS}
+ ar cru $@ ${OBJS}
+ ${RANLIB} $@
+
+dyntest: libdyn.a dyntest.o
+ ${CC} ${LDFLAGS} -o $@ dyntest.o libdyn.a
+
+check:
+
+install:
+
+clean:
+ rm -f ${OBJS} libdyn.a dyntest.o dyntest
+
+${OBJS} dyntest.o: dynP.h ${top_srcdir}/h/dyn.h ${top_srcdir}/h/sysdep.h
+${OBJS} dyntest.o: ${BUILDTOP}/h/config.h
+
+.PHONY: all check install clean
+
diff --git a/libdyn/Makefile.old b/libdyn/Makefile.old
deleted file mode 100644
index 3d98582..0000000
--- a/libdyn/Makefile.old
+++ /dev/null
@@ -1,42 +0,0 @@
-# This file is part of libdyn.a, the C Dynamic Object library. It
-# contains the Makefile.
-#
-# There are no restrictions on this code; however, if you make any
-# changes, I request that you document them so that I do not get
-# credit or blame for your modifications.
-#
-# Written by Barr3y Jaspan, Student Information Processing Board (SIPB)
-# and MIT-Project Athena, 1989.
-
-DESTDIR = /afs/.athena.mit.edu/contrib/sipb/$(MACHINE)lib
-CC = hc2 -H+w
-CFLAGS = -O
-DEST = libdyn.a
-
-SRCS = dyn_create.c dyn_put.c dyn_debug.c dyn_delete.c dyn_size.c \
- dyn_append.c dyn_realloc.c dyn_paranoid.c dyn_insert.c
-OBJS = dyn_create.o dyn_put.o dyn_debug.o dyn_delete.o dyn_size.o \
- dyn_append.o dyn_realloc.o dyn_paranoid.o dyn_insert.o
-HDRS = dyn.h dynP.h
-
-$(DEST): $(OBJS)
- rm -f $(DEST)
- ar rc $(DEST) $(OBJS)
- ranlib $(DEST)
-
-all: $(DEST) test
-
-test: $(DEST) test.o
- $(CC) -o test test.o $(DEST)
-
-depend:
- makedepend -- $(CLFAGS) -- $(HDRS) $(SRCS)
-
-bin_install: $(DEST)
- install -c $(DEST) $(DESTDIR)
- ranlib $(DESTDIR)/$(DEST)
-
-clean:
- -rm -f $(OBJS) $(DEST) test *~
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/libdyn/dyn.3m b/libdyn/dyn.3m
deleted file mode 100644
index 21ae70b..0000000
--- a/libdyn/dyn.3m
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-15 March 1990 DYN(3M)
-
-
-
-NAME
- dyn - the C Dynamic Object library
-
-
-DESCRIPTION
- A C Dynamic Object is an array that takes care of resizing
- itself as you add and delete elements from it. It can be of
- any type for which sizeof is defined and for which an
- address of a variable of that type can be passed to a func-
- tion. The library containing the functions described below
- is called _l_i_b_d_y_n._a, and the necessary declarations to use
- them are in <_d_y_n._h>.
-
- A DynObject is actually a structure that contains an array
- and a couple of integers to maintain necessary state infor-
- mation. When a Dyn function is said to operate on "the
- object" or "the array", it is operating on the array stored
- in the structure while at the same time updating internal
- state information.
-
-
-LIST OF FUNCTIONS
- DynObject DynCreate(size, increment)
- int size, increment;
-
- _R_e_q_u_i_r_e_s: _s_i_z_e and _i_n_c_r_e_m_e_n_t are greater than zero.
-
- _E_f_f_e_c_t_s: Creates a new DynObject that will store elements of
- size _s_i_z_e and will allocate memory in blocks large enough to
- hold exactly _i_n_c_r_e_m_e_n_t elements. For example, if you are
- storing 8-byte double precision numbers and _i_n_c_r_e_m_e_n_t is 5,
- each 5th element you add to the object will cause it to
- request 40 more bytes (8 * 5) from the operating system. If
- _i_n_c_r_e_m_e_n_t is zero, a default value is used (currently 100).
- This is the only time the programmer deals with a dynamic
- object's memory allocation.
-
- _R_e_t_u_r_n_s: DynCreate returns the new DynObject, or NULL if
- there is insufficient memory.
-
- int DynDestroy(obj)
- DynObject obj;
-
- _M_o_d_i_f_i_e_s: obj
-
- _E_f_f_e_c_t_s: Frees all memory associated with _o_b_j. The results
- of calling any Dyn function on a destroyed object are unde-
- fined (except for DynCreate, which resets the object).
-
- _R_e_t_u_r_n_s: DynDestroy returns DYN_OK.
-
-
-
-
-
- 1
-
-
-
-
-
-
-DYN(3M) 15 March 1990
-
-
-
- int DynAdd(obj, el)
- DynObject obj;
- DynPtr el;
-
- _M_o_d_i_f_i_e_s: obj
-
- _E_f_f_e_c_t_s: Adds the element pointed to by _e_l to the object
- _o_b_j, resizing the object if necessary. The new element
- becomes the last element in obj's array.
-
- _R_e_t_u_r_n_s: DynAdd returns DYN_OK on success or DYN_NOMEM if
- there is insufficient memory.
-
- int DynInsert(obj, index, els, num)
- DynObject obj;
- DynPtr els;
- int index, num;
-
- _M_o_d_i_f_i_e_s: obj
-
- _E_f_f_e_c_t_s: Inserts the array of _n_u_m elements, pointed to by
- _e_l_s, into the object _o_b_j starting at the array location
- _i_n_d_e_x, resizing the object if necessary. Order is
- preserved; if you have the array "1 2 3 4 5" and insert "10
- 11 12" at the third position, you will have the array "1 2
- 10 11 12 3 4 5".
-
- _R_e_t_u_r_n_s: DynInsert returns DYN_BADINDEX if _i_n_d_e_x is not
- between 0 and DynSize(obj); DYN_BADVALUE if _n_u_m is less than
- 1; DYN_NOMEM if there is insufficient memory.
-
- int DynGet(obj, index)
- DynObject obj;
- int index;
-
- _E_f_f_e_c_t_s: Returns the address of the element _i_n_d_e_x in the
- array of _o_b_j. This pointer can be treated as a normal array
- of the type specified to DynCreate. The order of elements
- in this array is the order in which they were added to the
- object. The returned pointer is guaranteed to be valid only
- until obj is modified.
-
- _R_e_t_u_r_n_s: DynGet returns NULL if _i_n_d_e_x is larger than the
- number of elements in the array of less than zero.
-
- int DynDelete(obj, index)
- DynObject obj;
- int index;
-
- _M_o_d_i_f_i_e_s: obj
-
-
-
-
-
-2
-
-
-
-
-
-
-15 March 1990 DYN(3M)
-
-
-
- _E_f_f_e_c_t_s: The element _i_n_d_e_x is deleted from the object _o_b_j.
- Note that the element is actually removed permanently from
- the array. If you have the array "1 2 3 4 5" and delete the
- third element, you will have the array "1 2 4 5". The order
- of elements in not affected.
-
- _R_e_t_u_r_n_s: DynDelete will return DYN_OK on success or
- DYN_BADINDEX if the element _i_n_d_e_x does not exist in the
- array or is less than zero.
-
- int DynSize(obj)
- DynObject obj;
-
- _E_f_f_e_c_t_s: Returns the number of elements in the object _o_b_j.
-
- int DynHigh(obj)
- DynObject obj;
-
- _E_f_f_e_c_t_s: Returns the index of the highest element in the
- object _o_b_j. In this version, DynHigh is macro that expands
- to DynSize - 1.
-
- int DynLow(obj)
- DynObject obj;
-
- _E_f_f_e_c_t_s: Returns the index of the lowest element in the
- object _o_b_j. In this version, DynLow is macro that expands
- to 0.
-
- int DynDebug(obj, state)
- DynObject obj;
- int state;
-
- _M_o_d_i_f_i_e_s: obj
-
- _E_f_f_e_c_t_s: Sets the debugging state of _o_b_j to _s_t_a_t_e and prints
- a message on stderr saying what state debugging was set to.
- Any non-zero value for _s_t_a_t_e turns debugging ``on''. When
- debugging is on, all Dyn functions will produce (hopefully
- useful) output to stderr describing what is going on.
-
- _R_e_t_u_r_n_s: DynDebug returns DYN_OK.
-
-AUTHOR
- Barr3y Jaspan, Student Information Processing Board (SIPB)
- and MIT-Project Athena, bjaspan@athena.mit.edu
-
-
-
-
-
-
-
-
-
- 3
-
-
-
diff --git a/libdyn/dynP.h b/libdyn/dynP.h
index a6131db..26ef10f 100644
--- a/libdyn/dynP.h
+++ b/libdyn/dynP.h
@@ -18,7 +18,8 @@
#ifndef _DynP_h
#define _DynP_h
-#include "dyn.h"
+#include <sysdep.h>
+#include <dyn.h>
/*
* Rep invariant:
@@ -35,20 +36,14 @@ typedef struct _DynObject {
DynPtr array;
int el_size, num_el, size, inc;
char debug, paranoid;
-} DynObjectRecP, *DynObjectP;
+} DynObjectRec;
/* Internal functions */
-int _DynRealloc();
+int _DynRealloc __P((DynObject obj, int num_incs));
#define _DynResize(obj, req) \
((obj)->size > (req) ? DYN_OK : \
(_DynRealloc((obj), (((req) - (obj)->size) / (obj)->inc) + 1)))
-/* external (C library) functions */
-#include <stdio.h>
-#ifdef POSIX
-#include <stdlib.h>
-#endif
-
#endif /* _DynP_h */
/* DON'T ADD STUFF AFTER THIS #endif */
diff --git a/libdyn/dyn_append.c b/libdyn/dyn_append.c
index 8de3eb5..fc19172 100644
--- a/libdyn/dyn_append.c
+++ b/libdyn/dyn_append.c
@@ -15,12 +15,12 @@
#include "dynP.h"
int DynAppend(obj, els, num)
- DynObjectP obj;
+ DynObject obj;
DynPtr els;
int num;
{
if (obj->debug)
- fprintf(stderr, "dyn: append: Writing %d bytes from %d to %d + %d\n",
+ fprintf(stderr, "dyn: append: Writing %d bytes from %p to %p + %d\n",
obj->el_size*num, els, obj->array, obj->num_el*obj->el_size);
if (obj->size < obj->num_el + num) {
diff --git a/libdyn/dyn_create.c b/libdyn/dyn_create.c
index 16890ae..8862396 100644
--- a/libdyn/dyn_create.c
+++ b/libdyn/dyn_create.c
@@ -21,12 +21,12 @@
static int default_increment = DEFAULT_INC;
-DynObjectP DynCreate(el_size, inc)
+DynObject DynCreate(el_size, inc)
int el_size, inc;
{
- DynObjectP obj;
+ DynObject obj;
- obj = (DynObjectP) malloc(sizeof(DynObjectRecP));
+ obj = (DynObject) malloc(sizeof(DynObjectRec));
if (obj == NULL)
return NULL;
@@ -40,7 +40,7 @@ DynObjectP DynCreate(el_size, inc)
}
int DynDestroy(obj)
- DynObjectP obj;
+ DynObject obj;
{
free(obj->array);
free(obj);
diff --git a/libdyn/dyn_debug.c b/libdyn/dyn_debug.c
index d3d72bb..53178d2 100644
--- a/libdyn/dyn_debug.c
+++ b/libdyn/dyn_debug.c
@@ -15,8 +15,8 @@
#include "dynP.h"
int DynDebug(obj, state)
- DynObjectP obj;
- char state;
+ DynObject obj;
+ int state;
{
obj->debug = state;
diff --git a/libdyn/dyn_delete.c b/libdyn/dyn_delete.c
index 5cb38f7..1dd39c1 100644
--- a/libdyn/dyn_delete.c
+++ b/libdyn/dyn_delete.c
@@ -19,7 +19,7 @@
* (Stupid dog. He almost did it to me again ...)
*/
int DynDelete(obj, idx)
- DynObjectP obj;
+ DynObject obj;
int idx;
{
if (idx < 0) {
@@ -49,7 +49,7 @@ int DynDelete(obj, idx)
else {
if (obj->debug)
fprintf(stderr,
- "dyn: delete: copying %d bytes from %d + %d to + %d.\n",
+ "dyn: delete: copying %d bytes from %p + %d to + %d.\n",
obj->el_size*(obj->num_el - idx), obj->array,
(idx+1)*obj->el_size, idx*obj->el_size);
@@ -60,7 +60,7 @@ int DynDelete(obj, idx)
if (obj->paranoid) {
if (obj->debug)
fprintf(stderr,
- "dyn: delete: zeroing %d bytes from %d + %d\n",
+ "dyn: delete: zeroing %d bytes from %p + %d\n",
obj->el_size, obj->array,
obj->el_size*(obj->num_el - 1));
(void) memset(obj->array + obj->el_size*(obj->num_el - 1),
diff --git a/libdyn/dyn_insert.c b/libdyn/dyn_insert.c
index d59d9e7..7e20595 100644
--- a/libdyn/dyn_insert.c
+++ b/libdyn/dyn_insert.c
@@ -13,7 +13,7 @@
#include "dynP.h"
int DynInsert(obj, idx, els, num)
- DynObjectP obj;
+ DynObject obj;
DynPtr els;
int idx, num;
{
@@ -34,7 +34,7 @@ int DynInsert(obj, idx, els, num)
}
if (obj->debug)
- fprintf(stderr,"dyn: insert: Moving %d bytes from %d + %d to + %d\n",
+ fprintf(stderr,"dyn: insert: Moving %d bytes from %p + %d to + %d\n",
(obj->num_el-idx)*obj->el_size, obj->array,
obj->el_size*idx, obj->el_size*(idx+num));
@@ -45,7 +45,7 @@ int DynInsert(obj, idx, els, num)
(obj->num_el-idx)*obj->el_size);
if (obj->debug)
- fprintf(stderr, "dyn: insert: Copying %d bytes from %d to %d + %d\n",
+ fprintf(stderr, "dyn: insert: Copying %d bytes from %p to %p + %d\n",
obj->el_size*num, els, obj->array, obj->el_size*idx);
(void) memmove(obj->array + obj->el_size*idx, els, obj->el_size*num);
diff --git a/libdyn/dyn_paranoid.c b/libdyn/dyn_paranoid.c
index 86c69dd..d2de3c4 100644
--- a/libdyn/dyn_paranoid.c
+++ b/libdyn/dyn_paranoid.c
@@ -15,8 +15,8 @@
#include "dynP.h"
int DynParanoid(obj, state)
- DynObjectP obj;
- char state;
+ DynObject obj;
+ int state;
{
obj->paranoid = state;
diff --git a/libdyn/dyn_put.c b/libdyn/dyn_put.c
index 6b1c9ea..8427d5b 100644
--- a/libdyn/dyn_put.c
+++ b/libdyn/dyn_put.c
@@ -12,10 +12,10 @@
#include "dynP.h"
-int DynPut();
+static int DynPut __P((DynObject obj, DynPtr el, int index));
DynPtr DynGet(obj, num)
- DynObjectP obj;
+ DynObject obj;
int num;
{
if (num < 0) {
@@ -32,14 +32,14 @@ DynPtr DynGet(obj, num)
}
if (obj->debug)
- fprintf(stderr, "dyn: get: Returning address %d + %d.\n",
+ fprintf(stderr, "dyn: get: Returning address %p + %d.\n",
obj->array, obj->el_size*num);
return (DynPtr) obj->array + obj->el_size*num;
}
int DynAdd(obj, el)
- DynObjectP obj;
+ DynObject obj;
DynPtr el;
{
int ret;
@@ -60,15 +60,15 @@ int DynAdd(obj, el)
* obj->num_el) will not be updated properly and many other functions
* in the library will lose. Have a nice day.
*/
-int DynPut(obj, el, index)
- DynObjectP obj;
+static int DynPut(obj, el, index)
+ DynObject obj;
DynPtr el;
int index;
{
int ret;
if (obj->debug)
- fprintf(stderr, "dyn: put: Writing %d bytes from %d to %d + %d\n",
+ fprintf(stderr, "dyn: put: Writing %d bytes from %p to %p + %d\n",
obj->el_size, el, obj->array, index*obj->el_size);
if ((ret = _DynResize(obj, index)) != DYN_OK)
diff --git a/libdyn/dyn_realloc.c b/libdyn/dyn_realloc.c
index bf13910..4dedd72 100644
--- a/libdyn/dyn_realloc.c
+++ b/libdyn/dyn_realloc.c
@@ -19,7 +19,7 @@
* library. However, nothing will break if it is.
*/
int _DynRealloc(obj, num_incs)
- DynObjectP obj;
+ DynObject obj;
int num_incs;
{
DynPtr temp;
diff --git a/libdyn/dyn_size.c b/libdyn/dyn_size.c
index 773db4a..4d1445d 100644
--- a/libdyn/dyn_size.c
+++ b/libdyn/dyn_size.c
@@ -15,7 +15,7 @@
#include "dynP.h"
int DynSize(obj)
- DynObjectP obj;
+ DynObject obj;
{
if (obj->debug)
fprintf(stderr, "dyn: size: returning size %d.\n", obj->num_el);
diff --git a/libdyn/dyntest.c b/libdyn/dyntest.c
index b08118d..9f91720 100644
--- a/libdyn/dyntest.c
+++ b/libdyn/dyntest.c
@@ -12,6 +12,7 @@
*/
#include <stdio.h>
+#include <string.h>
#include "dyn.h"
@@ -20,7 +21,7 @@ static char insert1[] = "This will be put at the beginning.";
static char insert2[] = "(parenthetical remark!) ";
static char insert3[] = " This follows the random string.";
-main(argc, argv)
+int main(argc, argv)
int argc;
char **argv;
{
@@ -94,7 +95,8 @@ main(argc, argv)
exit(1);
}
- printf("This should be the random string: \"%s\"\n", DynGet(obj, 14));
+ printf("This should be the random string: \"%s\"\n",
+ (char *) DynGet(obj, 14));
if (DynInsert(obj, -1, "foo", 4) != DYN_BADINDEX ||
DynInsert(obj, DynSize(obj) + 1, "foo", 4) != DYN_BADINDEX ||
@@ -119,9 +121,10 @@ main(argc, argv)
exit(1);
}
- printf("A new random string: \"%s\"\n", DynGet(obj, 14 +
- strlen(insert1) + 1));
- printf("This was put at the beginning: \"%s\"\n", DynGet(obj, 0));
+ printf("A new random string: \"%s\"\n",
+ (char *) DynGet(obj, 14 + strlen(insert1) + 1));
+ printf("This was put at the beginning: \"%s\"\n",
+ (char *) DynGet(obj, 0));
DynDestroy(obj);
diff --git a/logs/ChangeLog.1992 b/logs/ChangeLog.1992
deleted file mode 100644
index 2757f07..0000000
--- a/logs/ChangeLog.1992
+++ /dev/null
@@ -1,1670 +0,0 @@
-Wed Aug 26 00:20:18 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * server/access.c:
- * server/bdump.c:
- * server/common.c:
- * server/kopt.c:
- * server/main.c:
- * server/timer.c: Add support for K&R C
-
- * lib/ZSubs.c: Fix typo introduced in 1.16
-
- * clients/zmailnotify/zmailnotify.c: fix memory leak
-
- * clients/zstat/zstat.c: fix memory leak
-
- * zwgc/X_fonts.c: (Font_to_hex) off by one; alloc'ing one too few
- bytes.
-
- * zwgc/tty_filter.c: (tty_filter_init) multiple calls caused memory
- leak.
-
- * zwgc/xshow.c: (xshow) style string could be leaked
-
-Tue Aug 25 22:21:36 1992 Marc Horowitz (marc at deathtongue)
-
- * sometime in the past, changes were made to zwgc to support the
- WM_DELETE_WINDOW WM protocol on xgrams
-
- * zwgc/X_gram.c: Today, I fixed a bug which prevented
- WM_DELETE_WINDOW from working unless transient was turned on.
-
-Thu Aug 20 14:48:15 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * clients/zctl/zctl.c: fix memory leak
-
- * clients/zmailnotify/zmailnotify.c: fix memory leak
-
- * ss/lib/execute_cmd.c: fix memory leak
-
-Fri Aug 14 08:08:07 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * server/kopt.c:
- * server/uloc.c:
- * server/access.c:
- * server/bdump.c:
- * server/kstuff.c:
- * server/main.c:
- * server/class.c:
- * server/server.c: saber complains about pure assignment statements
- in ifs-
-
- * server/dispatch.c: saber complaints fixed
- be sure to initialize srv_idx in nacked structure.
-
- * server/hostm.c: (host_not_losing): client_deregister free's client
- structure, so call to server_kill_clt should be called first.
-
- * server/client.c: removed useless ops in client_deregister- client
- & clients are both local automatic to the routine, so setting them
- to null before returning is pointless.
-
-Mon Aug 10 09:20:52 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * lib/ZNewLocU.c: fix leak in ZLocateUser
-
- * lib/acl_files.c: removed extra definitions of malloc/calloc
-
- * server/uloc.c: fix leaks in ulogin_setup and ulogin_find
-
- * server/main.c: added support for debugging malloc
-
- * server/client.c: fix leak in client_deregister
-
-Sat Aug 8 19:41:37 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * zwgc/xrevstack.h: add defs for unlinked and unlink_gram
-
- * include/zephyr/zephyr.h: remove C++ stuff
- fix ZRequestLocations prototype (jfc's changes)
-
- * clients/syslogd/syslogd.c: Initial support for AIX; mostly signal
- handling and SRCMGR stuff.
-
- * lib/Zinternal.c: Ifdef additional stuff out on Z_DEBUG
- make sure to cast results of malloc (jfc's change)
-
- * lib/ZSendPkt.c: move definition of wait_for_hmack to be local to
- file instead of function (jfc's change)
-
- * config/config.Imakefile: AIX has flock
- remove C++ defines
- fix lint defs for AIX
-
-Fri Aug 7 11:11:10 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * zwgc/Imakefile: fixed typo with BUILDDIR;
- removed extra dependency on y.tab.c (removed in build by default
- rules)
-
-Wed Aug 5 08:13:55 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * clients/xzwrite/destlist.c: fix off-by-one error in sorting
- routine reported by jik
-
- * clients/xzwrite/destlist.c: added nec. space to nonexistant
- destinations file warning.
-
-Wed Jul 15 15:13:02 EDT 1992 Ken Raeburn (raeburn at cygnus.com)
-
- * lib/*.c: Renamed to make "ar" and 14-character-filename systems
- happy.
- * lib/Imakefile: Updated to reflect this.
-
-Mon Jul 13 13:01:43 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * zwgc/Imakefile:
- * zwgc/Dictionary/Imakefile:
- generate dictionaries referencing through BUILDTOP instead of
- SRCTOP; sources in /source were referring to zephyr locker...
-;
-Tue Mar 3 15:20:57 1992 Lucien W. Van Elsen (lwvanels at fionavar)
-
- * zwgc/Imakefile: Add y.tab.c to list of generated files
-
-Sat Feb 15 18:10:43 1992 Lucien W. Van Elsen (lwvanels at godtree)
-
- * clients/zmailnotify/zmailnotify.c: use POP3 TOP command instead of
- RETR if HAVE_POP3_TOP is defined; reduces load on server by not
- getting whole message just for subject lines.
-
- * clients/zmailnotify/zmailnotify.c: added POSIX file locking,
- ifdef'd on _POSIX_SOURCE
-
-Thu Feb 13 02:38:10 1992 Lucien W. Van Elsen (lwvanels at godtree)
-
- * server/subscr.c: fix compare_subs to deal with wildcards correctly
- and still maintain sort order.
-
-Fri Jan 17 04:15:46 1992 Lucien W. Van Elsen (lwvanels at godtree)
-
- * server/hostm.c: pass sockaddr_in.sin_addr, not sockaddr_in to
- inet_ntoa
-
- * server/class.c: when searching class_bucket hash table for class,
- check instance as well
-
- class acls are stored in <class,*>
- use macro to generate hash value
- Use dup_zstring to duplicate zstrings instead of frobbing struct
-
-Fri Jan 17 02:43:04 1992 Lucien W. Van Elsen (lwvanels at godtree)
-
- * server/dispatch.c: Add more information to some error messages;
- turn off other debugging info
-
- * server/client.c: turn off other debugging info (for speed)
- clt_free only called once; inline.
-
- * server/hostm.c: turn off extra debugging info (for speed)
- fix calls to inet_ntoa to pass correct struct.
-
- * server/zserver.h: add prototype for compare_subs
-
- * server/server.c: turn of extra debugging info (for speed)
-
- * server/main.c: add stub function for init'ing db from file on startup
- turn off other debugging info (for speed)
- always increment reference counts when dup'ing zstrings.
-
- * server/kstuff.c: free the associated zstring when freeing up
- AuthEnt struct
-
- * server/subscr.c: turn off other debugging info (for speed)
- always increment reference counts when dup'ing zstrings.
- fix calls to compare_subs to take new do_wildcard arg
- added additional logic to compare_subs to deal with wildcards
-
- * server/bdump.c: add ability to specify primary bdump protocol
- version on command line ifdef out 1A bdump code
-
- * server/zsrv_conf.h: fix spelling error in ZEPHYR_TKFILE
-
- * server/kopt.c: add ability to force using libc strlen on RT; asm
- version doesn't work when compiled -g.
-
- * server/uloc.c: turn off other debugging info (for speed)
- remove unused debugging code
- only downcase usernames
- free all temporary zstrings
-
- * server/access.c: add extra error checking on acl_load; if acl
- can't be loaded, deny access.
-
- * server/zstring.c:
- * zstring.h: Don't store len in zstring; v. infreq. used.
-
-Mon Dec 30 14:01:54 1991 John F. Carr (jfc @ Achates)
-
- * zwgc/tty_filter.c: Ignore @color and @font.
-
-Wed Dec 4 13:22:51 1991 Lucien W. Van Elsen (lwvanels at godtree)
-
- Converted back to ANSI C (with ifdef's for standard C)
- * server/dispatch.c:
- * server/client.c:
- * server/hostm.c:
- * server/zserver.h:
- * server/version.c:
- * server/server.c:
- * server/timer.c:
- * server/timer.h:
- * server/zalloc.c:
- * server/class.c:
- * server/main.c:
- * server/kstuff.c:
- * server/subscr.c:
- * server/bdump.c:
- * server/zsrv_conf.h:
- * server/Imakefile:
- * server/common.c:
- * server/access.h:
- * server/acl_files.c:
- * server/kopt.c:
- * server/unix.h:
- * server/uloc.c:
- * server/zalloc.h:
- * server/access.c:
- * server/zstring.c:
- * server/zstring.h:
-
- * server/new_version.csh: (new) shell script to generate version
- number/compile time/builder
-
- * config/Imake.rules: added saber_program and osaber_program
- targets; no longer try to make tags for c++ style files.
-
- * config/config.Imakefile: Now build server on all platforms
- make sure there is a link for /usr/etc/zwgc on all platforms, for
- compatability
- Now build syslogd under AIX
- Build xzwrite on AIX now; athena widgets available
- Use "new" (post-filsys reorg) paths on all platforms, not just new
- ones
- Build with ansi compiler (c89) on the RS/6000's
- Don't link against bsd compatability library anymore for RS/6000-
- unnecessary
- Always give -L/usr/athena/lib
- Give etags the -t flag to generate tags for structures/typedefs
-
- * lib/ZSubscriptions.c: can't optimize away a call to
- Z_Subscriptions with nitems=0; that's how ZCancelSubs works-
-
-
- Minor ANSI C fixes- (typecasts and nothing after #endif)
- * lib/ZOpenPort.c:
- * lib/ZFormatNotice.c:
- * lib/ZPeekNotice.c:
- * lib/ZPeekPacket.c:
- * lib/ZPending.c:
- * lib/ZSendList.c:
- * lib/ZReceiveNotice.c:
- * lib/ZReceivePacket.c:
- * lib/ZSendNotice.c:
- * lib/ZCheckIfNotice.c:
- * lib/ZIfNotice.c:
- * lib/ZPeekIfNotice.c:
- * lib/ZFormatNoticeList.c:
- * lib/ZFlushLocations.c:
- * lib/ZGetLocations.c:
- * lib/ZFormatRawNotice.c:
- * lib/ZLocateUser.c:
- * lib/ZSendRawNotice.c:
- * lib/ZSetDestAddr.c:
- * lib/ZFormatSmallRawNoticeList.c:
- * lib/ZSetServerState.c:
- * lib/ZCompareUIDPred.c:
- * lib/ZFormatRawNoticeList.c:
- * lib/ZGetSubscriptions.c:
- * lib/ZGetWGPort.c:
- * lib/ZVariables.c:
- * lib/ZFreeNotice.c:
- * lib/ZFormatSmallRawNotice.c:
- * lib/ZSendRawList.c:
- * lib/acl_files.c:
- * lib/ZAsyncLocate.c:
-
- * zhm/zhm.h: Give standard machine name for rs/6000
-
- * zhm/queue.c: ANSI style #endif's
-
- * zhm/zhm_client.c: ANSI style #endif's
-
- * zhm/zhm_server.c: ANSI style #endif's
-
- * Imakefile: don't make ozwgc anymore
-
- * clients/syslogd/Imakefile: link against -src for AIX
-
- * clients/zleave/zleave.c: ANSI style #endif's
-
- * clients/zmailnotify/Imakefile: only make links on install target,
- not all
-
- * clients/zpopnotify/zpopnotify.c: ansi style #endifs
-
- * clients/zshutdown_notify/zshutdown_notify.c: ansi style endifs
-
- * clients/zwrite/zwrite.c: ansi style endifs
-
- * include/zephyr/acl.h: take out c++ stuff
-
- * include/zephyr/zephyr_internal.h: take out c++ stuff
-
- * zwgc/Dictionary/Imakefile: need target for string_dictionary.h
-
- * zwgc/Imakefile: fix pathnames; make sure directory exists before
- installing in it.
-
- * zwgc/formatter.c: include string.h and use strchr instead of index.
-
-Mon Jul 1 00:29:21 1991 (lwvanels at godtree)
-
- * zwgc/zwgc.desc: change /usr/athena to /usr/athena/bin in path
- move unauthentic personal messages to lower right.
-
- * zwgc/standard_ports.c: Made "no X display" warning message
- shorter and quieter.
-
-Mon May 13 13:11:54 1991 Ken Raeburn (raeburn at lycus)
-
- * server/bdump.C (bdump_get): Log offered dump version number as
- string, not number.
-
- * server/client.C (client_register): Log a message when adding a new
- client to the database.
-
- * server/dispatch.C: Added more information to severeal log
- messages.
- * server/hostm.c: Ditto.
- * server/server.C: Ditto.
-
- * server/subscr.C: Disabled a couple of debugging messages.
- (subscr_marshal_subs): For "zctl ret", require authentication as the
- correct user.
-
- * server/uloc.C (ulogin_flush_user): Increment counter while
- deleting a range of locations.
- (ulogin_dump_locs): Enlarge buffer, and use staatic pointers reset
- each time through loop.
-
-Thu Apr 11 23:51:08 1991 Ken Raeburn (raeburn at watch.com)
-
- * zwgc/X_gram.c (set_transient): Default initializer is sufficient.
- (xattributes, xattributes_mask): Static copy of attributes to set on
- all windows.
- (x_gram_init): Initialize it, looking up *backingStore resource.
- (x_gram_create): Call XCreateWindow with new attributes, instead of
- XCreateSimpleWindow. Input event selection is also done with
- attributes; don't call XSelectInput. Delay call to
- XResetScreenSaver until needed. Call XReconfigureWMWindow instead
- of duplicating code already in Xt library.
- (x_gram_expose): Default initialization suffices for partregion.
-
-Tue Apr 2 22:37:44 1991 Ken Raeburn (raeburn at portnoy.MIT.EDU)
-
- * server/uloc.C (ulogin_find): Now returns pointer to array element,
- which is ZLocation_t*, so that offsets work. Callers changed.
-
-Fri Mar 29 03:19:17 1991 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * config/Imake.template: Include config.Imakefile before testing
- values defined there.
- (GLOBAL_LINTFLAGS): Default `-bh', can override in config.Imakefile.
-
- * config/config.Imakefile (GLOBALCDEFS): Re-arrange handling and
- documentation. New flag -DNO_MALLOC_ZERO indicates malloc(0)
- returns null pointer. STRCASE stuff moved elsewhere.
- [_AIX && i386]: Changed many tests to just _AIX.
- (X11_NO_XAW): New symbol; defined if Athena widgets unavailable.
- (NO_LINT): Define on RS/6000.
- (GLOBAL_LINTFLAGS): Override with BSD defaults.
- (LINTLIBFLAG): Default to SysV; specify Vax/BSD, RT/ACIS, and Sun
- explcitly.
- (STRCASE): Define if str[n]casecmp not available.
- (CfrontCpp): No longer define.
- (MiscCcFlags) [_AIX && _IBMR2]: Use -Q (function inlining) on
- RS/6000.
-
- * include/zephyr/zephyr_internal.h (krb_err_base): Declare only if
- Z_HaveKerberos.
- [NO_MALLOC_ZERO] (Z_malloc): New variable, pointer to memory
- allocation function.
- [NO_MALLOC_ZERO] (malloc): Define as macro; call Z_malloc with 1 if
- arg is 0, arg otherwise. Declare malloc only if not NO_MALLOC_ZERO.
-
- * lib/Zinternal.c (function versions of library macros): No longer
- use inline function referring to original macro; duplicate the
- definition.
- [NO_MALLOC_ZERO] (Z_malloc): New variable; initialize to address of
- malloc.
-
- * lib/ZNewLocateUser.c: Inclusion of sys/select.h for AIX is no
- longer necessary.
- (ZNewLocateUser): Guard against zero-length allocations. Save
- string length rather than recomputing.
-
- * lib/ZParseNotce.c (ZParseNotice): Redefine macro BAD to reduce
- lint warnings.
-
- * lib/Imakefile (K_*): Renamed from KERR_*.
- (K_O, K_C, OBJS, SRCS): Compile ZFormatAuthenticNotice only when
- using Kerberos.
-
-Thu Mar 28 21:42:22 1991 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * lib/inet_ntoa.c: New file, broken of with hacked-up version of
- inet_ntoa routine.
- lib/Zinternal.c: Removed inet_ntoa and inclusion of strcasecmp.c.
- lib/Imakefile: Compile strcasecmp separately, if STRCASE is defined.
- Compile inet_ntoa on sparc under gcc.
-
-Tue Mar 26 20:35:09 1991 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * From eichin@watch.com:
- server/dispatch.C (nack_cancel): Enable "nack not found" message,
- and dump some useful information with it.
- (pktypes): Deleted in favor of library's ZNoticeKinds.
- (dispatch): Use ZNoticeKinds for debug message.
- server/zserver.h (relational operators on ZDestination): Declare
- explicit int return type.
- (pktypes): Declaration deleted.
- server/bdump.C (bdump_recv_loop, sbd_loop): Use ZNoticeKinds instead
- of pktypes.
-
-Mon Mar 25 03:18:56 1991 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * lib/ZParseNotice.c (ZParseNotice): A bcopy->assignment change was
- done backwards.
-
-Sun Mar 24 14:27:40 1991 John Carr (jfc at Achates.mit.edu)
-
- * zwgc/X_driver.c: Support X11 R5 per-screen resources.
-
-Sat Mar 23 09:18:14 1991 John Carr (jfc at Achates.mit.edu)
-
- * config/config.Imakefile: X11R3+ is now the default; define X11R2
- for older systems. Add LDFLAGS; use this for -Z and
- -L/usr/athena/lib.
- * config/Imake.rules: program() macro uses LDFLAGS.
- * ozwgc/Imakefile: include text extents fix if X11R2 is defined,
- instead of if !X11R3.
- * clients/xzwrite/interface.c: arg 3 to XtAppAddInput is type
- XtPointer.
- * clients/xzwrite/zephyr.c, xzwrite-proto.h: fix arguments to
- zeph_dispatch().
- * clients/xzwrite/edit_window.c: NULL != 0
-
-Fri Mar 22 18:19:42 1991 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * lib/ZCheckAuthentication.c (ZCheckAuthentication): Use Z_LIBDIR to
- compute pathname of srvtab file, instead of SERVER_SRVTAB (which is
- no longer available).
- * server/zsrv_conf.h: Added warning near SERVER_SRVTAB about keeping
- ZCheckAuthentication consistent.
-
- * include/zephyr/zephyr.h (ZGetSession): Removed C function
- declaration, since some C compilers can't handle the array return
- type.
- (Z_debug): Omit prototype (old-style decl instead) if varargs is in
- use.
- (ZNoticeKinds): Explicitly extern, for C++.
-
-Mon Mar 18 15:36:21 1991 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * tools/makeconfig (SUBDIR): clients/zinit no longer exists.
-
-Mon Mar 18 00:14:53 1991 Ken Raeburn (raeburn at watch.com)
-
- * include/zephyr/zephyr.h (varargs/stdarg): Include only if va_start
- isn't already defined.
-
-Sun Mar 17 14:21:11 1991 Ken Raeburn (raeburn at watch.com)
-
- * zhm/zhm.c: Removed explicit versions of default static
- initializers.
- (PIDFILE): Deleted default value; get it from Imakefile.
- [HESIOD]: Conditionalize on Z_HaveHesiod instead.
-
- * lib/ZWaitForNotice.c (Z_WaitForNotice): New file. Moved
- select/CheckIfNotice loop here. Modified to call ZCheckIfNotice
- before starting select loop.
- lib/ZLocations.c (Z_SendLocation): Call it.
- lib/ZSendPacket.c (ZSendPacket): Ditto.
- lib/ZRetrieveSubscriptions.c (Z_RetSubs): Ditto.
- lib/ZNewLocateUser.c (ZNewLocateUser): Ditto.
- lib/Imakefile: Include ZWaitForNotice.{c,o}.
-
- * include/zephyr/zephyr.h (Zconst): Define as "const" or empty.
-
- * lib/Zinternal.c (ZNoticeKinds): String array of names for notice
- kinds.
- include/zephyr/zephyr.h: Declare it.
-
-Fri Mar 15 11:08:22 1991 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * lib/ZFormatNoticeList.c (ZFormatNoticeList): Changed signature
- slightly to match prototype.
-
-Thu Mar 14 15:24:11 1991 Ken Raeburn (raeburn at watch.com)
-
- * server/dispatch.C (sendit): Compare Internet addresses as u_long
- values, rather than calling bcmp.
-
- * server/uloc.C (class ZLocation_t): All char* members are now type
- ZString, to simplify memory allocation problems. All references
- changed. Constructor and destructor deleted, since they are no
- longer needed.
-
- * server/zalloc.C (zalloc_count): Renamed from "count".
- (zmemset): Renamed from "memset".
-
- * lib/Zinternal.c (inet_ntoa): Provide this for Sun-4 compiles with
- gcc version 1.
-
- * include/zephyr/zephyr.h (ZGetSession): Declare as external before
- defining macro; include these only if Kerberos is enabled.
- (ZGetFD): Macro modified to not return an lvalue. Also declared as
- external routine.
- (ZQLength, ZGetDestAddr, ZGetRealm, ZSetDebug): Ditto.
- * lib/Zinternal.c: Define addressable functions for these macros.
-
-Wed Mar 13 10:26:41 1991 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * server/main.C (nacklist): Initialize it statically.
- (initialize): ...not here.
-
- * server/zserver.h (class SignalBlock): Removed.
- * server/main.C, server/server.C: All uses of SignalBlock converted
- back to explicit calls to sigblock/sigsetmask.
-
-Tue Mar 12 12:17:10 1991 Ken Raeburn (raeburn at watch.com)
-
- * lib/ZParseNotice.c (ZParseNotice): Call Z_debug if fields are
- missing, or if the version string (minor) is empty.
- * lib/Zinternal.c (Z_ReadWait): Call Z_debug if packet is all nulls.
-
- * include/zephyr/zephyr.h (ZSetDebug): New routine/macro, sets the
- routine responsible for printing debugging messages from the
- library.
- (__Z_debug_print,..._closure): Variables used by this macro.
- (Z_debug): New declaration.
- lib/Zinternal.c (__Z_debug_print*): Definitions.
- (Z_debug): New routine; calls debug-printing procedure, if non-null.
- (Z_debug_stderr): Utility routine; calls vfprintf with stderr.
-
- * config/config.Imakefile (GLOBALCDEFS): Define NO_VPRINTF when
- vfprintf isn't available.
-
- * zhm/zhm.h [sun, sparc]: Added more machine-name tests.
- (adjust_size): New macro for adjusting data size on machine-specific
- basis.
- * zhm/zhm.c (send_stats): Use adjust_size, or use -1 if not defined.
-
- * clients/zstat/Imakefile: No longer need to build src in server
- before running `depend'.
-
- * config/config.Imakefile (PidFile): New macro, returns directory
- name for .pid file.
- * zhm/Imakefile: Use it.
-
- * config/Imake.rules (makefile_target): Build new Makefile before
- renaming old one, then move it into place.
-
- * tools/makepaths: New script.
- * include/zephyr/zephyr_paths.h: New file generated by makepaths.
- * include/zephyr/Imakefile: Create it when config.Imakefile is
- changed.
- * include/zephyr/zephyr_conf.h: Include it. Conditionalize Kerberos
- stuff on Z_HaveKerberos rather than KERBEROS.
- * include/zephyr/zephyr.h: Conditionalize on Z_HaveKerberos rather
- than KERBEROS.
- * include/zephyr/zephyr_conf.h (SERVER_SRVTAB): Moved...
- * server/zsrv_conf.h: ...to here.
- * server/zsrv_conf.h (SERVER_LIST_FILE, ZEPHYR_ACL_DIR,
- ZEPHYR_TKFILE, DEFAULT_SUBS_FILE, SERVER_SRVTAB): Use Z_LIBDIR.
-
- * include/zephyr/zephyr_conf.h [!Z_HaveKerberos] (KRM_REALM):
- Deleted.
- * include/zephyr/zephyr.h (__Zephyr_realm): Define as constant
- string if not Z_HaveKerberos.
- * lib/ZInitialize.c (ZInitialize): Don't fill __Zephyr_realm if
- Kerberos isn't available.
- * lib/Zinternal.c (__Zephyr_realm): Don't allocate space for it if
- Kerberos isn't available.
- * lib/ZGetSender.c (ZGetSender): Call ZGetRealm, rather than
- accessing __Zephyr_realm directly.
-
- * server/main.C (detach, dump_db): Call moncontrol only on some
- architectures.
-
- * server/uloc.C [OLD_COMPAT, NEW_COMPAT]: Code deleted.
- (struct ZLocation_t): Members zlt_user and zlt_tty are now ZStrings.
- All accesses and allocations changed. Member zlt_exposure shortened
- to 16 bits under GNU compilers.
- (enum exposure_type): Removed extra name "_exposure_type".
- (ulogin_find): Cache notice instance in a ZString for efficiency.
- (ulogin_parse, ulogin_setup): Now take pointer to ZLocation_t*.
- (locations): Now ZLocation_t**; all accesses and allocations
- changed; many other variables changed.
- (ul_equiv): Replaced by operators == and !=. Callers changed.
-
- * server/zserver.h (GetKerberosData, SendKerberosData): Declare only
- for KERBEROS.
- * server/unix.h (rresvport): Declare if not KERBEROS.
- * server/client.C (client_register): Clear zct_block member only if
- KERBEROS.
-
-Mon Mar 11 20:00:49 1991 Ken Raeburn (raeburn at watch.com)
-
- * lib/acl_files.c (acl_abort): Eliminated return values.
-
- * lib/ZSendPacket.c (ZSendPacket): Declaration for wait_for_hmack
- should say "static".
-
-Sat Mar 9 13:43:34 1991 Ken Raeburn (raeburn at watch.com)
-
- * lib/ZRetrieveSubscriptions.c (Z_RetSubs): Declare before calling.
-
- * lib/acl_files.c (acl_abort): Now void. Moved declaration before
- use.
-
-Fri Mar 8 15:13:31 1991 Ken Raeburn (raeburn at watch.com)
-
- * include/zephyr/zephyr.h (ZFormatAuthenticNotice): Declare only if
- KERBEROS is defined.
-
- * include/Imakefile: If LOCAL_LIBS is defined, make links to
- com_err.h and ss header files.
-
- * clients/syslogd/syslogd.c: Don't include <krb.h>.
-
- * config/Imake.rules (do_subdirs, foreach_subdirs): Store exit
- status from `make' in a variable, and exit subshell with that
- status.
-
-Fri Mar 8 13:52:28 1991 John Carr (jfc at m16-034-4.mit.edu)
-
- * zwgc/ulong.h: AIX 1.2 defines a ulong type in <sys/types.h>,
- so include that file instead of declaring ulong.
-
- * zwgc/Memory/new_memory.c, zwgc/Memory/new_memory.c: don't
- use alternate memory functions unless DEBUG or MEMORY_DEBUG
- is defined.
-
-Fri Mar 8 11:47:02 1991 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- Many changes finally checked in:
-
- * server/zalloc.C (count) [ZALLOC_STATS]: New var; array of counters
- for free and allocated chunks of each size.
- (zalloc, zfree) [ZALLOC_STATS]: Adjust counters when appropriate.
- (alloc_size): Define in terms of sz.
- (zalloc): Use alloc_size for new allocations.
- [ZALLOC_DEBUG_PRINT]: Now covers printing code previously under
- ZALLOC_DEBUG.
- (zalloc) [ZALLOC_DEBUG && !ZALLOC_DEBUG_PRINT]: Scan list in bucket,
- just to verify that pointers are valid.
-
- * config/Imake.template (INCLUDE): Include $(ATHINCDIR) only of
- NeedAthIncDir is defined.
- * config/config.Imakefile (NeedAthIncDir): Don't define it, but
- describe when it's needed.
-
- * config/Imake.rules (library_obj_rule): Use LDSTRIPFLAGS and
- LDPROFSTRIPFLAGS to strip out symbols.
- (genutil, generate, test, program, cplusplus_program, suidprogram,
- program_spinst): Include GLOBAL_SYSLIBS in link step.
- * config/config.Imakefile (LD*STRIPFLAGS): Define these.
- (GLOBAL_SYSLIBS): Empty.
- (GLOBAL_SYSLIBS) [_AIX && i386]: Include -lbsd.
-
- * lib/Zinternal.c: Eliminated initializations that duplicated C's
- defaults.
- (version): Now local to Z_FormatHeader.
-
- * clients/zmailnotify/zmailnotify.c (main): If NO_FLOCK is defined,
- don't try calling flock.
- * config/config.Imakefile (GLOBAL_CDEFS) [_AIX]: Define NO_FLOCK and
- _BSD.
- (PROF_FLAG): Use -p on AIX on i386 as well.
- Also, don't build the server or syslogd under AIX.
-
- * server/zserver.h (ZClass_t constructor & destructor): Definitions
- now in class body.
- (Notice::Notice): Ditto.
- (ZNotAcked_t::ZNotAcked_t) [not __GNUG__]: Define, to avoid cfront
- lossage.
- (ZServerDesc_t): New member `addr', containing inet_ntoa string.
- server/server.C (setup_server): Set `addr' field.
-
- * server/zserver.h (class statistic): New type; counts events, and
- logs counter value.
- server/dispatch.C: Declare several "statistic" objects. Removed
- "register" declarations from function declarations.
- (dump_stats): Dump all their values to log, schedule another dump at
- +6hours.
- (handle_packet): First time through, schedule a stats dump for
- +5minutes.
- (dispatch): Reorder some logic to eliminate "dispatched" variable.
- (control_dispatch): If zdebug is true, log subscription
- cancellation.
- server/server.C: Bump counters when appropriate.
-
- * server/hostm.C: Made many error messages more informative. Also
- eliminated many (now-unnecessary) references to `sin_addr' in
- calling inet_ntoa. Enabled/disabled some debug messages. Use
- `addr' component in ZServerDesc_t instead of calling inet_ntoa.
- * server/server.C: Ditto.
-
- * server/kopt.c [ibm032]: Optimized versions of strlen and
- multiplication functions, from John Carr.
- (asm_wrapper_kopt_c): Wrapper function for asm code.
-
- * server/main.C (main): Initialize nacklist with pointer to bss
- storage, rather than calling malloc.
-
-Wed Mar 6 20:46:41 1991 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * server/zsrv_conf.h (NUM_REXMITS): Increased to 9 retries.
- (LOSE_TIMO): Give hosts a full minute.
-
-Thu Feb 28 18:31:57 1991 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/zalloc.h (zalloc, zfree): If MPROF is defined, make these
- inline routines calling standard C memory management.
- * zalloc.C: Don't compile any code if MPROF is defined.
-
-Wed Feb 27 22:14:37 1991 Ken Raeburn (raeburn at hodge.MIT.EDU)
-
- * server/zserver.h (inet_ntoa): Declare C version; define inline C++
- version that accepts sin_addr argument.
- server/hostm.C: Use the latter to simplify code.
-
- * server/zserver.h (ZDestination::order_strings): Renamed from
- compare_strings. All callers and definition changed.
-
-Fri Feb 22 16:38:37 1991 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * clients/zmailnotify/zmailnotify.c (main): Declare argv.
-
- * config/config.Imakefile (PROF_FLAG): Use -p on PS/2.
-
- * config/config.Imakefile (LDSTRIPFLAGS, LDPROFSTRIPFLAGS): New
- variables, flags to pass to linker to strip symbols from library
- files.
- (GLOBAL_LIBS): New variables, libraries always needed.
- config/Imake.rules (library_obj_rule, all program-building rules):
- Use them.
-
- * imake/imake.c (REDUCED_TO_ASCII_SPACE): Define this for AIX (at
- least for PS/2).
- (cpp_argv): Define _AIX explicitly if imake is compiled that way.
-
-Wed Feb 20 15:09:13 1991 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * clients/zmailnotify/zmailnotify.c: Changed all error messages
- printed to include program name and final newline.
- (fatal_pop_err): New function, implementing some common
- functionality from other routines.
-
- * clients/zmailnotify/zmailnotify.c: Changes from Mark Eichin:
- (main): Close pop connection as soon as possible.
- (multiline): Flush message bodies more efficiently.
-
-Mon Feb 4 16:08:04 1991 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/subscr.C: Made several log messages more clear or
- informative.
- (subscr_copy_def_subs): Recompute the hash value for the
- destination.
- (subscr_match_list): Create ZString objects when needed, not before.
- (subscr_cancel): Don't assume subscription listss are ordered.
-
- * server/ZString.h (no-argument constructor): Newly split off from
- other constructors. Always inline.
-
- * server/class.C (class_deregister): Disabled debugging log
- messages.
-
-Mon Jan 28 12:20:02 1991 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/server.C (admin_dispatch): If a bdump is in progress,
- discard offers.
- (send_stats): Add more machine specific info.
- (all routines): Use new/delete for ZHostList_t.
- server/hostm.C (all routines): Ditto.
-
- * server/main.C (dump_strings): Log "dump done" when finished.
- (main): Seed random number generator.
- (popular_ZStrings): Don't bother; string table order is now
- determined by hash value.
-
- * server/hostm.C (struct losinghost): Leading underscore removed
- from name.
- (losinghost::operator new, delete): New methods; use zalloc. All
- allocations and deallocations changed from xmalloc/free.
- (losing_hosts): Explicit version of default initializer removed.
- (NULLLH): Definition deleted.
-
- * server/zserver.h (ZDestination): Definitions of hash and set_hash
- now in class body.
- (class ZServerDesc_t): Now a class rather than struct. Member
- zs_state is private; new methods state and set_state created for
- accessing. All accesses changed.
- server/server.C: Several friends of ZServerDesc_t now non-static.
-
- * server/ZString.C: Rearranged some functions for inlining.
- (initialize(cst char*,int)): Use a static buffer rather than an
- automatic array.
- (initialize(*)): Reordered downcase-handling logic for efficiency.
-
- * server/bdump.C: Increased verbosity of many syslog strings.
- (setup_file_pointers): Now returns int, indicating
- success or failure.
- (ticket_time, my_realm): Moved to other Kerberos decls.
- (bdumping): Removed zero initializer.
- (bdump_send): Rearranged some logic to be tidier.
- (shutdown_file_pointers): Only call fclose on non-null FILE
- pointers, and only call close if the file descriptor is not -1.
-
- * server/bdump.C: Minor change to dump/offer protocol.
- (bdump_offer): Now offer version 1A.
- (bdump_send): If already doing a bdump, decide which connection to
- punt.
- (cancel_outgoing_dump): New var, non-zero if a higher-precedence
- dump has started.
- (bdump_recv_loop): If cancel_outgoing_dump is non-zero, punt
- connection.
- (bdump_send_loop): Ditto.
- (bdump_get_v1_guts): Internals of old bdump_get.
- (bdump_get_v1): Rest of old bdump_get; closes listening socket.
- (bdump_get_v1a): Like bdump_get_v1, except listening socket is kept
- open.
- (bdump_get): Decide which to call.
-
- * server/unix.h (srandom, getpid): Added extern declarations.
-
- * server/common.C (hash): Improved behavior for short strings;
- reduced duplicate hash values.
-
- * server/bdump.C (bdump_sin): Now static in this file.
- server/zserver.h: Delete declaration.
- server/main.C: Delete initialization.
-
- * server/Set.hT: Removed duplicate inclusions of header files.
-
- * server/dispatch.C: Fixed up preprocessing problems.
- (dispatch): Now static.
- server/zserver.h (dispatch): Moved declaration to dispatch.C.
-
- * server/dispatch.C (dispatch): New argument from_server obviates
- need to call server_which_server a second time.
- (handle_packet): Pass it.
-
-Wed Jan 23 09:56:17 1991 John Carr (jfc at Achates.mit.edu)
- * zwgc/ulong.h: On AIX 1.2, include <sys/types.h> to get
- ulong definition.
-
-Wed Jan 9 02:36:13 1991 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * zwgc/formatter.c (*_set character classes): Now const.
- (not_contains): Character class argument is now const.
- * zwgc/exec.c (opstuff): Now const.
-
-Mon Jan 7 12:20:03 1991 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * config/config.Imakefile (BuildServer): New symbol.
- [vax] (MiscGplusplusFlags): Pass -DFIXED_GXX and -Z.
- (CfrontCpp): Handling cleaned up.
-
- * Incorporated variants of changes from Paul Traina of Stanford
- University, <pst@ack.Stanford.EDU>:
- * clients/syslogd/syslogd.c (sighandler_type): Defined as "void" or
- "int", as appropriate.
- (die, domark, reapchild): Return this type.
- * config/config.Imakefile (ATHINCDIR): New variable, specifies where
- Athena-originated header files (e.g., Kerberos, Hesiod, Zephyr) go.
- (ETCDIR): New variable.
- (KRB_LIB, DES_LIB, HES_LIB, SS_LIB, COMERR_LIB): Search LIBDIR.
- * config/Imake.template (INCLUDES): Use ATHINCDIR for Kerberos and
- other header files.
- * et/compile_et/error_table.y: Don't include stdlib.h if ibm032 is
- defined.
- * lib/Imakefile (install): Install header files in ${ATHINCDIR}.
-
-Sat Dec 29 01:33:31 1990 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * server/hostm.C (hm_recipient): Construct hostmanager recipient
- name from local realm, rather than assuming Athena, and cache it.
- (hostm_deathgram, ping): Call it.
-
-Fri Dec 28 17:51:50 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/Set.hT (SetHashSize): New default value is 1024, to
- simplify modulus operations.
-
- * server/ZString.h, ZString.C (ZString::insert(const char*)): Now
- takes an int argument denoting length, and passes it through to
- ZStringRep constructor.
- (ZString copy constructor): Now always inline.
-
-Thu Dec 27 13:32:45 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/ZStringRep.h (operator==, ZStringRep::hash,
- ZStringRep::value): Reordered functions to get inlining working
- better under cfront.
-
- * include/zephyr/zephyr.h (ZSendList): Added prototype.
-
-Sat Dec 22 23:53:33 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/ZStringRep.c (operator ==): Now compares hash values.
-
-Sat Dec 22 17:33:38 1990 John Carr (jfc at Achates.mit.edu)
-
- * lib/acl_files.c: Only define MAX and MIN macros if not already
- defined.
- * lib/ZSendList.c: cert_routine argument is type Z_AuthProc.
-
-Fri Dec 21 17:19:57 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * Integrated some changes from A/UX port by vrt@athena.mit.edu:
- * zmailnotify.c: Eliminated unneeded header files, cleaned up
- preprocessor directives.
- * include/zephyr/zephyr.h: Include <time.h> for macII (running A/UX)
- also.
- * include/zephyr/zephyr_conf.h: Define fd_set macros for macII. (Is
- this really necessary??)
- * ozwgc/main.c (vfork): On macII, defined to be `fork'.
- * server/main.C (main): Setpriority isn't supported by macII.
- * zhm/zhm.c (srandom): Define to be srand48 on macII.
- * zwgc/Imakefile (LIBS2): Use -lc and -lPW on macII.
- (LIBS): Include LIBS2.
- * config/config.Imakefile (GLOBALCDEFS): List recommended options
- for Mac A/UX.
-
-Fri Dec 21 09:22:11 1990 John Carr (jfc at Achates.mit.edu)
-
- * clients/zmailnotify/zmailnotify.c, zhm/zhm.c, ozwgc/draw.c:
- Change NULL to '\0'.
- * clients/syslogd/syslogd.c: Fix bug with constant strings.
- * clients/xzwrite/util.c: Print newline after error messages.
- * zwgc/xmark.c: change an array index to type (unsigned char).
- * ozwgc/inter_zep.c: include <arpa/inet.h>
- * ozwgc/main.c: add missing argument to fprintf()
-
-Thu Dec 20 02:58:18 1990 John Carr (jfc at Achates.MIT.EDU)
-
- * include/zephyr/zephyr.h (SRV_TIMEOUT): New constant for timeout
- when waiting for server rather than host manager; initial value 30
- seconds.
- (HM_TIMEOUT): Back to 10 seconds.
- * lib/ZNewLocateUser.c (ZNewLocateUser): Use SRV_TIMEOUT instead of
- HM_TIMEOUT.
- * lib/ZRetrieveSubscriptions.c (ZRetrieveSubscriptions): Ditto.
- * lib/ZLocations.c (Z_SendLocation): Ditto. Also set file
- descriptor masks inside loops before select, instead of assuming
- they'll remain unchanged.
-
-Sun Dec 16 12:55:57 1990 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * server/ZStringRep.h (ZStringRep::ZStringRep, ZStringRep::init):
- Added new "length" parameter to these methods, defaulting to -1.
- * server/ZStringTable.C (ZStringRep::init): If length supplied is
- not -1, use it instead of calling strlen.
- * server/ZString.h (ZString::insert of const char *): New parameter
- "length".
- * server/ZString.C (ZString::insert(const char*,int)): Pass it
- through to ZStringRep constructor.
-
- * server/Set.hT, Set.CT (operators new and delete): Inline these
- methods.
-
- * server/main.C (main): Always log "ready for action" message.
-
-Fri Dec 14 10:57:54 1990 John Carr (jfc at achates.mit.edu)
-
- * clients/zwrite/zwrite.c: zwrite was writing past the
- end of space allocated by malloc when reading from a terminal.
-
-Fri Dec 14 02:19:48 1990 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * lib/ZReadAscii.c (ZReadAscii): Temporary variables c1, c2 are now
- ints.
-
- * include/zephyr/zephyr.h (HM_TIMEOUT): Up to 30 again.
-
-Thu Dec 13 11:35:33 1990 John Carr (jfc at achates.mit.edu)
-
- * lib/ZFormatNoticeList.c: cert_routine argument is type Z_AuthProc
-
-Wed Dec 12 05:50:17 1990 Ken Raeburn (raeburn at hodge.MIT.EDU)
-
- * lib/ZReadAscii.c (Z_cnvt_xtoi): Rewritten as a macro, for speed.
-
- * server/bdump.C (net_read, net_write): Use stdio file pointers
- rather than UNIX file descriptors. Buffering should improve
- performance, at least on reading.
-
- * server/zserver.h (operator != for ZDestination): Defined as
- negative of ==.
- (dump_masks): New constant; signal mask to inhibit database and
- string table dumps.
- (ZServerDesc_t.zs_state): Eliminated enumeral bit field.
- Also reordered some functions.
-
- * server/Set.hT, server/Set.CT: Linked lists are now ordered by hash
- value. Set::find and other functions adjusted accordingly.
- (operators new and delete): Now conditionalized on FIXED_GXX, like
- 11 December change to server/zserver.h.
- (SetIterator class): Fixed up iterator definition to actually work.
- (Set::find): Can now return pointer to first element with too-high
- hash value. Callers adjusted accordingly.
-
-Wed Dec 12 02:05:18 1990 John Carr (jfc at achates.mit.edu)
-
- * include/zephyr/zephyr_internal.h: comment text after #endif
- * include/zephyr/zephyr.h: include <time.h> for AIX 3.1
- * lib/ZLocations.c, lib/ZNewLocateUser.c, lib/ZSendPacket.c,
- lib/ZRetrieveSubscriptions: include <sys/select.h> for AIX
- * zwgc/main.c: signal_child() returns void, support systems
- without type (union wait)
- * zwgc/notice.c: ctime() don't assume that the fields of a
- struct timeval can be passed to ctime()
- * zwgc/mux.c: include <sys/select.h> for AIX
-
-Wed Dec 12 01:02:01 1990 Ken Raeburn (raeburn at hodge.MIT.EDU)
-
- * server/zsrv_conf.h (TIMO_TARDY): Wait 2 minutes between "hello"
- notices to tardy servers.
- (H_NUM_TARDY): Send 5 notices before marking tardy server dead.
-
- * server/server.C (kill_clt): New argument, server sending notice.
- Address logged when errors occur. All callers changed.
-
- * server/main.C (dump_strings): Preserve errno.
- (dump_db): Ditto.
- (do_reset): Ditto.
- (reap): Ditto. Also, call wait3 until we're told we have no more
- children.
- (popular_ZStrings): Remove "%me%".
-
- * server/kstuff.C (SendKerberosData): Removed some unused code. Now
- logs source address when ZReadAscii, krb_rd_req, krb_get_cred, or
- the checksum verification fails.
-
-Tue Dec 11 23:56:08 1990 Ken Raeburn (raeburn at hodge.MIT.EDU)
-
- * server/zserver.h (class ZDestination): Always use separate
- destructor function. Overload operators new and delete like other
- classes do.
- (classes ZHostList_t, ZNotAcked_t, ZSrvPending_t): Removed leading
- underscores from type names, and `typedef' constructs.
- (all operators new and delete): Conditionalize on __GNUG__ not
- defined or FIXED_GXX defined, rather than just the former.
- server/class.C (ZDestination::~ZDestination): Always implement.
- * config/config.Imakefile (FIXED_GXX): Define it, for Athena.
-
-Wed Dec 5 23:21:40 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * config/Imake.rules, config/config.Imakefile: Changed all `C++'
- variable names to `CXX'.
-
-Sat Dec 1 17:33:27 1990 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * lib/ZFormatNotice.c (ZFormatNotice): Argument cert_routine is type
- Z_AuthProc.
-
- * clients/xzwrite/xzwrite.bitmap: Copied from SIPB bitmaps; default
- bitmap used by xzwrite.
- clients/xzwrite/XZwrite (*icon.bitmap): Specify bitmap path relative
- to ACLDIR.
- clients/xzwrite/Imakefile (install): Install xzwrite.bitmap, and
- edit XZwrite to have the correct pathname for it.
- (CODE): Add xzwrite.bitmap.
-
- * clients/xzwrite/Imakefile (DEFINES): X application-default search
- path should end with "%N".
-
- * clients/zctl/zctl.c (main): Print newline after error message.
-
-Fri Nov 30 08:44:20 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * lib/ZFreeNotice.c (ZFreeNotice): Always return zero.
-
-Mon Nov 26 10:58:54 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * All source files tagged with version ASR72A. (Changes made today
- not included.)
-
- * Created libdyn/profiled, in case `makeconfig' isn't used.
-
- * clients/xzwrite/Imakefile (install): All installs must be relative
- to $(DESTDIR).
-
- * lib/ZParseNotice.c: Removed debugging `abort' version of
- ZERR_BADPKT macro that slipped in.
-
-Sat Nov 17 01:25:29 1990 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * include/zephyr/zephyr.h (HM_TIMEOUT): Increase to 10 seconds.
-
- * server/class.C (class_get_acl): Check entire destination, rather
- than just class name, when looking for acl.
-
-Fri Nov 16 10:28:13 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * server/kstuff.C (ZCheckAuthentication): Don't log messages about
- zero-length authenticators.
-
- * ss/lib/parse.c (ss_parse): Set *argc_ptr to 0 in error cases.
-
- * clients/syslogd/syslogd.c: Conditionally (on macII) include
- sys/types.h and time.h, and use setvbuf instead of setlinebuf.
- [from vrt@athena.mit.edu]
-
- * lib/ZLocations.c (Z_SendLocation): If gethostbyname returns no
- info, just use local host name.
-
- * libdyn, clients/xzwrite: New directories.
- Imakefile, clients/Imakefile: Build them.
- tools/makeconfig: Include them.
-
- * server/Imakefile: Added to ${HDRS} all the header files that are
- used, so "make depend" does the right thing.
-
- * server/unix.h: Fixed prototypes for Kerberos routines, and
- conditionalized them. Added prototype for hes_resolve.
-
- * config/Imake.rules: Added support for ucode libraries, if
- HaveUCode is defined. Reorganized some rules duplicating lots of
- commands.
- config/config.Imakefile (HaveUCode): Define it on MIPS.
-
- * config/Imake.template: Add definitions for dynamic-array library.
-
- * lib/ZLocations.c (Z_SendLocation): Rewrote handling of select
- call.
-
- * clients/zstat/zserver.h: Copied from server/zserver.h, before
- conversion to C++. Cut down to needed definitions.
- clients/zstat/zstat.c: Use the former instead of the latter.
- clients/zstat/Imakefile: Reflect this change.
-
-Thu Nov 15 13:08:34 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * zwgc/zwgc.desc: Display recipient of class "message" notices.
- Also reorganized layout of fields to avoid really long lines.
-
- * include/zephyr/zephyr.h (HM_TIMEOUT): Reduce to 5sec from 30sec.
-
- * lib/ZParseNotice.c (next_field): New macro, finds next field of
- message. Defaults to old action, but on vax and mips faster version
- is available.
- (ZParseNotice): Use it. Also use a union of types rather than
- casting the address of an int array. When appropriate, use sizeof
- instead of strlen.
-
-Wed Nov 14 23:41:48 1990 Ken Raeburn (raeburn at hodge.MIT.EDU)
-
- * server/access.h (acl_load): Declare it.
-
- * include/zephyr/zephyr.h: More prototypes added; further C++
- changes.
- * include/zephyr/zephyr_internal.h: Treat C++ like standard C.
-
- * server/server.C (get_server_addrs): Cleaned up Hesiod code for C++
- use.
-
-Tue Nov 13 17:31:24 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * config/config.Imakefile: Use -p for profiling on mips.
-
- * zwgc/xshow.c: Include <X11/Xresource.h>, for XrmUniqueQuark
- declaration.
-
- * config/config.Imakefile: Don't automatically use -g with gcc,
- until we've separated out library flags from program flags.
-
- * config/{config.Imakefile,Imake.rules}: Added support for C++
- programs, compiled with either g++ or cfront. Also enabled
- P0INVALID code on Vax and RT, and read-only strings on RT.
-
- * server directory, ChangeLog file: Merged in server changes
- (audited by lwvanels). RCS tag ZSRV3PT21 added.
-
- * man/man1/zwrite.1: Restored documentation of `-O' option and
- `zwrite-opcode' Zephyr variable.
-
-Fri Nov 9 14:33:13 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * clients/zwrite/zwrite.c (main): For default display formats
- including signatures, add "From: " before the name.
-
- * clients/zwrite/zwrite.c (main): Made character buffers and
- ZNotice_t structure static (and therefore automatically
- initialized).
-
- * lib/Imakefile: Simplified Kerberos conditional code.
-
- * zwgc/xshow.c (xres_get_resource): New function replacing
- xres_get_{geometry,bgcolor}, with data tables controlling
- behavior.
- (xres_get_{geometry,bgcolor}): Now macros calling above.
-
- * zwgc: Version 0.4.2 frozen and put up for testing; future
- changes should include update of version number.
-
- * zwgc/xshow.c (mode_to_colorname): Modified to use
- xres_get_resource. Also removed spurious "style" that was being
- inserted into the resource name.
- main.c (zwgc_version_string): Raised to 0.4.3.
-
-Thu Nov 8 17:34:23 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * zwgc/tty_filter.c (struct _tty_str_info): Make flags into
- bitfields.
-
- * zwgc/X_gram.c (x_gram_create): Only beep once.
- zwgc/tty_filter.c (convert_desc_to_tty_str_info): Ditto. Also
- simplified Saber-bug/non-ANSI workaround.
- man/man1/zwgc.1: Documented change.
-
-Wed Nov 7 19:00:28 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * zwgc/X_gram.c (x_gram_init): Prefixed time-to-live resource
- names with "min", making room for future "max" variant.
- man/man1/zwgc.1: Documented change.
-
-Tue Nov 6 14:04:07 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * zhm/zhm.c: Commented out text after #endif directives.
- (send_stats): MIPS measures data size from 0x10000000, like IBM RT
- does.
-
-Sun Nov 4 10:26:22 1990 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * zwgc/xselect.c (xselSetProperties): Cast argument of XFree to
- char* to avoid compiler errors on the RT.
-
- * lib/ZVariables.c (get_localvarfile, get_varval, varline): Added
- static declarations.
-
- * server/ZStringRep.h (ZStringRep_magic): Never define.
- server/ZString.h (ZString_magic): Ditto.
-
- * server/zalloc.C (BUCKET): Use quotient, not remainder, to choose
- bucket number.
-
- * server/acl_files.c (ACL_LEN): Raised from 16 to 256. Should be
- deleted eventually.
- (CACHED_ACLS): Raised from 32 to 64.
- [WRITE_ACL]: Conditionalized compilation of code involved in
- editing acl files.
- (KRB_REALM): Default definition deleted.
- (destroy_hash): Void return.
- [#if 0]: Some debug code, currently disabled.
-
- * server/class.C (class_setup_restricted): Don't pull class name
- out of ZDestination record to initialize new ZDestination record,
- when the new record will be the same as the old.
-
- * server/kstuff.C (add_to_cache): Fixed bug in access to expire
- method.
-
- * server/unix.h [ibm032] (LOCAL_ALLOC): Since we can't really
- access the builtin _Alloca from C++, call alloca instead.
-
- * server/bdump.C (sbd_loop): To avoid calling malloc, use a
- fixed-size automatic buffer for zeph_version if it'll fit.
-
-Thu Nov 1 17:20:03 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * server/access.C (access_setup): Merged function, from
- access_init and access_reinit.
- (access_init, access_reinit): Trivial functions that call
- access_setup.
-
-Wed Oct 31 15:10:13 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * zwgc/main.c (signal_child): Preserve value of errno.
-
- * server/main.C (dump_strings): Rename output file to
- zephyr.strings.
-
- * server/kstuff.C (add_to_cache): Call expire method, rather than
- calling zfree, to localize memory-manager dependencies.
-
-Tue Oct 30 01:31:31 1990 Ken Raeburn (raeburn at binkley.MIT.EDU)
-
- * server/client.C (client_deregister): Delete client, rather than
- calling clt_free to do it.
- (clt_free): Deleted.
-
-Mon Oct 29 04:35:02 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/kstuff.C: Removed unused variable cache_initialized.
- (AuthEnt::expire, add_to_cache, ZCheckAuthentication): Use zalloc
- and zfree for saved authenticator strings.
-
- * server/ZString.h (ZString::length): New method.
- server/ZString.C (ZString::initialize for const ZString&): Use it.
-
- * server/kstuff.C (ZCheckAuthentication): Only calculate the
- length of the ASCII form once.
-
- * server/ZStringRep.h (ZStringRep::len): New field, length of
- string.
- (ZStringRep::length): New method, returns it.
- (operator==): Compare it before calling strcmp.
- server/ZStringTable.C (ZStringRep::init): Set it.
- (ZStringRep::~ZStringRep): Use it, rather than calling strlen, for
- argument to zfree.
-
- * server/ZStringRep.h (ZStringRep::is_copy): New field, indicating
- whether field `str' was allocated by this class. Bitfield of
- length one.
- (ZStringRep::magic, ZStringRep_magic): Now `unsigned short'.
- (ZStringRep::ZStringRep): Now takes a `nocopy' argument,
- defaulting to 0. Pass it through to init.
- (ZStringRep::init): Also takes `nocopy' argument.
- server/ZStringTable.C (ZStringRep::init): If `nocopy' is non-zero,
- use the string value passed in.
-
- * server/common.C (hash): Preserve more bits.
-
- * server/zalloc.C (BUCKET): New macro; returns bucket number given
- size. Adjusted to use bucket 0 for one-word requests.
- (ROUND): New macro; rounds argument (lvalue) up to next multiple
- of sz.
- (zalloc, zfree): Use them.
- (alloc_size): Raised to 16K minus overhead.
-
- * server/zserver.h (struct ZClient_t): Removed leading underscore
- from primary name.
- (ZClient::last_check): New field: Last time owning server was
- prodded to check if client still exists.
- (ZClient::ZClient): New method; initialize last_check and last_msg
- to 0.
-
- * server/zalloc.C (memset): New routine for debugging; overwrite
- region with specified byte value.
- (ZALLOC_DEBUG code): More debugging code, now disabled.
- (zfree): Fix to enter proper value in free list, rather than
- address of bucket.
-
- * server/Set.hT (Set::print): New function; call obj.print for
- each object in the set.
- server/ZStringRep.h (ZStringRep::print): New function; print ref
- count and string contents to specified file.
- server/ZString.h (ZString::print): New static method; call print
- method of string table.
- server/main.C (dump_strings): New function; calls ZString::print
- to dump string table into /usr/tmp/zephyrd.strings.
- (main): Call it on SIGEMT.
-
-Tue Oct 23 11:36:49 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * server/zalloc.C: New file. Contains routines for more compact
- memory allocation.
- * server/zalloc.h: Declarations for external use.
- * server/Imakefile (SRCS, OBJS): Include it.
- * server/Set.hT (class SetRec): Define operators new and delete,
- using the zalloc routines. Use only if __GNUG__ not defined (bug
- workaround).
- * server/zserver.h (ZSubscr_t, ZClient_t, ZClientList_t, ZClass_t,
- ZHostList_t, ZNotAcked_t, ZSrvPending_t): Likewise.
-
-Mon Oct 22 04:11:38 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * clients/zctl/zctl.c (main): Fixed up format of error message
- printed for request given on command line.
-
- * lib/Zinternal.c (Z_AddField): Treat a null pointer as a
- zero-length string.
- [from dcj%flume@decwrl.dec.com]
-
- * zwgc/X_gram.h (x_gram.can_die): New field; indicates first time
- when the window should respond to ButtonRelease events and delete
- itself.
- * zwgc/X_gram.c (ttl): New variable; minimum-time-to-live of X
- windowgrams.
- (x_gram_init): Set ttl from timeToLive/TimeToLive X resource.
- (x_gram_create): Include StructureNotifyMask in selected input.
- Simplified a conditional; added comments.
- * zwgc/xcut.c (xdestroygram): New function, taken from xcut; does
- work of deleting a windowgram. Augmented to perform minimum-ttl
- last-minute cancellation.
- (xcut) [ButtonRelease]: If "control" key is down, delete all
- windows at the specified coordinates, rather than just the window
- containing the mouse pointer. Call xdestroygram to delete them.
- [MapNotify]: Initialize "can_die" field with current time plus
- ttl.
- [from marc@athena.mit.edu]
-
- * zwgc/main.c (zwgc_version_string): Set version to 0.4.2.
-
-Fri Oct 19 06:09:22 1990 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * clients/zshutdown_notify/zshutdown_notify.c (main): Moved the
- ZInitialize call to after the Kerberos setup code.
- zwgc/standard_ports.c (init_standard_ports): Use ZWGCPATH in error
- message rather than explicit path.
- zwgc/Imakefile (DEFINES): Define ZWGCPATH.
- [from jtkohl@athena.mit.edu]
-
- * zwgc/X_driver.c (open_display_and_load_resources): X bug
- workaround: Don't call XrmGetStringDatabase with null value.
- [from epeisach@athena.mit.edu]
-
- * clients/zwrite/zwrite.c (main): Incorporate time and date into
- default message formats.
-
- * zhm/zhm.h: Minor preprocessing changes for ANSI compliance.
- ozwgc/zbrowser/Viewport.h: Ditto.
- makedepend/def.h: Ditto.
- include/zephyr/zephyr_internal.h: Ditto.
- include/zephyr/zephyr.h: Ditto.
- [from jik@athena.mit.edu]
-
- * lib/ZLocations.c (Z_SendLocation): If ttyname returns null, use
- a location of "unknown".
-
- * zwgc/port.c (defined (__HIGHC__)): Changed from ibm032, since
- higher-level compiler errors aren't specific to hardware platform.
-
- * zwgc/standard_ports.c (init_standard_ports): If -ttymode is
- given, disable X driver.
- [from warlord@athena.mit.edu]
-
- * lib/ZSendPacket.c (ZSendPacket): Removed unreachable return
- statement.
-
- * lib/Zinternal.c (Z_ReadWait): Check for failure allocating
- header field.
- (Z_FormatHeader): Use assignment rather than bcopy for
- ZUnique_Id_t values. Initialize checksum to 0 if no certification
- routine is provided.
- (Z_FormatRawHeader): Use a union of different types, rather than
- assuming "int" will cover all, for "temp".
-
- * server/kopt.c (krb_get_lrealm): Cache value after reading it
- once.
-
-Thu Oct 18 23:41:24 1990 Ken Raeburn (raeburn at bill-the-cat.MIT.EDU)
-
- * include/zephyr/zephyr.h (<netinet/in.h>): Moved include to
- inside `extern "C"' section.
- (various): Cleaned up whitespace to get names aligned again.
- (ZSubscriptions_t "z_class" field): Got rid of this (unused) name,
- in favor of the new one.
- (ZGetFD): Use inline function for C++ rather than macro.
- (ZQLength, ZGetDestAddr, ZGetRealm): Ditto.
- (Z_MAXQLEN, ZERR_NONE, HM_TIMEOUT, ZAUTH, ZNOAUTH): Const values
- for C++, rather than macros.
- Also added lots of missing library routine declarations.
-
- * include/zephyr/acl.h: Added ANSI/C++ versions of declarations.
-
- * Server changes to date:
- * server/uloc.c: Added unauthentic-zlocate changes.
- * server/ZString*, server/Set*: Separated out functions that
- cannot be made inline, made a separate source file.
- * server/xxx.c: New source file, for anything that doesn't compile
- correctly in C++ code (e.g., unions under cfront).
- * server/* (struct ZDestination): Combination of class/inst/recip,
- with its own methods. Now used where the triple was used before.
- Non-inlined methods are in class.C.
- (struct Notice): Parsed notice, including ZString for sender and
- ZDestination, as well as original ZNotice_t. Should be used more
- thoroughly.
- * server/zserver.h (class_is_*): Functions now inline.
- (many constants): Replaced macros with constants of same name.
- (msgs_queued): Inline function, replaces macro.
- * server/*: Most "zdbug" calls, other DEBUG logging code, now
- under "#if 0". Some "#if 1" for now; change as needed.
-
- * server/version.C: Manually changed version to 3.20.90.
-
-Sun Sep 9 14:02:50 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/kopt.c (krb_rd_req): Copied from Kerberos library; added
- cache to minimize des_key_sched calls.
-
-Thu Sep 6 02:49:25 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * server/zserver.h (struct ZClient_t): Changed zct_principal to
- ZString.
-
- * server/kstuff.C (ZCheckAuthentication): Copied from library;
- added interaction with new authenticator cache.
-
- * server/zserver.h: Created new ZDestination class.
- (struct ZSubscr_t, ZClass_t): Use it.
- (struct ZClass_t): Changed zct_classname to ZString; created
- constructor and destructor methods.
-
- * server/ZString.[hC]: Added declaration and definition of
- operator== for comparing ZString objects. Removed debugging
- printf statements.
-
-Tue Sep 4 18:31:15 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * Server changes:
- * Added constructors for ZSubscr_t.
- * Added ZString class (not based on a String class at the moment);
- incorporated into ZSubscr_t. Also changed all references to use
- ZString or to use value() method.
- * Changed "class" to "class_name" or "z_class" throughout.
- * Ran all files through protoize; added declarations to zserver.h
- and other header files as needed.
-
-Tue Sep 4 09:50:30 1990 Lucien Van Elsen (lwvanels at fionavar.mit.edu)
-
- * lib/ZMakeAuthentication.c: Fixes to set last_authent_time
- correctly. [auditor: raeburn]
-
- * clients/zctl/zctl.c (main): Error code is returned by
- ss_execute_line; it doesn't take pointer-to. [auditor: raeburn]
-
-Thu Aug 16 22:51:03 1990 Ken Raeburn (raeburn at podge.MIT.EDU)
-
- * server/class.c (hash): Speed it up (on the vax) by using signed
- arithmetic. Also, re-implement the hash function the way it was
- originally intended.
-
-Thu Aug 16 22:44:51 1990 Ted Ts'o (tytso at binkley.MIT.EDU)
-
- * server/class.c (class_restrict): Don't #ifdef this out.
- [Audited by raeburn]
-
- * server/subscr.c (subscr_subscribe_real): If bdumping, don't
- bother checking the acl. [auditor: raeburn]
-
-Thu Aug 16 21:35:12 1990 Ken Raeburn (raeburn at podge.MIT.EDU)
-
- * server/kstuff.C (SendKerberosData): Changed so that Kerberos error
- message are sent with the Kerberos error base added to them; the
- routines in bdump.c which use SendKerberosData were changed to uses
- error_message() to decode the error returns from
- SendKerberosData(). This prevents a core dump from happening when
- SendKerberosData returned ZSRV_PKSHORT and the bdump_() routines
- tried to index the return through the Kerberos error table.
- [audited by tytso]
-
-Fri Jul 27 11:15:09 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * Previous changes have been incorporated into Athena release 7.1.
- RCS logs tagged with ASR71A.
-
-Mon Jul 16 09:18:15 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * include/zephyr/zephyr{,_internal}.h: Added prototypes and some
- minimal C++-compatibility code. [audited by jfc]
-
- * config/config.Imakefile (UseGcc,CC,DBG): Build with gcc if
- UseGcc is defined; define UseGcc by default on vax.
- (LINTLIBFLAG): Use -o rather than -C on DECstation, which is
- SysV-based.
- [audited by jfc]
-
-Sun Jul 15 17:13:19 1990 Ken Raeburn (raeburn at hodge.MIT.EDU)
-
- * lib/ZMakeAuthentication.c (ZMakeAuthentication): Kerberos
- authenticators less than two minutes old may be re-used.
- (ZResetAuthentication): New function: Clears this cache.
- [audited by marc]
-
- * lib/Z{Make,Read}Ascii.c: Partially rewritten for speed.
- [audited by marc]
-
- * man/man1/zmailnotify.1: Corrected description of case with more
- than four mail messages. [from krishna]
-
- * man/man1/zwgc.1: Added description of ``transient;'' corrected
- description of signal handling. [from marc]
-
-Thu Jul 12 13:56:49 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * clients/zctl/zctl.c: Include <com_err.h>; don't declare index
- when including <string.h>; don't declare malloc several times.
- [from jfc]
-
- * clients/zpopnotify/zpopnotify.c: Include <com_err.h>. Don't
- declare rindex when string.h is included; removed unused variable.
- [from jfc]
-
-Thu Jul 5 17:04:18 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * Added ASR70F RCS tag to all RCS files.
-
-Thu May 24 22:38:42 1990 Ken Raeburn (raeburn at jellicle.MIT.EDU)
-
- * Reverted "punt" semantics, for this release. (Turned over to
- rel-eng.)
- * main.c: Renamed relevant variables from "sender" to "recipient".
- Also, use recipient rather than when checking for puntable
- addresses.
- * subscriptions.c: Go back to previous version, which doesn't try
- to deal with wildcards as such.
-
-Mon May 21 23:39:59 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * Punted "pretty" hacks. (Turned over to rel-eng.)
- * clients/zwrite/zwrite.c: Removed -p argument; default opcode is
- empty.
- * zwgc/zwgc.desc: Never use verbatim.
-
-Thu May 17 01:35:19 1990 Ken Raeburn (raeburn at multics.MIT.EDU)
-
- * Started ChangeLog, logging changes from marc, jfc, and myself as
- I audit or enter them.
-
- * server/uloc.c (uloc_dump_locs): Changed "??" to "?" to avoid
- trigraph problems.
-
- * zwgc/port.c (create_port_from_files): Added workaround for bug
- in RT hc compiler version 2.1y.
-
- * lib/ZSendPacket.c (ZSendPacket): Use select to determine when to
- check for response, rather than polling periodically.
- (wait_for_hmack): Explicitly declare type.
-
- * zwgc/exec.c (exec_process_packet): Fixed counting of fields,
- including accounting for old version of zwrite that appended an
- extra null byte.
-
- * zwgc/subscriptions.c: Rewrote "punt" list handling code.
-
- * zwgc/main.c (zwgc_version_string): New variable, replaces
- multiple literal occurrences of version number. New version
- number is 0.4.1.
- (fake_startup_packet): Use it. Also use current time.
- (setup_signals): Take DOFORK argument; if set, ignore signals INT,
- TSTP, QUIT, rather than exiting or dying.
- (main): Pass DOFORK to setup_signals.
- (notice_handler): Use "sender" rather than "recipient" for
- supression code.
-
- * zwgc/zwgc_resources: No longer specify name of program, since
- this is the application-defaults file for only the one program.
-
- * Unauthenticated-locate changes:
- * lib/ZNewLocateUser.c (ZNewLocateUser): New file/function, using
- guts of old ZLocateUser, but now taking an AUTH parameter.
- * lib/ZLocateUser.c (ZLocateUser): Call it.
- * lib/Imakefile (SRCS, OLIST): Include ZNewLocateUser.o.
- * clients/zlocate/zlocate.c: Do unauthenticated zlocate if
- argument "-d" is given, authenticated (default) on "-a".
- * man/man1/zlocate.1: Documentation changes for above.
-
- * Turned over changes to rel-eng for 7.0.
-
-
-Local Variables:
-mode: indented-text
-left-margin: 8
-fill-column: 76
-version-control: never
-End:
diff --git a/logs/changes.ghudson b/logs/changes.ghudson
deleted file mode 100644
index 1d41f86..0000000
--- a/logs/changes.ghudson
+++ /dev/null
@@ -1,2153 +0,0 @@
-diff -c /mit/zephyr/src/server/Imakefile ./Imakefile
-*** /mit/zephyr/src/server/Imakefile Wed Nov 24 14:39:08 1993
---- ./Imakefile Wed Jul 6 17:19:09 1994
-***************
-*** 9,18 ****
- /**/#
-
- #if defined(SYSLOG_COMPAT42)
-! SYSLOG_LIB= ../clients/syslogd/syslog.o
- SYSLOG_DEF= -I../clients/syslogd
- #else
-! SYSLOG_LIB=
- SYSLOG_DEF=
- #endif
-
---- 9,18 ----
- /**/#
-
- #if defined(SYSLOG_COMPAT42)
-! SYSLOG_OBJ= ../clients/syslogd/syslog.o
- SYSLOG_DEF= -I../clients/syslogd
- #else
-! SYSLOG_OBJ=
- SYSLOG_DEF=
- #endif
-
-***************
-*** 54,60 ****
- zstring.o
-
- error_table(zsrv_err)
-! SimpleProgram(zephyrd,$(OBJS) version.o $(ZLIB),$(ZLIBS) $(LIB_HES),$(ATHETCDIR))
- install_man(zephyrd.8,zephyrd.8)
- install_file(default.subscriptions,$(ZLIBDIR))
-
---- 54,60 ----
- zstring.o
-
- error_table(zsrv_err)
-! SimpleProgram(zephyrd,$(OBJS) $(SYSLOG_OBJ) version.o $(ZLIB), $(ZLIBS) $(LIB_HES), $(ATHETCDIR))
- install_man(zephyrd.8,zephyrd.8)
- install_file(default.subscriptions,$(ZLIBDIR))
-
-diff -c /mit/zephyr/src/server/class.c ./class.c
-*** /mit/zephyr/src/server/class.c Mon Aug 1 08:38:18 1994
---- ./class.c Wed Jul 6 17:19:14 1994
-***************
-*** 28,44 ****
- *
- * External functions are:
- *
-! * Code_t class_register(client, subs)
- *
-! * Code_t class_deregister(client, subs)
- *
-! * ZClientList_t *class_lookup(subs)
- * ZClient_t *client;
- * ZSubscr_t *subs;
- *
-- * void class_free(lyst)
-- * ZClientList_t *lyst;
-- *
- * ZAcl_t *class_get_acl(ZString class_name)
- *
- * Code_t class_restrict(class_name, acl)
---- 28,41 ----
- *
- * External functions are:
- *
-! * Code_t triplet_register(client, subs)
- *
-! * Code_t triplet_deregister(client, subs)
- *
-! * ZClientList_t *triplet_lookup(subs)
- * ZClient_t *client;
- * ZSubscr_t *subs;
- *
- * ZAcl_t *class_get_acl(ZString class_name)
- *
- * Code_t class_restrict(class_name, acl)
-***************
-*** 75,83 ****
- #define EMPTY_CLASS 2000
-
- #define HASHSIZE 1023
-! #define CLASS_HASHVAL(cl,in) (cl->hash_val ^ in->hash_val) % HASHSIZE
-
-! static ZClass_t *class_bucket[HASHSIZE]; /* the hash table of pointers */
-
-
- #ifdef __STDC__
---- 72,82 ----
- #define EMPTY_CLASS 2000
-
- #define HASHSIZE 1023
-! #define HASHVAL(c, i, r) (((c)->hash_val ^ (i)->hash_val ^ (r)->hash_val) \
-! % HASHSIZE)
-! #define DEST_HASHVAL(dest) HASHVAL((dest).classname, (dest).inst, (dest).recip)
-
-! static ZTriplet_t *class_bucket[HASHSIZE]; /* the hash table of pointers */
-
-
- #ifdef __STDC__
-***************
-*** 86,165 ****
- # define P(s) ()
- #endif
-
-! static Code_t remove_client P((ZClass_t *ptr, ZClient_t *client)),
-! insert_client P((ZClass_t *ptr, ZClient_t *client));
- static ZClientList_t *client_alloc P((ZClient_t *client));
-! static ZClass_t *class_alloc P((ZSTRING *classname, ZSTRING *inst));
-! static void free_class P((ZClass_t *));
-
- /* public routines */
-
-! void
-! set_ZDestination_hash(zd)
-! ZDestination *zd;
-! {
-! zd->hash_value = (zd->classname->hash_val ^ zd->inst->hash_val) % HASHSIZE;
-! }
-
--
- int ZDest_eq(d1, d2)
- ZDestination *d1, *d2;
- {
-! return((d1->hash_value == d2->hash_value) &&
-! (d1->classname == d2->classname) &&
-! (d1->inst == d2->inst));
- }
-
-- int order_dest_strings(d1, d2)
-- ZDestination *d1, *d2;
-- {
-- int i;
-
-! i = strcmp(d1->classname->string, d2->classname->string);
-! if (i != 0)
-! return (i);
-! i = strcmp(d1->inst->string, d2->inst->string);
-! if (i != 0)
-! return(i);
-! i = strcmp(d1->recip->string, d2->recip->string);
-! if (i != 0)
-! return(i);
-! syslog(LOG_WARNING,"order_dest_strings equal");
-! return(1); /* be arbitrary */
-! }
-
-- int ZDest_geq(d1, d2)
-- ZDestination *d1, *d2;
-- {
-- return((d1->hash_value != d2->hash_value) ?
-- (d1->hash_value < d2->hash_value) :
-- ((order_dest_strings(d1,d2) < 0)));
-- }
--
--
--
-- /* register the client as interested in class */
--
- Code_t
-! class_register(client, subs)
- ZClient_t *client;
-! ZSubscr_t *subs;
- {
-! register ZClass_t *ptr, *ptr2;
- unsigned long hashval;
-
-! hashval = CLASS_HASHVAL(subs->zst_dest.classname, subs->zst_dest.inst);
-
- if (!(ptr = class_bucket[hashval])) {
- /* not registered */
-
-! if (!(ptr = class_alloc(subs->zst_dest.classname,
-! subs->zst_dest.inst)))
- return(ENOMEM);
-
- /* allocate the head of the bucket */
-
-! if (!(ptr2 = (ZClass_t *) xmalloc(sizeof(ZClass_t))))
- return(ENOMEM);
-
- ptr2->zct_clientlist = 0;
---- 85,143 ----
- # define P(s) ()
- #endif
-
-! static Code_t remove_client P((ZTriplet_t *ptr, ZClient_t *client));
-! static Code_t insert_client P((ZTriplet_t *ptr, ZClient_t *client));
- static ZClientList_t *client_alloc P((ZClient_t *client));
-! static ZTriplet_t *triplet_alloc P((ZSTRING *classname, ZSTRING *inst,
-! ZSTRING *recipient));
-! static void free_class P((ZTriplet_t *));
-
- /* public routines */
-
-! /*
-! * Determine if two destination triplets are equal. Note the backup
-! * case-insensitive recipient check in the third term. Recipients are
-! * not downcased at subscription time (in order to preserve case for,
-! * say, "zctl ret"), but traditional zephyr server behavior has not
-! * been case-sensitive in the recipient string. In most cases, a
-! * failed match will fail on the classname or instance, and a successful
-! * match will succeed on the (d1->recip == d2->recip) check, so this
-! * shouldn't affect performance. Note that this invalidates the overall
-! * hash value check, which was of dubious value to start with.
-! */
-
- int ZDest_eq(d1, d2)
- ZDestination *d1, *d2;
- {
-! return((d1->classname == d2->classname) &&
-! (d1->inst == d2->inst) &&
-! (d1->recip == d2->recip ||
-! strcasecmp(d1->recip->string, d2->recip->string) == 0));
- }
-
-
-! /* register the client as interested in a triplet */
-
- Code_t
-! triplet_register(client, dest)
- ZClient_t *client;
-! ZDestination *dest;
- {
-! register ZTriplet_t *ptr, *ptr2;
- unsigned long hashval;
-
-! hashval = DEST_HASHVAL(*dest);
-
- if (!(ptr = class_bucket[hashval])) {
- /* not registered */
-
-! ptr = triplet_alloc(dest->classname, dest->inst, dest->recip);
-! if (!ptr)
- return(ENOMEM);
-
- /* allocate the head of the bucket */
-
-! if (!(ptr2 = (ZTriplet_t *) xmalloc(sizeof(ZTriplet_t))))
- return(ENOMEM);
-
- ptr2->zct_clientlist = 0;
-***************
-*** 173,186 ****
- return(insert_client(ptr, client));
-
- } else {
-! for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw)
- /* walk down the list, looking for a match */
-! if (ZDest_eq(&ptr2->zct_dest,&subs->zst_dest))
- return(insert_client(ptr2, client));
-
- /* fell off the end, no match */
-! if (!(ptr2 = class_alloc(subs->zst_dest.classname,
-! subs->zst_dest.inst)))
- return(ENOMEM);
-
- xinsque(ptr2, ptr); /* insert new class into hash bucket */
---- 151,165 ----
- return(insert_client(ptr, client));
-
- } else {
-! for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) {
- /* walk down the list, looking for a match */
-! if (ZDest_eq(&ptr2->zct_dest,dest))
- return(insert_client(ptr2, client));
-+ }
-
- /* fell off the end, no match */
-! ptr2 = triplet_alloc(dest->classname, dest->inst, dest->recip);
-! if (!ptr2)
- return(ENOMEM);
-
- xinsque(ptr2, ptr); /* insert new class into hash bucket */
-***************
-*** 191,218 ****
- /* dissociate client from the class, garbage collecting if appropriate */
-
- Code_t
-! class_deregister(client, subs)
- ZClient_t *client;
-! ZSubscr_t *subs;
- {
-! register ZClass_t *ptr, *ptr2;
- int retval = -1;
- unsigned long hashval;
-
-! hashval = CLASS_HASHVAL(subs->zst_dest.classname, subs->zst_dest.inst);
- #if 0
-! zdbug((LOG_DEBUG, "class_dereg: %s %s",
-! subs->zst_dest.classname->string,
-! subs->zst_dest.inst->string));
- #endif
-! if (!(ptr = class_bucket[hashval]))
- /* no such class to deregister */
- return(ZSRV_BADASSOC);
-
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) {
- /* walk down the list, looking for a match */
-! if (ZDest_eq(&ptr2->zct_dest,&subs->zst_dest)) {
-! if ((retval = remove_client(ptr2, client)) == EMPTY_CLASS) {
- #if 0
- zdbug((LOG_DEBUG,"empty class"));
- #endif
---- 170,198 ----
- /* dissociate client from the class, garbage collecting if appropriate */
-
- Code_t
-! triplet_deregister(client, dest)
- ZClient_t *client;
-! ZDestination *dest;
- {
-! register ZTriplet_t *ptr, *ptr2;
- int retval = -1;
- unsigned long hashval;
-
-! hashval = DEST_HASHVAL(*dest);
- #if 0
-! zdbug((LOG_DEBUG, "class_dereg: %s %s", dest->classname->string,
-! dest->inst->string));
- #endif
-! ptr = class_bucket[hashval];
-! if (!ptr)
- /* no such class to deregister */
- return(ZSRV_BADASSOC);
-
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) {
- /* walk down the list, looking for a match */
-! if (ZDest_eq(&ptr2->zct_dest,dest)) {
-! retval = remove_client(ptr2, client);
-! if (retval == EMPTY_CLASS) {
- #if 0
- zdbug((LOG_DEBUG,"empty class"));
- #endif
-***************
-*** 237,331 ****
- return(retval);
- }
-
-! /* return a linked list of what clients are interested in this class */
-
- ZClientList_t *
-! class_lookup(subs)
-! ZSubscr_t *subs;
- {
-! register ZClass_t *ptr, *ptr2;
-! register int count = 0, wc_count = 0, idx = 1;
-! register ZClientList_t *list_return, *list_copy;
-! ZClientList_t *list = NULLZCLT;
-! ZClientList_t *wc_list = NULLZCLT;
-! ZSubscr_t wc_sub;
- unsigned long hashval;
-
-! hashval = CLASS_HASHVAL(subs->zst_dest.classname, subs->zst_dest.inst);
-
-! if ((ptr = class_bucket[hashval]) != NULLZCT)
-! /* go search the list for the class */
-! for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) {
-! /* walk down the list, looking for a match */
-! if (ZDest_eq(&ptr2->zct_dest,&subs->zst_dest)) {
-! list = ptr2->zct_clientlist;
-! break;
-! }
-! }
-! /* list is the list of direct matches; now check for wildcards */
-! wc_sub = *subs;
-! wc_sub.zst_dest.inst = wildcard_instance;
-! set_ZDestination_hash(&wc_sub.zst_dest);
-!
-! hashval = CLASS_HASHVAL(wc_sub.zst_dest.classname, wc_sub.zst_dest.inst);
-! if ((ptr = class_bucket[hashval]) != NULLZCT)
-! /* go search the list for the class */
-! for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) {
-! /* walk down the list, looking for a match */
-! if (ZDest_eq(&ptr2->zct_dest,&wc_sub.zst_dest)) {
-! wc_list = ptr2->zct_clientlist;
-! break;
-! }
-! }
-! /* merge the lists for returning */
-! if (list)
-! for (list_return = list->q_forw;
-! list_return != list;
-! list_return = list_return->q_forw)
-! count++;
-! if (wc_list)
-! for (list_return = wc_list->q_forw;
-! list_return != wc_list;
-! list_return = list_return->q_forw)
-! wc_count++;
-!
-! if (!(wc_count + count))
-! return(NULLZCLT);
-! list_return = (ZClientList_t *) xmalloc((count + wc_count + 1)
-! * sizeof(ZClientList_t));
-! if (!list_return) {
-! syslog(LOG_ERR, "class_lookup no mem");
-! return(NULLZCLT);
- }
-! list_return[0].q_forw = list_return[0].q_back = &list_return[0];
-! if (list)
-! for (list_copy = list->q_forw;
-! list_copy != list;
-! list_copy = list_copy->q_forw) {
-! list_return[idx].zclt_client = list_copy->zclt_client;
-! xinsque(&list_return[idx], &list_return[0]);
-! idx++;
-! }
-! if (wc_list)
-! for (list_copy = wc_list->q_forw;
-! list_copy != wc_list;
-! list_copy = list_copy->q_forw) {
-! list_return[idx].zclt_client = list_copy->zclt_client;
-! xinsque(&list_return[idx], &list_return[0]);
-! idx++;
-! }
-! return(list_return);
- }
-
-- /* free up the storage used by a returned list */
-- void
-- class_free(lyst)
-- ZClientList_t *lyst;
-- {
-- xfree(lyst);
-- return;
-- }
--
- /*
- * return the acl structure associated with class, or NULLZACLT if there is
- * no such acl struct
---- 217,245 ----
- return(retval);
- }
-
-! /* return a linked list of what clients are interested in this triplet */
-
- ZClientList_t *
-! triplet_lookup(dest)
-! ZDestination *dest;
- {
-! register ZTriplet_t *class, *p;
- unsigned long hashval;
-
-! hashval = DEST_HASHVAL(*dest);
-! p = class_bucket[hashval];
-! if (p == NULLZT)
-! return NULLZCLT;
-
-! /* Go search the list for the class */
-! for (class = p->q_forw; class != p; class = class->q_forw) {
-! /* walk down the list, looking for a match */
-! if (ZDest_eq(&class->zct_dest,dest))
-! return class->zct_clientlist;
- }
-! return NULLZCLT;
- }
-
- /*
- * return the acl structure associated with class, or NULLZACLT if there is
- * no such acl struct
-***************
-*** 335,344 ****
- class_get_acl(class_name)
- ZSTRING *class_name;
- {
-! register ZClass_t *ptr, *ptr2;
- unsigned long hashval;
-
-! hashval = CLASS_HASHVAL(class_name, empty);
- if (!(ptr = class_bucket[hashval]))
- return(NULLZACLT);
-
---- 249,258 ----
- class_get_acl(class_name)
- ZSTRING *class_name;
- {
-! register ZTriplet_t *ptr, *ptr2;
- unsigned long hashval;
-
-! hashval = HASHVAL(class_name, empty, empty);
- if (!(ptr = class_bucket[hashval]))
- return(NULLZACLT);
-
-***************
-*** 345,351 ****
- /* walk down the list, looking for a match */
- for (ptr2 = ptr->q_back; ptr2 != ptr; ptr2 = ptr2->q_back)
- if ((ptr2->zct_dest.classname == class_name) &&
-! (ptr2->zct_dest.inst == empty))
- return(ptr2->zct_acl);
-
- /* fell off the end, no match ==> not restricted */
---- 259,266 ----
- /* walk down the list, looking for a match */
- for (ptr2 = ptr->q_back; ptr2 != ptr; ptr2 = ptr2->q_back)
- if ((ptr2->zct_dest.classname == class_name) &&
-! (ptr2->zct_dest.inst == empty) &&
-! (ptr2->zct_dest.recip == empty))
- return(ptr2->zct_acl);
-
- /* fell off the end, no match ==> not restricted */
-***************
-*** 363,374 ****
- char *class_name;
- ZAcl_t *acl;
- {
-! register ZClass_t *ptr, *ptr2;
- ZSTRING *d;
- unsigned long hashval;
-
- d = make_zstring(class_name,1);
-! hashval = CLASS_HASHVAL(d,empty);
-
- if (!(ptr = class_bucket[hashval])) {
- free_zstring(d);
---- 278,289 ----
- char *class_name;
- ZAcl_t *acl;
- {
-! register ZTriplet_t *ptr, *ptr2;
- ZSTRING *d;
- unsigned long hashval;
-
- d = make_zstring(class_name,1);
-! hashval = HASHVAL(d, empty, empty);
-
- if (!(ptr = class_bucket[hashval])) {
- free_zstring(d);
-***************
-*** 377,383 ****
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw)
- /* walk down the list, looking for a match */
- if ((ptr2->zct_dest.classname == d) &&
-! (ptr2->zct_dest.inst == empty)){
- if (ptr2->zct_acl)
- return ZSRV_CLASSRESTRICTED;
- ptr2->zct_acl = acl;
---- 292,299 ----
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw)
- /* walk down the list, looking for a match */
- if ((ptr2->zct_dest.classname == d) &&
-! (ptr2->zct_dest.inst == empty) &&
-! (ptr2->zct_dest.recip == empty)) {
- if (ptr2->zct_acl)
- return ZSRV_CLASSRESTRICTED;
- ptr2->zct_acl = acl;
-***************
-*** 401,423 ****
- char *class_name;
- ZAcl_t *acl;
- {
-! register ZClass_t *ptr, *ptr2;
- ZSTRING *d;
- unsigned long hashval;
-
- d = make_zstring(class_name,1);
-! hashval = CLASS_HASHVAL(d,empty);
-
- if (!(ptr = class_bucket[hashval])) {
- /* not registered */
-
-! if (!(ptr = class_alloc(d,empty)))
- return(ENOMEM);
-
- ptr->zct_acl = acl;
-
- /* allocate the head of the bucket */
-! if (!(ptr2 = (ZClass_t *) xmalloc(sizeof(ZClass_t))))
- return(ENOMEM);
-
- ptr2->q_forw = ptr;
---- 317,341 ----
- char *class_name;
- ZAcl_t *acl;
- {
-! register ZTriplet_t *ptr, *ptr2;
- ZSTRING *d;
- unsigned long hashval;
-
- d = make_zstring(class_name,1);
-! hashval = HASHVAL(d, empty, empty);
-
- if (!(ptr = class_bucket[hashval])) {
- /* not registered */
-
-! ptr = triplet_alloc(d,empty,empty);
-! if (!ptr)
- return(ENOMEM);
-
- ptr->zct_acl = acl;
-
- /* allocate the head of the bucket */
-! ptr2 = (ZTriplet_t *) xmalloc(sizeof(ZTriplet_t));
-! if (!ptr2)
- return(ENOMEM);
-
- ptr2->q_forw = ptr;
-***************
-*** 432,442 ****
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw)
- /* walk down the list, looking for a match */
- if ((ptr2->zct_dest.classname == d) &&
-! (ptr2->zct_dest.inst == empty)) {
- free_zstring(d);
- return(ZSRV_CLASSXISTS);
- }
-! if (!(ptr2 = class_alloc(d,empty))) {
- free_zstring(d);
- return(ENOMEM);
- }
---- 350,361 ----
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw)
- /* walk down the list, looking for a match */
- if ((ptr2->zct_dest.classname == d) &&
-! (ptr2->zct_dest.inst == empty) &&
-! (ptr2->zct_dest.recip == empty)) {
- free_zstring(d);
- return(ZSRV_CLASSXISTS);
- }
-! if (!(ptr2 = triplet_alloc(d,empty,empty))) {
- free_zstring(d);
- return(ENOMEM);
- }
-***************
-*** 452,477 ****
-
- /* allocate space for a class structure */
-
-! static ZClass_t *
-! class_alloc(classname,inst)
- ZSTRING *classname;
- ZSTRING *inst;
- {
-! register ZClass_t *ptr;
- ZClientList_t *clist;
-
-! if (!(ptr = (ZClass_t *) xmalloc(sizeof(ZClass_t))))
-! return(NULLZCT);
-
- ptr->q_forw = ptr->q_back = ptr;
- ptr->zct_dest.classname = dup_zstring(classname);
- ptr->zct_dest.inst = dup_zstring(inst);
-! ptr->zct_dest.recip = dup_zstring(empty);
-! set_ZDestination_hash(&ptr->zct_dest);
-
- if (!(clist = (ZClientList_t *) xmalloc (sizeof (ZClientList_t)))) {
- xfree(ptr);
-! return(NULLZCT);
- }
- clist->q_forw = clist->q_back = clist;
- ptr->zct_clientlist = clist;
---- 371,396 ----
-
- /* allocate space for a class structure */
-
-! static ZTriplet_t *
-! triplet_alloc(classname,inst,recipient)
- ZSTRING *classname;
- ZSTRING *inst;
-+ ZSTRING *recipient;
- {
-! register ZTriplet_t *ptr;
- ZClientList_t *clist;
-
-! if (!(ptr = (ZTriplet_t *) xmalloc(sizeof(ZTriplet_t))))
-! return(NULLZT);
-
- ptr->q_forw = ptr->q_back = ptr;
- ptr->zct_dest.classname = dup_zstring(classname);
- ptr->zct_dest.inst = dup_zstring(inst);
-! ptr->zct_dest.recip = dup_zstring(recipient);
-
- if (!(clist = (ZClientList_t *) xmalloc (sizeof (ZClientList_t)))) {
- xfree(ptr);
-! return(NULLZT);
- }
- clist->q_forw = clist->q_back = clist;
- ptr->zct_clientlist = clist;
-***************
-*** 500,506 ****
-
- static Code_t
- insert_client(ptr, client)
-! ZClass_t *ptr;
- ZClient_t *client;
- {
- register ZClientList_t *listp, *clist;
---- 419,425 ----
-
- static Code_t
- insert_client(ptr, client)
-! ZTriplet_t *ptr;
- ZClient_t *client;
- {
- register ZClientList_t *listp, *clist;
-***************
-*** 507,516 ****
-
- for (clist = ptr->zct_clientlist->q_forw;
- clist != ptr->zct_clientlist;
-! clist = clist->q_forw)
- /* don't duplicate */
- if (clist->zclt_client == client)
-! return(ZERR_NONE);
-
- if (!(listp = client_alloc(client)))
- return(ENOMEM);
---- 426,436 ----
-
- for (clist = ptr->zct_clientlist->q_forw;
- clist != ptr->zct_clientlist;
-! clist = clist->q_forw) {
- /* don't duplicate */
- if (clist->zclt_client == client)
-! return(ZSRV_CLASSXISTS);
-! }
-
- if (!(listp = client_alloc(client)))
- return(ENOMEM);
-***************
-*** 525,531 ****
- */
-
- static Code_t remove_client(ptr, client)
-! ZClass_t *ptr;
- ZClient_t *client;
- {
- register ZClientList_t *listp = ptr->zct_clientlist;
---- 445,451 ----
- */
-
- static Code_t remove_client(ptr, client)
-! ZTriplet_t *ptr;
- ZClient_t *client;
- {
- register ZClientList_t *listp = ptr->zct_clientlist;
-***************
-*** 549,555 ****
- }
-
- static void free_class(class)
-! ZClass_t *class;
- {
- free_zstring(class->zct_dest.classname);
- free_zstring(class->zct_dest.inst);
---- 469,475 ----
- }
-
- static void free_class(class)
-! ZTriplet_t *class;
- {
- free_zstring(class->zct_dest.classname);
- free_zstring(class->zct_dest.inst);
-diff -c /mit/zephyr/src/server/client.c ./client.c
-*** /mit/zephyr/src/server/client.c Mon Aug 1 08:43:42 1994
---- ./client.c Wed Jul 6 17:19:14 1994
-***************
-*** 100,105 ****
---- 100,106 ----
-
- (*client)->last_msg = 0;
- (*client)->last_check = 0;
-+ (*client)->last_send = 0;
-
- if (!(clist = (ZClientList_t *) xmalloc(sizeof(ZClientList_t)))) {
- xfree(*client);
-diff -c /mit/zephyr/src/server/common.c ./common.c
-*** /mit/zephyr/src/server/common.c Wed Aug 26 00:36:11 1992
---- ./common.c Wed Jul 6 17:19:14 1994
-***************
-*** 49,55 ****
- return(ret);
- }
-
-! /* generic string hash function */
-
- unsigned long
- #ifdef __STDC__
---- 49,55 ----
- return(ret);
- }
-
-! /* The "& 0x5f" provides case-insensitivity for ASCII. */
-
- unsigned long
- #ifdef __STDC__
-***************
-*** 63,89 ****
- register char cp;
-
- while (1) {
-! cp = *string++;
- if (!cp)
- break;
- hval += cp;
-
-! cp = *string++;
- if (!cp)
- break;
- hval += cp * (3 + (1 << 16));
-
-! cp = *string++;
- if (!cp)
- break;
- hval += cp * (1 + (1 << 8));
-
-! cp = *string++;
- if (!cp)
- break;
- hval += cp * (1 + (1 << 12));
-
-! cp = *string++;
- if (!cp)
- break;
- hval += cp * (1 + (1 << 4));
---- 63,89 ----
- register char cp;
-
- while (1) {
-! cp = *string++ & 0x5f;
- if (!cp)
- break;
- hval += cp;
-
-! cp = *string++ & 0x5f;
- if (!cp)
- break;
- hval += cp * (3 + (1 << 16));
-
-! cp = *string++ & 0x5f;
- if (!cp)
- break;
- hval += cp * (1 + (1 << 8));
-
-! cp = *string++ & 0x5f;
- if (!cp)
- break;
- hval += cp * (1 + (1 << 12));
-
-! cp = *string++ & 0x5f;
- if (!cp)
- break;
- hval += cp * (1 + (1 << 4));
-diff -c /mit/zephyr/src/server/dispatch.c ./dispatch.c
-*** /mit/zephyr/src/server/dispatch.c Tue Mar 15 12:44:24 1994
---- ./dispatch.c Wed Jul 6 17:19:15 1994
-***************
-*** 74,79 ****
---- 74,80 ----
-
- static void nack_cancel P((register ZNotice_t *, struct sockaddr_in *));
- static void dispatch P((ZNotice_t *, int, struct sockaddr_in *, int));
-+ static int send_to_send P((ZNotice_t *, int, ZDestination *dest, int));
-
- #undef P
-
-***************
-*** 346,364 ****
- int auth;
- struct sockaddr_in *who;
- {
-! int acked = 0;
- ZAcl_t *acl;
-! register ZClientList_t *clientlist, *ptr;
-! ZSTRING *z;
-
-! z = make_zstring(notice->z_class,1);
-! if ((acl = class_get_acl(z)) != NULLZACLT) {
-! free_zstring(z);
- /* if controlled and not auth, fail */
- if (!auth) {
- syslog(LOG_WARNING, "sendit unauthentic %s from %s",
- notice->z_class, notice->z_sender);
- clt_ack(notice, who, AUTH_FAILED);
- return;
- }
- /* if not auth to transmit, fail */
---- 347,366 ----
- int auth;
- struct sockaddr_in *who;
- {
-! static int send_counter = 0;
-! int any = 0;
- ZAcl_t *acl;
-! ZDestination dest;
-! ZSTRING *class;
-
-! class = make_zstring(notice->z_class,1);
-! if ((acl = class_get_acl(class)) != NULLZACLT) {
- /* if controlled and not auth, fail */
- if (!auth) {
- syslog(LOG_WARNING, "sendit unauthentic %s from %s",
- notice->z_class, notice->z_sender);
- clt_ack(notice, who, AUTH_FAILED);
-+ free_zstring(class);
- return;
- }
- /* if not auth to transmit, fail */
-***************
-*** 366,371 ****
---- 368,374 ----
- syslog(LOG_WARNING, "sendit unauthorized %s from %s",
- notice->z_class, notice->z_sender);
- clt_ack(notice, who, AUTH_FAILED);
-+ free_zstring(class);
- return;
- }
- /* sender != inst and not auth to send to others --> fail */
-***************
-*** 377,382 ****
---- 380,386 ----
- notice->z_class,
- notice->z_class_inst);
- clt_ack(notice, who, AUTH_FAILED);
-+ free_zstring(class);
- return;
- }
- }
-***************
-*** 391,396 ****
---- 395,401 ----
- syslog(LOG_WARNING, "sendit unauthentic fake packet: claimed %s, real %s",
- inet_ntoa(notice->z_sender_addr), buffer);
- clt_ack(notice, who, AUTH_FAILED);
-+ free_zstring(class);
- return;
- }
- if (ntohl(notice->z_sender_addr.s_addr) != 0) {
-***************
-*** 397,425 ****
- syslog(LOG_WARNING, "sendit invalid address: claimed %s, real %s",
- inet_ntoa(notice->z_sender_addr), buffer);
- clt_ack(notice, who, AUTH_FAILED);
- return;
- }
- syslog(LOG_WARNING, "sendit addr mismatch: claimed %s, real %s",
- inet_ntoa(notice->z_sender_addr), buffer);
- }
-- if ((clientlist = subscr_match_list(notice)) != NULLZCLT) {
-- for (ptr = clientlist->q_forw;
-- ptr != clientlist;
-- ptr = ptr->q_forw) {
-- /* for each client who gets this notice,
-- send it along */
-- xmit(notice, &(ptr->zclt_client->zct_sin), auth,
-- ptr->zclt_client);
-- if (!acked) {
-- acked = 1;
-- ack(notice, who);
-- }
-- }
-- subscr_free_list(clientlist);
-- }
-
-! if (!acked)
- nack(notice, who);
- }
-
- /*
---- 402,473 ----
- syslog(LOG_WARNING, "sendit invalid address: claimed %s, real %s",
- inet_ntoa(notice->z_sender_addr), buffer);
- clt_ack(notice, who, AUTH_FAILED);
-+ free_zstring(class);
- return;
- }
- syslog(LOG_WARNING, "sendit addr mismatch: claimed %s, real %s",
- inet_ntoa(notice->z_sender_addr), buffer);
- }
-
-! /* Increment the send counter, used to prevent duplicate sends to
-! * clients. On the off-chance that we wrap around to 0, skip over
-! * it to prevent missing clients which have never had a packet
-! * sent to them. */
-! send_counter++;
-! if (send_counter == 0)
-! send_counter = 1;
-!
-! /* Send to clients subscribed to the triplet itself. */
-! dest.classname = class;
-! dest.inst = make_zstring(notice->z_class_inst, 1);
-! dest.recip = make_zstring(notice->z_recipient, 0);
-! if (send_to_dest(notice, auth, &dest, send_counter))
-! any = 1;
-!
-! /* Send to clients subscribed to the triplet with the instance
-! * substituted with the wildcard instance. */
-! free_zstring(dest.inst);
-! dest.inst = wildcard_instance;
-! if (send_to_dest(notice, auth, &dest, send_counter))
-! any = 1;
-!
-! free_zstring(class);
-! free_zstring(dest.recip);
-! if (any)
-! ack(notice, who);
-! else
- nack(notice, who);
-+ }
-+
-+ /*
-+ * Send to each client in the list. Avoid duplicates by setting
-+ * last_send on each client to send_counter, a nonce which is updated
-+ * by sendit() above.
-+ */
-+
-+ static int
-+ send_to_dest(notice, auth, dest, send_counter)
-+ ZNotice_t *notice;
-+ int auth;
-+ ZDestination *dest;
-+ int send_counter;
-+ {
-+ register ZClientList_t *list, *p;
-+ register ZClient_t *client;
-+ register int any = 0;
-+
-+ list = triplet_lookup(dest);
-+ if (list != NULLZCLT) {
-+ for (p = list->q_forw; p != list; p = p->q_forw) {
-+ client = p->zclt_client;
-+ if (client->last_send == send_counter)
-+ continue;
-+ client->last_send = send_counter;
-+ xmit(notice, &(client->zct_sin), auth, client);
-+ any = 1;
-+ }
-+ }
-+ return any;
- }
-
- /*
-diff -c /mit/zephyr/src/server/main.c ./main.c
-*** /mit/zephyr/src/server/main.c Mon Aug 1 08:43:47 1994
---- ./main.c Wed Jul 6 17:19:15 1994
-***************
-*** 442,458 ****
- class_hm = make_zstring(HM_CTL_CLASS, 1);
- class_ulogin = make_zstring(LOGIN_CLASS, 1);
- class_ulocate = make_zstring(LOCATE_CLASS, 1);
-- wildcard_class = make_zstring(MATCHALL_CLASS, 1);
- wildcard_instance = make_zstring(WILDCARD_INSTANCE, 1);
- empty = make_zstring("", 0);
-
-- matchall_sub.q_forw = &matchall_sub;
-- matchall_sub.q_back = &matchall_sub;
-- matchall_sub.zst_dest.classname = wildcard_class;
-- matchall_sub.zst_dest.inst = dup_zstring(empty);
-- matchall_sub.zst_dest.recip = dup_zstring(empty);
--
-- set_ZDestination_hash(&matchall_sub.zst_dest);
- /* restrict certain classes */
- access_init();
- return(0);
---- 442,450 ----
-diff -c /mit/zephyr/src/server/server.c ./server.c
-*** /mit/zephyr/src/server/server.c Mon Aug 1 08:43:51 1994
---- ./server.c Wed Jul 6 17:19:16 1994
-***************
-*** 1770,1777 ****
-
- /* search the not-yet-acked list for anything destined to him, and
- flush it. */
-! for (nacked = nacklist->q_forw;
-! nacked != nacklist;)
- if (&otherservers[nacked->na_srv_idx] == server) {
- /* go back, since remque will change things */
- nack2 = nacked->q_back;
---- 1770,1777 ----
-
- /* search the not-yet-acked list for anything destined to him, and
- flush it. */
-! for (nacked = srv_nacklist->q_forw;
-! nacked != srv_nacklist;)
- if (&otherservers[nacked->na_srv_idx] == server) {
- /* go back, since remque will change things */
- nack2 = nacked->q_back;
-diff -c /mit/zephyr/src/server/subscr.c ./subscr.c
-*** /mit/zephyr/src/server/subscr.c Mon Aug 1 08:43:37 1994
---- ./subscr.c Wed Jul 6 17:19:16 1994
-***************
-*** 80,86 ****
-
- /* for compatibility when sending subscription information to old clients */
-
-- static void check_sub_order P((ZSubscr_t *subs, int wc));
- #ifdef OLD_COMPAT
- #define OLD_ZEPHYR_VERSION "ZEPH0.0"
- #define OLD_CLIENT_INCOMPSUBS "INCOMP"
---- 80,85 ----
-***************
-*** 96,110 ****
- #endif /* NEW_COMPAT */
-
- extern char *re_comp(), *re_conv();
- static ZSubscr_t *extract_subscriptions P((register ZNotice_t *notice));
-- static int clt_unique P((ZClient_t *clt, ZClientList_t *clist));
- static void free_subscriptions P((register ZSubscr_t *subs));
- static char **subscr_marshal_subs P((ZNotice_t *notice, int auth,
-! struct sockaddr_in *who,
-! register int *found));
-! static Code_t subscr_subscribe_real P((ZClient_t *who, ZSubscr_t *newsubs,
-! ZNotice_t *notice));
-! static ZSubscr_t *subscr_copy_def_subs P((char *));
- static int cl_match P((ZSubscr_t*, ZClient_t *));
-
- static int defaults_read = 0; /* set to 1 if the default subs
---- 95,108 ----
- #endif /* NEW_COMPAT */
-
- extern char *re_comp(), *re_conv();
-+ static Code_t add_subscriptions P((ZClient_t *who, ZSubscr_t *subs_queue,
-+ ZNotice_t *notice));
- static ZSubscr_t *extract_subscriptions P((register ZNotice_t *notice));
- static void free_subscriptions P((register ZSubscr_t *subs));
- static char **subscr_marshal_subs P((ZNotice_t *notice, int auth,
-! struct sockaddr_in *who,
-! register int *found));
-! static ZSubscr_t *subscr_copy_def_subs P((char *person));
- static int cl_match P((ZSubscr_t*, ZClient_t *));
-
- static int defaults_read = 0; /* set to 1 if the default subs
-***************
-*** 113,122 ****
-
- #undef P
-
-- ZSTRING *wildcard_class;
- ZSTRING *wildcard_instance;
- ZSTRING *empty;
-- ZSubscr_t matchall_sub;
-
- /* WARNING: make sure this is the same as the number of strings you */
- /* plan to hand back to the user in response to a subscription check, */
---- 111,118 ----
-***************
-*** 132,268 ****
- ZClient_t *who;
- ZNotice_t *notice;
- {
-! ZSubscr_t *subs;
-
- if (!who->zct_subs) {
- /* allocate a subscription head */
-! if (!(subs = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t))))
- return(ENOMEM);
-! subs->q_forw = subs->q_back = subs;
-! subs->zst_dest.classname = subs->zst_dest.inst =
-! subs->zst_dest.recip = NULL;
-! subs->zst_dest.hash_value = 0;
-! who->zct_subs = subs;
- }
-
-! if (!(subs = extract_subscriptions(notice)))
-! return(ZERR_NONE); /* no subscr -> no error */
-!
-! return(subscr_subscribe_real(who, subs, notice));
- }
-
- static Code_t
-! subscr_subscribe_real(who, newsubs, notice)
- ZClient_t *who;
-! register ZSubscr_t *newsubs;
- ZNotice_t *notice;
- {
- Code_t retval;
- ZAcl_t *acl;
- ZSTRING *sender;
-- ZSubscr_t *subs2, *subs3, *subs;
-- int relation;
-
- sender = make_zstring(notice->z_sender,0);
-
- START_CRITICAL_CODE;
-
-! for (subs = newsubs->q_forw;
-! subs != newsubs;
-! subs = subs->q_forw) {
-! /* for each new subscription */
-
- #if 0
- zdbug ((LOG_DEBUG, "subscr: %s/%s/%s",
-! subs->zst_dest.classname->string,
-! subs->zst_dest.inst->string,
-! subs->zst_dest.recip->string));
- #endif
-
-- if (!bdumping
-- && (subs->zst_dest.recip != empty)
-- && (subs->zst_dest.recip != sender)) {
-- syslog(LOG_WARNING, "subscr unauth %s recipient %s",
-- sender->string,
-- subs->zst_dest.recip->string);
-- continue;
-- }
- if (!bdumping) {
-! acl = class_get_acl(subs->zst_dest.classname);
- if (acl) {
- if (!(access_check(sender->string, acl, SUBSCRIBE))) {
- syslog(LOG_WARNING,
- "subscr unauth %s class %s",
- sender->string,
-! subs->zst_dest.classname->string);
- continue; /* the for loop */
- }
-! if (wildcard_instance == subs->zst_dest.inst) {
- if (!access_check(sender->string, acl, INSTWILD)) {
- syslog(LOG_WARNING,
- "subscr unauth %s class %s wild inst",
- notice->z_sender,
-! subs->zst_dest.classname->string);
- continue;
- }
- }
- }
- }
-! /* subscriptions are stored in ascending order by */
-! /* subscription hash value */
-! /* Scan through list to check for duplicates, and to find */
-! /* where to insert these subs */
-!
-! for (subs2 = who->zct_subs->q_forw;
-! subs2 != who->zct_subs;
-! subs2 = subs2->q_forw) {
-! /* for each existing subscription */
-! relation = compare_subs(subs2,subs,0);
-! if (relation == 0)
-! goto duplicate;
-! if (relation > 0) /* we have passed last possible one */
-! break;
-! if (relation < 0) /* nope... */
-! continue;
- }
-!
-! /* subs2 now points to the first class which is greater
-! than the new class. We need to back up so that the
-! insertion below goes BEFORE this one (i.e. after the
-! previous one) */
-! subs2 = subs2->q_back;
-!
-! /* ok, we are a new subscription. register and chain on. */
-!
-! if (!(subs3 = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t)))) {
-! free_subscriptions(newsubs);
-! END_CRITICAL_CODE;
-! return(ENOMEM);
-! }
-!
-! subs3->q_forw = subs3->q_back = subs3;
-! subs3->zst_dest.classname =
-! dup_zstring(subs->zst_dest.classname);
-! subs3->zst_dest.inst = dup_zstring(subs->zst_dest.inst);
-! subs3->zst_dest.recip = dup_zstring(subs->zst_dest.recip);
-! set_ZDestination_hash(&subs3->zst_dest);
-!
-! if ((retval = class_register(who, subs)) != ZERR_NONE) {
-! xfree(subs3);
-! free_subscriptions(newsubs);
-! END_CRITICAL_CODE;
-! return(retval);
-! }
-!
-! /* subs2 was adjusted above */
-! xinsque(subs3, subs2);
-! duplicate:
-! ;
- }
-
- END_CRITICAL_CODE;
-
-! free_subscriptions(newsubs);
- return(ZERR_NONE);
- }
-
---- 128,228 ----
- ZClient_t *who;
- ZNotice_t *notice;
- {
-! ZSubscr_t *subs_queue, *sub;
-! Code_t retval;
-
- if (!who->zct_subs) {
- /* allocate a subscription head */
-! sub = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t));
-! if (!sub)
- return(ENOMEM);
-! sub->q_forw = sub->q_back = sub;
-! sub->zst_dest.classname = sub->zst_dest.inst =
-! sub->zst_dest.recip = NULL;
-! who->zct_subs = sub;
- }
-
-! subs_queue = extract_subscriptions(notice);
-! return(add_subscriptions(who, subs_queue, notice));
- }
-
- static Code_t
-! add_subscriptions(who, subs_queue, notice)
- ZClient_t *who;
-! ZSubscr_t *subs_queue;
- ZNotice_t *notice;
- {
-+ ZSubscr_t *sub, *next;
- Code_t retval;
- ZAcl_t *acl;
- ZSTRING *sender;
-
-+ if (!subs_queue)
-+ return(ZERR_NONE); /* no subscr -> no error */
-+
- sender = make_zstring(notice->z_sender,0);
-
- START_CRITICAL_CODE;
-
-! /* Loop over the new subscriptions. */
-! next = subs_queue->q_forw;
-! while (next != subs_queue) {
-! sub = next;
-! next = sub->q_forw;
-
- #if 0
- zdbug ((LOG_DEBUG, "subscr: %s/%s/%s",
-! sub->zst_dest.classname->string,
-! sub->zst_dest.inst->string,
-! sub->zst_dest.recip->string));
- #endif
-
- if (!bdumping) {
-! if ((sub->zst_dest.recip != empty)
-! && (sub->zst_dest.recip != sender)) {
-! syslog(LOG_WARNING, "subscr unauth %s recipient %s",
-! sender->string,
-! sub->zst_dest.recip->string);
-! continue;
-! }
-! acl = class_get_acl(sub->zst_dest.classname);
- if (acl) {
- if (!(access_check(sender->string, acl, SUBSCRIBE))) {
- syslog(LOG_WARNING,
- "subscr unauth %s class %s",
- sender->string,
-! sub->zst_dest.classname->string);
- continue; /* the for loop */
- }
-! if (wildcard_instance == sub->zst_dest.inst) {
- if (!access_check(sender->string, acl, INSTWILD)) {
- syslog(LOG_WARNING,
- "subscr unauth %s class %s wild inst",
- notice->z_sender,
-! sub->zst_dest.classname->string);
- continue;
- }
- }
- }
- }
-! xremque(sub);
-! retval = triplet_register(who, &sub->zst_dest);
-! if (retval != ZERR_NONE) {
-! xfree(sub);
-! if (retval == ZSRV_CLASSXISTS) {
-! continue;
-! } else {
-! free_subscriptions(subs_queue);
-! END_CRITICAL_CODE;
-! return(retval);
-! }
- }
-! xinsque(sub, who->zct_subs);
- }
-
- END_CRITICAL_CODE;
-
-! free_subscriptions(subs_queue);
- return(ZERR_NONE);
- }
-
-***************
-*** 285,296 ****
- subs->q_forw = subs->q_back = subs;
- subs->zst_dest.classname = subs->zst_dest.inst =
- subs->zst_dest.recip = (ZSTRING *) NULL;
-- subs->zst_dest.hash_value = 0;
- who->zct_subs = subs;
- }
-
- subs = subscr_copy_def_subs(who->zct_principal->string);
-! return(subscr_subscribe_real(who, subs, &default_notice));
- }
-
- void
---- 245,255 ----
- subs->q_forw = subs->q_back = subs;
- subs->zst_dest.classname = subs->zst_dest.inst =
- subs->zst_dest.recip = (ZSTRING *) NULL;
- who->zct_subs = subs;
- }
-
- subs = subscr_copy_def_subs(who->zct_principal->string);
-! return(add_subscriptions(who, subs, &default_notice));
- }
-
- void
-***************
-*** 391,403 ****
- free_zstring(subs2->zst_dest.recip);
- subs2->zst_dest.recip = dup_zstring(empty);
- }
-- set_ZDestination_hash(&(subs2->zst_dest));
- }
- return(subs);
- }
-
- /*
-! * Cancel one subscription.
- */
-
- Code_t
---- 350,361 ----
- free_zstring(subs2->zst_dest.recip);
- subs2->zst_dest.recip = dup_zstring(empty);
- }
- }
- return(subs);
- }
-
- /*
-! * Cancel a specific set of subscriptions.
- */
-
- Code_t
-***************
-*** 406,412 ****
- ZNotice_t *notice;
- {
- ZClient_t *who;
-! register ZSubscr_t *subs, *subs2, *subs3, *subs4;
- Code_t retval;
- int found = 0;
- int relation;
---- 364,370 ----
- ZNotice_t *notice;
- {
- ZClient_t *who;
-! register ZSubscr_t *cancel_queue, *cancel, *sub;
- Code_t retval;
- int found = 0;
- int relation;
-***************
-*** 414,475 ****
- #if 0
- zdbug((LOG_DEBUG,"subscr_cancel"));
- #endif
-! if (!(who = client_which_client(sin, notice)))
- return(ZSRV_NOCLT);
-
- if (!who->zct_subs)
- return(ZSRV_NOSUB);
-
-! if (!(subs = extract_subscriptions(notice)))
- return(ZERR_NONE); /* no subscr -> no error */
-
- START_CRITICAL_CODE;
-
-! for (subs4 = subs->q_forw; subs4 != subs; subs4 = subs4->q_forw) {
-! for (subs2 = who->zct_subs->q_forw;
-! subs2 != who->zct_subs;) {
-! /* for each existing subscription */
-! /* is this what we are canceling? */
-! relation = compare_subs(subs2, subs4,0);
-! if (relation < 0) {
-! subs2 = subs2->q_forw;
-! continue;
-! }
-! if (relation > 0)
-! /* We have passed last possible one */
-! break;
-!
-! /* go back, since remque will change things */
-! subs3 = subs2->q_back;
-! xremque(subs2);
-! (void) class_deregister(who, subs2);
-! free_zstring(subs2->zst_dest.classname);
-! free_zstring(subs2->zst_dest.inst);
-! free_zstring(subs2->zst_dest.recip);
-! xfree(subs2);
-! found = 1;
-! /* now that the remque adjusted the linked
-! list, we go forward again */
-! subs2 = subs3->q_forw;
-! break;
- }
-- }
--
-- /* make sure we are still registered for all the classes */
-- if (found) {
-- for (subs2 = who->zct_subs->q_forw;
-- subs2 != who->zct_subs;
-- subs2 = subs2->q_forw)
-- if ((retval = class_register(who, subs2)) != ZERR_NONE) {
-- free_subscriptions(subs);
-- END_CRITICAL_CODE;
-- return(retval);
-- }
- }
-
- END_CRITICAL_CODE;
-
-! free_subscriptions(subs);
- if (found) {
- #if 0
- zdbug((LOG_DEBUG, "found & removed"));
---- 372,410 ----
- #if 0
- zdbug((LOG_DEBUG,"subscr_cancel"));
- #endif
-! who = client_which_client(sin, notice);
-! if (!who)
- return(ZSRV_NOCLT);
-
- if (!who->zct_subs)
- return(ZSRV_NOSUB);
-
-! cancel_queue = extract_subscriptions(notice);
-! if (!cancel_queue)
- return(ZERR_NONE); /* no subscr -> no error */
-
- START_CRITICAL_CODE;
-
-! for (cancel = cancel_queue->q_forw; cancel != cancel_queue;
-! cancel = cancel->q_forw) {
-! for (sub = who->zct_subs->q_forw; sub != who->zct_subs;
-! sub = sub->q_forw) {
-! if (ZDest_eq(&cancel->zst_dest, &sub->zst_dest)) {
-! xremque(sub);
-! triplet_deregister(who, &sub->zst_dest);
-! free_zstring(sub->zst_dest.classname);
-! free_zstring(sub->zst_dest.inst);
-! free_zstring(sub->zst_dest.recip);
-! xfree(sub);
-! found = 1;
-! break;
-! }
- }
- }
-
- END_CRITICAL_CODE;
-
-! free_subscriptions(cancel_queue);
- if (found) {
- #if 0
- zdbug((LOG_DEBUG, "found & removed"));
-***************
-*** 509,515 ****
- zdbug((LOG_DEBUG,"sub_can %s",
- subs->zst_dest.classname->string));
- #endif
-! if (class_deregister(client, subs) != ZERR_NONE) {
- #if 0
- zdbug((LOG_DEBUG,"sub_can_clt: not registered!"));
- #endif
---- 444,450 ----
- zdbug((LOG_DEBUG,"sub_can %s",
- subs->zst_dest.classname->string));
- #endif
-! if (triplet_deregister(client, &subs->zst_dest) != ZERR_NONE) {
- #if 0
- zdbug((LOG_DEBUG,"sub_can_clt: not registered!"));
- #endif
-***************
-*** 565,670 ****
- #endif
-
- /*
-- * Here is the bulk of the work in the subscription manager.
-- * We grovel over the list of clients possibly interested in this
-- * notice, and copy into a list on a match. Make sure we only add any given
-- * client once.
-- */
--
-- ZClientList_t *
-- subscr_match_list(notice)
-- ZNotice_t *notice;
-- {
-- register ZClientList_t *hits, *clients, *majik, *clients2, *hit2;
-- char *saveclass, *saveclinst;
-- ZSTRING *newclass;
-- ZSTRING *newclinst;
-- ZSubscr_t check_sub;
--
-- if (!(hits = (ZClientList_t *) xmalloc(sizeof(ZClientList_t))))
-- return(NULLZCLT);
-- hits->q_forw = hits->q_back = hits;
--
-- saveclass = notice->z_class;
-- newclass = make_zstring(notice->z_class, 1);
--
-- saveclinst = notice->z_class_inst;
-- newclinst = make_zstring(notice->z_class_inst, 1);
--
-- check_sub.zst_dest.classname = newclass;
-- check_sub.zst_dest.inst = newclinst;
-- check_sub.zst_dest.recip = make_zstring(notice->z_recipient, 0);
-- set_ZDestination_hash(&check_sub.zst_dest);
-- check_sub.q_forw = check_sub.q_back = &check_sub;
--
-- clients = class_lookup (&check_sub);
-- majik = class_lookup (&matchall_sub);
-- if (!clients && !majik)
-- return NULLZCLT;
--
-- notice->z_class = (char *) newclass->string;
-- notice->z_class_inst = (char *) newclinst->string;
-- if (clients) {
-- for (clients2 = clients->q_forw;
-- clients2 != clients;
-- clients2 = clients2->q_forw)
-- if (cl_match(&check_sub, clients2->zclt_client)) {
-- if (!clt_unique(clients2->zclt_client, hits))
-- continue;
-- /* we hit */
-- if (!(hit2 = (ZClientList_t *) xmalloc(sizeof(ZClientList_t)))) {
-- syslog(LOG_WARNING,
-- "subscr_match: punting/no mem");
-- notice->z_class = saveclass;
-- notice->z_class_inst = saveclinst;
-- free_zstring(newclass);
-- free_zstring(newclinst);
-- free_zstring(check_sub.zst_dest.recip);
-- return(hits);
-- }
-- hit2->zclt_client = clients2->zclt_client;
-- hit2->q_forw = hit2->q_back = hit2;
-- xinsque(hit2, hits);
-- }
-- class_free(clients);
-- }
-- if (majik) {
-- for (clients2 = majik->q_forw;
-- clients2 != majik;
-- clients2 = clients2->q_forw) {
-- if (!clt_unique(clients2->zclt_client, hits))
-- continue;
-- /* we hit */
-- if (!(hit2 = (ZClientList_t *) xmalloc(sizeof(ZClientList_t)))) {
-- syslog(LOG_WARNING,
-- "subscr_match(majik): punting/no mem");
-- notice->z_class = saveclass;
-- notice->z_class_inst = saveclinst;
-- free_zstring(newclass);
-- free_zstring(newclinst);
-- free_zstring(check_sub.zst_dest.recip);
-- return(hits);
-- }
-- hit2->zclt_client = clients2->zclt_client;
-- hit2->q_forw = hit2->q_back = hit2;
--
-- xinsque(hit2, hits);
-- }
-- class_free(majik);
-- }
-- notice->z_class = saveclass;
-- notice->z_class_inst = saveclinst;
-- free_zstring(newclass);
-- free_zstring(newclinst);
-- free_zstring(check_sub.zst_dest.recip);
-- if (hits->q_forw == hits) {
-- xfree(hits);
-- return(NULLZCLT);
-- }
-- return(hits);
-- }
--
-- /*
- * Free memory used by a list we allocated.
- */
-
---- 500,505 ----
-***************
-*** 1149,1206 ****
- }
-
- /*
-- * is this client unique to this list? 0 = no, 1 = yes
-- */
--
-- static int
-- clt_unique(clt, clist)
-- ZClient_t *clt;
-- ZClientList_t *clist;
-- {
-- register ZClientList_t *client;
--
-- for (client = clist->q_forw;
-- client != clist;
-- client = client->q_forw)
-- if (client->zclt_client == clt)
-- return(0);
-- return(1);
-- }
--
-- /*
-- * is this client listening to this notice? 1=yes, 0=no
-- */
--
-- static int
-- cl_match(notice_subs, client)
-- register ZSubscr_t *notice_subs;
-- register ZClient_t *client;
-- {
-- register ZSubscr_t *subs;
-- int relation;
--
-- if (client->zct_subs == NULLZST) {
-- syslog(LOG_WARNING, "cl_match w/ no subs");
-- return(0);
-- }
--
-- for (subs = client->zct_subs->q_forw;
-- subs != client->zct_subs;
-- subs = subs->q_forw) {
-- relation = compare_subs(notice_subs, subs, 1);
--
-- /*
-- if (relation < 0)
-- return(0);
-- */
-- if (relation == 0)
-- return(1);
-- }
-- /* fall through */
-- return(0);
-- }
--
-- /*
- * free the memory allocated for the list of subscriptions.
- */
-
---- 984,989 ----
-***************
-*** 1272,1278 ****
- subs->q_forw = subs->q_back = subs;
- subs->zst_dest.classname = subs->zst_dest.inst =
- subs->zst_dest.recip = NULL;
-- subs->zst_dest.hash_value = 0;
- }
- if (!(subs2 = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t)))) {
- syslog(LOG_WARNING, "ex_subs: no mem 2");
---- 1055,1060 ----
-***************
-*** 1282,1288 ****
- subs2->zst_dest.classname = make_zstring(class_name,1);
- subs2->zst_dest.inst = make_zstring(classinst,1);
- subs2->zst_dest.recip = make_zstring(recip,0);
-- set_ZDestination_hash(&subs2->zst_dest);
-
- xinsque(subs2, subs);
- }
---- 1064,1069 ----
-***************
-*** 1317,1384 ****
- return;
- }
-
-- int
-- compare_subs(s1,s2,do_wildcard)
-- ZSubscr_t *s1, *s2;
-- int do_wildcard;
-- {
--
-- #if 0
-- zdbug((LOG_DEBUG,"compare_subs: %s/%s/%s to %s/%s/%s",
-- s1->zst_dest.classname->string, s1->zst_dest.inst->string, s1->zst_dest.recip->string,
-- s2->zst_dest.classname->string, s2->zst_dest.inst->string, s2->zst_dest.recip->string));
-- #endif
-- /* wildcard must be in s2 in order for it to match */
--
-- if (do_wildcard && (s1->zst_dest.classname == s2->zst_dest.classname) &&
-- (s2->zst_dest.inst == wildcard_instance) &&
-- (s1->zst_dest.recip == s2->zst_dest.recip))
-- return(0);
--
-- if (s1->zst_dest.hash_value > s2->zst_dest.hash_value)
-- return 1;
-- if (s1->zst_dest.hash_value < s2->zst_dest.hash_value)
-- return -1;
--
-- if (s1->zst_dest.classname != s2->zst_dest.classname)
-- return(strcasecmp(s1->zst_dest.classname->string,
-- s2->zst_dest.classname->string));
--
-- if (s1->zst_dest.inst != s2->zst_dest.inst)
-- return(strcasecmp(s1->zst_dest.inst->string,
-- s2->zst_dest.inst->string));
--
-- if (s1->zst_dest.recip != s2->zst_dest.recip)
-- return(strcasecmp(s1->zst_dest.recip->string,
-- s2->zst_dest.recip->string));
--
-- return(0);
-- }
--
-- static void
-- check_sub_order(subs,wc)
-- ZSubscr_t *subs;
-- int wc;
-- {
-- ZSubscr_t *subs2;
-- int relation;
--
-- for (subs2 = subs->q_forw;
-- subs2->q_forw != subs;
-- subs2 = subs2->q_forw) {
--
-- /* for each existing subscription */
-- relation = compare_subs(subs2,subs2->q_forw,wc);
-- if (relation > 0) {
-- syslog(LOG_DEBUG, "s_check failed: %s/%s/%s <=> %s/%s/%s = %d",
-- subs2->zst_dest.classname->string,
-- subs2->zst_dest.inst->string,
-- subs2->zst_dest.recip->string,
-- subs2->q_forw->zst_dest.classname->string,
-- subs2->q_forw->zst_dest.inst->string,
-- subs2->q_forw->zst_dest.recip->string,
-- relation);
-- }
--
-- }
-- }
---- 1098,1100 ----
-diff -c /mit/zephyr/src/server/uloc.c ./uloc.c
-*** /mit/zephyr/src/server/uloc.c Mon Aug 1 09:39:54 1994
---- ./uloc.c Wed Jul 6 17:19:16 1994
-***************
-*** 108,115 ****
- static exposure_type ulogin_remove_user P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- int *err_return));
-! static void login_sendit P((ZNotice_t *notice, int auth, struct sockaddr_in *who)),
-! sense_logout P((ZNotice_t *notice, struct sockaddr_in *who));
- static char **ulogin_marshal_locs P((ZNotice_t *notice, int *found, int auth));
-
- static int ul_equiv P((ZLocation_t *l1, ZLocation_t *l2));
---- 108,114 ----
- static exposure_type ulogin_remove_user P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- int *err_return));
-! static void login_sendit P((ZNotice_t *notice, int auth, struct sockaddr_in *who));
- static char **ulogin_marshal_locs P((ZNotice_t *notice, int *found, int auth));
-
- static int ul_equiv P((ZLocation_t *l1, ZLocation_t *l2));
-***************
-*** 158,167 ****
- inet_ntoa(who->sin_addr),
- ntohs(notice->z_port)));
- #endif
-! if (server == me_server) {
- clt_ack(notice, who, AUTH_FAILED);
-- sense_logout(notice, who);
-- }
- return(ZERR_NONE);
- } else if (err_ret == NOLOC) {
- if (server == me_server)
---- 157,164 ----
- inet_ntoa(who->sin_addr),
- ntohs(notice->z_port)));
- #endif
-! if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- } else if (err_ret == NOLOC) {
- if (server == me_server)
-***************
-*** 204,210 ****
- zdbug((LOG_DEBUG,"unauthentic ulogin: %d %s %s", auth,
- notice->z_sender, notice->z_class_inst));
- #endif
-- sense_logout(notice, who);
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
---- 201,206 ----
-***************
-*** 322,386 ****
- }
-
-
-- /*ARGSUSED*/
-- static void
-- sense_logout(notice, who)
-- ZNotice_t *notice;
-- struct sockaddr_in *who;
-- {
-- ZNotice_t sense_notice;
-- ZLocation_t *loc;
-- struct sockaddr_in owner;
-- char message[BUFSIZ];
-- int retval, len;
-- char *pkt;
-- ZClient_t *client;
--
-- /* XXX todo: have the messsage print the IP addr */
-- /*
-- someone tried an unauthentic logout. Try to send a message
-- to the person named in the message, warning them of this.
-- If there is nobody listening on that port, the retransmission
-- will eventually result in a flush of the location.
-- */
--
-- if (!(loc = ulogin_find (notice, 1)))
-- return;
--
-- /* fabricate an addr descriptor for him */
-- owner = *who;
-- owner.sin_addr.s_addr = loc->zlt_addr.s_addr;
-- owner.sin_port = loc->zlt_port;
--
-- sense_notice = *notice; /* copy all fields */
-- /* and change the ones we need to */
-- sense_notice.z_kind = ACKED;
-- sense_notice.z_port = loc->zlt_port;
-- sense_notice.z_class = "MESSAGE";
-- sense_notice.z_class_inst = "URGENT";
-- sense_notice.z_opcode = "";
-- sense_notice.z_sender = "Zephyr Server";
-- sense_notice.z_recipient = (char *) loc->zlt_user->string;
-- sense_notice.z_default_format = "Urgent Message from $sender at $time:\n\n$1";
-- (void) sprintf(message,
-- "Someone at host %s tried an unauthorized \nchange to your login information",
-- inet_ntoa(notice->z_sender_addr));
-- sense_notice.z_message = message;
-- sense_notice.z_message_len = strlen(message) + 1;
--
-- /* we format the notice to generate a UID and other stuff */
-- if ((retval = ZFormatNotice(&sense_notice, &pkt, &len, ZNOAUTH))
-- != ZERR_NONE) {
-- syslog(LOG_ERR, "sense_logout: %s", error_message(retval));
-- return;
-- }
-- xfree(pkt); /* free packet */
--
-- client = client_which_client(who, &sense_notice);
-- /* transmit the message to the owning port of the location. */
-- xmit(&sense_notice, &owner, 1, client);
-- return;
-- }
- /*
- * Dispatch a LOCATE notice.
- */
---- 318,323 ----
-diff -c /mit/zephyr/src/server/version.h ./version.h
-*** /mit/zephyr/src/server/version.h Fri Nov 19 13:34:58 1993
---- ./version.h Wed Jul 6 17:19:17 1994
-***************
-*** 1 ****
-! #define ZSERVER_VERSION_STRING "(Fri Nov 19 13:34:58 EST 1993) probe@tardis"
---- 1 ----
-! #define ZSERVER_VERSION_STRING "(Wed Jul 6 14:39:57 EDT 1994) ghudson@packet-drop"
-diff -c /mit/zephyr/src/server/zserver.h ./zserver.h
-*** /mit/zephyr/src/server/zserver.h Thu Apr 7 12:40:16 1994
---- ./zserver.h Wed Jul 6 17:19:17 1994
-***************
-*** 57,63 ****
- */
-
- typedef struct _ZDestination {
-- unsigned long hash_value;
- ZSTRING *classname;
- ZSTRING *inst;
- ZSTRING *recip;
---- 57,62 ----
-***************
-*** 86,91 ****
---- 85,94 ----
- long last_msg; /* last message sent to this client */
- long last_check; /* actually, last time the other
- server was asked to check... */
-+ int last_send; /* The send counter value for the
-+ * last packet sent to the client,
-+ * used to prevent duplicates. See
-+ * sendit() in dispatch.c. */
- } ZClient_t;
-
- typedef struct _ZClientList_t {
-***************
-*** 94,106 ****
- struct _ZClient_t *zclt_client;
- } ZClientList_t;
-
-! typedef struct _ZClass_t {
-! struct _ZClass_t *q_forw;
-! struct _ZClass_t *q_back;
- ZDestination zct_dest;
- ZAcl_t *zct_acl;
- ZClientList_t *zct_clientlist;
-! } ZClass_t;
-
- typedef struct _ZHostList_t {
- struct _ZHostList_t *q_forw;
---- 97,109 ----
- struct _ZClient_t *zclt_client;
- } ZClientList_t;
-
-! typedef struct _ZTriplet_t {
-! struct _ZTriplet_t *q_forw;
-! struct _ZTriplet_t *q_back;
- ZDestination zct_dest;
- ZAcl_t *zct_acl;
- ZClientList_t *zct_clientlist;
-! } ZTriplet_t;
-
- typedef struct _ZHostList_t {
- struct _ZHostList_t *q_forw;
-***************
-*** 190,200 ****
- char **lyst, int num));
-
- /* found in class.c */
-! extern Code_t class_register P((ZClient_t *client, ZSubscr_t *subs));
-! extern Code_t class_deregister P((ZClient_t *client, ZSubscr_t *subs));
- extern Code_t class_restrict P((char *z_class, ZAcl_t *acl));
- extern Code_t class_setup_restricted P((char *z_class, ZAcl_t *acl));
-! extern ZClientList_t *class_lookup P((ZSubscr_t *subs));
- extern ZAcl_t *class_get_acl P((ZSTRING *z_class));
- extern void class_free P((ZClientList_t *lyst));
- extern ZSTRING *class_control, *class_admin, *class_hm;
---- 193,203 ----
- char **lyst, int num));
-
- /* found in class.c */
-! extern Code_t triplet_register P((ZClient_t *client, ZDestination *dest));
-! extern Code_t triplet_deregister P((ZClient_t *client, ZDestination *dest));
- extern Code_t class_restrict P((char *z_class, ZAcl_t *acl));
- extern Code_t class_setup_restricted P((char *z_class, ZAcl_t *acl));
-! extern ZClientList_t *triplet_lookup P((ZDestination *dest));
- extern ZAcl_t *class_get_acl P((ZSTRING *z_class));
- extern void class_free P((ZClientList_t *lyst));
- extern ZSTRING *class_control, *class_admin, *class_hm;
-***************
-*** 281,287 ****
- extern Code_t subscr_cancel P((struct sockaddr_in *sin, ZNotice_t *notice));
- extern Code_t subscr_subscribe P((ZClient_t *who, ZNotice_t *notice)),
- subscr_send_subs P((ZClient_t *client, char *vers));;
-- extern ZClientList_t *subscr_match_list P((ZNotice_t *notice));
- extern void subscr_free_list P((ZClientList_t *list)),
- subscr_cancel_client P((register ZClient_t *client)),
- subscr_sendlist P((ZNotice_t *notice, int auth, struct sockaddr_in *who));
---- 284,289 ----
-***************
-*** 343,350 ****
- /* found in subscr.c */
- extern ZSTRING *empty;
- extern ZSTRING *wildcard_instance;
-- extern ZSTRING *wildcard_class;
-- extern ZSubscr_t matchall_sub;
-
- extern struct in_addr my_addr; /* my inet address */
-
---- 345,350 ----
-***************
-*** 369,375 ****
- #define ADMIN_YOU "YOUR_STATE" /* Class inst: please send your state*/
- #define ADMIN_ME "MY_STATE" /* Class inst: please send my info */
-
-! #define NULLZCT ((ZClass_t *) 0)
- #define NULLZCNT ((ZClient_t *) 0)
- #define NULLZCLT ((ZClientList_t *) 0)
- #define NULLZST ((ZSubscr_t *) 0)
---- 369,375 ----
- #define ADMIN_YOU "YOUR_STATE" /* Class inst: please send your state*/
- #define ADMIN_ME "MY_STATE" /* Class inst: please send my info */
-
-! #define NULLZT ((ZTriplet_t *) 0)
- #define NULLZCNT ((ZClient_t *) 0)
- #define NULLZCLT ((ZClientList_t *) 0)
- #define NULLZST ((ZSubscr_t *) 0)
-***************
-*** 397,404 ****
- #define START_CRITICAL_CODE
- #define END_CRITICAL_CODE
-
-- /* the magic class to match all packets */
-- #define MATCHALL_CLASS "zmatch_all"
- /* the instance that matches all instances */
- #define WILDCARD_INSTANCE "*"
-
---- 397,402 ----
-diff -c /mit/zephyr/src/server/zsrv_conf.h ./zsrv_conf.h
-*** /mit/zephyr/src/server/zsrv_conf.h Fri Nov 19 15:57:44 1993
---- ./zsrv_conf.h Wed Jul 6 17:19:17 1994
-***************
-*** 18,30 ****
-
- /* Magic path names */
- #ifndef HESIOD
-! #define SERVER_LIST_FILE "/usr/athena/lib/zephyr/server.list"
- #endif
-
- /* ACL's for pre-registered classes */
- /* Directory containing acls and other info */
- #ifndef ZEPHYR_ACL_DIR
-! #define ZEPHYR_ACL_DIR "/usr/athena/lib/zephyr/acl/"
- #endif
- /* name of the class registry */
- #define ZEPHYR_CLASS_REGISTRY "class-registry.acl"
---- 18,30 ----
-
- /* Magic path names */
- #ifndef HESIOD
-! #define SERVER_LIST_FILE "/etc/athena/zephyr/server.list"
- #endif
-
- /* ACL's for pre-registered classes */
- /* Directory containing acls and other info */
- #ifndef ZEPHYR_ACL_DIR
-! #define ZEPHYR_ACL_DIR "/etc/athena/zephyr/acl/"
- #endif
- /* name of the class registry */
- #define ZEPHYR_CLASS_REGISTRY "class-registry.acl"
-***************
-*** 31,45 ****
-
- #ifdef KERBEROS
- /* name of file to hold the tickets for keys to exchange with other servers */
-! #define ZEPHYR_TKFILE "/usr/athena/lib/zephyr/ztkts"
-
-! /* Pathname of Kerberos srvtab file.
-! * WARNING: lib/ZCkAuth.c needs to have a corresponding definition! */
-! #define SERVER_SRVTAB "/usr/athena/lib/zephyr/srvtab"
- #endif /* KERBEROS */
-
- /* default subscription file */
-! #define DEFAULT_SUBS_FILE "/usr/athena/lib/zephyr/default.subscriptions"
-
- /* client defines */
- #define REXMIT_SECS ((long) 20) /* rexmit delay on normal notices */
---- 31,43 ----
-
- #ifdef KERBEROS
- /* name of file to hold the tickets for keys to exchange with other servers */
-! #define ZEPHYR_TKFILE "/etc/athena/zephyr/ztkts"
-
-! /* The pathname of the Kerberos srvtab file is defined in zephyr_conf.h. */
- #endif /* KERBEROS */
-
- /* default subscription file */
-! #define DEFAULT_SUBS_FILE "/etc/athena/zephyr/default.subscriptions"
-
- /* client defines */
- #define REXMIT_SECS ((long) 20) /* rexmit delay on normal notices */
diff --git a/logs/tag.77 b/logs/tag.77
deleted file mode 100644
index 319c5eb..0000000
--- a/logs/tag.77
+++ /dev/null
@@ -1,62 +0,0 @@
-./server/BUGS: SKIPPING - No RCS file exists
-./server/acl/class-registry.acl: SKIPPING - No RCS file exists
-./server/acl/iui-filsrv.acl: SKIPPING - No RCS file exists
-./server/acl/iui-hm_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/iui-hm_stat.acl: SKIPPING - No RCS file exists
-./server/acl/iui-login.acl: SKIPPING - No RCS file exists
-./server/acl/iui-operations.acl: SKIPPING - No RCS file exists
-./server/acl/iui-ops.acl: SKIPPING - No RCS file exists
-./server/acl/iui-user_locate.acl: SKIPPING - No RCS file exists
-./server/acl/iui-wg_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/iui-zephyr_admin.acl: SKIPPING - No RCS file exists
-./server/acl/iui-zephyr_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/iui-zmatch_all.acl: SKIPPING - No RCS file exists
-./server/acl/iws-filsrv.acl: SKIPPING - No RCS file exists
-./server/acl/iws-hm_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/iws-hm_stat.acl: SKIPPING - No RCS file exists
-./server/acl/iws-login.acl: SKIPPING - No RCS file exists
-./server/acl/iws-operations.acl: SKIPPING - No RCS file exists
-./server/acl/iws-ops.acl: SKIPPING - No RCS file exists
-./server/acl/iws-user_locate.acl: SKIPPING - No RCS file exists
-./server/acl/iws-wg_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/iws-zephyr_admin.acl: SKIPPING - No RCS file exists
-./server/acl/iws-zephyr_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/iws-zmatch_all.acl: SKIPPING - No RCS file exists
-./server/acl/sub-filsrv.acl: SKIPPING - No RCS file exists
-./server/acl/sub-hm_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/sub-hm_stat.acl: SKIPPING - No RCS file exists
-./server/acl/sub-login.acl: SKIPPING - No RCS file exists
-./server/acl/sub-operations.acl: SKIPPING - No RCS file exists
-./server/acl/sub-ops.acl: SKIPPING - No RCS file exists
-./server/acl/sub-user_locate.acl: SKIPPING - No RCS file exists
-./server/acl/sub-wg_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/sub-zephyr_admin.acl: SKIPPING - No RCS file exists
-./server/acl/sub-zephyr_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-filsrv.acl: SKIPPING - No RCS file exists
-./server/acl/sub-zmatch_all.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-hm_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-hm_stat.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-login.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-operations.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-ops.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-user_locate.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-wg_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-zephyr_admin.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-zephyr_ctl.acl: SKIPPING - No RCS file exists
-./server/acl/xmt-zmatch_all.acl: SKIPPING - No RCS file exists
-./server/version.h: SKIPPING - No RCS file exists
-./tools/zlook: SKIPPING - No RCS file exists
-./tools/zsubscriptions: SKIPPING - No RCS file exists
-./lib/lib_headers: SKIPPING - No RCS file exists
-./lib/decl.awk: SKIPPING - No RCS file exists
-./lib/decl: SKIPPING - No RCS file exists
-./zhm/TODO: SKIPPING - No RCS file exists
-./prototype.c: SKIPPING - No RCS file exists
-./ChangeLog: SKIPPING - No RCS file exists
-./clients/syslogd/syslog.conf: SKIPPING - No RCS file exists
-./clients/syslogd/syslog.3: SKIPPING - No RCS file exists
-./clients/syslogd/syslog.h: SKIPPING - No RCS file exists
-./clients/syslogd/syslog_patch.43tahoe: SKIPPING - No RCS file exists
-./LOG.tag: NEW FILE (Mon Aug 1 8:56:03 EDT 1994)
-./libdyn/dyn.3m: SKIPPING - No RCS file exists
-./.rconf: SKIPPING - No RCS file exists
diff --git a/patchlevel.h b/patchlevel.h
deleted file mode 100644
index 82d4f62..0000000
--- a/patchlevel.h
+++ /dev/null
@@ -1 +0,0 @@
-#define PATCHLEVEL 4
diff --git a/prototype.c b/prototype.c
deleted file mode 100644
index 59e309a..0000000
--- a/prototype.c
+++ /dev/null
@@ -1,20 +0,0 @@
-You should replace all of the <> bracketed text before you can compile
-this file.
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains functions for <frobbing nakrabs>.
- *
- * Created by: <Joe Random Hacker>
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1990 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#ifndef lint
-static char rcsid_<foo_c>[] = "$Header$";
-#endif lint
diff --git a/server/BUGS b/server/BUGS
deleted file mode 100644
index ba58741..0000000
--- a/server/BUGS
+++ /dev/null
@@ -1,2 +0,0 @@
-* race conditions may still exist...
-* two renegade servers won't find each other.
diff --git a/server/Imakefile b/server/Imakefile
deleted file mode 100644
index fcf0232..0000000
--- a/server/Imakefile
+++ /dev/null
@@ -1,76 +0,0 @@
-/**/# Copyright 1988 Massachusetts Institute of Technology.
-/**/#
-/**/# For copying and distribution information, see the file
-/**/# "mit-copyright.h".
-/**/#
-/**/# $Source$
-/**/# $Author$
-/**/# $Header$
-/**/#
-
-#if defined(SYSLOG_COMPAT42)
-SYSLOG_OBJ= ../clients/syslogd/syslog.o
-SYSLOG_DEF= -I../clients/syslogd
-#else
-SYSLOG_OBJ=
-SYSLOG_DEF=
-#endif
-
-#ifdef __NetBSD__
-OSLIBS=-lcompat /* for insque() */
-#endif
-
-XDEFS = $(SYSLOG_DEF) -DCONCURRENT
-
-SRCS= access.c \
- bdump.c \
- class.c \
- client.c \
- common.c \
- dispatch.c \
- hostm.c \
- kopt.c \
- kstuff.c \
- main.c \
- server.c \
- subscr.c \
- timer.c \
- uloc.c \
- version.c \
- zsrv_err.c \
- zstring.c
-
-OBJS= access.o \
- bdump.o \
- class.o \
- client.o \
- common.o \
- dispatch.o \
- hostm.o \
- kopt.o \
- kstuff.o \
- main.o \
- server.o \
- subscr.o \
- timer.o \
- uloc.o \
- zsrv_err.o \
- zstring.o
-
-error_table(zsrv_err)
-SimpleProgram(zephyrd,$(OBJS) $(SYSLOG_OBJ) version.o $(ZLIB) $(ZLIBDES), $(ZLIBS) $(OSLIBS), $(ATHETCDIR))
-install_man(zephyrd.8,zephyrd.8)
-install_file(default.subscriptions,$(ZETCDIR))
-
-create_dir($(ZACLDIR))
-install::
- $(RM) $(DESTDIR)$(ZACLDIR)/?*.acl
- $(CP) acl/?* $(DESTDIR)$(ZACLDIR)
-
-depend:: zsrv_err.h version.h
-$(OBJS): zsrv_err.h
-
-version.o: version.h
-version.h: $(SRCS)
- $(RM) version.h
- sh new_vers.sh
diff --git a/server/Makefile.in b/server/Makefile.in
new file mode 100644
index 0000000..9a4cf56
--- /dev/null
+++ b/server/Makefile.in
@@ -0,0 +1,67 @@
+SHELL = /bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datadir=@datadir@
+confdir=@confdir@
+sbindir=@sbindir@
+lsbindir=@lsbindir@
+
+includedir=${prefix}/include
+mandir=${prefix}/man
+libdir=${exec_prefix}/lib
+
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+BUILDTOP=..
+VPATH=@srcdir@
+CC=@CC@
+INSTALL=@INSTALL@
+COMPILE_ET=@COMPILE_ET@
+
+DEBUG=-O
+CFLAGS=${DEBUG} -DCONFDIR=\"${confdir}\" -I${top_srcdir}/h -I${BUILDTOP}/h \
+ -I. @CPPFLAGS@
+LDFLAGS=${DEBUG} -L${BUILDTOP}/lib/zephyr @ET_LDFLAGS@ @LDFLAGS@
+LIBS=-lzephyr @LIBS@ -lcom_err
+
+OBJS= zsrv_err.o access.o acl_files.o bdump.o class.o client.o common.o \
+ dispatch.o kopt.o kstuff.o main.o server.o subscr.o timer.o uloc.o \
+ zstring.o realm.o version.o
+
+all: zephyrd
+
+zephyrd: ${OBJS} ${BUILDTOP}/lib/zephyr/libzephyr.a @ETDEP@
+ ${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
+
+zsrv_err.c zsrv_err.h: zsrv_err.et
+ ${COMPILE_ET} ${srcdir}/zsrv_err.et
+
+version.o: version.h
+
+version.h: always
+ sh ${srcdir}/new_vers.sh
+
+check:
+
+# No dependency on zephyrd, to avoid rebuilding version.o.
+install:
+ ${INSTALL} -m 755 -s zephyrd ${DESTDIR}${sbindir}
+ ${INSTALL} -m 644 ${srcdir}/zephyrd.8 ${DESTDIR}${mandir}/man8
+ ${INSTALL} -m 644 ${srcdir}/default.subscriptions ${DESTDIR}${confdir}
+ rm -f ${DESTDIR}${confdir}/acl/?*.acl
+ cp ${srcdir}/acl/?*.acl ${DESTDIR}${confdir}/acl
+ chmod 644 ${DESTDIR}${confdir}/acl/*
+
+clean:
+ rm -f ${OBJS} zephyrd zsrv_err.[ch]
+
+always:
+
+${OBJS}: zserver.h zsrv_err.h timer.h zsrv_conf.h zstring.h access.h acl.h
+${OBJS}: ${top_srcdir}/h/internal.h ${top_srcdir}/h/sysdep.h
+${OBJS}: ${BUILDTOP}/h/config.h ${BUILDTOP}/h/zephyr/zephyr.h
+${OBJS}: ${BUILDTOP}/h/zephyr/zephyr_err.h
+
+.PHONY: all check install clean always
+
diff --git a/server/access.c b/server/access.c
index 9550904..325b911 100644
--- a/server/access.c
+++ b/server/access.c
@@ -12,9 +12,11 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
+#include <com_err.h>
#if !defined (lint) && !defined (SABER)
-static char rcsid_access_c[] =
+static const char rcsid_access_c[] =
"$Id$";
#endif
@@ -24,8 +26,8 @@ static char rcsid_access_c[] =
*
* int access_check(notice, acl, accesstype)
* ZNotice_t *notice;
- * ZAcl_t *acl;
- * ZAccess_t accesstype;
+ * Acl *acl;
+ * Access accesstype;
*
* void access_init();
*
@@ -39,14 +41,8 @@ static char rcsid_access_c[] =
* routines and the support needed by the Zephyr server.
*/
-#include <sys/param.h>
-#ifdef SOLARIS
-#include <sys/filio.h>
-#endif
-#include "zserver.h"
-
/*
- * Our private types for the acl_types field in the ZAcl_t structure.
+ * Our private types for the acl_types field in the Acl structure.
* -TYT 8/14/90
*/
#define ACL_XMT 1
@@ -54,18 +50,9 @@ static char rcsid_access_c[] =
#define ACL_IWS 4
#define ACL_IUI 8
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static void check_acl P((ZAcl_t *acl));
-static void check_acl_type P((ZAcl_t *acl, ZAccess_t accesstype,
- int typeflag));
-static void access_setup P((int first));
-
-#undef P
+static void check_acl __P((Acl *acl));
+static void check_acl_type __P((Acl *acl, Access accesstype, int typeflag));
+static void access_setup __P((int first));
/*
* check access. return 1 if ok, 0 if not ok.
@@ -73,195 +60,176 @@ static void access_setup P((int first));
int
access_check(sender, acl, accesstype)
- char *sender;
- ZAcl_t *acl;
- ZAccess_t accesstype;
+ char *sender;
+ Acl *acl;
+ Access accesstype;
{
- char buf[MAXPATHLEN]; /* holds the real acl name */
- char *prefix;
- int flag;
- int retval;
-
- switch (accesstype) {
- case TRANSMIT:
- prefix = "xmt";
- flag = ACL_XMT;
- break;
- case SUBSCRIBE:
- prefix = "sub";
- flag = ACL_SUB;
- break;
- case INSTWILD:
- prefix = "iws";
- flag = ACL_IWS;
- break;
- case INSTUID:
- prefix = "iui";
- flag = ACL_IUI;
- break;
- default:
- syslog(LOG_ERR, "unknown access type %d", (int) accesstype);
- return(0);
- }
- if (!(acl->acl_types) & flag) /* no acl ==> no restriction
- ==> thumbs up */
- return (1);
- (void) sprintf(buf, "%s%s-%s.acl",
- ZEPHYR_ACL_DIR,
- prefix,
- acl->acl_filename);
- /*
- * If we can't load it (because it probably doesn't exist),
- * we deny access.
- */
+ char buf[MAXPATHLEN]; /* holds the real acl name */
+ char *prefix;
+ int flag;
+ int retval;
+
+ switch (accesstype) {
+ case TRANSMIT:
+ prefix = "xmt";
+ flag = ACL_XMT;
+ break;
+ case SUBSCRIBE:
+ prefix = "sub";
+ flag = ACL_SUB;
+ break;
+ case INSTWILD:
+ prefix = "iws";
+ flag = ACL_IWS;
+ break;
+ case INSTUID:
+ prefix = "iui";
+ flag = ACL_IUI;
+ break;
+ default:
+ syslog(LOG_ERR, "unknown access type %d", (int) accesstype);
+ return 0;
+ }
+ if (!(acl->acl_types & flag)) /* no acl ==> no restriction */
+ return 1;
+ sprintf(buf, "%s/%s-%s.acl", acl_dir, prefix, acl->acl_filename);
+ /*
+ * If we can't load it (because it probably doesn't exist),
+ * we deny access.
+ */
#if 0
- zdbug ((LOG_DEBUG, "checking %s for %s", buf, sender));
+ zdbug ((LOG_DEBUG, "checking %s for %s", buf, sender));
#endif
- retval = acl_load(buf);
- if (retval < 0) {
- syslog(LOG_DEBUG, "Error in acl_load of %s for %s", buf, sender);
- return(0);
- }
- return (acl_check(buf, sender));
+ retval = acl_load(buf);
+ if (retval < 0) {
+ syslog(LOG_DEBUG, "Error in acl_load of %s for %s", buf, sender);
+ return 0;
+ }
+ return acl_check(buf, sender);
}
static void
check_acl(acl)
- ZAcl_t *acl;
+ Acl *acl;
{
- acl->acl_types = 0;
- check_acl_type (acl, TRANSMIT, ACL_XMT);
- check_acl_type (acl, SUBSCRIBE, ACL_SUB);
- check_acl_type (acl, INSTWILD, ACL_IWS);
- check_acl_type (acl, INSTUID, ACL_IUI);
+ acl->acl_types = 0;
+ check_acl_type(acl, TRANSMIT, ACL_XMT);
+ check_acl_type(acl, SUBSCRIBE, ACL_SUB);
+ check_acl_type(acl, INSTWILD, ACL_IWS);
+ check_acl_type(acl, INSTUID, ACL_IUI);
}
static void
check_acl_type(acl, accesstype, typeflag)
- ZAcl_t *acl;
- ZAccess_t accesstype;
- int typeflag;
+ Acl *acl;
+ Access accesstype;
+ int typeflag;
{
- char buf[MAXPATHLEN]; /* holds the real acl name */
- char *prefix;
-
- switch (accesstype) {
- case TRANSMIT:
- prefix = "xmt";
- break;
- case SUBSCRIBE:
- prefix = "sub";
- break;
- case INSTWILD:
- prefix = "iws";
- break;
- case INSTUID:
- prefix = "iui";
- break;
- default:
- syslog(LOG_ERR, "unknown access type %d", (int) accesstype);
- return;
- }
- (void) sprintf(buf, "%s%s-%s.acl",
- ZEPHYR_ACL_DIR,
- prefix,
- acl->acl_filename);
- if (!access(buf, F_OK))
- acl->acl_types |= typeflag;
+ char buf[MAXPATHLEN]; /* holds the real acl name */
+ char *prefix;
+
+ switch (accesstype) {
+ case TRANSMIT:
+ prefix = "xmt";
+ break;
+ case SUBSCRIBE:
+ prefix = "sub";
+ break;
+ case INSTWILD:
+ prefix = "iws";
+ break;
+ case INSTUID:
+ prefix = "iui";
+ break;
+ default:
+ syslog(LOG_ERR, "unknown access type %d", (int) accesstype);
+ return;
+ }
+ sprintf(buf, "%s/%s-%s.acl", acl_dir, prefix, acl->acl_filename);
+ if (!access(buf, F_OK))
+ acl->acl_types |= typeflag;
}
-
+
/*
* Re-init code written by TYT, 8/14/90.
*
* General plan of action; we reread the registry list, and add any
* new restricted classes. If any restricted classes disappear (this
- * should be rarely) the ZAcl_t structure is not deallocated; rather,
+ * should be rarely) the Acl structure is not deallocated; rather,
* the acl_types field will be left at zero, since there will be no
* acl files for the (non-)restricted class.
*/
static void
-#ifdef __STDC__
-access_setup (int first)
-#else
access_setup(first)
- int first;
-#endif
+ int first;
{
- char buf[MAXPATHLEN];
- char class_name[512]; /* assume class names <= 511 bytes */
- FILE *registry;
- ZAcl_t *acl;
- register int len;
- register char *colon_idx;
- Code_t retval = 0;
-
- (void) sprintf(buf, "%s%s", ZEPHYR_ACL_DIR, ZEPHYR_CLASS_REGISTRY);
-
- if ((registry = fopen(buf, "r")) == (FILE *) NULL) {
- syslog(LOG_ERR, "no registry available, all classes are free");
- return;
+ char buf[MAXPATHLEN];
+ char class_name[512]; /* assume class names <= 511 bytes */
+ FILE *registry;
+ Acl *acl;
+ int len;
+ char *colon_idx;
+ Code_t retval = 0;
+
+ sprintf(buf, "%s/%s", acl_dir, ZEPHYR_CLASS_REGISTRY);
+ registry = fopen(buf, "r");
+ if (!registry) {
+ syslog(LOG_ERR, "no registry available, all classes are free");
+ return;
+ }
+ while (fgets(class_name, 512, registry)) {
+ colon_idx = strchr(class_name, ':');
+ if (colon_idx != NULL)
+ *colon_idx = '\0';
+ else if ((len = strlen(class_name)) != 0)
+ class_name[len - 1] = '\0';
+ acl = 0;
+ if (!first) {
+ String *z;
+
+ z = make_string(class_name,1);
+ acl = class_get_acl(z);
+ free_string(z);
}
- while (fgets(class_name, 512, registry) != NULL) {
- if ((colon_idx = (char *) strchr(class_name, ':')) != NULL)
- *colon_idx = '\0';
- else if ((len = strlen(class_name)) != 0)
- class_name[len - 1] = '\0';
- acl = 0;
- if (!first) {
- ZSTRING *z;
- z = make_zstring(class_name,1);
- acl = class_get_acl(z);
- free_zstring(z);
- }
- if (!acl) {
- acl = (ZAcl_t *) xmalloc(sizeof(ZAcl_t));
- if (!acl) {
- syslog(LOG_ERR, "no mem acl alloc");
- abort();
- }
- acl->acl_filename = strsave(class_name);
- check_acl(acl);
+ if (!acl) {
+ acl = (Acl *) malloc(sizeof(Acl));
+ if (!acl) {
+ syslog(LOG_ERR, "no mem acl alloc");
+ abort();
+ }
+ acl->acl_filename = strsave(class_name);
+ check_acl(acl);
- if (!first) {
- /* Try to restrict already existing class */
- retval = class_restrict (class_name, acl);
- if (retval == ZSRV_NOCLASS)
- retval = class_setup_restricted (class_name, acl);
- }
- else
- retval = class_setup_restricted (class_name, acl);
- }
- if (retval) {
- syslog(LOG_ERR, "can't restrict %s: %s",
- class_name, error_message(retval));
- continue;
- }
- zdbug((LOG_DEBUG, "restricted %s", class_name));
+ if (!first) {
+ /* Try to restrict already existing class */
+ retval = class_restrict(class_name, acl);
+ if (retval == ZSRV_NOCLASS)
+ retval = class_setup_restricted(class_name, acl);
+ } else {
+ retval = class_setup_restricted(class_name, acl);
+ }
}
- (void) fclose(registry);
-
- return;
+ if (retval) {
+ syslog(LOG_ERR, "can't restrict %s: %s",
+ class_name, error_message(retval));
+ continue;
+ }
+ zdbug((LOG_DEBUG, "restricted %s", class_name));
+ }
+ fclose(registry);
}
void
-#ifdef __STDC__
-access_init (void)
-#else
access_init()
-#endif
{
- access_setup (1);
+ access_setup(1);
}
void
-#ifdef __STDC__
-access_reinit (void)
-#else
access_reinit()
-#endif
{
- acl_cache_reset ();
- access_setup (0);
+ acl_cache_reset();
+ access_setup(0);
}
diff --git a/server/access.h b/server/access.h
index df1201d..32507e3 100644
--- a/server/access.h
+++ b/server/access.h
@@ -17,36 +17,28 @@
#include <zephyr/mit-copyright.h>
-#include <zephyr/acl.h>
+#include "acl.h"
#include "zstring.h"
-#include "unix.h"
-
-typedef enum _ZAccess_t {
- TRANSMIT, /* use transmission acl */
- SUBSCRIBE, /* use subscription acl */
- INSTWILD, /* use instance wildcard acl */
- INSTUID /* use instance UID identity acl */
-} ZAccess_t;
-
-typedef struct _ZAcl_t {
- char *acl_filename;
- int acl_types; /* Flag field indcating which acls
- are present. Used ONLY in access.c */
-} ZAcl_t;
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
+
+typedef enum _Access {
+ TRANSMIT, /* use transmission acl */
+ SUBSCRIBE, /* use subscription acl */
+ INSTWILD, /* use instance wildcard acl */
+ INSTUID /* use instance UID identity acl */
+} Access;
+
+typedef struct _Acl {
+ char *acl_filename;
+ int acl_types; /* Internal; access fields present. */
+} Acl;
/* found in access.c */
-extern void access_init P((void)), access_reinit P((void));
+void access_init __P((void));
+void access_reinit __P((void));
/* found in acl_files.c */
-extern int acl_load P((char *));
-
-#undef P
+int acl_load __P((char *));
/* external data relevant */
extern int zdebug;
+
diff --git a/h/zephyr/acl.h b/server/acl.h
index a196ed1..679cd95 100644
--- a/h/zephyr/acl.h
+++ b/server/acl.h
@@ -16,12 +16,12 @@
#ifndef __ACL__
#define __ACL__
-#if defined(__STDC_)
- extern int acl_add ( char *, char *);
- extern int acl_check ( char *, char *);
- extern int acl_delete ( char *, char *);
- extern int acl_initialize ( char *, int);
-#else /* not STDC */
-extern int acl_check(), acl_add(), acl_delete(), acl_initialize();
-#endif
+
+int acl_add __P((char *, char *));
+int acl_check __P((char *, char *));
+int acl_delete __P((char *, char *));
+int acl_initialize __P((char *, int));
+void acl_cache_reset __P((void));
+
#endif /* __ACL__ */
+
diff --git a/lib/acl_files.c b/server/acl_files.c
index 7025b1b..27c7f63 100644
--- a/lib/acl_files.c
+++ b/server/acl_files.c
@@ -19,21 +19,18 @@
* declared and not statically declared.
*/
+#include <zephyr/mit-copyright.h>
+#include "zserver.h"
+
+
+#ifndef SABER
#ifndef lint
-static char rcsid_acl_files_c[] = "$Id$";
-#endif
+static const char rcsid_acl_files_c[] = "$Id$";
+#endif /* lint */
+#endif /* SABER */
/*** Routines for manipulating access control list files ***/
-#include <zephyr/zephyr.h>
-#include <string.h>
-#include <sys/file.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <sys/param.h> /* for MAXHOSTNAMELEN */
-#include <errno.h>
-
/* "aname.inst@realm" */
#define MAX_PRINCIPAL_SIZE (ANAME_SZ + INST_SZ + REALM_SZ + 3)
#define INST_SEP '.'
@@ -47,31 +44,34 @@ static char rcsid_acl_files_c[] = "$Id$";
#define CACHED_ACLS 64 /* How many acls to cache */
#define ACL_LEN 256 /* Twice a reasonable acl length */
-#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
-#endif
#define COR(a,b) ((a!=NULL)?(a):(b))
+extern int errno;
+
+extern time_t time();
+
/* Canonicalize a principal name */
/* If instance is missing, it becomes "" */
/* If realm is missing, it becomes the local realm */
/* Canonicalized form is put in canon, which must be big enough to hold
MAX_PRINCIPAL_SIZE characters */
-acl_canonicalize_principal(principal, canon)
+void acl_canonicalize_principal(principal, canon)
char *principal;
char *canon;
{
- char *dot, *atsign, *end;
+ char *end;
+ char *dot, *atsign;
int len;
- dot = (char *)strchr(principal, INST_SEP);
- atsign = (char *)strchr(principal, REALM_SEP);
+ dot = strchr(principal, INST_SEP);
+ atsign = strchr(principal, REALM_SEP);
/* Maybe we're done already */
- if(dot != NULL && atsign != NULL) {
- if(dot < atsign) {
+ if (dot != NULL && atsign != NULL) {
+ if (dot < atsign) {
/* It's for real */
/* Copy into canon */
strncpy(canon, principal, MAX_PRINCIPAL_SIZE);
@@ -95,7 +95,7 @@ acl_canonicalize_principal(principal, canon)
*canon++ = INST_SEP;
/* Get the instance, if it exists */
- if(dot != NULL) {
+ if (dot != NULL) {
++dot;
len = MIN(INST_SZ, COR(atsign, end) - dot);
strncpy(canon, dot, len);
@@ -107,20 +107,21 @@ acl_canonicalize_principal(principal, canon)
/* Get the realm, if it exists */
/* Otherwise, default to local realm */
- if(atsign != NULL) {
+ if (atsign != NULL) {
++atsign;
len = MIN(REALM_SZ, end - atsign);
strncpy(canon, atsign, len);
canon += len;
*canon++ = '\0';
}
-#ifdef Z_HaveKerberos
- else if(krb_get_lrealm(canon, 1) != KSUCCESS) {
+#ifdef ZEPHYR_USES_KERBEROS
+ else if (krb_get_lrealm(canon, 1) != KSUCCESS) {
strcpy(canon, KRB_REALM);
}
#endif
}
-
+
+#ifdef notdef
/* Get a lock to modify acl_file */
/* Return new FILE pointer */
/* or NULL if file cannot be modified */
@@ -134,16 +135,16 @@ static FILE *acl_lock_file(acl_file)
FILE *nf;
int mode;
- if(stat(acl_file, &s) < 0) return(NULL);
+ if (stat(acl_file, &s) < 0) return(NULL);
mode = s.st_mode;
sprintf(new, NEW_FILE, acl_file);
- for(;;) {
+ for (;;) {
/* Open the new file */
- if((nfd = open(new, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0) {
- if(errno == EEXIST) {
+ if ((nfd = open(new, O_WRONLY|O_CREAT|O_EXCL, mode)) < 0) {
+ if (errno == EEXIST) {
/* Maybe somebody got here already, maybe it's just old */
- if(stat(new, &s) < 0) return(NULL);
- if(time(0) - s.st_ctime > WAIT_TIME) {
+ if (stat(new, &s) < 0) return(NULL);
+ if (time(0) - s.st_ctime > WAIT_TIME) {
/* File is stale, kill it */
unlink(new);
continue;
@@ -160,7 +161,7 @@ static FILE *acl_lock_file(acl_file)
/* If we got to here, the lock file is ours and ok */
/* Reopen it under stdio */
- if((nf = fdopen(nfd, "w")) == NULL) {
+ if ((nf = fdopen(nfd, "w")) == NULL) {
/* Oops, clean up */
unlink(new);
}
@@ -183,7 +184,7 @@ static int acl_commit(acl_file, f)
struct stat s;
sprintf(new, NEW_FILE, acl_file);
- if(fflush(f) < 0
+ if (fflush(f) < 0
|| fstat(fileno(f), &s) < 0
|| s.st_nlink == 0) {
acl_abort(acl_file, f);
@@ -211,16 +212,15 @@ static int acl_abort(acl_file, f)
struct stat s;
/* make sure we aren't nuking someone else's file */
- if(fstat(fileno(f), &s) < 0
- || s.st_nlink == 0) {
- fclose(f);
- return(-1);
- } else {
- sprintf(new, NEW_FILE, acl_file);
- ret = unlink(new);
- fclose(f);
- return(ret);
- }
+ if (fstat(fileno(f), &s) < 0 || s.st_nlink == 0) {
+ fclose(f);
+ return(-1);
+ } else {
+ sprintf(new, NEW_FILE, acl_file);
+ ret = unlink(new);
+ fclose(f);
+ return(ret);
+ }
#else
abort ();
#endif
@@ -239,11 +239,11 @@ acl_initialize(acl_file, perm)
int fd;
/* Check if the file exists already */
- if((new = acl_lock_file(acl_file)) != NULL) {
+ if ((new = acl_lock_file(acl_file)) != NULL) {
return(acl_commit(acl_file, new));
} else {
/* File must be readable and writable by owner */
- if((fd = open(acl_file, O_CREAT|O_EXCL, perm|0600)) < 0) {
+ if ((fd = open(acl_file, O_CREAT|O_EXCL, perm|0600)) < 0) {
return(-1);
} else {
close(fd);
@@ -252,15 +252,17 @@ acl_initialize(acl_file, perm)
}
}
+#endif /* notdef */
+
/* Eliminate all whitespace character in buf */
/* Modifies its argument */
-static nuke_whitespace(buf)
+static void nuke_whitespace(buf)
char *buf;
{
- register char *pin, *pout;
+ char *pin, *pout;
- for(pin = pout = buf; *pin != '\0'; pin++)
- if(!isspace(*pin)) *pout++ = *pin;
+ for (pin = pout = buf; *pin != '\0'; pin++)
+ if (!isspace(*pin)) *pout++ = *pin;
*pout = '\0'; /* Terminate the string */
}
@@ -278,7 +280,7 @@ static struct hashtbl *make_hash(size)
{
struct hashtbl *h;
- if(size < 1) size = 1;
+ if (size < 1) size = 1;
h = (struct hashtbl *) malloc(sizeof(struct hashtbl));
h->size = size;
h->entries = 0;
@@ -293,8 +295,8 @@ destroy_hash(h)
{
int i;
- for(i = 0; i < h->size; i++) {
- if(h->tbl[i] != NULL) free(h->tbl[i]);
+ for (i = 0; i < h->size; i++) {
+ if (h->tbl[i] != NULL) free(h->tbl[i]);
}
free(h->tbl);
free(h);
@@ -303,18 +305,18 @@ destroy_hash(h)
/* Compute hash value for a string */
static unsigned int
hashval(s)
- register char *s;
+ char *s;
{
- register unsigned hv;
+ unsigned hv;
- for(hv = 0; *s != '\0'; s++) {
+ for (hv = 0; *s != '\0'; s++) {
hv ^= ((hv << 3) ^ *s);
}
return(hv);
}
/* Add an element to a hash table */
-static add_hash(h, el)
+static void add_hash(h, el)
struct hashtbl *h;
char *el;
{
@@ -323,12 +325,15 @@ static add_hash(h, el)
char **old;
int i;
+#if 0
+ fprintf (stderr, "adding %s to acl hash %08X\n", el, h);
+#endif
/* Make space if it isn't there already */
- if(h->entries + 1 > (h->size >> 1)) {
+ if (h->entries + 1 > (h->size >> 1)) {
old = h->tbl;
h->tbl = (char **) calloc(h->size << 1, sizeof(char *));
- for(i = 0; i < h->size; i++) {
- if(old[i] != NULL) {
+ for (i = 0; i < h->size; i++) {
+ if (old[i] != NULL) {
hv = hashval(old[i]) % (h->size << 1);
while(h->tbl[hv] != NULL) hv = (hv+1) % (h->size << 1);
h->tbl[hv] = old[i];
@@ -354,11 +359,23 @@ check_hash(h, el)
{
unsigned hv;
- for(hv = hashval(el) % h->size; h->tbl[hv]; hv = (hv + 1) % h->size) {
+#if 0
+ fprintf (stderr, "looking for %s in acl %08X\n", el, h);
+#endif
+ for (hv = hashval(el) % h->size; h->tbl[hv]; hv = (hv + 1) % h->size) {
+#if 0
+ fprintf (stderr, "\tstrcmp (%s,...)\n", h->tbl[hv]);
+#endif
if (!strcmp(h->tbl[hv], el)) {
+#if 0
+ fprintf (stderr, "success!\n");
+#endif
return 1;
}
}
+#if 0
+ fprintf (stderr, "failure\n");
+#endif
return 0;
}
@@ -384,20 +401,20 @@ int acl_load(name)
char canon[MAX_PRINCIPAL_SIZE];
/* See if it's there already */
- for(i = 0; i < acl_cache_count; i++) {
- if (!strcmp(acl_cache[i].filename, name))
- goto got_it;
+ for (i = 0; i < acl_cache_count; i++) {
+ if (!strcmp(acl_cache[i].filename, name))
+ goto got_it;
}
/* It isn't, load it in */
/* maybe there's still room */
- if(acl_cache_count < CACHED_ACLS) {
+ if (acl_cache_count < CACHED_ACLS) {
i = acl_cache_count++;
} else {
/* No room, clean one out */
i = acl_cache_next;
acl_cache_next = (acl_cache_next + 1) % CACHED_ACLS;
- if(acl_cache[i].acl) {
+ if (acl_cache[i].acl) {
destroy_hash(acl_cache[i].acl);
acl_cache[i].acl = (struct hashtbl *) 0;
}
@@ -408,24 +425,30 @@ int acl_load(name)
/* Force reload */
acl_cache[i].acl = (struct hashtbl *) 0;
-got_it:
+ got_it:
/*
* See if we need to reload the ACL
*/
if (acl_cache[i].acl == (struct hashtbl *) 0) {
- /* Gotta reload */
- if ((f = fopen(name, "r")) == NULL) {
- return -1;
- }
- if (acl_cache[i].acl) destroy_hash(acl_cache[i].acl);
- acl_cache[i].acl = make_hash(ACL_LEN);
- while(fgets(buf, sizeof(buf), f) != NULL) {
- nuke_whitespace(buf);
- acl_canonicalize_principal(buf, canon);
- add_hash(acl_cache[i].acl, canon);
- }
- fclose(f);
- }
+ /* Gotta reload */
+#if 0
+ fprintf (stderr, "attempting to load %s\n", name);
+#endif
+ if ((f = fopen(name, "r")) == NULL) {
+#if 0
+ perror (name);
+#endif
+ return -1;
+ }
+ if (acl_cache[i].acl) destroy_hash(acl_cache[i].acl);
+ acl_cache[i].acl = make_hash(ACL_LEN);
+ while(fgets(buf, sizeof(buf), f) != NULL) {
+ nuke_whitespace(buf);
+ acl_canonicalize_principal(buf, canon);
+ add_hash(acl_cache[i].acl, canon);
+ }
+ fclose(f);
+ }
return(i);
}
@@ -433,19 +456,20 @@ got_it:
* This destroys all cached ACL's so that new ones will be loaded in
* the next time they are requested.
*/
+void
acl_cache_reset()
{
- int i;
-
- /* See if it's there already */
- for(i = 0; i < acl_cache_count; i++)
- if (acl_cache[i].acl) {
- destroy_hash(acl_cache[i].acl);
- acl_cache[i].acl = (struct hashtbl *) 0;
+ int i;
+
+ /* See if it's there already */
+ for (i = 0; i < acl_cache_count; i++)
+ if (acl_cache[i].acl) {
+ destroy_hash(acl_cache[i].acl);
+ acl_cache[i].acl = (struct hashtbl *) 0;
+ }
+ acl_cache_count = 0;
+ acl_cache_next = 0;
}
- acl_cache_count = 0;
- acl_cache_next = 0;
-}
/* Returns nonzero if it can be determined that acl contains principal */
@@ -456,42 +480,50 @@ acl_exact_match(acl, principal)
{
int idx;
+#if 0
+ fprintf (stderr, "checking for %s in %s\n", principal, acl);
+#endif
return((idx = acl_load(acl)) >= 0
&& check_hash(acl_cache[idx].acl, principal));
}
/* Returns nonzero if it can be determined that acl contains principal */
-/* Recognizes wildcards in acl of the form
- name.*@realm, *.*@realm, and *.*@* */
+/* Recognizes wildcards in acl. */
+int
acl_check(acl, principal)
char *acl;
char *principal;
{
char buf[MAX_PRINCIPAL_SIZE];
char canon[MAX_PRINCIPAL_SIZE];
- char *realm;
+ char *instance, *realm;
+ int p, i, r;
+ /* Parse into principal, instance, and realm. */
acl_canonicalize_principal(principal, canon);
-
- /* Is it there? */
- if (acl_exact_match(acl, canon))
- return 1;
-
- /* Try the wildcards */
- realm = (char *)strchr(canon, REALM_SEP);
- *((char *)strchr(canon, INST_SEP)) = '\0'; /* Chuck the instance */
-
- sprintf(buf, "%s.*%s", canon, realm);
- if(acl_exact_match(acl, buf)) return 1;
-
- sprintf(buf, "*.*%s", realm);
- if(acl_exact_match(acl, buf) || acl_exact_match(acl, "*.*@*")) return(1);
+ instance = (char *) strchr(canon, INST_SEP);
+ *instance++ = 0;
+ realm = (char *) strchr(instance, REALM_SEP);
+ *realm++ = 0;
+
+ for (p = 0; p <= 1; p++) {
+ for (i = 0; i <= 1; i++) {
+ for (r = 0; r <= 1; r++) {
+ sprintf(buf, "%s%c%s%c%s", (p) ? canon : "*", INST_SEP,
+ (i) ? instance : "*", REALM_SEP, (r) ? realm : "*");
+ if (acl_exact_match(acl, buf))
+ return 1;
+ }
+ }
+ }
return(0);
}
+#ifdef notdef
/* Adds principal to acl */
/* Wildcards are interpreted literally */
+int
acl_add(acl, principal)
char *acl;
char *principal;
@@ -503,20 +535,20 @@ acl_add(acl, principal)
acl_canonicalize_principal(principal, canon);
- if((new = acl_lock_file(acl)) == NULL) return(-1);
- if((acl_exact_match(acl, canon))
+ if ((new = acl_lock_file(acl)) == NULL) return(-1);
+ if ((acl_exact_match(acl, canon))
|| (idx = acl_load(acl)) < 0) {
- acl_abort(acl, new);
- return(-1);
- }
+ acl_abort(acl, new);
+ return(-1);
+ }
/* It isn't there yet, copy the file and put it in */
- for(i = 0; i < acl_cache[idx].acl->size; i++) {
- if(acl_cache[idx].acl->tbl[i] != NULL) {
- if(fputs(acl_cache[idx].acl->tbl[i], new) == 0
+ for (i = 0; i < acl_cache[idx].acl->size; i++) {
+ if (acl_cache[idx].acl->tbl[i] != NULL) {
+ if (fputs(acl_cache[idx].acl->tbl[i], new) == NULL
|| putc('\n', new) != '\n') {
- acl_abort(acl, new);
- return(-1);
- }
+ acl_abort(acl, new);
+ return(-1);
+ }
}
}
fputs(canon, new);
@@ -538,19 +570,20 @@ acl_delete(acl, principal)
acl_canonicalize_principal(principal, canon);
- if((new = acl_lock_file(acl)) == NULL) return(-1);
- if((!acl_exact_match(acl, canon))
+ if ((new = acl_lock_file(acl)) == NULL) return(-1);
+ if ((!acl_exact_match(acl, canon))
|| (idx = acl_load(acl)) < 0) {
- acl_abort(acl, new);
- return(-1);
- }
+ acl_abort(acl, new);
+ return(-1);
+ }
/* It isn't there yet, copy the file and put it in */
- for(i = 0; i < acl_cache[idx].acl->size; i++) {
- if(acl_cache[idx].acl->tbl[i] != NULL
+ for (i = 0; i < acl_cache[idx].acl->size; i++) {
+ if (acl_cache[idx].acl->tbl[i] != NULL
&& strcmp(acl_cache[idx].acl->tbl[i], canon)) {
- fputs(acl_cache[idx].acl->tbl[i], new);
- putc('\n', new);
+ fputs(acl_cache[idx].acl->tbl[i], new);
+ putc('\n', new);
}
}
return(acl_commit(acl, new));
}
+#endif /* notdef */
diff --git a/server/bdump.c b/server/bdump.c
index e304933..17f99db 100644
--- a/server/bdump.c
+++ b/server/bdump.c
@@ -11,27 +11,15 @@
* For copying and distribution information, see the file
* "mit-copyright.h".
*/
-
+
#include <zephyr/mit-copyright.h>
-
-#ifndef lint
-#ifndef SABER
-static char rcsid_bdump_c[] = "$Id$";
-#endif /* SABER */
-#endif /* lint */
-
#include "zserver.h"
#include <sys/socket.h>
-#include <signal.h>
-#include <sys/param.h> /* for BSD */
-
-/* inconsistent header files... */
-#ifdef SignalIgnore
-#undef SIG_IGN
-#define SIG_IGN SignalIgnore
-#undef SIG_DFL
-#define SIG_DFL SignalDefault
-#endif
+#include <com_err.h>
+
+#ifndef lint
+static const char rcsid_bdump_c[] = "$Id$";
+#endif /* lint */
/*
* External functions are:
@@ -45,7 +33,7 @@ static char rcsid_bdump_c[] = "$Id$";
* ZNotice_t *notice;
* int auth;
* struct sockaddr_in *who;
- * ZServerDesc_t *server;
+ * Server *server;
*
* Code_t bdump_send_list_tcp(kind, port, class, inst, opcode,
* sender, recip, lyst, num)
@@ -55,42 +43,30 @@ static char rcsid_bdump_c[] = "$Id$";
* char *lyst[];
* int num;
*/
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-static void close_bdump P((void* arg));
-static Code_t bdump_send_loop P((register ZServerDesc_t *server, char *vers)),
- bdump_ask_for P((char *inst)),
- bdump_recv_loop P((ZServerDesc_t *server));
-static void bdump_get_v1 P((ZNotice_t *, int, struct sockaddr_in *,
- ZServerDesc_t *));
-static void bdump_get_v1a P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, ZServerDesc_t *server));
-static Code_t get_packet P((caddr_t packet, int len, int *retlen));
-static Code_t extract_sin P((ZNotice_t *notice, struct sockaddr_in *target));
-static Code_t send_done P((void));
-static Code_t send_list P((ZNotice_Kind_t kind, int port, char *class_name,
- char *inst, char *opcode, char *sender, char *recip,
- char **lyst, int num));
-static Code_t send_host_register P((ZHostList_t *host));
-static Code_t sbd_loop P((struct sockaddr_in *from));
-static Code_t gbd_loop P((ZServerDesc_t *server));
-static Code_t send_normal_tcp P((ZNotice_Kind_t kind, int port,
- char *class_name,
- char *inst, char *opcode, char *sender,
- char *recip, char *message, int len));
-static int net_read P((FILE *f, register char *buf, register int len));
-static int net_write P((FILE *f, register char *buf, int len));
-static int setup_file_pointers P((void));
-static void shutdown_file_pointers P((void));
-static void cleanup P((ZServerDesc_t *server));
-
-#ifdef KERBEROS
-static int get_tgt P((void));
+static void close_bdump __P((void* arg));
+static Code_t bdump_send_loop __P((Server *server)),
+bdump_ask_for __P((char *inst)),
+bdump_recv_loop __P((Server *server));
+static void bdump_get_v12 __P((ZNotice_t *, int, struct sockaddr_in *,
+ Server *));
+static Code_t get_packet __P((void *packet, int len, int *retlen));
+static Code_t extract_sin __P((ZNotice_t *notice, struct sockaddr_in *target));
+static Code_t send_done __P((void));
+static Code_t send_list __P((ZNotice_Kind_t kind, int port, char *class_name,
+ char *inst, char *opcode, char *sender,
+ char *recip, char **lyst, int num));
+static Code_t send_normal_tcp __P((ZNotice_Kind_t kind, int port,
+ char *class_name,
+ char *inst, char *opcode, char *sender,
+ char *recip, char *message, int len));
+static int net_read __P((FILE *f, char *buf, int len));
+static int net_write __P((FILE *f, char *buf, int len));
+static int setup_file_pointers __P((void));
+static void shutdown_file_pointers __P((void));
+static void cleanup __P((Server *server));
+
+#ifdef ZEPHYR_USES_KERBEROS
static long ticket_time;
static char my_realm[REALM_SZ];
@@ -98,15 +74,12 @@ static char my_realm[REALM_SZ];
#define tkt_lifetime(val) ((long) val * 5L * 60L)
#ifndef NOENCRYPTION
-C_Block serv_key;
-Sched serv_ksched;
+extern C_Block serv_key;
+extern Sched serv_ksched;
#endif
-#endif /* KERBEROS */
+#endif /* ZEPHYR_USES_KERBEROS */
-#undef P
-
-static timer bdump_timer;
-static int bdump_inited;
+static Timer *bdump_timer;
static int live_socket = -1;
static FILE *input, *output;
static struct sockaddr_in bdump_sin;
@@ -115,668 +88,575 @@ static int cancel_outgoing_dump;
#endif
int bdumping;
+int bdump_concurrent;
extern char *bdump_version;
-
+
/*
* Functions for performing a brain dump between servers.
*/
-
+
/*
* offer the brain dump to another server
*/
-
+
void
bdump_offer(who)
- struct sockaddr_in *who;
+ struct sockaddr_in *who;
{
- Code_t retval;
- char buf[512], *addr, *lyst[2];
-#ifndef KERBEROS
- int bdump_port = IPPORT_RESERVED - 1;
-#endif /* !KERBEROS */
+ Code_t retval;
+ char buf[512], *addr, *lyst[2];
+#ifndef ZEPHYR_USES_KERBEROS
+ int bdump_port = IPPORT_RESERVED - 1;
+#endif /* !ZEPHYR_USES_KERBEROS */
#if 1
- zdbug((LOG_DEBUG, "bdump_offer"));
+ zdbug((LOG_DEBUG, "bdump_offer"));
#endif
-#ifdef KERBEROS
- /*
- * when using Kerberos server-server authentication, we can
- * use any random local address
- */
- if ((bdump_socket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- syslog(LOG_ERR,"bdump_offer: socket: %m");
- bdump_socket = -1;
- return;
- }
- (void) memset((caddr_t) &bdump_sin, 0, sizeof(bdump_sin));
- /* a port field of 0 makes the UNIX
- * kernel choose an appropriate port/address pair */
-
- bdump_sin.sin_port = 0;
- bdump_sin.sin_addr = my_addr;
- bdump_sin.sin_family = AF_INET;
- if ((retval = bind(bdump_socket, (struct sockaddr *) &bdump_sin, sizeof(bdump_sin))) < 0) {
- syslog(LOG_ERR, "bdump_offer: bind: %m");
- (void) close(bdump_socket);
- bdump_socket = -1;
- return;
- }
- if (!bdump_sin.sin_port) {
- int len = sizeof(bdump_sin);
- if (getsockname(bdump_socket,
- (struct sockaddr *)&bdump_sin, &len)) {
- syslog(LOG_ERR, "bdump_offer: getsockname: %m");
- (void) close(bdump_socket);
- bdump_socket = -1;
- return;
- }
- }
-#else /* !KERBEROS */
- /*
- * when not using Kerberos, we can't use any old port, we use
- * Internet reserved ports instead (rresvport)
- */
- if ((bdump_socket = rresvport(&bdump_port)) < 0) {
- syslog(LOG_ERR,"bdump_offer: socket: %m");
- bdump_socket = -1;
- return;
+#ifdef ZEPHYR_USES_KERBEROS
+ /*
+ * when using ZEPHYR_USES_KERBEROS server-server authentication, we can
+ * use any random local address
+ */
+ bdump_socket = socket(AF_INET, SOCK_STREAM, 0);
+ if (bdump_socket < 0) {
+ syslog(LOG_ERR,"bdump_offer: socket: %m");
+ bdump_socket = -1;
+ return;
+ }
+ memset(&bdump_sin, 0, sizeof(bdump_sin));
+ /* a port field of 0 makes the UNIX
+ * kernel choose an appropriate port/address pair */
+
+ bdump_sin.sin_port = 0;
+ bdump_sin.sin_addr = my_addr;
+ bdump_sin.sin_family = AF_INET;
+ retval = bind(bdump_socket, (struct sockaddr *) &bdump_sin,
+ sizeof(bdump_sin));
+ if (retval < 0) {
+ syslog(LOG_ERR, "bdump_offer: bind: %m");
+ close(bdump_socket);
+ bdump_socket = -1;
+ return;
+ }
+ if (!bdump_sin.sin_port) {
+ int len = sizeof(bdump_sin);
+
+ if (getsockname(bdump_socket,
+ (struct sockaddr *) &bdump_sin, &len) < 0) {
+ syslog(LOG_ERR, "bdump_offer: getsockname: %m");
+ close(bdump_socket);
+ bdump_socket = -1;
+ return;
}
- (void) memset((caddr_t) &bdump_sin, 0, sizeof(bdump_sin));
- bdump_sin.sin_port = htons((unsigned short)bdump_port);
- bdump_sin.sin_addr = my_addr;
- bdump_sin.sin_family = AF_INET;
-
-#endif /* KERBEROS */
- (void) listen(bdump_socket, 1);
-
- bdump_timer = timer_set_rel(20L, close_bdump, (void *) 0);
- FD_SET(bdump_socket, &interesting);
- nfildes = max(bdump_socket, srv_socket) + 1;
-
-
- addr = inet_ntoa(bdump_sin.sin_addr);
- (void) sprintf(buf, "%d", ntohs(bdump_sin.sin_port));
- lyst[0] = addr;
- lyst[1] = buf;
+ }
+#else /* !ZEPHYR_USES_KERBEROS */
+ /*
+ * when not using ZEPHYR_USES_KERBEROS, we can't use any old port, we use
+ * Internet reserved ports instead (rresvport)
+ */
+ bdump_socket = rresvport(&bdump_port);
+ if (bdump_socket < 0) {
+ syslog(LOG_ERR,"bdump_offer: socket: %m");
+ bdump_socket = -1;
+ return;
+ }
+ memset(&bdump_sin, 0, sizeof(bdump_sin));
+ bdump_sin.sin_port = htons((unsigned short) bdump_port);
+ bdump_sin.sin_addr = my_addr;
+ bdump_sin.sin_family = AF_INET;
+#endif /* ZEPHYR_USES_KERBEROS */
+
+ listen(bdump_socket, 1);
- if ((retval = ZSetDestAddr(who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "bdump_offer: ZSetDestAddr: %s",
- error_message(retval));
- return;
- }
+ bdump_timer = timer_set_rel(20L, close_bdump, NULL);
+ FD_SET(bdump_socket, &interesting);
+ nfds = max(bdump_socket, srv_socket) + 1;
+
+ addr = inet_ntoa(bdump_sin.sin_addr);
+ sprintf(buf, "%d", ntohs(bdump_sin.sin_port));
+ lyst[0] = addr;
+ lyst[1] = buf;
+
+ retval = ZSetDestAddr(who);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "bdump_offer: ZSetDestAddr: %s",
+ error_message(retval));
+ return;
+ }
- /* myname is the hostname */
- /* the class instance is the version number, here it is */
- /* bdump_version, which is set in main */
- (void) send_list(ACKED, sock_sin.sin_port, ZEPHYR_ADMIN_CLASS,
- bdump_version, ADMIN_BDUMP, myname, "", lyst, 2);
+ /* myname is the hostname */
+ /* the class instance is the version number, here it is */
+ /* bdump_version, which is set in main */
+ send_list(ACKED, srv_addr.sin_port, ZEPHYR_ADMIN_CLASS, bdump_version,
+ ADMIN_BDUMP, myname, "", lyst, 2);
#if 1
- zdbug((LOG_DEBUG,"bdump_offer: address is %s/%d\n",
- inet_ntoa(bdump_sin.sin_addr),
- ntohs(bdump_sin.sin_port)));
+ zdbug((LOG_DEBUG,"bdump_offer: address is %s/%d\n",
+ inet_ntoa(bdump_sin.sin_addr),
+ ntohs(bdump_sin.sin_port)));
#endif
- return;
+ return;
}
-
+
/*
* Accept a connection, and send the brain dump to the other server
*/
-
+
void
-#ifdef __STDC__
-bdump_send(void)
-#else
bdump_send()
-#endif
{
- struct sockaddr_in from;
- ZServerDesc_t *server;
- Code_t retval;
- int fromlen = sizeof(from);
- int on = 1;
-#ifdef POSIX
- struct sigaction action;
+ struct sockaddr_in from;
+ Server *server;
+ Code_t retval;
+ int fromlen = sizeof(from);
+ int on = 1;
+#ifdef _POSIX_VERSION
+ struct sigaction action;
#endif
-#ifdef KERBEROS
- KTEXT_ST ticket;
- AUTH_DAT kdata;
+#ifdef ZEPHYR_USES_KERBEROS
+ KTEXT_ST ticket;
+ AUTH_DAT kdata;
#else
- unsigned short fromport;
-#endif /* KERBEROS */
+ unsigned short fromport;
+#endif /* ZEPHYR_USES_KERBEROS */
#if 1
- zdbug((LOG_DEBUG, "bdump_send"));
+ zdbug((LOG_DEBUG, "bdump_send"));
#endif
- /* accept the connection, and send the brain dump */
- if ((live_socket = accept(bdump_socket, (struct sockaddr *)&from,
- &fromlen)) < 0) {
- syslog(LOG_ERR,"bdump_send: accept: %m");
- return;
- }
- if (setsockopt(live_socket, SOL_SOCKET, SO_KEEPALIVE, (char *)&on,
- sizeof (on)) < 0)
- syslog(LOG_WARNING,
- "bdump_send: setsockopt (SO_KEEPALIVE): %m");
+ /* accept the connection, and send the brain dump */
+ live_socket = accept(bdump_socket, (struct sockaddr *) &from, &fromlen);
+ if (live_socket < 0) {
+ syslog(LOG_ERR,"bdump_send: accept: %m");
+ return;
+ }
+ if (setsockopt(live_socket, SOL_SOCKET, SO_KEEPALIVE, (char *) &on,
+ sizeof(on)) < 0)
+ syslog(LOG_WARNING, "bdump_send: setsockopt (SO_KEEPALIVE): %m");
-#ifndef KERBEROS
- fromport = ntohs(from.sin_port);
+#ifndef ZEPHYR_USES_KERBEROS
+ fromport = ntohs(from.sin_port);
#endif
-#ifdef POSIX
- (void) sigemptyset(&action.sa_mask);
- action.sa_flags = 0;
- action.sa_handler = SIG_IGN;
- (void) sigaction(SIGPIPE, &action, NULL);
+#ifdef _POSIX_VERSION
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = 0;
+ action.sa_handler = SIG_IGN;
+ sigaction(SIGPIPE, &action, NULL);
- START_CRITICAL_CODE;
#else
- (void) signal(SIGPIPE, SIG_IGN); /* so we can detect failures */
+ signal(SIGPIPE, SIG_IGN); /* so we can detect failures */
#endif
- from.sin_port = sock_sin.sin_port; /* we don't care what port
- it came from, and we need to
- fake out server_which_server() */
- server = server_which_server(&from);
- if (!server) {
- syslog(LOG_ERR, "bdump_send: unknown server?");
- server = limbo_server;
- }
+ from.sin_port = srv_addr.sin_port; /* we don't care what port
+ * it came from, and we need to
+ * fake out server_which_server() */
+ server = server_which_server(&from);
+ if (!server) {
+ syslog(LOG_ERR, "bdump_send: unknown server?");
+ server = limbo_server;
+ }
#if 1
- zdbug((LOG_DEBUG, "bdump_send: connection from %s/%d",
- inet_ntoa (from.sin_addr), ntohs (from.sin_port)));
+ zdbug((LOG_DEBUG, "bdump_send: connection from %s/%d",
+ inet_ntoa(from.sin_addr), ntohs(from.sin_port)));
#endif
-#ifdef notdef
- if (bdumping) {
- /* Already bdumping; punt one of the two. If this is a
- new host, punt this connection. If it's one we're
- already trying to talk to... arbitrary decision: The
- connection with the listener at the lower IP address
- will be punted. */
- if (!server->zs_dumping) {
- zdbug ((LOG_INFO,
-"bdump_send: already dumping; breaking new bdump connection from %s",
- inet_ntoa (from.sin_addr)));
- (void) close (live_socket);
- return;
- }
- /* Should be safe now to get rid of listener socket. */
- (void) close (bdump_socket);
- FD_CLR (bdump_socket, &interesting);
- bdump_socket = -1;
- timer_reset(bdump_timer);
- if (ntohl (bdump_sin.sin_addr.s_addr) < ntohl (from.sin_addr.s_addr)) {
- /* My address is lower; punt incoming connection. */
- (void) close (live_socket);
- return;
- }
- else
- cancel_outgoing_dump = 1;
- }
-#endif
+ bdumping = 1;
+ server->dumping = 1;
- bdumping = 1;
- server->zs_dumping = 1;
-
- if (bdump_socket >= 0) {
- /* shut down the listening socket and the timer */
- FD_CLR(bdump_socket, &interesting);
- (void) close(bdump_socket);
- nfildes = srv_socket + 1;
- bdump_socket = -1;
- timer_reset(bdump_timer);
- }
+ if (bdump_socket >= 0) {
+ /* shut down the listening socket and the timer. */
+ FD_CLR(bdump_socket, &interesting);
+ close(bdump_socket);
+ nfds = srv_socket + 1;
+ bdump_socket = -1;
+ timer_reset(bdump_timer);
+ }
- /* Now begin the brain dump. */
+ /* Now begin the brain dump. */
-#ifdef KERBEROS
- /* receive the authenticator */
- if ((retval = GetKerberosData(live_socket, from.sin_addr, &kdata,
- SERVER_SERVICE, ZEPHYR_SRVTAB))
- != KSUCCESS)
- {
- syslog(LOG_ERR, "bdump_send: getkdata: %s",
- krb_err_txt[retval]);
- cleanup(server);
- return;
- }
- if (get_tgt()) {
- cleanup(server);
- return;
- }
- if (strcmp(kdata.pname,SERVER_SERVICE) ||
- strcmp(kdata.pinst, SERVER_INSTANCE) ||
- strcmp(kdata.prealm, my_realm))
- {
- syslog(LOG_ERR, "bdump_send: peer not zephyr: %s.%s@%s",
- kdata.pname, kdata.pinst, kdata.prealm);
- cleanup(server);
- return;
- }
- /* authenticate back */
- if ((retval = SendKerberosData(live_socket, &ticket,
- SERVER_SERVICE, SERVER_INSTANCE)) != 0)
- {
- syslog(LOG_ERR,"bdump_send: SendKerberosData: %s",
- error_message (retval));
- cleanup(server);
- return;
- }
-#else /* !KERBEROS */
- if ((fromport > IPPORT_RESERVED) ||
- (fromport < (IPPORT_RESERVED / 2))) {
- syslog(LOG_ERR, "bdump_send: bad port from peer: %d",
- fromport);
- cleanup(server);
- return;
- }
-#endif /* KERBEROS */
+#ifdef ZEPHYR_USES_KERBEROS
+ /* receive the authenticator */
+ retval = GetKerberosData(live_socket, from.sin_addr, &kdata,
+ SERVER_SERVICE, srvtab_file);
+ if (retval != KSUCCESS) {
+ syslog(LOG_ERR, "bdump_send: getkdata: %s",
+ krb_get_err_text(retval));
+ cleanup(server);
+ return;
+ }
+ if (get_tgt()) {
+ cleanup(server);
+ return;
+ }
+ if (strcmp(kdata.pname, SERVER_SERVICE) ||
+ strcmp(kdata.pinst, SERVER_INSTANCE) ||
+ strcmp(kdata.prealm, ZGetRealm())) {
+ syslog(LOG_ERR, "bdump_send: peer not zephyr: %s.%s@%s",
+ kdata.pname, kdata.pinst, kdata.prealm);
+ cleanup(server);
+ return;
+ }
+ /* authenticate back */
+ retval = SendKerberosData(live_socket, &ticket, SERVER_SERVICE,
+ SERVER_INSTANCE);
+ if (retval != 0) {
+ syslog(LOG_ERR,"bdump_send: SendKerberosData: %s",
+ error_message (retval));
+ cleanup(server);
+ return;
+ }
+#else /* !ZEPHYR_USES_KERBEROS */
+ if (fromport > IPPORT_RESERVED || fromport < IPPORT_RESERVED / 2) {
+ syslog(LOG_ERR, "bdump_send: bad port from peer: %d", fromport);
+ cleanup(server);
+ return;
+ }
+#endif /* ZEPHYR_USES_KERBEROS */
- if ((retval = setup_file_pointers()) != 0) {
- syslog (LOG_WARNING, "bdump_send: can't set up file pointers: %s",
- error_message (retval));
- cleanup(server);
- return;
- }
- if ((retval = sbd_loop(&from)) != ZERR_NONE) {
- syslog(LOG_WARNING, "bdump_send: sbd_loop failed: %s",
- error_message(retval));
- cleanup(server);
- return;
- }
- if ((retval = gbd_loop(server)) != ZERR_NONE) {
- syslog(LOG_WARNING, "bdump_send: gbd_loop failed: %s",
- error_message(retval));
- cleanup(server);
- return;
- }
+ retval = setup_file_pointers();
+ if (retval != 0) {
+ syslog (LOG_WARNING, "bdump_send: can't set up file pointers: %s",
+ error_message(retval));
+ cleanup(server);
+ return;
+ }
+ retval = bdump_send_loop(server);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "bdump_send: bdump_send_loop failed: %s",
+ error_message(retval));
+ cleanup(server);
+ return;
+ }
+ retval = bdump_recv_loop(server);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "bdump_send: bdump_recv_loop failed: %s",
+ error_message(retval));
+ cleanup(server);
+ return;
+ }
#if 1
- zdbug((LOG_DEBUG, "bdump_send: finished"));
+ zdbug((LOG_DEBUG, "bdump_send: finished"));
#endif
- if (server != limbo_server) {
- /* set this guy to be up, and schedule a hello */
- server->zs_state = SERV_UP;
- timer_reset(server->zs_timer);
- server->zs_timer = timer_set_rel(0L, server_timo, (void *) server);
- }
+ if (server != limbo_server) {
+ /* set this guy to be up, and schedule a hello */
+ server->state = SERV_UP;
+ timer_reset(server->timer);
+ server->timer = timer_set_rel(0L, server_timo, server);
+ }
#if 0
- zdbug((LOG_DEBUG,"cleanup sbd"));
+ zdbug((LOG_DEBUG,"cleanup sbd"));
#endif
- shutdown_file_pointers ();
+ shutdown_file_pointers();
-#ifdef POSIX
- action.sa_handler = SIG_DFL;
- sigaction(SIGPIPE, &action, NULL);
+#ifdef _POSIX_VERSION
+ action.sa_handler = SIG_DFL;
+ sigaction(SIGPIPE, &action, NULL);
#else
- (void) signal(SIGPIPE, SIG_DFL);
-#endif
- bdump_inited = 1;
- bdumping = 0;
- server->zs_dumping = 0;
-#ifdef CONCURRENT
- /* Now that we are finished dumping, send all the queued packets */
- server_send_queue(server);
+ signal(SIGPIPE, SIG_DFL);
#endif
- END_CRITICAL_CODE;
- return;
+ bdumping = 0;
+ server->dumping = 0;
+ /* Now that we are finished dumping, send all the queued packets */
+ server_send_queue(server);
+ return;
}
/*ARGSUSED*/
static void
-bdump_get_v1_guts (notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
+bdump_get_v12 (notice, auth, who, server)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
{
- struct sockaddr_in from;
- Code_t retval;
- int on = 1;
-#ifdef POSIX
- struct sigaction action;
+ struct sockaddr_in from;
+ Code_t retval;
+ int on = 1;
+#ifdef _POSIX_VERSION
+ struct sigaction action;
#endif
-#ifdef KERBEROS
- KTEXT_ST ticket;
- AUTH_DAT kdata;
-#else /* !KERBEROS */
- int reserved_port = IPPORT_RESERVED - 1;
-#endif /* KERBEROS */
+#ifdef ZEPHYR_USES_KERBEROS
+ KTEXT_ST ticket;
+ AUTH_DAT kdata;
+#else /* !ZEPHYR_USES_KERBEROS */
+ int reserved_port = IPPORT_RESERVED - 1;
+#endif /* ZEPHYR_USES_KERBEROS */
- bdumping = 1;
- server->zs_dumping = 1;
+ bdumping = 1;
+ server->dumping = 1;
-#ifdef POSIX
- action.sa_flags = 0;
- sigemptyset(&action.sa_mask);
- action.sa_handler = SIG_IGN;
- sigaction(SIGPIPE, &action, NULL);
+#ifdef _POSIX_VERSION
+ action.sa_flags = 0;
+ sigemptyset(&action.sa_mask);
+ action.sa_handler = SIG_IGN;
+ sigaction(SIGPIPE, &action, NULL);
#else
- (void) signal(SIGPIPE, SIG_IGN); /* so we can detect problems */
-#endif /* POSIX */
+ signal(SIGPIPE, SIG_IGN); /* so we can detect problems */
+#endif /* _POSIX_VRESION */
- if (bdump_socket >= 0) {
- /* We cannot go get a brain dump when someone may
- potentially be connecting to us (if that other
- server is the server to whom we are connecting,
- we will deadlock. so we shut down the listening
- socket and the timer */
- FD_CLR(bdump_socket, &interesting);
- (void) close(bdump_socket);
- nfildes = srv_socket+1;
- bdump_socket = -1;
- timer_reset(bdump_timer);
- }
+ if (bdump_socket >= 0) {
+ /* We cannot go get a brain dump when someone may
+ potentially be connecting to us (if that other
+ server is the server to whom we are connecting,
+ we will deadlock. so we shut down the listening
+ socket and the timer. */
+ FD_CLR(bdump_socket, &interesting);
+ close(bdump_socket);
+ nfds = srv_socket+1;
+ bdump_socket = -1;
+ timer_reset(bdump_timer);
+ }
- if ((retval = extract_sin(notice, &from)) != ZERR_NONE) {
- syslog(LOG_ERR, "bdump_get: sin: %s", error_message(retval));
-#ifdef POSIX
- action.sa_handler = SIG_DFL;
- sigaction(SIGPIPE, &action, NULL);
+ retval = extract_sin(notice, &from);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "bdump_get: sin: %s", error_message(retval));
+#ifdef _POSIX_VERSION
+ action.sa_handler = SIG_DFL;
+ sigaction(SIGPIPE, &action, NULL);
#else
- (void) signal(SIGPIPE, SIG_DFL);
+ signal(SIGPIPE, SIG_DFL);
#endif
- bdumping = 0;
- server->zs_dumping = 0;
- return;
- }
- START_CRITICAL_CODE;
-#ifndef KERBEROS
- if (ntohs(from.sin_port) > IPPORT_RESERVED ||
- ntohs(from.sin_port) < IPPORT_RESERVED / 2) {
- syslog(LOG_ERR, "bdump_get: port not reserved: %d",
- ntohs(from.sin_port));
- cleanup(server);
- return;
- }
- live_socket = rresvport(&reserved_port);
-#else /* !KERBEROS */
- live_socket = socket(AF_INET, SOCK_STREAM, 0);
-#endif /* KERBEROS */
- if (live_socket < 0) {
- syslog(LOG_ERR, "bdump_get: socket: %m");
- cleanup(server);
- return;
- }
- if (connect(live_socket, (struct sockaddr *) &from, sizeof(from))) {
- syslog(LOG_ERR, "bdump_get: connect: %m");
- cleanup(server);
- return;
- }
- if (setsockopt(live_socket, SOL_SOCKET, SO_KEEPALIVE, (char *)&on,
- sizeof (on)) < 0)
- syslog(LOG_WARNING,
- "bdump_get: setsockopt (SO_KEEPALIVE): %m");
+ bdumping = 0;
+ server->dumping = 0;
+ return;
+ }
+#ifndef ZEPHYR_USES_KERBEROS
+ if (ntohs(from.sin_port) > IPPORT_RESERVED ||
+ ntohs(from.sin_port) < IPPORT_RESERVED / 2) {
+ syslog(LOG_ERR, "bdump_get: port not reserved: %d",
+ ntohs(from.sin_port));
+ cleanup(server);
+ return;
+ }
+ live_socket = rresvport(&reserved_port);
+#else /* !ZEPHYR_USES_KERBEROS */
+ live_socket = socket(AF_INET, SOCK_STREAM, 0);
+#endif /* ZEPHYR_USES_KERBEROS */
+ if (live_socket < 0) {
+ syslog(LOG_ERR, "bdump_get: socket: %m");
+ cleanup(server);
+ return;
+ }
+ if (connect(live_socket, (struct sockaddr *) &from, sizeof(from))) {
+ syslog(LOG_ERR, "bdump_get: connect: %m");
+ cleanup(server);
+ return;
+ }
+ if (setsockopt(live_socket, SOL_SOCKET, SO_KEEPALIVE, (char *)&on,
+ sizeof(on)) < 0)
+ syslog(LOG_WARNING, "bdump_get: setsockopt (SO_KEEPALIVE): %m");
#if 1
- zdbug((LOG_DEBUG, "bdump_get: connected"));
+ zdbug((LOG_DEBUG, "bdump_get: connected"));
#endif
- /* Now begin the brain dump. */
+ /* Now begin the brain dump. */
-#ifdef KERBEROS
- /* send an authenticator */
- if (get_tgt()) {
- cleanup(server);
- return;
- }
- if ((retval = SendKerberosData(live_socket, &ticket,
- SERVER_SERVICE, SERVER_INSTANCE)) != 0)
- {
- syslog(LOG_ERR,"bdump_get: %s",
- error_message (retval));
- cleanup(server);
- return;
- }
+#ifdef ZEPHYR_USES_KERBEROS
+ /* send an authenticator */
+ if (get_tgt()) {
+ cleanup(server);
+ return;
+ }
+ retval = SendKerberosData(live_socket, &ticket, SERVER_SERVICE,
+ SERVER_INSTANCE);
+ if (retval != 0) {
+ syslog(LOG_ERR,"bdump_get: %s", error_message(retval));
+ cleanup(server);
+ return;
+ }
#if 1
- zdbug((LOG_DEBUG, "bdump_get: SendKerberosData ok"));
+ zdbug((LOG_DEBUG, "bdump_get: SendKerberosData ok"));
#endif
- /* get his authenticator */
- if ((retval = GetKerberosData(live_socket, from.sin_addr, &kdata,
- SERVER_SERVICE, ZEPHYR_SRVTAB))
- != KSUCCESS)
- {
- syslog(LOG_ERR, "bdump_get getkdata: %s",krb_err_txt[retval]);
- cleanup(server);
- return;
- }
- /* my_realm is filled in inside get_tgt() */
- if (strcmp(kdata.pname, SERVER_SERVICE) ||
- strcmp(kdata.pinst, SERVER_INSTANCE) ||
- strcmp(kdata.prealm, my_realm))
- {
- syslog(LOG_ERR,
- "bdump_get: peer not zephyr in lrealm: %s.%s@%s",
- kdata.pname, kdata.pinst,kdata.prealm);
- cleanup(server);
- return;
- }
-#endif /* KERBEROS */
- if ((retval = setup_file_pointers()) != 0) {
- syslog (LOG_WARNING, "bdump_get: can't set up file pointers: %s",
- error_message (retval));
- cleanup(server);
- return;
- }
- if ((retval = gbd_loop(server)) != ZERR_NONE) {
- syslog(LOG_WARNING, "bdump_get: gbd_loop failed: %s",
- error_message(retval));
- cleanup(server);
- return;
- }
+ /* get his authenticator */
+ retval = GetKerberosData(live_socket, from.sin_addr, &kdata,
+ SERVER_SERVICE, srvtab_file);
+ if (retval != KSUCCESS) {
+ syslog(LOG_ERR, "bdump_get getkdata: %s",krb_get_err_text(retval));
+ cleanup(server);
+ return;
+ }
+ /* my_realm is filled in inside get_tgt() */
+ if (strcmp(kdata.pname, SERVER_SERVICE) ||
+ strcmp(kdata.pinst, SERVER_INSTANCE) ||
+ strcmp(kdata.prealm, my_realm)) {
+ syslog(LOG_ERR, "bdump_get: peer not zephyr in lrealm: %s.%s@%s",
+ kdata.pname, kdata.pinst,kdata.prealm);
+ cleanup(server);
+ return;
+ }
+#endif /* ZEPHYR_USES_KERBEROS */
+ retval = setup_file_pointers();
+ if (retval != 0) {
+ syslog(LOG_WARNING, "bdump_get: can't set up file pointers: %s",
+ error_message (retval));
+ cleanup(server);
+ return;
+ }
+ retval = bdump_recv_loop(server);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "bdump_get: bdump_recv_loop failed: %s",
+ error_message(retval));
+ cleanup(server);
+ return;
+ }
#if 1
- zdbug((LOG_DEBUG,"bdump_get: gbdl ok"));
+ zdbug((LOG_DEBUG,"bdump_get: gbdl ok"));
#endif
- if ((retval = sbd_loop(&from)) != ZERR_NONE) {
- syslog(LOG_WARNING, "sbd_loop failed: %s",
- error_message(retval));
- cleanup(server);
- return;
- }
+ retval = bdump_send_loop(server);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "bdump_send_loop failed: %s",
+ error_message(retval));
+ cleanup(server);
+ return;
+ }
#if 1
- zdbug((LOG_DEBUG, "bdump_get: gbd finished"));
+ zdbug((LOG_DEBUG, "bdump_get: gbd finished"));
#endif
- /* set this guy to be up, and schedule a hello */
- server->zs_state = SERV_UP;
- timer_reset(server->zs_timer);
- server->zs_timer = timer_set_rel(0L, server_timo, (void *) server);
+ /* set this guy to be up, and schedule a hello */
+ server->state = SERV_UP;
+ timer_reset(server->timer);
+ server->timer = timer_set_rel(0L, server_timo, server);
#if 1
- zdbug((LOG_DEBUG,"cleanup gbd"));
-#endif
- shutdown_file_pointers ();
-#ifdef POSIX
- action.sa_handler = SIG_DFL;
- sigaction(SIGPIPE, &action, NULL);
-#else
- (void) signal(SIGPIPE, SIG_DFL);
+ zdbug((LOG_DEBUG,"cleanup gbd"));
#endif
- bdump_inited = 1;
- bdumping = 0;
- server->zs_dumping = 0;
-#ifdef CONCURRENT
- /* Now that we are finished dumping, send all the queued packets */
- server_send_queue(server);
-#endif
-
- END_CRITICAL_CODE;
- return;
-}
-
-static void
-#ifdef __STDC__
-bdump_get_v1(ZNotice_t *notice, int auth, struct sockaddr_in *who,
- ZServerDesc_t *server)
+ shutdown_file_pointers();
+#ifdef _POSIX_VERSION
+ action.sa_handler = SIG_DFL;
+ sigaction(SIGPIPE, &action, NULL);
#else
-bdump_get_v1(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
+ signal(SIGPIPE, SIG_DFL);
#endif
-{
- if (bdump_socket >= 0) {
- /* We cannot go get a brain dump when someone may
- potentially be connecting to us (if that other
- server is the server to whom we are connecting,
- we will deadlock. so we shut down the listening
- socket and the timer */
- FD_CLR(bdump_socket, &interesting);
- (void) close(bdump_socket);
- nfildes = srv_socket + 1;
- bdump_socket = -1;
- timer_reset(bdump_timer);
- }
-
- bdump_get_v1_guts (notice, auth, who, server);
-}
+ bdumping = 0;
+ server->dumping = 0;
+ /* Now that we are finished dumping, send all the queued packets */
+ server_send_queue(server);
-static void
-#ifdef __STDC__
-bdump_get_v1a( ZNotice_t *notice, int auth, struct sockaddr_in *who,
- ZServerDesc_t *server)
-#else
-bdump_get_v1a(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
-#endif
-{
- /* In version 1A, leave the listening file descriptor open; if we
- get a connection while we're dumping, one of the two will be
- punted. */
- bdump_get_v1_guts (notice, auth, who, server);
+ return;
}
void
bdump_get(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
{
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
+ void (*proc) __P((ZNotice_t *, int, struct sockaddr_in *, Server *));
- void (*proc) P((ZNotice_t *, int, struct sockaddr_in *, ZServerDesc_t *));
-
-#undef P
- proc = NULL;
+ proc = NULL;
#if 1
- if (zdebug)
- syslog(LOG_DEBUG, "bdump_get: bdump v%s avail %s",
- notice->z_class_inst, inet_ntoa(who->sin_addr));
+ if (zdebug) {
+ syslog(LOG_DEBUG, "bdump_get: bdump v%s avail %s",
+ notice->z_class_inst, inet_ntoa(who->sin_addr));
+ }
#endif
- /*
- * We do not listen to version "1" or "1A" because they are a
- * security threat (they send the CBlock in clear-text).
- */
- if (!strcmp (notice->z_class_inst, "1.1")
- || !strcmp (notice->z_class_inst, ""))
- proc = bdump_get_v1;
- if (!strcmp (notice->z_class_inst, "1.1A"))
- proc = bdump_get_v1a;
-
- if (proc)
- (*proc) (notice, auth, who, server);
- else
- syslog(LOG_WARNING,
- "bdump_get: Incompatible bdump version '%s' from %s",
- notice->z_class_inst,
- inet_ntoa(who->sin_addr));
+ if (strcmp (notice->z_class_inst, "1.2") == 0)
+ proc = bdump_get_v12;
+
+ if (proc) {
+ (*proc)(notice, auth, who, server);
+ } else {
+ syslog(LOG_WARNING,
+ "bdump_get: Incompatible bdump version '%s' from %s",
+ notice->z_class_inst,
+ inet_ntoa(who->sin_addr));
+ }
}
/*
* Send a list off as the specified notice
*/
-
-int
-bdump_send_list_tcp(kind, port, class_name, inst, opcode, sender, recip,
- lyst, num)
- ZNotice_Kind_t kind;
- int port;
- char *class_name;
- char *inst;
- char *opcode;
- char *sender;
- char *recip;
- char **lyst;
- int num;
+
+Code_t
+bdump_send_list_tcp(kind, addr, class_name, inst, opcode, sender, recip, lyst,
+ num)
+ ZNotice_Kind_t kind;
+ struct sockaddr_in *addr;
+ int num;
+ char *class_name, *inst, *opcode, *sender, *recip, **lyst;
{
- ZNotice_t notice;
- register ZNotice_t *pnotice = &notice; /* speed hack */
- char *pack;
- int packlen, count;
- Code_t retval;
- u_short length;
-
- pnotice->z_kind = kind;
-
- pnotice->z_port = port;
- pnotice->z_class = class_name;
- pnotice->z_class_inst = inst;
- pnotice->z_opcode = opcode;
- pnotice->z_sender = sender;
- pnotice->z_recipient = recip;
- pnotice->z_default_format = "";
- pnotice->z_num_other_fields = 0;
-
- if ((retval = ZFormatNoticeList(pnotice, (char **) lyst, num, &pack, &packlen, ZNOAUTH)) != ZERR_NONE)
- return(retval);
+ ZNotice_t notice;
+ char *pack, addrbuf[100];
+ int packlen, count;
+ Code_t retval;
+ u_short length;
+
+ retval = ZMakeAscii(addrbuf, sizeof(addrbuf),
+ (unsigned char *) &addr->sin_addr,
+ sizeof(struct in_addr));
+ if (retval != ZERR_NONE)
+ return retval;
+ notice.z_kind = kind;
+
+ notice.z_port = addr->sin_port;
+ notice.z_class = class_name;
+ notice.z_class_inst = inst;
+ notice.z_opcode = opcode;
+ notice.z_sender = sender;
+ notice.z_recipient = recip;
+ notice.z_default_format = "";
+ notice.z_num_other_fields = 1;
+ notice.z_other_fields[0] = addrbuf;
+
+ retval = ZFormatNoticeList(&notice, lyst, num, &pack, &packlen, ZNOAUTH);
+ if (retval != ZERR_NONE)
+ return retval;
- length = htons((u_short) packlen);
+ length = htons((u_short) packlen);
- if ((count = net_write(output, (caddr_t) &length, sizeof(length))) != sizeof(length))
- if (count < 0) {
- xfree(pack); /* free allocated storage */
- return(errno);
- } else {
- syslog(LOG_WARNING, "slt (length) xmit: %d vs %d",
- sizeof(length),count);
- xfree(pack); /* free allocated storage */
- return(ZSRV_PKSHORT);
- }
+ count = net_write(output, (char *) &length, sizeof(length));
+ if (count != sizeof(length)) {
+ if (count < 0) {
+ free(pack);
+ return(errno);
+ } else {
+ syslog(LOG_WARNING, "slt (length) xmit: %d vs %d",
+ sizeof(length), count);
+ free(pack);
+ return(ZSRV_PKSHORT);
+ }
+ }
- if ((count = net_write(output, pack, packlen)) != packlen)
- if (count < 0) {
- xfree(pack); /* free allocated storage */
- return(errno);
- } else {
- syslog(LOG_WARNING, "slt (packet) xmit: %d vs %d",
- packlen, count);
- xfree(pack); /* free allocated storage */
- return(ZSRV_PKSHORT);
- }
- xfree(pack); /* free allocated storage */
- return(ZERR_NONE);
+ count = net_write(output, pack, packlen);
+ if (count != packlen) {
+ if (count < 0) {
+ free(pack);
+ return(errno);
+ } else {
+ syslog(LOG_WARNING, "slt (packet) xmit: %d vs %d",
+ packlen, count);
+ free(pack);
+ return(ZSRV_PKSHORT);
+ }
+ }
+ free(pack);
+ return(ZERR_NONE);
}
-
+
static void
-shutdown_file_pointers () {
+shutdown_file_pointers() {
if (input) {
- (void) fclose (input);
+ fclose(input);
input = 0;
}
if (output) {
- (void) fclose (output);
+ fclose(output);
output = 0;
}
if (live_socket >= 0) {
- (void) close (live_socket);
+ close(live_socket);
live_socket = -1;
}
}
static void
cleanup(server)
- ZServerDesc_t *server;
+ Server *server;
{
-#ifdef POSIX
+#ifdef _POSIX_VERSION
struct sigaction action;
#endif
@@ -784,226 +664,86 @@ cleanup(server)
zdbug((LOG_DEBUG, "bdump cleanup"));
#endif
if (server != limbo_server) {
- server->zs_state = SERV_DEAD;
- timer_reset(server->zs_timer);
- server->zs_timer =
- timer_set_rel(0L, server_timo, (void *) server);
+ server->state = SERV_DEAD;
+ timer_reset(server->timer);
+ server->timer = timer_set_rel(0L, server_timo, server);
}
shutdown_file_pointers ();
-#ifdef POSIX
+#ifdef _POSIX_VERSION
action.sa_flags = 0;
sigemptyset(&action.sa_mask);
action.sa_handler = SIG_DFL;
sigaction(SIGPIPE,&action, NULL);
#else
- (void) signal(SIGPIPE, SIG_DFL);
-#endif /* POSIX */
+ signal(SIGPIPE, SIG_DFL);
+#endif /* _POSIX_VERSION */
bdumping = 0;
- server->zs_dumping = 0;
-#ifdef CONCURRENT
- /* XXX need to flush the server and the updates to it */
-#endif
- END_CRITICAL_CODE;
- return;
+ server->dumping = 0;
}
-
-#ifdef KERBEROS
-static int
+
+#ifdef ZEPHYR_USES_KERBEROS
+int
get_tgt()
{
- int retval;
+ /* MIT Kerberos 4 get_svc_in_tkt() requires instance to be writable and
+ * at least INST_SZ bytes long. */
+ static char buf[INST_SZ + 1] = SERVER_INSTANCE;
+ int retval = 0;
+ CREDENTIALS cred;
#ifndef NOENCRYPTION
- Sched *s;
+ Sched *s;
#endif
- if (!*my_realm)
- if ((retval = krb_get_lrealm(my_realm, 1)) != KSUCCESS) {
- syslog(LOG_ERR,"krb_get_lrealm: %s",
- krb_err_txt[retval]);
- *my_realm = '\0';
- return(1);
- }
- /* have they expired ? */
- if (ticket_time < NOW - tkt_lifetime(TKTLIFETIME) + 15L) {
- /* +15 for leeway */
+ if (!*my_realm) {
+ retval = krb_get_lrealm(my_realm, 1);
+ if (retval != KSUCCESS) {
+ syslog(LOG_ERR,"krb_get_lrealm: %s", krb_get_err_text(retval));
+ *my_realm = '\0';
+ return(1);
+ }
+ }
+ /* have they expired ? */
+ if (ticket_time < NOW - tkt_lifetime(TKTLIFETIME) + 15L) {
+ /* +15 for leeway */
#if 0
- zdbug((LOG_DEBUG,"get new tickets: %d %d %d",
- ticket_time, NOW,
- NOW - tkt_lifetime(TKTLIFETIME) + 15L));
+ zdbug((LOG_DEBUG,"get new tickets: %d %d %d", ticket_time, NOW,
+ NOW - tkt_lifetime(TKTLIFETIME) + 15L));
#endif
- (void) dest_tkt();
-
- {
- /*
- * XXX One version of krb_get_svc_in_tkt wants
- * this argument writable and at least INST_SZ
- * bytes long.
- */
- static char buf[INST_SZ+1] = SERVER_INSTANCE;
-
- retval = krb_get_svc_in_tkt (SERVER_SERVICE, buf/*XXX*/,
- my_realm,
- SERVER_SERVICE, SERVER_INSTANCE,
- TKTLIFETIME, ZEPHYR_SRVTAB);
- }
- if (retval != KSUCCESS) {
- syslog(LOG_ERR,"get_tgt: krb_get_svc_in_tkt: %s",
- krb_err_txt[retval]);
- ticket_time = 0L;
- return(1);
- } else
- ticket_time = NOW;
+ dest_tkt();
-#ifndef NOENCRYPTION
- retval = read_service_key(SERVER_SERVICE, SERVER_INSTANCE,
- my_realm, 0 /*kvno*/,
- ZEPHYR_SRVTAB, serv_key);
- if (retval != KSUCCESS) {
- syslog(LOG_ERR, "get_tgt: read_service_key: %s",
- krb_err_txt[retval]);
- return 1;
- }
- s = (Sched *)check_key_sched_cache(serv_key);
- if (s) {
- serv_ksched = *s;
- } else {
- des_key_sched(serv_key, serv_ksched.s);
- add_to_key_sched_cache(serv_key, &serv_ksched);
- }
-#endif /* !NOENCRYPTION */
- }
- return(0);
-}
-#endif /* KERBEROS */
-
-static Code_t
-sbd_loop(from)
- struct sockaddr_in *from;
-{
- ZNotice_t bd_notice;
- ZPacket_t pack;
- ZServerDesc_t *server;
- int packlen = sizeof(pack);
- Code_t retval;
- struct sockaddr_in bogus_from;
- char *zeph_version = NULL;
-
- bogus_from = *from;
- bogus_from.sin_port = sock_sin.sin_port;
-
- while (1) {
- packlen = sizeof(pack);
- if ((retval = get_packet(pack, packlen, &packlen)) != ZERR_NONE) {
- syslog(LOG_ERR, "sbd_loop: notice get: %s",
- error_message(retval));
- return(retval);
- }
- if ((retval = ZParseNotice(pack, packlen, &bd_notice)) != ZERR_NONE) {
- syslog(LOG_ERR, "sbd notice parse: %s",
- error_message(retval));
- return(retval);
- }
- if (!zeph_version) {
- zeph_version = strsave(bd_notice.z_version);
- }
-#ifdef DEBUG
- if (zdebug) {
- char buf[4096];
-
- (void) sprintf(buf,
- "bdump:%s '%s' '%s' '%s' '%s' '%s'",
- ZNoticeKinds[(int) bd_notice.z_kind],
- bd_notice.z_class,
- bd_notice.z_class_inst,
- bd_notice.z_opcode,
- bd_notice.z_sender,
- bd_notice.z_recipient);
- syslog(LOG_DEBUG, buf);
- }
-#endif /* DEBUG */
- if (!strcmp(bd_notice.z_class_inst, ADMIN_LIMBO)) {
- /* he wants limbo */
-#if 1
- zdbug((LOG_DEBUG, "limbo req"));
-#endif
- if ((retval = bdump_send_loop(limbo_server,
- zeph_version))
- != ZERR_NONE)
- return(retval);
- continue;
- } else if (!strcmp(bd_notice.z_class_inst, ADMIN_ME)) {
- /* he wants his state */
-#if 1
- zdbug((LOG_DEBUG, "his state req"));
-#endif
- if ((server = server_which_server(&bogus_from)) !=
- NULLZSDT) {
- if ((retval = bdump_send_loop(server,
- zeph_version))
- != ZERR_NONE)
- return(retval);
- } else {
- syslog(LOG_ERR,"sbd_loop: no state");
- if ((retval = send_done()) != ZERR_NONE)
- return(retval);
- }
- continue;
- } else if (!strcmp(bd_notice.z_class_inst, ADMIN_YOU)) {
- /* he wants my state */
-#if 1
- zdbug((LOG_DEBUG, "my state req"));
-#endif
- if ((retval = bdump_send_loop(me_server, zeph_version))
- != ZERR_NONE)
- return(retval);
- break;
- } else if (!strcmp(bd_notice.z_class_inst, ADMIN_DONE)) {
- break;
- } else {
- /* what does he want? */
-#if 1
- zdbug((LOG_DEBUG, "unknown req"));
-#endif
- break;
- }
- }
- if (zeph_version)
- xfree(zeph_version);
- return(ZERR_NONE);
-}
-
-static Code_t
-gbd_loop(server)
- ZServerDesc_t *server;
-{
- Code_t retval;
-
- /*
- * if we have no hosts in the 'limbo' state (on the limbo server),
- * ask for the other server to send us the limbo state.
- * Thus we keep track of all the hosts which haven't spoken in a while,
- * even in the face of server failure.
- */
- if (otherservers[limbo_server_idx()].zs_hosts->q_forw ==
- otherservers[limbo_server_idx()].zs_hosts) {
- if ((retval = bdump_ask_for(ADMIN_LIMBO)) != ZERR_NONE)
- return(retval);
- if ((retval = bdump_recv_loop(&otherservers[limbo_server_idx()])) != ZERR_NONE)
- return(retval);
+ retval = krb_get_svc_in_tkt(SERVER_SERVICE, buf, ZGetRealm(),
+ "krbtgt", ZGetRealm(),
+ TKTLIFETIME, srvtab_file);
+ if (retval != KSUCCESS) {
+ syslog(LOG_ERR,"get_tgt: krb_get_svc_in_tkt: %s",
+ krb_get_err_text(retval));
+ ticket_time = 0;
+ return(1);
+ } else {
+ ticket_time = NOW;
}
- /* Have I been given my own startup info yet? */
- if (!bdump_inited) {
- if ((retval = bdump_ask_for(ADMIN_ME)) != ZERR_NONE)
- return(retval);
- if ((retval = bdump_recv_loop(me_server)) != ZERR_NONE)
- return(retval);
+#ifndef NOENCRYPTION
+ retval = read_service_key(SERVER_SERVICE, SERVER_INSTANCE,
+ ZGetRealm(), 0 /*kvno*/,
+ srvtab_file, serv_key);
+ if (retval != KSUCCESS) {
+ syslog(LOG_ERR, "get_tgt: read_service_key: %s",
+ krb_get_err_text(retval));
+ return 1;
+ }
+ s = (Sched *) check_key_sched_cache(serv_key);
+ if (s) {
+ serv_ksched = *s;
+ } else {
+ des_key_sched(serv_key, serv_ksched.s);
+ add_to_key_sched_cache(serv_key, &serv_ksched);
}
- if ((retval = bdump_ask_for(ADMIN_YOU)) != ZERR_NONE)
- return(retval);
- retval = bdump_recv_loop(server);
- return(retval);
+#endif /* !NOENCRYPTION */
+ }
+ return(0);
}
+#endif /* ZEPHYR_USES_KERBEROS */
/*
* The braindump offer wasn't taken, so we retract it.
@@ -1012,40 +752,22 @@ gbd_loop(server)
/*ARGSUSED*/
static void
close_bdump(arg)
- void * arg;
+ void * arg;
{
- if (bdump_socket >= 0) {
- FD_CLR(bdump_socket, &interesting);
- (void) close(bdump_socket);
- nfildes = srv_socket + 1;
- bdump_socket = -1;
+ if (bdump_socket >= 0) {
+ FD_CLR(bdump_socket, &interesting);
+ close(bdump_socket);
+ nfds = srv_socket + 1;
+ bdump_socket = -1;
#if 1
- zdbug((LOG_DEBUG, "bdump not used"));
+ zdbug((LOG_DEBUG, "bdump not used"));
#endif
- } else {
+ } else {
#if 1
- zdbug((LOG_DEBUG, "bdump not open"));
+ zdbug((LOG_DEBUG, "bdump not open"));
#endif
- }
- return;
-}
-
-/*
- * Ask the other server to send instruction packets for class instance
- * inst
- */
-
-static Code_t
-bdump_ask_for(inst)
- char *inst;
-{
- Code_t retval;
-
- /* myname is the hostname */
- retval = send_normal_tcp(ACKED, bdump_sin.sin_port, ZEPHYR_ADMIN_CLASS,
- inst, ADMIN_BDUMP, myname, "",
- (char *) NULL, 0);
- return(retval);
+ }
+ return;
}
/*
@@ -1054,535 +776,376 @@ bdump_ask_for(inst)
static Code_t
bdump_recv_loop(server)
- ZServerDesc_t *server;
+ Server *server;
{
- ZNotice_t notice;
- ZPacket_t packet;
- int len;
- Code_t retval;
- ZClient_t *client = NULLZCNT;
- struct sockaddr_in current_who;
- int who_valid = 0;
- int flushing_subs = 0;
-#ifdef KERBEROS
- register char *cp;
- C_Block cblock;
-#endif /* KERBEROS */
-#ifdef CONCURRENT
- fd_set readable, initial;
- int fd_ready;
- struct timeval tv;
-#endif /* CONCURRENT */
+ ZNotice_t notice;
+ ZPacket_t packet;
+ int len;
+ Code_t retval;
+ Client *client = NULL;
+ struct sockaddr_in who;
+#ifdef ZEPHYR_USES_KERBEROS
+ char *cp;
+ C_Block cblock;
+#endif /* ZEPHYR_USES_KERBEROS */
+ Realm *realm = NULL;
#if 1
- zdbug((LOG_DEBUG, "bdump recv loop"));
+ zdbug((LOG_DEBUG, "bdump recv loop"));
#endif
-#ifdef CONCURRENT
- FD_ZERO(&initial);
- FD_SET(srv_socket, &initial);
-#endif /* CONCURRENT */
-
- /* do the inverse of bdump_send_loop, registering stuff on the fly */
- while (1) {
-#ifdef CONCURRENT
- readable = initial;
- tv.tv_sec = tv.tv_usec = 0;
-
- if (msgs_queued()) {
-#if 1
- zdbug((LOG_DEBUG, "brl msgqued"));
-#endif
- fd_ready = 1;
- } else
- fd_ready = select(srv_socket + 1, &readable,
- (fd_set *)0,
- (fd_set *)0, &tv);
- /*
- * if there are packets to be processed, do them.
- * We needn't worry about locking since we don't
- * know what's coming our way.
- */
- if (fd_ready > 0) {
-#if 1
- zdbug((LOG_DEBUG, "brl fdready"));
-#endif
- handle_packet();
-#ifdef notdef
- if (cancel_outgoing_dump) {
- cancel_outgoing_dump = 0;
- return EWOULDBLOCK; /* maybe in a warped sort
- of way */
- }
-#endif
- } else if (fd_ready < 0)
- syslog(LOG_ERR, "brl select: %m");
-#endif /* CONCURRENT */
- len = sizeof(packet);
- if ((retval = get_packet(packet, len, &len)) != ZERR_NONE) {
- syslog(LOG_ERR, "brl get pkt: %s",
- error_message(retval));
- return(retval);
- }
+ /* do the inverse of bdump_send_loop, registering stuff on the fly */
+ while (1) {
+ if (packets_waiting()) {
+ /* A non-braindump packet is waiting; handle it. */
+ bdumping = 0;
+ bdump_concurrent = 1;
+ handle_packet();
+ bdump_concurrent = 0;
+ bdumping = 1;
+ }
+ len = sizeof(packet);
+ retval = get_packet(packet, len, &len);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "brl get pkt: %s", error_message(retval));
+ return retval;
+ }
- if ((retval = ZParseNotice(packet, len, &notice)) != ZERR_NONE) {
- syslog(LOG_ERR, "brl notice parse: %s",
- error_message(retval));
- return(retval);
- }
+ retval = ZParseNotice(packet, len, &notice);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "brl notice parse: %s", error_message(retval));
+ return retval;
+ }
#if defined (DEBUG)
- if (zdebug) {
- char buf[4096];
-
- (void) sprintf(buf,
- "bdump:%s '%s' '%s' '%s' '%s' '%s'",
- ZNoticeKinds[(int) notice.z_kind],
- notice.z_class,
- notice.z_class_inst,
- notice.z_opcode,
- notice.z_sender,
- notice.z_recipient);
- syslog(LOG_DEBUG, buf);
- }
+ if (zdebug) {
+ char buf[4096];
+
+ sprintf(buf, "bdump:%s '%s' '%s' '%s' '%s' '%s'",
+ ZNoticeKinds[(int) notice.z_kind], notice.z_class,
+ notice.z_class_inst, notice.z_opcode, notice.z_sender,
+ notice.z_recipient);
+ syslog(LOG_DEBUG, buf);
+ }
#endif /* DEBUG */
- if (notice.z_kind == HMCTL) {
- /* host register */
- if ((retval = extract_sin(&notice, &current_who)) !=
- ZERR_NONE) {
- syslog(LOG_ERR, "brl hmctl sin: %s",
- error_message(retval));
- return(retval);
- }
- who_valid = 1;
- /* 1 = tell it we are authentic */
- if ((retval = hostm_dispatch(&notice, 1,
- &current_who, server))
- != ZERR_NONE) {
- syslog(LOG_ERR,"brl hm_disp failed: %s",
- error_message(retval));
- return(retval);
- }
- } else if (!strcmp(notice.z_opcode, ADMIN_DONE)) {
- /* end of brain dump */
- return(ZERR_NONE);
- } else if (!who_valid) {
- syslog(LOG_ERR, "brl: no current host");
- return(ZSRV_HNOTFOUND);
- } else if (!strcmp(notice.z_class, LOGIN_CLASS)) {
- /* 1 = tell it we are authentic */
- if ((retval = ulogin_dispatch(&notice, 1,
- &current_who, server))
- != ZERR_NONE) {
- syslog(LOG_ERR, "brl ul_disp failed: %s",
- error_message(retval));
- return(retval);
- }
- } else if (!strcmp(notice.z_opcode, ADMIN_NEWCLT)) {
- /* register a new client */
- notice.z_port = htons((u_short)atoi(notice.z_message));
- if (ntohs(notice.z_port) == 0) {
- /* this is a bogus client from an older rev.
- server, so we just flush it. */
- syslog(LOG_ERR, "brl flushing %s/0",
- inet_ntoa(current_who.sin_addr));
- flushing_subs = 1;
- continue; /* while loop */
- }
- flushing_subs = 0;
- if ((retval = client_register(&notice,
- &current_who,
- &client,
- server,
- 0)) != ZERR_NONE) {
- syslog(LOG_ERR,"brl register failed: %s",
- error_message(retval));
- return(retval);
- }
-#ifdef KERBEROS
- (void) memset((caddr_t) client->zct_cblock, 0,
- sizeof(C_Block));
- if (*notice.z_class_inst) {
- /* a C_Block is there */
- cp = notice.z_message +
- strlen(notice.z_message) + 1;
- retval = ZReadAscii(cp,strlen(cp),
- cblock, sizeof(C_Block));
- if (retval != ZERR_NONE) {
- syslog(LOG_ERR,"brl bad cblk read: %s (%s)",
- error_message(retval),
- cp);
- } else {
+ if (notice.z_num_other_fields >= 1) {
+ retval = ZReadAscii(notice.z_other_fields[0],
+ strlen(notice.z_other_fields[0]),
+ (unsigned char *) &who.sin_addr,
+ sizeof(struct in_addr));
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "brl zreadascii failed: %s",
+ error_message(retval));
+ return retval;
+ }
+ } else {
+ who.sin_addr.s_addr = notice.z_sender_addr.s_addr;
+ }
+ who.sin_family = AF_INET;
+ who.sin_port = notice.z_port;
+
+ if (strcmp(notice.z_opcode, ADMIN_DONE) == 0) {
+ /* end of brain dump */
+ return ZERR_NONE;
+ } else if (strcmp(notice.z_opcode, ADMIN_NEWREALM) == 0) {
+ /* get a realm from the message */
+ realm = realm_get_realm_by_name(notice.z_message);
+ if (!realm)
+ return(ZERR_NONE);
+ } else if (strcmp(notice.z_class, LOGIN_CLASS) == 0) {
+ /* 1 = tell it we are authentic */
+ retval = ulogin_dispatch(&notice, 1, &who, server);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "brl ul_disp failed: %s",
+ error_message(retval));
+ return retval;
+ }
+ } else if (strcmp(notice.z_opcode, ADMIN_NEWCLT) == 0) {
+ /* a new client */
+ notice.z_port = htons((u_short) atoi(notice.z_message));
+ retval = client_register(&notice, &who.sin_addr, &client, 0);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR,"brl failed: %s", error_message(retval));
+ return retval;
+ }
+#ifdef ZEPHYR_USES_KERBEROS
+ memset(client->session_key, 0, sizeof(C_Block));
+ if (*notice.z_class_inst) {
+ /* a C_Block is there */
+ cp = notice.z_message + strlen(notice.z_message) + 1;
+ retval = ZReadAscii(cp, strlen(cp), cblock, sizeof(C_Block));
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR,"brl bad cblk read: %s (%s)",
+ error_message(retval), cp);
+ } else {
#ifdef NOENCRYPTION
- memcpy((caddr_t)cblock,
- (caddr_t)client->zct_cblock,
- sizeof(C_Block));
+ memcpy(cblock, client->session_key, sizeof(C_Block));
#else
- des_ecb_encrypt(cblock, client->zct_cblock,
- serv_ksched.s, DES_DECRYPT);
+ des_ecb_encrypt(cblock, client->session_key, serv_ksched.s,
+ DES_DECRYPT);
#endif
- }
- }
-#endif /* KERBEROS */
- } else if (!strcmp(notice.z_opcode, CLIENT_SUBSCRIBE)) {
- if (flushing_subs)
- continue; /* while loop */
- /* a subscription packet */
- if (!client) {
- syslog(LOG_ERR, "brl no client");
- return(ZSRV_NOCLT);
- }
- if ((retval = subscr_subscribe(client, &notice)) != ZERR_NONE) {
- syslog(LOG_WARNING, "brl subscr failed: %s",
- error_message(retval));
- return(retval);
- }
- } else {
- syslog(LOG_ERR, "brl bad opcode %s",notice.z_opcode);
- return(ZSRV_UNKNOWNOPCODE);
}
+ }
+#endif /* ZEPHYR_USES_KERBEROS */
+ } else if (strcmp(notice.z_opcode, CLIENT_SUBSCRIBE) == 0) {
+ /* a subscription packet */
+ if (!client) {
+ syslog(LOG_ERR, "brl no client");
+ return ZSRV_NOCLT;
+ }
+ retval = subscr_subscribe(client, &notice);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "brl subscr failed: %s",
+ error_message(retval));
+ return retval;
+ }
+ } else if (strcmp(notice.z_opcode, REALM_SUBSCRIBE) == 0) {
+ /* add a subscription for a realm */
+ if (!realm) {
+ syslog(LOG_ERR, "brl no realm");
+ return(ZSRV_NORLM);
+ }
+ retval = subscr_realm(realm, &notice);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "brl subscr failed: %s",
+ error_message(retval));
+ return retval;
+ }
+ } else {
+ syslog(LOG_ERR, "brl bad opcode %s",notice.z_opcode);
+ return ZSRV_UNKNOWNOPCODE;
}
+ }
}
-
+
/*
- * Send all the state from server to the peer.
+ * Send all the state to the peer.
*/
-
+
static Code_t
-bdump_send_loop(server, vers)
- ZServerDesc_t *server;
- char *vers;
+bdump_send_loop(server)
+ Server *server;
{
- register ZHostList_t *host;
- register ZClientList_t *clist;
- Code_t retval;
-#ifdef CONCURRENT
- fd_set readable, initial;
- int fd_ready;
- struct timeval tv;
-#endif /* CONCURRENT */
-
+ Code_t retval;
+
#if 1
- zdbug((LOG_DEBUG, "bdump send loop"));
-#endif
-
-
-#ifdef CONCURRENT
- FD_ZERO(&initial);
- FD_SET(srv_socket, &initial);
-#endif /* CONCURRENT */
-
- for (host = server->zs_hosts->q_forw;
- host != server->zs_hosts;
- host = host->q_forw) {
- /* for each host */
-#ifdef CONCURRENT
- host->zh_locked = 1;
-
- readable = initial;
- tv.tv_sec = tv.tv_usec = 0;
-
- if (msgs_queued())
- fd_ready = 1;
- else
- fd_ready = select(srv_socket + 1, &readable,
- (fd_set *)0,
- (fd_set *)0, &tv);
- /*
- * if there are packets to be processed, do them.
- * locking the host above insures nothing we are working on
- * gets trashed.
- */
- if (fd_ready > 0) {
- handle_packet();
-#ifdef notdef
- if (cancel_outgoing_dump) {
- cancel_outgoing_dump = 0;
- return EWOULDBLOCK;
- }
-#endif
- } else if (fd_ready < 0)
- syslog(LOG_ERR, "bsl select: %m");
-
-#endif /* CONCURRENT */
- if ((retval = send_host_register(host)) != ZERR_NONE) {
- host->zh_locked = 0;
- return(retval);
- }
- if ((retval = uloc_send_locations(host, vers)) != ZERR_NONE) {
- host->zh_locked = 0;
- return(retval);
- }
- if (!host->zh_clients) {
- host->zh_locked = 0;
- continue;
- }
- for (clist = host->zh_clients->q_forw;
- clist != host->zh_clients;
- clist = clist->q_forw) {
- /* for each client */
- if (!clist->zclt_client->zct_subs) {
- host->zh_locked = 0;
- continue;
- }
- if ((retval = subscr_send_subs(clist->zclt_client,
- vers)) != ZERR_NONE) {
- host->zh_locked = 0;
- return(retval);
- }
- }
- host->zh_locked = 0;
- }
- retval = send_done();
- return(retval);
-}
-
-/*
- * Send a host boot packet to the other server
- */
-
-static Code_t
-send_host_register(host)
- ZHostList_t *host;
-{
- char buf[512], *addr, *lyst[2];
- Code_t retval;
-
-#if 0
- zdbug((LOG_DEBUG, "bdump_host_register"));
+ zdbug((LOG_DEBUG, "bdump send loop"));
#endif
- addr = inet_ntoa(host->zh_addr.sin_addr);
- (void) sprintf(buf, "%d", ntohs(host->zh_addr.sin_port));
- lyst[0] = addr;
- lyst[1] = buf;
-
- /* myname is the hostname */
- retval = bdump_send_list_tcp (HMCTL, (int) bdump_sin.sin_port,
- ZEPHYR_CTL_CLASS, ZEPHYR_CTL_HM,
- HM_BOOT, myname, "", lyst, 2);
- if (retval != ZERR_NONE)
- syslog(LOG_ERR, "shr send: %s",error_message(retval));
- return(retval);
+
+ retval = uloc_send_locations();
+ if (retval != ZERR_NONE)
+ return retval;
+ retval = client_send_clients();
+ if (retval != ZERR_NONE)
+ return retval;
+ retval = realm_send_realms();
+ if (retval != ZERR_NONE)
+ return retval;
+ return send_done();
}
-
+
/*
* Send a sync indicating end of this host
*/
-
+
static Code_t
send_done()
{
- Code_t retval;
+ Code_t retval;
#if 1
- zdbug((LOG_DEBUG, "send_done"));
+ zdbug((LOG_DEBUG, "send_done"));
#endif
- retval = send_normal_tcp(SERVACK, bdump_sin.sin_port,
- ZEPHYR_ADMIN_CLASS, "", ADMIN_DONE, myname,
- "", (char *) NULL, 0);
- return(retval);
+ retval = send_normal_tcp(SERVACK, bdump_sin.sin_port, ZEPHYR_ADMIN_CLASS,
+ "", ADMIN_DONE, myname, "", NULL, 0);
+ return retval;
}
-
-
+
+
/*
* Send a list off as the specified notice
*/
-
+
static Code_t
send_list(kind, port, class_name, inst, opcode, sender, recip, lyst, num)
- ZNotice_Kind_t kind;
- int port;
- char *class_name;
- char *inst;
- char *opcode;
- char *sender;
- char *recip;
- char **lyst;
- int num;
+ ZNotice_Kind_t kind;
+ int port, num;
+ char *class_name, *inst, *opcode, *sender, *recip, **lyst;
{
- ZNotice_t notice;
- register ZNotice_t *pnotice; /* speed hack */
- char *pack;
- int packlen;
- Code_t retval;
-
- pnotice = &notice;
-
- pnotice->z_kind = kind;
-
- pnotice->z_port = port;
- pnotice->z_class = class_name;
- pnotice->z_class_inst = inst;
- pnotice->z_opcode = opcode;
- pnotice->z_sender = sender;
- pnotice->z_recipient = recip;
- pnotice->z_default_format = "";
- pnotice->z_num_other_fields = 0;
+ ZNotice_t notice;
+ char *pack;
+ int packlen;
+ Code_t retval;
+
+ notice.z_kind = kind;
+ notice.z_port = port;
+ notice.z_class = class_name;
+ notice.z_class_inst = inst;
+ notice.z_opcode = opcode;
+ notice.z_sender = sender;
+ notice.z_recipient = recip;
+ notice.z_default_format = "";
+ notice.z_num_other_fields = 0;
- if ((retval = ZFormatNoticeList(pnotice, lyst, num, &pack, &packlen, ZNOAUTH)) != ZERR_NONE) {
- syslog(LOG_WARNING, "sl format: %s", error_message(retval));
- return(retval);
- }
+ retval = ZFormatNoticeList(&notice, lyst, num, &pack, &packlen, ZNOAUTH);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "sl format: %s", error_message(retval));
+ return retval;
+ }
- if ((retval = ZSendPacket(pack, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "sl xmit: %s", error_message(retval));
- xfree(pack); /* free allocated storage */
- return(retval);
- }
- xfree(pack); /* free allocated storage */
- return(ZERR_NONE);
+ retval = ZSendPacket(pack, packlen, 0);
+ if (retval != ZERR_NONE)
+ syslog(LOG_WARNING, "sl xmit: %s", error_message(retval));
+ free(pack);
+ return retval;
}
-
+
/*
* Send a message off as the specified notice, via TCP
*/
-
+
static Code_t
send_normal_tcp(kind, port, class_name, inst, opcode, sender, recip,
message, len)
- ZNotice_Kind_t kind;
- int port;
- char *class_name;
- char *inst;
- char *opcode;
- char *sender;
- char *recip;
- char *message;
- int len;
+ ZNotice_Kind_t kind;
+ int port, len;
+ char *class_name, *inst, *opcode, *sender, *recip, *message;
{
- ZNotice_t notice;
- register ZNotice_t *pnotice; /* speed hack */
- char *pack;
- int packlen, count;
- Code_t retval;
- u_short length;
-
- pnotice = &notice;
-
- pnotice->z_kind = kind;
+ ZNotice_t notice;
+ char *pack;
+ int packlen, count;
+ Code_t retval;
+ u_short length;
+
+ notice.z_kind = kind;
+ notice.z_port = port;
+ notice.z_class = class_name;
+ notice.z_class_inst = inst;
+ notice.z_opcode = opcode;
+ notice.z_sender = sender;
+ notice.z_recipient = recip;
+ notice.z_default_format = "";
+ notice.z_message = message;
+ notice.z_message_len = len;
+ notice.z_num_other_fields = 0;
+
+ retval = ZFormatNotice(&notice, &pack, &packlen, ZNOAUTH);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "sn format: %s", error_message(retval));
+ return retval;
+ }
- pnotice->z_port = port;
- pnotice->z_class = class_name;
- pnotice->z_class_inst = inst;
- pnotice->z_opcode = opcode;
- pnotice->z_sender = sender;
- pnotice->z_recipient = recip;
- pnotice->z_default_format = "";
- pnotice->z_message = message;
- pnotice->z_message_len = len;
- pnotice->z_num_other_fields = 0;
+ length = htons((u_short) packlen);
- if ((retval = ZFormatNotice(pnotice, &pack, &packlen, ZNOAUTH)) != ZERR_NONE) {
- syslog(LOG_WARNING, "sn format: %s", error_message(retval));
- return(retval);
+ count = net_write(output, (char *) &length, sizeof(length));
+ if (count != sizeof(length)) {
+ if (count < 0) {
+ syslog(LOG_WARNING, "snt xmit/len: %m");
+ free(pack);
+ return errno;
+ } else {
+ syslog(LOG_WARNING, "snt xmit: %d vs %d",sizeof(length),count);
+ free(pack);
+ return ZSRV_LEN;
}
-
- length = htons((u_short) packlen);
-
- if ((count = net_write(output, (caddr_t) &length, sizeof(length))) != sizeof(length)) {
- if (count < 0) {
- syslog(LOG_WARNING, "snt xmit/len: %m");
- xfree(pack); /* free allocated storage */
- return(errno);
- } else {
- syslog(LOG_WARNING, "snt xmit: %d vs %d",sizeof(length),count);
- xfree(pack); /* free allocated storage */
- return(ZSRV_LEN);
- }
+ }
+ count = net_write(output, pack, packlen);
+ if (count != packlen) {
+ if (count < 0) {
+ syslog(LOG_WARNING, "snt xmit: %m");
+ free(pack);
+ return errno;
+ } else {
+ syslog(LOG_WARNING, "snt xmit: %d vs %d",packlen, count);
+ free(pack);
+ return ZSRV_LEN;
}
- if ((count = net_write(output, pack, packlen)) != packlen)
- if (count < 0) {
- syslog(LOG_WARNING, "snt xmit: %m");
- xfree(pack); /* free allocated storage */
- return(errno);
- } else {
- syslog(LOG_WARNING, "snt xmit: %d vs %d",packlen, count);
- xfree(pack); /* free allocated storage */
- return(ZSRV_LEN);
- }
- xfree(pack); /* free allocated storage */
- return(ZERR_NONE);
+ }
+ free(pack);
+ return ZERR_NONE;
}
-
+
/*
* get a packet from the TCP socket
* return 0 if successful, error code else
*/
-
+
static Code_t
get_packet(packet, len, retlen)
- caddr_t packet;
- int len;
- int *retlen;
+ void *packet;
+ int len;
+ int *retlen;
{
- u_short length;
- int result;
+ u_short length;
+ int result;
- if ((result = net_read(input, (caddr_t) &length, sizeof(u_short))) < sizeof(short)) {
- if (result < 0)
- return(errno);
- else {
- syslog(LOG_ERR, "get_pkt len: %d vs %d (%m)", result, sizeof(short));
- return(ZSRV_LEN);
- }
+ result = net_read(input, (char *) &length, sizeof(u_short));
+ if (result < sizeof(short)) {
+ if (result < 0) {
+ return errno;
+ } else {
+ syslog(LOG_ERR, "get_pkt len: %d vs %d (%m)", result,
+ sizeof(short));
+ return ZSRV_LEN;
}
+ }
- length = ntohs(length);
- if (len < length)
- return(ZSRV_BUFSHORT);
- if ((result = net_read(input, packet, (int) length)) < length) {
- if (result < 0)
- return(errno);
- else {
- syslog(LOG_ERR, "get_pkt: %d vs %d (%m)",result, length);
- return(ZSRV_LEN);
- }
+ length = ntohs(length);
+ if (len < length)
+ return ZSRV_BUFSHORT;
+ result = net_read(input, packet, (int) length);
+ if (result < length) {
+ if (result < 0) {
+ return errno;
+ } else {
+ syslog(LOG_ERR, "get_pkt: %d vs %d (%m)", result, length);
+ return ZSRV_LEN;
}
- *retlen = (int) length;
- return(ZERR_NONE);
+ }
+ *retlen = length;
+ return ZERR_NONE;
}
-
+
static Code_t
extract_sin(notice, target)
- ZNotice_t *notice;
- struct sockaddr_in *target;
+ ZNotice_t *notice;
+ struct sockaddr_in *target;
{
- register char *cp = notice->z_message;
- char *buf;
+ char *cp = notice->z_message;
+ char *buf;
- buf = cp;
- if (!notice->z_message_len || *buf == '\0') {
+ buf = cp;
+ if (!notice->z_message_len || *buf == '\0') {
#if 0
- zdbug((LOG_DEBUG,"no addr"));
+ zdbug((LOG_DEBUG,"no addr"));
#endif
- return(ZSRV_PKSHORT);
- }
- target->sin_addr.s_addr = inet_addr(cp);
+ return ZSRV_PKSHORT;
+ }
+ target->sin_addr.s_addr = inet_addr(cp);
- cp += (strlen(cp) + 1); /* past the null */
- if ((cp >= notice->z_message + notice->z_message_len)
- || (*cp == '\0')) {
+ cp += (strlen(cp) + 1); /* past the null */
+ if ((cp >= notice->z_message + notice->z_message_len) || (*cp == '\0')) {
#if 0
- zdbug((LOG_DEBUG, "no port"));
+ zdbug((LOG_DEBUG, "no port"));
#endif
- return(ZSRV_PKSHORT);
- }
- target->sin_port = htons((u_short) atoi(cp));
- target->sin_family = AF_INET;
- return(ZERR_NONE);
+ return(ZSRV_PKSHORT);
+ }
+ target->sin_port = htons((u_short) atoi(cp));
+ target->sin_family = AF_INET;
+ return ZERR_NONE;
}
-
+
static int
net_read(f, buf, len)
- FILE *f;
- register char *buf;
- register int len;
+ FILE *f;
+ char *buf;
+ int len;
{
int cc, len2 = 0;
fflush (output);
do {
errno = 0;
- cc = fread (buf, 1, len, f);
+ cc = fread(buf, 1, len, f);
if (cc == 0)
return -1;
buf += cc;
@@ -1591,15 +1154,15 @@ net_read(f, buf, len)
} while (len > 0);
return len2;
}
-
+
static int
net_write(f, buf, len)
- FILE *f;
- register char *buf;
- int len;
+ FILE *f;
+ char *buf;
+ int len;
{
int cc;
- register int wrlen = len;
+ int wrlen = len;
do {
cc = fwrite (buf, 1, wrlen, f);
if (cc == 0)
@@ -1613,7 +1176,7 @@ net_write(f, buf, len)
static int
setup_file_pointers ()
{
- int fd;
+ int fd;
input = fdopen (live_socket, "r");
if (!input)
diff --git a/server/class.c b/server/class.c
index b70bf4e..b4c46d8 100644
--- a/server/class.c
+++ b/server/class.c
@@ -12,41 +12,40 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h" /* includes zephyr/zephyr.h */
+#include <assert.h>
#if !defined (lint) && !defined (SABER)
-static char rcsid_class_c[] =
- "$Id$";
+static const char rcsid_class_c[] =
+"$Id$";
#endif
-#include "zserver.h" /* includes zephyr/zephyr.h */
-
-#include <ctype.h> /* for isupper, tolower */
-
/*
* Class manager subsystem.
*
*
* External functions are:
*
- * Code_t triplet_register(client, subs)
+ * Code_t triplet_register(client, subs, realm)
*
- * Code_t triplet_deregister(client, subs)
+ * Code_t triplet_deregister(client, subs, realm)
*
- * ZClientList_t *triplet_lookup(subs)
- * ZClient_t *client;
- * ZSubscr_t *subs;
+ * Client *triplet_lookup(subs)
+ * Client *client;
+ * Destlist *subs;
*
- * ZAcl_t *class_get_acl(ZString class_name)
+ * Acl *class_get_acl(class_name)
+ * String *class_name;
*
* Code_t class_restrict(class_name, acl)
* char *class_name;
- * ZAcl_t *acl;
+ * Acl *acl;
*
* Code_t class_setup_restricted(class_name, acl)
* char *class_name;
- * ZAcl_t *acl;
+ * Acl *acl;
*
- * and several ZDestination methods.
+ * and several Destination methods.
*/
/*
@@ -56,7 +55,7 @@ static char rcsid_class_c[] =
* name (which hashes into the bucket associated with this list) and a
* doubly linked list of clients which are interested in this class.
* The data pointed to by these clients is owned by other modules. Care
- * must be taken by the caller not to register a free()'d client
+ * must be taken by the caller not to a free()'d client
* structure.
*
* If any hash bucket is empty, the pointer is null.
@@ -71,26 +70,23 @@ static char rcsid_class_c[] =
/* Private variables */
#define EMPTY_CLASS 2000
+#define ALLOC_OFFSET 8 /* Allocate 32 bytes less than a power of 2. */
+#define ALLOC_INIT 8 /* Initial number of subscriptions. */
+
#define HASHSIZE 1023
#define HASHVAL(c, i, r) (((c)->hash_val ^ (i)->hash_val ^ (r)->hash_val) \
% HASHSIZE)
#define DEST_HASHVAL(dest) HASHVAL((dest).classname, (dest).inst, (dest).recip)
-static ZTriplet_t *class_bucket[HASHSIZE]; /* the hash table of pointers */
-
+static Triplet *triplet_bucket[HASHSIZE]; /* the hash table of pointers */
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static Code_t remove_client P((ZTriplet_t *ptr, ZClient_t *client));
-static Code_t insert_client P((ZTriplet_t *ptr, ZClient_t *client));
-static ZClientList_t *client_alloc P((ZClient_t *client));
-static ZTriplet_t *triplet_alloc P((ZSTRING *classname, ZSTRING *inst,
- ZSTRING *recipient));
-static void free_class P((ZTriplet_t *));
+static Code_t remove_client __P((Triplet *triplet, Client *client,
+ Realm *realm));
+static Code_t insert_client __P((Triplet *triplet, Client *client,
+ Realm *realm));
+static Triplet *triplet_alloc __P((String *classname, String *inst,
+ String *recipient));
+static void free_triplet __P((Triplet *));
/* public routines */
@@ -102,169 +98,112 @@ static void free_class P((ZTriplet_t *));
* been case-sensitive in the recipient string. In most cases, a
* failed match will fail on the classname or instance, and a successful
* match will succeed on the (d1->recip == d2->recip) check, so this
- * shouldn't affect performance. Note that this invalidates the overall
- * hash value check, which was of dubious value to start with.
+ * shouldn't affect performance.
*/
int ZDest_eq(d1, d2)
- ZDestination *d1, *d2;
+ Destination *d1, *d2;
{
- return((d1->classname == d2->classname) &&
- (d1->inst == d2->inst) &&
- (d1->recip == d2->recip ||
- strcasecmp(d1->recip->string, d2->recip->string) == 0));
+ return((d1->classname == d2->classname) &&
+ (d1->inst == d2->inst) &&
+ (d1->recip == d2->recip ||
+ strcasecmp(d1->recip->string, d2->recip->string) == 0));
}
-/* register the client as interested in a triplet */
+/* the client as interested in a triplet */
Code_t
-triplet_register(client, dest)
- ZClient_t *client;
- ZDestination *dest;
+triplet_register(client, dest, realm)
+ Client *client;
+ Destination *dest;
+ Realm *realm;
{
- register ZTriplet_t *ptr, *ptr2;
- unsigned long hashval;
-
- hashval = DEST_HASHVAL(*dest);
-
- if (!(ptr = class_bucket[hashval])) {
- /* not registered */
-
- ptr = triplet_alloc(dest->classname, dest->inst, dest->recip);
- if (!ptr)
- return(ENOMEM);
-
- /* allocate the head of the bucket */
-
- if (!(ptr2 = (ZTriplet_t *) xmalloc(sizeof(ZTriplet_t))))
- return(ENOMEM);
-
- ptr2->zct_clientlist = 0;
- ptr2->zct_acl = 0;
- ptr2->q_forw = ptr;
- ptr2->q_back = ptr;
- ptr->q_forw = ptr2;
- ptr->q_back = ptr2;
-
- class_bucket[hashval] = ptr2;
- return(insert_client(ptr, client));
-
- } else {
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) {
- /* walk down the list, looking for a match */
- if (ZDest_eq(&ptr2->zct_dest,dest))
- return(insert_client(ptr2, client));
- }
+ Triplet *triplet;
+ unsigned long hashval;
- /* fell off the end, no match */
- ptr2 = triplet_alloc(dest->classname, dest->inst, dest->recip);
- if (!ptr2)
- return(ENOMEM);
+ hashval = DEST_HASHVAL(*dest);
+ for (triplet = triplet_bucket[hashval]; triplet; triplet = triplet->next) {
+ if (ZDest_eq(&triplet->dest, dest))
+ return insert_client(triplet, client, realm);
+ }
- xinsque(ptr2, ptr); /* insert new class into hash bucket */
- return(insert_client(ptr2, client));
- }
+ /* Triplet not present in hash table, insert it. */
+ triplet = triplet_alloc(dest->classname, dest->inst, dest->recip);
+ LIST_INSERT(&triplet_bucket[hashval], triplet);
+ return insert_client(triplet, client, realm);
}
/* dissociate client from the class, garbage collecting if appropriate */
Code_t
-triplet_deregister(client, dest)
- ZClient_t *client;
- ZDestination *dest;
+triplet_deregister(client, dest, realm)
+ Client *client;
+ Destination *dest;
+ Realm *realm;
{
- register ZTriplet_t *ptr, *ptr2;
- int retval = -1;
- unsigned long hashval;
+ Triplet *triplet;
+ int retval;
+ unsigned long hashval;
- hashval = DEST_HASHVAL(*dest);
-#if 0
- zdbug((LOG_DEBUG, "class_dereg: %s %s", dest->classname->string,
- dest->inst->string));
-#endif
- ptr = class_bucket[hashval];
- if (!ptr)
- /* no such class to deregister */
- return(ZSRV_BADASSOC);
-
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw) {
- /* walk down the list, looking for a match */
- if (ZDest_eq(&ptr2->zct_dest,dest)) {
- retval = remove_client(ptr2, client);
- if (retval == EMPTY_CLASS) {
#if 0
- zdbug((LOG_DEBUG,"empty class"));
+ zdbug((LOG_DEBUG, "class_dereg: %s %s", dest->classname->string,
+ dest->inst->string));
#endif
- /* Don't free up restricted classes. */
- if (ptr2->zct_acl)
- return(ZERR_NONE);
- else {
- xremque(ptr2);
- free_class(ptr2);
- return(ZERR_NONE);
- }
- }
- /* if not EMPTY_CLASS, it's either ZSRV_BADASSOC
- (not found) or ZERR_NONE (found and removed),
- so break */
- break;
- }
+ hashval = DEST_HASHVAL(*dest);
+ for (triplet = triplet_bucket[hashval]; triplet; triplet = triplet->next) {
+ if (ZDest_eq(&triplet->dest, dest)) {
+ retval = remove_client(triplet, client, realm);
+ if (retval != ZERR_NONE)
+ return retval;
+ if (*triplet->clients == NULL && !triplet->acl) {
+ LIST_DELETE(triplet);
+ free_triplet(triplet);
+ }
+ return ZERR_NONE;
}
-
- /* fell off: either client not found or client found
- and removed, retval contains the result */
- return(retval);
+ }
+ return(ZSRV_BADASSOC);
}
-
+
/* return a linked list of what clients are interested in this triplet */
-ZClientList_t *
+Client **
triplet_lookup(dest)
- ZDestination *dest;
+ Destination *dest;
{
- register ZTriplet_t *class, *p;
- unsigned long hashval;
-
- hashval = DEST_HASHVAL(*dest);
- p = class_bucket[hashval];
- if (p == NULLZT)
- return NULLZCLT;
-
- /* Go search the list for the class */
- for (class = p->q_forw; class != p; class = class->q_forw) {
- /* walk down the list, looking for a match */
- if (ZDest_eq(&class->zct_dest,dest))
- return class->zct_clientlist;
- }
- return NULLZCLT;
+ Triplet *triplet;
+ unsigned long hashval;
+
+ hashval = DEST_HASHVAL(*dest);
+ for (triplet = triplet_bucket[hashval]; triplet; triplet = triplet->next) {
+ if (ZDest_eq(&triplet->dest, dest))
+ return triplet->clients;
+ }
+ return NULL;
}
/*
- * return the acl structure associated with class, or NULLZACLT if there is
+ * return the acl structure associated with class, or NULL if there is
* no such acl struct
*/
-ZAcl_t *
+Acl *
class_get_acl(class_name)
- ZSTRING *class_name;
+ String *class_name;
{
- register ZTriplet_t *ptr, *ptr2;
- unsigned long hashval;
-
- hashval = HASHVAL(class_name, empty, empty);
- if (!(ptr = class_bucket[hashval]))
- return(NULLZACLT);
-
- /* walk down the list, looking for a match */
- for (ptr2 = ptr->q_back; ptr2 != ptr; ptr2 = ptr2->q_back)
- if ((ptr2->zct_dest.classname == class_name) &&
- (ptr2->zct_dest.inst == empty) &&
- (ptr2->zct_dest.recip == empty))
- return(ptr2->zct_acl);
-
- /* fell off the end, no match ==> not restricted */
- return(NULLZACLT);
+ Triplet *triplet;
+ unsigned long hashval;
+
+ hashval = HASHVAL(class_name, empty, empty);
+ for (triplet = triplet_bucket[hashval]; triplet; triplet = triplet->next) {
+ if (triplet->dest.classname == class_name &&
+ triplet->dest.inst == empty && triplet->dest.recip == empty)
+ return triplet->acl;
+ }
+
+ /* No acl found, not restricted. */
+ return NULL;
}
/*
@@ -275,35 +214,28 @@ class_get_acl(class_name)
Code_t
class_restrict(class_name, acl)
- char *class_name;
- ZAcl_t *acl;
+ char *class_name;
+ Acl *acl;
{
- register ZTriplet_t *ptr, *ptr2;
- ZSTRING *d;
- unsigned long hashval;
-
- d = make_zstring(class_name,1);
- hashval = HASHVAL(d, empty, empty);
-
- if (!(ptr = class_bucket[hashval])) {
- free_zstring(d);
- return(ZSRV_NOCLASS);
+ Triplet *triplet;
+ String *d;
+ unsigned long hashval;
+
+ d = make_string(class_name,1);
+ hashval = HASHVAL(d, empty, empty);
+ for (triplet = triplet_bucket[hashval]; triplet; triplet = triplet->next) {
+ if (triplet->dest.classname == d && triplet->dest.inst == empty &&
+ triplet->dest.recip == empty) {
+ if (triplet->acl)
+ return ZSRV_CLASSRESTRICTED;
+ triplet->acl = acl;
+ free_string(d);
+ return ZERR_NONE;
}
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw)
- /* walk down the list, looking for a match */
- if ((ptr2->zct_dest.classname == d) &&
- (ptr2->zct_dest.inst == empty) &&
- (ptr2->zct_dest.recip == empty)) {
- if (ptr2->zct_acl)
- return ZSRV_CLASSRESTRICTED;
- ptr2->zct_acl = acl;
- free_zstring(d);
- return(ZERR_NONE);
- }
+ }
- /* fell off the end, no match */
- free_zstring(d);
- return(ZSRV_NOCLASS);
+ free_string(d);
+ return ZSRV_NOCLASS;
}
/*
@@ -311,132 +243,100 @@ class_restrict(class_name, acl)
* structure acl. return ZERR_NONE if no error, or ZSRV_CLASSXISTS
* if the class is already registered, or ENOMEM in case of malloc failure.
*/
-
+
Code_t
class_setup_restricted(class_name, acl)
- char *class_name;
- ZAcl_t *acl;
+ char *class_name;
+ Acl *acl;
{
- register ZTriplet_t *ptr, *ptr2;
- ZSTRING *d;
- unsigned long hashval;
-
- d = make_zstring(class_name,1);
- hashval = HASHVAL(d, empty, empty);
-
- if (!(ptr = class_bucket[hashval])) {
- /* not registered */
-
- ptr = triplet_alloc(d,empty,empty);
- if (!ptr)
- return(ENOMEM);
-
- ptr->zct_acl = acl;
-
- /* allocate the head of the bucket */
- ptr2 = (ZTriplet_t *) xmalloc(sizeof(ZTriplet_t));
- if (!ptr2)
- return(ENOMEM);
-
- ptr2->q_forw = ptr;
- ptr2->q_back = ptr;
- ptr->q_forw = ptr2;
- ptr->q_back = ptr2;
-
- class_bucket[hashval] = ptr2;
- free_zstring(d);
- return(ZERR_NONE);
- } else {
- for (ptr2 = ptr->q_forw; ptr2 != ptr; ptr2 = ptr2->q_forw)
- /* walk down the list, looking for a match */
- if ((ptr2->zct_dest.classname == d) &&
- (ptr2->zct_dest.inst == empty) &&
- (ptr2->zct_dest.recip == empty)) {
- free_zstring(d);
- return(ZSRV_CLASSXISTS);
- }
- if (!(ptr2 = triplet_alloc(d,empty,empty))) {
- free_zstring(d);
- return(ENOMEM);
- }
-
- free_zstring(d);
- ptr2->zct_acl = acl;
- xinsque(ptr2, ptr);
- return(ZERR_NONE);
+ Triplet *triplet;
+ String *d;
+ unsigned long hashval;
+
+ d = make_string(class_name,1);
+ hashval = HASHVAL(d, empty, empty);
+ for (triplet = triplet_bucket[hashval]; triplet; triplet = triplet->next) {
+ if (triplet->dest.classname == d && triplet->dest.inst == empty &&
+ triplet->dest.recip == d) {
+ free_string(d);
+ return ZSRV_CLASSXISTS;
}
+ }
+
+ /* Triplet not present in hash table, insert it. */
+ triplet = triplet_alloc(d, empty, empty);
+ free_string(d);
+ if (!triplet)
+ return ENOMEM;
+ triplet->acl = acl;
+ LIST_INSERT(&triplet_bucket[hashval], triplet);
+ return ZERR_NONE;
}
/* private routines */
/* allocate space for a class structure */
-static ZTriplet_t *
+static Triplet *
triplet_alloc(classname,inst,recipient)
- ZSTRING *classname;
- ZSTRING *inst;
- ZSTRING *recipient;
+ String *classname, *inst, *recipient;
{
- register ZTriplet_t *ptr;
- ZClientList_t *clist;
-
- if (!(ptr = (ZTriplet_t *) xmalloc(sizeof(ZTriplet_t))))
- return(NULLZT);
-
- ptr->q_forw = ptr->q_back = ptr;
- ptr->zct_dest.classname = dup_zstring(classname);
- ptr->zct_dest.inst = dup_zstring(inst);
- ptr->zct_dest.recip = dup_zstring(recipient);
-
- if (!(clist = (ZClientList_t *) xmalloc (sizeof (ZClientList_t)))) {
- xfree(ptr);
- return(NULLZT);
- }
- clist->q_forw = clist->q_back = clist;
- ptr->zct_clientlist = clist;
- ptr->zct_acl = NULLZACLT;
+ Triplet *triplet;
+ Client *clist;
- return (ptr);
-}
-
-/* allocate space for a client entry */
-
-static ZClientList_t *
-client_alloc(client)
- ZClient_t *client;
-{
- register ZClientList_t *ptr;
- if (!(ptr = (ZClientList_t *) xmalloc(sizeof(ZClientList_t))))
- return(NULLZCLT);
+ triplet = (Triplet *) malloc(sizeof(Triplet));
+ if (!triplet)
+ return NULL;
- ptr->q_forw = ptr->q_back = ptr;
- ptr->zclt_client = client;
+ triplet->dest.classname = dup_string(classname);
+ triplet->dest.inst = dup_string(inst);
+ triplet->dest.recip = dup_string(recipient);
+ triplet->clients = NULL;
+ triplet->acl = NULL;
- return(ptr);
+ return triplet;
}
/* insert a client into the list associated with the class *ptr */
static Code_t
-insert_client(ptr, client)
- ZTriplet_t *ptr;
- ZClient_t *client;
+insert_client(triplet, client, realm)
+ Triplet *triplet;
+ Client *client;
+ Realm *realm;
{
- register ZClientList_t *listp, *clist;
-
- for (clist = ptr->zct_clientlist->q_forw;
- clist != ptr->zct_clientlist;
- clist = clist->q_forw) {
- /* don't duplicate */
- if (clist->zclt_client == client)
- return(ZSRV_CLASSXISTS);
+ Client **clientp, **newclients;
+ int new_size;
+
+ if (triplet->clients) {
+ /* Avoid duplication. */
+ for (clientp = triplet->clients; *clientp; clientp++) {
+ if (*clientp == client || (realm && (*clientp)->realm == realm))
+ return ZSRV_CLASSXISTS;
}
- if (!(listp = client_alloc(client)))
- return(ENOMEM);
+ if (clientp + 1 - triplet->clients >= triplet->clients_size) {
+ new_size = triplet->clients_size * 2 + ALLOC_OFFSET;
+ newclients = (Client **) realloc(triplet->clients,
+ new_size * sizeof(Client *));
+ if (newclients == NULL)
+ return ENOMEM;
+ clientp = newclients + (clientp - triplet->clients);
+ triplet->clients = newclients;
+ triplet->clients_size = new_size;
+ }
+ } else {
+ /* Allocate an initial list of client pointers. */
+ triplet->clients = (Client **) malloc(ALLOC_INIT * sizeof(Client *));
+ if (triplet->clients == NULL)
+ return ENOMEM;
+ triplet->clients_size = ALLOC_INIT;
+ clientp = triplet->clients;
+ }
- xinsque(listp, ptr->zct_clientlist);
- return(ZERR_NONE);
+ *clientp = client;
+ clientp[1] = NULL;
+ return ZERR_NONE;
}
/*
@@ -444,70 +344,58 @@ insert_client(ptr, client)
* collecting if appropriate
*/
-static Code_t remove_client(ptr, client)
- ZTriplet_t *ptr;
- ZClient_t *client;
+static Code_t remove_client(triplet, client, realm)
+ Triplet *triplet;
+ Client *client;
+ Realm *realm;
{
- register ZClientList_t *listp = ptr->zct_clientlist;
- register ZClientList_t *listp2;
-
- if (!listp)
- return(ZSRV_BADASSOC);
- for (listp2 = listp->q_forw;
- listp2 != listp;
- listp2 = listp2->q_forw)
- /* walk down list, looking for him */
- if (listp2->zclt_client == client) {
- xremque(listp2);
- xfree(listp2);
- if (listp->q_forw == listp)
- return(EMPTY_CLASS);
- else
- return(ZERR_NONE);
- }
- return(ZSRV_BADASSOC);
+ Client **clientp;
+
+ for (clientp = triplet->clients; *clientp; clientp++) {
+ if (*clientp == client || (realm && (*clientp)->realm == realm)) {
+ for (; *clientp; clientp++)
+ *clientp = clientp[1];
+ return ZERR_NONE;
+ }
+ }
+
+ return ZSRV_BADASSOC;
}
-static void free_class(class)
- ZTriplet_t *class;
+static void free_triplet(triplet)
+ Triplet *triplet;
{
- free_zstring(class->zct_dest.classname);
- free_zstring(class->zct_dest.inst);
- free_zstring(class->zct_dest.recip);
- if (class->zct_acl != NULL)
- xfree(class->zct_acl);
- if (class->zct_clientlist != NULL)
- xfree(class->zct_clientlist);
- xfree(class);
+ if (triplet->clients)
+ free(triplet->clients);
+ free_string(triplet->dest.classname);
+ free_string(triplet->dest.inst);
+ free_string(triplet->dest.recip);
+ free(triplet);
}
-
-void class_dump_subs(fp)
- register FILE *fp;
+
+void triplet_dump_subs(fp)
+ FILE *fp;
{
int i;
- ZTriplet_t *trpq, *trp;
- ZClientList_t *cltq, *clt;
+ Triplet *triplet;
+ Client **clientp;
for (i = 0; i < HASHSIZE; i++) {
- trpq = class_bucket[i];
- if (!trpq)
- continue;
- for (trp = trpq->q_forw; trp != trpq; trp = trp->q_forw) {
+ for (triplet = triplet_bucket[i]; triplet; triplet = triplet->next) {
fputs("Triplet '", fp);
- subscr_quote(trp->zct_dest.classname->string, fp);
+ dump_quote(triplet->dest.classname->string, fp);
fputs("' '", fp);
- subscr_quote(trp->zct_dest.inst->string, fp);
+ dump_quote(triplet->dest.inst->string, fp);
fputs("' '", fp);
- subscr_quote(trp->zct_dest.recip->string, fp);
+ dump_quote(triplet->dest.recip->string, fp);
fputs("':\n", fp);
- cltq = trp->zct_clientlist;
- if (!cltq)
- continue;
- for (clt = cltq->q_forw; clt != cltq; clt = clt->q_forw) {
- fprintf(fp, "\t%s %d (%s)\n",
- inet_ntoa(clt->zclt_client->zct_sin.sin_addr),
- ntohs(clt->zclt_client->zct_sin.sin_port),
- clt->zclt_client->zct_principal->string);
+ if (triplet->clients) {
+ for (clientp = triplet->clients; *clientp; clientp++) {
+ fprintf(fp, "\t%s %d (%s)\n",
+ inet_ntoa((*clientp)->addr.sin_addr),
+ ntohs((*clientp)->addr.sin_port),
+ (*clientp)->principal->string);
+ }
}
}
}
diff --git a/server/client.c b/server/client.c
index 4646ac6..4e98f8f 100644
--- a/server/client.c
+++ b/server/client.c
@@ -12,10 +12,12 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
+#include <sys/socket.h>
#if !defined (lint) && !defined (SABER)
-static char rcsid_client_c[] =
- "$Id$";
+static const char rcsid_client_c[] =
+"$Id$";
#endif
/*
@@ -24,29 +26,26 @@ static char rcsid_client_c[] =
* Code_t client_register(notice, who, client, server, wantdefaults)
* ZNotice_t *notice;
* struct sockaddr_in *who;
- * ZClient_t **client; (RETURN)
- * ZServerDesc_t *server;
+ * Client **client; (RETURN)
+ * Server *server;
* int wantdefaults;
*
* Code_t client_deregister(client, host, flush)
- * ZClient_t *client;
- * ZHostList_t *host;
+ * Client *client;
+ * Host *host;
* int flush;
*
- * ZClient_t *client_which_client(who, notice)
+ * Client *client_which_client(who, notice)
* struct sockaddr_in *who;
* ZNotice_t *notice;
*
* void client_dump_clients(fp, clist)
* FILE *fp;
- * ZClientList_t *clist;
+ * Client *clist;
*/
-#include "zserver.h"
-#include <sys/socket.h>
-
/*
- * register a client: allocate space, find or insert the address in the
+ * a client: allocate space, find or insert the address in the
* server's list of hosts, initialize and insert the client into
* the host's list of clients.
*
@@ -54,90 +53,61 @@ static char rcsid_client_c[] =
* The caller should check by calling client_which_client
*/
+#define HASHSIZE 1024
+static Client *client_bucket[HASHSIZE];
+
+#define INET_HASH(host, port) ((htonl((host)->s_addr) + \
+ htons((unsigned short) (port))) % HASHSIZE)
+
+static Client *client_find __P((struct in_addr *host, unsigned int port));
+
Code_t
-client_register(notice, who, client, server, wantdefaults)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- register ZClient_t **client;
- ZServerDesc_t *server;
- int wantdefaults;
+client_register(notice, host, client_p, wantdefaults)
+ ZNotice_t *notice;
+ struct in_addr *host;
+ Client **client_p;
+ int wantdefaults;
{
- register ZHostList_t *hlp = server->zs_hosts;
- register ZHostList_t *hlp2;
- register ZClientList_t *clist;
-
- /* chain the client's host onto this server's host list */
+ Client *client;
+ Code_t retval;
- if (!hlp) { /* bad host list */
- syslog(LOG_ERR, "cl_register: bad server host list");
- abort();
- }
+ /* chain the client's host onto this server's host list */
#if 1
- zdbug ((LOG_DEBUG, "client_register: adding %s at %s/%d",
- notice->z_sender, inet_ntoa (who->sin_addr),
- ntohs (notice->z_port)));
+ zdbug((LOG_DEBUG, "client_register: adding %s at %s/%d",
+ notice->z_sender, inet_ntoa(*host), ntohs(notice->z_port)));
#endif
- if (!notice->z_port) {
- /* must be a non-zero port # */
- return(ZSRV_BADSUBPORT);
- }
- if (!(hlp2 = hostm_find_host(&who->sin_addr))) {
- /* not here */
- return(ZSRV_HNOTFOUND);
- }
+ if (!notice->z_port)
+ return ZSRV_BADSUBPORT;
- /* hlp2 is now pointing to the client's host's address struct */
-
- if (!hlp2->zh_clients) {
- return(EINVAL);
- }
-
- /* allocate a client struct */
- if (!(*client = (ZClient_t *) xmalloc(sizeof(ZClient_t))))
- return(ENOMEM);
-
- (*client)->last_msg = 0;
- (*client)->last_check = 0;
- (*client)->last_send = 0;
-
- if (!(clist = (ZClientList_t *) xmalloc(sizeof(ZClientList_t)))) {
- xfree(*client);
- return(ENOMEM);
- }
-
- clist->q_forw = clist->q_back = clist;
- clist->zclt_client = *client;
-
- /* initialize the struct */
- (void) memset((caddr_t) &(*client)->zct_sin, 0,
- sizeof(struct sockaddr_in));
+ *client_p = client = client_find(host, notice->z_port);
+ if (!client) {
+ *client_p = client = (Client *) malloc(sizeof(Client));
+ if (!client)
+ return ENOMEM;
+ memset(&client->addr, 0, sizeof(struct sockaddr_in));
#ifdef KERBEROS
- (void) memset((caddr_t) &(*client)->zct_cblock, 0,
- sizeof((*client)->zct_cblock));
+ memset(&client->session_key, 0, sizeof(client->session_key));
#endif
- (*client)->zct_sin.sin_addr.s_addr = who->sin_addr.s_addr;
- (*client)->zct_sin.sin_port = notice->z_port;
- (*client)->zct_sin.sin_family = AF_INET;
- (*client)->zct_subs = NULLZST;
- (*client)->zct_principal = make_zstring(notice->z_sender,0);
-
- /* chain him in to the clients list in the host list*/
-
- START_CRITICAL_CODE;
-
- xinsque(clist, hlp2->zh_clients);
-
- END_CRITICAL_CODE;
-
- if (!server->zs_dumping && wantdefaults)
- /* add default subscriptions only if this is not
- resulting from a brain dump, AND this request
- wants defaults */
- return(subscr_def_subs(*client));
- else
- return(ZERR_NONE);
+ client->last_msg = 0;
+ client->last_send = 0;
+ client->addr.sin_family = AF_INET;
+ client->addr.sin_addr.s_addr = host->s_addr;
+ client->addr.sin_port = notice->z_port;
+ client->subs = NULL;
+ client->realm = NULL;
+ client->principal = make_string(notice->z_sender, 0);
+ LIST_INSERT(&client_bucket[INET_HASH(&client->addr.sin_addr,
+ notice->z_port)], client);
+ }
+
+ /* Add default subscriptions only if this is not resulting from a brain
+ * dump, AND this request wants defaults. */
+ if (!bdumping && wantdefaults)
+ return subscr_def_subs(client);
+ else
+ return ZERR_NONE;
}
/*
@@ -147,81 +117,73 @@ client_register(notice, who, client, server, wantdefaults)
*/
void
-client_deregister(client, host, flush)
- ZClient_t *client;
- ZHostList_t *host;
- int flush;
+client_deregister(client, flush)
+ Client *client;
+ int flush;
+{
+ LIST_DELETE(client);
+ nack_release(client);
+ subscr_cancel_client(client);
+ free_string(client->principal);
+ if (flush)
+ uloc_flush_client(&client->addr);
+ free(client);
+}
+
+void
+client_flush_host(host)
+ struct in_addr *host;
{
- ZClientList_t *clients;
-
- START_CRITICAL_CODE;
-
- /* release any not-acked packets in the rexmit queue */
- nack_release(client);
-
- /* release subscriptions */
- (void) subscr_cancel_client(client);
-
- if (flush)
- /* release locations if this is a punted client */
- (void) uloc_flush_client(&client->zct_sin);
-
- /* unthread and release this client */
-
- if (host->zh_clients)
- for (clients = host->zh_clients->q_forw;
- clients != host->zh_clients;
- clients = clients->q_forw)
- if (clients->zclt_client == client) {
- xremque(clients);
- free_zstring(client->zct_principal);
- xfree(client);
- xfree(clients);
- END_CRITICAL_CODE;
- return;
- }
- syslog(LOG_CRIT, "clt_dereg: clt not in host list");
- abort();
- /*NOTREACHED*/
+ int i;
+ Client *client, *next;
+
+ for (i = 0; i < HASHSIZE; i++) {
+ for (client = client_bucket[i]; client; client = next) {
+ next = client->next;
+ if (client->addr.sin_addr.s_addr == host->s_addr)
+ client_deregister(client, 1);
+ }
+ }
+ uloc_hflush(host);
}
/*
* find the client which sent the notice
*/
-ZClient_t *
-client_which_client(who, notice)
- struct sockaddr_in *who;
- ZNotice_t *notice;
+Client *
+client_which_client(host, notice)
+ struct in_addr *host;
+ ZNotice_t *notice;
{
- register ZHostList_t *hlt;
- register ZClientList_t *clients;
+ return client_find(host, notice->z_port);
+}
- if (!(hlt = hostm_find_host(&who->sin_addr))) {
-#if 0
- zdbug((LOG_DEBUG,"cl_wh_clt: host not found"));
-#endif
- return(NULLZCNT);
+Code_t
+client_send_clients()
+{
+ int i;
+ Client *client;
+ Code_t retval;
+
+ for (i = 0; i < HASHSIZE; i++) {
+ /* Allow packets to be processed between rows of the hash table. */
+ if (packets_waiting()) {
+ bdumping = 0;
+ bdump_concurrent = 1;
+ handle_packet();
+ bdump_concurrent = 0;
+ bdumping = 1;
}
-
- if (!hlt->zh_clients) {
-#if 1
- zdbug((LOG_DEBUG,"cl_wh_clt: no clients"));
-#endif
- return(NULLZCNT);
+ for (client = client_bucket[i]; client; client = client->next) {
+ if (client->subs) {
+ retval = subscr_send_subs(client);
+ if (retval != ZERR_NONE)
+ return retval;
+ }
}
-
- for (clients = hlt->zh_clients->q_forw;
- clients != hlt->zh_clients;
- clients = clients->q_forw)
- if (clients->zclt_client->zct_sin.sin_port == notice->z_port) {
- return(clients->zclt_client);
- }
-
-#if 1
- zdbug((LOG_DEBUG, "cl_wh_clt: no port"));
-#endif
- return(NULLZCNT);
+ }
+ return ZERR_NONE;
}
/*
@@ -231,17 +193,35 @@ client_which_client(who, notice)
*/
void
-client_dump_clients(fp, clist)
- FILE *fp;
- ZClientList_t *clist;
+client_dump_clients(fp)
+ FILE *fp;
{
- register ZClientList_t *ptr;
-
- for (ptr = clist->q_forw; ptr != clist; ptr = ptr->q_forw) {
- (void) fprintf(fp, "\t%d (%s):\n",
- ntohs(ptr->zclt_client->zct_sin.sin_port),
- ptr->zclt_client->zct_principal->string);
- subscr_dump_subs(fp, ptr->zclt_client->zct_subs);
+ Client *client;
+ int i;
+
+ for (i = 0; i < HASHSIZE; i++) {
+ for (client = client_bucket[i]; client; client = client->next) {
+ fprintf(fp, "\t%d (%s):\n", ntohs(client->addr.sin_port),
+ client->principal->string);
+ subscr_dump_subs(fp, client->subs);
}
- return;
+ }
}
+
+static Client *
+client_find(host, port)
+ struct in_addr *host;
+ unsigned int port;
+{
+ Client *client;
+ long hashval;
+
+ hashval = INET_HASH(host, port);
+ for (client = client_bucket[hashval]; client; client = client->next) {
+ if (client->addr.sin_addr.s_addr == host->s_addr
+ && client->addr.sin_port == port)
+ return client;
+ }
+ return NULL;
+}
+
diff --git a/server/common.c b/server/common.c
index 87585b9..bff30a9 100644
--- a/server/common.c
+++ b/server/common.c
@@ -12,90 +12,78 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
#ifndef lint
#ifndef SABER
-static char rcsid_common_c[] =
+static const char rcsid_common_c[] =
"$Id$";
#endif /* SABER */
#endif /* lint */
-#include <zephyr/zephyr.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <syslog.h>
-#include <string.h>
-#include "unix.h"
-
/* common routines for the server */
-/* copy the string into newly allocated area */
+/* copy a string into a newly allocated area */
char *
-#ifdef __STDC__
-strsave (Zconst char *sp)
-#else
strsave (sp)
- Zconst char *sp;
-#endif
+ const char *sp;
{
- register char *ret;
+ char *ret;
- if((ret = (char *) xmalloc((unsigned) strlen(sp)+1)) == NULL) {
- syslog(LOG_ERR, "no mem strdup'ing");
- abort();
+ ret = (char *) malloc(strlen(sp) + 1);
+ if (!ret) {
+ syslog(LOG_CRIT, "no mem strdup'ing");
+ abort();
}
- (void) strcpy(ret,sp);
- return(ret);
+ strcpy(ret, sp);
+ return ret;
}
/* The "& 0x5f" provides case-insensitivity for ASCII. */
unsigned long
-#ifdef __STDC__
-hash (Zconst char *string)
-#else
-hash (string)
- Zconst char *string;
-#endif
+hash(string)
+ const char *string;
{
- register unsigned long hval = 0;
- register char cp;
-
- while (1) {
- cp = *string++;
- if (!cp)
- break;
- hval += cp & 0x5f;
-
- cp = *string++;
- if (!cp)
- break;
- hval += (cp & 0x5f) * (3 + (1 << 16));
-
- cp = *string++;
- if (!cp)
- break;
- hval += (cp & 0x5f) * (1 + (1 << 8));
-
- cp = *string++;
- if (!cp)
- break;
- hval += (cp & 0x5f) * (1 + (1 << 12));
-
- cp = *string++;
- if (!cp)
- break;
- hval += (cp & 0x5f) * (1 + (1 << 4));
-
- hval += ((long) hval) >> 18;
- }
- hval &= 0x7fffffff;
- return hval;
+ unsigned long hval = 0;
+ char cp;
+
+ while (1) {
+ cp = *string++;
+ if (!cp)
+ break;
+ hval += cp & 0x5f;
+
+ cp = *string++;
+ if (!cp)
+ break;
+ hval += (cp & 0x5f) * (3 + (1 << 16));
+
+ cp = *string++;
+ if (!cp)
+ break;
+ hval += (cp & 0x5f) * (1 + (1 << 8));
+
+ cp = *string++;
+ if (!cp)
+ break;
+ hval += (cp & 0x5f) * (1 + (1 << 12));
+
+ cp = *string++;
+ if (!cp)
+ break;
+ hval += (cp & 0x5f) * (1 + (1 << 4));
+
+ hval += ((long) hval) >> 18;
+ }
+
+ hval &= 0x7fffffff;
+ return hval;
}
/* Output a name, replacing newlines with \n and single quotes with \q. */
-void subscr_quote(p, fp)
+void dump_quote(p, fp)
char *p;
FILE *fp;
{
diff --git a/server/dispatch.c b/server/dispatch.c
index 2c2fb16..fed2336 100644
--- a/server/dispatch.c
+++ b/server/dispatch.c
@@ -12,21 +12,28 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
+#include <sys/socket.h>
#ifndef lint
#ifndef SABER
-static char rcsid_dispatch_c[] =
- "$Id$";
+static const char rcsid_dispatch_c[] =
+"$Id$";
#endif
#endif
-#include "zserver.h"
-#include <sys/socket.h>
+#define NACKTAB_HASHSIZE 1023
+#define NACKTAB_HASHVAL(sockaddr, uid) (((sockaddr).sin_addr.s_addr ^ \
+ (sockaddr).sin_port ^ \
+ (uid).zuid_addr.s_addr ^ \
+ (uid).tv.tv_sec ^ \
+ (uid).tv.tv_usec) % NACKTAB_HASHSIZE)
+#define HOSTS_SIZE_INIT 256
#ifdef DEBUG
-Zconst char *ZNoticeKinds[9] = {"UNSAFE", "UNACKED", "ACKED", "HMACK",
- "HMCTL", "SERVACK", "SERVNAK", "CLIENTACK",
- "STAT"};
+ZCONST char *ZNoticeKinds[9] = {"UNSAFE", "UNACKED", "ACKED", "HMACK",
+ "HMCTL", "SERVACK", "SERVNAK", "CLIENTACK",
+ "STAT"};
#endif
/*
*
@@ -40,10 +47,10 @@ Zconst char *ZNoticeKinds[9] = {"UNSAFE", "UNACKED", "ACKED", "HMACK",
* void clt_ack(notice, who, sent)
* ZNotice_t *notice;
* struct sockaddr_in *who;
- * ZSentType sent;
+ * Sent_type sent;
*
* void nack_release(client)
- * ZClient_t *client;
+ * Client *client;
*
* void sendit(notice, auth, who)
* ZNotice_t *notice;
@@ -54,69 +61,59 @@ Zconst char *ZNoticeKinds[9] = {"UNSAFE", "UNACKED", "ACKED", "HMACK",
* ZNotice_t *notice;
* struct sockaddr_in *dest;
* int auth;
- * ZClient_t *client;
+ * Client *client;
*/
-/* patchable magic numbers controlling the retransmission rate and count */
-int num_rexmits = NUM_REXMITS;
-long rexmit_secs = REXMIT_SECS;
-long abs_timo = REXMIT_SECS*NUM_REXMITS + 10;
+String *class_control, *class_admin, *class_hm, *class_ulogin, *class_ulocate;
-ZSTRING *class_control, *class_admin, *class_hm, *class_ulogin,
- *class_ulocate;
+int rexmit_times[] = REXMIT_TIMES;
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static void nack_cancel P((register ZNotice_t *, struct sockaddr_in *));
-static void dispatch P((ZNotice_t *, int, struct sockaddr_in *, int));
-static int send_to_dest P((ZNotice_t *, int, ZDestination *dest, int));
+static void nack_cancel __P((ZNotice_t *, struct sockaddr_in *));
+static void dispatch __P((ZNotice_t *, int, struct sockaddr_in *, int));
+static int send_to_dest __P((ZNotice_t *, int, Destination *dest, int, int));
+static void hostm_deathgram __P((struct sockaddr_in *, Server *));
+static char *hm_recipient __P((void));
-#undef P
+Statistic realm_notices = {0, "inter-realm notices"};
+Statistic interserver_notices = {0, "inter-server notices"};
+Statistic hm_packets = {0, "hostmanager packets"};
+Statistic control_notices = {0, "client control notices"};
+Statistic message_notices = {0, "message notices"};
+Statistic login_notices = {0, "login notices"};
+Statistic i_s_ctls = {0, "inter-server control notices"};
+Statistic i_s_logins = {0, "inter-server login notices"};
+Statistic i_s_admins = {0, "inter-server admin notices"};
+Statistic i_s_locates = {0, "inter-server locate notices"};
+Statistic locate_notices = {0, "locate notices"};
+Statistic admin_notices = {0, "admin notices"};
-ZStatistic interserver_notices = {0, "inter-server notices"};
-ZStatistic hm_packets = {0, "hostmanager packets"};
-ZStatistic control_notices = {0, "client control notices"};
-ZStatistic message_notices = {0, "message notices"};
-ZStatistic login_notices = {0, "login notices"};
-ZStatistic i_s_ctls = {0, "inter-server control notices"};
-ZStatistic i_s_logins = {0, "inter-server login notices"};
-ZStatistic i_s_admins = {0, "inter-server admin notices"};
-ZStatistic i_s_locates = {0, "inter-server locate notices"};
-ZStatistic locate_notices = {0, "locate notices"};
-ZStatistic admin_notices = {0, "admin notices"};
+static Unacked *nacktab[NACKTAB_HASHSIZE];
+static struct in_addr *hosts;
+static int hosts_size = 0, num_hosts = 0;
static void
-#ifdef __STDC__
-dump_stats (void *arg)
-#else
dump_stats (arg)
-void *arg;
-#endif
+ void *arg;
{
- syslog(LOG_INFO, "stats: %s: %d", hm_packets.str, hm_packets.val);
- syslog(LOG_INFO, "stats: %s: %d", control_notices.str,
- control_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", message_notices.str,
- message_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", login_notices.str,
- login_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", locate_notices.str,
- locate_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", admin_notices.str,
- admin_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", interserver_notices.str,
- interserver_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", i_s_ctls.str, i_s_ctls.val);
- syslog(LOG_INFO, "stats: %s: %d", i_s_logins.str, i_s_logins.val);
- syslog(LOG_INFO, "stats: %s: %d", i_s_admins.str, i_s_admins.val);
- syslog(LOG_INFO, "stats: %s: %d", i_s_locates.str, i_s_locates.val);
- /* log stuff once an hour */
- (void) timer_set_rel ((long) 6*60*60, dump_stats, arg);
+ syslog(LOG_INFO, "stats: %s: %d", hm_packets.str, hm_packets.val);
+ syslog(LOG_INFO, "stats: %s: %d", control_notices.str,
+ control_notices.val);
+ syslog(LOG_INFO, "stats: %s: %d", message_notices.str,
+ message_notices.val);
+ syslog(LOG_INFO, "stats: %s: %d", login_notices.str, login_notices.val);
+ syslog(LOG_INFO, "stats: %s: %d", locate_notices.str, locate_notices.val);
+ syslog(LOG_INFO, "stats: %s: %d", admin_notices.str, admin_notices.val);
+ syslog(LOG_INFO, "stats: %s: %d", realm_notices.str, realm_notices.val);
+ syslog(LOG_INFO, "stats: %s: %d", interserver_notices.str,
+ interserver_notices.val);
+ syslog(LOG_INFO, "stats: %s: %d", i_s_ctls.str, i_s_ctls.val);
+ syslog(LOG_INFO, "stats: %s: %d", i_s_logins.str, i_s_logins.val);
+ syslog(LOG_INFO, "stats: %s: %d", i_s_admins.str, i_s_admins.val);
+ syslog(LOG_INFO, "stats: %s: %d", i_s_locates.str, i_s_locates.val);
+
+ /* log stuff once an hour */
+ timer_set_rel ((long) 6*60*60, dump_stats, arg);
}
/*
@@ -127,123 +124,104 @@ void *arg;
void
handle_packet()
{
- Code_t status;
- ZPacket_t input_packet; /* from the network */
- ZNotice_t new_notice; /* parsed from input_packet */
- int input_len; /* len of packet */
- struct sockaddr_in input_sin; /* Zconstructed for authent */
- struct sockaddr_in whoisit; /* for holding peer's address */
- int authentic; /* authentic flag */
- ZSrvPending_t *pending; /* pending packet */
- ZHostList_t *host; /* host ptr */
- int from_server; /* packet is from another server */
+ Code_t status;
+ ZPacket_t input_packet; /* from the network */
+ ZNotice_t new_notice; /* parsed from input_packet */
+ int input_len; /* len of packet */
+ struct sockaddr_in input_sin; /* Zconstructed for authent */
+ struct sockaddr_in whoisit; /* for holding peer's address */
+ int authentic; /* authentic flag */
+ Pending *pending; /* pending packet */
+ int from_server; /* packet is from another server */
+ Realm *realm; /* foreign realm ptr */
#ifdef DEBUG
- static int first_time = 1;
+ static int first_time = 1;
#endif
#ifdef DEBUG
- /* Dump statistics five minutes after startup */
- if (first_time) {
- first_time = 0;
- (void) timer_set_rel (5*60, dump_stats, (void *) 0);
- }
-#endif
- /* handle traffic */
-
- if (otherservers[me_server_idx].zs_update_queue) {
- /* something here for me; take care of it */
-#if 1
- zdbug((LOG_DEBUG, "internal queue process"));
+ /* Dump statistics five minutes after startup */
+ if (first_time) {
+ first_time = 0;
+ timer_set_rel(5*60, dump_stats, NULL);
+ }
#endif
+ /* handle traffic */
- pending = otherservers[me_server_idx].zs_update_queue->q_forw;
- host = hostm_find_host(&(pending->pend_who.sin_addr));
- if (host && host->zh_locked) {
- /* can't deal with it now. to preserve ordering,
- we can't process other packets, esp. since we
- may block since we don't really know if there
- are things in the real queue. */
+ if (otherservers[me_server_idx].queue) {
+ /* something here for me; take care of it */
#if 1
- zdbug((LOG_DEBUG,"host %s is locked",
- inet_ntoa(host->zh_addr.sin_addr)));
+ zdbug((LOG_DEBUG, "internal queue process"));
#endif
- return;
- }
- pending = server_dequeue(me_server); /* we can do it, remove */
-
- if ((status = ZParseNotice(pending->pend_packet,
- pending->pend_len,
- &new_notice)) != ZERR_NONE) {
- syslog(LOG_ERR,
- "bad notice parse (%s): %s",
- inet_ntoa(pending->pend_who.sin_addr),
- error_message(status));
- } else
- dispatch(&new_notice, pending->pend_auth,
- &pending->pend_who, 1);
- server_pending_free(pending);
- return;
- }
- /*
- * nothing in internal queue, go to the external library
- * queue/socket
- */
- if ((status = ZReceivePacket(input_packet,
- &input_len,
- &whoisit)) != ZERR_NONE) {
- syslog(LOG_ERR,
- "bad packet receive: %s from %s",
- error_message(status), inet_ntoa(whoisit.sin_addr));
- return;
- }
- npackets++;
- if ((status = ZParseNotice(input_packet,
- input_len,
- &new_notice)) != ZERR_NONE) {
- syslog(LOG_ERR,
- "bad notice parse (%s): %s",
- inet_ntoa(whoisit.sin_addr),
- error_message(status));
- return;
- }
- if (server_which_server(&whoisit)) {
- /* we need to parse twice--once to get
- the source addr, second to check
- authentication */
- (void) memset((caddr_t) &input_sin, 0,
- sizeof(input_sin));
- input_sin.sin_addr.s_addr = new_notice.z_sender_addr.s_addr;
- input_sin.sin_port = new_notice.z_port;
- input_sin.sin_family = AF_INET;
- authentic = ZCheckAuthentication(&new_notice, &input_sin);
- from_server = 1;
+
+ pending = server_dequeue(me_server);
+
+ status = ZParseNotice(pending->packet, pending->len, &new_notice);
+ if (status != ZERR_NONE) {
+ syslog(LOG_ERR, "bad notice parse (%s): %s",
+ inet_ntoa(pending->who.sin_addr), error_message(status));
} else {
- from_server = 0;
- authentic = ZCheckAuthentication(&new_notice, &whoisit);
+ dispatch(&new_notice, pending->auth, &pending->who, 1);
}
- switch (authentic) {
- case ZAUTH_YES:
- authentic = 1;
- break;
- case ZAUTH_FAILED:
- case ZAUTH_NO:
- default:
- authentic = 0;
- break;
+ server_pending_free(pending);
+ return;
+ }
+
+ /*
+ * nothing in internal queue, go to the external library
+ * queue/socket
+ */
+ status = ZReceivePacket(input_packet, &input_len, &whoisit);
+ if (status != ZERR_NONE) {
+ syslog(LOG_ERR, "bad packet receive: %s from %s",
+ error_message(status), inet_ntoa(whoisit.sin_addr));
+ return;
+ }
+ npackets++;
+ status = ZParseNotice(input_packet, input_len, &new_notice);
+ if (status != ZERR_NONE) {
+ syslog(LOG_ERR, "bad notice parse (%s): %s",
+ inet_ntoa(whoisit.sin_addr), error_message(status));
+ return;
+ }
+ if (server_which_server(&whoisit)) {
+ /* we need to parse twice--once to get
+ the source addr, second to check
+ authentication */
+ memset(&input_sin, 0, sizeof(input_sin));
+ input_sin.sin_addr.s_addr = new_notice.z_sender_addr.s_addr;
+ input_sin.sin_port = new_notice.z_port;
+ input_sin.sin_family = AF_INET;
+ realm = realm_which_realm(&input_sin);
+ if (realm) {
+ authentic = ZCheckRealmAuthentication(&new_notice, &input_sin,
+ realm->name);
+ } else {
+ authentic = ZCheckAuthentication(&new_notice, &input_sin);
}
- if (whoisit.sin_port != hm_port &&
- strcasecmp (new_notice.z_class,ZEPHYR_ADMIN_CLASS) &&
- whoisit.sin_port != sock_sin.sin_port &&
- new_notice.z_kind != CLIENTACK) {
- syslog(LOG_ERR,
- "bad port %s/%d",
- inet_ntoa(whoisit.sin_addr),
- ntohs(whoisit.sin_port));
- return;
+ from_server = 1;
+ } else {
+ from_server = 0;
+ realm = realm_which_realm(&whoisit);
+ if (realm) {
+ authentic = ZCheckRealmAuthentication(&new_notice, &whoisit,
+ realm->name);
+ } else {
+ authentic = ZCheckAuthentication(&new_notice, &whoisit);
}
- message_notices.val++;
- dispatch(&new_notice, authentic, &whoisit, from_server);
+ }
+
+ if (whoisit.sin_port != hm_port && whoisit.sin_port != hm_srv_port &&
+ strcasecmp(new_notice.z_class, ZEPHYR_ADMIN_CLASS) != 0 &&
+ whoisit.sin_port != srv_addr.sin_port &&
+ new_notice.z_kind != CLIENTACK) {
+ syslog(LOG_ERR, "bad port %s/%d", inet_ntoa(whoisit.sin_addr),
+ ntohs(whoisit.sin_port));
return;
+ }
+
+ message_notices.val++;
+ dispatch(&new_notice, authentic, &whoisit, from_server);
+ return;
}
/*
* Dispatch a notice.
@@ -251,88 +229,110 @@ handle_packet()
static void
dispatch(notice, auth, who, from_server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- int from_server;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ int from_server;
{
- Code_t status;
- ZSTRING *notice_class;
- struct sockaddr_in who2;
+ Code_t status;
+ String *notice_class;
+ struct sockaddr_in who2;
+ int authflag;
+ Realm *realm;
+ char *cp;
#ifdef DEBUG
- char dbg_buf[BUFSIZ];
+ char dbg_buf[BUFSIZ];
#endif
- if ((int) notice->z_kind < (int) UNSAFE ||
- (int) notice->z_kind > (int) CLIENTACK) {
- syslog(LOG_NOTICE, "bad notice kind 0x%x from %s",
- (int) notice->z_kind,
- inet_ntoa(who->sin_addr));
- return;
- }
+ /* Set "authflag" to 1 or 0 for handler functions. Treat
+ * ZAUTH_CKSUM_FAILED as authentic except for sendit(), which is
+ * handled below. */
+ switch (auth) {
+ case ZAUTH_YES:
+ case ZAUTH_CKSUM_FAILED:
+ authflag = 1;
+ break;
+ case ZAUTH_FAILED:
+ case ZAUTH_NO:
+ default:
+ authflag = 0;
+ break;
+ }
+
+ if ((int) notice->z_kind < (int) UNSAFE ||
+ (int) notice->z_kind > (int) CLIENTACK) {
+ syslog(LOG_NOTICE, "bad notice kind 0x%x from %s", notice->z_kind,
+ inet_ntoa(who->sin_addr));
+ return;
+ }
#if 0
- if (zdebug) {
- (void) sprintf (dbg_buf,
- "disp:%s '%s' '%s' '%s' notice to '%s' from '%s' %s/%d/%d",
- ZNoticeKinds[(int) notice->z_kind],
- notice->z_class,
- notice->z_class_inst,
- notice->z_opcode,
- notice->z_recipient,
- notice->z_sender,
- inet_ntoa(who->sin_addr),
- ntohs(who->sin_port),
- ntohs(notice->z_port));
- syslog (LOG_DEBUG, "%s", dbg_buf);
- }
+ if (zdebug) {
+ sprintf(dbg_buf,
+ "disp:%s '%s' '%s' '%s' notice to '%s' from '%s' %s/%d/%d",
+ ZNoticeKinds[(int) notice->z_kind], notice->z_class,
+ notice->z_class_inst, notice->z_opcode, notice->z_recipient,
+ notice->z_sender, inet_ntoa(who->sin_addr),
+ ntohs(who->sin_port), ntohs(notice->z_port));
+ syslog(LOG_DEBUG, "%s", dbg_buf);
+ }
#endif
- if (notice->z_kind == CLIENTACK) {
- nack_cancel(notice, who);
- return;
- }
+ if (notice->z_kind == CLIENTACK) {
+ nack_cancel(notice, who);
+ return;
+ }
- who2 = *who;
+ who2 = *who;
#if 0
- if (0 && from_server) {
- /* incorporate server_dispatch here */
- }
+ if (0 && from_server) {
+ /* incorporate server_dispatch here */
+ }
#endif
- notice_class = make_zstring(notice->z_class,1);
-
- if (from_server) {
- interserver_notices.val++;
- status = server_dispatch(notice, auth, who);
- } else if (class_is_hm(notice_class)) {
- hm_packets.val++;
- status = hostm_dispatch(notice, auth, who, me_server);
- } else if (class_is_control(notice_class)) {
- control_notices.val++;
- status = control_dispatch(notice, auth, who, me_server);
- } else if (class_is_ulogin(notice_class)) {
- login_notices.val++;
- status = ulogin_dispatch(notice, auth, who, me_server);
- } else if (class_is_ulocate(notice_class)) {
- locate_notices.val++;
- status = ulocate_dispatch(notice, auth, who, me_server);
- } else if (class_is_admin(notice_class)) {
- admin_notices.val++;
- status = server_adispatch(notice, auth, who, me_server);
+ notice_class = make_string(notice->z_class,1);
+
+ if (from_server) {
+ interserver_notices.val++;
+ status = server_dispatch(notice, authflag, who);
+ } else if (class_is_hm(notice_class)) {
+ hm_packets.val++;
+ status = hostm_dispatch(notice, authflag, who, me_server);
+ } else if (realm_which_realm(who) && !(class_is_admin(notice_class))) {
+ realm_notices.val++;
+ status = realm_dispatch(notice, authflag, who, me_server);
+ } else if (class_is_control(notice_class)) {
+ control_notices.val++;
+ status = control_dispatch(notice, authflag, who, me_server);
+ } else if (class_is_ulogin(notice_class)) {
+ login_notices.val++;
+ status = ulogin_dispatch(notice, authflag, who, me_server);
+ } else if (class_is_ulocate(notice_class)) {
+ locate_notices.val++;
+ status = ulocate_dispatch(notice, authflag, who, me_server);
+ } else if (class_is_admin(notice_class)) {
+ admin_notices.val++;
+ status = server_adispatch(notice, authflag, who, me_server);
+ } else {
+ if (auth == ZAUTH_CKSUM_FAILED)
+ authflag = 0;
+ if (!bound_for_local_realm(notice)) {
+ cp = strchr(notice->z_recipient, '@');
+ if (!cp ||
+ !(realm = realm_get_realm_by_name(realm_expand_realm(cp + 1))))
+ sendit(notice, authflag, who, 0);
+ else
+ realm_handoff(notice, authflag, who, realm, 1);
} else {
- sendit (notice, auth, who);
- free_zstring(notice_class);
- return;
+ if (notice->z_recipient[0] == '@')
+ notice->z_recipient = "";
+ sendit(notice, authflag, who, 1);
}
+ free_string(notice_class);
+ return;
+ }
- if (status == ZSRV_REQUEUE) {
-#ifdef CONCURRENT
- server_self_queue(notice, auth, who);
-#else
- syslog(LOG_ERR, "requeue while not concurr");
- abort();
-#endif
- }
- free_zstring(notice_class);
+ if (status == ZSRV_REQUEUE)
+ server_self_queue(notice, authflag, who);
+ free_string(notice_class);
}
/*
@@ -340,101 +340,113 @@ dispatch(notice, auth, who, from_server)
*/
void
-sendit(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+sendit(notice, auth, who, external)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ int external;
{
- static int send_counter = 0;
- int any = 0;
- ZAcl_t *acl;
- ZDestination dest;
- ZSTRING *class;
-
- class = make_zstring(notice->z_class,1);
- if ((acl = class_get_acl(class)) != NULLZACLT) {
- /* if controlled and not auth, fail */
- if (!auth) {
- syslog(LOG_WARNING, "sendit unauthentic %s from %s",
- notice->z_class, notice->z_sender);
- clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
- return;
- }
- /* if not auth to transmit, fail */
- if (!access_check(notice->z_sender, acl, TRANSMIT)) {
- syslog(LOG_WARNING, "sendit unauthorized %s from %s",
- notice->z_class, notice->z_sender);
- clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
- return;
- }
- /* sender != inst and not auth to send to others --> fail */
- if ((strcmp (notice->z_sender, notice->z_class_inst)) &&
- (!access_check(notice->z_sender, acl, INSTUID))) {
- syslog(LOG_WARNING,
- "sendit unauth uid %s %s.%s",
- notice->z_sender,
- notice->z_class,
- notice->z_class_inst);
+ static int send_counter = 0;
+ char recipbuf[ANAME_SZ + INST_SZ + REALM_SZ + 3], *recipp;
+ int any = 0;
+ Acl *acl;
+ Destination dest;
+ String *class;
+
+ class = make_string(notice->z_class, 1);
+ acl = class_get_acl(class);
+ if (acl != NULL) {
+ /* if controlled and not auth, fail */
+ if (!auth) {
+ syslog(LOG_WARNING, "sendit unauthentic %s from %s",
+ notice->z_class, notice->z_sender);
clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
+ free_string(class);
return;
- }
}
+ /* if not auth to transmit, fail */
+ if (!access_check(notice->z_sender, acl, TRANSMIT)) {
+ syslog(LOG_WARNING, "sendit unauthorized %s from %s",
+ notice->z_class, notice->z_sender);
+ clt_ack(notice, who, AUTH_FAILED);
+ free_string(class);
+ return;
+ }
+ /* sender != inst and not auth to send to others --> fail */
+ if (strcmp(notice->z_sender, notice->z_class_inst) != 0 &&
+ !access_check(notice->z_sender, acl, INSTUID)) {
+ syslog(LOG_WARNING, "sendit unauth uid %s %s.%s", notice->z_sender,
+ notice->z_class, notice->z_class_inst);
+ clt_ack(notice, who, AUTH_FAILED);
+ free_string(class);
+ return;
+ }
+ }
+ if (!realm_which_realm(who)) {
if (memcmp(&notice->z_sender_addr.s_addr, &who->sin_addr.s_addr,
sizeof(notice->z_sender_addr.s_addr))) {
/* someone is playing games... */
/* inet_ntoa returns pointer to static area */
/* max size is 255.255.255.255 */
char buffer[16];
- (void) strcpy(buffer, inet_ntoa(who->sin_addr));
+ strcpy(buffer, inet_ntoa(who->sin_addr));
if (!auth) {
- syslog(LOG_WARNING, "sendit unauthentic fake packet: claimed %s, real %s",
+ syslog(LOG_WARNING,
+ "sendit unauthentic fake packet: claimed %s, real %s",
inet_ntoa(notice->z_sender_addr), buffer);
clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
+ free_string(class);
return;
}
if (ntohl(notice->z_sender_addr.s_addr) != 0) {
- syslog(LOG_WARNING, "sendit invalid address: claimed %s, real %s",
+ syslog(LOG_WARNING,
+ "sendit invalid address: claimed %s, real %s",
inet_ntoa(notice->z_sender_addr), buffer);
clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
+ free_string(class);
return;
}
syslog(LOG_WARNING, "sendit addr mismatch: claimed %s, real %s",
inet_ntoa(notice->z_sender_addr), buffer);
}
-
- /* Increment the send counter, used to prevent duplicate sends to
- * clients. On the off-chance that we wrap around to 0, skip over
- * it to prevent missing clients which have never had a packet
- * sent to them. */
- send_counter++;
- if (send_counter == 0)
- send_counter = 1;
-
- /* Send to clients subscribed to the triplet itself. */
- dest.classname = class;
- dest.inst = make_zstring(notice->z_class_inst, 1);
- dest.recip = make_zstring(notice->z_recipient, 0);
- if (send_to_dest(notice, auth, &dest, send_counter))
- any = 1;
-
- /* Send to clients subscribed to the triplet with the instance
- * substituted with the wildcard instance. */
- free_zstring(dest.inst);
- dest.inst = wildcard_instance;
- if (send_to_dest(notice, auth, &dest, send_counter))
- any = 1;
-
- free_zstring(class);
- free_zstring(dest.recip);
- if (any)
- ack(notice, who);
- else
- nack(notice, who);
+ }
+
+ /* Increment the send counter, used to prevent duplicate sends to
+ * clients. On the off-chance that we wrap around to 0, skip over
+ * it to prevent missing clients which have never had a packet
+ * sent to them. */
+ send_counter++;
+ if (send_counter == 0)
+ send_counter = 1;
+
+ /* Send to clients subscribed to the triplet itself. */
+ dest.classname = class;
+ dest.inst = make_string(notice->z_class_inst, 1);
+ if (bound_for_local_realm(notice) && *notice->z_recipient == '@') {
+ dest.recip = make_string("", 0);
+ } else {
+ strncpy(recipbuf, notice->z_recipient, sizeof(recipbuf));
+ recipp = strrchr(&recipbuf, '@');
+ if (recipp)
+ sprintf(recipp + 1, "%s", realm_expand_realm(recipp + 1));
+ dest.recip = make_string(recipbuf, 0);
+ }
+ if (send_to_dest(notice, auth, &dest, send_counter, external))
+ any = 1;
+
+ /* Send to clients subscribed to the triplet with the instance
+ * substituted with the wildcard instance. */
+ free_string(dest.inst);
+ dest.inst = wildcard_instance;
+ if (send_to_dest(notice, auth, &dest, send_counter, external))
+ any = 1;
+
+ free_string(class);
+ free_string(dest.recip);
+ if (any)
+ ack(notice, who);
+ else
+ nack(notice, who);
}
/*
@@ -444,59 +456,59 @@ sendit(notice, auth, who)
*/
static int
-send_to_dest(notice, auth, dest, send_counter)
- ZNotice_t *notice;
- int auth;
- ZDestination *dest;
- int send_counter;
+send_to_dest(notice, auth, dest, send_counter, external)
+ ZNotice_t *notice;
+ int auth;
+ Destination *dest;
+ int send_counter;
+ int external;
{
- register ZClientList_t *list, *p;
- register ZClient_t *client;
- register int any = 0;
-
- list = triplet_lookup(dest);
- if (list != NULLZCLT) {
- for (p = list->q_forw; p != list; p = p->q_forw) {
- client = p->zclt_client;
- if (client->last_send == send_counter)
- continue;
- client->last_send = send_counter;
- xmit(notice, &(client->zct_sin), auth, client);
- any = 1;
- }
- }
- return any;
+ Client **clientp;
+ int any = 0;
+
+ clientp = triplet_lookup(dest);
+ if (!clientp)
+ return 0;
+
+ for (; *clientp; clientp++) {
+ if ((*clientp)->last_send == send_counter)
+ continue;
+ (*clientp)->last_send = send_counter;
+ if ((*clientp)->realm && external)
+ realm_handoff(notice, auth, &clientp[0]->addr, clientp[0]->realm,
+ 1);
+ else
+ xmit(notice, &((*clientp)->addr), auth, *clientp);
+ any = 1;
+ }
+
+ return any;
}
/*
- * Clean up the not-yet-acked queue and release anything destined
- * for the client.
+ * Release anything destined for the client in the not-yet-acked table.
*/
void
nack_release(client)
- ZClient_t *client;
+ Client *client;
{
- register ZNotAcked_t *nacked, *nack2;
-
- /* search the not-yet-acked list for anything destined to him, and
- flush it. */
- for (nacked = nacklist->q_forw;
- nacked != nacklist;)
- if ((nacked->na_addr.sin_addr.s_addr == client->zct_sin.sin_addr.s_addr) &&
- (nacked->na_addr.sin_port == client->zct_sin.sin_port)) {
- /* go back, since remque will change things */
- nack2 = nacked->q_back;
- timer_reset(nacked->na_timer);
- xremque(nacked);
- xfree(nacked->na_packet);
- xfree(nacked);
- /* now that the remque adjusted the linked list,
- we go forward again */
- nacked = nack2->q_forw;
- } else
- nacked = nacked->q_forw;
- return;
+ int i;
+ Unacked *nacked, *next;
+
+ for (i = 0; i < NACKTAB_HASHSIZE; i++) {
+ for (nacked = nacktab[i]; nacked; nacked = next) {
+ next = nacked->next;
+ if (nacked->dest.addr.sin_addr.s_addr ==
+ client->addr.sin_addr.s_addr &&
+ nacked->dest.addr.sin_port == client->addr.sin_port) {
+ timer_reset(nacked->timer);
+ LIST_DELETE(nacked);
+ free(nacked->packet);
+ free(nacked);
+ }
+ }
+ }
}
/*
@@ -508,53 +520,50 @@ nack_release(client)
/*ARGSUSED*/
Code_t
xmit_frag(notice, buf, len, waitforack)
- ZNotice_t *notice;
- char *buf;
- int len;
- int waitforack;
+ ZNotice_t *notice;
+ char *buf;
+ int len;
+ int waitforack;
{
- char *savebuf;
- register ZNotAcked_t *nacked;
- Code_t retval;
-
- if ((retval = ZSendPacket(buf, len, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "xmit_frag send: %s",
- error_message(retval));
- return(retval);
- }
-
- /* now we've sent it, mark it as not ack'ed */
-
- if (!(nacked = (ZNotAcked_t *)xmalloc(sizeof(ZNotAcked_t)))) {
- /* no space: just punt */
- syslog(LOG_WARNING, "xmit_frag nack malloc");
- return(ENOMEM);
- }
-
- if (!(savebuf = (char *)xmalloc(len))) {
- /* no space: just punt */
- syslog(LOG_WARNING, "xmit_frag pack malloc");
- return(ENOMEM);
- }
-
- (void) memcpy(savebuf, buf, len);
-
- nacked->na_rexmits = 0;
- nacked->na_packet = savebuf;
- nacked->na_srv_idx = 0;
- nacked->na_addr = ZGetDestAddr();
- nacked->na_packsz = len;
- nacked->na_uid = notice->z_uid;
- nacked->q_forw = nacked->q_back = nacked;
- nacked->na_abstimo = NOW + abs_timo;
-
- /* set a timer to retransmit when done */
- nacked->na_timer = timer_set_rel(rexmit_secs,
- rexmit,
- (void *) nacked);
- /* chain in */
- xinsque(nacked, nacklist);
- return(ZERR_NONE);
+ struct sockaddr_in sin;
+ char *savebuf;
+ Unacked *nacked;
+ Code_t retval;
+ int hashval;
+
+ retval = ZSendPacket(buf, len, 0);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "xmit_frag send: %s", error_message(retval));
+ return retval;
+ }
+
+ /* now we've sent it, mark it as not ack'ed */
+ nacked = (Unacked *) malloc(sizeof(Unacked));
+ if (!nacked) {
+ /* no space: just punt */
+ syslog(LOG_WARNING, "xmit_frag nack malloc");
+ return ENOMEM;
+ }
+
+ savebuf = (char *) malloc(len);
+ if (!savebuf) {
+ /* no space: just punt */
+ syslog(LOG_WARNING, "xmit_frag pack malloc");
+ free(nacked);
+ return ENOMEM;
+ }
+
+ memcpy(savebuf, buf, len);
+
+ sin = ZGetDestAddr();
+ nacked->rexmits = 0;
+ nacked->packet = savebuf;
+ nacked->dest.addr = sin;
+ nacked->packsz = len;
+ nacked->uid = notice->z_uid;
+ nacked->timer = timer_set_rel(rexmit_times[0], rexmit, nacked);
+ LIST_INSERT(&nacktab[NACKTAB_HASHVAL(sin, nacked->uid)], nacked);
+ return(ZERR_NONE);
}
/*
@@ -564,115 +573,97 @@ xmit_frag(notice, buf, len, waitforack)
void
xmit(notice, dest, auth, client)
- ZNotice_t *notice;
- struct sockaddr_in *dest;
- int auth;
- ZClient_t *client;
+ ZNotice_t *notice;
+ struct sockaddr_in *dest;
+ int auth;
+ Client *client;
{
- caddr_t noticepack;
- register ZNotAcked_t *nacked;
- int packlen;
- Code_t retval;
+ char *noticepack;
+ Unacked *nacked;
+ int packlen;
+ Code_t retval;
#if 0
- zdbug((LOG_DEBUG,"xmit"));
+ zdbug((LOG_DEBUG,"xmit"));
#endif
- if (!(noticepack = (caddr_t) xmalloc(sizeof(ZPacket_t)))) {
- syslog(LOG_ERR, "xmit malloc");
- return; /* DON'T put on nack list */
+ noticepack = (char *) malloc(sizeof(ZPacket_t));
+ if (!noticepack) {
+ syslog(LOG_ERR, "xmit malloc");
+ return; /* DON'T put on nack list */
+ }
+
+ packlen = sizeof(ZPacket_t);
+
+ if (auth && client) { /*
+ we are distributing authentic and
+ we have a pointer to auth info
+ */
+#ifdef ZEPHYR_USES_KERBEROS
+ retval = ZFormatAuthenticNotice(notice, noticepack, packlen, &packlen,
+ client->session_key);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "xmit auth format: %s", error_message(retval));
+ free(noticepack);
+ return;
}
-
- packlen = sizeof(ZPacket_t);
-
- if (auth && client) { /*
- we are distributing authentic and
- we have a pointer to auth info
- */
-#ifdef KERBEROS
-
- if ((retval = ZFormatAuthenticNotice(notice,
- noticepack,
- packlen,
- &packlen,
- client->zct_cblock))
- != ZERR_NONE) {
- syslog(LOG_ERR, "xmit auth format: %s",
- error_message(retval));
- xfree(noticepack);
- return;
- }
-#else /* !KERBEROS */
- notice->z_auth = 1;
- if ((retval = ZFormatSmallRawNotice(notice,
- noticepack,
- &packlen))
- != ZERR_NONE) {
- syslog(LOG_ERR, "xmit auth/raw format: %s",
- error_message(retval));
- xfree(noticepack);
- return;
- }
-#endif /* KERBEROS */
- } else {
- notice->z_auth = 0;
- notice->z_authent_len = 0;
- notice->z_ascii_authent = (char *)"";
- if ((retval = ZFormatSmallRawNotice(notice,
- noticepack,
- &packlen)) != ZERR_NONE) {
- syslog(LOG_ERR, "xmit format: %s",
- error_message(retval));
- xfree(noticepack);
- return; /* DON'T put on nack list */
- }
+#else /* !ZEPHYR_USES_KERBEROS */
+ notice->z_auth = 1;
+ retval = ZFormatSmallRawNotice(notice, noticepack, &packlen);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "xmit auth/raw format: %s", error_message(retval));
+ free(noticepack);
+ return;
+ }
+#endif /* ZEPHYR_USES_KERBEROS */
+ } else {
+ notice->z_auth = 0;
+ notice->z_authent_len = 0;
+ notice->z_ascii_authent = (char *)"";
+ retval = ZFormatSmallRawNotice(notice, noticepack, &packlen);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "xmit format: %s", error_message(retval));
+ free(noticepack);
+ return; /* DON'T put on nack list */
}
+ }
#if 0
- zdbug((LOG_DEBUG," to %s/%d",inet_ntoa(dest->sin_addr),
- ntohs(dest->sin_port)));
+ zdbug((LOG_DEBUG," to %s/%d", inet_ntoa(dest->sin_addr),
+ ntohs(dest->sin_port)));
#endif
- if ((retval = ZSetDestAddr(dest)) != ZERR_NONE) {
- syslog(LOG_WARNING, "xmit set addr: %s",
- error_message(retval));
- xfree(noticepack);
- return;
- }
- if ((retval = ZSendPacket(noticepack, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "xmit xmit: (%s/%d) %s",
- inet_ntoa(dest->sin_addr), ntohs(dest->sin_port),
- error_message(retval));
- xfree(noticepack);
- return;
- }
-
- /* now we've sent it, mark it as not ack'ed */
-
- if (!(nacked = (ZNotAcked_t *)xmalloc(sizeof(ZNotAcked_t)))) {
- /* no space: just punt */
- syslog(LOG_WARNING, "xmit nack malloc");
- xfree(noticepack);
- return;
- }
+ retval = ZSetDestAddr(dest);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "xmit set addr: %s", error_message(retval));
+ free(noticepack);
+ return;
+ }
+ retval = ZSendPacket(noticepack, packlen, 0);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "xmit xmit: (%s/%d) %s", inet_ntoa(dest->sin_addr),
+ ntohs(dest->sin_port), error_message(retval));
+ free(noticepack);
+ return;
+ }
- nacked->na_rexmits = 0;
- nacked->na_packet = noticepack;
- nacked->na_srv_idx = 0; /* XXX */
- nacked->na_addr = *dest;
- nacked->na_packsz = packlen;
- nacked->na_uid = notice->z_uid;
- nacked->q_forw = nacked->q_back = nacked;
- nacked->na_abstimo = NOW + abs_timo;
-
- /* set a timer to retransmit when done */
- nacked->na_timer = timer_set_rel(rexmit_secs,
- rexmit,
- (void *) nacked);
- /* chain in */
- xinsque(nacked, nacklist);
+ /* now we've sent it, mark it as not ack'ed */
+ nacked = (Unacked *) malloc(sizeof(Unacked));
+ if (!nacked) {
+ /* no space: just punt */
+ syslog(LOG_WARNING, "xmit nack malloc");
+ free(noticepack);
+ return;
+ }
+
+ nacked->rexmits = 0;
+ nacked->packet = noticepack;
+ nacked->dest.addr = *dest;
+ nacked->packsz = packlen;
+ nacked->uid = notice->z_uid;
+ nacked->timer = timer_set_rel(rexmit_times[0], rexmit, nacked);
+ LIST_INSERT(&nacktab[NACKTAB_HASHVAL(*dest, nacked->uid)], nacked);
}
-
/*
* Retransmit the packet specified. If we have timed out or retransmitted
* too many times, punt the packet and initiate the host recovery algorithm
@@ -680,67 +671,59 @@ xmit(notice, dest, auth, client)
*/
void
-#ifdef __STDC__
-rexmit(void *arg)
-#else
rexmit(arg)
- void *arg;
-#endif
+ void *arg;
{
- register ZNotAcked_t *nackpacket = (ZNotAcked_t*) arg;
- int retval;
- ZNotice_t dummy_notice;
- register ZClient_t *client;
+ Unacked *nacked = (Unacked *) arg;
+ int retval;
+ ZNotice_t dummy_notice;
+ Client *client;
#if 1
- zdbug((LOG_DEBUG,"rexmit"));
+ syslog(LOG_DEBUG, "rexmit %s/%d #%d time %d",
+ inet_ntoa(nacked->dest.addr.sin_addr),
+ ntohs(nacked->dest.addr.sin_port), nacked->rexmits + 1, NOW);
#endif
- if (++(nackpacket->na_rexmits) > num_rexmits ||
- NOW > nackpacket->na_abstimo) {
- /* possibly dead client */
-
- dummy_notice.z_port = nackpacket->na_addr.sin_port;
-
- client = client_which_client(&nackpacket->na_addr,
- &dummy_notice);
-
- /* unlink & free packet */
- xremque(nackpacket);
- xfree(nackpacket->na_packet);
- xfree(nackpacket);
-
- /* initiate recovery */
- if (client)
- server_recover(client);
- return;
+ nacked->rexmits++;
+ if (rexmit_times[nacked->rexmits] == -1) {
+ /* Unresponsive client, find it in our database. */
+ dummy_notice.z_port = nacked->dest.addr.sin_port;
+ client = client_which_client(&nacked->dest.addr.sin_addr,
+ &dummy_notice);
+
+ /* unlink & free nacked */
+ LIST_DELETE(nacked);
+ free(nacked->packet);
+ free(nacked);
+
+ /* Kill the client. */
+ if (client) {
+ server_kill_clt(client);
+ client_deregister(client, 1);
}
- /* retransmit the packet */
-
-#if 0
- zdbug((LOG_DEBUG," to %s/%d",
- inet_ntoa(nackpacket->na_addr.sin_addr),
- ntohs(nackpacket->na_addr.sin_port)));
-#endif
- if ((retval = ZSetDestAddr(&nackpacket->na_addr))
- != ZERR_NONE) {
- syslog(LOG_WARNING, "rexmit set addr: %s",
- error_message(retval));
- goto requeue;
-
- }
- if ((retval = ZSendPacket(nackpacket->na_packet,
- nackpacket->na_packsz, 0)) != ZERR_NONE)
- syslog(LOG_WARNING, "rexmit xmit: %s", error_message(retval));
-
-requeue:
- /* reset the timer */
- nackpacket->na_timer = timer_set_rel(rexmit_secs,
- rexmit,
- (void *) nackpacket);
return;
+ }
+ /* retransmit the packet */
+#if 0
+ zdbug((LOG_DEBUG," to %s/%d", inet_ntoa(nacked->dest.addr.sin_addr),
+ ntohs(nacked->dest.addr.sin_port)));
+#endif
+ retval = ZSetDestAddr(&nacked->dest.addr);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "rexmit set addr: %s", error_message(retval));
+ } else {
+ retval = ZSendPacket(nacked->packet, nacked->packsz, 0);
+ if (retval != ZERR_NONE)
+ syslog(LOG_WARNING, "rexmit xmit: %s", error_message(retval));
+ }
+
+ /* reset the timer */
+ nacked->timer = timer_set_rel(rexmit_times[nacked->rexmits], rexmit,
+ nacked);
+ return;
}
/*
@@ -752,93 +735,81 @@ requeue:
void
clt_ack(notice, who, sent)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- ZSentType sent;
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
+ Sent_type sent;
{
- ZNotice_t acknotice;
- ZPacket_t ackpack;
- int packlen;
- int notme = 0;
- char *sent_name;
- Code_t retval;
-
- if (bdumping) { /* don't ack while dumping */
+ ZNotice_t acknotice;
+ ZPacket_t ackpack;
+ int packlen;
+ int notme = 0;
+ char *sent_name;
+ Code_t retval;
+
+ if (bdumping) { /* don't ack while dumping */
#if 1
- zdbug((LOG_DEBUG,"bdumping, no ack"));
-#endif
- return;
- }
-
- acknotice = *notice;
-
- acknotice.z_kind = SERVACK;
- switch (sent) {
- case SENT:
- acknotice.z_message = ZSRVACK_SENT;
- sent_name = "sent";
- break;
- case NOT_FOUND:
- acknotice.z_message = ZSRVACK_FAIL;
- acknotice.z_kind = SERVNAK;
- sent_name = "fail";
- break;
- case AUTH_FAILED:
- acknotice.z_kind = SERVNAK;
- acknotice.z_message = ZSRVACK_NOTSENT;
- sent_name = "nak/not_sent";
- break;
- case NOT_SENT:
- acknotice.z_message = ZSRVACK_NOTSENT;
- sent_name = "not_sent";
- break;
- default:
- abort ();
- }
-
-#if 0
- zdbug((LOG_DEBUG,"clt_ack type %s for %d to %s/%d",
- sent_name,
- ntohs(notice->z_port),
- inet_ntoa(who->sin_addr),
- ntohs(who->sin_port)));
+ zdbug((LOG_DEBUG,"bdumping, no ack"));
#endif
+ return;
+ }
+
+ acknotice = *notice;
+
+ acknotice.z_kind = SERVACK;
+ switch (sent) {
+ case SENT:
+ acknotice.z_message = ZSRVACK_SENT;
+ sent_name = "sent";
+ break;
+ case NOT_FOUND:
+ acknotice.z_message = ZSRVACK_FAIL;
+ acknotice.z_kind = SERVNAK;
+ sent_name = "fail";
+ break;
+ case AUTH_FAILED:
+ acknotice.z_kind = SERVNAK;
+ acknotice.z_message = ZSRVACK_NOTSENT;
+ sent_name = "nak/not_sent";
+ break;
+ case NOT_SENT:
+ acknotice.z_message = ZSRVACK_NOTSENT;
+ sent_name = "not_sent";
+ break;
+ default:
+ abort ();
+ }
- if (!server_which_server(who) &&
- (hostm_find_server(&who->sin_addr) != me_server)) {
#if 0
- zdbug((LOG_DEBUG,"not me"));
+ zdbug((LOG_DEBUG,"clt_ack type %s for %d to %s/%d", sent_name,
+ ntohs(notice->z_port), inet_ntoa(who->sin_addr),
+ ntohs(who->sin_port)));
#endif
- notme = 1;
- }
- acknotice.z_multinotice = "";
+ acknotice.z_multinotice = "";
- /* leave room for the trailing null */
- acknotice.z_message_len = strlen(acknotice.z_message) + 1;
+ /* leave room for the trailing null */
+ acknotice.z_message_len = strlen(acknotice.z_message) + 1;
- packlen = sizeof(ackpack);
+ packlen = sizeof(ackpack);
- if ((retval = ZFormatSmallRawNotice(&acknotice,
- ackpack,
- &packlen)) != ZERR_NONE) {
- syslog(LOG_ERR, "clt_ack format: %s",error_message(retval));
- return;
- }
- if ((retval = ZSetDestAddr(who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "clt_ack set addr: %s",
- error_message(retval));
- return;
- }
- if ((retval = ZSendPacket(ackpack, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "clt_ack xmit: %s", error_message(retval));
- return;
- }
- else
- zdbug ((LOG_DEBUG, "packet sent"));
- if (notme)
- hostm_deathgram(who, me_server);
+ retval = ZFormatSmallRawNotice(&acknotice, ackpack, &packlen);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "clt_ack format: %s", error_message(retval));
return;
+ }
+ retval = ZSetDestAddr(who);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "clt_ack set addr: %s", error_message(retval));
+ return;
+ }
+ retval = ZSendPacket(ackpack, packlen, 0);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "clt_ack xmit: %s", error_message(retval));
+ return;
+ } else {
+ zdbug((LOG_DEBUG, "packet sent"));
+ }
+ return;
}
/*
@@ -848,36 +819,36 @@ clt_ack(notice, who, sent)
static void
nack_cancel(notice, who)
- register ZNotice_t *notice;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
{
- register ZNotAcked_t *nacked;
+ Unacked *nacked;
+ int hashval;
- /* search the not-yet-acked list for this packet, and
- flush it. */
+ /* search the not-yet-acked table for this packet, and flush it. */
#if 0
- zdbug((LOG_DEBUG, "nack_cancel: %s:%08X,%08X",
- inet_ntoa (notice->z_uid.zuid_addr),
- notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec));
+ zdbug((LOG_DEBUG, "nack_cancel: %s:%08X,%08X",
+ inet_ntoa(notice->z_uid.zuid_addr),
+ notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec));
#endif
- for (nacked = nacklist->q_forw;
- nacked != nacklist;
- nacked = nacked->q_forw)
- if ((nacked->na_addr.sin_addr.s_addr == who->sin_addr.s_addr) &&
- (nacked->na_addr.sin_port == who->sin_port))
- if (ZCompareUID(&nacked->na_uid, &notice->z_uid)) {
- timer_reset(nacked->na_timer);
- xfree(nacked->na_packet);
- xremque(nacked);
- xfree(nacked);
- return;
- }
+ hashval = NACKTAB_HASHVAL(*who, notice->z_uid);
+ for (nacked = nacktab[hashval]; nacked; nacked = nacked->next) {
+ if (nacked->dest.addr.sin_addr.s_addr == who->sin_addr.s_addr
+ && nacked->dest.addr.sin_port == who->sin_port
+ && ZCompareUID(&nacked->uid, &notice->z_uid)) {
+ timer_reset(nacked->timer);
+ free(nacked->packet);
+ LIST_DELETE(nacked);
+ free(nacked);
+ return;
+ }
+ }
+
#if 1
- zdbug((LOG_DEBUG,"nack_cancel: nack not found %s:%08X,%08X",
- inet_ntoa (notice->z_uid.zuid_addr),
- notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec));
+ zdbug((LOG_DEBUG,"nack_cancel: nack not found %s:%08X,%08X",
+ inet_ntoa (notice->z_uid.zuid_addr),
+ notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec));
#endif
- return;
}
/* for compatibility when sending subscription information to old clients */
@@ -885,184 +856,329 @@ nack_cancel(notice, who)
#define OLD_ZEPHYR_VERSION "ZEPH0.0"
#endif /* OLD_COMPAT */
+/* Dispatch an HM_CTL notice. */
+
+Code_t
+hostm_dispatch(notice, auth, who, server)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
+{
+ Server *owner;
+ char *opcode = notice->z_opcode;
+ Code_t retval;
+ int i, add = 0, remove = 0;
+
+#if 0
+ zdbug((LOG_DEBUG,"hm_disp"));
+#endif
+
+ if (notice->z_kind == HMACK) {
+ /* Ignore. */
+ ;
+ } else if (notice->z_kind != HMCTL) {
+#if 0
+ zdbug((LOG_DEBUG, "bogus HM packet"));
+#endif
+ clt_ack(notice, who, AUTH_FAILED);
+ } else if (strcmp(opcode, HM_FLUSH) == 0) {
+ client_flush_host(&who->sin_addr);
+ if (server == me_server)
+ server_forward(notice, auth, who);
+ } else if (strcmp(opcode, HM_BOOT) == 0) {
+ client_flush_host(&who->sin_addr);
+ if (server == me_server) {
+ server_forward(notice, auth, who);
+ ack(notice, who);
+ add = 1;
+ }
+ } else if (strcmp(opcode, HM_ATTACH) == 0) {
+ if (server == me_server) {
+ server_forward(notice, auth, who);
+ ack(notice, who);
+ add = 1;
+ } else {
+ remove = 1;
+ }
+ } else if (strcmp(opcode, HM_DETACH) == 0) {
+ remove = 1;
+ } else {
+ syslog(LOG_WARNING, "hm_dispatch: unknown opcode %s", opcode);
+ }
+
+ if (add) {
+ for (i = 0; i < num_hosts; i++) {
+ if (hosts[i].s_addr == who->sin_addr.s_addr)
+ break;
+ }
+ if (i == num_hosts) {
+ if (hosts_size == 0) {
+ hosts = (struct in_addr *) malloc(HOSTS_SIZE_INIT *
+ sizeof(struct in_addr));
+ if (!hosts)
+ return ENOMEM;
+ hosts_size = HOSTS_SIZE_INIT;
+ } else if (num_hosts == hosts_size) {
+ hosts = (struct in_addr *) realloc(hosts, hosts_size * 2 *
+ sizeof(struct in_addr));
+ if (!hosts)
+ return ENOMEM;
+ hosts_size *= 2;
+ }
+ hosts[num_hosts++] = who->sin_addr;
+ }
+ } else if (remove) {
+ for (i = 0; i < num_hosts; i++) {
+ if (hosts[i].s_addr == who->sin_addr.s_addr) {
+ memmove(&hosts[i], &hosts[i + 1], num_hosts - (i + 1));
+ num_hosts--;
+ break;
+ }
+ }
+ }
+ return ZERR_NONE;
+}
+
/*
* Dispatch a ZEPHYR_CTL notice.
*/
Code_t
control_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
{
- register char *opcode = notice->z_opcode;
- ZClient_t *client;
- ZHostList_t *host;
- Code_t retval;
- int wantdefs;
-
- /*
- * ZEPHYR_CTL Opcodes expected are:
- * BOOT (inst HM): host has booted; flush data.
- * CLIENT_SUBSCRIBE: process with the subscription mananger.
- * CLIENT_UNSUBSCRIBE: ""
- * CLIENT_CANCELSUB: ""
- */
-
- zdbug ((LOG_DEBUG, "ctl_disp: opc=%s", opcode));
-
- if (!strcasecmp (notice->z_class_inst, ZEPHYR_CTL_HM))
- return(hostm_dispatch(notice, auth, who, server));
- else if (!strcmp (opcode, CLIENT_GIMMESUBS) ||
- !strcmp (opcode, CLIENT_GIMMEDEFS)) {
- /* this special case is before the auth check so that
- someone who has no subscriptions does NOT get a SERVNAK
- but rather an empty list. Note we must therefore
- check authentication inside subscr_sendlist */
+ char *opcode = notice->z_opcode;
+ Client *client;
+ Code_t retval;
+ int wantdefs;
+ Realm *realm;
+ struct sockaddr_in newwho;
+
+ /*
+ * ZEPHYR_CTL Opcodes expected are:
+ * BOOT (inst HM): host has booted; flush data.
+ * CLIENT_SUBSCRIBE: process with the subscription mananger.
+ * CLIENT_UNSUBSCRIBE: ""
+ * CLIENT_CANCELSUB: ""
+ */
+
+ zdbug((LOG_DEBUG, "ctl_disp: opc=%s", opcode));
+
+ newwho.sin_addr.s_addr = notice->z_sender_addr.s_addr;
+ newwho.sin_port = notice->z_port;
+ realm = realm_which_realm(&newwho);
+ if (realm)
+ return(realm_control_dispatch(notice, auth, who, server, realm));
+
+ if (strcasecmp(notice->z_class_inst, ZEPHYR_CTL_HM) == 0) {
+ return hostm_dispatch(notice, auth, who, server);
+ } else if (strcmp(opcode, CLIENT_GIMMESUBS) == 0 ||
+ strcmp(opcode, CLIENT_GIMMEDEFS) == 0) {
+ /* this special case is before the auth check so that
+ someone who has no subscriptions does NOT get a SERVNAK
+ but rather an empty list. Note we must therefore
+ check authentication inside subscr_sendlist */
#ifdef OLD_COMPAT
- /* only acknowledge if *not* old version; the old version
- acknowledges the packet with the reply */
- if (strcmp (notice->z_version, OLD_ZEPHYR_VERSION))
- ack(notice, who);
+ /* only acknowledge if *not* old version; the old version
+ acknowledges the packet with the reply */
+ if (strcmp(notice->z_version, OLD_ZEPHYR_VERSION) != 0)
+ ack(notice, who);
#else /* !OLD_COMPAT */
- ack(notice, who);
+ ack(notice, who);
#endif /* OLD_COMPAT */
- subscr_sendlist(notice, auth, who);
- return(ZERR_NONE);
- } else if (!auth) {
+ subscr_sendlist(notice, auth, who);
+ return ZERR_NONE;
+ } else if (!auth) {
#if 0
- zdbug((LOG_DEBUG,"unauth ctrl_disp"));
+ zdbug((LOG_DEBUG,"unauth ctrl_disp"));
#endif
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return ZERR_NONE;
+ }
+
+ wantdefs = strcmp(opcode, CLIENT_SUBSCRIBE_NODEFS);
+ if (!wantdefs || strcmp(opcode, CLIENT_SUBSCRIBE) == 0) {
+ /* subscription notice */
+ retval = client_register(notice, &who->sin_addr, &client, wantdefs);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_NOTICE, "subscr %s/%s/%d failed: %s",
+ notice->z_sender, inet_ntoa(who->sin_addr),
+ ntohs(notice->z_port), error_message(retval));
+ if (server == me_server) {
+ if (retval == ZSRV_BADSUBPORT)
+ clt_ack(notice, who, AUTH_FAILED);
+ else
+ nack(notice, who);
+ }
+ return(ZERR_NONE);
}
-
- /* the rest of the expected opcodes modify state; check for
- unlocked host first */
- host = hostm_find_host(&who->sin_addr);
- if (host && host->zh_locked)
- return(ZSRV_REQUEUE);
-
- wantdefs = strcmp (opcode, CLIENT_SUBSCRIBE_NODEFS);
- if (!wantdefs || !strcmp (opcode, CLIENT_SUBSCRIBE)) {
- /* subscription notice */
- if (!(client = client_which_client(who, notice))) {
- if ((retval = client_register(notice,
- who,
- &client,
- server,
- wantdefs)) != ZERR_NONE)
- {
- syslog(LOG_NOTICE,
- "subscr. register %s/%s/%d failed: %s",
- notice->z_sender,
- inet_ntoa(who->sin_addr),
- ntohs(notice->z_port),
- error_message(retval));
- if (server == me_server) {
- if (retval == ZSRV_BADSUBPORT) {
- clt_ack(notice, who, AUTH_FAILED);
- } else
- hostm_deathgram(who, me_server);
- }
- return(ZERR_NONE);
- }
- if (!(client = client_which_client(who, notice))) {
- syslog(LOG_CRIT, "subscr reg. failure");
- abort();
- }
- }
- if (strcmp (client->zct_principal->string, notice->z_sender)) {
- /* you may only subscribe for your own clients */
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
-#ifdef KERBEROS
- /* in case it's changed */
- (void) memcpy((caddr_t) client->zct_cblock, (caddr_t) ZGetSession(),
- sizeof(C_Block));
+ if (strcmp(client->principal->string, notice->z_sender) != 0) {
+ /* you may only subscribe for your own clients */
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return ZERR_NONE;
+ }
+#ifdef ZEPHYR_USES_KERBEROS
+ /* in case it's changed */
+ memcpy(client->session_key, ZGetSession(), sizeof(C_Block));
#endif
- if ((retval = subscr_subscribe(client,notice)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr failed: %s",
- error_message(retval));
- if (server == me_server)
- nack(notice, who);
- return(ZERR_NONE);
- }
- } else if (!strcmp(opcode, CLIENT_UNSUBSCRIBE)) {
- if ((client = client_which_client(who,notice)) != NULLZCNT) {
- if (strcmp(client->zct_principal->string, notice->z_sender)) {
- /* you may only cancel for your own clients */
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
+ retval = subscr_subscribe(client, notice);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr failed: %s", error_message(retval));
+ if (server == me_server)
+ nack(notice, who);
+ return ZERR_NONE;
+ }
+ } else if (strcmp(opcode, CLIENT_UNSUBSCRIBE) == 0) {
+ client = client_which_client(&who->sin_addr, notice);
+ if (client != NULL) {
+ if (strcmp(client->principal->string, notice->z_sender) != 0) {
+ /* you may only cancel for your own clients */
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return ZERR_NONE;
+ }
#if 0
- if (zdebug) {
- if (server == me_server)
- syslog (LOG_DEBUG,
- "subscription cancel for %s/%d\n",
- inet_ntoa (who->sin_addr),
- ntohs (who->sin_port));
- else
- syslog (LOG_DEBUG,
- "subscription cancel for %s/%d from %s\n",
- inet_ntoa (who->sin_addr),
- ntohs (who->sin_port),
- server->addr);
- }
-#endif
- (void) subscr_cancel(who, notice);
+ if (zdebug) {
+ if (server == me_server) {
+ syslog(LOG_DEBUG, "subscription cancel for %s/%d\n",
+ inet_ntoa(who->sin_addr), ntohs(who->sin_port));
} else {
- nack(notice, who);
- return(ZERR_NONE);
+ syslog(LOG_DEBUG,
+ "subscription cancel for %s/%d from %s\n",
+ inet_ntoa(who->sin_addr), ntohs(who->sin_port),
+ server->addr_str);
}
- } else if (!strcmp(opcode, CLIENT_CANCELSUB)) {
- /* canceling subscriptions implies I can punt info about
- this client */
- if ((client = client_which_client(who,notice)) != NULLZCNT) {
- if (strcmp(client->zct_principal->string, notice->z_sender)) {
- /* you may only cancel for your own clients */
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
- if (host) {
- /* don't flush locations here, let him
- do it explicitly */
+ }
+#endif
+ subscr_cancel(who, notice);
+ } else {
+ nack(notice, who);
+ return ZERR_NONE;
+ }
+ } else if (strcmp(opcode, CLIENT_CANCELSUB) == 0) {
+ /* canceling subscriptions implies I can punt info about this client */
+ client = client_which_client(&who->sin_addr, notice);
+ if (client == NULL) {
#if 0
- zdbug((LOG_DEBUG, "cancelsub clt_dereg %s/%d",
- inet_ntoa (who->sin_addr),
- ntohs (who->sin_port)));
+ zdbug((LOG_DEBUG,"can_sub not found client"));
#endif
- hostm_lose_ignore(client);
- (void) client_deregister(client, host, 0);
- }
-
- }
- if (!client || !host) {
+ if (server == me_server)
+ nack(notice, who);
+ return ZERR_NONE;
+ }
+ if (strcmp(client->principal->string, notice->z_sender) != 0) {
+ /* you may only cancel for your own clients */
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return ZERR_NONE;
+ }
+ /* don't flush locations here, let him do it explicitly */
#if 0
- zdbug((LOG_DEBUG,"can_sub not found client"));
+ zdbug((LOG_DEBUG, "cancelsub clt_dereg %s/%d",
+ inet_ntoa(who->sin_addr), ntohs(who->sin_port)));
#endif
- if (server == me_server)
- nack(notice, who);
- return(ZERR_NONE);
- }
+ client_deregister(client, 0);
+ } else {
+ syslog(LOG_WARNING, "unknown ctl opcode %s", opcode);
+ if (server == me_server)
+ nack(notice, who);
+ return ZERR_NONE;
+ }
+
+ if (server == me_server) {
+ ack(notice, who);
+ server_forward(notice, auth, who);
+ }
+ return ZERR_NONE;
+}
+
+void
+hostm_shutdown()
+{
+ int i, s, newserver;
+ struct sockaddr_in sin;
+
+ for (i = 0; i < nservers; i++) {
+ if (i != me_server_idx && otherservers[i].state == SERV_UP)
+ break;
+ }
+ newserver = (i < nservers);
+ for (i = 0; i < num_hosts; i++) {
+ sin.sin_addr = hosts[i];
+ sin.sin_port = hm_port;
+ if (newserver) {
+ while (1) {
+ s = (random() % (nservers - 1)) + 1;
+ if (otherservers[s].state == SERV_UP)
+ break;
+ }
+ hostm_deathgram(&sin, &otherservers[s]);
} else {
- syslog(LOG_WARNING, "unknown ctl opcode %s", opcode);
- if (server == me_server)
- nack(notice, who);
- return(ZERR_NONE);
+ hostm_deathgram(&sin, NULL);
}
+ }
+}
- if (server == me_server) {
- ack(notice, who);
- server_forward(notice, auth, who);
- }
- return(ZERR_NONE);
+static void
+hostm_deathgram(sin, server)
+ struct sockaddr_in *sin;
+ Server *server;
+{
+ Code_t retval;
+ int shutlen;
+ ZNotice_t shutnotice;
+ char *shutpack;
+
+ shutnotice.z_kind = HMCTL;
+ shutnotice.z_port = sin->sin_port; /* we are sending it */
+ shutnotice.z_class = HM_CTL_CLASS;
+ shutnotice.z_class_inst = HM_CTL_SERVER;
+ shutnotice.z_opcode = SERVER_SHUTDOWN;
+ shutnotice.z_sender = HM_CTL_SERVER;
+ shutnotice.z_recipient = hm_recipient();
+ shutnotice.z_default_format = "";
+ shutnotice.z_num_other_fields = 0;
+ shutnotice.z_message = (server) ? server->addr_str : NULL;
+ shutnotice.z_message_len = (server) ? strlen(server->addr_str) + 1 : 0;
+
+ retval = ZFormatNotice(&shutnotice, &shutpack, &shutlen, ZNOAUTH);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "hm_shut format: %s",error_message(retval));
+ return;
+ }
+ retval = ZSetDestAddr(sin);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "hm_shut set addr: %s", error_message(retval));
+ free(shutpack);
+ return;
+ }
+ retval = ZSendPacket(shutpack, shutlen, 0);
+ if (retval != ZERR_NONE)
+ syslog(LOG_WARNING, "hm_shut xmit: %s", error_message(retval));
+ free(shutpack);
+}
+
+static char *
+hm_recipient()
+{
+ static char *recipient;
+ char *realm;
+
+ if (recipient)
+ return recipient;
+
+ realm = ZGetRealm();
+ if (!realm)
+ realm = "???";
+ recipient = (char *) malloc(strlen(realm) + 4);
+ strcpy (recipient, "hm@");
+ strcat (recipient, realm);
+ return recipient;
}
-
diff --git a/server/dispatch.c.auth b/server/dispatch.c.auth
deleted file mode 100644
index 8707c2f..0000000
--- a/server/dispatch.c.auth
+++ /dev/null
@@ -1,1078 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains functions for dispatching a notice.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1987, 1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#ifndef lint
-#ifndef SABER
-static char rcsid_dispatch_c[] =
- "$Id$";
-#endif
-#endif
-
-#include "zserver.h"
-#include <sys/socket.h>
-
-#ifdef DEBUG
-Zconst char *ZNoticeKinds[9] = {"UNSAFE", "UNACKED", "ACKED", "HMACK",
- "HMCTL", "SERVACK", "SERVNAK", "CLIENTACK",
- "STAT"};
-#endif
-/*
- *
- * External Routines:
- *
- * void dispatch(notice, auth, who)
- * ZNotice_t *notice;
- * int auth;
- * struct sockaddr_in *who;
- *
- * void clt_ack(notice, who, sent)
- * ZNotice_t *notice;
- * struct sockaddr_in *who;
- * ZSentType sent;
- *
- * void nack_release(client)
- * ZClient_t *client;
- *
- * void sendit(notice, auth, who)
- * ZNotice_t *notice;
- * int auth;
- * struct sockaddr_in *who;
- *
- * void xmit(notice, dest, auth, client)
- * ZNotice_t *notice;
- * struct sockaddr_in *dest;
- * int auth;
- * ZClient_t *client;
- */
-
-
-/* patchable magic numbers controlling the retransmission rate and count */
-int num_rexmits = NUM_REXMITS;
-long rexmit_secs = REXMIT_SECS;
-long abs_timo = REXMIT_SECS*NUM_REXMITS + 10;
-
-ZSTRING *class_control, *class_admin, *class_hm, *class_ulogin,
- *class_ulocate;
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static void nack_cancel P((register ZNotice_t *, struct sockaddr_in *));
-static void dispatch P((ZNotice_t *, int, struct sockaddr_in *, int));
-static int send_to_dest P((ZNotice_t *, int, ZDestination *dest, int));
-
-#undef P
-
-ZStatistic interserver_notices = {0, "inter-server notices"};
-ZStatistic hm_packets = {0, "hostmanager packets"};
-ZStatistic control_notices = {0, "client control notices"};
-ZStatistic message_notices = {0, "message notices"};
-ZStatistic login_notices = {0, "login notices"};
-ZStatistic i_s_ctls = {0, "inter-server control notices"};
-ZStatistic i_s_logins = {0, "inter-server login notices"};
-ZStatistic i_s_admins = {0, "inter-server admin notices"};
-ZStatistic i_s_locates = {0, "inter-server locate notices"};
-ZStatistic locate_notices = {0, "locate notices"};
-ZStatistic admin_notices = {0, "admin notices"};
-
-static void
-#ifdef __STDC__
-dump_stats (void *arg)
-#else
-dump_stats (arg)
-void *arg;
-#endif
-{
- syslog(LOG_INFO, "stats: %s: %d", hm_packets.str, hm_packets.val);
- syslog(LOG_INFO, "stats: %s: %d", control_notices.str,
- control_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", message_notices.str,
- message_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", login_notices.str,
- login_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", locate_notices.str,
- locate_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", admin_notices.str,
- admin_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", interserver_notices.str,
- interserver_notices.val);
- syslog(LOG_INFO, "stats: %s: %d", i_s_ctls.str, i_s_ctls.val);
- syslog(LOG_INFO, "stats: %s: %d", i_s_logins.str, i_s_logins.val);
- syslog(LOG_INFO, "stats: %s: %d", i_s_admins.str, i_s_admins.val);
- syslog(LOG_INFO, "stats: %s: %d", i_s_locates.str, i_s_locates.val);
- /* log stuff once an hour */
- (void) timer_set_rel ((long) 6*60*60, dump_stats, arg);
-}
-
-/*
- * Handle an input packet.
- * Warning: this function may be called from within a brain dump.
- */
-
-void
-handle_packet()
-{
- Code_t status;
- ZPacket_t input_packet; /* from the network */
- ZNotice_t new_notice; /* parsed from input_packet */
- int input_len; /* len of packet */
- struct sockaddr_in input_sin; /* Zconstructed for authent */
- struct sockaddr_in whoisit; /* for holding peer's address */
- int authentic; /* authentic flag */
- ZSrvPending_t *pending; /* pending packet */
- ZHostList_t *host; /* host ptr */
- int from_server; /* packet is from another server */
-#ifdef DEBUG
- static int first_time = 1;
-#endif
-
-#ifdef DEBUG
- /* Dump statistics five minutes after startup */
- if (first_time) {
- first_time = 0;
- (void) timer_set_rel (5*60, dump_stats, (void *) 0);
- }
-#endif
- /* handle traffic */
-
- if (otherservers[me_server_idx].zs_update_queue) {
- /* something here for me; take care of it */
-#if 1
- zdbug((LOG_DEBUG, "internal queue process"));
-#endif
-
- pending = otherservers[me_server_idx].zs_update_queue->q_forw;
- host = hostm_find_host(&(pending->pend_who.sin_addr));
- if (host && host->zh_locked) {
- /* can't deal with it now. to preserve ordering,
- we can't process other packets, esp. since we
- may block since we don't really know if there
- are things in the real queue. */
-#if 1
- zdbug((LOG_DEBUG,"host %s is locked",
- inet_ntoa(host->zh_addr.sin_addr)));
-#endif
- return;
- }
- pending = server_dequeue(me_server); /* we can do it, remove */
-
- if ((status = ZParseNotice(pending->pend_packet,
- pending->pend_len,
- &new_notice)) != ZERR_NONE) {
- syslog(LOG_ERR,
- "bad notice parse (%s): %s",
- inet_ntoa(pending->pend_who.sin_addr),
- error_message(status));
- } else
- dispatch(&new_notice, pending->pend_auth,
- &pending->pend_who, 1);
- server_pending_free(pending);
- return;
- }
- /*
- * nothing in internal queue, go to the external library
- * queue/socket
- */
- if ((status = ZReceivePacket(input_packet,
- &input_len,
- &whoisit)) != ZERR_NONE) {
- syslog(LOG_ERR,
- "bad packet receive: %s from %s",
- error_message(status), inet_ntoa(whoisit.sin_addr));
- return;
- }
- npackets++;
- if ((status = ZParseNotice(input_packet,
- input_len,
- &new_notice)) != ZERR_NONE) {
- syslog(LOG_ERR,
- "bad notice parse (%s): %s",
- inet_ntoa(whoisit.sin_addr),
- error_message(status));
- return;
- }
- if (server_which_server(&whoisit)) {
- /* we need to parse twice--once to get
- the source addr, second to check
- authentication */
- (void) memset((caddr_t) &input_sin, 0,
- sizeof(input_sin));
- input_sin.sin_addr.s_addr = new_notice.z_sender_addr.s_addr;
- input_sin.sin_port = new_notice.z_port;
- input_sin.sin_family = AF_INET;
- authentic = ZCheckAuthentication(&new_notice, &input_sin);
- from_server = 1;
- } else {
- from_server = 0;
- authentic = ZCheckAuthentication(&new_notice, &whoisit);
- }
-
- if (whoisit.sin_port != hm_port &&
- strcasecmp (new_notice.z_class,ZEPHYR_ADMIN_CLASS) &&
- whoisit.sin_port != sock_sin.sin_port &&
- new_notice.z_kind != CLIENTACK) {
- syslog(LOG_ERR,
- "bad port %s/%d",
- inet_ntoa(whoisit.sin_addr),
- ntohs(whoisit.sin_port));
- return;
- }
-
- message_notices.val++;
- dispatch(&new_notice, authentic, &whoisit, from_server);
- return;
-}
-/*
- * Dispatch a notice.
- */
-
-static void
-dispatch(notice, auth, who, from_server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- int from_server;
-{
- Code_t status;
- ZSTRING *notice_class;
- struct sockaddr_in who2;
- int authflag;
-#ifdef DEBUG
- char dbg_buf[BUFSIZ];
-#endif
-
- /* Set "authflag" to 1 or 0 for handler functions. Treat
- * ZAUTH_CKSUM_FAILED as authentic except for sendit(), which is
- * handled below. */
- switch (auth) {
- case ZAUTH_YES:
- case ZAUTH_CKSUM_FAILED:
- authflag = 1;
- break;
- case ZAUTH_FAILED:
- case ZAUTH_NO:
- default:
- authflag = 0;
- break;
- }
-
- if ((int) notice->z_kind < (int) UNSAFE ||
- (int) notice->z_kind > (int) CLIENTACK) {
- syslog(LOG_NOTICE, "bad notice kind 0x%x from %s",
- (int) notice->z_kind,
- inet_ntoa(who->sin_addr));
- return;
- }
-#if 0
- if (zdebug) {
- (void) sprintf (dbg_buf,
- "disp:%s '%s' '%s' '%s' notice to '%s' from '%s' %s/%d/%d",
- ZNoticeKinds[(int) notice->z_kind],
- notice->z_class,
- notice->z_class_inst,
- notice->z_opcode,
- notice->z_recipient,
- notice->z_sender,
- inet_ntoa(who->sin_addr),
- ntohs(who->sin_port),
- ntohs(notice->z_port));
- syslog (LOG_DEBUG, "%s", dbg_buf);
- }
-#endif
-
- if (notice->z_kind == CLIENTACK) {
- nack_cancel(notice, who);
- return;
- }
-
- who2 = *who;
-#if 0
- if (0 && from_server) {
- /* incorporate server_dispatch here */
- }
-#endif
- notice_class = make_zstring(notice->z_class,1);
-
- if (from_server) {
- interserver_notices.val++;
- status = server_dispatch(notice, auth, who);
- } else if (class_is_hm(notice_class)) {
- hm_packets.val++;
- status = hostm_dispatch(notice, auth, who, me_server);
- } else if (class_is_control(notice_class)) {
- control_notices.val++;
- status = control_dispatch(notice, auth, who, me_server);
- } else if (class_is_ulogin(notice_class)) {
- login_notices.val++;
- status = ulogin_dispatch(notice, auth, who, me_server);
- } else if (class_is_ulocate(notice_class)) {
- locate_notices.val++;
- status = ulocate_dispatch(notice, auth, who, me_server);
- } else if (class_is_admin(notice_class)) {
- admin_notices.val++;
- status = server_adispatch(notice, auth, who, me_server);
- } else {
- if (auth == ZAUTH_CKSUM_FAILED)
- authflag = 0;
- sendit (notice, auth, who);
- free_zstring(notice_class);
- return;
- }
-
- if (status == ZSRV_REQUEUE) {
-#ifdef CONCURRENT
- server_self_queue(notice, auth, who);
-#else
- syslog(LOG_ERR, "requeue while not concurr");
- abort();
-#endif
- }
- free_zstring(notice_class);
-}
-
-/*
- * Send a notice off to those clients who have subscribed to it.
- */
-
-void
-sendit(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
-{
- static int send_counter = 0;
- int any = 0;
- ZAcl_t *acl;
- ZDestination dest;
- ZSTRING *class;
-
- class = make_zstring(notice->z_class,1);
- if ((acl = class_get_acl(class)) != NULLZACLT) {
- /* if controlled and not auth, fail */
- if (!auth) {
- syslog(LOG_WARNING, "sendit unauthentic %s from %s",
- notice->z_class, notice->z_sender);
- clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
- return;
- }
- /* if not auth to transmit, fail */
- if (!access_check(notice->z_sender, acl, TRANSMIT)) {
- syslog(LOG_WARNING, "sendit unauthorized %s from %s",
- notice->z_class, notice->z_sender);
- clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
- return;
- }
- /* sender != inst and not auth to send to others --> fail */
- if ((strcmp (notice->z_sender, notice->z_class_inst)) &&
- (!access_check(notice->z_sender, acl, INSTUID))) {
- syslog(LOG_WARNING,
- "sendit unauth uid %s %s.%s",
- notice->z_sender,
- notice->z_class,
- notice->z_class_inst);
- clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
- return;
- }
- }
- if (memcmp(&notice->z_sender_addr.s_addr, &who->sin_addr.s_addr,
- sizeof(notice->z_sender_addr.s_addr))) {
- /* someone is playing games... */
- /* inet_ntoa returns pointer to static area */
- /* max size is 255.255.255.255 */
- char buffer[16];
- (void) strcpy(buffer, inet_ntoa(who->sin_addr));
- if (!auth) {
- syslog(LOG_WARNING, "sendit unauthentic fake packet: claimed %s, real %s",
- inet_ntoa(notice->z_sender_addr), buffer);
- clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
- return;
- }
- if (ntohl(notice->z_sender_addr.s_addr) != 0) {
- syslog(LOG_WARNING, "sendit invalid address: claimed %s, real %s",
- inet_ntoa(notice->z_sender_addr), buffer);
- clt_ack(notice, who, AUTH_FAILED);
- free_zstring(class);
- return;
- }
- syslog(LOG_WARNING, "sendit addr mismatch: claimed %s, real %s",
- inet_ntoa(notice->z_sender_addr), buffer);
- }
-
- /* Increment the send counter, used to prevent duplicate sends to
- * clients. On the off-chance that we wrap around to 0, skip over
- * it to prevent missing clients which have never had a packet
- * sent to them. */
- send_counter++;
- if (send_counter == 0)
- send_counter = 1;
-
- /* Send to clients subscribed to the triplet itself. */
- dest.classname = class;
- dest.inst = make_zstring(notice->z_class_inst, 1);
- dest.recip = make_zstring(notice->z_recipient, 0);
- if (send_to_dest(notice, auth, &dest, send_counter))
- any = 1;
-
- /* Send to clients subscribed to the triplet with the instance
- * substituted with the wildcard instance. */
- free_zstring(dest.inst);
- dest.inst = wildcard_instance;
- if (send_to_dest(notice, auth, &dest, send_counter))
- any = 1;
-
- free_zstring(class);
- free_zstring(dest.recip);
- if (any)
- ack(notice, who);
- else
- nack(notice, who);
-}
-
-/*
- * Send to each client in the list. Avoid duplicates by setting
- * last_send on each client to send_counter, a nonce which is updated
- * by sendit() above.
- */
-
-static int
-send_to_dest(notice, auth, dest, send_counter)
- ZNotice_t *notice;
- int auth;
- ZDestination *dest;
- int send_counter;
-{
- register ZClientList_t *list, *p;
- register ZClient_t *client;
- register int any = 0;
-
- list = triplet_lookup(dest);
- if (list != NULLZCLT) {
- for (p = list->q_forw; p != list; p = p->q_forw) {
- client = p->zclt_client;
- if (client->last_send == send_counter)
- continue;
- client->last_send = send_counter;
- xmit(notice, &(client->zct_sin), auth, client);
- any = 1;
- }
- }
- return any;
-}
-
-/*
- * Clean up the not-yet-acked queue and release anything destined
- * for the client.
- */
-
-void
-nack_release(client)
- ZClient_t *client;
-{
- register ZNotAcked_t *nacked, *nack2;
-
- /* search the not-yet-acked list for anything destined to him, and
- flush it. */
- for (nacked = nacklist->q_forw;
- nacked != nacklist;)
- if ((nacked->na_addr.sin_addr.s_addr == client->zct_sin.sin_addr.s_addr) &&
- (nacked->na_addr.sin_port == client->zct_sin.sin_port)) {
- /* go back, since remque will change things */
- nack2 = nacked->q_back;
- timer_reset(nacked->na_timer);
- xremque(nacked);
- xfree(nacked->na_packet);
- xfree(nacked);
- /* now that the remque adjusted the linked list,
- we go forward again */
- nacked = nack2->q_forw;
- } else
- nacked = nacked->q_forw;
- return;
-}
-
-/*
- * Send one packet of a fragmented message to a client. After transmitting,
- * put it onto the not ack'ed list.
- */
-
-/* the arguments must be the same as the arguments to Z_XmitFragment */
-/*ARGSUSED*/
-Code_t
-xmit_frag(notice, buf, len, waitforack)
- ZNotice_t *notice;
- char *buf;
- int len;
- int waitforack;
-{
- char *savebuf;
- register ZNotAcked_t *nacked;
- Code_t retval;
-
- if ((retval = ZSendPacket(buf, len, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "xmit_frag send: %s",
- error_message(retval));
- return(retval);
- }
-
- /* now we've sent it, mark it as not ack'ed */
-
- if (!(nacked = (ZNotAcked_t *)xmalloc(sizeof(ZNotAcked_t)))) {
- /* no space: just punt */
- syslog(LOG_WARNING, "xmit_frag nack malloc");
- return(ENOMEM);
- }
-
- if (!(savebuf = (char *)xmalloc(len))) {
- /* no space: just punt */
- syslog(LOG_WARNING, "xmit_frag pack malloc");
- return(ENOMEM);
- }
-
- (void) memcpy(savebuf, buf, len);
-
- nacked->na_rexmits = 0;
- nacked->na_packet = savebuf;
- nacked->na_srv_idx = 0;
- nacked->na_addr = ZGetDestAddr();
- nacked->na_packsz = len;
- nacked->na_uid = notice->z_uid;
- nacked->q_forw = nacked->q_back = nacked;
- nacked->na_abstimo = NOW + abs_timo;
-
- /* set a timer to retransmit when done */
- nacked->na_timer = timer_set_rel(rexmit_secs,
- rexmit,
- (void *) nacked);
- /* chain in */
- xinsque(nacked, nacklist);
- return(ZERR_NONE);
-}
-
-/*
- * Send the notice to the client. After transmitting, put it onto the
- * not ack'ed list.
- */
-
-void
-xmit(notice, dest, auth, client)
- ZNotice_t *notice;
- struct sockaddr_in *dest;
- int auth;
- ZClient_t *client;
-{
- caddr_t noticepack;
- register ZNotAcked_t *nacked;
- int packlen;
- Code_t retval;
-
-#if 0
- zdbug((LOG_DEBUG,"xmit"));
-#endif
-
- if (!(noticepack = (caddr_t) xmalloc(sizeof(ZPacket_t)))) {
- syslog(LOG_ERR, "xmit malloc");
- return; /* DON'T put on nack list */
- }
-
- packlen = sizeof(ZPacket_t);
-
- if (auth && client) { /*
- we are distributing authentic and
- we have a pointer to auth info
- */
-#ifdef KERBEROS
-
- if ((retval = ZFormatAuthenticNotice(notice,
- noticepack,
- packlen,
- &packlen,
- client->zct_cblock))
- != ZERR_NONE) {
- syslog(LOG_ERR, "xmit auth format: %s",
- error_message(retval));
- xfree(noticepack);
- return;
- }
-#else /* !KERBEROS */
- notice->z_auth = 1;
- if ((retval = ZFormatSmallRawNotice(notice,
- noticepack,
- &packlen))
- != ZERR_NONE) {
- syslog(LOG_ERR, "xmit auth/raw format: %s",
- error_message(retval));
- xfree(noticepack);
- return;
- }
-#endif /* KERBEROS */
- } else {
- notice->z_auth = 0;
- notice->z_authent_len = 0;
- notice->z_ascii_authent = (char *)"";
- if ((retval = ZFormatSmallRawNotice(notice,
- noticepack,
- &packlen)) != ZERR_NONE) {
- syslog(LOG_ERR, "xmit format: %s",
- error_message(retval));
- xfree(noticepack);
- return; /* DON'T put on nack list */
- }
- }
-#if 0
- zdbug((LOG_DEBUG," to %s/%d",inet_ntoa(dest->sin_addr),
- ntohs(dest->sin_port)));
-#endif
- if ((retval = ZSetDestAddr(dest)) != ZERR_NONE) {
- syslog(LOG_WARNING, "xmit set addr: %s",
- error_message(retval));
- xfree(noticepack);
- return;
- }
- if ((retval = ZSendPacket(noticepack, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "xmit xmit: (%s/%d) %s",
- inet_ntoa(dest->sin_addr), ntohs(dest->sin_port),
- error_message(retval));
- xfree(noticepack);
- return;
- }
-
- /* now we've sent it, mark it as not ack'ed */
-
- if (!(nacked = (ZNotAcked_t *)xmalloc(sizeof(ZNotAcked_t)))) {
- /* no space: just punt */
- syslog(LOG_WARNING, "xmit nack malloc");
- xfree(noticepack);
- return;
- }
-
- nacked->na_rexmits = 0;
- nacked->na_packet = noticepack;
- nacked->na_srv_idx = 0; /* XXX */
- nacked->na_addr = *dest;
- nacked->na_packsz = packlen;
- nacked->na_uid = notice->z_uid;
- nacked->q_forw = nacked->q_back = nacked;
- nacked->na_abstimo = NOW + abs_timo;
-
- /* set a timer to retransmit when done */
- nacked->na_timer = timer_set_rel(rexmit_secs,
- rexmit,
- (void *) nacked);
- /* chain in */
- xinsque(nacked, nacklist);
-
-}
-
-
-/*
- * Retransmit the packet specified. If we have timed out or retransmitted
- * too many times, punt the packet and initiate the host recovery algorithm
- * Else, increment the count and re-send the notice packet.
- */
-
-void
-#ifdef __STDC__
-rexmit(void *arg)
-#else
-rexmit(arg)
- void *arg;
-#endif
-{
- register ZNotAcked_t *nackpacket = (ZNotAcked_t*) arg;
- int retval;
- ZNotice_t dummy_notice;
- register ZClient_t *client;
-
-#if 1
- zdbug((LOG_DEBUG,"rexmit"));
-#endif
-
- if (++(nackpacket->na_rexmits) > num_rexmits ||
- NOW > nackpacket->na_abstimo) {
- /* possibly dead client */
-
- dummy_notice.z_port = nackpacket->na_addr.sin_port;
-
- client = client_which_client(&nackpacket->na_addr,
- &dummy_notice);
-
- /* unlink & free packet */
- xremque(nackpacket);
- xfree(nackpacket->na_packet);
- xfree(nackpacket);
-
- /* initiate recovery */
- if (client)
- server_recover(client);
- return;
- }
-
- /* retransmit the packet */
-
-#if 0
- zdbug((LOG_DEBUG," to %s/%d",
- inet_ntoa(nackpacket->na_addr.sin_addr),
- ntohs(nackpacket->na_addr.sin_port)));
-#endif
- if ((retval = ZSetDestAddr(&nackpacket->na_addr))
- != ZERR_NONE) {
- syslog(LOG_WARNING, "rexmit set addr: %s",
- error_message(retval));
- goto requeue;
-
- }
- if ((retval = ZSendPacket(nackpacket->na_packet,
- nackpacket->na_packsz, 0)) != ZERR_NONE)
- syslog(LOG_WARNING, "rexmit xmit: %s", error_message(retval));
-
-requeue:
- /* reset the timer */
- nackpacket->na_timer = timer_set_rel(rexmit_secs,
- rexmit,
- (void *) nackpacket);
- return;
-
-}
-
-/*
- * Send an acknowledgement to the sending client, by sending back the
- * header from the original notice with the z_kind field changed to either
- * SERVACK or SERVNAK, and the contents of the message either SENT or
- * NOT_SENT, depending on the value of the sent argument.
- */
-
-void
-clt_ack(notice, who, sent)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- ZSentType sent;
-{
- ZNotice_t acknotice;
- ZPacket_t ackpack;
- int packlen;
- int notme = 0;
- char *sent_name;
- Code_t retval;
-
- if (bdumping) { /* don't ack while dumping */
-#if 1
- zdbug((LOG_DEBUG,"bdumping, no ack"));
-#endif
- return;
- }
-
- acknotice = *notice;
-
- acknotice.z_kind = SERVACK;
- switch (sent) {
- case SENT:
- acknotice.z_message = ZSRVACK_SENT;
- sent_name = "sent";
- break;
- case NOT_FOUND:
- acknotice.z_message = ZSRVACK_FAIL;
- acknotice.z_kind = SERVNAK;
- sent_name = "fail";
- break;
- case AUTH_FAILED:
- acknotice.z_kind = SERVNAK;
- acknotice.z_message = ZSRVACK_NOTSENT;
- sent_name = "nak/not_sent";
- break;
- case NOT_SENT:
- acknotice.z_message = ZSRVACK_NOTSENT;
- sent_name = "not_sent";
- break;
- default:
- abort ();
- }
-
-#if 0
- zdbug((LOG_DEBUG,"clt_ack type %s for %d to %s/%d",
- sent_name,
- ntohs(notice->z_port),
- inet_ntoa(who->sin_addr),
- ntohs(who->sin_port)));
-#endif
-
- if (!server_which_server(who) &&
- (hostm_find_server(&who->sin_addr) != me_server)) {
-#if 0
- zdbug((LOG_DEBUG,"not me"));
-#endif
- notme = 1;
- }
-
- acknotice.z_multinotice = "";
-
- /* leave room for the trailing null */
- acknotice.z_message_len = strlen(acknotice.z_message) + 1;
-
- packlen = sizeof(ackpack);
-
- if ((retval = ZFormatSmallRawNotice(&acknotice,
- ackpack,
- &packlen)) != ZERR_NONE) {
- syslog(LOG_ERR, "clt_ack format: %s",error_message(retval));
- return;
- }
- if ((retval = ZSetDestAddr(who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "clt_ack set addr: %s",
- error_message(retval));
- return;
- }
- if ((retval = ZSendPacket(ackpack, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "clt_ack xmit: %s", error_message(retval));
- return;
- }
- else
- zdbug ((LOG_DEBUG, "packet sent"));
- if (notme)
- hostm_deathgram(who, me_server);
- return;
-}
-
-/*
- * An ack has arrived.
- * remove the packet matching this notice from the not-yet-acked queue
- */
-
-static void
-nack_cancel(notice, who)
- register ZNotice_t *notice;
- struct sockaddr_in *who;
-{
- register ZNotAcked_t *nacked;
-
- /* search the not-yet-acked list for this packet, and
- flush it. */
-#if 0
- zdbug((LOG_DEBUG, "nack_cancel: %s:%08X,%08X",
- inet_ntoa (notice->z_uid.zuid_addr),
- notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec));
-#endif
- for (nacked = nacklist->q_forw;
- nacked != nacklist;
- nacked = nacked->q_forw)
- if ((nacked->na_addr.sin_addr.s_addr == who->sin_addr.s_addr) &&
- (nacked->na_addr.sin_port == who->sin_port))
- if (ZCompareUID(&nacked->na_uid, &notice->z_uid)) {
- timer_reset(nacked->na_timer);
- xfree(nacked->na_packet);
- xremque(nacked);
- xfree(nacked);
- return;
- }
-#if 1
- zdbug((LOG_DEBUG,"nack_cancel: nack not found %s:%08X,%08X",
- inet_ntoa (notice->z_uid.zuid_addr),
- notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec));
-#endif
- return;
-}
-
-/* for compatibility when sending subscription information to old clients */
-#ifdef OLD_COMPAT
-#define OLD_ZEPHYR_VERSION "ZEPH0.0"
-#endif /* OLD_COMPAT */
-
-/*
- * Dispatch a ZEPHYR_CTL notice.
- */
-
-Code_t
-control_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
-{
- register char *opcode = notice->z_opcode;
- ZClient_t *client;
- ZHostList_t *host;
- Code_t retval;
- int wantdefs;
-
- /*
- * ZEPHYR_CTL Opcodes expected are:
- * BOOT (inst HM): host has booted; flush data.
- * CLIENT_SUBSCRIBE: process with the subscription mananger.
- * CLIENT_UNSUBSCRIBE: ""
- * CLIENT_CANCELSUB: ""
- */
-
- zdbug ((LOG_DEBUG, "ctl_disp: opc=%s", opcode));
-
- if (!strcasecmp (notice->z_class_inst, ZEPHYR_CTL_HM))
- return(hostm_dispatch(notice, auth, who, server));
- else if (!strcmp (opcode, CLIENT_GIMMESUBS) ||
- !strcmp (opcode, CLIENT_GIMMEDEFS)) {
- /* this special case is before the auth check so that
- someone who has no subscriptions does NOT get a SERVNAK
- but rather an empty list. Note we must therefore
- check authentication inside subscr_sendlist */
-#ifdef OLD_COMPAT
- /* only acknowledge if *not* old version; the old version
- acknowledges the packet with the reply */
- if (strcmp (notice->z_version, OLD_ZEPHYR_VERSION))
- ack(notice, who);
-#else /* !OLD_COMPAT */
- ack(notice, who);
-#endif /* OLD_COMPAT */
- subscr_sendlist(notice, auth, who);
- return(ZERR_NONE);
- } else if (!auth) {
-#if 0
- zdbug((LOG_DEBUG,"unauth ctrl_disp"));
-#endif
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
-
- /* the rest of the expected opcodes modify state; check for
- unlocked host first */
- host = hostm_find_host(&who->sin_addr);
- if (host && host->zh_locked)
- return(ZSRV_REQUEUE);
-
- wantdefs = strcmp (opcode, CLIENT_SUBSCRIBE_NODEFS);
- if (!wantdefs || !strcmp (opcode, CLIENT_SUBSCRIBE)) {
- /* subscription notice */
- if (!(client = client_which_client(who, notice))) {
- if ((retval = client_register(notice,
- who,
- &client,
- server,
- wantdefs)) != ZERR_NONE)
- {
- syslog(LOG_NOTICE,
- "subscr. register %s/%s/%d failed: %s",
- notice->z_sender,
- inet_ntoa(who->sin_addr),
- ntohs(notice->z_port),
- error_message(retval));
- if (server == me_server) {
- if (retval == ZSRV_BADSUBPORT) {
- clt_ack(notice, who, AUTH_FAILED);
- } else
- hostm_deathgram(who, me_server);
- }
- return(ZERR_NONE);
- }
- if (!(client = client_which_client(who, notice))) {
- syslog(LOG_CRIT, "subscr reg. failure");
- abort();
- }
- }
- if (strcmp (client->zct_principal->string, notice->z_sender)) {
- /* you may only subscribe for your own clients */
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
-#ifdef KERBEROS
- /* in case it's changed */
- (void) memcpy((caddr_t) client->zct_cblock, (caddr_t) ZGetSession(),
- sizeof(C_Block));
-#endif
- if ((retval = subscr_subscribe(client,notice)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr failed: %s",
- error_message(retval));
- if (server == me_server)
- nack(notice, who);
- return(ZERR_NONE);
- }
- } else if (!strcmp(opcode, CLIENT_UNSUBSCRIBE)) {
- if ((client = client_which_client(who,notice)) != NULLZCNT) {
- if (strcmp(client->zct_principal->string, notice->z_sender)) {
- /* you may only cancel for your own clients */
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
-#if 0
- if (zdebug) {
- if (server == me_server)
- syslog (LOG_DEBUG,
- "subscription cancel for %s/%d\n",
- inet_ntoa (who->sin_addr),
- ntohs (who->sin_port));
- else
- syslog (LOG_DEBUG,
- "subscription cancel for %s/%d from %s\n",
- inet_ntoa (who->sin_addr),
- ntohs (who->sin_port),
- server->addr);
- }
-#endif
- (void) subscr_cancel(who, notice);
- } else {
- nack(notice, who);
- return(ZERR_NONE);
- }
- } else if (!strcmp(opcode, CLIENT_CANCELSUB)) {
- /* canceling subscriptions implies I can punt info about
- this client */
- if ((client = client_which_client(who,notice)) != NULLZCNT) {
- if (strcmp(client->zct_principal->string, notice->z_sender)) {
- /* you may only cancel for your own clients */
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
- if (host) {
- /* don't flush locations here, let him
- do it explicitly */
-#if 0
- zdbug((LOG_DEBUG, "cancelsub clt_dereg %s/%d",
- inet_ntoa (who->sin_addr),
- ntohs (who->sin_port)));
-#endif
- hostm_lose_ignore(client);
- (void) client_deregister(client, host, 0);
- }
-
- }
- if (!client || !host) {
-#if 0
- zdbug((LOG_DEBUG,"can_sub not found client"));
-#endif
- if (server == me_server)
- nack(notice, who);
- return(ZERR_NONE);
- }
- } else {
- syslog(LOG_WARNING, "unknown ctl opcode %s", opcode);
- if (server == me_server)
- nack(notice, who);
- return(ZERR_NONE);
- }
-
- if (server == me_server) {
- ack(notice, who);
- server_forward(notice, auth, who);
- }
- return(ZERR_NONE);
-}
-
-
diff --git a/server/hostm.c b/server/hostm.c
deleted file mode 100644
index 4a029ea..0000000
--- a/server/hostm.c
+++ /dev/null
@@ -1,1045 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains functions for communicating with the HostManager.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#ifndef lint
-#ifndef SABER
-static char rcsid_hostm_c[] = "$Id$";
-#endif
-#endif
-
-#include "zserver.h"
-#include <sys/socket.h> /* for AF_INET */
-
-/*
- *
- * External functions:
- *
- * void hostm_dispatch(notice, auth, who, server)
- * ZNotice_t *notice;
- * int auth;
- * struct sockaddr_in *who;
- * ZServerDesc_t *server;
- *
- * void hostm_flush(host, server)
- * ZHostList_t *host;
- * ZServerDesc_t *server;
- *
- * void hostm_transfer(host, server)
- * ZHostList_t *host;
- * ZServerDesc_t *server;
- *
- * ZHostList_t *hostm_find_host(addr)
- * struct in_addr *addr;
- *
- * ZServerDesc_t *hostm_find_server(addr)
- * struct in_addr *addr;
- *
- * void hostm_shutdown()
- *
- * void hostm_losing(client, host)
- * ZClient_t *client;
- * ZHostList_t *host;
- *
- * void hostm_deathgram(sin, server)
- * struct sockaddr_in *sin;
- * ZServerDesc_t *server;
- *
- * void hostm_dump_hosts(fp)
- * FILE *fp;
- */
-
-/*
- * This module maintains two important structures.
- * all_hosts is an array of all currently known hosts, and which server
- * is responsible for that host. This list is kept sorted by IP address
- * so that lookups can be fast (binary search). num_hosts contains the
- * number of hosts to be found in the array.
- *
- * The losing hosts list is a linked list of all the clients (and their hosts)
- * whose existence is in doubt. Any host on this list has already been sent
- * a ping and is expected to reply immediately.
- * As usual, the first element of the list is a placeholder header so we
- * know when the list has been completely scanned.
- */
-
-struct hostlist {
- ZHostList_t *host; /* ptr to host struct */
- int server_index; /* index of server in the table */
-};
-
-typedef struct _losinghost {
- struct _losinghost *q_forw;
- struct _losinghost *q_back;
- struct _ZHostList_t *lh_host;
- timer lh_timer;
- struct _ZClient_t *lh_client;
-} losinghost;
-
-#define NULLHLT ((struct hostlist *) 0)
-
-static struct hostlist *all_hosts;
-
-static int num_hosts = 0; /* number of hosts in all_hosts */
-static long lose_timo = LOSE_TIMO;
-
-static losinghost *losing_hosts; /* queue of pings for hosts we
- doubt are really there */
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static void host_detach P((register ZHostList_t *host, ZServerDesc_t *server)),
- insert_host P((ZHostList_t *host, ZServerDesc_t *server)),
- remove_host P((ZHostList_t *host));
-static void host_not_losing P((struct sockaddr_in *who)),
- host_lost P((void *which)),
- ping P((struct sockaddr_in *sin));
-static Code_t host_attach P((struct sockaddr_in *who, ZServerDesc_t *server));
-
-#undef P
-
-/*
- * We received a HostManager packet. process accordingly.
- */
-
-/*ARGSUSED*/
-Code_t
-hostm_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
-{
- ZServerDesc_t *owner;
- ZHostList_t *host = NULLZHLT;
- char *opcode = notice->z_opcode;
- Code_t retval;
-
-#if 0
- zdbug((LOG_DEBUG,"hm_disp"));
-#endif
-
- host = hostm_find_host(&who->sin_addr);
- if (host && host->zh_locked)
- return(ZSRV_REQUEUE);
-
- if (notice->z_kind == HMACK) {
- host_not_losing(who);
- return(ZERR_NONE);
- } else if (notice->z_kind != HMCTL) {
-#if 0
- zdbug((LOG_DEBUG, "bogus HM packet"));
-#endif
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
- owner = hostm_find_server(&who->sin_addr);
- if (!strcmp(opcode, HM_ATTACH)) {
-#if 0
- zdbug((LOG_DEBUG,"attach %s",inet_ntoa(who)));
-#endif
- if (owner == server) {
-#if 0
- zdbug((LOG_DEBUG,"no change"));
-#endif
- /* Same server owns him. do nothing */
- } else if (owner) {
- /* He has switched servers.
- he was lost but has asked server to work for him.
- We need to transfer him to server */
-#if 0
- zdbug((LOG_DEBUG,"hm_disp transfer"));
-#endif
- hostm_transfer(host, server);
- } else {
- /* no owner. attach him to server. */
- if ((retval = host_attach(who, server))
- != ZERR_NONE) {
- syslog(LOG_WARNING, "hattach failed: %s",
- error_message(retval));
- return(retval);
- }
-
- }
- if (server == me_server) {
- server_forward(notice, auth, who);
- ack(notice, who);
- }
- } else if (!strcmp(opcode, HM_BOOT)) {
-#if 0
- zdbug((LOG_DEBUG, "boot %s (server %s)",
- inet_ntoa(who->sin_addr),
- server->addr));
-#endif
- /* Booting is just like flushing and attaching */
- if (owner) /* if owned, flush */
- hostm_flush(host, owner);
- if ((retval = host_attach(who, server)) != ZERR_NONE) {
- syslog(LOG_WARNING, "hattach failed: %s",
- error_message(retval));
- return(retval);
- }
- if (server == me_server) {
- server_forward(notice, auth, who);
- ack(notice, who);
- }
- } else if (!strcmp(opcode, HM_FLUSH)) {
-#if 0
- zdbug((LOG_DEBUG, "hm_flush %s (server %s)",
- inet_ntoa(who->sin_addr),
- server->addr));
-#endif
- if (!owner)
- return(ZERR_NONE);
- /* flush him */
- hostm_flush(host, owner);
- if (server == me_server)
- server_forward(notice, auth, who);
- } else if (!strcmp(opcode, HM_DETACH)) {
-#if 0
- zdbug((LOG_DEBUG, "hm_detach %s",inet_ntoa(who_sin_addr)));
-#endif
- /* ignore it */
- } else {
- syslog(LOG_WARNING, "hm_disp: unknown opcode %s",opcode);
- return(ZERR_NONE);
- }
- return(ZERR_NONE);
-}
-
-/*
- * Flush all information about this host. Remove any losing host entries,
- * deregister all the clients, flush any user locations, and remove the host
- * from its server.
- * The caller is responsible for informing other servers of this flush
- * (if appropriate).
- */
-
-void
-hostm_flush(host, server)
- ZHostList_t *host;
- ZServerDesc_t *server;
-{
- register ZClientList_t *clist = NULLZCLT, *clt;
- losinghost *lhp, *lhp2;
-
- START_CRITICAL_CODE;
-
- if (!host) {
- syslog(LOG_WARNING, "null host flush");
- return;
- }
-
-#if 0
- zdbug ((LOG_DEBUG,"hostm_flush %s", inet_ntoa (host->zh_addr.sin_addr)));
-#endif
-
- if (losing_hosts)
- for (lhp = losing_hosts->q_forw;
- lhp != losing_hosts;)
- if (lhp->lh_host == host) {
- lhp2 = lhp->q_back;
- timer_reset(lhp->lh_timer);
- xremque(lhp);
- xfree(lhp);
- lhp = lhp2->q_forw;
- } else
- lhp = lhp->q_forw;
-
- if ((clist = host->zh_clients) != NULLZCLT) {
- for (clt = clist->q_forw; clt != clist; clt = clist->q_forw) {
- /* client_deregister frees this client & subscriptions
- & locations and remque()s the client */
-#if 0
- if (zdebug)
- syslog (LOG_DEBUG, "hostm_flush clt_dereg %s/%d",
- inet_ntoa(host->zh_addr.sin_addr),
- ntohs (clt->zclt_client->zct_sin.sin_port));
-#endif
- client_deregister(clt->zclt_client, host, 1);
- }
- }
-
- uloc_hflush(&host->zh_addr.sin_addr);
- host_detach(host, server);
-
- END_CRITICAL_CODE;
-
- return;
-}
-
-/*
- * send a shutdown to each of our hosts
- */
-
-void
-hostm_shutdown()
-{
- register ZHostList_t *hosts = otherservers[me_server_idx].zs_hosts;
- register ZHostList_t *host;
- int newserver, i;
-
-#if 0
- zdbug((LOG_DEBUG,"hostm_shutdown"));
-#endif
- if (!hosts)
- return;
-
- for (i = 0; i < nservers; i++){
- if (i == me_server_idx) continue;
- if (otherservers[i].zs_state == SERV_UP)
- break;
- }
- if (i == nservers) /* no other servers are up */
- newserver = 0;
- else
- newserver = 1;
-
- /* kill them all */
- for (host = hosts->q_forw;
- host != hosts;
- host = host->q_forw) {
- /* recommend a random, known up server */
- if (newserver) {
- do
- newserver = (int) (random() % (nservers - 1)) + 1;
- while (newserver == limbo_server_idx() ||
- (otherservers[newserver].zs_state != SERV_UP &&
- otherservers[newserver].zs_state != SERV_TARDY) ||
- newserver == me_server_idx);
- hostm_deathgram(&host->zh_addr, &otherservers[newserver]);
- } else
- hostm_deathgram(&host->zh_addr, NULLZSDT);
- }
- return;
-}
-
-
-/*
- * The client on the host is not acknowledging any packets. Ping the
- * host and set a timeout.
- */
-
-void
-hostm_losing(client, host)
- ZClient_t *client;
- ZHostList_t *host;
-{
- losinghost *newhost;
-
-#if 0
- zdbug((LOG_DEBUG,"losing host"));
-#endif
- if (!losing_hosts) {
- if (!(losing_hosts = (losinghost *)
- xmalloc(sizeof(losinghost)))) {
- syslog(LOG_ERR, "no mem losing host");
- return;
- }
- losing_hosts->q_forw = losing_hosts->q_back = losing_hosts;
- }
- for (newhost = losing_hosts->q_forw;
- newhost != losing_hosts;
- newhost = newhost->q_forw)
- if (newhost->lh_client == client) {
-#if 0
- zdbug((LOG_DEBUG,"clt already losing"));
-#endif
- return;
- }
- if (!(newhost = (losinghost *) xmalloc(sizeof(losinghost)))) {
- syslog(LOG_ERR, "no mem losing host 2");
- return;
- }
-
- /* send a ping */
- ping(&host->zh_addr);
- newhost->lh_host = host;
- newhost->lh_client = client;
- newhost->lh_timer = timer_set_rel(lose_timo, host_lost, (void *) newhost);
- xinsque(newhost, losing_hosts);
- return;
-}
-
-/*
- * The host did not respond to the ping, so we punt him
- */
-
-static void
-host_lost(arg)
- void* arg;
-{
- losinghost *which = (losinghost *) arg;
- ZServerDesc_t *server;
- ZNotice_t notice;
- struct sockaddr_in who;
- Code_t retval;
- char *buffer;
- int len;
-
- START_CRITICAL_CODE;
-
- server = hostm_find_server(&which->lh_host->zh_addr.sin_addr);
-#if 1
- zdbug ((LOG_DEBUG,"lost host %s (server %s)",
- inet_ntoa(which->lh_host->zh_addr.sin_addr),
- server ? server->addr : "<NONE>"));
-#endif
-
- if (!server) {
-#if 1
- zdbug((LOG_DEBUG,"no server"));
-#endif
- xremque(which);
- xfree(which);
- END_CRITICAL_CODE;
- return;
- }
- xremque(which);
- hostm_flush(which->lh_host, server);
-
- (void) memset((caddr_t)&notice, 0, sizeof(notice));
-
- /* tell other servers to flush this host */
- notice.z_kind = HMCTL;
- notice.z_auth = 0;
- notice.z_port = hm_port;
- notice.z_class = ZEPHYR_CTL_CLASS;
- notice.z_class_inst = ZEPHYR_CTL_HM;
- notice.z_opcode = HM_FLUSH;
- notice.z_sender = "HM";
- notice.z_recipient = "";
- notice.z_default_format = "";
- notice.z_num_other_fields = 0;
- notice.z_message_len = 0;
-
- /* generate the other fields */
- retval = ZFormatNotice(&notice, &buffer, &len, ZNOAUTH);
- if (retval != ZERR_NONE)
- return;
- xfree(buffer);
-
- /* forge a from address */
- (void) memset((char *) &who, 0, sizeof(who));
- who.sin_addr.s_addr = which->lh_host->zh_addr.sin_addr.s_addr;
- who.sin_port = hm_port;
- who.sin_family = AF_INET;
-
- server_forward(&notice, 0, &who); /* unauthentic */
-
- xfree(which);
-
- END_CRITICAL_CODE;
-
- return;
-}
-
-/*
- * The host responded to the ping, so we flush the losing clients on this host.
- */
-
-static void
-host_not_losing(who)
- struct sockaddr_in *who;
-{
- losinghost *lhp, *lhp2;
-
- if (!losing_hosts)
- return;
-
- START_CRITICAL_CODE;
-
- for (lhp = losing_hosts->q_forw;
- lhp != losing_hosts;)
- if (lhp->lh_host->zh_addr.sin_addr.s_addr == who->sin_addr.s_addr) {
- /* go back, since remque will change things */
- lhp2 = lhp->q_back;
- timer_reset(lhp->lh_timer);
-#if 1
- if (zdebug || 1)
- syslog (LOG_DEBUG,"lost client %s/%d",
- inet_ntoa(lhp->lh_client->zct_sin.sin_addr),
- ntohs(lhp->lh_client->zct_sin.sin_port));
-#endif
- /* deregister all subscriptions, and flush locations
- associated with the client. */
-#if 0
- if (zdebug)
- syslog(LOG_DEBUG,"h_not_lose clt_dereg");
-#endif
- server_kill_clt(lhp->lh_client);
- client_deregister(lhp->lh_client, lhp->lh_host, 1);
- xremque(lhp);
- xfree(lhp);
- /* now that the remque adjusted the linked list,
- we go forward again */
- lhp = lhp2->q_forw;
- } else
- lhp = lhp->q_forw;
-
- END_CRITICAL_CODE;
-
- return;
-}
-
-/*
- * A client is being de-registered, so remove it from the losing_host list,
- * if it is there.
- */
-
-void
-hostm_lose_ignore(client)
- ZClient_t *client;
-{
- losinghost *lhp, *lhp2;
-
- if (!losing_hosts)
- return;
-
- START_CRITICAL_CODE;
-
- for (lhp = losing_hosts->q_forw;
- lhp != losing_hosts;)
- /* if client matches, remove it */
- if (lhp->lh_client == client) {
- /* go back, since remque will change things */
- lhp2 = lhp->q_back;
- timer_reset(lhp->lh_timer);
-#if 0
- zdbug((LOG_DEBUG,"hm_l_ign client %s/%d",
- inet_ntoa(client->zct_sin),
- ntohs(client->zct_sin.sin_port)));
-#endif
- xremque(lhp);
- xfree(lhp);
- /* now that the remque adjusted the linked list,
- we go forward again */
- lhp = lhp2->q_forw;
- } else
- lhp = lhp->q_forw;
-
- END_CRITICAL_CODE;
-
- return;
-}
-
-/*
- * transfer this host to server's ownership. The caller must update the
- * other servers.
- */
-
-void
-hostm_transfer(host, server)
- ZHostList_t *host;
- ZServerDesc_t *server;
-{
- /* we need to unlink and relink him, and change the table entry */
-#if 1
- if (zdebug)
- syslog (LOG_DEBUG, "hostm_transfer %s to %s",
- inet_ntoa (host->zh_addr.sin_addr), server->addr);
-#endif
-
- /* is this the same server? */
- if (hostm_find_server(&host->zh_addr.sin_addr) == server)
- return;
-
- START_CRITICAL_CODE;
-
- /* remove from old server's queue */
- xremque(host);
-
- /* switch servers in the table */
- remove_host(host);
- insert_host(host, server);
-
- /* insert in our queue */
- xinsque(host, server->zs_hosts);
-
- END_CRITICAL_CODE;
-
- return;
-}
-
-
-/*
- * attach the host with return address in who to the server.
- */
-
-static Code_t
-host_attach(who, server)
- struct sockaddr_in *who;
- ZServerDesc_t *server;
-{
- register ZHostList_t *hlist;
- register ZClientList_t *clist;
-
- START_CRITICAL_CODE;
-
-#if 0
- if (zdebug)
- syslog (LOG_DEBUG, "host_attach %s to %s",
- inet_ntoa (who->sin_addr), server->addr);
-#endif
- /* allocate a header */
- if (!(hlist = (ZHostList_t *) xmalloc(sizeof(ZHostList_t)))) {
- syslog(LOG_WARNING, "hm_attach alloc");
- END_CRITICAL_CODE;
- return(ENOMEM);
- }
- /* set up */
- if (!(clist = (ZClientList_t *)xmalloc(sizeof(ZClientList_t)))) {
- xfree(hlist);
- END_CRITICAL_CODE;
- return(ENOMEM);
- }
- clist->zclt_client = NULLZCNT;
- clist->q_forw = clist->q_back = clist;
-
- hlist->zh_clients = clist;
- hlist->zh_addr = *who;
- hlist->q_forw = hlist->q_back = hlist;
- hlist->zh_locked = 0;
-
- /* add to table */
- insert_host(hlist, server);
-
- /* chain in to the end of the list */
- xinsque(hlist, server->zs_hosts->q_back);
-
- END_CRITICAL_CODE;
-
- return(ZERR_NONE);
-}
-
-/*
- * detach the host at addr from the server
- * Warning: this routine assumes all the clients have already been removed
- * from this host.
- */
-
-static void
-host_detach(host, server)
- register ZHostList_t *host;
- ZServerDesc_t *server;
-{
- ZServerDesc_t *server2;
-
- START_CRITICAL_CODE;
-
- /* undo what we did in host_attach */
- server2 = hostm_find_server (&host->zh_addr.sin_addr);
-
- if (server2 != server) {
- syslog(LOG_WARNING,
- "host_detach: wrong server: %s from %s, found %s",
- inet_ntoa (host->zh_addr.sin_addr),
- server->addr,
- server2->addr);
- END_CRITICAL_CODE;
- return;
- }
-
-
- /* all the clients have already been freed */
- xfree(host->zh_clients);
-
- /* unchain */
- xremque(host);
-
- /* remove from table */
- remove_host(host);
-
- xfree(host);
-
- END_CRITICAL_CODE;
-
- return;
-}
-
-/*
- * Build hostmanager recipient name.
- */
-static char *
-hm_recipient ()
-{
- static char *recipient;
- char *realm;
-
- if (recipient)
- return recipient;
-
- realm = ZGetRealm ();
- if (!realm)
- realm = "???";
- recipient = (char *) xmalloc (strlen (realm) + 4);
- strcpy (recipient, "hm@");
- strcat (recipient, realm);
- return recipient;
-}
-
-/*
- * Send a shutdown message to the HostManager at sin, recommending him to
- * use server
- */
-
-void
-hostm_deathgram(sin, server)
- struct sockaddr_in *sin;
- ZServerDesc_t *server;
-{
- Code_t retval;
- int shutlen;
- ZNotice_t shutnotice;
- char *shutpack;
-
-#if 0
- zdbug((LOG_DEBUG,"deathgram %s",inet_ntoa(*sin)));
-#endif
-
- /* fill in the shutdown notice */
-
- shutnotice.z_kind = HMCTL;
- shutnotice.z_port = sock_sin.sin_port; /* we are sending it */
- shutnotice.z_class = HM_CTL_CLASS;
- shutnotice.z_class_inst = HM_CTL_SERVER;
- shutnotice.z_opcode = SERVER_SHUTDOWN;
- shutnotice.z_sender = HM_CTL_SERVER;
- shutnotice.z_recipient = hm_recipient ();
- shutnotice.z_default_format = "";
- shutnotice.z_num_other_fields = 0;
-
- if (server) {
- shutnotice.z_message = server->addr;
- shutnotice.z_message_len = strlen(shutnotice.z_message) + 1;
-#if 0
- zdbug((LOG_DEBUG, "suggesting %s",shutnotice.z_message));
-#endif
- } else {
- shutnotice.z_message = NULL;
- shutnotice.z_message_len = 0;
- }
-
- if ((retval = ZFormatNotice(&shutnotice,
- &shutpack,
- &shutlen,
- ZNOAUTH)) != ZERR_NONE) {
- syslog(LOG_ERR, "hm_shut format: %s",error_message(retval));
- return;
- }
- if ((retval = ZSetDestAddr(sin)) != ZERR_NONE) {
- syslog(LOG_WARNING, "hm_shut set addr: %s",
- error_message(retval));
- xfree(shutpack); /* free allocated storage */
- return;
- }
- /* don't wait for ack! */
- if ((retval = ZSendPacket(shutpack, shutlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "hm_shut xmit: %s", error_message(retval));
- xfree(shutpack); /* free allocated storage */
- return;
- }
- xfree(shutpack); /* free allocated storage */
- return;
-}
-
-/*
- * Send a ping to the HostManager at sin
- */
-
-static void
-ping(sin)
- struct sockaddr_in *sin;
-{
- Code_t retval;
- int shutlen;
- ZNotice_t shutnotice;
- char *shutpack;
-
-#if 0
- zdbug((LOG_DEBUG,"ping %s",inet_ntoa(*sin)));
-#endif
-
- /* fill in the shutdown notice */
-
- shutnotice.z_kind = HMCTL;
- shutnotice.z_port = sock_sin.sin_port;
- shutnotice.z_class = HM_CTL_CLASS;
- shutnotice.z_class_inst = HM_CTL_SERVER;
- shutnotice.z_opcode = SERVER_PING;
- shutnotice.z_sender = HM_CTL_SERVER;
- shutnotice.z_recipient = hm_recipient ();
- shutnotice.z_message = NULL;
- shutnotice.z_message_len = 0;
- shutnotice.z_default_format = "";
- shutnotice.z_num_other_fields = 0;
-
- if ((retval = ZFormatNotice(&shutnotice,
- &shutpack,
- &shutlen,
- ZNOAUTH)) != ZERR_NONE) {
- syslog(LOG_ERR, "hm_ping format: %s",error_message(retval));
- return;
- }
- if ((retval = ZSetDestAddr(sin)) != ZERR_NONE) {
- syslog(LOG_WARNING, "hm_ping set addr: %s",
- error_message(retval));
- xfree(shutpack); /* free allocated storage */
- return;
- }
- /* don't wait for ack */
- if ((retval = ZSendPacket(shutpack, shutlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "hm_ping xmit: %s", error_message(retval));
- xfree(shutpack); /* free allocated storage */
- return;
- }
- xfree(shutpack); /* free allocated storage */
- return;
-}
-
-/*
- * Routines for maintaining the host array.
- */
-
-/*
- * Binary search on the host table to find this host.
- */
-
-ZHostList_t *
-hostm_find_host(addr)
- struct in_addr *addr;
-{
- register int i, rlo, rhi;
-
- if (!all_hosts)
- return(NULLZHLT);
-
- /* i is the current host we are checking */
- /* rlo is the lowest we will still check, rhi is the highest we will
- still check */
-
- i = num_hosts >> 1; /* start in the middle */
- rlo = 0;
- rhi = num_hosts - 1; /* first index is 0 */
-
- while ((all_hosts[i].host)->zh_addr.sin_addr.s_addr != addr->s_addr) {
- if ((all_hosts[i].host)->zh_addr.sin_addr.s_addr < addr->s_addr)
- rlo = i + 1;
- else
- rhi = i - 1;
- if (rhi - rlo < 0)
- return(NULLZHLT);
- i = (rhi + rlo) >> 1; /* split the diff */
- }
- return(all_hosts[i].host);
-}
-
-/*
- * Binary search on the host table to find this host's server.
- */
-
-ZServerDesc_t *
-hostm_find_server(addr)
- struct in_addr *addr;
-{
- register int i, rlo, rhi;
-
- if (!all_hosts)
- return(NULLZSDT);
-
- /* i is the current host we are checking */
- /* rlo is the lowest we will still check, rhi is the highest we will
- still check */
-
- i = num_hosts >> 1; /* start in the middle */
- rlo = 0;
- rhi = num_hosts - 1; /* first index is 0 */
-
- while ((all_hosts[i].host)->zh_addr.sin_addr.s_addr != addr->s_addr) {
- if ((all_hosts[i].host)->zh_addr.sin_addr.s_addr < addr->s_addr)
- rlo = i + 1;
- else
- rhi = i - 1;
- if (rhi - rlo < 0)
- return(NULLZSDT);
- i = (rhi + rlo) >> 1; /* split the diff */
- }
- return(&otherservers[all_hosts[i].server_index]);
-}
-
-/*
- * Insert the host and server into the sorted array of hosts.
- */
-
-static void
-insert_host(host, server)
- ZHostList_t *host;
- ZServerDesc_t *server;
-{
- struct hostlist *oldlist;
- register int i = 0;
-
-#if 0
- zdbug ((LOG_DEBUG,"insert_host %s %s",
- inet_ntoa(host->zh_addr.sin_addr), server->addr));
-#endif
- if (hostm_find_host(&host->zh_addr.sin_addr))
- return;
-
- START_CRITICAL_CODE;
-
- num_hosts++;
- oldlist = all_hosts;
-
- if (!(all_hosts = (struct hostlist *) xmalloc(num_hosts * sizeof(struct hostlist)))) {
- syslog(LOG_CRIT, "insert_host: nomem");
- abort();
- }
-
- if (!oldlist) { /* this is the first */
- all_hosts[0].host = host;
- all_hosts[0].server_index = server - otherservers;
- END_CRITICAL_CODE;
- return;
- }
-
- /* copy old pointers */
- while ((i < (num_hosts - 1)) &&
- ((oldlist[i].host)->zh_addr.sin_addr.s_addr < host->zh_addr.sin_addr.s_addr)) {
- all_hosts[i] = oldlist[i];
- i++;
- }
- /* add this one */
- all_hosts[i].host = host;
- all_hosts[i++].server_index = server - otherservers;
-
- /* copy the rest */
- while (i < num_hosts) {
- all_hosts[i] = oldlist[i - 1];
- i++;
- }
- xfree(oldlist);
-
- END_CRITICAL_CODE;
-
-#if defined (DEBUG) && 0
- if (zdebug) {
- register int i = 0;
- for (i = 0; i < num_hosts; i++)
- syslog(LOG_DEBUG, "%d: %s %s",i,
- inet_ntoa ((all_hosts[i].host)->zh_addr.sin_addr),
- otherservers[all_hosts[i].server_index]->addr);
- }
-#endif
- return;
-}
-
-/*
- * remove the host from the array of known hosts.
- */
-
-static void
-remove_host(host)
- ZHostList_t *host;
-{
- struct hostlist *oldlist;
- register int i = 0;
-
-#if 0
- zdbug((LOG_DEBUG,"remove_host %s", inet_ntoa(host->zh_addr.sin_addr)));
-#endif
- if (!hostm_find_host(&host->zh_addr.sin_addr))
- return;
-
- START_CRITICAL_CODE;
-
- if (--num_hosts == 0) {
-#if 0
- zdbug((LOG_DEBUG,"last host"));
-#endif
- xfree (all_hosts);
- all_hosts = NULLHLT;
- END_CRITICAL_CODE;
- return;
- }
-
- oldlist = all_hosts;
-
- if (!(all_hosts = (struct hostlist *) xmalloc(num_hosts * sizeof(struct hostlist)))) {
- syslog(LOG_CRIT, "remove_host: nomem");
- abort();
- }
-
- /* copy old pointers */
- while (i < num_hosts && (oldlist[i].host)->zh_addr.sin_addr.s_addr < host->zh_addr.sin_addr.s_addr) {
- all_hosts[i] = oldlist[i];
- i++;
- }
-
- i++; /* skip over this one */
-
- /* copy the rest */
- while (i <= num_hosts) {
- all_hosts[i - 1] = oldlist[i];
- i++;
- }
- xfree (oldlist);
-
- END_CRITICAL_CODE;
-
- return;
-}
-
-/*
- * Assumes that SIGFPE is blocked when called; this is true if called from a
- * signal handler
- */
-
-void
-hostm_dump_hosts(fp)
- FILE *fp;
-{
- register int i;
- for (i = 0; i < num_hosts; i++) {
- (void) fprintf(fp, "%s/%d:\n",
- inet_ntoa((all_hosts[i].host)->zh_addr.sin_addr),
- all_hosts[i].server_index);
- client_dump_clients(fp,(all_hosts[i].host)->zh_clients);
- }
- return;
-}
-
-/*
- * Readjust server-array indices according to the supplied new vector.
- */
-
-void
-hostm_renumber_servers (srv)
- int *srv;
-{
- int i;
- for (i = 0; i < num_hosts; i++) {
- int idx = srv[all_hosts[i].server_index];
- if (idx < 0) {
- syslog (LOG_ERR, "hostm_renumber_servers error: [%d] = %d",
- all_hosts[i].server_index, idx);
- idx = 0;
- }
- all_hosts[i].server_index = idx;
- }
-}
diff --git a/server/kopt.c b/server/kopt.c
index 5d62688..3bcaa57 100644
--- a/server/kopt.c
+++ b/server/kopt.c
@@ -16,24 +16,22 @@
* Kerberos: krb_conf.h,v 4.0 89/01/23 09:59:27 jtkohl Exp
*/
+#include <zephyr/mit-copyright.h>
+#include "zserver.h"
+
#ifndef lint
#ifndef SABER
-static char *rcsid_rd_req_c =
+static const char *rcsid_rd_req_c =
"$Id$";
#endif /* lint */
#endif /* SABER */
-#ifdef KERBEROS
+#ifdef ZEPHYR_USES_KERBEROS
#ifndef NOENCRYPTION
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr.h>
-#include <stdio.h>
-#include <krb.h>
-#include "zserver.h"
-
/* Byte ordering */
-static int krbONE;
+#undef HOST_BYTE_ORDER
+static int krbONE = 1;
#define HOST_BYTE_ORDER (* (char *) &krbONE)
#define KRB_PROT_VERSION 4
@@ -64,9 +62,6 @@ static int krbONE;
#define KERB_ERR_PRINCIPAL_NOT_UNIQUE 9
#define KERB_ERR_NULL_KEY 10
-#include <sys/time.h>
-#include <string.h>
-
extern int krb_ap_req_debug;
extern struct timeval t_local;
@@ -97,34 +92,26 @@ typedef struct {
} KeySchedRec;
static KeySchedRec scheds[HASH_SIZE_1][HASH_SIZE_2];
-#ifdef __STDC__
-Sched* check_key_sched_cache (des_cblock key)
-#else
-Sched* check_key_sched_cache (key)
- des_cblock key;
-#endif
+Sched *check_key_sched_cache(key)
+ des_cblock key;
{
unsigned int hash_value = key[0] + key[1] * 256;
KeySchedRec *rec = scheds[hash_value % HASH_SIZE_1];
int i;
- for (i = HASH_SIZE_2 - 1; i >= 0; i--)
- if (rec[i].last_time_used
- && key[0] == rec[i].key[0]
- && !memcmp (key, rec[i].key, sizeof (des_cblock))) {
+ for (i = HASH_SIZE_2 - 1; i >= 0; i--) {
+ if (rec[i].last_time_used && key[0] == rec[i].key[0]
+ && !memcmp(key, rec[i].key, sizeof(des_cblock))) {
rec[i].last_time_used = last_use++;
return &rec[i].schedule;
}
+ }
return 0;
}
-#ifdef __STDC__
-void add_to_key_sched_cache (des_cblock key, Sched* sched)
-#else
-void add_to_key_sched_cache (key, sched)
- des_cblock key;
- Sched* sched;
-#endif
+void add_to_key_sched_cache(key, sched)
+ des_cblock key;
+ Sched *sched;
{
unsigned int hash_value = key[0] + key[1] * 256;
KeySchedRec *rec = scheds[hash_value % HASH_SIZE_1];
@@ -138,7 +125,7 @@ void add_to_key_sched_cache (key, sched)
if (rec[i].last_time_used < rec[oldest].last_time_used)
oldest = i;
}
- (void) memcpy (rec[oldest].key, key, sizeof (des_cblock));
+ memcpy (rec[oldest].key, key, sizeof(des_cblock));
rec[oldest].schedule = *sched;
rec[oldest].last_time_used = last_use++;
}
@@ -178,7 +165,7 @@ krb_set_key(key,cvt)
int cvt;
{
#ifdef NOENCRYPTION
- (void) memset(serv_key, 0, sizeof(serv_key));
+ memset(serv_key, 0, sizeof(serv_key));
return KSUCCESS;
#else /* Encrypt */
Sched *s;
@@ -187,15 +174,15 @@ krb_set_key(key,cvt)
if (cvt)
string_to_key(key,serv_key);
else
- (void) memcpy((char *)serv_key,key,8);
+ memcpy((char *)serv_key,key,8);
s = check_key_sched_cache (serv_key);
if (s) {
serv_ksched = *s;
return 0;
}
- ret = des_key_sched (serv_key, serv_ksched.s);
- add_to_key_sched_cache (serv_key, &serv_ksched);
+ ret = des_key_sched(serv_key, serv_ksched.s);
+ add_to_key_sched_cache(serv_key, &serv_ksched);
return ret;
#endif /* NOENCRYPTION */
}
@@ -242,18 +229,19 @@ krb_set_key(key,cvt)
* Mutual authentication is not implemented.
*/
+int
krb_rd_req(authent,service,instance,from_addr,ad,fn)
- register KTEXT authent; /* The received message */
- char *service; /* Service name */
- char *instance; /* Service instance */
- long from_addr; /* Net address of originating host */
- AUTH_DAT *ad; /* Structure to be filled in */
- char *fn; /* Filename to get keys from */
+ KTEXT authent; /* The received message */
+ char *service; /* Service name */
+ char *instance; /* Service instance */
+ unsigned KRB_INT32 from_addr; /* Net address of originating host */
+ AUTH_DAT *ad; /* Structure to be filled in */
+ char *fn; /* Filename to get keys from */
{
KTEXT_ST ticket; /* Temp storage for ticket */
KTEXT tkt = &ticket;
KTEXT_ST req_id_st; /* Temp storage for authenticator */
- register KTEXT req_id = &req_id_st;
+ KTEXT req_id = &req_id_st;
char realm[REALM_SZ]; /* Realm of issuing kerberos */
Sched seskey_sched, *sched; /* Key sched for session key */
@@ -265,7 +253,7 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn)
char r_realm[REALM_SZ]; /* Client realm from authenticator */
unsigned int r_time_ms; /* Fine time from authenticator */
unsigned long r_time_sec; /* Coarse time from authenticator */
- register char *ptr; /* For stepping through */
+ char *ptr; /* For stepping through */
unsigned long delta_t; /* Time in authenticator - local time */
long tkt_age; /* Age of ticket */
int swap_bytes; /* Need to swap bytes? */
@@ -283,7 +271,7 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn)
/* check version */
if (KRB_PROT_VERSION != (unsigned int) *ptr++)
- return(RD_AP_VERSION);
+ return RD_AP_VERSION;
/* byte order */
swap_bytes = 0;
@@ -293,12 +281,12 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn)
/* check msg type */
mutual = 0;
switch (*ptr++ & ~1) {
- case AUTH_MSG_APPL_REQUEST:
+ case AUTH_MSG_APPL_REQUEST:
break;
- case AUTH_MSG_APPL_REQUEST_MUTUAL:
+ case AUTH_MSG_APPL_REQUEST_MUTUAL:
mutual++;
break;
- default:
+ default:
return(RD_AP_MSG_TYPE);
}
@@ -309,7 +297,7 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn)
mutual = 0;
#endif /* lint */
s_kvno = *ptr++; /* get server key version */
- (void) strcpy(realm,ptr); /* And the realm of the issuing KDC */
+ strcpy(realm,ptr); /* And the realm of the issuing KDC */
ptr += strlen(ptr) + 1; /* skip the realm "hint" */
/*
@@ -320,85 +308,90 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn)
* from the ticket file. If "fn" is the null string, use the
* default ticket file.
*/
- if (fn && (strcmp(st_nam,service) || strcmp(st_inst,instance) ||
- strcmp(st_rlm,realm) || (st_kvno != s_kvno))) {
- if (*fn == 0) fn = KEYFILE;
+ if (fn && (strcmp(st_nam,service) != 0 || strcmp(st_inst,instance) != 0 ||
+ strcmp(st_rlm,realm) != 0 || (st_kvno != s_kvno))) {
+ if (*fn == 0)
+ fn = KEYFILE;
st_kvno = s_kvno;
#ifndef NOENCRYPTION
- if (read_service_key(service,instance,realm,(int) s_kvno,
- fn,(char *)skey))
+ if (read_service_key(service,instance,realm, (int) s_kvno,
+ fn, (char *) skey))
return(RD_AP_UNDEC);
- if ((status = krb_set_key((char *)skey,0)) != 0)
+ status = krb_set_key((char *) skey, 0);
+ if (status != 0)
return(status);
#endif /* !NOENCRYPTION */
- (void) strcpy(st_rlm,realm);
- (void) strcpy(st_nam,service);
- (void) strcpy(st_inst,instance);
+ strcpy(st_rlm,realm);
+ strcpy(st_nam,service);
+ strcpy(st_inst,instance);
}
/* Get ticket from authenticator */
tkt->length = (int) *ptr++;
if ((tkt->length + (ptr+1 - (char *) authent->dat)) > authent->length)
- return(RD_AP_MODIFIED);
- (void) memcpy((char *)(tkt->dat),ptr+1,tkt->length);
+ return RD_AP_MODIFIED;
+ memcpy(tkt->dat, ptr + 1, tkt->length);
if (krb_ap_req_debug)
- log("ticket->length: %d",tkt->length);
+ krb_log("ticket->length: %d", tkt->length);
#ifndef NOENCRYPTION
/* Decrypt and take apart ticket */
#endif
- if (decomp_ticket(tkt,&ad->k_flags,ad->pname,ad->pinst,ad->prealm,
- &(ad->address),ad->session, &(ad->life),
- &(ad->time_sec),sname,iname,serv_key,serv_ksched.s))
- return(RD_AP_UNDEC);
+ if (decomp_ticket(tkt, &ad->k_flags, ad->pname, ad->pinst, ad->prealm,
+ &(ad->address), ad->session, &(ad->life),
+ &(ad->time_sec), sname, iname, serv_key, serv_ksched.s))
+ return RD_AP_UNDEC;
if (krb_ap_req_debug) {
- log("Ticket Contents.");
- log(" Aname: %s.%s",ad->pname,
- ((int)*(ad->prealm) ? ad->prealm : "Athena"));
- log(" Service: %s%s%s",sname,((int)*iname ? "." : ""),iname);
+ krb_log("Ticket Contents.");
+ krb_log(" Aname: %s.%s",ad->pname,
+ ((int)*(ad->prealm) ? ad->prealm : "Athena"));
+ krb_log(" Service: %s%s%s", sname, ((int)*iname ? "." : ""), iname);
}
/* Extract the authenticator */
req_id->length = (int) *(ptr++);
if ((req_id->length + (ptr + tkt->length - (char *) authent->dat)) >
authent->length)
- return(RD_AP_MODIFIED);
- (void) memcpy((char *)(req_id->dat),ptr + tkt->length, req_id->length);
+ return RD_AP_MODIFIED;
+ memcpy(req_id->dat, ptr + tkt->length, req_id->length);
#ifndef NOENCRYPTION
/* And decrypt it with the session key from the ticket */
- if (krb_ap_req_debug) log("About to decrypt authenticator");
- sched = check_key_sched_cache (ad->session);
+ if (krb_ap_req_debug)
+ krb_log("About to decrypt authenticator");
+ sched = check_key_sched_cache(ad->session);
if (!sched) {
sched = &seskey_sched;
- key_sched (ad->session, seskey_sched.s);
- add_to_key_sched_cache (ad->session, &seskey_sched);
+ key_sched(ad->session, seskey_sched.s);
+ add_to_key_sched_cache(ad->session, &seskey_sched);
}
/* can't do much to optimize this... */
- pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat,
- (long) req_id->length, sched->s, ad->session,DES_DECRYPT);
- if (krb_ap_req_debug) log("Done.");
+ pcbc_encrypt((C_Block *) req_id->dat, (C_Block *) req_id->dat,
+ (long) req_id->length, sched->s, ad->session, DES_DECRYPT);
+ if (krb_ap_req_debug)
+ krb_log("Done.");
#endif /* NOENCRYPTION */
#define check_ptr() if ((ptr - (char *) req_id->dat) > req_id->length) return(RD_AP_MODIFIED);
ptr = (char *) req_id->dat;
- (void) strcpy(r_aname,ptr); /* Authentication name */
- ptr += strlen(r_aname)+1;
+ strcpy(r_aname,ptr); /* Authentication name */
+ ptr += strlen(r_aname) + 1;
check_ptr();
- (void) strcpy(r_inst,ptr); /* Authentication instance */
- ptr += strlen(r_inst)+1;
+ strcpy(r_inst,ptr); /* Authentication instance */
+ ptr += strlen(r_inst) + 1;
check_ptr();
- (void) strcpy(r_realm,ptr); /* Authentication name */
- ptr += strlen(r_realm)+1;
+ strcpy(r_realm,ptr); /* Authentication name */
+ ptr += strlen(r_realm) + 1;
check_ptr();
- (void) memcpy((char *)&ad->checksum,ptr,4); /* Checksum */
+ memcpy(&ad->checksum, ptr, 4); /* Checksum */
ptr += 4;
check_ptr();
- if (swap_bytes) swap_u_long(ad->checksum);
+ if (swap_bytes)
+ swap_u_long(ad->checksum);
r_time_ms = *(ptr++); /* Time (fine) */
#ifdef lint
/* XXX r_time_ms is set but not used. why??? */
@@ -408,61 +401,102 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn)
#endif /* lint */
check_ptr();
/* assume sizeof(r_time_sec) == 4 ?? */
- (void) memcpy((char *)&r_time_sec,ptr,4); /* Time (coarse) */
- if (swap_bytes) swap_u_long(r_time_sec);
+ memcpy(&r_time_sec,ptr,4); /* Time (coarse) */
+ if (swap_bytes)
+ swap_u_long(r_time_sec);
/* Check for authenticity of the request */
if (krb_ap_req_debug)
- log("Pname: %s %s",ad->pname,r_aname);
+ krb_log("Pname: %s %s",ad->pname,r_aname);
if (strcmp(ad->pname,r_aname) != 0)
- return(RD_AP_INCON);
+ return RD_AP_INCON;
if (strcmp(ad->pinst,r_inst) != 0)
- return(RD_AP_INCON);
+ return RD_AP_INCON;
if (krb_ap_req_debug)
- log("Realm: %s %s",ad->prealm,r_realm);
- if ((strcmp(ad->prealm,r_realm) != 0))
- return(RD_AP_INCON);
+ krb_log("Realm: %s %s", ad->prealm, r_realm);
+ if (strcmp(ad->prealm,r_realm) != 0)
+ return RD_AP_INCON;
if (krb_ap_req_debug)
- log("Address: %d %d",ad->address,from_addr);
+ krb_log("Address: %d %d", ad->address, from_addr);
if (from_addr && (ad->address != from_addr))
- return(RD_AP_BADD);
+ return RD_AP_BADD;
delta_t = abs((int)(t_local.tv_sec - r_time_sec));
if (delta_t > CLOCK_SKEW) {
- (void) gettimeofday(&t_local, (struct timezone *)0);
+ gettimeofday(&t_local, NULL);
delta_t = abs((int)(t_local.tv_sec - r_time_sec));
if (delta_t > CLOCK_SKEW) {
- if (krb_ap_req_debug)
- log("Time out of range: %d - %d = %d",
- t_local.tv_sec,r_time_sec,delta_t);
- return(RD_AP_TIME);
+ if (krb_ap_req_debug) {
+ krb_log("Time out of range: %d - %d = %d",
+ t_local.tv_sec, r_time_sec, delta_t);
+ }
+ return RD_AP_TIME;
}
}
/* Now check for expiration of ticket */
tkt_age = t_local.tv_sec - ad->time_sec;
- if (krb_ap_req_debug)
- log("Time: %d Issue Date: %d Diff: %d Life %x",
- t_local.tv_sec,ad->time_sec,tkt_age,ad->life);
+ if (krb_ap_req_debug) {
+ krb_log("Time: %d Issue Date: %d Diff: %d Life %x",
+ t_local.tv_sec, ad->time_sec, tkt_age, ad->life);
+ }
if (t_local.tv_sec < ad->time_sec) {
- if ((ad->time_sec - t_local.tv_sec) > CLOCK_SKEW)
- return(RD_AP_NYV);
+ if (ad->time_sec - t_local.tv_sec > CLOCK_SKEW)
+ return RD_AP_NYV;
+ } else if (t_local.tv_sec - ad->time_sec > 5 * 60 * ad->life) {
+ return RD_AP_EXP;
}
- else if ((t_local.tv_sec - ad->time_sec) > 5 * 60 * ad->life)
- return(RD_AP_EXP);
/* All seems OK */
ad->reply.length = 0;
- return(RD_AP_OK);
+ return RD_AP_OK;
}
#endif /* NOENCRYPTION */
+int
+krb_find_ticket(authent, ticket)
+ KTEXT authent, ticket;
+{
+ char *ptr; /* For stepping through */
+
+ /* Check for bogus length. */
+ if (authent->length <= 0)
+ return RD_AP_MODIFIED;
+
+ ptr = (char *) authent->dat;
+
+ /* check version */
+ if (KRB_PROT_VERSION != (unsigned int) *ptr++)
+ return RD_AP_VERSION;
+
+ /* Make sure msg type is ok. */
+ switch (*ptr++ & ~1) {
+ case AUTH_MSG_APPL_REQUEST:
+ case AUTH_MSG_APPL_REQUEST_MUTUAL:
+ break;
+ default:
+ return RD_AP_MSG_TYPE;
+ }
+
+ *ptr++; /* skip server key version */
+ ptr += strlen(ptr) + 1; /* skip the realm "hint" */
+
+ /* Get ticket from authenticator */
+ ticket->length = (int) *ptr++;
+ if ((ticket->length + (ptr + 1 - (char *) authent->dat)) > authent->length)
+ return RD_AP_MODIFIED;
+ memcpy((char *)(ticket->dat),ptr+1,ticket->length);
+
+ return RD_AP_OK;
+}
+
static char local_realm_buffer[REALM_SZ+1];
+int
krb_get_lrealm(r,n)
char *r;
int n;
@@ -470,125 +504,111 @@ krb_get_lrealm(r,n)
FILE *cnffile, *fopen();
if (n > 1)
- return(KFAILURE); /* Temporary restriction */
+ return KFAILURE; /* Temporary restriction */
+
+ if (my_realm[0]) {
+ strcpy(r, my_realm);
+ return KSUCCESS;
+ }
if (local_realm_buffer[0]) {
- strcpy (r, local_realm_buffer);
+ strcpy(r, local_realm_buffer);
return KSUCCESS;
}
- if ((cnffile = fopen(KRB_CONF, "r")) == NULL) {
+ cnffile = fopen(KRB_CONF, "r");
+ if (cnffile == NULL) {
if (n == 1) {
- (void) strcpy(r, KRB_REALM);
- return(KSUCCESS);
+ strcpy(r, KRB_REALM);
+ return KSUCCESS;
+ } else {
+ return KFAILURE;
}
- else
- return(KFAILURE);
}
if (fscanf(cnffile,"%s",r) != 1) {
- (void) fclose(cnffile);
- return(KFAILURE);
+ fclose(cnffile);
+ return KFAILURE;
}
- (void) fclose(cnffile);
- return(KSUCCESS);
+ fclose(cnffile);
+ return KSUCCESS;
}
-#endif /* KERBEROS */
+int
+decomp_ticket(tkt, flags, pname, pinstance, prealm, paddress, session,
+ life, time_sec, sname, sinstance, key, key_s)
+ KTEXT tkt; /* The ticket to be decoded */
+ unsigned char *flags; /* Kerberos ticket flags */
+ char *pname; /* Authentication name */
+ char *pinstance; /* Principal's instance */
+ char *prealm; /* Principal's authentication domain */
+ unsigned long *paddress; /* Net address of entity
+ * requesting ticket */
+ C_Block session; /* Session key inserted in ticket */
+ int *life; /* Lifetime of the ticket */
+ unsigned long *time_sec; /* Issue time and date */
+ char *sname; /* Service name */
+ char *sinstance; /* Service instance */
+ C_Block key; /* Service's secret key
+ * (to decrypt the ticket) */
+ des_key_sched key_s; /* The precomputed key schedule */
+{
+ static int tkt_swap_bytes;
+ unsigned char *uptr;
+ char *ptr = (char *)tkt->dat;
-#ifdef ibm032
+#ifndef NOENCRYPTION
+ /* Do the decryption */
+ pcbc_encrypt((C_Block *)tkt->dat,(C_Block *)tkt->dat,
+ (long) tkt->length,key_s,(C_Block *) key,0);
+#endif /* ! NOENCRYPTION */
+
+ *flags = *ptr; /* get flags byte */
+ ptr += sizeof(*flags);
+ tkt_swap_bytes = 0;
+ if (HOST_BYTE_ORDER != ((*flags >> K_FLAG_ORDER)& 1))
+ tkt_swap_bytes++;
+
+ if (strlen(ptr) > ANAME_SZ)
+ return(KFAILURE);
+ strcpy(pname,ptr); /* pname */
+ ptr += strlen(pname) + 1;
-#if defined (__GNUC__) || defined (__HIGHC__)
-#ifdef __HIGHC__
-#define asm _ASM
-#endif
+ if (strlen(ptr) > INST_SZ)
+ return(KFAILURE);
+ strcpy(pinstance,ptr); /* instance */
+ ptr += strlen(pinstance) + 1;
-/*
- * Copyright (C) 1990 by the Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted.
- */
+ if (strlen(ptr) > REALM_SZ)
+ return(KFAILURE);
+ strcpy(prealm,ptr); /* realm */
+ ptr += strlen(prealm) + 1;
+ /* temporary hack until realms are dealt with properly */
+ if (*prealm == 0)
+ strcpy(prealm, ZGetRealm());
-void asm_wrapper_kopt_c () {
- /*
- * Multiply routine. The C library routine tries to optimize around
- * the multiply-step instruction, which was slower in earlier versions
- * of the processor; this is no longer useful. Derived from assembly
- * code written by John Carr.
- */
-
- /* data section */
- asm(".data\n.align 2");
- asm(".globl _ulmul$$ \n _ulmul$$:");
- asm(".globl _lmul$$ \n _lmul$$: .long lmul$$");
- /* text section */
- asm(".text \n .align 1");
- asm(".globl lmul$$ \n lmul$$:");
- asm(".globl ulmul$$ \n ulmul$$:");
- asm(".globl _.lmul$$ \n _.lmul$$:");
- asm(".globl _.ulmul$$ \n _.ulmul$$:");
- asm(" s r0,r0 \n mts r10,r2"); /* set up multiply, and go: */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" brx r15 \n mfs r10,r2"); /* return result */
- asm(" .long 0xdf02df00"); /* for debugging */
-
-#ifdef USE_LIBC_STRLEN
- }
-#else
- /* Note- do not use this version of strlen when compiling with -g; -g */
- /* causes extra no-ops to be inserted between instructions, which cause */
- /* the delayed branch instructions to fail. */
+ memcpy((char *)paddress, ptr, 4); /* net address */
+ ptr += 4;
- /*
- * Fast strlen, with optional trapping of null pointers. Also from
- * John Carr.
- */
- /* data */
- asm(".data\n.align 2");
- asm(".globl _strlen \n _strlen: .long _.strlen");
- /* text */
- asm(".text\n.align 1");
- asm(".globl _.strlen \n _.strlen:");
-#if 1
- asm(" ti 2,r2,0"); /* trap if r2 is NULL */
-#endif
- asm(" ls r4,0(r2)");
- asm(" mr r0,r2");
- asm(" nilz r3,r2,3");
- asm(" beqx 0f");
- asm(" nilo r2,r2,0xfffc"); /* clear low bits */
- asm(" sis r3,2"); /* test appropriate bytes of 1st word */
- asm(" jeq 2f"); /* s & 3 == 2 */
- asm(" jm 1f"); /* s & 3 == 1 */
- asm(" j 3f"); /* s & 3 == 3 */
- asm("0: srpi16 r4,8"); /* byte 0 */
- asm(" jeq 4f");
- asm("1: niuz r5,r4,0xff"); /* byte 1 */
- asm(" jeq 5f");
- asm("2: nilz r5,r4,0xff00"); /* byte 2 */
- asm(" jeq 6f");
- asm("3: sli16 r4,8"); /* byte 3 */
- asm(" jeq 7f");
- asm(" ls r4,4(r2)"); /* get next word and continue */
- asm(" bx 0b");
- asm(" inc r2,4");
- asm("4: brx r15"); /* byte 0 is zero */
- asm(" s r2,r0");
- asm("5: s r2,r0"); /* byte 1 is zero */
- asm(" brx r15");
- asm(" inc r2,1");
- asm("6: s r2,r0"); /* byte 2 is zero */
- asm(" brx r15");
- asm(" inc r2,2");
- asm("7: s r2,r0"); /* byte 3 is zero */
- asm(" brx r15");
- asm(" inc r2,3");
- asm(" .long 0xdf02df00"); /* trace table */
+ memcpy((char *)session, ptr, 8); /* session key */
+ ptr+= 8;
+
+ /* get lifetime, being certain we don't get negative lifetimes */
+ uptr = (unsigned char *) ptr++;
+ *life = (int) *uptr;
+
+ memcpy((char *) time_sec, ptr, 4); /* issue time */
+ ptr += 4;
+ if (tkt_swap_bytes)
+ swap_u_long(*time_sec);
+
+ strcpy(sname,ptr); /* service name */
+ ptr += 1 + strlen(sname);
+
+ strcpy(sinstance,ptr); /* instance */
+ ptr += 1 + strlen(sinstance);
+
+ return(KSUCCESS);
}
-#endif /* USE_LIBC_STRLEN */
-#endif /* __GNUC__ || __HIGHC__ */
-#endif /* ibm032 */
+#endif /* ZEPHYR_USES_KERBEROS */
+
diff --git a/server/kopt.c.auth b/server/kopt.c.auth
deleted file mode 100644
index 99fe48e..0000000
--- a/server/kopt.c.auth
+++ /dev/null
@@ -1,631 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1985, 1986, 1987, 1988, 1990, 1991 by the Massachusetts
- * Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- */
-
-/*
- * This includes code taken from:
- * Kerberos: rd_req.c,v 4.16 89/03/22 14:52:06 jtkohl Exp
- * Kerberos: prot.h,v 4.13 89/01/24 14:27:22 jtkohl Exp
- * Kerberos: krb_conf.h,v 4.0 89/01/23 09:59:27 jtkohl Exp
- */
-
-#ifndef lint
-#ifndef SABER
-static char *rcsid_rd_req_c =
- "$Id$";
-#endif /* lint */
-#endif /* SABER */
-
-#ifdef KERBEROS
-#ifndef NOENCRYPTION
-
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr.h>
-#include <stdio.h>
-#include <krb.h>
-#include "zserver.h"
-
-/* Byte ordering */
-static int krbONE = 1;
-#define HOST_BYTE_ORDER (* (char *) &krbONE)
-
-#define KRB_PROT_VERSION 4
-
-/* Message types , always leave lsb for byte order */
-
-#define AUTH_MSG_KDC_REQUEST 1<<1
-#define AUTH_MSG_KDC_REPLY 2<<1
-#define AUTH_MSG_APPL_REQUEST 3<<1
-#define AUTH_MSG_APPL_REQUEST_MUTUAL 4<<1
-#define AUTH_MSG_ERR_REPLY 5<<1
-#define AUTH_MSG_PRIVATE 6<<1
-#define AUTH_MSG_SAFE 7<<1
-#define AUTH_MSG_APPL_ERR 8<<1
-#define AUTH_MSG_DIE 63<<1
-
-/* values for kerb error codes */
-
-#define KERB_ERR_OK 0
-#define KERB_ERR_NAME_EXP 1
-#define KERB_ERR_SERVICE_EXP 2
-#define KERB_ERR_AUTH_EXP 3
-#define KERB_ERR_PKT_VER 4
-#define KERB_ERR_NAME_MAST_KEY_VER 5
-#define KERB_ERR_SERV_MAST_KEY_VER 6
-#define KERB_ERR_BYTE_ORDER 7
-#define KERB_ERR_PRINCIPAL_UNKNOWN 8
-#define KERB_ERR_PRINCIPAL_NOT_UNIQUE 9
-#define KERB_ERR_NULL_KEY 10
-
-#include <sys/time.h>
-#include <string.h>
-
-extern int krb_ap_req_debug;
-
-extern struct timeval t_local;
-
-/*
- * Keep the following information around for subsequent calls
- * to this routine by the same server using the same key.
- */
-
-static Sched serv_ksched; /* Key sched to decrypt ticket */
-static des_cblock serv_key; /* Initialization vector */
-
-static int st_kvno; /* version number for this key */
-static char st_rlm[REALM_SZ]; /* server's realm */
-static char st_nam[ANAME_SZ]; /* service name */
-static char st_inst[INST_SZ]; /* server's instance */
-
-/*
- * Cache of key schedules
- */
-#define HASH_SIZE_1 255 /* not a power of 2 */
-#define HASH_SIZE_2 3
-static unsigned long last_use;
-typedef struct {
- unsigned long last_time_used;
- des_cblock key;
- Sched schedule;
-} KeySchedRec;
-static KeySchedRec scheds[HASH_SIZE_1][HASH_SIZE_2];
-
-#ifdef __STDC__
-Sched* check_key_sched_cache (des_cblock key)
-#else
-Sched* check_key_sched_cache (key)
- des_cblock key;
-#endif
-{
- unsigned int hash_value = key[0] + key[1] * 256;
- KeySchedRec *rec = scheds[hash_value % HASH_SIZE_1];
- int i;
-
- for (i = HASH_SIZE_2 - 1; i >= 0; i--)
- if (rec[i].last_time_used
- && key[0] == rec[i].key[0]
- && !memcmp (key, rec[i].key, sizeof (des_cblock))) {
- rec[i].last_time_used = last_use++;
- return &rec[i].schedule;
- }
- return 0;
-}
-
-#ifdef __STDC__
-void add_to_key_sched_cache (des_cblock key, Sched* sched)
-#else
-void add_to_key_sched_cache (key, sched)
- des_cblock key;
- Sched* sched;
-#endif
-{
- unsigned int hash_value = key[0] + key[1] * 256;
- KeySchedRec *rec = scheds[hash_value % HASH_SIZE_1];
- int i, oldest = HASH_SIZE_2 - 1;
-
- for (i = HASH_SIZE_2 - 1; i >= 0; i--) {
- if (rec[i].last_time_used == 0) {
- oldest = i;
- break;
- }
- if (rec[i].last_time_used < rec[oldest].last_time_used)
- oldest = i;
- }
- (void) memcpy (rec[oldest].key, key, sizeof (des_cblock));
- rec[oldest].schedule = *sched;
- rec[oldest].last_time_used = last_use++;
-}
-
-/*
- * This file contains two functions. krb_set_key() takes a DES
- * key or password string and returns a DES key (either the original
- * key, or the password converted into a DES key) and a key schedule
- * for it.
- *
- * krb_rd_req() reads an authentication request and returns information
- * about the identity of the requestor, or an indication that the
- * identity information was not authentic.
- */
-
-/*
- * krb_set_key() takes as its first argument either a DES key or a
- * password string. The "cvt" argument indicates how the first
- * argument "key" is to be interpreted: if "cvt" is null, "key" is
- * taken to be a DES key; if "cvt" is non-null, "key" is taken to
- * be a password string, and is converted into a DES key using
- * string_to_key(). In either case, the resulting key is returned
- * in the external variable "serv_key". A key schedule is
- * generated for "serv_key" and returned in the external variable
- * "serv_ksched".
- *
- * This routine returns the return value of des_key_sched.
- *
- * krb_set_key() needs to be in the same .o file as krb_rd_req() so that
- * the key set by krb_set_key() is available in private storage for
- * krb_rd_req().
- */
-
-int
-krb_set_key(key,cvt)
- char *key;
- int cvt;
-{
-#ifdef NOENCRYPTION
- (void) memset(serv_key, 0, sizeof(serv_key));
- return KSUCCESS;
-#else /* Encrypt */
- Sched *s;
- int ret;
-
- if (cvt)
- string_to_key(key,serv_key);
- else
- (void) memcpy((char *)serv_key,key,8);
-
- s = check_key_sched_cache (serv_key);
- if (s) {
- serv_ksched = *s;
- return 0;
- }
- ret = des_key_sched (serv_key, serv_ksched.s);
- add_to_key_sched_cache (serv_key, &serv_ksched);
- return ret;
-#endif /* NOENCRYPTION */
-}
-
-
-/*
- * krb_rd_req() takes an AUTH_MSG_APPL_REQUEST or
- * AUTH_MSG_APPL_REQUEST_MUTUAL message created by krb_mk_req(),
- * checks its integrity and returns a judgement as to the requestor's
- * identity.
- *
- * The "authent" argument is a pointer to the received message.
- * The "service" and "instance" arguments name the receiving server,
- * and are used to get the service's ticket to decrypt the ticket
- * in the message, and to compare against the server name inside the
- * ticket. "from_addr" is the network address of the host from which
- * the message was received; this is checked against the network
- * address in the ticket. If "from_addr" is zero, the check is not
- * performed. "ad" is an AUTH_DAT structure which is
- * filled in with information about the sender's identity according
- * to the authenticator and ticket sent in the message. Finally,
- * "fn" contains the name of the file containing the server's key.
- * (If "fn" is NULL, the server's key is assumed to have been set
- * by krb_set_key(). If "fn" is the null string ("") the default
- * file KEYFILE, defined in "krb.h", is used.)
- *
- * krb_rd_req() returns RD_AP_OK if the authentication information
- * was genuine, or one of the following error codes (defined in
- * "krb.h"):
- *
- * RD_AP_VERSION - wrong protocol version number
- * RD_AP_MSG_TYPE - wrong message type
- * RD_AP_UNDEC - couldn't decipher the message
- * RD_AP_INCON - inconsistencies found
- * RD_AP_BADD - wrong network address
- * RD_AP_TIME - client time (in authenticator)
- * too far off server time
- * RD_AP_NYV - Kerberos time (in ticket) too
- * far off server time
- * RD_AP_EXP - ticket expired
- *
- * For the message format, see krb_mk_req().
- *
- * Mutual authentication is not implemented.
- */
-
-krb_rd_req(authent,service,instance,from_addr,ad,fn)
- register KTEXT authent; /* The received message */
- char *service; /* Service name */
- char *instance; /* Service instance */
- long from_addr; /* Net address of originating host */
- AUTH_DAT *ad; /* Structure to be filled in */
- char *fn; /* Filename to get keys from */
-{
- KTEXT_ST ticket; /* Temp storage for ticket */
- KTEXT tkt = &ticket;
- KTEXT_ST req_id_st; /* Temp storage for authenticator */
- register KTEXT req_id = &req_id_st;
-
- char realm[REALM_SZ]; /* Realm of issuing kerberos */
- Sched seskey_sched, *sched; /* Key sched for session key */
- unsigned char skey[KKEY_SZ]; /* Session key from ticket */
- char sname[SNAME_SZ]; /* Service name from ticket */
- char iname[INST_SZ]; /* Instance name from ticket */
- char r_aname[ANAME_SZ]; /* Client name from authenticator */
- char r_inst[INST_SZ]; /* Client instance from authenticator */
- char r_realm[REALM_SZ]; /* Client realm from authenticator */
- unsigned int r_time_ms; /* Fine time from authenticator */
- unsigned long r_time_sec; /* Coarse time from authenticator */
- register char *ptr; /* For stepping through */
- unsigned long delta_t; /* Time in authenticator - local time */
- long tkt_age; /* Age of ticket */
- int swap_bytes; /* Need to swap bytes? */
- int mutual; /* Mutual authentication requested? */
- unsigned char s_kvno; /* Version number of the server's key
- * Kerberos used to encrypt ticket */
- int status;
-
- if (authent->length <= 0)
- return(RD_AP_MODIFIED);
-
- ptr = (char *) authent->dat;
-
- /* get msg version, type and byte order, and server key version */
-
- /* check version */
- if (KRB_PROT_VERSION != (unsigned int) *ptr++)
- return(RD_AP_VERSION);
-
- /* byte order */
- swap_bytes = 0;
- if ((*ptr & 1) != HOST_BYTE_ORDER)
- swap_bytes++;
-
- /* check msg type */
- mutual = 0;
- switch (*ptr++ & ~1) {
- case AUTH_MSG_APPL_REQUEST:
- break;
- case AUTH_MSG_APPL_REQUEST_MUTUAL:
- mutual++;
- break;
- default:
- return(RD_AP_MSG_TYPE);
- }
-
-#ifdef lint
- /* XXX mutual is set but not used; why??? */
- /* this is a crock to get lint to shut up */
- if (mutual)
- mutual = 0;
-#endif /* lint */
- s_kvno = *ptr++; /* get server key version */
- (void) strcpy(realm,ptr); /* And the realm of the issuing KDC */
- ptr += strlen(ptr) + 1; /* skip the realm "hint" */
-
- /*
- * If "fn" is NULL, key info should already be set; don't
- * bother with ticket file. Otherwise, check to see if we
- * already have key info for the given server and key version
- * (saved in the static st_* variables). If not, go get it
- * from the ticket file. If "fn" is the null string, use the
- * default ticket file.
- */
- if (fn && (strcmp(st_nam,service) || strcmp(st_inst,instance) ||
- strcmp(st_rlm,realm) || (st_kvno != s_kvno))) {
- if (*fn == 0) fn = KEYFILE;
- st_kvno = s_kvno;
-#ifndef NOENCRYPTION
- if (read_service_key(service,instance,realm,(int) s_kvno,
- fn,(char *)skey))
- return(RD_AP_UNDEC);
- if ((status = krb_set_key((char *)skey,0)) != 0)
- return(status);
-#endif /* !NOENCRYPTION */
- (void) strcpy(st_rlm,realm);
- (void) strcpy(st_nam,service);
- (void) strcpy(st_inst,instance);
- }
-
- /* Get ticket from authenticator */
- tkt->length = (int) *ptr++;
- if ((tkt->length + (ptr+1 - (char *) authent->dat)) > authent->length)
- return(RD_AP_MODIFIED);
- (void) memcpy((char *)(tkt->dat),ptr+1,tkt->length);
-
- if (krb_ap_req_debug)
- log("ticket->length: %d",tkt->length);
-
-#ifndef NOENCRYPTION
- /* Decrypt and take apart ticket */
-#endif
-
- if (decomp_ticket(tkt,&ad->k_flags,ad->pname,ad->pinst,ad->prealm,
- &(ad->address),ad->session, &(ad->life),
- &(ad->time_sec),sname,iname,serv_key,serv_ksched.s))
- return(RD_AP_UNDEC);
-
- if (krb_ap_req_debug) {
- log("Ticket Contents.");
- log(" Aname: %s.%s",ad->pname,
- ((int)*(ad->prealm) ? ad->prealm : "Athena"));
- log(" Service: %s%s%s",sname,((int)*iname ? "." : ""),iname);
- }
-
- /* Extract the authenticator */
- req_id->length = (int) *(ptr++);
- if ((req_id->length + (ptr + tkt->length - (char *) authent->dat)) >
- authent->length)
- return(RD_AP_MODIFIED);
- (void) memcpy((char *)(req_id->dat),ptr + tkt->length, req_id->length);
-
-#ifndef NOENCRYPTION
- /* And decrypt it with the session key from the ticket */
- if (krb_ap_req_debug) log("About to decrypt authenticator");
- sched = check_key_sched_cache (ad->session);
- if (!sched) {
- sched = &seskey_sched;
- key_sched (ad->session, seskey_sched.s);
- add_to_key_sched_cache (ad->session, &seskey_sched);
- }
- /* can't do much to optimize this... */
- pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat,
- (long) req_id->length, sched->s, ad->session,DES_DECRYPT);
- if (krb_ap_req_debug) log("Done.");
-#endif /* NOENCRYPTION */
-
-#define check_ptr() if ((ptr - (char *) req_id->dat) > req_id->length) return(RD_AP_MODIFIED);
-
- ptr = (char *) req_id->dat;
- (void) strcpy(r_aname,ptr); /* Authentication name */
- ptr += strlen(r_aname)+1;
- check_ptr();
- (void) strcpy(r_inst,ptr); /* Authentication instance */
- ptr += strlen(r_inst)+1;
- check_ptr();
- (void) strcpy(r_realm,ptr); /* Authentication name */
- ptr += strlen(r_realm)+1;
- check_ptr();
- (void) memcpy((char *)&ad->checksum,ptr,4); /* Checksum */
- ptr += 4;
- check_ptr();
- if (swap_bytes) swap_u_long(ad->checksum);
- r_time_ms = *(ptr++); /* Time (fine) */
-#ifdef lint
- /* XXX r_time_ms is set but not used. why??? */
- /* this is a crock to get lint to shut up */
- if (r_time_ms)
- r_time_ms = 0;
-#endif /* lint */
- check_ptr();
- /* assume sizeof(r_time_sec) == 4 ?? */
- (void) memcpy((char *)&r_time_sec,ptr,4); /* Time (coarse) */
- if (swap_bytes) swap_u_long(r_time_sec);
-
- /* Check for authenticity of the request */
- if (krb_ap_req_debug)
- log("Pname: %s %s",ad->pname,r_aname);
- if (strcmp(ad->pname,r_aname) != 0)
- return(RD_AP_INCON);
- if (strcmp(ad->pinst,r_inst) != 0)
- return(RD_AP_INCON);
- if (krb_ap_req_debug)
- log("Realm: %s %s",ad->prealm,r_realm);
- if ((strcmp(ad->prealm,r_realm) != 0))
- return(RD_AP_INCON);
-
- if (krb_ap_req_debug)
- log("Address: %d %d",ad->address,from_addr);
- if (from_addr && (ad->address != from_addr))
- return(RD_AP_BADD);
-
- delta_t = abs((int)(t_local.tv_sec - r_time_sec));
- if (delta_t > CLOCK_SKEW) {
- (void) gettimeofday(&t_local, (struct timezone *)0);
- delta_t = abs((int)(t_local.tv_sec - r_time_sec));
- if (delta_t > CLOCK_SKEW) {
- if (krb_ap_req_debug)
- log("Time out of range: %d - %d = %d",
- t_local.tv_sec,r_time_sec,delta_t);
- return(RD_AP_TIME);
- }
- }
-
- /* Now check for expiration of ticket */
-
- tkt_age = t_local.tv_sec - ad->time_sec;
- if (krb_ap_req_debug)
- log("Time: %d Issue Date: %d Diff: %d Life %x",
- t_local.tv_sec,ad->time_sec,tkt_age,ad->life);
-
- if (t_local.tv_sec < ad->time_sec) {
- if ((ad->time_sec - t_local.tv_sec) > CLOCK_SKEW)
- return(RD_AP_NYV);
- }
- else if ((t_local.tv_sec - ad->time_sec) > 5 * 60 * ad->life)
- return(RD_AP_EXP);
-
- /* All seems OK */
- ad->reply.length = 0;
-
- return(RD_AP_OK);
-}
-#endif /* NOENCRYPTION */
-
-int krb_find_ticket(authent, ticket)
- KTEXT authent, ticket;
-{
- register char *ptr; /* For stepping through */
-
- /* Check for bogus length. */
- if (authent->length <= 0)
- return(RD_AP_MODIFIED);
-
- ptr = (char *) authent->dat;
-
- /* check version */
- if (KRB_PROT_VERSION != (unsigned int) *ptr++)
- return(RD_AP_VERSION);
-
- /* Make sure msg type is ok. */
- switch (*ptr++ & ~1) {
- case AUTH_MSG_APPL_REQUEST:
- case AUTH_MSG_APPL_REQUEST_MUTUAL:
- break;
- default:
- return(RD_AP_MSG_TYPE);
- }
-
- *ptr++; /* skip server key version */
- ptr += strlen(ptr) + 1; /* skip the realm "hint" */
-
- /* Get ticket from authenticator */
- ticket->length = (int) *ptr++;
- if ((ticket->length + (ptr+1 - (char *) authent->dat)) > authent->length)
- return(RD_AP_MODIFIED);
- (void) memcpy((char *)(ticket->dat),ptr+1,ticket->length);
-
- return RD_AP_OK;
-}
-
-static char local_realm_buffer[REALM_SZ+1];
-
-krb_get_lrealm(r,n)
- char *r;
- int n;
-{
- FILE *cnffile, *fopen();
-
- if (n > 1)
- return(KFAILURE); /* Temporary restriction */
-
- if (local_realm_buffer[0]) {
- strcpy (r, local_realm_buffer);
- return KSUCCESS;
- }
-
- if ((cnffile = fopen(KRB_CONF, "r")) == NULL) {
- if (n == 1) {
- (void) strcpy(r, KRB_REALM);
- return(KSUCCESS);
- }
- else
- return(KFAILURE);
- }
-
- if (fscanf(cnffile,"%s",r) != 1) {
- (void) fclose(cnffile);
- return(KFAILURE);
- }
- (void) fclose(cnffile);
- return(KSUCCESS);
-}
-
-#endif /* KERBEROS */
-
-#ifdef ibm032
-
-#if defined (__GNUC__) || defined (__HIGHC__)
-#ifdef __HIGHC__
-#define asm _ASM
-#endif
-
-/*
- * Copyright (C) 1990 by the Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted.
- */
-
-void asm_wrapper_kopt_c () {
- /*
- * Multiply routine. The C library routine tries to optimize around
- * the multiply-step instruction, which was slower in earlier versions
- * of the processor; this is no longer useful. Derived from assembly
- * code written by John Carr.
- */
-
- /* data section */
- asm(".data\n.align 2");
- asm(".globl _ulmul$$ \n _ulmul$$:");
- asm(".globl _lmul$$ \n _lmul$$: .long lmul$$");
- /* text section */
- asm(".text \n .align 1");
- asm(".globl lmul$$ \n lmul$$:");
- asm(".globl ulmul$$ \n ulmul$$:");
- asm(".globl _.lmul$$ \n _.lmul$$:");
- asm(".globl _.ulmul$$ \n _.ulmul$$:");
- asm(" s r0,r0 \n mts r10,r2"); /* set up multiply, and go: */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" brx r15 \n mfs r10,r2"); /* return result */
- asm(" .long 0xdf02df00"); /* for debugging */
-
-#ifdef USE_LIBC_STRLEN
- }
-#else
- /* Note- do not use this version of strlen when compiling with -g; -g */
- /* causes extra no-ops to be inserted between instructions, which cause */
- /* the delayed branch instructions to fail. */
-
- /*
- * Fast strlen, with optional trapping of null pointers. Also from
- * John Carr.
- */
- /* data */
- asm(".data\n.align 2");
- asm(".globl _strlen \n _strlen: .long _.strlen");
- /* text */
- asm(".text\n.align 1");
- asm(".globl _.strlen \n _.strlen:");
-#if 1
- asm(" ti 2,r2,0"); /* trap if r2 is NULL */
-#endif
- asm(" ls r4,0(r2)");
- asm(" mr r0,r2");
- asm(" nilz r3,r2,3");
- asm(" beqx 0f");
- asm(" nilo r2,r2,0xfffc"); /* clear low bits */
- asm(" sis r3,2"); /* test appropriate bytes of 1st word */
- asm(" jeq 2f"); /* s & 3 == 2 */
- asm(" jm 1f"); /* s & 3 == 1 */
- asm(" j 3f"); /* s & 3 == 3 */
- asm("0: srpi16 r4,8"); /* byte 0 */
- asm(" jeq 4f");
- asm("1: niuz r5,r4,0xff"); /* byte 1 */
- asm(" jeq 5f");
- asm("2: nilz r5,r4,0xff00"); /* byte 2 */
- asm(" jeq 6f");
- asm("3: sli16 r4,8"); /* byte 3 */
- asm(" jeq 7f");
- asm(" ls r4,4(r2)"); /* get next word and continue */
- asm(" bx 0b");
- asm(" inc r2,4");
- asm("4: brx r15"); /* byte 0 is zero */
- asm(" s r2,r0");
- asm("5: s r2,r0"); /* byte 1 is zero */
- asm(" brx r15");
- asm(" inc r2,1");
- asm("6: s r2,r0"); /* byte 2 is zero */
- asm(" brx r15");
- asm(" inc r2,2");
- asm("7: s r2,r0"); /* byte 3 is zero */
- asm(" brx r15");
- asm(" inc r2,3");
- asm(" .long 0xdf02df00"); /* trace table */
-}
-#endif /* USE_LIBC_STRLEN */
-#endif /* __GNUC__ || __HIGHC__ */
-#endif /* ibm032 */
-
diff --git a/server/kopt.c.old b/server/kopt.c.old
deleted file mode 100644
index 90032f1..0000000
--- a/server/kopt.c.old
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * $Source$
- * $Author$
- *
- * Copyright 1985, 1986, 1987, 1988, 1990, 1991 by the Massachusetts
- * Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- */
-
-/*
- * This includes code taken from:
- * Kerberos: rd_req.c,v 4.16 89/03/22 14:52:06 jtkohl Exp
- * Kerberos: prot.h,v 4.13 89/01/24 14:27:22 jtkohl Exp
- * Kerberos: krb_conf.h,v 4.0 89/01/23 09:59:27 jtkohl Exp
- */
-
-#ifndef lint
-#ifndef SABER
-static char *rcsid_rd_req_c =
- "$Id$";
-#endif /* lint */
-#endif /* SABER */
-
-#ifdef KERBEROS
-#ifndef NOENCRYPTION
-
-#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr.h>
-#include <stdio.h>
-#include <krb.h>
-#include "zserver.h"
-
-/* Byte ordering */
-extern int krbONE;
-#define HOST_BYTE_ORDER (* (char *) &krbONE)
-
-#define KRB_PROT_VERSION 4
-
-/* Message types , always leave lsb for byte order */
-
-#define AUTH_MSG_KDC_REQUEST 1<<1
-#define AUTH_MSG_KDC_REPLY 2<<1
-#define AUTH_MSG_APPL_REQUEST 3<<1
-#define AUTH_MSG_APPL_REQUEST_MUTUAL 4<<1
-#define AUTH_MSG_ERR_REPLY 5<<1
-#define AUTH_MSG_PRIVATE 6<<1
-#define AUTH_MSG_SAFE 7<<1
-#define AUTH_MSG_APPL_ERR 8<<1
-#define AUTH_MSG_DIE 63<<1
-
-/* values for kerb error codes */
-
-#define KERB_ERR_OK 0
-#define KERB_ERR_NAME_EXP 1
-#define KERB_ERR_SERVICE_EXP 2
-#define KERB_ERR_AUTH_EXP 3
-#define KERB_ERR_PKT_VER 4
-#define KERB_ERR_NAME_MAST_KEY_VER 5
-#define KERB_ERR_SERV_MAST_KEY_VER 6
-#define KERB_ERR_BYTE_ORDER 7
-#define KERB_ERR_PRINCIPAL_UNKNOWN 8
-#define KERB_ERR_PRINCIPAL_NOT_UNIQUE 9
-#define KERB_ERR_NULL_KEY 10
-
-#include <sys/time.h>
-#include <strings.h>
-
-extern int krb_ap_req_debug;
-
-extern struct timeval t_local;
-
-/*
- * Keep the following information around for subsequent calls
- * to this routine by the same server using the same key.
- */
-
-static Sched serv_ksched; /* Key sched to decrypt ticket */
-static des_cblock serv_key; /* Initialization vector */
-
-static int st_kvno; /* version number for this key */
-static char st_rlm[REALM_SZ]; /* server's realm */
-static char st_nam[ANAME_SZ]; /* service name */
-static char st_inst[INST_SZ]; /* server's instance */
-
-/*
- * Cache of key schedules
- */
-#define HASH_SIZE_1 255 /* not a power of 2 */
-#define HASH_SIZE_2 3
-static unsigned long last_use;
-typedef struct {
- unsigned long last_time_used;
- des_cblock key;
- Sched schedule;
-} KeySchedRec;
-static KeySchedRec scheds[HASH_SIZE_1][HASH_SIZE_2];
-
-#ifdef __STDC__
-Sched* check_key_sched_cache (des_cblock key)
-#else
-Sched* check_key_sched_cache (key)
- des_cblock key;
-#endif
-{
- unsigned int hash_value = key[0] + key[1] * 256;
- KeySchedRec *rec = scheds[hash_value % HASH_SIZE_1];
- int i;
-
- for (i = HASH_SIZE_2 - 1; i >= 0; i--)
- if (rec[i].last_time_used
- && key[0] == rec[i].key[0]
- && !memcmp (key, rec[i].key, sizeof (des_cblock))) {
- rec[i].last_time_used = last_use++;
- return &rec[i].schedule;
- }
- return 0;
-}
-
-#ifdef __STDC__
-void add_to_key_sched_cache (des_cblock key, Sched* sched)
-#else
-void add_to_key_sched_cache (key, sched)
- des_cblock key;
- Sched* sched;
-#endif
-{
- unsigned int hash_value = key[0] + key[1] * 256;
- KeySchedRec *rec = scheds[hash_value % HASH_SIZE_1];
- int i, oldest = HASH_SIZE_2 - 1;
-
- for (i = HASH_SIZE_2 - 1; i >= 0; i--) {
- if (rec[i].last_time_used == 0) {
- oldest = i;
- break;
- }
- if (rec[i].last_time_used < rec[oldest].last_time_used)
- oldest = i;
- }
- (void) memcpy (rec[oldest].key, key, sizeof (des_cblock));
- rec[oldest].schedule = *sched;
- rec[oldest].last_time_used = last_use++;
-}
-
-/*
- * This file contains two functions. krb_set_key() takes a DES
- * key or password string and returns a DES key (either the original
- * key, or the password converted into a DES key) and a key schedule
- * for it.
- *
- * krb_rd_req() reads an authentication request and returns information
- * about the identity of the requestor, or an indication that the
- * identity information was not authentic.
- */
-
-/*
- * krb_set_key() takes as its first argument either a DES key or a
- * password string. The "cvt" argument indicates how the first
- * argument "key" is to be interpreted: if "cvt" is null, "key" is
- * taken to be a DES key; if "cvt" is non-null, "key" is taken to
- * be a password string, and is converted into a DES key using
- * string_to_key(). In either case, the resulting key is returned
- * in the external variable "serv_key". A key schedule is
- * generated for "serv_key" and returned in the external variable
- * "serv_ksched".
- *
- * This routine returns the return value of des_key_sched.
- *
- * krb_set_key() needs to be in the same .o file as krb_rd_req() so that
- * the key set by krb_set_key() is available in private storage for
- * krb_rd_req().
- */
-
-int
-krb_set_key(key,cvt)
- char *key;
- int cvt;
-{
-#ifdef NOENCRYPTION
- (void) memset(serv_key, 0, sizeof(serv_key));
- return KSUCCESS;
-#else /* Encrypt */
- Sched *s;
- int ret;
-
- if (cvt)
- string_to_key(key,serv_key);
- else
- (void) memcpy((char *)serv_key,key,8);
-
- s = check_key_sched_cache (serv_key);
- if (s) {
- serv_ksched = *s;
- return 0;
- }
- ret = des_key_sched (serv_key, serv_ksched.s);
- add_to_key_sched_cache (serv_key, &serv_ksched);
- return ret;
-#endif /* NOENCRYPTION */
-}
-
-
-/*
- * krb_rd_req() takes an AUTH_MSG_APPL_REQUEST or
- * AUTH_MSG_APPL_REQUEST_MUTUAL message created by krb_mk_req(),
- * checks its integrity and returns a judgement as to the requestor's
- * identity.
- *
- * The "authent" argument is a pointer to the received message.
- * The "service" and "instance" arguments name the receiving server,
- * and are used to get the service's ticket to decrypt the ticket
- * in the message, and to compare against the server name inside the
- * ticket. "from_addr" is the network address of the host from which
- * the message was received; this is checked against the network
- * address in the ticket. If "from_addr" is zero, the check is not
- * performed. "ad" is an AUTH_DAT structure which is
- * filled in with information about the sender's identity according
- * to the authenticator and ticket sent in the message. Finally,
- * "fn" contains the name of the file containing the server's key.
- * (If "fn" is NULL, the server's key is assumed to have been set
- * by krb_set_key(). If "fn" is the null string ("") the default
- * file KEYFILE, defined in "krb.h", is used.)
- *
- * krb_rd_req() returns RD_AP_OK if the authentication information
- * was genuine, or one of the following error codes (defined in
- * "krb.h"):
- *
- * RD_AP_VERSION - wrong protocol version number
- * RD_AP_MSG_TYPE - wrong message type
- * RD_AP_UNDEC - couldn't decipher the message
- * RD_AP_INCON - inconsistencies found
- * RD_AP_BADD - wrong network address
- * RD_AP_TIME - client time (in authenticator)
- * too far off server time
- * RD_AP_NYV - Kerberos time (in ticket) too
- * far off server time
- * RD_AP_EXP - ticket expired
- *
- * For the message format, see krb_mk_req().
- *
- * Mutual authentication is not implemented.
- */
-
-krb_rd_req(authent,service,instance,from_addr,ad,fn)
- register KTEXT authent; /* The received message */
- char *service; /* Service name */
- char *instance; /* Service instance */
- long from_addr; /* Net address of originating host */
- AUTH_DAT *ad; /* Structure to be filled in */
- char *fn; /* Filename to get keys from */
-{
- KTEXT_ST ticket; /* Temp storage for ticket */
- KTEXT tkt = &ticket;
- KTEXT_ST req_id_st; /* Temp storage for authenticator */
- register KTEXT req_id = &req_id_st;
-
- char realm[REALM_SZ]; /* Realm of issuing kerberos */
- Sched seskey_sched, *sched; /* Key sched for session key */
- unsigned char skey[KKEY_SZ]; /* Session key from ticket */
- char sname[SNAME_SZ]; /* Service name from ticket */
- char iname[INST_SZ]; /* Instance name from ticket */
- char r_aname[ANAME_SZ]; /* Client name from authenticator */
- char r_inst[INST_SZ]; /* Client instance from authenticator */
- char r_realm[REALM_SZ]; /* Client realm from authenticator */
- unsigned int r_time_ms; /* Fine time from authenticator */
- unsigned long r_time_sec; /* Coarse time from authenticator */
- register char *ptr; /* For stepping through */
- unsigned long delta_t; /* Time in authenticator - local time */
- long tkt_age; /* Age of ticket */
- int swap_bytes; /* Need to swap bytes? */
- int mutual; /* Mutual authentication requested? */
- unsigned char s_kvno; /* Version number of the server's key
- * Kerberos used to encrypt ticket */
- int status;
-
- if (authent->length <= 0)
- return(RD_AP_MODIFIED);
-
- ptr = (char *) authent->dat;
-
- /* get msg version, type and byte order, and server key version */
-
- /* check version */
- if (KRB_PROT_VERSION != (unsigned int) *ptr++)
- return(RD_AP_VERSION);
-
- /* byte order */
- swap_bytes = 0;
- if ((*ptr & 1) != HOST_BYTE_ORDER)
- swap_bytes++;
-
- /* check msg type */
- mutual = 0;
- switch (*ptr++ & ~1) {
- case AUTH_MSG_APPL_REQUEST:
- break;
- case AUTH_MSG_APPL_REQUEST_MUTUAL:
- mutual++;
- break;
- default:
- return(RD_AP_MSG_TYPE);
- }
-
-#ifdef lint
- /* XXX mutual is set but not used; why??? */
- /* this is a crock to get lint to shut up */
- if (mutual)
- mutual = 0;
-#endif /* lint */
- s_kvno = *ptr++; /* get server key version */
- (void) strcpy(realm,ptr); /* And the realm of the issuing KDC */
- ptr += strlen(ptr) + 1; /* skip the realm "hint" */
-
- /*
- * If "fn" is NULL, key info should already be set; don't
- * bother with ticket file. Otherwise, check to see if we
- * already have key info for the given server and key version
- * (saved in the static st_* variables). If not, go get it
- * from the ticket file. If "fn" is the null string, use the
- * default ticket file.
- */
- if (fn && (strcmp(st_nam,service) || strcmp(st_inst,instance) ||
- strcmp(st_rlm,realm) || (st_kvno != s_kvno))) {
- if (*fn == 0) fn = KEYFILE;
- st_kvno = s_kvno;
-#ifndef NOENCRYPTION
- if (read_service_key(service,instance,realm,(int) s_kvno,
- fn,(char *)skey))
- return(RD_AP_UNDEC);
- if ((status = krb_set_key((char *)skey,0)) != 0)
- return(status);
-#endif /* !NOENCRYPTION */
- (void) strcpy(st_rlm,realm);
- (void) strcpy(st_nam,service);
- (void) strcpy(st_inst,instance);
- }
-
- /* Get ticket from authenticator */
- tkt->length = (int) *ptr++;
- if ((tkt->length + (ptr+1 - (char *) authent->dat)) > authent->length)
- return(RD_AP_MODIFIED);
- (void) memcpy((char *)(tkt->dat),ptr+1,tkt->length);
-
- if (krb_ap_req_debug)
- log("ticket->length: %d",tkt->length);
-
-#ifndef NOENCRYPTION
- /* Decrypt and take apart ticket */
-#endif
-
- if (decomp_ticket(tkt,&ad->k_flags,ad->pname,ad->pinst,ad->prealm,
- &(ad->address),ad->session, &(ad->life),
- &(ad->time_sec),sname,iname,serv_key,serv_ksched.s))
- return(RD_AP_UNDEC);
-
- if (krb_ap_req_debug) {
- log("Ticket Contents.");
- log(" Aname: %s.%s",ad->pname,
- ((int)*(ad->prealm) ? ad->prealm : "Athena"));
- log(" Service: %s%s%s",sname,((int)*iname ? "." : ""),iname);
- }
-
- /* Extract the authenticator */
- req_id->length = (int) *(ptr++);
- if ((req_id->length + (ptr + tkt->length - (char *) authent->dat)) >
- authent->length)
- return(RD_AP_MODIFIED);
- (void) memcpy((char *)(req_id->dat),ptr + tkt->length, req_id->length);
-
-#ifndef NOENCRYPTION
- /* And decrypt it with the session key from the ticket */
- if (krb_ap_req_debug) log("About to decrypt authenticator");
- sched = check_key_sched_cache (ad->session);
- if (!sched) {
- sched = &seskey_sched;
- key_sched (ad->session, seskey_sched.s);
- add_to_key_sched_cache (ad->session, &seskey_sched);
- }
- /* can't do much to optimize this... */
- pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat,
- (long) req_id->length, sched->s, ad->session,DES_DECRYPT);
- if (krb_ap_req_debug) log("Done.");
-#endif /* NOENCRYPTION */
-
-#define check_ptr() if ((ptr - (char *) req_id->dat) > req_id->length) return(RD_AP_MODIFIED);
-
- ptr = (char *) req_id->dat;
- (void) strcpy(r_aname,ptr); /* Authentication name */
- ptr += strlen(r_aname)+1;
- check_ptr();
- (void) strcpy(r_inst,ptr); /* Authentication instance */
- ptr += strlen(r_inst)+1;
- check_ptr();
- (void) strcpy(r_realm,ptr); /* Authentication name */
- ptr += strlen(r_realm)+1;
- check_ptr();
- (void) memcpy((char *)&ad->checksum,ptr,4); /* Checksum */
- ptr += 4;
- check_ptr();
- if (swap_bytes) swap_u_long(ad->checksum);
- r_time_ms = *(ptr++); /* Time (fine) */
-#ifdef lint
- /* XXX r_time_ms is set but not used. why??? */
- /* this is a crock to get lint to shut up */
- if (r_time_ms)
- r_time_ms = 0;
-#endif /* lint */
- check_ptr();
- /* assume sizeof(r_time_sec) == 4 ?? */
- (void) memcpy((char *)&r_time_sec,ptr,4); /* Time (coarse) */
- if (swap_bytes) swap_u_long(r_time_sec);
-
- /* Check for authenticity of the request */
- if (krb_ap_req_debug)
- log("Pname: %s %s",ad->pname,r_aname);
- if (strcmp(ad->pname,r_aname) != 0)
- return(RD_AP_INCON);
- if (strcmp(ad->pinst,r_inst) != 0)
- return(RD_AP_INCON);
- if (krb_ap_req_debug)
- log("Realm: %s %s",ad->prealm,r_realm);
- if ((strcmp(ad->prealm,r_realm) != 0))
- return(RD_AP_INCON);
-
- if (krb_ap_req_debug)
- log("Address: %d %d",ad->address,from_addr);
- if (from_addr && (ad->address != from_addr))
- return(RD_AP_BADD);
-
- delta_t = abs((int)(t_local.tv_sec - r_time_sec));
- if (delta_t > CLOCK_SKEW) {
- (void) gettimeofday(&t_local, (struct timezone *)0);
- delta_t = abs((int)(t_local.tv_sec - r_time_sec));
- if (delta_t > CLOCK_SKEW) {
- if (krb_ap_req_debug)
- log("Time out of range: %d - %d = %d",
- t_local.tv_sec,r_time_sec,delta_t);
- return(RD_AP_TIME);
- }
- }
-
- /* Now check for expiration of ticket */
-
- tkt_age = t_local.tv_sec - ad->time_sec;
- if (krb_ap_req_debug)
- log("Time: %d Issue Date: %d Diff: %d Life %x",
- t_local.tv_sec,ad->time_sec,tkt_age,ad->life);
-
- if (t_local.tv_sec < ad->time_sec) {
- if ((ad->time_sec - t_local.tv_sec) > CLOCK_SKEW)
- return(RD_AP_NYV);
- }
- else if ((t_local.tv_sec - ad->time_sec) > 5 * 60 * ad->life)
- return(RD_AP_EXP);
-
- /* All seems OK */
- ad->reply.length = 0;
-
- return(RD_AP_OK);
-}
-#endif /* NOENCRYPTION */
-
-static char local_realm_buffer[REALM_SZ+1];
-
-krb_get_lrealm(r,n)
- char *r;
- int n;
-{
- FILE *cnffile, *fopen();
-
- if (n > 1)
- return(KFAILURE); /* Temporary restriction */
-
- if (local_realm_buffer[0]) {
- strcpy (r, local_realm_buffer);
- return KSUCCESS;
- }
-
- if ((cnffile = fopen(KRB_CONF, "r")) == NULL) {
- if (n == 1) {
- (void) strcpy(r, KRB_REALM);
- return(KSUCCESS);
- }
- else
- return(KFAILURE);
- }
-
- if (fscanf(cnffile,"%s",r) != 1) {
- (void) fclose(cnffile);
- return(KFAILURE);
- }
- (void) fclose(cnffile);
- return(KSUCCESS);
-}
-
-#endif /* KERBEROS */
-
-#ifdef ibm032
-
-#if defined (__GNUC__) || defined (__HIGHC__)
-#ifdef __HIGHC__
-#define asm _ASM
-#endif
-
-/*
- * Copyright (C) 1990 by the Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted.
- */
-
-void asm_wrapper_kopt_c () {
- /*
- * Multiply routine. The C library routine tries to optimize around
- * the multiply-step instruction, which was slower in earlier versions
- * of the processor; this is no longer useful. Derived from assembly
- * code written by John Carr.
- */
-
- /* data section */
- asm(".data\n.align 2");
- asm(".globl _ulmul$$ \n _ulmul$$:");
- asm(".globl _lmul$$ \n _lmul$$: .long lmul$$");
- /* text section */
- asm(".text \n .align 1");
- asm(".globl lmul$$ \n lmul$$:");
- asm(".globl ulmul$$ \n ulmul$$:");
- asm(".globl _.lmul$$ \n _.lmul$$:");
- asm(".globl _.ulmul$$ \n _.ulmul$$:");
- asm(" s r0,r0 \n mts r10,r2"); /* set up multiply, and go: */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" m r0,r3 \n m r0,r3 \n m r0,r3 \n m r0,r3"); /* execute 4 steps */
- asm(" brx r15 \n mfs r10,r2"); /* return result */
- asm(" .long 0xdf02df00"); /* for debugging */
-
-#ifdef USE_LIBC_STRLEN
- }
-#else
- /* Note- do not use this version of strlen when compiling with -g; -g */
- /* causes extra no-ops to be inserted between instructions, which cause */
- /* the delayed branch instructions to fail. */
-
- /*
- * Fast strlen, with optional trapping of null pointers. Also from
- * John Carr.
- */
- /* data */
- asm(".data\n.align 2");
- asm(".globl _strlen \n _strlen: .long _.strlen");
- /* text */
- asm(".text\n.align 1");
- asm(".globl _.strlen \n _.strlen:");
-#if 1
- asm(" ti 2,r2,0"); /* trap if r2 is NULL */
-#endif
- asm(" ls r4,0(r2)");
- asm(" mr r0,r2");
- asm(" nilz r3,r2,3");
- asm(" beqx 0f");
- asm(" nilo r2,r2,0xfffc"); /* clear low bits */
- asm(" sis r3,2"); /* test appropriate bytes of 1st word */
- asm(" jeq 2f"); /* s & 3 == 2 */
- asm(" jm 1f"); /* s & 3 == 1 */
- asm(" j 3f"); /* s & 3 == 3 */
- asm("0: srpi16 r4,8"); /* byte 0 */
- asm(" jeq 4f");
- asm("1: niuz r5,r4,0xff"); /* byte 1 */
- asm(" jeq 5f");
- asm("2: nilz r5,r4,0xff00"); /* byte 2 */
- asm(" jeq 6f");
- asm("3: sli16 r4,8"); /* byte 3 */
- asm(" jeq 7f");
- asm(" ls r4,4(r2)"); /* get next word and continue */
- asm(" bx 0b");
- asm(" inc r2,4");
- asm("4: brx r15"); /* byte 0 is zero */
- asm(" s r2,r0");
- asm("5: s r2,r0"); /* byte 1 is zero */
- asm(" brx r15");
- asm(" inc r2,1");
- asm("6: s r2,r0"); /* byte 2 is zero */
- asm(" brx r15");
- asm(" inc r2,2");
- asm("7: s r2,r0"); /* byte 3 is zero */
- asm(" brx r15");
- asm(" inc r2,3");
- asm(" .long 0xdf02df00"); /* trace table */
-}
-#endif /* USE_LIBC_STRLEN */
-#endif /* __GNUC__ || __HIGHC__ */
-#endif /* ibm032 */
diff --git a/server/kstuff.c b/server/kstuff.c
index 49089de..ff695f5 100644
--- a/server/kstuff.c
+++ b/server/kstuff.c
@@ -1,4 +1,3 @@
-#ifdef KERBEROS
/* This file is part of the Project Athena Zephyr Notification System.
* It contains functions for dealing with Kerberos functions in the server.
*
@@ -13,40 +12,42 @@
* $Header$
*/
+#include "zserver.h"
+
#ifndef lint
#ifndef SABER
-static char rcsid_kstuff_c[] = "$Id$";
+static const char rcsid_kstuff_c[] = "$Id$";
#endif
#endif
-#include "zserver.h"
+#ifdef ZEPHYR_USES_KERBEROS
-#include <ctype.h>
-#include <netdb.h>
-#include <string.h>
+/* Keep a hash table mapping tickets to session keys, so we can do a fast
+ * check of the cryptographic checksum without doing and DES decryptions.
+ * Also remember the expiry time of the ticket, so that we can sweep the
+ * table periodically. */
-#include <zephyr/zephyr_internal.h>
-#ifdef KERBEROS
-#include <zephyr/krb_err.h>
-#endif
+#define HASHTAB_SIZE 4091
-static char tkt_file[] = ZEPHYR_TKFILE;
+typedef struct hash_entry Hash_entry;
-
-struct AuthEnt {
- Zconst char *data;
- int len;
- ZSTRING *principal;
-#ifndef NOENCRYPTION
+/* The ticket comes at the end, in a variable-length array. */
+struct hash_entry {
C_Block session_key;
-#endif
- long expire_time;
- struct sockaddr_in from;
+ time_t expires;
+ char srcprincipal[ANAME_SZ+INST_SZ+REALM_SZ+4];
+ Hash_entry *next;
+ int ticket_len;
+ unsigned char ticket[1];
};
-#define HASH_SIZE_1 513
-#define HASH_SIZE_2 3
-static struct AuthEnt auth_cache[HASH_SIZE_1][HASH_SIZE_2];
+Hash_entry *hashtab[HASHTAB_SIZE];
+
+static int hash_ticket __P((unsigned char *, int));
+static void add_session_key __P((KTEXT, C_Block, char *, time_t));
+static int find_session_key __P((KTEXT, C_Block, char *));
+static ZChecksum_t compute_checksum __P((ZNotice_t *, C_Block));
+static ZChecksum_t compute_rlm_checksum __P((ZNotice_t *, C_Block));
/*
* GetKerberosData
@@ -114,7 +115,7 @@ GetKerberosData(fd, haddr, kdata, service, srvtab)
int
SendKerberosData(fd, ticket, service, host)
- int fd; /* file descriptor to write onto */
+ int fd; /* file descriptor to write onto */
KTEXT ticket; /* where to put ticket (return) */
char *service; /* service name, foreign host */
char *host;
@@ -125,242 +126,327 @@ SendKerberosData(fd, ticket, service, host)
int written;
int size_to_write;
- rem = krb_get_lrealm(krb_realm,1);
- if (rem != KSUCCESS)
- return rem + krb_err_base;
-
- rem = krb_mk_req( ticket, service, host, krb_realm, (u_long)0 );
+ rem = krb_mk_req(ticket, service, host, ZGetRealm(), (u_long) 0);
if (rem != KSUCCESS)
return rem + krb_err_base;
(void) sprintf(p,"%d ",ticket->length);
size_to_write = strlen (p);
if ((written = write(fd, p, size_to_write)) != size_to_write)
- if (written < 0)
- return errno;
- else
- return ZSRV_PKSHORT;
- if ((written = write(fd, (caddr_t) (ticket->dat), ticket->length)) != ticket->length)
- if (written < 0)
- return errno;
- else
- return ZSRV_PKSHORT;
+ return (written < 0) ? errno : ZSRV_PKSHORT;
+ if ((written = write(fd, (caddr_t) (ticket->dat), ticket->length))
+ != ticket->length)
+ return (written < 0) ? errno : ZSRV_PKSHORT;
return 0;
}
-/* Hack to replace the kerberos library's idea of the ticket file with
- our idea */
-char *
-tkt_string()
-{
- return tkt_file;
-}
+#endif /* ZEPHYR_USES_KERBEROS */
-/* Check authentication of the notice.
- If it looks authentic but fails the Kerberos check, return -1.
- If it looks authentic and passes the Kerberos check, return 1.
- If it doesn't look authentic, return 0
-
- When not using Kerberos, return (looks-authentic-p)
- */
+int
+ZCheckRealmAuthentication(notice, from, realm)
+ ZNotice_t *notice;
+ struct sockaddr_in *from;
+ char *realm;
+{
+#ifdef ZEPHYR_USES_KERBEROS
+ int result;
+ char rlmprincipal[ANAME_SZ+INST_SZ+REALM_SZ+4];
+ char srcprincipal[ANAME_SZ+INST_SZ+REALM_SZ+4];
+ KTEXT_ST authent, ticket;
+ AUTH_DAT dat;
+ ZChecksum_t checksum;
+ CREDENTIALS cred;
+ C_Block session_key;
-static void
-ae_expire(ae)
- struct AuthEnt *ae;
-{
- if (ae->data) {
- xfree((void *) ae->data);
- ae->data = 0;
- }
- ae->len = 0;
- ae->expire_time = 0;
- free_zstring(ae->principal);
- ae->principal= 0;
-}
+ if (!notice->z_auth)
+ return ZAUTH_NO;
-static int
-auth_hash (str, len)
- Zconst char *str;
- int len;
-{
- unsigned long hash;
- if (len <= 3)
- return str[0];
- hash = str[len - 1] * 256 + str[len-2] * 16 + str[len-3];
- hash %= HASH_SIZE_1;
- return hash;
-}
+ /* Check for bogus authentication data length. */
+ if (notice->z_authent_len <= 0)
+ return ZAUTH_FAILED;
-static int
-check_cache (notice, from)
- ZNotice_t *notice;
- struct sockaddr_in *from;
- {
- Zconst char *str = notice->z_ascii_authent;
- int len, i;
- unsigned int hash_val = 0;
- unsigned long now = time(0);
- struct AuthEnt *a;
-
- len = strlen (str);
- hash_val = auth_hash (str, len);
- for (i = 0; i < HASH_SIZE_2; i++) {
- a = &auth_cache[hash_val][i];
- if (!a->data) {
- continue;
- }
- if (now > a->expire_time) {
- ae_expire(a);
- continue;
- }
- if (len != a->len) {
- continue;
- }
- if (strcmp (notice->z_ascii_authent, a->data)) {
- continue;
- }
- /* Okay, we know we've got the same authenticator. */
- if (strcmp (notice->z_sender, a->principal->string)) {
- return ZAUTH_FAILED;
- }
- if (from->sin_addr.s_addr != a->from.sin_addr.s_addr) {
- return ZAUTH_FAILED;
- }
-#ifndef NOENCRYPTION
- (void) memcpy (__Zephyr_session, a->session_key, sizeof (C_Block));
-#endif
- return ZAUTH_YES;
+ /* Read in the authentication data. */
+ if (ZReadAscii(notice->z_ascii_authent,
+ strlen(notice->z_ascii_authent)+1,
+ (unsigned char *)authent.dat,
+ notice->z_authent_len) == ZERR_BADFIELD) {
+ return ZAUTH_FAILED;
+ }
+ authent.length = notice->z_authent_len;
+
+ /* Copy the ticket out of the authentication data. */
+ if (krb_find_ticket(&authent, &ticket) != RD_AP_OK)
+ return ZAUTH_FAILED;
+
+ (void) sprintf(rlmprincipal, "%s.%s@%s", SERVER_SERVICE,
+ SERVER_INSTANCE, realm);
+
+ /* Try to do a fast check against the cryptographic checksum. */
+ if (find_session_key(&ticket, session_key, srcprincipal) >= 0) {
+ if (strcmp(srcprincipal, rlmprincipal) != 0)
+ return ZAUTH_FAILED;
+ if (notice->z_time.tv_sec - NOW > CLOCK_SKEW)
+ return ZAUTH_FAILED;
+ checksum = compute_rlm_checksum(notice, session_key);
+
+ /* If checksum matches, packet is authentic. Otherwise, check
+ * the authenticator as if we didn't have the session key cached
+ * and return ZAUTH_CKSUM_FAILED. This is a rare case (since the
+ * ticket isn't cached after a checksum failure), so don't worry
+ * about the extra des_quad_cksum() call. */
+ if (checksum == notice->z_checksum) {
+ memcpy(__Zephyr_session, session_key, sizeof(C_Block));
+ return ZAUTH_YES;
+ }
}
- return ZAUTH_NO;
-}
-void
-add_to_cache (a)
- struct AuthEnt *a;
-{
- int len, i, j;
- struct AuthEnt *entries;
- unsigned int hash_val = 0;
-
- len = a->len;
- hash_val = auth_hash (a->data, len);
- entries = auth_cache[hash_val];
- j = 0;
- for (i = 0; i < HASH_SIZE_2; i++) {
- if (entries[i].data == 0) {
- j = i;
- goto ok;
- }
- if (i == j)
- continue;
- if (entries[i].expire_time < entries[j].expire_time)
- j = i;
+ /* We don't have the session key cached; do it the long way. */
+ result = krb_rd_req(&authent, SERVER_SERVICE, SERVER_INSTANCE,
+ from->sin_addr.s_addr, &dat, srvtab_file);
+ if (result == RD_AP_OK) {
+ sprintf(srcprincipal, "%s%s%s@%s", dat.pname, dat.pinst[0] ? "." : "",
+ dat.pinst, dat.prealm);
+ if (strcmp(rlmprincipal, srcprincipal))
+ return ZAUTH_FAILED;
+ } else {
+ return ZAUTH_FAILED; /* didn't decode correctly */
}
-ok:
- if (entries[j].data)
- ae_expire(&entries[j]);
- entries[j] = *a;
+
+ /* Check the cryptographic checksum. */
+#ifdef NOENCRYPTION
+ our_checksum = 0;
+#else
+ checksum = compute_rlm_checksum(notice, dat.session);
+#endif
+ if (checksum != notice->z_checksum)
+ return ZAUTH_CKSUM_FAILED;
+
+ /* Record the session key, expiry time, and source principal in the
+ * hash table, so we can do a fast check next time. */
+ add_session_key(&ticket, dat.session, srcprincipal,
+ (time_t)(dat.time_sec + dat.life * 5 * 60));
+
+ return ZAUTH_YES;
+
+#else /* !ZEPHYR_USES_KERBEROS */
+ return (notice->z_auth) ? ZAUTH_YES : ZAUTH_NO;
+#endif
}
int
ZCheckAuthentication(notice, from)
- ZNotice_t *notice;
- struct sockaddr_in *from;
+ ZNotice_t *notice;
+ struct sockaddr_in *from;
{
+#ifdef ZEPHYR_USES_KERBEROS
int result;
char srcprincipal[ANAME_SZ+INST_SZ+REALM_SZ+4];
- KTEXT_ST authent;
+ KTEXT_ST authent, ticket;
AUTH_DAT dat;
- ZChecksum_t our_checksum;
- CREDENTIALS cred;
- struct AuthEnt a;
- char *s;
- int auth_len = 0;
+ ZChecksum_t checksum;
+ C_Block session_key;
+
+ if (!notice->z_auth)
+ return ZAUTH_NO;
+ /* Check for bogus authentication data length. */
+ if (notice->z_authent_len <= 0)
+ return ZAUTH_FAILED;
- if (!notice->z_auth) {
- return (ZAUTH_NO);
+ /* Read in the authentication data. */
+ if (ZReadAscii(notice->z_ascii_authent,
+ strlen(notice->z_ascii_authent)+1,
+ (unsigned char *)authent.dat,
+ notice->z_authent_len) == ZERR_BADFIELD) {
+ return ZAUTH_FAILED;
}
+ authent.length = notice->z_authent_len;
- if (__Zephyr_server) {
-
- if (notice->z_authent_len <= 0) { /* bogus length */
-#if 0
- syslog (LOG_DEBUG, "z_authent_len = %d -> AUTH_FAILED",
- notice->z_authent_len);
-#endif
- return(ZAUTH_FAILED);
- }
+ /* Copy the ticket out of the authentication data. */
+ if (krb_find_ticket(&authent, &ticket) != RD_AP_OK)
+ return ZAUTH_FAILED;
- auth_len = strlen (notice->z_ascii_authent);
- if (ZReadAscii(notice->z_ascii_authent, auth_len + 1,
- (unsigned char *)authent.dat,
- notice->z_authent_len) == ZERR_BADFIELD) {
- syslog (LOG_DEBUG,
- "ZReadAscii failed (len:%s) -> AUTH_FAILED (from %s)",
- error_message (ZERR_BADFIELD), inet_ntoa (from->sin_addr));
- return (ZAUTH_FAILED);
- }
- authent.length = notice->z_authent_len;
- result = check_cache (notice, from);
- if (result != ZAUTH_NO)
- return result;
-
- /* Well, it's not in the cache... decode it. */
- result = krb_rd_req(&authent, SERVER_SERVICE,
- SERVER_INSTANCE, (int) from->sin_addr.s_addr,
- &dat, SERVER_SRVTAB);
- if (result == RD_AP_OK) {
- (void) memcpy ((void *) a.session_key,(void *) dat.session,
- sizeof(C_Block));
- (void) memcpy((char *)__Zephyr_session, (char *)dat.session,
- sizeof(C_Block));
- (void) sprintf(srcprincipal, "%s%s%s@%s", dat.pname,
- dat.pinst[0]?".":"", dat.pinst, dat.prealm);
- if (strcmp(srcprincipal, notice->z_sender)) {
- syslog (LOG_DEBUG, "principal mismatch->AUTH_FAILED");
- return (ZAUTH_FAILED);
- }
- a.principal = make_zstring(srcprincipal,0);
- a.expire_time = time (0) + 5 * 60; /* add 5 minutes */
- a.from = *from;
- s = (char *) xmalloc (auth_len + 1);
- strcpy (s, notice->z_ascii_authent);
- a.data = s;
- a.len = auth_len;
- add_to_cache (&a);
- return(ZAUTH_YES);
- } else {
- syslog (LOG_DEBUG, "krb_rd_req failed (%s)->AUTH_FAILED (from %s)",
- krb_err_txt [result], inet_ntoa (from->sin_addr));
- return (ZAUTH_FAILED); /* didn't decode correctly */
+ /* Try to do a fast check against the cryptographic checksum. */
+ if (find_session_key(&ticket, session_key, srcprincipal) >= 0) {
+ if (strcmp(srcprincipal, notice->z_sender) != 0)
+ return ZAUTH_FAILED;
+ if (notice->z_time.tv_sec - NOW > CLOCK_SKEW)
+ return ZAUTH_FAILED;
+ checksum = compute_checksum(notice, session_key);
+
+ /* If the checksum matches, the packet is authentic. Otherwise,
+ * check authenticator as if we didn't have the session key cached
+ * and return ZAUTH_CKSUM_FAILED. This is a rare case (since the
+ * ticket isn't cached after a checksum failure), so don't worry
+ * about the extra des_quad_cksum() call. */
+ if (checksum == notice->z_checksum) {
+ memcpy(__Zephyr_session, session_key, sizeof(C_Block));
+ return ZAUTH_YES;
}
}
-
- if ((result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE,
- __Zephyr_realm, &cred)) != KSUCCESS) {
- syslog (LOG_DEBUG, "krb_get_cred failed (%s) ->AUTH_NO (from %s)",
- krb_err_txt [result], inet_ntoa (from->sin_addr));
- return (ZAUTH_NO);
+
+ /* We don't have the session key cached; do it the long way. */
+ result = krb_rd_req(&authent, SERVER_SERVICE, SERVER_INSTANCE,
+ from->sin_addr.s_addr, &dat, srvtab_file);
+ if (result == RD_AP_OK) {
+ memcpy(__Zephyr_session, dat.session, sizeof(C_Block));
+ sprintf(srcprincipal, "%s%s%s@%s", dat.pname, dat.pinst[0] ? "." : "",
+ dat.pinst, dat.prealm);
+ if (strcmp(srcprincipal, notice->z_sender))
+ return ZAUTH_FAILED;
+ } else {
+ return ZAUTH_FAILED; /* didn't decode correctly */
}
+ /* Check the cryptographic checksum. */
#ifdef NOENCRYPTION
our_checksum = 0;
#else
- our_checksum = (ZChecksum_t)des_quad_cksum(notice->z_packet, NULL,
- notice->z_default_format+
- strlen(notice->z_default_format)+1-
- notice->z_packet, 0, cred.session);
+ checksum = compute_checksum(notice, dat.session);
#endif
- /* if mismatched checksum, then the packet was corrupted */
- if (our_checksum == notice->z_checksum) {
- return ZAUTH_YES;
+ if (checksum != notice->z_checksum)
+ return ZAUTH_CKSUM_FAILED;
+
+ /* Record the session key, expiry time, and source principal in the
+ * hash table, so we can do a fast check next time. */
+ add_session_key(&ticket, dat.session, srcprincipal,
+ (time_t)(dat.time_sec + dat.life * 5 * 60));
+
+ return ZAUTH_YES;
+
+#else /* !ZEPHYR_USES_KERBEROS */
+ return (notice->z_auth) ? ZAUTH_YES : ZAUTH_NO;
+#endif
+}
+
+#ifdef ZEPHYR_USES_KERBEROS
+
+static int hash_ticket(p, len)
+ unsigned char *p;
+ int len;
+{
+ unsigned long hashval = 0, g;
+
+ for (; len > 0; p++, len--) {
+ hashval = (hashval << 4) + *p;
+ g = hashval & 0xf0000000;
+ if (g) {
+ hashval ^= g >> 24;
+ hashval ^= g;
+ }
}
- else {
- syslog (LOG_DEBUG, "checksum mismatch->AUTH_FAILED (from %s)",
- inet_ntoa (from->sin_addr));
- return ZAUTH_FAILED;
+ return hashval % HASHTAB_SIZE;
+}
+
+static void add_session_key(ticket, session_key, srcprincipal, expires)
+ KTEXT ticket;
+ C_Block session_key;
+ char *srcprincipal;
+ time_t expires;
+{
+ Hash_entry *entry;
+ int hashval;
+
+ /* If we can't allocate memory for the hash table entry, just forget
+ * about it. */
+ entry = (Hash_entry *) malloc(sizeof(Hash_entry) - 1 + ticket->length);
+ if (!entry)
+ return;
+
+ /* Initialize the new entry. */
+ memcpy(entry->session_key, session_key, sizeof(entry->session_key));
+ strcpy(entry->srcprincipal, srcprincipal);
+ entry->expires = expires;
+ entry->ticket_len = ticket->length;
+ memcpy(entry->ticket, ticket->dat, ticket->length * sizeof(unsigned char));
+
+ /* Insert the new entry in the hash table. */
+ hashval = hash_ticket(ticket->dat, ticket->length);
+ entry->next = hashtab[hashval];
+ hashtab[hashval] = entry;
+}
+
+static int find_session_key(ticket, key, srcprincipal)
+ KTEXT ticket;
+ C_Block key;
+ char *srcprincipal;
+{
+ unsigned char *dat;
+ int hashval, len;
+ Hash_entry *entry;
+
+ dat = ticket->dat;
+ len = ticket->length;
+ hashval = hash_ticket(dat, len);
+
+ for (entry = hashtab[hashval]; entry; entry = entry->next) {
+ if (entry->ticket_len == len && memcmp(entry->ticket, dat, len) == 0) {
+ memcpy(key, entry->session_key, sizeof(entry->session_key));
+ strcpy(srcprincipal, entry->srcprincipal);
+ return 0;
+ }
}
-}
-#endif /* KERBEROS */
+ return -1;
+}
+
+static ZChecksum_t compute_checksum(notice, session_key)
+ ZNotice_t *notice;
+ C_Block session_key;
+{
+#ifdef NOENCRYPTION
+ return 0;
+#else
+ ZChecksum_t checksum;
+ char *cstart, *cend, *hstart = notice->z_packet, *hend = notice->z_message;
+
+ cstart = notice->z_default_format + strlen(notice->z_default_format) + 1;
+ cend = cstart + strlen(cstart) + 1;
+ checksum = des_quad_cksum(hstart, NULL, cstart - hstart, 0, session_key);
+ checksum ^= des_quad_cksum(cend, NULL, hend - cend, 0, session_key);
+ checksum ^= des_quad_cksum(notice->z_message, NULL, notice->z_message_len,
+ 0, session_key);
+ return checksum;
+#endif
+}
+
+static ZChecksum_t compute_rlm_checksum(notice, session_key)
+ ZNotice_t *notice;
+ C_Block session_key;
+{
+#ifdef NOENCRYPTION
+ return 0;
+#else
+ ZChecksum_t checksum;
+ char *cstart, *cend, *hstart = notice->z_packet, *hend = notice->z_message;
+
+ cstart = notice->z_default_format + strlen(notice->z_default_format) + 1;
+ cend = cstart + strlen(cstart) + 1;
+ checksum = des_quad_cksum(hstart, NULL, cstart - hstart, 0, session_key);
+ return checksum;
+#endif
+}
+
+void sweep_ticket_hash_table(arg)
+ void *arg;
+{
+ int i;
+ Hash_entry **ptr, *entry;
+
+ for (i = 0; i < HASHTAB_SIZE; i++) {
+ ptr = &hashtab[i];
+ while (*ptr) {
+ entry = *ptr;
+ if (entry->expires < NOW) {
+ *ptr = entry->next;
+ free(entry);
+ } else {
+ ptr = &(*ptr)->next;
+ }
+ }
+ }
+ timer_set_rel(SWEEP_INTERVAL, sweep_ticket_hash_table, NULL);
+}
+
+#endif /* ZEPHYR_USES_KERBEROS */
+
diff --git a/server/kstuff.c.auth b/server/kstuff.c.auth
deleted file mode 100644
index f81da75..0000000
--- a/server/kstuff.c.auth
+++ /dev/null
@@ -1,363 +0,0 @@
-#ifdef KERBEROS
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains functions for dealing with Kerberos functions in the server.
- *
- * Created by: John T Kohl
- *
- * Copyright (c) 1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-/*
- * $Source$
- * $Header$
- */
-
-#ifndef lint
-#ifndef SABER
-static char rcsid_kstuff_c[] = "$Id$";
-#endif
-#endif
-
-#include "zserver.h"
-
-#include <ctype.h>
-#include <netdb.h>
-#include <string.h>
-
-#include <zephyr/zephyr_internal.h>
-#ifdef KERBEROS
-#include <zephyr/krb_err.h>
-#endif
-
-/* Keep a hash table mapping tickets to session keys, so we can do a fast
- * check of the cryptographic checksum without doing and DES decryptions.
- * Also remember the expiry time of the ticket, so that we can sweep the
- * table periodically. */
-
-#define HASHTAB_SIZE 4091
-
-typedef struct hash_entry Hash_entry;
-
-/* The ticket comes at the end, in a variable-length array. */
-struct hash_entry {
- C_Block session_key;
- time_t expires;
- char srcprincipal[ANAME_SZ+INST_SZ+REALM_SZ+4];
- Hash_entry *next;
- int ticket_len;
- unsigned char ticket[1];
-};
-
-Hash_entry *hashtab[HASHTAB_SIZE];
-
-static char tkt_file[] = ZEPHYR_TKFILE;
-
-#ifdef __STDC__
-static int hash_ticket(unsigned char *, int);
-static void add_session_key(KTEXT, C_Block, char *, time_t);
-static int find_session_key(KTEXT, C_Block, char *);
-#else
-static int hash_ticket();
-static void add_session_key();
-static int find_session_key();
-#endif
-
-/*
- * GetKerberosData
- *
- * get ticket from file descriptor and decode it.
- * Return KFAILURE if we barf on reading the ticket, else return
- * the value of rd_ap_req() applied to the ticket.
- */
-int
-GetKerberosData(fd, haddr, kdata, service, srvtab)
- int fd; /* file descr. to read from */
- struct in_addr haddr; /* address of foreign host on fd */
- AUTH_DAT *kdata; /* kerberos data (returned) */
- char *service; /* service principal desired */
- char *srvtab; /* file to get keys from */
-{
- char p[20];
- KTEXT_ST ticket; /* will get Kerberos ticket from client */
- int i;
- char instance[INST_SZ];
-
- /*
- * Get the Kerberos ticket. The first few characters, terminated
- * by a blank, should give us a length; then get than many chars
- * which will be the ticket proper.
- */
- for (i=0; i<20; i++) {
- if (read(fd, &p[i], 1) != 1) {
- syslog(LOG_WARNING,"bad read tkt len");
- return(KFAILURE);
- }
- if (p[i] == ' ') {
- p[i] = '\0';
- break;
- }
- }
- ticket.length = atoi(p);
- if ((i==20) || (ticket.length<=0) || (ticket.length>MAX_KTXT_LEN)) {
- syslog(LOG_WARNING,"bad tkt len %d",ticket.length);
- return(KFAILURE);
- }
- for (i=0; i<ticket.length; i++) {
- if (read(fd, (caddr_t) &(ticket.dat[i]), 1) != 1) {
- syslog(LOG_WARNING,"bad tkt read");
- return(KFAILURE);
- }
- }
- /*
- * now have the ticket. use it to get the authenticated
- * data from Kerberos.
- */
- (void) strcpy(instance,"*"); /* let Kerberos fill it in */
-
- return(krb_rd_req(&ticket, service, instance, haddr.s_addr,
- kdata, srvtab ? srvtab : ""));
-}
-
-/*
- * SendKerberosData
- *
- * create and transmit a ticket over the file descriptor for service.host
- * return failure codes if appropriate, or 0 if we
- * get the ticket and write it to the file descriptor
- */
-
-int
-SendKerberosData(fd, ticket, service, host)
- int fd; /* file descriptor to write onto */
- KTEXT ticket; /* where to put ticket (return) */
- char *service; /* service name, foreign host */
- char *host;
-{
- int rem;
- char p[32];
- char krb_realm[REALM_SZ];
- int written;
- int size_to_write;
-
- rem = krb_get_lrealm(krb_realm,1);
- if (rem != KSUCCESS)
- return rem + krb_err_base;
-
- rem = krb_mk_req( ticket, service, host, krb_realm, (u_long)0 );
- if (rem != KSUCCESS)
- return rem + krb_err_base;
-
- (void) sprintf(p,"%d ",ticket->length);
- size_to_write = strlen (p);
- if ((written = write(fd, p, size_to_write)) != size_to_write)
- if (written < 0)
- return errno;
- else
- return ZSRV_PKSHORT;
- if ((written = write(fd, (caddr_t) (ticket->dat), ticket->length)) != ticket->length)
- if (written < 0)
- return errno;
- else
- return ZSRV_PKSHORT;
-
- return 0;
-}
-
-/* Hack to replace the kerberos library's idea of the ticket file with
- our idea */
-char *
-tkt_string()
-{
- return tkt_file;
-}
-
-int
-ZCheckAuthentication(notice, from)
- ZNotice_t *notice;
- struct sockaddr_in *from;
-{
-#ifdef Z_HaveKerberos
- int result, len;
- char srcprincipal[ANAME_SZ+INST_SZ+REALM_SZ+4];
- KTEXT_ST authent, ticket;
- AUTH_DAT dat;
- ZChecksum_t our_checksum;
- unsigned long cksum;
- CREDENTIALS cred;
- C_Block session_key;
-
- if (!notice->z_auth)
- return (ZAUTH_NO);
-
- /* Check for bogus authentication data length. */
- if (notice->z_authent_len <= 0)
- return(ZAUTH_FAILED);
-
- /* Read in the authentication data. */
- if (ZReadAscii(notice->z_ascii_authent,
- strlen(notice->z_ascii_authent)+1,
- (unsigned char *)authent.dat,
- notice->z_authent_len) == ZERR_BADFIELD) {
- return (ZAUTH_FAILED);
- }
- authent.length = notice->z_authent_len;
-
- /* Copy the ticket out of the authentication data. */
- if (krb_find_ticket(&authent, &ticket) != RD_AP_OK)
- return (ZAUTH_FAILED);
-
- /* Try to do a fast check against the cryptographic checksum. */
- if (find_session_key(&ticket, session_key, srcprincipal) >= 0) {
- if (strcmp(srcprincipal, notice->z_sender) != 0)
- return (ZAUTH_FAILED);
- if (notice->z_time.tv_sec - NOW > CLOCK_SKEW)
- return (ZAUTH_FAILED);
-#ifdef NOENCRYPTION
- our_checksum = 0;
-#else
- len = notice->z_default_format + strlen(notice->z_default_format)
- + 1 - notice->z_packet;
- result = des_quad_cksum(notice->z_packet, NULL, len, 0, session_key);
- result ^= des_quad_cksum(notice->z_message, NULL, notice->z_message_len,
- 0, session_key);
- our_checksum = (ZChecksum_t) result;
-#endif
- /* If checksum matches, packet is authentic. Otherwise, check
- * the authenticator as if we didn't have the session key cached
- * and return ZAUTH_CKSUM_FAILED. This is a rare case (since the
- * ticket isn't cached after a checksum failure), so don't worry
- * about the extra des_quad_cksum() call. */
- if (our_checksum == notice->z_checksum)
- return (ZAUTH_YES);
- }
-
- /* We don't have the session key cached; do it the long way. */
- result = krb_rd_req(&authent, SERVER_SERVICE, SERVER_INSTANCE,
- from->sin_addr.s_addr, &dat, SERVER_SRVTAB);
- if (result == RD_AP_OK) {
- (void) memcpy((char *)__Zephyr_session, (char *)dat.session,
- sizeof(C_Block));
- (void) sprintf(srcprincipal, "%s%s%s@%s", dat.pname,
- dat.pinst[0]?".":"", dat.pinst, dat.prealm);
- if (strcmp(srcprincipal, notice->z_sender))
- return (ZAUTH_FAILED);
- } else {
- return (ZAUTH_FAILED); /* didn't decode correctly */
- }
-
- /* Check the cryptographic checksum. */
-#ifdef NOENCRYPTION
- our_checksum = 0;
-#else
- len = notice->z_default_format + strlen(notice->z_default_format)
- + 1 - notice->z_packet;
- cksum = des_quad_cksum(notice->z_packet, NULL, len, 0, dat.session);
- our_checksum = (ZChecksum_t) cksum;
-#endif
- if (our_checksum != notice->z_checksum)
- return (ZAUTH_CKSUM_FAILED);
-
- /* Record the session key, expiry time, and source principal in the
- * hash table, so we can do a fast check next time. */
- add_session_key(&ticket, dat.session, srcprincipal,
- (time_t)(dat.time_sec + dat.life * 5 * 60));
-
- return (ZAUTH_YES);
-
-#else /* not Z_HaveKerberos */
- return (notice->z_auth ? ZAUTH_YES : ZAUTH_NO);
-#endif
-}
-
-static int hash_ticket(p, len)
- unsigned char *p;
- int len;
-{
- unsigned long hashval = 0, g;
-
- for (; len > 0; p++, len--) {
- hashval = (hashval << 4) + *p;
- g = hashval & 0xf0000000;
- if (g) {
- hashval ^= g >> 24;
- hashval ^= g;
- }
- }
- return hashval % HASHTAB_SIZE;
-}
-
-static void add_session_key(ticket, session_key, srcprincipal, expires)
- KTEXT ticket;
- C_Block session_key;
- char *srcprincipal;
- time_t expires;
-{
- Hash_entry *entry;
- int hashval;
-
- /* If we can't allocate memory for the hash table entry, just forget
- * about it. */
- entry = (Hash_entry *) xmalloc(sizeof(Hash_entry) - 1 + ticket->length);
- if (!entry)
- return;
-
- /* Initialize the new entry. */
- memcpy(entry->session_key, session_key, sizeof(entry->session_key));
- strcpy(entry->srcprincipal, srcprincipal);
- entry->expires = expires;
- entry->ticket_len = ticket->length;
- memcpy(entry->ticket, ticket->dat, ticket->length * sizeof(unsigned char));
-
- /* Insert the new entry in the hash table. */
- hashval = hash_ticket(ticket->dat, ticket->length);
- entry->next = hashtab[hashval];
- hashtab[hashval] = entry;
-}
-
-static int find_session_key(ticket, key, srcprincipal)
- KTEXT ticket;
- C_Block key;
- char *srcprincipal;
-{
- unsigned char *dat;
- int hashval, len;
- Hash_entry *entry;
-
- dat = ticket->dat;
- len = ticket->length;
- hashval = hash_ticket(dat, len);
-
- for (entry = hashtab[hashval]; entry; entry = entry->next) {
- if (entry->ticket_len == len && memcmp(entry->ticket, dat, len) == 0) {
- memcpy(key, entry->session_key, sizeof(entry->session_key));
- strcpy(srcprincipal, entry->srcprincipal);
- return 0;
- }
- }
- return -1;
-}
-
-void sweep_ticket_hash_table(arg)
- void *arg;
-{
- int i;
- Hash_entry **ptr, *entry;
-
- for (i = 0; i < HASHTAB_SIZE; i++) {
- ptr = &hashtab[i];
- while (*ptr) {
- entry = *ptr;
- if (entry->expires < NOW) {
- *ptr = entry->next;
- free(entry);
- } else {
- ptr = &(*ptr)->next;
- }
- }
- }
- timer_set_rel(SWEEP_INTERVAL, sweep_ticket_hash_table, NULL);
-}
-
-#endif /* KERBEROS */
-
diff --git a/server/main.c b/server/main.c
index 3420d06..9978bbd 100644
--- a/server/main.c
+++ b/server/main.c
@@ -12,10 +12,13 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
+#include <sys/socket.h>
+#include <sys/resource.h>
#ifndef lint
#ifndef SABER
-static char rcsid_main_c[] =
+static const char rcsid_main_c[] =
"$Id$";
#endif
#endif
@@ -47,91 +50,58 @@ static char rcsid_main_c[] =
(if the client has not acknowledged a packet after a given timeout).
*/
-#include "zserver.h"
-/* which includes
- zephyr/zephyr.h
- <errno.h>
- <sys/types.h>
- <netinet/in.h>
- <sys/time.h>
- <stdio.h>
- <sys/file.h>
- <syslog.h>
- <strings.h>
- <signal.h>
- timer.h
- zsrv_err.h
- */
-
-#include <netdb.h>
-#include <sys/socket.h>
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#ifdef POSIX
-#include <termios.h>
-#endif
-
-#ifdef POSIX
-#define SIGNAL_RETURN_TYPE void
-#define SIG_RETURN return
-#else
-#define SIGNAL_RETURN_TYPE int
-#define SIG_RETURN return(0)
-#endif
-
-#if !defined(__SABER__) && (defined (vax) || defined (ibm032))
-#define MONCONTROL moncontrol
-#else
-#define MONCONTROL (void)
-#endif
-
#define EVER (;;) /* don't stop looping */
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static int do_net_setup P((void)), initialize P((void));
-static void usage P((void)), do_reset P((void));
-static SIGNAL_RETURN_TYPE bye P((int)),
- dbug_on P((int)), dbug_off P((int)),
- sig_dump_db P((int)), sig_dump_strings P((int)),
- reset P((int)), reap P((int));
-static void read_from_dump P((char *dumpfile));
-static void dump_db P((void)), dump_strings P((void));
+static int do_net_setup __P((void));
+static int initialize __P((void));
+static void usage __P((void));
+static void do_reset __P((void));
+static RETSIGTYPE bye __P((int));
+static RETSIGTYPE dbug_on __P((int));
+static RETSIGTYPE dbug_off __P((int));
+static RETSIGTYPE sig_dump_db __P((int));
+static RETSIGTYPE sig_dump_strings __P((int));
+static RETSIGTYPE reset __P((int));
+static RETSIGTYPE reap __P((int));
+static void read_from_dump __P((char *dumpfile));
+static void dump_db __P((void));
+static void dump_strings __P((void));
#ifndef DEBUG
-static void detach P((void));
+static void detach __P((void));
#endif
-extern void perror P((Zconst char *));
-
-#undef P
-
static short doreset = 0; /* if it becomes 1, perform
reset functions */
+int nfds; /* max file descriptor for select() */
int srv_socket; /* dgram socket for clients
and other servers */
int bdump_socket = -1; /* brain dump socket fd
(closed most of the time) */
fd_set interesting; /* the file descrips we are listening
to right now */
-int nfildes; /* number to look at in select() */
-struct sockaddr_in sock_sin; /* address of the socket */
-struct timeval nexthost_tv; /* time till next timeout for select */
+struct sockaddr_in srv_addr; /* address of the socket */
-ZNotAcked_t *nacklist; /* list of packets waiting for ack's */
+Unacked *nacklist = NULL; /* list of packets waiting for ack's */
-u_short hm_port; /* the port # of the host manager */
+unsigned short hm_port; /* host manager receiver port */
+unsigned short hm_srv_port; /* host manager server sending port */
char *programname; /* set to the basename of argv[0] */
char myname[MAXHOSTNAMELEN]; /* my host name */
+#ifndef ZEPHYR_USES_HESIOD
+char list_file[128];
+#endif
+#ifdef ZEPHYR_USES_KERBEROS
+char srvtab_file[128];
+char my_realm[REALM_SZ];
+static char tkt_file[128];
+#endif
+char acl_dir[128];
+char subs_file[128];
+
int zdebug;
#ifdef DEBUG_MALLOC
int dump_malloc_stats = 0;
@@ -147,259 +117,247 @@ static int dump_db_flag = 0;
static int dump_strings_flag = 0;
u_long npackets; /* number of packets processed */
-long uptime; /* when we started operations */
+time_t uptime; /* when we started operations */
static int nofork;
struct in_addr my_addr;
-char *bdump_version = "1.1";
+char *bdump_version = "1.2";
int
main(argc, argv)
- int argc;
- char **argv;
+ int argc;
+ char **argv;
{
- int nfound; /* #fildes ready on select */
- fd_set readable;
- struct timeval *tvp;
- int init_from_dump = 0;
- char *dumpfile;
-#ifdef POSIX
- struct sigaction action;
-#endif
-
-
- int optchar; /* option processing */
- extern char *optarg;
- extern int optind;
-
- /* set name */
- if (programname = strrchr(argv[0],'/'))
- programname++;
- else programname = argv[0];
-
- /* process arguments */
-
- while ((optchar = getopt(argc, argv, "dsnv:f:")) != EOF) {
- switch(optchar) {
- case 'd':
- zdebug = 1;
- break;
+ int nfound; /* #fildes ready on select */
+ fd_set readable;
+ struct timeval tv;
+ int init_from_dump = 0;
+ char *dumpfile;
+#ifdef _POSIX_VERSION
+ struct sigaction action;
+#endif
+ int optchar; /* option processing */
+ extern char *optarg;
+ extern int optind;
+
+#ifndef ZEPHYR_USES_HESIOD
+ sprintf(list_file, "%s/%s", CONFDIR, SERVER_LIST_FILE);
+#endif
+#ifdef ZEPHYR_USES_KERBEROS
+ sprintf(srvtab_file, "%s/%s", CONFDIR, ZEPHYR_SRVTAB);
+ sprintf(tkt_file, "%s/%s", CONFDIR, ZEPHYR_TKFILE);
+#endif
+ sprintf(acl_dir, "%s/%s", CONFDIR, ZEPHYR_ACL_DIR);
+ sprintf(subs_file, "%s/%s", CONFDIR, DEFAULT_SUBS_FILE);
+
+ /* set name */
+ programname = strrchr(argv[0],'/');
+ programname = (programname) ? programname + 1 : argv[0];
+
+ /* process arguments */
+ while ((optchar = getopt(argc, argv, "dsnv:f:k:")) != EOF) {
+ switch(optchar) {
+ case 'd':
+ zdebug = 1;
+ break;
#ifdef DEBUG
- case 's':
- zalone = 1;
- break;
-#endif
- case 'n':
- nofork = 1;
- break;
- case 'v':
- bdump_version = optarg;
- break;
- case 'f':
- init_from_dump = 0;
- dumpfile = optarg;
- break;
- case '?':
- default:
- usage();
- /*NOTREACHED*/
- }
+ case 's':
+ zalone = 1;
+ break;
+#endif
+ case 'n':
+ nofork = 1;
+ break;
+ case 'k':
+#ifdef ZEPHYR_USES_KERBEROS
+ strncpy(my_realm, optarg, REALM_SZ);
+#endif
+ break;
+ case 'v':
+ bdump_version = optarg;
+ break;
+ case 'f':
+ init_from_dump = 0;
+ dumpfile = optarg;
+ break;
+ case '?':
+ default:
+ usage();
+ /*NOTREACHED*/
}
+ }
-#ifdef KERBEROS
- /* if there is no readable srvtab and we are not standalone, there
- is no possible way we can succeed, so we exit */
+#ifdef ZEPHYR_USES_KERBEROS
+ /* if there is no readable srvtab and we are not standalone, there
+ is no possible way we can succeed, so we exit */
- if (access(ZEPHYR_SRVTAB, R_OK)
+ if (access(srvtab_file, R_OK)
#ifdef DEBUG
- && !zalone
+ && !zalone
#endif /* DEBUG */
- ) {
- fprintf(stderr, "NO ZEPHYR SRVTAB (%s) available; exiting\n",
- ZEPHYR_SRVTAB);
- exit(1);
+ ) {
+ fprintf(stderr, "NO ZEPHYR SRVTAB (%s) available; exiting\n",
+ srvtab_file);
+ exit(1);
+ }
+ /* Use local realm if not specified on command line. */
+ if (!*my_realm) {
+ if (krb_get_lrealm(my_realm, 1) != KSUCCESS) {
+ fputs("Couldn't get local Kerberos realm; exiting.\n", stderr);
+ exit(1);
}
-#endif /* KERBEROS */
+ }
+#endif /* ZEPHYR_USES_KERBEROS */
#ifndef DEBUG
- if (!nofork)
- detach();
+ if (!nofork)
+ detach();
#endif /* DEBUG */
- /* open log */
- OPENLOG(programname, LOG_PID, LOG_LOCAL6);
+ /* open log */
+ OPENLOG(programname, LOG_PID, LOG_LOCAL6);
#if defined (DEBUG) && 0
- if (zalone)
- syslog(LOG_DEBUG, "standalone operation");
+ if (zalone)
+ syslog(LOG_DEBUG, "standalone operation");
#endif
#if 0
- if (zdebug)
- syslog(LOG_DEBUG, "debugging on");
+ if (zdebug)
+ syslog(LOG_DEBUG, "debugging on");
#endif
- /* set up sockets & my_addr and myname,
- find other servers and set up server table, initialize queues
- for retransmits, initialize error tables,
- set up restricted classes */
-
- /* Initialize t_local for other uses */
- (void) gettimeofday(&t_local, (struct timezone *)0);
+ /* set up sockets & my_addr and myname,
+ find other servers and set up server table, initialize queues
+ for retransmits, initialize error tables,
+ set up restricted classes */
- if (initialize())
- exit(1);
+ /* Initialize t_local for other uses */
+ gettimeofday(&t_local, NULL);
- if (init_from_dump)
- read_from_dump(dumpfile);
+ if (initialize())
+ exit(1);
- /* Seed random number set. */
- srandom (getpid () ^ time (0));
+ if (init_from_dump)
+ read_from_dump(dumpfile);
-#ifndef __SABER__
- /* chdir to somewhere where a core dump will survive */
- if (chdir("/usr/tmp") != 0)
- syslog(LOG_ERR,"chdir failed (%m) (execution continuing)");
+ /* Seed random number set. */
+ srandom(getpid() ^ time(0));
-#if 0
- /*
- * Many systems don't implement setpriority() as is done under BSD,
- * and the kernel scheduler will appropriately swap in the processes
- * that are needed.
- */
- if (setpriority(PRIO_PROCESS, getpid(), -10))
- syslog(LOG_ERR,"setpriority failed (%m)");
-#endif
-#endif
+ /* chdir to somewhere where a core dump will survive */
+ if (chdir(TEMP_DIRECTORY) != 0)
+ syslog(LOG_ERR, "chdir failed (%m) (execution continuing)");
- FD_ZERO(&interesting);
- FD_SET(srv_socket, &interesting);
+ FD_ZERO(&interesting);
+ FD_SET(srv_socket, &interesting);
- nfildes = srv_socket + 1;
+ nfds = srv_socket + 1;
-#ifdef POSIX
- action.sa_flags = 0;
- sigemptyset(&action.sa_mask);
+#ifdef _POSIX_VERSION
+ action.sa_flags = 0;
+ sigemptyset(&action.sa_mask);
- action.sa_handler = bye;
- sigaction(SIGINT, &action, NULL);
- sigaction(SIGTERM, &action, NULL);
+ action.sa_handler = bye;
+ sigaction(SIGINT, &action, NULL);
+ sigaction(SIGTERM, &action, NULL);
- action.sa_handler = dbug_on;
- sigaction(SIGUSR1, &action, NULL);
+ action.sa_handler = dbug_on;
+ sigaction(SIGUSR1, &action, NULL);
- action.sa_handler = dbug_off;
- sigaction(SIGUSR2, &action, NULL);
+ action.sa_handler = dbug_off;
+ sigaction(SIGUSR2, &action, NULL);
- action.sa_handler = reap;
- sigaction(SIGCHLD, &action, NULL);
+ action.sa_handler = reap;
+ sigaction(SIGCHLD, &action, NULL);
- action.sa_handler = sig_dump_db;
- sigaction(SIGFPE, &action, NULL);
- sigaction(SIGXCPU, &action, NULL);
+ action.sa_handler = sig_dump_db;
+ sigaction(SIGFPE, &action, NULL);
#ifdef SIGEMT
- action.sa_handler = sig_dump_strings;
- sigaction(SIGEMT, &action, NULL);
+ action.sa_handler = sig_dump_strings;
+ sigaction(SIGEMT, &action, NULL);
#endif
- action.sa_handler = reset;
- sigaction(SIGHUP, &action, NULL);
+ action.sa_handler = reset;
+ sigaction(SIGHUP, &action, NULL);
#else /* !posix */
- (void) signal(SIGINT, bye);
- (void) signal(SIGTERM, bye);
- (void) signal(SIGUSR1, dbug_on);
- (void) signal(SIGUSR2, dbug_off);
- (void) signal(SIGCHLD, reap);
- (void) signal(SIGFPE, sig_dump_db);
- (void) signal(SIGXCPU, sig_dump_db);
+ signal(SIGINT, bye);
+ signal(SIGTERM, bye);
+ signal(SIGUSR1, dbug_on);
+ signal(SIGUSR2, dbug_off);
+ signal(SIGCHLD, reap);
+ signal(SIGFPE, sig_dump_db);
#ifdef SIGEMT
- (void) signal(SIGEMT, sig_dump_strings);
+ signal(SIGEMT, sig_dump_strings);
#endif
- (void) signal(SIGHUP, reset);
-#endif /* POSIX */
+ signal(SIGHUP, reset);
+#endif /* _POSIX_VERSION */
- syslog(LOG_NOTICE, "Ready for action");
+ syslog(LOG_NOTICE, "Ready for action");
- /* Reinitialize t_local now that initialization is done. */
- (void) gettimeofday(&t_local, (struct timezone *)0);
- /* GO! */
- uptime = NOW;
+ /* Reinitialize t_local now that initialization is done. */
+ gettimeofday(&t_local, NULL);
+ uptime = NOW;
+#ifdef ZEPHYR_USES_KERBEROS
+ timer_set_rel(SWEEP_INTERVAL, sweep_ticket_hash_table, NULL);
+#endif
#ifdef DEBUG_MALLOC
- malloc_inuse(&m_size);
-#endif
- for EVER {
- if (doreset)
- do_reset();
-
- if (dump_db_flag)
- dump_db();
- if (dump_strings_flag)
- dump_strings();
-
- nexthost_tv.tv_usec = 0;
- tvp = &nexthost_tv;
-
- if (nexttimo != 0L) {
- nexthost_tv.tv_sec = nexttimo - NOW;
- if (nexthost_tv.tv_sec <= 0) {
- /* timeout has passed! */
- /* so we process one timeout, then pop to
- select, polling for input. This way we get
- work done even if swamped with many
- timeouts */
- /* this will reset nexttimo */
- (void) timer_process();
- nexthost_tv.tv_sec = 0;
- }
- } else { /* no timeouts to process */
- nexthost_tv.tv_sec = 15;
- }
- readable = interesting;
- if (msgs_queued()) {
- /* when there is input in the queue, we
- artificially set up to pick up the input */
- nfound = 1;
- FD_ZERO(&readable);
- } else
- nfound = select(nfildes, &readable, (fd_set *) 0,
- (fd_set *) 0, tvp);
-
- /* Initialize t_local for other uses */
- (void) gettimeofday(&t_local, (struct timezone *)0);
+ malloc_inuse(&m_size);
+#endif
+ for EVER {
+ if (doreset)
+ do_reset();
+
+ if (dump_db_flag)
+ dump_db();
+ if (dump_strings_flag)
+ dump_strings();
+
+ readable = interesting;
+ if (msgs_queued()) {
+ /* when there is input in the queue, we
+ artificially set up to pick up the input */
+ nfound = 1;
+ FD_ZERO(&readable);
+ } else {
+ nfound = select(nfds, &readable, NULL, NULL, timer_timeout(&tv));
+ }
+
+ /* Initialize t_local for other uses */
+ gettimeofday(&t_local, (struct timezone *)0);
- /* don't flame about EINTR, since a SIGUSR1 or SIGUSR2
- can generate it by interrupting the select */
- if (nfound < 0) {
- if (errno != EINTR)
- syslog(LOG_WARNING, "select error: %m");
+ /* don't flame about EINTR, since a SIGUSR1 or SIGUSR2
+ can generate it by interrupting the select */
+ if (nfound < 0) {
+ if (errno != EINTR)
+ syslog(LOG_WARNING, "select error: %m");
#ifdef DEBUG_MALLOC
- if (dump_malloc_stats) {
- unsigned long foo,histid2;
- dump_malloc_stats = 0;
- foo = malloc_inuse(&histid2);
- printf("Total inuse: %d\n",foo);
- malloc_list(2,m_size,histid2);
- }
-#endif
- continue;
- }
- if (nfound == 0)
- /* either we timed out or we were just
- polling for input. Either way we want to continue
- the loop, and process the next timeout */
- continue;
- else {
- if ((bdump_socket >= 0) &&
- FD_ISSET(bdump_socket,&readable))
- bdump_send();
- else if (msgs_queued() ||
- FD_ISSET(srv_socket, &readable)) {
- handle_packet();
- } else
- syslog(LOG_ERR, "select weird?!?!");
- }
+ if (dump_malloc_stats) {
+ unsigned long foo,histid2;
+
+ dump_malloc_stats = 0;
+ foo = malloc_inuse(&histid2);
+ printf("Total inuse: %d\n",foo);
+ malloc_list(2,m_size,histid2);
+ }
+#endif
+ continue;
+ }
+
+ if (nfound == 0) {
+ /* either we timed out or we were just
+ polling for input. Either way we want to continue
+ the loop, and process the next timeout */
+ continue;
+ } else {
+ if (bdump_socket >= 0 && FD_ISSET(bdump_socket,&readable))
+ bdump_send();
+ else if (msgs_queued() || FD_ISSET(srv_socket, &readable))
+ handle_packet();
+ else
+ syslog(LOG_ERR, "select weird?!?!");
}
+ }
}
/* Initialize net stuff.
@@ -412,49 +370,35 @@ main(argc, argv)
static int
initialize()
{
- if (do_net_setup())
- return(1);
+ if (do_net_setup())
+ return(1);
- server_init();
+ server_init();
-#if 0
- if (!(nacklist = (ZNotAcked_t *) xmalloc(sizeof(ZNotAcked_t)))) {
- /* unrecoverable */
- syslog(LOG_CRIT, "nacklist malloc");
- abort();
- }
-#else
- {
- static ZNotAcked_t not_acked_head;
- nacklist = &not_acked_head;
- }
+#ifdef ZEPHYR_USES_KERBEROS
+ krb_set_tkt_string(tkt_file);
#endif
- (void) memset((caddr_t) nacklist, 0, sizeof(ZNotAcked_t));
- nacklist->q_forw = nacklist->q_back = nacklist;
-
- nexttimo = 1L; /* trigger the timers when we hit
- the FOR loop */
+ realm_init();
- (void) ZInitialize(); /* set up the library */
- (void) init_zsrv_err_tbl(); /* set up err table */
+ ZSetServerState(1);
+ ZInitialize(); /* set up the library */
+ init_zsrv_err_tbl(); /* set up err table */
- (void) ZSetServerState(1);
- (void) ZSetFD(srv_socket); /* set up the socket as the
- input fildes */
+ ZSetFD(srv_socket); /* set up the socket as the input fildes */
- /* set up default strings */
+ /* set up default strings */
- class_control = make_zstring(ZEPHYR_CTL_CLASS, 1);
- class_admin = make_zstring(ZEPHYR_ADMIN_CLASS, 1);
- class_hm = make_zstring(HM_CTL_CLASS, 1);
- class_ulogin = make_zstring(LOGIN_CLASS, 1);
- class_ulocate = make_zstring(LOCATE_CLASS, 1);
- wildcard_instance = make_zstring(WILDCARD_INSTANCE, 1);
- empty = make_zstring("", 0);
+ class_control = make_string(ZEPHYR_CTL_CLASS, 1);
+ class_admin = make_string(ZEPHYR_ADMIN_CLASS, 1);
+ class_hm = make_string(HM_CTL_CLASS, 1);
+ class_ulogin = make_string(LOGIN_CLASS, 1);
+ class_ulocate = make_string(LOCATE_CLASS, 1);
+ wildcard_instance = make_string(WILDCARD_INSTANCE, 1);
+ empty = make_string("", 0);
- /* restrict certain classes */
- access_init();
- return(0);
+ /* restrict certain classes */
+ access_init();
+ return 0;
}
/*
@@ -464,62 +408,59 @@ initialize()
static int
do_net_setup()
{
- struct servent *sp;
- struct hostent *hp;
- char hostname[MAXHOSTNAMELEN+1];
- int flags;
-
- if (gethostname(hostname, MAXHOSTNAMELEN+1)) {
- syslog(LOG_ERR, "no hostname: %m");
- return(1);
- }
- if (!(hp = gethostbyname(hostname))) {
- syslog(LOG_ERR, "no gethostbyname repsonse");
- (void) strncpy(myname, hostname, MAXHOSTNAMELEN);
- return(1);
- }
- (void) strncpy(myname, hp->h_name, MAXHOSTNAMELEN);
- (void) memcpy((caddr_t) &my_addr, (caddr_t) hp->h_addr,
- sizeof(hp->h_addr));
-
- (void) setservent(1); /* keep file/connection open */
-
- if (!(sp = getservbyname(SERVER_SVCNAME, "udp"))) {
- syslog(LOG_ERR, "%s/udp unknown",SERVER_SVCNAME);
- return(1);
- }
- (void) memset((caddr_t) &sock_sin, 0, sizeof(sock_sin));
- sock_sin.sin_port = sp->s_port;
-
- if (!(sp = getservbyname(HM_SVCNAME, "udp"))) {
- syslog(LOG_ERR, "%s/udp unknown", HM_SVCNAME);
- return(1);
- }
- hm_port = sp->s_port;
+ struct servent *sp;
+ struct hostent *hp;
+ char hostname[MAXHOSTNAMELEN+1];
+ int flags;
+
+ if (gethostname(hostname, MAXHOSTNAMELEN + 1)) {
+ syslog(LOG_ERR, "no hostname: %m");
+ return 1;
+ }
+ hp = gethostbyname(hostname);
+ if (!hp) {
+ syslog(LOG_ERR, "no gethostbyname repsonse");
+ strncpy(myname, hostname, MAXHOSTNAMELEN);
+ return 1;
+ }
+ strncpy(myname, hp->h_name, MAXHOSTNAMELEN);
+ memcpy(&my_addr, hp->h_addr, sizeof(hp->h_addr));
- (void) endservent();
+ setservent(1); /* keep file/connection open */
+
+ memset(&srv_addr, 0, sizeof(srv_addr));
+ srv_addr.sin_family = AF_INET;
+ sp = getservbyname(SERVER_SVCNAME, "udp");
+ srv_addr.sin_port = (sp) ? sp->s_port : SERVER_SVC_FALLBACK;
+
+ sp = getservbyname(HM_SVCNAME, "udp");
+ hm_port = (sp) ? sp->s_port : HM_SVC_FALLBACK;
- if ((srv_socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- syslog(LOG_ERR, "client_sock failed: %m");
- return(1);
- }
- if (bind(srv_socket, (struct sockaddr *) &sock_sin,
- sizeof(sock_sin)) < 0) {
- syslog(LOG_ERR, "client bind failed: %m");
- return(1);
- }
+ sp = getservbyname(HM_SRV_SVCNAME, "udp");
+ hm_srv_port = (sp) ? sp->s_port : HM_SRV_SVC_FALLBACK;
+
+ srv_socket = socket(AF_INET, SOCK_DGRAM, 0);
+ if (srv_socket < 0) {
+ syslog(LOG_ERR, "client_sock failed: %m");
+ return 1;
+ }
+ if (bind(srv_socket, (struct sockaddr *) &srv_addr,
+ sizeof(srv_addr)) < 0) {
+ syslog(LOG_ERR, "client bind failed: %m");
+ return 1;
+ }
- /* set not-blocking */
-#ifdef POSIX
- flags = fcntl(srv_socket, F_GETFL);
- flags |= O_NONBLOCK;
- (void) fcntl(srv_socket, F_SETFL, flags);
+ /* set not-blocking */
+#ifdef _POSIX_VERSION
+ flags = fcntl(srv_socket, F_GETFL);
+ flags |= O_NONBLOCK;
+ fcntl(srv_socket, F_SETFL, flags);
#else
- flags = 1;
- (void) ioctl(srv_socket, FIONBIO, (caddr_t) &flags);
+ flags = 1;
+ ioctl(srv_socket, FIONBIO, &flags);
#endif
- return(0);
+ return 0;
}
@@ -531,186 +472,160 @@ static void
usage()
{
#ifdef DEBUG
- fprintf(stderr,"Usage: %s [-d] [-s] [-n] [-f dumpfile]\n",programname);
+ fprintf(stderr, "Usage: %s [-d] [-s] [-n] [-k realm] [-f dumpfile]\n",
+ programname);
#else
- fprintf(stderr,"Usage: %s [-d] [-n] [-f dumpfile]\n",programname);
+ fprintf(stderr, "Usage: %s [-d] [-n] [-k realm] [-f dumpfile]\n",
+ programname);
#endif /* DEBUG */
exit(2);
}
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-bye(int sig)
-#else
+int
+packets_waiting()
+{
+ fd_set readable, initial;
+ struct timeval tv;
+
+ if (msgs_queued())
+ return 1;
+ FD_ZERO(&initial);
+ FD_SET(srv_socket, &initial);
+ readable = initial;
+ tv.tv_sec = tv.tv_usec = 0;
+ return (select(srv_socket + 1, &readable, NULL, NULL, &tv) > 0);
+}
+
+static RETSIGTYPE
bye(sig)
- int sig;
-#endif
+ int sig;
{
- server_shutdown(); /* tell other servers */
- hostm_shutdown(); /* tell our hosts */
-#ifdef KERBEROS
- (void) dest_tkt();
+ server_shutdown(); /* tell other servers */
+ hostm_shutdown(); /* tell our hosts */
+#ifdef ZEPHYR_USES_KERBEROS
+ dest_tkt();
#endif
- syslog(LOG_NOTICE, "goodbye (sig %d)",sig);
- exit(0);
- /*NOTREACHED*/
+ syslog(LOG_NOTICE, "goodbye (sig %d)", sig);
+ exit(0);
}
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-dbug_on(int sig)
-#else
+static RETSIGTYPE
dbug_on(sig)
- int sig;
-#endif
+ int sig;
{
- syslog(LOG_DEBUG, "debugging turned on");
+ syslog(LOG_DEBUG, "debugging turned on");
#ifdef DEBUG_MALLOC
- dump_malloc_stats = 1;
+ dump_malloc_stats = 1;
#endif
- zdebug = 1;
- SIG_RETURN;
+ zdebug = 1;
}
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-dbug_off(int sig)
-#else
+static RETSIGTYPE
dbug_off(sig)
- int sig;
-#endif
+ int sig;
{
- syslog(LOG_DEBUG, "debugging turned off");
+ syslog(LOG_DEBUG, "debugging turned off");
#ifdef DEBUG_MALLOC
- malloc_inuse(&m_size);
+ malloc_inuse(&m_size);
#endif
- zdebug = 0;
- SIG_RETURN;
+ zdebug = 0;
}
int fork_for_dump = 0;
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-sig_dump_strings (int sig)
-#else
+static RETSIGTYPE
sig_dump_strings(sig)
- int sig;
-#endif
+ int sig;
{
- dump_strings_flag = 1;
- SIG_RETURN;
+ dump_strings_flag = 1;
}
static void dump_strings()
{
+ char filename[128];
+
FILE *fp;
int oerrno = errno;
- fp = fopen ("/usr/tmp/zephyr.strings", "w");
+
+ sprintf(filename, "%szephyr.strings", TEMP_DIRECTORY);
+ fp = fopen (filename, "w");
if (!fp) {
- syslog (LOG_ERR, "can't open strings dump file: %m");
+ syslog(LOG_ERR, "can't open strings dump file: %m");
errno = oerrno;
dump_strings_flag = 0;
return;
}
- syslog (LOG_INFO, "dumping strings to disk");
- print_zstring_table(fp);
- if (fclose (fp) == EOF)
- syslog (LOG_ERR, "error writing strings dump file");
+ syslog(LOG_INFO, "dumping strings to disk");
+ print_string_table(fp);
+ if (fclose(fp) == EOF)
+ syslog(LOG_ERR, "error writing strings dump file");
else
- syslog (LOG_INFO, "dump done");
+ syslog(LOG_INFO, "dump done");
oerrno = errno;
dump_strings_flag = 0;
return;
}
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-sig_dump_db(int sig)
-#else
+static RETSIGTYPE
sig_dump_db(sig)
- int sig;
-#endif
+ int sig;
{
- dump_db_flag = 1;
- SIG_RETURN;
+ dump_db_flag = 1;
}
static void dump_db()
{
- /* dump the in-core database to human-readable form on disk */
- FILE *fp;
- int oerrno = errno;
- int pid;
+ /* dump the in-core database to human-readable form on disk */
+ FILE *fp;
+ int oerrno = errno;
+ int pid;
+ char filename[128];
-#ifdef __SABER__
- pid = -1;
-#else
- if (fork_for_dump) {
- MONCONTROL (0);
- pid = fork ();
- MONCONTROL (1);
- }
- else
- pid = -1;
-#endif
- if (pid > 0)
- {
- dump_db_flag = 0;
- return;
- }
- if ((fp = fopen("/usr/tmp/zephyr.db", "w")) == (FILE *)0) {
- syslog(LOG_ERR, "can't open dump database");
- errno = oerrno;
- dump_db_flag = 0;
- return;
- }
- syslog(LOG_INFO, "dumping to disk");
- server_dump_servers(fp);
- uloc_dump_locs(fp);
- hostm_dump_hosts(fp);
- class_dump_subs(fp);
- syslog(LOG_INFO, "dump done");
- if (fclose(fp) == EOF) {
- syslog(LOG_ERR, "can't close dump db");
- }
- if (pid == 0)
- exit (0);
+ pid = (fork_for_dump) ? fork() : -1;
+ if (pid > 0) {
+ dump_db_flag = 0;
+ return;
+ }
+ sprintf(filename, "%szephyr.db", TEMP_DIRECTORY);
+ fp = fopen(filename, "w");
+ if (!fp) {
+ syslog(LOG_ERR, "can't open dump database");
errno = oerrno;
dump_db_flag = 0;
return;
+ }
+ syslog(LOG_INFO, "dumping to disk");
+ server_dump_servers(fp);
+ uloc_dump_locs(fp);
+ client_dump_clients(fp);
+ triplet_dump_subs(fp);
+ realm_dump_realms(fp);
+ syslog(LOG_INFO, "dump done");
+ if (fclose(fp) == EOF)
+ syslog(LOG_ERR, "can't close dump db");
+ if (pid == 0)
+ exit(0);
+ errno = oerrno;
+ dump_db_flag = 0;
}
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-reset(int sig)
-#else
+static RETSIGTYPE
reset(sig)
- int sig;
-#endif
+ int sig;
{
#if 1
- zdbug((LOG_DEBUG,"reset()"));
+ zdbug((LOG_DEBUG,"reset()"));
#endif
- doreset = 1;
- SIG_RETURN;
+ doreset = 1;
}
-#ifdef __GNUG__
-#define wait WaitStatus
-#endif
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-reap(int sig)
-#else
+static RETSIGTYPE
reap(sig)
- int sig;
-#endif
+ int sig;
{
int oerrno = errno;
-#ifdef POSIX
+#ifdef _POSIX_VERSION
int waitb;
while (waitpid(-1, &waitb, WNOHANG) == 0) ;
#else
@@ -719,40 +634,39 @@ reap(sig)
#endif
errno = oerrno;
- SIG_RETURN;
}
static void
do_reset()
{
- int oerrno = errno;
-#ifdef POSIX
- sigset_t mask, omask;
+ int oerrno = errno;
+#ifdef _POSIX_VERSION
+ sigset_t mask, omask;
#else
- int omask;
+ int omask;
#endif
#if 0
- zdbug((LOG_DEBUG,"do_reset()"));
+ zdbug((LOG_DEBUG,"do_reset()"));
#endif
-#ifdef POSIX
- sigemptyset(&mask);
- sigaddset(&mask, SIGHUP);
- sigprocmask(SIG_BLOCK, &mask, &omask);
+#ifdef _POSIX_VERSION
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGHUP);
+ sigprocmask(SIG_BLOCK, &mask, &omask);
#else
- omask = sigblock(sigmask(SIGHUP));
+ omask = sigblock(sigmask(SIGHUP));
#endif
- /* reset various things in the server's state */
- subscr_reset();
- server_reset();
- access_reinit();
- syslog (LOG_INFO, "restart completed");
- doreset = 0;
- errno = oerrno;
-#ifdef POSIX
- sigprocmask(SIG_SETMASK, &omask, (sigset_t *)0);
+ /* reset various things in the server's state */
+ subscr_reset();
+ server_reset();
+ access_reinit();
+ syslog(LOG_INFO, "restart completed");
+ doreset = 0;
+ errno = oerrno;
+#ifdef _POSIX_VERSION
+ sigprocmask(SIG_SETMASK, &omask, (sigset_t *)0);
#else
- sigsetmask(omask);
+ sigsetmask(omask);
#endif
}
@@ -764,40 +678,42 @@ do_reset()
static void
detach()
{
- /* detach from terminal and fork. */
- register int i;
- register long size;
+ /* detach from terminal and fork. */
+ int i;
+ long size;
-#ifdef POSIX
- size = sysconf(_SC_OPEN_MAX);
+#ifdef _POSIX_VERSION
+ size = sysconf(_SC_OPEN_MAX);
#else
- size = getdtablesize();
-#endif
- /* profiling seems to get confused by fork() */
- MONCONTROL (0);
- i = fork ();
- MONCONTROL (1);
- if (i) {
- if (i < 0)
- perror("fork");
- exit(0);
- }
+ size = getdtablesize();
+#endif
+ /* profiling seems to get confused by fork() */
+ i = fork ();
+ if (i) {
+ if (i < 0)
+ perror("fork");
+ exit(0);
+ }
- for (i = 0; i < size; i++) {
- (void) close(i);
- }
- i = open("/dev/tty", O_RDWR, 666);
- (void) ioctl(i, TIOCNOTTY, (caddr_t) 0);
- (void) close(i);
-#ifdef POSIX
- (void) setsid();
+ for (i = 0; i < size; i++)
+ close(i);
+
+ i = open("/dev/tty", O_RDWR, 666);
+#ifdef TIOCNOTTY /* Only necessary on old systems. */
+ ioctl(i, TIOCNOTTY, NULL);
#endif
-}
+ close(i);
+#ifdef _POSIX_VERSION
+ setsid();
#endif
+}
+#endif /* not DEBUG */
static void
read_from_dump(dumpfile)
- char *dumpfile;
+ char *dumpfile;
{
- return;
+ /* Not yet implemented. */
+ return;
}
+
diff --git a/server/main.c.auth b/server/main.c.auth
deleted file mode 100644
index c0ae1af..0000000
--- a/server/main.c.auth
+++ /dev/null
@@ -1,804 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains the main loop of the Zephyr server
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#ifndef lint
-#ifndef SABER
-static char rcsid_main_c[] =
- "$Id$";
-#endif
-#endif
-
-/*
- * Server loop for Zephyr.
- */
-
-/*
- The Zephyr server maintains several linked lists of information.
-
- There is an array of servers (otherservers) initialized and maintained
- by server_s.c.
-
- Each server descriptor contains a pointer to a linked list of hosts
- which are ``owned'' by that server. The first server is the ``limbo''
- server which owns any host which was formerly owned by a dead server.
-
- Each of these host list entries has an IP address and a pointer to a
- linked list of clients on that host.
-
- Each client has a sockaddr_in, a list of subscriptions, and possibly
- a session key.
-
- In addition, the class manager has copies of the pointers to the
- clients which are registered with a particular class, the
- not-yet-acknowledged list has copies of pointers to some clients,
- and the hostm manager may have copies of pointers to some clients
- (if the client has not acknowledged a packet after a given timeout).
-*/
-
-#include "zserver.h"
-/* which includes
- zephyr/zephyr.h
- <errno.h>
- <sys/types.h>
- <netinet/in.h>
- <sys/time.h>
- <stdio.h>
- <sys/file.h>
- <syslog.h>
- <strings.h>
- <signal.h>
- timer.h
- zsrv_err.h
- */
-
-#include <netdb.h>
-#include <sys/socket.h>
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#ifdef POSIX
-#include <termios.h>
-#endif
-
-#ifdef POSIX
-#define SIGNAL_RETURN_TYPE void
-#define SIG_RETURN return
-#else
-#define SIGNAL_RETURN_TYPE int
-#define SIG_RETURN return(0)
-#endif
-
-#if !defined(__SABER__) && (defined (vax) || defined (ibm032))
-#define MONCONTROL moncontrol
-#else
-#define MONCONTROL (void)
-#endif
-
-#define EVER (;;) /* don't stop looping */
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static int do_net_setup P((void)), initialize P((void));
-static void usage P((void)), do_reset P((void));
-static SIGNAL_RETURN_TYPE bye P((int)),
- dbug_on P((int)), dbug_off P((int)),
- sig_dump_db P((int)), sig_dump_strings P((int)),
- reset P((int)), reap P((int));
-static void read_from_dump P((char *dumpfile));
-static void dump_db P((void)), dump_strings P((void));
-
-#ifndef DEBUG
-static void detach P((void));
-#endif
-
-extern void perror P((Zconst char *));
-
-#undef P
-
-static short doreset = 0; /* if it becomes 1, perform
- reset functions */
-
-int srv_socket; /* dgram socket for clients
- and other servers */
-int bdump_socket = -1; /* brain dump socket fd
- (closed most of the time) */
-fd_set interesting; /* the file descrips we are listening
- to right now */
-int nfildes; /* number to look at in select() */
-struct sockaddr_in sock_sin; /* address of the socket */
-struct timeval nexthost_tv; /* time till next timeout for select */
-
-ZNotAcked_t *nacklist; /* list of packets waiting for ack's */
-
-u_short hm_port; /* the port # of the host manager */
-
-char *programname; /* set to the basename of argv[0] */
-char myname[MAXHOSTNAMELEN]; /* my host name */
-
-int zdebug;
-#ifdef DEBUG_MALLOC
-int dump_malloc_stats = 0;
-unsigned long m_size;
-#endif
-#ifdef DEBUG
-int zalone;
-#endif
-
-struct timeval t_local; /* store current time for other uses */
-
-static int dump_db_flag = 0;
-static int dump_strings_flag = 0;
-
-u_long npackets; /* number of packets processed */
-long uptime; /* when we started operations */
-static int nofork;
-struct in_addr my_addr;
-char *bdump_version = "1.1";
-
-int
-main(argc, argv)
- int argc;
- char **argv;
-{
- int nfound; /* #fildes ready on select */
- fd_set readable;
- struct timeval *tvp;
- int init_from_dump = 0;
- char *dumpfile;
-#ifdef POSIX
- struct sigaction action;
-#endif
-
-
- int optchar; /* option processing */
- extern char *optarg;
- extern int optind;
-
- /* set name */
- if (programname = strrchr(argv[0],'/'))
- programname++;
- else programname = argv[0];
-
- /* process arguments */
-
- while ((optchar = getopt(argc, argv, "dsnv:f:")) != EOF) {
- switch(optchar) {
- case 'd':
- zdebug = 1;
- break;
-#ifdef DEBUG
- case 's':
- zalone = 1;
- break;
-#endif
- case 'n':
- nofork = 1;
- break;
- case 'v':
- bdump_version = optarg;
- break;
- case 'f':
- init_from_dump = 0;
- dumpfile = optarg;
- break;
- case '?':
- default:
- usage();
- /*NOTREACHED*/
- }
- }
-
-#ifdef KERBEROS
- /* if there is no readable srvtab and we are not standalone, there
- is no possible way we can succeed, so we exit */
-
- if (access(ZEPHYR_SRVTAB, R_OK)
-#ifdef DEBUG
- && !zalone
-#endif /* DEBUG */
- ) {
- fprintf(stderr, "NO ZEPHYR SRVTAB (%s) available; exiting\n",
- ZEPHYR_SRVTAB);
- exit(1);
- }
-#endif /* KERBEROS */
-
-#ifndef DEBUG
- if (!nofork)
- detach();
-#endif /* DEBUG */
-
- /* open log */
- OPENLOG(programname, LOG_PID, LOG_LOCAL6);
-
-#if defined (DEBUG) && 0
- if (zalone)
- syslog(LOG_DEBUG, "standalone operation");
-#endif
-#if 0
- if (zdebug)
- syslog(LOG_DEBUG, "debugging on");
-#endif
-
- /* set up sockets & my_addr and myname,
- find other servers and set up server table, initialize queues
- for retransmits, initialize error tables,
- set up restricted classes */
-
- /* Initialize t_local for other uses */
- (void) gettimeofday(&t_local, (struct timezone *)0);
-
- if (initialize())
- exit(1);
-
- if (init_from_dump)
- read_from_dump(dumpfile);
-
- /* Seed random number set. */
- srandom (getpid () ^ time (0));
-
-#ifndef __SABER__
- /* chdir to somewhere where a core dump will survive */
- if (chdir("/usr/tmp") != 0)
- syslog(LOG_ERR,"chdir failed (%m) (execution continuing)");
-
-#if 0
- /*
- * Many systems don't implement setpriority() as is done under BSD,
- * and the kernel scheduler will appropriately swap in the processes
- * that are needed.
- */
- if (setpriority(PRIO_PROCESS, getpid(), -10))
- syslog(LOG_ERR,"setpriority failed (%m)");
-#endif
-#endif
-
- FD_ZERO(&interesting);
- FD_SET(srv_socket, &interesting);
-
- nfildes = srv_socket + 1;
-
-
-#ifdef POSIX
- action.sa_flags = 0;
- sigemptyset(&action.sa_mask);
-
- action.sa_handler = bye;
- sigaction(SIGINT, &action, NULL);
- sigaction(SIGTERM, &action, NULL);
-
- action.sa_handler = dbug_on;
- sigaction(SIGUSR1, &action, NULL);
-
- action.sa_handler = dbug_off;
- sigaction(SIGUSR2, &action, NULL);
-
- action.sa_handler = reap;
- sigaction(SIGCHLD, &action, NULL);
-
- action.sa_handler = sig_dump_db;
- sigaction(SIGFPE, &action, NULL);
- sigaction(SIGXCPU, &action, NULL);
-
-#ifdef SIGEMT
- action.sa_handler = sig_dump_strings;
- sigaction(SIGEMT, &action, NULL);
-#endif
-
- action.sa_handler = reset;
- sigaction(SIGHUP, &action, NULL);
-#else /* !posix */
- (void) signal(SIGINT, bye);
- (void) signal(SIGTERM, bye);
- (void) signal(SIGUSR1, dbug_on);
- (void) signal(SIGUSR2, dbug_off);
- (void) signal(SIGCHLD, reap);
- (void) signal(SIGFPE, sig_dump_db);
- (void) signal(SIGXCPU, sig_dump_db);
-#ifdef SIGEMT
- (void) signal(SIGEMT, sig_dump_strings);
-#endif
- (void) signal(SIGHUP, reset);
-#endif /* POSIX */
-
- syslog(LOG_NOTICE, "Ready for action");
-
- /* Reinitialize t_local now that initialization is done. */
- (void) gettimeofday(&t_local, (struct timezone *)0);
- timer_set_rel(SWEEP_INTERVAL, sweep_ticket_hash_table, NULL);
- /* GO! */
- uptime = NOW;
-
-#ifdef DEBUG_MALLOC
- malloc_inuse(&m_size);
-#endif
- for EVER {
- if (doreset)
- do_reset();
-
- if (dump_db_flag)
- dump_db();
- if (dump_strings_flag)
- dump_strings();
-
- nexthost_tv.tv_usec = 0;
- tvp = &nexthost_tv;
-
- if (nexttimo != 0L) {
- nexthost_tv.tv_sec = nexttimo - NOW;
- if (nexthost_tv.tv_sec <= 0) {
- /* timeout has passed! */
- /* so we process one timeout, then pop to
- select, polling for input. This way we get
- work done even if swamped with many
- timeouts */
- /* this will reset nexttimo */
- (void) timer_process();
- nexthost_tv.tv_sec = 0;
- }
- } else { /* no timeouts to process */
- nexthost_tv.tv_sec = 15;
- }
- readable = interesting;
- if (msgs_queued()) {
- /* when there is input in the queue, we
- artificially set up to pick up the input */
- nfound = 1;
- FD_ZERO(&readable);
- } else
- nfound = select(nfildes, &readable, (fd_set *) 0,
- (fd_set *) 0, tvp);
-
- /* Initialize t_local for other uses */
- (void) gettimeofday(&t_local, (struct timezone *)0);
-
- /* don't flame about EINTR, since a SIGUSR1 or SIGUSR2
- can generate it by interrupting the select */
- if (nfound < 0) {
- if (errno != EINTR)
- syslog(LOG_WARNING, "select error: %m");
-#ifdef DEBUG_MALLOC
- if (dump_malloc_stats) {
- unsigned long foo,histid2;
- dump_malloc_stats = 0;
- foo = malloc_inuse(&histid2);
- printf("Total inuse: %d\n",foo);
- malloc_list(2,m_size,histid2);
- }
-#endif
- continue;
- }
- if (nfound == 0)
- /* either we timed out or we were just
- polling for input. Either way we want to continue
- the loop, and process the next timeout */
- continue;
- else {
- if ((bdump_socket >= 0) &&
- FD_ISSET(bdump_socket,&readable))
- bdump_send();
- else if (msgs_queued() ||
- FD_ISSET(srv_socket, &readable)) {
- handle_packet();
- } else
- syslog(LOG_ERR, "select weird?!?!");
- }
- }
-}
-
-/* Initialize net stuff.
- Set up the server array.
- Initialize the packet ack queues to be empty.
- Initialize the error tables.
- Restrict certain classes.
- */
-
-static int
-initialize()
-{
- if (do_net_setup())
- return(1);
-
- server_init();
-
-#if 0
- if (!(nacklist = (ZNotAcked_t *) xmalloc(sizeof(ZNotAcked_t)))) {
- /* unrecoverable */
- syslog(LOG_CRIT, "nacklist malloc");
- abort();
- }
-#else
- {
- static ZNotAcked_t not_acked_head;
- nacklist = &not_acked_head;
- }
-#endif
- (void) memset((caddr_t) nacklist, 0, sizeof(ZNotAcked_t));
- nacklist->q_forw = nacklist->q_back = nacklist;
-
- nexttimo = 1L; /* trigger the timers when we hit
- the FOR loop */
-
- (void) ZInitialize(); /* set up the library */
- (void) init_zsrv_err_tbl(); /* set up err table */
-
- (void) ZSetServerState(1);
- (void) ZSetFD(srv_socket); /* set up the socket as the
- input fildes */
-
- /* set up default strings */
-
- class_control = make_zstring(ZEPHYR_CTL_CLASS, 1);
- class_admin = make_zstring(ZEPHYR_ADMIN_CLASS, 1);
- class_hm = make_zstring(HM_CTL_CLASS, 1);
- class_ulogin = make_zstring(LOGIN_CLASS, 1);
- class_ulocate = make_zstring(LOCATE_CLASS, 1);
- wildcard_instance = make_zstring(WILDCARD_INSTANCE, 1);
- empty = make_zstring("", 0);
-
- /* restrict certain classes */
- access_init();
- return(0);
-}
-
-/*
- * Set up the server and client sockets, and initialize my_addr and myname
- */
-
-static int
-do_net_setup()
-{
- struct servent *sp;
- struct hostent *hp;
- char hostname[MAXHOSTNAMELEN+1];
- int flags;
-
- if (gethostname(hostname, MAXHOSTNAMELEN+1)) {
- syslog(LOG_ERR, "no hostname: %m");
- return(1);
- }
- if (!(hp = gethostbyname(hostname))) {
- syslog(LOG_ERR, "no gethostbyname repsonse");
- (void) strncpy(myname, hostname, MAXHOSTNAMELEN);
- return(1);
- }
- (void) strncpy(myname, hp->h_name, MAXHOSTNAMELEN);
- (void) memcpy((caddr_t) &my_addr, (caddr_t) hp->h_addr,
- sizeof(hp->h_addr));
-
- (void) setservent(1); /* keep file/connection open */
-
- if (!(sp = getservbyname(SERVER_SVCNAME, "udp"))) {
- syslog(LOG_ERR, "%s/udp unknown",SERVER_SVCNAME);
- return(1);
- }
- (void) memset((caddr_t) &sock_sin, 0, sizeof(sock_sin));
- sock_sin.sin_port = sp->s_port;
-
- if (!(sp = getservbyname(HM_SVCNAME, "udp"))) {
- syslog(LOG_ERR, "%s/udp unknown", HM_SVCNAME);
- return(1);
- }
- hm_port = sp->s_port;
-
- (void) endservent();
-
- if ((srv_socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- syslog(LOG_ERR, "client_sock failed: %m");
- return(1);
- }
- if (bind(srv_socket, (struct sockaddr *) &sock_sin,
- sizeof(sock_sin)) < 0) {
- syslog(LOG_ERR, "client bind failed: %m");
- return(1);
- }
-
- /* set not-blocking */
-#ifdef POSIX
- flags = fcntl(srv_socket, F_GETFL);
- flags |= O_NONBLOCK;
- (void) fcntl(srv_socket, F_SETFL, flags);
-#else
- flags = 1;
- (void) ioctl(srv_socket, FIONBIO, (caddr_t) &flags);
-#endif
-
- return(0);
-}
-
-
-/*
- * print out a usage message.
- */
-
-static void
-usage()
-{
-#ifdef DEBUG
- fprintf(stderr,"Usage: %s [-d] [-s] [-n] [-f dumpfile]\n",programname);
-#else
- fprintf(stderr,"Usage: %s [-d] [-n] [-f dumpfile]\n",programname);
-#endif /* DEBUG */
- exit(2);
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-bye(int sig)
-#else
-bye(sig)
- int sig;
-#endif
-{
- server_shutdown(); /* tell other servers */
- hostm_shutdown(); /* tell our hosts */
-#ifdef KERBEROS
- (void) dest_tkt();
-#endif
- syslog(LOG_NOTICE, "goodbye (sig %d)",sig);
- exit(0);
- /*NOTREACHED*/
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-dbug_on(int sig)
-#else
-dbug_on(sig)
- int sig;
-#endif
-{
- syslog(LOG_DEBUG, "debugging turned on");
-#ifdef DEBUG_MALLOC
- dump_malloc_stats = 1;
-#endif
- zdebug = 1;
- SIG_RETURN;
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-dbug_off(int sig)
-#else
-dbug_off(sig)
- int sig;
-#endif
-{
- syslog(LOG_DEBUG, "debugging turned off");
-#ifdef DEBUG_MALLOC
- malloc_inuse(&m_size);
-#endif
- zdebug = 0;
- SIG_RETURN;
-}
-
-int fork_for_dump = 0;
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-sig_dump_strings (int sig)
-#else
-sig_dump_strings(sig)
- int sig;
-#endif
-{
- dump_strings_flag = 1;
- SIG_RETURN;
-}
-
-static void dump_strings()
-{
- FILE *fp;
- int oerrno = errno;
- fp = fopen ("/usr/tmp/zephyr.strings", "w");
- if (!fp) {
- syslog (LOG_ERR, "can't open strings dump file: %m");
- errno = oerrno;
- dump_strings_flag = 0;
- return;
- }
- syslog (LOG_INFO, "dumping strings to disk");
- print_zstring_table(fp);
- if (fclose (fp) == EOF)
- syslog (LOG_ERR, "error writing strings dump file");
- else
- syslog (LOG_INFO, "dump done");
- oerrno = errno;
- dump_strings_flag = 0;
- return;
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-sig_dump_db(int sig)
-#else
-sig_dump_db(sig)
- int sig;
-#endif
-{
- dump_db_flag = 1;
- SIG_RETURN;
-}
-
-static void dump_db()
-{
- /* dump the in-core database to human-readable form on disk */
- FILE *fp;
- int oerrno = errno;
- int pid;
-
-#ifdef __SABER__
- pid = -1;
-#else
- if (fork_for_dump) {
- MONCONTROL (0);
- pid = fork ();
- MONCONTROL (1);
- }
- else
- pid = -1;
-#endif
- if (pid > 0)
- {
- dump_db_flag = 0;
- return;
- }
- if ((fp = fopen("/usr/tmp/zephyr.db", "w")) == (FILE *)0) {
- syslog(LOG_ERR, "can't open dump database");
- errno = oerrno;
- dump_db_flag = 0;
- return;
- }
- syslog(LOG_INFO, "dumping to disk");
- server_dump_servers(fp);
- uloc_dump_locs(fp);
- hostm_dump_hosts(fp);
- class_dump_subs(fp);
- syslog(LOG_INFO, "dump done");
- if (fclose(fp) == EOF) {
- syslog(LOG_ERR, "can't close dump db");
- }
- if (pid == 0)
- exit (0);
- errno = oerrno;
- dump_db_flag = 0;
- return;
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-reset(int sig)
-#else
-reset(sig)
- int sig;
-#endif
-{
-#if 1
- zdbug((LOG_DEBUG,"reset()"));
-#endif
- doreset = 1;
- SIG_RETURN;
-}
-
-#ifdef __GNUG__
-#define wait WaitStatus
-#endif
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-reap(int sig)
-#else
-reap(sig)
- int sig;
-#endif
-{
- int oerrno = errno;
-
-#ifdef POSIX
- int waitb;
- while (waitpid(-1, &waitb, WNOHANG) == 0) ;
-#else
- union wait waitb;
- while (wait3 (&waitb, WNOHANG, (struct rusage*) 0) == 0) ;
-#endif
-
- errno = oerrno;
- SIG_RETURN;
-}
-
-static void
-do_reset()
-{
- int oerrno = errno;
-#ifdef POSIX
- sigset_t mask, omask;
-#else
- int omask;
-#endif
-#if 0
- zdbug((LOG_DEBUG,"do_reset()"));
-#endif
-#ifdef POSIX
- sigemptyset(&mask);
- sigaddset(&mask, SIGHUP);
- sigprocmask(SIG_BLOCK, &mask, &omask);
-#else
- omask = sigblock(sigmask(SIGHUP));
-#endif
-
- /* reset various things in the server's state */
- subscr_reset();
- server_reset();
- access_reinit();
- syslog (LOG_INFO, "restart completed");
- doreset = 0;
- errno = oerrno;
-#ifdef POSIX
- sigprocmask(SIG_SETMASK, &omask, (sigset_t *)0);
-#else
- sigsetmask(omask);
-#endif
-}
-
-#ifndef DEBUG
-/*
- * detach from the terminal
- */
-
-static void
-detach()
-{
- /* detach from terminal and fork. */
- register int i;
- register long size;
-
-#ifdef POSIX
- size = sysconf(_SC_OPEN_MAX);
-#else
- size = getdtablesize();
-#endif
- /* profiling seems to get confused by fork() */
- MONCONTROL (0);
- i = fork ();
- MONCONTROL (1);
- if (i) {
- if (i < 0)
- perror("fork");
- exit(0);
- }
-
- for (i = 0; i < size; i++) {
- (void) close(i);
- }
- i = open("/dev/tty", O_RDWR, 666);
- (void) ioctl(i, TIOCNOTTY, (caddr_t) 0);
- (void) close(i);
-#ifdef POSIX
- (void) setsid();
-#endif
-}
-#endif
-
-static void
-read_from_dump(dumpfile)
- char *dumpfile;
-{
- return;
-}
diff --git a/server/main.c.old b/server/main.c.old
deleted file mode 100644
index b3ec4e4..0000000
--- a/server/main.c.old
+++ /dev/null
@@ -1,803 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains the main loop of the Zephyr server
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#ifndef lint
-#ifndef SABER
-static char rcsid_main_c[] =
- "$Id$";
-#endif
-#endif
-
-/*
- * Server loop for Zephyr.
- */
-
-/*
- The Zephyr server maintains several linked lists of information.
-
- There is an array of servers (otherservers) initialized and maintained
- by server_s.c.
-
- Each server descriptor contains a pointer to a linked list of hosts
- which are ``owned'' by that server. The first server is the ``limbo''
- server which owns any host which was formerly owned by a dead server.
-
- Each of these host list entries has an IP address and a pointer to a
- linked list of clients on that host.
-
- Each client has a sockaddr_in, a list of subscriptions, and possibly
- a session key.
-
- In addition, the class manager has copies of the pointers to the
- clients which are registered with a particular class, the
- not-yet-acknowledged list has copies of pointers to some clients,
- and the hostm manager may have copies of pointers to some clients
- (if the client has not acknowledged a packet after a given timeout).
-*/
-
-#include "zserver.h"
-/* which includes
- zephyr/zephyr.h
- <errno.h>
- <sys/types.h>
- <netinet/in.h>
- <sys/time.h>
- <stdio.h>
- <sys/file.h>
- <syslog.h>
- <strings.h>
- <signal.h>
- timer.h
- zsrv_err.h
- */
-
-#include <netdb.h>
-#include <sys/socket.h>
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#ifdef POSIX
-#include <termios.h>
-#endif
-
-#ifdef POSIX
-#define SIGNAL_RETURN_TYPE void
-#define SIG_RETURN return
-#else
-#define SIGNAL_RETURN_TYPE int
-#define SIG_RETURN return(0)
-#endif
-
-#if !defined(__SABER__) && (defined (vax) || defined (ibm032))
-#define MONCONTROL moncontrol
-#else
-#define MONCONTROL (void)
-#endif
-
-#define EVER (;;) /* don't stop looping */
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static int do_net_setup P((void)), initialize P((void));
-static void usage P((void)), do_reset P((void));
-static SIGNAL_RETURN_TYPE bye P((int)),
- dbug_on P((int)), dbug_off P((int)),
- sig_dump_db P((int)), sig_dump_strings P((int)),
- reset P((int)), reap P((int));
-static void read_from_dump P((char *dumpfile));
-static void dump_db P((void)), dump_strings P((void));
-
-#ifndef DEBUG
-static void detach P((void));
-#endif
-
-extern void perror P((Zconst char *));
-
-#undef P
-
-static short doreset = 0; /* if it becomes 1, perform
- reset functions */
-
-int srv_socket; /* dgram socket for clients
- and other servers */
-int bdump_socket = -1; /* brain dump socket fd
- (closed most of the time) */
-fd_set interesting; /* the file descrips we are listening
- to right now */
-int nfildes; /* number to look at in select() */
-struct sockaddr_in sock_sin; /* address of the socket */
-struct timeval nexthost_tv; /* time till next timeout for select */
-
-ZNotAcked_t *nacklist; /* list of packets waiting for ack's */
-
-u_short hm_port; /* the port # of the host manager */
-
-char *programname; /* set to the basename of argv[0] */
-char myname[MAXHOSTNAMELEN]; /* my host name */
-
-int zdebug;
-#ifdef DEBUG_MALLOC
-int dump_malloc_stats = 0;
-unsigned long m_size;
-#endif
-#ifdef DEBUG
-int zalone;
-#endif
-
-struct timeval t_local; /* store current time for other uses */
-
-static int dump_db_flag = 0;
-static int dump_strings_flag = 0;
-
-u_long npackets; /* number of packets processed */
-long uptime; /* when we started operations */
-static int nofork;
-struct in_addr my_addr;
-char *bdump_version = "1.1";
-
-int
-main(argc, argv)
- int argc;
- char **argv;
-{
- int nfound; /* #fildes ready on select */
- fd_set readable;
- struct timeval *tvp;
- int init_from_dump = 0;
- char *dumpfile;
-#ifdef POSIX
- struct sigaction action;
-#endif
-
-
- int optchar; /* option processing */
- extern char *optarg;
- extern int optind;
-
- /* set name */
- if (programname = strrchr(argv[0],'/'))
- programname++;
- else programname = argv[0];
-
- /* process arguments */
-
- while ((optchar = getopt(argc, argv, "dsnv:f:")) != EOF) {
- switch(optchar) {
- case 'd':
- zdebug = 1;
- break;
-#ifdef DEBUG
- case 's':
- zalone = 1;
- break;
-#endif
- case 'n':
- nofork = 1;
- break;
- case 'v':
- bdump_version = optarg;
- break;
- case 'f':
- init_from_dump = 0;
- dumpfile = optarg;
- break;
- case '?':
- default:
- usage();
- /*NOTREACHED*/
- }
- }
-
-#ifdef KERBEROS
- /* if there is no readable srvtab and we are not standalone, there
- is no possible way we can succeed, so we exit */
-
- if (access(ZEPHYR_SRVTAB, R_OK)
-#ifdef DEBUG
- && !zalone
-#endif /* DEBUG */
- ) {
- fprintf(stderr, "NO ZEPHYR SRVTAB (%s) available; exiting\n",
- ZEPHYR_SRVTAB);
- exit(1);
- }
-#endif /* KERBEROS */
-
-#ifndef DEBUG
- if (!nofork)
- detach();
-#endif /* DEBUG */
-
- /* open log */
- OPENLOG(programname, LOG_PID, LOG_LOCAL6);
-
-#if defined (DEBUG) && 0
- if (zalone)
- syslog(LOG_DEBUG, "standalone operation");
-#endif
-#if 0
- if (zdebug)
- syslog(LOG_DEBUG, "debugging on");
-#endif
-
- /* set up sockets & my_addr and myname,
- find other servers and set up server table, initialize queues
- for retransmits, initialize error tables,
- set up restricted classes */
-
- if (initialize())
- exit(1);
-
- if (init_from_dump)
- read_from_dump(dumpfile);
-
- /* Seed random number set. */
- srandom (getpid () ^ time (0));
-
-#ifndef __SABER__
- /* chdir to somewhere where a core dump will survive */
- if (chdir("/usr/tmp") != 0)
- syslog(LOG_ERR,"chdir failed (%m) (execution continuing)");
-
-#if 0
- /*
- * Many systems don't implement setpriority() as is done under BSD,
- * and the kernel scheduler will appropriately swap in the processes
- * that are needed.
- */
- if (setpriority(PRIO_PROCESS, getpid(), -10))
- syslog(LOG_ERR,"setpriority failed (%m)");
-#endif
-#endif
-
- FD_ZERO(&interesting);
- FD_SET(srv_socket, &interesting);
-
- nfildes = srv_socket + 1;
-
-
-#ifdef POSIX
- action.sa_flags = 0;
- sigemptyset(&action.sa_mask);
-
- action.sa_handler = bye;
- sigaction(SIGINT, &action, NULL);
- sigaction(SIGTERM, &action, NULL);
-
- action.sa_handler = dbug_on;
- sigaction(SIGUSR1, &action, NULL);
-
- action.sa_handler = dbug_off;
- sigaction(SIGUSR2, &action, NULL);
-
- action.sa_handler = reap;
- sigaction(SIGCHLD, &action, NULL);
-
- action.sa_handler = sig_dump_db;
- sigaction(SIGFPE, &action, NULL);
- sigaction(SIGXCPU, &action, NULL);
-
- action.sa_handler = sig_dump_strings;
- sigaction(SIGEMT, &action, NULL);
-
- action.sa_handler = reset;
- sigaction(SIGHUP, &action, NULL);
-#else /* !posix */
- (void) signal(SIGINT, bye);
- (void) signal(SIGTERM, bye);
- (void) signal(SIGUSR1, dbug_on);
- (void) signal(SIGUSR2, dbug_off);
- (void) signal(SIGCHLD, reap);
- (void) signal(SIGFPE, sig_dump_db);
- (void) signal(SIGXCPU, sig_dump_db);
- (void) signal(SIGEMT, sig_dump_strings);
- (void) signal(SIGHUP, reset);
-#endif /* POSIX */
-
- syslog(LOG_NOTICE, "Ready for action");
-
- /* Initialize t_local for other uses */
- (void) gettimeofday(&t_local, (struct timezone *)0);
- /* GO! */
- uptime = NOW;
-
-#ifdef DEBUG_MALLOC
- malloc_inuse(&m_size);
-#endif
- for EVER {
- if (doreset)
- do_reset();
-
- if (dump_db_flag)
- dump_db();
- if (dump_strings_flag)
- dump_strings();
-
- nexthost_tv.tv_usec = 0;
- tvp = &nexthost_tv;
-
- if (nexttimo != 0L) {
- nexthost_tv.tv_sec = nexttimo - NOW;
- if (nexthost_tv.tv_sec <= 0) {
- /* timeout has passed! */
- /* so we process one timeout, then pop to
- select, polling for input. This way we get
- work done even if swamped with many
- timeouts */
- /* this will reset nexttimo */
- (void) timer_process();
- nexthost_tv.tv_sec = 0;
- }
- } else { /* no timeouts to process */
- nexthost_tv.tv_sec = 15;
- }
- readable = interesting;
- if (msgs_queued()) {
- /* when there is input in the queue, we
- artificially set up to pick up the input */
- nfound = 1;
- FD_ZERO(&readable);
- } else
- nfound = select(nfildes, &readable, (fd_set *) 0,
- (fd_set *) 0, tvp);
-
- /* Initialize t_local for other uses */
- (void) gettimeofday(&t_local, (struct timezone *)0);
-
- /* don't flame about EINTR, since a SIGUSR1 or SIGUSR2
- can generate it by interrupting the select */
- if (nfound < 0) {
- if (errno != EINTR)
- syslog(LOG_WARNING, "select error: %m");
-#ifdef DEBUG_MALLOC
- if (dump_malloc_stats) {
- unsigned long foo,histid2;
- dump_malloc_stats = 0;
- foo = malloc_inuse(&histid2);
- printf("Total inuse: %d\n",foo);
- malloc_list(2,m_size,histid2);
- }
-#endif
- continue;
- }
- if (nfound == 0)
- /* either we timed out or we were just
- polling for input. Either way we want to continue
- the loop, and process the next timeout */
- continue;
- else {
- if ((bdump_socket >= 0) &&
- FD_ISSET(bdump_socket,&readable))
- bdump_send();
- else if (msgs_queued() ||
- FD_ISSET(srv_socket, &readable)) {
- handle_packet();
- } else
- syslog(LOG_ERR, "select weird?!?!");
- }
- }
-}
-
-/* Initialize net stuff.
- Set up the server array.
- Initialize the packet ack queues to be empty.
- Initialize the error tables.
- Restrict certain classes.
- */
-
-static int
-initialize()
-{
- if (do_net_setup())
- return(1);
-
- server_init();
-
-#if 0
- if (!(nacklist = (ZNotAcked_t *) xmalloc(sizeof(ZNotAcked_t)))) {
- /* unrecoverable */
- syslog(LOG_CRIT, "nacklist malloc");
- abort();
- }
-#else
- {
- static ZNotAcked_t not_acked_head;
- nacklist = &not_acked_head;
- }
-#endif
- (void) memset((caddr_t) nacklist, 0, sizeof(ZNotAcked_t));
- nacklist->q_forw = nacklist->q_back = nacklist;
-
- nexttimo = 1L; /* trigger the timers when we hit
- the FOR loop */
-
- (void) ZInitialize(); /* set up the library */
- (void) init_zsrv_err_tbl(); /* set up err table */
-
- (void) ZSetServerState(1);
- (void) ZSetFD(srv_socket); /* set up the socket as the
- input fildes */
-
- /* set up default strings */
-
- class_control = make_zstring(ZEPHYR_CTL_CLASS, 1);
- class_admin = make_zstring(ZEPHYR_ADMIN_CLASS, 1);
- class_hm = make_zstring(HM_CTL_CLASS, 1);
- class_ulogin = make_zstring(LOGIN_CLASS, 1);
- class_ulocate = make_zstring(LOCATE_CLASS, 1);
- wildcard_class = make_zstring(MATCHALL_CLASS, 1);
- wildcard_instance = make_zstring(WILDCARD_INSTANCE, 1);
- empty = make_zstring("", 0);
-
- matchall_sub.q_forw = &matchall_sub;
- matchall_sub.q_back = &matchall_sub;
- matchall_sub.zst_dest.classname = wildcard_class;
- matchall_sub.zst_dest.inst = dup_zstring(empty);
- matchall_sub.zst_dest.recip = dup_zstring(empty);
-
- set_ZDestination_hash(&matchall_sub.zst_dest);
- /* restrict certain classes */
- access_init();
- return(0);
-}
-
-/*
- * Set up the server and client sockets, and initialize my_addr and myname
- */
-
-static int
-do_net_setup()
-{
- struct servent *sp;
- struct hostent *hp;
- char hostname[MAXHOSTNAMELEN+1];
- int flags;
-
- if (gethostname(hostname, MAXHOSTNAMELEN+1)) {
- syslog(LOG_ERR, "no hostname: %m");
- return(1);
- }
- if (!(hp = gethostbyname(hostname))) {
- syslog(LOG_ERR, "no gethostbyname repsonse");
- (void) strncpy(myname, hostname, MAXHOSTNAMELEN);
- return(1);
- }
- (void) strncpy(myname, hp->h_name, MAXHOSTNAMELEN);
- (void) memcpy((caddr_t) &my_addr, (caddr_t) hp->h_addr,
- sizeof(hp->h_addr));
-
- (void) setservent(1); /* keep file/connection open */
-
- if (!(sp = getservbyname(SERVER_SVCNAME, "udp"))) {
- syslog(LOG_ERR, "%s/udp unknown",SERVER_SVCNAME);
- return(1);
- }
- (void) memset((caddr_t) &sock_sin, 0, sizeof(sock_sin));
- sock_sin.sin_port = sp->s_port;
-
- if (!(sp = getservbyname(HM_SVCNAME, "udp"))) {
- syslog(LOG_ERR, "%s/udp unknown", HM_SVCNAME);
- return(1);
- }
- hm_port = sp->s_port;
-
- (void) endservent();
-
- if ((srv_socket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
- syslog(LOG_ERR, "client_sock failed: %m");
- return(1);
- }
- if (bind(srv_socket, (struct sockaddr *) &sock_sin,
- sizeof(sock_sin)) < 0) {
- syslog(LOG_ERR, "client bind failed: %m");
- return(1);
- }
-
- /* set not-blocking */
-#ifdef POSIX
- flags = fcntl(srv_socket, F_GETFL);
- flags |= O_NONBLOCK;
- (void) fcntl(srv_socket, F_SETFL, flags);
-#else
- flags = 1;
- (void) ioctl(srv_socket, FIONBIO, (caddr_t) &flags);
-#endif
-
- return(0);
-}
-
-
-/*
- * print out a usage message.
- */
-
-static void
-usage()
-{
-#ifdef DEBUG
- fprintf(stderr,"Usage: %s [-d] [-s] [-n] [-f dumpfile]\n",programname);
-#else
- fprintf(stderr,"Usage: %s [-d] [-n] [-f dumpfile]\n",programname);
-#endif /* DEBUG */
- exit(2);
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-bye(int sig)
-#else
-bye(sig)
- int sig;
-#endif
-{
- server_shutdown(); /* tell other servers */
- hostm_shutdown(); /* tell our hosts */
-#ifdef KERBEROS
- (void) dest_tkt();
-#endif
- syslog(LOG_NOTICE, "goodbye (sig %d)",sig);
- exit(0);
- /*NOTREACHED*/
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-dbug_on(int sig)
-#else
-dbug_on(sig)
- int sig;
-#endif
-{
- syslog(LOG_DEBUG, "debugging turned on");
-#ifdef DEBUG_MALLOC
- dump_malloc_stats = 1;
-#endif
- zdebug = 1;
- SIG_RETURN;
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-dbug_off(int sig)
-#else
-dbug_off(sig)
- int sig;
-#endif
-{
- syslog(LOG_DEBUG, "debugging turned off");
-#ifdef DEBUG_MALLOC
- malloc_inuse(&m_size);
-#endif
- zdebug = 0;
- SIG_RETURN;
-}
-
-int fork_for_dump = 0;
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-sig_dump_strings (int sig)
-#else
-sig_dump_strings(sig)
- int sig;
-#endif
-{
- dump_strings_flag = 1;
- SIG_RETURN;
-}
-
-static void dump_strings()
-{
- FILE *fp;
- int oerrno = errno;
- fp = fopen ("/usr/tmp/zephyr.strings", "w");
- if (!fp) {
- syslog (LOG_ERR, "can't open strings dump file: %m");
- errno = oerrno;
- dump_strings_flag = 0;
- return;
- }
- syslog (LOG_INFO, "dumping strings to disk");
- print_zstring_table(fp);
- if (fclose (fp) == EOF)
- syslog (LOG_ERR, "error writing strings dump file");
- else
- syslog (LOG_INFO, "dump done");
- oerrno = errno;
- dump_strings_flag = 0;
- return;
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-sig_dump_db(int sig)
-#else
-sig_dump_db(sig)
- int sig;
-#endif
-{
- dump_db_flag = 1;
- SIG_RETURN;
-}
-
-static void dump_db()
-{
- /* dump the in-core database to human-readable form on disk */
- FILE *fp;
- int oerrno = errno;
- int pid;
-
-#ifdef __SABER__
- pid = -1;
-#else
- if (fork_for_dump) {
- MONCONTROL (0);
- pid = fork ();
- MONCONTROL (1);
- }
- else
- pid = -1;
-#endif
- if (pid > 0)
- {
- dump_db_flag = 0;
- return;
- }
- if ((fp = fopen("/usr/tmp/zephyr.db", "w")) == (FILE *)0) {
- syslog(LOG_ERR, "can't open dump database");
- errno = oerrno;
- dump_db_flag = 0;
- return;
- }
- syslog(LOG_INFO, "dumping to disk");
- server_dump_servers(fp);
- uloc_dump_locs(fp);
- hostm_dump_hosts(fp);
- syslog(LOG_INFO, "dump done");
- if (fclose(fp) == EOF) {
- syslog(LOG_ERR, "can't close dump db");
- }
- if (pid == 0)
- exit (0);
- errno = oerrno;
- dump_db_flag = 0;
- return;
-}
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-reset(int sig)
-#else
-reset(sig)
- int sig;
-#endif
-{
-#if 1
- zdbug((LOG_DEBUG,"reset()"));
-#endif
- doreset = 1;
- SIG_RETURN;
-}
-
-#ifdef __GNUG__
-#define wait WaitStatus
-#endif
-
-static SIGNAL_RETURN_TYPE
-#ifdef __STDC__
-reap(int sig)
-#else
-reap(sig)
- int sig;
-#endif
-{
- int oerrno = errno;
-
-#ifdef POSIX
- int waitb;
- while (waitpid(-1, &waitb, WNOHANG) == 0) ;
-#else
- union wait waitb;
- while (wait3 (&waitb, WNOHANG, (struct rusage*) 0) == 0) ;
-#endif
-
- errno = oerrno;
- SIG_RETURN;
-}
-
-static void
-do_reset()
-{
- int oerrno = errno;
-#ifdef POSIX
- sigset_t mask, omask;
-#else
- int omask;
-#endif
-#if 0
- zdbug((LOG_DEBUG,"do_reset()"));
-#endif
-#ifdef POSIX
- sigemptyset(&mask);
- sigaddset(&mask, SIGHUP);
- sigprocmask(SIG_BLOCK, &mask, &omask);
-#else
- omask = sigblock(sigmask(SIGHUP));
-#endif
-
- /* reset various things in the server's state */
- subscr_reset();
- server_reset();
- access_reinit();
- syslog (LOG_INFO, "restart completed");
- doreset = 0;
- errno = oerrno;
-#ifdef POSIX
- sigprocmask(SIG_SETMASK, &omask, (sigset_t *)0);
-#else
- sigsetmask(omask);
-#endif
-}
-
-#ifndef DEBUG
-/*
- * detach from the terminal
- */
-
-static void
-detach()
-{
- /* detach from terminal and fork. */
- register int i;
- register long size;
-
-#ifdef POSIX
- size = sysconf(_SC_OPEN_MAX);
-#else
- size = getdtablesize();
-#endif
- /* profiling seems to get confused by fork() */
- MONCONTROL (0);
- i = fork ();
- MONCONTROL (1);
- if (i) {
- if (i < 0)
- perror("fork");
- exit(0);
- }
-
- for (i = 0; i < size; i++) {
- (void) close(i);
- }
- i = open("/dev/tty", O_RDWR, 666);
- (void) ioctl(i, TIOCNOTTY, (caddr_t) 0);
- (void) close(i);
-#ifdef POSIX
- (void) setsid();
-#endif
-}
-#endif
-
-static void
-read_from_dump(dumpfile)
- char *dumpfile;
-{
- return;
-}
diff --git a/server/realm.c b/server/realm.c
new file mode 100644
index 0000000..de2dc12
--- /dev/null
+++ b/server/realm.c
@@ -0,0 +1,1086 @@
+#include "zserver.h"
+#include <sys/socket.h>
+
+extern int __My_length;
+extern char *__My_addr;
+
+Unacked *rlm_nacklist = NULL; /* not acked list for realm-realm
+ packets */
+Realm *otherrealms; /* points to an array of the known
+ servers */
+int nrealms = 0; /* number of other realms */
+
+static void get_realm_addrs __P(());
+static void realm_sendit __P((ZNotice_t *notice, struct sockaddr_in *who, int auth, Realm *realm, int ack_to_sender));
+static void realm_sendit_auth __P((ZNotice_t *notice, struct sockaddr_in *who, int auth, Realm *realm, int ack_to_sender));
+static void rlm_ack __P((ZNotice_t *notice, Unacked *nacked));
+static void rlm_nack_cancel __P((ZNotice_t *notice, struct sockaddr_in *who));
+static void rlm_new_ticket __P(());
+static void rlm_rexmit __P((void *arg));
+static Code_t realm_ulocate_dispatch __P((ZNotice_t *notice,int auth,struct sockaddr_in *who,Server *server,Realm *realm));
+#ifdef ZEPHYR_USES_KERBEROS
+static Code_t ticket_retrieve __P((Realm *realm));
+#endif
+
+char *
+realm_expand_realm(realmname)
+char *realmname;
+{
+ static char expand[REALM_SZ];
+ static char krb_realm[REALM_SZ+1];
+ char *cp1, *cp2;
+ int retval;
+ FILE *rlm_file;
+ char list_file[128];
+ char linebuf[BUFSIZ];
+ char scratch[128];
+
+ /* upcase what we got */
+ cp2 = realmname;
+ cp1 = expand;
+ while (*cp2) {
+ *cp1++ = toupper(*cp2++);
+ }
+ *cp1 = '\0';
+
+ sprintf(list_file, "%s/%s", CONFDIR, REALM_LIST_FILE);
+
+ if ((rlm_file = fopen(list_file, "r")) == (FILE *) 0) {
+ return(expand);
+ }
+
+ if (fgets(linebuf, BUFSIZ, rlm_file) == NULL) {
+ /* error reading */
+ (void) fclose(rlm_file);
+ return(expand);
+ }
+
+ while (1) {
+ /* run through the file, looking for admin host */
+ if (fgets(linebuf, BUFSIZ, rlm_file) == NULL) {
+ (void) fclose(rlm_file);
+ return(expand);
+ }
+
+ if (sscanf(linebuf, "%s %s", krb_realm, scratch) < 2)
+ continue;
+ if (!strncmp(krb_realm, expand, strlen(expand))) {
+ (void) fclose(rlm_file);
+ return(krb_realm);
+ }
+ }
+#ifdef KERBEROS
+ if (!strncmp(my_realm, expand, strlen(expand)))
+ return(my_realm);
+#endif
+ return(expand);
+}
+
+Realmname *
+get_realm_lists(file)
+ char *file;
+{
+ Realmname *rlm_list, *rlm;
+ int ii, nused, ntotal;
+ FILE *fp;
+ char buf[REALM_SZ + MAXHOSTNAMELEN + 1]; /* one for newline */
+ char realm[REALM_SZ], server[MAXHOSTNAMELEN + 1];
+
+ nused = 0;
+ if (!(fp = fopen(file, "r")))
+ return((Realmname *)0);
+
+ /* start with 16, realloc if necessary */
+ ntotal = 16;
+ rlm_list = (Realmname *)malloc(ntotal * sizeof(Realmname));
+ if (!rlm_list) {
+ syslog(LOG_CRIT, "get_realm_lists malloc");
+ abort();
+ }
+
+ while (fgets(buf, REALM_SZ + MAXHOSTNAMELEN + 1, fp)) {
+ if (sscanf(buf, "%s %s", realm, server) != 2) {
+ syslog(LOG_CRIT, "bad format in %s", file);
+ abort();
+ }
+ for (ii = 0; ii < nused; ii++) {
+ /* look for this realm */
+ if (!strcmp(rlm_list[ii].name, realm))
+ break;
+ }
+ if (ii < nused) {
+ rlm = &rlm_list[ii];
+ if (rlm->nused +1 >= rlm->nservers) {
+ /* make more space */
+ rlm->servers = (char **)realloc((char *)rlm->servers,
+ (unsigned)rlm->nservers * 2 *
+ sizeof(char *));
+ if (!rlm->servers) {
+ syslog(LOG_CRIT, "get_realm_lists realloc");
+ abort();
+ }
+ rlm->nservers *= 2;
+ }
+ rlm->servers[rlm->nused++] = strsave(server);
+ } else {
+ /* new realm */
+ if (nused + 1 >= ntotal) {
+ /* make more space */
+ rlm_list = (Realmname *)realloc((char *)rlm_list,
+ (unsigned)ntotal * 2 *
+ sizeof(Realmname));
+ if (!rlm_list) {
+ syslog(LOG_CRIT, "get_realm_lists realloc");
+ abort();
+ }
+ ntotal *= 2;
+ }
+ rlm = &rlm_list[nused++];
+ strcpy(rlm->name, realm);
+ rlm->nused = 0;
+ rlm->nservers = 16;
+ rlm->servers = (char **)malloc(rlm->nservers * sizeof(char *));
+ if (!rlm->servers) {
+ syslog(LOG_CRIT, "get_realm_lists malloc");
+ abort();
+ }
+ rlm->servers[rlm->nused++] = strsave(server);
+ }
+ }
+ if (nused + 1 >= ntotal) {
+ rlm_list = (Realmname *)realloc((char *)rlm_list,
+ (unsigned)(ntotal + 1) *
+ sizeof(Realmname));
+ if (!rlm_list) {
+ syslog(LOG_CRIT, "get_realm_lists realloc");
+ abort();
+ }
+ }
+ *rlm_list[nused].name = '\0';
+
+ return(rlm_list);
+}
+
+Code_t
+realm_send_realms()
+{
+ int cnt, retval;
+ for (cnt = 0; cnt < nrealms; cnt++) {
+ if (retval = (subscr_send_realm_subs(&otherrealms[cnt])) != ZERR_NONE)
+ return(retval);
+ }
+}
+
+int
+bound_for_local_realm(notice)
+ ZNotice_t *notice;
+{
+ char *realm;
+
+ realm = strchr(notice->z_recipient, '@');
+
+ if (!realm || !strcmp(realm_expand_realm(realm + 1), ZGetRealm()))
+ return 1;
+
+ return 0;
+}
+
+int
+sender_in_realm(notice)
+ ZNotice_t *notice;
+{
+ char *realm;
+
+ realm = strchr(notice->z_sender, '@');
+
+ if (!realm || !strcmp(realm + 1, ZGetRealm()))
+ return 1;
+
+ return 0;
+}
+
+Realm *
+realm_which_realm(who)
+ struct sockaddr_in *who;
+{
+ Realm *realm;
+ struct sockaddr_in *addr;
+ int a, b;
+
+ /* loop through the realms */
+ for (realm = otherrealms, a = 0; a < nrealms; a++, realm++)
+ /* loop through the addresses for the realm */
+ for (addr = realm->addrs, b = 0; b < realm->count; b++, addr++)
+ if (addr->sin_addr.s_addr == who->sin_addr.s_addr)
+ return(realm);
+
+ return 0;
+}
+
+Realm *
+realm_get_realm_by_name(name)
+char *name;
+{
+ int a;
+ Realm *realm;
+
+ for (realm = otherrealms, a = 0; a < nrealms; a++, realm++)
+ if (!strcmp(realm->name, name))
+ return(realm);
+
+ return 0;
+}
+
+static void
+rlm_nack_cancel(notice, who)
+ register ZNotice_t *notice;
+ struct sockaddr_in *who;
+{
+ register Realm *which = realm_which_realm(who);
+ register Unacked *nacked, *next;
+ ZNotice_t acknotice;
+ ZPacket_t retval;
+
+#if 0
+ zdbug((LOG_DEBUG, "rlm_nack_cancel: %s:%08X,%08X",
+ inet_ntoa(notice->z_uid.zuid_addr),
+ notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec));
+#endif
+ if (!which) {
+ syslog(LOG_ERR, "non-realm ack?");
+ return;
+ }
+
+ for (nacked = rlm_nacklist; nacked; nacked = nacked->next) {
+ if (&otherrealms[nacked->dest.rlm.rlm_idx] == which) {
+ if (ZCompareUID(&nacked->uid, &notice->z_uid)) {
+ timer_reset(nacked->timer);
+
+ if (nacked->ack_addr.sin_addr.s_addr)
+ rlm_ack(notice, nacked);
+
+ /* free the data */
+ free(nacked->packet);
+ LIST_DELETE(nacked);
+ free(nacked);
+ return;
+ }
+ }
+ }
+#if 0
+ zdbug((LOG_DEBUG,"nack_cancel: nack not found %s:%08X,%08X",
+ inet_ntoa (notice->z_uid.zuid_addr),
+ notice->z_uid.tv.tv_sec, notice->z_uid.tv.tv_usec));
+#endif
+ return;
+}
+
+static void
+rlm_ack(notice, nacked)
+ ZNotice_t *notice;
+ Unacked *nacked;
+{
+ ZNotice_t acknotice;
+ ZPacket_t ackpack;
+ int packlen;
+ Code_t retval;
+
+ /* tell the original sender the result */
+ acknotice = *notice;
+ acknotice.z_message_len = strlen(acknotice.z_message) + 1;
+
+ packlen = sizeof(ackpack);
+
+ if ((retval = ZFormatSmallRawNotice(&acknotice, ackpack, &packlen)) != ZERR_NONE) {
+ syslog(LOG_ERR, "rlm_ack format: %s",
+ error_message(retval));
+ return;
+ }
+ zdbug((LOG_DEBUG, "rlm_ack sending to %s/%d",
+ inet_ntoa(nacked->ack_addr.sin_addr),
+ ntohs(nacked->ack_addr.sin_port)));
+ if ((retval = ZSetDestAddr(&nacked->ack_addr)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_ack set addr: %s",
+ error_message(retval));
+ return;
+ }
+ if ((retval = ZSendPacket(ackpack, packlen, 0)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_ack xmit: %s", error_message(retval));
+ return;
+ }
+}
+
+
+Code_t
+realm_dispatch(notice, auth, who, server)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
+{
+ Realm *realm;
+ struct sockaddr_in newwho;
+ Code_t status = ZERR_NONE;
+ char rlm_recipient[REALM_SZ + 1];
+ int external = 0;
+ String *notice_class;
+
+ if (notice->z_kind == SERVACK || notice->z_kind == SERVNAK) {
+ rlm_nack_cancel(notice, who);
+ return(ZERR_NONE);
+ }
+ /* set up a who for the real origin */
+ memset((caddr_t) &newwho, 0, sizeof(newwho));
+ newwho.sin_family = AF_INET;
+ newwho.sin_addr.s_addr = notice->z_sender_addr.s_addr;
+ newwho.sin_port = hm_port;
+
+ /* check if it's a control message */
+ realm = realm_which_realm(who);
+
+ notice_class = make_string(notice->z_class,1);
+
+ if (class_is_admin(notice_class)) {
+ syslog(LOG_WARNING, "%s sending admin opcode %s",
+ realm->name, notice->z_opcode);
+ } else if (class_is_hm(notice_class)) {
+ syslog(LOG_WARNING, "%s sending hm opcode %s",
+ realm->name, notice->z_opcode);
+ } else if (class_is_control(notice_class)) {
+ status = realm_control_dispatch(notice, auth, who,
+ server, realm);
+ } else if (class_is_ulogin(notice_class)) {
+ /* don't need to forward this */
+ if (server == me_server) {
+ sprintf(rlm_recipient, "@%s", realm->name);
+ notice->z_recipient = rlm_recipient;
+
+ sendit(notice, 1, who, 0);
+ }
+ } else if (class_is_ulocate(notice_class)) {
+ status = realm_ulocate_dispatch(notice, auth, who, server, realm);
+ } else {
+ /* redo the recipient */
+ if (*notice->z_recipient == '\0') {
+ sprintf(rlm_recipient, "@%s", realm->name);
+ notice->z_recipient = rlm_recipient;
+ /* only send to our realm */
+ external = 0;
+ } else if (bound_for_local_realm(notice) && *notice->z_recipient
+ == '@')
+ {
+ /* we're responsible for getting this message out */
+ external = 1;
+ notice->z_recipient = "";
+ }
+
+ /* otherwise, send to local subscribers */
+ sendit(notice, auth, who, external);
+ }
+
+ return(status);
+}
+
+void
+realm_init()
+{
+ Client *client;
+ Realmname *rlmnames;
+ Realm *rlm;
+ int ii, jj, found;
+ struct in_addr *addresses;
+ struct hostent *hp;
+ char list_file[128];
+ char rlmprinc[ANAME_SZ+INST_SZ+REALM_SZ+3];
+
+ sprintf(list_file, "%s/%s", CONFDIR, REALM_LIST_FILE);
+ rlmnames = get_realm_lists(list_file);
+ if (!rlmnames) {
+ zdbug((LOG_DEBUG, "No other realms"));
+ nrealms = 0;
+ return;
+ }
+
+ for (nrealms = 0; *rlmnames[nrealms].name; nrealms++);
+
+ otherrealms = (Realm *)malloc(nrealms * sizeof(Realm));
+ if (!otherrealms) {
+ syslog(LOG_CRIT, "malloc failed in get_realm_addrs");
+ abort();
+ }
+
+ for (ii = 0; ii < nrealms; ii++) {
+ rlm = &otherrealms[ii];
+ strcpy(rlm->name, rlmnames[ii].name);
+
+ addresses = (struct in_addr *)malloc(rlmnames[ii].nused * sizeof(struct in_addr));
+ if (!addresses) {
+ syslog(LOG_CRIT, "malloc failed in get_realm_addrs");
+ abort();
+ }
+ /* convert names to addresses */
+ found = 0;
+ for (jj = 0; jj < rlmnames[ii].nused; jj++) {
+ hp = gethostbyname(rlmnames[ii].servers[jj]);
+ if (hp) {
+ memmove((caddr_t) &addresses[found], (caddr_t)hp->h_addr, sizeof(struct in_addr));
+ found++;
+ } else
+ syslog(LOG_WARNING, "hostname failed, %s", rlmnames[ii].servers[jj]);
+ /* free the hostname */
+ free(rlmnames[ii].servers[jj]);
+ }
+ rlm->count = found;
+ rlm->addrs = (struct sockaddr_in *)malloc(found * sizeof (struct sockaddr_in));
+ if (!rlm->addrs) {
+ syslog(LOG_CRIT, "malloc failed in get_realm_addrs");
+ abort();
+ }
+ for (jj = 0; jj < rlm->count; jj++) {
+ rlm->addrs[jj].sin_family = AF_INET;
+ /* use the server port */
+ rlm->addrs[jj].sin_port = srv_addr.sin_port;
+ rlm->addrs[jj].sin_addr = addresses[jj];
+ }
+ client = (Client *) malloc(sizeof(Client));
+ if (!client) {
+ syslog(LOG_CRIT, "malloc failed in get_realm_addrs");
+ abort();
+ }
+ memset(&client->addr, 0, sizeof(struct sockaddr_in));
+#ifdef ZEPHYR_USES_KERBEROS
+ memset(&client->session_key, 0, sizeof(client->session_key));
+#endif
+ sprintf(rlmprinc, "%s.%s@%s", SERVER_SERVICE, SERVER_INSTANCE, rlm->name);
+ client->principal = make_string(rlmprinc, 0);
+ client->last_msg = 0;
+ client->last_check = 0;
+ client->last_send = 0;
+ client->subs = NULL;
+ client->realm = rlm;
+ client->addr.sin_family = 0;
+ client->addr.sin_port = 0;
+ client->addr.sin_addr.s_addr = 0;
+
+ rlm->client = client;
+ rlm->idx = random() % rlm->count;
+ rlm->subs = NULL;
+ rlm->tkt_try = 0;
+ free(rlmnames[ii].servers);
+ free(addresses);
+ }
+ free(rlmnames);
+}
+
+static Code_t
+realm_ulocate_dispatch(notice, auth, who, server, realm)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
+ Realm *realm;
+{
+ register char *opcode = notice->z_opcode;
+ Code_t status;
+
+ if (!auth) {
+ syslog(LOG_WARNING, "unauth locate msg from %s",
+ inet_ntoa(who->sin_addr));
+ clt_ack(notice, who, AUTH_FAILED);
+ return(ZERR_NONE);
+ }
+
+ if (!strcmp(opcode, REALM_REQ_LOCATE)) {
+ ack(notice, who);
+ ulogin_realm_locate(notice, who, realm);
+ } else if (!strcmp(opcode, REALM_ANS_LOCATE)) {
+ ack(notice, who);
+ ulogin_relay_locate(notice, who);
+ } else {
+ syslog(LOG_WARNING, "%s unknown/illegal loc opcode %s",
+ realm->name, opcode);
+ nack(notice, who);
+ }
+
+ return(ZERR_NONE);
+}
+
+
+Code_t
+realm_control_dispatch(notice, auth, who, server, realm)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
+ Realm *realm;
+{
+ register char *opcode = notice->z_opcode;
+ Code_t status;
+
+ if (!auth) {
+ syslog(LOG_WARNING, "unauth ctl msg from %s",
+ inet_ntoa(who->sin_addr));
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return(ZERR_NONE);
+ }
+
+ if (strcmp(notice->z_class_inst, ZEPHYR_CTL_REALM)) {
+ syslog(LOG_WARNING, "Invalid rlm_dispatch instance %s",
+ notice->z_class_inst);
+ return(ZERR_NONE);
+ }
+
+ if (!strcmp(opcode, REALM_REQ_SUBSCRIBE) || !strcmp(opcode, REALM_ADD_SUBSCRIBE)) {
+ /* try to add subscriptions */
+ /* attempts to get defaults are ignored */
+ if ((status = subscr_foreign_user(notice, who, realm)) != ZERR_NONE) {
+ clt_ack(notice, who, AUTH_FAILED);
+ } else if (server == me_server) {
+ server_forward(notice, auth, who);
+ ack(notice, who);
+ }
+ } else if (!strcmp(opcode, REALM_UNSUBSCRIBE)) {
+ /* try to remove subscriptions */
+ if ((status = subscr_realm_cancel(who, notice, realm)) != ZERR_NONE) {
+ clt_ack(notice, who, NOT_FOUND);
+ } else if (server == me_server) {
+ server_forward(notice, auth, who);
+ ack(notice, who);
+ }
+ } else {
+ syslog(LOG_WARNING, "%s unknown/illegal ctl opcode %s",
+ realm->name, opcode);
+ if (server == me_server)
+ nack(notice, who);
+ return(ZERR_NONE);
+ }
+ return(ZERR_NONE);
+}
+
+void
+realm_handoff(notice, auth, who, realm, ack_to_sender)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Realm *realm;
+ int ack_to_sender;
+{
+#ifdef ZEPHYR_USES_KERBEROS
+ Code_t retval;
+
+ if (!auth) {
+ zdbug((LOG_DEBUG, "realm_sendit unauthentic to realm %s", realm->name))
+ realm_sendit(notice, who, auth, realm, ack_to_sender);
+ }
+
+ if (!ticket_lookup(realm->name))
+ if ((retval = ticket_retrieve(realm)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_handoff failed: %s", error_message(retval));
+ return;
+ }
+
+ zdbug((LOG_DEBUG, "realm_sendit to realm %s auth %d", realm->name, auth));
+ /* valid ticket available now, send the message */
+ realm_sendit_auth(notice, who, auth, realm, ack_to_sender);
+#else /* ZEPHYR_USES_KERBEROS */
+ realm_sendit(notice, who, auth, realm, ack_to_sender);
+#endif /* ZEPHYR_USES_KERBEROS */
+}
+
+static void
+realm_sendit(notice, who, auth, realm, ack_to_sender)
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
+ int auth;
+ Realm *realm;
+ int ack_to_sender;
+{
+ caddr_t pack;
+ int packlen;
+ Code_t retval;
+ Unacked *nacked;
+
+ notice->z_auth = auth;
+
+ /* format the notice */
+ if ((retval = ZFormatRawNotice(notice, &pack, &packlen)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit format: %s",
+ error_message(retval));
+ return;
+ }
+
+ /* now send */
+ if ((retval = ZSetDestAddr(&realm->addrs[realm->idx])) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit set addr: %s",
+ error_message(retval));
+ free(pack);
+ return;
+ }
+ if ((retval = ZSendPacket(pack, packlen, 0)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit xmit: %s", error_message(retval));
+ free(pack);
+ return;
+ }
+
+ /* now we've sent it, mark it as not ack'ed */
+
+ if (!(nacked = (Unacked *)malloc(sizeof(Unacked)))) {
+ /* no space: just punt */
+ syslog(LOG_ERR, "rlm_sendit nack malloc");
+ free(pack);
+ return;
+ }
+
+ nacked->rexmits = 0;
+ nacked->packet = pack;
+ nacked->dest.rlm.rlm_idx = realm - otherrealms;
+ nacked->dest.rlm.rlm_srv_idx = realm->idx;
+ nacked->packsz = packlen;
+ nacked->uid = notice->z_uid;
+ if (ack_to_sender)
+ nacked->ack_addr = *who;
+ else
+ nacked->ack_addr.sin_addr.s_addr = 0;
+
+ /* set a timer to retransmit */
+ nacked->timer = timer_set_rel(rexmit_times[0], rlm_rexmit, nacked);
+ /* chain in */
+ LIST_INSERT(&rlm_nacklist, nacked);
+ return;
+}
+
+static void
+packet_ctl_nack(nackpacket)
+ Unacked *nackpacket;
+{
+ ZNotice_t notice;
+
+ /* extract the notice */
+ ZParseNotice(nackpacket->packet, nackpacket->packsz, &notice);
+ nack(&notice, &nackpacket->ack_addr);
+}
+
+static void
+rlm_rexmit(arg)
+ void *arg;
+{
+ Unacked *nackpacket = (Unacked *) arg;
+ Code_t retval;
+ register Realm *realm;
+ int new_srv_idx;
+
+ zdbug((LOG_DEBUG,"rlm_rexmit"));
+
+ realm = &otherrealms[nackpacket->dest.rlm.rlm_idx];
+
+ zdbug((LOG_DEBUG, "rlm_rexmit: sending to %s", realm->name));
+
+ if (rexmit_times[(nackpacket->rexmits + 1)/(realm->count)] == -1) {
+ /* give a server ack that the packet is lost/realm dead */
+ packet_ctl_nack(nackpacket);
+ LIST_DELETE(nackpacket);
+ free(nackpacket->packet);
+ free(nackpacket);
+
+ zdbug((LOG_DEBUG, "rlm_rexmit: %s appears dead", realm->name));
+ return;
+ }
+
+ /* retransmit the packet, trying each server in the realm multiple times */
+#if 0
+ new_srv_idx = ((nackpacket->rexmits / NUM_REXMIT_TIMES)
+ + nackpacket->rlm.rlm_srv_idx) % realm->count;
+#else
+ new_srv_idx = nackpacket->rexmits % realm->count;
+#endif
+ if (new_srv_idx != realm->idx)
+ realm->idx = new_srv_idx;
+
+ retval = ZSetDestAddr(&realm->addrs[realm->idx]);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_rexmit set addr: %s", error_message(retval));
+ } else {
+ retval = ZSendPacket(nackpacket->packet, nackpacket->packsz, 0);
+ if (retval != ZERR_NONE)
+ syslog(LOG_WARNING, "rlm_rexmit xmit: %s", error_message(retval));
+ }
+ /* reset the timer */
+ if (rexmit_times[(nackpacket->rexmits + 1)/(realm->count)] != -1)
+ nackpacket->rexmits++;
+
+ nackpacket->timer = timer_set_rel(rexmit_times[(nackpacket->rexmits)/(realm->count)], rlm_rexmit, nackpacket);
+ return;
+}
+
+void
+realm_dump_realms(fp)
+ FILE *fp;
+{
+ register int ii, jj;
+
+ for (ii = 0; ii < nrealms; ii++) {
+ (void) fprintf(fp, "%d:%s\n", ii, otherrealms[ii].name);
+ for (jj = 0; jj < otherrealms[ii].count; jj++) {
+ (void) fprintf(fp, "\t%s\n",
+ inet_ntoa(otherrealms[ii].addrs[jj].sin_addr));
+ }
+ /* dump the subs */
+ subscr_dump_subs(fp, otherrealms[ii].subs);
+ }
+}
+
+
+#ifdef ZEPHYR_USES_KERBEROS
+static void
+realm_sendit_auth(notice, who, auth, realm, ack_to_sender)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Realm *realm;
+ int ack_to_sender;
+{
+ char *buffer, *ptr;
+ caddr_t pack;
+ int buffer_len, hdrlen, offset, fragsize, ret_len, message_len;
+ int origoffset, origlen;
+ Code_t retval;
+ Unacked *nacked;
+ char buf[1024], multi[64];
+ CREDENTIALS cred;
+ KTEXT_ST authent;
+ ZNotice_t partnotice, newnotice;
+
+ offset = 0;
+
+ /* first, build an authent */
+ retval = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE, realm, &cred);
+ if (retval != GC_OK) {
+ syslog(LOG_WARNING, "rlm_sendit_auth get_cred: %s",
+ error_message(retval+krb_err_base));
+ return;
+ }
+
+ retval = krb_mk_req(&authent, SERVER_SERVICE, SERVER_INSTANCE, realm, 1);
+ if (retval != MK_AP_OK) {
+ syslog(LOG_WARNING, "rlm_sendit_auth mk_req: %s",
+ error_message(retval+krb_err_base));
+ return;
+ }
+
+ retval = ZMakeAscii(buf, sizeof(buf), authent.dat, authent.length);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth mk_ascii: %s",
+ error_message(retval));
+ return;
+ }
+
+ /* set the dest addr */
+ retval = ZSetDestAddr(&realm->addrs[realm->idx]);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth set addr: %s", error_message(retval));
+ return;
+ }
+
+ /* now format the notice, refragmenting if needed */
+ newnotice = *notice;
+ newnotice.z_auth = 1;
+ newnotice.z_ascii_authent = buf;
+ newnotice.z_authent_len = authent.length;
+
+ buffer = (char *) malloc(sizeof(ZPacket_t));
+ if (!buffer) {
+ syslog(LOG_ERR, "realm_sendit_auth malloc");
+ return; /* DON'T put on nack list */
+ }
+
+ buffer_len = sizeof(ZPacket_t);
+
+ retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len, &hdrlen, &ptr,
+ NULL);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth raw: %s", error_message(retval));
+ free(buffer);
+ return;
+ }
+
+#ifdef NOENCRYPTION
+ newnotice.z_checksum = 0;
+#else
+ newnotice.z_checksum =
+ (ZChecksum_t)des_quad_cksum(buffer, NULL, ptr - buffer, 0, cred.session);
+#endif
+
+ retval = Z_FormatRawHeader(&newnotice, buffer, buffer_len, &hdrlen,
+ NULL, NULL);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth raw: %s", error_message(retval));
+ free(buffer);
+ return;
+ }
+
+ /* This is not terribly pretty, but it does do its job.
+ * If a packet we get that needs to get sent off to another realm is
+ * too big after we slap on our authent, we refragment it further,
+ * a la Z_SendFragmentedNotice. This obliviates the need for what
+ * used to be done in ZFormatAuthenticRealmNotice, as we do it here.
+ * At some point it should be pulled back out into its own function,
+ * but only the server uses it.
+ */
+
+ if ((newnotice.z_message_len+hdrlen > buffer_len) ||
+ (newnotice.z_message_len+hdrlen > Z_MAXPKTLEN)){
+ /* Deallocate buffer, use a local one */
+ free(buffer);
+
+ partnotice = *notice;
+
+ partnotice.z_auth = 1;
+ partnotice.z_ascii_authent = buf;
+ partnotice.z_authent_len = authent.length;
+
+ origoffset = 0;
+ origlen = notice->z_message_len;
+
+ if (notice->z_multinotice && strcmp(notice->z_multinotice, ""))
+ if (sscanf(notice->z_multinotice, "%d/%d", &origoffset, &origlen) != 2) {
+ syslog(LOG_WARNING, "rlm_sendit_auth frag: parse failed");
+ return;
+ }
+
+#if 0
+ zdbug((LOG_DEBUG,"rlm_send_auth: orig: %d-%d/%d", origoffset, notice->z_message_len, origlen));
+#endif
+
+ fragsize = Z_MAXPKTLEN-hdrlen-Z_FRAGFUDGE;
+
+ while (offset < notice->z_message_len || !notice->z_message_len) {
+ (void) sprintf(multi, "%d/%d", offset+origoffset, origlen);
+ partnotice.z_multinotice = multi;
+ if (offset > 0) {
+ (void) gettimeofday(&partnotice.z_uid.tv, (struct timezone *)0);
+ partnotice.z_uid.tv.tv_sec = htonl((u_long)
+ partnotice.z_uid.tv.tv_sec);
+ partnotice.z_uid.tv.tv_usec = htonl((u_long)
+ partnotice.z_uid.tv.tv_usec);
+ if ((retval = Z_GetMyAddr()) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth addr: %s", error_message(retval));
+ return;
+ }
+ (void) memcpy((char *)&partnotice.z_uid.zuid_addr, __My_addr,
+ __My_length);
+ }
+ message_len = min(notice->z_message_len-offset, fragsize);
+ partnotice.z_message = notice->z_message+offset;
+ partnotice.z_message_len = message_len;
+
+#if 0
+ zdbug((LOG_DEBUG,"rlm_send_auth: new: %d-%d/%d", origoffset+offset, message_len, origlen));
+#endif
+
+ buffer = (char *) malloc(sizeof(ZPacket_t));
+ if (!buffer) {
+ syslog(LOG_ERR, "realm_sendit_auth malloc");
+ return; /* DON'T put on nack list */
+ }
+
+ retval = Z_FormatRawHeader(&partnotice, buffer, buffer_len, &hdrlen,
+ &ptr, NULL);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth raw: %s", error_message(retval));
+ free(buffer);
+ return;
+ }
+
+#ifdef NOENCRYPTION
+ partnotice.z_checksum = 0;
+#else
+ partnotice.z_checksum =
+ (ZChecksum_t)des_quad_cksum(buffer, NULL, ptr - buffer, 0,
+ cred.session);
+#endif
+
+ retval = Z_FormatRawHeader(&partnotice, buffer, buffer_len, &hdrlen,
+ NULL, NULL);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth raw: %s", error_message(retval));
+ free(buffer);
+ return;
+ }
+
+ ptr = buffer+hdrlen;
+
+ (void) memcpy(ptr, partnotice.z_message, partnotice.z_message_len);
+
+ buffer_len = hdrlen+partnotice.z_message_len;
+
+ /* now send */
+ if ((retval = ZSendPacket(buffer, buffer_len, 0)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth xmit: %s", error_message(retval));
+ free(buffer);
+ return;
+ }
+
+ offset += fragsize;
+
+ if (!(nacked = (Unacked *)malloc(sizeof(Unacked)))) {
+ /* no space: just punt */
+ syslog(LOG_ERR, "rlm_sendit_auth nack malloc");
+ free(buffer);
+ return;
+ }
+
+ nacked->rexmits = 0;
+ nacked->packet = buffer;
+ nacked->dest.rlm.rlm_idx = realm - otherrealms;
+ nacked->dest.rlm.rlm_srv_idx = realm->idx;
+ nacked->packsz = buffer_len;
+ nacked->uid = partnotice.z_uid;
+
+ /* Do the ack for the last frag, below */
+ if (ack_to_sender)
+ nacked->ack_addr = *who;
+ else
+ nacked->ack_addr.sin_addr.s_addr = 0;
+
+ /* set a timer to retransmit */
+ nacked->timer = timer_set_rel(rexmit_times[0], rlm_rexmit, nacked);
+
+ /* chain in */
+ LIST_INSERT(&rlm_nacklist, nacked);
+
+ if (!notice->z_message_len)
+ break;
+ }
+#if 0
+ zdbug((LOG_DEBUG, "rlm_sendit_auth frag message sent"));
+#endif
+ } else {
+ /* This is easy, no further fragmentation needed */
+ ptr = buffer+hdrlen;
+
+ (void) memcpy(ptr, newnotice.z_message, newnotice.z_message_len);
+
+ buffer_len = hdrlen+newnotice.z_message_len;
+
+ /* now send */
+ if ((retval = ZSendPacket(buffer, buffer_len, 0)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "rlm_sendit_auth xmit: %s", error_message(retval));
+ free(buffer);
+ return;
+ }
+
+#if 0
+ zdbug((LOG_DEBUG, "rlm_sendit_auth message sent"));
+#endif
+ /* now we've sent it, mark it as not ack'ed */
+
+ if (!(nacked = (Unacked *)malloc(sizeof(Unacked)))) {
+ /* no space: just punt */
+ syslog(LOG_ERR, "rlm_sendit_auth nack malloc");
+ free(buffer);
+ return;
+ }
+
+ nacked->rexmits = 0;
+ nacked->packet = buffer;
+ nacked->dest.rlm.rlm_idx = realm - otherrealms;
+ nacked->dest.rlm.rlm_srv_idx = realm->idx;
+ nacked->packsz = buffer_len;
+ nacked->uid = notice->z_uid;
+
+ /* Do the ack for the last frag, below */
+ if (ack_to_sender)
+ nacked->ack_addr = *who;
+ else
+ nacked->ack_addr.sin_addr.s_addr = 0;
+
+ /* set a timer to retransmit */
+ nacked->timer = timer_set_rel(rexmit_times[0], rlm_rexmit, nacked);
+ /* chain in */
+ LIST_INSERT(&rlm_nacklist, nacked);
+ }
+#if 0
+ if (ack_to_sender)
+ nacked->ack_addr = *who;
+#endif
+ return;
+}
+
+int
+ticket_expired(cred)
+CREDENTIALS *cred;
+{
+ /* extra 15 minutes for safety margin */
+#ifdef AFS_LIFETIMES
+ return (krb_life_to_time(cred->issue_date, cred->lifetime) < NOW + 15*60);
+#else /* AFS_LIFETIMES */
+ return (cred->issue_date + cred->lifetime*5*60 < NOW + 15*60);
+#endif /* AFS_LIFETIMES */
+}
+
+int
+ticket_lookup(realm)
+char *realm;
+{
+ CREDENTIALS cred;
+ KTEXT_ST authent;
+ int retval;
+
+ retval = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE, realm, &cred);
+ if (retval == GC_OK && !ticket_expired(&cred))
+ /* good ticket */
+ return(1);
+
+ if (!strcmp(realm, ZGetRealm())) {
+ get_tgt();
+
+ /* For Putrify */
+ memset(&authent.dat,0,MAX_KTXT_LEN);
+ authent.mbz=0;
+
+ /* this is local, so try to contact the Kerberos server */
+ retval = krb_mk_req(&authent, SERVER_SERVICE, SERVER_INSTANCE,
+ realm, 0);
+ if (retval != KSUCCESS) {
+ syslog(LOG_ERR, "tkt_lookup: local: %s",
+ krb_err_txt[retval]);
+ return(0);
+ } else {
+ return(1);
+ }
+ }
+
+ return (0);
+}
+
+static Code_t
+ticket_retrieve(realm)
+ Realm *realm;
+{
+ int pid, retval;
+ KTEXT_ST authent;
+
+ get_tgt();
+
+ /* For Putrify */
+ memset(&authent.dat,0,MAX_KTXT_LEN);
+ authent.mbz=0;
+
+ /* Don't lose by trying too often. */
+ if (NOW - realm->tkt_try > 5 * 60) {
+ retval = krb_mk_req(&authent, SERVER_SERVICE, SERVER_INSTANCE,
+ realm->name, 0);
+ realm->tkt_try = NOW;
+ if (retval != KSUCCESS) {
+ syslog(LOG_WARNING, "tkt_rtrv: %s: %s", realm,
+ krb_err_txt[retval]);
+ return (retval+krb_err_base);
+ }
+ return (0);
+ } else {
+ return (1);
+ }
+}
+#endif /* ZEPHYR_USES_KERBEROS */
+
diff --git a/server/server.c b/server/server.c
index cb9b121..70a06b9 100644
--- a/server/server.c
+++ b/server/server.c
@@ -12,18 +12,19 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
+#include <sys/socket.h>
#ifndef lint
#ifndef SABER
-static char rcsid_server_c[] = "$Id$";
+static const char rcsid_server_c[] = "$Id$";
#endif
#endif
-#include "zserver.h"
-#include <sys/socket.h> /* for AF_INET */
-#include <netdb.h> /* for gethostbyname */
-#include <sys/param.h> /* for BSD */
-
+#define SRV_NACKTAB_HASHSIZE 1023
+#define SRV_NACKTAB_HASHVAL(which, uid) (((which) ^ (uid).zuid_addr.s_addr ^ \
+ (uid).tv.tv_sec ^ (uid).tv.tv_usec) \
+ % SRV_NACKTAB_HASHSIZE)
/*
* Server manager. Deal with traffic to and from other servers.
*
@@ -32,7 +33,7 @@ static char rcsid_server_c[] = "$Id$";
* void server_shutdown()
*
* void server_timo(which)
- * ZServerDesc_t *which;
+ * Server *which;
*
* void server_dispatch(notice, auth, who)
* ZNotice_t *notice;
@@ -40,24 +41,24 @@ static char rcsid_server_c[] = "$Id$";
* struct sockaddr_in *who;
*
* void server_recover(client)
- * ZClient_t *client;
+ * Client *client;
*
* void server_adispatch(notice, auth, who, server)
* ZNotice_t *notice;
* int auth;
* struct sockaddr_in *who;
- * ZServerDesc_t *server;
+ * Server *server;
*
* void server_forward(notice, auth, who)
* ZNotice_t *notice;
* int auth;
* struct sockaddr_in *who;
*
- * ZServerDesc_t *server_which_server(who)
+ * Server *server_which_server(who)
* struct sockaddr_in *who;
*
* void server_kill_clt(client);
- * ZClient_t *client;
+ * Client *client;
*
* void server_dump_servers(fp);
* FILE *fp;
@@ -65,68 +66,51 @@ static char rcsid_server_c[] = "$Id$";
* void server_reset();
*/
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static void
- server_flush P((ZServerDesc_t *)),
- hello_respond P((struct sockaddr_in *, int, int)),
- srv_responded P((struct sockaddr_in *)),
- send_msg P((struct sockaddr_in *, char *, int)),
- send_msg_list P((struct sockaddr_in *, char *, char **, int, int, int)),
- srv_nack_cancel P((ZNotice_t *, struct sockaddr_in *)),
- srv_nack_release P((ZServerDesc_t *)),
- srv_nack_renumber P((int *)),
- server_lost P((ZServerDesc_t *)),
- send_stats P((struct sockaddr_in *)),
- server_queue P((ZServerDesc_t *, int, caddr_t, int, struct sockaddr_in *));
-#define STATIC /* should be static, but is friend elsewhere */
-STATIC void
- server_hello P((ZServerDesc_t *, int)),
- setup_server P((ZServerDesc_t *, struct in_addr *)),
- srv_rexmit P((void *)),
- server_forw_reliable P((ZServerDesc_t *, caddr_t, int, ZNotice_t *));
-static Code_t
- admin_dispatch P((ZNotice_t *, int, struct sockaddr_in *,
- ZServerDesc_t *)),
- recover_clt P((ZNotice_t *, ZServerDesc_t *)),
- kill_clt P((ZNotice_t *, ZServerDesc_t *)),
- extract_addr P((ZNotice_t *, struct sockaddr_in *));
-
+static void server_flush __P((Server *));
+static void hello_respond __P((struct sockaddr_in *, int, int));
+static void srv_responded __P((struct sockaddr_in *));
+static void send_msg __P((struct sockaddr_in *, char *, int));
+static void send_msg_list __P((struct sockaddr_in *, char *, char **, int,
+ int));
+static void srv_nack_cancel __P((ZNotice_t *, struct sockaddr_in *));
+static void srv_nack_release __P((Server *));
+static void srv_nack_renumber __P((int *));
+static void send_stats __P((struct sockaddr_in *));
+static void server_queue __P((Server *, int, void *, int,
+ struct sockaddr_in *));
+static void server_hello __P((Server *, int));
+static void setup_server __P((Server *, struct in_addr *));
+static void srv_rexmit __P((void *));
+static void server_forw_reliable __P((Server *, caddr_t, int, ZNotice_t *));
+static Code_t admin_dispatch __P((ZNotice_t *, int, struct sockaddr_in *,
+ Server *));
+static Code_t kill_clt __P((ZNotice_t *, Server *));
+static Code_t extract_addr __P((ZNotice_t *, struct sockaddr_in *));
#ifdef notdef
static Code_t server_register();
#endif
-static struct in_addr *get_server_addrs P((int *number));
-#ifndef HESIOD
-static char **get_server_list P((char *file));
-static void free_server_list P((char **list));
+static struct in_addr *get_server_addrs __P((int *number));
+#ifndef ZEPHYR_USES_HESIOD
+static char **get_server_list __P((char *file));
+static void free_server_list __P((char **list));
#endif
-#undef P
+static Unacked *srv_nacktab[SRV_NACKTAB_HASHSIZE];
+Server *otherservers; /* points to an array of the known
+ servers */
+int nservers; /* number of other servers */
+int me_server_idx; /* # of my entry in the array */
-
-ZNotAcked_t *srv_nacklist; /* not acked list for server-server
- packets */
-ZServerDesc_t *otherservers; /* points to an array of the known
- servers */
-int nservers; /* number of other servers */
-int me_server_idx; /* # of my entry in the array */
-
-#define ADJUST (1) /* adjust timeout on hello input */
-#define DONT_ADJUST (0) /* don't adjust timeout */
+#define ADJUST (1) /* adjust timeout on hello input */
+#define DONT_ADJUST (0) /* don't adjust timeout */
/* parameters controlling the transitions of the FSM's--patchable with adb */
long timo_up = TIMO_UP;
long timo_tardy = TIMO_TARDY;
long timo_dead = TIMO_DEAD;
-long srv_rexmit_secs = REXMIT_SECS;
-
/* counters to measure old protocol use */
#ifdef OLD_COMPAT
int old_compat_count_uloc = 0;
@@ -152,93 +136,85 @@ int zalone;
void
server_init()
{
- register int i;
- struct in_addr *serv_addr, *server_addrs, limbo_addr;
+ int i;
+ struct in_addr *serv_addr, *server_addrs, limbo_addr;
- /* we don't need to mask SIGFPE here since when we are called,
- the signal handler isn't set up yet. */
+ /* we don't need to mask SIGFPE here since when we are called,
+ the signal handler isn't set up yet. */
- /* talk to hesiod here, set nservers */
- if (!(server_addrs = get_server_addrs(&nservers))) {
- syslog(LOG_ERR, "No servers?!?");
- exit(1);
- }
+ /* talk to hesiod here, set nservers */
+ server_addrs = get_server_addrs(&nservers);
+ if (!server_addrs) {
+ syslog(LOG_ERR, "No servers?!?");
+ exit(1);
+ }
#ifdef DEBUG
- if (zalone)
- nservers = 1;
- else
+ if (zalone)
+ nservers = 1;
+ else
#endif /* DEBUG */
- /* increment servers to make room for 'limbo' */
- nservers++;
-
- otherservers = (ZServerDesc_t *) xmalloc(nservers *
- sizeof(ZServerDesc_t));
- me_server_idx = -1;
-
- /* set up limbo */
- limbo_addr.s_addr = (unsigned long) 0;
- setup_server(otherservers, &limbo_addr);
- timer_reset(otherservers[0].zs_timer);
- otherservers[0].zs_timer = (timer) NULL;
- otherservers[0].zs_update_queue = NULLZSPT;
- otherservers[0].zs_dumping = 0;
-
- for (serv_addr = server_addrs, i = 1; i < nservers; serv_addr++, i++) {
- setup_server(&otherservers[i], serv_addr);
- /* is this me? */
- if (serv_addr->s_addr == my_addr.s_addr) {
- me_server_idx = i;
- otherservers[i].zs_state = SERV_UP;
- timer_reset(otherservers[i].zs_timer);
- otherservers[i].zs_timer = (timer) NULL;
- otherservers[i].zs_update_queue = NULLZSPT;
- otherservers[i].zs_dumping = 0;
+ /* increment servers to make room for 'limbo' */
+ nservers++;
+
+ otherservers = (Server *) malloc(nservers * sizeof(Server));
+ me_server_idx = -1;
+
+ /* set up limbo */
+ limbo_addr.s_addr = 0;
+ setup_server(otherservers, &limbo_addr);
+ timer_reset(otherservers[0].timer);
+ otherservers[0].timer = NULL;
+ otherservers[0].queue = NULL;
+ otherservers[0].dumping = 0;
+
+ for (serv_addr = server_addrs, i = 1; i < nservers; serv_addr++, i++) {
+ setup_server(&otherservers[i], serv_addr);
+ /* is this me? */
+ if (serv_addr->s_addr == my_addr.s_addr) {
+ me_server_idx = i;
+ otherservers[i].state = SERV_UP;
+ timer_reset(otherservers[i].timer);
+ otherservers[i].timer = NULL;
+ otherservers[i].queue = NULL;
+ otherservers[i].dumping = 0;
#if 0
- zdbug((LOG_DEBUG,"found myself"));
+ zdbug((LOG_DEBUG,"found myself"));
#endif
- }
}
+ }
- /* free up the addresses */
- xfree(server_addrs);
+ /* free up the addresses */
+ free(server_addrs);
- if (me_server_idx == -1) {
- syslog(LOG_WARNING, "I'm a renegade server!");
- otherservers = (ZServerDesc_t *)realloc((caddr_t) otherservers, (unsigned) (++nservers * sizeof(ZServerDesc_t)));
- if (!otherservers) {
- syslog(LOG_CRIT, "renegade realloc");
- abort();
- }
- setup_server(&otherservers[nservers - 1], &my_addr);
- /* we are up. */
- otherservers[nservers - 1].zs_state = SERV_UP;
-
- /* I don't send hello's to myself--cancel the timer */
- timer_reset(otherservers[nservers - 1].zs_timer);
- otherservers[nservers - 1].zs_timer = (timer) NULL;
-
- /* cancel and reschedule all the timers--pointers need
- adjusting */
- /* don't reschedule limbo's timer, so start i=1 */
- for (i = 1; i < nservers - 1; i++) {
- timer_reset(otherservers[i].zs_timer);
- /* all the HELLO's are due now */
- otherservers[i].zs_timer =
- timer_set_rel(0L, server_timo, (void *)
- &otherservers[i]);
- }
- me_server_idx = nservers - 1;
+ if (me_server_idx == -1) {
+ syslog(LOG_WARNING, "I'm a renegade server!");
+ otherservers = (Server *) realloc(otherservers,
+ ++nservers * sizeof(Server));
+ if (!otherservers) {
+ syslog(LOG_CRIT, "renegade realloc");
+ abort();
}
- if (!(srv_nacklist = (ZNotAcked_t *) xmalloc(sizeof(ZNotAcked_t)))) {
- /* unrecoverable */
- syslog(LOG_CRIT, "srv_nacklist malloc");
- abort();
+ setup_server(&otherservers[nservers - 1], &my_addr);
+ /* we are up. */
+ otherservers[nservers - 1].state = SERV_UP;
+
+ /* I don't send hello's to myself--cancel the timer */
+ timer_reset(otherservers[nservers - 1].timer);
+ otherservers[nservers - 1].timer = NULL;
+
+ /* cancel and reschedule all the timers--pointers need
+ adjusting */
+ /* don't reschedule limbo's timer, so start i=1 */
+ for (i = 1; i < nservers - 1; i++) {
+ timer_reset(otherservers[i].timer);
+ /* all the HELLO's are due now */
+ otherservers[i].timer = timer_set_rel(0L, server_timo,
+ &otherservers[i]);
}
- (void) memset((caddr_t) srv_nacklist, 0, sizeof(ZNotAcked_t));
- srv_nacklist->q_forw = srv_nacklist->q_back = srv_nacklist;
+ me_server_idx = nservers - 1;
+ }
- return;
}
/*
@@ -256,191 +232,193 @@ server_init()
void
server_reset()
{
- int num_servers;
- struct in_addr *server_addrs;
- register struct in_addr *serv_addr;
- register ZServerDesc_t *servers;
- register int i, j;
- int *ok_list_new, *ok_list_old;
- int num_ok, new_num;
+ int num_servers;
+ struct in_addr *server_addrs;
+ struct in_addr *serv_addr;
+ Server *servers;
+ int i, j;
+ int *ok_list_new, *ok_list_old;
+ int num_ok, new_num;
#if 0
- zdbug((LOG_DEBUG, "server_reset"));
+ zdbug((LOG_DEBUG, "server_reset"));
#endif
#ifdef DEBUG
- if (zalone) {
- syslog(LOG_INFO, "server_reset while alone, punt");
- return;
- }
+ if (zalone) {
+ syslog(LOG_INFO, "server_reset while alone, punt");
+ return;
+ }
#endif /* DEBUG */
- /* Find out what servers are supposed to be known. */
- if (!(server_addrs = get_server_addrs(&num_servers))) {
- syslog(LOG_ERR, "server_reset no servers. nothing done.");
- return;
- }
- ok_list_new = (int *) xmalloc (num_servers * sizeof (int));
- if (ok_list_new == (int *) 0) {
- syslog(LOG_ERR, "server_reset no mem new");
- return;
- }
- ok_list_old = (int *) xmalloc (nservers * sizeof (int));
- if (ok_list_old == (int *) 0) {
- syslog(LOG_ERR, "server_reset no mem old");
- xfree(ok_list_new);
- return;
- }
+ /* Find out what servers are supposed to be known. */
+ server_addrs = get_server_addrs(&num_servers);
+ if (!server_addrs) {
+ syslog(LOG_ERR, "server_reset no servers. nothing done.");
+ return;
+ }
+ ok_list_new = (int *) malloc(num_servers * sizeof(int));
+ if (!ok_list_new) {
+ syslog(LOG_ERR, "server_reset no mem new");
+ return;
+ }
+ ok_list_old = (int *) malloc(nservers * sizeof(int));
+ if (!ok_list_old) {
+ syslog(LOG_ERR, "server_reset no mem old");
+ free(ok_list_new);
+ return;
+ }
- (void) memset((char *)ok_list_old, 0, nservers * sizeof(int));
- (void) memset((char *)ok_list_new, 0, num_servers * sizeof(int));
+ memset(ok_list_old, 0, nservers * sizeof(int));
+ memset(ok_list_new, 0, num_servers * sizeof(int));
- /* reset timers--pointers will move */
- for (j = 1; j < nservers; j++) { /* skip limbo */
- if (j == me_server_idx)
- continue;
- timer_reset(otherservers[j].zs_timer);
- otherservers[j].zs_timer = (timer) 0;
+ /* reset timers--pointers will move */
+ for (j = 1; j < nservers; j++) { /* skip limbo */
+ if (j == me_server_idx)
+ continue;
+ timer_reset(otherservers[j].timer);
+ otherservers[j].timer = NULL;
+ }
+
+ /* check off entries on new list which are on old list.
+ check off entries on old list which are on new list. */
+
+ /* count limbo as "OK" */
+ num_ok = 1;
+ ok_list_old[0] = 1; /* limbo is OK */
+
+ for (serv_addr = server_addrs, i = 0; i < num_servers; serv_addr++, i++) {
+ for (j = 1; j < nservers; j++) { /* j = 1 since we skip limbo */
+ if (otherservers[j].addr.sin_addr.s_addr == serv_addr->s_addr) {
+ /* if server is on both lists, mark */
+ ok_list_new[i] = 1;
+ ok_list_old[j] = 1;
+ num_ok++;
+ break; /* for j loop */
+ }
}
+ }
- /* check off entries on new list which are on old list.
- check off entries on old list which are on new list.
- */
-
- /* count limbo as "OK" */
- num_ok = 1;
- ok_list_old[0] = 1; /* limbo is OK */
-
- for (serv_addr = server_addrs, i = 0;
- i < num_servers;
- serv_addr++, i++) /* for each new server */
- for (j = 1; j < nservers; j++) /* j = 1 since we skip limbo */
- if (otherservers[j].zs_addr.sin_addr.s_addr ==
- serv_addr->s_addr) {
- /* if server is on both lists, mark */
- ok_list_new[i] = 1;
- ok_list_old[j] = 1;
- num_ok++;
- break; /* for j loop */
- }
-
- /* remove any dead servers on old list not on new list. */
- if (num_ok < nservers) {
- int *srv;
- new_num = 1; /* limbo */
- /* count number of servers to keep */
- for (j = 1; j < nservers; j++)
- /* since we are never SERV_DEAD, the following
- test prevents removing ourself from the list */
- if (ok_list_old[j] ||
- (otherservers[j].zs_state != SERV_DEAD)) {
- syslog(LOG_INFO, "keeping server %s",
- otherservers[j].addr);
- new_num++;
- }
- if (new_num < nservers) {
- servers = (ZServerDesc_t *) xmalloc(new_num * sizeof(ZServerDesc_t));
- if (!servers) {
- syslog(LOG_CRIT, "server_reset server malloc");
- abort();
- }
- i = 1;
- servers[0] = otherservers[0]; /* copy limbo */
-
- srv = (int*) xmalloc (nservers * sizeof (int));
- (void) memset (srv, 0, nservers * sizeof (int));
-
- /* copy the kept servers */
- for (j = 1; j < nservers; j++) { /* skip limbo */
- if (ok_list_old[j] ||
- otherservers[j].zs_state != SERV_DEAD) {
- servers[i] = otherservers[j];
- srv[j] = i;
- i++;
- } else {
- syslog(LOG_INFO, "flushing server %s",
- otherservers[j].addr);
- server_flush(&otherservers[j]);
- srv[j] = -1;
- }
-
- }
- srv_nack_renumber (srv);
- hostm_renumber_servers (srv);
-
- xfree(srv);
- xfree(otherservers);
- otherservers = servers;
- nservers = new_num;
+ /* remove any dead servers on old list not on new list. */
+ if (num_ok < nservers) {
+ int *srv;
+
+ new_num = 1; /* limbo */
+ /* count number of servers to keep */
+ for (j = 1; j < nservers; j++) {
+ /* since we are never SERV_DEAD, the following
+ test prevents removing ourself from the list */
+ if (ok_list_old[j] || (otherservers[j].state != SERV_DEAD)) {
+ syslog(LOG_INFO, "keeping server %s",
+ otherservers[j].addr_str);
+ new_num++;
+ }
+ }
+ if (new_num < nservers) {
+ servers = (Server *) malloc(new_num * sizeof(Server));
+ if (!servers) {
+ syslog(LOG_CRIT, "server_reset server malloc");
+ abort();
+ }
+ i = 1;
+ servers[0] = otherservers[0]; /* copy limbo */
+
+ srv = (int *) malloc(nservers * sizeof(int));
+ memset(srv, 0, nservers * sizeof(int));
+
+ /* copy the kept servers */
+ for (j = 1; j < nservers; j++) { /* skip limbo */
+ if (ok_list_old[j] ||
+ otherservers[j].state != SERV_DEAD) {
+ servers[i] = otherservers[j];
+ srv[j] = i;
+ i++;
+ } else {
+ syslog(LOG_INFO, "flushing server %s",
+ otherservers[j].addr_str);
+ server_flush(&otherservers[j]);
+ srv[j] = -1;
}
+
+ }
+ srv_nack_renumber(srv);
+
+ free(srv);
+ free(otherservers);
+ otherservers = servers;
+ nservers = new_num;
}
- /* add any new servers on new list not on old list. */
- new_num = 0;
- for (i = 0; i < num_servers; i++)
- if (!ok_list_new[i])
- new_num++;
- /* new_num is number of extras. */
- nservers += new_num;
- otherservers = (ZServerDesc_t *)realloc((caddr_t) otherservers, (unsigned) (nservers * sizeof(ZServerDesc_t)));
- if (!otherservers) {
- syslog(LOG_CRIT, "server_reset realloc");
- abort();
+ }
+
+ /* add any new servers on new list not on old list. */
+ new_num = 0;
+ for (i = 0; i < num_servers; i++) {
+ if (!ok_list_new[i])
+ new_num++;
+ }
+
+ /* new_num is number of extras. */
+ nservers += new_num;
+ otherservers = (Server *) realloc(otherservers, nservers * sizeof(Server));
+ if (!otherservers) {
+ syslog(LOG_CRIT, "server_reset realloc");
+ abort();
+ }
+
+ me_server_idx = 0;
+ for (j = 1; j < nservers - new_num; j++) {
+ if (otherservers[j].addr.sin_addr.s_addr == my_addr.s_addr) {
+ me_server_idx = j;
+ break;
}
+ }
+ if (!me_server_idx) {
+ syslog(LOG_CRIT, "can't find myself");
+ abort();
+ }
- me_server_idx = 0;
- for (j = 1; j < nservers - new_num; j++)
- if (otherservers[j].zs_addr.sin_addr.s_addr ==
- my_addr.s_addr) {
- me_server_idx = j;
- break;
- }
- if (!me_server_idx) {
- syslog(LOG_CRIT, "can't find myself");
- abort();
+ /* fill in otherservers with the new servers */
+ for (i = 0; i < num_servers; i++) {
+ if (!ok_list_new[i]) {
+ setup_server(&otherservers[nservers - (new_num--)],
+ &server_addrs[i]);
+ syslog(LOG_INFO, "adding server %s", inet_ntoa(server_addrs[i]));
}
-
- /* fill in otherservers with the new servers */
- for (i = 0; i < num_servers; i++)
- if (!ok_list_new[i]) {
- setup_server(&otherservers[nservers - (new_num--)],
- &server_addrs[i]);
- syslog(LOG_INFO, "adding server %s",
- inet_ntoa(server_addrs[i]));
- }
- xfree(server_addrs);
- /* reset timers, to go off now.
- We can't get a time-left indication (bleagh!)
- so we expire them all now. This will generally
- be non-destructive. We assume that when this code is
- entered via a SIGHUP trigger that a system wizard
- is watching the goings-on to make sure things straighten
- themselves out.
- */
- for (i = 1; i < nservers; i++) /* skip limbo */
- if (i != me_server_idx && !otherservers[i].zs_timer) {
- otherservers[i].zs_timer =
- timer_set_rel(0L, server_timo,
- (void *) &otherservers[i]);
+ }
+
+ free(server_addrs);
+ /* reset timers, to go off now.
+ We can't get a time-left indication (bleagh!)
+ so we expire them all now. This will generally
+ be non-destructive. We assume that when this code is
+ entered via a SIGHUP trigger that a system wizard
+ is watching the goings-on to make sure things straighten
+ themselves out.
+ */
+ for (i = 1; i < nservers; i++) { /* skip limbo */
+ if (i != me_server_idx && !otherservers[i].timer) {
+ otherservers[i].timer =
+ timer_set_rel(0L, server_timo, &otherservers[i]);
#if 0
- zdbug((LOG_DEBUG, "reset timer for %s",
- otherservers[i].addr));
-#endif
- }
- xfree(ok_list_old);
- xfree(ok_list_new);
+ zdbug((LOG_DEBUG, "reset timer for %s",
+ otherservers[i].addr_str));
+#endif
+ }
+ }
+ free(ok_list_old);
+ free(ok_list_new);
#if 0
- zdbug((LOG_DEBUG, "server_reset: %d servers now", nservers));
+ zdbug((LOG_DEBUG, "server_reset: %d servers now", nservers));
#endif
- return;
}
/* note: these must match the order given in zserver.h */
static char *
srv_states[] = {
- "SERV_UP",
- "SERV_TARDY",
- "SERV_DEAD",
- "SERV_STARTING"
+ "SERV_UP",
+ "SERV_TARDY",
+ "SERV_DEAD",
+ "SERV_STARTING"
};
/*
@@ -453,58 +431,53 @@ srv_states[] = {
*/
void
-#ifdef __STDC__
-server_timo(void* arg)
-#else
server_timo(arg)
- void* arg;
-#endif
+ void *arg;
{
- ZServerDesc_t *which = (ZServerDesc_t *) arg;
- int auth = 0;
+ Server *which = (Server *) arg;
+ int auth = 0;
#if 0
- zdbug((LOG_DEBUG,"srv_timo: %s", which->addr));
+ zdbug((LOG_DEBUG,"srv_timo: %s", which->addr_str));
#endif
- /* change state and reset if appropriate */
- switch(which->zs_state) {
- case SERV_DEAD: /* leave him dead */
- server_flush(which);
- auth = 1;
- break;
- case SERV_UP: /* he's now tardy */
- which->zs_state = SERV_TARDY;
- which->zs_numsent = 0;
- which->zs_timeout = timo_tardy;
- auth = 0;
- break;
- case SERV_TARDY:
- case SERV_STARTING:
- if (which->zs_numsent >= ((which->zs_state == SERV_TARDY) ?
- H_NUM_TARDY :
- H_NUM_STARTING)) {
- /* he hasn't answered, assume DEAD */
- which->zs_state = SERV_DEAD;
- which->zs_numsent = 0;
- which->zs_timeout = timo_dead;
- server_lost(which);
- }
- auth = 0;
- break;
- default:
- syslog(LOG_ERR,"Bad server state, server 0x%x\n",which);
- abort();
+ /* change state and reset if appropriate */
+ switch(which->state) {
+ case SERV_DEAD: /* leave him dead */
+ server_flush(which);
+ auth = 1;
+ break;
+ case SERV_UP: /* he's now tardy */
+ which->state = SERV_TARDY;
+ which->num_hello_sent = 0;
+ which->timeout = timo_tardy;
+ auth = 0;
+ break;
+ case SERV_TARDY:
+ case SERV_STARTING:
+ if (which->num_hello_sent >= ((which->state == SERV_TARDY) ?
+ H_NUM_TARDY :
+ H_NUM_STARTING)) {
+ /* he hasn't answered, assume DEAD */
+ which->state = SERV_DEAD;
+ which->num_hello_sent = 0;
+ which->timeout = timo_dead;
+ srv_nack_release(which);
}
- /* now he's either TARDY, STARTING, or DEAD
- We send a "hello," which increments the counter */
+ auth = 0;
+ break;
+ default:
+ syslog(LOG_ERR,"Bad server state, server 0x%x\n",which);
+ abort();
+ }
+ /* now he's either TARDY, STARTING, or DEAD
+ We send a "hello," which increments the counter */
#if 0
- zdbug((LOG_DEBUG, "srv %s is %s", which->addr,
- srv_states[(int) which->zs_state]));
+ zdbug((LOG_DEBUG, "srv %s is %s", which->addr_str,
+ srv_states[which->state]));
#endif
- server_hello(which, auth);
- /* reschedule the timer */
- which->zs_timer = timer_set_rel(which->zs_timeout, server_timo,
- (void *) which);
+ server_hello(which, auth);
+ /* reschedule the timer */
+ which->timer = timer_set_rel(which->timeout, server_timo, which);
}
/*
@@ -514,67 +487,64 @@ server_timo(arg)
/*ARGSUSED*/
Code_t
server_dispatch(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
{
- ZServerDesc_t *server;
- struct sockaddr_in newwho;
- Code_t status;
- ZSTRING *notice_class;
-
+ Server *server;
+ struct sockaddr_in newwho;
+ Code_t status;
+ String *notice_class;
#if 0
- zdbug((LOG_DEBUG, "server_dispatch"));
+ zdbug((LOG_DEBUG, "server_dispatch"));
#endif
- if (notice->z_kind == SERVACK) {
- srv_nack_cancel(notice, who);
- srv_responded(who);
- return(ZERR_NONE);
- }
- /* set up a who for the real origin */
- (void) memset((caddr_t) &newwho, 0, sizeof(newwho));
- newwho.sin_family = AF_INET;
- newwho.sin_addr.s_addr = notice->z_sender_addr.s_addr;
- newwho.sin_port = notice->z_port;
-
- server = server_which_server(who);
-
- /* we can dispatch to routines safely here, since they will
- return ZSRV_REQUEUE if appropriate. We bounce this back
- to the caller, and the caller will re-queue the message
- for us to process later. */
-
- notice_class = make_zstring(notice->z_class,1);
-
- if (class_is_admin(notice_class)) {
- /* admins don't get acked, else we get a packet loop */
- /* will return requeue if bdump request and dumping */
- i_s_admins.val++;
- return(admin_dispatch(notice, auth, who, server));
- } else if (class_is_control(notice_class)) {
- status = control_dispatch(notice, auth, &newwho, server);
- i_s_ctls.val++;
- }
- else if (class_is_ulogin(notice_class)) {
- status = ulogin_dispatch(notice, auth, &newwho, server);
- i_s_logins.val++;
- }
- else if (class_is_ulocate(notice_class)) {
- status = ulocate_dispatch(notice, auth, &newwho, server);
- i_s_locates.val++;
- }
- else {
- /* shouldn't come from another server */
- syslog(LOG_WARNING, "srv_disp: pkt cls %s",
- notice->z_class);
- status = ZERR_NONE; /* XXX */
- }
- if (status != ZSRV_REQUEUE)
- ack(notice, who); /* acknowledge it if processed */
- free_zstring(notice_class);
- return(status);
+ if (notice->z_kind == SERVACK) {
+ srv_nack_cancel(notice, who);
+ srv_responded(who);
+ return ZERR_NONE;
+ }
+ /* set up a who for the real origin */
+ memset(&newwho, 0, sizeof(newwho));
+ newwho.sin_family = AF_INET;
+ newwho.sin_addr.s_addr = notice->z_sender_addr.s_addr;
+ newwho.sin_port = notice->z_port;
+
+ server = server_which_server(who);
+
+ /* we can dispatch to routines safely here, since they will
+ return ZSRV_REQUEUE if appropriate. We bounce this back
+ to the caller, and the caller will re-queue the message
+ for us to process later. */
+
+ notice_class = make_string(notice->z_class, 1);
+
+ if (realm_which_realm(&newwho))
+ status = realm_dispatch(notice, auth, &newwho, server);
+ else if (class_is_admin(notice_class)) {
+ /* admins don't get acked, else we get a packet loop */
+ /* will return requeue if bdump request and dumping */
+ i_s_admins.val++;
+ return admin_dispatch(notice, auth, who, server);
+ } else if (class_is_control(notice_class)) {
+ status = control_dispatch(notice, auth, &newwho, server);
+ i_s_ctls.val++;
+ } else if (class_is_ulogin(notice_class)) {
+ status = ulogin_dispatch(notice, auth, &newwho, server);
+ i_s_logins.val++;
+ } else if (class_is_ulocate(notice_class)) {
+ status = ulocate_dispatch(notice, auth, &newwho, server);
+ i_s_locates.val++;
+ } else {
+ /* shouldn't come from another server */
+ syslog(LOG_WARNING, "srv_disp: pkt cls %s", notice->z_class);
+ status = ZERR_NONE; /* XXX */
+ }
+ if (status != ZSRV_REQUEUE)
+ ack(notice, who); /* acknowledge it if processed */
+ free_string(notice_class);
+ return status;
}
#ifdef notdef
@@ -585,165 +555,120 @@ server_dispatch(notice, auth, who)
/*ARGSUSED*/
static Code_t
server_register(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
{
- ZServerDesc_t *temp;
- register int i;
- long timerval;
+ Server *temp;
+ int i;
+ long timerval;
- if (who->sin_port != sock_sin.sin_port) {
+ if (who->sin_port != srv_addr.sin_port) {
#if 0
- zdbug((LOG_DEBUG, "srv_register wrong port %d",
- ntohs(who->sin_port)));
+ zdbug((LOG_DEBUG, "srv_wrong port %d", ntohs(who->sin_port)));
#endif
- return 1;
- }
- /* Not yet... talk to ken about authenticators */
+ return 1;
+ }
+ /* Not yet... talk to ken about authenticators */
#ifdef notdef
- if (!auth) {
+ if (!auth) {
#if 0
- zdbug((LOG_DEBUG, "srv_register unauth"));
+ zdbug((LOG_DEBUG, "srv_unauth"));
#endif
- return 1;
- }
+ return 1;
+ }
#endif /* notdef */
- /* OK, go ahead and set him up. */
- temp = (ZServerDesc_t *)xmalloc((unsigned) ((nservers + 1) * sizeof(ZServerDesc_t)));
- if (!temp) {
- syslog(LOG_CRIT, "srv_reg malloc");
- return 1;
- }
+ /* OK, go ahead and set him up. */
+ temp = (Server *) malloc((nservers + 1) * sizeof(Server));
+ if (!temp) {
+ syslog(LOG_CRIT, "srv_reg malloc");
+ return 1;
+ }
- START_CRITICAL_CODE;
-
- (void) memcpy((caddr_t) temp, (caddr_t) otherservers,
- nservers * sizeof(ZServerDesc_t));
- xfree(otherservers);
- otherservers = temp;
- /* don't reschedule limbo's timer, so start i=1 */
- for (i = 1; i < nservers; i++) {
- if (i == me_server_idx) /* don't reset myself */
- continue;
- /* reschedule the timers--we moved otherservers */
- timerval = timer_when(otherservers[i].zs_timer);
- timer_reset(otherservers[i].zs_timer);
- otherservers[i].zs_timer = timer_set_abs(timerval, server_timo, (caddr_t) &otherservers[i]);
- }
- setup_server(&otherservers[nservers], &who->sin_addr);
- otherservers[nservers].zs_state = SERV_STARTING;
- otherservers[nservers].zs_timeout = timo_tardy;
- otherservers[nservers].zs_update_queue = NULLZSPT;
- otherservers[nservers].zs_dumping = 0;
+ memcpy(temp, otherservers, nservers * sizeof(Server));
+ free(otherservers);
+ otherservers = temp;
+ /* don't reschedule limbo's timer, so start i=1 */
+ for (i = 1; i < nservers; i++) {
+ if (i == me_server_idx) /* don't reset myself */
+ continue;
+ /* reschedule the timers--we moved otherservers */
+ timerval = timer_when(otherservers[i].timer);
+ timer_reset(otherservers[i].timer);
+ otherservers[i].timer = timer_set_abs(timerval, server_timo,
+ &otherservers[i]);
+ }
+ setup_server(&otherservers[nservers], &who->sin_addr);
+ otherservers[nservers].state = SERV_STARTING;
+ otherservers[nservers].timeout = timo_tardy;
+ otherservers[nservers].update_queue = NULL;
+ otherservers[nservers].dumping = 0;
- nservers++;
+ nservers++;
#if 0
- zdbug((LOG_DEBUG, "srv %s is %s", otherservers[nservers].addr,
- srv_states[(int) otherservers[nservers].zs_state]));
+ zdbug((LOG_DEBUG, "srv %s is %s", otherservers[nservers].addr_str,
+ srv_states[otherservers[nservers].state]));
#endif
- END_CRITICAL_CODE;
-
- return 0;
+ return 0;
}
#endif
/*
- * Recover a host whose client has stopped responding.
- * The hostm_ module takes care of pings, timeouts, etc.
- */
-
-void
-server_recover(client)
- ZClient_t *client;
-{
- ZServerDesc_t *server;
- char *lyst[2];
- char buf[512];
-
-#if 0
- zdbug((LOG_DEBUG,"server recover"));
-#endif
- if ((server = hostm_find_server(&client->zct_sin.sin_addr)) !=
- NULLZSDT) {
- if (server == limbo_server) {
-#if 0
- zdbug((LOG_DEBUG, "no server to recover"));
-#endif
- return;
- } else if (server == me_server) {
- /* send a ping, set up a timeout, and return */
- hostm_losing(client, hostm_find_host(&client->zct_sin.sin_addr));
- return;
- } else {
- /* some other server */
- lyst[0] = inet_ntoa(client->zct_sin.sin_addr);
- (void) sprintf(buf, "%d", ntohs(client->zct_sin.sin_port));
- lyst[1] = buf;
- send_msg_list(&server->zs_addr, ADMIN_LOST_CLT,
- lyst, 2, 0, server - otherservers);
- return;
- }
- } else
- syslog(LOG_ERR, "srv_recover: no host for client");
- return;
-}
-
-/*
* Tell the other servers that this client died.
*/
void
server_kill_clt(client)
- ZClient_t *client;
+ Client *client;
{
- register int i;
- char buf[512], *lyst[2];
- ZNotice_t notice;
- register ZNotice_t *pnotice; /* speed hack */
- caddr_t pack;
- int packlen, auth;
- Code_t retval;
-
- lyst[0] = inet_ntoa(client->zct_sin.sin_addr),
- (void) sprintf(buf, "%d", ntohs(client->zct_sin.sin_port));
- lyst[1] = buf;
+ int i;
+ char buf[512], *lyst[2];
+ ZNotice_t notice;
+ ZNotice_t *pnotice; /* speed hack */
+ caddr_t pack;
+ int packlen, auth;
+ Code_t retval;
+
+ lyst[0] = inet_ntoa(client->addr.sin_addr),
+ sprintf(buf, "%d", ntohs(client->addr.sin_port));
+ lyst[1] = buf;
#if 0
- zdbug((LOG_DEBUG, "server kill clt %s/%s", lyst[0], lyst[1]));
+ zdbug((LOG_DEBUG, "server kill clt %s/%s", lyst[0], lyst[1]));
#endif
- pnotice = &notice;
+ pnotice = &notice;
- pnotice->z_kind = ACKED;
+ pnotice->z_kind = ACKED;
- pnotice->z_port = sock_sin.sin_port;
- pnotice->z_class = ZEPHYR_ADMIN_CLASS;
- pnotice->z_class_inst = "";
- pnotice->z_opcode = ADMIN_KILL_CLT;
- pnotice->z_sender = myname; /* myname is the hostname */
- pnotice->z_recipient = "";
- pnotice->z_default_format = "";
- pnotice->z_num_other_fields = 0;
+ pnotice->z_port = srv_addr.sin_port;
+ pnotice->z_class = ZEPHYR_ADMIN_CLASS;
+ pnotice->z_class_inst = "";
+ pnotice->z_opcode = ADMIN_KILL_CLT;
+ pnotice->z_sender = myname; /* myname is the hostname */
+ pnotice->z_recipient = "";
+ pnotice->z_default_format = "";
+ pnotice->z_num_other_fields = 0;
- /* XXX */
- auth = 0;
+ /* XXX */
+ auth = 0;
- /* don't tell limbo to flush, start at 1*/
- for (i = 1; i < nservers; i++) {
- if (i == me_server_idx) /* don't xmit to myself */
- continue;
- if (otherservers[i].zs_state == SERV_DEAD)
- continue;
-
- if ((retval = ZFormatNoticeList(pnotice, lyst, 2, &pack, &packlen, auth ? ZAUTH : ZNOAUTH)) != ZERR_NONE) {
- syslog(LOG_WARNING, "kill_clt format: %s",
- error_message(retval));
- return;
- }
- server_forw_reliable(&otherservers[i], pack, packlen, pnotice);
+ /* don't tell limbo to flush, start at 1*/
+ for (i = 1; i < nservers; i++) {
+ if (i == me_server_idx) /* don't xmit to myself */
+ continue;
+ if (otherservers[i].state == SERV_DEAD)
+ continue;
+
+ retval = ZFormatNoticeList(pnotice, lyst, 2, &pack, &packlen,
+ auth ? ZAUTH : ZNOAUTH);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "kill_clt format: %s", error_message(retval));
+ return;
}
+ server_forw_reliable(&otherservers[i], pack, packlen, pnotice);
+ }
}
/*
@@ -752,76 +677,34 @@ server_kill_clt(client)
static Code_t
kill_clt(notice, server)
- ZNotice_t *notice;
- ZServerDesc_t *server;
+ ZNotice_t *notice;
+ Server *server;
{
- struct sockaddr_in who;
- ZHostList_t *host;
- ZClient_t *client;
+ struct sockaddr_in who;
+ Client *client;
#if 0
- zdbug((LOG_DEBUG, "kill_clt"));
+ zdbug((LOG_DEBUG, "kill_clt"));
#endif
- if (extract_addr(notice, &who) != ZERR_NONE)
- return(ZERR_NONE); /* XXX */
- if (!(host = hostm_find_host(&who.sin_addr))) {
- syslog(LOG_NOTICE, "kill_clt: no such host (%s, from %s)",
- inet_ntoa (who.sin_addr), server->addr);
- return(ZERR_NONE); /* XXX */
- }
- if (host->zh_locked)
- return(ZSRV_REQUEUE);
- if (!(client = client_which_client(&who, notice))) {
- syslog(LOG_NOTICE, "kill_clt: no such client (%s/%d) from %s",
- inet_ntoa (who.sin_addr), ntohs (who.sin_port),
- server->addr);
- return(ZERR_NONE); /* XXX */
- }
-#if 0
- if (zdebug || 1)
- syslog(LOG_DEBUG, "kill_clt clt_dereg %s/%d from %s",
- inet_ntoa (who.sin_addr), ntohs (who.sin_port),
- server->addr);
+ if (extract_addr(notice, &who) != ZERR_NONE)
+ return ZERR_NONE; /* XXX */
+ client = client_which_client(&who.sin_addr, notice);
+ if (!client) {
+ syslog(LOG_NOTICE, "kill_clt: no such client (%s/%d) from %s",
+ inet_ntoa(who.sin_addr), ntohs(who.sin_port),
+ server->addr_str);
+ return ZERR_NONE; /* XXX */
+ }
+#if 1
+ if (zdebug || 1) {
+ syslog(LOG_DEBUG, "kill_clt clt_dereg %s/%d from %s",
+ inet_ntoa(who.sin_addr), ntohs(who.sin_port), server->addr_str);
+ }
#endif
- hostm_lose_ignore(client);
- /* remove the locations, too */
- client_deregister(client, host, 1);
- return(ZERR_NONE);
-}
-
-/*
- * Another server asked us to initiate recovery protocol with the hostmanager
- */
-static Code_t
-recover_clt(notice, server)
- register ZNotice_t *notice;
- ZServerDesc_t *server;
-{
- struct sockaddr_in who;
- ZClient_t *client;
- ZHostList_t *host;
- Code_t status;
-
- if ((status = extract_addr(notice, &who)) != ZERR_NONE)
- return(status);
- if (!(host = hostm_find_host(&who.sin_addr))) {
- syslog(LOG_NOTICE,
- "recover_clt: host not found (%s, from %s)",
- inet_ntoa (who.sin_addr), server->addr);
- return(ZERR_NONE); /* XXX */
- }
- if (host->zh_locked)
- return(ZSRV_REQUEUE);
- if (!(client = client_which_client(&who, notice))) {
- syslog(LOG_NOTICE,
- "recover_clt: client not found (%s/%d, from %s)",
- inet_ntoa (who.sin_addr), ntohs (who.sin_port),
- server->addr);
- return(ZERR_NONE); /* XXX */
- }
- hostm_losing(client, host);
- return(ZERR_NONE);
+ /* remove the locations, too */
+ client_deregister(client, 1);
+ return ZERR_NONE;
}
/*
@@ -830,29 +713,29 @@ recover_clt(notice, server)
static Code_t
extract_addr(notice, who)
- ZNotice_t *notice;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
{
- register char *cp = notice->z_message;
+ char *cp = notice->z_message;
- if (!notice->z_message_len) {
- syslog(LOG_WARNING, "bad addr pkt");
- return(ZSRV_PKSHORT);
- }
- who->sin_addr.s_addr = inet_addr(notice->z_message);
+ if (!notice->z_message_len) {
+ syslog(LOG_WARNING, "bad addr pkt");
+ return ZSRV_PKSHORT;
+ }
+ who->sin_addr.s_addr = inet_addr(notice->z_message);
- cp += strlen(cp) + 1;
- if (cp >= notice->z_message + notice->z_message_len) {
- syslog(LOG_WARNING, "short addr pkt");
- return(ZSRV_PKSHORT);
- }
- who->sin_port = notice->z_port = htons((u_short) atoi(cp));
- who->sin_family = AF_INET;
+ cp += strlen(cp) + 1;
+ if (cp >= notice->z_message + notice->z_message_len) {
+ syslog(LOG_WARNING, "short addr pkt");
+ return ZSRV_PKSHORT;
+ }
+ who->sin_port = notice->z_port = htons((u_short) atoi(cp));
+ who->sin_family = AF_INET;
#if 0
- zdbug((LOG_DEBUG,"ext %s/%d", inet_ntoa(who->sin_addr),
- ntohs(who->sin_port)));
+ zdbug((LOG_DEBUG,"ext %s/%d", inet_ntoa(who->sin_addr),
+ ntohs(who->sin_port)));
#endif
- return(ZERR_NONE);
+ return ZERR_NONE;
}
/*
@@ -861,29 +744,13 @@ extract_addr(notice, who)
static void
server_flush(which)
- register ZServerDesc_t *which;
+ Server *which;
{
- register ZHostList_t *hst;
-
#if 0
- if (zdebug)
- syslog (LOG_DEBUG, "server_flush %s", which->addr);
+ if (zdebug)
+ syslog(LOG_DEBUG, "server_flush %s", which->addr_str);
#endif
- if (!which->zs_hosts) /* no data to flush */
- return;
-
- for (hst = which->zs_hosts->q_forw;
- hst != which->zs_hosts;
- hst = which->zs_hosts->q_forw) {
- /* for each host, flush all data */
-#if 0
- if (zdebug)
- syslog (LOG_DEBUG, "... host %s",
- inet_ntoa (hst->zh_addr.sin_addr));
-#endif
- hostm_flush(hst, which);
- }
- srv_nack_release(which);
+ srv_nack_release(which);
}
/*
@@ -891,14 +758,13 @@ server_flush(which)
* Authenticate if auth is set.
*/
-STATIC void
+static void
server_hello(which, auth)
- ZServerDesc_t *which;
- int auth;
+ Server *which;
+ int auth;
{
- send_msg(&which->zs_addr, ADMIN_HELLO, auth);
- (which->zs_numsent)++;
- return;
+ send_msg(&which->addr, ADMIN_HELLO, auth);
+ which->num_hello_sent++;
}
/*
@@ -908,83 +774,54 @@ server_hello(which, auth)
/*ARGSUSED*/
static Code_t
admin_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
{
- register char *opcode = notice->z_opcode;
- Code_t status = ZERR_NONE;
+ char *opcode = notice->z_opcode;
+ Code_t status = ZERR_NONE;
#if 0
- zdbug((LOG_DEBUG, "ADMIN received"));
+ zdbug((LOG_DEBUG, "ADMIN received"));
#endif
- if (!strcmp(opcode, ADMIN_HELLO)) {
- hello_respond(who, ADJUST, auth);
- } else if (!strcmp(opcode, ADMIN_IMHERE)) {
- srv_responded(who);
- } else if (!strcmp(opcode, ADMIN_SHUTDOWN)) {
+ if (strcmp(opcode, ADMIN_HELLO) == 0) {
+ hello_respond(who, ADJUST, auth);
+ } else if (strcmp(opcode, ADMIN_IMHERE) == 0) {
+ srv_responded(who);
+ } else if (strcmp(opcode, ADMIN_SHUTDOWN) == 0) {
#if 0
- zdbug((LOG_DEBUG, "server shutdown"));
+ zdbug((LOG_DEBUG, "server shutdown"));
#endif
- /* we need to transfer all of its hosts to limbo */
- if (server) {
- server_lost(server);
- server->zs_state = SERV_DEAD;
- server->zs_timeout = timo_dead;
- /* don't worry about the timer, it will
- be set appropriately on the next send */
+ if (server) {
+ srv_nack_release(server);
+ server->state = SERV_DEAD;
+ server->timeout = timo_dead;
+ /* don't worry about the timer, it will
+ be set appropriately on the next send */
#if 0
- zdbug((LOG_DEBUG, "srv %s is %s", server->addr,
- srv_states[(int) server->zs_state]));
+ zdbug((LOG_DEBUG, "srv %s is %s", server->addr_str,
+ srv_states[server->state]));
#endif
}
- } else if (!strcmp(opcode, ADMIN_BDUMP)) {
-#ifdef CONCURRENT
-#if 0 /* If another dump is in progress, it'll likely not
- finish in time for us to catch the server's
- bdump-waiting period. So don't bother. */
- if (bdumping)
- return(ZSRV_REQUEUE);
-#else
- if (bdumping)
- return ZERR_NONE;
-#endif
-#endif
- bdump_get(notice, auth, who, server);
- } else if (!strcmp(opcode, ADMIN_LOST_CLT)) {
- status = recover_clt(notice, server);
- if (status == ZERR_NONE)
- ack(notice, who);
- } else if (!strcmp(opcode, ADMIN_KILL_CLT)) {
- status = kill_clt(notice, server);
- if (status == ZERR_NONE)
- ack(notice, who);
- } else
- syslog(LOG_WARNING, "ADMIN unknown opcode %s",opcode);
- return(status);
+ } else if (strcmp(opcode, ADMIN_BDUMP) == 0) {
+ /* Ignore a brain dump request if this is a brain dump packet
+ * or a packet being processed concurrently during a brain
+ * dump. */
+ if (bdumping || bdump_concurrent)
+ return ZERR_NONE;
+ bdump_get(notice, auth, who, server);
+ } else if (strcmp(opcode, ADMIN_KILL_CLT) == 0) {
+ status = kill_clt(notice, server);
+ if (status == ZERR_NONE)
+ ack(notice, who);
+ } else {
+ syslog(LOG_WARNING, "ADMIN unknown opcode %s",opcode);
+ }
+ return status;
}
-/*
- * Transfer all the hosts on server to limbo
- */
-
-static void
-server_lost(server)
- ZServerDesc_t *server;
-{
- register ZHostList_t *host, *hishost;
-
- hishost = server->zs_hosts;
- for (host = hishost->q_forw;
- host != hishost;
- host = hishost->q_forw)
- /* hostm transfer remque's the host and
- attaches it to the new server */
- hostm_transfer(host, limbo_server);
- srv_nack_release(server);
-}
/*
* Handle an ADMIN message from some random client.
@@ -995,130 +832,131 @@ server_lost(server)
/*ARGSUSED*/
Code_t
server_adispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
{
- /* this had better be a HELLO message--start of acquisition
- protocol, OR a status req packet */
+ /* this had better be a HELLO message--start of acquisition
+ protocol, OR a status req packet */
+
+ if (strcmp(notice->z_opcode, ADMIN_STATUS) == 0) {
+ /* status packet */
+ send_stats(who);
+ return ZERR_NONE;
+ }
- if (!strcmp(notice->z_opcode, ADMIN_STATUS)) {
- /* status packet */
- send_stats(who);
- return(ZERR_NONE);
- }
#ifdef notdef
- syslog(LOG_INFO, "disp: new server?");
- if (server_register(notice, auth, who) != ZERR_NONE)
- syslog(LOG_INFO, "new server failed");
- else {
- syslog(LOG_INFO, "new server %s, %d",
- inet_ntoa(who->sin_addr),
- ntohs(who->sin_port));
- hello_respond(who, DONT_ADJUST, auth);
- }
+ syslog(LOG_INFO, "disp: new server?");
+ if (server_register(notice, auth, who) != ZERR_NONE) {
+ syslog(LOG_INFO, "new server failed");
+ } else {
+ syslog(LOG_INFO, "new server %s, %d", inet_ntoa(who->sin_addr),
+ ntohs(who->sin_port));
+ hello_respond(who, DONT_ADJUST, auth);
+ }
#else
- syslog(LOG_INFO, "srv_adisp: server attempt from %s",
- inet_ntoa(who->sin_addr));
+ syslog(LOG_INFO, "srv_adisp: server attempt from %s",
+ inet_ntoa(who->sin_addr));
#endif /* notdef */
- return(ZERR_NONE);
+
+ return ZERR_NONE;
}
static void
send_stats(who)
- struct sockaddr_in *who;
+ struct sockaddr_in *who;
{
- register int i;
- char buf[BUFSIZ];
- char **responses;
- int num_resp;
- char *vers, *pkts, *upt;
+ int i;
+ char buf[BUFSIZ];
+ char **responses;
+ int num_resp;
+ char *vers, *pkts, *upt;
#if defined(OLD_COMPAT) || defined(NEW_COMPAT)
- int extrafields = 0;
+ int extrafields = 0;
#endif /* OLD_ or NEW_COMPAT */
#define NUM_FIXED 3 /* 3 fixed fields, plus server info */
/* well, not really...but for
backward compatibility, we gotta
do it this way. */
- vers = get_version();
+ vers = get_version();
- (void) sprintf(buf, "%d pkts", npackets);
- pkts = strsave(buf);
- (void) sprintf(buf, "%d seconds operational",NOW - uptime);
- upt = strsave(buf);
+ sprintf(buf, "%d pkts", npackets);
+ pkts = strsave(buf);
+ sprintf(buf, "%d seconds operational",NOW - uptime);
+ upt = strsave(buf);
#ifdef OLD_COMPAT
- if (old_compat_count_uloc) extrafields++;
- if (old_compat_count_ulocate) extrafields++;
- if (old_compat_count_subscr) extrafields++;
+ if (old_compat_count_uloc)
+ extrafields++;
+ if (old_compat_count_ulocate)
+ extrafields++;
+ if (old_compat_count_subscr)
+ extrafields++;
#endif /* OLD_COMPAT */
#ifdef NEW_COMPAT
- if (new_compat_count_uloc) extrafields++;
- if (new_compat_count_subscr) extrafields++;
+ if (new_compat_count_uloc)
+ extrafields++;
+ if (new_compat_count_subscr)
+ extrafields++;
#endif /* NEW_COMPAT */
#if defined(OLD_COMPAT) || defined(NEW_COMPAT)
- responses = (char **) xmalloc((NUM_FIXED + nservers + extrafields) *
- sizeof(char **));
+ responses = (char **) malloc((NUM_FIXED + nservers + extrafields) *
+ sizeof(char *));
#else
- responses = (char **) xmalloc ((NUM_FIXED + nservers) *
- sizeof(char **));
+ responses = (char **) malloc((NUM_FIXED + nservers) * sizeof(char *));
#endif /* OLD_ or NEW_COMPAT */
- responses[0] = vers;
- responses[1] = pkts;
- responses[2] = upt;
-
- num_resp = NUM_FIXED;
- /* start at 1 and ignore limbo */
- for (i = 1; i < nservers ; i++) {
- (void) sprintf(buf, "%s/%s%s", otherservers[i].addr,
- srv_states[(int) otherservers[i].zs_state],
- otherservers[i].zs_dumping ? " (DUMPING)" : "");
- responses[num_resp++] = strsave (buf);
- }
+ responses[0] = vers;
+ responses[1] = pkts;
+ responses[2] = upt;
+
+ num_resp = NUM_FIXED;
+ /* start at 1 and ignore limbo */
+ for (i = 1; i < nservers ; i++) {
+ sprintf(buf, "%s/%s%s", otherservers[i].addr_str,
+ srv_states[(int) otherservers[i].state],
+ otherservers[i].dumping ? " (DUMPING)" : "");
+ responses[num_resp++] = strsave(buf);
+ }
#ifdef OLD_COMPAT
- if (old_compat_count_uloc) {
- (void) sprintf(buf, "%d old old location requests",
- old_compat_count_uloc);
- responses[num_resp++] = strsave (buf);
- }
- if (old_compat_count_ulocate) {
- (void) sprintf(buf, "%d old old loc lookup requests",
- old_compat_count_ulocate);
- responses[num_resp++] = strsave (buf);
- }
- if (old_compat_count_subscr) {
- (void) sprintf(buf, "%d old old subscr requests",
- old_compat_count_subscr);
- responses[num_resp++] = strsave (buf);
- }
+ if (old_compat_count_uloc) {
+ sprintf(buf, "%d old old location requests", old_compat_count_uloc);
+ responses[num_resp++] = strsave(buf);
+ }
+ if (old_compat_count_ulocate) {
+ sprintf(buf, "%d old old loc lookup requests",
+ old_compat_count_ulocate);
+ responses[num_resp++] = strsave(buf);
+ }
+ if (old_compat_count_subscr) {
+ sprintf(buf, "%d old old subscr requests", old_compat_count_subscr);
+ responses[num_resp++] = strsave(buf);
+ }
#endif /* OLD_COMPAT */
#ifdef NEW_COMPAT
- if (new_compat_count_uloc) {
- (void) sprintf(buf, "%d new old location requests",
- new_compat_count_uloc);
- responses[num_resp++] = strsave (buf);
- }
- if (new_compat_count_subscr) {
- (void) sprintf(buf, "%d new old subscr requests",
- new_compat_count_subscr);
- responses[num_resp++] = strsave (buf);
- }
+ if (new_compat_count_uloc) {
+ sprintf(buf, "%d new old location requests", new_compat_count_uloc);
+ responses[num_resp++] = strsave(buf);
+ }
+ if (new_compat_count_subscr) {
+ sprintf(buf, "%d new old subscr requests", new_compat_count_subscr);
+ responses[num_resp++] = strsave(buf);
+ }
#endif /* NEW_COMPAT */
- send_msg_list(who, ADMIN_STATUS, responses, num_resp, 0, -1);
- /* Start at one; don't try to free static version string */
- for (i = 1; i < num_resp; i++)
- xfree(responses[i]);
- xfree(responses);
- return;
+ send_msg_list(who, ADMIN_STATUS, responses, num_resp, 0);
+
+ /* Start at one; don't try to free static version string */
+ for (i = 1; i < num_resp; i++)
+ free(responses[i]);
+ free(responses);
}
/*
* Get a list of server addresses.
-#ifdef HESIOD
+#ifdef ZEPHYR_USES_HESIOD
* This list is retrieved from Hesiod.
#else
* This list is read from a file.
@@ -1129,46 +967,50 @@ send_stats(who)
static struct in_addr *
get_server_addrs(number)
- int *number; /* RETURN */
+ int *number; /* RETURN */
{
- register int i;
- char **server_hosts;
- register char **cpp;
- struct in_addr *addrs;
- register struct in_addr *addr;
- register struct hostent *hp;
-
-#ifdef HESIOD
- /* get the names from Hesiod */
- if (!(server_hosts = hes_resolve("zephyr","sloc")))
- return((struct in_addr *)NULL);
+ int i;
+ char **server_hosts;
+ char **cpp;
+ struct in_addr *addrs;
+ struct in_addr *addr;
+ struct hostent *hp;
+
+#ifdef ZEPHYR_USES_HESIOD
+ /* get the names from Hesiod */
+ server_hosts = hes_resolve("zephyr","sloc");
+ if (!server_hosts)
+ return NULL;
#else
- if (!(server_hosts = get_server_list(SERVER_LIST_FILE)))
- return((struct in_addr *)NULL);
+ server_hosts = get_server_list(list_file);
+ if (!server_hosts)
+ return NULL;
#endif
- /* count up */
- for (cpp = server_hosts, i = 0; *cpp; cpp++, i++);
+ /* count up */
+ i = 0;
+ for (cpp = server_hosts; *cpp; cpp++)
+ i++;
- addrs = (struct in_addr *) xmalloc(i * sizeof(struct in_addr));
-
- /* Convert to in_addr's */
- for (cpp = server_hosts, addr = addrs, i = 0; *cpp; cpp++) {
- hp = gethostbyname(*cpp);
- if (hp) {
- (void) memcpy((caddr_t) addr, (caddr_t)hp->h_addr,
- sizeof(struct in_addr));
- addr++, i++;
- } else
- syslog(LOG_WARNING, "hostname failed, %s",*cpp);
+ addrs = (struct in_addr *) malloc(i * sizeof(struct in_addr));
+
+ /* Convert to in_addr's */
+ for (cpp = server_hosts, addr = addrs, i = 0; *cpp; cpp++) {
+ hp = gethostbyname(*cpp);
+ if (hp) {
+ memcpy(addr, hp->h_addr, sizeof(struct in_addr));
+ addr++, i++;
+ } else {
+ syslog(LOG_WARNING, "hostname failed, %s", *cpp);
}
- *number = i;
-#ifndef HESIOD
- free_server_list(server_hosts);
+ }
+ *number = i;
+#ifndef ZEPHYR_USES_HESIOD
+ free_server_list(server_hosts);
#endif
- return(addrs);
+ return addrs;
}
-#ifndef HESIOD
+#ifndef ZEPHYR_USES_HESIOD
static int nhosts = 0;
@@ -1179,40 +1021,46 @@ static int nhosts = 0;
static char **
get_server_list(file)
- char *file;
+ char *file;
{
- FILE *fp;
- char buf[MAXHOSTNAMELEN];
- char **ret_list;
- int nused = 0;
- char *newline;
-
- if (!(fp = fopen(file, "r")))
- return((char **)0);
-
- /* start with 16, realloc if necessary */
- nhosts = 16;
- ret_list = (char **)xmalloc(nhosts * sizeof(char *));
-
+ FILE *fp;
+ char buf[MAXHOSTNAMELEN];
+ char **ret_list;
+ int nused = 0;
+ char *newline;
+
+ /* start with 16, realloc if necessary */
+ nhosts = 16;
+ ret_list = (char **) malloc(nhosts * sizeof(char *));
+
+ fp = fopen(file, "r");
+ if (fp) {
while (fgets(buf, MAXHOSTNAMELEN, fp)) {
- /* nuke the newline, being careful not to overrun
- the buffer searching for it with strlen() */
- buf[MAXHOSTNAMELEN - 1] = '\0';
- if (newline = index(buf, '\n'))
- *newline = '\0';
-
- if (nused+1 >= nhosts) {
- /* get more pointer space if necessary */
- /* +1 to leave room for null pointer */
- ret_list = (char **)realloc((char *)ret_list,
- (unsigned) nhosts * 2);
- nhosts = nhosts * 2;
- }
- ret_list[nused++] = strsave (buf);
- }
- (void) fclose(fp);
- ret_list[nused] = (char *)0;
- return(ret_list);
+ /* nuke the newline, being careful not to overrun
+ the buffer searching for it with strlen() */
+ buf[MAXHOSTNAMELEN - 1] = '\0';
+ newline = strchr(buf, '\n');
+ if (newline)
+ *newline = '\0';
+
+ if (nused + 1 >= nhosts) {
+ /* get more pointer space if necessary */
+ /* +1 to leave room for null pointer */
+ ret_list = (char **) realloc(ret_list, nhosts * 2);
+ nhosts = nhosts * 2;
+ }
+ ret_list[nused++] = strsave(buf);
+ }
+ fclose(fp);
+ } else {
+ if (gethostname(buf, sizeof(buf)) < 0) {
+ free(ret_list);
+ return NULL;
+ }
+ ret_list[nused++] = strsave(buf);
+ }
+ ret_list[nused] = NULL;
+ return ret_list;
}
/*
@@ -1220,16 +1068,16 @@ get_server_list(file)
*/
static void
free_server_list(list)
- register char **list;
+ char **list;
{
- char **orig_list = list;
+ char **orig_list = list;
- if (!nhosts) /* nothing allocated */
- return;
- for (; *list; list++)
- xfree(*list);
- xfree(orig_list);
+ if (!nhosts) /* nothing allocated */
return;
+ for (; *list; list++)
+ free(*list);
+ free(orig_list);
+ return;
}
#endif
@@ -1238,37 +1086,22 @@ free_server_list(list)
* to go off immediately to send hello's to other servers.
*/
-STATIC void
+static void
setup_server(server, addr)
- register ZServerDesc_t *server;
- struct in_addr *addr;
+ Server *server;
+ struct in_addr *addr;
{
- register ZHostList_t *host;
-
- server->zs_state = SERV_DEAD;
- server->zs_timeout = timo_dead;
- server->zs_numsent = 0;
- server->zs_addr.sin_family = AF_INET;
- /* he listens to the same port we do */
- server->zs_addr.sin_port = sock_sin.sin_port;
- server->zs_addr.sin_addr = *addr;
- strcpy (server->addr, inet_ntoa (*addr));
-
- /* set up a timer for this server */
- server->zs_timer = timer_set_rel(0L, server_timo, (void *) server);
- host = (ZHostList_t *) xmalloc(sizeof(ZHostList_t));
- if (!host) {
- /* unrecoverable */
- syslog(LOG_CRIT, "zs_host alloc");
- abort();
- }
- host->q_forw = host->q_back = host;
- server->zs_hosts = host;
-
- server->zs_update_queue = NULLZSPT;
- server->zs_dumping = 0;
-
- return;
+ server->state = SERV_DEAD;
+ server->timeout = timo_dead;
+ server->num_hello_sent = 0;
+ server->addr.sin_family = AF_INET;
+ /* he listens to the same port we do */
+ server->addr.sin_port = srv_addr.sin_port;
+ server->addr.sin_addr = *addr;
+ strcpy(server->addr_str, inet_ntoa(*addr));
+ server->timer = timer_set_rel(0L, server_timo, server);
+ server->queue = NULL;
+ server->dumping = 0;
}
/*
@@ -1277,62 +1110,61 @@ setup_server(server, addr)
static void
hello_respond(who, adj, auth)
- struct sockaddr_in *who;
- int adj;
- int auth;
+ struct sockaddr_in *who;
+ int adj;
+ int auth;
{
- register ZServerDesc_t *which;
+ Server *which;
#if 0
- zdbug((LOG_DEBUG, "hello from %s", inet_ntoa(who->sin_addr)));
+ zdbug((LOG_DEBUG, "hello from %s", inet_ntoa(who->sin_addr)));
#endif
- send_msg(who, ADMIN_IMHERE, auth);
- if (adj != ADJUST)
- return;
-
- /* If we think he's down, schedule an immediate HELLO. */
-
- if (!(which = server_which_server(who)))
- return;
-
- switch (which->zs_state) {
- case SERV_DEAD:
- /* he said hello, we thought he was dead.
- reschedule his hello for now. */
- timer_reset(which->zs_timer);
- which->zs_timer = timer_set_rel(0L, server_timo,
- (void *) which);
- break;
- case SERV_STARTING:
- case SERV_TARDY:
- case SERV_UP:
- default:
- break;
- }
+ send_msg(who, ADMIN_IMHERE, auth);
+ if (adj != ADJUST)
+ return;
+
+ /* If we think he's down, schedule an immediate HELLO. */
+
+ which = server_which_server(who);
+ if (!which)
return;
+
+ switch (which->state) {
+ case SERV_DEAD:
+ /* he said hello, we thought he was dead.
+ reschedule his hello for now. */
+ timer_reset(which->timer);
+ which->timer = timer_set_rel(0L, server_timo, which);
+ break;
+ case SERV_STARTING:
+ case SERV_TARDY:
+ case SERV_UP:
+ default:
+ break;
+ }
}
/*
* return the server descriptor for server at who
*/
-ZServerDesc_t *
+Server *
server_which_server(who)
- struct sockaddr_in *who;
+ struct sockaddr_in *who;
{
- register ZServerDesc_t *server;
- register int i;
+ Server *server;
+ int i;
- if (who->sin_port != sock_sin.sin_port)
- return(NULLZSDT);
+ if (who->sin_port != srv_addr.sin_port)
+ return NULL;
- /* don't check limbo */
- for (server = &otherservers[1], i = 1; i < nservers; i++, server++) {
- if (server->zs_addr.sin_addr.s_addr == who->sin_addr.s_addr)
- return(server);
- }
- return(NULLZSDT);
+ /* don't check limbo */
+ for (server = &otherservers[1], i = 1; i < nservers; i++, server++) {
+ if (server->addr.sin_addr.s_addr == who->sin_addr.s_addr)
+ return server;
+ }
+ return NULL;
}
/*
@@ -1341,52 +1173,50 @@ server_which_server(who)
*/
static void
srv_responded(who)
- struct sockaddr_in *who;
+ struct sockaddr_in *who;
{
- register ZServerDesc_t *which = server_which_server(who);
+ Server *which = server_which_server(who);
#if 0
- zdbug((LOG_DEBUG, "srv_responded %s", inet_ntoa(who->sin_addr)));
+ zdbug((LOG_DEBUG, "srv_responded %s", inet_ntoa(who->sin_addr)));
#endif
- if (!which) {
- syslog(LOG_ERR, "hello input from non-server?!");
- return;
- }
+ if (!which) {
+ syslog(LOG_ERR, "hello input from non-server?!");
+ return;
+ }
- switch (which->zs_state) {
- case SERV_DEAD:
- /* he responded, we thought he was dead. mark as starting
- and negotiate */
- which->zs_state = SERV_STARTING;
- which->zs_timeout = timo_tardy;
- timer_reset(which->zs_timer);
- which->zs_timer = timer_set_rel(0L, server_timo,
- (void *) which);
-
- case SERV_STARTING:
- /* here we negotiate and set up a braindump */
- if (bdump_socket < 0) {
- /* XXX offer it to the other server */
- bdump_offer(who);
- }
- break;
- case SERV_TARDY:
- which->zs_state = SERV_UP;
- case SERV_UP:
- /* reset the timer and counts */
- which->zs_numsent = 0;
- which->zs_timeout = timo_up;
- timer_reset(which->zs_timer);
- which->zs_timer = timer_set_rel(which->zs_timeout, server_timo,
- (void *) which);
- break;
- }
+ switch (which->state) {
+ case SERV_DEAD:
+ /* he responded, we thought he was dead. mark as starting
+ and negotiate */
+ which->state = SERV_STARTING;
+ which->timeout = timo_tardy;
+ timer_reset(which->timer);
+ which->timer = timer_set_rel(0L, server_timo, which);
+
+ case SERV_STARTING:
+ /* here we negotiate and set up a braindump */
+ if (bdump_socket < 0)
+ bdump_offer(who);
+ break;
+
+ case SERV_TARDY:
+ which->state = SERV_UP;
+ /* Fall through. */
+
+ case SERV_UP:
+ /* reset the timer and counts */
+ which->num_hello_sent = 0;
+ which->timeout = timo_up;
+ timer_reset(which->timer);
+ which->timer = timer_set_rel(which->timeout, server_timo, which);
+ break;
+ }
#if 0
- zdbug((LOG_DEBUG, "srv %s is %s", which->addr,
- srv_states[(int) which->zs_state]));
+ zdbug((LOG_DEBUG, "srv %s is %s", which->addr_str,
+ srv_states[which->state]));
#endif
- return;
}
/*
@@ -1396,13 +1226,11 @@ srv_responded(who)
void
server_shutdown()
{
- register int i;
+ int i;
- /* don't tell limbo to go away, start at 1*/
- for (i = 1; i < nservers; i++) {
- send_msg(&otherservers[i].zs_addr, ADMIN_SHUTDOWN, 1);
- }
- return;
+ /* don't tell limbo to go away, start at 1*/
+ for (i = 1; i < nservers; i++)
+ send_msg(&otherservers[i].addr, ADMIN_SHUTDOWN, 1);
}
/*
@@ -1412,54 +1240,50 @@ server_shutdown()
static void
send_msg(who, opcode, auth)
- struct sockaddr_in *who;
- char *opcode;
- int auth;
+ struct sockaddr_in *who;
+ char *opcode;
+ int auth;
{
- ZNotice_t notice;
- register ZNotice_t *pnotice; /* speed hack */
- char *pack;
- int packlen;
- Code_t retval;
-
- pnotice = &notice;
-
- pnotice->z_kind = ACKED;
-
- pnotice->z_port = sock_sin.sin_port;
- pnotice->z_class = ZEPHYR_ADMIN_CLASS;
- pnotice->z_class_inst = "";
- pnotice->z_opcode = opcode;
- pnotice->z_sender = myname; /* myname is the hostname */
- pnotice->z_recipient = "";
- pnotice->z_default_format = "";
- pnotice->z_message = (caddr_t) NULL;
- pnotice->z_message_len = 0;
- pnotice->z_num_other_fields = 0;
-
- /* XXX for now, we don't do authentication */
- auth = 0;
-
- if ((retval = ZFormatNotice(pnotice, &pack, &packlen,
- auth ? ZAUTH : ZNOAUTH)) != ZERR_NONE) {
- syslog(LOG_WARNING, "snd_msg format: %s",
- error_message(retval));
- return;
- }
- if ((retval = ZSetDestAddr(who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "snd_msg set addr: %s",
- error_message(retval));
- xfree(pack); /* free allocated storage */
- return;
- }
- /* don't wait for ack */
- if ((retval = ZSendPacket(pack, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "snd_msg xmit: %s", error_message(retval));
- xfree(pack); /* free allocated storage */
- return;
- }
- xfree(pack); /* free allocated storage */
+ ZNotice_t notice;
+ ZNotice_t *pnotice; /* speed hack */
+ char *pack;
+ int packlen;
+ Code_t retval;
+
+ pnotice = &notice;
+
+ pnotice->z_kind = ACKED;
+
+ pnotice->z_port = srv_addr.sin_port;
+ pnotice->z_class = ZEPHYR_ADMIN_CLASS;
+ pnotice->z_class_inst = "";
+ pnotice->z_opcode = opcode;
+ pnotice->z_sender = myname; /* myname is the hostname */
+ pnotice->z_recipient = "";
+ pnotice->z_default_format = "";
+ pnotice->z_message = NULL;
+ pnotice->z_message_len = 0;
+ pnotice->z_num_other_fields = 0;
+
+ /* XXX for now, we don't do authentication */
+ auth = 0;
+
+ retval = ZFormatNotice(pnotice, &pack, &packlen, auth ? ZAUTH : ZNOAUTH);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "snd_msg format: %s", error_message(retval));
+ return;
+ }
+ retval = ZSetDestAddr(who);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "snd_msg set addr: %s", error_message(retval));
+ free(pack);
return;
+ }
+ /* don't wait for ack */
+ retval = ZSendPacket(pack, packlen, 0);
+ if (retval != ZERR_NONE)
+ syslog(LOG_WARNING, "snd_msg xmit: %s", error_message(retval));
+ free(pack);
}
/*
@@ -1471,83 +1295,48 @@ send_msg(who, opcode, auth)
*/
static void
-send_msg_list(who, opcode, lyst, num, auth, server_idx)
- struct sockaddr_in *who;
- char *opcode;
- char **lyst;
- int num;
- int auth;
- int server_idx;
+send_msg_list(who, opcode, lyst, num, auth)
+ struct sockaddr_in *who;
+ char *opcode;
+ char **lyst;
+ int num;
+ int auth;
{
- ZNotice_t notice;
- register ZNotice_t *pnotice; /* speed hack */
- char *pack;
- int packlen;
- Code_t retval;
- register ZNotAcked_t *nacked;
-
- pnotice = &notice;
-
- pnotice->z_kind = UNSAFE;
-
- pnotice->z_port = sock_sin.sin_port;
- pnotice->z_class = ZEPHYR_ADMIN_CLASS;
- pnotice->z_class_inst = "";
- pnotice->z_opcode = opcode;
- pnotice->z_sender = myname; /* myname is the hostname */
- pnotice->z_recipient = "";
- pnotice->z_default_format = "";
- pnotice->z_message = (caddr_t) NULL;
- pnotice->z_message_len = 0;
- pnotice->z_num_other_fields = 0;
-
- /* XXX for now, we don't do authentication */
- auth = 0;
-
- retval = ZFormatNoticeList (pnotice, lyst, num, &pack, &packlen,
- auth ? ZAUTH : ZNOAUTH);
- if (retval != ZERR_NONE) {
- syslog(LOG_WARNING, "snd_msg_lst format: %s",
- error_message(retval));
- return;
- }
- if ((retval = ZSetDestAddr(who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "snd_msg_lst set addr: %s",
- error_message(retval));
- xfree(pack); /* free allocated storage */
- return;
- }
- if ((retval = ZSendPacket(pack, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "snd_msg_lst xmit: %s", error_message(retval));
- xfree(pack); /* free allocated storage */
- return;
- }
-
- if (!(nacked = (ZNotAcked_t *)xmalloc(sizeof(ZNotAcked_t)))) {
- /* no space: just punt */
- syslog(LOG_WARNING, "xmit nack malloc");
- xfree(pack);
- return;
- }
-
- nacked->na_rexmits = 0;
- nacked->na_packet = pack;
- nacked->na_packsz = packlen;
- nacked->na_uid = pnotice->z_uid;
- nacked->q_forw = nacked->q_back = nacked;
- nacked->na_abstimo = NOW + abs_timo;
-
- /* Set the address and chain into the appropriate queue. */
- if (server_idx < 0) {
- nacked->na_addr = *who;
- nacked->na_timer = timer_set_rel(rexmit_secs, rexmit, nacked);
- xinsque(nacked, nacklist);
- } else {
- nacked->na_srv_idx = server_idx;
- nacked->na_timer = timer_set_rel(srv_rexmit_secs, srv_rexmit,
- nacked);
- xinsque(nacked, srv_nacklist);
- }
+ ZNotice_t notice;
+ char *pack;
+ int packlen;
+ Code_t retval;
+ Unacked *nacked;
+
+ notice.z_kind = UNSAFE;
+ notice.z_port = srv_addr.sin_port;
+ notice.z_class = ZEPHYR_ADMIN_CLASS;
+ notice.z_class_inst = "";
+ notice.z_opcode = opcode;
+ notice.z_sender = myname; /* myname is the hostname */
+ notice.z_recipient = "";
+ notice.z_default_format = "";
+ notice.z_message = NULL;
+ notice.z_message_len = 0;
+ notice.z_num_other_fields = 0;
+
+ /* XXX for now, we don't do authentication */
+ auth = 0;
+
+ retval = ZFormatNoticeList(&notice, lyst, num, &pack, &packlen,
+ auth ? ZAUTH : ZNOAUTH);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "snd_msg_lst format: %s", error_message(retval));
+ return;
+ }
+ retval = ZSetDestAddr(who);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "snd_msg_lst set addr: %s", error_message(retval));
+ free(pack);
+ return;
+ }
+ xmit_frag(&notice, pack, packlen, 0);
+ free(pack);
}
/*
@@ -1556,125 +1345,116 @@ send_msg_list(who, opcode, lyst, num, auth, server_idx)
/*ARGSUSED*/
void
server_forward(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
{
- register int i;
- caddr_t pack;
- int packlen;
- Code_t retval;
+ int i;
+ caddr_t pack;
+ int packlen;
+ Code_t retval;
#if 0
- zdbug((LOG_DEBUG, "srv_forw"));
+ zdbug((LOG_DEBUG, "srv_forw"));
#endif
- /* don't send to limbo */
- for (i = 1; i < nservers; i++) {
- if (i == me_server_idx) /* don't xmit to myself */
- continue;
- if (otherservers[i].zs_state == SERV_DEAD &&
- otherservers[i].zs_dumping == 0)
- /* if we are dumping to him, we want to
- queue it, even if he's dead */
- continue;
-
- if (!(pack = (caddr_t) xmalloc(sizeof(ZPacket_t)))) {
- syslog(LOG_CRIT, "srv_fwd malloc");
- abort();
- }
- if ((retval = ZFormatSmallRawNotice(notice, pack, &packlen)) != ZERR_NONE) {
- syslog(LOG_WARNING, "srv_fwd format: %s",
- error_message(retval));
- continue;
- }
- if (otherservers[i].zs_dumping) {
- server_queue(&(otherservers[i]), packlen, pack,
- auth, who);
- continue;
- }
- server_forw_reliable(&otherservers[i], pack, packlen, notice);
+ /* don't send to limbo */
+ for (i = 1; i < nservers; i++) {
+ if (i == me_server_idx) /* don't xmit to myself */
+ continue;
+ if (otherservers[i].state == SERV_DEAD &&
+ otherservers[i].dumping == 0) {
+ /* if we are dumping to him, we want to
+ queue it, even if he's dead */
+ continue;
+ }
+
+ pack = malloc(sizeof(ZPacket_t));
+ if (!pack) {
+ syslog(LOG_CRIT, "srv_fwd malloc");
+ abort();
+ }
+ retval = ZFormatSmallRawNotice(notice, pack, &packlen);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "srv_fwd format: %s", error_message(retval));
+ continue;
}
- return;
+ if (otherservers[i].dumping) {
+ server_queue(&otherservers[i], packlen, pack, auth, who);
+ continue;
+ }
+ server_forw_reliable(&otherservers[i], pack, packlen, notice);
+ }
}
-STATIC void
+static void
server_forw_reliable(server, pack, packlen, notice)
- ZServerDesc_t *server;
- caddr_t pack;
- int packlen;
- ZNotice_t *notice;
+ Server *server;
+ caddr_t pack;
+ int packlen;
+ ZNotice_t *notice;
{
- Code_t retval;
- register ZNotAcked_t *nacked;
-
- if ((retval = ZSetDestAddr(&server->zs_addr)) != ZERR_NONE) {
- syslog(LOG_WARNING, "srv_fwd_rel set addr: %s",
- error_message(retval));
- xfree(pack);
- return;
- }
- if ((retval = ZSendPacket(pack, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "srv_fwd xmit: %s", error_message(retval));
- xfree(pack);
- return;
- }
- /* now we've sent it, mark it as not ack'ed */
+ Code_t retval;
+ Unacked *nacked;
+ int hashval;
+
+ retval = ZSetDestAddr(&server->addr);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "srv_fwd_rel set addr: %s", error_message(retval));
+ free(pack);
+ return;
+ }
+ retval = ZSendPacket(pack, packlen, 0);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "srv_fwd xmit: %s", error_message(retval));
+ free(pack);
+ return;
+ }
+ /* now we've sent it, mark it as not ack'ed */
- if (!(nacked = (ZNotAcked_t *)xmalloc(sizeof(ZNotAcked_t)))) {
- /* no space: just punt */
- syslog(LOG_ERR, "srv_forw_rel nack malloc");
- xfree(pack);
- return;
- }
-
- nacked->na_rexmits = 0;
- nacked->na_packet = pack;
- nacked->na_srv_idx = server - otherservers;
- nacked->na_packsz = packlen;
- nacked->na_uid = notice->z_uid;
- nacked->q_forw = nacked->q_back = nacked;
- nacked->na_abstimo = 0;
-
- /* set a timer to retransmit */
- nacked->na_timer = timer_set_rel(srv_rexmit_secs,
- srv_rexmit,
- (void *) nacked);
- /* chain in */
- xinsque(nacked, srv_nacklist);
+ nacked = (Unacked *) malloc(sizeof(Unacked));
+ if (!nacked) {
+ /* no space: just punt */
+ syslog(LOG_ERR, "srv_forw_rel nack malloc");
+ free(pack);
return;
+ }
+
+ nacked->rexmits = 0;
+ nacked->packet = pack;
+ nacked->dest.srv_idx = server - otherservers;
+ nacked->packsz = packlen;
+ nacked->uid = notice->z_uid;
+ nacked->timer = timer_set_rel(rexmit_times[0], srv_rexmit, nacked);
+ hashval = SRV_NACKTAB_HASHVAL(nacked->dest.srv_idx, nacked->uid);
+ LIST_INSERT(&srv_nacktab[hashval], nacked);
}
-#ifdef CONCURRENT
/*
* send the queued message for the server.
*/
void
server_send_queue(server)
- ZServerDesc_t *server;
+ Server *server;
{
- register ZSrvPending_t *pending;
- ZNotice_t notice;
- Code_t status;
-
- while(server->zs_update_queue) {
- pending = server_dequeue(server);
- if ((status = ZParseNotice(pending->pend_packet,
- pending->pend_len,
- &notice)) != ZERR_NONE) {
- syslog(LOG_ERR,
- "ssq bad notice parse (%s): %s",
- inet_ntoa(pending->pend_who.sin_addr),
- error_message(status));
- } else {
- server_forw_reliable(server, pending->pend_packet,
- pending->pend_len, &notice);
- xfree(pending);
- /* ACK handling routines will free the packet */
- }
+ Pending *pending;
+ ZNotice_t notice;
+ Code_t status;
+
+ while (server->queue) {
+ pending = server_dequeue(server);
+ status = ZParseNotice(pending->packet, pending->len, &notice);
+ if (status != ZERR_NONE) {
+ syslog(LOG_ERR, "ssq bad notice parse (%s): %s",
+ inet_ntoa(pending->who.sin_addr), error_message(status));
+ } else {
+ server_forw_reliable(server, pending->packet, pending->len,
+ &notice);
+ free(pending);
+ /* ACK handling routines will free the packet */
}
+ }
}
-#endif
/*
* a server has acknowledged a message we sent to him; remove it from
@@ -1683,82 +1463,75 @@ server_send_queue(server)
static void
srv_nack_cancel(notice, who)
- register ZNotice_t *notice;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
{
- register ZServerDesc_t *which = server_which_server(who);
- register ZNotAcked_t *nacked;
+ Server *server = server_which_server(who);
+ Unacked *nacked;
+ int hashval;
- if (!which) {
- syslog(LOG_ERR, "non-server ack?");
- return;
+ if (!server) {
+ syslog(LOG_ERR, "non-server ack?");
+ return;
+ }
+ hashval = SRV_NACKTAB_HASHVAL(server - otherservers, notice->z_uid);
+ for (nacked = srv_nacktab[hashval]; nacked; nacked = nacked->next) {
+ if (nacked->dest.srv_idx == server - otherservers
+ && ZCompareUID(&nacked->uid, &notice->z_uid)) {
+ timer_reset(nacked->timer);
+ free(nacked->packet);
+ LIST_DELETE(nacked);
+ free(nacked);
+ return;
}
- for (nacked = srv_nacklist->q_forw;
- nacked != srv_nacklist;
- nacked = nacked->q_forw)
- if (&otherservers[nacked->na_srv_idx] == which)
- if (ZCompareUID(&nacked->na_uid, &notice->z_uid)) {
- timer_reset(nacked->na_timer);
- xfree(nacked->na_packet);
- xremque(nacked);
- xfree(nacked);
- return;
- }
+ }
#if 0
- zdbug((LOG_DEBUG, "srv_nack not found"));
+ zdbug((LOG_DEBUG, "srv_nack not found"));
#endif
- return;
}
/*
* retransmit a message to another server
*/
-STATIC void
-#ifdef __STDC__
-srv_rexmit(void *arg)
-#else
+static void
srv_rexmit(arg)
- void *arg;
-#endif
+ void *arg;
{
- ZNotAcked_t *nackpacket = (ZNotAcked_t *) arg;
- Code_t retval;
- /* retransmit the packet */
+ Unacked *packet = (Unacked *) arg;
+ Code_t retval;
+ /* retransmit the packet */
#if 0
- zdbug((LOG_DEBUG,"srv_rexmit to %s/%d",
- otherservers[nackpacket->na_srv_idx].addr,
- ntohs(otherservers[nackpacket->na_srv_idx].zs_addr.sin_port)));
+ zdbug((LOG_DEBUG,"srv_rexmit to %s/%d",
+ otherservers[packet->dest.srv_idx].addr_str,
+ ntohs(otherservers[packet->dest.srv_idx].addr.sin_port)));
#endif
- if (otherservers[nackpacket->na_srv_idx].zs_state == SERV_DEAD) {
+ if (otherservers[packet->dest.srv_idx].state == SERV_DEAD) {
#if 0
- zdbug((LOG_DEBUG, "cancelling send to dead server"));
+ zdbug((LOG_DEBUG, "cancelling send to dead server"));
#endif
- xremque(nackpacket);
- xfree(nackpacket->na_packet);
- srv_nack_release(&otherservers[nackpacket->na_srv_idx]);
- xfree(nackpacket);
- return;
- }
- retval = ZSetDestAddr(&otherservers[nackpacket->na_srv_idx].zs_addr);
- if (retval != ZERR_NONE) {
- syslog(LOG_WARNING, "srv_rexmit set addr: %s",
- error_message(retval));
- goto requeue;
-
- }
- if ((retval = ZSendPacket(nackpacket->na_packet,
- nackpacket->na_packsz, 0)) != ZERR_NONE)
- syslog(LOG_WARNING, "srv_rexmit xmit: %s",
- error_message(retval));
-
-requeue:
- /* reset the timer */
- nackpacket->na_timer = timer_set_rel(srv_rexmit_secs,
- srv_rexmit,
- (void *) nackpacket);
+ LIST_DELETE(packet);
+ free(packet->packet);
+ srv_nack_release(&otherservers[packet->dest.srv_idx]);
+ free(packet);
return;
+ }
+ retval = ZSetDestAddr(&otherservers[packet->dest.srv_idx].addr);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "srv_rexmit set addr: %s", error_message(retval));
+ } else {
+ retval = ZSendPacket(packet->packet, packet->packsz, 0);
+ if (retval != ZERR_NONE)
+ syslog(LOG_WARNING, "srv_rexmit xmit: %s",
+ error_message(retval));
+ }
+
+ /* reset the timer */
+ if (rexmit_times[packet->rexmits + 1] != -1)
+ packet->rexmits++;
+ packet->timer = timer_set_rel(rexmit_times[packet->rexmits], srv_rexmit,
+ packet);
}
/*
@@ -1768,29 +1541,22 @@ requeue:
static void
srv_nack_release(server)
- ZServerDesc_t *server;
+ Server *server;
{
- /* XXX release any private queue for this server */
-
- register ZNotAcked_t *nacked, *nack2;
-
- /* search the not-yet-acked list for anything destined to him, and
- flush it. */
- for (nacked = srv_nacklist->q_forw;
- nacked != srv_nacklist;)
- if (&otherservers[nacked->na_srv_idx] == server) {
- /* go back, since remque will change things */
- nack2 = nacked->q_back;
- timer_reset(nacked->na_timer);
- xremque(nacked);
- xfree(nacked->na_packet);
- xfree(nacked);
- /* now that the remque adjusted the linked list,
- we go forward again */
- nacked = nack2->q_forw;
- } else
- nacked = nacked->q_forw;
- return;
+ int i;
+ Unacked *nacked, *next;
+
+ for (i = 0; i < SRV_NACKTAB_HASHSIZE; i++) {
+ for (nacked = srv_nacktab[i]; nacked; nacked = next) {
+ next = nacked->next;
+ if (nacked->dest.srv_idx == server - otherservers) {
+ timer_reset(nacked->timer);
+ LIST_DELETE(nacked);
+ free(nacked->packet);
+ free(nacked);
+ }
+ }
+ }
}
/*
@@ -1800,23 +1566,24 @@ srv_nack_release(server)
static void
srv_nack_renumber (new_idx)
- register int* new_idx;
+ int *new_idx;
{
/* XXX release any private queue for this server */
-
- register ZNotAcked_t *nacked;
+ Unacked *nacked;
+ int idx, i;
/* search the not-yet-acked list for anything destined to 'from', and
change the index to 'to'. */
- for (nacked = srv_nacklist->q_forw; nacked != srv_nacklist;) {
- int idx = new_idx[nacked->na_srv_idx];
- if (idx < 0) {
- syslog (LOG_ERR,
- "srv_nack_renumber error: [%d]=%d",
- nacked->na_srv_idx, idx);
- idx = 0;
+ for (i = 0; i < SRV_NACKTAB_HASHSIZE; i++) {
+ for (nacked = srv_nacktab[i]; nacked; nacked = nacked->next) {
+ idx = new_idx[nacked->dest.srv_idx];
+ if (idx < 0) {
+ syslog(LOG_ERR, "srv_nack_renumber error: [%d]=%d",
+ nacked->dest.srv_idx, idx);
+ idx = 0;
+ }
+ nacked->dest.srv_idx = idx;
}
- nacked->na_srv_idx = idx;
}
}
@@ -1825,58 +1592,47 @@ srv_nack_renumber (new_idx)
*/
static void
server_queue(server, len, pack, auth, who)
- ZServerDesc_t *server;
- int len;
- caddr_t pack;
- int auth;
- struct sockaddr_in *who;
+ Server *server;
+ int len;
+ void *pack;
+ int auth;
+ struct sockaddr_in *who;
{
- register ZSrvPending_t *pending;
-
- if (!server->zs_update_queue) {
- if (!(pending =
- (ZSrvPending_t *)xmalloc(sizeof(ZSrvPending_t)))) {
- syslog(LOG_CRIT, "zs_update_queue head malloc");
- abort();
- }
- pending->q_forw = pending->q_back = pending;
- server->zs_update_queue = pending;
- }
- if (!(pending = (ZSrvPending_t *)xmalloc(sizeof(ZSrvPending_t)))) {
- syslog(LOG_CRIT, "zs_update_queue malloc");
- abort();
- }
- pending->pend_packet = pack;
- pending->pend_len = len;
- pending->pend_auth = auth;
- pending->pend_who = *who;
+ Pending *pending;
- /* put it on the end of the list */
- xinsque(pending, server->zs_update_queue->q_back);
- return;
+ pending = (Pending *) malloc(sizeof(Pending));
+ if (!pending) {
+ syslog(LOG_CRIT, "update_queue malloc");
+ abort();
+ }
+ pending->packet = pack;
+ pending->len = len;
+ pending->auth = auth;
+ pending->who = *who;
+ pending->next = NULL;
+
+ /* put it on the end of the list */
+ if (server->queue)
+ server->queue_last->next = pending;
+ else
+ server->queue = server->queue_last = pending;
}
/*
* Pull a notice off the hold queue.
*/
-ZSrvPending_t *
+Pending *
server_dequeue(server)
- register ZServerDesc_t *server;
+ Server *server;
{
- ZSrvPending_t *pending;
+ Pending *pending;
- if (!server->zs_update_queue)
- return(NULLZSPT);
- pending = server->zs_update_queue->q_forw;
- /* pull it off */
- xremque(pending);
- if (server->zs_update_queue->q_forw == server->zs_update_queue) {
- /* empty queue now */
- xfree(server->zs_update_queue);
- server->zs_update_queue = NULLZSPT;
- }
- return(pending);
+ if (!server->queue)
+ return NULL;
+ pending = server->queue;
+ server->queue = pending->next;
+ return pending;
}
/*
@@ -1885,38 +1641,34 @@ server_dequeue(server)
void
server_pending_free(pending)
- register ZSrvPending_t *pending;
+ Pending *pending;
{
- xfree(pending->pend_packet);
- xfree(pending);
- return;
+ free(pending->packet);
+ free(pending);
+ return;
}
-#ifdef CONCURRENT
/*
* Queue something to be handled later by this server.
*/
void
server_self_queue(notice, auth, who)
- ZNotice_t* notice;
- int auth;
- struct sockaddr_in * who;
+ ZNotice_t* notice;
+ int auth;
+ struct sockaddr_in * who;
{
- caddr_t pack;
- int packlen;
- Code_t retval;
-
- if ((retval = ZFormatRawNotice(notice, &pack, &packlen))
- != ZERR_NONE) {
- syslog(LOG_CRIT, "srv_self_queue format: %s",
- error_message(retval));
- abort();
- }
- server_queue(me_server, packlen, pack, auth, who);
- return;
+ char *pack;
+ int packlen;
+ Code_t retval;
+
+ retval = ZFormatRawNotice(notice, &pack, &packlen);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_CRIT, "srv_self_queue format: %s", error_message(retval));
+ abort();
+ }
+ server_queue(me_server, packlen, pack, auth, who);
}
-#endif
/*
* dump info about servers onto the fp.
@@ -1925,16 +1677,14 @@ server_self_queue(notice, auth, who)
*/
void
server_dump_servers(fp)
- FILE *fp;
+ FILE *fp;
{
- register int i;
-
- for (i = 0; i < nservers ; i++) {
- (void) fprintf(fp, "%d:%s/%s%s\n",
- i, otherservers[i].addr,
- srv_states[(int) otherservers[i].zs_state],
- otherservers[i].zs_dumping ? " (DUMPING)" : "");
- }
+ int i;
- return;
+ for (i = 0; i < nservers ; i++) {
+ fprintf(fp, "%d:%s/%s%s\n", i, otherservers[i].addr_str,
+ srv_states[otherservers[i].state],
+ otherservers[i].dumping ? " (DUMPING)" : "");
+ }
}
+
diff --git a/server/subscr.c b/server/subscr.c
index 742adda..c305c70 100644
--- a/server/subscr.c
+++ b/server/subscr.c
@@ -12,10 +12,11 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
#ifndef lint
#ifndef SABER
-static char rcsid_subscr_c[] = "$Id$";
+static const char rcsid_subscr_c[] = "$Id$";
#endif
#endif
@@ -25,7 +26,7 @@ static char rcsid_subscr_c[] = "$Id$";
* External functions:
*
* Code_t subscr_subscribe(who, notice)
- * ZClient_t *who;
+ * Client *who;
* ZNotice_t *notice;
*
* Code_t subscr_cancel(sin, notice)
@@ -33,16 +34,16 @@ static char rcsid_subscr_c[] = "$Id$";
* ZNotice_t *notice;
*
* Code_t subscr_cancel_client(client)
- * ZClient_t *client;
+ * Client *client;
*
* Code_t subscr_cancel_host(addr)
* struct in_addr *addr;
*
- * ZClientList_t *subscr_match_list(notice)
+ * Client *subscr_match_list(notice)
* ZNotice_t *notice;
*
* void subscr_free_list(list)
- * ZClientList_t *list;
+ * Client *list;
*
* void subscr_sendlist(notice, auth, who)
* ZNotice_t *notice;
@@ -50,28 +51,17 @@ static char rcsid_subscr_c[] = "$Id$";
* struct sockaddr_in *who;
*
* Code_t subscr_send_subs(client, vers)
- * ZClient_t *client;
+ * Client *client;
* char *vers;
*
* Code_t subscr_def_subs(who)
- * ZClient_t *who;
+ * Client *who;
*
* void subscr_reset();
*
*/
-#include "zserver.h"
-#include <ctype.h>
-#include <strings.h>
-#include <sys/stat.h>
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-#ifdef KERBEROS
+#ifdef ZEPHYR_USES_KERBEROS
#ifndef NOENCRYPTION
C_Block serv_key;
Sched serv_ksched;
@@ -83,36 +73,41 @@ Sched serv_ksched;
#ifdef OLD_COMPAT
#define OLD_ZEPHYR_VERSION "ZEPH0.0"
#define OLD_CLIENT_INCOMPSUBS "INCOMP"
-static void old_compat_subscr_sendlist P((ZNotice_t *notice, int auth,
+static void old_compat_subscr_sendlist __P((ZNotice_t *notice, int auth,
struct sockaddr_in *who));
extern int old_compat_count_subscr; /* counter of old use */
#endif /* OLD_COMPAT */
#ifdef NEW_COMPAT
#define NEW_OLD_ZEPHYR_VERSION "ZEPH0.1"
-static void new_old_compat_subscr_sendlist P((ZNotice_t *notice, int auth,
+static void new_old_compat_subscr_sendlist __P((ZNotice_t *notice, int auth,
struct sockaddr_in *who));
extern int new_compat_count_subscr; /* counter of old use */
#endif /* NEW_COMPAT */
extern char *re_comp(), *re_conv();
-static Code_t add_subscriptions P((ZClient_t *who, ZSubscr_t *subs_queue,
+static Code_t add_subscriptions __P((Client *who, Destlist *subs_queue,
ZNotice_t *notice));
-static ZSubscr_t *extract_subscriptions P((register ZNotice_t *notice));
-static void free_subscriptions P((register ZSubscr_t *subs));
-static char **subscr_marshal_subs P((ZNotice_t *notice, int auth,
+static Destlist *extract_subscriptions __P((ZNotice_t *notice));
+static void free_subscriptions __P((Destlist *subs));
+static char **subscr_marshal_subs __P((ZNotice_t *notice, int auth,
struct sockaddr_in *who,
- register int *found));
-static ZSubscr_t *subscr_copy_def_subs P((char *person));
-static int cl_match P((ZSubscr_t*, ZClient_t *));
+ int *found));
+static Destlist *subscr_copy_def_subs __P((char *person));
+static Code_t subscr_subscribe_realms __P((struct sockaddr_in *who,
+ Destlist *newsubs,
+ ZNotice_t *notice));
+static Code_t subscr_realm_sendit __P((Client *who, Destlist *subs,
+ ZNotice_t *notice, Realm *realm));
+static void subscr_unsub_realms __P((Destlist *newsubs));
+static void subscr_unsub_sendit __P((Destlist *subs, Realm *realm));
+static int cl_match __P((Destlist*, Client *));
static int defaults_read = 0; /* set to 1 if the default subs
are in memory */
static ZNotice_t default_notice; /* contains default subscriptions */
-#undef P
-
-ZSTRING *wildcard_instance;
-ZSTRING *empty;
+String *wildcard_instance;
+String *empty;
/* WARNING: make sure this is the same as the number of strings you */
/* plan to hand back to the user in response to a subscription check, */
@@ -125,105 +120,89 @@ ZSTRING *empty;
Code_t
subscr_subscribe(who, notice)
- ZClient_t *who;
- ZNotice_t *notice;
+ Client *who;
+ ZNotice_t *notice;
{
- ZSubscr_t *subs_queue, *sub;
- Code_t retval;
-
- if (!who->zct_subs) {
- /* allocate a subscription head */
- sub = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t));
- if (!sub)
- return(ENOMEM);
- sub->q_forw = sub->q_back = sub;
- sub->zst_dest.classname = sub->zst_dest.inst =
- sub->zst_dest.recip = NULL;
- who->zct_subs = sub;
- }
+ Destlist *subs;
- subs_queue = extract_subscriptions(notice);
- return(add_subscriptions(who, subs_queue, notice));
+ subs = extract_subscriptions(notice);
+ return add_subscriptions(who, subs, notice);
}
static Code_t
-add_subscriptions(who, subs_queue, notice)
- ZClient_t *who;
- ZSubscr_t *subs_queue;
- ZNotice_t *notice;
+add_subscriptions(who, subs, notice)
+ Client *who;
+ Destlist *subs;
+ ZNotice_t *notice;
{
- ZSubscr_t *sub, *next;
- Code_t retval;
- ZAcl_t *acl;
- ZSTRING *sender;
-
- if (!subs_queue)
- return(ZERR_NONE); /* no subscr -> no error */
+ Destlist *next;
+ Code_t retval;
+ Acl *acl;
+ String *sender;
+ Realm *realm = NULL;
- sender = make_zstring(notice->z_sender,0);
+ if (!subs)
+ return ZERR_NONE; /* no subscr -> no error */
- START_CRITICAL_CODE;
-
- /* Loop over the new subscriptions. */
- next = subs_queue->q_forw;
- while (next != subs_queue) {
- sub = next;
- next = sub->q_forw;
+ sender = make_string(notice->z_sender, 0);
+ /* Loop over the new subscriptions. */
+ for (; subs; subs = next) {
+ next = subs->next;
#if 0
- zdbug ((LOG_DEBUG, "subscr: %s/%s/%s",
- sub->zst_dest.classname->string,
- sub->zst_dest.inst->string,
- sub->zst_dest.recip->string));
+ zdbug ((LOG_DEBUG, "subscr: %s/%s/%s", subs->dest.classname->string,
+ subs->dest.inst->string, subs->dest.recip->string));
#endif
-
- if (!bdumping) {
- if ((sub->zst_dest.recip != empty)
- && (sub->zst_dest.recip != sender)) {
- syslog(LOG_WARNING, "subscr unauth %s recipient %s",
- sender->string,
- sub->zst_dest.recip->string);
+ if (!bdumping) {
+ if (subs->dest.recip != empty && subs->dest.recip != sender
+ && subs->dest.recip->string[0] != '@') {
+ syslog(LOG_WARNING, "subscr unauth %s recipient %s",
+ sender->string, subs->dest.recip->string);
+ continue;
+ }
+ acl = class_get_acl(subs->dest.classname);
+ if (acl) {
+ if (!access_check(sender->string, acl, SUBSCRIBE)) {
+ syslog(LOG_WARNING, "subscr unauth %s class %s",
+ sender->string, subs->dest.classname->string);
+ continue; /* the for loop */
+ }
+ if (wildcard_instance == subs->dest.inst) {
+ if (!access_check(sender->string, acl, INSTWILD)) {
+ syslog(LOG_WARNING,
+ "subscr unauth %s class %s wild inst",
+ sender->string, subs->dest.classname->string);
continue;
}
- acl = class_get_acl(sub->zst_dest.classname);
- if (acl) {
- if (!(access_check(sender->string, acl, SUBSCRIBE))) {
- syslog(LOG_WARNING,
- "subscr unauth %s class %s",
- sender->string,
- sub->zst_dest.classname->string);
- continue; /* the for loop */
- }
- if (wildcard_instance == sub->zst_dest.inst) {
- if (!access_check(sender->string, acl, INSTWILD)) {
- syslog(LOG_WARNING,
- "subscr unauth %s class %s wild inst",
- notice->z_sender,
- sub->zst_dest.classname->string);
- continue;
- }
- }
- }
}
- xremque(sub);
- retval = triplet_register(who, &sub->zst_dest);
- if (retval != ZERR_NONE) {
- xfree(sub);
- if (retval == ZSRV_CLASSXISTS) {
- continue;
- } else {
- free_subscriptions(subs_queue);
- END_CRITICAL_CODE;
- return(retval);
- }
- }
- xinsque(sub, who->zct_subs);
+ }
}
+ /* check the recipient for a realm which isn't ours */
+ realm = NULL;
+ if (subs->dest.recip->string[0] == '@' &&
+ strcmp((subs->dest.recip->string + 1), ZGetRealm()) != 0)
+ realm = realm_get_realm_by_name(subs->dest.recip->string + 1);
+ if (realm) {
+ retval = subscr_realm_sendit(who, subs, notice, realm);
+ if (retval != ZERR_NONE) {
+ free(subs);
+ return(retval);
+ }
+ }
+ retval = triplet_register(who, &subs->dest, realm);
+ if (retval != ZERR_NONE) {
+ free(subs);
+ if (retval == ZSRV_CLASSXISTS) {
+ continue;
+ } else {
+ free_subscriptions(next);
+ return retval;
+ }
+ }
+ LIST_INSERT(&who->subs, subs);
+ }
- END_CRITICAL_CODE;
-
- free_subscriptions(subs_queue);
- return(ZERR_NONE);
+ return ZERR_NONE;
}
/*
@@ -232,126 +211,101 @@ add_subscriptions(who, subs_queue, notice)
Code_t
subscr_def_subs(who)
- ZClient_t *who;
+ Client *who;
{
- ZSubscr_t *subs;
-
- if (!who->zct_subs) {
- /* allocate a subscription head */
- if (!(subs = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t)))) {
- syslog(LOG_ERR, "no mem subscr_def_subs");
- return(ENOMEM);
- }
- subs->q_forw = subs->q_back = subs;
- subs->zst_dest.classname = subs->zst_dest.inst =
- subs->zst_dest.recip = (ZSTRING *) NULL;
- who->zct_subs = subs;
- }
+ Destlist *subs;
- subs = subscr_copy_def_subs(who->zct_principal->string);
- return(add_subscriptions(who, subs, &default_notice));
+ subs = subscr_copy_def_subs(who->principal->string);
+ return add_subscriptions(who, subs, &default_notice);
}
void
subscr_reset()
{
#if 0
- zdbug((LOG_DEBUG, "subscr_reset()"));
+ zdbug((LOG_DEBUG, "subscr_reset()"));
#endif
- xfree(default_notice.z_message);
- default_notice.z_message = NULL;
- defaults_read = 0;
+ free(default_notice.z_message);
+ default_notice.z_message = NULL;
+ defaults_read = 0;
}
-static ZSubscr_t *
+static Destlist *
subscr_copy_def_subs(person)
- char *person;
+ char *person;
{
- int retval;
- int fd;
- struct stat statbuf;
- char *def_sub_area;
- register char *cp;
- ZSubscr_t *subs;
- register ZSubscr_t *subs2;
-
- if (!defaults_read) {
+ int retval, fd;
+ struct stat statbuf;
+ char *def_sub_area, *cp;
+ Destlist *subs, *sub;
+
+ if (!defaults_read) {
#if 0
- zdbug((LOG_DEBUG, "reading default subscription file"));
+ zdbug((LOG_DEBUG, "reading default subscription file"));
#endif
- fd = open(DEFAULT_SUBS_FILE, O_RDONLY, 0666);
- if (fd < 0) {
- syslog(LOG_ERR, "can't open %s:%m", DEFAULT_SUBS_FILE);
- return((ZSubscr_t *)0);
- }
- retval = fstat(fd, &statbuf);
- if (retval < 0) {
- syslog(LOG_ERR, "fstat failure on %s:%m",
- DEFAULT_SUBS_FILE);
- (void) close(fd);
- return((ZSubscr_t *)0);
- }
- if (!(def_sub_area = (char *) xmalloc(statbuf.st_size + 1))) {
- syslog(LOG_ERR, "no mem copy_def_subs");
- (void) close(fd);
- return((ZSubscr_t *)0);
- }
- retval = read(fd, def_sub_area, (int) statbuf.st_size);
- /*
- "Upon successful completion, read and readv return the number
- of bytes actually read and placed in the buffer. The system
- guarantees to read the number of bytes requested if the
- descriptor references a normal file that has that many bytes
- left before the end-of-file, but in no other case."
- -- read(2)
- Therefore, the following test is valid.
- */
- if (retval != statbuf.st_size) {
- syslog(LOG_ERR, "short read in copy_def_subs");
- (void) close(fd);
- return((ZSubscr_t *)0);
- }
+ fd = open(subs_file, O_RDONLY, 0666);
+ if (fd < 0) {
+ syslog(LOG_ERR, "can't open %s:%m", subs_file);
+ return NULL;
+ }
+ retval = fstat(fd, &statbuf);
+ if (retval < 0) {
+ syslog(LOG_ERR, "fstat failure on %s:%m", subs_file);
+ close(fd);
+ return NULL;
+ }
+ def_sub_area = (char *) malloc(statbuf.st_size + 1);
+ if (!def_sub_area) {
+ syslog(LOG_ERR, "no mem copy_def_subs");
+ close(fd);
+ return NULL;
+ }
+ retval = read(fd, def_sub_area, (size_t) statbuf.st_size);
+ if (retval != statbuf.st_size) {
+ syslog(LOG_ERR, "short read in copy_def_subs");
+ close(fd);
+ return NULL;
+ }
+
+ close(fd);
+ def_sub_area[statbuf.st_size] = '\0'; /* null-terminate it */
+
+ /*
+ def_subs_area now points to a buffer full of subscription info.
+ Each line of the stuff is of the form:
+ class,inst,recipient
- (void) close(fd);
- def_sub_area[statbuf.st_size] = '\0'; /* null-terminate it */
-
- /*
- def_subs_area now points to a buffer full of subscription
- info.
- each line of the stuff is of the form:
- class,inst,recipient
-
- Commas and newlines may not appear as part of the class,
- instance, or recipient. XXX!
- */
-
- /* split up the subscription info */
- for (cp = def_sub_area;
- cp < def_sub_area + statbuf.st_size;
- cp++)
- if ((*cp == '\n') || (*cp == ','))
- *cp = '\0';
- default_notice.z_message = def_sub_area;
- default_notice.z_message_len = (int) statbuf.st_size + 1;
- default_notice.z_auth = 1;
- defaults_read = 1;
+ Commas and newlines may not appear as part of the class,
+ instance, or recipient. XXX!
+ */
+
+ /* split up the subscription info */
+ for (cp = def_sub_area; cp < def_sub_area + statbuf.st_size; cp++) {
+ if (*cp == '\n' || *cp == ',')
+ *cp = '\0';
}
- /* needed later for access_check() */
- default_notice.z_sender = person;
- subs = extract_subscriptions(&default_notice);
- /* replace any non-* recipients with "person" */
-
- for (subs2 = subs->q_forw; subs2 != subs; subs2 = subs2->q_forw) {
- /* if not a wildcard, replace it with person */
- if (strcmp(subs2->zst_dest.recip->string, "*")) {
- free_zstring(subs2->zst_dest.recip);
- subs2->zst_dest.recip = make_zstring(person,0);
- } else { /* replace with null recipient */
- free_zstring(subs2->zst_dest.recip);
- subs2->zst_dest.recip = dup_zstring(empty);
- }
+ default_notice.z_message = def_sub_area;
+ default_notice.z_message_len = statbuf.st_size + 1;
+ default_notice.z_auth = 1;
+ defaults_read = 1;
+ }
+
+ /* needed later for access_check() */
+ default_notice.z_sender = person;
+ subs = extract_subscriptions(&default_notice);
+ /* replace any non-* recipients with "person" */
+
+ for (sub = subs; sub; sub = sub->next) {
+ /* if not a wildcard, replace it with person */
+ if (strcmp(sub->dest.recip->string, "*")) {
+ free_string(sub->dest.recip);
+ sub->dest.recip = make_string(person, 0);
+ } else { /* replace with null recipient */
+ free_string(sub->dest.recip);
+ sub->dest.recip = dup_string(empty);
}
- return(subs);
+ }
+ return subs;
}
/*
@@ -360,161 +314,163 @@ subscr_copy_def_subs(person)
Code_t
subscr_cancel(sin, notice)
- struct sockaddr_in *sin;
- ZNotice_t *notice;
+ struct sockaddr_in *sin;
+ ZNotice_t *notice;
{
- ZClient_t *who;
- register ZSubscr_t *cancel_queue, *cancel, *sub;
- Code_t retval;
- int found = 0;
- int relation;
+ Realm *realm;
+ Client *who;
+ Destlist *cancel_subs, *subs, *cancel_next, *client_subs, *client_next;
+ Code_t retval;
+ int found = 0;
+ int relation;
#if 0
- zdbug((LOG_DEBUG,"subscr_cancel"));
+ zdbug((LOG_DEBUG,"subscr_cancel"));
#endif
- who = client_which_client(sin, notice);
- if (!who)
- return(ZSRV_NOCLT);
-
- if (!who->zct_subs)
- return(ZSRV_NOSUB);
-
- cancel_queue = extract_subscriptions(notice);
- if (!cancel_queue)
- return(ZERR_NONE); /* no subscr -> no error */
-
- START_CRITICAL_CODE;
-
- for (cancel = cancel_queue->q_forw; cancel != cancel_queue;
- cancel = cancel->q_forw) {
- for (sub = who->zct_subs->q_forw; sub != who->zct_subs;
- sub = sub->q_forw) {
- if (ZDest_eq(&cancel->zst_dest, &sub->zst_dest)) {
- xremque(sub);
- triplet_deregister(who, &sub->zst_dest);
- free_zstring(sub->zst_dest.classname);
- free_zstring(sub->zst_dest.inst);
- free_zstring(sub->zst_dest.recip);
- xfree(sub);
- found = 1;
- break;
+ who = client_which_client(&sin->sin_addr, notice);
+ if (!who)
+ return ZSRV_NOCLT;
+
+ if (!who->subs)
+ return ZSRV_NOSUB;
+
+ cancel_subs = extract_subscriptions(notice);
+ if (!cancel_subs)
+ return ZERR_NONE; /* no subscr -> no error */
+
+ for (subs = cancel_subs; subs; subs = cancel_next) {
+ cancel_next = subs->next;
+ for (client_subs = who->subs; client_subs; client_subs = client_next) {
+ client_next = client_subs->next;
+ if (ZDest_eq(&client_subs->dest, &subs->dest)) {
+ LIST_DELETE(client_subs);
+ triplet_deregister(who, &client_subs->dest, NULL);
+ if (retval == ZSRV_EMPTYCLASS &&
+ client_subs->dest.recip->string[0] == '@') {
+ realm =
+ realm_get_realm_by_name(client_subs->dest.recip->string
+ + 1);
+ if (realm)
+ subscr_unsub_sendit(client_subs, realm);
+ realm = NULL;
}
+ free_string(client_subs->dest.classname);
+ free_string(client_subs->dest.inst);
+ free_string(client_subs->dest.recip);
+ free(client_subs);
+ found = 1;
+ break;
}
}
+ }
- END_CRITICAL_CODE;
+ free_subscriptions(cancel_subs);
- free_subscriptions(cancel_queue);
- if (found) {
+ if (found) {
#if 0
- zdbug((LOG_DEBUG, "found & removed"));
+ zdbug((LOG_DEBUG, "found & removed"));
#endif
- return(ZERR_NONE);
- } else {
+ return ZERR_NONE;
+ } else {
#if 0
- zdbug((LOG_DEBUG, "not found"));
+ zdbug((LOG_DEBUG, "not found"));
#endif
- return(ZSRV_NOSUB);
- }
+ return ZSRV_NOSUB;
+ }
}
-/*
- * Cancel all the subscriptions for this client.
- */
-
-void
-subscr_cancel_client(client)
- ZClient_t *client;
+Code_t
+subscr_realm_cancel(sin, notice, realm)
+ struct sockaddr_in *sin;
+ ZNotice_t *notice;
+ Realm *realm;
{
- register ZSubscr_t *subs;
-
+ Client *who;
+ Destlist *cancel_subs, *subs, *client_subs, *next, *next2;
+ Code_t retval;
+ int found = 0;
+
+ if (!realm)
+ return ZSRV_NORLM;
+
+ if (!realm->subs)
+ return ZSRV_NOSUB;
+
+ cancel_subs = extract_subscriptions(notice);
+ if (!cancel_subs)
+ return ZERR_NONE; /* no subscr -> no error */
+
+ for (subs = cancel_subs; subs; subs = next) {
+ next = subs->next;
+ for (client_subs = realm->subs; client_subs; client_subs = next2) {
+ next2 = client_subs->next;
+ if (ZDest_eq(&client_subs->dest, &subs->dest)) {
+ LIST_DELETE(client_subs);
+ retval = triplet_deregister(realm->client, &client_subs->dest, realm);
+ free_string(client_subs->dest.classname);
+ free_string(client_subs->dest.inst);
+ free_string(client_subs->dest.recip);
+ free(client_subs);
+ found = 1;
+ break;
+ }
+ }
+ }
+
+ free_subscriptions(cancel_subs);
+
+ if (found) {
#if 0
- zdbug((LOG_DEBUG,"subscr_cancel_client %s",
- inet_ntoa (client->zct_addr.sin_addr)));
+ zdbug((LOG_DEBUG, "found & removed"));
#endif
- if (!client->zct_subs)
- return;
-
- START_CRITICAL_CODE;
-
- for (subs = client->zct_subs->q_forw;
- subs != client->zct_subs;
- subs = client->zct_subs->q_forw) {
+ return ZERR_NONE;
+ } else {
#if 0
- zdbug((LOG_DEBUG,"sub_can %s",
- subs->zst_dest.classname->string));
+ zdbug((LOG_DEBUG, "not found"));
#endif
- if (triplet_deregister(client, &subs->zst_dest) != ZERR_NONE) {
-#if 0
- zdbug((LOG_DEBUG,"sub_can_clt: not registered!"));
-#endif
- }
- xremque(subs);
- free_zstring(subs->zst_dest.classname);
- free_zstring(subs->zst_dest.inst);
- free_zstring(subs->zst_dest.recip);
- xfree(subs);
- }
-
- /* also flush the head of the queue */
- /* subs is now client->zct_subs */
- free_zstring(subs->zst_dest.classname);
- free_zstring(subs->zst_dest.inst);
- free_zstring(subs->zst_dest.recip);
- xfree(subs);
- client->zct_subs = NULLZST;
-
- END_CRITICAL_CODE;
-
- return;
+ return ZSRV_NOSUB;
+ }
}
-#ifdef notdef
-/* not used for the moment */
/*
- * Cancel all the subscriptions for clients at this addr.
+ * Cancel all the subscriptions for this client.
*/
-Code_t
-subscr_cancel_host(addr)
-struct in_addr *addr;
+void
+subscr_cancel_client(client)
+ Client *client;
{
- register ZHostList_t *hosts;
- register ZClientList_t *clist = NULLZCLT, *clt;
-
- /* find the host */
- if (!(hosts = hostm_find_host(addr)))
- return(ZSRV_HNOTFOUND);
- clist = hosts->zh_clients;
-
- START_CRITICAL_CODE;
-
- /* flush each one */
- for (clt = clist->q_forw; clt != clist; clt = clt->q_forw)
- (void) subscr_cancel_client(clt->zclt_client);
+ Destlist *subs, *next;
+ Code_t retval;
+ Realm *realm;
- END_CRITICAL_CODE;
-
- return(ZERR_NONE);
-}
+#if 0
+ zdbug((LOG_DEBUG,"subscr_cancel_client %s",
+ inet_ntoa(client->addr.sin_addr)));
#endif
+ if (!client->subs)
+ return;
-/*
- * Free memory used by a list we allocated.
- */
-
-void
-subscr_free_list(list)
- ZClientList_t *list;
-{
- register ZClientList_t *lyst;
-
- for (lyst = list->q_forw; lyst != list; lyst = list->q_forw) {
- xremque(lyst);
- xfree(lyst);
+ for (subs = client->subs; subs; subs = next) {
+ next = subs->next;
+#if 0
+ zdbug((LOG_DEBUG,"sub_can %s", subs->dest.classname->string));
+#endif
+ retval = triplet_deregister(client, &subs->dest, NULL);
+ if (retval == ZSRV_EMPTYCLASS &&
+ subs->dest.recip->string[0] == '@') {
+ realm = realm_get_realm_by_name(subs->dest.recip->string + 1);
+ if (realm)
+ subscr_unsub_sendit(subs, realm);
+ realm = NULL;
}
- xfree(list);
- return;
+ free_string(subs->dest.classname);
+ free_string(subs->dest.inst);
+ free_string(subs->dest.recip);
+ free(subs);
+ }
+
+ client->subs = NULL;
}
/*
@@ -523,359 +479,349 @@ subscr_free_list(list)
void
subscr_sendlist(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
{
- char **answer;
- int found;
- struct sockaddr_in send_to_who;
- Code_t retval;
+ char **answer;
+ int found;
+ struct sockaddr_in send_to_who;
+ Code_t retval;
#ifdef OLD_COMPAT
- if (!strcmp(notice->z_version, OLD_ZEPHYR_VERSION)) {
- /* we are talking to an old client; use the old-style
- acknowledgement-message */
- old_compat_subscr_sendlist(notice, auth, who);
- return;
- }
+ if (strcmp(notice->z_version, OLD_ZEPHYR_VERSION) == 0) {
+ /* we are talking to an old client; use the old-style
+ acknowledgement-message */
+ old_compat_subscr_sendlist(notice, auth, who);
+ return;
+ }
#endif /* OLD_COMPAT */
#ifdef NEW_COMPAT
- if (!strcmp(notice->z_version, NEW_OLD_ZEPHYR_VERSION)) {
- /* we are talking to a new old client; use the new-old-style
- acknowledgement-message */
- new_old_compat_subscr_sendlist(notice, auth, who);
- return;
- }
+ if (strcmp(notice->z_version, NEW_OLD_ZEPHYR_VERSION) == 0) {
+ /* we are talking to a new old client; use the new-old-style
+ acknowledgement-message */
+ new_old_compat_subscr_sendlist(notice, auth, who);
+ return;
+ }
#endif /* NEW_COMPAT */
- answer = subscr_marshal_subs(notice, auth, who, &found);
- send_to_who = *who;
- send_to_who.sin_port = notice->z_port; /* Return port */
-
- if ((retval = ZSetDestAddr(&send_to_who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist set addr: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
+ answer = subscr_marshal_subs(notice, auth, who, &found);
+ send_to_who = *who;
+ send_to_who.sin_port = notice->z_port; /* Return port */
+
+ retval = ZSetDestAddr(&send_to_who);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_sendlist set addr: %s",
+ error_message(retval));
+ if (answer)
+ free(answer);
+ return;
+ }
- /* XXX for now, don't do authentication */
- auth = 0;
+ /* XXX for now, don't do authentication */
+ auth = 0;
- notice->z_kind = ACKED;
+ notice->z_kind = ACKED;
- /* use xmit_frag() to send each piece of the notice */
+ /* use xmit_frag() to send each piece of the notice */
- if ((retval = ZSrvSendRawList(notice, (char **) answer,
- found*NUM_FIELDS, xmit_frag))
- != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist xmit: %s",
- error_message(retval));
- }
- if (answer)
- xfree(answer);
- return;
+ retval = ZSrvSendRawList(notice, answer, found * NUM_FIELDS, xmit_frag);
+ if (retval != ZERR_NONE)
+ syslog(LOG_WARNING, "subscr_sendlist xmit: %s", error_message(retval));
+ if (answer)
+ free(answer);
}
static char **
subscr_marshal_subs(notice, auth, who, found)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- register int *found;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ int *found;
{
- ZNotice_t reply;
- char **answer = (char **) 0;
- int temp;
- Code_t retval;
- ZClient_t *client;
- register ZSubscr_t *subs, *subs2 = NULLZST;
- register int i;
- int defsubs = 0;
+ ZNotice_t reply;
+ char **answer = NULL;
+ unsigned short temp;
+ Code_t retval;
+ Client *client;
+ Destlist *subs = NULL, *sub;
+ int i;
+ int defsubs = 0;
#if 0
- zdbug((LOG_DEBUG, "subscr_marshal"));
+ zdbug((LOG_DEBUG, "subscr_marshal"));
#endif
- *found = 0;
+ *found = 0;
- /* Note that the following code is an incredible crock! */
+ /* Note that the following code is an incredible crock! */
- /* We cannot send multiple packets as acknowledgements to the client,
- since the hostmanager will ignore the later packets. So we need
- to send directly to the client. */
+ /* We cannot send multiple packets as acknowledgements to the client,
+ since the hostmanager will ignore the later packets. So we need
+ to send directly to the client. */
- /* Make our own copy so we can send directly back to the client */
- /* RSF 11/07/87 */
-
+ /* Make our own copy so we can send directly back to the client */
+ /* RSF 11/07/87 */
- if (!strcmp(notice->z_opcode, CLIENT_GIMMESUBS)) {
- /* If the client has requested his current subscriptions,
- the message field of the notice contains the port number
- of the client for which the sender desires the subscription
- list. The port field is the port of the sender. */
-
- if ((retval = ZReadAscii(notice->z_message,
- notice->z_message_len,
- (unsigned char *)&temp,
- sizeof(u_short))) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_marshal read port num: %s",
- error_message(retval));
- return((char **)0);
- }
+ if (strcmp(notice->z_opcode, CLIENT_GIMMESUBS) == 0) {
+ /* If the client has requested his current subscriptions,
+ the message field of the notice contains the port number
+ of the client for which the sender desires the subscription
+ list. The port field is the port of the sender. */
- /* Blech blech blech */
- reply = *notice;
- reply.z_port = *((u_short *)&temp);
-
- client = client_which_client(who, &reply);
-
- if (client)
- subs2 = client->zct_subs;
- } else if (!strcmp(notice->z_opcode, CLIENT_GIMMEDEFS)) {
-#if 0
- zdbug((LOG_DEBUG, "gimmedefs"));
-#endif
- /* subscr_copy_def_subs allocates new pointer rings, so
- it must be freed when finished.
- the string areas pointed to are static, however.*/
- subs2 = subscr_copy_def_subs(notice->z_sender);
- defsubs = 1;
- } else {
- syslog(LOG_ERR, "subscr_marshal bogus opcode %s",
- notice->z_opcode);
- return((char **) 0);
+ retval = ZReadAscii16(notice->z_message, notice->z_message_len, &temp);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_marshal read port num: %s",
+ error_message(retval));
+ return(NULL);
}
- if (subs2) {
+ reply = *notice;
+ reply.z_port = htons(temp);
- /* check authenticity here. The user must be authentic to get
- a list of subscriptions. If he is not subscribed to
- anything, this if-clause fails, and he gets a response
- indicating no subscriptions.
- if retrieving default subscriptions, don't care about
- authentication. */
+ client = client_which_client(&who->sin_addr, &reply);
- if (!auth && !defsubs) {
- return((char **) 0);
- }
- if (!defsubs) {
- if (client && (strcmp(client->zct_principal->string,
- notice->z_sender) != 0)) {
- zdbug ((LOG_DEBUG,
+ if (client)
+ subs = client->subs;
+ } else if (strcmp(notice->z_opcode, CLIENT_GIMMEDEFS) == 0) {
+#if 0
+ zdbug((LOG_DEBUG, "gimmedefs"));
+#endif
+ /* subscr_copy_def_subs allocates new pointer rings, so
+ it must be freed when finished.
+ the string areas pointed to are static, however.*/
+ subs = subscr_copy_def_subs(notice->z_sender);
+ defsubs = 1;
+ } else {
+ syslog(LOG_ERR, "subscr_marshal bogus opcode %s",
+ notice->z_opcode);
+ return(NULL);
+ }
+
+ if (subs) {
+
+ /* check authenticity here. The user must be authentic to get
+ a list of subscriptions. If he is not subscribed to
+ anything, this if-clause fails, and he gets a response
+ indicating no subscriptions.
+ if retrieving default subscriptions, don't care about
+ authentication. */
+
+ if (!auth && !defsubs)
+ return(NULL);
+ if (!defsubs) {
+ if (client && (strcmp(client->principal->string,
+ notice->z_sender) != 0)) {
+ zdbug ((LOG_DEBUG,
"subscr_marshal: %s requests subs for %s at %s/%d",
- notice->z_sender,
- client->zct_principal->string,
- inet_ntoa (who->sin_addr),
- ntohs (who->sin_port)));
- return 0;
- }
- }
+ notice->z_sender, client->principal->string,
+ inet_ntoa(who->sin_addr), ntohs(who->sin_port)));
+ return 0;
+ }
+ }
+
+ for (sub = subs; sub; sub = sub->next)
+ (*found)++;
- for (subs = subs2->q_forw;
- subs != subs2;
- subs = subs->q_forw, (*found)++);
-
- /* found is now the number of subscriptions */
-
- /* coalesce the subscription information into a list of
- char *'s */
- if ((answer = (char **) xmalloc((*found) * NUM_FIELDS * sizeof(char *))) == (char **) 0) {
- syslog(LOG_ERR, "subscr no mem(answer)");
- *found = 0;
- } else
- for (i = 0, subs = subs2->q_forw;
- i < *found ;
- i++, subs = subs->q_forw) {
- answer[i*NUM_FIELDS] = subs->zst_dest.classname->string;
- answer[i*NUM_FIELDS + 1] = subs->zst_dest.inst->string;
- answer[i*NUM_FIELDS + 2] = subs->zst_dest.recip->string;
- }
+ /* found is now the number of subscriptions */
+
+ /* coalesce the subscription information into a list of char *'s */
+ answer = (char **) malloc((*found) * NUM_FIELDS * sizeof(char *));
+ if (answer == NULL) {
+ syslog(LOG_ERR, "subscr no mem(answer)");
+ *found = 0;
+ } else {
+ i = 0;
+ for (sub = subs; sub; sub = sub->next) {
+ answer[i * NUM_FIELDS] = sub->dest.classname->string;
+ answer[i * NUM_FIELDS + 1] = sub->dest.inst->string;
+ answer[i * NUM_FIELDS + 2] = sub->dest.recip->string;
+ i++;
+ }
}
- if (defsubs)
- free_subscriptions(subs2);
- return(answer);
+ }
+ if (defsubs)
+ free_subscriptions(subs);
+ return answer;
}
#ifdef NEW_COMPAT
static void
new_old_compat_subscr_sendlist(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
{
- Code_t retval;
- ZNotice_t reply;
- ZPacket_t reppacket;
- int packlen, found, count, initfound, zerofound;
- char buf[64];
- Zconst char **answer;
- struct sockaddr_in send_to_who;
- register int i;
-
- new_compat_count_subscr++;
-
- syslog(LOG_INFO, "new old subscr, %s", inet_ntoa(who->sin_addr));
- reply = *notice;
- reply.z_kind = SERVACK;
- reply.z_authent_len = 0; /* save some space */
- reply.z_auth = 0;
-
- send_to_who = *who;
- send_to_who.sin_port = notice->z_port; /* Return port */
-
- if ((retval = ZSetDestAddr(&send_to_who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "new_old_subscr_sendlist set addr: %s",
- error_message(retval));
- return;
- }
+ Code_t retval;
+ ZNotice_t reply;
+ ZPacket_t reppacket;
+ int packlen, found, count, initfound, zerofound;
+ char buf[64];
+ const char **answer;
+ struct sockaddr_in send_to_who;
+ int i;
+
+ new_compat_count_subscr++;
+
+ syslog(LOG_INFO, "new old subscr, %s", inet_ntoa(who->sin_addr));
+ reply = *notice;
+ reply.z_kind = SERVACK;
+ reply.z_authent_len = 0; /* save some space */
+ reply.z_auth = 0;
+
+ send_to_who = *who;
+ send_to_who.sin_port = notice->z_port; /* Return port */
+
+ retval = ZSetDestAddr(&send_to_who);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "new_old_subscr_sendlist set addr: %s",
+ error_message(retval));
+ return;
+ }
- /* retrieve the subscriptions */
- answer = subscr_marshal_subs(notice, auth, who, &found);
+ /* retrieve the subscriptions */
+ answer = subscr_marshal_subs(notice, auth, who, &found);
- /* note that when there are no subscriptions, found == 0, so
- we needn't worry about answer being NULL since
- ZFormatSmallRawNoticeList won't reference the pointer */
+ /* note that when there are no subscriptions, found == 0, so
+ we needn't worry about answer being NULL since
+ ZFormatSmallRawNoticeList won't reference the pointer */
- /* send 5 at a time until we are finished */
- count = found?((found-1) / 5 + 1):1; /* total # to be sent */
- i = 0; /* pkt # counter */
+ /* send 5 at a time until we are finished */
+ count = found?((found-1) / 5 + 1):1; /* total # to be sent */
+ i = 0; /* pkt # counter */
#if 0
- zdbug((LOG_DEBUG,"Found %d subscriptions for %d packets",
- found,count));
+ zdbug((LOG_DEBUG,"Found %d subscriptions for %d packets", found, count));
#endif
- initfound = found;
- zerofound = (found == 0);
- while (found > 0 || zerofound) {
- packlen = sizeof(reppacket);
- (void) sprintf(buf, "%d/%d", ++i, count);
- reply.z_opcode = buf;
- retval = ZFormatSmallRawNoticeList(&reply,
- answer+(initfound-found)*NUM_FIELDS,
- ((found > 5) ? 5 : found)*NUM_FIELDS,
- reppacket,
- &packlen);
- if (retval != ZERR_NONE) {
- syslog(LOG_ERR, "subscr_sendlist format: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
- if ((retval = ZSendPacket(reppacket, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist xmit: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
- found -= 5;
- zerofound = 0;
+ initfound = found;
+ zerofound = (found == 0);
+ while (found > 0 || zerofound) {
+ packlen = sizeof(reppacket);
+ sprintf(buf, "%d/%d", ++i, count);
+ reply.z_opcode = buf;
+ retval = ZFormatSmallRawNoticeList(&reply,
+ answer + (initfound - found)
+ * NUM_FIELDS,
+ ((found > 5) ? 5 : found)
+ * NUM_FIELDS,
+ reppacket, &packlen);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "subscr_sendlist format: %s",
+ error_message(retval));
+ if (answer)
+ free(answer);
+ return;
}
+ retval = ZSendPacket(reppacket, packlen, 0);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_sendlist xmit: %s",
+ error_message(retval));
+ if (answer)
+ free(answer);
+ return;
+ }
+ found -= 5;
+ zerofound = 0;
+ }
#if 0
- zdbug((LOG_DEBUG,"subscr_sendlist acked"));
+ zdbug((LOG_DEBUG,"subscr_sendlist acked"));
#endif
- if (answer)
- xfree(answer);
- return;
+ if (answer)
+ free(answer);
}
#endif /* NEW_COMPAT */
#ifdef OLD_COMPAT
static void
old_compat_subscr_sendlist(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
{
- ZClient_t *client = client_which_client(who, notice);
- register ZSubscr_t *subs;
- Code_t retval;
- ZNotice_t reply;
- ZPacket_t reppacket;
- int packlen, i, found = 0;
- char **answer = (char **) NULL;
-
- old_compat_count_subscr++;
-
- syslog(LOG_INFO, "old old subscr, %s", inet_ntoa(who->sin_addr));
- if (client && client->zct_subs) {
-
- /* check authenticity here. The user must be authentic to get
- a list of subscriptions. If he is not subscribed to
- anything, the above test fails, and he gets a response
- indicating no subscriptions */
-
- if (!auth) {
- clt_ack(notice, who, AUTH_FAILED);
- return;
- }
-
- for (subs = client->zct_subs->q_forw;
- subs != client->zct_subs;
- subs = subs->q_forw, found++);
-
- /* found is now the number of subscriptions */
-
- /* coalesce the subscription information into a list of
- char *'s */
- if ((answer = (char **) xmalloc(found * NUM_FIELDS * sizeof(char *))) == (char **) 0) {
- syslog(LOG_ERR, "old_subscr_sendlist no mem(answer)");
- found = 0;
- } else
- for (i = 0, subs = client->zct_subs->q_forw;
- i < found ;
- i++, subs = subs->q_forw) {
- answer[i*NUM_FIELDS] = subs->zst_class;
- answer[i*NUM_FIELDS + 1] = subs->zst_classinst;
- answer[i*NUM_FIELDS + 2] = subs->zst_recipient;
- }
+ Client *client = client_which_client(&who->sin_addr, notice);
+ Destlist *subs;
+ Code_t retval;
+ ZNotice_t reply;
+ ZPacket_t reppacket;
+ int packlen, i, found = 0;
+ char **answer = NULL;
+
+ old_compat_count_subscr++;
+
+ syslog(LOG_INFO, "old old subscr, %s", inet_ntoa(who->sin_addr));
+ if (client && client->subs) {
+
+ /* check authenticity here. The user must be authentic to get
+ a list of subscriptions. If he is not subscribed to
+ anything, the above test fails, and he gets a response
+ indicating no subscriptions */
+
+ if (!auth) {
+ clt_ack(notice, who, AUTH_FAILED);
+ return;
}
- /* note that when there are no subscriptions, found == 0, so
- we needn't worry about answer being NULL */
- reply = *notice;
- reply.z_kind = SERVACK;
- reply.z_authent_len = 0; /* save some space */
- reply.z_auth = 0;
-
-
- /* if it's too long, chop off one at a time till it fits */
- while ((retval = ZFormatSmallRawNoticeList(&reply,
- answer,
- found * NUM_FIELDS,
- reppacket,
- &packlen)) == ZERR_PKTLEN) {
- found--;
- reply.z_opcode = OLD_CLIENT_INCOMPSUBS;
- }
- if (retval != ZERR_NONE) {
- syslog(LOG_ERR, "old_subscr_sendlist format: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
- if ((retval = ZSetDestAddr(who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist set addr: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
- if ((retval = ZSendPacket(reppacket, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist xmit: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
+ for (subs = client->subs; subs; subs = subs->next)
+ found++;
+ /* found is now the number of subscriptions */
+
+ /* coalesce the subscription information into a list of char *'s */
+ answer = (char **) malloc(found * NUM_FIELDS * sizeof(char *));
+ if (!answer) {
+ syslog(LOG_ERR, "old_subscr_sendlist no mem(answer)");
+ found = 0;
+ } else {
+ i = 0;
+ for (subs = client->subs; subs; subs = subs->next) {
+ answer[i*NUM_FIELDS] = subs->dest.classname->string;
+ answer[i*NUM_FIELDS + 1] = subs->dest.inst->string;
+ answer[i*NUM_FIELDS + 2] = subs->dest.recip->string;
+ i++;
+ }
}
-#if 0
- zdbug((LOG_DEBUG,"subscr_sendlist acked"));
-#endif
+ }
+
+ /* note that when there are no subscriptions, found == 0, so
+ we needn't worry about answer being NULL */
+
+ reply = *notice;
+ reply.z_kind = SERVACK;
+ reply.z_authent_len = 0; /* save some space */
+ reply.z_auth = 0;
+
+ /* if it's too long, chop off one at a time till it fits */
+ while ((retval = ZFormatSmallRawNoticeList(&reply, answer,
+ found * NUM_FIELDS,
+ reppacket,
+ &packlen)) != ZERR_PKTLEN) {
+ found--;
+ reply.z_opcode = OLD_CLIENT_INCOMPSUBS;
+ }
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "old_subscr_sendlist format: %s",
+ error_message(retval));
if (answer)
- xfree(answer);
+ free(answer);
return;
+ }
+ retval = ZSetDestAddr(who);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_sendlist set addr: %s",
+ error_message(retval));
+ if (answer)
+ free(answer);
+ return;
+ }
+ retval = ZSendPacket(reppacket, packlen, 0);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_sendlist xmit: %s",
+ error_message(retval));
+ if (answer)
+ free(answer);
+ return;
+ }
+#if 0
+ zdbug((LOG_DEBUG,"subscr_sendlist acked"));
+#endif
+ if (answer)
+ free(answer);
}
#endif /* OLD_COMPAT */
@@ -888,99 +834,89 @@ old_compat_subscr_sendlist(notice, auth, who)
/*ARGSUSED*/
Code_t
-subscr_send_subs(client, vers)
- ZClient_t *client;
- char *vers;
+subscr_send_subs(client)
+ Client *client;
{
- register int i = 0;
- register ZSubscr_t *sub;
-#ifdef KERBEROS
- char buf[512];
- C_Block cblock;
-#endif /* KERBEROS */
- char buf2[512];
- char *lyst[7 * NUM_FIELDS];
- int num = 0;
- Code_t retval;
+ int i = 0;
+ Destlist *subs;
+#ifdef ZEPHYR_USES_KERBEROS
+ char buf[512];
+ C_Block cblock;
+#endif /* ZEPHYR_USES_KERBEROS */
+ char buf2[512];
+ char *list[7 * NUM_FIELDS];
+ int num = 0;
+ Code_t retval;
#if 0
- zdbug((LOG_DEBUG, "send_subs"));
+ zdbug((LOG_DEBUG, "send_subs"));
#endif
- (void) sprintf(buf2, "%d",ntohs(client->zct_sin.sin_port));
+ sprintf(buf2, "%d",ntohs(client->addr.sin_port));
- lyst[num++] = buf2;
+ list[num++] = buf2;
-#ifdef KERBEROS
+#ifdef ZEPHYR_USES_KERBEROS
#ifdef NOENCRYPTION
- (void) memcpy((caddr_t)cblock, (caddr_t)client->zct_cblock, sizeof(C_Block));
+ memcpy(cblock, client->session_key, sizeof(C_Block));
#else
- des_ecb_encrypt(client->zct_cblock, cblock, serv_ksched.s, DES_ENCRYPT);
+ des_ecb_encrypt(client->session_key, cblock, serv_ksched.s, DES_ENCRYPT);
#endif
- if ((retval = ZMakeAscii(buf, sizeof(buf), cblock,
- sizeof(C_Block))) != ZERR_NONE) {
+ retval = ZMakeAscii(buf, sizeof(buf), cblock, sizeof(C_Block));
+ if (retval != ZERR_NONE) {
#if 0
- zdbug((LOG_DEBUG,"zmakeascii failed: %s",
- error_message(retval)));
+ zdbug((LOG_DEBUG,"zmakeascii failed: %s", error_message(retval)));
#endif
- } else {
- lyst[num++] = buf;
+ } else {
+ list[num++] = buf;
#if 0
- zdbug((LOG_DEBUG,"cblock %s",buf));
+ zdbug((LOG_DEBUG, "cblock %s", buf));
#endif
- }
-#endif /* KERBEROS */
- if ((retval = bdump_send_list_tcp(SERVACK, client->zct_sin.sin_port,
- ZEPHYR_ADMIN_CLASS,
- num > 1 ? "CBLOCK" : "",
- ADMIN_NEWCLT,
- (char*)client->zct_principal->string,
- "", lyst, num)) != ZERR_NONE ) {
- syslog(LOG_ERR, "subscr_send_subs newclt: %s",
+ }
+#endif /* ZEPHYR_USES_KERBEROS */
+ retval = bdump_send_list_tcp(SERVACK, &client->addr, ZEPHYR_ADMIN_CLASS,
+ num > 1 ? "CBLOCK" : "", ADMIN_NEWCLT,
+ client->principal->string, "", list, num);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "subscr_send_subs newclt: %s", error_message(retval));
+ return retval;
+ }
+
+ if (!client->subs)
+ return ZERR_NONE;
+
+ for (subs = client->subs; subs; subs = subs->next) {
+ /* for each subscription */
+ list[i * NUM_FIELDS] = subs->dest.classname->string;
+ list[i * NUM_FIELDS + 1] = subs->dest.inst->string;
+ list[i * NUM_FIELDS + 2] = subs->dest.recip->string;
+ i++;
+ if (i >= 7) {
+ /* we only put 7 in each packet, so we don't run out of room */
+ retval = bdump_send_list_tcp(ACKED, &client->addr,
+ ZEPHYR_CTL_CLASS, "",
+ CLIENT_SUBSCRIBE, "", "", list,
+ i * NUM_FIELDS);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "subscr_send_subs subs: %s",
error_message(retval));
- return(retval);
- }
-
- if (!client->zct_subs)
- return(ZERR_NONE);
- for (sub = client->zct_subs->q_forw;
- sub != client->zct_subs;
- sub = sub->q_forw) {
- /* for each subscription */
- lyst[i * NUM_FIELDS] = sub->zst_dest.classname->string;
- lyst[i * NUM_FIELDS + 1] = sub->zst_dest.inst->string;
- lyst[i * NUM_FIELDS + 2] = sub->zst_dest.recip->string;
- i++;
- if (i >= 7) {
- /* we only put 7 in each packet, so we don't
- run out of room */
- if ((retval = bdump_send_list_tcp(ACKED,
- client->zct_sin.sin_port,
- ZEPHYR_CTL_CLASS, "",
- CLIENT_SUBSCRIBE, "",
- "", lyst,
- i * NUM_FIELDS))
- != ZERR_NONE) {
- syslog(LOG_ERR, "subscr_send_subs subs: %s",
- error_message(retval));
- return(retval);
- }
- i = 0;
- }
+ return retval;
+ }
+ i = 0;
}
- if (i) {
- if ((retval = bdump_send_list_tcp(ACKED,
- client->zct_sin.sin_port,
- ZEPHYR_CTL_CLASS, "",
- CLIENT_SUBSCRIBE, "", "",
- lyst, i * NUM_FIELDS))
- != ZERR_NONE) {
- syslog(LOG_ERR, "subscr_send_subs subs: %s",
- error_message(retval));
- return(retval);
- }
+ }
+ if (i) {
+ retval = bdump_send_list_tcp(ACKED, &client->addr, ZEPHYR_CTL_CLASS,
+ "", CLIENT_SUBSCRIBE, "", "", list,
+ i * NUM_FIELDS);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "subscr_send_subs subs: %s",
+ error_message(retval));
+ return retval;
}
- return(ZERR_NONE);
+ }
+
+ return ZERR_NONE;
}
/*
@@ -989,85 +925,72 @@ subscr_send_subs(client, vers)
static void
free_subscriptions(subs)
- register ZSubscr_t *subs;
+ Destlist *subs;
{
- register ZSubscr_t *sub;
-
- for (sub = subs->q_forw; sub != subs; sub = subs->q_forw) {
- xremque(sub);
- free_zstring(sub->zst_dest.classname);
- free_zstring(sub->zst_dest.inst);
- free_zstring(sub->zst_dest.recip);
- xfree(sub);
- }
- free_zstring(subs->zst_dest.classname);
- free_zstring(subs->zst_dest.inst);
- free_zstring(subs->zst_dest.recip);
- xfree(subs);
-
- return;
+ Destlist *next;
+
+ for (; subs; subs = next) {
+ next = subs->next;
+ free_string(subs->dest.classname);
+ free_string(subs->dest.inst);
+ free_string(subs->dest.recip);
+ free(subs);
+ }
}
#define ADVANCE(xx) { cp += (strlen(cp) + 1); \
if (cp >= notice->z_message + notice->z_message_len) { \
- syslog(LOG_WARNING, "malformed subscription %d", xx); \
- return(subs); \
+ syslog(LOG_WARNING, "malformed subscription %d", \
+ xx); \
+ return subs; \
}}
/*
* Parse the message body, returning a linked list of subscriptions, or
- * NULLZST if there are no subscriptions there.
+ * NULL if there are no subscriptions there.
*/
-static ZSubscr_t *
+static Destlist *
extract_subscriptions(notice)
- register ZNotice_t *notice;
+ ZNotice_t *notice;
{
- register ZSubscr_t *subs = NULLZST, *subs2;
- register char *recip, *class_name, *classinst;
- register char *cp = notice->z_message;
-
- /* parse the data area for the subscriptions */
- while (cp < notice->z_message + notice->z_message_len) {
- class_name = cp;
- if (*cp == '\0')
- /* we've exhausted the subscriptions */
- return(subs);
- ADVANCE(1);
- classinst = cp;
- ADVANCE(2);
- recip = cp;
+ Destlist *subs = NULL, *sub;
+ char *recip, *class_name, *classinst;
+ char *cp = notice->z_message;
+
+ /* parse the data area for the subscriptions */
+ while (cp < notice->z_message + notice->z_message_len) {
+ class_name = cp;
+ if (*cp == '\0') /* we've exhausted the subscriptions */
+ return(subs);
+ ADVANCE(1);
+ classinst = cp;
+ ADVANCE(2);
+ recip = cp;
#if 0
- zdbug((LOG_DEBUG, "ext_sub: CLS %s INST %s RCPT %s",
- class_name, classinst, cp));
+ zdbug((LOG_DEBUG, "ext_sub: CLS %s INST %s RCPT %s",
+ class_name, classinst, cp));
#endif
- cp += (strlen(cp) + 1);
- if (cp > notice->z_message + notice->z_message_len) {
- syslog(LOG_WARNING, "malformed sub 3");
- return(subs);
- }
- if (!subs) {
- if (!(subs = (ZSubscr_t *)
- xmalloc(sizeof(ZSubscr_t)))) {
- syslog(LOG_WARNING, "ex_subs: no mem");
- return(NULLZST);
- }
- subs->q_forw = subs->q_back = subs;
- subs->zst_dest.classname = subs->zst_dest.inst =
- subs->zst_dest.recip = NULL;
- }
- if (!(subs2 = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t)))) {
- syslog(LOG_WARNING, "ex_subs: no mem 2");
- return(subs);
- }
- subs2->q_forw = subs2->q_back = subs2;
- subs2->zst_dest.classname = make_zstring(class_name,1);
- subs2->zst_dest.inst = make_zstring(classinst,1);
- subs2->zst_dest.recip = make_zstring(recip,0);
-
- xinsque(subs2, subs);
+ cp += (strlen(cp) + 1);
+ if (cp > notice->z_message + notice->z_message_len) {
+ syslog(LOG_WARNING, "malformed sub 3");
+ return subs;
+ }
+ sub = (Destlist *) malloc(sizeof(Destlist));
+ if (!sub) {
+ syslog(LOG_WARNING, "ex_subs: no mem 2");
+ return subs;
}
- return(subs);
+ sub->dest.classname = make_string(class_name, 1);
+ sub->dest.inst = make_string(classinst, 1);
+ /* Nuke @REALM if REALM is us. */
+ if (recip[0] == '@' && !strcmp(recip + 1, ZGetRealm()))
+ sub->dest.recip = make_string("", 0);
+ else
+ sub->dest.recip = make_string(recip, 0);
+ LIST_INSERT(&subs, sub);
+ }
+ return subs;
}
/*
@@ -1078,24 +1001,538 @@ extract_subscriptions(notice)
void
subscr_dump_subs(fp, subs)
- FILE *fp;
- ZSubscr_t *subs;
+ FILE *fp;
+ Destlist *subs;
{
- register ZSubscr_t *ptr;
- register char *p;
+ char *p;
- if (!subs) /* no subscriptions to dump */
- return;
-
- for (ptr = subs->q_forw; ptr != subs; ptr = ptr->q_forw) {
- fputs("\t\t'", fp);
- subscr_quote(ptr->zst_dest.classname->string, fp);
- fputs("' '", fp);
- subscr_quote(ptr->zst_dest.inst->string, fp);
- fputs("' '", fp);
- subscr_quote(ptr->zst_dest.recip->string, fp);
- fputs("'\n", fp);
- }
+ if (!subs) /* no subscriptions to dump */
return;
+
+ for (; subs; subs = subs->next) {
+ fputs("\t\t'", fp);
+ dump_quote(subs->dest.classname->string, fp);
+ fputs("' '", fp);
+ dump_quote(subs->dest.inst->string, fp);
+ fputs("' '", fp);
+ dump_quote(subs->dest.recip->string, fp);
+ fputs("'\n", fp);
+ }
+}
+
+#define I_ADVANCE(xx) { cp += (strlen(cp) + 1); \
+ if (cp >= notice->z_message + notice->z_message_len) { \
+ syslog(LOG_WARNING, "malformed subscription %d", \
+ xx); \
+ return (ZERR_NONE); \
+ }}
+
+/* As it exists, this function expects to take only the first sub from the
+ * Destlist. At some point, it and the calling code should be replaced */
+static Code_t
+subscr_realm_sendit(who, subs, notice, realm)
+ Client *who;
+ Destlist *subs;
+ ZNotice_t *notice;
+ Realm *realm;
+{
+#if 0
+ Destlist *subs2;
+#endif
+ ZNotice_t snotice;
+ char *pack;
+ int packlen;
+ int found = 0, i;
+ char **text;
+ Code_t retval;
+ char addr[16]; /* xxx.xxx.xxx.xxx max */
+ char port[16];
+
+#if 0
+ zdbug((LOG_DEBUG, "subscr_rlm_sendit"));
+#endif
+
+
+#ifdef notdef
+ for (subs2 = subs; subs2; subs2 = subs2->next, found++);
+ /* found is now the number of subscriptions */
+
+ /* coalesce the subscription information into a list of char *'s */
+ /* one extra for client information */
+ if ((text = (char **) malloc((found * NUM_FIELDS + 2)
+ * sizeof(char *))) == (char **) 0)
+ {
+ syslog(LOG_ERR, "subscr_rlm_sendit malloc");
+ return(ENOMEM);
+ }
+#endif /* notdef */
+
+ if ((text=(char **)malloc((NUM_FIELDS + 2)*sizeof(char *))) == (char **)0) {
+ syslog(LOG_ERR, "subscr_rlm_sendit malloc");
+ return(ENOMEM);
+ }
+ /* convert the address to a string of the form x.x.x.x/port */
+ strcpy(addr, inet_ntoa(notice->z_sender_addr));
+ if ((retval = ZMakeAscii(port, sizeof(port), (unsigned char *)
+ &notice->z_port, sizeof(u_short))) != ZERR_NONE)
+ {
+ syslog(LOG_ERR, "subscr_rlm_sendit make ascii: %s",
+ error_message(retval));
+ return(ZERR_NONE);
+ }
+ text[0] = addr;
+ text[1] = port;
+
+#ifdef notdef
+ for (i = 0, subs2 = subs; subs2, i < found ; i++, subs2 = subs2->next) {
+ text[i*NUM_FIELDS + 2] = subs2->dest.classname->string;
+ text[i*NUM_FIELDS + 3] = subs2->dest.inst->string;
+ text[i*NUM_FIELDS + 4] = subs2->dest.recip->string;
+ }
+#endif /* notdef */
+
+ text[2] = subs->dest.classname->string;
+ text[3] = subs->dest.inst->string;
+ text[4] = subs->dest.recip->string;
+
+ /* format snotice */
+ snotice.z_class_inst = ZEPHYR_CTL_REALM;
+ snotice.z_opcode = REALM_REQ_SUBSCRIBE;
+ snotice.z_port = srv_addr.sin_port;
+
+ snotice.z_class = ZEPHYR_CTL_CLASS;
+
+ snotice.z_recipient = "";
+ snotice.z_kind = ACKED;
+ snotice.z_num_other_fields = 0;
+ snotice.z_default_format = "";
+ snotice.z_sender = notice->z_sender;
+ snotice.z_recipient = notice->z_recipient;
+ snotice.z_default_format = notice->z_default_format;
+
+#ifdef notdef
+ if ((retval = ZFormatNoticeList(&snotice, text, found * NUM_FIELDS + 2,
+ &pack, &packlen, ZNOAUTH)) != ZERR_NONE)
+#else
+ if ((retval = ZFormatNoticeList(&snotice, text, NUM_FIELDS + 2,
+ &pack, &packlen, ZNOAUTH)) != ZERR_NONE)
+#endif
+ {
+ syslog(LOG_WARNING, "subscr_rlm_sendit format: %s",
+ error_message(retval));
+ free(text);
+ return(ZERR_NONE);
+ }
+ free(text);
+
+ if ((retval = ZParseNotice(pack, packlen, &snotice)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_rlm_sendit parse: %s",
+ error_message(retval));
+ free(pack);
+ return(ZERR_NONE);
+ }
+
+#if 0
+ zdbug((LOG_DEBUG,"subscr_rlm_sendit len: %d", snotice.z_message_len));
+#endif
+ realm_handoff(&snotice, 1, &(who->addr), realm, 0);
+ free(pack);
+
+ return(ZERR_NONE);
+}
+
+static Code_t
+subscr_add_raw(client, realm, newsubs)
+ Client *client;
+ Realm *realm;
+ Destlist *newsubs;
+{
+ Destlist *subs, *subs2, *subs3, **head;
+ Code_t retval;
+
+#if 0
+ zdbug((LOG_DEBUG, "subscr_add_raw"));
+#endif
+ head = (realm) ? &realm->subs : &client->subs;
+
+ /* Loop over the new subscriptions. */
+ for (subs = newsubs; subs; subs = subs2) {
+ subs2 = subs->next;
+#ifdef DEBUG
+ zdbug((LOG_DEBUG,"subscr_add_raw: %s/%s/%s", subs->dest.classname->string, subs->dest.inst->string, subs->dest.recip->string));
+ if (realm)
+ zdbug((LOG_DEBUG,"subscr_add_raw: realm is %s", realm->name));
+#endif
+ retval = triplet_register(client, &subs->dest, realm);
+ if (retval != ZERR_NONE) {
+ free(subs);
+ if (retval == ZSRV_CLASSXISTS) {
+ continue;
+ } else {
+ free_subscriptions(subs2);
+ return retval;
+ }
+ }
+ LIST_INSERT(head, subs);
+ }
+ return ZERR_NONE;
+}
+
+Code_t
+subscr_realm(realm, notice)
+ Realm *realm;
+ ZNotice_t *notice;
+{
+ Destlist *newsubs;
+
+ newsubs = extract_subscriptions(notice);
+
+ if (!newsubs) {
+ syslog(LOG_WARNING, "empty subs in subscr_realm");
+ return(ZERR_NONE);
+ }
+
+ return(subscr_add_raw(realm->client, realm, newsubs));
+}
+
+/* Like realm_sendit, this only takes one item from subs */
+static void
+subscr_unsub_sendit(subs, realm)
+ Destlist *subs;
+ Realm *realm;
+{
+ ZNotice_t unotice;
+ Code_t retval;
+#ifdef notdef
+ char *list[7 * NUM_FIELDS];
+#else /* notdef */
+ char *list[NUM_FIELDS];
+#endif /* notdef */
+ char *pack;
+ int packlen;
+ int found = 0;
+ Destlist *subs2;
+
+ unotice.z_class = ZEPHYR_CTL_CLASS;
+ unotice.z_class_inst = ZEPHYR_CTL_REALM;
+ unotice.z_opcode = REALM_UNSUBSCRIBE;
+ unotice.z_recipient = "";
+ unotice.z_kind = ACKED;
+
+ unotice.z_sender = "";
+ unotice.z_port = srv_addr.sin_port;
+ unotice.z_num_other_fields = 0;
+ unotice.z_default_format = "";
+
+#ifdef notdef
+ found = 0;
+ for (subs2 = subs; subs2; subs2 = subs2->next) {
+ list[found * NUM_FIELDS] = subs2->dest.classname->string;
+ list[found * NUM_FIELDS + 1] = subs2->dest.inst->string;
+ list[found * NUM_FIELDS + 2] = "";
+
+ found++;
+
+ if (found >= 7) {
+ if ((retval = ZFormatNoticeList(&unotice, list, found * NUM_FIELDS, &pack, &packlen, ZNOAUTH)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_unsub_sendit format: %s",
+ error_message(retval));
+ return;
+ }
+ if ((retval = ZParseNotice(pack, packlen, &unotice)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_unsub_sendit parse: %s",
+ error_message(retval));
+ free(pack);
+ return;
+ }
+ free(pack);
+ realm_handoff(&unotice, 1, (struct sockaddr_in *) 0, realm, 0);
+ found = 0;
+ }
+ }
+
+ if (found == 0)
+ return;
+
+ if ((retval = ZFormatNoticeList(&unotice, list, found * NUM_FIELDS, &pack, &packlen, ZNOAUTH)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_unsub_sendit format: %s",
+ error_message(retval));
+ return;
+ }
+#else /* notdef */
+ list[0] = subs->dest.classname->string;
+ list[1] = subs->dest.inst->string;
+ list[2] = "";
+
+ if ((retval = ZFormatNoticeList(&unotice, list, NUM_FIELDS, &pack, &packlen, ZNOAUTH)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_unsub_sendit format: %s",
+ error_message(retval));
+ return;
+ }
+#endif /* notdef */
+
+ if ((retval = ZParseNotice(pack, packlen, &unotice)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_unsub_sendit parse: %s",
+ error_message(retval));
+ free(pack);
+ return;
+ }
+ free(pack);
+ realm_handoff(&unotice, 1, (struct sockaddr_in *) 0, realm, 0);
+}
+
+Code_t
+subscr_send_realm_subs(realm)
+ Realm *realm;
+{
+ int i = 0;
+ Destlist *subs, *next;
+ char buf[512];
+ char *list[7 * NUM_FIELDS];
+ int num = 0;
+ Code_t retval;
+
+#if 0
+ zdbug((LOG_DEBUG, "send_realm_subs"));
+#endif
+
+ strcpy(buf, realm->name);
+ list[num++] = buf;
+
+ retval = bdump_send_list_tcp(SERVACK, &srv_addr, ZEPHYR_ADMIN_CLASS,
+ "", ADMIN_NEWREALM, "", "", list, num);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "subscr_send_realm_subs newclt: %s", error_message(retval));
+ return retval;
+ }
+
+ if (!realm->subs)
+ return ZERR_NONE;
+
+ for (subs=realm->subs; subs; subs = next) {
+ next = subs->next;
+#ifdef DEBUG
+ zdbug ((LOG_DEBUG, "send_realm_subs: %s/%s/%s", subs->dest.classname->string,
+ subs->dest.inst->string, subs->dest.recip->string));
+#endif
+ /* for each subscription */
+ list[i * NUM_FIELDS] = subs->dest.classname->string;
+ list[i * NUM_FIELDS + 1] = subs->dest.inst->string;
+ list[i * NUM_FIELDS + 2] = subs->dest.recip->string;
+ i++;
+ if (i >= 7) {
+ /* we only put 7 in each packet, so we don't run out of room */
+ retval = bdump_send_list_tcp(ACKED, &srv_addr,
+ ZEPHYR_CTL_CLASS, "",
+ REALM_SUBSCRIBE, "", "", list,
+ i * NUM_FIELDS);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "subscr_send_realm_subs subs: %s",
+ error_message(retval));
+ return retval;
+ }
+ i = 0;
+ }
+ }
+ if (i) {
+ retval = bdump_send_list_tcp(ACKED, &srv_addr, ZEPHYR_CTL_CLASS,
+ "", REALM_SUBSCRIBE, "", "", list,
+ i * NUM_FIELDS);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "subscr_send_realm_subs subs: %s",
+ error_message(retval));
+ return retval;
+ }
+ }
+
+ return ZERR_NONE;
+}
+
+static Code_t
+subscr_check_foreign_subs(notice, who, realm, newsubs)
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
+ Realm *realm;
+ Destlist *newsubs;
+{
+ Destlist *subs, *subs2, *next;
+ Acl *acl;
+ char **text;
+ int found = 0;
+ ZNotice_t snotice;
+ char *pack, *cp;
+ int packlen;
+ Code_t retval;
+ String *sender;
+
+ for (subs = newsubs; subs; subs = subs->next)
+ found++;
+
+ if (found == 0)
+ return(ZERR_NONE);
+
+ sender = make_string(notice->z_sender, 0);
+
+ if ((text = (char **)malloc((found * NUM_FIELDS + 2) * sizeof(char *))) == (char **) 0) {
+ syslog(LOG_ERR, "subscr_ck_forn_subs no mem(text)");
+ return(ENOMEM);
+ }
+
+ /* grab the client information from the incoming message */
+ cp = notice->z_message;
+ text[0] = cp;
+
+ I_ADVANCE(2);
+ text[1] = cp;
+
+ I_ADVANCE(3);
+
+ found = 0;
+ for (subs = newsubs; subs; subs = next) {
+ next=subs->next;
+ acl = class_get_acl(subs->dest.classname);
+ if (acl) {
+ if (!access_check(sender->string, acl, SUBSCRIBE)) {
+ syslog(LOG_WARNING, "subscr unauth %s class %s",
+ sender->string, subs->dest.classname->string);
+ continue; /* the for loop */
+ }
+ if (wildcard_instance == subs->dest.inst) {
+ if (!access_check(sender->string, acl, INSTWILD)) {
+ syslog(LOG_WARNING,
+ "subscr unauth %s class %s wild inst",
+ sender->string, subs->dest.classname->string);
+ continue;
+ }
+ }
+ }
+
+ /* okay to subscribe. save for return trip */
+ text[found*NUM_FIELDS + 2] = subs->dest.classname->string;
+ text[found*NUM_FIELDS + 3] = subs->dest.inst->string;
+ text[found*NUM_FIELDS + 4] = "";
+ found++;
+
+ retval = triplet_register(realm->client, &subs->dest, realm);
+#ifdef DEBUG
+ zdbug ((LOG_DEBUG, "ck_frn_subs: %s/%s/%s", subs->dest.classname->string,
+ subs->dest.inst->string, subs->dest.recip->string));
+#endif
+
+ if (retval != ZERR_NONE) {
+ if (retval == ZSRV_CLASSXISTS) {
+ continue;
+ } else {
+ free_subscriptions(subs->next);
+ free(text);
+ return retval;
+ }
+ }
+ LIST_INSERT(&realm->subs, subs);
+ }
+ /* don't send confirmation if we're not the initial server contacted */
+ if (!(server_which_server(who) || found == 0)) {
+ snotice = *notice;
+ snotice.z_opcode = REALM_ADD_SUBSCRIBE;
+ snotice.z_class_inst = ZEPHYR_CTL_REALM;
+ snotice.z_port = srv_addr.sin_port;
+ if ((retval = ZFormatNoticeList(&snotice, text, found * NUM_FIELDS + 2, &pack, &packlen, ZNOAUTH)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_ck_forn_subs format: %s",
+ error_message(retval));
+ free(text);
+ return(ZERR_NONE);
+ }
+ if ((retval = ZParseNotice(pack, packlen, &snotice)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_ck_forn_subs parse: %s",
+ error_message(retval));
+ free(text);
+ free(pack);
+ return(ZERR_NONE);
+ }
+ realm_handoff(&snotice, 1, who, realm, 0);
+ free(pack);
+ }
+ free(text);
+ return ZERR_NONE;
+}
+
+Code_t subscr_foreign_user(notice, who, realm)
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
+ Realm *realm;
+{
+ Destlist *newsubs, *temp;
+ Acl *acl;
+ Code_t status;
+ Client *client;
+ ZNotice_t snotice;
+ struct sockaddr_in newwho;
+ char *cp;
+ char rlm_recipient[REALM_SZ + 1];
+
+#if 0
+ zdbug((LOG_DEBUG, "subscr_foreign_user"));
+#endif
+
+ cp = notice->z_message;
+
+ newwho.sin_addr.s_addr = inet_addr(cp);
+ if (newwho.sin_addr.s_addr == -1) {
+ syslog(LOG_ERR, "malformed addr from %s, notice->z_sender");
+ return(ZERR_NONE);
+ }
+
+ I_ADVANCE(0);
+
+ snotice = *notice;
+
+ if ((status = ZReadAscii(cp, strlen(cp), (unsigned char *)&snotice.z_port, sizeof(u_short)))
+ != ZERR_NONE)
+ {
+ syslog(LOG_ERR, "subscr_foreign_user read ascii: %s",
+ error_message(status));
+ return(ZERR_NONE);
+ }
+
+ I_ADVANCE(1);
+
+ snotice.z_message = cp;
+ snotice.z_message_len = notice->z_message_len - (cp - notice->z_message);
+
+ newsubs = extract_subscriptions(&snotice);
+ if (!newsubs) {
+ syslog(LOG_WARNING, "empty subscr for %s", notice->z_sender);
+ return(ZERR_NONE);
+ }
+
+ if (!strcmp(snotice.z_opcode, REALM_ADD_SUBSCRIBE)) {
+ /* this was approved by the other realm, add subscriptions */
+
+ client = client_which_client(&newwho.sin_addr, &snotice);
+ if (client == (Client *)0) {
+ syslog(LOG_WARNING, "no client at %s/%d",
+ inet_ntoa(newwho.sin_addr), ntohs(snotice.z_port));
+ free_subscriptions(newsubs);
+ return(ZERR_NONE);
+ }
+
+ /* translate the recipient to represent the foreign realm */
+ sprintf(rlm_recipient, "@%s", realm->name);
+ for (temp = newsubs; temp; temp = temp->next) {
+#if 0
+ syslog(LOG_DEBUG, "in foreign_user: class is %s", temp->dest.classname->string);
+#endif
+ temp->dest.recip = make_string(rlm_recipient, 0);
+ }
+
+ status = subscr_add_raw(client, (Realm *)0, newsubs);
+ } else if (!strcmp(snotice.z_opcode, REALM_REQ_SUBSCRIBE)) {
+ status = subscr_check_foreign_subs(notice, who, realm, newsubs);
+ } else {
+ syslog(LOG_ERR, "bogus opcode %s in subscr_forn_user",
+ snotice.z_opcode);
+ status = ZERR_NONE;
+ }
+ return(status);
}
diff --git a/server/subscr.c.old b/server/subscr.c.old
deleted file mode 100644
index cb2b110..0000000
--- a/server/subscr.c.old
+++ /dev/null
@@ -1,1384 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains functions for managing subscription lists.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- *
- * Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#ifndef lint
-#ifndef SABER
-static char rcsid_subscr_c[] = "$Id$";
-#endif
-#endif
-
-/*
- * The subscription manager.
- *
- * External functions:
- *
- * Code_t subscr_subscribe(who, notice)
- * ZClient_t *who;
- * ZNotice_t *notice;
- *
- * Code_t subscr_cancel(sin, notice)
- * struct sockaddr_in *sin;
- * ZNotice_t *notice;
- *
- * Code_t subscr_cancel_client(client)
- * ZClient_t *client;
- *
- * Code_t subscr_cancel_host(addr)
- * struct in_addr *addr;
- *
- * ZClientList_t *subscr_match_list(notice)
- * ZNotice_t *notice;
- *
- * void subscr_free_list(list)
- * ZClientList_t *list;
- *
- * void subscr_sendlist(notice, auth, who)
- * ZNotice_t *notice;
- * int auth;
- * struct sockaddr_in *who;
- *
- * Code_t subscr_send_subs(client, vers)
- * ZClient_t *client;
- * char *vers;
- *
- * Code_t subscr_def_subs(who)
- * ZClient_t *who;
- *
- * void subscr_reset();
- *
- */
-
-#include "zserver.h"
-#include <ctype.h>
-#include <strings.h>
-#include <sys/stat.h>
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-#ifdef KERBEROS
-#ifndef NOENCRYPTION
-C_Block serv_key;
-Sched serv_ksched;
-#endif
-#endif
-
-/* for compatibility when sending subscription information to old clients */
-
-static void check_sub_order P((ZSubscr_t *subs, int wc));
-#ifdef OLD_COMPAT
-#define OLD_ZEPHYR_VERSION "ZEPH0.0"
-#define OLD_CLIENT_INCOMPSUBS "INCOMP"
-static void old_compat_subscr_sendlist P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern int old_compat_count_subscr; /* counter of old use */
-#endif /* OLD_COMPAT */
-#ifdef NEW_COMPAT
-#define NEW_OLD_ZEPHYR_VERSION "ZEPH0.1"
-static void new_old_compat_subscr_sendlist P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern int new_compat_count_subscr; /* counter of old use */
-#endif /* NEW_COMPAT */
-
-extern char *re_comp(), *re_conv();
-static ZSubscr_t *extract_subscriptions P((register ZNotice_t *notice));
-static int clt_unique P((ZClient_t *clt, ZClientList_t *clist));
-static void free_subscriptions P((register ZSubscr_t *subs));
-static char **subscr_marshal_subs P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- register int *found));
-static Code_t subscr_subscribe_real P((ZClient_t *who, ZSubscr_t *newsubs,
- ZNotice_t *notice));
-static ZSubscr_t *subscr_copy_def_subs P((char *));
-static int cl_match P((ZSubscr_t*, ZClient_t *));
-
-static int defaults_read = 0; /* set to 1 if the default subs
- are in memory */
-static ZNotice_t default_notice; /* contains default subscriptions */
-
-#undef P
-
-ZSTRING *wildcard_class;
-ZSTRING *wildcard_instance;
-ZSTRING *empty;
-ZSubscr_t matchall_sub;
-
-/* WARNING: make sure this is the same as the number of strings you */
-/* plan to hand back to the user in response to a subscription check, */
-/* else you will lose. See subscr_sendlist() */
-#define NUM_FIELDS 3
-
-/*
- * subscribe the client to types described in notice.
- */
-
-Code_t
-subscr_subscribe(who, notice)
- ZClient_t *who;
- ZNotice_t *notice;
-{
- ZSubscr_t *subs;
-
- if (!who->zct_subs) {
- /* allocate a subscription head */
- if (!(subs = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t))))
- return(ENOMEM);
- subs->q_forw = subs->q_back = subs;
- subs->zst_dest.classname = subs->zst_dest.inst =
- subs->zst_dest.recip = NULL;
- subs->zst_dest.hash_value = 0;
- who->zct_subs = subs;
- }
-
- if (!(subs = extract_subscriptions(notice)))
- return(ZERR_NONE); /* no subscr -> no error */
-
- return(subscr_subscribe_real(who, subs, notice));
-}
-
-static Code_t
-subscr_subscribe_real(who, newsubs, notice)
- ZClient_t *who;
- register ZSubscr_t *newsubs;
- ZNotice_t *notice;
-{
- Code_t retval;
- ZAcl_t *acl;
- ZSTRING *sender;
- ZSubscr_t *subs2, *subs3, *subs;
- int relation;
-
- sender = make_zstring(notice->z_sender,0);
-
- START_CRITICAL_CODE;
-
- for (subs = newsubs->q_forw;
- subs != newsubs;
- subs = subs->q_forw) {
- /* for each new subscription */
-
-#if 0
- zdbug ((LOG_DEBUG, "subscr: %s/%s/%s",
- subs->zst_dest.classname->string,
- subs->zst_dest.inst->string,
- subs->zst_dest.recip->string));
-#endif
-
- if (!bdumping
- && (subs->zst_dest.recip != empty)
- && (subs->zst_dest.recip != sender)) {
- syslog(LOG_WARNING, "subscr unauth %s recipient %s",
- sender->string,
- subs->zst_dest.recip->string);
- continue;
- }
- if (!bdumping) {
- acl = class_get_acl(subs->zst_dest.classname);
- if (acl) {
- if (!(access_check(sender->string, acl, SUBSCRIBE))) {
- syslog(LOG_WARNING,
- "subscr unauth %s class %s",
- sender->string,
- subs->zst_dest.classname->string);
- continue; /* the for loop */
- }
- if (wildcard_instance == subs->zst_dest.inst) {
- if (!access_check(sender->string, acl, INSTWILD)) {
- syslog(LOG_WARNING,
- "subscr unauth %s class %s wild inst",
- notice->z_sender,
- subs->zst_dest.classname->string);
- continue;
- }
- }
- }
- }
- /* subscriptions are stored in ascending order by */
- /* subscription hash value */
- /* Scan through list to check for duplicates, and to find */
- /* where to insert these subs */
-
- for (subs2 = who->zct_subs->q_forw;
- subs2 != who->zct_subs;
- subs2 = subs2->q_forw) {
- /* for each existing subscription */
- relation = compare_subs(subs2,subs,0);
- if (relation == 0)
- goto duplicate;
- if (relation > 0) /* we have passed last possible one */
- break;
- if (relation < 0) /* nope... */
- continue;
- }
-
- /* subs2 now points to the first class which is greater
- than the new class. We need to back up so that the
- insertion below goes BEFORE this one (i.e. after the
- previous one) */
- subs2 = subs2->q_back;
-
- /* ok, we are a new subscription. register and chain on. */
-
- if (!(subs3 = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t)))) {
- free_subscriptions(newsubs);
- END_CRITICAL_CODE;
- return(ENOMEM);
- }
-
- subs3->q_forw = subs3->q_back = subs3;
- subs3->zst_dest.classname =
- dup_zstring(subs->zst_dest.classname);
- subs3->zst_dest.inst = dup_zstring(subs->zst_dest.inst);
- subs3->zst_dest.recip = dup_zstring(subs->zst_dest.recip);
- set_ZDestination_hash(&subs3->zst_dest);
-
- if ((retval = class_register(who, subs)) != ZERR_NONE) {
- xfree(subs3);
- free_subscriptions(newsubs);
- END_CRITICAL_CODE;
- return(retval);
- }
-
- /* subs2 was adjusted above */
- xinsque(subs3, subs2);
- duplicate:
- ;
- }
-
- END_CRITICAL_CODE;
-
- free_subscriptions(newsubs);
- return(ZERR_NONE);
-}
-
-/*
- * add default subscriptions to the client's subscription chain.
- */
-
-Code_t
-subscr_def_subs(who)
- ZClient_t *who;
-{
- ZSubscr_t *subs;
-
- if (!who->zct_subs) {
- /* allocate a subscription head */
- if (!(subs = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t)))) {
- syslog(LOG_ERR, "no mem subscr_def_subs");
- return(ENOMEM);
- }
- subs->q_forw = subs->q_back = subs;
- subs->zst_dest.classname = subs->zst_dest.inst =
- subs->zst_dest.recip = (ZSTRING *) NULL;
- subs->zst_dest.hash_value = 0;
- who->zct_subs = subs;
- }
-
- subs = subscr_copy_def_subs(who->zct_principal->string);
- return(subscr_subscribe_real(who, subs, &default_notice));
-}
-
-void
-subscr_reset()
-{
-#if 0
- zdbug((LOG_DEBUG, "subscr_reset()"));
-#endif
- xfree(default_notice.z_message);
- default_notice.z_message = NULL;
- defaults_read = 0;
-}
-
-static ZSubscr_t *
-subscr_copy_def_subs(person)
- char *person;
-{
- int retval;
- int fd;
- struct stat statbuf;
- char *def_sub_area;
- register char *cp;
- ZSubscr_t *subs;
- register ZSubscr_t *subs2;
-
- if (!defaults_read) {
-#if 0
- zdbug((LOG_DEBUG, "reading default subscription file"));
-#endif
- fd = open(DEFAULT_SUBS_FILE, O_RDONLY, 0666);
- if (fd < 0) {
- syslog(LOG_ERR, "can't open %s:%m", DEFAULT_SUBS_FILE);
- return((ZSubscr_t *)0);
- }
- retval = fstat(fd, &statbuf);
- if (retval < 0) {
- syslog(LOG_ERR, "fstat failure on %s:%m",
- DEFAULT_SUBS_FILE);
- (void) close(fd);
- return((ZSubscr_t *)0);
- }
- if (!(def_sub_area = (char *) xmalloc(statbuf.st_size + 1))) {
- syslog(LOG_ERR, "no mem copy_def_subs");
- (void) close(fd);
- return((ZSubscr_t *)0);
- }
- retval = read(fd, def_sub_area, (int) statbuf.st_size);
- /*
- "Upon successful completion, read and readv return the number
- of bytes actually read and placed in the buffer. The system
- guarantees to read the number of bytes requested if the
- descriptor references a normal file that has that many bytes
- left before the end-of-file, but in no other case."
- -- read(2)
- Therefore, the following test is valid.
- */
- if (retval != statbuf.st_size) {
- syslog(LOG_ERR, "short read in copy_def_subs");
- (void) close(fd);
- return((ZSubscr_t *)0);
- }
-
- (void) close(fd);
- def_sub_area[statbuf.st_size] = '\0'; /* null-terminate it */
-
- /*
- def_subs_area now points to a buffer full of subscription
- info.
- each line of the stuff is of the form:
- class,inst,recipient
-
- Commas and newlines may not appear as part of the class,
- instance, or recipient. XXX!
- */
-
- /* split up the subscription info */
- for (cp = def_sub_area;
- cp < def_sub_area + statbuf.st_size;
- cp++)
- if ((*cp == '\n') || (*cp == ','))
- *cp = '\0';
- default_notice.z_message = def_sub_area;
- default_notice.z_message_len = (int) statbuf.st_size + 1;
- default_notice.z_auth = 1;
- defaults_read = 1;
- }
- /* needed later for access_check() */
- default_notice.z_sender = person;
- subs = extract_subscriptions(&default_notice);
- /* replace any non-* recipients with "person" */
-
- for (subs2 = subs->q_forw; subs2 != subs; subs2 = subs2->q_forw) {
- /* if not a wildcard, replace it with person */
- if (strcmp(subs2->zst_dest.recip->string, "*")) {
- free_zstring(subs2->zst_dest.recip);
- subs2->zst_dest.recip = make_zstring(person,0);
- } else { /* replace with null recipient */
- free_zstring(subs2->zst_dest.recip);
- subs2->zst_dest.recip = dup_zstring(empty);
- }
- set_ZDestination_hash(&(subs2->zst_dest));
- }
- return(subs);
-}
-
-/*
- * Cancel one subscription.
- */
-
-Code_t
-subscr_cancel(sin, notice)
- struct sockaddr_in *sin;
- ZNotice_t *notice;
-{
- ZClient_t *who;
- register ZSubscr_t *subs, *subs2, *subs3, *subs4;
- Code_t retval;
- int found = 0;
- int relation;
-
-#if 0
- zdbug((LOG_DEBUG,"subscr_cancel"));
-#endif
- if (!(who = client_which_client(sin, notice)))
- return(ZSRV_NOCLT);
-
- if (!who->zct_subs)
- return(ZSRV_NOSUB);
-
- if (!(subs = extract_subscriptions(notice)))
- return(ZERR_NONE); /* no subscr -> no error */
-
- START_CRITICAL_CODE;
-
- for (subs4 = subs->q_forw; subs4 != subs; subs4 = subs4->q_forw) {
- for (subs2 = who->zct_subs->q_forw;
- subs2 != who->zct_subs;) {
- /* for each existing subscription */
- /* is this what we are canceling? */
- relation = compare_subs(subs2, subs4,0);
- if (relation < 0) {
- subs2 = subs2->q_forw;
- continue;
- }
- if (relation > 0)
- /* We have passed last possible one */
- break;
-
- /* go back, since remque will change things */
- subs3 = subs2->q_back;
- xremque(subs2);
- (void) class_deregister(who, subs2);
- free_zstring(subs2->zst_dest.classname);
- free_zstring(subs2->zst_dest.inst);
- free_zstring(subs2->zst_dest.recip);
- xfree(subs2);
- found = 1;
- /* now that the remque adjusted the linked
- list, we go forward again */
- subs2 = subs3->q_forw;
- break;
- }
- }
-
- /* make sure we are still registered for all the classes */
- if (found) {
- for (subs2 = who->zct_subs->q_forw;
- subs2 != who->zct_subs;
- subs2 = subs2->q_forw)
- if ((retval = class_register(who, subs2)) != ZERR_NONE) {
- free_subscriptions(subs);
- END_CRITICAL_CODE;
- return(retval);
- }
- }
-
- END_CRITICAL_CODE;
-
- free_subscriptions(subs);
- if (found) {
-#if 0
- zdbug((LOG_DEBUG, "found & removed"));
-#endif
- return(ZERR_NONE);
- } else {
-#if 0
- zdbug((LOG_DEBUG, "not found"));
-#endif
- return(ZSRV_NOSUB);
- }
-}
-
-/*
- * Cancel all the subscriptions for this client.
- */
-
-void
-subscr_cancel_client(client)
- ZClient_t *client;
-{
- register ZSubscr_t *subs;
-
-#if 0
- zdbug((LOG_DEBUG,"subscr_cancel_client %s",
- inet_ntoa (client->zct_addr.sin_addr)));
-#endif
- if (!client->zct_subs)
- return;
-
- START_CRITICAL_CODE;
-
- for (subs = client->zct_subs->q_forw;
- subs != client->zct_subs;
- subs = client->zct_subs->q_forw) {
-#if 0
- zdbug((LOG_DEBUG,"sub_can %s",
- subs->zst_dest.classname->string));
-#endif
- if (class_deregister(client, subs) != ZERR_NONE) {
-#if 0
- zdbug((LOG_DEBUG,"sub_can_clt: not registered!"));
-#endif
- }
- xremque(subs);
- free_zstring(subs->zst_dest.classname);
- free_zstring(subs->zst_dest.inst);
- free_zstring(subs->zst_dest.recip);
- xfree(subs);
- }
-
- /* also flush the head of the queue */
- /* subs is now client->zct_subs */
- free_zstring(subs->zst_dest.classname);
- free_zstring(subs->zst_dest.inst);
- free_zstring(subs->zst_dest.recip);
- xfree(subs);
- client->zct_subs = NULLZST;
-
- END_CRITICAL_CODE;
-
- return;
-}
-
-#ifdef notdef
-/* not used for the moment */
-/*
- * Cancel all the subscriptions for clients at this addr.
- */
-
-Code_t
-subscr_cancel_host(addr)
-struct in_addr *addr;
-{
- register ZHostList_t *hosts;
- register ZClientList_t *clist = NULLZCLT, *clt;
-
- /* find the host */
- if (!(hosts = hostm_find_host(addr)))
- return(ZSRV_HNOTFOUND);
- clist = hosts->zh_clients;
-
- START_CRITICAL_CODE;
-
- /* flush each one */
- for (clt = clist->q_forw; clt != clist; clt = clt->q_forw)
- (void) subscr_cancel_client(clt->zclt_client);
-
- END_CRITICAL_CODE;
-
- return(ZERR_NONE);
-}
-#endif
-
-/*
- * Here is the bulk of the work in the subscription manager.
- * We grovel over the list of clients possibly interested in this
- * notice, and copy into a list on a match. Make sure we only add any given
- * client once.
- */
-
-ZClientList_t *
-subscr_match_list(notice)
- ZNotice_t *notice;
-{
- register ZClientList_t *hits, *clients, *majik, *clients2, *hit2;
- char *saveclass, *saveclinst;
- ZSTRING *newclass;
- ZSTRING *newclinst;
- ZSubscr_t check_sub;
-
- if (!(hits = (ZClientList_t *) xmalloc(sizeof(ZClientList_t))))
- return(NULLZCLT);
- hits->q_forw = hits->q_back = hits;
-
- saveclass = notice->z_class;
- newclass = make_zstring(notice->z_class, 1);
-
- saveclinst = notice->z_class_inst;
- newclinst = make_zstring(notice->z_class_inst, 1);
-
- check_sub.zst_dest.classname = newclass;
- check_sub.zst_dest.inst = newclinst;
- check_sub.zst_dest.recip = make_zstring(notice->z_recipient, 0);
- set_ZDestination_hash(&check_sub.zst_dest);
- check_sub.q_forw = check_sub.q_back = &check_sub;
-
- clients = class_lookup (&check_sub);
- majik = class_lookup (&matchall_sub);
- if (!clients && !majik)
- return NULLZCLT;
-
- notice->z_class = (char *) newclass->string;
- notice->z_class_inst = (char *) newclinst->string;
- if (clients) {
- for (clients2 = clients->q_forw;
- clients2 != clients;
- clients2 = clients2->q_forw)
- if (cl_match(&check_sub, clients2->zclt_client)) {
- if (!clt_unique(clients2->zclt_client, hits))
- continue;
- /* we hit */
- if (!(hit2 = (ZClientList_t *) xmalloc(sizeof(ZClientList_t)))) {
- syslog(LOG_WARNING,
- "subscr_match: punting/no mem");
- notice->z_class = saveclass;
- notice->z_class_inst = saveclinst;
- free_zstring(newclass);
- free_zstring(newclinst);
- free_zstring(check_sub.zst_dest.recip);
- return(hits);
- }
- hit2->zclt_client = clients2->zclt_client;
- hit2->q_forw = hit2->q_back = hit2;
- xinsque(hit2, hits);
- }
- class_free(clients);
- }
- if (majik) {
- for (clients2 = majik->q_forw;
- clients2 != majik;
- clients2 = clients2->q_forw) {
- if (!clt_unique(clients2->zclt_client, hits))
- continue;
- /* we hit */
- if (!(hit2 = (ZClientList_t *) xmalloc(sizeof(ZClientList_t)))) {
- syslog(LOG_WARNING,
- "subscr_match(majik): punting/no mem");
- notice->z_class = saveclass;
- notice->z_class_inst = saveclinst;
- free_zstring(newclass);
- free_zstring(newclinst);
- free_zstring(check_sub.zst_dest.recip);
- return(hits);
- }
- hit2->zclt_client = clients2->zclt_client;
- hit2->q_forw = hit2->q_back = hit2;
-
- xinsque(hit2, hits);
- }
- class_free(majik);
- }
- notice->z_class = saveclass;
- notice->z_class_inst = saveclinst;
- free_zstring(newclass);
- free_zstring(newclinst);
- free_zstring(check_sub.zst_dest.recip);
- if (hits->q_forw == hits) {
- xfree(hits);
- return(NULLZCLT);
- }
- return(hits);
-}
-
-/*
- * Free memory used by a list we allocated.
- */
-
-void
-subscr_free_list(list)
- ZClientList_t *list;
-{
- register ZClientList_t *lyst;
-
- for (lyst = list->q_forw; lyst != list; lyst = list->q_forw) {
- xremque(lyst);
- xfree(lyst);
- }
- xfree(list);
- return;
-}
-
-/*
- * Send the requester a list of his current subscriptions
- */
-
-void
-subscr_sendlist(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
-{
- char **answer;
- int found;
- struct sockaddr_in send_to_who;
- Code_t retval;
-
-#ifdef OLD_COMPAT
- if (!strcmp(notice->z_version, OLD_ZEPHYR_VERSION)) {
- /* we are talking to an old client; use the old-style
- acknowledgement-message */
- old_compat_subscr_sendlist(notice, auth, who);
- return;
- }
-#endif /* OLD_COMPAT */
-#ifdef NEW_COMPAT
- if (!strcmp(notice->z_version, NEW_OLD_ZEPHYR_VERSION)) {
- /* we are talking to a new old client; use the new-old-style
- acknowledgement-message */
- new_old_compat_subscr_sendlist(notice, auth, who);
- return;
- }
-#endif /* NEW_COMPAT */
- answer = subscr_marshal_subs(notice, auth, who, &found);
- send_to_who = *who;
- send_to_who.sin_port = notice->z_port; /* Return port */
-
- if ((retval = ZSetDestAddr(&send_to_who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist set addr: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
-
- /* XXX for now, don't do authentication */
- auth = 0;
-
- notice->z_kind = ACKED;
-
- /* use xmit_frag() to send each piece of the notice */
-
- if ((retval = ZSrvSendRawList(notice, (char **) answer,
- found*NUM_FIELDS, xmit_frag))
- != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist xmit: %s",
- error_message(retval));
- }
- if (answer)
- xfree(answer);
- return;
-}
-
-static char **
-subscr_marshal_subs(notice, auth, who, found)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- register int *found;
-{
- ZNotice_t reply;
- char **answer = (char **) 0;
- int temp;
- Code_t retval;
- ZClient_t *client;
- register ZSubscr_t *subs, *subs2 = NULLZST;
- register int i;
- int defsubs = 0;
-
-#if 0
- zdbug((LOG_DEBUG, "subscr_marshal"));
-#endif
- *found = 0;
-
- /* Note that the following code is an incredible crock! */
-
- /* We cannot send multiple packets as acknowledgements to the client,
- since the hostmanager will ignore the later packets. So we need
- to send directly to the client. */
-
- /* Make our own copy so we can send directly back to the client */
- /* RSF 11/07/87 */
-
-
- if (!strcmp(notice->z_opcode, CLIENT_GIMMESUBS)) {
- /* If the client has requested his current subscriptions,
- the message field of the notice contains the port number
- of the client for which the sender desires the subscription
- list. The port field is the port of the sender. */
-
- if ((retval = ZReadAscii(notice->z_message,
- notice->z_message_len,
- (unsigned char *)&temp,
- sizeof(u_short))) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_marshal read port num: %s",
- error_message(retval));
- return((char **)0);
- }
-
- /* Blech blech blech */
- reply = *notice;
- reply.z_port = *((u_short *)&temp);
-
- client = client_which_client(who, &reply);
-
- if (client)
- subs2 = client->zct_subs;
- } else if (!strcmp(notice->z_opcode, CLIENT_GIMMEDEFS)) {
-#if 0
- zdbug((LOG_DEBUG, "gimmedefs"));
-#endif
- /* subscr_copy_def_subs allocates new pointer rings, so
- it must be freed when finished.
- the string areas pointed to are static, however.*/
- subs2 = subscr_copy_def_subs(notice->z_sender);
- defsubs = 1;
- } else {
- syslog(LOG_ERR, "subscr_marshal bogus opcode %s",
- notice->z_opcode);
- return((char **) 0);
- }
-
- if (subs2) {
-
- /* check authenticity here. The user must be authentic to get
- a list of subscriptions. If he is not subscribed to
- anything, this if-clause fails, and he gets a response
- indicating no subscriptions.
- if retrieving default subscriptions, don't care about
- authentication. */
-
- if (!auth && !defsubs) {
- return((char **) 0);
- }
- if (!defsubs) {
- if (client && (strcmp(client->zct_principal->string,
- notice->z_sender) != 0)) {
- zdbug ((LOG_DEBUG,
- "subscr_marshal: %s requests subs for %s at %s/%d",
- notice->z_sender,
- client->zct_principal->string,
- inet_ntoa (who->sin_addr),
- ntohs (who->sin_port)));
- return 0;
- }
- }
-
- for (subs = subs2->q_forw;
- subs != subs2;
- subs = subs->q_forw, (*found)++);
-
- /* found is now the number of subscriptions */
-
- /* coalesce the subscription information into a list of
- char *'s */
- if ((answer = (char **) xmalloc((*found) * NUM_FIELDS * sizeof(char *))) == (char **) 0) {
- syslog(LOG_ERR, "subscr no mem(answer)");
- *found = 0;
- } else
- for (i = 0, subs = subs2->q_forw;
- i < *found ;
- i++, subs = subs->q_forw) {
- answer[i*NUM_FIELDS] = subs->zst_dest.classname->string;
- answer[i*NUM_FIELDS + 1] = subs->zst_dest.inst->string;
- answer[i*NUM_FIELDS + 2] = subs->zst_dest.recip->string;
- }
- }
- if (defsubs)
- free_subscriptions(subs2);
- return(answer);
-}
-
-#ifdef NEW_COMPAT
-static void
-new_old_compat_subscr_sendlist(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
-{
- Code_t retval;
- ZNotice_t reply;
- ZPacket_t reppacket;
- int packlen, found, count, initfound, zerofound;
- char buf[64];
- Zconst char **answer;
- struct sockaddr_in send_to_who;
- register int i;
-
- new_compat_count_subscr++;
-
- syslog(LOG_INFO, "new old subscr, %s", inet_ntoa(who->sin_addr));
- reply = *notice;
- reply.z_kind = SERVACK;
- reply.z_authent_len = 0; /* save some space */
- reply.z_auth = 0;
-
- send_to_who = *who;
- send_to_who.sin_port = notice->z_port; /* Return port */
-
- if ((retval = ZSetDestAddr(&send_to_who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "new_old_subscr_sendlist set addr: %s",
- error_message(retval));
- return;
- }
-
- /* retrieve the subscriptions */
- answer = subscr_marshal_subs(notice, auth, who, &found);
-
- /* note that when there are no subscriptions, found == 0, so
- we needn't worry about answer being NULL since
- ZFormatSmallRawNoticeList won't reference the pointer */
-
- /* send 5 at a time until we are finished */
- count = found?((found-1) / 5 + 1):1; /* total # to be sent */
- i = 0; /* pkt # counter */
-#if 0
- zdbug((LOG_DEBUG,"Found %d subscriptions for %d packets",
- found,count));
-#endif
- initfound = found;
- zerofound = (found == 0);
- while (found > 0 || zerofound) {
- packlen = sizeof(reppacket);
- (void) sprintf(buf, "%d/%d", ++i, count);
- reply.z_opcode = buf;
- retval = ZFormatSmallRawNoticeList(&reply,
- answer+(initfound-found)*NUM_FIELDS,
- ((found > 5) ? 5 : found)*NUM_FIELDS,
- reppacket,
- &packlen);
- if (retval != ZERR_NONE) {
- syslog(LOG_ERR, "subscr_sendlist format: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
- if ((retval = ZSendPacket(reppacket, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist xmit: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
- found -= 5;
- zerofound = 0;
- }
-#if 0
- zdbug((LOG_DEBUG,"subscr_sendlist acked"));
-#endif
- if (answer)
- xfree(answer);
- return;
-}
-#endif /* NEW_COMPAT */
-
-#ifdef OLD_COMPAT
-static void
-old_compat_subscr_sendlist(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
-{
- ZClient_t *client = client_which_client(who, notice);
- register ZSubscr_t *subs;
- Code_t retval;
- ZNotice_t reply;
- ZPacket_t reppacket;
- int packlen, i, found = 0;
- char **answer = (char **) NULL;
-
- old_compat_count_subscr++;
-
- syslog(LOG_INFO, "old old subscr, %s", inet_ntoa(who->sin_addr));
- if (client && client->zct_subs) {
-
- /* check authenticity here. The user must be authentic to get
- a list of subscriptions. If he is not subscribed to
- anything, the above test fails, and he gets a response
- indicating no subscriptions */
-
- if (!auth) {
- clt_ack(notice, who, AUTH_FAILED);
- return;
- }
-
- for (subs = client->zct_subs->q_forw;
- subs != client->zct_subs;
- subs = subs->q_forw, found++);
-
- /* found is now the number of subscriptions */
-
- /* coalesce the subscription information into a list of
- char *'s */
- if ((answer = (char **) xmalloc(found * NUM_FIELDS * sizeof(char *))) == (char **) 0) {
- syslog(LOG_ERR, "old_subscr_sendlist no mem(answer)");
- found = 0;
- } else
- for (i = 0, subs = client->zct_subs->q_forw;
- i < found ;
- i++, subs = subs->q_forw) {
- answer[i*NUM_FIELDS] = subs->zst_class;
- answer[i*NUM_FIELDS + 1] = subs->zst_classinst;
- answer[i*NUM_FIELDS + 2] = subs->zst_recipient;
- }
- }
- /* note that when there are no subscriptions, found == 0, so
- we needn't worry about answer being NULL */
-
- reply = *notice;
- reply.z_kind = SERVACK;
- reply.z_authent_len = 0; /* save some space */
- reply.z_auth = 0;
-
-
- /* if it's too long, chop off one at a time till it fits */
- while ((retval = ZFormatSmallRawNoticeList(&reply,
- answer,
- found * NUM_FIELDS,
- reppacket,
- &packlen)) == ZERR_PKTLEN) {
- found--;
- reply.z_opcode = OLD_CLIENT_INCOMPSUBS;
- }
- if (retval != ZERR_NONE) {
- syslog(LOG_ERR, "old_subscr_sendlist format: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
- if ((retval = ZSetDestAddr(who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist set addr: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
- if ((retval = ZSendPacket(reppacket, packlen, 0)) != ZERR_NONE) {
- syslog(LOG_WARNING, "subscr_sendlist xmit: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
-#if 0
- zdbug((LOG_DEBUG,"subscr_sendlist acked"));
-#endif
- if (answer)
- xfree(answer);
- return;
-}
-#endif /* OLD_COMPAT */
-
-/*
- * Send the client's subscriptions to another server
- */
-
-/* version is currently unused; if necessary later versions may key off it
- to determine what to send to the peer (protocol changes) */
-
-/*ARGSUSED*/
-Code_t
-subscr_send_subs(client, vers)
- ZClient_t *client;
- char *vers;
-{
- register int i = 0;
- register ZSubscr_t *sub;
-#ifdef KERBEROS
- char buf[512];
- C_Block cblock;
-#endif /* KERBEROS */
- char buf2[512];
- char *lyst[7 * NUM_FIELDS];
- int num = 0;
- Code_t retval;
-
-#if 0
- zdbug((LOG_DEBUG, "send_subs"));
-#endif
- (void) sprintf(buf2, "%d",ntohs(client->zct_sin.sin_port));
-
- lyst[num++] = buf2;
-
-#ifdef KERBEROS
-#ifdef NOENCRYPTION
- (void) memcpy((caddr_t)cblock, (caddr_t)client->zct_cblock, sizeof(C_Block));
-#else
- des_ecb_encrypt(client->zct_cblock, cblock, serv_ksched.s, DES_ENCRYPT);
-#endif
-
- if ((retval = ZMakeAscii(buf, sizeof(buf), cblock,
- sizeof(C_Block))) != ZERR_NONE) {
-#if 0
- zdbug((LOG_DEBUG,"zmakeascii failed: %s",
- error_message(retval)));
-#endif
- } else {
- lyst[num++] = buf;
-#if 0
- zdbug((LOG_DEBUG,"cblock %s",buf));
-#endif
- }
-#endif /* KERBEROS */
- if ((retval = bdump_send_list_tcp(SERVACK, client->zct_sin.sin_port,
- ZEPHYR_ADMIN_CLASS,
- num > 1 ? "CBLOCK" : "",
- ADMIN_NEWCLT,
- (char*)client->zct_principal->string,
- "", lyst, num)) != ZERR_NONE ) {
- syslog(LOG_ERR, "subscr_send_subs newclt: %s",
- error_message(retval));
- return(retval);
- }
-
- if (!client->zct_subs)
- return(ZERR_NONE);
- for (sub = client->zct_subs->q_forw;
- sub != client->zct_subs;
- sub = sub->q_forw) {
- /* for each subscription */
- lyst[i * NUM_FIELDS] = sub->zst_dest.classname->string;
- lyst[i * NUM_FIELDS + 1] = sub->zst_dest.inst->string;
- lyst[i * NUM_FIELDS + 2] = sub->zst_dest.recip->string;
- i++;
- if (i >= 7) {
- /* we only put 7 in each packet, so we don't
- run out of room */
- if ((retval = bdump_send_list_tcp(ACKED,
- client->zct_sin.sin_port,
- ZEPHYR_CTL_CLASS, "",
- CLIENT_SUBSCRIBE, "",
- "", lyst,
- i * NUM_FIELDS))
- != ZERR_NONE) {
- syslog(LOG_ERR, "subscr_send_subs subs: %s",
- error_message(retval));
- return(retval);
- }
- i = 0;
- }
- }
- if (i) {
- if ((retval = bdump_send_list_tcp(ACKED,
- client->zct_sin.sin_port,
- ZEPHYR_CTL_CLASS, "",
- CLIENT_SUBSCRIBE, "", "",
- lyst, i * NUM_FIELDS))
- != ZERR_NONE) {
- syslog(LOG_ERR, "subscr_send_subs subs: %s",
- error_message(retval));
- return(retval);
- }
- }
- return(ZERR_NONE);
-}
-
-/*
- * is this client unique to this list? 0 = no, 1 = yes
- */
-
-static int
-clt_unique(clt, clist)
- ZClient_t *clt;
- ZClientList_t *clist;
-{
- register ZClientList_t *client;
-
- for (client = clist->q_forw;
- client != clist;
- client = client->q_forw)
- if (client->zclt_client == clt)
- return(0);
- return(1);
-}
-
-/*
- * is this client listening to this notice? 1=yes, 0=no
- */
-
-static int
-cl_match(notice_subs, client)
- register ZSubscr_t *notice_subs;
- register ZClient_t *client;
-{
- register ZSubscr_t *subs;
- int relation;
-
- if (client->zct_subs == NULLZST) {
- syslog(LOG_WARNING, "cl_match w/ no subs");
- return(0);
- }
-
- for (subs = client->zct_subs->q_forw;
- subs != client->zct_subs;
- subs = subs->q_forw) {
- relation = compare_subs(notice_subs, subs, 1);
-
-/*
- if (relation < 0)
- return(0);
-*/
- if (relation == 0)
- return(1);
- }
- /* fall through */
- return(0);
-}
-
-/*
- * free the memory allocated for the list of subscriptions.
- */
-
-static void
-free_subscriptions(subs)
- register ZSubscr_t *subs;
-{
- register ZSubscr_t *sub;
-
- for (sub = subs->q_forw; sub != subs; sub = subs->q_forw) {
- xremque(sub);
- free_zstring(sub->zst_dest.classname);
- free_zstring(sub->zst_dest.inst);
- free_zstring(sub->zst_dest.recip);
- xfree(sub);
- }
- free_zstring(subs->zst_dest.classname);
- free_zstring(subs->zst_dest.inst);
- free_zstring(subs->zst_dest.recip);
- xfree(subs);
-
- return;
-}
-
-#define ADVANCE(xx) { cp += (strlen(cp) + 1); \
- if (cp >= notice->z_message + notice->z_message_len) { \
- syslog(LOG_WARNING, "malformed subscription %d", xx); \
- return(subs); \
- }}
-
-/*
- * Parse the message body, returning a linked list of subscriptions, or
- * NULLZST if there are no subscriptions there.
- */
-
-static ZSubscr_t *
-extract_subscriptions(notice)
- register ZNotice_t *notice;
-{
- register ZSubscr_t *subs = NULLZST, *subs2;
- register char *recip, *class_name, *classinst;
- register char *cp = notice->z_message;
-
- /* parse the data area for the subscriptions */
- while (cp < notice->z_message + notice->z_message_len) {
- class_name = cp;
- if (*cp == '\0')
- /* we've exhausted the subscriptions */
- return(subs);
- ADVANCE(1);
- classinst = cp;
- ADVANCE(2);
- recip = cp;
-#if 0
- zdbug((LOG_DEBUG, "ext_sub: CLS %s INST %s RCPT %s",
- class_name, classinst, cp));
-#endif
- cp += (strlen(cp) + 1);
- if (cp > notice->z_message + notice->z_message_len) {
- syslog(LOG_WARNING, "malformed sub 3");
- return(subs);
- }
- if (!subs) {
- if (!(subs = (ZSubscr_t *)
- xmalloc(sizeof(ZSubscr_t)))) {
- syslog(LOG_WARNING, "ex_subs: no mem");
- return(NULLZST);
- }
- subs->q_forw = subs->q_back = subs;
- subs->zst_dest.classname = subs->zst_dest.inst =
- subs->zst_dest.recip = NULL;
- subs->zst_dest.hash_value = 0;
- }
- if (!(subs2 = (ZSubscr_t *) xmalloc(sizeof(ZSubscr_t)))) {
- syslog(LOG_WARNING, "ex_subs: no mem 2");
- return(subs);
- }
- subs2->q_forw = subs2->q_back = subs2;
- subs2->zst_dest.classname = make_zstring(class_name,1);
- subs2->zst_dest.inst = make_zstring(classinst,1);
- subs2->zst_dest.recip = make_zstring(recip,0);
- set_ZDestination_hash(&subs2->zst_dest);
-
- xinsque(subs2, subs);
- }
- return(subs);
-}
-
-/*
- * print subscriptions in subs onto fp.
- * assumed to be called with SIGFPE blocked
- * (true if called from signal handler)
- */
-
-void
-subscr_dump_subs(fp, subs)
- FILE *fp;
- ZSubscr_t *subs;
-{
- register ZSubscr_t *ptr;
-
- if (!subs) /* no subscriptions to dump */
- return;
-
- for (ptr = subs->q_forw; ptr != subs; ptr = ptr->q_forw) {
- fputs("\t\t'", fp);
- fputs(ptr->zst_dest.classname->string, fp);
- fputs("' '", fp);
- fputs(ptr->zst_dest.inst->string, fp);
- fputs("' '", fp);
- fputs(ptr->zst_dest.recip->string, fp);
- fputs("'\n", fp);
- }
- return;
-}
-
-int
-compare_subs(s1,s2,do_wildcard)
- ZSubscr_t *s1, *s2;
- int do_wildcard;
-{
-
-#if 0
- zdbug((LOG_DEBUG,"compare_subs: %s/%s/%s to %s/%s/%s",
- s1->zst_dest.classname->string, s1->zst_dest.inst->string, s1->zst_dest.recip->string,
- s2->zst_dest.classname->string, s2->zst_dest.inst->string, s2->zst_dest.recip->string));
-#endif
- /* wildcard must be in s2 in order for it to match */
-
- if (do_wildcard && (s1->zst_dest.classname == s2->zst_dest.classname) &&
- (s2->zst_dest.inst == wildcard_instance) &&
- (s1->zst_dest.recip == s2->zst_dest.recip))
- return(0);
-
- if (s1->zst_dest.hash_value > s2->zst_dest.hash_value)
- return 1;
- if (s1->zst_dest.hash_value < s2->zst_dest.hash_value)
- return -1;
-
- if (s1->zst_dest.classname != s2->zst_dest.classname)
- return(strcasecmp(s1->zst_dest.classname->string,
- s2->zst_dest.classname->string));
-
- if (s1->zst_dest.inst != s2->zst_dest.inst)
- return(strcasecmp(s1->zst_dest.inst->string,
- s2->zst_dest.inst->string));
-
- if (s1->zst_dest.recip != s2->zst_dest.recip)
- return(strcasecmp(s1->zst_dest.recip->string,
- s2->zst_dest.recip->string));
-
- return(0);
-}
-
-static void
-check_sub_order(subs,wc)
- ZSubscr_t *subs;
- int wc;
-{
- ZSubscr_t *subs2;
- int relation;
-
- for (subs2 = subs->q_forw;
- subs2->q_forw != subs;
- subs2 = subs2->q_forw) {
-
- /* for each existing subscription */
- relation = compare_subs(subs2,subs2->q_forw,wc);
- if (relation > 0) {
- syslog(LOG_DEBUG, "s_check failed: %s/%s/%s <=> %s/%s/%s = %d",
- subs2->zst_dest.classname->string,
- subs2->zst_dest.inst->string,
- subs2->zst_dest.recip->string,
- subs2->q_forw->zst_dest.classname->string,
- subs2->q_forw->zst_dest.inst->string,
- subs2->q_forw->zst_dest.recip->string,
- relation);
- }
-
- }
-}
diff --git a/server/timer.c b/server/timer.c
index 9d59cba..d23eb82 100644
--- a/server/timer.c
+++ b/server/timer.c
@@ -9,10 +9,12 @@
*
*/
+#include "zserver.h"
+
#ifndef SABER
#ifndef lint
-static char rcsid[] =
- "$Id$";
+static const char rcsid[] =
+"$Id$";
#endif /* lint */
#endif /* SABER */
@@ -24,46 +26,43 @@ static char rcsid[] =
* Massachusetts Institute of Technology
*
* written by Ken Raeburn
-
-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. and the Student
-Information Processing Board not be used in
-advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-M.I.T. and the Student Information Processing Board
-make no representations about the suitability of
-this software for any purpose. It is provided "as is"
-without express or implied warranty.
-
+
+ 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. and the Student
+ Information Processing Board not be used in
+ advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission.
+ M.I.T. and the Student Information Processing Board
+ make no representations about the suitability of
+ this software for any purpose. It is provided "as is"
+ without express or implied warranty.
+
*/
/*
* External functions:
*
- * timer timer_set_rel (time_rel, proc, arg)
+ * Timer *timer_set_rel (time_rel, proc, arg)
* long time_rel;
* void (*proc)();
* caddr_t arg;
- * timer timer_set_abs (time_abs, proc, arg)
+ * Timer *timer_set_abs (time_abs, proc, arg)
* long time_abs;
* void (*proc)();
* caddr_t arg;
*
* void timer_reset(tmr)
- * timer tmr;
+ * Timer *tmr;
*
* void timer_process()
*
*/
-#include <stdio.h>
-#include "zserver.h"
-
/* DELTA is just an offset to keep the size a bit less than a power
* of two. It's measured in pointers, so it's 32 bytes on most
* systems. */
@@ -109,180 +108,149 @@ without express or implied warranty.
#define PARENT(i) (((i) - 1) / 2)
#define CHILD1(i) ((i) * 2 + 1)
#define CHILD2(i) ((i) * 2 + 2)
-#define TIME(i) (heap[i]->time)
+#define TIME(i) (heap[i]->abstime)
#define HEAP_ASSIGN(pos, tmr) ((heap[pos] = (tmr))->heap_pos = (pos))
-long nexttimo = 0L; /* the Unix time of the next
- alarm */
-static timer *heap;
+static Timer **heap;
static int num_timers = 0;
static int heap_size = 0;
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static void timer_botch P((void*));
-static timer add_timer P((timer));
-
-/*
- * timer_set_rel(time_rel, proc)
- * time_rel: alarm time relative to now, in seconds
- * proc: subroutine to be called (no args, returns void)
- *
- * creates a "timer" and adds it to the current list, returns "timer"
- */
+static void timer_botch __P((void*));
+static Timer *add_timer __P((Timer *));
-timer timer_set_rel (time_rel, proc, arg)
- long time_rel;
- void (*proc) P((void *));
- void *arg;
+Timer *timer_set_rel(time_rel, proc, arg)
+ long time_rel;
+ void (*proc) __P((void *));
+ void *arg;
{
- timer new_t;
- new_t = (timer) xmalloc(sizeof(*new_t));
- if (new_t == NULL)
- return(NULL);
- new_t->time = time_rel + NOW;
- new_t->func = proc;
- new_t->arg = arg;
- return add_timer(new_t);
+ Timer *new_t;
+
+ new_t = (Timer *) malloc(sizeof(*new_t));
+ if (new_t == NULL)
+ return(NULL);
+ new_t->abstime = time_rel + NOW;
+ new_t->func = proc;
+ new_t->arg = arg;
+ return add_timer(new_t);
}
-/*
- * timer_reset
- *
- * args:
- * tmr: timer to be removed from the list
- *
- * removes any timers matching tmr and reallocates list
- *
- */
-
void
timer_reset(tmr)
- timer tmr;
+ Timer *tmr;
{
- int pos, min;
-
- /* Free the timer, saving its heap position. */
- pos = tmr->heap_pos;
- xfree(tmr);
-
- if (pos != num_timers - 1) {
- /* Replace the timer with the last timer in the heap and
- * restore the heap, propagating the timer either up or
- * down, depending on which way it violates the heap
- * property to insert the last timer in place of the
- * deleted timer. */
- if (pos > 0 && TIME(num_timers - 1) < TIME(PARENT(pos))) {
- do {
- HEAP_ASSIGN(pos, heap[PARENT(pos)]);
- pos = PARENT(pos);
- } while (pos > 0 && TIME(num_timers - 1) < TIME(PARENT(pos)));
- HEAP_ASSIGN(pos, heap[num_timers - 1]);
- } else {
- while (CHILD2(pos) < num_timers) {
- min = num_timers - 1;
- if (TIME(CHILD1(pos)) < TIME(min))
- min = CHILD1(pos);
- if (TIME(CHILD2(pos)) < TIME(min))
- min = CHILD2(pos);
- HEAP_ASSIGN(pos, heap[min]);
- pos = min;
- }
- if (pos != num_timers - 1)
- HEAP_ASSIGN(pos, heap[num_timers - 1]);
+ int pos, min;
+
+ /* Free the timer, saving its heap position. */
+ pos = tmr->heap_pos;
+ free(tmr);
+
+ if (pos != num_timers - 1) {
+ /* Replace the timer with the last timer in the heap and
+ * restore the heap, propagating the timer either up or
+ * down, depending on which way it violates the heap
+ * property to insert the last timer in place of the
+ * deleted timer. */
+ if (pos > 0 && TIME(num_timers - 1) < TIME(PARENT(pos))) {
+ do {
+ HEAP_ASSIGN(pos, heap[PARENT(pos)]);
+ pos = PARENT(pos);
+ } while (pos > 0 && TIME(num_timers - 1) < TIME(PARENT(pos)));
+ HEAP_ASSIGN(pos, heap[num_timers - 1]);
+ } else {
+ while (CHILD2(pos) < num_timers) {
+ min = num_timers - 1;
+ if (TIME(CHILD1(pos)) < TIME(min))
+ min = CHILD1(pos);
+ if (TIME(CHILD2(pos)) < TIME(min))
+ min = CHILD2(pos);
+ HEAP_ASSIGN(pos, heap[min]);
+ pos = min;
}
+ if (pos != num_timers - 1)
+ HEAP_ASSIGN(pos, heap[num_timers - 1]);
}
- num_timers--;
-
- /* Fix up the next timeout. */
- nexttimo = (num_timers == 0) ? 0 : heap[0]->time;
+ }
+ num_timers--;
}
#define set_timeval(t,s) ((t).tv_sec=(s),(t).tv_usec=0,(t))
-/* add_timer(t:timer)
- *
- * args:
- * t: new "timer" to be added
- *
- * returns:
- * 0 if successful
- * -1 if error (errno set) -- old time table may have been destroyed
- *
- */
-static timer
+static Timer *
add_timer(new)
- timer new;
+ Timer *new;
{
- int pos;
-
- /* Create or resize the heap as necessary. */
- if (heap_size == 0) {
- heap_size = INITIAL_HEAP_SIZE;
- heap = (timer *) xmalloc(heap_size * sizeof(timer));
- } else if (num_timers >= heap_size) {
- heap_size = heap_size * 2 + DELTA;
- heap = (timer *) xrealloc(heap, heap_size * sizeof(timer));
- }
- if (!heap) {
- xfree(new);
- return NULL;
- }
-
- /* Insert the timer into the heap. */
- pos = num_timers;
- while (pos > 0 && new->time < TIME(PARENT(pos))) {
- HEAP_ASSIGN(pos, heap[PARENT(pos)]);
- pos = PARENT(pos);
- }
- HEAP_ASSIGN(pos, new);
- num_timers++;
-
- /* Fix up the next timeout. */
- nexttimo = heap[0]->time;
- return new;
+ int pos;
+
+ /* Create or resize the heap as necessary. */
+ if (heap_size == 0) {
+ heap_size = INITIAL_HEAP_SIZE;
+ heap = (Timer **) malloc(heap_size * sizeof(Timer *));
+ } else if (num_timers >= heap_size) {
+ heap_size = heap_size * 2 + DELTA;
+ heap = (Timer **) realloc(heap, heap_size * sizeof(Timer *));
+ }
+ if (!heap) {
+ free(new);
+ return NULL;
+ }
+
+ /* Insert the Timer *into the heap. */
+ pos = num_timers;
+ while (pos > 0 && new->abstime < TIME(PARENT(pos))) {
+ HEAP_ASSIGN(pos, heap[PARENT(pos)]);
+ pos = PARENT(pos);
+ }
+ HEAP_ASSIGN(pos, new);
+ num_timers++;
+
+ return new;
}
-/*
- * timer_process -- checks for next timer execution time
- * and execute
- *
- */
-
void
timer_process()
{
- register timer t;
- timer_proc func;
- void *arg;
- int valid = 0;
-
- if (num_timers == 0 || heap[0]->time > NOW)
- return;
-
- /* Remove the first timer from the heap, remembering it's
- * function and argument. timer_reset() updates nexttimo. */
- t = heap[0];
- func = t->func;
- arg = t->arg;
- t->func = timer_botch;
- t->arg = NULL;
- timer_reset(t);
+ Timer *t;
+ timer_proc func;
+ void *arg;
+ int valid = 0;
+
+ if (num_timers == 0 || heap[0]->abstime > NOW)
+ return;
+
+ /* Remove the first timer from the heap, remembering its
+ * function and argument. */
+ t = heap[0];
+ func = t->func;
+ arg = t->arg;
+ t->func = timer_botch;
+ t->arg = NULL;
+ timer_reset(t);
+
+ /* Run the function. */
+ func(arg);
+}
- /* Run the function. */
- (func)(arg);
+struct timeval *
+timer_timeout(tvbuf)
+ struct timeval *tvbuf;
+{
+ if (num_timers > 0) {
+ tvbuf->tv_sec = heap[0]->abstime - NOW;
+ if (tvbuf->tv_sec < 0)
+ tvbuf->tv_sec = 0;
+ tvbuf->tv_usec = 0;
+ return tvbuf;
+ } else {
+ return NULL;
+ }
}
static void
timer_botch(arg)
- void *arg;
+ void *arg;
{
- syslog(LOG_CRIT, "Timer botch\n");
- abort();
+ syslog(LOG_CRIT, "timer botch\n");
+ abort();
}
diff --git a/server/timer.h b/server/timer.h
index 231208f..42c0081 100644
--- a/server/timer.h
+++ b/server/timer.h
@@ -6,11 +6,12 @@
*
* $Source$
* $Author$
- * $Header: /mit/zephyr/src/server/RCS/timer.h,v 1.9 94/03/15 12:44:40 prob
-e Exp $
+ * $Header$
*
*/
+#ifndef __TIMER_H
+
/*
* timer_manager_ -- routines for handling timers in login_shell
* (and elsewhere)
@@ -36,31 +37,20 @@ without express or implied warranty.
*/
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-typedef struct _timer {
- int heap_pos;
- /* time for timer to go off, absolute time */
- long time;
- /* procedure to call when timer goes off */
- void (*func)P((void*));
- /* argument for that procedure */
- void * arg;
-} *timer;
+typedef void (*timer_proc) __P((void *));
-#define NOW t_local.tv_sec
-typedef void (*timer_proc) P((void *));
-extern timer timer_set_rel P((long, timer_proc, void*));
-extern timer timer_set_abs P((long, timer_proc, void*));
-extern void timer_reset P((timer)), timer_process P((void));
+typedef struct _Timer {
+ int heap_pos; /* Position in timer heap */
+ long abstime;
+ timer_proc func;
+ void *arg;
+} Timer;
-#undef P
+Timer *timer_set_rel __P((long, timer_proc, void *));
+Timer *timer_set_abs __P((long, timer_proc, void *));
+void timer_reset __P((Timer *));
+void timer_process __P((void));
+struct timeval *timer_timeout __P((struct timeval *tvbuf));
-#define timer_when(x) ALARM_TIME(x)
+#endif /* __TIMER_H */
-extern struct timeval t_local;
-extern long nexttimo; /* Unix time of next timout */
diff --git a/server/uloc.c b/server/uloc.c
index 018d657..9bd7a11 100644
--- a/server/uloc.c
+++ b/server/uloc.c
@@ -12,16 +12,16 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
+#include <sys/socket.h>
#ifndef lint
#ifndef SABER
-static char rcsid_uloc_c[] =
- "$Id$";
+static const char rcsid_uloc_c[] =
+"$Id$";
#endif /* SABER */
#endif /* lint */
-#include "zserver.h"
-
/*
* The user locator functions.
*
@@ -31,13 +31,13 @@ static char rcsid_uloc_c[] =
* ZNotice_t *notice;
* int auth;
* struct sockaddr_in *who;
- * ZServerDesc_t *server;
+ * Server *server;
*
* void ulogin_dispatch(notice, auth, who, server)
* ZNotice_t *notice;
* int auth;
* struct sockaddr_in *who;
- * ZServerDesc_t *server;
+ * Server *server;
*
* void uloc_hflush(addr)
* struct in_addr *addr;
@@ -45,9 +45,7 @@ static char rcsid_uloc_c[] =
* void uloc_flush_client(sin)
* struct sockaddr_in *sin;
*
- * Code_t uloc_send_locations(host, version)
- * ZHostList_t *host;
- * char *version;
+ * Code_t uloc_send_locations()
*
* void uloc_dump_locs(fp)
* FILE *fp;
@@ -55,7 +53,7 @@ static char rcsid_uloc_c[] =
/*
* The user locator.
- * We maintain an array of ZLocation_t sorted by user (so we can do
+ * We maintain an array of Location sorted by user (so we can do
* binary searches), growing and shrinking it as necessary.
*/
@@ -64,58 +62,53 @@ static char rcsid_uloc_c[] =
/* else you will lose. See ulogin_locate() and uloc_send_locations() */
#define NUM_FIELDS 3
-typedef enum _exposure_type {
- NONE,
- OPSTAFF_VIS,
- REALM_VIS,
- REALM_ANN,
- NET_VIS,
- NET_ANN
-} exposure_type;
-
-typedef struct _ZLocation_t {
- ZSTRING * zlt_user;
- ZSTRING * zlt_machine;
- char * zlt_time; /* in ctime format */
- ZSTRING * zlt_tty;
- struct in_addr zlt_addr; /* IP addr of this loc */
- unsigned short zlt_port; /* port of registering client--
- for removing old entries */
- exposure_type zlt_exposure;
-} ZLocation_t;
-
-#define NULLZLT ((ZLocation_t *) 0)
+typedef enum _Exposure_type {
+ NONE,
+ OPSTAFF_VIS,
+ REALM_VIS,
+ REALM_ANN,
+ NET_VIS,
+ NET_ANN
+} Exposure_type;
+
+typedef struct _Location {
+ String *user;
+ String *machine;
+ char *time; /* in ctime format */
+ String *tty;
+ struct sockaddr_in addr; /* IP address and port of location */
+ Exposure_type exposure;
+} Location;
+
#define NOLOC 1
#define QUIET -1
#define UNAUTH -2
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-static void ulogin_locate P((ZNotice_t *notice, struct sockaddr_in *who,
- int auth)),
- ulogin_flush_user P((ZNotice_t *notice));
-static ZLocation_t *ulogin_find P((ZNotice_t *notice, int strict));
-static int ulogin_setup P((ZNotice_t *notice, ZLocation_t *locs,
- exposure_type exposure, struct sockaddr_in *who)),
- ulogin_add_user P((ZNotice_t *notice, exposure_type exposure,
- struct sockaddr_in *who)),
- ulogin_parse P((ZNotice_t *notice, ZLocation_t *locs)),
- ulogin_expose_user P((ZNotice_t *notice, exposure_type exposure));
-static exposure_type ulogin_remove_user P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- int *err_return));
-static void login_sendit P((ZNotice_t *notice, int auth, struct sockaddr_in *who));
-static char **ulogin_marshal_locs P((ZNotice_t *notice, int *found, int auth));
-
-static int ul_equiv P((ZLocation_t *l1, ZLocation_t *l2));
-
-static void free_loc P((ZLocation_t *loc));
-
-static ZLocation_t *locations = NULLZLT; /* ptr to first in array */
+static void ulogin_locate __P((ZNotice_t *notice, struct sockaddr_in *who,
+ int auth)),
+ulogin_flush_user __P((ZNotice_t *notice));
+static Location *ulogin_find __P((ZNotice_t *notice, int strict));
+static int ulogin_setup __P((ZNotice_t *notice, Location *locs,
+ Exposure_type exposure, struct sockaddr_in *who)),
+ulogin_add_user __P((ZNotice_t *notice, Exposure_type exposure,
+ struct sockaddr_in *who)),
+ulogin_parse __P((ZNotice_t *notice, Location *locs)),
+ulogin_expose_user __P((ZNotice_t *notice, Exposure_type exposure));
+static Exposure_type ulogin_remove_user __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who,
+ int *err_return));
+static void login_sendit __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, int external));
+static char **ulogin_marshal_locs __P((ZNotice_t *notice, int *found,
+ int auth));
+
+static int ul_equiv __P((Location *l1, Location *l2));
+
+static void free_loc __P((Location *loc));
+static void ulogin_locate_forward __P((ZNotice_t *notice,
+ struct sockaddr_in *who, Realm *realm));
+
+static Location *locations = NULL; /* ptr to first in array */
static int num_locs = 0; /* number in array */
/*
@@ -124,197 +117,199 @@ static int num_locs = 0; /* number in array */
Code_t
ulogin_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
{
- exposure_type retval;
- int err_ret;
- ZHostList_t *host;
+ Exposure_type retval;
+ int err_ret;
#if 0
- zdbug((LOG_DEBUG,
- "ulogin_dispatch: opc=%s from=%s/%d auth=%d who=%s/%d",
- notice->z_opcode, notice->z_sender, ntohs (notice->z_port),
- auth, inet_ntoa (who->sin_addr), ntohs (who->sin_port)));
+ zdbug((LOG_DEBUG,
+ "ulogin_dispatch: opc=%s from=%s/%d auth=%d who=%s/%d",
+ notice->z_opcode, notice->z_sender, ntohs (notice->z_port),
+ auth, inet_ntoa (who->sin_addr), ntohs (who->sin_port)));
#endif
- host = hostm_find_host(&who->sin_addr);
- if (host && host->zh_locked)
- return(ZSRV_REQUEUE);
-
- if (!strcmp(notice->z_opcode, LOGIN_USER_LOGOUT)) {
+ if (strcmp(notice->z_opcode, LOGIN_USER_LOGOUT) == 0) {
#if 0
- zdbug((LOG_DEBUG,"logout"));
+ zdbug((LOG_DEBUG,"logout"));
#endif
- retval = ulogin_remove_user(notice, auth, who, &err_ret);
- switch (retval) {
- case NONE:
- if (err_ret == UNAUTH) {
+ retval = ulogin_remove_user(notice, auth, who, &err_ret);
+ switch (retval) {
+ case NONE:
+ if (err_ret == UNAUTH) {
#if 0
- zdbug((LOG_DEBUG, "unauth logout: %s %d",
- inet_ntoa(who->sin_addr),
- ntohs(notice->z_port)));
+ zdbug((LOG_DEBUG, "unauth logout: %s %d",
+ inet_ntoa(who->sin_addr),
+ ntohs(notice->z_port)));
#endif
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- } else if (err_ret == NOLOC) {
- if (server == me_server)
- clt_ack(notice, who, NOT_FOUND);
- return(ZERR_NONE);
- }
- syslog(LOG_ERR,"bogus location exposure NONE, %s",
- notice->z_sender);
- break;
- case OPSTAFF_VIS:
- case REALM_VIS:
- /* he is not announced to people. Silently ack */
- if (server == me_server)
- ack(notice, who);
- break;
- case REALM_ANN:
- case NET_VIS:
- case NET_ANN:
- /* currently no distinction between these.
- just announce */
- /* we assume that if this user is at a certain
- IP address, we can trust the logout to be
- authentic. ulogin_remove_user checks the
- ip addrs */
- if (server == me_server)
- sendit(notice, 1, who);
- break;
- default:
- syslog(LOG_ERR,"bogus location exposure %d/%s",
- (int) retval, notice->z_sender);
- break;
- }
- if (server == me_server) /* tell the other servers */
- server_forward(notice, auth, who);
- return(ZERR_NONE);
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return ZERR_NONE;
+ } else if (err_ret == NOLOC) {
+ if (server == me_server)
+ clt_ack(notice, who, NOT_FOUND);
+ return ZERR_NONE;
+ }
+ syslog(LOG_ERR,"bogus location exposure NONE, %s",
+ notice->z_sender);
+ break;
+ case OPSTAFF_VIS:
+ case REALM_VIS:
+ /* he is not announced to people. Silently ack */
+ if (server == me_server)
+ ack(notice, who);
+ break;
+ case REALM_ANN:
+ case NET_VIS:
+ if (server == me_server)
+ sendit(notice, 1, who, 0);
+ break;
+ case NET_ANN:
+ /* currently no distinction between these.
+ just announce */
+ /* we assume that if this user is at a certain
+ IP address, we can trust the logout to be
+ authentic. ulogin_remove_user checks the
+ ip addrs */
+ if (server == me_server)
+ sendit(notice, 1, who, 1);
+ break;
+ default:
+ syslog(LOG_ERR,"bogus location exposure %d/%s",
+ (int) retval, notice->z_sender);
+ break;
}
- if (!bdumping &&
- (!auth || strcmp(notice->z_sender, notice->z_class_inst))) {
+ if (server == me_server) /* tell the other servers */
+ server_forward(notice, auth, who);
+ return ZERR_NONE;
+ }
+ if (!bdumping &&
+ (!auth || strcmp(notice->z_sender, notice->z_class_inst) != 0)) {
#if 1
- zdbug((LOG_DEBUG,"unauthentic ulogin: %d %s %s", auth,
- notice->z_sender, notice->z_class_inst));
+ zdbug((LOG_DEBUG,"unauthentic ulogin: %d %s %s", auth,
+ notice->z_sender, notice->z_class_inst));
#endif
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
- if (!strcmp(notice->z_opcode, LOGIN_USER_FLUSH)) {
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return ZERR_NONE;
+ }
+ if (strcmp(notice->z_opcode, LOGIN_USER_FLUSH) == 0) {
#if 0
- zdbug((LOG_DEBUG, "user flush"));
+ zdbug((LOG_DEBUG, "user flush"));
#endif
- ulogin_flush_user(notice);
- if (server == me_server)
- ack(notice, who);
- } else if (!strcmp(notice->z_opcode, EXPOSE_NONE)) {
+ ulogin_flush_user(notice);
+ if (server == me_server)
+ ack(notice, who);
+ } else if (strcmp(notice->z_opcode, EXPOSE_NONE) == 0) {
#if 0
- zdbug((LOG_DEBUG,"no expose"));
+ zdbug((LOG_DEBUG,"no expose"));
#endif
- (void) ulogin_remove_user(notice, auth, who, &err_ret);
- if (err_ret == UNAUTH) {
+ ulogin_remove_user(notice, auth, who, &err_ret);
+ if (err_ret == UNAUTH) {
#if 0
- zdbug((LOG_DEBUG, "unauth noexpose: %s/%d",
- inet_ntoa(who->sin_addr),
- ntohs(notice->z_port)));
+ zdbug((LOG_DEBUG, "unauth noexpose: %s/%d",
+ inet_ntoa(who->sin_addr), ntohs(notice->z_port)));
#endif
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- } else if (err_ret == NOLOC) {
- if (server == me_server)
- clt_ack(notice, who, NOT_FOUND);
- return(ZERR_NONE);
- }
- if (server == me_server) {
- ack(notice, who);
- server_forward(notice, auth, who);
- }
- return(ZERR_NONE);
- } else if (!strcmp(notice->z_opcode, EXPOSE_OPSTAFF)) {
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return ZERR_NONE;
+ } else if (err_ret == NOLOC) {
+ if (server == me_server)
+ clt_ack(notice, who, NOT_FOUND);
+ return ZERR_NONE;
+ }
+ if (server == me_server) {
+ ack(notice, who);
+ server_forward(notice, auth, who);
+ }
+ return ZERR_NONE;
+ } else if (strcmp(notice->z_opcode, EXPOSE_OPSTAFF) == 0) {
#if 0
- zdbug((LOG_DEBUG,"opstaff"));
+ zdbug((LOG_DEBUG,"opstaff"));
#endif
- err_ret = ulogin_add_user(notice, OPSTAFF_VIS, who);
- if (server == me_server)
- if (err_ret)
- nack(notice, who);
- else
- ack(notice, who);
- } else if (!strcmp(notice->z_opcode, EXPOSE_REALMVIS)) {
+ err_ret = ulogin_add_user(notice, OPSTAFF_VIS, who);
+ if (server == me_server) {
+ if (err_ret)
+ nack(notice, who);
+ else
+ ack(notice, who);
+ }
+ } else if (strcmp(notice->z_opcode, EXPOSE_REALMVIS) == 0) {
#if 0
- zdbug((LOG_DEBUG,"realmvis"));
+ zdbug((LOG_DEBUG,"realmvis"));
#endif
- err_ret = ulogin_add_user(notice, REALM_VIS, who);
- if (server == me_server) /* realm vis is not broadcast,
- so we ack it here */
- if (err_ret)
- nack(notice, who);
- else
- ack(notice, who);
- } else if (!strcmp(notice->z_opcode, EXPOSE_REALMANN)) {
+ err_ret = ulogin_add_user(notice, REALM_VIS, who);
+ if (server == me_server) { /* realm vis is not broadcast,
+ so we ack it here */
+ if (err_ret)
+ nack(notice, who);
+ else
+ ack(notice, who);
+ }
+ } else if (!strcmp(notice->z_opcode, EXPOSE_REALMANN)) {
#if 0
- zdbug((LOG_DEBUG,"realmann"));
+ zdbug((LOG_DEBUG,"realmann"));
#endif
- err_ret = ulogin_add_user(notice, REALM_ANN, who);
- if (server == me_server) /* announce to the realm */
- if (err_ret)
- nack(notice, who);
- else
- login_sendit(notice, auth, who);
- } else if (!strcmp(notice->z_opcode, EXPOSE_NETVIS)) {
+ err_ret = ulogin_add_user(notice, REALM_ANN, who);
+ if (server == me_server) { /* announce to the realm */
+ if (err_ret)
+ nack(notice, who);
+ else
+ login_sendit(notice, auth, who, 0);
+ }
+ } else if (!strcmp(notice->z_opcode, EXPOSE_NETVIS)) {
#if 0
- zdbug((LOG_DEBUG,"netvis"));
+ zdbug((LOG_DEBUG,"netvis"));
#endif
- err_ret = ulogin_add_user(notice, NET_VIS, who);
- if (server == me_server) /* announce to the realm */
- if (err_ret)
- nack(notice, who);
- else
- login_sendit(notice, auth, who);
- } else if (!strcmp(notice->z_opcode, EXPOSE_NETANN)) {
+ err_ret = ulogin_add_user(notice, NET_VIS, who);
+ if (server == me_server) { /* announce to the realm */
+ if (err_ret)
+ nack(notice, who);
+ else
+ login_sendit(notice, auth, who, 0);
+ }
+ } else if (!strcmp(notice->z_opcode, EXPOSE_NETANN)) {
#if 0
- zdbug((LOG_DEBUG,"netann"));
+ zdbug((LOG_DEBUG,"netann"));
#endif
- err_ret = ulogin_add_user(notice, NET_ANN, who);
- if (server == me_server) /* tell the world */
- if (err_ret)
- nack(notice, who);
- else
- login_sendit(notice, auth, who);
- } else {
- syslog(LOG_ERR, "unknown ulog opcode %s", notice->z_opcode);
- if (server == me_server)
- nack(notice, who);
- return(ZERR_NONE);
+ err_ret = ulogin_add_user(notice, NET_ANN, who);
+ if (server == me_server) { /* tell the world */
+ if (err_ret)
+ nack(notice, who);
+ else
+ login_sendit(notice, auth, who, 1);
}
+ } else {
+ syslog(LOG_ERR, "unknown ulog opcode %s", notice->z_opcode);
if (server == me_server)
- server_forward(notice, auth, who);
- return(ZERR_NONE);
+ nack(notice, who);
+ return ZERR_NONE;
+ }
+ if (server == me_server)
+ server_forward(notice, auth, who);
+ return ZERR_NONE;
}
static void
-login_sendit(notice, auth, who)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
+login_sendit(notice, auth, who, external)
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ int external;
{
- ZNotice_t log_notice;
+ ZNotice_t log_notice;
- /* we must copy the notice struct here because we need the original
- for forwarding. We needn't copy the private data of the notice,
- since that isn't modified by sendit and its subroutines. */
+ /* we must copy the notice struct here because we need the original
+ for forwarding. We needn't copy the private data of the notice,
+ since that isn't modified by sendit and its subroutines. */
- log_notice = *notice;
+ log_notice = *notice;
- log_notice.z_opcode = LOGIN_USER_LOGIN;
- sendit(&log_notice, auth, who);
- return;
+ log_notice.z_opcode = LOGIN_USER_LOGIN;
+ sendit(&log_notice, auth, who, external);
}
@@ -323,46 +318,53 @@ login_sendit(notice, auth, who)
*/
Code_t
ulocate_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- ZServerDesc_t *server;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ Server *server;
{
+ char *cp;
+ Realm *realm;
+
#if 0
- zdbug((LOG_DEBUG,"ulocate_disp"));
+ zdbug((LOG_DEBUG,"ulocate_disp"));
#endif
-#if 0 /* Now we support unauthentic locate for net-visible. */
- if (!auth) {
+#if 0 /* Now we support unauthentic locate for net-visible. */
+ if (!auth) {
#if 0
- zdbug((LOG_DEBUG,"unauthentic ulocate"));
+ zdbug((LOG_DEBUG,"unauthentic ulocate"));
#endif
- if (server == me_server)
- clt_ack(notice, who, AUTH_FAILED);
- return(ZERR_NONE);
- }
+ if (server == me_server)
+ clt_ack(notice, who, AUTH_FAILED);
+ return ZERR_NONE;
+ }
#endif
- if (!strcmp(notice->z_opcode, LOCATE_LOCATE)) {
+ if (!strcmp(notice->z_opcode, LOCATE_LOCATE)) {
#if 0
- zdbug((LOG_DEBUG,"locate"));
+ zdbug((LOG_DEBUG,"locate"));
#endif
- /* we are talking to a current-rev client; send an ack */
- ack(notice, who);
- ulogin_locate(notice, who, auth);
- return(ZERR_NONE);
- } else {
- syslog(LOG_ERR, "unknown uloc opcode %s", notice->z_opcode);
- if (server == me_server)
- nack(notice, who);
- return(ZERR_NONE);
- }
+ /* we are talking to a current-rev client; send an ack */
+ ack(notice, who);
+ cp = strchr(notice->z_class_inst, '@');
+ if (cp && (realm = realm_get_realm_by_name(cp + 1)))
+ ulogin_locate_forward(notice, who, realm);
+ else
+ ulogin_locate(notice, who, auth);
+ return ZERR_NONE;
+ } else {
+ syslog(LOG_ERR, "unknown uloc opcode %s", notice->z_opcode);
+ if (server == me_server)
+ nack(notice, who);
+ return ZERR_NONE;
+ }
#if 0
- if (server == me_server) {
- server_forward(notice, auth, who);
- ack(notice, who);
- }
+ if (server == me_server) {
+ server_forward(notice, auth, who);
+ ack(notice, who);
+ }
+ return ZERR_NONE;
#endif
- return(ZERR_NONE);
}
/*
@@ -371,135 +373,121 @@ ulocate_dispatch(notice, auth, who, server)
void
uloc_hflush(addr)
- struct in_addr *addr;
+ struct in_addr *addr;
{
- ZLocation_t *loc;
- register int i = 0, new_num = 0;
-
- if (num_locs == 0)
- return; /* none to flush */
-
- START_CRITICAL_CODE;
-
- /* slightly inefficient, assume the worst, and allocate enough space */
- loc = (ZLocation_t *) xmalloc(num_locs *sizeof(ZLocation_t));
- if (!loc) {
- syslog(LOG_CRIT, "uloc_flush alloc");
- abort();
- /*NOTREACHED*/
- }
-
- /* copy entries which don't match */
- while (i < num_locs) {
- if (locations[i].zlt_addr.s_addr != addr->s_addr)
- loc[new_num++] = locations[i];
- else {
+ Location *loc;
+ int i = 0, new_num = 0;
+
+ if (num_locs == 0)
+ return; /* none to flush */
+
+ /* slightly inefficient, assume the worst, and allocate enough space */
+ loc = (Location *) malloc(num_locs *sizeof(Location));
+ if (!loc) {
+ syslog(LOG_CRIT, "uloc_flush alloc");
+ abort();
+ }
+
+ /* copy entries which don't match */
+ while (i < num_locs) {
+ if (locations[i].addr.sin_addr.s_addr != addr->s_addr) {
+ loc[new_num++] = locations[i];
+ } else {
#if 0
- if (zdebug)
- syslog(LOG_DEBUG, "uloc hflushing %s/%s/%s",
- locations[i].zlt_user->string,
- locations[i].zlt_machine->string,
- locations[i].zlt_tty->string);
+ if (zdebug)
+ syslog(LOG_DEBUG, "uloc hflushing %s/%s/%s",
+ locations[i].user->string,
+ locations[i].machine->string,
+ locations[i].tty->string);
#endif
- free_loc(&locations[i]);
- }
- i++;
+ free_loc(&locations[i]);
}
+ i++;
+ }
- xfree(locations);
- locations = NULLZLT;
+ free(locations);
+ locations = NULL;
- if (!new_num) {
+ if (!new_num) {
#if 0
- zdbug((LOG_DEBUG,"no more locs"));
+ zdbug((LOG_DEBUG,"no more locs"));
#endif
- xfree(loc);
- loc = NULLZLT;
- num_locs = new_num;
-
- END_CRITICAL_CODE;
-
- return;
- }
- locations = loc;
+ free(loc);
+ loc = NULL;
num_locs = new_num;
- END_CRITICAL_CODE;
-
- /* all done */
return;
+ }
+ locations = loc;
+ num_locs = new_num;
+
+ /* all done */
+ return;
}
void
uloc_flush_client(sin)
- struct sockaddr_in *sin;
+ struct sockaddr_in *sin;
{
- ZLocation_t *loc;
- register int i = 0, new_num = 0;
-
- if (num_locs == 0)
- return; /* none to flush */
-
- START_CRITICAL_CODE;
-
- /* slightly inefficient, assume the worst, and allocate enough space */
- loc = (ZLocation_t *) xmalloc(num_locs *sizeof(ZLocation_t));
- if (!loc) {
- syslog(LOG_CRIT, "uloc_flush_clt alloc");
- abort();
- /*NOTREACHED*/
- }
-
- /* copy entries which don't match */
- while (i < num_locs) {
- if ((locations[i].zlt_addr.s_addr != sin->sin_addr.s_addr)
- || (locations[i].zlt_port != sin->sin_port))
- loc[new_num++] = locations[i];
- else {
+ Location *loc;
+ int i = 0, new_num = 0;
+
+ if (num_locs == 0)
+ return; /* none to flush */
+
+ /* slightly inefficient, assume the worst, and allocate enough space */
+ loc = (Location *) malloc(num_locs *sizeof(Location));
+ if (!loc) {
+ syslog(LOG_CRIT, "uloc_flush_clt alloc");
+ abort();
+ }
+
+ /* copy entries which don't match */
+ while (i < num_locs) {
+ if ((locations[i].addr.sin_addr.s_addr != sin->sin_addr.s_addr)
+ || (locations[i].addr.sin_port != sin->sin_port)) {
+ loc[new_num++] = locations[i];
+ } else {
#if 0
- if (zdebug)
- syslog(LOG_DEBUG, "uloc cflushing %s/%s/%s",
- locations[i].zlt_user->string,
- locations[i].zlt_machine->string,
- locations[i].zlt_tty->string);
+ if (zdebug)
+ syslog(LOG_DEBUG, "uloc cflushing %s/%s/%s",
+ locations[i].user->string,
+ locations[i].machine->string,
+ locations[i].tty->string);
#endif
- free_loc(&locations[i]);
- }
- i++;
+ free_loc(&locations[i]);
}
+ i++;
+ }
- xfree(locations);
- locations = NULLZLT;
+ free(locations);
+ locations = NULL;
- if (!new_num) {
+ if (!new_num) {
#if 0
- zdbug((LOG_DEBUG,"no more locs"));
+ zdbug((LOG_DEBUG,"no more locs"));
#endif
- xfree(loc);
- loc = NULLZLT;
- num_locs = new_num;
-
- END_CRITICAL_CODE;
-
- return;
- }
- locations = loc;
+ free(loc);
+ loc = NULL;
num_locs = new_num;
- END_CRITICAL_CODE;
+ return;
+ }
+ locations = loc;
+ num_locs = new_num;
#ifdef DEBUG
- if (zdebug) {
- register int i;
+ if (zdebug) {
+ int i;
- for (i = 0; i < num_locs; i++)
- syslog(LOG_DEBUG, "%s/%d",
- locations[i].zlt_user->string,
- (int) locations[i].zlt_exposure);
+ for (i = 0; i < num_locs; i++) {
+ syslog(LOG_DEBUG, "%s/%d", locations[i].user->string,
+ (int) locations[i].exposure);
}
+ }
#endif
- /* all done */
- return;
+ /* all done */
+ return;
}
/*
@@ -508,59 +496,49 @@ uloc_flush_client(sin)
/*ARGSUSED*/
Code_t
-uloc_send_locations(host, vers)
- ZHostList_t *host;
- char *vers;
+uloc_send_locations()
{
- register ZLocation_t *loc;
- register int i;
- register struct in_addr *haddr = &host->zh_addr.sin_addr;
- char *lyst[NUM_FIELDS];
- char *exposure_level;
- Code_t retval;
-
- for (i = 0, loc = locations; i < num_locs; i++, loc++) {
- if (loc->zlt_addr.s_addr != haddr->s_addr)
- continue;
- lyst[0] = (char *) loc->zlt_machine->string;
- lyst[1] = (char *) loc->zlt_time;
- lyst[2] = (char *) loc->zlt_tty->string;
-
- switch (loc->zlt_exposure) {
- case OPSTAFF_VIS:
- exposure_level = EXPOSE_OPSTAFF;
- break;
- case REALM_VIS:
- exposure_level = EXPOSE_REALMVIS;
- break;
- case REALM_ANN:
- exposure_level = EXPOSE_REALMANN;
- break;
- case NET_VIS:
- exposure_level = EXPOSE_NETVIS;
- break;
- case NET_ANN:
- exposure_level = EXPOSE_NETANN;
- break;
- default:
- syslog(LOG_ERR,"broken location state %s/%d",
- loc->zlt_user->string,
- (int) loc->zlt_exposure);
- break;
- }
- retval = bdump_send_list_tcp(ACKED, loc->zlt_port,
- LOGIN_CLASS,
- (char *) loc->zlt_user->string, /* XXX */
- exposure_level,
- myname, "", lyst,
- NUM_FIELDS);
- if (retval != ZERR_NONE) {
- syslog(LOG_ERR, "uloc_send_locs: %s",
- error_message(retval));
- return(retval);
- }
+ Location *loc;
+ int i;
+ char *lyst[NUM_FIELDS];
+ char *exposure_level;
+ Code_t retval;
+
+ for (i = 0, loc = locations; i < num_locs; i++, loc++) {
+ lyst[0] = (char *) loc->machine->string;
+ lyst[1] = (char *) loc->time;
+ lyst[2] = (char *) loc->tty->string;
+
+ switch (loc->exposure) {
+ case OPSTAFF_VIS:
+ exposure_level = EXPOSE_OPSTAFF;
+ break;
+ case REALM_VIS:
+ exposure_level = EXPOSE_REALMVIS;
+ break;
+ case REALM_ANN:
+ exposure_level = EXPOSE_REALMANN;
+ break;
+ case NET_VIS:
+ exposure_level = EXPOSE_NETVIS;
+ break;
+ case NET_ANN:
+ exposure_level = EXPOSE_NETANN;
+ break;
+ default:
+ syslog(LOG_ERR,"broken location state %s/%d",
+ loc->user->string, (int) loc->exposure);
+ break;
+ }
+ retval = bdump_send_list_tcp(ACKED, &loc->addr, LOGIN_CLASS,
+ loc->user->string, exposure_level, myname,
+ "", lyst, NUM_FIELDS);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_ERR, "uloc_send_locs: %s", error_message(retval));
+ return(retval);
}
- return(ZERR_NONE);
+ }
+ return ZERR_NONE;
}
/*
@@ -569,88 +547,81 @@ uloc_send_locations(host, vers)
static int
ulogin_add_user(notice, exposure, who)
- ZNotice_t *notice;
- exposure_type exposure;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ Exposure_type exposure;
+ struct sockaddr_in *who;
{
- ZLocation_t *oldlocs, newloc;
- register int i;
+ Location *oldlocs, newloc;
+ int i;
- if ((oldlocs = ulogin_find(notice,1)) != NULLZLT) {
+ if ((oldlocs = ulogin_find(notice,1)) != NULL) {
#if 0
- zdbug((LOG_DEBUG,"ul_add: already here"));
+ zdbug((LOG_DEBUG,"ul_add: already here"));
#endif
- (void) ulogin_expose_user(notice, exposure);
- return 0;
- }
-
- oldlocs = locations;
-
- START_CRITICAL_CODE;
-
- locations = (ZLocation_t *) xmalloc((num_locs +1) *
- sizeof(ZLocation_t));
- if (!locations) {
- syslog(LOG_ERR, "zloc mem alloc");
- locations = oldlocs;
- return 1;
- }
-
- if (num_locs == 0) { /* first one */
- if (ulogin_setup(notice, locations, exposure, who)) {
- xfree(locations);
- locations = NULLZLT;
- END_CRITICAL_CODE;
- return 1;
- }
- num_locs = 1;
- goto dprnt;
- }
-
- /* not the first one, insert him */
-
- if (ulogin_setup(notice, &newloc, exposure, who)) {
- xfree(locations);
- locations = oldlocs;
- END_CRITICAL_CODE;
- return 1;
- }
- num_locs++;
+ ulogin_expose_user(notice, exposure);
+ return 0;
+ }
- /* copy old locs */
- i = 0;
- while ((i < num_locs-1) &&
- (comp_zstring(oldlocs[i].zlt_user,newloc.zlt_user) < 0)) {
- locations[i] = oldlocs[i];
- i++;
- }
+ oldlocs = locations;
- /* add him in here */
- locations[i++] = newloc;
+ locations = (Location *) malloc((num_locs + 1) * sizeof(Location));
+ if (!locations) {
+ syslog(LOG_ERR, "zloc mem alloc");
+ locations = oldlocs;
+ return 1;
+ }
- /* copy the rest */
- while (i < num_locs) {
- locations[i] = oldlocs[i - 1];
- i++;
+ if (num_locs == 0) { /* first one */
+ if (ulogin_setup(notice, locations, exposure, who)) {
+ free(locations);
+ locations = NULL;
+ return 1;
}
- if (oldlocs)
- xfree(oldlocs);
-
- dprnt:
+ num_locs = 1;
+ goto dprnt;
+ }
+
+ /* not the first one, insert him */
+
+ if (ulogin_setup(notice, &newloc, exposure, who)) {
+ free(locations);
+ locations = oldlocs;
+ return 1;
+ }
+ num_locs++;
+
+ /* copy old locs */
+ i = 0;
+ while ((i < num_locs-1) &&
+ (comp_string(oldlocs[i].user,newloc.user) < 0)) {
+ locations[i] = oldlocs[i];
+ i++;
+ }
+
+ /* add him in here */
+ locations[i++] = newloc;
+
+ /* copy the rest */
+ while (i < num_locs) {
+ locations[i] = oldlocs[i - 1];
+ i++;
+ }
+ if (oldlocs)
+ free(oldlocs);
+
+ dprnt:
#if 0
- if (zdebug) {
- register int i;
- syslog(LOG_DEBUG, "ul_add: New Locations (%d)", num_locs);
- for (i = 0; i < num_locs; i++)
- syslog(LOG_DEBUG, "%s/%s/%s/%d",
- locations[i].zlt_user->string,
- locations[i].zlt_machine->string,
- locations[i].zlt_tty->string,
- (int) locations[i].zlt_exposure);
+ if (zdebug) {
+ int i;
+ syslog(LOG_DEBUG, "ul_add: New Locations (%d)", num_locs);
+ for (i = 0; i < num_locs; i++) {
+ syslog(LOG_DEBUG, "%s/%s/%s/%d", locations[i].user->string,
+ locations[i].machine->string, locations[i].tty->string,
+ (int) locations[i].exposure);
}
+ }
#endif
- END_CRITICAL_CODE;
- return 0;
+ return 0;
}
/*
@@ -659,41 +630,19 @@ ulogin_add_user(notice, exposure, who)
static int
ulogin_setup(notice, locs, exposure, who)
- ZNotice_t *notice;
- ZLocation_t *locs;
- exposure_type exposure;
- struct sockaddr_in *who;
+ ZNotice_t *notice;
+ Location *locs;
+ Exposure_type exposure;
+ struct sockaddr_in *who;
{
- if (ulogin_parse(notice, locs))
- return(1);
-
- if (!locs->zlt_user) {
- syslog(LOG_ERR, "zloc bad format: no user");
- return(1);
- }
- if (!locs->zlt_machine) {
- syslog(LOG_ERR, "zloc bad format: no machine");
- free_zstring(locs->zlt_user);
- return(1);
-
- }
- if (!locs->zlt_tty) {
- syslog(LOG_ERR, "zloc bad format: no tty");
- free_zstring(locs->zlt_user);
- free_zstring(locs->zlt_machine);
- return(1);
- }
- if (!locs->zlt_time) {
- syslog(LOG_ERR, "zloc bad format: no time");
- free_zstring(locs->zlt_user);
- free_zstring(locs->zlt_machine);
- free_zstring(locs->zlt_tty);
- return(1);
- }
- locs->zlt_exposure = exposure;
- locs->zlt_addr = who->sin_addr;
- locs->zlt_port = notice->z_port;
- return(0);
+ if (ulogin_parse(notice, locs))
+ return 1;
+
+ locs->exposure = exposure;
+ locs->addr.sin_family = AF_INET;
+ locs->addr.sin_addr.s_addr = who->sin_addr.s_addr;
+ locs->addr.sin_port = notice->z_port;
+ return(0);
}
/*
@@ -702,56 +651,50 @@ ulogin_setup(notice, locs, exposure, who)
static int
ulogin_parse(notice, locs)
- ZNotice_t *notice;
- ZLocation_t *locs;
+ ZNotice_t *notice;
+ Location *locs;
{
- register char *cp, *base;
- register int nulls = 0;
-
- if (!notice->z_message_len) {
- syslog(LOG_ERR, "short ulogin");
- return(1);
- }
-
- base = notice->z_message;
- for (cp = base; cp < base + notice->z_message_len; cp++)
- if (! *cp) nulls++;
- if (nulls < 3) {
- syslog(LOG_ERR, "zloc bad format from user %s (only %d fields)",
- notice->z_sender, nulls);
- return 1;
- }
-
- locs->zlt_user = make_zstring(notice->z_class_inst,0);
-
- cp = base;
- locs->zlt_machine = make_zstring(cp,0);
+ char *cp, *base;
+ int nulls = 0;
+
+ if (!notice->z_message_len) {
+ syslog(LOG_ERR, "short ulogin");
+ return 1;
+ }
+
+ base = notice->z_message;
+ for (cp = base; cp < base + notice->z_message_len; cp++) {
+ if (!*cp)
+ nulls++;
+ }
+ if (nulls < 3) {
+ syslog(LOG_ERR, "zloc bad format from user %s (only %d fields)",
+ notice->z_sender, nulls);
+ return 1;
+ }
+
+ locs->user = make_string(notice->z_class_inst,0);
+
+ cp = base;
+ locs->machine = make_string(cp,0);
#if 0
- zdbug((LOG_DEBUG, "ul_parse: mach %s", cp));
+ zdbug((LOG_DEBUG, "ul_parse: mach %s", cp));
#endif
- cp += (strlen(cp) + 1);
- locs->zlt_time = strsave(cp);
+ cp += (strlen(cp) + 1);
+ locs->time = strsave(cp);
#if 0
- zdbug((LOG_DEBUG, "ul_parse: time %s", cp));
+ zdbug((LOG_DEBUG, "ul_parse: time %s", cp));
#endif
- /* This field might not be null-terminated */
- cp += (strlen(cp) + 1);
-#if 0
- if (nulls == 2) {
- s = (char *)xmalloc(base + notice->z_message_len - cp + 1);
- strncpy(s, cp);
- locs->zlt_tty = make_zstring(s, 0);
- xfree(s);
- } else
-#endif
- locs->zlt_tty = make_zstring(cp,0);
+ /* This field might not be null-terminated */
+ cp += (strlen(cp) + 1);
+ locs->tty = make_string(cp, 0);
#if 0
- zdbug((LOG_DEBUG, "ul_parse: tty %s", locs->zlt_tty->string));
+ zdbug((LOG_DEBUG, "ul_parse: tty %s", locs->tty->string));
#endif
- return 0;
+ return 0;
}
/*
@@ -761,190 +704,178 @@ ulogin_parse(notice, locs)
* in the table.
*/
-static ZLocation_t *
+static Location *
ulogin_find(notice, strict)
- ZNotice_t *notice;
- int strict;
+ ZNotice_t *notice;
+ int strict;
{
- register int i, rlo, rhi;
- ZLocation_t tmploc;
- int compar;
- ZSTRING *inst;
+ int i, rlo, rhi;
+ Location tmploc;
+ int compar;
+ String *inst;
- if (!locations)
- return(NULLZLT);
+ if (!locations)
+ return(NULL);
- inst = make_zstring(notice->z_class_inst,0);
+ inst = make_string(notice->z_class_inst, 0);
- /* i is the current loc we are checking */
- /* rlo is the lowest we will still check, rhi is the highest we will
- still check */
+ /* i is the current loc we are checking */
+ /* rlo is the lowest we will still check, rhi is the highest we will
+ still check */
- i = num_locs >> 1; /* start in the middle */
- rlo = 0;
- rhi = num_locs - 1; /* first index is 0 */
+ i = num_locs >> 1; /* start in the middle */
+ rlo = 0;
+ rhi = num_locs - 1; /* first index is 0 */
- while ((compar = comp_zstring(locations[i].zlt_user, inst)) != 0) {
+ while ((compar = comp_string(locations[i].user, inst)) != 0) {
#if 0
- zdbug ((LOG_DEBUG, "ulogin_find: comparing %s %s %s %d %d",
- notice->z_class_inst,
- locations[i].zlt_user->string,
- locations[i].zlt_tty->string,
- rlo, rhi));
+ zdbug ((LOG_DEBUG, "ulogin_find: comparing %s %s %s %d %d",
+ notice->z_class_inst, locations[i].user->string,
+ locations[i].tty->string, rlo, rhi));
#endif
- if (compar < 0)
- rlo = i + 1;
- else
- rhi = i - 1;
- if (rhi - rlo < 0) {
+ if (compar < 0)
+ rlo = i + 1;
+ else
+ rhi = i - 1;
+ if (rhi - rlo < 0) {
#if 0
- zdbug((LOG_DEBUG,"ul_find: %s not found",
- inst->string));
+ zdbug((LOG_DEBUG,"ul_find: %s not found",
+ inst->string));
#endif
- free_zstring(inst);
- return 0;
- }
- i = (rhi + rlo) >> 1; /* split the diff */
+ free_string(inst);
+ return 0;
}
+ i = (rhi + rlo) >> 1; /* split the diff */
+ }
#if 0
- zdbug((LOG_DEBUG, "ul_find: %s found at loc %d",
- inst->string, i));
+ zdbug((LOG_DEBUG, "ul_find: %s found at loc %d",
+ inst->string, i));
#endif
- if (strict && ulogin_parse(notice, &tmploc)) {
+ if (strict && ulogin_parse(notice, &tmploc)) {
#if 1
- zdbug((LOG_DEBUG,"ul_find bad fmt"));
+ zdbug((LOG_DEBUG,"ul_find bad fmt"));
#endif
- free_zstring(inst);
- return 0;
- }
- /* back up to the first of this guy */
- while (i > 0 && (locations[i-1].zlt_user == inst)) {
- i--;
+ free_string(inst);
+ return 0;
+ }
+ /* back up to the first of this guy */
+ while (i > 0 && (locations[i-1].user == inst)) {
+ i--;
#if 0
- zdbug ((LOG_DEBUG,
- "ulogin_find: backing up: %s %d %s %s",
- inst->string, i,
- locations[i].zlt_user->string,
- locations[i].zlt_tty->string));
+ zdbug((LOG_DEBUG, "ulogin_find: backing up: %s %d %s %s", inst->string,
+ i, locations[i].user->string, locations[i].tty->string));
#endif
- }
- if (strict)
- while (i < num_locs
- && !ul_equiv(&tmploc, &locations[i])
- && (locations[i].zlt_user == inst)) {
- i++;
- }
-
- if ((i == num_locs) || (locations[i].zlt_user != inst)) {
+ }
+ if (strict) {
+ while (i < num_locs && !ul_equiv(&tmploc, &locations[i])
+ && (locations[i].user == inst))
+ i++;
+ }
+ if (strict)
+ free_loc(&tmploc);
+ if (i == num_locs || locations[i].user != inst) {
#if 1
- zdbug((LOG_DEBUG,"ul_find final match loss"));
+ zdbug((LOG_DEBUG,"ul_find final match loss"));
#endif
- free_zstring(inst);
- return 0;
- }
- if (strict)
- free_loc(&tmploc);
- free_zstring(inst);
- return &locations[i];
+ free_string(inst);
+ return 0;
+ }
+ free_string(inst);
+ return &locations[i];
}
static int
ul_equiv(l1, l2)
-register ZLocation_t *l1, *l2;
+ Location *l1, *l2;
{
- if (l1->zlt_machine != l2->zlt_machine)
- return(0);
- if (l1->zlt_tty != l2->zlt_tty)
- return(0);
- return(1);
+ if (l1->machine != l2->machine)
+ return 0;
+ if (l1->tty != l2->tty)
+ return 0;
+ return 1;
}
/*
* remove the user specified in notice from the internal table
*/
-static exposure_type
+static Exposure_type
ulogin_remove_user(notice, auth, who, err_return)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- int *err_return;
+ ZNotice_t *notice;
+ int auth;
+ struct sockaddr_in *who;
+ int *err_return;
{
- ZLocation_t *loc, *loc2;
- register int i = 0;
- exposure_type quiet;
+ Location *new_locs, *loc;
+ int i = 0;
+ Exposure_type quiet;
- *err_return = 0;
- if (!(loc2 = ulogin_find(notice, 1))) {
+ *err_return = 0;
+ loc = ulogin_find(notice, 1);
+ if (!loc) {
#if 0
- zdbug((LOG_DEBUG,"ul_rem: not here"));
+ zdbug((LOG_DEBUG,"ul_rem: not here"));
#endif
- *err_return = NOLOC;
- return(NONE);
- }
+ *err_return = NOLOC;
+ return NONE;
+ }
- /* if unauthentic, the sender MUST be the same IP addr
- that registered */
- if (!auth && loc2->zlt_addr.s_addr != who->sin_addr.s_addr) {
- *err_return = UNAUTH;
- return NONE;
- }
+ /* if unauthentic, the sender MUST be the same IP addr that registered */
+ if (!auth && loc->addr.sin_addr.s_addr != who->sin_addr.s_addr) {
+ *err_return = UNAUTH;
+ return NONE;
+ }
- quiet = loc2->zlt_exposure;
+ quiet = loc->exposure;
- START_CRITICAL_CODE;
- if (--num_locs == 0) { /* last one */
+ if (--num_locs == 0) { /* last one */
#if 0
- zdbug((LOG_DEBUG,"last loc"));
+ zdbug((LOG_DEBUG,"last loc"));
#endif
- free_loc(locations);
- xfree(locations);
- locations = NULLZLT;
- END_CRITICAL_CODE;
- return(quiet);
- }
-
- loc = (ZLocation_t *) xmalloc(num_locs * sizeof(ZLocation_t));
- if (!loc) {
- syslog(LOG_CRIT, "ul_rem alloc");
- abort();
- /*NOTREACHED*/
- }
-
- /* copy old entries */
- while (i < num_locs && &locations[i] < loc2) {
- loc[i] = locations[i];
- i++;
- }
-
- /* free up this one */
- free_loc(&locations[i]);
- i++; /* skip over this one */
-
- /* copy the rest */
- while (i <= num_locs) {
- loc[i - 1] = locations[i];
- i++;
- }
-
- xfree(locations);
-
- locations = loc;
-
- END_CRITICAL_CODE;
+ free_loc(locations);
+ free(locations);
+ locations = NULL;
+ return quiet;
+ }
+
+ new_locs = (Location *) malloc(num_locs * sizeof(Location));
+ if (!new_locs) {
+ syslog(LOG_CRIT, "ul_rem alloc");
+ abort();
+ }
+
+ /* copy old entries */
+ while (i < num_locs && &locations[i] < loc) {
+ new_locs[i] = locations[i];
+ i++;
+ }
+
+ /* free up this one */
+ free_loc(&locations[i]);
+ i++; /* skip over this one */
+
+ /* copy the rest */
+ while (i <= num_locs) {
+ new_locs[i - 1] = locations[i];
+ i++;
+ }
+
+ free(locations);
+
+ locations = new_locs;
#if defined(DEBUG) && 0
- if (zdebug) {
- register int i;
+ if (zdebug) {
+ int i;
- for (i = 0; i < num_locs; i++)
- syslog(LOG_DEBUG, "%s/%d",
- locations[i].zlt_user->string,
- (int) locations[i].zlt_exposure);
+ for (i = 0; i < num_locs; i++) {
+ syslog(LOG_DEBUG, "%s/%d", locations[i].user->string,
+ (int) locations[i].exposure);
}
+ }
#endif
- /* all done */
- return(quiet);
+ /* all done */
+ return quiet;
}
/*
@@ -953,89 +884,80 @@ ulogin_remove_user(notice, auth, who, err_return)
static void
ulogin_flush_user(notice)
- ZNotice_t *notice;
+ ZNotice_t *notice;
{
- register ZLocation_t *loc, *loc2;
- register int i, j, num_match, num_left;
+ Location *loc, *loc2;
+ int i, j, num_match, num_left;
- i = num_match = num_left = 0;
+ i = num_match = num_left = 0;
- if (!(loc2 = ulogin_find(notice, 0))) {
+ if (!(loc2 = ulogin_find(notice, 0))) {
#if 0
- zdbug((LOG_DEBUG,"ul_rem: not here"));
+ zdbug((LOG_DEBUG,"ul_rem: not here"));
#endif
- return;
- }
-
- /* compute # locations left in the list, after loc2 (inclusive) */
- num_left = num_locs - (loc2 - locations);
+ return;
+ }
- START_CRITICAL_CODE;
+ /* compute # locations left in the list, after loc2 (inclusive) */
+ num_left = num_locs - (loc2 - locations);
- while (num_left &&
- !strcasecmp(loc2[num_match].zlt_user->string,
+ while (num_left &&
+ !strcasecmp(loc2[num_match].user->string,
notice->z_class_inst)) {
- /* as long as we keep matching, march up the list */
- num_match++;
- num_left--;
- }
- if (num_locs == num_match) { /* no other locations left */
+ /* as long as we keep matching, march up the list */
+ num_match++;
+ num_left--;
+ }
+ if (num_locs == num_match) { /* no other locations left */
#if 0
- zdbug((LOG_DEBUG,"last loc"));
+ zdbug((LOG_DEBUG,"last loc"));
#endif
- for (j = 0; j < num_match; j++)
- free_loc(&locations[j]); /* free storage */
- xfree (locations);
- locations = NULLZLT;
- num_locs = 0;
- END_CRITICAL_CODE;
- return;
- }
-
- loc = (ZLocation_t *) xmalloc((num_locs - num_match) *
- sizeof(ZLocation_t));
- if (!loc) {
- syslog(LOG_CRIT, "ul_rem alloc");
- abort();
- /*NOTREACHED*/
- }
-
- /* copy old entries */
- while (i < num_locs && &locations[i] < loc2) {
- loc[i] = locations[i];
- i++;
- }
+ for (j = 0; j < num_match; j++)
+ free_loc(&locations[j]); /* free storage */
+ free (locations);
+ locations = NULL;
+ num_locs = 0;
+ return;
+ }
+
+ loc = (Location *) malloc((num_locs - num_match) * sizeof(Location));
+ if (!loc) {
+ syslog(LOG_CRIT, "ul_rem alloc");
+ abort();
+ }
+
+ /* copy old entries */
+ while (i < num_locs && &locations[i] < loc2) {
+ loc[i] = locations[i];
+ i++;
+ }
- for(j = 0; j < num_match; j++) {
- free_loc(&locations[i]);
- i++;
- }
+ for(j = 0; j < num_match; j++) {
+ free_loc(&locations[i]);
+ i++;
+ }
- /* copy the rest */
- while (i < num_locs) {
- loc[i - num_match] = locations[i];
- i++;
- }
+ /* copy the rest */
+ while (i < num_locs) {
+ loc[i - num_match] = locations[i];
+ i++;
+ }
- xfree(locations);
+ free(locations);
- locations = loc;
- num_locs -= num_match;
+ locations = loc;
+ num_locs -= num_match;
- END_CRITICAL_CODE;
-
#ifdef DEBUG
- if (zdebug) {
- register int i;
+ if (zdebug) {
+ int i;
- for (i = 0; i < num_locs; i++)
- syslog(LOG_DEBUG, "%s/%d",
- locations[i].zlt_user->string,
- (int) locations[i].zlt_exposure);
+ for (i = 0; i < num_locs; i++) {
+ syslog(LOG_DEBUG, "%s/%d", locations[i].user->string,
+ (int) locations[i].exposure);
}
+ }
#endif
- /* all done */
- return;
}
/*
@@ -1044,86 +966,85 @@ ulogin_flush_user(notice)
static int
ulogin_expose_user(notice, exposure)
- ZNotice_t *notice;
- exposure_type exposure;
+ ZNotice_t *notice;
+ Exposure_type exposure;
{
- ZLocation_t *loc, loc2;
- int idx, notfound = 1;
+ Location *loc, loc2;
+ int idx, notfound = 1;
#if 0
- zdbug((LOG_DEBUG,"ul_expose: %s type %d", notice->z_sender,
- (int) exposure));
+ zdbug((LOG_DEBUG,"ul_expose: %s type %d", notice->z_sender,
+ (int) exposure));
#endif
- if (ulogin_parse(notice, &loc2))
- return(1);
-
- if (!(loc = ulogin_find(notice, 0))) {
+ loc = ulogin_find(notice, 0);
+ if (!loc) {
#if 0
zdbug((LOG_DEBUG,"ul_hide: not here"));
#endif
- return(1);
- }
+ return 1;
+ }
+
+ if (ulogin_parse(notice, &loc2))
+ return 1;
- idx = loc -locations;
-
- while ((idx < num_locs) &&
- locations[idx].zlt_user == loc2.zlt_user) {
-
- /* change exposure and owner for each loc on that host */
- if (locations[idx].zlt_machine == loc2.zlt_machine) {
- notfound = 0;
- locations[idx].zlt_exposure = exposure;
- locations[idx].zlt_port = notice->z_port;
- /* change time for the specific loc */
- if (locations[idx].zlt_tty == loc2.zlt_tty) {
- xfree(locations[idx].zlt_time);
- locations[idx].zlt_time = strsave(loc2.zlt_time);
- }
- }
- idx++;
+ idx = loc -locations;
+
+ while (idx < num_locs && locations[idx].user == loc2.user) {
+
+ /* change exposure and owner for each loc on that host */
+ if (locations[idx].machine == loc2.machine) {
+ notfound = 0;
+ locations[idx].exposure = exposure;
+ locations[idx].addr.sin_port = notice->z_port;
+ /* change time for the specific loc */
+ if (locations[idx].tty == loc2.tty) {
+ free(locations[idx].time);
+ locations[idx].time = strsave(loc2.time);
+ }
}
- return(notfound);
+ idx++;
+ }
+
+ free_loc(&loc2);
+ return notfound;
}
static void
ulogin_locate(notice, who, auth)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- int auth;
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
+ int auth;
{
- char **answer;
- int found;
- Code_t retval;
- struct sockaddr_in send_to_who;
-
- answer = ulogin_marshal_locs(notice, &found, auth);
-
- send_to_who = *who;
- send_to_who.sin_port = notice->z_port;
-
- if ((retval = ZSetDestAddr(&send_to_who)) != ZERR_NONE) {
- syslog(LOG_WARNING, "ulogin_locate set addr: %s",
- error_message(retval));
- if (answer)
- xfree(answer);
- return;
- }
+ char **answer;
+ int found;
+ Code_t retval;
+ struct sockaddr_in send_to_who;
- notice->z_kind = ACKED;
+ answer = ulogin_marshal_locs(notice, &found, auth);
- /* use xmit_frag() to send each piece of the notice */
+ send_to_who = *who;
+ send_to_who.sin_port = notice->z_port;
- if ((retval = ZSrvSendRawList(notice, answer, found*NUM_FIELDS,
- xmit_frag))
- != ZERR_NONE) {
- syslog(LOG_WARNING, "ulog_locate xmit: %s",
- error_message(retval));
- }
+ retval = ZSetDestAddr(&send_to_who);
+ if (retval != ZERR_NONE) {
+ syslog(LOG_WARNING, "ulogin_locate set addr: %s",
+ error_message(retval));
if (answer)
- xfree(answer);
+ free(answer);
return;
+ }
+
+ notice->z_kind = ACKED;
+
+ /* use xmit_frag() to send each piece of the notice */
+
+ retval = ZSrvSendRawList(notice, answer, found * NUM_FIELDS, xmit_frag);
+ if (retval != ZERR_NONE)
+ syslog(LOG_WARNING, "ulog_locate xmit: %s", error_message(retval));
+ if (answer)
+ free(answer);
}
/*
@@ -1133,151 +1054,243 @@ ulogin_locate(notice, who, auth)
static char **
ulogin_marshal_locs(notice, found, auth)
- ZNotice_t *notice;
- register int *found;
- int auth;
+ ZNotice_t *notice;
+ int *found;
+ int auth;
{
- ZLocation_t **matches = (ZLocation_t **) 0;
- ZLocation_t *loc;
- char **answer;
- register int i = 0;
- ZSTRING *inst;
+ Location **matches = (Location **) 0;
+ Location *loc;
+ char **answer;
+ int i = 0;
+ String *inst;
+ int local = sender_in_realm(notice);
- *found = 0; /* # of matches */
+ *found = 0; /* # of matches */
- if (!(loc = ulogin_find(notice, 0)))
- /* not here anywhere */
- return((char **)0);
+ loc = ulogin_find(notice, 0);
+ if (!loc)
+ return(NULL);
- i = loc - locations;
+ i = loc - locations;
- inst = make_zstring(notice->z_class_inst,0);
- while (i < num_locs && (inst == locations[i].zlt_user)) {
- /* these locations match */
+ inst = make_string(notice->z_class_inst,0);
+ while (i < num_locs && (inst == locations[i].user)) {
+ /* these locations match */
#if 0
- zdbug((LOG_DEBUG,"match %s", locations[i].zlt_user->string));
+ zdbug((LOG_DEBUG,"match %s", locations[i].user->string));
#endif
- switch (locations[i].zlt_exposure) {
- case OPSTAFF_VIS:
- i++;
- continue;
- case REALM_VIS:
- case REALM_ANN:
- if (!auth) {
- i++;
- continue;
- }
- case NET_VIS:
- case NET_ANN:
- default:
- break;
- }
- if (!*found) {
- if ((matches = (ZLocation_t **) xmalloc(sizeof(ZLocation_t *))) == (ZLocation_t **) 0) {
- syslog(LOG_ERR, "ulog_loc: no mem");
- break; /* from the while */
- }
- matches[0] = &locations[i];
- (*found)++;
- } else {
- if ((matches = (ZLocation_t **) realloc((caddr_t) matches, (unsigned) ++(*found) * sizeof(ZLocation_t *))) == (ZLocation_t **) 0) {
- syslog(LOG_ERR, "ulog_loc: realloc no mem");
- *found = 0;
- break; /* from the while */
- }
- matches[*found - 1] = &locations[i];
- }
+ switch (locations[i].exposure) {
+ case OPSTAFF_VIS:
+ i++;
+ continue;
+ case REALM_VIS:
+ case REALM_ANN:
+ if (!local) {
i++;
+ continue;
+ }
+ case NET_VIS:
+ case NET_ANN:
+ default:
+ break;
}
- free_zstring(inst);
-
- /* OK, now we have a list of user@host's to return to the client
- in matches */
-
+ if (!*found) {
+ matches = (Location **) malloc(sizeof(Location *));
+ if (!matches) {
+ syslog(LOG_ERR, "ulog_loc: no mem");
+ break; /* from the while */
+ }
+ matches[0] = &locations[i];
+ (*found)++;
+ } else {
+ matches = (Location **) realloc(matches,
+ ++(*found) * sizeof(Location *));
+ if (!matches) {
+ syslog(LOG_ERR, "ulog_loc: realloc no mem");
+ *found = 0;
+ break; /* from the while */
+ }
+ matches[*found - 1] = &locations[i];
+ }
+ i++;
+ }
+ free_string(inst);
+ /* OK, now we have a list of user@host's to return to the client
+ in matches */
+
+
#ifdef DEBUG
- if (zdebug) {
- for (i = 0; i < *found ; i++)
- zdbug((LOG_DEBUG,"found %s",
- matches[i]->zlt_user->string));
- }
+ if (zdebug) {
+ for (i = 0; i < *found ; i++)
+ zdbug((LOG_DEBUG,"found %s",
+ matches[i]->user->string));
+ }
#endif
-
- /* coalesce the location information into a list of char *'s */
- if ((answer = (char **)xmalloc((*found) * NUM_FIELDS * sizeof(char *))) == (char **) 0) {
- syslog(LOG_ERR, "zloc no mem(answer)");
- *found = 0;
- } else
- for (i = 0; i < *found ; i++) {
- answer[i*NUM_FIELDS] = (char *) matches[i]->zlt_machine->string;
- answer[i*NUM_FIELDS + 1] = (char *) matches[i]->zlt_time;
- answer[i*NUM_FIELDS + 2] = (char *) matches[i]->zlt_tty->string;
- }
-
- if (matches)
- xfree(matches);
- return(answer);
+
+ /* coalesce the location information into a list of char *'s */
+ answer = (char **) malloc((*found) * NUM_FIELDS * sizeof(char *));
+ if (!answer) {
+ syslog(LOG_ERR, "zloc no mem(answer)");
+ *found = 0;
+ } else
+ for (i = 0; i < *found ; i++) {
+ answer[i * NUM_FIELDS] = matches[i]->machine->string;
+ answer[i * NUM_FIELDS + 1] = matches[i]->time;
+ answer[i * NUM_FIELDS + 2] = matches[i]->tty->string;
+ }
+
+ if (matches)
+ free(matches);
+ return answer;
}
void
uloc_dump_locs(fp)
- register FILE *fp;
+ FILE *fp;
{
- register int i;
- char buf[BUFSIZ*3];
- static char *bufp;
- static Zconst char *cp;
-
- /* delay using stdio so that we can run FAST! */
- for (i = 0; i < num_locs; i++) {
- bufp = buf;
-#define cpy(str) cp=(str);while(*cp){*bufp++ = *cp++;}
- cpy (locations[i].zlt_user->string);
- *bufp++ = '/';
- cpy (locations[i].zlt_machine->string);
- *bufp++ = '/';
- cpy (locations[i].zlt_time);
- *bufp++ = '/';
- cpy (locations[i].zlt_tty->string);
- switch (locations[i].zlt_exposure) {
- case OPSTAFF_VIS:
- cpy ("/OPSTAFF/");
- break;
- case REALM_VIS:
- cpy ("/RLM_VIS/");
- break;
- case REALM_ANN:
- cpy ("/RLM_ANN/");
- break;
- case NET_VIS:
- cpy ("/NET_VIS/");
- break;
- case NET_ANN:
- cpy ("/NET_ANN/");
- break;
- default:
- sprintf (bufp, "/? %d ?/", locations[i].zlt_exposure);
- while (*bufp)
- bufp++;
- break;
- }
- cpy (inet_ntoa (locations[i].zlt_addr));
- *bufp++ = '/';
- sprintf(bufp, "%d", ntohs(locations[i].zlt_port));
- fputs(buf, fp);
- (void) putc('\n', fp);
-#undef cpy
+ int i;
+
+ for (i = 0; i < num_locs; i++) {
+ fputs("'", fp);
+ dump_quote(locations[i].user->string, fp);
+ fputs("' '", fp);
+ dump_quote(locations[i].machine->string, fp);
+ fputs("' '", fp);
+ dump_quote(locations[i].time, fp);
+ fputs("' ", fp);
+ switch (locations[i].exposure) {
+ case OPSTAFF_VIS:
+ fputs("OPSTAFF", fp);
+ break;
+ case REALM_VIS:
+ fputs("RLM_VIS", fp);
+ break;
+ case REALM_ANN:
+ fputs("RLM_ANN", fp);
+ break;
+ case NET_VIS:
+ fputs("NET_VIS", fp);
+ break;
+ case NET_ANN:
+ fputs("NET_ANN", fp);
+ break;
+ default:
+ fprintf(fp, "? %d ?", locations[i].exposure);
+ break;
}
- return;
+ fprintf(fp, " %s/%d\n", inet_ntoa(locations[i].addr.sin_addr),
+ ntohs(locations[i].addr.sin_port));
+ }
}
static void
free_loc(loc)
- ZLocation_t *loc;
+ Location *loc;
+{
+ free_string(loc->user);
+ free_string(loc->machine);
+ free_string(loc->tty);
+ free(loc->time);
+ return;
+}
+
+static void
+ulogin_locate_forward(notice, who, realm)
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
+ Realm *realm;
{
- free_zstring(loc->zlt_user);
- free_zstring(loc->zlt_machine);
- free_zstring(loc->zlt_tty);
- xfree(loc->zlt_time);
+ ZNotice_t lnotice;
+
+ lnotice = *notice;
+ lnotice.z_opcode = REALM_REQ_LOCATE;
+
+ realm_handoff(&lnotice, 1, who, realm, 0);
+}
+
+void
+ulogin_realm_locate(notice, who, realm)
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
+ Realm *realm;
+{
+ char **answer;
+ int found;
+ Code_t retval;
+ ZNotice_t lnotice;
+ char *pack;
+ int packlen;
+
+#ifdef DEBUG
+ if (zdebug)
+ zdbug((LOG_DEBUG, "ulogin_realm_locate"));
+#endif
+
+ answer = ulogin_marshal_locs(notice, &found, 0/*AUTH*/);
+
+ lnotice = *notice;
+ lnotice.z_opcode = REALM_ANS_LOCATE;
+
+ if ((retval = ZFormatRawNoticeList(&lnotice, answer, found * NUM_FIELDS, &pack, &packlen)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "ulog_rlm_loc format: %s",
+ error_message(retval));
+
+ if (answer)
+ free(answer);
+ return;
+ }
+ if (answer)
+ free(answer);
+
+ if ((retval = ZParseNotice(pack, packlen, &lnotice)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "subscr_rlm_sendit parse: %s",
+ error_message(retval));
+ free(pack);
+ return;
+ }
+
+ realm_handoff(&lnotice, 1, who, realm, 0);
+ free(pack);
+
return;
}
+
+void
+ulogin_relay_locate(notice, who)
+ ZNotice_t *notice;
+ struct sockaddr_in *who;
+{
+ ZNotice_t lnotice;
+ Code_t retval;
+ struct sockaddr_in newwho;
+ char *pack;
+ int packlen;
+
+ newwho.sin_addr.s_addr = notice->z_sender_addr.s_addr;
+ newwho.sin_port = notice->z_port;
+ newwho.sin_family = AF_INET;
+
+ if ((retval = ZSetDestAddr(&newwho)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "uloc_relay_loc set addr: %s",
+ error_message(retval));
+ return;
+ }
+
+ lnotice = *notice;
+ lnotice.z_opcode = LOCATE_LOCATE;
+ lnotice.z_kind = ACKED;
+
+ if ((retval = ZFormatRawNotice(&lnotice, &pack, &packlen)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "ulog_relay_loc format: %s",
+ error_message(retval));
+ return;
+ }
+
+ if ((retval = ZSendPacket(pack, packlen, 0)) != ZERR_NONE) {
+ syslog(LOG_WARNING, "ulog_relay_loc xmit: %s",
+ error_message(retval));
+ }
+ free(pack);
+}
+
diff --git a/server/unix.h b/server/unix.h
deleted file mode 100644
index 78b6d34..0000000
--- a/server/unix.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains declarations for many standard UNIX library functions,
- * and macros for aiding in interfacing to them.
- *
- * Created by Ken Raeburn.
- *
- * $Source$
- * $Author$
- * $Zephyr: unix.h,v 1.3 91/01/28 15:12:57 raeburn Exp $
- *
- * Copyright (c) 1990,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#ifndef ZSERVER_UNIX_H__
-
-#include <stdio.h>
-#if defined(__STDC__) && !defined(__HIGHC__) && !defined(SABER)
-/* Brain-dead High-C claims to be ANSI but doesn't have the include files.. */
-#include <stdlib.h>
-#endif
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-#ifndef linux /* struct qelem is defined in stdlib.h */
-/*
- * Queue-handling functions. This structure is basically a dummy;
- * as long as the start of another structure looks like this,
- * we're okay.
- */
-struct qelem {
- struct qelem *q_forw;
- struct qelem *q_back;
- char *q_data;
-};
-void insque P((struct qelem*, struct qelem*));
-void remque P((struct qelem *));
-
-#endif /* linux */
-
-/* From the Error table library */
-char *error_message P((long));
-
-#ifdef KERBEROS
-/* Kerberos */
-extern int krb_get_lrealm P((char *, int));
-extern int dest_tkt P((void));
-extern int krb_get_svc_in_tkt P((char *, char *, char *, char *, char *, int,
- char *));
-#ifdef KRB_DEFS /* have we actually got krb.h? */
-extern int krb_mk_req P((KTEXT, char *, char *, char *, unsigned long));
-extern int krb_get_cred P((char *, char *, char *, CREDENTIALS *));
-#endif
-#else
-extern int rresvport P((int *));
-#endif
-
-#ifdef HESIOD
- /* Hesiod */
-extern char ** hes_resolve P((Zconst char *, Zconst char *));
-#endif
-
- /* hacked acl code */
-extern void acl_cache_reset P((void));
-
-#undef P
-
-#ifdef vax
-#define HAVE_ALLOCA
-#endif
-
-#if defined (__GNUC__)
-
-/* GCC/G++ has a built-in function for allocating automatic storage. */
-#define LOCAL_ALLOC(X) __builtin_alloca(X)
-#define LOCAL_FREE(X)
-
-#else /* not gcc or g++ */
-
-#ifdef HAVE_ALLOCA
-#define LOCAL_ALLOC(X) alloca(X)
-#define LOCAL_FREE(X)
-#endif
-#endif
-
-#ifndef LOCAL_ALLOC
-#define LOCAL_ALLOC(X) malloc(X)
-#define LOCAL_FREE(X) free(X)
-#endif
-
-/*
- * Miscellaneous casts, so we don't have to insert these all over the
- * source files...
- */
-
-#define xfree(foo) free((caddr_t) (foo))
-#define xinsque(a,b) insque((struct qelem *)(a), (struct qelem *)(b))
-#define xremque(a) remque((struct qelem *)(a))
-#define xmalloc(a) malloc((unsigned)(a))
-#define xrealloc(foo,a) realloc((caddr_t) (foo), (unsigned) (a))
-
-#define ZSERVER_UNIX_H__
-#endif
diff --git a/server/version.c b/server/version.c
index 587028f..5487000 100644
--- a/server/version.c
+++ b/server/version.c
@@ -13,26 +13,22 @@
#include <zephyr/mit-copyright.h>
-#include <string.h>
-#include <zephyr/zephyr.h>
+#include "zserver.h"
#include "version.h"
+const char zephyr_version[] = "Zephyr system version 2.0";
+
#ifdef DEBUG
-Zconst char version[] = "Zephyr Server (DEBUG) $Revision$";
+const char version[] = "Zephyr server (DEBUG) $Revision$";
#else
-Zconst char version[] = "Zephyr Server $Revision$";
+const char version[] = "Zephyr server $Revision$";
#endif
#if !defined (lint) && !defined (SABER)
-Zconst char rcsid_version_c[] =
+static const char rcsid_version_c[] =
"$Id$";
-Zconst char copyright[] =
+static const char copyright[] =
"Copyright (c) 1987,1988,1989,1990 Massachusetts Institute of Technology.\n";
-#ifdef CONCURRENT
-Zconst char concurrent[] = "Brain-dump concurrency enabled";
-#else
-Zconst char concurrent[] = "no brain-dump concurrency";
-#endif
#endif
char *
diff --git a/server/version.h b/server/version.h
deleted file mode 100644
index 40f1ff3..0000000
--- a/server/version.h
+++ /dev/null
@@ -1 +0,0 @@
-#define ZSERVER_VERSION_STRING "(Fri Nov 19 13:34:58 EST 1993) probe@tardis"
diff --git a/server/zalloc.c b/server/zalloc.c
deleted file mode 100644
index f4e5e23..0000000
--- a/server/zalloc.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Memory allocator for Zephyr server.
- */
-
-#include <stdio.h>
-#include <zephyr/zephyr.h>
-#include "unix.h"
-#include "zalloc.h"
-
-#ifndef MPROF
-/*
- * What's the maximum number of words to expect to allocate through
- * this mechanism? (Larger requests will be fed to malloc.)
- */
-#define MAX_SIZE 32
-
-static void *free_space;
-static unsigned int free_space_size;
-static void *buckets[MAX_SIZE];
-#ifdef ZALLOC_STATS
-enum zalloc_memtype {
- FREE=0, ALLOCATED,
- N_zalloc_memtype
-};
-static int zalloc_count[MAX_SIZE][(int) N_zalloc_memtype];
-#endif
-
-/*
- union misc_types {
- void *void_p;
- int i;
- long l;
- double d;
- };
-*/
-/* SZ = sizeof(misc_types) */
-#define SZ 32
-
-/*
- * Pick some size here that will help keep down the number of calls to
- * malloc, but doesn't waste too much space. To avoid waste of space,
- * we leave some overhead before the next power of two.
- */
-
-
-/* ALLOC_SIZE = ((16384 - 32) / SZ) * SZ */
-#define ALLOC_SIZE 16352
-
-unsigned int round (size)
- unsigned int size;
-{
- size += SZ - 1;
- size -= (size % SZ);
- return size;
-}
-
-#define ROUND(size) (size = round (size))
-int BUCKET (size)
- unsigned int size;
-{
- ROUND (size);
- return size / SZ - 1;
-}
-
-static void
-zmemset (ptr, size, fill)
- void *ptr;
- int size;
- int fill;
-{
-#ifdef ZALLOC_DEBUG
- char *cptr = (char *) ptr;
- while (size--)
- cptr[size] = fill;
-#endif
-}
-
-void *
-zalloc (size)
- unsigned int size;
-{
- int bucket;
- void *ret;
- void **ptr;
-
- ROUND (size);
- bucket = BUCKET (size);
- if (bucket < 0 || bucket >= MAX_SIZE)
- return (void *) malloc (size);
-
- ptr = &buckets[bucket];
-#ifdef ZALLOC_DEBUG_PRINT
- fprintf (stderr, "zalloc(%d); looking in bucket %d, found %08X\n",
- size, bucket, *ptr);
-#endif
- if (*ptr) {
- ret = *ptr;
- *ptr = *(void**)ret;
- goto return_it;
- }
-
- if (free_space_size < size) {
- if (free_space_size > 0) {
- ptr = &buckets[BUCKET (free_space_size)];
- *(void**)free_space = *ptr;
- *ptr = free_space;
-#ifdef ZALLOC_DEBUG_PRINT
- fprintf (stderr, "tossing %08X into bucket %d\n",
- free_space, bucket);
-#endif
-#ifdef ZALLOC_STATS
- zalloc_count[BUCKET (free_space_size)][FREE]++;
-#endif
- }
-
- free_space_size = ALLOC_SIZE;
- free_space = (void *) malloc (free_space_size);
- if (!free_space)
- abort ();
-#ifdef ZALLOC_DEBUG_PRINT
- fprintf (stderr, "grabbing more free store at %08X\n", free_space);
-#endif
- }
-
- ret = free_space;
- free_space = (char *) free_space + size;
- free_space_size -= size;
-return_it:
-#ifdef ZALLOC_DEBUG_PRINT
- fprintf (stderr, "returning %08X\n", ret);
-#endif
- zmemset (ret, size, 0xe5);
-#ifdef ZALLOC_STATS
- zalloc_count[bucket][FREE]--, zalloc_count[bucket][ALLOCATED]++;
-#endif
- return ret;
-}
-
-void zfree (ptr, size)
- void *ptr;
- unsigned int size;
-{
- int bucket;
- void **b;
-
- ROUND (size);
- bucket = BUCKET (size);
- if (bucket < 0 || bucket >= MAX_SIZE) {
- free (ptr);
- return;
- }
-
- b = &buckets[bucket];
- zmemset (ptr, size, 0xe5);
- *(void **) ptr = *b;
- *b = ptr;
-#ifdef ZALLOC_DEBUG
-#ifdef ZALLOC_DEBUG_PRINT
- fprintf (stderr, "putting %08X into bucket %d\n",
- ptr, bucket);
- fprintf (stderr, "bucket %d:");
- for (ptr = buckets[bucket]; ptr; ptr=*(void**)ptr)
- fprintf (stderr, " %X", ptr);
- fprintf (stderr, "\n");
-#else
- for (ptr = buckets[bucket]; ptr; ptr=*(void**)ptr)
- /* do nothing, just read value */;
-#endif
-#endif
-
-#ifdef ZALLOC_STATS
- zalloc_count[bucket][FREE]++, zalloc_count[bucket][ALLOCATED]--;
-#endif
-}
-#endif
diff --git a/server/zalloc.h b/server/zalloc.h
deleted file mode 100644
index a2c60a8..0000000
--- a/server/zalloc.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- */
-
-#ifndef __zalloc_h
-#define __zalloc_h __FILE__
-#ifdef MPROF
-#define zalloc(sz) malloc(sz)
-#define zfree(p,sz) free(p)
-#else
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif /* STDC */
-
-extern void * zalloc P((unsigned int));
-extern void zfree P((void *, unsigned int));
-
-#undef P
-#endif /* MPROF */
-#endif /* __zalloc_h */
diff --git a/server/zserver.h b/server/zserver.h
index 8dede2b..4fe7c2a 100644
--- a/server/zserver.h
+++ b/server/zserver.h
@@ -16,27 +16,9 @@
#include <zephyr/mit-copyright.h>
-#include <zephyr/zephyr.h> /* which includes <errno.h>,
- <sys/types.h>,
- <netinet/in.h>,
- <sys/time.h>,
- <stdio.h>,
- <krb.h> */
+#include <internal.h>
#include <arpa/inet.h>
-#include <zephyr/acl.h>
-#include <sys/file.h>
-#include <fcntl.h>
-
-#include <zephyr/zsyslog.h>
-
-#include <string.h>
-#include <signal.h>
-#ifdef lint
-#include <sys/uio.h> /* so it shuts up about struct iovec */
-#endif /* lint */
-#ifdef _IBMR2
-#include <sys/select.h>
-#endif
+
#include "zsrv_err.h"
#include "timer.h"
@@ -44,277 +26,299 @@
#include "zstring.h"
#include "access.h"
-#include "unix.h"
-#include "zalloc.h"
+#include "acl.h"
-/* definitions for the Zephyr server */
-
-/* structures */
+/* For krb_rd_req prototype and definition. */
+#ifndef KRB_INT32
+#define KRB_INT32 ZEPHYR_INT32
+#endif
-/*
- * ZDestination: Where is this notice going to? This includes class,
- * instance, and recipient at the moment.
- */
+/* These macros are for insertion into and deletion from a singly-linked list
+ * with back pointers to the previous element's next pointer. In order to
+ * make these macros act like expressions, they use the comma operator for
+ * sequenced evaluations of assignment, and "a && b" for "evaluate assignment
+ * b if expression a is true". */
+#define LIST_INSERT(head, elem) \
+ ((elem)->next = *(head), \
+ (*head) && ((*(head))->prev_p = &(elem)->next), \
+ (*head) = (elem), (elem)->prev_p = (head))
+#define LIST_DELETE(elem) \
+ (*(elem)->prev_p = (elem)->next, \
+ (elem)->next && ((elem)->next->prev_p = (elem)->prev_p))
+
+/* Current time as cached by main(); use instead of time(). */
+#define NOW t_local.tv_sec
+
+#ifdef ZEPHYR_USES_KERBEROS
+#ifndef NOENCRYPTION
+/* Kerberos shouldn't stick us with array types... */
+typedef struct {
+ des_key_schedule s;
+} Sched;
+#endif
+#endif
-typedef struct _ZDestination {
- ZSTRING *classname;
- ZSTRING *inst;
- ZSTRING *recip;
-} ZDestination;
-
-/* typedef struct _Notice {
- ZNotice_t *notice;
- struct _ZDestination dest;
- ZSTRING *sender;
- int msg_no;
-} Notice;
-*/
-typedef struct _ZSubscr_t {
- struct _ZSubscr_t *q_forw; /* links in client's subscr. queue */
- struct _ZSubscr_t *q_back;
- struct _ZDestination zst_dest; /* destination of messages */
-} ZSubscr_t;
-
-typedef struct _ZClient_t {
- struct sockaddr_in zct_sin; /* ipaddr/port of client */
- struct _ZSubscr_t *zct_subs; /* subscriptions */
-#ifdef KERBEROS
- C_Block zct_cblock; /* session key for this client */
-#endif /* KERBEROS */
- ZSTRING *zct_principal; /* krb principal of user */
- long last_msg; /* last message sent to this client */
- long last_check; /* actually, last time the other
- server was asked to check... */
- int last_send; /* The send counter value for the
- * last packet sent to the client,
- * used to prevent duplicates. See
- * sendit() in dispatch.c. */
-} ZClient_t;
-
-typedef struct _ZClientList_t {
- struct _ZClientList_t *q_forw;
- struct _ZClientList_t *q_back;
- struct _ZClient_t *zclt_client;
-} ZClientList_t;
-
-typedef struct _ZTriplet_t {
- struct _ZTriplet_t *q_forw;
- struct _ZTriplet_t *q_back;
- ZDestination zct_dest;
- ZAcl_t *zct_acl;
- ZClientList_t *zct_clientlist;
-} ZTriplet_t;
-
-typedef struct _ZHostList_t {
- struct _ZHostList_t *q_forw;
- struct _ZHostList_t *q_back;
- ZClientList_t *zh_clients;
- struct sockaddr_in zh_addr; /* IP addr/port of hostmanager */
- unsigned int zh_locked; /* 1 if this host is locked for
- a braindump */
-} ZHostList_t;
-
-typedef enum _server_state {
- SERV_UP, /* Server is up */
- SERV_TARDY, /* Server due for a hello */
- SERV_DEAD, /* Server is considered dead */
- SERV_STARTING /* Server is between dead and up */
-} server_state;
-
-typedef struct _ZNotAcked_t {
- struct _ZNotAcked_t *q_forw; /* link to next */
- struct _ZNotAcked_t *q_back; /* link to prev */
- timer na_timer; /* timer for retransmit */
- long na_abstimo; /* absolute timeout to drop after */
- short na_rexmits; /* number of retransmits */
- short na_packsz; /* size of packet */
- caddr_t na_packet; /* ptr to packet */
- ZUnique_Id_t na_uid; /* uid of packet */
- union { /* address to send to */
- struct sockaddr_in na_sin; /* client address */
- int srv_idx; /* index of server */
- } dest;
-#define na_addr dest.na_sin
-#define na_srv_idx dest.srv_idx
-} ZNotAcked_t;
-
-typedef struct _ZSrvPending_t {
- struct _ZSrvPending_t *q_forw; /* link to next */
- struct _ZSrvPending_t *q_back; /* link to prev */
- caddr_t pend_packet; /* the notice (in pkt form) */
- short pend_len; /* len of pkt */
- unsigned int pend_auth; /* whether it is authentic */
- struct sockaddr_in pend_who; /* the addr of the sender */
-} ZSrvPending_t;
-
-typedef struct _ZServerDesc_t {
- server_state zs_state; /* server's state */
- struct sockaddr_in zs_addr; /* server's address */
- long zs_timeout; /* Length of timeout in sec */
- timer zs_timer; /* timer struct for this server */
- struct _ZHostList_t *zs_hosts; /* pointer to list of info from this
- server */
- struct _ZSrvPending_t *zs_update_queue; /* queue of packets to send
+typedef struct _Destination Destination;
+typedef struct _Destlist Destlist;
+typedef struct _Realm Realm;
+typedef struct _Realmname Realmname;
+typedef struct _Client Client;
+typedef struct _Triplet Triplet;
+typedef enum _Server_state Server_state;
+typedef struct _Unacked Unacked;
+typedef struct _Pending Pending;
+typedef struct _Server Server;
+typedef enum _Sent_type Sent_type;
+typedef struct _Statistic Statistic;
+
+struct _Destination {
+ String *classname;
+ String *inst;
+ String *recip;
+};
+
+struct _Destlist {
+ Destination dest;
+ struct _Destlist *next, **prev_p;
+};
+
+struct _Realm {
+ char name[REALM_SZ];
+ int count;
+ struct sockaddr_in *addrs;
+ int idx; /* which server we are connected to */
+ Destlist *subs;
+ Client *client;
+ long tkt_try;
+};
+
+struct _Realmname {
+ char name[REALM_SZ];
+ char **servers;
+ int nused;
+ int nservers;
+};
+
+struct _Client {
+ struct sockaddr_in addr; /* ipaddr/port of client */
+ Destlist *subs ; /* subscriptions */
+#ifdef ZEPHYR_USES_KERBEROS
+ C_Block session_key; /* session key for this client */
+#endif /* ZEPHYR_USES_KERBEROS */
+ String *principal; /* krb principal of user */
+ time_t last_check; /* last time the other server was
+ asked to check */
+ long last_msg; /* last message sent to this client */
+ int last_send; /* Counter for last sent packet. */
+ Realm *realm;
+ struct _Client *next, **prev_p;
+};
+
+struct _Triplet {
+ Destination dest;
+ Acl *acl;
+ Client **clients;
+ int clients_size;
+ struct _Triplet *next, **prev_p;
+};
+
+enum _Server_state {
+ SERV_UP, /* Server is up */
+ SERV_TARDY, /* Server due for a hello */
+ SERV_DEAD, /* Server is considered dead */
+ SERV_STARTING /* Server is between dead and up */
+};
+
+struct _Unacked {
+ Timer *timer; /* timer for retransmit */
+ short rexmits; /* number of retransmits */
+ short packsz; /* size of packet */
+ char *packet; /* ptr to packet */
+ ZUnique_Id_t uid; /* uid of packet */
+ struct sockaddr_in ack_addr;
+ union { /* address to send to */
+ struct sockaddr_in addr; /* client address */
+ int srv_idx; /* index of server */
+ struct {
+ int rlm_idx; /* index of realm */
+ int rlm_srv_idx; /* index of server in realm */
+ } rlm;
+ } dest;
+ struct _Unacked *next, **prev_p;
+};
+
+struct _Pending {
+ char *packet; /* the notice (in pkt form) */
+ short len; /* len of pkt */
+ unsigned int auth; /* whether it is authentic */
+ struct sockaddr_in who; /* the addr of the sender */
+ struct _Pending *next;
+};
+
+struct _Server {
+ Server_state state; /* server's state */
+ struct sockaddr_in addr; /* server's address */
+ long timeout; /* Length of timeout in sec */
+ Timer *timer; /* timer for this server */
+ Pending *queue; /* queue of packets to send
to this server when done dumping */
- short zs_numsent; /* number of hello's sent */
- unsigned int zs_dumping; /* 1 if dumping, so we should queue */
- char addr[16]; /* text version of address */
-} ZServerDesc_t;
-
-typedef enum ZSentType {
- NOT_SENT, /* message was not xmitted */
- SENT, /* message was xmitted */
- AUTH_FAILED, /* authentication failed */
- NOT_FOUND /* user not found for uloc */
-} ZSentType;
+ Pending *queue_last; /* last packet on queue */
+ short num_hello_sent; /* number of hello's sent */
+ unsigned int dumping; /* 1 if dumping, so we should queue */
+ char addr_str[16]; /* text version of address */
+};
+
+enum _Sent_type {
+ NOT_SENT, /* message was not xmitted */
+ SENT, /* message was xmitted */
+ AUTH_FAILED, /* authentication failed */
+ NOT_FOUND /* user not found for uloc */
+};
/* statistics gathering */
-typedef struct _ZStatistic_t {
- int val;
- char *str;
-} ZStatistic;
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
+struct _Statistic {
+ int val;
+ char *str;
+};
/* Function declarations */
/* found in bdump.c */
-extern void bdump_get P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
- ZServerDesc_t *server));
-extern void bdump_send P((void));
-extern void bdump_offer P((struct sockaddr_in *who));
-extern Code_t bdump_send_list_tcp P((ZNotice_Kind_t kind, int port,
- char *class_name, char *inst, char *opcode,
- char *sender, char *recip,
- char **lyst, int num));
+void bdump_get __P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
+ Server *server));
+void bdump_send __P((void));
+void bdump_offer __P((struct sockaddr_in *who));
+Code_t bdump_send_list_tcp __P((ZNotice_Kind_t kind, struct sockaddr_in *addr,
+ char *class_name, char *inst, char *opcode,
+ char *sender, char *recip, char **lyst,
+ int num));
+int get_tgt __P((void));
/* found in class.c */
-extern Code_t triplet_register P((ZClient_t *client, ZDestination *dest));
-extern Code_t triplet_deregister P((ZClient_t *client, ZDestination *dest));
-extern Code_t class_restrict P((char *z_class, ZAcl_t *acl));
-extern Code_t class_setup_restricted P((char *z_class, ZAcl_t *acl));
-extern ZClientList_t *triplet_lookup P((ZDestination *dest));
-extern ZAcl_t *class_get_acl P((ZSTRING *z_class));
-extern void class_free P((ZClientList_t *lyst));
-extern ZSTRING *class_control, *class_admin, *class_hm;
-extern ZSTRING *class_ulogin, *class_ulocate;
-extern void set_ZDestination_hash P((ZDestination *zd));
-extern int ZDest_eq P((ZDestination *zd1, ZDestination *zd2));
-extern int order_dest_strings P((ZDestination *zd1, ZDestination *zd2));
-extern void class_dump_subs P((register FILE *fp));
+extern String *class_control, *class_admin, *class_hm;
+extern String *class_ulogin, *class_ulocate;
+int ZDest_eq __P((Destination *d1, Destination *d2));
+Code_t triplet_register __P((Client *client, Destination *dest, Realm *realm));
+Code_t triplet_deregister __P((Client *client, Destination *dest,
+ Realm *realm));
+Code_t class_restrict __P((char *class, Acl *acl));
+Code_t class_setup_restricted __P((char *class, Acl *acl));
+Client **triplet_lookup __P((Destination *dest));
+Acl *class_get_acl __P((String *class));
+int dest_eq __P((Destination *d1, Destination *d2));
+int order_dest_strings __P((Destination *d1, Destination *d2));
+void triplet_dump_subs __P((FILE *fp));
/* found in client.c */
-extern Code_t client_register P((ZNotice_t *notice, struct sockaddr_in *who,
- register ZClient_t **client,
- ZServerDesc_t *server, int wantdefaults));
-extern void client_deregister P((ZClient_t *client, ZHostList_t *host,
- int flush));
-extern void client_dump_clients P((FILE *fp, ZClientList_t *clist));
-extern ZClient_t *client_which_client P((struct sockaddr_in *who,
- ZNotice_t *notice));
+Code_t client_register __P((ZNotice_t *notice, struct in_addr *host,
+ Client **client_p, int wantdefaults));
+void client_deregister __P((Client *client, int flush));
+void client_flush_host __P((struct in_addr *host));
+void client_dump_clients __P((FILE *fp));
+Client *client_which_client __P((struct in_addr *host, ZNotice_t *notice));
+Code_t client_send_clients __P((void));
/* found in common.c */
-extern char *strsave P((Zconst char *str));
-extern unsigned long hash P((Zconst char *));
-extern void subscr_quote P((char *p, FILE *fp));
+char *strsave __P((const char *str));
+unsigned long hash __P((const char *));
+void dump_quote __P((char *p, FILE *fp));
/* found in dispatch.c */
-extern void handle_packet P((void));
-extern void clt_ack P((ZNotice_t *notice, struct sockaddr_in *who,
- ZSentType sent));
-extern void nack_release P((ZClient_t *client));
-extern void sendit P((register ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern void rexmit P((void *));
-extern void xmit P((register ZNotice_t *notice, struct sockaddr_in *dest,
- int auth, ZClient_t *client));
-extern Code_t control_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- ZServerDesc_t *server));
-extern Code_t xmit_frag P((ZNotice_t *notice, char *buf, int len,
- int waitforack));
-
-/* found in hostm.c */
-extern void hostm_flush P((ZHostList_t *host, ZServerDesc_t *server));
-extern void hostm_shutdown P((void));
-extern void hostm_losing P((ZClient_t *client, ZHostList_t *host));
-extern ZHostList_t *hostm_find_host P((struct in_addr *addr));
-extern ZServerDesc_t *hostm_find_server P((struct in_addr *addr));
-extern void hostm_transfer P((ZHostList_t *host, ZServerDesc_t *server));
-extern void hostm_deathgram P((struct sockaddr_in *sin,
- ZServerDesc_t *server));
-extern void hostm_dump_hosts P((FILE *fp));
-extern Code_t hostm_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, ZServerDesc_t *server));
-extern void hostm_lose_ignore P((ZClient_t *client));
-extern void hostm_renumber_servers P((int *));
+void handle_packet __P((void));
+void clt_ack __P((ZNotice_t *notice, struct sockaddr_in *who, Sent_type sent));
+void nack_release __P((Client *client));
+void sendit __P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
+ int external));
+void rexmit __P((void *));
+void xmit __P((ZNotice_t *notice, struct sockaddr_in *dest, int auth,
+ Client *client));
+Code_t hostm_dispatch __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server));
+Code_t control_dispatch __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server));
+Code_t xmit_frag __P((ZNotice_t *notice, char *buf, int len, int waitforack));
+void hostm_shutdown __P((void));
/* found in kstuff.c */
-#ifdef KERBEROS
-extern int GetKerberosData P((int, struct in_addr, AUTH_DAT*, char*, char*));
-extern Code_t SendKerberosData P((int, KTEXT, char*, char*));
+#ifdef ZEPHYR_USES_KERBEROS
+int GetKerberosData __P((int, struct in_addr, AUTH_DAT *, char *, char *));
+Code_t SendKerberosData __P((int, KTEXT, char *, char *));
+void sweep_ticket_hash_table __P((void *));
#endif
-/* found in server.c */
-extern void server_timo P((void *which));
-extern void server_recover P((ZClient_t *client)),
- server_dump_servers P((FILE *fp));
-extern void server_init P((void)),
- server_shutdown P((void));
-extern void server_forward P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern void server_kill_clt P((ZClient_t *client));
-extern void server_pending_free P((register ZSrvPending_t *pending));
-extern void server_self_queue P((ZNotice_t*, int, struct sockaddr_in *)),
- server_send_queue P((ZServerDesc_t *)),
- server_reset P((void));
-extern int is_server();
-extern ZServerDesc_t *server_which_server P((struct sockaddr_in *who));
-extern ZSrvPending_t *server_dequeue P((register ZServerDesc_t *server));
-extern Code_t server_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern Code_t server_adispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- ZServerDesc_t *server));
+/* found in kopt.c */
+#ifdef ZEPHYR_USES_KERBEROS
+#ifndef NOENCRYPTION
+Sched *check_key_sched_cache __P((des_cblock key));
+void add_to_key_sched_cache __P((des_cblock key, Sched *sched));
+int krb_set_key __P((char *key, int cvt));
+int krb_rd_req __P((KTEXT authent, char *service, char *instance,
+ unsigned KRB_INT32 from_addr, AUTH_DAT *ad, char *fn));
+int krb_find_ticket __P((KTEXT authent, KTEXT ticket));
+int krb_get_lrealm __P((char *r, int n));
+#endif
+#endif
+/* found in server.c */
+void server_timo __P((void *which));
+void server_dump_servers __P((FILE *fp));
+void server_init __P((void));
+void server_shutdown __P((void));
+void server_forward __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who));
+void server_kill_clt __P((Client *client));
+void server_pending_free __P((Pending *pending));
+void server_self_queue __P((ZNotice_t *, int, struct sockaddr_in *));
+void server_send_queue __P((Server *));
+void server_reset __P((void));
+int is_server();
+Server *server_which_server __P((struct sockaddr_in *who));
+Pending *server_dequeue __P((Server *server));
+Code_t server_dispatch __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who));
+Code_t server_adispatch __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server));
/* found in subscr.c */
-extern Code_t subscr_cancel P((struct sockaddr_in *sin, ZNotice_t *notice));
-extern Code_t subscr_subscribe P((ZClient_t *who, ZNotice_t *notice)),
- subscr_send_subs P((ZClient_t *client, char *vers));;
-extern void subscr_free_list P((ZClientList_t *list)),
- subscr_cancel_client P((register ZClient_t *client)),
- subscr_sendlist P((ZNotice_t *notice, int auth, struct sockaddr_in *who));
-extern void subscr_dump_subs P((FILE *fp, ZSubscr_t *subs)),
- subscr_reset P((void));
-extern int compare_subs P((ZSubscr_t *s1, ZSubscr_t *s2, int do_wildcard));
-extern Code_t subscr_def_subs P((ZClient_t *who));
+Code_t subscr_cancel __P((struct sockaddr_in *sin, ZNotice_t *notice));
+Code_t subscr_subscribe __P((Client *who, ZNotice_t *notice));
+Code_t subscr_send_subs __P((Client *client));
+void subscr_cancel_client __P((Client *client));
+void subscr_sendlist __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who));
+void subscr_dump_subs __P((FILE *fp, Destlist *subs));
+void subscr_reset __P((void));
+Code_t subscr_def_subs __P((Client *who));
/* found in uloc.c */
-extern void uloc_hflush P((struct in_addr *addr)),
- uloc_flush_client P((struct sockaddr_in *sin)),
- uloc_dump_locs P((register FILE *fp));
-extern Code_t ulogin_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, ZServerDesc_t *server)),
- ulocate_dispatch P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
- ZServerDesc_t *server)),
- uloc_send_locations P((ZHostList_t *host, char *vers));
+void uloc_hflush __P((struct in_addr *addr));
+void uloc_flush_client __P((struct sockaddr_in *sin));
+void uloc_dump_locs __P((FILE *fp));
+Code_t ulogin_dispatch __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server));
+Code_t ulocate_dispatch __P((ZNotice_t *notice, int auth,
+ struct sockaddr_in *who, Server *server));
+Code_t uloc_send_locations __P((void));
+
+/* found in realm.c */
+Realm *realm_which_realm __P((struct sockaddr_in *who));
+Realm *realm_get_realm_by_name __P((char *name));
+void realm_handoff(ZNotice_t *, int, struct sockaddr_in *, Realm *, int);
+char *realm_expand_realm(char *);
+void realm_init __P((void));
+Code_t ZCheckRealmAuthentication __P((ZNotice_t *, struct sockaddr_in *,
+ char *));
/* found in version.c */
-extern char *get_version P((void));
-
-#undef P
-
+char *get_version __P((void));
/* global identifiers */
/* found in main.c */
-extern struct sockaddr_in sock_sin; /* socket descriptors */
-extern u_short hm_port; /* port # of hostmanagers */
+int packets_waiting __P((void));
+extern struct sockaddr_in srv_addr; /* server socket address */
+extern unsigned short hm_port; /* host manager receiver port */
+extern unsigned short hm_srv_port; /* host manager server sending port */
extern int srv_socket; /* dgram sockets for clients
and other servers */
extern int bdump_socket; /* brain dump socket
@@ -322,31 +326,41 @@ extern int bdump_socket; /* brain dump socket
extern fd_set interesting; /* the file descrips we are listening
to right now */
-extern int nfildes; /* number to look at in select() */
+extern int nfds; /* number to look at in select() */
extern int zdebug;
extern char myname[]; /* domain name of this host */
-extern ZNotAcked_t *nacklist; /* list of not ack'ed packets */
-extern Zconst char version[];
+#ifndef ZEPHYR_USES_HESIOD
+extern char list_file[];
+#endif
+#ifdef ZEPHYR_USES_KERBEROS
+extern char srvtab_file[];
+extern char my_realm[];
+#endif
+extern char acl_dir[];
+extern char subs_file[];
+extern const char version[];
extern u_long npackets; /* num of packets processed */
-extern long uptime; /* time we started */
+extern time_t uptime; /* time we started */
extern struct in_addr my_addr;
+extern struct timeval t_local; /* current time */
/* found in bdump.c */
-extern int bdumping; /* are we dumping right now? */
+extern int bdumping; /* are we processing a bdump packet? */
+extern int bdump_concurrent; /* set while processing a packet
+ * concurrently during a braindump. */
/* found in dispatch.c */
-extern ZStatistic i_s_ctls, i_s_logins, i_s_admins, i_s_locates;
-extern int num_rexmits;
-extern long rexmit_secs, abs_timo;
+extern Statistic i_s_ctls, i_s_logins, i_s_admins, i_s_locates;
+extern int rexmit_times[];
/* found in server.c */
-extern ZServerDesc_t *otherservers; /* array of servers */
+extern Server *otherservers; /* array of servers */
extern int me_server_idx; /* me (in the array of servers) */
extern int nservers; /* number of other servers*/
/* found in subscr.c */
-extern ZSTRING *empty;
-extern ZSTRING *wildcard_instance;
+extern String *empty;
+extern String *wildcard_instance;
extern struct in_addr my_addr; /* my inet address */
@@ -363,24 +377,12 @@ extern struct in_addr my_addr; /* my inet address */
#define ADMIN_DONE "DUMP_DONE" /* Opcode: brain dump for this server
is complete */
#define ADMIN_NEWCLT "NEXT_CLIENT" /* Opcode: this is a new client */
-#define ADMIN_LOST_CLT "LOST_CLIENT" /* Opcode: client not ack'ing */
#define ADMIN_KILL_CLT "KILL_CLIENT" /* Opcode: client is dead, remove */
#define ADMIN_STATUS "STATUS" /* Opcode: please send status */
-#define ADMIN_LIMBO "LIMBO" /* Class inst: please send limbo info*/
-#define ADMIN_YOU "YOUR_STATE" /* Class inst: please send your state*/
-#define ADMIN_ME "MY_STATE" /* Class inst: please send my info */
-
-#define NULLZT ((ZTriplet_t *) 0)
-#define NULLZCNT ((ZClient_t *) 0)
-#define NULLZCLT ((ZClientList_t *) 0)
-#define NULLZST ((ZSubscr_t *) 0)
-#define NULLZHLT ((ZHostList_t *) 0)
-#define NULLZNAT ((ZNotAcked_t *) 0)
-#define NULLZACLT ((ZAcl_t *) 0)
-#define NULLZPT ((ZPacket_t *) 0)
-#define NULLZSDT ((ZServerDesc_t *) 0)
-#define NULLZSPT ((ZSrvPending_t *) 0)
+#define ADMIN_NEWREALM "NEXT_REALM" /* Opcode: this is a new realm */
+#define REALM_REQ_LOCATE "REQ_LOCATE" /* Opcode: request a location */
+#define REALM_ANS_LOCATE "ANS_LOCATE" /* Opcode: answer to location */
/* me_server_idx is the index into otherservers of this server descriptor. */
/* the 'limbo' server is always the first server */
@@ -389,11 +391,12 @@ extern struct in_addr my_addr; /* my inet address */
#define limbo_server_idx() (0)
#define limbo_server (&otherservers[limbo_server_idx()])
-#define msgs_queued() (ZQLength() || otherservers[me_server_idx].zs_update_queue)
+#define msgs_queued() (ZQLength() || otherservers[me_server_idx].queue)
#define ack(a,b) clt_ack(a,b,SENT)
#define nack(a,b) clt_ack(a,b,NOT_SENT)
+#define min(a,b) ((a) < (b) ? (a) : (b))
#define max(a,b) ((a) > (b) ? (a) : (b))
#define START_CRITICAL_CODE
@@ -402,18 +405,6 @@ extern struct in_addr my_addr; /* my inet address */
/* the instance that matches all instances */
#define WILDCARD_INSTANCE "*"
-/* SERVER_SRVTAB is defined in zephyr.h */
-#define ZEPHYR_SRVTAB SERVER_SRVTAB
-
-#ifdef KERBEROS
-#ifndef NOENCRYPTION
-/* Kerberos shouldn't stick us with array types... */
-typedef struct {
- des_key_schedule s;
-} Sched;
-#endif
-#endif
-
/* debugging macros */
#ifdef DEBUG
#define zdbug(s1) if (zdebug) syslog s1;
diff --git a/server/zserver.h.auth b/server/zserver.h.auth
deleted file mode 100644
index 41f6380..0000000
--- a/server/zserver.h.auth
+++ /dev/null
@@ -1,425 +0,0 @@
-#ifndef __ZSERVER_H__
-#define __ZSERVER_H__
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains declarations for use in the server.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- * $Zephyr: /mit/zephyr/src/server/RCS/zserver.h,v 1.34 91/03/08 12:53:24 raeburn Exp $
- *
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr.h> /* which includes <errno.h>,
- <sys/types.h>,
- <netinet/in.h>,
- <sys/time.h>,
- <stdio.h>,
- <krb.h> */
-#include <arpa/inet.h>
-#include <zephyr/acl.h>
-#include <sys/file.h>
-#include <fcntl.h>
-
-#include <zephyr/zsyslog.h>
-
-#include <string.h>
-#include <signal.h>
-#ifdef lint
-#include <sys/uio.h> /* so it shuts up about struct iovec */
-#endif /* lint */
-#ifdef _IBMR2
-#include <sys/select.h>
-#endif
-#include "zsrv_err.h"
-
-#include "timer.h"
-#include "zsrv_conf.h" /* configuration params */
-
-#include "zstring.h"
-#include "access.h"
-#include "unix.h"
-#include "zalloc.h"
-
-/* definitions for the Zephyr server */
-
-/* structures */
-
-/*
- * ZDestination: Where is this notice going to? This includes class,
- * instance, and recipient at the moment.
- */
-
-typedef struct _ZDestination {
- ZSTRING *classname;
- ZSTRING *inst;
- ZSTRING *recip;
-} ZDestination;
-
-/* typedef struct _Notice {
- ZNotice_t *notice;
- struct _ZDestination dest;
- ZSTRING *sender;
- int msg_no;
-} Notice;
-*/
-typedef struct _ZSubscr_t {
- struct _ZSubscr_t *q_forw; /* links in client's subscr. queue */
- struct _ZSubscr_t *q_back;
- struct _ZDestination zst_dest; /* destination of messages */
-} ZSubscr_t;
-
-typedef struct _ZClient_t {
- struct sockaddr_in zct_sin; /* ipaddr/port of client */
- struct _ZSubscr_t *zct_subs; /* subscriptions */
-#ifdef KERBEROS
- C_Block zct_cblock; /* session key for this client */
-#endif /* KERBEROS */
- ZSTRING *zct_principal; /* krb principal of user */
- long last_msg; /* last message sent to this client */
- long last_check; /* actually, last time the other
- server was asked to check... */
- int last_send; /* The send counter value for the
- * last packet sent to the client,
- * used to prevent duplicates. See
- * sendit() in dispatch.c. */
-} ZClient_t;
-
-typedef struct _ZClientList_t {
- struct _ZClientList_t *q_forw;
- struct _ZClientList_t *q_back;
- struct _ZClient_t *zclt_client;
-} ZClientList_t;
-
-typedef struct _ZTriplet_t {
- struct _ZTriplet_t *q_forw;
- struct _ZTriplet_t *q_back;
- ZDestination zct_dest;
- ZAcl_t *zct_acl;
- ZClientList_t *zct_clientlist;
-} ZTriplet_t;
-
-typedef struct _ZHostList_t {
- struct _ZHostList_t *q_forw;
- struct _ZHostList_t *q_back;
- ZClientList_t *zh_clients;
- struct sockaddr_in zh_addr; /* IP addr/port of hostmanager */
- unsigned int zh_locked; /* 1 if this host is locked for
- a braindump */
-} ZHostList_t;
-
-typedef enum _server_state {
- SERV_UP, /* Server is up */
- SERV_TARDY, /* Server due for a hello */
- SERV_DEAD, /* Server is considered dead */
- SERV_STARTING /* Server is between dead and up */
-} server_state;
-
-typedef struct _ZNotAcked_t {
- struct _ZNotAcked_t *q_forw; /* link to next */
- struct _ZNotAcked_t *q_back; /* link to prev */
- timer na_timer; /* timer for retransmit */
- long na_abstimo; /* absolute timeout to drop after */
- short na_rexmits; /* number of retransmits */
- short na_packsz; /* size of packet */
- caddr_t na_packet; /* ptr to packet */
- ZUnique_Id_t na_uid; /* uid of packet */
- union { /* address to send to */
- struct sockaddr_in na_sin; /* client address */
- int srv_idx; /* index of server */
- } dest;
-#define na_addr dest.na_sin
-#define na_srv_idx dest.srv_idx
-} ZNotAcked_t;
-
-typedef struct _ZSrvPending_t {
- struct _ZSrvPending_t *q_forw; /* link to next */
- struct _ZSrvPending_t *q_back; /* link to prev */
- caddr_t pend_packet; /* the notice (in pkt form) */
- short pend_len; /* len of pkt */
- unsigned int pend_auth; /* whether it is authentic */
- struct sockaddr_in pend_who; /* the addr of the sender */
-} ZSrvPending_t;
-
-typedef struct _ZServerDesc_t {
- server_state zs_state; /* server's state */
- struct sockaddr_in zs_addr; /* server's address */
- long zs_timeout; /* Length of timeout in sec */
- timer zs_timer; /* timer struct for this server */
- struct _ZHostList_t *zs_hosts; /* pointer to list of info from this
- server */
- struct _ZSrvPending_t *zs_update_queue; /* queue of packets to send
- to this server when done dumping */
- short zs_numsent; /* number of hello's sent */
- unsigned int zs_dumping; /* 1 if dumping, so we should queue */
- char addr[16]; /* text version of address */
-} ZServerDesc_t;
-
-typedef enum ZSentType {
- NOT_SENT, /* message was not xmitted */
- SENT, /* message was xmitted */
- AUTH_FAILED, /* authentication failed */
- NOT_FOUND /* user not found for uloc */
-} ZSentType;
-
-/* statistics gathering */
-typedef struct _ZStatistic_t {
- int val;
- char *str;
-} ZStatistic;
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-/* Function declarations */
-
-/* found in bdump.c */
-extern void bdump_get P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
- ZServerDesc_t *server));
-extern void bdump_send P((void));
-extern void bdump_offer P((struct sockaddr_in *who));
-extern Code_t bdump_send_list_tcp P((ZNotice_Kind_t kind, int port,
- char *class_name, char *inst, char *opcode,
- char *sender, char *recip,
- char **lyst, int num));
-
-/* found in class.c */
-extern Code_t triplet_register P((ZClient_t *client, ZDestination *dest));
-extern Code_t triplet_deregister P((ZClient_t *client, ZDestination *dest));
-extern Code_t class_restrict P((char *z_class, ZAcl_t *acl));
-extern Code_t class_setup_restricted P((char *z_class, ZAcl_t *acl));
-extern ZClientList_t *triplet_lookup P((ZDestination *dest));
-extern ZAcl_t *class_get_acl P((ZSTRING *z_class));
-extern void class_free P((ZClientList_t *lyst));
-extern ZSTRING *class_control, *class_admin, *class_hm;
-extern ZSTRING *class_ulogin, *class_ulocate;
-extern void set_ZDestination_hash P((ZDestination *zd));
-extern int ZDest_eq P((ZDestination *zd1, ZDestination *zd2));
-extern int order_dest_strings P((ZDestination *zd1, ZDestination *zd2));
-extern void class_dump_subs P((register FILE *fp));
-
-/* found in client.c */
-extern Code_t client_register P((ZNotice_t *notice, struct sockaddr_in *who,
- register ZClient_t **client,
- ZServerDesc_t *server, int wantdefaults));
-extern void client_deregister P((ZClient_t *client, ZHostList_t *host,
- int flush));
-extern void client_dump_clients P((FILE *fp, ZClientList_t *clist));
-extern ZClient_t *client_which_client P((struct sockaddr_in *who,
- ZNotice_t *notice));
-
-/* found in common.c */
-extern char *strsave P((Zconst char *str));
-extern unsigned long hash P((Zconst char *));
-extern void subscr_quote P((char *p, FILE *fp));
-
-/* found in dispatch.c */
-extern void handle_packet P((void));
-extern void clt_ack P((ZNotice_t *notice, struct sockaddr_in *who,
- ZSentType sent));
-extern void nack_release P((ZClient_t *client));
-extern void sendit P((register ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern void rexmit P((void *));
-extern void xmit P((register ZNotice_t *notice, struct sockaddr_in *dest,
- int auth, ZClient_t *client));
-extern Code_t control_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- ZServerDesc_t *server));
-extern Code_t xmit_frag P((ZNotice_t *notice, char *buf, int len,
- int waitforack));
-
-/* found in hostm.c */
-extern void hostm_flush P((ZHostList_t *host, ZServerDesc_t *server));
-extern void hostm_shutdown P((void));
-extern void hostm_losing P((ZClient_t *client, ZHostList_t *host));
-extern ZHostList_t *hostm_find_host P((struct in_addr *addr));
-extern ZServerDesc_t *hostm_find_server P((struct in_addr *addr));
-extern void hostm_transfer P((ZHostList_t *host, ZServerDesc_t *server));
-extern void hostm_deathgram P((struct sockaddr_in *sin,
- ZServerDesc_t *server));
-extern void hostm_dump_hosts P((FILE *fp));
-extern Code_t hostm_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, ZServerDesc_t *server));
-extern void hostm_lose_ignore P((ZClient_t *client));
-extern void hostm_renumber_servers P((int *));
-
-/* found in kstuff.c */
-#ifdef KERBEROS
-extern int GetKerberosData P((int, struct in_addr, AUTH_DAT*, char*, char*));
-extern Code_t SendKerberosData P((int, KTEXT, char*, char*));
-#endif
-void sweep_ticket_hash_table P((void *));
-
-/* found in server.c */
-extern void server_timo P((void *which));
-extern void server_recover P((ZClient_t *client)),
- server_dump_servers P((FILE *fp));
-extern void server_init P((void)),
- server_shutdown P((void));
-extern void server_forward P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern void server_kill_clt P((ZClient_t *client));
-extern void server_pending_free P((register ZSrvPending_t *pending));
-extern void server_self_queue P((ZNotice_t*, int, struct sockaddr_in *)),
- server_send_queue P((ZServerDesc_t *)),
- server_reset P((void));
-extern int is_server();
-extern ZServerDesc_t *server_which_server P((struct sockaddr_in *who));
-extern ZSrvPending_t *server_dequeue P((register ZServerDesc_t *server));
-extern Code_t server_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern Code_t server_adispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- ZServerDesc_t *server));
-
-
-/* found in subscr.c */
-extern Code_t subscr_cancel P((struct sockaddr_in *sin, ZNotice_t *notice));
-extern Code_t subscr_subscribe P((ZClient_t *who, ZNotice_t *notice)),
- subscr_send_subs P((ZClient_t *client, char *vers));;
-extern void subscr_free_list P((ZClientList_t *list)),
- subscr_cancel_client P((register ZClient_t *client)),
- subscr_sendlist P((ZNotice_t *notice, int auth, struct sockaddr_in *who));
-extern void subscr_dump_subs P((FILE *fp, ZSubscr_t *subs)),
- subscr_reset P((void));
-extern int compare_subs P((ZSubscr_t *s1, ZSubscr_t *s2, int do_wildcard));
-extern Code_t subscr_def_subs P((ZClient_t *who));
-
-/* found in uloc.c */
-extern void uloc_hflush P((struct in_addr *addr)),
- uloc_flush_client P((struct sockaddr_in *sin)),
- uloc_dump_locs P((register FILE *fp));
-extern Code_t ulogin_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, ZServerDesc_t *server)),
- ulocate_dispatch P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
- ZServerDesc_t *server)),
- uloc_send_locations P((ZHostList_t *host, char *vers));
-
-/* found in version.c */
-extern char *get_version P((void));
-
-#undef P
-
-
-/* global identifiers */
-
-/* found in main.c */
-extern struct sockaddr_in sock_sin; /* socket descriptors */
-extern u_short hm_port; /* port # of hostmanagers */
-extern int srv_socket; /* dgram sockets for clients
- and other servers */
-extern int bdump_socket; /* brain dump socket
- (closed most of the time) */
-
-extern fd_set interesting; /* the file descrips we are listening
- to right now */
-extern int nfildes; /* number to look at in select() */
-extern int zdebug;
-extern char myname[]; /* domain name of this host */
-extern ZNotAcked_t *nacklist; /* list of not ack'ed packets */
-extern Zconst char version[];
-extern u_long npackets; /* num of packets processed */
-extern long uptime; /* time we started */
-extern struct in_addr my_addr;
-
-/* found in bdump.c */
-extern int bdumping; /* are we dumping right now? */
-
-/* found in dispatch.c */
-extern ZStatistic i_s_ctls, i_s_logins, i_s_admins, i_s_locates;
-extern int num_rexmits;
-extern long rexmit_secs, abs_timo;
-
-/* found in server.c */
-extern ZServerDesc_t *otherservers; /* array of servers */
-extern int me_server_idx; /* me (in the array of servers) */
-extern int nservers; /* number of other servers*/
-
-/* found in subscr.c */
-extern ZSTRING *empty;
-extern ZSTRING *wildcard_instance;
-
-extern struct in_addr my_addr; /* my inet address */
-
-#define class_is_control(classname) (classname == class_control)
-#define class_is_admin(classname) (classname == class_admin)
-#define class_is_hm(classname) (classname == class_hm)
-#define class_is_ulogin(classname) (classname == class_ulogin)
-#define class_is_ulocate(classname) (classname == class_ulocate)
-
-#define ADMIN_HELLO "HELLO" /* Opcode: hello, are you there */
-#define ADMIN_IMHERE "IHEARDYOU" /* Opcode: yes, I am here */
-#define ADMIN_SHUTDOWN "GOODBYE" /* Opcode: I am shutting down */
-#define ADMIN_BDUMP "DUMP_AVAIL" /* Opcode: I will give you a dump */
-#define ADMIN_DONE "DUMP_DONE" /* Opcode: brain dump for this server
- is complete */
-#define ADMIN_NEWCLT "NEXT_CLIENT" /* Opcode: this is a new client */
-#define ADMIN_LOST_CLT "LOST_CLIENT" /* Opcode: client not ack'ing */
-#define ADMIN_KILL_CLT "KILL_CLIENT" /* Opcode: client is dead, remove */
-#define ADMIN_STATUS "STATUS" /* Opcode: please send status */
-
-#define ADMIN_LIMBO "LIMBO" /* Class inst: please send limbo info*/
-#define ADMIN_YOU "YOUR_STATE" /* Class inst: please send your state*/
-#define ADMIN_ME "MY_STATE" /* Class inst: please send my info */
-
-#define NULLZT ((ZTriplet_t *) 0)
-#define NULLZCNT ((ZClient_t *) 0)
-#define NULLZCLT ((ZClientList_t *) 0)
-#define NULLZST ((ZSubscr_t *) 0)
-#define NULLZHLT ((ZHostList_t *) 0)
-#define NULLZNAT ((ZNotAcked_t *) 0)
-#define NULLZACLT ((ZAcl_t *) 0)
-#define NULLZPT ((ZPacket_t *) 0)
-#define NULLZSDT ((ZServerDesc_t *) 0)
-#define NULLZSPT ((ZSrvPending_t *) 0)
-
-/* me_server_idx is the index into otherservers of this server descriptor. */
-/* the 'limbo' server is always the first server */
-
-#define me_server (&otherservers[me_server_idx])
-#define limbo_server_idx() (0)
-#define limbo_server (&otherservers[limbo_server_idx()])
-
-#define msgs_queued() (ZQLength() || otherservers[me_server_idx].zs_update_queue)
-
-#define ack(a,b) clt_ack(a,b,SENT)
-#define nack(a,b) clt_ack(a,b,NOT_SENT)
-
-#define max(a,b) ((a) > (b) ? (a) : (b))
-
-#define START_CRITICAL_CODE
-#define END_CRITICAL_CODE
-
-/* the instance that matches all instances */
-#define WILDCARD_INSTANCE "*"
-
-/* SERVER_SRVTAB is defined in zephyr.h */
-#define ZEPHYR_SRVTAB SERVER_SRVTAB
-
-#ifdef KERBEROS
-#ifndef NOENCRYPTION
-/* Kerberos shouldn't stick us with array types... */
-typedef struct {
- des_key_schedule s;
-} Sched;
-#endif
-#endif
-
-/* debugging macros */
-#ifdef DEBUG
-#define zdbug(s1) if (zdebug) syslog s1;
-#else /* !DEBUG */
-#define zdbug(s1)
-#endif /* DEBUG */
-
-#endif /* !__ZSERVER_H__ */
diff --git a/server/zserver.h.old b/server/zserver.h.old
deleted file mode 100644
index 7b51ac1..0000000
--- a/server/zserver.h.old
+++ /dev/null
@@ -1,424 +0,0 @@
-#ifndef __ZSERVER_H__
-#define __ZSERVER_H__
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains declarations for use in the server.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- * $Zephyr: /mit/zephyr/src/server/RCS/zserver.h,v 1.34 91/03/08 12:53:24 raeburn Exp $
- *
- * Copyright (c) 1987,1988,1991 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#include <zephyr/mit-copyright.h>
-
-#include <zephyr/zephyr.h> /* which includes <errno.h>,
- <sys/types.h>,
- <netinet/in.h>,
- <sys/time.h>,
- <stdio.h>,
- <krb.h> */
-#include <arpa/inet.h>
-#include <zephyr/acl.h>
-#include <sys/file.h>
-#include <fcntl.h>
-
-#include <zephyr/zsyslog.h>
-
-#include <strings.h>
-#include <signal.h>
-#ifdef lint
-#include <sys/uio.h> /* so it shuts up about struct iovec */
-#endif /* lint */
-#ifdef _IBMR2
-#include <sys/select.h>
-#endif
-#include "zsrv_err.h"
-
-#include "timer.h"
-#include "zsrv_conf.h" /* configuration params */
-
-#include "zstring.h"
-#include "access.h"
-#include "unix.h"
-#include "zalloc.h"
-
-/* definitions for the Zephyr server */
-
-/* structures */
-
-/*
- * ZDestination: Where is this notice going to? This includes class,
- * instance, and recipient at the moment.
- */
-
-typedef struct _ZDestination {
- unsigned long hash_value;
- ZSTRING *classname;
- ZSTRING *inst;
- ZSTRING *recip;
-} ZDestination;
-
-/* typedef struct _Notice {
- ZNotice_t *notice;
- struct _ZDestination dest;
- ZSTRING *sender;
- int msg_no;
-} Notice;
-*/
-typedef struct _ZSubscr_t {
- struct _ZSubscr_t *q_forw; /* links in client's subscr. queue */
- struct _ZSubscr_t *q_back;
- struct _ZDestination zst_dest; /* destination of messages */
-} ZSubscr_t;
-
-typedef struct _ZClient_t {
- struct sockaddr_in zct_sin; /* ipaddr/port of client */
- struct _ZSubscr_t *zct_subs; /* subscriptions */
-#ifdef KERBEROS
- C_Block zct_cblock; /* session key for this client */
-#endif /* KERBEROS */
- ZSTRING *zct_principal; /* krb principal of user */
- long last_msg; /* last message sent to this client */
- long last_check; /* actually, last time the other
- server was asked to check... */
-} ZClient_t;
-
-typedef struct _ZClientList_t {
- struct _ZClientList_t *q_forw;
- struct _ZClientList_t *q_back;
- struct _ZClient_t *zclt_client;
-} ZClientList_t;
-
-typedef struct _ZClass_t {
- struct _ZClass_t *q_forw;
- struct _ZClass_t *q_back;
- ZDestination zct_dest;
- ZAcl_t *zct_acl;
- ZClientList_t *zct_clientlist;
-} ZClass_t;
-
-typedef struct _ZHostList_t {
- struct _ZHostList_t *q_forw;
- struct _ZHostList_t *q_back;
- ZClientList_t *zh_clients;
- struct sockaddr_in zh_addr; /* IP addr/port of hostmanager */
- unsigned int zh_locked; /* 1 if this host is locked for
- a braindump */
-} ZHostList_t;
-
-typedef enum _server_state {
- SERV_UP, /* Server is up */
- SERV_TARDY, /* Server due for a hello */
- SERV_DEAD, /* Server is considered dead */
- SERV_STARTING /* Server is between dead and up */
-} server_state;
-
-typedef struct _ZNotAcked_t {
- struct _ZNotAcked_t *q_forw; /* link to next */
- struct _ZNotAcked_t *q_back; /* link to prev */
- timer na_timer; /* timer for retransmit */
- long na_abstimo; /* absolute timeout to drop after */
- short na_rexmits; /* number of retransmits */
- short na_packsz; /* size of packet */
- caddr_t na_packet; /* ptr to packet */
- ZUnique_Id_t na_uid; /* uid of packet */
- union { /* address to send to */
- struct sockaddr_in na_sin; /* client address */
- int srv_idx; /* index of server */
- } dest;
-#define na_addr dest.na_sin
-#define na_srv_idx dest.srv_idx
-} ZNotAcked_t;
-
-typedef struct _ZSrvPending_t {
- struct _ZSrvPending_t *q_forw; /* link to next */
- struct _ZSrvPending_t *q_back; /* link to prev */
- caddr_t pend_packet; /* the notice (in pkt form) */
- short pend_len; /* len of pkt */
- unsigned int pend_auth; /* whether it is authentic */
- struct sockaddr_in pend_who; /* the addr of the sender */
-} ZSrvPending_t;
-
-typedef struct _ZServerDesc_t {
- server_state zs_state; /* server's state */
- struct sockaddr_in zs_addr; /* server's address */
- long zs_timeout; /* Length of timeout in sec */
- timer zs_timer; /* timer struct for this server */
- struct _ZHostList_t *zs_hosts; /* pointer to list of info from this
- server */
- struct _ZSrvPending_t *zs_update_queue; /* queue of packets to send
- to this server when done dumping */
- short zs_numsent; /* number of hello's sent */
- unsigned int zs_dumping; /* 1 if dumping, so we should queue */
- char addr[16]; /* text version of address */
-} ZServerDesc_t;
-
-typedef enum ZSentType {
- NOT_SENT, /* message was not xmitted */
- SENT, /* message was xmitted */
- AUTH_FAILED, /* authentication failed */
- NOT_FOUND /* user not found for uloc */
-} ZSentType;
-
-/* statistics gathering */
-typedef struct _ZStatistic_t {
- int val;
- char *str;
-} ZStatistic;
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-/* Function declarations */
-
-/* found in bdump.c */
-extern void bdump_get P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
- ZServerDesc_t *server));
-extern void bdump_send P((void));
-extern void bdump_offer P((struct sockaddr_in *who));
-extern Code_t bdump_send_list_tcp P((ZNotice_Kind_t kind, int port,
- char *class_name, char *inst, char *opcode,
- char *sender, char *recip,
- char **lyst, int num));
-
-/* found in class.c */
-extern Code_t class_register P((ZClient_t *client, ZSubscr_t *subs));
-extern Code_t class_deregister P((ZClient_t *client, ZSubscr_t *subs));
-extern Code_t class_restrict P((char *z_class, ZAcl_t *acl));
-extern Code_t class_setup_restricted P((char *z_class, ZAcl_t *acl));
-extern ZClientList_t *class_lookup P((ZSubscr_t *subs));
-extern ZAcl_t *class_get_acl P((ZSTRING *z_class));
-extern void class_free P((ZClientList_t *lyst));
-extern ZSTRING *class_control, *class_admin, *class_hm;
-extern ZSTRING *class_ulogin, *class_ulocate;
-extern void set_ZDestination_hash P((ZDestination *zd));
-extern int ZDest_eq P((ZDestination *zd1, ZDestination *zd2));
-extern int order_dest_strings P((ZDestination *zd1, ZDestination *zd2));
-
-/* found in client.c */
-extern Code_t client_register P((ZNotice_t *notice, struct sockaddr_in *who,
- register ZClient_t **client,
- ZServerDesc_t *server, int wantdefaults));
-extern void client_deregister P((ZClient_t *client, ZHostList_t *host,
- int flush));
-extern void client_dump_clients P((FILE *fp, ZClientList_t *clist));
-extern ZClient_t *client_which_client P((struct sockaddr_in *who,
- ZNotice_t *notice));
-
-/* found in common.c */
-extern char *strsave P((Zconst char *str));
-extern unsigned long hash P((Zconst char *));
-
-/* found in dispatch.c */
-extern void handle_packet P((void));
-extern void clt_ack P((ZNotice_t *notice, struct sockaddr_in *who,
- ZSentType sent));
-extern void nack_release P((ZClient_t *client));
-extern void sendit P((register ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern void rexmit P((void *));
-extern void xmit P((register ZNotice_t *notice, struct sockaddr_in *dest,
- int auth, ZClient_t *client));
-extern Code_t control_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- ZServerDesc_t *server));
-extern Code_t xmit_frag P((ZNotice_t *notice, char *buf, int len,
- int waitforack));
-
-/* found in hostm.c */
-extern void hostm_flush P((ZHostList_t *host, ZServerDesc_t *server));
-extern void hostm_shutdown P((void));
-extern void hostm_losing P((ZClient_t *client, ZHostList_t *host));
-extern ZHostList_t *hostm_find_host P((struct in_addr *addr));
-extern ZServerDesc_t *hostm_find_server P((struct in_addr *addr));
-extern void hostm_transfer P((ZHostList_t *host, ZServerDesc_t *server));
-extern void hostm_deathgram P((struct sockaddr_in *sin,
- ZServerDesc_t *server));
-extern void hostm_dump_hosts P((FILE *fp));
-extern Code_t hostm_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, ZServerDesc_t *server));
-extern void hostm_lose_ignore P((ZClient_t *client));
-extern void hostm_renumber_servers P((int *));
-
-/* found in kstuff.c */
-#ifdef KERBEROS
-extern int GetKerberosData P((int, struct in_addr, AUTH_DAT*, char*, char*));
-extern Code_t SendKerberosData P((int, KTEXT, char*, char*));
-#endif
-
-/* found in server.c */
-extern void server_timo P((void *which));
-extern void server_recover P((ZClient_t *client)),
- server_dump_servers P((FILE *fp));
-extern void server_init P((void)),
- server_shutdown P((void));
-extern void server_forward P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern void server_kill_clt P((ZClient_t *client));
-extern void server_pending_free P((register ZSrvPending_t *pending));
-extern void server_self_queue P((ZNotice_t*, int, struct sockaddr_in *)),
- server_send_queue P((ZServerDesc_t *)),
- server_reset P((void));
-extern int is_server();
-extern ZServerDesc_t *server_which_server P((struct sockaddr_in *who));
-extern ZSrvPending_t *server_dequeue P((register ZServerDesc_t *server));
-extern Code_t server_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who));
-extern Code_t server_adispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who,
- ZServerDesc_t *server));
-
-
-/* found in subscr.c */
-extern Code_t subscr_cancel P((struct sockaddr_in *sin, ZNotice_t *notice));
-extern Code_t subscr_subscribe P((ZClient_t *who, ZNotice_t *notice)),
- subscr_send_subs P((ZClient_t *client, char *vers));;
-extern ZClientList_t *subscr_match_list P((ZNotice_t *notice));
-extern void subscr_free_list P((ZClientList_t *list)),
- subscr_cancel_client P((register ZClient_t *client)),
- subscr_sendlist P((ZNotice_t *notice, int auth, struct sockaddr_in *who));
-extern void subscr_dump_subs P((FILE *fp, ZSubscr_t *subs)),
- subscr_reset P((void));
-extern int compare_subs P((ZSubscr_t *s1, ZSubscr_t *s2, int do_wildcard));
-extern Code_t subscr_def_subs P((ZClient_t *who));
-
-/* found in uloc.c */
-extern void uloc_hflush P((struct in_addr *addr)),
- uloc_flush_client P((struct sockaddr_in *sin)),
- uloc_dump_locs P((register FILE *fp));
-extern Code_t ulogin_dispatch P((ZNotice_t *notice, int auth,
- struct sockaddr_in *who, ZServerDesc_t *server)),
- ulocate_dispatch P((ZNotice_t *notice, int auth, struct sockaddr_in *who,
- ZServerDesc_t *server)),
- uloc_send_locations P((ZHostList_t *host, char *vers));
-
-/* found in version.c */
-extern char *get_version P((void));
-
-#undef P
-
-
-/* global identifiers */
-
-/* found in main.c */
-extern struct sockaddr_in sock_sin; /* socket descriptors */
-extern u_short hm_port; /* port # of hostmanagers */
-extern int srv_socket; /* dgram sockets for clients
- and other servers */
-extern int bdump_socket; /* brain dump socket
- (closed most of the time) */
-
-extern fd_set interesting; /* the file descrips we are listening
- to right now */
-extern int nfildes; /* number to look at in select() */
-extern int zdebug;
-extern char myname[]; /* domain name of this host */
-extern ZNotAcked_t *nacklist; /* list of not ack'ed packets */
-extern Zconst char version[];
-extern u_long npackets; /* num of packets processed */
-extern long uptime; /* time we started */
-extern struct in_addr my_addr;
-
-/* found in bdump.c */
-extern int bdumping; /* are we dumping right now? */
-
-/* found in dispatch.c */
-extern ZStatistic i_s_ctls, i_s_logins, i_s_admins, i_s_locates;
-extern int num_rexmits;
-extern long rexmit_secs, abs_timo;
-
-/* found in server.c */
-extern ZServerDesc_t *otherservers; /* array of servers */
-extern int me_server_idx; /* me (in the array of servers) */
-extern int nservers; /* number of other servers*/
-
-/* found in subscr.c */
-extern ZSTRING *empty;
-extern ZSTRING *wildcard_instance;
-extern ZSTRING *wildcard_class;
-extern ZSubscr_t matchall_sub;
-
-extern struct in_addr my_addr; /* my inet address */
-
-#define class_is_control(classname) (classname == class_control)
-#define class_is_admin(classname) (classname == class_admin)
-#define class_is_hm(classname) (classname == class_hm)
-#define class_is_ulogin(classname) (classname == class_ulogin)
-#define class_is_ulocate(classname) (classname == class_ulocate)
-
-#define ADMIN_HELLO "HELLO" /* Opcode: hello, are you there */
-#define ADMIN_IMHERE "IHEARDYOU" /* Opcode: yes, I am here */
-#define ADMIN_SHUTDOWN "GOODBYE" /* Opcode: I am shutting down */
-#define ADMIN_BDUMP "DUMP_AVAIL" /* Opcode: I will give you a dump */
-#define ADMIN_DONE "DUMP_DONE" /* Opcode: brain dump for this server
- is complete */
-#define ADMIN_NEWCLT "NEXT_CLIENT" /* Opcode: this is a new client */
-#define ADMIN_LOST_CLT "LOST_CLIENT" /* Opcode: client not ack'ing */
-#define ADMIN_KILL_CLT "KILL_CLIENT" /* Opcode: client is dead, remove */
-#define ADMIN_STATUS "STATUS" /* Opcode: please send status */
-
-#define ADMIN_LIMBO "LIMBO" /* Class inst: please send limbo info*/
-#define ADMIN_YOU "YOUR_STATE" /* Class inst: please send your state*/
-#define ADMIN_ME "MY_STATE" /* Class inst: please send my info */
-
-#define NULLZCT ((ZClass_t *) 0)
-#define NULLZCNT ((ZClient_t *) 0)
-#define NULLZCLT ((ZClientList_t *) 0)
-#define NULLZST ((ZSubscr_t *) 0)
-#define NULLZHLT ((ZHostList_t *) 0)
-#define NULLZNAT ((ZNotAcked_t *) 0)
-#define NULLZACLT ((ZAcl_t *) 0)
-#define NULLZPT ((ZPacket_t *) 0)
-#define NULLZSDT ((ZServerDesc_t *) 0)
-#define NULLZSPT ((ZSrvPending_t *) 0)
-
-/* me_server_idx is the index into otherservers of this server descriptor. */
-/* the 'limbo' server is always the first server */
-
-#define me_server (&otherservers[me_server_idx])
-#define limbo_server_idx() (0)
-#define limbo_server (&otherservers[limbo_server_idx()])
-
-#define msgs_queued() (ZQLength() || otherservers[me_server_idx].zs_update_queue)
-
-#define ack(a,b) clt_ack(a,b,SENT)
-#define nack(a,b) clt_ack(a,b,NOT_SENT)
-
-#define max(a,b) ((a) > (b) ? (a) : (b))
-
-#define START_CRITICAL_CODE
-#define END_CRITICAL_CODE
-
-/* the magic class to match all packets */
-#define MATCHALL_CLASS "zmatch_all"
-/* the instance that matches all instances */
-#define WILDCARD_INSTANCE "*"
-
-/* SERVER_SRVTAB is defined in zephyr.h */
-#define ZEPHYR_SRVTAB SERVER_SRVTAB
-
-#ifdef KERBEROS
-#ifndef NOENCRYPTION
-/* Kerberos shouldn't stick us with array types... */
-typedef struct {
- des_key_schedule s;
-} Sched;
-#endif
-#endif
-
-/* debugging macros */
-#ifdef DEBUG
-#define zdbug(s1) if (zdebug) syslog s1;
-#else /* !DEBUG */
-#define zdbug(s1)
-#endif /* DEBUG */
-
-#endif /* !__ZSERVER_H__ */
diff --git a/server/zsrv_conf.h b/server/zsrv_conf.h
index cb81883..2440d1d 100644
--- a/server/zsrv_conf.h
+++ b/server/zsrv_conf.h
@@ -16,32 +16,22 @@
#define __ZSRV_CONF_H__
#include <zephyr/mit-copyright.h>
-/* Magic path names */
-#ifndef HESIOD
-#define SERVER_LIST_FILE "/etc/athena/zephyr/server.list"
-#endif
+/* Path names are relative to CONFDIR, except for the class registry. */
-/* ACL's for pre-registered classes */
-/* Directory containing acls and other info */
-#ifndef ZEPHYR_ACL_DIR
-#define ZEPHYR_ACL_DIR "/etc/athena/zephyr/acl/"
+#ifndef ZEPHYR_USES_HESIOD
+#define SERVER_LIST_FILE "server.list"
+#endif
+#define REALM_LIST_FILE "realm.list"
+#ifdef ZEPHYR_USES_KERBEROS
+#define ZEPHYR_SRVTAB "srvtab"
+#define ZEPHYR_TKFILE "ztkts"
#endif
-/* name of the class registry */
+#define ZEPHYR_ACL_DIR "acl/"
#define ZEPHYR_CLASS_REGISTRY "class-registry.acl"
+#define DEFAULT_SUBS_FILE "default.subscriptions"
-#ifdef KERBEROS
-/* name of file to hold the tickets for keys to exchange with other servers */
-#define ZEPHYR_TKFILE "/etc/athena/zephyr/ztkts"
-
-/* The pathname of the Kerberos srvtab file is defined in zephyr_conf.h. */
-#endif /* KERBEROS */
-
-/* default subscription file */
-#define DEFAULT_SUBS_FILE "/etc/athena/zephyr/default.subscriptions"
-
-/* client defines */
-#define REXMIT_SECS ((long) 20) /* rexmit delay on normal notices */
-#define NUM_REXMITS (9) /* number of rexmits */
+#define REXMIT_TIMES { 2, 2, 4, 4, 8, 8, 16, 32, 64, 128, 256, 512, -1 }
+#define NUM_REXMIT_TIMES 12
/* hostmanager defines */
#define LOSE_TIMO (60) /* time during which a losing host
@@ -56,4 +46,8 @@
when tardy */
#define H_NUM_STARTING 2 /* num hello's before going dead
when starting */
+
+#define SWEEP_INTERVAL 3600 /* Time between sweeps of the ticket
+ hash table */
+
#endif /* __ZSRV_CONF_H__ */
diff --git a/server/zsrv_conf.h.auth b/server/zsrv_conf.h.auth
deleted file mode 100644
index 6057130..0000000
--- a/server/zsrv_conf.h.auth
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This file is part of the Project Athena Zephyr Notification System.
- * It contains site-specific definitions for use in the server.
- *
- * Created by: John T. Kohl
- *
- * $Source$
- * $Author$
- * $Header$
- *
- * Copyright (c) 1988 by the Massachusetts Institute of Technology.
- * For copying and distribution information, see the file
- * "mit-copyright.h".
- */
-
-#ifndef __ZSRV_CONF_H__
-#define __ZSRV_CONF_H__
-#include <zephyr/mit-copyright.h>
-
-/* Magic path names */
-#ifndef HESIOD
-#define SERVER_LIST_FILE "/etc/athena/zephyr/server.list"
-#endif
-
-/* ACL's for pre-registered classes */
-/* Directory containing acls and other info */
-#ifndef ZEPHYR_ACL_DIR
-#define ZEPHYR_ACL_DIR "/etc/athena/zephyr/acl/"
-#endif
-/* name of the class registry */
-#define ZEPHYR_CLASS_REGISTRY "class-registry.acl"
-
-#ifdef KERBEROS
-/* name of file to hold the tickets for keys to exchange with other servers */
-#define ZEPHYR_TKFILE "/etc/athena/zephyr/ztkts"
-
-/* The pathname of the Kerberos srvtab file is defined in zephyr_conf.h. */
-#endif /* KERBEROS */
-
-/* default subscription file */
-#define DEFAULT_SUBS_FILE "/etc/athena/zephyr/default.subscriptions"
-
-/* client defines */
-#define REXMIT_SECS ((long) 20) /* rexmit delay on normal notices */
-#define NUM_REXMITS (9) /* number of rexmits */
-
-/* hostmanager defines */
-#define LOSE_TIMO (60) /* time during which a losing host
- must respond to a ping */
-
-/* server-server defines */
-#define TIMO_UP ((long) 60) /* timeout between up and tardy */
-#define TIMO_TARDY ((long) 120) /* timeout btw tardy hellos */
-#define TIMO_DEAD ((long)(15*60)) /* timeout between hello's for dead */
-
-#define H_NUM_TARDY 5 /* num hello's before going dead
- when tardy */
-#define H_NUM_STARTING 2 /* num hello's before going dead
- when starting */
-
-#define SWEEP_INTERVAL 3600 /* Time between sweeps of the ticket
- hash table */
-
-#endif /* __ZSRV_CONF_H__ */
diff --git a/server/zsrv_err.et b/server/zsrv_err.et
index 26bbc0d..d3b9eab 100644
--- a/server/zsrv_err.et
+++ b/server/zsrv_err.et
@@ -38,4 +38,8 @@ ec ZSRV_RCSID,
"$Id$"
ec ZSRV_BADSUBPORT,
"Illegal port specified in subscription"
+ec ZSRV_NORLM,
+ "No such realm"
+ec ZSRV_EMPTYCLASS,
+ "Class is now empty"
end
diff --git a/server/zstring.c b/server/zstring.c
index 6b5aed3..955e0b8 100644
--- a/server/zstring.c
+++ b/server/zstring.c
@@ -12,177 +12,156 @@
*/
#include <zephyr/mit-copyright.h>
+#include "zserver.h"
#ifndef lint
#ifndef SABER
-static char rcsid_zstring_c[] =
- "$Id$";
+static const char rcsid_zstring_c[] =
+"$Id$";
#endif
#endif
-#include <mit-copyright.h>
+static String *zhash[STRING_HASH_TABLE_SIZE];
-#include <ctype.h>
-#if defined(__STDC__) && !defined(__HIGHC__) && !defined(SABER)
-#include <stdlib.h>
-#endif
-#include <string.h>
-
-#include <zephyr/zephyr.h>
-#include "zstring.h"
-
-static ZSTRING *zhash[ZSTRING_HASH_TABLE_SIZE];
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-extern unsigned long hash P((Zconst char *s));
-extern char *strsave P((Zconst char *s));
-#undef P
-
-ZSTRING *
-make_zstring(s, downcase)
- char *s;
- int downcase;
+String *
+make_string(s, downcase)
+ char *s;
+ int downcase;
{
- char *new_s,*p;
- ZSTRING *new_z,*hp;
- int i;
-
- if (downcase) {
- new_s = strsave(s);
- p = new_s;
- while(*p) {
- if (isascii(*p) && isupper(*p))
- *p = tolower(*p);
- p++;
+ char *new_s,*p;
+ String *new_z,*hp;
+ int i;
+
+ if (downcase) {
+ new_s = strsave(s);
+ p = new_s;
+ while(*p) {
+ if (isascii(*p) && isupper(*p))
+ *p = tolower(*p);
+ p++;
+ }
+ } else {
+ new_s = s;
}
- } else {
- new_s = s;
- }
- new_z = find_zstring(new_s,0);
- if (new_z != NULL) {
- if (downcase)
- free(new_s);
- new_z->ref_count++;
- return(new_z);
- }
-
- /* Initialize new ZSTRING */
-
- if (!downcase)
- new_s = strsave(s);
- new_z = (ZSTRING *) malloc(sizeof(ZSTRING));
- new_z->string = new_s;
- new_z->ref_count = 1;
+ new_z = find_string(new_s,0);
+ if (new_z != NULL) {
+ if (downcase)
+ free(new_s);
+ new_z->ref_count++;
+ return(new_z);
+ }
+
+ /* Initialize new String */
+
+ if (!downcase)
+ new_s = strsave(s);
+ new_z = (String *) malloc(sizeof(String));
+ new_z->string = new_s;
+ new_z->ref_count = 1;
- /* Add to beginning of hash table */
- new_z->hash_val = hash(new_s);
- i = new_z->hash_val % ZSTRING_HASH_TABLE_SIZE;
- hp = zhash[i];
- new_z->next = hp;
- if (hp != NULL)
- hp->prev = new_z;
- new_z->prev = NULL;
- zhash[i] = new_z;
-
- return(new_z);
+ /* Add to beginning of hash table */
+ new_z->hash_val = hash(new_s);
+ i = new_z->hash_val % STRING_HASH_TABLE_SIZE;
+ hp = zhash[i];
+ new_z->next = hp;
+ if (hp != NULL)
+ hp->prev = new_z;
+ new_z->prev = NULL;
+ zhash[i] = new_z;
+
+ return new_z;
}
void
-free_zstring(z)
- ZSTRING *z;
+free_string(z)
+ String *z;
{
- if (z == (ZSTRING *) NULL)
- return;
-
- z->ref_count--;
- if (z->ref_count > 0)
- return;
-
- /* delete zstring completely */
- if(z->prev == NULL)
- zhash[hash(z->string) % ZSTRING_HASH_TABLE_SIZE] = z->next;
- else
- z->prev->next = z->next;
+ if (z == (String *) NULL)
+ return;
+
+ z->ref_count--;
+ if (z->ref_count > 0)
+ return;
+
+ /* delete string completely */
+ if(z->prev == NULL)
+ zhash[hash(z->string) % STRING_HASH_TABLE_SIZE] = z->next;
+ else
+ z->prev->next = z->next;
- if (z->next != NULL)
- z->next->prev = z->prev;
+ if (z->next != NULL)
+ z->next->prev = z->prev;
- free(z->string);
- free(z);
- return;
+ free(z->string);
+ free(z);
}
-ZSTRING *
-find_zstring(s,downcase)
- char *s;
- int downcase;
+String *
+find_string(s,downcase)
+ char *s;
+ int downcase;
{
- char *new_s,*p;
- ZSTRING *z;
-
- if (downcase) {
- new_s = strsave(s);
- p = new_s;
- while (*p) {
- if (isascii(*p) && isupper(*p))
- *p = tolower(*p);
- p++;
+ char *new_s,*p;
+ String *z;
+
+ if (downcase) {
+ new_s = strsave(s);
+ p = new_s;
+ while (*p) {
+ if (isascii(*p) && isupper(*p))
+ *p = tolower(*p);
+ p++;
+ }
+ } else {
+ new_s = s;
}
- } else {
- new_s = s;
- }
- z = zhash[hash(new_s) % ZSTRING_HASH_TABLE_SIZE];
- while (z != (ZSTRING *)NULL) {
- if (strcmp(new_s,z->string) == 0)
- break;
- z = z->next;
- }
+ z = zhash[hash(new_s) % STRING_HASH_TABLE_SIZE];
+ while (z != NULL) {
+ if (strcmp(new_s, z->string) == 0)
+ break;
+ z = z->next;
+ }
- if (downcase)
- free(new_s);
+ if (downcase)
+ free(new_s);
- return(z);
+ return z;
}
int
-comp_zstring(a,b)
- ZSTRING *a, *b;
+comp_string(a,b)
+ String *a, *b;
{
- if (a->hash_val > b->hash_val)
- return(1);
- if (a->hash_val < b->hash_val)
- return(-1);
- return(strcmp(a->string,b->string));
+ if (a->hash_val > b->hash_val)
+ return 1;
+ if (a->hash_val < b->hash_val)
+ return -1;
+ return strcmp(a->string,b->string);
}
void
-print_zstring_table(f)
- FILE *f;
+print_string_table(f)
+ FILE *f;
{
- ZSTRING *p;
- int i;
-
- for(i=0;i<ZSTRING_HASH_TABLE_SIZE;i++) {
- p = zhash[i];
- while (p != (ZSTRING *) NULL) {
- fprintf(f,"[%d] %s\n",p->ref_count,p->string);
- p = p->next;
+ String *p;
+ int i;
+
+ for(i = 0; i < STRING_HASH_TABLE_SIZE; i++) {
+ p = zhash[i];
+ while (p != (String *) NULL) {
+ fprintf(f,"[%d] %s\n",p->ref_count,p->string);
+ p = p->next;
+ }
}
- }
- return;
}
-ZSTRING *
-dup_zstring(z)
- ZSTRING *z;
+String *
+dup_string(z)
+ String *z;
{
- z->ref_count++;
- return(z);
+ z->ref_count++;
+ return z;
}
+
diff --git a/server/zstring.h b/server/zstring.h
index 5d3aaa1..eb3a3da 100644
--- a/server/zstring.h
+++ b/server/zstring.h
@@ -12,33 +12,24 @@
#ifndef __zstring_h
#define __zstring_h __FILE__
-#define ZSTRING_HASH_TABLE_SIZE 1024
+#define STRING_HASH_TABLE_SIZE 1024
#include <stdio.h>
-typedef struct _zstring
+typedef struct _String
{
- char *string; /* the string itself */
- int ref_count; /* for gc */
- unsigned long hash_val; /* hash value for this string */
- struct _zstring *next; /* for linking in hash table */
- struct _zstring *prev; /* for linking in hash table */
-} ZSTRING;
-
-#ifdef __STDC__
-# define P(s) s
-#else
-# define P(s) ()
-#endif
-
-ZSTRING *make_zstring P((char *s, int downcase));
-void free_zstring P((ZSTRING *z));
-ZSTRING *find_zstring P((char *s, int downcase));
-ZSTRING *dup_zstring P((ZSTRING *z));
-int comp_zstring P((ZSTRING *a, ZSTRING *b));
-void print_zstring_table P((FILE *f));
-
-#undef P
-
+ char *string; /* the string itself */
+ int ref_count; /* for gc */
+ unsigned long hash_val; /* hash value for this string */
+ struct _String *next, *prev; /* for linking in hash table */
+} String;
+
+String *make_string __P((char *s, int downcase));
+void free_string __P((String *z));
+String *find_string __P((char *s, int downcase));
+String *dup_string __P((String *z));
+int comp_string __P((String *a, String *b));
+void print_string_table __P((FILE *f));
#endif /* __zstring_h */
+
diff --git a/tools/makeconfig b/tools/makeconfig
deleted file mode 100644
index 8575851..0000000
--- a/tools/makeconfig
+++ /dev/null
@@ -1,63 +0,0 @@
-# $Source$
-# $Author$
-# $Header$
-#
-# Makefile for creating a Zephyr configuration
-#
-# This Makefile creates the directories needed to hold Zephyr
-# object files and executables. It also installs the Imakefiles.
-# This also copies in the Imake and make depend program and Imake macros.
-# By default, the Imakefiles are copied into the configuration
-# and made writeable. If a link is preferred, change LN to "ln".
-#
-# The default distination for the configuration is the current
-# directory; defaults for destination and source directories may be
-# specified, e.g.:
-#
-# make -f makeconfig SRCDIR=/u2/lockers/zephyr DESTDIR=myconfig
-
-DESTDIR = .
-SRCDIR = /afs/athena.mit.edu/astaff/project/zephyr/src
-
-LN = ln -s
-CP = cp
-SUBDIR = et et/lib et/compile_et ss ss/lib ss/make_commands clients \
- clients/syslogd clients/zaway \
- clients/zbitmap clients/zctl clients/zleave \
- clients/zlocate clients/zmailnotify clients/znol clients/zpopnotify \
- clients/zshutdown_notify clients/zstat clients/zwrite \
- include include/zephyr lib man man/man1 man/man8 server zhm zwgc \
- zwgc/String zwgc/Memory zwgc/Dictionary ozwgc ozwgc/zbrowser \
- libdyn clients/xzwrite
-
-
-# Empty directories which also need to be built.
-
-MTDIR = et/lib/profiled ss/lib/profiled lib/profiled libdyn/profiled libs
-
-# Directories which need only be linked into the sources
-
-LINKDIR = server/acldir
-
-all:
- rm -f ${DESTDIR}/Makefile ${DESTDIR}/Imakefile
- ${CP} ${SRCDIR}/Makefile ${DESTDIR}
- ${LN} ${SRCDIR}/Imakefile ${DESTDIR}
- chmod +w ${DESTDIR}/Makefile
- -for i in ${SUBDIR}; do \
- mkdir ${DESTDIR}/$$i; \
- rm -f ${DESTDIR}/$$i/Imakefile; \
- ${LN} ${SRCDIR}/$$i/Imakefile ${DESTDIR}/$$i; \
- done
- -for i in ${MTDIR}; do mkdir ${DESTDIR}/$$i; done
- -for i in ${LINKDIR}; do ${LN} ${SRCDIR}/$$i ${DESTDIR}/$$i; done
- for i in imake makedepend config; do \
- rm -rf ${DESTDIR}/$$i; \
- cp -r ${SRCDIR}/$$i ${DESTDIR}; \
- rm -rf ${DESTDIR}/$$i/RCS; \
- done
-#special hack for libss
- rm -f ${DESTDIR}/ss/ss
- ln -s lib ${DESTDIR}/ss/ss
-
-
diff --git a/tools/makepaths b/tools/makepaths
deleted file mode 100755
index 1665e5d..0000000
--- a/tools/makepaths
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-# $Id$
-#
-# makepaths script -- generate zephyr_paths.h file on stdout
-echo "/* This file is automatically generated. Do not edit it. */"
-echo '#define Z_ETCATHDIR ' \"$ETCATHDIR\"
-echo '#define Z_CLIENTDIR ' \"$CLIENTDIR\"
-echo '#define Z_LIBDIR ' \"$LIBDIR\"
-if [ x"$HaveKerberos" != x ]; then
- echo '#define Z_HaveKerberos'
-fi
-if [ x"$HaveHesiod" != x ]; then
- echo '#define Z_HaveHesiod'
-fi
-exit 0
diff --git a/tools/zlook b/tools/zlook
deleted file mode 100755
index 43b18b7..0000000
--- a/tools/zlook
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/bin/sh
-#
-# ZLOOK: AUTHOR: "Jr" Spidell DATE: April 25, 1992
-#
-# this script will only run properly by root
-# on a zephyr server node
-# output: accounts logged into zephyr
-# nodes running a host manager
-
-TEMPFILE=/usr/tmp/zephyr.$$
-TEMPFILE2=/usr/tmp/zephyr2.$$
-DBFILE=/usr/tmp/zephyr.db # where zephyrd dumps its data after a kill -FPE
-
-# the next "magic numbers" for the servers come from looking at server.list
-# the '1' or '3' corresponds to the position of the server name in the file
-# 'server.list'
-# NOTE: these numbers will need to be changed if the server.list file gets
-# changed. (server.list resides in the directory /usr/athena/lib/zephyr)
-CAP_SERVER="3:"
-FRED_SERVER="1:"
-
-# test for root
-if test "`whoami`" != root
- then
- echo "you must be root to run this script"
- exit
-fi
-
-# test for no options
-if test $# -eq 0
-then USAGE="yes"
- echo "no options given."
- echo ""
-fi
-
-# test for server node
-if test -z "`ps aux | grep zephyrd | grep -v grep | awk '{print $2}'`"
- then echo "you must be on a zephyr server (ie cap, fred)"
- exit
-fi
-
-# root doesn't have this in its path
-path=$PATH
-PATH=$path":/usr/local/bin:/bin:"
-
-for argument in $*
-do
- case $argument in
- -N)# extract the running host managers
- ZHM=yes
- ;;
-
- -s)# extract the suns (nodes that use fred as their server )
- FRED=yes
- ;;
-
- -d)# extract the decs (nodes that use cap as their server )
- CAP=yes
- ;;
-
- -A)# extract logged in users
- EXTRACT_USERS=yes
- ;;
-
- -O)# list options
- USAGE=yes
- ;;
-
- -e)# list exposure values
- EXPO=yes
- ;;
-
- -g)# list group name
- GRP=yes
- ;;
-
- -t)# list time user logged in to zephyr
- TME=yes
- ;;
-
- -n)# list user's node
- NOD=yes
- ;;
-
- -ni)# list user's "world name" or "nickname" ie joe B. Blow
- NIK=yes
- ;;
-
- -G*)# list users by given group name
- # note -g option does not display along with -G option
- # (sort of redundant don't ya think?)
-
- if test "$argument" = "-G"
- then echo "you must specify a group for -G option"
- zlook -o
- exit
- fi
- /accts/caspidell/shelldir/zlook -A -g`echo " $* " | sed "s/-G/ /g"` | grep `echo $argument
- | sed "s/-G//"` | sed "s/`echo $argument| sed "s/-G//g"`//"
- # | awk '{print $1}'
- exit;;
-
- -s)# subscription information
- # nothing here, yet...
- ;;
-
- -?)# unknown option
- USAGE="yes"
- echo "unknown option $argument"
- echo ""
- ;;
-
- esac # end of options
-done # end of arguments
-
-
-#############
-# -O option #
-#############
-if test "$USAGE" = "yes"
-then
- echo "zlook [-N] [-d] [-s] [-G<groupname>] [-A] [-t] [-ni] [-n] [-e] [-o]"
- echo ""
- echo " -N nodes currently running a zephyr host manager."
- echo " -d only decs currently running zhm"
- echo " -s only suns currently running zhm"
- echo " -G<group> users by group name."
- echo " -A all users currently logged into zephyr."
- echo " -g give user's group association"
- echo " -t give time user logged into zephyr."
- echo " -n give user's node."
- echo " -e give user's exposure level."
- echo " -ni give user's full name (ie Joe B. Blow)."
- echo " -O option descriptions. (this screen)"
- echo ""
- echo " options -t, -n, -e, -ni must be accompanied by -A or -G<group>"
- echo " options -d and -s must be accompanied by -N"
- echo ""
-fi
-
-#############
-# -N option #
-#############
-if test "$ZHM" = "yes"
- then
-
- # this is for all nodes
- SERVER=":"
-
- # extract only nodes that use cap as their server
- if test "$CAP" = "yes"
- then
- SERVER=$CAP_SERVER
- fi
-
- # extract only nodes that use fred as their server
- if test "$FRED" = "yes"
- then
- SERVER=$FRED_SERVER
- fi
-
- # dump the database
- kill -FPE `ps aux | grep zephyrd | grep -v grep | awk '{print $2}'`
-
- # cross-reference the internet adresses with node names
- for address in `cat /usr/tmp/zephyr.db | grep 131.198 | grep $SERVER | grep -v rockwell |
-grep -v SERV | sed "s/\/[0-9]://"`
- do
- ypcat hosts | grep "$address " | awk '{ print $2 }' | sed "s/.cca.cr.rockwell.com//" >> $T
-EMPFILE
- done
- cat $TEMPFILE | sort
- rm $TEMPFILE
-fi
-
-
-
-#############
-# -A option #
-#############
-
-if test "$EXTRACT_USERS" = "yes"
- then
-# dump the database
- kill -FPE `ps aux | grep zephyrd | grep -v grep | awk '{print $2}'`
-
- for instance in `cat /usr/tmp/zephyr.db | grep @cca.cr.rockwell.com/ | sed "s/ /~/g"`
- do
-#------------------
-# display user name
-#------------------
- PEOPLE=`echo $instance | awk '{FS="@"}{print $1}'`
- echo $instance | awk '{FS="@"}{printf("%-10s", $1)}' >> $TEMPFILE
-
-#---------------------------------
-# display group association
-#---------------------------------
- if test "$GRP" = "yes"
- then
- GROUP=`ypcat passwd | grep $PEOPLE: | awk '{FS=":"}{print $4}'`
- ypcat group | grep ":$GROUP:" | awk '{FS=":"}{printf("%-9s", $1)}' >> $TEMPFILE
- fi
-
-#--------------------
-# display node
-#--------------------
- if test "$NOD" = "yes"
- then
- echo $instance | sed "s/.cca.cr.rockwell.com//g" | awk '{FS="/"}{printf("%-8s ",$2)}' >
-> $TEMPFILE
- fi
-
-#-----------------------
-# display exposure level
-#-----------------------
- if test "$EXPO" = "yes"
- then
- echo $instance | awk '{FS="/"}{printf("%s ", $5)}' >> $TEMPFILE
- fi
-
-#-------------
-# display time
-#-------------
- if test "$TME" = "yes"
- then
- echo $instance | sed "s/~/ /g" | sed "s/:[0-9][0-9] [0-9][0-9][0-9][0-9]//" | awk '{FS=
-"/"}{printf("%-10s ",$3)}' >> $TEMPFILE
- fi
-
-#-----------------
-# display nickname
-#-----------------
- if test "$NIK" = "yes"
- then
- ypcat passwd | grep $PEOPLE: | awk '{FS=":"}{printf("%s ", $5)}' >> $TEMPFILE
- fi
- echo "" >>$TEMPFILE
- done
- cat $TEMPFILE | sort
- rm $TEMPFILE
-fi
diff --git a/tools/zsubscriptions b/tools/zsubscriptions
deleted file mode 100755
index b9a9e79..0000000
--- a/tools/zsubscriptions
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-#
-# author: "Jr" Spidell
-# date : 4/25/92
-#
-USAGE="zsubscriptions <user>"
-DBFILE=/usr/tmp/zephyr.db # where zephyrd dumps its data after a kill -FPE
-
-# test for root
-if test "`whoami`" != root
- then
- echo "you must be root to run this script"
- exit
-fi
-
-# test for no options
-if test $# -eq 0
-then USAGE="yes"
- echo "no options given."
- echo $USAGE
- echo ""
- exit
-fi
-
-# test for server node
-if test -z "`ps aux | grep zephyrd | grep -v grep | awk '{print $2}'`"
- then echo "you must be on a zephyr server (ie cap, fred)"
- exit
-fi
-
-# root doesn't have this in its path
-path=$PATH
-PATH=$path":/usr/local/bin:/bin:/usr/athena:"
-
-# dump the database
-kill -FPE `ps aux | grep zephyrd | grep -v grep | awk '{print $2}'`
-
-user=$1
-
-nawk ' BEGIN {user=""}
- {if ((NF > 1) && (NF < 4))
- {
- if (NF == 2)
- {
- user=$2
- next
- }
- print user,$0
- }
- }' /net/cap/usr/tmp/zephyr.db | \
-sed s/.cca.cr.rockwell.com//g | sed s/"("//g | sed s/")"//g |\
-sed s/"'"//g | sed s/":"//g > /tmp/users
-
-echo ""
-echo "$user is subscribed to recieve the following message types:"
-echo ""
-
-nawk ' {if ($1 == uname)
- {printf ("%-20s%-20s%-20s\n",$2,$3,$4)}}' uname=$user /tmp/users
-
-echo ""
diff --git a/util/autoconf/.rconf b/util/autoconf/.rconf
deleted file mode 100644
index 1753f83..0000000
--- a/util/autoconf/.rconf
+++ /dev/null
@@ -1 +0,0 @@
-copy configure
diff --git a/util/autoconf/COPYING b/util/autoconf/COPYING
deleted file mode 100644
index a43ea21..0000000
--- a/util/autoconf/COPYING
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/util/autoconf/ChangeLog b/util/autoconf/ChangeLog
deleted file mode 100644
index 9885bdc..0000000
--- a/util/autoconf/ChangeLog
+++ /dev/null
@@ -1,1196 +0,0 @@
-Mon Dec 19 19:20:58 1994 Theodore Y. Ts'o (tytso at tsx-11)
-
- * acgeneral.m4 (AC_DEFINE_UNQUOTED): Workaround more Ultrix sh
- brain damage.
-
- * acgeneral.m4 (AC_CACHE_SAVE): Work around yet another really
- horrible Ultrix sh bug. The values of variables read in
- using the ${var='bar'} construction are displayed using
- the "set" command with the high bit set. (Someone should
- just haul off the Ultrix sh and have it shot). Fixed
- using tr.
-
-Fri Nov 4 09:08:33 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * Version 2.1.
-
- * autoreconf.sh: Add -f --force option.
- From "Theodore Ts'o" <tytso@MIT.EDU>.
-
-Thu Nov 3 10:24:08 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * acgeneral.m4 (AC_TRY_RUN): Reword warning.
-
- * acspecific.m4 (AC_PROG_CXX): Notify the user of the check for
- GNU C++.
- (AC_PROG_CXX, AC_PROG_CXXCPP): Use g++, not gcc, as default C++
- compiler.
- * acgeneral.m4 (AC_LANG_CPLUSPLUS): Ditto.
-
- * acgeneral.m4 (AC_INIT_PARSE_ARGS): Move ac_usage string directly
- into the here document to work around A/UX shell limitation.
-
- * acgeneral.m4 (AC_COMPILE_CHECK): Mention the MSG macros in the
- obsolete warning.
-
- * autoscan.pl (output_programs): Use AC_CHECK_LIB, not
- AC_HAVE_LIBRARY.
-
- * acgeneral.m4 (AC_CHECK_FUNC): Move prototype outside of function
- so it works with C++. From ejb@era.COM (E. Jay Berkenbilt).
-
-Fri Oct 28 11:23:30 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * acspecific.m4 (AC_CHECK_HEADERS_DIRENT): Use define, not
- AC_DEFUN, so the testsuite doesn't call it with no arguments,
- leading to a syntax error in the real Bourne shell.
-
-Wed Oct 26 18:40:41 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * Version 2.0.
-
-Tue Oct 25 11:04:16 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * acgeneral.m4 (AC_CHECK_HEADER, AC_CHECK_HEADERS): Change -
- in file names to _.
- * acspecific.m4 (AC_CHECK_HEADER_DIRENT, AC_CHECK_HEADERS_DIRENT):
- Likewise.
-
-Mon Oct 24 11:28:20 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * Makefile.in (uninstall): Remove the transformed names.
- (SCRIPTS): Rename from PROGS.
- * configure.in: Likewise.
-
-Fri Oct 21 07:14:23 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * acgeneral.m4 (AC_TRY_COMPILE): New macro.
- (AC_LANG_C, AC_LANG_CPLUSPLUS): Set $ac_compile.
- (AC_TRY_LINK): Don't declare exit.
- * acspecific.m4 (AC_C_INLINE, AC_C_CONST, AC_CHECK_HEADER_DIRENT,
- AC_DECL_SYS_SIGLIST, AC_HEADER_SYS_WAIT, AC_TYPE_SIGNAL,
- AC_FUNC_GETLOADAVG, AC_HEADER_TIME, AC_STRUCT_TM,
- AC_STRUCT_TIMEZONE, AC_STRUCT_ST_BLOCKS, AC_STRUCT_ST_BLKSIZE,
- AC_STRUCT_ST_RDEV): Use AC_TRY_COMPILE instead of AC_TRY_LINK.
- (AC_AIX, AC_MINIX, AC_ISC_POSIX): Must come before AC_TRY_COMPILE.
-
- * acspecific.m4 (AC_PROG_LEX): Don't assume -ll if using lex;
- check for it. From Mark Eichin.
-
-Thu Oct 20 07:11:22 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * acgeneral.m4 (AC_PARSE_ARGS): Ignore --site.
-
- * autoscan.pl: Add more blank lines to the output. Pacify perl -w.
-
-Wed Oct 19 09:14:50 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREREQ_COMPARE): Allow secondary and ternary
- numbers >99. From John Eaton <jwe@che.utexas.edu>.
-
-Wed Oct 19 00:06:40 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * ifnames.sh: Take comments out of sed script.
-
-Tue Oct 18 00:20:04 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu>
-
- * acgeneral.m4 (AC_INIT_NOTICE): Set ac_default_prefix.
- (AC_INIT_PARSE_ARGS, AC_SITE_LOAD, AC_OUTPUT): Use it.
- (AC_PREFIX_DEFAULT): New macro.
- From Ken Raeburn.
-
- * testsuite/autoconf.s/syntax.exp: Renamed from specific.exp.
-
- * acgeneral.m4 (AC_SITE_LOAD): Change where to look for config.site.
-
- * configure.in: Call AC_ARG_PROGRAM.
- * Makefile.in (install): Use program_transform_name.
-
- * acgeneral.m4 acspecific.m4 acoldnames.m4: Clarify copying terms.
-
- * acgeneral.m4 (AC_CANONICAL_BUILD): Default build to host, not empty.
-
- * acspecific.m4 (AC_PROG_CC): Recognize NeXT cpp as GNU C.
- From tom@basil.icce.rug.NL (Tom R.Hageman).
-
-Mon Oct 17 18:25:53 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_CPP): Use assert.h (comes with gcc), not
- stdio.h (loses for new cross-compilers). From Roland McGrath.
-
-Tue Oct 11 13:22:22 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PATH_XTRA): Add X_PRE_LIBS variable and assume
- -lSM if -lICE is found. From Karl Berry.
-
-Mon Oct 3 20:12:36 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu)
-
- * testsuite/Makefile.in (AUTOCONF, AUTOCONFFLAGS): Test
- ../autoconf, not installed autoconf.
-
-Sat Oct 1 04:43:43 1994 Paul Eggert <eggert@twinsun.com>
-
- * acspecific.m4: Catch `const' bug in NEC SVR4.0.2 mips cc.
-
- * Makefile.in (.sh, .pl, configure): Do chmod before mv.
-
- * acheaders, acspecific.m4 (AC_HEADER_SYS_WAIT): New entry.
-
- * acconfig.h (HAVE_SYS_WAIT_H): New entry.
-
-Wed Sep 28 08:59:01 1994 David MacKenzie <djm@geech.gnu.ai.mit.edu>
-
- * Makefile.in: Set datadir to $(prefix)/share.
-
-Tue Sep 27 08:00:38 1994 David MacKenzie <djm@geech.gnu.ai.mit.edu>
-
- * Makefile.in: Use implicit rules to make scripts.
- From Jim Meyering.
-
- * acconfig.h: Remove #undefs of unused symbols.
- From Paul Eggert.
- * testsuite/autoconf.s/defines.exp: New file.
- * testsuite/autoconf.s/specific.exp: Extract the list of macros to
- test from acspecific.m4 instead of hardcoding it.
- * acspecific.m4 (AC_PROG_CXXCPP): Default CXX to gcc, not c++.
-
-Mon Sep 26 12:32:46 1994 David MacKenzie <djm@churchy.gnu.ai.mit.edu>
-
- * acspecific.m4 (AC_HEADER_DIRENT): Only check for -lx if not
- using dirent.
- * autoreconf.sh: Shorten sed label for OSF/1.
- * acgeneral.m4 acspecific.m4: Change licensing terms for output.
-
-Thu Sep 22 15:36:56 1994 David MacKenzie <djm@churchy.gnu.ai.mit.edu>
-
- * autoconf.sh (tmpin): Always set.
-
-Wed Sep 21 13:12:10 1994 David MacKenzie <djm@geech.gnu.ai.mit.edu>
-
- * acgeneral.m4 (AC_INIT_PREPARE): Remove trailing slashes from
- srcdir.
-
-Mon Sep 19 17:11:39 1994 David MacKenzie <djm@geech.gnu.ai.mit.edu>
-
- * acgeneral.m4 (AC_INIT, AC_INIT_PARSE_ARGS, AC_CANONICAL_SYSTEM,
- AC_ARG_PROGRAM): Make the default for program_transform_name be
- a valid sed script, and substitute it always.
-
-Sat Sep 17 08:27:58 1994 David MacKenzie <djm@geech.gnu.ai.mit.edu>
-
- * autoheader.sh: Protect `for' loop from checking empty $syms.
-
- * ifnames.sh: Use % instead of , as sed s separator.
-
- * autoscan.pl: Update output comments.
-
-Fri Sep 16 11:20:02 1994 David MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_TYPE_GETGROUPS): Provide a cross compiling
- default. From Jim Meyering.
-
- * acgeneral.m4 (AC_INIT_PARSE_ARGS): Document
- --program-transform-name.
-
-Thu Sep 15 16:26:36 1994 David MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_INIT_NOTICE): Clarify copying notice.
- Fix up comments between sections.
-
- * acspecific.m4 (AC_PROG_LEX): Omit extra checking message.
-
- * autoreconf.sh: Give usage if non-option args are given.
- * autoconf.sh autoheader.sh: Define AC_LOCALDIR for configure.in.
-
-Thu Sep 15 11:31:13 1994 Ian Lance Taylor (ian@airs.com)
-
- * Makefile.in (check): Set AUTOCONFFLAGS from srcdir, not objdir.
-
-Thu Sep 15 09:06:40 1994 David MacKenzie (djm@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_MSG_ERROR): Say that it's an error in the message.
-
- * Makefile.in (check): Copy install-sh from srcdir if needed.
-
- * autoreconf.sh: Only regenerate autoheader-generated header file
- templates. Pass relative macrodir properly.
- * autoconf.sh autoheader.sh autoreconf.sh: Add -l --localdir option.
- Based on work by Mark Eichin.
-
- * ifnames.sh: Add -h option.
- * autoconf.sh autoheader.sh: Remove -v option.
-
- * acgeneral.m4 (AC_CHECK_TYPE): Require AC_HEADER_STDC and check
- stdlib.h if present.
-
- * acgeneral.m4 (AC_OUTPUT): Protect cache save from interruptions.
-
-Tue Sep 13 09:46:23 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
-
- * Makefile.in (install): Use srcdir. From Mark Eichin.
-
- * acgeneral.m4 (AC_OUTPUT_FILES): Automatically add
- configure_input comment to Makefiles again.
- * Makefile.in testsuite/Makefile.in: Remove configure_input ref.
-
- * acgeneral.m4 (AC_LINK_FILES, AC_OUTPUT_LINKS): Reverse the order
- of the arguments. Support relative symlinks.
-
- * acgeneral.m4 acspecific.m4: Remove some gratuitous {} in shell
- variable references.
-
- * acgeneral.m4 (AC_OUTPUT_FILES): New output variable
- configure_input replaces big kludge for adding output comment.
- * Makefile.in, testsuite/Makefile.in: Use it.
-
-Mon Sep 12 23:06:08 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_INIT_PREPARE, AC_OUTPUT_SUBDIRS): Make command
- line quoting work for shell metachars besides blanks.
-
-Sun Sep 11 23:34:24 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PATH_XTRA): Link with X_EXTRA_LIBS when
- checking for -lSM.
-
- * acfunctions (memcmp): Use AC_FUNC_MEMCMP. From Paul Eggert.
-
- * acgeneral.m4 (AC_COMPILE_CHECK): Mark obsolete.
-
-Sat Sep 10 10:59:19 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * Makefile.in (DISTFILES): Include install-sh, not install.sh.
-
- * autoscan.pl: Check AC_MACRODIR.
-
- * acgeneral.m4 (AC_INIT_PARSE_ARGS, AC_INIT_PREPARE,
- AC_CONFIG_SUBDIRS, AC_OUTPUT_SUBDIRS): Make quoting of command
- line options work.
- (AC_CONFIG_AUX_DIRS): Check for install-sh over install.sh.
-
- * acspecific.m4 (AC_FUNC_GETMNTENT): Only check for second lib if
- first lib isn't found. From Jim Meyering.
-
-Fri Sep 9 10:41:42 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FUNC_MEMCMP): New macro, from Jim Meyering.
- * testsuite/autoconf.s/specific.exp: Test it.
-
- * testsuite/Makefile.in (site.exp): Simplify.
-
- * acgeneral.m4 (AC_CACHE_SAVE): Use a shorter syntax for setting
- the variables. Idea from Karl Berry.
- (AC_CHECK_FUNCS, AC_CHECK_HEADERS): Take an action-if-not-found.
- From Jim Meyering.
-
- * acconfig.h: Add entries for getmntent and strftime.
- * acspecific.m4 (AC_C_CHAR_UNSIGNED): If GCC, don't run a test
- program.
-
-Thu Sep 8 10:53:53 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_USG): Was passing too many args to AC_TRY_LINK.
- (AC_FUNC_STRFTIME, AC_FUNC_GETMNTENT): New macros.
- (AC_HEADER_DIRENT): Check for Xenix dir libs.
- (AC_XENIX_DIR, AC_SCO_INTL, AC_IRIX_SUN, AC_DYNIX_SEQ, AC_AIX,
- AC_ISC_POSIX, AC_MINIX): Go back to the v1 names.
- * acoldnames.m4: Delete their aliases.
- * testsuite/autoconf.s/specific.exp: Check them.
-
- * acgeneral.m4 (AC_ARG_PROGRAM): Use `;' instead of `-e' to
- separate sed arguments, to simplify Makefile usage and support
- sed arguments containing spaces.
- (AC_CANONICAL_HOST): Move check for config.sub here from
- AC_CANONICAL_SYSTEM.
-
- * autoheader.m4 (AC_CHECK_HEADERS_DIRENT): Redefine. From Paul Eggert.
- (AC_CHECK_SIZEOF): Redefine this, not the old name.
- (AC_HAVE_LIBRARY): Redefine.
-
-Wed Sep 7 09:32:31 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * testsuite/lib/common.exp: Ignore warnings about test programs.
- * testsuite/autoconf.s/specific.exp: Check AC_FUNC_CLOSEDIR_VOID.
-
- * Makefile.in (*clean): Remove the new index.
- (dist): Undo adding write perms. Screws up RCS.
- * acgeneral.m4 (AC_OUTPUT_MAKE_DEFS): Remove comments from sed
- program.
- * acoldnames.m4: Change a couple of AC_DEFUN to define.
-
-Wed Sep 7 01:27:19 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_SITE_LOAD): Check whether $CONFIG_SITE is empty.
-
-Tue Sep 6 09:55:30 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_ARG_PROGRAM): New macro.
- (AC_INIT_PARSE_ARGS, AC_CANONICAL_SYSTEM): Do a little setup for it.
-
- * acspecific.m4 (AC_PROG_INSTALL): Clarify comment. Remove check
- for bsdinst, since it's no better than our install.sh.
- (AC_CHECK_HEADER_DIRENT, AC_CHECK_HEADERS_DIRENT): New macros.
- (AC_HEADER_DIRENT, AC_DIR_HEADER): Use them.
- (AC_PROG_CC, AC_PROG_CXX): Check whether GCC accepts -g.
-
- * acgeneral.m4 (AC_INIT_PREPARE): Call AC_PROG_ECHO_N.
- Use define instead of AC_DEFUN for some frequently called or
- internal macros that aren't involved in ordering constraints.
-
-Mon Sep 5 17:37:36 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_C_CROSS): Provide default argument to AC_TRY_RUN.
-
-Fri Sep 2 09:30:41 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_TRY_CPP): Use a temp file so sh -x works.
- From Mark Nudelman.
-
- * acgeneral.m4: --norecursion -> --no-recursion.
- (AC_OUTPUT_LINKS): Reset srcdir to ac_given_srcdir.
-
- * acspecific.m4 (AC_PATH_X): Call AC_ARG_WITH(x, ...).
- (AC_PROG_INSTALL): Search for bsdinst too.
-
- * Makefile.in (dist): Make distribution files writable.
-
- * acgeneral.m4 (AC_OUTPUT): Move trap 0 commands to near the end
- of configure, to work around shell bug in failing to execute the
- trap when there are commands after AC_OUTPUT.
-
-Sat Sep 3 19:47:06 1994 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
-
- * acgeneral.m4 (AC_OUTPUT_FILES): Write CONFIG_FILES defn
- unquoted, so $1 can contain references to shell variables in configure.
-
-Thu Sep 1 15:34:15 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_TRY_RUN): Always warn if no cross-compile
- default is given.
- * acspecific.m4 (AC_FUNC_MMAP, AC_FUNC_VFORK, AC_FUNC_WAIT3,
- AC_FUNC_UTIME_NULL, AC_FUNC_STRCOLL): Provide a default
- for AC_TRY_RUN.
- (AC_FUNC_CLOSEDIR_VOID): New macro, broken out of AC_HEADER_DIRENT.
-
-Thu Sep 1 00:06:38 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acgeneral.m4 acspecific.m4: Discard all output until AC_INIT is
- called. Remove now-unnecessary dnl's between macro definitions.
- (AC_OUTPUT): Add exit 0 and optional unquoted here document to
- end of config.status.
-
-Wed Aug 31 00:11:28 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acspecific.m4 (AC_PATH_X_DIRECT): Use AC_TRY_LINK instead of
- AC_CHECK_LIB, so we don't add the library to $LIBS or print anything.
- (AC_PATH_XTRA): Remove initial checking message.
- (AC_HEADER_STDC): In test program, default to no STDC headers if
- cross compiling.
-
-Tue Aug 30 16:16:29 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * autoreconf.sh: Add -h option.
- * autoupdate.sh: Remove -v option.
-
- * acgeneral.m4 (AC_EGREP_CPP, AC_TRY_CPP): Add parens around eval
- for old shells. From Kaveh Ghazi.
- (AC_TRY_RUN): Warn when generating configure, if called without
- a default parameter and AC_CANONICAL_SYSTEM has been called.
-
- * autoheader.sh: Don't run `for' loops on empty lists.
- From Ken Raeburn.
-
- * autoconf.sh autoheader.sh: Print the version number using grep
- like the other scripts, not using m4.
- * acgeneral.m4: Remove conditional for printing version number.
- It broke with frozen files.
-
- * autoheader.m4: New file.
- * autoheader.sh: Use it; the frozen version if possible.
- * Makefile.in (install): Install a frozen autoheader.m4f if possible.
- * autoconf.m4: Don't sinclude acsite.m4 here.
- * acgeneral.m4 (AC_INIT): Include it here.
-
-Tue Aug 30 14:02:07 1994 David J. MacKenzie (djm@mole.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_CHECK_LIB): Use AC_DEFINE_UNQUOTED.
- From Jim Meyering.
-
- * acgeneral.m4: Revise diversions, to topologically order
- macros called via AC_REQUIRE.
- (AC_DIVERT_PUSH, AC_DIVERT_POP): New macros.
- (AC_INIT, AC_ARG_ENABLE, AC_ARG_WITH, AC_SUBST, AC_SUBST_FILE,
- AC_REQUIRE): Use them.
- From Franc,ois Pinard (bless his soul!).
- (AC_PRO, AC_EPI): New macros.
- (AC_DEFUN): Use them.
- (AC_INIT): sinclude aclocal.m4 herea.
- * autoconf.m4: Not here.
-
- * autoconf.sh: Use a freeze file if available and m4 can do it.
- * Makefile.in (install): Install a freeze file if m4 supports it.
-
-Mon Aug 29 16:18:22 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_TRY_CPP): Remove subshell and move quotes.
-
-Sun Aug 28 17:37:26 1994 David J. MacKenzie (djm@bennett.eng.umd.edu)
-
- * acspecific.m4 (AC_C_CHAR_UNSIGNED, AC_C_LONG_DOUBLE,
- AC_C_INLINE): Don't AC_REQUIRE AC_PROG_CC.
-
- * acspecific.m4 (AC_RSH, AC_ARG_ARRAY, AC_HAVE_POUNDBANG): Define
- to print error messages.
-
- * acgeneral.m4 (AC_OUTPUT_LINKS): Insert ac_links and ac_files
- into config.status using an *un*quoted here document.
- From Ken Raeburn.
-
-Sat Aug 27 13:31:58 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): Remove comments from within sed
- script. From Kaveh Ghazi <ghazi@wilhelm.rutgers.edu>.
-
-Fri Aug 26 17:03:18 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * autoconf.sh, acgeneral.m4: __LINE__ -> __oline__.
-
- * acgeneral.m4 (AC_TRY_CPP, AC_EGREP_CPP): Append any error output
- to config.log.
- (AC_EGREP_CPP): Don't use a temp file.
-
- * acspecific.m4 (AC_FUNC_ALLOCA): Require CPP.
-
- * acgeneral.m4 (AC_INIT_PREPARE): Replace AC_SUBST_DEFAULT calls
- with AC_SUBST.
- (AC_SUBST_DEFAULT): Macro removed.
- * acspecific.m4 (AC_PROG_CC, AC_PROG_CXX): If CFLAGS or CXXFLAGS
- was not set already, give it a default value according to whether
- we have gcc.
-
- * acspecific.m4 (AC_PATH_XTRA): Use AC_CHECK_LIB, not AC_HAVE_LIBRARY.
-
-Fri Aug 26 00:34:11 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acconfig.h (HAVE_UNION_WAIT): Entry removed; it wasn't defined
- anywhere.
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): rm files before mv onto them.
- (AC_OUTPUT): Remove explicit exit at end of configure, to allow
- code after AC_OUTPUT (needed for Emacs).
-
- * acgeneral.m4 (AC_CANONICAL_SYSTEM): Move setting of alias vars
- into submacros.
-
- * acspecific.m4 (AC_PROG_CPP): If $CPP is set and is a directory,
- ignore it.
-
-Thu Aug 25 09:26:36 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acspecific.m4 (AC_SYS_INTERPRETER): Move hash mark out of macro
- call.
- (AC_FUNC_MMAP): If C++, put malloc decls in extern "C".
-
- * acgeneral.m4 (AC_INIT_PARSE_ARGS): Untabify help message
- and indent options.
-
- * Makefile.in (DISTFILES): Remove ChangeLog.0.
-
- * acgeneral.m4 (AC_CHECK_LIB): Do uppercasing of library name at
- runtime.
- (AC_HAVE_LIBRARY): Retain old behavior.
-
- * acspecific.m4 (AC_FUNC_VFORK): If C++, use a prototype for the
- function in the test program.
- (AC_C_ARG_ARRAY): Macro deleted.
- * acoldnames.m4, acconfig.h, testsuite/autoconf.s/specific.exp:
- Remove references to it.
-
- * autoupdate.sh: Make sure $infile can be read, and $tmpout has
- the same permissions. Make sure $infile can be written. From
- Paul Eggert.
-
- * acgeneral.m4 (AC_INIT*): Remove now-incorrect AC_BEFORE calls.
- (AC_CHECK_FUNC): If C++, use extern "C".
- (AC_TRY_LINK, AC_TRY_RUN): If C++, declare exit.
-
- * acspecific.m4 (AC_PATH_XTRA): Check for more libraries.
- From Karl Berry.
-
- * acgeneral.m4 (AC_INIT_PREPARE): Substitute CPPFLAGS.
- (AC_LANG_C, AC_LANG_CPLUSPLUS): Include CPPFLAGS in the commands.
-
- * acgeneral.m4 (AC_OUTPUT_FILES): Move protection for right side
- of sed substitution here from AC_MAKE_DEFS, so it applies to all
- AC_SUBST'd variables.
-
- * Makefile.in (install): Use for loops. From Jim Meyering.
-
- * acgeneral.m4: Revise diversions to rely on implicit flushing at
- the end of the m4 run. Idea from Franc,ois Pinard.
- (AC_INIT_PREPARE, AC_ARG_ENABLE, AC_ARG_WITH, AC_PREFIX_PROGRAM):
- Write to the appropriate diversions.
- (AC_ENABLE, AC_WITH): Supply default help string.
- (AC_ENABLE_INTERNAL, AC_WITH_INTERNAL, AC_PREFIX_INTERNAL):
- Macros removed.
- (AC_CONFIG_SUBDIRS): Set `subdirs' here instead of in
- AC_INIT_PREPARE.
- (AC_PREFIX): Macro removed.
- * acoldnames.m4 (AC_PREFIX): Make it an alias for AC_PREFIX_PROGRAM.
-
- * acoldnames.m4: We don't officially support calling
- the subroutines of AC_INIT directly, or replacing them, so don't
- document it.
-
-Wed Aug 24 00:19:05 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acgeneral.m4 (AC_EGREP_CPP, AC_TRY_LINK, AC_TRY_RUN,
- AC_TRY_CPP): Add #line directives.
- * autoconf.sh: Make the #line directives accurate.
- From Franc,ois Pinard.
-
- * acgeneral.m4 (AC_OUTPUT): Set ac_given_INSTALL from INSTALL.
- (AC_SUBST_FILE): Replace with what was AC_INSERT_FILE.
- (AC_SUBST_DEFAULT): New macro.
- (AC_INIT_BINSH): Renamed from AC_BINSH.
- (AC_INIT_PREPARE): Call AC_SUBST_DEFAULT for CFLAGS, CXXFLAGS, and
- LDFLAGS.
-
- * acspecific.m4 (AC_HEADER_MAJOR): Don't nest caching tests.
-
- * Makefile.in (clean): Remove the new index files.
-
- * configure.in: Check for gm4 before gnum4.
-
- * acspecific.m4 (AC_PROG_RSH): Macro removed.
-
- * Makefile.in (install): Install autoconf.m4.
-
- * acspecific.m4 (AC_SYS_INTERPRETER): New name and calling
- convention for AC_HAVE_POUNDBANG.
- (AC_OS_XENIX): Check ac_header_dir instead of DEFS.
-
- * testsuite/autoconf.s/specific.exp: Add AC_HEADER_DIRENT.
- Remove AC_SYS_REMOTE_TAPE. Replace AC_HAVE_POUNDBANG with
- AC_SYS_INTERPRETER.
-
- * acspecific.m4 (AC_INT_16_BITS, AC_LONG_64_BITS): Reword messages.
-
- * acgeneral.m4 (AC_CHECK_LIB): Use our standard alternate m4 quote
- characters << and >> instead of /.
-
- * acspecific.m4 (AC_C_CONST, AC_TYPE_GETGROUPS,
- AC_PROG_GCC_TRADITIONAL): Don't put the test program in a
- temporary variable.
-
- * acgeneral.m4 (AC_CHECK_HEADERS, AC_CHECK_FUNCS): Use
- AC_DEFINE_UNQUOTED.
- * autoheader.sh (AC_DEFINE_UNQUOTED): Define.
-
-Tue Aug 23 00:03:06 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acgeneral.m4: Improve comments on some macros.
- Fix improperly quoted undefine calls.
- (AC_QUOTE_DQUOTE, AC_QUOTE_SQUOTE, AC_QUOTE_HERE, AC_QUOTE_SED,
- AC_QUOTE_TOKEN, AC_DEFINE_QUOTE, AC_DEFINE_SEDQUOTE,
- AC_QUOTE_IDENTITY): Macros removed.
- (AC_DEFINE, AC_DEFINE_UNQUOTED): Only write the (correct) value to
- confdefs.h.
- (AC_OUTPUT_MAKE_DEFS): New macro.
- (AC_OUTPUT): Call it. Move AC_SUBST calls to AC_INIT_PREPARE.
- (AC_OUTPUT_FILES): Put most variable substitutions in a here document
- instead of a string, to avoid unwanted changes to the values.
- (AC_OUTPUT_HEADER): Generate the sed script to transform
- config.h.in from conftest.h. Only split up the sed script in
- configure, not also in config.status.
-
- * acspecific.m4 (AC_PROG_ECHO_N): Work around some greps lacking -e.
-
- * acspecific.m4 (AC_PATH_X, AC_PATH_X_XMKMF, AC_PATH_X_DIRECT,
- AC_PATH_XTRA): Fix cache use and message printing.
-
- * acgeneral.m4 (AC_SITE_LOAD): Check env var CONFIG_SITE first.
- (AC_OUTPUT_HEADER): New macro broken out of AC_OUTPUT.
-
- * acgeneral.m4, acspecific.m4 (AC_FD_MSG, AC_FD_CC): New
- symbolic constants.
-
- * acgeneral.m4, acoldnames.m4 (AC_INIT_PARSE_ARGS): Renamed from
- AC_INIT_PARSEARGS.
-
- * autoupdate.sh: Use $SIMPLE_BACKUP_SUFFIX, if set.
-
- * autoheader.sh (AC_CHECK_LIB): Reflect the added arg.
-
- * autoconf.m4: New file.
- * Makefile.in (DISTFILES): Add it.
- * autoconf.sh, autoheader.sh, Makefile.in: Use it.
-
- * acspecific.m4 (AC_SYS_REMOTE_TAPE): Macro removed.
-
- * acfunctions, acheaders, acidentifiers, acmakevars, acprograms,
- autoscan.pl: Use new macro names.
-
- * acgeneral.m4 (AC_MSG_ERROR): Enclose within {} so it acts like a
- single statement. From mjshield@nyx.cs.du.edu (Michael Shields).
- (AC_CHECK_FUNCS, AC_CHECK_HEADERS): Only compute the uppercase
- name if we're going to define that symbol.
- (global): Remove AC_DIVERSION_VAR.
- (AC_OUTPUT): Adjust quoting and substitutions to replace most
- variable values directly in the sed script. Handle srcdir,
- top_srcdir, and INSTALL specially.
- Add .cpp and .hpp to c-ish suffixes list.
-
- * configure.in: Use the new macro names.
-
- * ChangeLog.0: New file, broken out of ChangeLog.1.
- * Makefile.in (DISTFILES): Add it.
-
- * autoupdate.sh: Update the regexps to account for changes to
- acoldnames.m4.
-
-Mon Aug 22 23:57:18 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * testsuite/autoconf.s/specific.exp: Use new macro names.
-
-Fri Aug 12 10:15:51 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acspecific.m4 (AC_HEADER_DIRENT, AC_DIR_HEADER): Use one cache
- variable for each header file, not one for all of them.
-
- * acgeneral.m4 (AC_CACHE_SAVE): Print a message noting when cache
- is unwritable.
- (AC_CHECK_FUNCS, AC_CHECK_HEADERS): Take an optional arg to
- execute on a match.
-
- * acspecific (AC_OS_AIX, AC_OS_MINIX, AC_OS_ISC): Don't need to be
- called before AC_TRY_CPP, since that doesn't use CFLAGS.
-
- * acgeneral.m4 (AC_CHECK_PROG, AC_PATH_PROG): Print a result
- whether or not we found the program.
- (AC_CHECKING): Not obsolete.
- (AC_WITH, AC_ENABLE, AC_INIT_PREPARE): Merge the --enable and
- --with diversions.
-
- * acgeneral.m4 (AC_DEFUN): New macro.
- Use it globally to define macros that are used as functions,
- as opposed to macros that are used as variables. Remove calls to
- AC_PROVIDE.
-
-Thu Aug 11 08:25:08 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acspecific.m4 (AC_OS_XENIX): Fix assignments. From Franc,ois
- Pinard.
- (AC_SYS_REMOTE_TAPE): Fix typo.
-
-Wed Aug 10 09:30:11 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acspecific.m4 (AC_C_CHAR_UNSIGNED): Don't lie about the result
- if gcc, just ignore it.
-
- * acgeneral.m4 (AC_CHECK_LIB): Add a function argument.
- * acgeneral.m4 (AC_HAVE_LIBRARY): Make it a wrapper around
- AC_CHECK_LIB.
- * acoldnames.m4: Remove its alias.
- * acspecific.m4: Add argument to callers.
-
- * acspecific.m4 (AC_PROG_ECHO_N): Move from acgeneral.m4 AC_MSG_ECHO_N.
- * acgeneral.m4: Callers changed.
-
- * acgeneral.m4 (AC_CACHE_LOAD, AC_CACHE_SAVE, AC_SITE_LOAD,
- AC_MSG_CHECKING): Aesthetic changes to messages, suggested by
- Franc,ois Pinard.
-
- * acspecific.m4 acgeneral.m4 acoldnames.m4: Rename
- AC_TRY_CROSS to AC_C_CROSS.
-
- * acgeneral.m4 (AC_INIT_PARSEARGS): Don't mention --verbose in
- help message.
- (AC_INIT_PREPARE): Use file descriptor 5 for config.log, and 6 for
- nothing. --verbose no longer does anything.
- (AC_MSG_ECHO_N): New macro.
- (AC_MSG_CHECKING, AC_MSG_RESULT, AC_CACHE_VAL): Require it and use
- the shell variables it sets.
- (AC_MSG_RESULT, AC_VERBOSE): Print unless --silent/--quiet is given,
- not only when --verbose is given.
- (AC_DEFINE): Don't echo anything.
- (AC_CACHE_VAL): Use a custom echo instead of AC_MSG_RESULT.
- * acgeneral.m4 (AC_CHECKING, AC_VERBOSE): Put back real versions,
- marked obsolete.
- * acoldnames.m4: Delete their aliases.
- * acgeneral.m4, acspecific.m4 (many macros): Make sure each call
- to AC_MSG_CHECKING has exactly one matching AC_MSG_RESULT, and
- make the result messages make sense with the checking messages.
-
- * acgeneral.m4 (AC_OUTPUT_SUBDIRS): Use echo, not AC_MSG_RESULT,
- to print recursion notice.
-
-Tue Aug 9 00:17:28 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Add comment mentioning config.log.
-
- * ChangeLog.1: File split out of ChangeLog.
- * Makefile.in (DISTFILES): Add it.
-
- * acgeneral.m4 (AC_OUTPUT, AC_OUTPUT_HEADER), autoheader.sh:
- Support optional input-file specification in output-file names.
- * autoheader.sh: Support top and bottom comments for config.h.in
- in acconfig.h.
-
- * acgeneral.m4, README: Say more about requiring GNU m4.
-
- * autoheader.sh: In the list of symbols to get template entries
- for, start each symbol with a blank.
-
- * autoupdate.sh: Add sed substitutions for replacing macro
- calls without parameters.
-
- * acgeneral.m4 (AC_CACHE_VAL): Omit the cache var name from the
- result message.
-
- * acspecific.m4 (AC_DIR_HEADER): Define to be similar to
- AC_HEADER_DIRENT, but only define the old cpp macros.
- (AC_HEADER_DIRENT): Only define the new ones.
- * acoldnames.m4: Don't say that those two macros are synonyms.
- * acconfig.h: Add the new cpp macros. Add <> to some comments.
-
- * acgeneral.m4 (AC_OUTPUT): Don't mess with $INSTALL if it starts
- with a $, due to user intervention.
-
- * Makefile.in, testsuite/Makefile.in: Fix *clean targets.
-
- * acgeneral.m4 (AC_CACHE_SAVE, AC_CACHE_LOAD, AC_SITE_LOAD):
- Use echo instead of AC_MSG_RESULT.
- (AC_INIT_PARSEARGS): Group options by topic in help message. Idea
- from Franc,ois Pinard.
-
- * TODO: New file.
-
-Mon Aug 8 23:04:01 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Tighten up srcdir handling code slightly.
- Add one or more ../ to $INSTALL when it's a relative path and
- creating a file in a subdirectory.
-
-Tue Aug 2 19:54:26 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * autoheader.sh: Read acoldnames.m4. Redefine the new macro names.
- Only define HAVE_LIBFOO where AC_CHECK_LIB is called with only one
- argument.
-
-Sat Jul 30 09:53:38 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acgeneral.m4 acspecific.m4: The Great Renaming.
- (Well, I think it's great. You may have your own opinion.)
-
- * acspecific.m4 (AC_DIR_HEADER): Define HAVE_<path>_H as well as
- the old DIRENT, SYSDIR, etc.
-
- * acgeneral.m4 acspecific.m4: Add missing spaces between arguments
- to m4 calls. From Franc,ois Pinard.
-
- * autoconf.sh: Read acoldnames.m4.
- * Makefile.in (DISTFILES, PROGS, install, clean): Add
- acoldnames.m4 and autoupdate.sh.
-
-Tue Jul 26 08:52:17 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * testsuite/Makefile.in (check): Print a message noting that
- runtest is part of DejaGNU.
-
- * autoscan.pl: Remove unneeded backslash.
-
-Sun Jul 24 23:30:27 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * Makefile.in (clean mostlyclean distclean realclean): Recurse
- into testsuite directory.
-
-Wed Jul 20 09:38:29 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * Makefile.in (install): Add missing else and fi.
- * acspecific.m4 (GETGROUPS_T, RETSIGTYPE, STACK_DIRECTION): Use
- AC_DEFINE_UNQUOTED rather than AC_DEFINE.
- From Jim Meyering.
-
-Tue Jul 19 14:49:02 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acspecific.m4 (AC_MEMORY_H): Add more quotes.
-
- * acgeneral.m4 (AC_TEST_RUN): Check for cross_compiling = yes, not
- whether it's non-empty.
-
- * acspecific.m4 (AC_MINUS_C_MINUS_O, AC_SET_MAKE): Eval the cache var
- assignments.
- (AC_YYTEXT_POINTER): Fix typo.
-
- * testsuite/autoconf.s/specific.exp,
- testsuite/autoconf.g/sizeof_type.exp,
- testsuite/autoconf.g/init.exp: New files.
- * testsuite/lib/common.exp, testsuite/config/unix.exp: Many
- changes to make them work.
-
- * acgeneral.m4 (AC_DEFINE): Use redirection for echo, not $verbose.
-
-Sat Jul 2 22:07:18 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acspecific.m4 (AC_REMOTE_TAPE): Substitute PROGS.
-
-Thu Jun 30 16:29:15 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acgeneral.m4 (AC_SUBST_FILE): New version from Ken Raeburn.
-
- * ifnames: Add --help, --version, --macrodir options.
-
-Fri Jun 24 06:03:35 1994 Paul Eggert (eggert@twinsun.com)
-
- * acspecific.m4 (AC_VFORK): Improve test for the gcc-sparc vfork bug.
-
-Thu Jun 30 09:47:17 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * acgeneral.m4 (AC_OUTPUT_SUBDIRS): Pass correct --srcdir option
- to sub configures. Quote args containing spaces.
- (AC_PREPARE): Set and substitute `subdirs'. Quote args containing
- spaces.
- (AC_CANONICAL_HOST, AC_CANONICAL_TARGET, AC_CANONICAL_BUILD):
- Substitute the cpu, vendor, os variables.
-
- * acspecific.m4 (AC_PROG_INSTALL): Look for ginstall before other
- names.
-
- * acgeneral.m4 (AC_TEST_LINK): Add newlines around argument code.
- From mjshield@nyx.cs.du.edu (Michael Shields).
-
-Wed Jun 29 16:56:28 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * autoscan.pl: Add --macrodir option.
-
- * acgeneral.m4 (AC_CACHE_SAVE): Capture stderr for Ultrix sh.
-
-Tue Jun 28 18:05:00 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * Makefile.in: Make INSTALL from install.texi.
-
-Thu Jun 23 02:03:19 1994 David J. MacKenzie (djm@vortex.eng.umd.edu)
-
- * ifnames.sh: New file.
- * Makefile.in: Add it in various places.
-
-Tue Jun 14 12:58:38 1994 David J. MacKenzie (djm@bleen.eng.umd.edu)
-
- * Makefile.in (DISTFILES): Add testsuite files.
-
- * autoconf.sh: Print version number on stdout, not stderr.
- * acgeneral.m4: Ditto.
-
- * acgeneral.m4 (AC_HAVE_LIBRARY): Add OTHER-LIBRARIES arg.
- Treat empty commands args as if they weren't given.
-
-Thu Jun 9 11:39:14 1994 David J. MacKenzie (djm@bleen.eng.umd.edu)
-
- * acgeneral.m4 (AC_CHECK_TYPE): New macro.
-
- * acspecific.m4 (AC_PROG_CPP, AC_PROG_CXXCPP, AC_YYTEXT_POINTER,
- AC_LN_S, AC_RSH, AC_STDC_HEADERS, AC_MAJOR_HEADER, AC_DIR_HEADER,
- AC_STAT_MACROS_BROKEN, AC_SYS_SIGLIST_DECLARED, AC_GETGROUPS_T,
- AC_UID_T, AC_RETSIGTYPE, AC_MMAP, AC_VFORK, AC_WAIT3, AC_ALLOCA,
- AC_GETLOADAVG, AC_UTIME_NULL, AC_STRCOLL, AC_SETVBUF_REVERSED,
- AC_STRUCT_TM, AC_TIME_WITH_SYS_TIME, AC_TIMEZONE, AC_ST_BLOCKS,
- AC_ST_BLKSIZE, AC_ST_RDEV, AC_CROSS_CHECK, AC_CHAR_UNSIGNED,
- AC_LONG_DOUBLE, AC_WORDS_BIGENDIAN, AC_ARG_ARRAY, AC_INLINE,
- AC_CONST, AC_HAVE_POUNDBANG, AC_REMOTE_TAPE, AC_LONG_FILE_NAMES,
- AC_RESTARTABLE_SYSCALLS, AC_FIND_X, AC_FIND_X_XMKMF,
- AC_FIND_X_DIRECT): Cache results.
- (AC_SIZE_T, AC_PID_T, AC_OFF_T, AC_MODE_T): Use AC_CHECK_TYPE.
- (AC_DIR_HEADER_CHECK): Macro removed.
-
-Wed Jun 8 18:03:45 1994 David J. MacKenzie (djm@bleen.eng.umd.edu)
-
- * acspecific.m4 (AC_MINUS_C_MINUS_O): Cache results.
-
-Thu May 26 09:43:37 1994 David J. Mackenzie (djm@poseidon.cygnus.com)
-
- * acspecific.m4 (AC_PROG_CC, AC_PROG_CXX): Cache results.
- Eliminate temp file in gcc test.
- (AC_GCC_TRADITIONAL): Cache results.
-
-Wed May 25 14:45:44 1994 David J. Mackenzie (djm@poseidon.cygnus.com)
-
- * acspecific.m4 (AC_VPRINTF): Use AC_FUNC_CHECK.
-
- * acgeneral.m4 (AC_CONFIG_AUX_DIR): Renamed from AC_CONFIG_AUXDIR.
- (AC_SUBST_FILE): Macro deleted; didn't work, not clear it's needed.
-
- * acgeneral.m4 (AC_SITE_LOAD): New macro.
- (AC_PREPARE): Call it.
-
-Wed May 25 08:18:07 1994 David J. Mackenzie (djm@rtl.cygnus.com)
-
- * acgeneral.m4: m4exit if --version, to reduce needless delay.
-
- * acgeneral.m4 (AC_PREPARE): Redirect file descriptor 6 to
- config.log.
- (AC_LANG_C, AC_LANG_CPLUSPLUS): Send compiler messages to desc 6.
- * acspecific.m4 (AC_MINUS_C_MINUS_O): Likewise.
- * Makefile.in (distclean): Remove config.log.
-
- * acgeneral.m4 (AC_PREPARE): Add AC_BEFORE calls for AC_CONFIG_HEADER,
- AC_REVISION, AC_PREREQ, and AC_CONFIG_SUBDIRS.
- Add AC_PROVIDE calls to those macros and AC_ARG_ENABLE and AC_ARG_WITH.
-
- * acgeneral.m4 (AC_CANONICAL_SYSTEM, AC_CANONICAL_HOST,
- AC_CANONICAL_TARGET, AC_CANONICAL_BUILD): Add "ICAL" to names.
- (AC_LINK_FILES): Renamed from AC_MAKE_LINKS.
- (AC_TEST_RUN): Renamed from AC_TEST_PROGRAM, which is now an alias.
- * acspecific.m4: Change callers to use new name.
-
- * acgeneral.m4 (AC_PREFIX_INTERNAL): Renamed from AC_PREFIX.
- (AC_PREFIX): Obsolete wrapper for it.
- (AC_PREFIX_PROGRAM): Define a variable.
- (AC_PREPARE): Call AC_PREFIX_INTERNAL if that variable is set.
-
-Tue May 24 18:49:35 1994 David J. Mackenzie (djm@rtl.cygnus.com)
-
- * acspecific.m4 (AC_ALLOCA): Don't declare alloca if it's already
- defined. From Bill Sommerfeld <sommerfeld@apollo.hp.com>.
-
- * acgeneral.m4 (AC_TEST_PROGRAM): Verbosely note when using the
- cross-compiling default.
- (AC_CACHE_WRITE): Set the cache values only if not already set.
- (AC_PARSEARGS, AC_OUTPUT): Allow giving an empty prefix or exec_prefix.
-
- AC_CONFIG_AUXDIR*.
-
- * acgeneral.m4, acspecific.m4: Rename AC_CONFIG_AUX* to
- AC_CONFIG_AUXDIR*.
-
- * acgeneral.m4 (AC_OUTPUT, AC_OUTPUT_HEADER): Add an env var
- CONFIG_STATUS to allow overriding the name of config.status.
-
- * acspecific.m4 (AC_MINUS_C_MINUS_O): If $CC=cc, don't duplicate
- the check. From Jim Meyering.
-
- * acgeneral.m4 (AC_TEST_PROGRAM): Add missing newline.
- Always include 'fi' for cross-compiling if.
- From Jim Meyering.
-
- * Makefile.in (prefix, exec_prefix): Use @ substitutions.
-
- * acgeneral.m4: Make default cache file ./config.cache,
- so PATH is not used by "." command. From Jim Meyering.
-
-Thu May 19 06:05:07 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_STRUCT_TM): Fixed checking message to be less
- confusing.
-
-Wed May 18 22:11:45 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_BINSH): New macro.
- (AC_INIT, AC_REVISION): Require AC_BINSH first thing.
-
-Wed May 18 09:08:39 1994 David J. MacKenzie (djm@burnout.eng.umd.edu)
-
- * acgeneral.m4: Rename some internal macros.
- Give the diversions symbolic names.
- (AC_ARG_ENABLE, AC_ARG_WITH, AC_ENABLE_INTERNAL, AC_WITH_INTERNAL):
- New macros.
- (AC_PARSEARGS): Print --with and --enable help strings.
- (AC_ENABLE, AC_WITH): Make wrappers around _INTERNAL functions.
- Mark obsolete.
- (AC_PREPARE): Execute any saved up --with or --enable code.
-
-Tue May 17 15:18:00 1994 David J. MacKenzie (djm@bleen.eng.umd.edu)
-
- * acgeneral.m4 (AC_REVISION): Move quotes around to make it work
- again.
-
-Sat May 14 07:30:57 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acgeneral.m4, acspecific.m4: Clean up some comments.
-
-Tue May 10 09:50:12 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): set the _path_ cache variable,
- not the _program_ one.
- * acgeneral.m4 (AC_PREFIX): Call AC_PROGRAM_PATH instead of
- duplicating it.
- (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): If the user set the variable
- in the environment, cache that value.
- (AC_PREPARE, AC_CHECKING, AC_VERBOSE): Use file descriptors 4 and
- 5 for checking and results messages. Idea from metaconfig 3.0.
-
-Mon May 9 08:20:14 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acgeneral.m4 (AC_TEST_PROGRAM): If no default for
- cross-compiling is given, but we are cross-compiling, give an error.
- (AC_PROGRAM_EGREP, AC_TEST_LINK, AC_TEST_PROGRAM, AC_TEST_CPP):
- Don't add an extra blank line after the if-clause.
- (AC_REVISION): Merge AC_DOREV into this macro.
- Rename some macros:
- AC_SYSTEM_TYPE -> AC_CANON_SYSTEM
- AC_HOST_TYPE -> AC_CANON_HOST
- AC_TARGET_TYPE -> AC_CANON_TARGET
- AC_BUILD_TYPE -> AC_CANON_BUILD
- (AC_OUTPUT): Don't do Cygnus-style magic
- substitutions on prefix and exec_prefix, just initialize and
- substitute them normally.
-
-Sun May 8 01:09:42 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_AIX, AC_MINIX, AC_ISC_POSIX): Don't call
- AC_BEFORE for AC_HEADER_EGREP, to avoid require loops.
- * acgeneral.m4 (AC_HEADER_EGREP): Call AC_PROGRAM_EGREP instead of
- duplicating most of it.
-
-Fri May 6 15:26:48 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acspecific.m4 (AC_YYTEXT_POINTER): Use AC_TEST_LINK, not
- AC_TEST_PROGRAM.
-
-Fri May 6 00:45:29 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acspecific.m4, acgeneral.m4: Add dnl after AC_PROVIDE,
- AC_REQUIRE, and AC_BEFORE calls.
- Use AC_CHECKING and AC_TEST_LINK instead of AC_COMPILE_CHECK.
-
- * acgeneral.m4 (AC_TEST_LINK): New macro.
- (AC_COMPILE_CHECK): Mark obsolete. Call AC_CHECKING and
- AC_TEST_LINK.
- (AC_PROGRAM_CHECK, AC_PROGRAM_PATH, AC_HAVE_LIBRARY, AC_HEADER_CHECK,
- AC_FUNC_CHECK, AC_SIZEOF_TYPE): Print "checking" messages even if
- using cached values. Use AC_TEST_LINK instead of AC_COMPILE_CHECK.
- * acspecific.m4 (AC_PROG_INSTALL): Ditto.
-
- * acgeneral.m4 (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): Fix nesting in
- cache use.
-
- * acspecific.m4 (AC_PROG_INSTALL): Ditto.
-
- * acgeneral.m4 (AC_OUTPUT_CONFIG_SUBDIRS): Adjust relative cache
- file paths before passing them to sub-configures. Omit existing
- --cache-file arguments.
-
-Thu May 5 21:38:51 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acgeneral.m4 (AC_FUNC_CHECK, AC_HEADER_CHECK): Combine redundant
- code. Use AC_CACHE_VAL.
- (AC_SIZEOF_TYPE): Use AC_CACHE_VAL.
-
-Thu May 5 12:51:32 1994 David J. MacKenzie (djm@gamera.eng.umd.edu)
-
- * Makefile.in (all): Don't depend on info files.
- (install): Don't install INSTALL.
- (installcheck, install-info): New targets.
-
-Thu May 5 08:49:39 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * Makefile.in (dist): chmod the dist directory, not the current
- directory. Don't depend on DISTFILES.
-
- * autoconf.sh: Go back to old way of doing NLS nuisance test.
- * autoheader.sh: Ditto.
- * acgeneral.m4: Ditto.
-
-Thu May 5 08:36:19 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acgeneral.m4: Use "yes" and "no" or "" uniformly for boolean
- variables' values. Don't assume default values.
- (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): Always set the cache variable
- and use different ones.
-
- * acspecific.m4: Use "yes" and "no" or "" uniformly for boolean
- variables' values. Don't assume default values.
- (AC_STDC_HEADERS, AC_ALLOCA): Untangle nested tests.
-
-Thu May 5 07:51:38 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * Makefile.in (distclean): Remove config.cache.
-
-Wed May 4 19:41:35 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_HAVE_LIBRARY): Use AC_CACHE_VAL.
-
- * Makefile.in (install): Depend on all again.
- (install-info): Depend on info again.
-
-Wed May 4 15:05:11 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): Use AC_CACHE_VAL.
- * acgeneral.m4 (AC_PROGRAM_CHECK, AC_PROGRAM_PATH): Use AC_CACHE_VAL.
- (AC_REPLACE_FUNCS): Use AC_FUNC_CHECK.
- Rearrange general tests into 4 categories:
- Checking for files - fundamental (caching)
- Checking for files - derived (caching)
- Checking for C features - fundamental (no caching)
- Checking for C features - derived (caching)
-
- * acgeneral.m4 (AC_CACHE_LOAD, AC_CACHE_SAVE, AC_CACHE_VAL):
- New macros.
- (AC_PREPARE): Call AC_CACHE_LOAD.
- (AC_OUTPUT): Call AC_CACHE_SAVE.
- (AC_PARSEARGS): Add --cache-file=FILE option.
- (AC_CONFIG_SUBDIRS): Pass --cache-file to subdirectory configures.
-
- * acgeneral.m4 (AC_OUTPUT_CONFIG_SUBDIRS): Renamed from
- AC_CONFIG_SUBDIRS.
- (AC_CONFIG_SUBDIRS): Just define AC_SUBDIR_LIST.
- (AC_OUTPUT): Call AC_OUTPUT_CONFIG_SUBDIRS if AC_SUBDIR_LIST is
- defined.
- Make config.status --recheck pass --norecursion to configure.
-
- * acspecific.m4 (AC_SETVBUF_REVERSED): Print "checking" message.
-
-Wed May 4 10:40:56 1994 David J. MacKenzie (djm@burnout.eng.umd.edu)
-
- * autoreconf.sh: Add options [--help] [--macrodir=dir] [--verbose]
- [--version].
-
- * acspecific.m4 (AC_GCC_TRADITIONAL, AC_SET_MAKE, AC_RSH,
- AC_GETLOADAVG, AC_CROSS_CHECK): Print results verbosely.
- (AC_GETLOADAVG): Namespace cleanup.
-
-Wed May 4 09:32:04 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * autoheader.sh, autoconf.sh, acgeneral.m4: Make the NLS
- nuisance test actually do something.
-
-Mon May 2 16:31:33 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * configure.in: Check for standards.texi.
- * Makefile.in: Put everything back into one directory.
- Don't assume standards.* exist.
-
-Sat Apr 30 09:37:06 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Change >> to > in sed command.
-
-Fri Apr 29 21:56:33 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * Makefile.in (all): Make autoreconf too.
-
-Fri Apr 29 21:03:48 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acgeneral.m4 (AC_OUTPUT): When doing substitutions on files, if
- the file starts with "#!", put the "automatically generated"
- comment on the second line instead of the first.
-
-Fri Apr 29 12:53:53 1994 David J. MacKenzie (djm@burnout.eng.umd.edu)
-
- * acgeneral.m4 (AC_CONFIG_AUX, AC_CONFIG_AUX_DEFAULT,
- AC_CONFIG_AUX_DIRS, AC_SYSTEM_TYPE, AC_HOST_TYPE, AC_TARGET_TYPE,
- AC_BUILD_TYPE, AC_SUBST_FILE, AC_MAKE_LINKS, AC_OUTPUT_MAKE_LINKS,
- AC_CONFIG_SUBDIRS): New macros.
-
- * acspecific.m4 (AC_PROG_INSTALL): Use install.sh from ac_aux_dir.
-
- * Makefile.in: Remove references to standards.*.
- Add autoreconf.
-
-Thu Apr 28 12:01:01 1994 David J. MacKenzie (djm@burnout.eng.umd.edu)
-
- * Makefile.in (dist): Add .., ../etc, and ../texinfo files.
-
- * acspecific.m4 (AC_LN_S): Add verbose messages.
-
- * Makefile.in, configure.in: Add autoscan and its data files.
- Check for perl.
diff --git a/util/autoconf/ChangeLog.1 b/util/autoconf/ChangeLog.1
deleted file mode 100644
index 5e2f017..0000000
--- a/util/autoconf/ChangeLog.1
+++ /dev/null
@@ -1,1920 +0,0 @@
-Thu May 12 15:55:40 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * Version 1.11.
-
- * autoconf.texi: Document filename restriction on CPP.
-
-Thu May 12 10:11:20 1994 David J. MacKenzie (djm@hill.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Treat "./Makefile" like "Makefile".
- From Karl Berry.
-
-Tue May 10 00:08:19 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Set prefix and exec_prefix if they
- weren't set already.
-
-Sat May 7 20:06:59 1994 Noah Friedman (friedman@kropotkin.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): If using install.sh, add `-c'
- to INSTALL.
-
-Sat May 7 15:36:22 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acgeneral.m4 (AC_OUTPUT): If configuring in the source tree,
- don't end top_srcdir with "/.".
- * acspecific.m4 (AC_SET_MAKE): Remove temp file.
- From John Interrante <interran@uluru.stanford.edu>.
-
-Fri May 6 15:26:48 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acgeneral.m4 (AC_SIZEOF_TYPE): Fatal error if test program fails.
-
-Fri May 6 12:52:19 1994 David J. MacKenzie (djm@gamera.eng.umd.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Run "./config.status", not "config.status".
- From Kevin Gallagher <kgallagh@spd.dsccc.com>.
-
-Fri May 6 00:45:29 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * acspecific.m4 (AC_WAIT3): Sleep in the parent to avoid rm
- problems on fast machines. From david d zuhn.
-
-Thu May 5 12:51:32 1994 David J. MacKenzie (djm@gamera.eng.umd.edu)
-
- * Version 1.10.
-
- * Makefile.in (install): Don't install INSTALL.
- (installcheck, install-info): New targets.
-
-Mon May 2 16:31:33 1994 David J. MacKenzie (djm@aria.eng.umd.edu)
-
- * autoconf.sh, autoheader.sh: If M4 is an absolute file name that
- no longer exists, use M4=m4.
-
-Mon May 2 13:06:06 1994 David J. MacKenzie (djm@burnout.eng.umd.edu)
-
- * acspecific.m4 (AC_HAVE_POUNDBANG): Quote # in message.
- From schwab@issan.informatik.uni-dortmund.de (Andreas Schwab).
-
- * autoconf.texi: Document config.h.bot. Fix typo in AC_HAVE_POUNDBANG.
-
- * acspecific.m4 (AC_PROG_CXX): Look for "cxx" (DEC C++ compiler) too.
-
- * autoheader.sh: Fix tr string for Solaris tr.
- Add config.h.bot if present.
- From richard@sol.kbsi.com (Richard Henderson).
-
-Fri Apr 29 12:53:53 1994 David J. MacKenzie (djm@burnout.eng.umd.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): Use install.sh from srcdir
- or srcdir/.. or srcdir/../.. and never default to cp.
-
-Thu Apr 28 12:01:01 1994 David J. MacKenzie (djm@burnout.eng.umd.edu)
-
- * acconfig.h: Add HAVE_MMAP entry.
- * acspecific.m4 (AC_MMAP): If NBPC is not defined, use PAGESIZE.
- From "Kaveh R. Ghazi" <ghazi@eden.rutgers.edu>.
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): For each file being created,
- munge a copy of conftest.sed rather than the original.
- From brook@trillium.botany.utexas.edu (Brook Milligan).
-
-Tue Apr 26 00:27:21 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_LANG_C, AC_LANG_CPLUSPLUS): Remove CFLAGS and
- CXXFLAGS from ac_cpp.
-
-Thu Apr 21 19:43:20 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * Version 1.9.
-
- * autoconf.texi: Document special AC_FIND_XTRA ordering
- dependencies.
-
- * acspecific.m4 (AC_FIND_XTRA): Reorder AC_REQUIREs.
-
- * acspecific.m4 (AC_FIND_X): AC_REQUIRE_CPP.
-
- * acspecific.m4 (AC_PROG_LEX): Say what we set LEXLIB to.
-
-Wed Apr 20 13:17:05 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS): Allow . in hostnames. Use string
- comparison on them.
- (AC_HAVE_LIBRARY): namespace cleanup.
-
- * autoconf.texi: Describe changes to AC_FIND_X, AC_FIND_XTRA, and
- AC_YYTEXT_POINTER.
-
- * acconfig.h: Replace DECLARE_YYTEXT with YYTEXT_POINTER.
-
- * acgeneral.m4 (AC_PARSEARGS): --gas and --x set with_gas and
- with_x to yes, not 1.
-
- * acspecific.m4 (AC_YYTEXT_POINTER): New macro, replacing
- AC_DECLARE_YYTEXT.
- (AC_FIND_X): Assume no X if --without-x was given.
- (AC_FIND_XTRA): Quotes AC_REQUIRE args. Run uname in a subshell in
- case it's missing. Put -l options in X_EXTRA_LIBS. Print values
- of the variables we set if verbose.
-
-Tue Apr 19 14:14:25 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.texi: Note GNU m4 1.0 bugs.
-
- * acspecific.m4 (AC_FIND_X_XMKMF): Set variables correctly.
-
- * autoconf.texi: Don't @setchapternewpage odd by default. Mention
- autoheader AC_SIZEOF_TYPE symbol generation.
-
- * acgeneral.m4 (AC_SIZEOF_TYPE): Fix typo.
-
- * Makefile.in (install): Don't install aclocal.m4.
-
- * autoheader.sh: Generate entries for AC_SIZEOF_TYPE
- automatically.
-
-Mon Apr 18 22:14:59 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_SIZEOF_TYPE): Remove second arg, and generate a
- symbol name automatically.
-
- * autoconf.texi: Document new AC_SIZEOF_TYPE usage.
-
- * acspecific.m4 (AC_PROG_INSTALL): Only filter out "install"
- containing "dspmsg".
- (AC_FIND_X_XMKMF): Fix variable names to not conflict with grep -v.
-
- * autoconf.texi: Various small fixes.
-
- * INSTALL: Say configure takes "awhile".
-
-Sat Apr 16 15:05:31 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4: Call AC_LANG_C in AC_PREPARE, not AC_INIT.
-
-Fri Apr 15 07:00:37 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * Version 1.8.
-
- * acgeneral.m4: Rename ac_configure_args back to configure_args,
- since some people have been using it.
-
-Thu Apr 14 14:45:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.texi: Note that AC_ENABLE and AC_WITH arguments
- shouldn't contain blanks, for now.
-
-Wed Apr 13 17:26:36 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_SET_MAKE): Use $MAKE if defined, else "make".
-
- * autoconf.texi: Add missing files to diagram.
-
- * acgeneral.m4 (AC_TEST_CPP): Propogate comment about Coherent
- lossage into configures.
-
-Sat Apr 9 17:34:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS): Unknown option is a fatal error.
-
- * acgeneral.m4: Remove ac_ prefix from some variables set by
- options, for consistency and backward compatibility.
-
-Fri Apr 8 13:24:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_XTRA): Don't test for -lsocket on IRIX.
- From Karl Berry.
-
- * acspecific.m4 (AC_FIND_X_XMKMF, AC_FIND_X_DIRECT): Don't
- override --x-includes and --x-libraries. Check openwin last due
- to its bugs.
-
- * acgeneral.m4: Add --x-includes, --x-libraries options. Document
- them and --build, --host, --target.
-
- * autoconf.texi: Mention --x-includes and --x-libraries.
-
- * INSTALL: Mention --x-includes and --x-libraries.
-
-Tue Apr 5 12:46:47 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.texi: Document top_srcdir substitution.
-
- * acspecific.m4 (AC_PROG_INSTALL): Look for install.sh in
- @top_srcdir@, not $srcdir.
-
- * acgeneral.m4 (AC_OUTPUT): AC_SUBST top_srcdir. Set it.
-
-Mon Apr 4 20:13:08 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.texi: Fix dependencies examples.
-
- * Makefile.in: Update configuration dependencies.
-
- * acgeneral.m4: Add back --no-create option. Make config.status
- --recheck use it.
-
- * autoheader.sh: Go back to doing move-if-change. (Work around in
- dependencies by using stamp files.)
-
-Thu Mar 31 11:34:50 1994 David J. MacKenzie (djm@hill.gnu.ai.mit.edu)
-
- * Makefile.in (autoconf, autoheader, configure): Write to $@.tmp
- instead of to $@ directly so that after a disk full error, the
- targets to not exist. Otherwise, a subsequent make could install
- a corrupt (but not executable) script. From Jim Meyering.
-
-Thu Mar 31 08:22:29 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.texi: Re-document --with argument.
-
- * acgeneral.m4 (AC_PARSEARGS): --with can take an argument again.
-
-Wed Mar 30 20:01:57 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.texi: Document --disable- options.
-
- * acgeneral.m4 (AC_PARSEARGS): Add --disable-FEATURE.
-
- * INSTALL: Mention --enable- options.
-
-Mon Mar 28 17:43:22 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS): Make multiple non-option args a
- fatal error.
-
- * acspecific.m4: Change all occurrences of $(MAKE_VAR) to
- ${MAKE_VAR}.
-
- * autoconf.texi (Command Line): New node. Move some descriptions
- here from General Feature Tests. Describe --without- options.
-
- * acgeneral.m4 (AC_PARSEARGS): Rewrite again, using ideas from the
- GNU libc configure.in. All options that take an argument set
- shell variables.
- (AC_COMPILE_CHECK): Add `return' in `int' function.
-
- * INSTALL: Fix typo.
-
-Sun Mar 27 00:44:07 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_NOTICE): Don't save original args or initialize
- options here.
- (AC_PARSEARGS): Do them here.
- (AC_PREPARE): Save a copy of original args here, if it hasn't been
- done yet.
-
-Sat Mar 26 01:32:40 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4: Omit obsolete options from usage message.
- Quote args to AC_CHECKING that contain m4 variables.
-
- * INSTALL: Note that env can be used to set env vars.
-
- * autoconf.texi: Document AC_SET_MAKE.
- Note that vsprintf and vfprintf come with vprintf.
- Note that env can be used to set env vars.
-
- * acspecific.m4 (AC_SET_MAKE): New macro.
- (AC_PROG_INSTALL): Find scoinst as a good install program.
-
- * acgeneral.m4: Initialize variables set by options.
- (AC_HAVE_HEADERS): Require cpp.
-
- * autoconf.texi: Document AC_ENABLE and @prefix@ and @exec_prefix@
- substitutions.
-
- * acgeneral.m4: Recognize all the Cygnus configure options; warn
- about other arguments. Make default value for --with "yes", not
- "1". AC_SUBST for prefix and exec_prefix.
- (AC_ENABLE): New macro.
-
-Thu Mar 24 18:11:00 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * INSTALL: Describe recently added configure options.
-
- * autoconf.texi: Style cleanups. Mention config.h.top.
-
- * autoheader.sh: Add ${config_h}.top to the output, if it's
- present.
-
-Thu Mar 24 13:36:19 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.sh: Remove all temp files when exiting. If m4 fails,
- produce no output and exit with the m4 exit status.
-
- * autoconf.texi: Document AC_PREREQ.
-
- * acgeneral.m4 (AC_PREREQ): New macro, with some helper macros.
-
-Thu Mar 24 01:20:49 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * Makefile.in (acdatadir): New variable based on datadir, giving
- Autoconf lib files their own subdirectory. Use it instead of
- datadir.
-
-Wed Mar 23 22:41:54 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * autoconf.texi: Change names of nodes that describe invoking
- configure and config.status to conform to coding standards.
- Document --version, --help, --silent/--quiet, --verbose options to
- configure and config.status.
-
- * acgeneral.m4 (AC_PARSEARGS): Add --help and --version to
- configure. Simplify getting option arguments. Complain about
- impossible host arguments.
- (AC_OUTPUT): Add --help and --version to config.status.
-
-Wed Mar 23 00:16:28 1994 Roland McGrath (roland@mole.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_CHECKING): Do nothing if $ac_silent is set.
- (AC_PARSEARGS): Grok -q/--quiet/--silent and set $ac_silent.
-
-Tue Mar 22 18:28:30 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.texi: Document AC_SIZEOF_TYPE.
-
- * acspecific.m4 (AC_INT_16_BITS, AC_LONG_64_BITS): Mark obsolete
- with advice to use AC_SIZEOF_TYPE instead.
-
- * acgeneral.m4 (AC_SIZEOF_TYPE): New macro.
-
-Tue Mar 22 08:44:40 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * autoconf.texi: Describe AC_CHECKING et al.
-
- * acspecific.m4: Use AC_CHECKING et al. where appropriate.
-
- * acgeneral.m4 (AC_CHECKING, AC_VERBOSE, AC_ERROR, AC_WARN): New
- macros. Use them where appropriate.
- (AC_LANG_C, AC_LANG_CPLUSPLUS): Fix quoting of ac_cpp.
-
- * acspecific.m4 (AC_PROG_CPP): Don't add $CFLAGS to CPP.
- (AC_PROG_CXXCPP): Don't add $CXXFLAGS to CXXCPP.
-
- * acgeneral.m4 (AC_OUTPUT): Don't remove VPATH lines containing
- colons. From Jim Meyering (meyering@comco.com).
- (AC_LANG_C): Add CFLAGS to ac_cpp.
- (AC_LANG_CPLUSPLUS): Add CXXFLAGS to ac_cpp.
-
-Sat Mar 19 16:38:03 1994 David J. MacKenzie (djm@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_LANG_RESTORE): Only emit shell code to change
- the current language if it actually changed.
-
- * autoconf.texi: Add info dir entry. Describe new C++ macros and
- AC_MMAP.
- (Language Choice): New section.
- Add another example of dependencies.
-
- * acspecific.m4 (AC_PROG_CXX, AC_PROG_CXXCPP, AC_REQUIRE_CPP): New
- macros based on work by zoo@aggregate.com (david d zuhn).
- (AC_DECLARE_YYTEXT): Use AC_REQUIRE_CPP. Warn that it's broken.
- (AC_STDC_HEADERS): Use AC_REQUIRE_CPP.
- (AC_MMAP): New macro from Mike Haertel and Jim Avera.
-
- * acgeneral.m4 (AC_PARSEARGS): Check for missing arguments to
- options. Recognize --target. Save the original args before
- modifying them.
- (AC_INIT): Call AC_LANG_C.
- (AC_PREPARE): Don't save the original args here (too late).
- (AC_LANG_C, AC_LANG_CPLUSPLUS, AC_LANG_SAVE, AC_LANG_RESTORE):
- New macros based on work by zoo@aggregate.com (david d zuhn).
- (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_COMPILE_CHECK,
- AC_TEST_PROGRAM, AC_TEST_CPP): Use AC_REQUIRE_CPP and ac_ext and
- ac_cpp.
-
- * autoheader.sh: Update the file even if it is unchanged, to avoid
- foiling a Makefile rule that makes it from configure.in. If you
- let the rule for making config.status from configure create
- config.h from config.h.in, then an unnecessary update here will
- not cause unneeded recompilation. Recompilation should only
- happen if config.h is updated, which won't occur if config.h.in
- had the same contents, even if its timestamp changed. (Ick.)
-
- * Makefile.in (Makefile): Don't depend on config.status, to avoid
- running config.status too many times.
-
-Fri Mar 18 00:43:21 1994 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * autoconf.texi: Document AC_FIND_XTRA.
-
- * acgeneral.m4 (AC_OUTPUT): Remove VPATH lines if srcdir=., to
- work around Sun make bug. From Karl Berry.
-
- Rename internal use shell variables to start with "ac_".
-
- Trap signal 2 (SIGINT), not signal 3 (SIGQUIT), which means stop
- without cleaning up. From eggert@twinsun.com (Paul Eggert).
-
- * acspecific.m4 (AC_FIND_XTRA): New macro from Karl Berry
- (karl@cs.umb.edu).
- (AC_FIND_X, AC_ISC_POSIX): Provide self.
-
- (AC_DECLARE_YYTEXT): Move AC_SUBST. Don't quote value of
- DECLARE_YYTEXT. From Karl Berry.
-
- (AC_PROG_CPP): Include $CFLAGS in CPP.
-
- Rename internal use shell variables to start with "ac_".
-
- * autoconf.sh, autoheader.sh: Trap signal 2 (SIGINT), not signal 3
- (SIGQUIT), which means stop without cleaning up. From
- eggert@twinsun.com (Paul Eggert).
-
- * autoconf.texi: Mention shell variable prefixes.
-
- * autoconf.texi: Work around RCS substitution in AC_REVISION
- example.
-
-Wed Mar 16 19:55:17 1994 Noah Friedman (friedman@prep.ai.mit.edu)
-
- * acgeneral.m4 (compile): Include $LDFLAGS.
-
-Thu Mar 10 01:27:20 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREPARE): Don't absolutize relative paths.
- (AC_OUTPUT): For relative paths, prepend to $srcdir as many
- "../" as the number of subdirectories deep the file being created is.
-
-Tue Feb 15 16:02:19 1994 Noah Friedman (friedman@prep.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): Reject /sbin/install.
-
-Sun Feb 13 21:15:45 1994 Noah Friedman (friedman@prep.ai.mit.edu)
-
- * autoconf.texi (Setting Variables, Sample configure.in): Replace
- references to AC_UNISTD_H with AC_HAVE_HEADERS(unistd.h).
-
-Thu Feb 10 21:39:43 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_SYS_SIGLIST_DECLARED): New macro.
-
-Sat Feb 5 13:35:52 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): Check for -lkvm separately after
- -lutil check.
-
-Fri Feb 4 17:17:11 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): Move creation of conftest.sed
- outside of `for' loop. We need only do this once for all the
- output files.
-
-Fri Jan 21 16:35:00 1994 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL_INSTALL_SH): New macro for
- INSTALL value to use install.sh.
- (AC_PROG_INSTALL): Use it.
-
-Thu Jan 6 16:22:25 1994 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_DEFINE): Use AC_QUOTE_SQUOTE instead of
- AC_DEFINE_QUOTE on AC_VAL. From Bruno Haible
- <haible@ma2s2.mathematik.uni-karlsruhe.de>.
- * acgeneral.m4 (AC_DEFINE_UNQUOTED): pushdef/popdef
- AC_QUOTE_SQUOTE instead of AC_DEFINE_QUOTE.
-
-Wed Dec 22 03:51:53 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_DEFINE): in verbose strings, put
- AC_DEFINE_QUOTE exprs in double quotes to avoid shell wildcard
- expansion.
-
- * acgeneral.m4 (AC_PROGRAM_PATH, AC_PROGRAMS_PATH): New macros.
- * autoconf.texi (General Tests): Document them.
-
- * configure.in: Use AC_PROGRAMS_PATH to find m4, not AC_PROGRAMS_CHECK.
- Put `m4' in the list of progs-to-check, since we want the absolute
- pathname for that too if we can get it.
-
-Fri Dec 17 13:44:24 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_ALLOCA): define HAVE_ALLOCA if alloca is
- present in system libraries.
-
-Tue Dec 14 14:53:55 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREPARE): Remove $ac_clean_files in traps.
-
- * acspecific.m4 (AC_STDC_HEADERS): Check that free appears in stdlib.h.
-
-Fri Dec 10 06:35:25 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): Don't look for install in `.'.
-
-Wed Dec 8 12:10:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_X_XMKMF): Redirect stderr to /dev/null in
- eval'd make pipeline.
-
- * acgeneral.m4 (AC_QUOTE_SED): Quote ! as well.
-
-Mon Dec 6 23:41:05 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_CPP): Try 'cc -E -traditional-cpp' for NeXT.
-
-Thu Dec 2 02:25:39 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREPARE): use rm -r to remove conftest* both in
- exit traps and at start of script.
-
-Wed Dec 1 03:22:21 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_X_DIRECT): Search for includes and libs
- in more places.
-
-Sun Nov 28 21:57:31 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_NOTICE): Replace "this program" with "this
- configure script" to disambiguate between configure and the
- program it is distributed with (which can have different terms).
-
-Tue Nov 23 19:41:53 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_X_DIRECT): Use the shell variable
- `x_direct_test_include' to choose the include file to search for.
-
-Sat Nov 20 17:58:09 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_X_DIRECT): Search for R6 includes & libs
- in various places. Look for /usr/athena/include & /usr/athena/lib.
- Make AC_HAVE_LIBRARY check for the library specified by the shell
- variable `x_direct_test_library', rather than hardcoding Xt (to
- which the shell variable now defaults).
-
-Thu Nov 18 18:17:21 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): Use ! instead of @ as the
- sed substitution separator.
-
- * install.sh: New file.
- * Makefile.in (DISTFILES): Add it.
- * acspecific.m4 (AC_PROG_INSTALL): Use it as the default
- instead of cp, if it's there.
-
-Sat Nov 13 12:24:57 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Extend that last change to also
- happen for .C, .cc, and .m (objc) files.
-
-Wed Nov 10 09:26:35 1993 Noah Friedman (friedman@gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): When substituting .c or .h files, put
- autoconf-added comments in '/* ... */'.
-
-Mon Nov 8 16:22:48 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_NOTICE): Put autoconf version number in configure.
-
-Fri Nov 5 23:31:28 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_X_XMKMF): properly quote `acfindx' rule.
-
-Fri Oct 29 21:46:57 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (HAVE_LONG_DOUBLE): Add code to detect Stardent
- Vistra lossage. From Kaveh R. Ghazi (ghazi@noc.rutgers.edu).
-
-Tue Oct 26 15:24:33 1993 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
-
- * Version 1.7.
-
-Tue Oct 19 23:49:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_TEST_PROGRAM): Don't remove conftest* before
- running $2 or $3 or $4; just once at the end.
-
-Mon Oct 18 01:38:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREPARE): Echo a newline into confdefs.h so it
- is never empty.
-
-Fri Oct 15 18:49:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_CONST): Added test of trivial use for broken
- Ultrix-32 V3.1 Rev 9 vcc.
-
-Fri Oct 15 15:44:39 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OBSOLETE): New macro.
- * acspecific.m4 (AC_UNISTD_H, AC_USG, AC_MEMORY_H): Call it.
-
- * acspecific.m4 (AC_LONG_FILE_NAMES): Try to create files in
- ${prefix}/lib and ${exec_prefix}/lib instead of ${prefix} and
- ${exec_prefix}; they are more likely to be writable.
-
- * Makefile.in (clean): Remove *.ma and *.mas, the macro index files.
-
-Tue Oct 12 16:02:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_RETSIGTYPE): AC_PROVIDE self.
-
-Mon Oct 11 19:09:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * Makefile.in (editsh): Obfuscate @M4@ and @datadir@ references so
- configure doesn't edit them.
-
-Sun Oct 10 14:01:35 1993 Jim Meyering (meyering@comco.com)
-
- * autoconf.sh (--help): Exit successfully.
-
-Sat Oct 9 08:29:15 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * Version 1.6.
-
- * acconfig.h (inline): New entry.
-
- * acspecific.m4 (AC_DIR_HEADER_CHECK): Don't call opendir, in
- case the needed libraries (e.g., -ldir on Xenix) aren't in
- LIBS yet. From Jim Meyering (meyering@comco.com).
-
- * acspecific.m4 (AC_PROG_LEX): Fix typo.
-
- * acgeneral.m4 (AC_HEADER_EGREP, AC_PROGRAM_EGREP,
- AC_COMPILE_CHECK, AC_TEST_PROGRAM, AC_TEST_CPP): Remove any
- temporary files before doing the actions, in case they're
- nested tests. From gray@antaire.com (Gray Watson).
-
- * configure.in: Check for GNU m4 under several names.
- * Makefile.in: Use that value.
- From Franc,ois Pinard.
-
- * acspecific.m4 (AC_STRUCT_TM): Use a member of struct tm, to
- make sure the compiler complains if it's not defined.
- From Bruno Haible (haible@ma2s2.mathematik.uni-karlsruhe.de).
-
- * acspecific.m4 (AC_FIND_X_XMKMF): If libX11.a isn't in
- USRLIBDIR, check in LIBDIR. Filter out any make verbose messages.
-
-Tue Oct 05 19:21:29 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_LONG_DOUBLE): Announce that this feature is being
- checked even if the test is simply whether $CC is gcc.
-
-Tue Oct 5 14:23:28 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh: Produce HAVE_LIBfoo for AC_HAVE_LIBRARY.
-
-Sun Oct 3 15:41:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Write assignment for `extrasub'; in sed
- cmds, write "$extrasub" so configure.in can set it to do sed frobs.
- Take second arg and write it to config.status before `exit 0'.
-
- * acspecific.m4 (AC_CONST): Say `checking for lack of working
- const'. That is precisely accurate.
-
-Wed Sep 22 15:47:50 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4: If not using GNU m4, abort.
-
- * acgeneral.m4 (AC_PREPARE): Lose if we're not in the srcdir,
- not if we're in it. But disable the check for now.
-
-Mon Sep 20 15:32:30 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREPARE): Check for $srcdir being configured,
- diagnose and lose.
-
- * acgeneral.m4 (AC_QUOTE_SED): Quote @ and %.
-
- * acgeneral.m4 (AC_OUTPUT): Say "$file is unchanged" when it is.
-
-Sat Sep 18 14:32:04 1993 Ian Lance Taylor (ian@airs.com)
-
- * acgeneral.m4: Substitute for CONFIG_FILES and CONFIG_HEADERS
- before using them, in case they have multiple values.
-
-Fri Sep 17 14:40:20 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_WAIT3): wait3 works if ru_stime is
- nonzero, too.
-
-Thu Sep 16 15:39:53 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_X_XMKMF): Code moved from AC_FIND_X.
- (AC_FIND_X_DIRECT): New function, derived from code by Karl
- Berry and Rob Savoye.
- (AC_FIND_X): Call them.
-
-Wed Sep 15 19:06:46 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREPARE): Remove confdefs* on exit with trap 0.
- (AC_OUTPUT): Don't bother removing it.
-
- * acgeneral.m4: Remove --no-create option; not useful.
-
-Mon Sep 13 21:54:46 1993 Paul Eggert (eggert@twinsun.com)
-
- * autoheader.sh: Rename the temporary output to the real
- output if their contents differ, not if their contents are identical.
- This fixes bug introduced in Aug 30 change.
-
-Mon Sep 13 16:50:30 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Run config.status with
- CONFIG_SHELL if defined. Same for configure run from config.status.
- Rename gen_files to CONFIG_FILES and gen_config to CONFIG_HEADERS.
-
- * acgeneral.m4 (AC_PREPARE): Remove confdefs* in trap.
-
-Fri Sep 10 00:29:20 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_LONG_FILE_NAMES): Test /var/tmp as well.
- In loop, skip past nonexistent dirs.
-
- * acspecific.m4 (AC_CONST): Say "working", not "broken". We are
- checking for a working const as opposed to a broken or absent
- const, not for a broken const as opposed to a working one.
-
-Thu Sep 9 09:25:49 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4, acconfig.h (AC_LONG_64_BITS): New macro.
-
-Wed Sep 1 18:54:12 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PROGRAM_CHECK): Use && instead of test -a.
-
-Tue Aug 31 19:21:35 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): Support generating multiple
- .h files. From gray@antaire.com (Gray Watson).
-
- * acspecific.m4 (AC_ALLOCA): If using alloca.o, define C_ALLOCA.
-
- * acgeneral.m4 (compile, AC_HEADER_EGREP, AC_PROGRAM_EGREP,
- AC_COMPILE_CHECK, AC_TEST_PROGRAM, AC_TEST_CPP): Remove $DEFS
- from cc and cpp command lines; include "confdefs.h" in test
- files.
- (AC_DEFINE): Append a #define to confdefs.h.
- Reduce duplicated code by introducing a temp variable, AC_VAL.
-
-Mon Aug 30 17:36:54 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh: Don't write output if it is the same as output file.
-
-Wed Aug 25 14:14:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_VFORK): Check for SunOS 5.2 bug with ignoring
- signal in parent before vfork. From eggert.
-
-Fri Aug 20 10:14:42 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS): Support giving values to --with
- options. Go back to using sed for invalid test, but without
- using '*' in the regex.
-
-Thu Aug 19 14:53:29 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_LONG_FILE_NAMES): eval the args.
-
- * acgeneral.m4 (AC_PARSEARGS): Use case instead of sed and
- test to detect invalid package names. Remove =value from
- --with options until we support it.
-
-Wed Aug 11 18:52:41 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_X): Don't set x_includes if it's
- /usr/include or x_libraries if it's /lib or /usr/lib.
-
-Wed Aug 11 13:00:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_LONG_FILE_NAMES): If we cannot write $dir, echo
- a warning msg and continue the loop to skip that directory.
-
- * acgeneral.m4 (AC_REVISION): Also eat double quotes.
-
-Thu Aug 5 14:55:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acconfig.h: Add TIME_WITH_SYS_TIME.
-
-Mon Aug 2 14:55:16 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_DECLARE_YYTEXT): \-escape "s in rhs of
- AC_DEFINE_UNQUOTED.
- Remove gratuitous second arg to AC_SUBST.
-
-Sun Aug 1 19:13:08 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): Define HAVE_GETLOADAVG if we find
- one and don't use our own getloadavg.c.
- * acconfig.h: Add HAVE_GETLOADAVG.
-
-Sat Jul 31 17:28:48 1993 Karl Berry (karl@cs.umb.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): Report results under -v.
-
-Fri Jul 30 18:08:30 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh (syms, headers, funcs, libs): Run values through
- sort|uniq to remove duplicates.
-
-Wed Jul 28 00:02:34 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
-
- * Makefile.in (config.status): Run config.status --recheck,
- not configure.
- (install): Remove refs to install-info until it's released,
- because people are getting confused.
-
- * acgeneral.m4 (AC_OUTPUT): For config.status --recheck, echo
- the configure command line that we run.
-
- * acspecific.m4 (AC_PROG_FLEX): Use AC_HAVE_LIBRARY.
-
-Mon Jul 26 19:11:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): Check that both -lutil and -lkvm
- exist before choosing them in hopes they will define getloadavg.
-
- * autoheader.sh (frob): Put $2 and $3 in the expansion of
- AC_HAVE_LIBRARY, so AC_DEFINE there is noticed.
-
-Mon Jul 26 14:21:33 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
-
- * acspecific.m4 (INT_16_BITS): Check the obvious way, so it
- doesn't pick up machines with 64 bit longs.
-
-Mon Jul 26 14:01:38 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): Check for -lelf with
- AC_HAVE_LIBRARY instead of checking for <elf.h> with AC_HEADER_CHECK.
-
-Mon Jul 26 13:58:39 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_SCO_INTL, AC_IRIX_SUN, AC_DYNIX_SEQ): Use
- AC_HAVE_LIBRARY.
-
-Mon Jul 26 13:55:17 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh (eval frob): Restore hairy sed use; we need it to
- handle multi-line macro invocations.
-
-Mon Jul 26 00:50:43 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_FIND_X): Quote the Imakefile.
-
-Sun Jul 25 08:17:11 1993 Jim Meyering (meyering@comco.com)
-
- * acconfig.h (CRAY_STACKSEG_END): New #undef.
-
-Thu Jul 22 20:26:12 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * Version 1.5.
-
- * acspecific.m4 (AC_FIND_X): Let make substitute any variables
- in INCROOT and USRLIBDIR, instead of using sed.
- From wojo@veritas.com (Jack Woychowski).
-
- * acgeneral.m4 (AC_DEFINE): When printing value verbosely, use
- double quotes and AC_DEFINE_QUOTE, like we do when assigning
- the value, so shell variables get expanded the same way.
-
- * acgeneral.m4 (AC_REVISION): New macro.
- From wollman@uvm-gen.EMBA.UVM.EDU (Garrett Wollman).
-
- * acgeneral.m4 (AC_DEFINE): Add newline before open brace.
-
-Thu Jul 22 17:07:15 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_STAT_MACROS_BROKEN): New macro.
- * acconfig.h (STAT_MACROS_BROKEN): New #undef.
-
-Wed Jul 21 15:44:32 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_DECLARE_YYTEXT): Use AC_DEFINE_UNQUOTED so
- shell var is replaced in rhs.
-
-Wed Jul 21 13:31:38 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acconfig.h (size_t, mode_t, off_t): Added.
- * acspecific.m4 (AC_OFF_T): New macro.
-
-Tue Jul 20 15:39:44 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * autoheader.sh: Put header-file.in in comment at top.
-
- * acconfig.h (NDIR): Added.
-
-Mon Jul 19 22:10:49 1993 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu)
-
- * Makefile.in (info, dvi): New targets.
-
-Sun Jul 18 22:36:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh (frob): Use `#' as the first line of each definition.
- (eval frob): Totally simplify sed use to just handle "^@@@.*@@@$".
-
-Wed Jul 14 22:44:25 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acconfig.h: Restore blank lines between paragraphs.
-
- * autoheader.sh (libs): New variable and frob to set it from
- AC_HAVE_LIBRARY uses. Produce #undef HAVE_* for each $libs.
-
-Tue Jul 13 19:03:46 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acconfig.h: Sort the entries, like the comment says.
-
- * acspecific.m4 (AC_GETLOADAVG): Only check for the AIX library
- once, looking in both local and system dirs.
- Consolidate SVR4 and Solaris cases.
-
-Mon Jul 12 20:33:36 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): If we find sys/dg_sys_info.h, do
- AC_HAVE_LIBRARY on -ldgc.
-
-Sun Jul 11 00:43:51 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): BSD library is -lutil, not
- -lutils, and requires -lkvm too.
- Check for local AIX library using AC_HAVE_LIBRARY, not
- AC_COMPILE_CHECK.
- Un-nest some conditionals. Stop checking once we've
- found a way to get getloadavg.
-
-Thu Jul 8 20:21:28 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * Makefile.in: Remove rules for making *.conf; make
- Autoconf's configure script semi-normally.
-
-Wed Jul 7 14:37:35 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * autoheader.sh (--help): Print help message to stdout and exit 0.
- (--version): Exit after printing version number.
- * autoconf.sh (--version): Exit after printing version number.
-
- * acspecific.m4 (AC_LONG_DOUBLE): Make sure that long double
- isn't smaller than double, as in Ultrix 4.[23] cc.
-
- * acgeneral.m4 (AC_REPLACE_FUNCS): Include ctype.h in the test
- program to get stubs.
-
- * acspecific.m4 (AC_FIND_X): New macro.
-
-Tue Jul 6 19:15:17 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): Try ls -L first, in case
- /dev/kmem is a symlink (as on Solaris).
-
-Wed Jun 30 22:08:22 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_MINUS_C_MINUS_O): Remove spurious `then'.
-
-Fri Jun 25 23:16:42 1993 Paul Eggert (eggert@twinsun.com)
-
- * acspecific.m4 (AC_CONST): Replace `p = <const char** expr>'
- with `ccp = <const char** expr>'; the former wasn't ANSI C, and
- was causing working compilers to be rejected.
-
-Fri Jun 25 13:26:34 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_LONG_FILE_NAMES): Redirect rm's stderr to
- /dev/null.
-
-Thu Jun 24 15:58:04 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.sh, autoheader.sh, acgeneral.m4 (AC_PREPARE): Undo
- change of Jun 16 1993. Only set `LANG' and `LC_ALL' to "C" if
- already set.
-
-Sat Jun 19 00:01:51 1993 Jim Meyering (meyering@comco.com)
-
- * acgeneral.m4: Undefine m4's `format' builtin.
- * acspecific.m4 (AC_HAVE_POUNDBANG): Make conftest executable,
- but not necessarily writable by group or other.
-
-Thu Jun 17 21:10:33 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_CPP): Put double quotes around ${CC-cc},
- not single quotes.
- If --verbose option given, say what CPP is being set to.
-
-Wed Jun 16 17:50:00 1993 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_CPP): Make sure that `cc -E` doesn't
- run the program through the C compiler too. Bob Olson
- <olson@mcs.anl.gov> says it does on the NeXT.
-
-Wed Jun 16 16:17:05 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.sh, autoheader.sh, acgeneral.m4 (AC_PREPARE): Always set
- `LANG' and `LC_ALL' environment variables to `C'.
-
-Fri Jun 11 14:29:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_MINUS_C_MINUS_O): Test that cc works at all,
- and only test it for -c -o if it does.
-
-Tue Jun 8 01:47:22 1993 Paul Eggert (eggert@twinsun.com)
-
- * acgeneral.m4 (AC_OUTPUT): The line
- DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
- doesn't work in some shells, which don't allow nesting
- \"\" inside `` inside "", and which don't unescape \\\& in the
- expected (?) way. Also, some versions of echo interpret
- backslashes inside $DEFS. Put $DEFS into a temporary file
- to avoid these portability minefields.
-
-Mon Jun 7 20:11:50 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): In setting KMEM_GROUP, use new sed
- magic from friedman which should win with both meanings of ls -lg.
-
-Mon Jun 7 06:48:49 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * Makefile.in (dist): Change gzipped tar file extension to `.gz'.
- Use explicit --gzip option to tar to make sure tar uses the right
- compression program (or else exits from failure to understand the
- option).
-
- * acgeneral.m4 (AC_OUTPUT): Don't split sed expr for exec_prefix
- across two lines, since not all versions of sed understand that.
-
- * acspecific.m4 (AC_HAVE_POUNDBANG): Complete rewrite which doesn't
- depend on csh.
-
-Tue Jun 1 03:06:28 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * Version 1.4.1 (not announced to the general public, but
- a snapshot was put on the June '93 GNU CDROM).
-
- * Makefile.in (dist): If ln fails (e.g. because of cross-device
- links), mention on stdout that file is being copied.
-
- * acgeneral.m4 (AC_PREPARE): Use `[$]*' in assignment to
- configure_args to get shell positional args, rather than m4 args to
- AC_PREPARE.
- (AC_OUTPUT): Use `configure_args' in config.status
- when invoked with --recheck, rather than $*.
-
-Mon May 31 13:12:56 1993 Paul Eggert (eggert@twinsun.com)
-
- * acspecific.m4 (AC_LONG_FILE_NAMES): rm $dir/conftest*,
- not conftest*.
-
-Mon May 31 04:18:18 1993 Roland McGrath (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_HAVE_LIBRARY): Quote libname in define.
-
-Sun May 30 19:52:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_SETVBUF_REVERSED): Pass (char *) main to
- setvbuf instead of zero.
-
-Thu May 27 20:30:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREPARE): Save $* in shell var `configure_args'.
- (AC_OUTPUT): Use $configure_args in place of $*.
-
-Wed May 26 16:19:51 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.texi (AC_PROG_INSTALL): Doc fix.
- (Automatic Remaking): Put code fragment in @example ... @end example.
-
-Mon May 24 15:46:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh (frob): Redefine AC_CONFIG_HEADER to set shell
- variable `config_h'.
- (config_h): New variable, initialize to "config.h" before frobbing.
- (final output): Write ${config_h}.in.
-
-Sat May 22 17:45:19 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * Version 1.4 released.
-
-Thu May 20 20:25:45 1993 Jim Blandy (jimb@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_IDENTITY): New function.
- (AC_DEFINE_UNQUOTED): Use it to fix this; due to a
- misunderstanding of m4, this was using its first argument as
- the definition.
-
-Thu May 20 09:21:55 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_ALLOCA) [find_stack_direction]: Return the
- value from the recursive call. If it worked before, it was by luck.
- From Bruno Haible <haible@ma2s2.mathematik.uni-karlsruhe.de>.
-
-Tue May 18 23:40:21 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_STDC_HEADERS): Require AC_PROG_CPP.
-
-Mon May 17 18:01:09 1993 Karl Berry (karl@hal.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Use variables gen_files and
- gen_config in the loop that generates the output (Make)files,
- instead of hardwiring the filenames.
-
-Sat May 15 17:23:19 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * autoconf.sh: Accept `-' to mean read stdin as input.
- * autoheader.sh: Likewise.
-
-Fri May 14 12:41:02 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * autoheader.sh, acspecific.m4 (AC_PREPARE): If `LANG' environment
- variable is set, reset its value to `C'. This is so `tr [...]'
- works more portably.
-
-Thu May 13 22:56:20 1993 Paul Eggert (eggert@twinsun.com)
-
- * acspecific.m4 (VOID_CLOSEDIR): Test closedir instead of assuming
- that it works. E.g. dynix closedir yields garbage, but has no
- prototype. Presumably Xenix closedir had the same problem, so
- stop special-casing it.
-
-Wed May 12 20:25:36 1993 Jim Meyering (meyering@comco.com)
-
- * acconfig.h: Add HAVE_LONG_DOUBLE.
-
-Wed May 12 15:07:36 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_DEFINE_UNQUOTED): New macro.
-
- * acgeneral.m4 (AC_FUNC_CHECK): Include ctype.h instead of stdio.h.
- We want it only to define __stub_* in glibc. Using stdio.h lost
- when it contained a conflicting prototype for $1; ctype.h has fewer
- prototypes.
-
- * acconfig.h: Add GETGROUPS_T.
-
- * acspecific.m4 (AC_PROG_RANLIB): Use : instead of @: for no-op.
- Some braindead make does bizarre magical things with @ in variables.
-
-Mon May 10 14:24:27 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_HAVE_POUNDBANG): New feature.
-
- * acgeneral.m4 (AC_OUTPUT): Add more backslashes to character class
- in DEFS filter (sigh).
-
-Sun May 9 14:04:31 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_DEFINE_QUOTE): No AC_QUOTE_SED (was innermost).
- (AC_HEADER_EGREP, AC_PROGRAM_EGREP, AC_TEST_CPP): Put a \ before
- $DEFS in string to be evalled.
- (AC_OUTPUT): Run DEFS through a sed filter that quotes things in it
- from sed (woo woo!) before writing it into config.status.
-
- * acspecific.m4 (AC_ALLOCA): Use AC_PROGRAM_EGREP to test for [CRAY
- && !CRAY2], instead of AC_TEST_PROGRAM. No need to run a program
- for this.
-
- * acgeneral.m4 (AC_PROGRAM_CHECK): Extract the first word of $2
- when looking for it in PATH, so it can be a program name with args.
- Omit default assignment if $4 is empty.
- Only write verbose msg if $1 was set nonempty.
- * acspecific.m4 (AC_PROG_YACC): Pass 'bison -y' (quoted like that)
- in list to AC_PROGRAMS_CHECK. Don't test for bison later to add -y
- flag.
-
-Sat May 8 00:23:58 1993 Jim Meyering (meyering@comco.com)
-
- * acgeneral.m4 (AC_REPLACE_FUNCS): Add a trailing newline in
- code for AC_COMPILE_CHECK. Otherwise it got spurious failures.
-
- * acspecific.m4 (TIME_WITH_SYS_TIME): New macro.
-
- * Makefile.in (dist): Depend on Makefile. Use gzip instead
- of compress. Link files individually instead of en masse;
- if a link fails, use `cp -f' on the losing file.
-
- * acspecific.m4 (AC_ALLOCA): Define CRAY_STACKSEG_END (the
- name of a function used in alloca.c) for CRAY-1, CRAY X-MP,
- and CRAY Y-MP.
-
-Fri May 7 15:56:26 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): Check for mach/mach.h, but don't
- disable nlist checks if found.
-
-Fri May 7 04:59:25 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): Don't look for `install' in
- /usr/ucb.
-
-Thu May 6 20:41:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_FUNC_CHECK): The test program should choke on
- #ifdef __stub___$1 as well.
- (AC_REPLACE_FUNCS): Make the test program choke on stubs.
-
-Wed May 5 20:43:13 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoconf.sh ($infile existence check): Fixed test for
- nonemptiness of $print_version to not always be true.
-
-Wed May 5 17:22:42 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PREFIX, AC_PROGRAM_CHECK), acspecific.m4
- (AC_PROG_INSTALL): If IFS wasn't set initially, give it a
- normal default value. Happens on LynxOS (x86), says
- Pete Klammer <PKLAMMER@cudnvr.denver.colorado.edu>.
-
-Wed May 5 13:22:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4: Undefine the `shift' builtin.
-
- * acspecific.m4 (AC_PROG_YACC): Use AC_PROGRAMS_CHECK to check for
- both bison and yacc, instead of two AC_PROGRAM_CHECK uses.
-
- * autoheader.sh ($# -eq 0): Set var $tmpout to name of temp file,
- send stdout there instead of config.h.in.
- (just before exit): If $# -eq 0, then move $tmpout to config.h.in
- if $status -eq 0, or remove $tmpout otherwise.
-
- * acspecific.m4 (AC_STRCOLL): Rewritten to use a test program that
- verifies that `strcoll' does vaguely reasonable ordering.
-
-Tue May 4 19:59:00 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_LONG_DOUBLE): Don't explicitely echo
- `checking for long double'.
-
-Mon May 3 22:04:35 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_GETGROUPS_T): New macro.
-
-Sat May 1 22:37:55 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_LONG_DOUBLE): New macro.
-
-Wed Apr 28 15:52:42 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PROGRAM_CHECK): Write msg under --verbose.
-
-Thu Apr 22 18:24:40 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_FUNC_CHECK): Remove spurious `#endif' line at end.
-
- * acgeneral.m4 (AC_WITH): Fix reversed args to patsubst.
- Test $with_FOO, not $FOO.
-
-Wed Apr 21 18:14:19 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_QUOTE_TOKEN): New macro.
- (AC_DEFINE_QUOTE): Use it.
-
-Tue Apr 20 18:02:46 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_DECLARE_YYTEXT): Guess name of lex output file
- and do AC_SUBST of `LEX_OUTPUT_ROOT'.
- Add `dnl' after calling some autoconf macros.
-
-Mon Apr 19 15:46:24 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_MINUS_C_MINUS_O): Do each compile a second time
- after testing for the existence of the output. Some compilers
- refuse to overwrite an existing .o file with -o, though they will
- create one.
-
- * acspecific.m4 (AC_DECLARE_YYTEXT): Changed lex input to two lines
- of "%%", not just one.
-
-Sat Apr 17 17:26:12 1993 Jim Meyering (meyering@comco.com)
-
- * acgeneral.m4 (AC_COMPILE_CHECK): Don't print `checking for ...'
- message if first argument is empty.
-
-Sat Apr 17 01:18:41 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PID_T): provide self.
- (AC_VFORK): Require AC_PID_T.
-
-Fri Apr 16 11:57:35 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PROGRAMS_CHECK): Take optional third arg; if
- given, use it as the default value.
-
-Thu Apr 15 16:43:45 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_REPLACE_FUNCS): Print a message under --verbose.
-
- * acgeneral.m4 (AC_HAVE_LIBRARY): Use m4's patsubst and translit
- instead of running sed and tr at runtime.
-
- * acconfig.h: Add STACK_DIRECTION.
-
-Wed Apr 14 17:08:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_ALLOCA): If we chose alloca.c, run a test
- program to define STACK_DIRECTION.
-
-Mon Apr 5 19:02:52 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_LONG_FILE_NAMES): Put test inside a for loop on
- several directories: . /tmp $prefix $exec_prefix. Define
- HAVE_LONG_FILE_NAMES iff long names win in all those directories.
-
-Sun Apr 4 18:38:23 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * Makefile.in (%.info): Removed pattern rule.
- (autoconf.info, standards.info): New rules.
-
- * autoconf.sh (version_only): New variable, set nonempty for
- `autoconf --version' with no input file.
- (output writing): No output if $version_only is set.
-
-Wed Mar 31 17:33:57 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_CONST): Uncomment and fix second AIX test.
-
-Wed Mar 31 16:58:12 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_CONST): Rewrite first AIX XL C 1.02.0.0 test.
- Comment out bogosity in second AIX test.
-
-Wed Mar 31 12:45:59 1993 Jim Meyering (meyering@comco.com)
-
- * acgeneral.m4 (AC_DEFINE): Put single quotes around definition
- that is echoed with --verbose. AC_DEFINE(MVDIR, "$(libdir)/mvdir")
- was generating losing code.
-
-Mon Mar 29 15:44:24 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_STDC_HEADERS): Add a missing pair of [quotes].
-
-Mon Mar 29 14:54:00 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_DECLARE_YYTEXT): Change sed regexp so it won't
- match other identifiers beginning with `yytext'.
-
-Sat Mar 27 00:11:16 1993 Paul Eggert (eggert@twinsun.com)
-
- * acspecific.m4 (AC_CONST): Detect broken AIX XL C 1.2.0.0 compiler.
-
-Thu Mar 25 19:54:50 1993 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_CONST): Remove single quotes from the C
- program; they produce shell syntax errors.
-
- * acgeneral.m4 (AC_DEFINE): Add a newline after "}" to prevent
- commands following on the same line of configure.in from
- generating shell syntax errors.
-
- * acgeneral.m4 (AC_COMPILE_CHECK): Use explicit return types
- to avoid warnings.
- (AC_TEST_CPP): Add parens to force redirection order.
- (AC_OUTPUT): Allow hostname to return bogus exit status.
- From Jean-loup Gailly <jloup@chorus.fr>.
-
-Mon Mar 22 16:53:01 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoconf.sh: Use $M4, not m4 explicitly.
- (M4): If unset in env, initialize to @m4@.
- * autoheader.sh: Likewise.
- * Makefile.in (M4): Define new variable.
- (autoconf.conf, %.conf): Use it.
- (editsh): New variable: sed command to replace @datadir@; also
- replace @M4@ with $(M4).
- (autoconf, autoheader): Use $(editsh) instead of explicit sed command.
-
-Mon Mar 22 13:08:10 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_CONST): IBM's /bin/cc under AIX-3.2 on an rs6000
- rejects attempts to modify *any* member of a struct that has a
- member declared like `const int *ap[2]'.
-
-Wed Mar 17 18:08:30 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * autoconf.sh, autoheader.sh (MACRODIR): Variable renamed to
- AC_MACRODIR. Don't initialize it at runtime if it is already set
- in the environment.
- (MACROFILES): Don't set until after options are processed.
- (print_version): New temp variable.
-
- * autoconf.sh, autoheader.sh: Rewrote argument parsing.
- Added `-m', `--macrodir', `-h', `--help', and `--' options.
- Updated usage string.
-
- * autoconf.texi: Documented --macrodir option and its effects for
- both scripts.
-
-Tue Mar 16 09:10:48 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_CONST): Sun's SC1.0 ANSI compiler (acc) won't
- increment a `const int *' pointer declared through a typedef.
-
-Mon Mar 15 16:08:42 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS): Grok `--verbose' flag; set verbose=yes.
- (AC_DEFINE): Only echo "defining $1" if $verbose is set.
-
-Sun Mar 14 18:19:21 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): Choose `installbsd' if we find
- it, in preference to `install'.
-
- * acspecific.m4 (AC_CONST): Add a check for `const int *foo' not
- allowing modification of FOO (not *FOO).
-
-Fri Mar 12 15:27:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): Remove conftest.sh before
- creating it.
-
-Thu Mar 11 12:57:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_DEFINE): Surround defn with { and }.
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): Split up $SEDDEFS into smaller
- chunks, since some shells can't handle large here documents.
- We write several commands in config.status to create conftest.sed
- in pieces.
-
-Mon Mar 8 14:40:53 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_WITH): Don't echo anything.
- Use the m4 patsubst fn instead of a run-time sed invocation to
- massage $1.
-
- * acspecific.m4 (AC_DIR_HEADER_CHECK): #include <sys/types.h>
- before the header we are testing.
-
- * acgeneral.m4 (AC_DEFINE): If $2 is empty, echo "defining $1 to be
- empty", rather than "defining $1 to be ".
-
- * acspecific.m4 (AC_DIR_HEADER_CHECK): New; subr of AC_DIR_HEADER.
- (AC_DIR_HEADER): Use it to test for each possible header file.
-
-Tue Mar 2 01:06:25 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu)
-
- * autoheader.sh: Don't use /p1/,/p2/ construct with sed---it's not
- portable. Handle broken AIX sed that strips \n from hold space
- when it shouldn't. From Jun Hamano <junio@twinsun.com>.
-
-Tue Mar 02 00:08:39 1993 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_CONST): Fix typo that caused spurious lossage
- with /bin/cc from Irix-4. From Karl Berry.
-
-Fri Feb 26 17:14:58 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_CONST): Add bizarre case that loses on SCO 3.2v4.
-
-Mon Feb 22 13:02:27 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_QUOTE_HERE, AC_QUOTE_SED): Change the quote
- chars to { and } instead of nothing. Then use {} (empty quotes) to
- separate the patsubst forms from the following dnl. Otherwise the
- result of patsubst is pasted together with dnl and the result is
- seen as a single token.
-
- * acspecific.m4 (AC_MINUS_C_MINUS_O): Print msg saying what we are
- doing before we do it.
-
- * acgeneral.m4 (AC_PREFIX): Print out the choice made.
- (AC_DEFINE): Print out the definition being done.
-
- * acgeneral.m4 (AC_DEFINE_QUOTE): Add dnl at end of line.
-
- * acspecific.m4 (AC_GETLOADAVG): Do changequote around listing of
- /dev/kmem and sed frobbing which needs to use [ and ].
-
-Sun Feb 21 13:57:55 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh: Use brackets in tr range args.
-
- * acspecific.m4 (AC_SETVBUF_REVERSED): Make the test fail if
- setvbuf returns nonzero.
-
- * acspecific.m4 (AC_GETLOADAVG): If we need to install setgid,
- figure out what group owns /dev/kmem, and set KMEM_GROUP to that.
-
- * acspecific.m4 (AC_MINUS_C_MINUS_O): Test plain `cc' after testing
- $CC. We want to make sure both compilers grok -c -o.
-
-Thu Feb 18 18:05:14 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_QUOTE_{DQUOTE,SQUOTE,HERE,SED}): New macros.
- (AC_DEFINE_{QUOTE,SEDQUOTE}): New macros; subrs of AC_DEFINE.
- (AC_DEFINE): Use them to quote $2.
-
-Wed Feb 17 14:49:14 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_TIMEZONE): Fixed quoting in tzname check.
- changequote inside quotes lost.
-
-Mon Feb 8 14:22:11 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acconfig.h (_ALL_SOURCE): Use #ifndef; AIX compiler way too dumb.
-
-Sun Jan 31 16:39:46 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_TIMEZONE): Put newlines before `#include ...'
- in $defs value.
-
-Thu Jan 28 18:06:53 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acconfig.h (_ALL_SOURCE): Use "!defined (_ALL_SOURCE) ||
- _ALL_SOURCE == 0" rather than "!_ALL_SOURCE", which bombs on the
- AIX compiler.
-
-Mon Jan 25 12:09:43 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acconfig.h (HAVE_UNION_WAIT, SYS_SIGLIST_DECLARED): New #undef's.
-
- * acconfig.h (_ALL_SOURCE): Surround with #if !_ALL_SOURCE.
-
-Fri Jan 22 15:08:33 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): If /usr/local/lib/libgetloadavg.a
- exists, add -L/usr/local/lib to LDFLAGS.
-
-Fri Jan 22 12:49:11 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT_HEADER): Only comment out the #undef NAME
- part of the line, to avoid causing errors from existing comments.
-
-Thu Jan 21 14:50:20 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_HAVE_LIBRARY): Use $libname in "checking for"
- message, not $1, to avoid "checking for -l-lfoo".
-
- * acgeneral.m4 (AC_PREPARE): In compile defn, include $CFLAGS.
-
- * acgeneral.m4 (AC_OUTPUT): Broke AC_CONFIG_NAME writing out into:
- (AC_OUTPUT_HEADER): New macro broken out of AC_OUTPUT.
- Add to conftest.sed a new sed command to turn #undef's into comments.
-
- * acgeneral.m4 (AC_OUTPUT): Use new shell variable, $maxsedlines,
- for max number of lines to feed to one sed invocation.
- Lower this limit to 20; UTekV 3.2e can't cope with 40.
-
-Tue Jan 19 13:21:02 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * Version 1.3.
-
-Fri Jan 15 16:28:18 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_CONFIG_HEADER, AC_HEADER_EGREP,
- AC_TEST_PROGRAM): Make DEFS always contain -D commands,
- not C code.
-
-Thu Jan 14 17:05:17 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): Check for -lkvm; don't assume it.
-
-Thu Jan 14 16:46:41 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh (selecting $syms from $TEMPLATES): Use sed to
- replace lines containing only blanks with empty lines.
-
-Thu Jan 14 15:15:31 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_MODE_T): New macro.
-
- * acgeneral.m4 (AC_OUTPUT): Check for grep -c returning
- nothing (AIX 3.1) as well as returning 0.
-
-Wed Jan 13 16:05:59 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_FUNC_CHECK): Add missing #endif.
-
- * acgeneral.m4 (AC_OUTPUT): Use sed, not basename.
- From Francois Pinard.
-
-Wed Jan 13 15:49:18 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Set exec_prefix to ${prefix}, not
- $(prefix); it now works in both makefiles and shell scripts.
-
-Wed Jan 13 15:29:04 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * autoheader.sh: If input is empty, don't print all of
- acconfig.h. From Francois Pinard.
-
- * acgeneral.m4 (AC_OUTPUT): Have config.status check all of its
- args for validity.
-
-Tue Jan 12 11:11:45 1993 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Preserve whitespace around = in prefix
- and exec_prefix assignments.
-
- * acspecific.m4 (AC_GETLOADAVG): Values for getloadavg_missing were
- reversed.
-
-Fri Jan 8 18:45:59 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Make config.status not complain with
- usage msg when given no args.
-
- * acgeneral.m4 (AC_HAVE_LIBRARY): Say "checking for -lfoo", not
- just "checking for foo".
-
- * acgeneral.m4 (AC_HAVE_LIBRARY): Remove excess quoting around $2
- and $3.
-
- * acspecific.m4 (AC_GETLOADAVG): Check for getloadavg library, both
- a normally installed one, and one in /usr/local/lib.
- After figuring out params for getloadavg.c, figure out whether it
- defined LDAV_PRIVILEGED, and if so, set NEED_SETGID to true, and
- define GETLOADAVG_PRIVILEGED.
- * acconfig.h: Added GETLOADAVG_PRIVILEGED.
-
-Fri Jan 8 16:16:35 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_DEFINE, AC_OUTPUT): Restore the third sed string.
-
- * acgeneral.m4 (AC_FUNC_CHECK): Use __stub_funcname.
-
- * autoheader.sh: Use Autoconf version number.
-
- * acgeneral.m4 (AC_OUTPUT): Diagnose usage errors for
- config.status. Use grep -c to count nonempty lines instead of
- test -s.
-
- * acspecific.m4 (AC_GETLOADAVG): Use AC_HAVE_LIBRARY.
-
-Wed Jan 6 19:54:47 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * autoheader.sh (coverage check): Use $TEMPLATES in error msg, not
- hard-wired "config.h".
-
-Wed Jan 6 18:24:41 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): If AC_CONFIG_NAME, change
- @DEFS@ to -DHAVE_CONFIG_H in Makefiles etc. Idea from Roland McGrath.
-
- * acgeneral.m4 (AC_FUNC_CHECK): If __STUB_funcname is defined,
- assume the function isn't present.
-
- * acgeneral.m4 (AC_OUTPUT): Make no args to AC_OUTPUT work
- again. From Ian Lance Taylor.
-
- * acspecific.m4 (AC_CONST): Fix quoting problem.
-
- * acconfig.h [const]: New addition.
-
-Thu Dec 31 17:56:18 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_HAVE_LIBRARY): New macro from Noah Friedman.
-
- * acconfig.h: Renamed from config.h.
-
- * autoheader.sh: Renamed from autohead.sh.
- Support a local acconfig.h.
- Use \\012 instead of \\n for tr for portability.
-
-Thu Dec 31 12:30:34 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * config.h: Added #undef vfork.
-
-Tue Dec 29 14:26:43 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_COMPILE_CHECK): Use cat rather than echo to
- create conftest.c, to avoid " problems.
-
-Fri Dec 25 15:07:06 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_CONST): Don't define HAVE_CONST.
-
- * acgeneral.m4 (AC_OUTPUT, AC_DEFINE): Combine the two sed
- commands for #undef lines.
- * acgeneral.m4 (AC_PROGRAM_EGREP, AC_TEST_PROGRAM,
- AC_TEST_CPP, AC_OUTPUT), acspecific.m4 (AC_PROG_CC): Put >
- before << when using both, to avoid HP-UX sh bug.
-
-Wed Dec 23 20:47:53 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS): Use if, not &&, for --with.
- From Jan Brittenson.
-
-Mon Dec 21 17:13:57 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Use sed instead of head and tail.
- Trap to remove the temp files.
-
- * acgeneral.m4 (AC_OUTPUT): Quote DEFS assignment.
- From Ian Lance Taylor.
-
-Mon Dec 21 14:27:44 1992 Jim Meyering (meyering@comco.com)
-
- * acspecific.m4 (AC_STDC_HEADERS): Make sure ctype.h macros
- are ANSI. Nest tests so we don't need shell temporary variable.
-
-Sun Dec 20 18:12:33 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu)
-
- * Makefile.in (%.h: %.in): New rule using autohead.
- (all): Do autohead.
- (install): Install autohead and config.h.
- (autohead): New rule.
- (DISTFILES): Added autohead.sh.
- * autohead: New script.
-
-Fri Dec 18 00:21:23 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_HAVE_FUNCS, AC_HAVE_HEADERS): Change method
- of tr quoting to keep old shells happy. From Ian Lance Taylor.
-
- * acgeneral.m4 (AC_DEFINE): Add to SEDDEFS.
- (AC_OUTPUT): Use sed instead of awk.
- From Ian Lance Taylor.
-
-Mon Dec 14 14:33:29 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_STDC_HEADERS): Check for string.h
- declaring memchr.
-
- * acgeneral.m4 (AC_NOTICE): Fix comment.
-
-Fri Dec 11 17:59:23 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_ALLOCA): Don't use libPW; it causes too
- much trouble.
-
-Wed Dec 9 14:04:30 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * config.h: Added HAVE_SYS_WAIT, HAVE_WAITPID, SVR4, UMAX,
- [ugp]id_t, UMAX4_3, DGUX.
-
-Thu Dec 3 13:37:17 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_INSTALL): Ignore AFS install.
- From James Clark, jjc@jclark.com.
-
-Tue Nov 24 07:47:45 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_LEX, AC_DECLARE_YYTEXT, AC_VFORK, AC_WAIT3,
- AC_INT_16_BITS, AC_WORDS_BIGENDIAN, AC_ARG_ARRAY): End with a newline.
-
- * acspecific.m4 (AC_DIR_HEADER): If ndir.h exists and the other
- choices don't, define NDIR.
-
-Sat Nov 21 00:14:51 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_RETSIGTYPE): Instead of grepping for the signal
- declaration, try redeclaring it and see if we get an error.
- Always define RETSIGTYPE, not just if it's int.
- From Ian Lance Taylor.
-
-Fri Nov 20 17:06:09 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_DEFINE): Only put -D option in quotes if it
- actually contains blanks.
-
-Thu Nov 19 17:18:40 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS): Set a shell var for --with-*.
- (AC_WITH): New macro.
-
- * acspecific.m4 (AC_CONST): If const works, define HAVE_CONST.
-
- * acspecific.m4 (AC_ALLOCA): Don't use libPW on HP-UX.
-
-Wed Nov 18 17:36:08 1992 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_DEFINE): When writing a -D with a value,
- surround it with 's so the value can contain spaces.
-
-Thu Nov 12 22:49:35 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_PROG_CC): Don't add -O to CC if GNU C.
- (-O2, or nothing, might be more appropriate.)
-
-Sun Nov 8 23:33:23 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
-
- * acspecific.m4 (AC_GETLOADAVG): Check for dwarf.h for general
- svr4, then elf.h for Solaris 2, which needs additional libraries.
-
-Thu Nov 12 22:18:54 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS): --exec_prefix -> --exec-prefix.
-
-Tue Nov 10 16:15:10 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4: undef m4 `include' builtin.
-
- * acspecific.m4 (AC_STDC_HEADERS): Don't test for limits.h
- due to Ultrix conflict with float.h.
-
-Thu Oct 29 16:16:11 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_PARSEARGS, AC_PREPARE): New macros, broken out
- parts of AC_INIT.
- (AC_INIT): Use them.
-
-Thu Oct 22 20:48:12 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_INSTALL): Comment out arg to `:'.
- AIX doesn't like it.
-
-Wed Oct 14 12:41:02 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * Version 1.2.
-
- * acspecific.m4 (AC_INSTALL): Avoid the AIX install script.
-
- * acspecific.m4 (AC_RESTARTABLE_SYSCALLS): Wait for child if
- sys calls are not restarted, to avoid leaving the child still
- running. From Ian Lance Taylor.
-
-Tue Oct 13 15:43:56 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_CONST): Add more tests for brokenness.
- From Jim Meyering.
-
- * acgeneral.m4: Use % instead of ? to avoid shell variable expansion.
-
-Fri Oct 2 06:55:05 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
-
- * acgeneral.m4: Use ? instead of , to separate parts of sed arg.
-
-Mon Sep 14 12:33:41 1992 David J. MacKenzie (djm@apple-gunkies.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_STDC_HEADERS): Also check for float.h.
-
- * acspecific.m4 (AC_TIMEZONE): Protect [] from being quotes.
-
-Thu Sep 10 17:12:10 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_OUTPUT): Include the hostname in config.status.
-
- * acgeneral.m4 (AC_OUTPUT): Use a separate flag in the awk
- script instead of checking for non-empty values, so things
- like defining const as empty work. From
- Steve Emmerson <steve@unidata.ucar.edu>.
-
-Fri Aug 28 18:51:13 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_INIT): If there's no path on $0, use '.'.
-
-Thu Aug 27 16:15:14 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * config.h: New file.
-
- * acgeneral.m4 (AC_INIT): Look for source files in the
- directory containing `configure', if not given explicitly.
-
- * acspecific.m4 (AC_TIMEZONE): Adjust tzname decl for RS6000.
-
- * acspecific.m4 (AC_GETLOADAVG): Don't use double quotes in
- the test program.
-
-Thu Aug 27 15:26:49 1992 Roland McGrath (roland@wookumz.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): Don't check nlist.h if we found
- one of specific things.
-
-Mon Aug 24 16:22:45 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * Version 1.1.
-
- * acspecific.m4 (AC_TIMEZONE): Include time.h. Don't
- declare tzname if it's a macro. From Jim Meyering.
-
-Fri Aug 21 14:12:35 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_ALLOCA): Check whether the alloca defined by
- alloca.h works when given a non-constant argument.
-
- * acspecific.m4 (AC_GETLOADAVG): Define NLIST_STRUCT and
- NLIST_NAME_UNION if appropriate.
-
- * acgeneral.m4 (AC_OUTPUT): If no args are given, omit the loop to
- produce output files.
-
- * acgeneral.m4 (AC_TEST_PROGRAM): Add a call to exit to try to
- suppress core dumped message. From Ian Lance Taylor.
-
- * acgeneral.m4 (AC_PREFIX): Only print the message if prefix
- hasn't been set. From James Clark.
-
- * acspecific.m4 (AC_SIZE_T, AC_UID_T, AC_PID_T,
- AC_RETSIGTYPE): Print a message saying what it's checking for.
- (AC_SIZE_T): Define size_t to be unsigned, not int, for
- ANSI-friendliness.
-
- * acspecific.m4 (AC_GETLOADAVG): Just check for elf.h, not
- dwarf.h too.
-
- * autoconf.sh: Exit with status 1 if there are unresolved macros.
- Isolate the pattern to make adding other prefixes easy.
- Look for aclocal.m4 in . as well as MACRODIR.
-
-Tue Aug 18 16:35:46 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_STRCOLL): New macro.
-
-Tue Aug 18 15:22:45 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu)
-
- * acspecific.m4 (AC_GETLOADAVG): elf.h implies SVR4.
-
-Mon Jul 27 14:20:32 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_TEST_PROGRAM): Check for cross-compiling
- was missing "test -n". From Ian Lance Taylor.
-
-Sun Jul 26 16:25:19 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * acgeneral.m4 (AC_SUBST): Support multiple substitutions in a
- line.
-
-Mon Jul 20 01:08:01 1992 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu)
-
- * Version 1.0.
diff --git a/util/autoconf/INSTALL b/util/autoconf/INSTALL
deleted file mode 100644
index 0338fbc..0000000
--- a/util/autoconf/INSTALL
+++ /dev/null
@@ -1,167 +0,0 @@
-Basic Installation
-==================
-
- These are generic installation instructions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
-
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source directory by typing `make clean'. To also remove the files
- that `configure' created (so you can compile the package for a
- different kind of computer), type `make distclean'.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-
-Using a Different Build Directory
-=================================
-
- You can compile the package in a different directory from the one
-containing the source code. Doing so allows you to compile it on more
-than one kind of computer at the same time. To do this, you must use a
-version of `make' that supports the `VPATH' variable, such as GNU
-`make'. `cd' to the directory where you want the object files and
-executables to go and run the `configure' script. `configure'
-automatically checks for the source code in the directory that
-`configure' is in and in `..'.
-
-Installation Names
-==================
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
- CPU-COMPANY-SYSTEM
-
-See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
-
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Operation Controls
-==================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--cache-file=FILE'
- Save the results of the tests in FILE instead of `config.cache'.
- Set FILE to `/dev/null' to disable caching, for debugging
- `configure'.
-
-`--help'
- Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made.
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
-
diff --git a/util/autoconf/Makefile b/util/autoconf/Makefile
deleted file mode 100644
index baffc63..0000000
--- a/util/autoconf/Makefile
+++ /dev/null
@@ -1,207 +0,0 @@
-# Generated automatically from Makefile.in by configure.
-# Makefile for Autoconf.
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#### Start of system configuration section. ####
-
-srcdir = .
-
-INSTALL = /usr/athena/bin/install -c
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-M4 = /mit/gnu/rsaixbin/gm4
-PERL = /usr/athena/bin/perl
-
-# Programs that are always installed.
-ASCRIPTS = autoconf autoheader autoreconf autoupdate ifnames
-SCRIPTS = $(ASCRIPTS) autoscan
-
-transform=s,x,x,
-
-prefix = /usr/local
-exec_prefix = ${prefix}
-
-# Directory in which to install scripts.
-bindir = $(exec_prefix)/bin
-
-# Directory in which to install library files.
-datadir = $(prefix)/share
-acdatadir = $(datadir)/autoconf
-
-# Directory in which to install documentation info files.
-infodir = $(prefix)/info
-
-#### End of system configuration section. ####
-
-SHELL = /bin/sh
-
-SUBDIRS = testsuite
-
-M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoheader.m4
-
-# Files that can be generated, but should be up to date for a distribution.
-DISTDEP = info Makefile
-# Files to distribute.
-DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL \
- Makefile.in NEWS README TODO $(M4FILES) \
- acconfig.h acfunctions acheaders acidentifiers \
- acmakevars acprograms autoconf.info* \
- autoconf.sh autoconf.texi install.texi \
- autoheader.sh autoscan.pl autoreconf.sh autoupdate.sh ifnames.sh \
- config.guess config.sub configure configure.in \
- install-sh mkinstalldirs texinfo.tex \
- testsuite/Makefile.in testsuite/config/*.exp \
- testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \
- standards.texi make-stds.texi standards.info*
-
-editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''M4''@,$(M4),g'
-editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g'
-
-all: ${SCRIPTS}
-
-.SUFFIXES:
-.SUFFIXES: .sh .pl
-
-.sh:
- rm -f $@ $@.tmp
- $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
-
-.pl:
- rm -f $@ $@.tmp
- $(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
-
-info: autoconf.info standards.info INSTALL
-
-autoconf.info: autoconf.texi install.texi
- $(MAKEINFO) -I$(srcdir) $(srcdir)/autoconf.texi --output=$@
-
-INSTALL: install.texi
- $(MAKEINFO) -I$(srcdir) $(srcdir)/install.texi --output=$@ \
- --no-headers --no-validate
-
-standards.info: standards.texi make-stds.texi
- $(MAKEINFO) -I$(srcdir) $(srcdir)/standards.texi --output=$@
-
-dvi: autoconf.dvi standards.dvi
-
-autoconf.dvi: autoconf.texi
- $(TEXI2DVI) $(srcdir)/autoconf.texi
-
-standards.dvi: standards.texi make-stds.texi
- $(TEXI2DVI) $(srcdir)/standards.texi
-
-check: all
- rootme=`pwd`; srcrootme=`cd $(srcdir); pwd`; \
- test -r install-sh || cp $(srcdir)/install-sh .; \
- cd testsuite && ${MAKE} $@ AUTOCONF=$$rootme/autoconf \
- AUTOCONFFLAGS="-m $$srcrootme"
-
-installcheck: all install
- cd testsuite && ${MAKE} AUTOCONF=${bindir}/autoconf $@
-
-installdirs:
- $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(acdatadir)
-
-install: all $(M4FILES) acconfig.h installdirs install-info
- @case `$(M4) --help < /dev/null 2>&1` in \
- *reload-state*) echo installing frozen m4 files; \
- $(M4) -F $(acdatadir)/autoconf.m4f -I${srcdir} ${srcdir}/autoconf.m4 ; \
- $(M4) -F $(acdatadir)/autoheader.m4f -I${srcdir} ${srcdir}/autoheader.m4 ;; \
- *traditional*) ;; \
- *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \
- esac
- for p in $(ASCRIPTS); do \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
- for i in $(M4FILES) acconfig.h; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
- done
- -if test -f autoscan; then \
- $(INSTALL_PROGRAM) autoscan $(bindir)/`echo autoscan|sed '$(transform)'`; \
- for i in acfunctions acheaders acidentifiers acprograms \
- acmakevars; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
- done; \
- else :; fi
-
-install-info: info installdirs
- -test -f autoconf.info || cd $(srcdir); \
- for i in autoconf.info*; do \
- $(INSTALL_DATA) $$i $(infodir)/$$i; \
- done
- -test -f standards.info || cd $(srcdir); \
- for i in standards.info*; do \
- $(INSTALL_DATA) $$i $(infodir)/$$i; \
- done
-
-uninstall:
- for p in $(SCRIPTS); do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
- rm -fr $(acdatadir)
- cd $(infodir); rm -f autoconf.info*
- if test -f standards.info || test -f $(srcdir)/standards.info; \
- then cd $(infodir); rm -f standards.info*; fi
-
-${srcdir}/configure: configure.in $(M4FILES)
- cd $(srcdir); \
- rm -f $@ $@.tmp; \
- $(M4) autoconf.m4 configure.in > $@.tmp && \
- chmod +x $@.tmp && mv $@.tmp $@
-Makefile: Makefile.in config.status
- ./config.status
-config.status: configure
- ./config.status --recheck
-
-clean mostlyclean distclean realclean::
- for dir in $(SUBDIRS); do \
- echo making $@ in $$dir ; \
- (cd $$dir; $(MAKE) $@) ; \
- done
-
-clean mostlyclean distclean realclean::
- rm -f $(SCRIPTS) *.tmp
- rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
- rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
- rm -f *.ev *.evs *.ov *.ovs *.cv *.cvs *.ma *.mas
-
-distclean realclean::
- rm -f Makefile config.status config.cache config.log
-
-realclean::
- rm -f TAGS *.info* INSTALL
-
-TAGS:
- etags ${srcdir}/*.m4 ${srcdir}/*.sh ${srcdir}/[a-z]*.in ${srcdir}/*.texi
-
-# Don't depend on DISTFILES because there's no rule for "standards.info*".
-dist: $(DISTDEP)
- distname=`sed -e '/define(AC_ACVERSION,/!d' \
- -e 's/[^0-9.]*\([0-9.]*\).*/autoconf-\1/' -e q acgeneral.m4`; \
- rm -fr $$distname; \
- mkdir $$distname $$distname/testsuite $$distname/testsuite/config \
- $$distname/testsuite/lib $$distname/testsuite/autoconf.g \
- $$distname/testsuite/autoconf.s; \
- for file in $(DISTFILES); do \
- ln $$file $$distname/$$file \
- || { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \
- done; \
- chmod -R a+rX $$distname; \
- tar -chz -f $$distname.tar.gz $$distname; \
- rm -fr $$distname
diff --git a/util/autoconf/Makefile.in b/util/autoconf/Makefile.in
deleted file mode 100644
index e7aab1d..0000000
--- a/util/autoconf/Makefile.in
+++ /dev/null
@@ -1,207 +0,0 @@
-# Makefile for Autoconf.
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#### Start of system configuration section. ####
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-M4 = @M4@
-PERL = @PERL@
-
-# Programs that are always installed.
-ASCRIPTS = autoconf autoheader autoreconf autoupdate ifnames
-SCRIPTS = $(ASCRIPTS) @SCRIPTS@
-
-transform=@program_transform_name@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-# Directory in which to install scripts.
-bindir = $(exec_prefix)/bin
-
-# Directory in which to install library files.
-datadir = $(prefix)/share
-acdatadir = $(datadir)/autoconf
-
-# Directory in which to install documentation info files.
-infodir = $(prefix)/info
-
-#### End of system configuration section. ####
-
-SHELL = /bin/sh
-
-SUBDIRS = testsuite
-
-M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoheader.m4
-
-# Files that can be generated, but should be up to date for a distribution.
-DISTDEP = info Makefile
-# Files to distribute.
-DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL \
- Makefile.in NEWS README TODO $(M4FILES) \
- acconfig.h acfunctions acheaders acidentifiers \
- acmakevars acprograms autoconf.info* \
- autoconf.sh autoconf.texi install.texi \
- autoheader.sh autoscan.pl autoreconf.sh autoupdate.sh ifnames.sh \
- config.guess config.sub configure configure.in \
- install-sh mkinstalldirs texinfo.tex \
- testsuite/Makefile.in testsuite/config/*.exp \
- testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \
- standards.texi make-stds.texi standards.info*
-
-editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''M4''@,$(M4),g'
-editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g'
-
-all: ${SCRIPTS}
-
-.SUFFIXES:
-.SUFFIXES: .sh .pl
-
-.sh:
- rm -f $@ $@.tmp
- $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
-
-.pl:
- rm -f $@ $@.tmp
- $(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
-
-info: autoconf.info @standards_info@ INSTALL
-
-autoconf.info: autoconf.texi install.texi
- $(MAKEINFO) -I$(srcdir) $(srcdir)/autoconf.texi --output=$@
-
-INSTALL: install.texi
- $(MAKEINFO) -I$(srcdir) $(srcdir)/install.texi --output=$@ \
- --no-headers --no-validate
-
-standards.info: standards.texi make-stds.texi
- $(MAKEINFO) -I$(srcdir) $(srcdir)/standards.texi --output=$@
-
-dvi: autoconf.dvi @standards_dvi@
-
-autoconf.dvi: autoconf.texi
- $(TEXI2DVI) $(srcdir)/autoconf.texi
-
-standards.dvi: standards.texi make-stds.texi
- $(TEXI2DVI) $(srcdir)/standards.texi
-
-check: all
- rootme=`pwd`; srcrootme=`cd $(srcdir); pwd`; \
- test -r install-sh || cp $(srcdir)/install-sh .; \
- cd testsuite && ${MAKE} $@ AUTOCONF=$$rootme/autoconf \
- AUTOCONFFLAGS="-m $$srcrootme"
-
-installcheck: all install
- cd testsuite && ${MAKE} AUTOCONF=${bindir}/autoconf $@
-
-installdirs:
- $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(acdatadir)
-
-install: all $(M4FILES) acconfig.h installdirs install-info
- @case `$(M4) --help < /dev/null 2>&1` in \
- *reload-state*) echo installing frozen m4 files; \
- $(M4) -F $(acdatadir)/autoconf.m4f -I${srcdir} ${srcdir}/autoconf.m4 ; \
- $(M4) -F $(acdatadir)/autoheader.m4f -I${srcdir} ${srcdir}/autoheader.m4 ;; \
- *traditional*) ;; \
- *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \
- esac
- for p in $(ASCRIPTS); do \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
- for i in $(M4FILES) acconfig.h; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
- done
- -if test -f autoscan; then \
- $(INSTALL_PROGRAM) autoscan $(bindir)/`echo autoscan|sed '$(transform)'`; \
- for i in acfunctions acheaders acidentifiers acprograms \
- acmakevars; do \
- $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
- done; \
- else :; fi
-
-install-info: info installdirs
- -test -f autoconf.info || cd $(srcdir); \
- for i in autoconf.info*; do \
- $(INSTALL_DATA) $$i $(infodir)/$$i; \
- done
- -test -f standards.info || cd $(srcdir); \
- for i in standards.info*; do \
- $(INSTALL_DATA) $$i $(infodir)/$$i; \
- done
-
-uninstall:
- for p in $(SCRIPTS); do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
- rm -fr $(acdatadir)
- cd $(infodir); rm -f autoconf.info*
- if test -f standards.info || test -f $(srcdir)/standards.info; \
- then cd $(infodir); rm -f standards.info*; fi
-
-${srcdir}/configure: configure.in $(M4FILES)
- cd $(srcdir); \
- rm -f $@ $@.tmp; \
- $(M4) autoconf.m4 configure.in > $@.tmp && \
- chmod +x $@.tmp && mv $@.tmp $@
-Makefile: Makefile.in config.status
- ./config.status
-config.status: configure
- ./config.status --recheck
-
-clean mostlyclean distclean realclean::
- for dir in $(SUBDIRS); do \
- echo making $@ in $$dir ; \
- (cd $$dir; $(MAKE) $@) ; \
- done
-
-clean mostlyclean distclean realclean::
- rm -f $(SCRIPTS) *.tmp
- rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
- rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
- rm -f *.ev *.evs *.ov *.ovs *.cv *.cvs *.ma *.mas
-
-distclean realclean::
- rm -f Makefile config.status config.cache config.log
-
-realclean::
- rm -f TAGS *.info* INSTALL
-
-TAGS:
- etags ${srcdir}/*.m4 ${srcdir}/*.sh ${srcdir}/[a-z]*.in ${srcdir}/*.texi
-
-# Don't depend on DISTFILES because there's no rule for "standards.info*".
-dist: $(DISTDEP)
- distname=`sed -e '/define(AC_ACVERSION,/!d' \
- -e 's/[^0-9.]*\([0-9.]*\).*/autoconf-\1/' -e q acgeneral.m4`; \
- rm -fr $$distname; \
- mkdir $$distname $$distname/testsuite $$distname/testsuite/config \
- $$distname/testsuite/lib $$distname/testsuite/autoconf.g \
- $$distname/testsuite/autoconf.s; \
- for file in $(DISTFILES); do \
- ln $$file $$distname/$$file \
- || { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \
- done; \
- chmod -R a+rX $$distname; \
- tar -chz -f $$distname.tar.gz $$distname; \
- rm -fr $$distname
diff --git a/util/autoconf/NEWS b/util/autoconf/NEWS
deleted file mode 100644
index cb22655..0000000
--- a/util/autoconf/NEWS
+++ /dev/null
@@ -1,272 +0,0 @@
-Major changes in release 2.1:
-
-* Fix C++ problems.
-* More explanations in the manual.
-* Fix a spurious failure in the testsuite.
-* Clarify some warning messages.
-* autoreconf by default only rebuilds configure and config.h.in files
- that are older than any of their particular input files; there is a
- --force option to use after installing a new version of Autoconf.
-
-Thanks to everybody who's submitted changes and additions to Autoconf!
-I've incorporated many of them, and am still considering others for
-future releases -- but I didn't want to postpone this release indefinitely.
-
-Caution: don't indiscriminantly rebuild configure scripts with
-Autoconf version 2. Some configure.in files need minor adjustments to
-work with it; the documentation has a chapter on upgrading. A few
-configure.in files, including those for GNU Emacs and the GNU C
-Library, need major changes because they relied on undocumented
-internals of version 1. Future releases of those packages will have
-updated configure.in files.
-
-It's best to use GNU m4 1.3 (or later) with Autoconf version 2.
-Autoconf now makes heavy use of m4 diversions, which were implemented
-inefficiently in GNU m4 releases before 1.3.
-
-Major changes in release 2.0:
-
-** New copyright terms:
-* There are no restrictions on distribution or use of configure scripts.
-
-** Documentation:
-* Autoconf manual is reorganized to make information easier to find
- and has several new indexes.
-* INSTALL is reorganized and clearer and is now made from Texinfo source.
-
-** New utilities:
-* autoscan to generate a preliminary configure.in for a package by
- scanning its source code for commonly used nonportable functions,
- programs, and header files.
-* ifnames to list the symbols used in #if and #ifdef directives in a
- source tree.
-* autoupdate to update a configure.in to use the version 2 macro names.
-* autoreconf to recursively remake configure and configuration header
- files in a source tree.
-
-** Changed utilities:
-* autoheader can take pieces of acconfig.h to replace config.h.{top,bot}.
-* autoconf and autoheader can look for package-local definition files
- in an alternate directory.
-
-** New macros:
-* AC_CACHE_VAL to share results of tests between configure runs.
-* AC_DEFUN to define macros, automatically AC_PROVIDE them, and ensure
- that macros invoked with AC_REQUIRE don't interrupt other macros.
-* AC_CONFIG_AUX_DIR, AC_CANONICAL_SYSTEM, AC_CANONICAL_HOST, AC_LINK_FILES to
- support deciding unguessable features based on the host and target types.
-* AC_CONFIG_SUBDIRS to recursively configure a source tree.
-* AC_ARG_PROGRAM to use the options --program-prefix,
- --program-suffix, and --program-transform-name to change the names
- of programs being installed.
-* AC_PREFIX_DEFAULT to change the default installation prefix.
-* AC_TRY_COMPILE to compile a test program without linking it.
-* AC_CHECK_TYPE to check whether sys/types.h or stdlib.h defines a given type.
-* AC_CHECK_LIB to check for a particular function and library.
-* AC_MSG_CHECKING and AC_MSG_RESULT to print test results, on a single line,
- whether or not the test succeeds. They obsolete AC_CHECKING and AC_VERBOSE.
-* AC_SUBST_FILE to insert one file into another.
-* AC_FUNC_MEMCMP to check whether memcmp is 8-bit clean.
-* AC_FUNC_STRFTIME to find strftime even if it's in -lintl.
-* AC_FUNC_GETMNTENT to find getmntent even if it's in -lsun or -lseq.
-* AC_HEADER_SYS_WAIT to check whether sys/wait.h is POSIX.1 compatible.
-
-** Changed macros:
-* Many macros renamed systematically, but old names are accepted for
- backward compatibility.
-* AC_OUTPUT adds the "automatically generated" comment to
- non-Makefiles where it finds @configure_input@ in an input file, to
- support files with various comment syntaxes.
-* AC_OUTPUT does not replace "prefix" and "exec_prefix" in generated
- files when they are not enclosed in @ signs.
-* AC_OUTPUT allows the optional environment variable CONFIG_STATUS to
- override the file name "config.status".
-* AC_OUTPUT takes an optional argument for passing variables from
- configure to config.status.
-* AC_OUTPUT and AC_CONFIG_HEADER allow you to override the input-file names.
-* AC_OUTPUT automatically substitutes the values of CFLAGS, CXXFLAGS,
- CPPFLAGS, and LDFLAGS from the environment.
-* AC_PROG_CC and AC_PROG_CXX now set CFLAGS and CXXFLAGS, respectively.
-* AC_PROG_INSTALL looks for install-sh or install.sh in the directory
- specified by AC_CONFIG_AUXDIR, or srcdir or srcdir/.. or
- srcdir/../.. by default.
-* AC_DEFINE, AC_DEFINE_UNQUOTED, and AC_SUBST are more robust and smaller.
-* AC_DEFINE no longer prints anything, because of the new result reporting
- mechanism (AC_MSG_CHECKING and AC_MSG_RESULT).
-* AC_VERBOSE pays attention to --quiet/--silent, not --verbose.
-* AC_ARG_ENABLE and AC_ARG_WITH support whitespace in the arguments to
- --enable- and --with- options.
-* AC_CHECK_FUNCS and AC_CHECK_HEADERS take optional shell commands to
- execute on success or failure.
-* Checking for C functions in C++ works.
-
-** Removed macros:
-* AC_REMOTE_TAPE and AC_RSH removed; too specific to tar and cpio, and
- better maintained with them.
-* AC_ARG_ARRAY removed because no one was likely using it.
-* AC_HAVE_POUNDBANG replaced with AC_SYS_INTERPRETER, which doesn't
- take arguments, for consistency with all of the other specific checks.
-
-** New files:
-* Comes with config.sub and config.guess, and uses them optionally.
-* Uses config.cache to cache test results. An alternate cache file
- can be selected with the --cache-file=FILE option.
-* Uses optional shell scripts $prefix/share/config.site and
- $prefix/etc/config.site to perform site or system specific initializations.
-* configure saves compiler output to ./config.log for debugging.
-* New files autoconf.m4 and autoheader.m4 load the other Autoconf macros.
-* acsite.m4 is the new name for the system-wide aclocal.m4.
-* Has a DejaGnu test suite.
-
-Major changes in release 1.11:
-
-* AC_PROG_INSTALL calls install.sh with the -c option.
-* AC_SET_MAKE cleans up after itself.
-* AC_OUTPUT sets prefix and exec_prefix if they weren't set already.
-* AC_OUTPUT prevents shells from looking in PATH for config.status.
-
-Plus a few other bug fixes.
-
-Major changes in release 1.10:
-
-* autoheader uses config.h.bot if present, analogous to config.h.top.
-* AC_PROG_INSTALL looks for install.sh in srcdir or srcdir/.. and
- never uses cp.
-* AC_PROG_CXX looks for cxx as a C++ compiler.
-
-Plus several bugs fixed.
-
-Major changes in release 1.9:
-
-* AC_YYTEXT_POINTER replaces AC_DECLARE_YYTEXT.
-* AC_SIZEOF_TYPE generates the cpp symbol name automatically,
- and autoheader generates entries for those names automatically.
-* AC_FIND_X gets the result from xmkmf correctly.
-* AC_FIND_X assumes no X if --without-x was given.
-* AC_FIND_XTRA adds libraries to the variable X_EXTRA_LIBS.
-* AC_PROG_INSTALL finds OSF/1 installbsd.
-
-Major changes in release 1.8:
-
-** New macros:
-* New macros AC_LANG_C, AC_LANG_CPLUSPLUS, AC_LANG_SAVE, AC_LANG_RESTORE,
- AC_PROG_CXX, AC_PROG_CXXCPP, AC_REQUIRE_CPP
- for checking both C++ and C features in one configure script.
-* New macros AC_CHECKING, AC_VERBOSE, AC_WARN, AC_ERROR for printing messages.
-* New macros AC_FIND_XTRA, AC_MMAP, AC_SIZEOF_TYPE, AC_PREREQ,
- AC_SET_MAKE, AC_ENABLE.
-
-** Changed macros:
-* AC_FIND_X looks for X in more places.
-* AC_PROG_INSTALL defaults to install.sh instead of cp, if it's in srcdir.
- install.sh is distributed with Autoconf.
-* AC_DECLARE_YYTEXT has been removed because it can't work, pending
- a rewrite of quoting in AC_DEFINE.
-* AC_OUTPUT adds its comments in C format when substituting in C files.
-* AC_COMPILE_CHECK protects its ECHO-TEXT argument with double quotes.
-
-** New or changed command line options:
-* configure accepts --enable-FEATURE[=ARG] and --disable-FEATURE options.
-* configure accepts --without-PACKAGE, which sets withval=no.
-* configure accepts --x-includes=DIR and --x-libraries=DIR.
-* Giving --with-PACKAGE no argument sets withval=yes instead of withval=1.
-* configure accepts --help, --version, --silent/--quiet, --no-create options.
-* configure accepts and ignores most other Cygnus configure options, and
- warns about unknown options.
-* config.status accepts --help, --version options.
-
-** Paths and other changes:
-* Relative srcdir values are not made absolute.
-* The values of @prefix@ and @exec_prefix@ and @top_srcdir@ get substituted.
-* Autoconf library files are installed in ${datadir}/autoconf, not ${datadir}.
-* autoheader optionally copies config.h.top to the beginning of config.h.in.
-* The example Makefile dependencies for configure et al. work better.
-* Namespace cleanup: all shell variables used internally by Autoconf
- have names beginning with `ac_'.
-
-More big improvements are in process for future releases, but have not
-yet been (variously) finished, integrated, tested, or documented enough
-to release yet.
-
-Major changes in release 1.7:
-
-* New macro AC_OBSOLETE.
-* Bugs in Makefile.in fixed.
-* AC_LONG_FILE_NAMES improved.
-
-Major changes in release 1.6:
-
-* New macro AC_LONG_64_BITS.
-* Multiple .h files can be created.
-* AC_FIND_X looks for X files directly if it doesn't find xmkmf.
-* AC_ALLOCA defines C_ALLOCA if using alloca.c.
-* --with-NAME can take a value, e.g., --with-targets=sun4,hp300bsd.
-* Unused --no-create option to configure removed.
-* autoheader doesn't change the timestamp of its output file if
- the file didn't change.
-* All macros that look for libraries now use AC_HAVE_LIBRARY.
-* config.status checks three optional environment variables to
- modify its behavior.
-* The usual bug fixes.
-
-Major changes in release 1.5:
-
-* New macros AC_FIND_X, AC_OFF_T, AC_STAT_MACROS_BROKEN, AC_REVISION.
-* autoconf and autoheader scripts have GNU standards conforming
- --version and --help options (they print their message and exit).
-* Many bug fixes.
-
-Major changes in release 1.4:
-
-* New macros AC_HAVE_POUNDBANG, AC_TIME_WITH_SYS_TIME, AC_LONG_DOUBLE,
- AC_GETGROUPS_T, AC_DEFINE_UNQUOTED.
-* autoconf and autoheader use the M4 environment variable to determine the
- path of the m4 program to use.
-* The --macrodir option to autoconf and autoheader specifies the directory
- in which acspecific.m4, acgeneral.m4, etc. reside if not the default.
-* autoconf and autoheader can take `-' as their file names, which means to
- read stdin as input.
-* Resulting configure scripts can take a --verbose option which causes them
- to print the results of their tests.
-* AC_DEFINE quotes its second argument in such a way that spaces, magic
- shell characters, etc. will be preserved during various stages of
- expansion done by the shell. If you don't want this, use
- AC_DEFINE_UNQUOTED instead.
-* Much textual processing done with external calls to tr and sed have been
- internalized with builtin m4 `patsubst' and `translit' calls.
-* AC_OUTPUT doesn't hardwire the filenames it outputs. Instead, you can
- set the shell variables `gen_files' and `gen_config' to the list of
- filenames to output.
-* AC_DECLARE_YYTEXT does an AC_SUBST of `LEX_OUTPUT_ROOT', which may be
- "lex.yy" or "lexyy", depending on the system.
-* AC_PROGRAMS_CHECK takes an optional third arg. If given, it is used as
- the default value.
-* If AC_ALLOCA chooses alloca.c, it also defines STACK_DIRECTION.
-* AC_CONST works much more reliably on more systems.
-* Many bug fixes.
-
-Major changes in release 1.3:
-
-configure no longer requires awk for packages that use a config.h.
-Support handling --with-PACKAGE options.
-New `autoheader' script to create `config.h.in' from `configure.in'.
-Ignore troublesome -lucb and -lPW when searching for alloca.
-Rename --exec_prefix to --exec-prefix for GNU standards conformance.
-Improve detection of STDC library.
-Add AC_HAVE_LIBRARY to check for non-default libraries.
-Function checking should work with future GNU libc releases.
-
-Major changes in release 1.2:
-
-The --srcdir option is now usually unnecessary.
-Add a file containing sample comments describing CPP macros.
-A comment in config.status tells which host it was configured on.
-Substituted variable values can now contain commas.
-Fix bugs in various feature checks.
-
-Major changes in release 1.1:
-
-Added AC_STRCOLL macro.
-Made AC_GETLOADAVG check for more things.
-AC_OUTPUT argument is now optional.
-Various bug fixes.
diff --git a/util/autoconf/README b/util/autoconf/README
deleted file mode 100644
index 959b195..0000000
--- a/util/autoconf/README
+++ /dev/null
@@ -1,38 +0,0 @@
-Autoconf
-
-Autoconf is an extensible package of m4 macros that produce shell
-scripts to automatically configure software source code packages.
-These scripts can adapt the packages to many kinds of UNIX-like
-systems without manual user intervention. Autoconf creates a
-configuration script for a package from a template file that lists the
-operating system features that the package can use, in the form of m4
-macro calls.
-
-Producing configuration scripts using Autoconf requires GNU m4. You
-must install GNU m4 (version 1.1 or later, preferably 1.3 or later
-for better performance) before configuring Autoconf, so that
-Autoconf's configure script can find it. The configuration scripts
-produced by Autoconf are self-contained, so their users do not need to
-have Autoconf (or GNU m4).
-
-Also, some optional utilities that come with Autoconf use Perl, TCL,
-and the TCL packages Expect and DejaGNU. However, none of those
-are required in order to use the main Autoconf program. If they are
-not present, the affected Autoconf utilities will not be installed.
-
-The file INSTALL can be distributed with packages that use
-Autoconf-generated configure scripts and Makefiles that conform to the
-GNU coding standards. The package's README can just give an overview
-of the package, where to report bugs, and a pointer to INSTALL for
-instructions on compilation and installation. This removes the need
-to maintain many similar sets of installation instructions.
-
-The file `acconfig.h' contains short descriptions of the C preprocessor
-variables that Autoconf can define, suitable for copying into other
-packages' configuration headers or Makefile.in files. You can use the
-program `autoheader' to automatically create a configuration header
-from a `configure.in', based on the information in `acconfig.h'.
-
-Mail suggestions and bug reports for Autoconf to
-bug-gnu-utils@prep.ai.mit.edu. Please include the Autoconf version
-number, which you can get by running "autoconf --version".
diff --git a/util/autoconf/TODO b/util/autoconf/TODO
deleted file mode 100644
index 89c3229..0000000
--- a/util/autoconf/TODO
+++ /dev/null
@@ -1,102 +0,0 @@
--*- outline -*-
-
-Things it might be nice to do someday:
-
-------------------------------------------------------------------------------
-
-* Make AC_CHECK_LIB check whether the function is already available
- before checking for the library. This might involve adding another
- kind of cache variable to indicate whether a given function needs a
- given library. The current ac_cv_func_ variables are intended to
- indicate whether the function is in the default libraries, but
- actually also take into account whatever value LIBS had when they
- were checked for.
-
-------------------------------------------------------------------------------
-
-* Add AC_PROG_CC_POSIX to replace the current ad-hoc macros for AIX,
- Minix, ISC, etc.
-
-------------------------------------------------------------------------------
-
-* Use AC_EGREP_CPP instead of AC_TRY_LINK to detect structures and members.
-
-------------------------------------------------------------------------------
-
-* Make AC_CHECK_FUNC[S] automatically use any particular macros for the
- listed functions.
-
-------------------------------------------------------------------------------
-
-* Support creating both config.h and DEFS in the same configure.
-
-------------------------------------------------------------------------------
-
-* Select the right CONFIG_SHELL automatically (for Ultrix, Lynx especially.)
-
-------------------------------------------------------------------------------
-
-* Doc: Add concept index.
-
-------------------------------------------------------------------------------
-
-* Doc: Centralize information on POSIX, MS-DOS, cross-compiling, and
- other important topics.
-
-------------------------------------------------------------------------------
-
-* Split up AC_SUBST substitutions using a loop to accomodate shells
- with severely limited here document sizes, if it turns out to be a problem.
- I'm not sure whether the limit is on lines or bytes; if bytes, it
- will be less of a problem than it was with the long lines used for
- creating a header file.
- There has also been a report that HPUX and OSF/1 seds only allow 100
- commands.
-
-------------------------------------------------------------------------------
-
-* Allow [ and ] in egrep patterns and AC_DEFINE args.
-
-------------------------------------------------------------------------------
-
-* Add a Makefile generator that supports the standard GNU targets.
- (Being worked on.)
-
-------------------------------------------------------------------------------
-
-* Mike Haertel's suggestions:
-
-** Provide files containing decls for alloca, strings, etc.
-
-** Cross compiling:
-
-*** Error messages include instructions for overriding defaults using
-config.site.
-
-*** Distribute a config.site corresponding to a hypothetical bare POSIX system with c89.
-
-*** Cache consistency checking: ignore cache if environment
-(CC or PATH) differs.
-
-** Site defaults:
-
-*** Convention for consistency checking of env vars and options in config.site so config.site can print obnoxious messages if it doesn't like options or env vars that users use.
-
-------------------------------------------------------------------------------
-
-* autoscan: Tell the files that caused inclusion of each macro,
-in a dnl comment. (Seems to be hard.)
-
-------------------------------------------------------------------------------
-
-* Look at user contributed macros: prototypes, IEEE double precision math,
-shared libraries, various other things.
-
-------------------------------------------------------------------------------
-
-* Test suite: more things to test:
-** That the shell scripts produce correct output on some simple data.
-** Configuration header files. That autoheader does the right thing,
- and so does AC_CONFIG_HEADER when autoconf is run.
-
-------------------------------------------------------------------------------
diff --git a/util/autoconf/acconfig.h b/util/autoconf/acconfig.h
deleted file mode 100644
index 801a8ac..0000000
--- a/util/autoconf/acconfig.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/* acconfig.h
- This file is in the public domain.
-
- Descriptive text for the C preprocessor macros that
- the distributed Autoconf macros can define.
- No software package will use all of them; autoheader copies the ones
- your configure.in uses into your configuration header file templates.
-
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). Although this order
- can split up related entries, it makes it easier to check whether
- a given entry is in the file.
-
- Leave the following blank line there!! Autoheader needs it. */
-
-
-/* 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 if using alloca.c. */
-#undef C_ALLOCA
-
-/* Define if type char is unsigned and you are not using gcc. */
-#undef __CHAR_UNSIGNED__
-
-/* Define if the closedir function returns void instead of int. */
-#undef CLOSEDIR_VOID
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
-
-/* Define for DGUX with <sys/dg_sys_info.h>. */
-#undef DGUX
-
-/* Define if you have <dirent.h>. */
-#undef DIRENT
-
-/* Define to the type of elements in the array set by `getgroups'.
- Usually this is either `int' or `gid_t'. */
-#undef GETGROUPS_T
-
-/* Define if the `getloadavg' function needs to be run setuid or setgid. */
-#undef GETLOADAVG_PRIVILEGED
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef gid_t
-
-/* Define if you have alloca, as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-#undef HAVE_ALLOCA_H
-
-/* Define if you don't have vprintf but do have _doprnt. */
-#undef HAVE_DOPRNT
-
-/* Define if your system has its own `getloadavg' function. */
-#undef HAVE_GETLOADAVG
-
-/* Define if you have the getmntent function. */
-#undef HAVE_GETMNTENT
-
-/* Define if the `long double' type works. */
-#undef HAVE_LONG_DOUBLE
-
-/* Define if you support file names longer than 14 characters. */
-#undef HAVE_LONG_FILE_NAMES
-
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if system calls automatically restart after interruption
- by a signal. */
-#undef HAVE_RESTARTABLE_SYSCALLS
-
-/* Define if your struct stat has st_blksize. */
-#undef HAVE_ST_BLKSIZE
-
-/* Define if your struct stat has st_blocks. */
-#undef HAVE_ST_BLOCKS
-
-/* Define if you have the strcoll function and it is properly defined. */
-#undef HAVE_STRCOLL
-
-/* Define if your struct stat has st_rdev. */
-#undef HAVE_ST_RDEV
-
-/* Define if you have the strftime function. */
-#undef HAVE_STRFTIME
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if your struct tm has tm_zone. */
-#undef HAVE_TM_ZONE
-
-/* Define if you don't have tm_zone but do have the external array
- tzname. */
-#undef HAVE_TZNAME
-
-/* Define if you have <unistd.h>. */
-#undef HAVE_UNISTD_H
-
-/* Define if utime(file, NULL) sets file's timestamp to the present. */
-#undef HAVE_UTIME_NULL
-
-/* Define if you have <vfork.h>. */
-#undef HAVE_VFORK_H
-
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
-
-/* Define if you have the wait3 system call. */
-#undef HAVE_WAIT3
-
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
-
-/* Define if int is 16 bits instead of 32. */
-#undef INT_16_BITS
-
-/* Define if long int is 64 bits. */
-#undef LONG_64_BITS
-
-/* Define if major, minor, and makedev are declared in <mkdev.h>. */
-#undef MAJOR_IN_MKDEV
-
-/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
-#undef MAJOR_IN_SYSMACROS
-
-/* Define if on MINIX. */
-#undef _MINIX
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef mode_t
-
-/* Define if you don't have <dirent.h>, but have <ndir.h>. */
-#undef NDIR
-
-/* Define if you have <memory.h>, and <string.h> doesn't declare the
- mem* functions. */
-#undef NEED_MEMORY_H
-
-/* Define if your struct nlist has an n_un member. */
-#undef NLIST_NAME_UNION
-
-/* Define if you have <nlist.h>. */
-#undef NLIST_STRUCT
-
-/* Define if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define to `int' if <sys/types.h> 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 if the setvbuf function takes the buffering type as its second
- argument and the buffer pointer as the third, as on System V
- before release 3. */
-#undef SETVBUF_REVERSED
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
-
-/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
-#undef STAT_MACROS_BROKEN
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define on System V Release 4. */
-#undef SVR4
-
-/* Define if you don't have <dirent.h>, but have <sys/dir.h>. */
-#undef SYSDIR
-
-/* Define if you don't have <dirent.h>, but have <sys/ndir.h>. */
-#undef SYSNDIR
-
-/* Define if `sys_siglist' is declared by <signal.h>. */
-#undef SYS_SIGLIST_DECLARED
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
-
-/* Define for Encore UMAX. */
-#undef UMAX
-
-/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
- instead of <sys/cpustats.h>. */
-#undef UMAX4_3
-
-/* Define if you do not have <strings.h>, index, bzero, etc.. */
-#undef USG
-
-/* Define vfork as fork if vfork does not work. */
-#undef vfork
-
-/* Define if the closedir function returns void instead of int. */
-#undef VOID_CLOSEDIR
-
-/* Define if your processor stores words with the most significant
- byte first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
-
-/* Define if lex declares yytext as a char * by default, not a char[]. */
-#undef YYTEXT_POINTER
-
-
-/* Leave that blank line there!! Autoheader needs it.
- If you're adding to this file, keep in mind:
- The entries are in sort -df order: alphabetical, case insensitive,
- ignoring punctuation (such as underscores). */
diff --git a/util/autoconf/acfunctions b/util/autoconf/acfunctions
deleted file mode 100644
index 5947ba6..0000000
--- a/util/autoconf/acfunctions
+++ /dev/null
@@ -1,58 +0,0 @@
-# Ones that have their own macros.
-major AC_HEADER_MAJOR
-minor AC_HEADER_MAJOR
-makedev AC_HEADER_MAJOR
-bcopy AC_HEADER_STDC
-bcmp AC_HEADER_STDC
-bzero AC_HEADER_STDC
-ioctl AC_PROG_GCC_TRADITIONAL
-memchr AC_HEADER_STDC
-memcpy AC_HEADER_STDC
-memcmp AC_FUNC_MEMCMP
-memmove AC_HEADER_STDC
-memset AC_HEADER_STDC
-index AC_HEADER_STDC
-rindex AC_HEADER_STDC
-getgroups AC_TYPE_GETGROUPS
-signal AC_TYPE_SIGNAL
-alloca AC_FUNC_ALLOCA
-getloadavg AC_FUNC_GETLOADAVG
-mmap AC_FUNC_MMAP
-setvbuf AC_FUNC_SETVBUF_REVERSED
-strcoll AC_FUNC_STRCOLL
-utime AC_FUNC_UTIME_NULL
-vfork AC_FUNC_VFORK
-vprintf AC_FUNC_VPRINTF
-vfprintf AC_FUNC_VPRINTF
-vsprintf AC_FUNC_VPRINTF
-wait3 AC_FUNC_WAIT3
-
-# Others.
-fnmatch AC_CHECK_FUNCS
-ftime AC_CHECK_FUNCS
-gethostname AC_CHECK_FUNCS
-gettimeofday AC_CHECK_FUNCS
-getusershell AC_CHECK_FUNCS
-getcwd AC_CHECK_FUNCS
-getwd AC_CHECK_FUNCS
-mkdir AC_CHECK_FUNCS
-mkfifo AC_CHECK_FUNCS
-mktime AC_CHECK_FUNCS
-putenv AC_CHECK_FUNCS
-re_comp AC_CHECK_FUNCS
-regcmp AC_CHECK_FUNCS
-regcomp AC_CHECK_FUNCS
-rmdir AC_CHECK_FUNCS
-select AC_CHECK_FUNCS
-socket AC_CHECK_FUNCS
-stime AC_CHECK_FUNCS
-strcspn AC_CHECK_FUNCS
-strdup AC_CHECK_FUNCS
-strerror AC_CHECK_FUNCS
-strftime AC_CHECK_FUNCS
-strspn AC_CHECK_FUNCS
-strstr AC_CHECK_FUNCS
-strtod AC_CHECK_FUNCS
-strtol AC_CHECK_FUNCS
-strtoul AC_CHECK_FUNCS
-uname AC_CHECK_FUNCS
diff --git a/util/autoconf/acgeneral.m4 b/util/autoconf/acgeneral.m4
deleted file mode 100644
index b7e6bc3..0000000
--- a/util/autoconf/acgeneral.m4
+++ /dev/null
@@ -1,2021 +0,0 @@
-dnl Parameterized macros.
-dnl Requires GNU m4.
-dnl This file is part of Autoconf.
-dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2, or (at your option)
-dnl any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-dnl
-dnl As a special exception, the Free Software Foundation gives unlimited
-dnl permission to copy, distribute and modify the configure scripts that
-dnl are the output of Autoconf. You need not follow the terms of the GNU
-dnl General Public License when using or distributing such scripts, even
-dnl though portions of the text of Autoconf appear in them. The GNU
-dnl General Public License (GPL) does govern all other use of the material
-dnl that constitutes the Autoconf program.
-dnl
-dnl Certain portions of the Autoconf source text are designed to be copied
-dnl (in certain cases, depending on the input) into the output of
-dnl Autoconf. We call these the "data" portions. The rest of the Autoconf
-dnl source text consists of comments plus executable code that decides which
-dnl of the data portions to output in any given case. We call these
-dnl comments and executable code the "non-data" portions. Autoconf never
-dnl copies any of the non-data portions into its output.
-dnl
-dnl This special exception to the GPL applies to versions of Autoconf
-dnl released by the Free Software Foundation. When you make and
-dnl distribute a modified version of Autoconf, you may extend this special
-dnl exception to the GPL to apply to your modified version as well, *unless*
-dnl your modified version has the potential to copy into its output some
-dnl of the text that was the non-data portion of the version that you started
-dnl with. (In other words, unless your change moves or copies text from
-dnl the non-data portions to the data portions.) If your modification has
-dnl such potential, you must delete any notice of this special exception
-dnl to the GPL from your modified version.
-dnl
-dnl Written by David MacKenzie, with help from
-dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
-dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
-dnl
-divert(-1)dnl Throw away output until AC_INIT is called.
-changequote([, ])
-
-define(AC_ACVERSION, 2.1)
-
-dnl Some old m4's don't support m4exit. But they provide
-dnl equivalent functionality by core dumping because of the
-dnl long macros we define.
-ifdef([__gnu__], , [errprint(Autoconf requires GNU m4.
-Install it before installing Autoconf or set the
-M4 environment variable to its path name.
-)m4exit(2)])
-
-undefine([eval])
-undefine([include])
-undefine([shift])
-undefine([format])
-
-
-dnl ### Defining macros
-
-
-dnl m4 output diversions. We let m4 output them all in order at the end,
-dnl except that we explicitly undivert AC_DIVERSION_SED.
-
-dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #!/bin/sh line
-define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings
-define(AC_DIVERSION_INIT, 2)dnl initialization code
-define(AC_DIVERSION_SED, 3)dnl variable substitutions in config.status
-define(AC_DIVERSION_NORMAL_4, 4)dnl AC_REQUIRE'd code, 4 level deep
-define(AC_DIVERSION_NORMAL_3, 5)dnl AC_REQUIRE'd code, 3 level deep
-define(AC_DIVERSION_NORMAL_2, 6)dnl AC_REQUIRE'd code, 2 level deep
-define(AC_DIVERSION_NORMAL_1, 7)dnl AC_REQUIRE'd code, 1 level deep
-define(AC_DIVERSION_NORMAL, 8)dnl the tests and output code
-
-dnl Change the diversion stream to STREAM, while stacking old values.
-dnl AC_DIVERT_PUSH(STREAM)
-define(AC_DIVERT_PUSH,
-[pushdef([AC_DIVERSION_CURRENT], $1)dnl
-divert(AC_DIVERSION_CURRENT)dnl
-])
-
-dnl Change the diversion stream to its previous value, unstacking it.
-dnl AC_DIVERT_POP()
-define(AC_DIVERT_POP,
-[popdef([AC_DIVERSION_CURRENT])dnl
-divert(AC_DIVERSION_CURRENT)dnl
-])
-
-dnl Initialize the diversion setup.
-define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL)
-dnl This will be popped by AC_REQUIRE in AC_INIT.
-pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE)
-
-dnl The prologue for Autoconf macros.
-dnl AC_PRO(MACRO-NAME)
-define(AC_PRO,
-[define([AC_PROVIDE_$1], )dnl
-ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
-[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))],
-[pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl
-])
-
-dnl The Epilogue for Autoconf macros.
-dnl AC_EPI()
-define(AC_EPI,
-[AC_DIVERT_POP()dnl
-ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
-[undivert(AC_DIVERSION_NORMAL_4)dnl
-undivert(AC_DIVERSION_NORMAL_3)dnl
-undivert(AC_DIVERSION_NORMAL_2)dnl
-undivert(AC_DIVERSION_NORMAL_1)dnl
-])dnl
-])
-
-dnl Define a macro which automatically provides itself. Add machinery
-dnl so the macro automatically switches expansion to the diversion
-dnl stack if it is not already using it. In this case, once finished,
-dnl it will bring back all the code accumulated in the diversion stack.
-dnl This, combined with AC_REQUIRE, achieves the topological ordering of
-dnl macros. We don't use this macro to define some frequently called
-dnl macros that are not involved in ordering constraints, to save m4
-dnl processing.
-dnl AC_DEFUN(NAME, EXPANSION)
-define([AC_DEFUN],
-[define($1, [AC_PRO([$1])$2[]AC_EPI()])])
-
-
-dnl ### Initialization
-
-
-dnl AC_INIT_NOTICE()
-AC_DEFUN(AC_INIT_NOTICE,
-[# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version] AC_ACVERSION [
-# Copyright (C) 1992, 1993, 1994 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:])
-
-dnl AC_PREFIX_DEFAULT(PREFIX)
-AC_DEFUN(AC_PREFIX_DEFAULT,
-[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-ac_default_prefix=$1
-AC_DIVERT_POP()])
-
-dnl AC_INIT_PARSE_ARGS()
-AC_DEFUN(AC_INIT_PARSE_ARGS,
-[
-# 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
-
-# Initialize some other variables.
-subdirs=
-
-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
-changequote(, )dnl
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-changequote([, ])dnl
- *) ac_optarg= ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case "$ac_option" in
-
- -build | --build | --buil | --bui | --bu | --b)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
- 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" ;;
-
- -disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
- # Reject names that are not valid shell variable names.
-changequote(, )dnl
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
-changequote([, ])dnl
- AC_MSG_ERROR($ac_feature: invalid feature name)
- 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.
-changequote(, )dnl
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
-changequote([, ])dnl
- AC_MSG_ERROR($ac_feature: invalid feature name)
- 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
-changequote(, )dnl
-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=PREFIX install architecture-dependent files in PREFIX
- [same as prefix]
- --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
-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
---enable and --with options recognized:$ac_help
-changequote([, ])dnl
-EOF
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$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 ;;
-
- -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 ;;
-
- -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" ;;
-
- -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 AC_ACVERSION"
- exit 0 ;;
-
- -with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
- # Reject names that are not valid shell variable names.
-changequote(, )dnl
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
-changequote([, ])dnl
- AC_MSG_ERROR($ac_package: invalid package name)
- 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.
-changequote(, )dnl
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
-changequote([, ])dnl
- AC_MSG_ERROR($ac_package: invalid package name)
- 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" ;;
-
- -*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage])
- ;;
-
- *)
-changequote(, )dnl
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
-changequote([, ])dnl
- AC_MSG_WARN($ac_option: invalid host type)
- fi
- if test "x$nonopt" != xNONE; then
- AC_MSG_ERROR(can only configure for one host and one target at a time)
- fi
- nonopt="$ac_option"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`)
-fi
-])
-
-dnl Try to have only one #! line, so the script doesn't look funny
-dnl for users of AC_REVISION.
-dnl AC_INIT_BINSH()
-AC_DEFUN(AC_INIT_BINSH,
-[#!/bin/sh
-])
-
-dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
-AC_DEFUN(AC_INIT,
-[sinclude(acsite.m4)dnl
-sinclude(./aclocal.m4)dnl
-AC_REQUIRE([AC_INIT_BINSH])dnl
-AC_INIT_NOTICE
-AC_DIVERT_POP()dnl to NORMAL
-AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl
-AC_INIT_PARSE_ARGS
-AC_INIT_PREPARE($1)dnl
-AC_DIVERT_POP()dnl to NORMAL
-])
-
-dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
-AC_DEFUN(AC_INIT_PREPARE,
-[trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 unused; standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 unused; some systems may open it to /dev/tty
-define(AC_FD_MSG, 4)dnl
-[#] AC_FD_MSG checking for... messages and results
-define(AC_FD_CC, 5)dnl
-[#] AC_FD_CC compiler messages saved in config.log
-if test "$silent" = yes; then
- exec AC_FD_MSG>/dev/null
-else
- exec AC_FD_MSG>&1
-fi
-exec AC_FD_CC>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&AC_FD_CC
-
-# 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) ;;
-changequote(<<, >>)dnl
-dnl If you change this globbing pattern, test it on an old shell --
-dnl it's sensitive. Putting any kind of quote in it causes syntax errors.
- *" "*|*" "*|*[\[\]\~\<<#>>\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
-changequote([, ])dnl
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
- esac
-done
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; 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=$1
-
-# 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
-changequote(, )dnl
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
-changequote([, ])dnl
- 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
- AC_MSG_ERROR(can not find sources in $ac_confdir or ..)
- else
- AC_MSG_ERROR(can not find sources in $srcdir)
- fi
-fi
-dnl Double slashes in pathnames in object file debugging info
-dnl mess up M-x gdb in Emacs.
-changequote(, )dnl
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
-changequote([, ])dnl
-
-dnl Let the site file select an alternate cache file if it wants to.
-AC_SITE_LOAD
-AC_CACHE_LOAD
-AC_LANG_C
-AC_PROG_ECHO_N
-dnl Substitute for predefined variables.
-AC_SUBST(CFLAGS)dnl
-AC_SUBST(CPPFLAGS)dnl
-AC_SUBST(CXXFLAGS)dnl
-AC_SUBST(DEFS)dnl
-AC_SUBST(LDFLAGS)dnl
-AC_SUBST(LIBS)dnl
-AC_SUBST(exec_prefix)dnl
-AC_SUBST(prefix)dnl
-AC_SUBST(program_transform_name)dnl
-])
-
-
-dnl ### Selecting optional features
-
-
-dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_ARG_ENABLE,
-[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-ac_help="$ac_help
-[$2]"
-AC_DIVERT_POP()dnl
-[#] Check whether --enable-$1 or --disable-$1 was given.
-enableval="[$enable_]patsubst($1, -, _)"
-if test -n "$enableval"; then
- ifelse([$3], , :, [$3])
-ifelse([$4], , , [else
- $4
-])dnl
-fi
-])
-
-AC_DEFUN(AC_ENABLE,
-[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl
-AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])dnl
-])
-
-
-dnl ### Working with optional software
-
-
-dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_ARG_WITH,
-[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
-ac_help="$ac_help
-[$2]"
-AC_DIVERT_POP()dnl
-[#] Check whether --with-$1 or --without-$1 was given.
-withval="[$with_]patsubst($1, -, _)"
-if test -n "$withval"; then
- ifelse([$3], , :, [$3])
-ifelse([$4], , , [else
- $4
-])dnl
-fi
-])
-
-AC_DEFUN(AC_WITH,
-[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl
-AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl
-])
-
-
-dnl ### Transforming program names.
-
-
-dnl AC_ARG_PROGRAM()
-AC_DEFUN(AC_ARG_PROGRAM,
-[if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $.
- echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
-fi
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-])
-
-
-dnl ### Version numbers
-
-
-dnl AC_REVISION(REVISION-INFO)
-AC_DEFUN(AC_REVISION,
-[AC_REQUIRE([AC_INIT_BINSH])dnl
-[# From configure.in] translit([$1], $")])
-
-dnl Subroutines of AC_PREREQ.
-
-dnl Change the dots in NUMBER into commas.
-dnl AC_PREREQ_SPLIT(NUMBER)
-define(AC_PREREQ_SPLIT,
-[translit($1, ., [, ])])
-
-dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
-dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY])
-define(AC_PREREQ_CANON,
-[$1, $2, ifelse([$3], , 0, [$3])])
-
-dnl Complain and exit if version number 1 is less than version number 2.
-dnl PRINTABLE2 is the printable version of version number 2.
-dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2,
-dnl PRINTABLE2)
-define(AC_PREREQ_COMPARE,
-[ifelse(builtin([eval],
-[$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1,
-[errprint(Autoconf version $7 or higher is required for this script
-)m4exit(3)])])
-
-dnl Complain and exit if the Autoconf version is less than VERSION.
-dnl AC_PREREQ(VERSION)
-define(AC_PREREQ,
-[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
-AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])
-
-
-dnl ### Getting the canonical system type
-
-
-dnl Find install-sh, config.sub, config.guess, and Cygnus configure
-dnl in directory DIR. These are auxiliary files used in configuration.
-dnl DIR can be either absolute or relative to $srcdir.
-dnl AC_CONFIG_AUX_DIR(DIR)
-AC_DEFUN(AC_CONFIG_AUX_DIR,
-[AC_CONFIG_AUX_DIRS($1 $srcdir/$1)])
-
-dnl The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.
-dnl There's no need to call this macro explicitly; just AC_REQUIRE it.
-AC_DEFUN(AC_CONFIG_AUX_DIR_DEFAULT,
-[AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)])
-
-dnl Internal subroutine.
-dnl Search for the configuration auxiliary files in directory list $1.
-dnl We look only for install-sh, so users of AC_PROG_INSTALL
-dnl do not automatically need to distribute the other auxiliary files.
-dnl AC_CONFIG_AUX_DIRS(DIR ...)
-AC_DEFUN(AC_CONFIG_AUX_DIRS,
-[ac_aux_dir=
-for ac_dir in $1; 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
- AC_MSG_ERROR([can not find install-sh or install.sh in $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.
-AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-])
-
-dnl Canonicalize the host, target, and build system types.
-AC_DEFUN(AC_CANONICAL_SYSTEM,
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [AC_ARG_PROGRAM])
-# Do some error checking and defaulting for the host and target type.
-# The inputs are:
-# configure --host=HOST --target=TARGET --build=BUILD NONOPT
-#
-# The rules are:
-# 1. You are not allowed to specify --host, --target, and nonopt at the
-# same time.
-# 2. Host defaults to nonopt.
-# 3. If nonopt is not specified, then host defaults to the current host,
-# as determined by config.guess.
-# 4. Target and build default to nonopt.
-# 5. If nonopt is not specified, then target and build default to host.
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-case $host---$target---$nonopt in
-NONE---*---* | *---NONE---* | *---*---NONE) ;;
-*) AC_MSG_ERROR(can only configure for one host and one target at a time) ;;
-esac
-
-AC_CANONICAL_HOST
-AC_CANONICAL_TARGET
-AC_CANONICAL_BUILD
-test "$host_alias" != "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, && program_prefix=${target_alias}-
-])
-
-dnl Subroutines of AC_CANONICAL_SYSTEM.
-
-AC_DEFUN(AC_CANONICAL_HOST,
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-
-# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
-else AC_MSG_ERROR(can not run $ac_config_sub)
-fi
-
-AC_MSG_CHECKING(host system type)
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`$ac_config_guess`; then :
- else AC_MSG_ERROR(can not guess host type; you must specify one)
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`$ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
-AC_MSG_RESULT($host)
-AC_SUBST(host)dnl
-AC_SUBST(host_alias)dnl
-AC_SUBST(host_cpu)dnl
-AC_SUBST(host_vendor)dnl
-AC_SUBST(host_os)dnl
-])
-
-dnl Internal use only.
-AC_DEFUN(AC_CANONICAL_TARGET,
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_MSG_CHECKING(target system type)
-
-target_alias=$target
-case "$target_alias" in
-NONE)
- case $nonopt in
- NONE) target_alias=$host_alias ;;
- *) target_alias=$nonopt ;;
- esac ;;
-esac
-
-target=`$ac_config_sub $target_alias`
-target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
-AC_MSG_RESULT($target)
-AC_SUBST(target)dnl
-AC_SUBST(target_alias)dnl
-AC_SUBST(target_cpu)dnl
-AC_SUBST(target_vendor)dnl
-AC_SUBST(target_os)dnl
-])
-
-dnl Internal use only.
-AC_DEFUN(AC_CANONICAL_BUILD,
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_MSG_CHECKING(build system type)
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`$ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
-AC_MSG_RESULT($build)
-AC_SUBST(build)dnl
-AC_SUBST(build_alias)dnl
-AC_SUBST(build_cpu)dnl
-AC_SUBST(build_vendor)dnl
-AC_SUBST(build_os)dnl
-])
-
-
-dnl ### Caching test results
-
-
-dnl Look for site or system specific initialization scripts.
-dnl AC_SITE_LOAD()
-define(AC_SITE_LOAD,
-[# 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
-])
-
-dnl AC_CACHE_LOAD()
-define(AC_CACHE_LOAD,
-[if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
-else
- echo "creating cache $cache_file"
- > $cache_file
-fi
-])
-
-dnl AC_CACHE_SAVE()
-define(AC_CACHE_SAVE,
-[if test -w $cache_file; then
-echo "updating cache $cache_file"
-cat > $cache_file <<\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
-changequote(, )dnl
-dnl Allow a site initialization script to override cache values.
-# Ultrix sh set writes to stderr and can't be redirected directly.
-# Ultrix sh set also returns variables that were read in from the config file
-# with their high bit set.
-(set) 2>&1 | tr '\201-\377' '\001-\177' |
- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
- >> $cache_file
-changequote([, ])dnl
-else
-echo "not updating unwritable cache $cache_file"
-fi
-])
-
-dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
-dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
-define(AC_CACHE_VAL,
-[dnl We used to use the below line, but it fails if the 1st arg is a
-dnl shell variable, so we need the eval.
-dnl if test "${$1+set}" = set; then
-if eval "test \"`echo '${'$1'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG
-else
- $2
-fi
-])
-
-
-dnl ### Defining symbols
-
-
-dnl Set VARIABLE to VALUE, verbatim, or 1.
-dnl AC_DEFINE(VARIABLE [, VALUE])
-define(AC_DEFINE,
-[cat >> confdefs.h <<\EOF
-[#define] $1 ifelse($#, 2, [$2], 1)
-EOF
-])
-
-dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
-dnl The 'tr' is to fix more Ultrix sh brain damage
-define(AC_DEFINE_UNQUOTED,
-[cat <<EOF | tr '\201-\377' '\001-\177' >> confdefs.h
-[#define] $1 ifelse($#, 2, [$2], 1)
-EOF
-])
-
-
-dnl ### Setting output variables
-
-
-dnl This macro protects VARIABLE from being diverted twice
-dnl if this macro is called twice for it.
-dnl AC_SUBST(VARIABLE)
-define(AC_SUBST,
-[ifdef([AC_SUBST_$1], ,
-[define([AC_SUBST_$1], )dnl
-AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
-s%@$1@%[$]$1%g
-AC_DIVERT_POP()dnl
-])])
-
-dnl AC_SUBST_FILE(VARIABLE)
-define(AC_SUBST_FILE,
-[ifdef([AC_SUBST_$1], ,
-[define([AC_SUBST_$1], )dnl
-AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
-/@$1@/r [$]$1
-s%@$1@%%g
-AC_DIVERT_POP()dnl
-])])
-
-
-dnl ### Printing messages
-
-
-dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION)
-define(AC_MSG_CHECKING,
-[echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG])
-
-dnl AC_CHECKING(FEATURE-DESCRIPTION)
-define(AC_CHECKING,
-[echo "checking $1" 1>&AC_FD_MSG])
-
-dnl AC_MSG_RESULT(RESULT-DESCRIPTION)
-define(AC_MSG_RESULT,
-[echo "$ac_t""$1" 1>&AC_FD_MSG])
-
-dnl AC_VERBOSE(RESULT-DESCRIPTION)
-define(AC_VERBOSE,
-[AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
-echo " $1" 1>&AC_FD_MSG])
-
-dnl AC_MSG_WARN(PROBLEM-DESCRIPTION)
-define(AC_MSG_WARN,
-[echo "configure: warning: $1" 1>&2])
-
-dnl AC_MSG_ERROR(ERROR-DESCRIPTION)
-define(AC_MSG_ERROR,
-[{ echo "configure: error: $1" 1>&2; exit 1; }])
-
-
-dnl ### Selecting which language to use for testing
-
-
-dnl AC_LANG_C()
-AC_DEFUN(AC_LANG_C,
-[define([AC_LANG], [C])dnl
-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} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&AC_FD_CC 2>&AC_FD_CC'
-ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
-])
-
-dnl AC_LANG_CPLUSPLUS()
-AC_DEFUN(AC_LANG_CPLUSPLUS,
-[define([AC_LANG], [CPLUSPLUS])dnl
-ac_ext=C
-# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='${CXX-g++} $CXXFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&AC_FD_CC 2>&AC_FD_CC'
-ac_link='${CXX-g++} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
-])
-
-dnl Push the current language on a stack.
-dnl AC_LANG_SAVE()
-define(AC_LANG_SAVE,
-[pushdef([AC_LANG_STACK], AC_LANG)])
-
-dnl Restore the current language from the stack.
-dnl AC_LANG_RESTORE()
-define(AC_LANG_RESTORE,
-[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])
-
-
-dnl ### Dependencies between macros
-
-
-dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
-define(AC_BEFORE,
-[ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1
-])])])
-
-dnl AC_REQUIRE(MACRO-NAME)
-define(AC_REQUIRE,
-[ifdef([AC_PROVIDE_$1], ,
-[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
-indir([$1])
-AC_DIVERT_POP()dnl
-])])
-
-dnl AC_PROVIDE(MACRO-NAME)
-define(AC_PROVIDE,
-[define([AC_PROVIDE_$1], )])
-
-dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION])
-define(AC_OBSOLETE,
-[errprint(__file__:__line__: warning: [$1] is obsolete[$2]
-)])
-
-
-dnl ### Checking for programs
-
-
-dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
-dnl [, VALUE-IF-NOT-FOUND])
-AC_DEFUN(AC_CHECK_PROG,
-[# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_prog_$1,
-[if test -n "[$]$1"; then
- ac_cv_prog_$1="[$]$1" # 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_$1="$3"
- break
- fi
- done
- IFS="$ac_save_ifs"
-dnl If no 4th arg is given, leave the cache variable unset,
-dnl so AC_CHECK_PROGS will keep looking.
-ifelse([$4], , , [ test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4"
-])dnl
-fi])dnl
-$1="$ac_cv_prog_$1"
-if test -n "[$]$1"; then
- AC_MSG_RESULT([$]$1)
-else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
-])
-
-dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-AC_DEFUN(AC_PATH_PROG,
-[# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
-[case "[$]$1" in
- /*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
- ;;
- *)
- 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_path_$1="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
-dnl If no 3rd arg is given, leave the cache variable unset,
-dnl so AC_PATH_PROGS will keep looking.
-ifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3"
-])dnl
- ;;
-esac])dnl
-$1="$ac_cv_path_$1"
-if test -n "[$]$1"; then
- AC_MSG_RESULT([$]$1)
-else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
-])
-
-dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-AC_DEFUN(AC_CHECK_PROGS,
-[for ac_prog in $2
-do
-AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, )
-test -n "[$]$1" && break
-done
-ifelse([$3], , , [test -n "[$]$1" || $1="$3"
-])])
-
-dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
-AC_DEFUN(AC_PATH_PROGS,
-[for ac_prog in $2
-do
-AC_PATH_PROG($1, [$]ac_prog)
-test -n "[$]$1" && break
-done
-ifelse([$3], , , [test -n "[$]$1" || $1="$3"
-])])
-
-dnl Guess the value for the `prefix' variable by looking for
-dnl the argument program along PATH and taking its parent.
-dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
-dnl set `prefix' to /usr/local/gnu.
-dnl This comes too late to find a site file based on the prefix,
-dnl and it might use a cached value for the path.
-dnl No big loss, I think, since most configures don't use this macro anyway.
-dnl AC_PREFIX_PROGRAM(PROGRAM)
-AC_DEFUN(AC_PREFIX_PROGRAM,
-[if test "x$prefix" = xNONE; then
-changequote(<<, >>)dnl
-define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
-changequote([, ])dnl
-AC_PATH_PROG(AC_VAR_NAME, $1)
-changequote(<<, >>)dnl
- if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
- prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*/[^/][^/]*$%%'`
-changequote([, ])dnl
- fi
-fi
-undefine([AC_VAR_NAME])dnl
-])
-
-
-dnl ### Checking for libraries
-
-
-dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl [, OTHER-LIBRARIES]]])
-AC_DEFUN(AC_CHECK_LIB,
-[AC_MSG_CHECKING([for -l$1])
-AC_CACHE_VAL(ac_cv_lib_$1,
-[ac_save_LIBS="$LIBS"
-LIBS="$LIBS -l$1 $5"
-AC_TRY_LINK(, [$2()], eval "ac_cv_lib_$1=yes", eval "ac_cv_lib_$1=no")dnl
-LIBS="$ac_save_LIBS"
-])dnl
-if eval "test \"`echo '$ac_cv_lib_'$1`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$3], ,
-[changequote(, )dnl
- ac_tr_lib=HAVE_LIB`echo $1 | tr '[a-z]' '[A-Z]'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_lib)
- LIBS="$LIBS -l$1"
-], [$3])
-else
- AC_MSG_RESULT(no)
-ifelse([$4], , , [$4
-])dnl
-fi
-])
-
-dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl [, OTHER-LIBRARIES]]])
-AC_DEFUN(AC_HAVE_LIBRARY,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl
-changequote(<<, >>)dnl
-define(<<AC_LIB_NAME>>, dnl
-patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
-define(<<AC_CV_NAME>>, ac_cv_lib_<<>>AC_LIB_NAME)dnl
-changequote([, ])dnl
-AC_MSG_CHECKING([for -l[]AC_LIB_NAME])
-AC_CACHE_VAL(AC_CV_NAME,
-[ac_save_LIBS="$LIBS"
-LIBS="$LIBS -l[]AC_LIB_NAME[] $4"
-AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no)dnl
-LIBS="$ac_save_LIBS"
-])dnl
-AC_MSG_RESULT($AC_CV_NAME)
-if test "$AC_CV_NAME" = yes; then
- ifelse([$2], ,
-[AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z]))
- LIBS="$LIBS -l[]AC_LIB_NAME[]"
-], [$2])
-ifelse([$3], , , [else
- $3
-])dnl
-fi
-undefine([AC_LIB_NAME])dnl
-undefine([AC_CV_NAME])dnl
-])
-
-
-dnl ### Examining declarations
-
-
-dnl AC_TRY_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_TRY_CPP,
-[AC_REQUIRE_CPP()dnl
-cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-#include "confdefs.h"
-[$1]
-EOF
-dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp.
-dnl We used to copy stderr to stdout and capture it in a variable, but
-dnl that breaks under sh -x, which writes compile commands starting
-dnl with ` +' to stderr in eval and subshells.
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- ifelse([$2], , :, [rm -rf conftest*
- $2])
-else
- echo "$ac_err" >&AC_FD_CC
-ifelse([$3], , , [ rm -rf conftest*
- $3
-])dnl
-fi
-rm -f conftest*])
-
-dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
-dnl ACTION-IF-NOT-FOUND])
-AC_DEFUN(AC_EGREP_HEADER,
-[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])
-
-dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
-dnl come early, it is not included in AC_BEFORE checks.
-dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [,
-dnl ACTION-IF-NOT-FOUND])
-AC_DEFUN(AC_EGREP_CPP,
-[AC_REQUIRE_CPP()dnl
-cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-#include "confdefs.h"
-[$2]
-EOF
-dnl eval is necessary to expand ac_cpp.
-dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
-if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
- egrep "$1" >/dev/null 2>&1; then
- ifelse([$3], , :, [rm -rf conftest*
- $3])
-ifelse([$4], , , [else
- rm -rf conftest*
- $4
-])dnl
-fi
-rm -f conftest*
-])
-
-
-dnl ### Examining syntax
-
-
-dnl AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
-dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-AC_DEFUN(AC_TRY_COMPILE,
-[cat > conftest.$ac_ext <<EOF
-dnl This sometimes fails to find confdefs.h, for some reason.
-dnl [#]line __oline__ "[$]0"
-[#]line __oline__ "configure"
-#include "confdefs.h"
-[$1]
-int main() { return 0; }
-int t() {
-[$2]
-; return 0; }
-EOF
-if eval $ac_compile; then
- ifelse([$3], , :, [rm -rf conftest*
- $3])
-ifelse([$4], , , [else
- rm -rf conftest*
- $4
-])dnl
-fi
-rm -f conftest*]
-)
-
-
-dnl ### Examining libraries
-
-
-dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
-dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-AC_DEFUN(AC_COMPILE_CHECK,
-[AC_OBSOLETE([$0], [; instead use AC_TRY_COMPILE or AC_TRY_LINK, and AC_MSG_CHECKING and AC_MSG_RESULT])dnl
-ifelse([$1], , , [AC_CHECKING([for $1])
-])dnl
-AC_TRY_LINK([$2], [$3], [$4], [$5])dnl
-])
-
-dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
-dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-AC_DEFUN(AC_TRY_LINK,
-[cat > conftest.$ac_ext <<EOF
-dnl This sometimes fails to find confdefs.h, for some reason.
-dnl [#]line __oline__ "[$]0"
-[#]line __oline__ "configure"
-#include "confdefs.h"
-[$1]
-int main() { return 0; }
-int t() {
-[$2]
-; return 0; }
-EOF
-if eval $ac_link; then
- ifelse([$3], , :, [rm -rf conftest*
- $3])
-ifelse([$4], , , [else
- rm -rf conftest*
- $4
-])dnl
-fi
-rm -f conftest*]
-)
-
-
-dnl ### Checking for run-time features
-
-
-dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
-dnl [, ACTION-IF-CROSS-COMPILING]])
-AC_DEFUN(AC_TRY_RUN,
-[AC_REQUIRE([AC_C_CROSS])dnl
-if test "$cross_compiling" = yes; then
- ifelse([$4], ,
- [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling
-)dnl
- AC_MSG_ERROR(can not run test program while cross compiling)],
- [$4])
-else
-cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-#include "confdefs.h"
-ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
-extern "C" void exit(int);
-#endif
-])dnl
-[$1]
-EOF
-eval $ac_link
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
- ifelse([$2], , :, [$2])
-ifelse([$3], , , [else
- $3
-])dnl
-fi
-fi
-rm -fr conftest*])
-
-
-dnl ### Checking for header files
-
-
-dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-AC_DEFUN(AC_CHECK_HEADER,
-[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
-ac_safe=`echo "$1" | tr './\055' '___'`
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_header_$ac_safe,
-[AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
- eval "ac_cv_header_$ac_safe=no")])dnl
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
-else
- AC_MSG_RESULT(no)
-ifelse([$3], , , [$3
-])dnl
-fi
-])
-
-dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-AC_DEFUN(AC_CHECK_HEADERS,
-[for ac_hdr in $1
-do
-AC_CHECK_HEADER($ac_hdr,
-[changequote(, )dnl
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl
-done
-])
-
-
-dnl ### Checking for library functions
-
-
-dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
-AC_DEFUN(AC_CHECK_FUNC,
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_func_$1,
-[AC_TRY_LINK(
-[#include <ctype.h> /* Arbitrary system header to define __stub macros. */
-/* Override any gcc2 internal prototype to avoid an error. */
-]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
-extern "C"
-#endif
-])dnl
-[char $1();
-], [
-/* 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_$1) || defined (__stub___$1)
-choke me
-#else
-$1();
-#endif
-], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])dnl
-if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
-else
- AC_MSG_RESULT(no)
-ifelse([$3], , , [$3
-])dnl
-fi
-])
-
-dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-AC_DEFUN(AC_CHECK_FUNCS,
-[for ac_func in $1
-do
-AC_CHECK_FUNC($ac_func,
-[changequote(, )dnl
- ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
-done
-])
-
-dnl AC_REPLACE_FUNCS(FUNCTION-NAME...)
-AC_DEFUN(AC_REPLACE_FUNCS,
-[for ac_func in $1
-do
-AC_CHECK_FUNC($ac_func, , [LIBOBJS="$LIBOBJS ${ac_func}.o"])
-done
-AC_SUBST(LIBOBJS)dnl
-])
-
-
-dnl ### Checking compiler characteristics
-
-
-dnl AC_CHECK_SIZEOF(TYPE)
-AC_DEFUN(AC_CHECK_SIZEOF,
-[changequote(<<, >>)dnl
-dnl The name to #define.
-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
-dnl The cache variable name.
-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
-changequote([, ])dnl
-AC_MSG_CHECKING(size of $1)
-AC_CACHE_VAL(AC_CV_NAME,
-[AC_TRY_RUN([#include <stdio.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof($1));
- exit(0);
-}], AC_CV_NAME=`cat conftestval`)])dnl
-AC_MSG_RESULT($AC_CV_NAME)
-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
-undefine([AC_TYPE_NAME])dnl
-undefine([AC_CV_NAME])dnl
-])
-
-
-dnl ### Checking for typedefs
-
-
-dnl AC_CHECK_TYPE(TYPE, DEFAULT)
-AC_DEFUN(AC_CHECK_TYPE,
-[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL(ac_cv_type_$1,
-[AC_EGREP_CPP($1, [#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
-AC_MSG_RESULT($ac_cv_type_$1)
-if test $ac_cv_type_$1 = no; then
- AC_DEFINE($1, $2)
-fi
-])
-
-
-dnl ### Creating output files
-
-
-dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
-AC_DEFUN(AC_CONFIG_HEADER,
-[define(AC_LIST_HEADER, $1)])
-
-dnl Link each of the existing files SOURCE... to the corresponding
-dnl link name in DEST...
-dnl AC_LINK_FILES(SOURCE..., DEST...)
-AC_DEFUN(AC_LINK_FILES,
-[define([AC_LIST_FILES], [$1])define([AC_LIST_LINKS], [$2])])
-
-dnl AC_CONFIG_SUBDIRS(DIR ...)
-AC_DEFUN(AC_CONFIG_SUBDIRS,
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-define([AC_LIST_SUBDIRS], [$1])dnl
-subdirs="AC_LIST_SUBDIRS"
-AC_SUBST(subdirs)dnl
-])
-
-dnl The big finish.
-dnl Produce config.status, config.h, and links, and configure subdirs.
-dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS])
-define(AC_OUTPUT,
-[trap '' 1 2 15
-AC_CACHE_SAVE
-trap 'rm -fr conftest* confdefs* 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
-changequote(, )dnl
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
-changequote([, ])dnl
-fi
-
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
-ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
-
-# 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 <<EOF
-#!/bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-dnl so uname gets run too.
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-[#] [$]0 [$]ac_configure_args
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-changequote(, )dnl
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-changequote([, ])dnl
-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 AC_ACVERSION"
- 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
-ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
-])dnl
-
-ifdef([AC_LIST_HEADER],
-[trap 'rm -fr $1 AC_LIST_HEADER conftest*; exit 1' 1 2 15],
-[trap 'rm -f $1; exit 1' 1 2 15])
-
-AC_OUTPUT_FILES($1)
-ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
-ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl
-ifelse([$3], , ,
-[EOF
-cat >> $CONFIG_STATUS <<EOF
-$3
-EOF
-cat >> $CONFIG_STATUS <<\EOF])
-$2
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
-dnl config.status should not do recursion.
-ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
-])dnl
-
-dnl This is a subroutine of AC_OUTPUT.
-dnl It is called inside configure, outside of config.status.
-dnl AC_OUTPUT_MAKE_DEFS()
-define(AC_OUTPUT_MAKE_DEFS,
-[# Transform confdefs.h into DEFS.
-dnl Using a here document instead of a string reduces the quoting nightmare.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-changequote(<<, >>)dnl
-s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
-s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-changequote([, ])dnl
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-])
-
-dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted
-dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_FILES(FILE...)
-define(AC_OUTPUT_FILES,
-[# Protect against being on the right side of a sed subst in config.status.
-changequote(, )dnl
-sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
-changequote([, ])dnl
-dnl These here document variables are unquoted when configure runs
-dnl but quoted when config.status runs, so variables are expanded once.
-$ac_vpsub
-dnl Shell code in configure.in might set extrasub.
-$extrasub
-dnl Insert the sed substitutions of variables.
-undivert(AC_DIVERSION_SED)
-CEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"$1"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
-dnl Specifying an input file breaks the trap to clean up on interrupt,
-dnl but that's not a huge problem.
- # Support "outfile[: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 relative srcdir, etc. for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
-changequote(, )dnl
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
-changequote([, ])dnl
- 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="/$ac_dir"
- # A "../" for each directory in $ac_dir_suffix.
-changequote(, )dnl
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
-changequote([, ])dnl
- 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
-
-ifdef([AC_PROVIDE_AC_PROG_INSTALL],
-[ case "$ac_given_INSTALL" in
-changequote(, )dnl
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
-changequote([, ])dnl
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-])dnl
- 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
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
-])dnl
-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
-fi; done
-rm -f conftest.subs
-])
-
-dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
-dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_HEADER(HEADER-FILE...)
-define(AC_OUTPUT_HEADER,
-[changequote(<<, >>)dnl
-# 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'
-changequote([, ])dnl
-
-CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[: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
- cp $ac_given_srcdir/$ac_file_in 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
-dnl Using a here document instead of a string reduces the quoting nightmare.
-dnl Putting comments in sed scripts is not portable.
-cat > conftest.hdr <<\EOF
-changequote(<<, >>)dnl
-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
-changequote([, ])dnl
-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
-changequote(, )dnl
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-changequote([, ])dnl
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-# Maximum number of lines to put in a single here document.
-ac_max_here_lines=12
-
-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 <<CEOF' >> $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
-
-dnl Now back to your regularly scheduled config.status.
-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
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
-])
-
-dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted
-dnl here document whose contents are going into config.status.
-dnl AC_OUTPUT_LINKS(SOURCE..., DEST...)
-define(AC_OUTPUT_LINKS,
-[EOF
-
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$1"
-ac_dests="$2"
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=[$]1; shift; ac_dests=[$]*
- set $ac_sources; ac_source=[$]1; shift; ac_sources=[$]*
-
- echo "linking $srcdir/$ac_source to $ac_dest"
-
- if test ! -r $srcdir/$ac_source; then
- AC_MSG_ERROR($srcdir/$ac_source: File not found)
- fi
- rm -f $ac_dest
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
-changequote(, )dnl
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
-changequote([, ])dnl
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/$ac_dest_dir"
- # A "../" for each directory in $ac_dest_dir_suffix.
-changequote(, )dnl
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
-changequote([, ])dnl
- else
- ac_dest_dir_suffix= ac_dots=
- fi
-
- case "$srcdir" in
-changequote(, )dnl
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
-changequote([, ])dnl
- *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
- esac
-
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
- else
- AC_MSG_ERROR(can not link $ac_dest to $srcdir/$ac_source)
- fi
-done
-])
-
-This is a subroutine of AC_OUTPUT. It is called after running config.status.
-dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
-define(AC_OUTPUT_SUBDIRS,
-[
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case "$ac_arg" in
- -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=*)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- esac
- done
-
- for ac_config_dir in $1; do
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- if test ! -d $srcdir/$ac_config_dir; then
- continue
- fi
-
- echo configuring in $ac_config_dir
-
- case "$srcdir" in
- .) ;;
- *)
- if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
- else
- AC_MSG_ERROR(can not create `pwd`/$ac_config_dir)
- fi
- ;;
- esac
-
- ac_popdir=`pwd`
- cd $ac_config_dir
-
- case "$srcdir" in
- .) # No --srcdir option. We are building in place.
- ac_sub_srcdir=$srcdir ;;
- /*) # Absolute path.
- ac_sub_srcdir=$srcdir/$ac_config_dir ;;
- *) # Relative path.
- ac_sub_srcdir=../$srcdir/$ac_config_dir ;;
- esac
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_sub_srcdir/configure; then
- ac_sub_configure=$ac_sub_srcdir/configure
- elif test -f $ac_sub_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
- else
- AC_MSG_WARN(no configuration information is in $ac_config_dir)
- ac_sub_configure=
- fi
-
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
-
- # Make the cache file name correct relative to the subdirectory.
-changequote(, )dnl
- # A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo /$ac_config_dir|sed 's%/[^/]*%../%g'`
-changequote([, ])dnl
- case "$cache_file" in
- /*) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file="$ac_dots$cache_file" ;;
- esac
-
- echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir"
- # The eval makes quoting arguments work.
- if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
- then :
- else
- AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir)
- fi
- fi
-
- cd $ac_popdir
- done
-fi
-])
diff --git a/util/autoconf/acheaders b/util/autoconf/acheaders
deleted file mode 100644
index 0363a38..0000000
--- a/util/autoconf/acheaders
+++ /dev/null
@@ -1,27 +0,0 @@
-# Ones that have their own macros.
-dirent.h AC_HEADER_DIRENT
-sys/ndir.h AC_HEADER_DIRENT
-sys/dir.h AC_HEADER_DIRENT
-ndir.h AC_HEADER_DIRENT
-sys/mkdev.h AC_HEADER_MAJOR
-string.h AC_HEADER_STDC
-strings.h AC_HEADER_STDC
-stdlib.h AC_HEADER_STDC
-stddef.h AC_HEADER_STDC
-stdarg.h AC_HEADER_STDC
-float.h AC_HEADER_STDC
-sys/wait.h AC_HEADER_SYS_WAIT
-X11/Xlib.h AC_PATH_X
-
-# Others.
-fcntl.h AC_CHECK_HEADERS
-limits.h AC_CHECK_HEADERS
-paths.h AC_CHECK_HEADERS
-sgtty.h AC_CHECK_HEADERS
-sys/file.h AC_CHECK_HEADERS
-sys/ioctl.h AC_CHECK_HEADERS
-sys/time.h AC_CHECK_HEADERS
-sys/window.h AC_CHECK_HEADERS
-syslog.h AC_CHECK_HEADERS
-termio.h AC_CHECK_HEADERS
-unistd.h AC_CHECK_HEADERS
diff --git a/util/autoconf/acidentifiers b/util/autoconf/acidentifiers
deleted file mode 100644
index a7979c0..0000000
--- a/util/autoconf/acidentifiers
+++ /dev/null
@@ -1,22 +0,0 @@
-sys_siglist AC_DECL_SYS_SIGLIST
-mode_t AC_TYPE_MODE_T
-off_t AC_TYPE_OFF_T
-pid_t AC_TYPE_PID_T
-size_t AC_TYPE_SIZE_T
-uid_t AC_TYPE_UID_T
-gid_t AC_TYPE_UID_T
-S_ISDIR AC_HEADER_STAT
-S_ISREG AC_HEADER_STAT
-S_ISCHR AC_HEADER_STAT
-S_ISBLK AC_HEADER_STAT
-S_ISFIFO AC_HEADER_STAT
-S_ISLNK AC_HEADER_STAT
-S_ISSOCK AC_HEADER_STAT
-st_blksize AC_STRUCT_ST_BLKSIZE
-st_blocks AC_STRUCT_ST_BLOCKS
-st_rdev AC_STRUCT_ST_RDEV
-timeval AC_HEADER_TIME
-tm AC_STRUCT_TM
-tm_zone AC_STRUCT_TIMEZONE
-const AC_C_CONST
-inline AC_C_INLINE
diff --git a/util/autoconf/acmakevars b/util/autoconf/acmakevars
deleted file mode 100644
index 721b79b..0000000
--- a/util/autoconf/acmakevars
+++ /dev/null
@@ -1,11 +0,0 @@
-LN AC_PROG_LN_S
-AWK AC_PROG_AWK
-CC AC_PROG_CC
-CPP AC_PROG_CPP
-CXX AC_PROG_CXX
-INSTALL AC_PROG_INSTALL
-LEX AC_PROG_LEX
-RANLIB AC_PROG_RANLIB
-YACC AC_PROG_YACC
-BISON AC_PROG_YACC
-MAKE AC_PROG_MAKE_SET
diff --git a/util/autoconf/acoldnames.m4 b/util/autoconf/acoldnames.m4
deleted file mode 100644
index 39e20b7..0000000
--- a/util/autoconf/acoldnames.m4
+++ /dev/null
@@ -1,79 +0,0 @@
-dnl Map old names of Autoconf macros to new regularized names.
-dnl This file is part of Autoconf.
-dnl Copyright (C) 1994 Free Software Foundation, Inc.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2, or (at your option)
-dnl any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-dnl
-dnl General macros.
-dnl
-define(AC_WARN, [indir([AC_MSG_WARN], $@)])dnl
-define(AC_ERROR, [indir([AC_MSG_ERROR], $@)])dnl
-AC_DEFUN(AC_PROGRAM_CHECK, [indir([AC_CHECK_PROG], $@)])dnl
-AC_DEFUN(AC_PROGRAM_PATH, [indir([AC_PATH_PROG], $@)])dnl
-AC_DEFUN(AC_PROGRAMS_CHECK, [indir([AC_CHECK_PROGS], $@)])dnl
-AC_DEFUN(AC_PROGRAMS_PATH, [indir([AC_PATH_PROGS], $@)])dnl
-AC_DEFUN(AC_PREFIX, [indir([AC_PREFIX_PROGRAM], $@)])dnl
-AC_DEFUN(AC_HEADER_EGREP, [indir([AC_EGREP_HEADER], $@)])dnl
-AC_DEFUN(AC_PROGRAM_EGREP, [indir([AC_EGREP_CPP], $@)])dnl
-AC_DEFUN(AC_TEST_PROGRAM, [indir([AC_TRY_RUN], $@)])dnl
-AC_DEFUN(AC_TEST_CPP, [indir([AC_TRY_CPP], $@)])dnl
-AC_DEFUN(AC_HEADER_CHECK, [indir([AC_CHECK_HEADER], $@)])dnl
-AC_DEFUN(AC_FUNC_CHECK, [indir([AC_CHECK_FUNC], $@)])dnl
-AC_DEFUN(AC_HAVE_FUNCS, [indir([AC_CHECK_FUNCS], $@)])dnl
-AC_DEFUN(AC_HAVE_HEADERS, [indir([AC_CHECK_HEADERS], $@)])dnl
-AC_DEFUN(AC_SIZEOF_TYPE, [indir([AC_CHECK_SIZEOF], $@)])dnl
-dnl
-dnl Specific macros.
-dnl
-AC_DEFUN(AC_GCC_TRADITIONAL, [indir([AC_PROG_GCC_TRADITIONAL])])dnl
-AC_DEFUN(AC_MINUS_C_MINUS_O, [indir([AC_PROG_CC_C_O])])dnl
-AC_DEFUN(AC_SET_MAKE, [indir([AC_PROG_MAKE_SET])])dnl
-AC_DEFUN(AC_YYTEXT_POINTER, [indir([AC_DECL_YYTEXT])])dnl
-AC_DEFUN(AC_LN_S, [indir([AC_PROG_LN_S])])dnl
-AC_DEFUN(AC_STDC_HEADERS, [indir([AC_HEADER_STDC])])dnl
-AC_DEFUN(AC_MAJOR_HEADER, [indir([AC_HEADER_MAJOR])])dnl
-AC_DEFUN(AC_STAT_MACROS_BROKEN, [indir([AC_HEADER_STAT])])dnl
-AC_DEFUN(AC_SYS_SIGLIST_DECLARED, [indir([AC_DECL_SYS_SIGLIST])])dnl
-AC_DEFUN(AC_GETGROUPS_T, [indir([AC_TYPE_GETGROUPS])])dnl
-AC_DEFUN(AC_UID_T, [indir([AC_TYPE_UID_T])])dnl
-AC_DEFUN(AC_SIZE_T, [indir([AC_TYPE_SIZE_T])])dnl
-AC_DEFUN(AC_PID_T, [indir([AC_TYPE_PID_T])])dnl
-AC_DEFUN(AC_OFF_T, [indir([AC_TYPE_OFF_T])])dnl
-AC_DEFUN(AC_MODE_T, [indir([AC_TYPE_MODE_T])])dnl
-AC_DEFUN(AC_RETSIGTYPE, [indir([AC_TYPE_SIGNAL])])dnl
-AC_DEFUN(AC_MMAP, [indir([AC_FUNC_MMAP])])dnl
-AC_DEFUN(AC_VPRINTF, [indir([AC_FUNC_VPRINTF])])dnl
-AC_DEFUN(AC_VFORK, [indir([AC_FUNC_VFORK])])dnl
-AC_DEFUN(AC_WAIT3, [indir([AC_FUNC_WAIT3])])dnl
-AC_DEFUN(AC_ALLOCA, [indir([AC_FUNC_ALLOCA])])dnl
-AC_DEFUN(AC_GETLOADAVG, [indir([AC_FUNC_GETLOADAVG])])dnl
-AC_DEFUN(AC_UTIME_NULL, [indir([AC_FUNC_UTIME_NULL])])dnl
-AC_DEFUN(AC_STRCOLL, [indir([AC_FUNC_STRCOLL])])dnl
-AC_DEFUN(AC_SETVBUF_REVERSED, [indir([AC_FUNC_SETVBUF_REVERSED])])dnl
-AC_DEFUN(AC_TIME_WITH_SYS_TIME, [indir([AC_HEADER_TIME])])dnl
-AC_DEFUN(AC_TIMEZONE, [indir([AC_STRUCT_TIMEZONE])])dnl
-AC_DEFUN(AC_ST_BLOCKS, [indir([AC_STRUCT_ST_BLOCKS])])dnl
-AC_DEFUN(AC_ST_BLKSIZE, [indir([AC_STRUCT_ST_BLKSIZE])])dnl
-AC_DEFUN(AC_ST_RDEV, [indir([AC_STRUCT_ST_RDEV])])dnl
-AC_DEFUN(AC_CROSS_CHECK, [indir([AC_C_CROSS])])dnl
-AC_DEFUN(AC_CHAR_UNSIGNED, [indir([AC_C_CHAR_UNSIGNED])])dnl
-AC_DEFUN(AC_LONG_DOUBLE, [indir([AC_C_LONG_DOUBLE])])dnl
-AC_DEFUN(AC_WORDS_BIGENDIAN, [indir([AC_C_BIGENDIAN])])dnl
-AC_DEFUN(AC_INLINE, [indir([AC_C_INLINE])])dnl
-AC_DEFUN(AC_CONST, [indir([AC_C_CONST])])dnl
-AC_DEFUN(AC_LONG_FILE_NAMES, [indir([AC_SYS_LONG_FILE_NAMES])])dnl
-AC_DEFUN(AC_RESTARTABLE_SYSCALLS, [indir([AC_SYS_RESTARTABLE_SYSCALLS])])dnl
-AC_DEFUN(AC_FIND_X, [indir([AC_PATH_X])])dnl
-AC_DEFUN(AC_FIND_XTRA, [indir([AC_PATH_XTRA])])dnl
diff --git a/util/autoconf/acprograms b/util/autoconf/acprograms
deleted file mode 100644
index be237e3..0000000
--- a/util/autoconf/acprograms
+++ /dev/null
@@ -1,18 +0,0 @@
-ln AC_PROG_LN_S
-awk AC_PROG_AWK
-nawk AC_PROG_AWK
-gawk AC_PROG_AWK
-mawk AC_PROG_AWK
-cc AC_PROG_CC
-gcc AC_PROG_CC
-cpp AC_PROG_CPP
-CC AC_PROG_CXX
-g++ AC_PROG_CXX
-install AC_PROG_INSTALL
-lex AC_PROG_LEX
-flex AC_PROG_LEX
-ranlib AC_PROG_RANLIB
-yacc AC_PROG_YACC
-byacc AC_PROG_YACC
-bison AC_PROG_YACC
-make AC_PROG_MAKE_SET
diff --git a/util/autoconf/acspecific.m4 b/util/autoconf/acspecific.m4
deleted file mode 100644
index 3c07bc9..0000000
--- a/util/autoconf/acspecific.m4
+++ /dev/null
@@ -1,1950 +0,0 @@
-dnl Macros that test for specific features.
-dnl This file is part of Autoconf.
-dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2, or (at your option)
-dnl any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-dnl
-dnl As a special exception, the Free Software Foundation gives unlimited
-dnl permission to copy, distribute and modify the configure scripts that
-dnl are the output of Autoconf. You need not follow the terms of the GNU
-dnl General Public License when using or distributing such scripts, even
-dnl though portions of the text of Autoconf appear in them. The GNU
-dnl General Public License (GPL) does govern all other use of the material
-dnl that constitutes the Autoconf program.
-dnl
-dnl Certain portions of the Autoconf source text are designed to be copied
-dnl (in certain cases, depending on the input) into the output of
-dnl Autoconf. We call these the "data" portions. The rest of the Autoconf
-dnl source text consists of comments plus executable code that decides which
-dnl of the data portions to output in any given case. We call these
-dnl comments and executable code the "non-data" portions. Autoconf never
-dnl copies any of the non-data portions into its output.
-dnl
-dnl This special exception to the GPL applies to versions of Autoconf
-dnl released by the Free Software Foundation. When you make and
-dnl distribute a modified version of Autoconf, you may extend this special
-dnl exception to the GPL to apply to your modified version as well, *unless*
-dnl your modified version has the potential to copy into its output some
-dnl of the text that was the non-data portion of the version that you started
-dnl with. (In other words, unless your change moves or copies text from
-dnl the non-data portions to the data portions.) If your modification has
-dnl such potential, you must delete any notice of this special exception
-dnl to the GPL from your modified version.
-dnl
-dnl Written by David MacKenzie, with help from
-dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
-dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
-
-
-dnl ### Checks for programs
-
-
-dnl Check whether to use -n, \c, or newline-tab to separate
-dnl checking messages from result messages.
-dnl Idea borrowed from dist 3.0.
-dnl Internal use only.
-AC_DEFUN(AC_PROG_ECHO_N,
-[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_DEFUN(AC_PROG_CC,
-[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_CHECK_PROG(CC, gcc, gcc, cc)
-
-AC_MSG_CHECKING(whether we are using GNU C)
-AC_CACHE_VAL(ac_cv_prog_gcc,
-[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
-cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if ${CC-cc} -E conftest.c 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
-else
- ac_cv_prog_gcc=no
-fi])dnl
-AC_MSG_RESULT($ac_cv_prog_gcc)
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- if test "${CFLAGS+set}" != set; then
- AC_MSG_CHECKING(whether ${CC-cc} accepts -g)
-AC_CACHE_VAL(ac_cv_prog_gcc_g,
-[echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_gcc_g=yes
-else
- ac_cv_prog_gcc_g=no
-fi
-rm -f conftest*
-])dnl
- AC_MSG_RESULT($ac_cv_prog_gcc_g)
- if test $ac_cv_prog_gcc_g = yes; then
- CFLAGS="-g -O"
- else
- CFLAGS="-O"
- fi
- fi
-else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-])
-
-AC_DEFUN(AC_PROG_CXX,
-[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
-AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc)
-
-AC_MSG_CHECKING(whether we are using GNU C++)
-AC_CACHE_VAL(ac_cv_prog_gxx,
-[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
-cat > conftest.C <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if ${CXX-g++} -E conftest.C 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gxx=yes
-else
- ac_cv_prog_gxx=no
-fi])dnl
-AC_MSG_RESULT($ac_cv_prog_gxx)
-if test $ac_cv_prog_gxx = yes; then
- GXX=yes
- if test "${CXXFLAGS+set}" != set; then
- AC_MSG_CHECKING(whether ${CXX-g++} accepts -g)
-AC_CACHE_VAL(ac_cv_prog_gxx_g,
-[echo 'void f(){}' > conftest.cc
-if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
- ac_cv_prog_gxx_g=yes
-else
- ac_cv_prog_gxx_g=no
-fi
-rm -f conftest*
-])dnl
- AC_MSG_RESULT($ac_cv_prog_gxx_g)
- if test $ac_cv_prog_gxx_g = yes; then
- CXXFLAGS="-g -O"
- else
- CXXFLAGS="-O"
- fi
- fi
-else
- GXX=
- test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
-fi
-])
-
-AC_DEFUN(AC_PROG_GCC_TRADITIONAL,
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_CPP])dnl
-if test $ac_cv_prog_gcc = yes; then
- AC_MSG_CHECKING(whether ${CC-cc} needs -traditional)
-AC_CACHE_VAL(ac_cv_prog_gcc_traditional,
-[ ac_pattern="Autoconf.*'x'"
- AC_EGREP_CPP($ac_pattern, [#include <sgtty.h>
-Autoconf TIOCGETP],
- ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
-
- if test $ac_cv_prog_gcc_traditional = no; then
- AC_EGREP_CPP($ac_pattern, [#include <termio.h>
-Autoconf TCGETA],
- ac_cv_prog_gcc_traditional=yes)
- fi])dnl
- AC_MSG_RESULT($ac_cv_prog_gcc_traditional)
- if test $ac_cv_prog_gcc_traditional = yes; then
- CC="$CC -traditional"
- fi
-fi
-])
-
-AC_DEFUN(AC_PROG_CC_C_O,
-[if test "x$CC" != xcc; then
- AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
-else
- AC_MSG_CHECKING(whether cc understands -c and -o together)
-fi
-set dummy $CC; ac_cc=[$]2
-AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
-[eval ac_cv_prog_cc_${ac_cc}_c_o=no
-echo 'foo(){}' > conftest.c
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-if ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC &&
- test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC
-then
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if cc -c conftest.c 1>&AC_FD_CC 2>&AC_FD_CC
- then
- if cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC &&
- test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC
- then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- fi
- fi
- fi
-fi
-rm -f conftest*
-])dnl
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
- AC_DEFINE(NO_MINUS_C_MINUS_O)
-fi
-])
-
-dnl Define SET_MAKE to set ${MAKE} if make doesn't.
-AC_DEFUN(AC_PROG_MAKE_SET,
-[AC_MSG_CHECKING(whether ${MAKE-make} sets \$MAKE)
-set dummy ${MAKE-make}; ac_make=[$]2
-AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
-[cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-changequote(, )dnl
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-changequote([, ])dnl
-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])dnl
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- AC_MSG_RESULT(yes)
- SET_MAKE=
-else
- AC_MSG_RESULT(no)
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-AC_SUBST([SET_MAKE])dnl
-])
-
-AC_DEFUN(AC_PROG_RANLIB,
-[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])
-
-dnl Check for mawk first since it's said to be faster.
-AC_DEFUN(AC_PROG_AWK,
-[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
-
-AC_DEFUN(AC_PROG_YACC,
-[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])
-
-AC_DEFUN(AC_PROG_CPP,
-[AC_MSG_CHECKING(how to run the C preprocessor)
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
-AC_CACHE_VAL(ac_cv_prog_CPP,
-[ # 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.
-dnl Use a header file that comes with gcc, so configuring glibc
-dnl with a fresh cross-compiler works.
- AC_TRY_CPP([#include <assert.h>
-Syntax Error], ,
- CPP="${CC-cc} -E -traditional-cpp"
- AC_TRY_CPP([#include <assert.h>
-Syntax Error], , CPP=/lib/cpp))
- ac_cv_prog_CPP="$CPP"])dnl
-fi
-CPP="$ac_cv_prog_CPP"
-AC_MSG_RESULT($CPP)
-AC_SUBST(CPP)dnl
-])
-
-AC_DEFUN(AC_PROG_CXXCPP,
-[AC_MSG_CHECKING(how to run the C++ preprocessor)
-if test -z "$CXXCPP"; then
-AC_CACHE_VAL(ac_cv_prog_CXXCPP,
-[AC_LANG_SAVE[]dnl
-AC_LANG_CPLUSPLUS[]dnl
- CXXCPP="${CXX-g++} -E"
- AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
- ac_cv_prog_CXXCPP="$CXXCPP"
-AC_LANG_RESTORE[]dnl
-fi])dnl
-CXXCPP="$ac_cv_prog_CXXCPP"
-AC_MSG_RESULT($CXXCPP)
-AC_SUBST(CXXCPP)dnl
-])
-
-dnl Require finding the C or C++ preprocessor, whichever is the
-dnl current language.
-AC_DEFUN(AC_REQUIRE_CPP,
-[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])
-
-AC_DEFUN(AC_PROG_LEX,
-[AC_CHECK_PROG(LEX, flex, flex, lex)
-if test -z "$LEXLIB"
-then
- case "$LEX" in
- flex*) ac_lib=fl ;;
- *) ac_lib=l ;;
- esac
- AC_CHECK_LIB($ac_lib, main, LEXLIB="-l$ac_lib")
-fi
-AC_SUBST(LEXLIB)])
-
-AC_DEFUN(AC_DECL_YYTEXT,
-[AC_REQUIRE_CPP()dnl
-AC_REQUIRE([AC_PROG_LEX])dnl
-AC_MSG_CHECKING(for yytext declaration)
-AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer,
-[# POSIX says lex can declare yytext either as a pointer or an array; the
-# default is implementation-dependent. Figure out which it is, since
-# not all implementations provide the %pointer and %array declarations.
-#
-# The minimal lex program is just a single line: %%. But some broken lexes
-# (Solaris, I think it was) want two %% lines, so accommodate them.
-ac_cv_prog_lex_yytext_pointer=no
- echo '%%
-%%' | $LEX
-if test -f lex.yy.c; then
- LEX_OUTPUT_ROOT=lex.yy
-elif test -f lexyy.c; then
- LEX_OUTPUT_ROOT=lexyy
-else
- AC_MSG_ERROR(cannot find output from $LEX, giving up)
-fi
-echo 'extern char *yytext; main () { exit (0); }' >>$LEX_OUTPUT_ROOT.c
-ac_save_LIBS="$LIBS"
-LIBS="$LIBS $LEXLIB"
-AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, ac_cv_prog_lex_yytext_pointer=yes)
-LIBS="$ac_save_LIBS"
-rm -f "${LEX_OUTPUT_ROOT}.c"])dnl
-AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer)
-if test $ac_cv_prog_lex_yytext_pointer = yes; then
- AC_DEFINE(YYTEXT_POINTER)
-fi
-AC_SUBST(LEX_OUTPUT_ROOT)dnl
-])
-
-AC_DEFUN(AC_PROG_INSTALL,
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-# 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.
-AC_MSG_CHECKING(for a BSD compatible install)
-if test -z "$INSTALL"; then
-AC_CACHE_VAL(ac_cv_path_install,
-[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- 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"
- # As a last resort, use the slow shell script.
- test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl
- INSTALL="$ac_cv_path_install"
-fi
-dnl We do special magic for INSTALL instead of AC_SUBST, to get
-dnl relative paths right.
-AC_MSG_RESULT($INSTALL)
-
-# 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}'
-AC_SUBST(INSTALL_PROGRAM)dnl
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-AC_SUBST(INSTALL_DATA)dnl
-])
-
-AC_DEFUN(AC_PROG_LN_S,
-[AC_MSG_CHECKING(whether ln -s works)
-AC_CACHE_VAL(ac_cv_prog_LN_S,
-[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])dnl
-LN_S="$ac_cv_prog_LN_S"
-if test "$ac_cv_prog_LN_S" = "ln -s"; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST(LN_S)dnl
-])
-
-define(AC_RSH,
-[errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code
-)m4exit(4)])
-
-
-dnl ### Checks for header files
-
-
-AC_DEFUN(AC_HEADER_STDC,
-[AC_REQUIRE_CPP()dnl
-AC_MSG_CHECKING(for ANSI C header files)
-AC_CACHE_VAL(ac_cv_header_stdc,
-[AC_TRY_CPP([#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>], ac_cv_header_stdc=yes, ac_cv_header_stdc=no)
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-AC_EGREP_HEADER(memchr, string.h, , ac_cv_header_stdc=no)
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-AC_EGREP_HEADER(free, stdlib.h, , ac_cv_header_stdc=no)
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-AC_TRY_RUN([#include <ctype.h>
-#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); }
-], , ac_cv_header_stdc=no, ac_cv_header_stdc=no)
-fi])dnl
-AC_MSG_RESULT($ac_cv_header_stdc)
-if test $ac_cv_header_stdc = yes; then
- AC_DEFINE(STDC_HEADERS)
-fi
-])
-
-AC_DEFUN(AC_UNISTD_H,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl
-AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])
-
-AC_DEFUN(AC_USG,
-[AC_OBSOLETE([$0],
- [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl
-AC_MSG_CHECKING([for BSD string and memory functions])
-AC_TRY_LINK([#include <strings.h>], [rindex(0, 0); bzero(0, 0);],
- [AC_MSG_RESULT(yes); AC_DEFINE(USG)], [AC_MSG_RESULT(no)])])
-
-
-dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
-dnl To avoid problems, don't check for gcc2 built-ins.
-AC_DEFUN(AC_MEMORY_H,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl
-AC_MSG_CHECKING(whether string.h declares mem functions)
-AC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no)
-AC_MSG_RESULT($ac_found)
-if test $ac_found = no; then
- AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)])
-fi
-])
-
-AC_DEFUN(AC_HEADER_MAJOR,
-[AC_MSG_CHECKING(whether sys/types.h defines makedev)
-AC_CACHE_VAL(ac_cv_header_sys_types_h_makedev,
-[AC_TRY_LINK([#include <sys/types.h>], [return makedev(0, 0);],
- ac_cv_header_sys_types_h_makedev=yes, ac_cv_header_sys_types_h_makedev=no)
-])dnl
-AC_MSG_RESULT($ac_cv_header_sys_types_h_makedev)
-
-if test $ac_cv_header_sys_types_h_makedev = no; then
-AC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)])
-
- if test $ac_cv_header_sys_mkdev_h = no; then
-AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)])
- fi
-fi
-])
-
-AC_DEFUN(AC_HEADER_DIRENT,
-[ac_header_dirent=no
-AC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h,
- [ac_header_dirent=$ac_hdr; break])
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
-AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
-else
-AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
-fi
-])
-
-dnl Like AC_CHECK_HEADER, except also make sure that HEADER-FILE
-dnl defines the type `DIR'. dirent.h on NextStep 3.2 doesn't.
-dnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND)
-AC_DEFUN(AC_CHECK_HEADER_DIRENT,
-[ac_safe=`echo "$1" | tr './\055' '___'`
-AC_MSG_CHECKING([for $1 that defines DIR])
-AC_CACHE_VAL(ac_cv_header_dirent_$ac_safe,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <$1>], [DIR *dirp = 0;],
- eval "ac_cv_header_dirent_$ac_safe=yes",
- eval "ac_cv_header_dirent_$ac_safe=no")])dnl
-if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
- AC_MSG_RESULT(yes)
- $2
-else
- AC_MSG_RESULT(no)
-fi
-])
-
-dnl Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that
-dnl defines `DIR'.
-dnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION])
-define(AC_CHECK_HEADERS_DIRENT,
-[for ac_hdr in $1
-do
-AC_CHECK_HEADER_DIRENT($ac_hdr,
-[changequote(, )dnl
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
-changequote([, ])dnl
- AC_DEFINE_UNQUOTED($ac_tr_hdr) $2])dnl
-done])
-
-AC_DEFUN(AC_DIR_HEADER,
-[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
- AC_CHECK_HEADER_DIRENT($ac_hdr, [ac_header_dirent=$ac_hdr; break])
-done
-
-case "$ac_header_dirent" in
-dirent.h) AC_DEFINE(DIRENT) ;;
-sys/ndir.h) AC_DEFINE(SYSNDIR) ;;
-sys/dir.h) AC_DEFINE(SYSDIR) ;;
-ndir.h) AC_DEFINE(NDIR) ;;
-esac
-
-AC_MSG_CHECKING(whether closedir returns void)
-AC_CACHE_VAL(ac_cv_func_closedir_void,
-[AC_TRY_RUN([#include <sys/types.h>
-#include <$ac_header_dirent>
-int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
- ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes)])dnl
-AC_MSG_RESULT($ac_cv_func_closedir_void)
-if test $ac_cv_func_closedir_void = yes; then
- AC_DEFINE(VOID_CLOSEDIR)
-fi
-])
-
-AC_DEFUN(AC_HEADER_STAT,
-[AC_MSG_CHECKING(whether stat file-mode macros are broken)
-AC_CACHE_VAL(ac_cv_header_stat_broken,
-[AC_EGREP_CPP([You lose], [#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef S_ISBLK
-# if S_ISBLK (S_IFDIR)
-You lose.
-# endif
-# ifdef S_IFCHR
-# if S_ISBLK (S_IFCHR)
-You lose.
-# endif
-# endif
-#endif
-
-#ifdef S_ISLNK
-# if S_ISLNK (S_IFREG)
-You lose.
-# endif
-#endif
-
-#ifdef S_ISSOCK
-# if S_ISSOCK (S_IFREG)
-You lose.
-# endif
-#endif
-], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])dnl
-AC_MSG_RESULT($ac_cv_header_stat_broken)
-if test $ac_cv_header_stat_broken = yes; then
- AC_DEFINE(STAT_MACROS_BROKEN)
-fi
-])
-
-AC_DEFUN(AC_DECL_SYS_SIGLIST,
-[AC_MSG_CHECKING([for sys_siglist declaration in signal.h or unistd.h])
-AC_CACHE_VAL(ac_cv_decl_sys_siglist,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <signal.h>
-/* NetBSD declares sys_siglist in unistd.h. */
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif], [char *msg = *(sys_siglist + 1);],
- ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no)])dnl
-AC_MSG_RESULT($ac_cv_decl_sys_siglist)
-if test $ac_cv_decl_sys_siglist = yes; then
- AC_DEFINE(SYS_SIGLIST_DECLARED)
-fi
-])
-
-AC_DEFUN(AC_HEADER_SYS_WAIT,
-[AC_MSG_CHECKING([for sys/wait.h that is POSIX.1 compatible])
-AC_CACHE_VAL(ac_cv_header_sys_wait_h,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif], [int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;],
-ac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)])dnl
-AC_MSG_RESULT($ac_cv_header_sys_wait_h)
-if test $ac_cv_header_sys_wait_h = yes; then
- AC_DEFINE(HAVE_SYS_WAIT_H)
-fi
-])
-
-
-dnl ### Checks for typedefs
-
-
-AC_DEFUN(AC_TYPE_GETGROUPS,
-[AC_REQUIRE([AC_TYPE_UID_T])dnl
-AC_MSG_CHECKING(type of array argument to getgroups)
-AC_CACHE_VAL(ac_cv_type_getgroups,
-[AC_TRY_RUN(
-changequote(<<, >>)dnl
-<<
-/* Thanks to Mike Rendell for this test. */
-#include <sys/types.h>
-#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);
-}
->>,
-changequote([, ])dnl
- ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int,
- ac_cv_type_getgroups=cross)
-if test $ac_cv_type_getgroups = cross; then
- dnl When we can't run the test program (we are cross compiling), presume
- dnl that <unistd.h> has either an accurate prototype for getgroups or none.
- dnl Old systems without prototypes probably use int.
- AC_EGREP_HEADER([getgroups.*int.*gid_t], unistd.h,
- ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)
-fi])dnl
-AC_MSG_RESULT($ac_cv_type_getgroups)
-AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
-])
-
-AC_DEFUN(AC_TYPE_UID_T,
-[AC_MSG_CHECKING(for uid_t in sys/types.h)
-AC_CACHE_VAL(ac_cv_type_uid_t,
-[AC_EGREP_HEADER(uid_t, sys/types.h,
- ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])dnl
-AC_MSG_RESULT($ac_cv_type_uid_t)
-if test $ac_cv_type_uid_t = no; then
- AC_DEFINE(uid_t, int)
- AC_DEFINE(gid_t, int)
-fi
-])
-
-AC_DEFUN(AC_TYPE_SIZE_T,
-[AC_CHECK_TYPE(size_t, unsigned)])
-
-AC_DEFUN(AC_TYPE_PID_T,
-[AC_CHECK_TYPE(pid_t, int)])
-
-AC_DEFUN(AC_TYPE_OFF_T,
-[AC_CHECK_TYPE(off_t, long)])
-
-AC_DEFUN(AC_TYPE_MODE_T,
-[AC_CHECK_TYPE(mode_t, int)])
-
-dnl Note that identifiers starting with SIG are reserved by ANSI C.
-AC_DEFUN(AC_TYPE_SIGNAL,
-[AC_MSG_CHECKING([return type of signal handlers])
-AC_CACHE_VAL(ac_cv_type_signal,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-extern void (*signal ()) ();],
-[int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)])dnl
-AC_MSG_RESULT($ac_cv_type_signal)
-AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal)
-])
-
-
-dnl ### Checks for functions
-
-
-AC_DEFUN(AC_FUNC_CLOSEDIR_VOID,
-[AC_REQUIRE([AC_HEADER_DIRENT])dnl
-AC_MSG_CHECKING(whether closedir returns void)
-AC_CACHE_VAL(ac_cv_func_closedir_void,
-[AC_TRY_RUN([#include <sys/types.h>
-#include <$ac_header_dirent>
-int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
- ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes)])dnl
-AC_MSG_RESULT($ac_cv_func_closedir_void)
-if test $ac_cv_func_closedir_void = yes; then
- AC_DEFINE(CLOSEDIR_VOID)
-fi
-])
-
-AC_DEFUN(AC_FUNC_MMAP,
-[AC_MSG_CHECKING(for working mmap)
-AC_CACHE_VAL(ac_cv_func_mmap,
-[AC_TRY_RUN([
-/* Thanks to Mike Haertel and Jim Avera for this test. */
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#ifdef BSD
-# ifndef BSD4_1
-# define HAVE_GETPAGESIZE
-# endif
-#endif
-
-#ifndef HAVE_GETPAGESIZE
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif
-# else
-# ifdef NBPC
-# define getpagesize() NBPC
-# else
-# define getpagesize() PAGESIZE /* SVR4 */
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __osf__
-# define valloc malloc
-#endif
-
-#ifdef __cplusplus
-extern "C" { void *valloc(unsigned), *malloc(unsigned); }
-#else
-char *valloc(), *malloc();
-#endif
-
-int
-main()
-{
- char *buf1, *buf2, *buf3;
- int i = getpagesize(), j;
- int i2 = getpagesize()*2;
- int fd;
-
- buf1 = (char *)valloc(i2);
- buf2 = (char *)valloc(i);
- buf3 = (char *)malloc(i2);
- for (j = 0; j < i2; ++j)
- *(buf1 + j) = rand();
- fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
- write(fd, buf1, i2);
- mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
- for (j = 0; j < i; ++j)
- if (*(buf1 + j) != *(buf2 + j))
- exit(1);
- lseek(fd, (long)i, 0);
- read(fd, buf2, i); /* read into mapped memory -- file should not change */
- /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */
- lseek(fd, (long)0, 0);
- read(fd, buf3, i2);
- for (j = 0; j < i2; ++j)
- if (*(buf1 + j) != *(buf3 + j))
- exit(1);
- exit(0);
-}
-], ac_cv_func_mmap=yes, ac_cv_func_mmap=no, ac_cv_func_mmap=no)])dnl
-AC_MSG_RESULT($ac_cv_func_mmap)
-if test $ac_cv_func_mmap = yes; then
- AC_DEFINE(HAVE_MMAP)
-fi
-])
-
-AC_DEFUN(AC_FUNC_VPRINTF,
-[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
-if test "$ac_cv_func_vprintf" != yes; then
-AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
-fi
-])
-
-AC_DEFUN(AC_FUNC_VFORK,
-[AC_REQUIRE([AC_TYPE_PID_T])dnl
-AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H))
-AC_MSG_CHECKING(for working vfork)
-AC_CACHE_VAL(ac_cv_func_vfork,
-[AC_REQUIRE([AC_TYPE_SIGNAL])
-AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <signal.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
-#endif
-/* On sparc systems, changes by the child to local and incoming
- argument registers are propagated back to the parent.
- The compiler is told about this with #include <vfork.h>,
- but some compilers (e.g. gcc -O) don't grok <vfork.h>.
- Test for this by using a static variable whose address
- is put into a register that is clobbered by the vfork. */
-static
-#ifdef __cplusplus
-sparc_address_test (int arg)
-#else
-sparc_address_test (arg) int arg;
-#endif
-{
- static pid_t child;
- if (!child) {
- child = vfork ();
- if (child < 0)
- perror ("vfork");
- if (!child) {
- arg = getpid();
- write(-1, "", 0);
- _exit (arg);
- }
- }
-}
-static int signalled;
-static RETSIGTYPE catch (s) int s; { signalled = 1; }
-main() {
- pid_t parent = getpid ();
- pid_t child;
-
- sparc_address_test ();
-
- signal (SIGINT, catch);
-
- child = vfork ();
-
- if (child == 0) {
- /* Here is another test for sparc vfork register problems.
- This test uses lots of local variables, at least
- as many local variables as main has allocated so far
- including compiler temporaries. 4 locals are enough for
- gcc 1.40.3 on a sparc, but we use 8 to be safe.
- A buggy compiler should reuse the register of parent
- for one of the local variables, since it will think that
- parent can't possibly be used any more in this routine.
- Assigning to the local variable will thus munge parent
- in the parent process. */
- pid_t
- p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
- p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
- /* Convince the compiler that p..p7 are live; otherwise, it might
- use the same hardware register for all 8 local variables. */
- if (p != p1 || p != p2 || p != p3 || p != p4
- || p != p5 || p != p6 || p != p7)
- _exit(1);
-
- /* On some systems (e.g. SunOS 5.2), if the parent is catching
- a signal, the child ignores the signal before execing,
- and the parent later receives that signal, the parent dumps core.
- Test for this by ignoring SIGINT in the child. */
- signal (SIGINT, SIG_IGN);
-
- /* On some systems (e.g. IRIX 3.3),
- vfork doesn't separate parent from child file descriptors.
- If the child closes a descriptor before it execs or exits,
- this munges the parent's descriptor as well.
- Test for this by closing stdout in the child. */
- _exit(close(fileno(stdout)) != 0);
- } else {
- int status;
- struct stat st;
-
- while (wait(&status) != child)
- ;
- exit(
- /* Was there some problem with vforking? */
- child < 0
-
- /* Did the child fail? (This shouldn't happen.) */
- || status
-
- /* Did the vfork/compiler bug occur? */
- || parent != getpid()
-
- /* Did the signal handling bug occur? */
- || kill(parent, SIGINT) != 0
- || signalled != 1
-
- /* Did the file descriptor bug occur? */
- || fstat(fileno(stdout), &st) != 0
- );
- }
-}], ac_cv_func_vfork=yes, ac_cv_func_vfork=no, ac_cv_func_vfork=no)])dnl
-AC_MSG_RESULT($ac_cv_func_vfork)
-if test $ac_cv_func_vfork = no; then
- AC_DEFINE(vfork, fork)
-fi
-])
-
-AC_DEFUN(AC_FUNC_WAIT3,
-[AC_MSG_CHECKING(for wait3 that fills in rusage)
-AC_CACHE_VAL(ac_cv_func_wait3,
-[AC_TRY_RUN([#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <stdio.h>
-/* 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. */
- r.ru_nvcsw = 0;
- r.ru_stime.tv_sec = 0;
- r.ru_stime.tv_usec = 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(1); /* Avoid "text file busy" from rm on fast HP-UX machines. */
- exit(r.ru_nvcsw == 0
- && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
- }
-}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl
-AC_MSG_RESULT($ac_cv_func_wait3)
-if test $ac_cv_func_wait3 = yes; then
- AC_DEFINE(HAVE_WAIT3)
-fi
-])
-
-AC_DEFUN(AC_FUNC_ALLOCA,
-[AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments. Useless!
-AC_MSG_CHECKING([for working alloca.h])
-AC_CACHE_VAL(ac_cv_header_alloca_h,
-[AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
- ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)])dnl
-AC_MSG_RESULT($ac_cv_header_alloca_h)
-if test $ac_cv_header_alloca_h = yes; then
- AC_DEFINE(HAVE_ALLOCA_H)
-fi
-
-AC_MSG_CHECKING([for alloca])
-AC_CACHE_VAL(ac_cv_func_alloca,
-[AC_TRY_LINK([
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-], [char *p = (char *) alloca(1);],
- ac_cv_func_alloca=yes, ac_cv_func_alloca=no)])dnl
-AC_MSG_RESULT($ac_cv_func_alloca)
-if test $ac_cv_func_alloca = yes; then
- AC_DEFINE(HAVE_ALLOCA)
-fi
-
-if test $ac_cv_func_alloca = no; then
- # The SVR3 libPW and SVR4 libucb both contain incompatible functions
- # that cause trouble. Some versions do not even contain alloca or
- # contain a buggy version. If you still want to use their alloca,
- # use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.o
- AC_DEFINE(C_ALLOCA)
-
-AC_MSG_CHECKING(whether alloca needs Cray hooks)
-AC_CACHE_VAL(ac_cv_os_cray,
-[AC_EGREP_CPP(webecray,
-[#if defined(CRAY) && ! defined(CRAY2)
-webecray
-#else
-wenotbecray
-#endif
-], ac_cv_os_cray=yes, ac_cv_os_cray=no)])dnl
-AC_MSG_RESULT($ac_cv_os_cray)
-if test $ac_cv_os_cray = yes; then
-AC_CHECK_FUNC(_getb67, AC_DEFINE(CRAY_STACKSEG_END, _getb67),
-AC_CHECK_FUNC(GETB67, AC_DEFINE(CRAY_STACKSEG_END, GETB67),
-AC_CHECK_FUNC(getb67, AC_DEFINE(CRAY_STACKSEG_END, getb67))))
-fi
-
-AC_MSG_CHECKING(stack direction for C alloca)
-AC_CACHE_VAL(ac_cv_c_stack_direction,
-[AC_TRY_RUN([find_stack_direction ()
-{
- static char *addr = 0;
- auto char dummy;
- if (addr == 0)
- {
- addr = &dummy;
- return find_stack_direction ();
- }
- else
- return (&dummy > addr) ? 1 : -1;
-}
-main ()
-{
- exit (find_stack_direction() < 0);
-}], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
- ac_cv_c_stack_direction=0)])dnl
-AC_MSG_RESULT($ac_cv_c_stack_direction)
-AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
-fi
-AC_SUBST(ALLOCA)dnl
-])
-
-AC_DEFUN(AC_FUNC_GETLOADAVG,
-[# Some definitions of getloadavg require that the program be installed setgid.
-NEED_SETGID=false
-AC_SUBST(NEED_SETGID)dnl
-ac_have_func=no
-
-# Check for the 4.4BSD definition of getloadavg.
-AC_CHECK_LIB(util, getloadavg, [LIBS="$LIBS -lutil" ac_have_func=yes
-# Some systems with -lutil have (and need) -lkvm as well, some do not.
-AC_CHECK_LIB(kvm, kvm_open, LIBS="$LIBS -lkvm")])
-
-if test $ac_have_func = no; then
-# There is a commonly available library for RS/6000 AIX.
-# Since it is not a standard part of AIX, it might be installed locally.
-ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS"
-AC_CHECK_LIB(getloadavg, getloadavg, LIBS="$LIBS -lgetloadavg", LIBS="$ac_save_LIBS")
-fi
-
-# Make sure it is really in the library, if we think we found it.
-AC_REPLACE_FUNCS(getloadavg)
-
-if test $ac_cv_func_getloadavg = yes; then
- AC_DEFINE(HAVE_GETLOADAVG)
-else
-ac_have_func=no
-AC_CHECK_HEADER(sys/dg_sys_info.h,
-[ac_have_func=yes AC_DEFINE(DGUX)
-AC_CHECK_LIB(dgc, dg_sys_info)])
-if test $ac_have_func = no; then
-# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
-# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
-# Irix 4.0.5F has the header but not the library.
-AC_CHECK_LIB(elf, elf_read,
- [LIBS="$LIBS -lelf" ac_have_func=yes AC_DEFINE(SVR4)
- AC_CHECK_LIB(kvm, kvm_open, LIBS="$LIBS -lkvm")])
-fi
-if test $ac_have_func = no; then
-AC_CHECK_HEADER(inq_stats/cpustats.h,
- [ac_have_func=yes AC_DEFINE(UMAX)
- AC_DEFINE(UMAX4_3)])
-fi
-if test $ac_have_func = no; then
-AC_CHECK_HEADER(sys/cpustats.h,
- [ac_have_func=yes AC_DEFINE(UMAX)])
-fi
-if test $ac_have_func = no; then
-AC_CHECK_HEADERS(mach/mach.h)
-fi
-
-AC_CHECK_HEADER(nlist.h,
-[AC_DEFINE(NLIST_STRUCT)
-AC_MSG_CHECKING([for n_un in struct nlist])
-AC_CACHE_VAL(ac_cv_struct_nlist_n_un,
-[AC_TRY_COMPILE([#include <nlist.h>],
-[struct nlist n; n.n_un.n_name = 0;],
-ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])dnl
-AC_MSG_RESULT($ac_cv_struct_nlist_n_un)
-if test $ac_cv_struct_nlist_n_un = yes; then
- AC_DEFINE(NLIST_NAME_UNION)
-fi
-])dnl
-
-dnl FIXME two bugs here:
-dnl Hardwiring the path of getloadavg.c in the top-level directory,
-dnl and not checking whether a getloadavg from a library needs privileges.
-AC_MSG_CHECKING(whether getloadavg requires setgid)
-AC_CACHE_VAL(ac_cv_func_getloadavg_setgid,
-[AC_EGREP_CPP([Yowza Am I SETGID yet],
-[#include "$srcdir/getloadavg.c"
-#ifdef LDAV_PRIVILEGED
-Yowza Am I SETGID yet
-#endif],
- ac_cv_func_getloadavg_setgid=yes, ac_cv_func_getloadavg_setgid=no)])dnl
-AC_MSG_RESULT($ac_cv_func_getloadavg_setgid)
-if test $ac_cv_func_getloadavg_setgid = yes; then
- NEED_SETGID=true AC_DEFINE(GETLOADAVG_PRIVILEGED)
-fi
-
-fi # Do not have getloadavg in system libraries.
-
-if test "$NEED_SETGID" = true; then
- AC_MSG_CHECKING(group of /dev/kmem)
-AC_CACHE_VAL(ac_cv_group_kmem,
-[changequote(, )dnl
- # On Solaris, /dev/kmem is a symlink. Get info on the real file.
- ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
- # If we got an error (system does not support symlinks), try without -L.
- test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
- ac_cv_group_kmem=`echo $ac_ls_output \
- | sed -ne 's/[ ][ ]*/ /g;
- s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
- / /s/.* //;p;'`
-changequote([, ])dnl
-])dnl
- KMEM_GROUP=$ac_cv_group_kmem
- AC_MSG_RESULT($KMEM_GROUP)
-fi
-AC_SUBST(KMEM_GROUP)dnl
-])
-
-AC_DEFUN(AC_FUNC_UTIME_NULL,
-[AC_MSG_CHECKING(whether utime accepts a null argument)
-AC_CACHE_VAL(ac_cv_func_utime_null,
-[rm -f conftestdata; > conftestdata
-# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
-AC_TRY_RUN([#include <sys/types.h>
-#include <sys/stat.h>
-main() {
-struct stat s, t;
-exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
-&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
-&& t.st_mtime - s.st_mtime < 120));
-}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no,
- ac_cv_func_utime_null=no)
-rm -f core])dnl
-AC_MSG_RESULT($ac_cv_func_utime_null)
-if test $ac_cv_func_utime_null = yes; then
- AC_DEFINE(HAVE_UTIME_NULL)
-fi
-])
-
-AC_DEFUN(AC_FUNC_STRCOLL,
-[AC_MSG_CHECKING(for strcoll)
-AC_CACHE_VAL(ac_cv_func_strcoll,
-[AC_TRY_RUN([#include <string.h>
-main ()
-{
- exit (strcoll ("abc", "def") >= 0 ||
- strcoll ("ABC", "DEF") >= 0 ||
- strcoll ("123", "456") >= 0);
-}], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no, ac_cv_func_strcoll=no)])dnl
-AC_MSG_RESULT($ac_cv_func_strcoll)
-if test $ac_cv_func_strcoll = yes; then
- AC_DEFINE(HAVE_STRCOLL)
-fi
-])
-
-AC_DEFUN(AC_FUNC_SETVBUF_REVERSED,
-[AC_MSG_CHECKING(whether setvbuf arguments are reversed)
-AC_CACHE_VAL(ac_cv_func_setvbuf_reversed,
-[AC_TRY_RUN([#include <stdio.h>
-/* If setvbuf has the reversed format, exit 0. */
-main () {
- /* This call has the arguments reversed.
- A reversed system may check and see that the address of main
- is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */
- if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
- exit(1);
- putc('\r', stdout);
- exit(0); /* Non-reversed systems segv here. */
-}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no)
-rm -f core])dnl
-AC_MSG_RESULT($ac_cv_func_setvbuf_reversed)
-if test $ac_cv_func_setvbuf_reversed = yes; then
- AC_DEFINE(SETVBUF_REVERSED)
-fi
-])
-
-AC_DEFUN(AC_FUNC_GETMNTENT,
-[# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX.
-AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun",
- [AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq")])
-AC_CHECK_FUNC(getmntent, [AC_DEFINE(HAVE_GETMNTENT)])])
-
-AC_DEFUN(AC_FUNC_STRFTIME,
-[# strftime is in -lintl on SCO UNIX.
-AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl")
-AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)])])
-
-AC_DEFUN(AC_FUNC_MEMCMP,
-[AC_MSG_CHECKING(for 8-bit clean memcmp)
-AC_CACHE_VAL(ac_cv_func_memcmp,
-[AC_TRY_RUN([
-main()
-{
- char c0 = 0x40, c1 = 0x80, c2 = 0x81;
- exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
-}
-], ac_cv_func_memcmp=yes, ac_cv_func_memcmp=no, ac_cv_func_memcmp=no)])dnl
-AC_MSG_RESULT($ac_cv_func_memcmp)
-test $ac_cv_func_memcmp = no && LIBOBJS="$LIBOBJS memcmp.o"
-AC_SUBST(LIBOBJS)dnl
-])
-
-
-dnl ### Checks for structure members
-
-
-AC_DEFUN(AC_HEADER_TIME,
-[AC_MSG_CHECKING([whether time.h and sys/time.h may both be included])
-AC_CACHE_VAL(ac_cv_header_time,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>],
-[struct tm *tp;], ac_cv_header_time=yes, ac_cv_header_time=no)])dnl
-AC_MSG_RESULT($ac_cv_header_time)
-if test $ac_cv_header_time = yes; then
- AC_DEFINE(TIME_WITH_SYS_TIME)
-fi
-])
-
-AC_DEFUN(AC_STRUCT_TM,
-[AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h])
-AC_CACHE_VAL(ac_cv_struct_tm,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <time.h>],
-[struct tm *tp; tp->tm_sec;],
- ac_cv_struct_tm=time.h, ac_cv_struct_tm=sys/time.h)])dnl
-AC_MSG_RESULT($ac_cv_struct_tm)
-if test $ac_cv_struct_tm = sys/time.h; then
- AC_DEFINE(TM_IN_SYS_TIME)
-fi
-])
-
-AC_DEFUN(AC_STRUCT_TIMEZONE,
-[AC_REQUIRE([AC_STRUCT_TM])dnl
-AC_MSG_CHECKING([for tm_zone in struct tm])
-AC_CACHE_VAL(ac_cv_struct_tm_zone,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
- ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])dnl
-AC_MSG_RESULT($ac_cv_struct_tm_zone)
-if test "$ac_cv_struct_tm_zone" = yes; then
- AC_DEFINE(HAVE_TM_ZONE)
-else
- AC_MSG_CHECKING([for tzname])
-AC_CACHE_VAL(ac_cv_var_tzname,
-[AC_TRY_LINK(
-changequote(<<, >>)dnl
-<<#include <time.h>
-#ifndef tzname /* For SGI. */
-extern char *tzname[]; /* RS6000 and others reject char **tzname. */
-#endif>>,
-changequote([, ])dnl
-[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])dnl
- AC_MSG_RESULT($ac_cv_var_tzname)
- if test $ac_cv_var_tzname = yes; then
- AC_DEFINE(HAVE_TZNAME)
- fi
-fi
-])
-
-AC_DEFUN(AC_STRUCT_ST_BLOCKS,
-[AC_MSG_CHECKING([for st_blocks in struct stat])
-AC_CACHE_VAL(ac_cv_struct_st_blocks,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/stat.h>], [struct stat s; s.st_blocks;],
-ac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)])dnl
-AC_MSG_RESULT($ac_cv_struct_st_blocks)
-if test $ac_cv_struct_st_blocks = yes; then
- AC_DEFINE(HAVE_ST_BLOCKS)
-else
- LIBOBJS="$LIBOBJS fileblocks.o"
-fi
-AC_SUBST(LIBOBJS)dnl
-])
-
-AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
-[AC_MSG_CHECKING([for st_blksize in struct stat])
-AC_CACHE_VAL(ac_cv_struct_st_blksize,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/stat.h>], [struct stat s; s.st_blksize;],
-ac_cv_struct_st_blksize=yes, ac_cv_struct_st_blksize=no)])dnl
-AC_MSG_RESULT($ac_cv_struct_st_blksize)
-if test $ac_cv_struct_st_blksize = yes; then
- AC_DEFINE(HAVE_ST_BLKSIZE)
-fi
-])
-
-AC_DEFUN(AC_STRUCT_ST_RDEV,
-[AC_MSG_CHECKING([for st_rdev in struct stat])
-AC_CACHE_VAL(ac_cv_struct_st_rdev,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/stat.h>], [struct stat s; s.st_rdev;],
-ac_cv_struct_st_rdev=yes, ac_cv_struct_st_rdev=no)])dnl
-AC_MSG_RESULT($ac_cv_struct_st_rdev)
-if test $ac_cv_struct_st_rdev = yes; then
- AC_DEFINE(HAVE_ST_RDEV)
-fi
-])
-
-
-dnl ### Checks for compiler characteristics
-
-
-AC_DEFUN(AC_C_CROSS,
-[# If we cannot run a trivial program, we must be cross compiling.
-AC_MSG_CHECKING(whether cross-compiling)
-AC_CACHE_VAL(ac_cv_c_cross,
-[AC_TRY_RUN([main(){return(0);}],
- ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_cross=yes)])dnl
-cross_compiling=$ac_cv_c_cross
-AC_MSG_RESULT($ac_cv_c_cross)
-])
-
-AC_DEFUN(AC_C_CHAR_UNSIGNED,
-[AC_MSG_CHECKING(whether char is unsigned)
-AC_CACHE_VAL(ac_cv_c_char_unsigned,
-[if test "$GCC" = yes; then
- # GCC predefines this symbol on systems where it applies.
-AC_EGREP_CPP(yes,
-[#ifdef __CHAR_UNSIGNED__
- yes
-#endif
-], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-else
-AC_TRY_RUN(
-[/* volatile prevents gcc2 from optimizing the test away on sparcs. */
-#if !defined(__STDC__) || __STDC__ != 1
-#define volatile
-#endif
-main() {
- volatile char c = 255; exit(c < 0);
-}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-fi])dnl
-AC_MSG_RESULT($ac_cv_c_char_unsigned)
-if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
- AC_DEFINE(__CHAR_UNSIGNED__)
-fi
-])
-
-AC_DEFUN(AC_C_LONG_DOUBLE,
-[AC_MSG_CHECKING(for long double)
-AC_CACHE_VAL(ac_cv_c_long_double,
-[if test "$GCC" = yes; then
- ac_cv_c_long_double=yes
-else
-AC_TRY_RUN([int main() {
-/* The Stardent Vistra knows sizeof(long double), but does not support it. */
-long double foo = 0.0;
-/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
-exit(sizeof(long double) < sizeof(double)); }],
-ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
-fi])dnl
-AC_MSG_RESULT($ac_cv_c_long_double)
-if test $ac_cv_c_long_double = yes; then
- AC_DEFINE(HAVE_LONG_DOUBLE)
-fi
-])
-
-AC_DEFUN(AC_INT_16_BITS,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])dnl
-AC_MSG_CHECKING(whether int is 16 bits)
-AC_TRY_RUN([main() { exit(sizeof(int) != 2); }],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no))
-])
-
-AC_DEFUN(AC_LONG_64_BITS,
-[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])dnl
-AC_MSG_CHECKING(whether long int is 64 bits)
-AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no))
-])
-
-AC_DEFUN(AC_C_BIGENDIAN,
-[AC_MSG_CHECKING(whether byte ordering is bigendian)
-AC_CACHE_VAL(ac_cv_c_bigendian,
-[AC_TRY_RUN([main () {
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long l;
- char c[sizeof (long)];
- } u;
- u.l = 1;
- exit (u.c[sizeof (long) - 1] == 1);
-}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes)])dnl
-AC_MSG_RESULT($ac_cv_c_bigendian)
-if test $ac_cv_c_bigendian = yes; then
- AC_DEFINE(WORDS_BIGENDIAN)
-fi
-])
-
-AC_DEFUN(AC_C_INLINE,
-[AC_MSG_CHECKING([for inline])
-AC_CACHE_VAL(ac_cv_c_inline,
-[if test "$GCC" = yes; then
-AC_TRY_COMPILE(, [} inline foo() {], ac_cv_c_inline=yes, ac_cv_c_inline=no)
-else
- ac_cv_c_inline=no
-fi])dnl
-AC_MSG_RESULT($ac_cv_c_inline)
-if test $ac_cv_c_inline = no; then
- AC_DEFINE(inline, __inline)
-fi
-])
-
-AC_DEFUN(AC_C_CONST,
-[dnl This message is consistent in form with the other checking messages,
-dnl and with the result message.
-AC_MSG_CHECKING([for working const])
-AC_CACHE_VAL(ac_cv_c_const,
-[AC_TRY_COMPILE(,
-changequote(<<, >>)dnl
-<<
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero;
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
->>,
-changequote([, ])dnl
-ac_cv_c_const=yes, ac_cv_c_const=no)])dnl
-AC_MSG_RESULT($ac_cv_c_const)
-if test $ac_cv_c_const = no; then
- AC_DEFINE(const, )
-fi
-])
-
-define(AC_ARG_ARRAY,
-[errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments
-)m4exit(4)])
-
-
-dnl ### Checks for operating system services
-
-
-AC_DEFUN(AC_SYS_INTERPRETER,
-[# Pull the hash mark out of the macro call to avoid m4 problems.
-ac_msg="whether #! works in shell scripts"
-AC_MSG_CHECKING($ac_msg)
-AC_CACHE_VAL(ac_cv_sys_interpreter,
-[echo '#!/bin/cat
-exit 69
-' > conftest
-chmod u+x conftest
-(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null)
-if test $? -ne 69; then
- ac_cv_sys_interpreter=yes
-else
- ac_cv_sys_interpreter=no
-fi
-rm -f conftest])dnl
-AC_MSG_RESULT($ac_cv_sys_interpreter)
-])
-
-define(AC_HAVE_POUNDBANG,
-[errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments
-])m4exit(4)])
-
-AC_DEFUN(AC_SYS_LONG_FILE_NAMES,
-[AC_MSG_CHECKING(for long file names)
-AC_CACHE_VAL(ac_cv_sys_long_file_names,
-[ac_cv_sys_long_file_names=yes
-# Test for long file names in all the places we know might matter:
-# . the current directory, where building will happen
-# /tmp where it might want to write temporary files
-# /var/tmp likewise
-# /usr/tmp likewise
-# $prefix/lib where we will be installing things
-# $exec_prefix/lib likewise
-# eval it to expand exec_prefix.
-for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do
- test -d $ac_dir || continue
- test -w $ac_dir || continue # It is less confusing to not echo anything here.
- (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
- (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
- val=`cat $ac_dir/conftest9012345 2>/dev/null`
- if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
- ac_cv_sys_long_file_names=no
- rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
- break
- fi
- rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
-done])dnl
-AC_MSG_RESULT($ac_cv_sys_long_file_names)
-if test $ac_cv_sys_long_file_names = yes; then
- AC_DEFINE(HAVE_LONG_FILE_NAMES)
-fi
-])
-
-AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS,
-[AC_MSG_CHECKING(for restartable system calls)
-AC_CACHE_VAL(ac_cv_sys_restartable_syscalls,
-[AC_TRY_RUN(
-[/* Exit 0 (true) if wait returns something other than -1,
- i.e. the pid of the child, which means that wait was restarted
- after getting the signal. */
-#include <sys/types.h>
-#include <signal.h>
-ucatch (isig) { }
-main () {
- int i = fork (), status;
- if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
- signal (SIGINT, ucatch);
- status = wait(&i);
- if (status == -1) wait(&i);
- exit (status == -1);
-}
-], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])dnl
-AC_MSG_RESULT($ac_cv_sys_restartable_syscalls)
-if test $ac_cv_sys_restartable_syscalls = yes; then
- AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
-fi
-])
-
-AC_DEFUN(AC_PATH_X,
-[AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally.
-# If we find X, set shell vars x_includes and x_libraries to the
-# paths, otherwise set no_x=yes.
-# Uses ac_ vars as temps to allow command line to override cache and checks.
-# --without-x overrides everything else, but does not touch the cache.
-AC_MSG_CHECKING(for X)
-
-AC_ARG_WITH(x, [ --with-x use the X Window System])
-if test "x$with_x" = xno; then
- no_x=yes
-else
- if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
- no_x=
- else
-AC_CACHE_VAL(ac_cv_path_x,
-[# One or both of the vars are not set, and there is no cached value.
-no_x=yes
-AC_PATH_X_XMKMF
-if test "$no_x" = yes; then
-AC_PATH_X_DIRECT
-fi
-if test "$no_x" = yes; then
- ac_cv_path_x="no_x=yes"
-else
- ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
-fi])dnl
- fi
- eval "$ac_cv_path_x"
-fi # $with_x != no
-
-if test "$no_x" = yes; then
- AC_MSG_RESULT(no)
-else
- test "x$x_includes" = xNONE && x_includes=$ac_x_includes
- test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
- ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
- AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
-fi
-])
-
-dnl Internal subroutine of AC_PATH_X.
-dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes).
-AC_DEFUN(AC_PATH_X_XMKMF,
-[rm -fr conftestdir
-if mkdir conftestdir; then
- cd conftestdir
- # Make sure to not put "make" in the Imakefile rules, since we grep it out.
- cat > Imakefile <<'EOF'
-acfindx:
- @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
-EOF
- if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
- no_x=
- # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
- eval `make acfindx 2>/dev/null | grep -v make`
- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
- if test ! -f $ac_im_usrlibdir/libX11.a && test -f $ac_im_libdir/libX11.a
- then
- ac_im_usrlibdir=$ac_im_libdir
- fi
- case "$ac_im_incroot" in
- /usr/include) ;;
- *) ac_x_includes="$ac_im_incroot" ;;
- esac
- case "$ac_im_usrlibdir" in
- /usr/lib | /lib) ;;
- *) ac_x_libraries="$ac_im_usrlibdir" ;;
- esac
- fi
- cd ..
- rm -fr conftestdir
-fi
-])
-
-dnl Internal subroutine of AC_PATH_X.
-dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes).
-AC_DEFUN(AC_PATH_X_DIRECT,
-[test -z "$x_direct_test_library" && x_direct_test_library=Xt
-test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
-test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
-AC_TRY_CPP([#include <$x_direct_test_include>],
-[no_x= ac_x_includes=],
-[ for ac_dir in \
- /usr/X11R6/include \
- /usr/X11R5/include \
- /usr/X11R4/include \
- \
- /usr/include/X11R6 \
- /usr/include/X11R5 \
- /usr/include/X11R4 \
- \
- /usr/local/X11R6/include \
- /usr/local/X11R5/include \
- /usr/local/X11R4/include \
- \
- /usr/local/include/X11R6 \
- /usr/local/include/X11R5 \
- /usr/local/include/X11R4 \
- \
- /usr/X11/include \
- /usr/include/X11 \
- /usr/local/X11/include \
- /usr/local/include/X11 \
- \
- /usr/X386/include \
- /usr/x386/include \
- /usr/XFree86/include/X11 \
- \
- /usr/include \
- /usr/local/include \
- /usr/unsupported/include \
- /usr/athena/include \
- /usr/local/x11r5/include \
- /usr/lpp/Xamples/include \
- \
- /usr/openwin/include \
- /usr/openwin/share/include \
- ; \
- do
- if test -r "$ac_dir/$x_direct_test_include"; then
- no_x= ac_x_includes=$ac_dir
- break
- fi
- done])
-
-# Check for the libraries.
-# See if we find them without any special options.
-# Don't add to $LIBS permanently.
-ac_save_LIBS="$LIBS"
-LIBS="$LIBS -l$x_direct_test_library"
-AC_TRY_LINK(, [${x_direct_test_function}()],
-[LIBS="$ac_save_LIBS" no_x= ac_x_libraries=],
-[LIBS="$ac_save_LIBS"
-# First see if replacing the include by lib works.
-for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
- /usr/X11R6/lib \
- /usr/X11R5/lib \
- /usr/X11R4/lib \
- \
- /usr/lib/X11R6 \
- /usr/lib/X11R5 \
- /usr/lib/X11R4 \
- \
- /usr/local/X11R6/lib \
- /usr/local/X11R5/lib \
- /usr/local/X11R4/lib \
- \
- /usr/local/lib/X11R6 \
- /usr/local/lib/X11R5 \
- /usr/local/lib/X11R4 \
- \
- /usr/X11/lib \
- /usr/lib/X11 \
- /usr/local/X11/lib \
- /usr/local/lib/X11 \
- \
- /usr/X386/lib \
- /usr/x386/lib \
- /usr/XFree86/lib/X11 \
- \
- /usr/lib \
- /usr/local/lib \
- /usr/unsupported/lib \
- /usr/athena/lib \
- /usr/local/x11r5/lib \
- /usr/lpp/Xamples/lib \
- \
- /usr/openwin/lib \
- /usr/openwin/share/lib \
- ; \
-do
- for ac_extension in a so sl; do
- if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
- no_x= ac_x_libraries=$ac_dir
- break 2
- fi
- done
-done])])
-
-dnl Find additional X libraries, magic flags, etc.
-AC_DEFUN(AC_PATH_XTRA,
-[AC_REQUIRE([AC_ISC_POSIX])dnl
-AC_REQUIRE([AC_PATH_X])dnl
-if test "$no_x" = yes; then
- # Not all programs may use this symbol, but it does not hurt to define it.
- X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING"
-else
- if test -n "$x_includes"; then
- X_CFLAGS="$X_CFLAGS -I$x_includes"
- fi
-
- # It would be nice to have a more robust check for the -R ld option than
- # just checking for Solaris.
- # It would also be nice to do this for all -L options, not just this one.
- if test -n "$x_libraries"; then
- X_LIBS="$X_LIBS -L$x_libraries"
- if test "`(uname) 2>/dev/null`" = SunOS &&
- uname -r | grep '^5' >/dev/null; then
- X_LIBS="$X_LIBS -R$x_libraries"
- fi
- fi
-
- # Check for libraries that X11R6 Xt/Xaw programs need.
-
- ac_save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -L$x_libraries"
- # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
- # check for ICE first), but we must link in the order -lSM -lICE or
- # we get undefined symbols. So assume we have SM if we have ICE.
- # These have to be linked with before -lX11, unlike the other
- # libraries we check for below, so use a different variable.
- # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
- AC_CHECK_LIB(ICE, IceConnectionNumbers,
- [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"])
- LDFLAGS="$ac_save_LDFLAGS"
-
- # Check for system-dependent libraries X programs must link with.
-
- if test "$ISC" = yes; then
- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
- else
- # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
- # libraries were built with DECnet support. And karl@cs.umb.edu says
- # the Alpha needs dnet_stub (dnet does not exist).
- AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
- if test $ac_cv_lib_dnet = no; then
- AC_CHECK_LIB(dnet_stub, dnet_ntoa,
- [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
- fi
-
- # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
- # to get the SysV transport functions.
- # Not sure which flavor of 386 UNIX this is, but it seems harmless to
- # check for it.
- AC_CHECK_LIB(nsl, t_accept, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
-
- # lieder@skyler.mavd.honeywell.com says without -lsocket,
- # socket/setsockopt and other routines are undefined under SCO ODT 2.0.
- # But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch.
- if test "`(uname) 2>/dev/null`" != IRIX; then
- AC_CHECK_LIB(socket, socket, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"])
- fi
- fi
-fi
-AC_SUBST(X_CFLAGS)dnl
-AC_SUBST(X_PRE_LIBS)dnl
-AC_SUBST(X_LIBS)dnl
-AC_SUBST(X_EXTRA_LIBS)dnl
-])
-
-
-dnl ### Checks for UNIX variants
-dnl These are kludges which should be replaced by a single POSIX check.
-
-
-AC_DEFUN(AC_AIX,
-[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
-AC_BEFORE([$0], [AC_TRY_LINK])dnl
-AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_MSG_CHECKING(for AIX)
-AC_EGREP_CPP(yes,
-[#ifdef _AIX
- yes
-#endif
-], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no))
-])
-
-AC_DEFUN(AC_MINIX,
-[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
-AC_BEFORE([$0], [AC_TRY_LINK])dnl
-AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
-if test "$MINIX" = yes; then
- AC_DEFINE(_POSIX_SOURCE)
- AC_DEFINE(_POSIX_1_SOURCE, 2)
- AC_DEFINE(_MINIX)
-fi
-])
-
-AC_DEFUN(AC_ISC_POSIX,
-[AC_BEFORE([$0], [AC_TRY_LINK])dnl
-AC_BEFORE([$0], [AC_TRY_LINK])dnl
-AC_BEFORE([$0], [AC_TRY_RUN])dnl
-AC_MSG_CHECKING(for POSIXized ISC)
-if test -d /etc/conf/kconfig.d &&
- grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
-then
- AC_MSG_RESULT(yes)
- ISC=yes # If later tests want to check for ISC.
- AC_DEFINE(_POSIX_SOURCE)
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- fi
-else
- AC_MSG_RESULT(no)
- ISC=
-fi
-])
-
-AC_DEFUN(AC_XENIX_DIR,
-[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
-AC_REQUIRE([AC_DIR_HEADER])dnl
-AC_MSG_CHECKING(for Xenix)
-AC_EGREP_CPP(yes,
-[#if defined(M_XENIX) && !defined(M_UNIX)
- yes
-#endif
-], [AC_MSG_RESULT(yes); XENIX=yes], [AC_MSG_RESULT(no); XENIX=])
-if test "$XENIX" = yes; then
- # Make sure -ldir precedes -lx.
- test $ac_header_dirent = dirent.h && LIBS="$LIBS -ldir"
- LIBS="$LIBS -lx"
-fi
-])
-
-AC_DEFUN(AC_DYNIX_SEQ,
-[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT])dnl
-AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq")
-])
-
-AC_DEFUN(AC_IRIX_SUN,
-[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT or AC_CHECK_LIB(sun, getpwnam)])dnl
-AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun")
-])
-
-AC_DEFUN(AC_SCO_INTL,
-[AC_OBSOLETE([$0], [; instead use AC_FUNC_STRFTIME])dnl
-AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl")
-])
diff --git a/util/autoconf/autoconf b/util/autoconf/autoconf
deleted file mode 100755
index 5358738..0000000
--- a/util/autoconf/autoconf
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/bin/sh
-# autoconf -- create `configure' using m4 macros
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# If given no args, create `configure' from template file `configure.in'.
-# With one arg, create a configure script on standard output from
-# the given template file.
-
-usage="\
-Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--version] [template-file]"
-
-# NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-
-test -z "${AC_MACRODIR}" && AC_MACRODIR=/usr/local/share/autoconf
-test -z "${M4}" && M4=/mit/gnu/rsaixbin/gm4
-case "${M4}" in
-/*) # Handle the case that m4 has moved since we were configured.
- # It may have been found originally in a build directory.
- test -f "${M4}" || M4=m4 ;;
-esac
-
-tmpout=/tmp/acout.$$
-localdir=
-show_version=no
-
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* )
- echo "${usage}" 1>&2; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m* )
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- AC_MACRODIR="${1}"
- shift ;;
- --version | --v* )
- show_version=yes; shift ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "${usage}" 1>&2; exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-case $# in
- 0) infile=configure.in ;;
- 1) infile="$1" ;;
- *) echo "$usage" >&2; exit 1 ;;
-esac
-
-trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15
-
-tmpin=/tmp/acin.$$ # Always set this, to avoid bogus errors from some rm's.
-if test z$infile = z-; then
- infile=$tmpin
- cat > $infile
-elif test ! -r "$infile"; then
- echo "autoconf: ${infile}: No such file or directory" >&2
- exit 1
-fi
-
-if test -n "$localdir"; then
- use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
-else
- use_localdir=
-fi
-
-# Use the frozen version of Autoconf if available.
-r= f=
-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
-case `$M4 --help < /dev/null 2>&1` in
-*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
-*traditional*) ;;
-*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
-esac
-
-$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
- { rm -f $tmpin $tmpout; exit 2; }
-
-# You could add your own prefixes to pattern if you wanted to check for
-# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do
-# alternation.
-pattern="AC_"
-
-status=0
-if grep "${pattern}" $tmpout > /dev/null 2>&1; then
- echo "autoconf: Undefined macros:" >&2
- grep "${pattern}" $tmpout | sed "s/.*\(${pattern}[_A-Z0-9]*\).*/\1/" |
- while read name; do
- grep -n $name $infile /dev/null
- done | sort -u >&2
- status=1
-fi
-
-if test $# -eq 0; then
- exec 4> configure; chmod +x configure
-else
- exec 4>&1
-fi
-
-# Put the real line numbers into configure to make config.log more helpful.
-awk '
-/__oline__/ { printf "%d:", NR + 1 }
- { print }
-' $tmpout | sed '
-/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__\(.*\)$/\2\1\3/
-' >&4
-
-rm -f $tmpout
-
-exit $status
diff --git a/util/autoconf/autoconf.info b/util/autoconf/autoconf.info
deleted file mode 100644
index cec6b13..0000000
--- a/util/autoconf/autoconf.info
+++ /dev/null
@@ -1,152 +0,0 @@
-This is Info file autoconf.info, produced by Makeinfo-1.55 from the
-input file ./autoconf.texi.
-
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an `m4' macro
-package.
-
- Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-Indirect:
-autoconf.info-1: 1085
-autoconf.info-2: 51012
-autoconf.info-3: 100216
-autoconf.info-4: 150192
-autoconf.info-5: 198408
-
-Tag Table:
-(Indirect)
-Node: Top1085
-Node: Introduction9210
-Node: Making configure Scripts13050
-Node: Writing configure.in16115
-Node: Invoking autoscan19815
-Node: Invoking ifnames22120
-Node: Invoking autoconf23610
-Node: Invoking autoreconf25448
-Node: Setup27768
-Node: Input28654
-Node: Output30270
-Node: Makefile Substitutions33020
-Node: Preset Output Variables34602
-Node: Build Directories37840
-Node: Automatic Remaking39566
-Node: Configuration Headers41632
-Node: Header Templates43999
-Node: Invoking autoheader45178
-Node: Subdirectories48265
-Node: Default Prefix49608
-Node: Versions51012
-Node: Existing Tests52914
-Node: Alternative Programs54379
-Node: Particular Programs55043
-Node: Generic Programs60893
-Node: Libraries62570
-Node: Library Functions64399
-Node: Particular Functions64957
-Node: Generic Functions70704
-Node: Header Files72545
-Node: Particular Headers73104
-Node: Generic Headers80075
-Node: Structures81375
-Node: Typedefs83612
-Node: Particular Typedefs84116
-Node: Generic Typedefs85316
-Node: Compiler Characteristics85759
-Node: System Services88215
-Node: UNIX Variants90536
-Node: Writing Tests92555
-Node: Examining Declarations94327
-Node: Examining Syntax96793
-Node: Examining Libraries97848
-Node: Run Time100216
-Node: Test Programs101177
-Node: Guidelines103712
-Node: Test Functions104901
-Node: Portable Shell106444
-Node: Testing Values and Files108096
-Node: Multiple Cases109751
-Node: Language Choice110949
-Node: Results112507
-Node: Defining Symbols113266
-Node: Setting Output Variables116275
-Node: Caching Results118121
-Node: Cache Variable Names120023
-Node: Cache Files121572
-Node: Printing Messages123357
-Node: Writing Macros126644
-Node: Macro Definitions127263
-Node: Macro Names128368
-Node: Quoting130819
-Node: Dependencies Between Macros132721
-Node: Prerequisite Macros133353
-Node: Suggested Ordering134808
-Node: Obsolete Macros136338
-Node: Manual Configuration137562
-Node: Specifying Names138471
-Node: Canonicalizing140343
-Node: System Type Variables141657
-Node: Using System Type142404
-Node: Site Configuration143684
-Node: External Software144457
-Node: Package Options146922
-Node: Site Details148978
-Node: Transforming Names150192
-Node: Transformation Options151371
-Node: Transformation Examples151837
-Node: Transformation Rules153405
-Node: Site Defaults154814
-Node: Invoking configure157976
-Node: Basic Installation158917
-Node: Compilers and Options161239
-Node: Build Directory161881
-Node: Installation Names162582
-Node: Optional Features163500
-Node: System Type164270
-Node: Sharing Defaults165292
-Node: Operation Controls165916
-Node: Invoking config.status166780
-Node: Questions170168
-Node: Distributing170700
-Node: Why GNU m4171826
-Node: Bootstrapping172639
-Node: Why Not Imake173255
-Node: Upgrading177836
-Node: Changed File Names179357
-Node: Changed Makefiles180093
-Node: Changed Macros181173
-Node: Invoking autoupdate182420
-Node: Changed Results184011
-Node: Changed Macro Writing186113
-Node: History187376
-Node: Genesis188083
-Node: Exodus189256
-Node: Leviticus192305
-Node: Numbers193828
-Node: Deuteronomy195744
-Node: Old Macro Names198408
-Node: Environment Variable Index201457
-Node: Output Variable Index202459
-Node: Preprocessor Symbol Index206540
-Node: Macro Index211348
-
-End Tag Table
diff --git a/util/autoconf/autoconf.info-1 b/util/autoconf/autoconf.info-1
deleted file mode 100644
index f49358c..0000000
--- a/util/autoconf/autoconf.info-1
+++ /dev/null
@@ -1,1156 +0,0 @@
-This is Info file autoconf.info, produced by Makeinfo-1.55 from the
-input file ./autoconf.texi.
-
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an `m4' macro
-package.
-
- Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-File: autoconf.info, Node: Top, Next: Introduction, Up: (dir)
-
- This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an `m4' macro
-package. This is edition 2.1, for Autoconf version 2.1.
-
-* Menu:
-
-* Introduction:: Autoconf's purpose, strengths, and weaknesses.
-* Making configure Scripts:: How to organize and produce Autoconf scripts.
-* Setup:: Initialization and output.
-* Existing Tests:: Macros that check for particular features.
-* Writing Tests:: How to write new feature checks.
-* Results:: What to do with results from feature checks.
-* Writing Macros:: Adding new macros to Autoconf.
-* Manual Configuration:: Selecting features that can't be guessed.
-* Site Configuration:: Local defaults for `configure'.
-* Invoking configure:: How to use the Autoconf output.
-* Invoking config.status:: Recreating a configuration.
-* Questions:: Questions about Autoconf, with answers.
-* Upgrading:: Tips for upgrading from version 1.
-* History:: History of Autoconf.
-* Old Macro Names:: Backward compatibility macros.
-* Environment Variable Index:: Index of environment variables used.
-* Output Variable Index:: Index of variables set in output files.
-* Preprocessor Symbol Index:: Index of C preprocessor symbols defined.
-* Macro Index:: Index of Autoconf macros.
-
- -- The Detailed Node Listing --
-
-Making `configure' Scripts
-
-* Writing configure.in:: What to put in an Autoconf input file.
-* Invoking autoscan:: Semi-automatic `configure.in' writing.
-* Invoking ifnames:: Listing the conditionals in source code.
-* Invoking autoconf:: How to create configuration scripts.
-* Invoking autoreconf:: Remaking multiple `configure' scripts.
-
-Initialization and Output Files
-
-* Input:: Where Autoconf should find files.
-* Output:: Creating output files.
-* Makefile Substitutions:: Using output variables in `Makefile's.
-* Configuration Headers:: Creating a configuration header file.
-* Subdirectories:: Configuring independent packages together.
-* Default Prefix:: Changing the default installation prefix.
-* Versions:: Version numbers in `configure'.
-
-Substitutions in Makefiles
-
-* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Compiling in a different directory.
-* Automatic Remaking:: Makefile rules for configuring.
-
-Configuration Header Files
-
-* Header Templates:: Input for the configuration headers.
-* Invoking autoheader:: How to create configuration templates.
-
-Existing Tests
-
-* Alternative Programs:: Selecting between alternative programs.
-* Libraries:: Library archives that might be missing.
-* Library Functions:: C library functions that might be missing.
-* Header Files:: Header files that might be missing.
-* Structures:: Structures or members that might be missing.
-* Typedefs:: `typedef's that might be missing.
-* Compiler Characteristics:: C compiler or machine architecture features.
-* System Services:: Operating system services.
-* UNIX Variants:: Special kludges for specific UNIX variants.
-
-Alternative Programs
-
-* Particular Programs:: Special handling to find certain programs.
-* Generic Programs:: How to find other programs.
-
-Library Functions
-
-* Particular Functions:: Special handling to find certain functions.
-* Generic Functions:: How to find other functions.
-
-Header Files
-
-* Particular Headers:: Special handling to find certain headers.
-* Generic Headers:: How to find other headers.
-
-Typedefs
-
-* Particular Typedefs:: Special handling to find certain types.
-* Generic Typedefs:: How to find other types.
-
-Writing Tests
-
-* Examining Declarations:: Detecting header files and declarations.
-* Examining Syntax:: Detecting language syntax features.
-* Examining Libraries:: Detecting functions and global variables.
-* Run Time:: Testing for run-time features.
-* Portable Shell:: Shell script portability pitfalls.
-* Testing Values and Files:: Checking strings and files.
-* Multiple Cases:: Tests for several possible values.
-* Language Choice:: Selecting which language to use for testing.
-
-Checking Run Time Behavior
-
-* Test Programs:: Running test programs.
-* Guidelines:: General rules for writing test programs.
-* Test Functions:: Avoiding pitfalls in test programs.
-
-Results of Tests
-
-* Defining Symbols:: Defining C preprocessor symbols.
-* Setting Output Variables:: Replacing variables in output files.
-* Caching Results:: Speeding up subsequent `configure' runs.
-* Printing Messages:: Notifying users of progress or problems.
-
-Caching Results
-
-* Cache Variable Names:: Shell variables used in caches.
-* Cache Files:: Files `configure' uses for caching.
-
-Writing Macros
-
-* Macro Definitions:: Basic format of an Autoconf macro.
-* Macro Names:: What to call your new macros.
-* Quoting:: Protecting macros from unwanted expansion.
-* Dependencies Between Macros:: What to do when macros depend on other macros.
-
-Dependencies Between Macros
-
-* Prerequisite Macros:: Ensuring required information.
-* Suggested Ordering:: Warning about possible ordering problems.
-* Obsolete Macros:: Warning about old ways of doing things.
-
-Manual Configuration
-
-* Specifying Names:: Specifying the system type.
-* Canonicalizing:: Getting the canonical system type.
-* System Type Variables:: Variables containing the system type.
-* Using System Type:: What to do with the system type.
-
-Site Configuration
-
-* External Software:: Working with other optional software.
-* Package Options:: Selecting optional features.
-* Site Details:: Configuring site details.
-* Transforming Names:: Changing program names when installing.
-* Site Defaults:: Giving `configure' local defaults.
-
-Transforming Program Names When Installing
-
-* Transformation Options:: `configure' options to transforme names.
-* Transformation Examples:: Sample uses of transforming names.
-* Transformation Rules:: `Makefile' uses of transforming names.
-
-Running `configure' Scripts
-
-* Basic Installation:: Instructions for typical cases.
-* Compilers and Options:: Selecting compilers and optimization.
-* Build Directory:: Configuring in a different directory.
-* Installation Names:: Installing in different directories.
-* Optional Features:: Selecting optional features.
-* System Type:: Specifying the system type.
-* Sharing Defaults:: Setting site-wide defaults for `configure'.
-* Operation Controls:: Changing how `configure' runs.
-
-Questions About Autoconf
-
-* Distributing:: Distributing `configure' scripts.
-* Why GNU m4:: Why not use the standard `m4'?
-* Bootstrapping:: Autoconf and GNU `m4' require each other?
-* Why Not Imake:: Why GNU uses `configure' instead of Imake.
-
-Upgrading From Version 1
-
-* Changed File Names:: Files you might rename.
-* Changed Makefiles:: New things to put in `Makefile.in'.
-* Changed Macros:: Macro calls you might replace.
-* Invoking autoupdate:: Replacing old macro names in `configure.in'.
-* Changed Results:: Changes in how to check test results.
-* Changed Macro Writing:: Better ways to write your own macros.
-
-History of Autoconf
-
-* Genesis:: Prehistory and naming of `configure'.
-* Exodus:: The plagues of `m4' and Perl.
-* Leviticus:: The priestly code of portability arrives.
-* Numbers:: Growth and contributors.
-* Deuteronomy:: Approaching the promises of easy configuration.
-
-
-File: autoconf.info, Node: Introduction, Next: Making configure Scripts, Prev: Top, Up: Top
-
-Introduction
-************
-
- A physicist, an engineer, and a computer scientist were
- discussing the nature of God. Surely a Physicist, said the
- physicist, because early in the Creation, God made Light; and you
- know, Maxwell's equations, the dual nature of electro-magnetic
- waves, the relativist consequences... An Engineer!, said the
- engineer, because before making Light, God split the Chaos into
- Land and Water; it takes a hell of an engineer to handle that big
- amount of mud, and orderly separation of solids from
- liquids... The computer scientist shouted: And the Chaos,
- where do you think it was coming from, hmm?
-
- ---Anonymous
-
- Autoconf is a tool for producing shell scripts that automatically
-configure software source code packages to adapt to many kinds of
-UNIX-like systems. The configuration scripts produced by Autoconf are
-independent of Autoconf when they are run, so their users do not need to
-have Autoconf.
-
- The configuration scripts produced by Autoconf require no manual user
-intervention when run; they do not normally even need an argument
-specifying the system type. Instead, they test for the presence of each
-feature that the software package they are for might need individually.
-(Before each check, they print a one-line message stating what they are
-checking for, so the user doesn't get too bored while waiting for the
-script to finish.) As a result, they deal well with systems that are
-hybrids or customized from the more common UNIX variants. There is no
-need to maintain files that list the features supported by each release
-of each variant of UNIX.
-
- For each software package that Autoconf is used with, it creates a
-configuration script from a template file that lists the system
-features that the package needs or can use. After the shell code to
-recognize and respond to a system feature has been written, Autoconf
-allows it to be shared by many software packages that can use (or need)
-that feature. If it later turns out that the shell code needs
-adjustment for some reason, it needs to be changed in only one place;
-all of the configuration scripts can be regenerated automatically to
-take advantage of the updated code.
-
- The Metaconfig package is similar in purpose to Autoconf, but the
-scripts it produces require manual user intervention, which is quite
-inconvenient when configuring large source trees. Unlike Metaconfig
-scripts, Autoconf scripts can support cross-compiling, if some care is
-taken in writing them.
-
- There are several jobs related to making portable software packages
-that Autoconf currently does not do. Among these are automatically
-creating `Makefile' files with all of the standard targets, and
-supplying replacements for standard library functions and header files
-on systems that lack them. Work is in progress to add those features in
-the future.
-
- Autoconf imposes some restrictions on the names of macros used with
-`#ifdef' in C programs (*note Preprocessor Symbol Index::.).
-
- Autoconf requires GNU `m4' in order to generate the scripts. It
-uses features that some UNIX versions of `m4' do not have. It also
-overflows internal limits of some versions of `m4', including GNU `m4'
-1.0. You must use version 1.1 or later of GNU `m4'. Using version 1.3
-or later will be much faster than 1.1 or 1.2.
-
- *Note Upgrading::, for information about upgrading from version 1.
-*Note History::, for the story of Autoconf's development. *Note
-Questions::, for answers to some common questions about Autoconf.
-
- Mail suggestions and bug reports for Autoconf to
-`bug-gnu-utils@prep.ai.mit.edu'. Please include the Autoconf version
-number, which you can get by running `autoconf --version'.
-
-
-File: autoconf.info, Node: Making configure Scripts, Next: Setup, Prev: Introduction, Up: Top
-
-Making `configure' Scripts
-**************************
-
- The configuration scripts that Autoconf produces are by convention
-called `configure'. When run, `configure' creates several files,
-replacing configuration parameters in them with appropriate values.
-The files that `configure' creates are:
-
- * one or more `Makefile' files, one in each subdirectory of the
- package (*note Makefile Substitutions::.);
-
- * optionally, a C header file, the name of which is configurable,
- containing `#define' directives (*note Configuration Headers::.);
-
- * a shell script called `config.status' that, when run, will recreate
- the files listed above (*note Invoking config.status::.);
-
- * a shell script called `config.cache' that saves the results of
- running many of the tests (*note Cache Files::.);
-
- * a file called `config.log' containing any messages produced by
- compilers, to help debugging if `configure' makes a mistake.
-
- To create a `configure' script with Autoconf, you need to write an
-Autoconf input file `configure.in' and run `autoconf' on it. If you
-write your own feature tests to supplement those that come with
-Autoconf, you might also write files called `aclocal.m4' and
-`acsite.m4'. If you use a C header file to contain `#define'
-directives, you might also write `acconfig.h', and you will distribute
-the Autoconf-generated file `config.h.in' with the package.
-
- Here is a diagram showing how the files that can be used in
-configuration are produced. Programs that are executed are suffixed by
-`*'. Optional files are enclosed in square brackets (`[]').
-`autoconf' and `autoheader' also read the installed Autoconf macro
-files (by reading `autoconf.m4').
-
-Files used in preparing a software package for distribution:
- your source files --> [autoscan*] --> [configure.scan] --> configure.in
-
- configure.in --. .------> autoconf* -----> configure
- +---+
- [aclocal.m4] --+ `---.
- [acsite.m4] ---' |
- +--> [autoheader*] -> [config.h.in]
- [acconfig.h] ----. |
- +-----'
- [config.h.top] --+
- [config.h.bot] --'
-
- Makefile.in -------------------------------> Makefile.in
-
-Files used in configuring a software package:
- .-------------> config.cache
- configure* ------------+-------------> config.log
- |
- [config.h.in] -. v .-> [config.h] -.
- +--> config.status* -+ +--> make*
- Makefile.in ---' `-> Makefile ---'
-
-* Menu:
-
-* Writing configure.in:: What to put in an Autoconf input file.
-* Invoking autoscan:: Semi-automatic `configure.in' writing.
-* Invoking ifnames:: Listing the conditionals in source code.
-* Invoking autoconf:: How to create configuration scripts.
-* Invoking autoreconf:: Remaking multiple `configure' scripts.
-
-
-File: autoconf.info, Node: Writing configure.in, Next: Invoking autoscan, Up: Making configure Scripts
-
-Writing `configure.in'
-======================
-
- To produce a `configure' script for a software package, create a
-file called `configure.in' that contains invocations of the Autoconf
-macros that test the system features your package needs or can use.
-Autoconf macros already exist to check for many features; see *Note
-Existing Tests::, for their descriptions. For most other features, you
-can use Autoconf template macros to produce custom checks; see *Note
-Writing Tests::, for information about them. For especially tricky or
-specialized features, `configure.in' might need to contain some
-hand-crafted shell commands. The `autoscan' program can give you a
-good start in writing `configure.in' (*note Invoking autoscan::., for
-more information).
-
- The order in which `configure.in' calls the Autoconf macros is not
-important, with a few exceptions. Every `configure.in' must contain a
-call to `AC_INIT' before the checks, and a call to `AC_OUTPUT' at the
-end (*note Output::.). Additionally, some macros rely on other macros
-having been called first, because they check previously set values of
-some variables to decide what to do. These macros are noted in the
-individual descriptions (*note Existing Tests::.), and they also warn
-you when creating `configure' if they are called out of order.
-
- To encourage consistency, here is a suggested order for calling the
-Autoconf macros. Generally speaking, the things near the end of this
-list could depend on things earlier in it. For example, library
-functions could be affected by typedefs and libraries.
-
- `AC_INIT(FILE)'
- checks for programs
- checks for libraries
- checks for header files
- checks for typedefs
- checks for structures
- checks for compiler characteristics
- checks for library functions
- checks for system services
- `AC_OUTPUT([FILE...])'
-
- It is best to put each macro call on its own line in `configure.in'.
-Most of the macros don't add extra newlines; they rely on the newline
-after the macro call to terminate the commands. This approach makes
-the generated `configure' script a little easier to read by not
-inserting lots of blank lines. It is generally safe to set shell
-variables on the same line as a macro call, because the shell allows
-assignments without intervening newlines.
-
- When calling macros that take arguments, there must not be any blank
-space between the macro name and the open parenthesis. Arguments can be
-more than one line long if they are enclosed within the `m4' quote
-characters `[' and `]'. If you have a long line such as a list of file
-names, you can generally use a backslash at the end of a line to
-continue it logically on the next line (this is implemented by the
-shell, not by anything special that Autoconf does).
-
- Some macros handle two cases: what to do if the given condition is
-met, and what to do if the condition is not met. In some places you
-might want to do something if a condition is true but do nothing if it's
-false, or vice versa. To omit the true case, pass an empty value for
-the ACTION-IF-FOUND argument to the macro. To omit the false case,
-omit the ACTION-IF-NOT-FOUND argument to the macro, including the comma
-before it.
-
- You can include comments in `configure.in' files by starting them
-with the `m4' builtin macro `dnl', which discards text up through the
-next newline. These comments do not appear in the generated
-`configure' scripts. For example, it is helpful to begin
-`configure.in' files with a line like this:
-
- dnl Process this file with autoconf to produce a configure script.
-
-
-File: autoconf.info, Node: Invoking autoscan, Next: Invoking ifnames, Prev: Writing configure.in, Up: Making configure Scripts
-
-Using `autoscan' to Create `configure.in'
-=========================================
-
- The `autoscan' program can help you create a `configure.in' file for
-a software package. `autoscan' examines source files in the directory
-tree rooted at a directory given as a command line argument, or the
-current directory if none is given. It searches the source files for
-common portability problems and creates a file `configure.scan' which
-is a preliminary `configure.in' for that package.
-
- You should manually examine `configure.scan' before renaming it to
-`configure.in'; it will probably need some adjustments. Occasionally
-`autoscan' outputs a macro in the wrong order relative to another
-macro, so that `autoconf' produces a warning; you need to move such
-macros manually. Also, if you want the package to use a configuration
-header file, you must add a call to `AC_CONFIG_HEADER' (*note
-Configuration Headers::.). You might also have to change or add some
-`#if' directives to your program in order to make it work with Autoconf
-(*note Invoking ifnames::., for information about a program that can
-help with that job).
-
- `autoscan' uses several data files, which are installed along with
-the distributed Autoconf macro files, to determine which macros to
-output when it finds particular symbols in a package's source files.
-These files all have the same format. Each line consists of a symbol,
-whitespace, and the Autoconf macro to output if that symbol is
-encountered. Lines starting with `#' are comments.
-
- `autoscan' is only installed if you already have Perl installed.
-`autoscan' accepts the following options:
-
-`--help'
- Print a summary of the command line options and exit.
-
-`--macrodir=DIR'
- Look for the data files in directory DIR instead of the default
- installation directory. You can also set the `AC_MACRODIR'
- environment variable to a directory; this option overrides the
- environment variable.
-
-`--verbose'
- Print the names of the files it examines and the potentially
- interesting symbols it finds in them. This output can be
- voluminous.
-
-`--version'
- Print the version number of Autoconf and exit.
-
-
-File: autoconf.info, Node: Invoking ifnames, Next: Invoking autoconf, Prev: Invoking autoscan, Up: Making configure Scripts
-
-Using `ifnames' to List Conditionals
-====================================
-
- `ifnames' can help when writing a `configure.in' for a software
-package. It prints the identifiers that the package already uses in C
-preprocessor conditionals. If a package has already been set up to
-have some portability, this program can help you figure out what its
-`configure' needs to check for. It may help fill in some gaps in a
-`configure.in' generated by `autoscan' (*note Invoking autoscan::.).
-
- `ifnames' scans all of the C source files named on the command line
-(or the standard input, if none are given) and writes to the standard
-output a sorted list of all the identifiers that appear in those files
-in `#if', `#elif', `#ifdef', or `#ifndef' directives. It prints each
-identifier on a line, followed by a space-separated list of the files
-in which that identifier occurs.
-
-`ifnames' accepts the following options:
-
-`--help'
-`-h'
- Print a summary of the command line options and exit.
-
-`--macrodir=DIR'
-`-m DIR'
- Look for the Autoconf macro files in directory DIR instead of the
- default installation directory. Only used to get the version
- number. You can also set the `AC_MACRODIR' environment variable
- to a directory; this option overrides the environment variable.
-
-`--version'
- Print the version number of Autoconf and exit.
-
-
-File: autoconf.info, Node: Invoking autoconf, Next: Invoking autoreconf, Prev: Invoking ifnames, Up: Making configure Scripts
-
-Using `autoconf' to Create `configure'
-======================================
-
- To create `configure' from `configure.in', run the `autoconf'
-program with no arguments. `autoconf' processes `configure.in' with
-the `m4' macro processor, using the Autoconf macros. If you give
-`autoconf' an argument, it reads that file instead of `configure.in'
-and writes the configuration script to the standard output instead of
-to `configure'. If you give `autoconf' the argument `-', it reads the
-standard input instead of `configure.in' and writes the configuration
-script on the standard output.
-
- The Autoconf macros are defined in several files. Some of the files
-are distributed with Autoconf; `autoconf' reads them first. Then it
-looks for the optional file `acsite.m4' in the directory that contains
-the distributed Autoconf macro files, and for the optional file
-`aclocal.m4' in the current directory. Those files can contain your
-site's or the package's own Autoconf macro definitions (*note Writing
-Macros::., for more information). If a macro is defined in more than
-one of the files that `autoconf' reads, the last definition it reads
-overrides the earlier ones.
-
- `autoconf' accepts the following options:
-
-`--help'
-`-h'
- Print a summary of the command line options and exit.
-
-`--localdir=DIR'
-`-l DIR'
- Look for the package file `aclocal.m4' in directory DIR instead of
- in the current directory.
-
-`--macrodir=DIR'
-`-m DIR'
- Look for the installed macro files in directory DIR. You can also
- set the `AC_MACRODIR' environment variable to a directory; this
- option overrides the environment variable.
-
-`--version'
- Print the version number of Autoconf and exit.
-
-
-File: autoconf.info, Node: Invoking autoreconf, Prev: Invoking autoconf, Up: Making configure Scripts
-
-Using `autoreconf' to Update `configure' Scripts
-================================================
-
- If you have a lot of Autoconf-generated `configure' scripts, the
-`autoreconf' program can save you some work. It runs `autoconf' (and
-`autoheader', where appropriate) repeatedly to remake the Autoconf
-`configure' scripts and configuration header templates in the directory
-tree rooted at the current directory. By default, it only remakes
-those files that are older than their `configure.in' or (if present)
-`aclocal.m4'. Since `autoheader' does not change the timestamp of its
-output file if the file wouldn't be changing, this is not necessarily
-the minimum amount of work. If you install a new version of Autoconf,
-you can make `autoreconf' remake *all* of the files by giving it the
-`--force' option.
-
- If you give `autoreconf' the `--macrodir=DIR' or `--localdir=DIR'
-options, it passes them down to `autoconf' and `autoheader' (with
-relative paths adjusted properly).
-
- *Note Automatic Remaking::, for `Makefile' rules to automatically
-remake `configure' scripts when their source files change. That method
-handles the timestamps of configuration header templates properly, but
-does not pass `--macrodir=DIR' or `--localdir=DIR'.
-
-`autoreconf' accepts the following options:
-
-`--help'
-`-h'
- Print a summary of the command line options and exit.
-
-`--force'
-`-f'
- Remake even `configure' scripts and configuration headers that are
- newer than their input files (`configure.in' and, if present,
- `aclocal.m4').
-
-`--localdir=DIR'
-`-l DIR'
- Look for the package files `aclocal.m4' and `acconfig.h' (but not
- `FILE.top' and `FILE.bot') in directory DIR instead of in the
- directory containing each `configure.in'.
-
-`--macrodir=DIR'
-`-m DIR'
- Look for the Autoconf macro files in directory DIR instead of the
- default installation directory. You can also set the `AC_MACRODIR'
- environment variable to a directory; this option overrides the
- environment variable.
-
-`--verbose'
- Print the name of each directory where `autoreconf' runs
- `autoconf' (and `autoheader', if appropriate).
-
-`--version'
- Print the version number of Autoconf and exit.
-
-
-File: autoconf.info, Node: Setup, Next: Existing Tests, Prev: Making configure Scripts, Up: Top
-
-Initialization and Output Files
-*******************************
-
- Autoconf-generated `configure' scripts need some information about
-how to initialize, such as how to find the package's source files; and
-about the output files to produce. The following sections describe
-initialization and creating output files.
-
-* Menu:
-
-* Input:: Where Autoconf should find files.
-* Output:: Creating output files.
-* Makefile Substitutions:: Using output variables in `Makefile's.
-* Configuration Headers:: Creating a configuration header file.
-* Subdirectories:: Configuring independent packages together.
-* Default Prefix:: Changing the default installation prefix.
-* Versions:: Version numbers in `configure'.
-
-
-File: autoconf.info, Node: Input, Next: Output, Up: Setup
-
-Finding `configure' Input
-=========================
-
- Every `configure' script must call `AC_INIT' before doing anything
-else. The only other required macro is `AC_OUTPUT' (*note Output::.).
-
- - Macro: AC_INIT (UNIQUE-FILE-IN-SOURCE-DIR)
- Process any command-line arguments and find the source code
- directory. UNIQUE-FILE-IN-SOURCE-DIR is some file that is in the
- package's source directory; `configure' checks for this file's
- existence to make sure that the directory that it is told contains
- the source code in fact does (*note Invoking configure::., for
- more information).
-
- Packages that do manual configuration or use the `install' program
-might need to tell `configure' where to find some other shell scripts
-by calling `AC_CONFIG_AUX_DIR', though the default places it looks are
-correct for most cases.
-
- - Macro: AC_CONFIG_AUX_DIR(DIR)
- Use the `install-sh', `config.sub', `config.guess', and Cygnus
- `configure' scripts that are in directory DIR. These are
- auxiliary files used in configuration. DIR can be either absolute
- or relative to `SRCDIR'. The default is `SRCDIR' or `SRCDIR/..' or
- `SRCDIR/../..', whichever is the first that contains `install-sh'.
- The other files are not checked for, so that using
- `AC_PROG_INSTALL' does not automatically require distributing the
- other auxiliary files. It checks for `install.sh' also, but that
- name is obsolete because some `make' programs have a rule that
- creates `install' from it if there is no `Makefile'.
-
-
-File: autoconf.info, Node: Output, Next: Makefile Substitutions, Prev: Input, Up: Setup
-
-Creating Output Files
-=====================
-
- Every Autoconf-generated `configure' script must finish by calling
-`AC_OUTPUT'. It is the macro that creates the `Makefile's and optional
-other files resulting from configuration. The only other required
-macro is `AC_INIT' (*note Input::.).
-
- - Macro: AC_OUTPUT ([FILE...] [,EXTRA-CMDS] [,INIT-CMDS])
- Create output files. The FILE... argument is a
- whitespace-separated list of output files; it may be empty. This
- macro creates each file `FILE' by copying an input file (by default
- named `FILE.in'), substituting the output variable values. *Note
- Makefile Substitutions::, for more information on using output
- variables. *Note Setting Output Variables::, for more information
- on creating them. This macro creates the directory that the file
- is in if it doesn't exist (but not the parents of that directory).
- Usually, `Makefile's are created this way, but other files, such
- as `.gdbinit', can be specified as well.
-
- If `AC_CONFIG_HEADER', `AC_LINK_FILES', or `AC_CONFIG_SUBDIRS' has
- been called, this macro also creates the files named as their
- arguments.
-
- A typical call to `AC_OUTPUT' looks like this:
- AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile)
-
- You can override an input file name by appending it to FILE,
- separated by a colon. For example,
- AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk)
-
- If you pass EXTRA-CMDS, those commands will be inserted into
- `config.status' to be run after all its other processing. If
- INIT-CMDS are given, they are inserted just before EXTRA-CMDS,
- with shell variable, command, and backslash substitutions
- performed on them in `configure'. You can use INIT-CMDS to pass
- variables from `configure' to the EXTRA-CMDS.
-
- If you run `make' on subdirectories, you should run it using the
-`make' variable `MAKE'. Most versions of `make' set `MAKE' to the name
-of the `make' program plus any options it was given. (But many do not
-include in it the values of any variables set on the command line, so
-those are not passed on automatically.) Some old versions of `make' do
-not set this variable. The following macro allows you to use it even
-with those versions.
-
- - Macro: AC_PROG_MAKE_SET
- If `make' predefines the variable `MAKE', define output variable
- `SET_MAKE' to be empty. Otherwise, define `SET_MAKE' to contain
- `MAKE=make'. Calls `AC_SUBST' for `SET_MAKE'.
-
- To use this macro, place a line like this in each `Makefile.in' that
-runs `MAKE' on other directories:
-
- @SET_MAKE@
-
-
-File: autoconf.info, Node: Makefile Substitutions, Next: Configuration Headers, Prev: Output, Up: Setup
-
-Substitutions in Makefiles
-==========================
-
- Each subdirectory in a distribution that contains something to be
-compiled or installed should come with a file `Makefile.in', from which
-`configure' will create a `Makefile' in that directory. To create a
-`Makefile', `configure' performs a simple variable substitution,
-replacing occurrences of `@VARIABLE@' in `Makefile.in' with the value
-that `configure' has determined for that variable. Variables that are
-substituted into output files in this way are called "output
-variables". They are ordinary shell variables that are set in
-`configure'. To make `configure' substitute a particular variable into
-the output files, the macro `AC_SUBST' must be called with that
-variable name as an argument. Any occurrences of `@VARIABLE@' for
-other variables are left unchanged. *Note Setting Output Variables::,
-for more information on creating output variables with `AC_SUBST'.
-
- A software package that uses a `configure' script should be
-distributed with a file `Makefile.in', but no `Makefile'; that way, the
-user has to properly configure the package for the local system before
-compiling it.
-
- *Note Makefile Conventions: (standards.info)Makefile Conventions,
-for more information on what to put in `Makefile's.
-
-* Menu:
-
-* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Compiling in a different directory.
-* Automatic Remaking:: Makefile rules for configuring.
-
-
-File: autoconf.info, Node: Preset Output Variables, Next: Build Directories, Up: Makefile Substitutions
-
-Preset Output Variables
------------------------
-
- Some output variables are preset by the Autoconf macros. Some of the
-Autoconf macros set additional output variables, which are mentioned in
-the descriptions for those macros. *Note Output Variable Index::, for a
-complete list of output variables. Here is what each of the preset ones
-contains.
-
- - Variable: configure_input
- A comment saying that the file was generated automatically by
- `configure' and giving the name of the input file. `AC_OUTPUT'
- adds a comment line containing this variable to the top of every
- `Makefile' it creates. For other files, you should reference this
- variable in a comment at the top of each input file. For example,
- an input shell script should begin like this:
-
- #!/bin/sh
- # @configure_input@
-
- The presence of that line also reminds people editing the file
- that it needs to be processed by `configure' in order to be used.
-
- - Variable: exec_prefix
- The installation prefix for architecture-dependent files.
-
- - Variable: prefix
- The installation prefix for architecture-independent files.
-
- - Variable: srcdir
- The directory that contains the source code for that `Makefile'.
-
- - Variable: top_srcdir
- The top-level source code directory for the package. In the
- top-level directory, this is the same as `srcdir'.
-
- - Variable: CFLAGS
- Debugging and optimization options for the C compiler. If it is
- not set in the environment when `configure' runs, the default
- value is set when you call `AC_PROG_CC' (or empty if you don't).
- `configure' uses this variable when compiling programs to test for
- C features.
-
- - Variable: CPPFLAGS
- Header file search directory (`-IDIR') and any other miscellaneous
- options for the C preprocessor and compiler. If it is not set in
- the environment when `configure' runs, the default value is empty.
- `configure' uses this variable when compiling or preprocessing
- programs to test for C features.
-
- - Variable: CXXFLAGS
- Debugging and optimization options for the C++ compiler. If it is
- not set in the environment when `configure' runs, the default
- value is set when you call `AC_PROG_CXX' (or empty if you don't).
- `configure' uses this variable when compiling programs to test for
- C++ features.
-
- - Variable: DEFS
- `-D' options to pass to the C compiler. If `AC_CONFIG_HEADER' is
- called, `configure' replaces `@DEFS@' with `-DHAVE_CONFIG_H'
- instead (*note Configuration Headers::.). This variable is not
- defined while `configure' is performing its tests, only when
- creating the output files. *Note Setting Output Variables::, for
- how to check the results of previous tests.
-
- - Variable: LDFLAGS
- Stripping (`-s') and any other miscellaneous options for the
- linker. If it is not set in the environment when `configure' runs,
- the default value is empty. `configure' uses this variable when
- linking programs to test for C features.
-
- - Variable: LIBS
- `-l' and `-L' options to pass to the linker.
-
-
-File: autoconf.info, Node: Build Directories, Next: Automatic Remaking, Prev: Preset Output Variables, Up: Makefile Substitutions
-
-Build Directories
------------------
-
- You might want to compile a software package in a different directory
-from the one that contains the source code. Doing this allows you to
-compile the package for several architectures simultaneously from the
-same copy of the source code and keep multiple sets of object files on
-disk.
-
- To support doing this, `make' uses the `VPATH' variable to find the
-files that are in the source directory. GNU `make' and most other
-recent `make' programs can do this. Older `make' programs do not
-support `VPATH'; when using them, the source code must be in the same
-directory as the object files.
-
- To support `VPATH', each `Makefile.in' should contain two lines that
-look like:
-
- srcdir = @srcdir@
- VPATH = @srcdir@
-
- Do not set `VPATH' to the value of another variable, for example
-`VPATH = $(srcdir)', because some versions of `make' do not do variable
-substitutions on the value of `VPATH'.
-
- `configure' substitutes in the correct value for `srcdir' when it
-produces `Makefile.in'.
-
- Do not use the `make' variable `$<', which expands to the pathname
-of the file in the source directory (found with `VPATH'), except in
-implicit rules. (An implicit rule is one such as `.c.o', which tells
-how to create a `.o' file from a `.c' file.) Some versions of `make'
-do not set `$<' in explicit rules; they expand it to an empty value.
-
- Instead, `Makefile' command lines should always refer to source
-files by prefixing them with `$(srcdir)/'. For example:
-
- time.info: time.texinfo
- $(MAKEINFO) $(srcdir)/time.texinfo
-
-
-File: autoconf.info, Node: Automatic Remaking, Prev: Build Directories, Up: Makefile Substitutions
-
-Automatic Remaking
-------------------
-
- You can put rules like the following in the top-level `Makefile.in'
-for a package to automatically update the configuration information when
-you change the configuration files. This example includes all of the
-optional files, such as `aclocal.m4' and those related to configuration
-header files. Omit from the `Makefile.in' rules any of these files
-that your package does not use.
-
- The `${srcdir}/' prefix is included because of limitations in the
-`VPATH' mechanism.
-
- The `stamp-' files are necessary because the timestamps of
-`config.h.in' and `config.h' will not be changed if remaking them does
-not change their contents. This feature avoids unnecessary
-recompilation. You should include the file `stamp-h.in' your package's
-distribution, so `make' will consider `config.h.in' up to date. On
-some old BSD systems, `touch' or any command that results in an empty
-file does not update the timestamps, so use a command like `date' as a
-workaround.
-
- ${srcdir}/configure: configure.in aclocal.m4
- cd ${srcdir} && autoconf
-
- # autoheader might not change config.h.in, so touch a stamp file.
- ${srcdir}/config.h.in: stamp-h.in
- ${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h \
- config.h.top config.h.bot
- cd ${srcdir} && autoheader
- date > ${srcdir}/stamp-h.in
-
- config.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
-
- In addition, you should pass `date > stamp-h' in the EXTRA-CMDS
-argument to `AC_OUTPUT', so `config.status' will ensure that `config.h'
-is considered up to date. *Note Output::, for more information about
-`AC_OUTPUT'.
-
- *Note Invoking config.status::, for more examples of handling
-configuration-related dependencies.
-
-
-File: autoconf.info, Node: Configuration Headers, Next: Subdirectories, Prev: Makefile Substitutions, Up: Setup
-
-Configuration Header Files
-==========================
-
- When a package tests more than a few C preprocessor symbols, the
-command lines to pass `-D' options to the compiler can get quite long.
-This causes two problems. One is that the `make' output is hard to
-visually scan for errors. More seriously, the command lines can exceed
-the length limits of some operating systems. As an alternative to
-passing `-D' options to the compiler, `configure' scripts can create a
-C header file containing `#define' directives. The `AC_CONFIG_HEADER'
-macro selects this kind of output. It should be called right after
-`AC_INIT'.
-
- The package should `#include' the configuration header file before
-any other header files, to prevent inconsistencies in declarations (for
-example, if it redefines `const'). Use `#include <config.h>' instead
-of `#include "config.h"', and pass the C compiler a `-I.' option (or
-`-I..'; whichever directory contains `config.h'). That way, even if
-the source directory is configured itself (perhaps to make a
-distribution), other build directories can also be configured without
-finding the `config.h' from the source directory.
-
- - Macro: AC_CONFIG_HEADER (HEADER-TO-CREATE ...)
- Make `AC_OUTPUT' create the file(s) in the whitespace-separated
- list HEADER-TO-CREATE containing C preprocessor `#define'
- statements, and replace `@DEFS@' in generated files with
- `-DHAVE_CONFIG_H' instead of the value of `DEFS'. The usual name
- for HEADER-TO-CREATE is `config.h'.
-
- If HEADER-TO-CREATE already exists and its contents are identical
- to what `AC_OUTPUT' would put in it, it is left alone. Doing this
- allows some changes in configuration without needlessly causing
- object files that depend on the header file to be recompiled.
-
- Usually the input file is named `HEADER-TO-CREATE.in'; however,
- you can override the input file name by appending it to
- HEADER-TO-CREATE, separated by a colon. For example,
- AC_CONFIG_HEADER(defines.h:defines.hin)
-
- Doing this allows you to keep your filenames acceptable to MS-DOS.
-
-* Menu:
-
-* Header Templates:: Input for the configuration headers.
-* Invoking autoheader:: How to create configuration templates.
-
-
-File: autoconf.info, Node: Header Templates, Next: Invoking autoheader, Up: Configuration Headers
-
-Configuration Header Templates
-------------------------------
-
- Your distribution should contain a template file that looks as you
-want the final header file to look, including comments, with default
-values in the `#define' statements. For example, suppose your
-`configure.in' makes these calls:
-
- AC_CONFIG_HEADER(conf.h)
- AC_CHECK_HEADERS(unistd.h)
-
-Then you could have code like the following in `conf.h.in'. On systems
-that have `unistd.h', `configure' will change the 0 to a 1. On other
-systems, it will leave the line unchanged.
-
- /* Define as 1 if you have unistd.h. */
- #define HAVE_UNISTD_H 0
-
- Alternately, if your code tests for configuration options using
-`#ifdef' instead of `#if', a default value can be to `#undef' the
-variable instead of to define it to a value. On systems that have
-`unistd.h', `configure' will change the second line to read `#define
-HAVE_UNISTD_H 1'. On other systems, it will comment that line out (in
-case the system predefines that symbol).
-
- /* Define if you have unistd.h. */
- #undef HAVE_UNISTD_H
-
-
-File: autoconf.info, Node: Invoking autoheader, Prev: Header Templates, Up: Configuration Headers
-
-Using `autoheader' to Create `config.h.in'
-------------------------------------------
-
- The `autoheader' program can create a template file of C `#define'
-statements for `configure' to use. If `configure.in' invokes
-`AC_CONFIG_HEADER(FILE)', `autoheader' creates `FILE.in'. Otherwise,
-`autoheader' creates `config.h.in'.
-
- If you give `autoheader' an argument, it uses that file instead of
-`configure.in' and writes the header file to the standard output
-instead of to `config.h.in'. If you give `autoheader' an argument of
-`-', it reads the standard input instead of `configure.in' and writes
-the header file to the standard output.
-
- `autoheader' scans `configure.in' and figures out which C
-preprocessor symbols it might define. It copies comments and `#define'
-and `#undef' statements from a file called `acconfig.h', which comes
-with and is installed with Autoconf. It also uses a file called
-`acconfig.h' in the current directory, if present. If you `AC_DEFINE'
-any additional symbols, you must create that file with entries for
-them. For symbols defined by `AC_CHECK_HEADERS', `AC_CHECK_FUNCS',
-`AC_CHECK_SIZEOF', or `AC_CHECK_LIB', `autoheader' generates comments
-and `#undef' statements itself rather than copying them from a file,
-since the possible symbols are effectively limitless.
-
- The file that `autoheader' creates contains mainly `#define' and
-`#undef' statements and their accompanying comments. If `./acconfig.h'
-contains the string `@TOP@', `autoheader' copies the lines before the
-line containing `@TOP@' into the top of the file that it generates.
-Similarly, if `./acconfig.h' contains the string `@BOTTOM@',
-`autoheader' copies the lines after that line to the end of the file it
-generates. Either or both of those strings may be omitted.
-
- An alternate way to produce the same effect is to create the files
-`FILE.top' (typically `config.h.top') and/or `FILE.bot' in the current
-directory. If they exist, `autoheader' copies them to the beginning
-and end, respectively, of its output. Their use is discouraged because
-they have file names that contain two periods, and so can not be stored
-on MS-DOS; also, they are two more files to clutter up the directory.
-But if you use the `--localdir=DIR' option to use an `acconfig.h' in
-another directory, they give you a way to put custom boilerplate in each
-individual `config.h.in'.
-
- `autoheader' accepts the following options:
-
-`--help'
-`-h'
- Print a summary of the command line options and exit.
-
-`--localdir=DIR'
-`-l DIR'
- Look for the package files `aclocal.m4' and `acconfig.h' (but not
- `FILE.top' and `FILE.bot') in directory DIR instead of in the
- current directory.
-
-`--macrodir=DIR'
-`-m DIR'
- Look for the installed macro files and `acconfig.h' in directory
- DIR. You can also set the `AC_MACRODIR' environment variable to a
- directory; this option overrides the environment variable.
-
-`--version'
- Print the version number of Autoconf and exit.
-
-
-File: autoconf.info, Node: Subdirectories, Next: Default Prefix, Prev: Configuration Headers, Up: Setup
-
-Configuring Other Packages in Subdirectories
-============================================
-
- In most situations, calling `AC_OUTPUT' is sufficient to produce
-`Makefile's in subdirectories. However, `configure' scripts that
-control more than one independent package can use `AC_CONFIG_SUBDIRS'
-to run `configure' scripts for other packages in subdirectories.
-
- - Macro: AC_CONFIG_SUBDIRS (DIR ...)
- Make `AC_OUTPUT' run `configure' in each subdirectory DIR in the
- given whitespace-separated list. If a given DIR is not found, no
- error is reported, so a `configure' script can configure whichever
- parts of a large source tree are present. If a given DIR contains
- `configure.in' but no `configure', the Cygnus `configure' script
- found by `AC_CONFIG_AUXDIR' is used. The subdirectory `configure'
- scripts are given the same command line options that were given to
- this `configure' script, with minor changes if needed (e.g., to
- adjust a relative path for the cache file or source directory).
- This macro also sets the output variable `subdirs' to the list of
- directories `DIR ...'. `Makefile' rules can use this variable to
- determine which subdirectories to recurse into.
-
-
-File: autoconf.info, Node: Default Prefix, Next: Versions, Prev: Subdirectories, Up: Setup
-
-Default Prefix
-==============
-
- By default, `configure' sets the prefix for files it installs to
-`/usr/local'. The user of `configure' can select a different prefix
-using the `--prefix' and `--exec-prefix' options. There are two ways
-to change the default: when creating `configure', and when running it.
-
- Some software packages might want to install in a directory besides
-`/usr/local' by default. To accomplish that, use the
-`AC_PREFIX_DEFAULT' macro.
-
- - Macro: AC_PREFIX_DEFAULT (PREFIX)
- Set the default installation prefix to PREFIX instead of
- `/usr/local'.
-
- It may be convenient for users to have `configure' guess the
-installation prefix from the location of a related program that they
-have already installed. If you wish to do that, you can call
-`AC_PREFIX_PROGRAM'.
-
- - Macro: AC_PREFIX_PROGRAM (PROGRAM)
- If the user did not specify an installation prefix (using the
- `--prefix' option), guess a value for it by looking for PROGRAM in
- `PATH', the way the shell does. If PROGRAM is found, set the
- prefix to the parent of the directory containing PROGRAM;
- otherwise leave the prefix specified in `Makefile.in' unchanged.
- For example, if PROGRAM is `gcc' and the `PATH' contains
- `/usr/local/gnu/bin/gcc', set the prefix to `/usr/local/gnu'.
-
diff --git a/util/autoconf/autoconf.info-2 b/util/autoconf/autoconf.info-2
deleted file mode 100644
index ae8fc7b..0000000
--- a/util/autoconf/autoconf.info-2
+++ /dev/null
@@ -1,1214 +0,0 @@
-This is Info file autoconf.info, produced by Makeinfo-1.55 from the
-input file ./autoconf.texi.
-
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an `m4' macro
-package.
-
- Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-File: autoconf.info, Node: Versions, Prev: Default Prefix, Up: Setup
-
-Version Numbers in `configure'
-==============================
-
- The following macros manage version numbers for `configure' scripts.
-Using them is optional.
-
- - Macro: AC_PREREQ (VERSION)
- Ensure that a recent enough version of Autoconf is being used. If
- the version of Autoconf being used to create `configure' is earlier
- than VERSION, print an error message on the standard error output
- and do not create `configure'. For example:
-
- AC_PREREQ(1.8)
-
- This macro is useful if your `configure.in' relies on non-obvious
- behavior that changed between Autoconf releases. If it merely
- needs recently added macros, then `AC_PREREQ' is less useful,
- because the `autoconf' program already tells the user which macros
- are not found. The same thing happens if `configure.in' is
- processed by a version of Autoconf older than when `AC_PREREQ' was
- added.
-
- - Macro: AC_REVISION (REVISION-INFO)
- Copy revision stamp REVISION-INFO into the `configure' script,
- with any dollar signs or double-quotes removed. This macro lets
- you put a revision stamp from `configure.in' into `configure'
- without RCS or CVS changing it when you check in `configure'. That
- way, you can determine easily which revision of `configure.in' a
- particular `configure' corresponds to.
-
- It is a good idea to call this macro before `AC_INIT' so that the
- revision number is near the top of both `configure.in' and
- `configure'. To support doing that, the `AC_REVISION' output
- begins with `#!/bin/sh', like the normal start of a `configure'
- script does.
-
- For example, this line in `configure.in':
-
- AC_REVISION($Revision$)dnl
-
- produces this in `configure':
-
- #!/bin/sh
- # From configure.in Revision: 1.30
-
-
-File: autoconf.info, Node: Existing Tests, Next: Writing Tests, Prev: Setup, Up: Top
-
-Existing Tests
-**************
-
- These macros test for particular system features that packages might
-need or want to use. If you need to test for a kind of feature that
-none of these macros check for, you can probably do it by calling
-primitive test macros with appropriate arguments (*note Writing
-Tests::.).
-
- These tests print messages telling the user which feature they're
-checking for, and what they find. They cache their results for future
-`configure' runs (*note Caching Results::.).
-
- Some of these macros set output variables. *Note Makefile
-Substitutions::, for how to get their values. The phrase "define NAME"
-is used below as a shorthand to mean "define C preprocessor symbol NAME
-to the value 1". *Note Defining Symbols::, for how to get those symbol
-definitions into your program.
-
-* Menu:
-
-* Alternative Programs:: Selecting between alternative programs.
-* Libraries:: Library archives that might be missing.
-* Library Functions:: C library functions that might be missing.
-* Header Files:: Header files that might be missing.
-* Structures:: Structures or members that might be missing.
-* Typedefs:: `typedef's that might be missing.
-* Compiler Characteristics:: C compiler or machine architecture features.
-* System Services:: Operating system services.
-* UNIX Variants:: Special kludges for specific UNIX variants.
-
-
-File: autoconf.info, Node: Alternative Programs, Next: Libraries, Up: Existing Tests
-
-Alternative Programs
-====================
-
- These macros check for the presence or behavior of particular
-programs. They are used to choose between several alternative programs
-and to decide what to do once one has been chosen. If there is no
-macro specifically defined to check for a program you need, and you
-don't need to check for any special properties of it, then you can use
-one of the general program check macros.
-
-* Menu:
-
-* Particular Programs:: Special handling to find certain programs.
-* Generic Programs:: How to find other programs.
-
-
-File: autoconf.info, Node: Particular Programs, Next: Generic Programs, Up: Alternative Programs
-
-Particular Program Checks
--------------------------
-
- These macros check for particular programs--whether they exist, and
-in some cases whether they support certain features.
-
- - Macro: AC_DECL_YYTEXT
- Define `YYTEXT_POINTER' if `yytext' is a `char *' instead of a
- `char []'. Also set output variable `LEX_OUTPUT_ROOT' to the base
- of the file name that the lexer generates; usually `lex.yy', but
- sometimes something else. These results vary according to whether
- `lex' or `flex' is being used.
-
- - Macro: AC_PROG_AWK
- Check for `mawk', `gawk', `nawk', and `awk', in that order, and
- set output variable `AWK' to the first one that it finds. It
- tries `mawk' first because that is reported to be the fastest
- implementation.
-
- - Macro: AC_PROG_CC
- Determine a C compiler to use. If `CC' is not already set in the
- environment, check for `gcc', and use `cc' if it's not found. Set
- output variable `CC' to the name of the compiler found.
-
- If using the GNU C compiler, set shell variable `GCC' to `yes',
- empty otherwise. If output variable `CFLAGS' was not already set,
- set it to `-g -O' for the GNU C compiler (`-O' on systems where
- GCC does not accept `-g'), or `-g' for other compilers.
-
- - Macro: AC_PROG_CC_C_O
- If the C compiler does not accept the `-c' and `-o' options
- simultaneously, define `NO_MINUS_C_MINUS_O'.
-
- - Macro: AC_PROG_CPP
- Set output variable `CPP' to a command that runs the C
- preprocessor. If `$CC -E' doesn't work, it uses `/lib/cpp'. It
- is only portable to run `CPP' on files with a `.c' extension.
-
- If the current language is C (*note Language Choice::.), many of
- the specific test macros use the value of `CPP' indirectly by
- calling `AC_TRY_CPP', `AC_CHECK_HEADER', `AC_EGREP_HEADER', or
- `AC_EGREP_CPP'.
-
- - Macro: AC_PROG_CXX
- Determine a C++ compiler to use. Check if the environment variable
- `CXX' or `CCC' (in that order) is set; if so, set output variable
- `CXX' to its value. Otherwise search for a C++ compiler under
- likely names (`c++', `g++', `gcc', `CC', and `cxx'). If none of
- those checks succeed, as a last resort set `CXX' to `gcc'.
-
- If using the GNU C++ compiler, set shell variable `GXX' to `yes',
- empty otherwise. If output variable `CXXFLAGS' was not already
- set, set it to `-g -O' for the GNU C++ compiler (`-O' on systems
- where G++ does not accept `-g'), or `-g' for other compilers.
-
- - Macro: AC_PROG_CXXCPP
- Set output variable `CXXCPP' to a command that runs the C++
- preprocessor. If `$CXX -E' doesn't work, it uses `/lib/cpp'. It
- is only portable to run `CXXCPP' on files with a `.c', `.C', or
- `.cc' extension.
-
- If the current language is C++ (*note Language Choice::.), many of
- the specific test macros use the value of `CXXCPP' indirectly by
- calling `AC_TRY_CPP', `AC_CHECK_HEADER', `AC_EGREP_HEADER', or
- `AC_EGREP_CPP'.
-
- - Macro: AC_PROG_GCC_TRADITIONAL
- Add `-traditional' to output variable `CC' if using the GNU C
- compiler and `ioctl' does not work properly without
- `-traditional'. That usually happens when the fixed header files
- have not been installed on an old system. Since recent versions
- of the GNU C compiler fix the header files automatically when
- installed, this is becoming a less prevalent problem.
-
- - Macro: AC_PROG_INSTALL
- Set output variable `INSTALL' to the path of a BSD compatible
- `install' program, if one is found in the current `PATH'.
- Otherwise, set `INSTALL' to `DIR/install-sh -c', checking the
- directories specified to `AC_CONFIG_AUX_DIR' (or its default
- directories) to determine DIR (*note Output::.). Also set the
- variable `INSTALL_PROGRAM' to `${INSTALL}' and `INSTALL_DATA' to
- `${INSTALL} -m 644'.
-
- This macro screens out various instances of `install' known to not
- work. It prefers to find a C program rather than a shell script,
- for speed. Instead of `install-sh', it can also use `install.sh',
- but that name is obsolete because some `make' programs have a rule
- that creates `install' from it if there is no `Makefile'.
-
- A copy of `install-sh' which you may use comes with Autoconf. If
- you use `AC_PROG_INSTALL', you must include either `install-sh' or
- `install.sh' in your distribution, or `configure' will produce an
- error message saying it can't find them--even if the system you're
- on has a good `install' program. This check is a safety measure
- to prevent you from accidentally leaving that file out, which
- would prevent your package from installing on systems that don't
- have a BSD-compatible `install' program.
-
- If you need to use your own installation program because it has
- features not found in standard `install' programs, there is no
- reason to use `AC_PROG_INSTALL'; just put the pathname of your
- program into your `Makefile.in' files.
-
- - Macro: AC_PROG_LEX
- If `flex' is found, set output variable `LEX' to `flex' and
- `LEXLIB' to `-lfl', if that library is in a standard place.
- Otherwise set `LEX' to `lex' and `LEXLIB' to `-ll'.
-
- - Macro: AC_PROG_LN_S
- If `ln -s' works on the current filesystem (the operating system
- and filesystem support symbolic links), set output variable `LN_S'
- to `ln -s', otherwise set it to `ln'.
-
- - Macro: AC_PROG_RANLIB
- Set output variable `RANLIB' to `ranlib' if `ranlib' is found,
- otherwise to `:' (do nothing).
-
- - Macro: AC_PROG_YACC
- If `bison' is found, set output variable `YACC' to `bison -y'.
- Otherwise, if `byacc' is found, set `YACC' to `byacc'. Otherwise
- set `YACC' to `yacc'.
-
-
-File: autoconf.info, Node: Generic Programs, Prev: Particular Programs, Up: Alternative Programs
-
-Generic Program Checks
-----------------------
-
- These macros are used to find programs not covered by the particular
-test macros. If you need to check the behavior of a program as well as
-find out whether it is present, you have to write your own test for it
-(*note Writing Tests::.).
-
- - Macro: AC_CHECK_PROG (VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND [,
- VALUE-IF-NOT-FOUND])
- Check whether program PROG-TO-CHECK-FOR exists in `PATH'. If it
- is found, set VARIABLE to VALUE-IF-FOUND, otherwise to
- VALUE-IF-NOT-FOUND, if given. If VARIABLE was already set, do
- nothing. Calls `AC_SUBST' for VARIABLE.
-
- - Macro: AC_CHECK_PROGS (VARIABLE, PROGS-TO-CHECK-FOR [,
- VALUE-IF-NOT-FOUND])
- Check for each program in the whitespace-separated list
- PROGS-TO-CHECK-FOR exists in `PATH'. If it is found, set VARIABLE
- to the name of that program. Otherwise, continue checking the
- next program in the list. If none of the programs in the list are
- found, set VARIABLE to VALUE-IF-NOT-FOUND; if VALUE-IF-NOT-FOUND
- is not specified, the value of VARIABLE is not changed. Calls
- `AC_SUBST' for VARIABLE.
-
- - Macro: AC_PATH_PROG (VARIABLE, PROG-TO-CHECK-FOR [,
- VALUE-IF-NOT-FOUND])
- Like `AC_CHECK_PROG', but set VARIABLE to the entire path of
- PROG-TO-CHECK-FOR if found.
-
- - Macro: AC_PATH_PROGS (VARIABLE, PROGS-TO-CHECK-FOR [,
- VALUE-IF-NOT-FOUND])
- Like `AC_CHECK_PROGS', but if any of PROGS-TO-CHECK-FOR are found,
- set VARIABLE to the entire path of the program found.
-
-
-File: autoconf.info, Node: Libraries, Next: Library Functions, Prev: Alternative Programs, Up: Existing Tests
-
-Library Files
-=============
-
- The following macros check for the presence of certain C library
-archive files.
-
- - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
- Try to ensure that C function FUNCTION is available by checking
- whether a test C program can be linked with the library LIBRARY to
- get the function. LIBRARY is the base name of the library; e.g.,
- to check for `-lmp', use `mp' as the LIBRARY argument.
-
- ACTION-IF-FOUND is a list of shell commands to run if the link
- with the library succeeds; ACTION-IF-NOT-FOUND is a list of shell
- commands to run if the link fails. If ACTION-IF-FOUND and
- ACTION-IF-NOT-FOUND are not specified, the default action is to
- add `-lLIBRARY' to `LIBS' and define `HAVE_LIBLIBRARY' (in all
- capitals).
-
- If linking with LIBRARY results in unresolved symbols, which would
- be resolved by linking with additional libraries, give those
- libraries as the OTHER-LIBRARIES argument, separated by spaces:
- `-lX11 -lXt'. Otherwise this macro will fail to detect that
- LIBRARY is present, because linking the test program will always
- fail with unresolved symbols.
-
- - Macro: AC_HAVE_LIBRARY (LIBRARY, [, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
- This macro is equivalent to calling `AC_CHECK_LIB' with a FUNCTION
- argument of `main'. In addition, LIBRARY can be written as any of
- `foo', `-lfoo', or `libfoo.a'. In all of those cases, the
- compiler is passed `-lfoo'. However, LIBRARY can not be a shell
- variable; it must be a literal name. This macro is considered
- obsolete.
-
-
-File: autoconf.info, Node: Library Functions, Next: Header Files, Prev: Libraries, Up: Existing Tests
-
-Library Functions
-=================
-
- The following macros check for particular C library functions. If
-there is no macro specifically defined to check for a function you need,
-and you don't need to check for any special properties of it, then you
-can use one of the general function check macros.
-
-* Menu:
-
-* Particular Functions:: Special handling to find certain functions.
-* Generic Functions:: How to find other functions.
-
-
-File: autoconf.info, Node: Particular Functions, Next: Generic Functions, Up: Library Functions
-
-Particular Function Checks
---------------------------
-
- These macros check for particular C functions--whether they exist,
-and in some cases how they respond when given certain arguments.
-
- - Macro: AC_FUNC_ALLOCA
- Check how to get `alloca'. Tries to get a builtin version by
- checking for `alloca.h' or the predefined C preprocessor macros
- `__GNUC__' and `_AIX'. If this macro finds `alloca.h', it defines
- `HAVE_ALLOCA_H'.
-
- If those attempts fail, it looks for the function in the standard C
- library. If any of those methods succeed, it defines
- `HAVE_ALLOCA'. Otherwise, it sets the output variable `ALLOCA' to
- `alloca.o' and defines `C_ALLOCA' (so programs can periodically
- call `alloca(0)' to garbage collect). This variable is separate
- from `LIBOBJS' so multiple programs can share the value of
- `ALLOCA' without needing to create an actual library, in case only
- some of them use the code in `LIBOBJS'.
-
- This macro does not try to get `alloca' from the System V R3
- `libPW' or the System V R4 `libucb' because those libraries
- contain some incompatible functions that cause trouble. Some
- versions do not even contain `alloca' or contain a buggy version.
- If you still want to use their `alloca', use `ar' to extract
- `alloca.o' from them instead of compiling `alloca.c'.
-
- Source files that use `alloca' should start with a piece of code
- like the following, to declare it properly. In some versions of
- AIX, the declaration of `alloca' must precede everything else
- except for comments and preprocessor directives. The `#pragma'
- directive is indented so that pre-ANSI C compilers will ignore it,
- rather than choke on it.
-
- /* AIX requires this to be the first thing in the file. */
- #ifdef __GNUC__
- # define alloca __builtin_alloca
- #else
- # if HAVE_ALLOCA_H
- # include <alloca.h>
- # else
- # ifdef _AIX
- #pragma alloca
- # else
- # ifndef alloca /* predefined by HP cc +Olibcalls */
- char *alloca ();
- # endif
- # endif
- # endif
- #endif
-
- - Macro: AC_FUNC_CLOSEDIR_VOID
- If the `closedir' function does not return a meaningful value,
- define `CLOSEDIR_VOID'. Otherwise, callers ought to check its
- return value for an error indicator.
-
- - Macro: AC_FUNC_GETLOADAVG
- Check how to get the system load averages. If the system has the
- `getloadavg' function, this macro defines `HAVE_GETLOADAVG', and
- adds to `LIBS' any libraries needed to get that function.
-
- Otherwise, it adds `getloadavg.o' to the output variable
- `LIBOBJS', and possibly defines several other C preprocessor
- macros and output variables:
-
- 1. It defines `SVR4', `DGUX', `UMAX', or `UMAX4_3' if on those
- systems.
-
- 2. If it finds `nlist.h', it defines `NLIST_STRUCT'.
-
- 3. If `struct nlist' has an `n_un' member, it defines
- `NLIST_NAME_UNION'.
-
- 4. If compiling `getloadavg.c' defines `LDAV_PRIVILEGED',
- programs need to be installed specially on this system for
- `getloadavg' to work, and this macro defines
- `GETLOADAVG_PRIVILEGED'.
-
- 5. This macro sets the output variable `NEED_SETGID'. The value
- is `true' if special installation is required, `false' if not.
- If `NEED_SETGID' is `true', this macro sets `KMEM_GROUP' to
- the name of the group that should own the installed program.
-
- - Macro: AC_FUNC_GETMNTENT
- Check for the `getmntent' in the `sun' and `seq' libraries, for
- Irix 4 and PTX, respectively. Then, if `getmntent' is available,
- define `HAVE_GETMNTENT'.
-
- - Macro: AC_FUNC_MEMCMP
- If the `memcmp' function is not available, or does not work on
- 8-bit data (like the one on SunOS 4.1.3), add `memcmp.o' to output
- variable `LIBOBJS'.
-
- - Macro: AC_FUNC_MMAP
- If the `mmap' function exists and works correctly on memory mapped
- files, define `HAVE_MMAP'.
-
- - Macro: AC_FUNC_SETVBUF_REVERSED
- If `setvbuf' takes the buffering type as its second argument and
- the buffer pointer as the third, instead of the other way around,
- define `SETVBUF_REVERSED'. This is the case on System V before
- release 3.
-
- - Macro: AC_FUNC_STRCOLL
- If the `strcoll' function exists and works correctly, define
- `HAVE_STRCOLL'. This does a bit more than
- `AC_CHECK_FUNCS(strcoll)', because some systems have incorrect
- definitions of `strcoll', which should not be used.
-
- - Macro: AC_FUNC_STRFTIME
- Check for `strftime' in the `intl' library, for SCO UNIX. Then,
- if `strftime' is available, define `HAVE_STRFTIME'.
-
- - Macro: AC_FUNC_UTIME_NULL
- If `utime(FILE, NULL)' sets FILE's timestamp to the present,
- define `HAVE_UTIME_NULL'.
-
- - Macro: AC_FUNC_VFORK
- If `vfork.h' is found, define `HAVE_VFORK_H'. If a working
- `vfork' is not found, define `vfork' to be `fork'. This macro
- checks for several known errors in implementations of `vfork' and
- considers the system to not have a working `vfork' if it detects
- any of them.
-
- - Macro: AC_FUNC_VPRINTF
- If `vprintf' is found, define `HAVE_VPRINTF'. Otherwise, if
- `_doprnt' is found, define `HAVE_DOPRNT'. (If `vprintf' is
- available, you may assume that `vfprintf' and `vsprintf' are also
- available.)
-
- - Macro: AC_FUNC_WAIT3
- If `wait3' is found and fills in the contents of its third argument
- (a `struct rusage *'), which HP-UX does not do, define
- `HAVE_WAIT3'.
-
-
-File: autoconf.info, Node: Generic Functions, Prev: Particular Functions, Up: Library Functions
-
-Generic Function Checks
------------------------
-
- These macros are used to find functions not covered by the particular
-test macros. If the functions might be in libraries other than the
-default C library, first call `AC_CHECK_LIB' for those libraries. If
-you need to check the behavior of a function as well as find out
-whether it is present, you have to write your own test for it (*note
-Writing Tests::.).
-
- - Macro: AC_CHECK_FUNC (FUNCTION, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND])
- If C function FUNCTION is available, run shell commands
- ACTION-IF-FOUND, otherwise ACTION-IF-NOT-FOUND. If you just want
- to define a symbol if the function is available, consider using
- `AC_CHECK_FUNCS' instead. This macro checks for functions with C
- linkage even when `AC_LANG_CPLUSPLUS' has been called, since C++ is
- more standardized than C is. (*note Language Choice::., for more
- information about selecting the language for checks.)
-
- - Macro: AC_CHECK_FUNCS (FUNCTION... [, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND]])
- For each given FUNCTION in the whitespace-separated argument list
- that is available, define `HAVE_FUNCTION' (in all capitals). If
- ACTION-IF-FOUND is given, it is additional shell code to execute
- when one of the functions is found. You can give it a value of
- `break' to break out of the loop on the first match. If
- ACTION-IF-NOT-FOUND is given, it is executed when one of the
- functions is not found.
-
- - Macro: AC_REPLACE_FUNCS (FUNCTION-NAME...)
- For each given FUNCTION-NAME in the whitespace-separated argument
- list that is not in the C library, add `FUNCTION-NAME.o' to the
- value of the output variable `LIBOBJS'.
-
-
-File: autoconf.info, Node: Header Files, Next: Structures, Prev: Library Functions, Up: Existing Tests
-
-Header Files
-============
-
- The following macros check for the presence of certain C header
-files. If there is no macro specifically defined to check for a header
-file you need, and you don't need to check for any special properties of
-it, then you can use one of the general header file check macros.
-
-* Menu:
-
-* Particular Headers:: Special handling to find certain headers.
-* Generic Headers:: How to find other headers.
-
-
-File: autoconf.info, Node: Particular Headers, Next: Generic Headers, Up: Header Files
-
-Particular Header Checks
-------------------------
-
- These macros check for particular system header files--whether they
-exist, and in some cases whether they declare certain symbols.
-
- - Macro: AC_DECL_SYS_SIGLIST
- Define `SYS_SIGLIST_DECLARED' if the variable `sys_siglist' is
- declared in a system header file, either `signal.h' or `unistd.h'.
-
- - Macro: AC_DIR_HEADER
- Like calling `AC_HEADER_DIRENT' and `AC_FUNC_CLOSEDIR_VOID', but
- defines a different set of C preprocessor macros to indicate which
- header file is found. This macro and the names it defines are
- considered obsolete. The names it defines are:
-
- `dirent.h'
- `DIRENT'
-
- `sys/ndir.h'
- `SYSNDIR'
-
- `sys/dir.h'
- `SYSDIR'
-
- `ndir.h'
- `NDIR'
-
- In addition, if the `closedir' function does not return a
- meaningful value, define `VOID_CLOSEDIR'.
-
- - Macro: AC_HEADER_DIRENT
- Check for the following header files, and for the first one that is
- found and defines `DIR', define the listed C preprocessor macro:
-
- `dirent.h'
- `HAVE_DIRENT_H'
-
- `sys/ndir.h'
- `HAVE_SYS_NDIR_H'
-
- `sys/dir.h'
- `HAVE_SYS_DIR_H'
-
- `ndir.h'
- `HAVE_NDIR_H'
-
- The directory library declarations in the source code should look
- something like the following:
-
- #if HAVE_DIRENT_H
- # include <dirent.h>
- # define NAMLEN(dirent) strlen((dirent)->d_name)
- #else
- # define dirent direct
- # define NAMLEN(dirent) (dirent)->d_namlen
- # if HAVE_SYS_NDIR_H
- # include <sys/ndir.h>
- # endif
- # if HAVE_SYS_DIR_H
- # include <sys/dir.h>
- # endif
- # if HAVE_NDIR_H
- # include <ndir.h>
- # endif
- #endif
-
- Using the above declarations, the program would declare variables
- to be type `struct dirent', not `struct direct', and would access
- the length of a directory entry name by passing a pointer to a
- `struct dirent' to the `NAMLEN' macro.
-
- This macro also checks for the SCO Xenix `dir' and `x' libraries.
-
- - Macro: AC_HEADER_MAJOR
- If `sys/types.h' does not define `major', `minor', and `makedev',
- but `sys/mkdev.h' does, define `MAJOR_IN_MKDEV'; otherwise, if
- `sys/sysmacros.h' does, define `MAJOR_IN_SYSMACROS'.
-
- - Macro: AC_HEADER_STDC
- Define `STDC_HEADERS' if the system has ANSI C header files.
- Specifically, this macro checks for `stdlib.h', `stdarg.h',
- `string.h', and `float.h'; if the system has those, it probably
- has the rest of the ANSI C header files. This macro also checks
- whether `string.h' declares `memchr' (and thus presumably the
- other `mem' functions), whether `stdlib.h' declare `free' (and
- thus presumably `malloc' and other related functions), and whether
- the `ctype.h' macros work on characters with the high bit set, as
- ANSI C requires.
-
- Use `STDC_HEADERS' instead of `__STDC__' to determine whether the
- system has ANSI-compliant header files (and probably C library
- functions) because many systems that have GCC do not have ANSI C
- header files.
-
- On systems without ANSI C headers, there is so much variation that
- it is probably easier to declare the functions you use than to
- figure out exactly what the system header files declare. Some
- systems contain a mix of functions ANSI and BSD; some are mostly
- ANSI but lack `memmove'; some define the BSD functions as macros in
- `string.h' or `strings.h'; some have only the BSD functions but
- `string.h'; some declare the memory functions in `memory.h', some
- in `string.h'; etc. It is probably sufficient to check for one
- string function and one memory function; if the library has the
- ANSI versions of those then it probably has most of the others.
- If you put the following in `configure.in':
-
- AC_HEADER_STDC
- AC_CHECK_FUNCS(strchr memcpy)
-
- then, in your code, you can put declarations like this:
-
- #if STDC_HEADERS
- # include <string.h>
- #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
-
- If you use a function like `memchr', `memset', `strtok', or
- `strspn', which have no BSD equivalent, then macros won't suffice;
- you must provide an implementation of each function. An easy way
- to incorporate your implementations only when needed (since the
- ones in system C libraries may be hand optimized) is to, taking
- `memchr' for example, put it in `memchr.c' and use
- `AC_REPLACE_FUNCS(memchr)'.
-
- - Macro: AC_HEADER_SYS_WAIT
- If `sys/wait.h' exists and is compatible with POSIX.1, define
- `HAVE_SYS_WAIT_H'. Incompatibility can occur if `sys/wait.h' does
- not exist, or if it uses the old BSD `union wait' instead of `int'
- to store a status value. If `sys/wait.h' is not POSIX.1
- compatible, then instead of including it, define the POSIX.1
- macros with their usual interpretations. Here is an example:
-
- #include <sys/types.h>
- #if HAVE_SYS_WAIT_H
- # include <sys/wait.h>
- #endif
- #ifndef WEXITSTATUS
- # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
- #endif
- #ifndef WIFEXITED
- # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
- #endif
-
- - Macro: AC_MEMORY_H
- Define `NEED_MEMORY_H' if `memcpy', `memcmp', etc. are not
- declared in `string.h' and `memory.h' exists. This macro is
- obsolete; instead, use `AC_CHECK_HEADERS(memory.h)'. See the
- example for `AC_HEADER_STDC'.
-
- - Macro: AC_UNISTD_H
- Define `HAVE_UNISTD_H' if the system has `unistd.h'. This macro
- is obsolete; instead, use `AC_CHECK_HEADERS(unistd.h)'.
-
- The way to check if the system supports POSIX.1 is:
-
- #if HAVE_UNISTD_H
- # include <sys/types.h>
- # include <unistd.h>
- #endif
-
- #ifdef _POSIX_VERSION
- /* Code for POSIX.1 systems. */
- #endif
-
- `_POSIX_VERSION' is defined when `unistd.h' is included on POSIX.1
- systems. If there is no `unistd.h', it is definitely not a
- POSIX.1 system. However, some non-POSIX.1 systems do have
- `unistd.h'.
-
- - Macro: AC_USG
- Define `USG' if the system does not have `strings.h', `rindex',
- `bzero', etc. This implies that it has `string.h', `strrchr',
- `memset', etc.
-
- The symbol `USG' is obsolete. Instead of this macro, see the
- example for `AC_HEADER_STDC'.
-
-
-File: autoconf.info, Node: Generic Headers, Prev: Particular Headers, Up: Header Files
-
-Generic Header Checks
----------------------
-
- These macros are used to find system header files not covered by the
-particular test macros. If you need to check the contents of a header
-as well as find out whether it is present, you have to write your own
-test for it (*note Writing Tests::.).
-
- - Macro: AC_CHECK_HEADER (HEADER-FILE, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND])
- If the system header file HEADER-FILE exists, execute shell
- commands ACTION-IF-FOUND, otherwise execute ACTION-IF-NOT-FOUND.
- If you just want to define a symbol if the header file is
- available, consider using `AC_CHECK_HEADERS' instead.
-
- - Macro: AC_CHECK_HEADERS (HEADER-FILE... [, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND]])
- For each given system header file HEADER-FILE in the
- whitespace-separated argument list that exists, define
- `HAVE_HEADER-FILE' (in all capitals). If ACTION-IF-FOUND is
- given, it is additional shell code to execute when one of the
- header files is found. You can give it a value of `break' to
- break out of the loop on the first match. If ACTION-IF-NOT-FOUND
- is given, it is executed when one of the header files is not found.
-
-
-File: autoconf.info, Node: Structures, Next: Typedefs, Prev: Header Files, Up: Existing Tests
-
-Structures
-==========
-
- The following macros check for certain structures or structure
-members. To check structures not listed here, use `AC_EGREP_CPP'
-(*note Examining Declarations::.) or `AC_TRY_COMPILE' (*note Examining
-Syntax::.).
-
- - Macro: AC_HEADER_STAT
- If the macros `S_ISDIR', `S_ISREG' et al. defined in `sys/stat.h'
- do not work properly (returning false positives), define
- `STAT_MACROS_BROKEN'. This is the case on Tektronix UTekV, Amdahl
- UTS and Motorola System V/88.
-
- - Macro: AC_HEADER_TIME
- If a program may include both `time.h' and `sys/time.h', define
- `TIME_WITH_SYS_TIME'. On some older systems, `sys/time.h'
- includes `time.h', but `time.h' is not protected against multiple
- inclusion, so programs should not explicitly include both files.
- This macro is useful in programs that use, for example, `struct
- timeval' or `struct timezone' as well as `struct tm'. It is best
- used in conjunction with `HAVE_SYS_TIME_H', which can be checked
- for using `AC_CHECK_HEADERS(sys/time.h)'.
-
- #if TIME_WITH_SYS_TIME
- # include <sys/time.h>
- # include <time.h>
- #else
- # if HAVE_SYS_TIME_H
- # include <sys/time.h>
- # else
- # include <time.h>
- # endif
- #endif
-
- - Macro: AC_STRUCT_ST_BLKSIZE
- If `struct stat' contains an `st_blksize' member, define
- `HAVE_ST_BLKSIZE'.
-
- - Macro: AC_STRUCT_ST_BLOCKS
- If `struct stat' contains an `st_blocks' member, define
- `HAVE_ST_BLOCKS'. Otherwise, add `fileblocks.o' to the output
- variable `LIBOBJS'.
-
- - Macro: AC_STRUCT_ST_RDEV
- If `struct stat' contains an `st_rdev' member, define
- `HAVE_ST_RDEV'.
-
- - Macro: AC_STRUCT_TM
- If `time.h' does not define `struct tm', define `TM_IN_SYS_TIME',
- which means that including `sys/time.h' had better define `struct
- tm'.
-
- - Macro: AC_STRUCT_TIMEZONE
- Figure out how to get the current timezone. If `struct tm' has a
- `tm_zone' member, define `HAVE_TM_ZONE'. Otherwise, if the
- external array `tzname' is found, define `HAVE_TZNAME'.
-
-
-File: autoconf.info, Node: Typedefs, Next: Compiler Characteristics, Prev: Structures, Up: Existing Tests
-
-Typedefs
-========
-
- The following macros check for C typedefs. If there is no macro
-specifically defined to check for a typedef you need, and you don't need
-to check for any special properties of it, then you can use a general
-typedef check macro.
-
-* Menu:
-
-* Particular Typedefs:: Special handling to find certain types.
-* Generic Typedefs:: How to find other types.
-
-
-File: autoconf.info, Node: Particular Typedefs, Next: Generic Typedefs, Up: Typedefs
-
-Particular Typedef Checks
--------------------------
-
- These macros check for particular C typedefs in `sys/types.h' and
-`stdlib.h' (if it exists).
-
- - Macro: AC_TYPE_GETGROUPS
- Define `GETGROUPS_T' to be whichever of `gid_t' or `int' is the
- base type of the array argument to `getgroups'.
-
- - Macro: AC_TYPE_MODE_T
- If `mode_t' is not defined, define `mode_t' to be `int'.
-
- - Macro: AC_TYPE_OFF_T
- If `off_t' is not defined, define `off_t' to be `long'.
-
- - Macro: AC_TYPE_PID_T
- If `pid_t' is not defined, define `pid_t' to be `int'.
-
- - Macro: AC_TYPE_SIGNAL
- If `signal.h' declares `signal' as returning a pointer to a
- function returning `void', define `RETSIGTYPE' to be `void';
- otherwise, define it to be `int'.
-
- Define signal handlers as returning type `RETSIGTYPE':
-
- RETSIGTYPE
- hup_handler ()
- {
- ...
- }
-
- - Macro: AC_TYPE_SIZE_T
- If `size_t' is not defined, define `size_t' to be `unsigned'.
-
- - Macro: AC_TYPE_UID_T
- If `uid_t' is not defined, define `uid_t' to be `int' and `gid_t'
- to be `int'.
-
-
-File: autoconf.info, Node: Generic Typedefs, Prev: Particular Typedefs, Up: Typedefs
-
-Generic Typedef Checks
-----------------------
-
- This macro is used to check for typedefs not covered by the
-particular test macros.
-
- - Macro: AC_CHECK_TYPE (TYPE, DEFAULT)
- If the type TYPE is not defined in `sys/types.h' or `stdlib.h' (if
- it exists), define it to be the C (or C++) builtin type DEFAULT;
- e.g., `short' or `unsigned'.
-
-
-File: autoconf.info, Node: Compiler Characteristics, Next: System Services, Prev: Typedefs, Up: Existing Tests
-
-Compiler Characteristics
-========================
-
- The following macros check for C compiler or machine architecture
-features. To check for characteristics not listed here, use
-`AC_TRY_COMPILE' (*note Examining Syntax::.) or `AC_TRY_RUN' (*note Run
-Time::.)
-
- - Macro: AC_C_BIGENDIAN
- If words are stored with the most significant byte first (like
- Motorola and SPARC, but not Intel and VAX, CPUs), define
- `WORDS_BIGENDIAN'.
-
- - Macro: AC_C_CONST
- If the C compiler does not fully support the keyword `const',
- define `const' to be empty. Some C compilers that do not define
- `__STDC__' do support `const'; some compilers that define
- `__STDC__' do not completely support `const'. Programs can simply
- use `const' as if every C compiler supported it; for those that
- don't, the `Makefile' or configuration header file will define it
- as empty.
-
- - Macro: AC_C_INLINE
- If the C compiler is a version of GCC that supports the keyword
- `__inline' but not `inline' (such as some NeXT versions), define
- `inline' to be `__inline'.
-
- - Macro: AC_C_CHAR_UNSIGNED
- If the C type `char' is unsigned, define `__CHAR_UNSIGNED__',
- unless the C compiler predefines it.
-
- - Macro: AC_C_LONG_DOUBLE
- If the C compiler supports the `long double' type, define
- `HAVE_LONG_DOUBLE'. Some C compilers that do not define
- `__STDC__' do support the `long double' type; some compilers that
- define `__STDC__' do not support `long double'.
-
- - Macro: AC_CHECK_SIZEOF (TYPE)
- Define `SIZEOF_UCTYPE' to be the size in bytes of the C (or C++)
- builtin type TYPE, e.g. `int' or `char *'. If `type' is unknown
- to the compiler, it gets a size of 0. UCTYPE is TYPE, with
- lowercase converted to uppercase, spaces changed to underscores,
- and asterisks changed to `P'. For example, the call
- AC_CHECK_SIZEOF(int *)
-
- defines `SIZEOF_INT_P' to be 8 on DEC Alpha AXP systems.
-
- - Macro: AC_INT_16_BITS
- If the C type `int' is 16 bits wide, define `INT_16_BITS'. This
- macro is obsolete; it is more general to use
- `AC_CHECK_SIZEOF(int)' instead.
-
- - Macro: AC_LONG_64_BITS
- If the C type `long int' is 64 bits wide, define `LONG_64_BITS'.
- This macro is obsolete; it is more general to use
- `AC_CHECK_SIZEOF(long)' instead.
-
-
-File: autoconf.info, Node: System Services, Next: UNIX Variants, Prev: Compiler Characteristics, Up: Existing Tests
-
-System Services
-===============
-
- The following macros check for operating system services or
-capabilities.
-
- - Macro: AC_SYS_INTERPRETER
- Check whether the system supports starting scripts with a line of
- the form `#!/bin/csh' to select the interpreter to use for the
- script. After running this macro, shell code in `configure.in'
- can check the variable `ac_cv_sys_interpreter'; it will be set to
- `yes' if the system supports `#!', `no' if not.
-
- - Macro: AC_PATH_X
- Try to locate the X Window System include files and libraries. If
- the user gave the command line options `--x-includes=DIR' and
- `--x-libraries=DIR', use those directories. If either or both
- were not given, get the missing values by running `xmkmf' on a
- trivial `Imakefile' and examining the `Makefile' that it produces.
- If that fails (such as if `xmkmf' is not present), look for them
- in several directories where they often reside. If either method
- is successful, set the shell variables `x_includes' and
- `x_libraries' to their locations, unless they are in directories
- the compiler searches by default.
-
- If both methods fail, or the user gave the command line option
- `--without-x', set the shell variable `no_x' to `yes'; otherwise
- set it to the empty string.
-
- - Macro: AC_PATH_XTRA
- An enhanced version of `AC_PATH_X'. Add the C compiler flags that
- X needs to output variable `X_CFLAGS', and the X linker flags to
- `X_LIBS'. If X is not available, add `-DX_DISPLAY_MISSING' to
- `X_CFLAGS'.
-
- Also check for special libraries that some systems need in order to
- compile X programs. Add any that the system needs to output
- variable `X_EXTRA_LIBS'. And check for special X11R6 libraries
- that need to be linked with before `-lX11', and add any found to
- the output variable `X_PRE_LIBS'.
-
- - Macro: AC_SYS_LONG_FILE_NAMES
- If the system supports file names longer than 14 characters, define
- `HAVE_LONG_FILE_NAMES'.
-
- - Macro: AC_SYS_RESTARTABLE_SYSCALLS
- If the system automatically restarts a system call that is
- interrupted by a signal, define `HAVE_RESTARTABLE_SYSCALLS'.
-
-
-File: autoconf.info, Node: UNIX Variants, Prev: System Services, Up: Existing Tests
-
-UNIX Variants
-=============
-
- The following macros check for certain operating systems that need
-special treatment for some programs, due to exceptional oddities in
-their header files or libraries. These macros are warts; they will be
-replaced by a more systematic approach, based on the functions they make
-available or the environments they provide.
-
- - Macro: AC_AIX
- If on AIX, define `_ALL_SOURCE'. Allows the use of some BSD
- functions. Should be called before any macros that run the C
- compiler.
-
- - Macro: AC_DYNIX_SEQ
- If on Dynix/PTX (Sequent UNIX), add `-lseq' to output variable
- `LIBS'. This macro is obsolete; instead, use `AC_FUNC_GETMNTENT'.
-
- - Macro: AC_IRIX_SUN
- If on IRIX (Silicon Graphics UNIX), add `-lsun' to output variable
- `LIBS'. This macro is obsolete. If you were using it to get
- `getmntent', use `AC_FUNC_GETMNTENT' instead. If you used it for
- the NIS versions of the password and group functions, use
- `AC_CHECK_LIB(sun, getpwnam)'.
-
- - Macro: AC_ISC_POSIX
- If on a POSIXized ISC UNIX, define `_POSIX_SOURCE' and add
- `-posix' (for the GNU C compiler) or `-Xp' (for other C compilers)
- to output variable `CC'. This allows the use of POSIX facilities.
- Must be called after `AC_PROG_CC' and before any other macros
- that run the C compiler.
-
- - Macro: AC_MINIX
- If on Minix, define `_MINIX' and `_POSIX_SOURCE' and define
- `_POSIX_1_SOURCE' to be 2. This allows the use of POSIX
- facilities. Should be called before any macros that run the C
- compiler.
-
- - Macro: AC_SCO_INTL
- If on SCO UNIX, add `-lintl' to output variable `LIBS'. This
- macro is obsolete; instead, use `AC_FUNC_STRFTIME'.
-
- - Macro: AC_XENIX_DIR
- If on Xenix, add `-lx' to output variable `LIBS'. Also, if
- `dirent.h' is being used, add `-ldir' to `LIBS'. This macro is
- obsolete; use `AC_HEADER_DIRENT' instead.
-
-
-File: autoconf.info, Node: Writing Tests, Next: Results, Prev: Existing Tests, Up: Top
-
-Writing Tests
-*************
-
- If the existing feature tests don't do something you need, you have
-to write new ones. These macros are the building blocks. They provide
-ways for other macros to check whether various kinds of features are
-available and report the results.
-
- This chapter contains some suggestions and some of the reasons why
-the existing tests are written the way they are. You can also learn a
-lot about how to write Autoconf tests by looking at the existing ones.
-If something goes wrong in one or more of the Autoconf tests, this
-information can help you understand the assumptions behind them, which
-might help you figure out how to best solve the problem.
-
- These macros check the output of the C compiler system. They do not
-cache the results of their tests for future use (*note Caching
-Results::.), because they don't know enough about the information they
-are checking for to generate a cache variable name. They also do not
-print any messages, for the same reason. The checks for particular
-kinds of C features call these macros and do cache their results and
-print messages about what they're checking for.
-
-* Menu:
-
-* Examining Declarations:: Detecting header files and declarations.
-* Examining Syntax:: Detecting language syntax features.
-* Examining Libraries:: Detecting functions and global variables.
-* Run Time:: Testing for run-time features.
-* Portable Shell:: Shell script portability pitfalls.
-* Testing Values and Files:: Checking strings and files.
-* Multiple Cases:: Tests for several possible values.
-* Language Choice:: Selecting which language to use for testing.
-
-
-File: autoconf.info, Node: Examining Declarations, Next: Examining Syntax, Up: Writing Tests
-
-Examining Declarations
-======================
-
- The macro `AC_TRY_CPP' is used to check whether particular header
-files exist. You can check for one at a time, or more than one if you
-need several header files to all exist for some purpose.
-
- - Macro: AC_TRY_CPP (INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
- INCLUDES is C or C++ `#include' statements and declarations, on
- which shell variable, backquote, and backslash substitutions are
- performed. (Actually, it can be any C program, but other
- statements are probably not useful.) If the preprocessor produces
- no error messages while processing it, run shell commands
- ACTION-IF-TRUE. Otherwise run shell commands ACTION-IF-FALSE.
-
- This macro uses `CPPFLAGS', but not `CFLAGS', because `-g', `-O',
- etc. are not valid options to many C preprocessors.
-
- Here is now to find out whether a header file contains a particular
-declaration, such as a typedef, a structure, a structure member, or a
-function. Use `AC_EGREP_HEADER' instead of running `grep' directly on
-the header file; on some systems the symbol might be defined in another
-header file that the file you are checking `#include's.
-
- - Macro: AC_EGREP_HEADER (PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND])
- If the output of running the preprocessor on the system header file
- HEADER-FILE matches the `egrep' regular expression PATTERN,
- execute shell commands ACTION-IF-FOUND, otherwise execute
- ACTION-IF-NOT-FOUND.
-
- To check for C preprocessor symbols, either defined by header files
-or predefined by the C preprocessor, use `AC_EGREP_CPP'. Here is an
-example of the latter:
-
- AC_EGREP_CPP(yes,
- [#ifdef _AIX
- yes
- #endif
- ], is_aix=yes, is_aix=no)
-
- - Macro: AC_EGREP_CPP (PATTERN, PROGRAM, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND])
- PROGRAM is the text of a C or C++ program, on which shell
- variable, backquote, and backslash substitutions are performed.
- If the output of running the preprocessor on PROGRAM matches the
- `egrep' regular expression PATTERN, execute shell commands
- ACTION-IF-FOUND, otherwise execute ACTION-IF-NOT-FOUND.
-
- This macro calls `AC_PROG_CPP' or `AC_PROG_CXXCPP' (depending on
- which language is current, *note Language Choice::.), if it hasn't
- been called already.
-
-
-File: autoconf.info, Node: Examining Syntax, Next: Examining Libraries, Prev: Examining Declarations, Up: Writing Tests
-
-Examining Syntax
-================
-
- To check for a syntax feature of the C or C++ compiler, such as
-whether it recognizes a certain keyword, use `AC_TRY_COMPILE' to try to
-compile a small program that uses that feature. You can also use it to
-check for structures and structure members that are not present on all
-systems.
-
- - Macro: AC_TRY_COMPILE (INCLUDES, FUNCTION-BODY, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND])
- Create a test C program to see whether a function whose body
- consists of FUNCTION-BODY can be compiled; INCLUDES is any
- `#include' statements needed by the code in FUNCTION-BODY. If the
- file compiles successfully, run shell commands ACTION-IF-FOUND,
- otherwise run ACTION-IF-NOT-FOUND. This macro uses `CFLAGS' or
- `CXXFLAGS', and `CPPFLAGS', when compiling. It does not try to
- link; use `AC_TRY_LINK' if you need to do that (*note Examining
- Libraries::.).
-
-
-File: autoconf.info, Node: Examining Libraries, Next: Run Time, Prev: Examining Syntax, Up: Writing Tests
-
-Examining Libraries
-===================
-
- To check for a library, a function, or a global variable, Autoconf
-`configure' scripts try to compile and link a small program that uses
-it. This is unlike Metaconfig, which by default uses `nm' or `ar' on
-the C library to try to figure out which functions are available.
-Trying to link with the function is usually a more reliable approach
-because it avoids dealing with the variations in the options and output
-formats of `nm' and `ar' and in the location of the standard libraries.
-It also allows configuring for cross-compilation or checking a
-function's runtime behavior if needed. On the other hand, it can be
-slower than scanning the libraries once.
-
- A few systems have linkers that do not return a failure exit status
-when there are unresolved functions in the link. This bug makes the
-configuration scripts produced by Autoconf unusable on those systems.
-However, some of them can be given options that make the exit status
-correct. This is a problem that Autoconf does not currently handle
-automatically.
-
- `AC_TRY_LINK' is used to compile test programs to test for functions
-and global variables. It is also used (by `AC_CHECK_LIB') to check for
-libraries, by adding the library being checked for to `LIBS'
-temporarily and trying to link a small program.
-
- - Macro: AC_TRY_LINK (INCLUDES, FUNCTION-BODY, ACTION-IF-FOUND [,
- ACTION-IF-NOT-FOUND])
- Create a test C program to see whether a function whose body
- consists of FUNCTION-BODY can be compiled and linked; INCLUDES is
- any `#include' statements needed by the code in FUNCTION-BODY. If
- the file compiles and links successfully, run shell commands
- ACTION-IF-FOUND, otherwise run ACTION-IF-NOT-FOUND. This macro
- uses `CFLAGS' or `CXXFLAGS', `CPPFLAGS', `LDFLAGS', and `LIBS'
- when compiling.
-
- - Macro: AC_COMPILE_CHECK (ECHO-TEXT, INCLUDES, FUNCTION-BODY,
- ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
- This is an obsolete version of `AC_TRY_LINK', with the addition
- that it prints `checking for ECHO-TEXT' to the standard output
- first, if ECHO-TEXT is non-empty. Use `AC_MSG_CHECKING' and
- `AC_MSG_RESULT' instead to print messages (*note Printing
- Messages::.).
-
diff --git a/util/autoconf/autoconf.info-3 b/util/autoconf/autoconf.info-3
deleted file mode 100644
index 0cbd5db..0000000
--- a/util/autoconf/autoconf.info-3
+++ /dev/null
@@ -1,1198 +0,0 @@
-This is Info file autoconf.info, produced by Makeinfo-1.55 from the
-input file ./autoconf.texi.
-
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an `m4' macro
-package.
-
- Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-File: autoconf.info, Node: Run Time, Next: Portable Shell, Prev: Examining Libraries, Up: Writing Tests
-
-Checking Run Time Behavior
-==========================
-
- Sometimes you need to find out how a system performs at run time,
-such as whether a given function has a certain capability or bug. If
-you can, make such checks when your program runs instead of when it is
-configured. You can check for things like the machine's endianness when
-your program initializes itself.
-
- If you really need to test for a run-time behavior while configuring,
-you can write a test program to determine the result, and compile and
-run it using `AC_TRY_RUN'. Avoid running test programs if possible,
-because using them prevents people from configuring your package for
-cross-compiling.
-
-* Menu:
-
-* Test Programs:: Running test programs.
-* Guidelines:: General rules for writing test programs.
-* Test Functions:: Avoiding pitfalls in test programs.
-
-
-File: autoconf.info, Node: Test Programs, Next: Guidelines, Up: Run Time
-
-Running Test Programs
----------------------
-
- Use the following macro if you need to test run-time behavior of the
-system while configuring.
-
- - Macro: AC_TRY_RUN (PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE [,
- ACTION-IF-CROSS-COMPILING]])
- PROGRAM is the text of a C program, on which shell variable and
- backquote substitutions are performed. If it compiles and links
- successfully and returns an exit status of 0 when executed, run
- shell commands ACTION-IF-TRUE. Otherwise run shell commands
- ACTION-IF-FALSE; the exit status of the program is available in
- the shell variable `$?'. This macro uses `CFLAGS' or `CXXFLAGS',
- `CPPFLAGS', `LDFLAGS', and `LIBS' when compiling.
-
- If the C compiler being used does not produce executables that run
- on the system where `configure' is being run, then the test
- program is not run. If the optional shell commands
- ACTION-IF-CROSS-COMPILING are given, they are run instead and this
- macro calls `AC_C_CROSS' if it has not already been called.
- Otherwise, `configure' prints an error message and exits.
-
- Try to provide a pessimistic default value to use when
-cross-compiling makes run-time tests impossible. You do this by
-passing the optional last argument to `AC_TRY_RUN'. `autoconf' prints
-a warning message when creating `configure' each time it encounters a
-call to `AC_TRY_RUN' with no ACTION-IF-CROSS-COMPILING argument given.
-You may ignore the warning, though users will not be able to configure
-your package for cross-compiling. A few of the macros distributed with
-Autoconf produce this warning message.
-
- To configure for cross-compiling you can also choose a value for
-those parameters based on the canonical system name (*note Manual
-Configuration::.). Alternatively, set up a test results cache file with
-the correct values for the target system (*note Caching Results::.).
-
- To provide a default for calls of `AC_TRY_RUN' that are embedded in
-other macros, including a few of the ones that come with Autoconf, you
-can call `AC_C_CROSS' before running them. Then, if the shell variable
-`cross_compiling' is set to `yes', use an alternate method to get the
-results instead of calling the macros.
-
- - Macro: AC_C_CROSS
- If the C compiler being used does not produce executables that can
- run on the system where `configure' is being run, set the shell
- variable `cross_compiling' to `yes', otherwise `no'.
-
-
-File: autoconf.info, Node: Guidelines, Next: Test Functions, Prev: Test Programs, Up: Run Time
-
-Guidelines for Test Programs
-----------------------------
-
- Test programs should not write anything to the standard output. They
-should return 0 if the test succeeds, nonzero otherwise, so that success
-can be distinguished easily from a core dump or other failure;
-segmentation violations and other failures produce a nonzero exit
-status. Test programs should `exit', not `return', from `main',
-because on some systems (old Suns, at least) the argument to `return'
-in `main' is ignored.
-
- Test programs can use `#if' or `#ifdef' to check the values of
-preprocessor macros defined by tests that have already run. For
-example, if you call `AC_HEADER_STDC', then later on in `configure.in'
-you can have a test program that includes an ANSI C header file
-conditionally:
-
- #if STDC_HEADERS
- # include <stdlib.h>
- #endif
-
- If a test program needs to use or create a data file, give it a name
-that starts with `conftest', such as `conftestdata'. The `configure'
-script cleans up by running `rm -rf conftest*' after running test
-programs and if the script is interrupted.
-
-
-File: autoconf.info, Node: Test Functions, Prev: Guidelines, Up: Run Time
-
-Test Functions
---------------
-
- Function declarations in test programs should have a prototype
-conditionalized for C++. In practice, though, test programs rarely need
-functions that take arguments.
-
- #ifdef __cplusplus
- foo(int i)
- #else
- foo(i) int i;
- #endif
-
- Functions that test programs declare should also be conditionalized
-for C++, which requires `extern "C"' prototypes. Make sure to not
-include any header files containing clashing prototypes.
-
- #ifdef __cplusplus
- extern "C" void *malloc(size_t);
- #else
- char *malloc();
- #endif
-
- If a test program calls a function with invalid parameters (just to
-see whether it exists), organize the program to ensure that it never
-invokes that function. You can do this by calling it in another
-function that is never invoked. You can't do it by putting it after a
-call to `exit', because GCC version 2 knows that `exit' never returns
-and optimizes out any code that follows it in the same block.
-
- If you include any header files, make sure to call the functions
-relevant to them with the correct number of arguments, even if they are
-just 0, to avoid compilation errors due to prototypes. GCC version 2
-has internal prototypes for several functions that it automatically
-inlines; for example, `memcpy'. To avoid errors when checking for
-them, either pass them the correct number of arguments or redeclare them
-with a different return type (such as `char').
-
-
-File: autoconf.info, Node: Portable Shell, Next: Testing Values and Files, Prev: Run Time, Up: Writing Tests
-
-Portable Shell Programming
-==========================
-
- When writing your own checks, there are some shell script programming
-techniques you should avoid in order to make your code portable. The
-Bourne shell and upward-compatible shells like Bash and the Korn shell
-have evolved over the years, but to prevent trouble, do not take
-advantage of features that were added after UNIX version 7, circa 1977.
-You should not use shell functions, aliases, negated character classes,
-or other features that are not found in all Bourne-compatible shells;
-restrict yourself to the lowest common denominator. Even `unset' is
-not supported by all shells!
-
- The set of external programs you should run in a `configure' script
-is fairly small. *Note Utilities in Makefiles:
-(standards.info)Utilities in Makefiles, for the list. This restriction
-allows users to start out with a fairly small set of programs and build
-the rest, avoiding too many interdependencies between packages.
-
- Some of these external utilities have a portable subset of features,
-as well; for example, don't rely on `ln' having a `-f' option or `cat'
-having any options. `sed' scripts should not contain comments or use
-branch labels longer than 8 characters. Don't use `grep -s' to
-suppress output, because `grep -s' on System V does not suppress
-output, only error messages. Instead, redirect the standard output and
-standard error (in case the file doesn't exist) of `grep' to
-`/dev/null'. Check the exit status of `grep' to determine whether it
-found a match.
-
-
-File: autoconf.info, Node: Testing Values and Files, Next: Multiple Cases, Prev: Portable Shell, Up: Writing Tests
-
-Testing Values and Files
-========================
-
- `configure' scripts need to test properties of many files and
-strings. Here are some portability problems to watch out for when doing
-those tests.
-
- The `test' program is the way to perform many file and string tests.
-It is often invoked by the alternate name `[', but using that name in
-Autoconf code is asking for trouble since it is an `m4' quote character.
-
- If you need to make multiple checks using `test', combine them with
-the shell operators `&&' and `||' instead of using the `test' operators
-`-a' and `-o'. On System V, the precedence of `-a' and `-o' is wrong
-relative to the unary operators; consequently, POSIX does not specify
-them, so using them is nonportable. If you combine `&&' and `||' in
-the same statement, keep in mind that they have equal precedence.
-
- To enable `configure' scripts to support cross-compilation, they
-shouldn't do anything that tests features of the host system instead of
-the target system. But occasionally you may find it necessary to check
-whether some arbitrary file exists. To do so, use `test -f' or `test
--r'. Do not use `test -x', because 4.3BSD does not have it.
-
- Another nonportable shell programming construction is
- VAR=${VAR:-VALUE}
-
-The intent is to set VAR to VALUE only if it is not already set, but if
-VAR has any value, even the empty string, to leave it alone. Old BSD
-shells, including the Ultrix `sh', don't accept the colon, and complain
-and die. A portable equivalent is
- : ${VAR=VALUE}
-
-
-File: autoconf.info, Node: Multiple Cases, Next: Language Choice, Prev: Testing Values and Files, Up: Writing Tests
-
-Multiple Cases
-==============
-
- Some operations are accomplished in several possible ways, depending
-on the UNIX variant. Checking for them essentially requires a "case
-statement". Autoconf does not directly provide one; however, it is
-easy to simulate by using a shell variable to keep track of whether a
-way to perform the operation has been found yet.
-
- Here is an example that uses the shell variable `fstype' to keep
-track of whether the remaining cases need to be checked.
-
- AC_MSG_CHECKING(how to get filesystem type)
- fstype=no
- # The order of these tests is important.
- AC_TRY_CPP([#include <sys/statvfs.h>
- #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
- if test $fstype = no; then
- AC_TRY_CPP([#include <sys/statfs.h>
- #include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
- fi
- if test $fstype = no; then
- AC_TRY_CPP([#include <sys/statfs.h>
- #include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
- fi
- # (more cases omitted here)
- AC_MSG_RESULT($fstype)
-
-
-File: autoconf.info, Node: Language Choice, Prev: Multiple Cases, Up: Writing Tests
-
-Language Choice
-===============
-
- Packages that use both C and C++ need to test features of both
-compilers. Autoconf-generated `configure' scripts check for C features
-by default. The following macros determine which language's compiler
-is used in tests that follow in `configure.in'.
-
- - Macro: AC_LANG_C
- Do compilation tests using `CC' and `CPP' and use extension `.c'
- for test programs.
-
- - Macro: AC_LANG_CPLUSPLUS
- Do compilation tests using `CXX' and `CXXCPP' and use extension
- `.C' for test programs.
-
- - Macro: AC_LANG_SAVE
- Remember the current language (as set by `AC_LANG_C' or
- `AC_LANG_CPLUSPLUS') on a stack. Does not change which language is
- current. Use this macro and `AC_LANG_RESTORE' in macros that need
- to temporarily switch to a particular language.
-
- - Macro: AC_LANG_RESTORE
- Select the language that is saved on the top of the stack, as set
- by `AC_LANG_SAVE', and remove it from the stack. This macro is
- equivalent to either `AC_LANG_C' or `AC_LANG_CPLUSPLUS', whichever
- had been run most recently when `AC_LANG_SAVE' was last called.
-
- Do not call this macro more times than `AC_LANG_SAVE'.
-
- - Macro: AC_REQUIRE_CPP
- Ensure that whichever preprocessor would currently be used for
- tests has been found. Calls `AC_REQUIRE' (*note Prerequisite
- Macros::.) with an argument of either `AC_PROG_CPP' or
- `AC_PROG_CXXCPP', depending on which language is current.
-
-
-File: autoconf.info, Node: Results, Next: Writing Macros, Prev: Writing Tests, Up: Top
-
-Results of Tests
-****************
-
- Once `configure' has determined whether a feature exists, what can
-it do to record that information? There are four sorts of things it can
-do: define a C preprocessor symbol, set a variable in the output files,
-save the result in a cache file for future `configure' runs, and print
-a message letting the user know the result of the test.
-
-* Menu:
-
-* Defining Symbols:: Defining C preprocessor symbols.
-* Setting Output Variables:: Replacing variables in output files.
-* Caching Results:: Speeding up subsequent `configure' runs.
-* Printing Messages:: Notifying users of progress or problems.
-
-
-File: autoconf.info, Node: Defining Symbols, Next: Setting Output Variables, Up: Results
-
-Defining C Preprocessor Symbols
-===============================
-
- A common action to take in response to a feature test is to define a
-C preprocessor symbol indicating the results of the test. That is done
-by calling `AC_DEFINE' or `AC_DEFINE_UNQUOTED'.
-
- By default, `AC_OUTPUT' places the symbols defined by these macros
-into the output variable `DEFS', which contains an option
-`-DSYMBOL=VALUE' for each symbol defined. Unlike in Autoconf version
-1, there is no variable `DEFS' defined while `configure' is running.
-To check whether Autoconf macros have already defined a certain C
-preprocessor symbol, test the value of the appropriate cache variable,
-as in this example:
-
- AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
- if test "$ac_cv_func_vprintf" != yes; then
- AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
- fi
-
- If `AC_CONFIG_HEADER' has been called, then instead of creating
-`DEFS', `AC_OUTPUT' creates a header file by substituting the correct
-values into `#define' statements in a template file. *Note
-Configuration Headers::, for more information about this kind of output.
-
- - Macro: AC_DEFINE (VARIABLE [, VALUE])
- Define C preprocessor variable VARIABLE. If VALUE is given, set
- VARIABLE to that value (verbatim), otherwise set it to 1. VALUE
- should not contain literal newlines, and if you are not using
- `AC_CONFIG_HEADER' it should not contain any `#' characters, as
- `make' tends to eat them. To use a shell variable (which you need
- to do in order to define a value containing the `m4' quote
- characters `[' or `]'), use `AC_DEFINE_UNQUOTED' instead. The
- following example defines the C preprocessor variable `EQUATION'
- to be the string constant `"$a > $b"':
-
- AC_DEFINE(EQUATION, "$a > $b")
-
- - Macro: AC_DEFINE_UNQUOTED (VARIABLE [, VALUE])
- Like `AC_DEFINE', but three shell expansions are
- performed--once--on VARIABLE and VALUE: variable expansion (`$'),
- command substitution (``'), and backslash escaping (`\'). Single
- and double quote characters in the value have no special meaning.
- Use this macro instead of `AC_DEFINE' when VARIABLE or VALUE is a
- shell variable. Examples:
-
- AC_DEFINE_UNQUOTED(config_machfile, "${machfile}")
- AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
- AC_DEFINE_UNQUOTED(${ac_tr_hdr})
-
- Due to the syntactical bizarreness of the Bourne shell, do not use
-semicolons to separate `AC_DEFINE' or `AC_DEFINE_UNQUOTED' calls from
-other macro calls or shell code; that can cause syntax errors in the
-resulting `configure' script. Use either spaces or newlines. That is,
-do this:
-
- AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf")
-
-or this:
-
- AC_CHECK_HEADER(elf.h,
- AC_DEFINE(SVR4)
- LIBS="$LIBS -lelf")
-
-instead of this:
-
- AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf")
-
-
-File: autoconf.info, Node: Setting Output Variables, Next: Caching Results, Prev: Defining Symbols, Up: Results
-
-Setting Output Variables
-========================
-
- One way to record the results of tests is to set "output variables",
-which are shell variables whose values are substituted into files that
-`configure' outputs. The two macros below create new output variables.
-*Note Preset Output Variables::, for a list of output variables that
-are always available.
-
- - Macro: AC_SUBST (VARIABLE)
- Create an output variable from a shell variable. Make `AC_OUTPUT'
- substitute the variable VARIABLE into output files (typically one
- or more `Makefile's). This means that `AC_OUTPUT' will replace
- instances of `@VARIABLE@' in input files with the value that the
- shell variable VARIABLE has when `AC_OUTPUT' is called. The value
- of VARIABLE should not contain literal newlines.
-
- - Macro: AC_SUBST_FILE (VARIABLE)
- Another way to create an output variable from a shell variable.
- Make `AC_OUTPUT' insert (without substitutions) the contents of
- the file named by shell variable VARIABLE into output files. This
- means that `AC_OUTPUT' will replace instances of `@VARIABLE@' in
- output files (such as `Makefile.in') with the contents of the file
- that the shell variable VARIABLE names when `AC_OUTPUT' is called.
- Set the variable to `/dev/null' for cases that do not have a file
- to insert.
-
- This macro is useful for inserting `Makefile' fragments containing
- special dependencies or other `make' directives for particular host
- or target types into `Makefile's. For example, `configure.in'
- could contain:
-
- AC_SUBST_FILE(host_frag)dnl
- host_frag=$srcdir/conf/sun4.mh
-
- and then a `Makefile.in' could contain:
-
- @host_frag@
-
-
-File: autoconf.info, Node: Caching Results, Next: Printing Messages, Prev: Setting Output Variables, Up: Results
-
-Caching Results
-===============
-
- To avoid checking for the same features repeatedly in various
-`configure' scripts (or repeated runs of one script), `configure' saves
-the results of many of its checks in a "cache file". If, when a
-`configure' script runs, it finds a cache file, it reads from it the
-results from previous runs and avoids rerunning those checks. As a
-result, `configure' can run much faster than if it had to perform all
-of the checks every time.
-
- - Macro: AC_CACHE_VAL (CACHE-ID, COMMANDS-TO-SET-IT)
- Ensure that the results of the check identified by CACHE-ID are
- available. If the results of the check were in the cache file
- that was read, and `configure' was not given the `--quiet' or
- `--silent' option, print a message saying that the result was
- cached; otherwise, run the shell commands COMMANDS-TO-SET-IT.
- Those commands should have no side effects except for setting the
- variable CACHE-ID. In particular, they should not call
- `AC_DEFINE'; the code that follows the call to `AC_CACHE_VAL'
- should do that, based on the cached value. Also, they should not
- print any messages, for example with `AC_MSG_CHECKING'; do that
- before calling `AC_CACHE_VAL', so the messages are printed
- regardless of whether the results of the check are retrieved from
- the cache or determined by running the shell commands. If the
- shell commands are run to determine the value, the value will be
- saved in the cache file just before `configure' creates its output
- files. *Note Cache Variable Names::, for how to choose the name
- of the CACHE-ID variable.
-
-* Menu:
-
-* Cache Variable Names:: Shell variables used in caches.
-* Cache Files:: Files `configure' uses for caching.
-
-
-File: autoconf.info, Node: Cache Variable Names, Next: Cache Files, Up: Caching Results
-
-Cache Variable Names
---------------------
-
- The names of cache variables should have the following format:
-
- PACKAGE-PREFIX_cv_VALUE-TYPE_SPECIFIC-VALUE[_ADDITIONAL-OPTIONS]
-
-for example, `ac_cv_header_stat_broken' or
-`ac_cv_prog_gcc_traditional'. The parts of the variable name are:
-
-PACKAGE-PREFIX
- An abbreviation for your package or organization; the same prefix
- you begin local Autoconf macros with, except lowercase by
- convention. For cache values used by the distributed Autoconf
- macros, this value is `ac'.
-
-`_cv_'
- Indicates that this shell variable is a cache value.
-
-VALUE-TYPE
- A convention for classifying cache values, to produce a rational
- naming system. The values used in Autoconf are listed in *Note
- Macro Names::.
-
-SPECIFIC-VALUE
- Which member of the class of cache values this test applies to.
- For example, which function (`alloca'), program (`gcc'), or output
- variable (`INSTALL').
-
-ADDITIONAL-OPTIONS
- Any particular behavior of the specific member that this test
- applies to. For example, `broken' or `set'. This part of the
- name may be omitted if it does not apply.
-
- Like their names, the values that may be assigned to cache variables
-have a few restrictions. The values may not contain single quotes or
-curly braces. Usually, their values will be boolean (`yes' or `no') or
-the names of files or functions; so this is not an important
-restriction.
-
-
-File: autoconf.info, Node: Cache Files, Prev: Cache Variable Names, Up: Caching Results
-
-Cache Files
------------
-
- A cache file is a shell script that caches the results of configure
-tests run on one system so they can be shared between configure scripts
-and configure runs. It is not useful on other systems. If its contents
-are invalid for some reason, the user may delete or edit it.
-
- By default, configure uses `./config.cache' as the cache file,
-creating it if it does not exist already. `configure' accepts 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'. *Note Subdirectories::, for
-information on configuring subdirectories with the `AC_CONFIG_SUBDIRS'
-macro. `config.status' only pays attention to the cache file if it is
-given the `--recheck' option, which makes it rerun `configure'.
-
- It is wrong to try to distribute cache files for particular system
-types. There is too much room for error in doing that, and too much
-administrative overhead in maintaining them. For any features that
-can't be guessed automatically, use the standard method of the canonical
-system type and linking files (*note Manual Configuration::.).
-
- The cache file on a particular system will gradually accumulate
-whenever someone runs a `configure' script; it will be initially
-nonexistent. Running `configure' merges the new cache results with the
-existing cache file. The site initialization script can specify a
-site-wide cache file to use instead of the default, to make it work
-transparently, as long as the same C compiler is used every time (*note
-Site Defaults::.).
-
-
-File: autoconf.info, Node: Printing Messages, Prev: Caching Results, Up: Results
-
-Printing Messages
-=================
-
- `configure' scripts need to give users running them several kinds of
-information. The following macros print messages in ways appropriate
-for each kind. The arguments to all of them get enclosed in shell
-double quotes, so the shell performs variable and backquote substitution
-on them.
-
- These macros are all wrappers around the `echo' shell command.
-`configure' scripts should rarely need to run `echo' directly to print
-messages for the user. Using these macros makes it easy to change how
-and when each kind of message is printed; such changes need only be
-made to the macro definitions, and all of the callers change
-automatically.
-
- - Macro: AC_MSG_CHECKING (FEATURE-DESCRIPTION)
- Notify the user that `configure' is checking for a particular
- feature. This macro prints a message that starts with `checking '
- and ends with `...' and no newline. It must be followed by a call
- to `AC_MSG_RESULT' to print the result of the check and the
- newline. The FEATURE-DESCRIPTION should be something like
- `whether the Fortran compiler accepts C++ comments' or `for c89'.
-
- This macro prints nothing if `configure' is run with the `--quiet'
- or `--silent' option.
-
- - Macro: AC_MSG_RESULT (RESULT-DESCRIPTION)
- Notify the user of the results of a check. RESULT-DESCRIPTION is
- almost always the value of the cache variable for the check,
- typically `yes', `no', or a file name. This macro should follow a
- call to `AC_MSG_CHECKING', and the RESULT-DESCRIPTION should be
- the completion of the message printed by the call to
- `AC_MSG_CHECKING'.
-
- This macro prints nothing if `configure' is run with the `--quiet'
- or `--silent' option.
-
- - Macro: AC_MSG_ERROR (ERROR-DESCRIPTION)
- Notify the user of an error that prevents `configure' from
- completing. This macro prints an error message on the standard
- error stream and exits `configure' with a nonzero status.
- eRROR-DESCRIPTION should be something like `invalid value $HOME
- for \$HOME'.
-
- - Macro: AC_MSG_WARN (PROBLEM-DESCRIPTION)
- Notify the `configure' user of a possible problem. This macro
- prints the message on the standard error stream; `configure'
- continues running afterward, so macros that call `AC_MSG_WARN'
- should provide a default (back-up) behavior for the situations
- they warn about. PROBLEM-DESCRIPTION should be something like `ln
- -s seems to make hard links'.
-
- The following two macros are an obsolete alternative to
-`AC_MSG_CHECKING' and `AC_MSG_RESULT'.
-
- - Macro: AC_CHECKING (FEATURE-DESCRIPTION)
- This macro is similar to `AC_MSG_CHECKING', except that it prints a
- newline after the FEATURE-DESCRIPTION. It is useful mainly to
- print a general description of the overall purpose of a group of
- feature checks, e.g.,
-
- AC_CHECKING(if stack overflow is detectable)
-
- - Macro: AC_VERBOSE (RESULT-DESCRIPTION)
- This macro is similar to `AC_MSG_RESULT', except that it is meant
- to follow a call to `AC_CHECKING' instead of `AC_MSG_CHECKING'; it
- starts the message it prints with a tab. It is considered
- obsolete.
-
-
-File: autoconf.info, Node: Writing Macros, Next: Manual Configuration, Prev: Results, Up: Top
-
-Writing Macros
-**************
-
- When you write a feature test that could be applicable to more than
-one software package, the best thing to do is encapsulate it in a new
-macro. Here are some instructions and guidelines for writing Autoconf
-macros.
-
-* Menu:
-
-* Macro Definitions:: Basic format of an Autoconf macro.
-* Macro Names:: What to call your new macros.
-* Quoting:: Protecting macros from unwanted expansion.
-* Dependencies Between Macros:: What to do when macros depend on other macros.
-
-
-File: autoconf.info, Node: Macro Definitions, Next: Macro Names, Up: Writing Macros
-
-Macro Definitions
-=================
-
- Autoconf macros are defined using the `AC_DEFUN' macro, which is
-similar to the `m4' builtin `define' macro. In addition to defining a
-macro, `AC_DEFUN' adds to it some code which is used to constrain the
-order in which macros are called (*note Prerequisite Macros::.).
-
- An Autoconf macro definition looks like this:
-
- AC_DEFUN(MACRO-NAME, [MACRO-BODY])
-
-The square brackets here do not indicate optional text: they should
-literally be present in the macro definition to avoid macro expansion
-problems (*note Quoting::.). You can refer to any arguments passed to
-the macro as `$1', `$2', etc.
-
- To introduce comments in `m4', use the `m4' builtin `dnl'; it causes
-`m4' to discard the text through the next newline. It is not needed
-between macro definitions in `acsite.m4' and `aclocal.m4', because all
-output is discarded until `AC_INIT' is called.
-
- *Note How to define new macros: (m4.info)Definitions, for more
-complete information on writing `m4' macros.
-
-
-File: autoconf.info, Node: Macro Names, Next: Quoting, Prev: Macro Definitions, Up: Writing Macros
-
-Macro Names
-===========
-
- All of the Autoconf macros have all-uppercase names starting with
-`AC_' to prevent them from accidentally conflicting with other text.
-All shell variables that they use for internal purposes have
-mostly-lowercase names starting with `ac_'. To ensure that your macros
-don't conflict with present or future Autoconf macros, you should
-prefix your own macro names and any shell variables they use with some
-other sequence. Possibilities include your initials, or an abbreviation
-for the name of your organization or software package.
-
- Most of the Autoconf macros' names follow a structured naming
-convention that indicates the kind of feature check by the name. The
-macro names consist of several words, separated by underscores, going
-from most general to most specific. The names of their cache
-variables use the same convention (*note Cache Variable Names::., for
-more information on them).
-
- The first word of the name after `AC_' usually tells the category of
-feature being tested. Here are the categories used in Autoconf for
-specific test macros, the kind of macro that you are more likely to
-write. They are also used for cache variables, in all-lowercase. Use
-them where applicable; where they're not, invent your own categories.
-
-`C'
- C language builtin features.
-
-`DECL'
- Declarations of C variables in header files.
-
-`FUNC'
- Functions in libraries.
-
-`GROUP'
- UNIX group owners of files.
-
-`HEADER'
- Header files.
-
-`LIB'
- C libraries.
-
-`PATH'
- The full path names to files, including programs.
-
-`PROG'
- The base names of programs.
-
-`STRUCT'
- Definitions of C structures in header files.
-
-`SYS'
- Operating system features.
-
-`TYPE'
- C builtin or declared types.
-
-`VAR'
- C variables in libraries.
-
- After the category comes the name of the particular feature being
-tested. Any further words in the macro name indicate particular aspects
-of the feature. For example, `AC_FUNC_UTIME_NULL' checks the behavior
-of the `utime' function when called with a `NULL' pointer.
-
- A macro that is an internal subroutine of another macro should have a
-name that starts with the name of that other macro, followed by one or
-more words saying what the internal macro does. For example,
-`AC_PATH_X' has internal macros `AC_PATH_X_XMKMF' and
-`AC_PATH_X_DIRECT'.
-
-
-File: autoconf.info, Node: Quoting, Next: Dependencies Between Macros, Prev: Macro Names, Up: Writing Macros
-
-Quoting
-=======
-
- Macros that are called by other macros are evaluated by `m4' several
-times; each evaluation might require another layer of quotes to prevent
-unwanted expansions of macros or `m4' builtins, such as `define' and
-`$1'. Quotes are also required around macro arguments that contain
-commas, since commas separate the arguments from each other. It's a
-good idea to quote any macro arguments that contain newlines or calls
-to other macros, as well.
-
- Autoconf changes the `m4' quote characters from the default ``' and
-`'' to `[' and `]', because many of the macros use ``' and `'',
-mismatched. However, in a few places the macros need to use brackets
-(usually in C program text or regular expressions). In those places,
-they use the `m4' builtin command `changequote' to temporarily change
-the quote characters to `<<' and `>>'. (Sometimes, if they don't need
-to quote anything, they disable quoting entirely instead by setting the
-quote characters to empty strings.) Here is an example:
-
- AC_TRY_LINK(
- changequote(<<, >>)dnl
- <<#include <time.h>
- #ifndef tzname /* For SGI. */
- extern char *tzname[]; /* RS6000 and others reject char **tzname. */
- #endif>>,
- changequote([, ])dnl
- [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)
-
- When you create a `configure' script using newly written macros,
-examine it carefully to check whether you need to add more quotes in
-your macros. If one or more words have disappeared in the `m4' output,
-you need more quotes. When in doubt, quote.
-
- However, it's also possible to put on too many layers of quotes. If
-this happens, the resulting `configure' script will contain unexpanded
-macros. The `autoconf' program checks for this problem by doing `grep
-AC_ configure'.
-
-
-File: autoconf.info, Node: Dependencies Between Macros, Prev: Quoting, Up: Writing Macros
-
-Dependencies Between Macros
-===========================
-
- Some Autoconf macros depend on other macros having been called first
-in order to work correctly. Autoconf provides a way to ensure that
-certain macros are called if needed and a way to warn the user if
-macros are called in an order that might cause incorrect operation.
-
-* Menu:
-
-* Prerequisite Macros:: Ensuring required information.
-* Suggested Ordering:: Warning about possible ordering problems.
-* Obsolete Macros:: Warning about old ways of doing things.
-
-
-File: autoconf.info, Node: Prerequisite Macros, Next: Suggested Ordering, Up: Dependencies Between Macros
-
-Prerequisite Macros
--------------------
-
- A macro that you write might need to use values that have previously
-been computed by other macros. For example, `AC_DECL_YYTEXT' examines
-the output of `flex' or `lex', so it depends on `AC_PROG_LEX' having
-been called first to set the shell variable `LEX'.
-
- Rather than forcing the user of the macros to keep track of the
-dependencies between them, you can use the `AC_REQUIRE' macro to do it
-automatically. `AC_REQUIRE' can ensure that a macro is only called if
-it is needed, and only called once.
-
- - Macro: AC_REQUIRE (MACRO-NAME)
- If the `m4' macro MACRO-NAME has not already been called, call it
- (without any arguments). Make sure to quote MACRO-NAME with
- square brackets. MACRO-NAME must have been defined using
- `AC_DEFUN' or else contain a call to `AC_PROVIDE' to indicate that
- it has been called.
-
- An alternative to using `AC_DEFUN' is to use `define' and call
-`AC_PROVIDE'. Because this technique does not prevent nested messages,
-it is considered obsolete.
-
- - Macro: AC_PROVIDE (THIS-MACRO-NAME)
- Record the fact that THIS-MACRO-NAME has been called.
- tHIS-MACRO-NAME should be the name of the macro that is calling
- `AC_PROVIDE'. An easy way to get it is from the `m4' builtin
- variable `$0', like this:
-
- AC_PROVIDE([$0])
-
-
-File: autoconf.info, Node: Suggested Ordering, Next: Obsolete Macros, Prev: Prerequisite Macros, Up: Dependencies Between Macros
-
-Suggested Ordering
-------------------
-
- Some macros should be run before another macro if both are called,
-but neither *requires* that the other be called. For example, a macro
-that changes the behavior of the C compiler should be called before any
-macros that run the C compiler. Many of these dependencies are noted in
-the documentation.
-
- Autoconf provides the `AC_BEFORE' macro to warn users when macros
-with this kind of dependency appear out of order in a `configure.in'
-file. The warning occurs when creating `configure' from
-`configure.in', not when running `configure'. For example,
-`AC_PROG_CPP' checks whether the C compiler can run the C preprocessor
-when given the `-E' option. It should therefore be called after any
-macros that change which C compiler is being used, such as
-`AC_PROG_CC'. So `AC_PROG_CC' contains:
-
- AC_BEFORE([$0], [AC_PROG_CPP])dnl
-
-This warns the user if a call to `AC_PROG_CPP' has already occurred
-when `AC_PROG_CC' is called.
-
- - Macro: AC_BEFORE (THIS-MACRO-NAME, CALLED-MACRO-NAME)
- Make `m4' print a warning message on the standard error output if
- CALLED-MACRO-NAME has already been called. THIS-MACRO-NAME should
- be the name of the macro that is calling `AC_BEFORE'. The macro
- CALLED-MACRO-NAME must have been defined using `AC_DEFUN' or else
- contain a call to `AC_PROVIDE' to indicate that it has been called.
-
-
-File: autoconf.info, Node: Obsolete Macros, Prev: Suggested Ordering, Up: Dependencies Between Macros
-
-Obsolete Macros
----------------
-
- Configuration and portability technology has evolved over the years.
-Often better ways of solving a particular problem are developed, or
-ad-hoc approaches are systematized. This process has occurred in many
-parts of Autoconf. One result is that some of the macros are now
-considered "obsolete"; they still work, but are no longer considered
-the best thing to do. Autoconf provides the `AC_OBSOLETE' macro to
-warn users producing `configure' scripts when they use obsolete macros,
-to encourage them to modernize. A sample call is:
-
- AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnl
-
- - Macro: AC_OBSOLETE (THIS-MACRO-NAME [, SUGGESTION])
- Make `m4' print a message on the standard error output warning that
- THIS-MACRO-NAME is obsolete, and giving the file and line number
- where it was called. THIS-MACRO-NAME should be the name of the
- macro that is calling `AC_OBSOLETE'. If SUGGESTION is given, it
- is printed at the end of the warning message; for example, it can
- be a suggestion for what to use instead of THIS-MACRO-NAME.
-
-
-File: autoconf.info, Node: Manual Configuration, Next: Site Configuration, Prev: Writing Macros, Up: Top
-
-Manual Configuration
-********************
-
- A few kinds of features can't be guessed automatically by running
-test programs. For example, the details of the object file format, or
-special options that need to be passed to the compiler or linker. It is
-possible to check for such features using ad-hoc means, such as having
-`configure' check the output of the `uname' program, or looking for
-libraries that are unique to particular systems. However, Autoconf
-provides a uniform method for handling unguessable features.
-
-* Menu:
-
-* Specifying Names:: Specifying the system type.
-* Canonicalizing:: Getting the canonical system type.
-* System Type Variables:: Variables containing the system type.
-* Using System Type:: What to do with the system type.
-
-
-File: autoconf.info, Node: Specifying Names, Next: Canonicalizing, Up: Manual Configuration
-
-Specifying the System Type
-==========================
-
- Like other GNU `configure' scripts, Autoconf-generated `configure'
-scripts can make decisions based on a canonical name for the system
-type, which has the form:
-
- CPU-COMPANY-SYSTEM
-
- `configure' can usually guess the canonical name for the type of
-system it's running on. To do so it runs a script called
-`config.guess', which derives the name using the `uname' command or
-symbols predefined by the C preprocessor.
-
- Alternately, the user can specify the system type with command line
-arguments to `configure'. Doing so is necessary when cross-compiling.
-In the most complex case of cross-compiling, three system types are
-involved. The options to specify them are:
-
-`--build=BUILD-TYPE'
- the type of system on which the package is being configured and
- compiled (rarely needed);
-
-`--host=HOST-TYPE'
- the type of system on which the package will run;
-
-`--target=TARGET-TYPE'
- the type of system for which any compiler tools in the package will
- produce code.
-
-If the user gives `configure' a non-option argument, it is used as the
-default for the host, target, and build system types if the user does
-not specify them explicitly with options. The target and build types
-default to the host type if it is given and they are not. If you are
-cross-compiling, you still have to specify the names of the cross-tools
-you use, in particular the C compiler, on the `configure' command line,
-e.g.,
-
- CC=m68k-coff-gcc configure --target=m68k-coff
-
- `configure' recognizes short aliases for many system types; for
-example, `decstation' can be given on the command line instead of
-`mips-dec-ultrix4.2'. `configure' runs a script called `config.sub' to
-canonicalize system type aliases.
-
-
-File: autoconf.info, Node: Canonicalizing, Next: System Type Variables, Prev: Specifying Names, Up: Manual Configuration
-
-Getting the Canonical System Type
-=================================
-
- The following macros make the system type available to `configure'
-scripts. They run the shell script `config.guess' to determine any
-values for the host, target, and build types that they need and the user
-did not specify on the command line. They run `config.sub' to
-canonicalize any aliases the user gave. If you use these macros, you
-must distribute those two shell scripts along with your source code.
-*Note Output::, for information about the `AC_CONFIG_AUX_DIR' macro
-which you can use to control which directory `configure' looks for
-those scripts in. If you do not use either of these macros,
-`configure' ignores any `--host', `--target', and `--build' options
-given to it.
-
- - Macro: AC_CANONICAL_SYSTEM
- Determine the system type and set output variables to the names of
- the canonical system types. *Note System Type Variables::, for
- details about the variables this macro sets.
-
- - Macro: AC_CANONICAL_HOST
- Perform only the subset of `AC_CANONICAL_SYSTEM' relevant to the
- host type. This is all that is needed for programs that are not
- part of a compiler toolchain.
-
-
-File: autoconf.info, Node: System Type Variables, Next: Using System Type, Prev: Canonicalizing, Up: Manual Configuration
-
-System Type Variables
-=====================
-
- After calling `AC_CANONICAL_SYSTEM', the following output variables
-contain the system type information. After `AC_CANONICAL_HOST', only
-the `host' variables below are set.
-
-``build', `host', `target''
- the canonical system names;
-
-``build_alias', `host_alias', `target_alias''
- the names the user specified, or the canonical names if
- `config.guess' was used;
-
-``build_cpu', `build_vendor', `build_os''
-``host_cpu', `host_vendor', `host_os''
-``target_cpu', `target_vendor', `target_os''
- the individual parts of the canonical names (for convenience).
-
-
-File: autoconf.info, Node: Using System Type, Prev: System Type Variables, Up: Manual Configuration
-
-Using the System Type
-=====================
-
- How do you use a canonical system type? Usually, you use it in one
-or more `case' statements in `configure.in' to select system-specific C
-files. Then link those files, which have names based on the system
-name, to generic names, such as `host.h' or `target.c'. The `case'
-statement patterns can use shell wildcards to group several cases
-together, like in this fragment:
-
- case "$target" in
- i386-*-mach* | i386-*-gnu*) obj_format=aout emulation=mach bfd_gas=yes ;;
- i960-*-bout) obj_format=bout ;;
- esac
-
- - Macro: AC_LINK_FILES (SOURCE..., DEST...)
- Make `AC_OUTPUT' link each of the existing files SOURCE to the
- corresponding link name DEST. Makes a symbolic link if possible,
- otherwise a hard link. The DEST and SOURCE names should be
- relative to the top level source or build directory.
-
- For example, this call:
-
- AC_LINK_FILES(config/${machine}.h config/${obj_format}.h, host.h object.h)
-
- creates in the current directory `host.h', which is a link to
- `SRCDIR/config/${machine}.h', and `object.h', which is a link to
- `SRCDIR/config/${obj_format}.h'.
-
-
-File: autoconf.info, Node: Site Configuration, Next: Invoking configure, Prev: Manual Configuration, Up: Top
-
-Site Configuration
-******************
-
- `configure' scripts support several kinds of local configuration
-decisions. There are ways for users to specify where external software
-packages are, include or exclude optional features, install programs
-under modified names, and set default values for `configure' options.
-
-* Menu:
-
-* External Software:: Working with other optional software.
-* Package Options:: Selecting optional features.
-* Site Details:: Configuring site details.
-* Transforming Names:: Changing program names when installing.
-* Site Defaults:: Giving `configure' local defaults.
-
-
-File: autoconf.info, Node: External Software, Next: Package Options, Up: Site Configuration
-
-Working With External Software
-==============================
-
- Some packages require, or can optionally use, other software packages
-which are already installed. The user can give `configure' command
-line options to specify which such external software to use. The
-options have one of these forms:
-
- --with-PACKAGE[=ARG]
- --without-PACKAGE
-
- For example, `--with-gnu-ld' means work with the GNU linker instead
-of some other linker. `--with-x11' means work with X11.
-
- The user can give an argument by following the package name with `='
-and the argument. Giving an argument of `no' is for packages that are
-used by default; it says to *not* use the package. An argument that is
-neither `yes' nor `no' could include a name or number of a version of
-the other package, to specify more precisely which other package this
-program is supposed to work with. If no argument is given, it defaults
-to `yes'. `--without-PACKAGE' is equivalent to `--with-PACKAGE=no'.
-
- For each external software package that may be used, `configure.in'
-should call `AC_ARG_WITH' to detect whether the `configure' user asked
-to use it. Whether each package is used or not by default, and which
-arguments are valid, is up to you.
-
- - Macro: AC_ARG_WITH (PACKAGE, HELP-STRING, ACTION-IF-TRUE [,
- ACTION-IF-FALSE])
- If the user gave `configure' the option `--with-PACKAGE' or
- `--without-PACKAGE', run shell commands ACTION-IF-TRUE. Otherwise
- run shell commands ACTION-IF-FALSE. The name PACKAGE indicates
- another software package that this program should work with. It
- should consist only of alphanumeric characters and dashes.
-
- The option's argument is available to the shell commands
- ACTION-IF-TRUE in the shell variable `withval'.
-
- The argument HELP-STRING is a description of the option which
- looks like this:
- --with-readline support fancy command line editing
-
- HELP-STRING may be more than one line long, if more detail is
- needed. Just make sure the columns line up in `configure --help'.
- Avoid tabs in the help string. You'll need to enclose it in `['
- and `]' in order to produce the leading spaces.
-
- - Macro: AC_WITH (PACKAGE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
- This is an obsolete version of `AC_ARG_WITH' that does not support
- providing a help string.
-
-
-File: autoconf.info, Node: Package Options, Next: Site Details, Prev: External Software, Up: Site Configuration
-
-Choosing Package Options
-========================
-
- If a software package has optional compile-time features, the user
-can give `configure' command line options to specify whether to compile
-them. The options have one of these forms:
-
- --enable-FEATURE[=ARG]
- --disable-FEATURE
-
- These options allow users to choose which optional features to build
-and install. `--enable-FEATURE' options should never make a feature
-behave differently or cause one feature to replace another. They
-should only cause parts of the program to be built rather than left out.
-
- The user can give an argument by following the feature name with `='
-and the argument. Giving an argument of `no' requests that the feature
-*not* be made available. A feature with an argument looks like
-`--enable-debug=stabs'. If no argument is given, it defaults to `yes'.
-`--disable-FEATURE' is equivalent to `--enable-FEATURE=no'.
-
- For each optional feature, `configure.in' should call
-`AC_ARG_ENABLE' to detect whether the `configure' user asked to include
-it. Whether each feature is included or not by default, and which
-arguments are valid, is up to you.
-
- - Macro: AC_ARG_ENABLE (FEATURE, HELP-STRING, ACTION-IF-TRUE [,
- ACTION-IF-FALSE])
- If the user gave `configure' the option `--enable-FEATURE' or
- `--disable-FEATURE', run shell commands ACTION-IF-TRUE. Otherwise
- run shell commands ACTION-IF-FALSE. The name FEATURE indicates an
- optional user-level facility. It should consist only of
- alphanumeric characters and dashes.
-
- The option's argument is available to the shell commands
- ACTION-IF-TRUE in the shell variable `enableval'. The HELP-STRING
- argument is like that of `AC_ARG_WITH' (*note External
- Software::.).
-
- - Macro: AC_ENABLE (FEATURE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
- This is an obsolete version of `AC_ARG_ENABLE' that does not
- support providing a help string.
-
-
-File: autoconf.info, Node: Site Details, Next: Transforming Names, Prev: Package Options, Up: Site Configuration
-
-Configuring Site Details
-========================
-
- Some software packages require complex site-specific information.
-Some examples are host names to use for certain services, company
-names, and email addresses to contact. Since some configuration
-scripts generated by Metaconfig ask for such information interactively,
-people sometimes wonder how to get that information in
-Autoconf-generated configuration scripts, which aren't interactive.
-
- Such site configuration information should be put in a file that is
-edited *only by users*, not by programs. The location of the file can
-either be based on the `prefix' variable, or be a standard location
-such as the user's home directory. It could even be specified by an
-environment variable. The programs should examine that file at run
-time, rather than at compile time. That approach is more convenient
-for users and makes the configuration process simpler than getting the
-information while configuring. *Note Variables for Installation
-Directories: (standards)Directory Variables, for more information on
-where to put data files.
-
diff --git a/util/autoconf/autoconf.info-4 b/util/autoconf/autoconf.info-4
deleted file mode 100644
index f296435..0000000
--- a/util/autoconf/autoconf.info-4
+++ /dev/null
@@ -1,1123 +0,0 @@
-This is Info file autoconf.info, produced by Makeinfo-1.55 from the
-input file ./autoconf.texi.
-
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an `m4' macro
-package.
-
- Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-File: autoconf.info, Node: Transforming Names, Next: Site Defaults, Prev: Site Details, Up: Site Configuration
-
-Transforming Program Names When Installing
-==========================================
-
- Autoconf supports changing the names of programs when installing
-them. In order to use these transformations, `configure.in' must call
-the macro `AC_ARG_PROGRAM'.
-
- - Macro: AC_ARG_PROGRAM
- Place in output variable `program_transform_name' a sequence of
- `sed' commands for changing the names of installed programs.
-
- If any of the options described below are given to `configure',
- program names are transformed accordingly. Otherwise, if
- `AC_CANONICAL_SYSTEM' has been called and a `--target' value is
- given that differs from the host type (specified with `--host' or
- defaulted by `config.sub'), the target type followed by a dash is
- used as a prefix. Otherwise, no program name transformation is
- done.
-
-* Menu:
-
-* Transformation Options:: `configure' options to transforme names.
-* Transformation Examples:: Sample uses of transforming names.
-* Transformation Rules:: `Makefile' uses of transforming names.
-
-
-File: autoconf.info, Node: Transformation Options, Next: Transformation Examples, Up: Transforming Names
-
-Transformation Options
-----------------------
-
- You can specify name transformations by giving `configure' these
-command line options:
-
-`--program-prefix=PREFIX'
- prepend PREFIX to the names;
-
-`--program-suffix=SUFFIX'
- append SUFFIX to the names;
-
-`--program-transform-name=EXPRESSION'
- perform `sed' substitution EXPRESSION on the names.
-
-
-File: autoconf.info, Node: Transformation Examples, Next: Transformation Rules, Prev: Transformation Options, Up: Transforming Names
-
-Transformation Examples
------------------------
-
- These transformations are useful with programs that can be part of a
-cross-compilation development environment. For example, a
-cross-assembler running on a Sun 4 configured with
-`--target=i960-vxworks' is normally installed as `i960-vxworks-as',
-rather than `as', which could be confused with a native Sun 4 assembler.
-
- You can force a program name to begin with `g', if you don't want
-GNU programs installed on your system to shadow other programs with the
-same name. For example, if you configure GNU `diff' with
-`--program-prefix=g', then when you run `make install' it is installed
-as `/usr/local/bin/gdiff'.
-
- As a more sophistocated example, you could use
- --program-transform-name='s/^/g/; s/^gg/g/; s/^gless/less/'
-
-to prepend `g' to most of the program names in a source tree, excepting
-those like `gdb' that already have one and those like `less' and
-`lesskey' that aren't GNU programs. (That is assuming that you have a
-source tree containing those programs that is set up to use this
-feature.)
-
- One way to install multiple versions of some programs simultaneously
-is to append a version number to the name of one or both. For example,
-if you want to keep Autoconf version 1 around for awhile, you can
-configure Autoconf version 2 using `--program-suffix=2' to install the
-programs as `/usr/local/bin/autoconf2', `/usr/local/bin/autoheader2',
-etc.
-
-
-File: autoconf.info, Node: Transformation Rules, Prev: Transformation Examples, Up: Transforming Names
-
-Transformation Rules
---------------------
-
- Here is how to use the variable `program_transform_name' in a
-`Makefile.in':
-
- transform=@program_transform_name@
- install: all
- $(INSTALL_PROGRAM) myprog $(bindir)/`echo myprog|sed '$(transform)'`
-
- uninstall:
- rm -f $(bindir)/`echo myprog|sed '$(transform)'`
-
-If you have more than one program to install, you can do it in a loop:
-
- PROGRAMS=cp ls rm
- install:
- for p in $(PROGRAMS); do \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
-
- uninstall:
- for p in $(PROGRAMS); do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
-
- Whether to do the transformations on documentation files (Texinfo or
-`man') is a tricky question; there seems to be no perfect answer, due
-to the several reasons for name transforming. Documentation is not
-usually particular to a specific architecture, and Texinfo files do not
-conflict with system documentation. But they might conflict with
-earlier versions of the same files, and `man' pages sometimes do
-conflict with system documentation. As a compromise, it is probably
-best to do name transformations on `man' pages but not on Texinfo
-manuals.
-
-
-File: autoconf.info, Node: Site Defaults, Prev: Transforming Names, Up: Site Configuration
-
-Setting Site Defaults
-=====================
-
- Autoconf-generated `configure' scripts allow your site to provide
-default values for some configuration values. You do this by creating
-site- and system-wide initialization files.
-
- If the environment variable `CONFIG_SITE' is set, `configure' uses
-its value as the name of a shell script to read. Otherwise, it reads
-the shell script `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Thus, settings in
-machine-specific files override those in machine-independent ones in
-case of conflict.
-
- Site files can be arbitrary shell scripts, but only certain kinds of
-code are really appropriate to be in them. Because `configure' reads
-any cache file after it has read any site files, a site file can define
-a default cache file to be shared between all Autoconf-generated
-`configure' scripts run on that system. If you set a default cache
-file in a site file, it is a good idea to also set the output variable
-`CC' in that site file, because the cache file is only valid for a
-particular compiler, but many systems have several available.
-
- Site files are also good places to set default values for other
-output variables, such as `CFLAGS', if you need to give them non-default
-values: anything you would normally do, repetitively, on the command
-line. If you use non-default values for PREFIX or EXEC_PREFIX
-(wherever you locate the site file), you can set them in the site file
-if you specify it with the `CONFIG_SITE' environment variable.
-
- You can set some cache values in the site file itself. Doing this is
-useful if you are cross-compiling, so it is impossible to check features
-that require running a test program. You could "prime the cache" by
-setting those values correctly for that system in
-`PREFIX/etc/config.site'. To find out the names of the cache variables
-you need to set, look for shell variables with `_cv_' in their names in
-the affected `configure' scripts, or in the Autoconf `m4' source code
-for those macros.
-
- The cache file is careful to not override any variables set in the
-site files. Similarly, you should not override command-line options in
-the site files. Your code should check that variables such as `prefix'
-and `cache_file' have their default values (as set near the top of
-`configure') before changing them.
-
- Here is a sample file `/usr/share/local/gnu/share/config.site'. The
-command `configure --prefix=/usr/share/local/gnu' would read this file
-(if `CONFIG_SITE' is not set to a different file).
-
- # config.site for configure
- #
- # Default --prefix and --exec-prefix.
- test "$prefix" = NONE && prefix=/usr/share/local/gnu
- test "$exec_prefix" = NONE && exec_prefix=/usr/local/gnu
- #
- # Give Autoconf 2.x generated configure scripts a shared default
- # cache file for feature test results, architecture-specific.
- if test "$cache_file" = ./config.cache; then
- cache_file="$prefix/var/config.cache"
- # A cache file is only valid for one C compiler.
- CC=gcc
- fi
-
-
-File: autoconf.info, Node: Invoking configure, Next: Invoking config.status, Prev: Site Configuration, Up: Top
-
-Running `configure' Scripts
-***************************
-
- Below are instructions on how to configure a package that uses a
-`configure' script, suitable for inclusion as an `INSTALL' file in the
-package. A plain-text version of `INSTALL' which you may use comes
-with Autoconf.
-
-* Menu:
-
-* Basic Installation:: Instructions for typical cases.
-* Compilers and Options:: Selecting compilers and optimization.
-* Build Directory:: Configuring in a different directory.
-* Installation Names:: Installing in different directories.
-* Optional Features:: Selecting optional features.
-* System Type:: Specifying the system type.
-* Sharing Defaults:: Setting site-wide defaults for `configure'.
-* Operation Controls:: Changing how `configure' runs.
-
-
-File: autoconf.info, Node: Basic Installation, Next: Compilers and Options, Up: Invoking configure
-
-Basic Installation
-==================
-
- These are generic installation instructions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, a file
-`config.cache' that saves the results of its tests to speed up
-reconfiguring, and a file `config.log' containing compiler output
-(useful mainly for debugging `configure').
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If at some point `config.cache'
-contains results you don't want to keep, you may remove or edit it.
-
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need `configure.in' if you want to change
-it or regenerate `configure' using a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source directory by typing `make clean'. To also remove the files
- that `configure' created (so you can compile the package for a
- different kind of computer), type `make distclean'.
-
-
-File: autoconf.info, Node: Compilers and Options, Next: Build Directory, Prev: Basic Installation, Up: Invoking configure
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. You can give `configure'
-initial values for variables by setting them in the environment. Using
-a Bourne-compatible shell, you can do that on the command line like
-this:
- CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-
-Or on systems that have the `env' program, you can do it like this:
- env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-
-
-File: autoconf.info, Node: Build Directory, Next: Installation Names, Prev: Compilers and Options, Up: Invoking configure
-
-Using a Different Build Directory
-=================================
-
- You can compile the package in a different directory from the one
-containing the source code. Doing so allows you to compile it on more
-than one kind of computer at the same time. To do this, you must use a
-version of `make' that supports the `VPATH' variable, such as GNU
-`make'. `cd' to the directory where you want the object files and
-executables to go and run the `configure' script. `configure'
-automatically checks for the source code in the directory that
-`configure' is in and in `..'.
-
-
-File: autoconf.info, Node: Installation Names, Next: Optional Features, Prev: Build Directory, Up: Invoking configure
-
-Installation Names
-==================
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PATH', the package will use
-PATH as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-
-File: autoconf.info, Node: Optional Features, Next: System Type, Prev: Installation Names, Up: Invoking configure
-
-Optional Features
-=================
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-
-File: autoconf.info, Node: System Type, Next: Sharing Defaults, Prev: Optional Features, Up: Invoking configure
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually `configure' can figure that out, but if it prints
-a message saying it can not guess the host type, give it the
-`--host=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name with three fields:
- CPU-COMPANY-SYSTEM
-
-See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the host type.
-
- If you are building compiler tools for cross-compiling, you can also
-use the `--target=TYPE' option to select the type of system they will
-produce code for and the `--build=TYPE' option to select the type of
-system on which you are compiling the package.
-
-
-File: autoconf.info, Node: Sharing Defaults, Next: Operation Controls, Prev: System Type, Up: Invoking configure
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-
-File: autoconf.info, Node: Operation Controls, Prev: Sharing Defaults, Up: Invoking configure
-
-Operation Controls
-==================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--cache-file=FILE'
- Save the results of the tests in FILE instead of `config.cache'.
- Set FILE to `/dev/null' to disable caching, for debugging
- `configure'.
-
-`--help'
- Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made.
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`configure' also accepts some other, not widely useful, options.
-
-
-File: autoconf.info, Node: Invoking config.status, Next: Questions, Prev: Invoking configure, Up: Top
-
-Recreating a Configuration
-**************************
-
- The `configure' script creates a file named `config.status' which
-describes which configuration options were specified when the package
-was last configured. This file is a shell script which, if run, will
-recreate the same configuration.
-
- You can give `config.status' the `--recheck' option to update
-itself. This option is useful if you change `configure', so that the
-results of some tests might be different from the previous run. The
-`--recheck' option re-runs `configure' with the same arguments you used
-before, plus the `--no-create' option, which prevent `configure' from
-running `config.status' and creating `Makefile' and other files, and
-the `--no-recursion' option, which prevents `configure' from running
-other `configure' scripts in subdirectories. (This is so other
-`Makefile' rules can run `config.status' when it changes; *note
-Automatic Remaking::., for an example).
-
- `config.status' also accepts the options `--help', which prints a
-summary of the options to `config.status', and `--version', which
-prints the version of Autoconf used to create the `configure' script
-that generated `config.status'.
-
- `config.status' checks several optional environment variables that
-can alter its behavior:
-
- - Variable: CONFIG_SHELL
- The shell with which to run `configure' for the `--recheck'
- option. It must be Bourne-compatible. The default is `/bin/sh'.
-
- - Variable: CONFIG_STATUS
- The file name to use for the shell script that records the
- configuration. The default is `./config.status'. This variable is
- useful when one package uses parts of another and the `configure'
- scripts shouldn't be merged because they are maintained separately.
-
- The following variables provide one way for separately distributed
-packages to share the values computed by `configure'. Doing so can be
-useful if some of the packages need a superset of the features that one
-of them, perhaps a common library, does. These variables allow a
-`config.status' file to create files other than the ones that its
-`configure.in' specifies, so it can be used for a different package.
-
- - Variable: CONFIG_FILES
- The files in which to perform `@VARIABLE@' substitutions. The
- default is the arguments given to `AC_OUTPUT' in `configure.in'.
-
- - Variable: CONFIG_HEADERS
- The files in which to substitute C `#define' statements. The
- default is the arguments given to `AC_CONFIG_HEADER'; if that
- macro was not called, `config.status' ignores this variable.
-
- These variables also allow you to write `Makefile' rules that
-regenerate only some of the files. For example, in the dependencies
-given above (*note Automatic Remaking::.), `config.status' is run twice
-when `configure.in' has changed. If that bothers you, you can make
-each run only regenerate the files for that rule:
-
- config.h: stamp-h
- stamp-h: config.h.in config.status
- CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
- echo > stamp-h
-
- Makefile: Makefile.in config.status
- CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status
-
-(If `configure.in' does not call `AC_CONFIG_HEADER', there is no need
-to set `CONFIG_HEADERS' in the `make' rules.)
-
-
-File: autoconf.info, Node: Questions, Next: Upgrading, Prev: Invoking config.status, Up: Top
-
-Questions About Autoconf
-************************
-
- Several questions about Autoconf come up occasionally. Here some of
-them are addressed.
-
-* Menu:
-
-* Distributing:: Distributing `configure' scripts.
-* Why GNU m4:: Why not use the standard `m4'?
-* Bootstrapping:: Autoconf and GNU `m4' require each other?
-* Why Not Imake:: Why GNU uses `configure' instead of Imake.
-
-
-File: autoconf.info, Node: Distributing, Next: Why GNU m4, Up: Questions
-
-Distributing `configure' Scripts
-================================
-
- What are the restrictions on distributing `configure'
- scripts that Autoconf generates? How does that affect my
- programs that use them?
-
- There are no restrictions on how the configuration scripts that
-Autoconf produces may be distributed or used. In Autoconf version 1,
-they were covered by the GNU General Public License. We still
-encourage software authors to distribute their work under terms like
-those of the GPL, but doing so is not required to use Autoconf.
-
- Of the other files that might be used with `configure',
-`config.h.in' is under whatever copyright you use for your
-`configure.in', since it is derived from that file and from the public
-domain file `acconfig.h'. `config.sub' and `config.guess' have an
-exception to the GPL when they are used with an Autoconf-generated
-`configure' script, which permits you to distribute them under the same
-terms as the rest of your package. `install-sh' is from the X
-Consortium and is not copyrighted.
-
-
-File: autoconf.info, Node: Why GNU m4, Next: Bootstrapping, Prev: Distributing, Up: Questions
-
-Why Require GNU `m4'?
-=====================
-
- Why does Autoconf require GNU `m4'?
-
- Many `m4' implementations have hard-coded limitations on the size
-and number of macros, which Autoconf exceeds. They also lack several
-builtin macros that it would be difficult to get along without in a
-sophisticated application like Autoconf, including:
-
- builtin
- indir
- patsubst
- __file__
- __line__
-
- Since only software maintainers need to use Autoconf, and since GNU
-`m4' is simple to configure and install, it seems reasonable to require
-GNU `m4' to be installed also. Many maintainers of GNU and other free
-software already have most of the GNU utilities installed, since they
-prefer them.
-
-
-File: autoconf.info, Node: Bootstrapping, Next: Why Not Imake, Prev: Why GNU m4, Up: Questions
-
-How Can I Bootstrap?
-====================
-
- If Autoconf requires GNU `m4' and GNU `m4' has an
- Autoconf `configure' script, how do I bootstrap? It seems
- like a chicken and egg problem!
-
- This is a misunderstanding. Although GNU `m4' does come with a
-`configure' script produced by Autoconf, Autoconf is not required in
-order to run the script and install GNU `m4'. Autoconf is only
-required if you want to change the `m4' `configure' script, which few
-people have to do (mainly its maintainer).
-
-
-File: autoconf.info, Node: Why Not Imake, Prev: Bootstrapping, Up: Questions
-
-Why Not Imake?
-==============
-
- Why not use Imake instead of `configure' scripts?
-
- Several people have written addressing this question, so I include
-adaptations of their explanations here.
-
- The following answer is based on one written by Richard Pixley:
-
- Autoconf generated scripts frequently work on machines which it has
-never been set up to handle before. That is, it does a good job of
-inferring a configuration for a new system. Imake cannot do this.
-
- Imake uses a common database of host specific data. For X11, this
-makes sense because the distribution is made as a collection of tools,
-by one central authority who has control over the database.
-
- GNU tools are not released this way. Each GNU tool has a maintainer;
-these maintainers are scattered across the world. Using a common
-database would be a maintenance nightmare. Autoconf may appear to be
-this kind of database, but in fact it is not. Instead of listing host
-dependencies, it lists program requirements.
-
- Imake is special-purpose. It is directed at building the X11
-distribution. By comparison to the GNU tools, this is a simple problem.
-If you view the GNU suite as a collection of native tools, then the
-problems are similar. But the GNU tools are more powerful than that.
-The development tools can be configured as cross tools in almost any
-host+target permutation. All of these configurations can be installed
-concurrently. They can even be configured to share host independent
-files across hosts. Imake doesn't address these issues.
-
- Imake templates are a form of standardization. The GNU coding
-standards address the same issues without necessarily imposing the same
-restrictions.
-
- Here is some further explanation, written by Per Bothner:
-
- One of the advantages of Imake is that it easy to generate large
-Makefiles using `cpp''s `#include' and macro mechanisms. However,
-`cpp' is not programmable: it has limited conditional facilities, and
-no looping. And `cpp' cannot inspect its environment.
-
- All of these problems are solved by using `sh' instead of `cpp'.
-The shell is fully programmable, has macro substitution, can execute
-(or source) other shell scripts, and can inspect its environment.
-
- Paul Eggert elaborates more:
-
- With Autoconf, installers need not assume that Imake itself is
-already installed and working well. This may not seem like much of an
-advantage to people who are accustomed to Imake. But on many hosts
-Imake is not installed or the default installation is not working well,
-and requiring Imake to install a package hinders the acceptance of that
-package on those hosts. For example, the Imake template and
-configuration files might not be installed properly on a host, or the
-Imake build procedure might wrongly assume that all source files are in
-one big directory tree, or the Imake configuration might assume one
-compiler whereas the package or the installer needs to use another, or
-there might be a version mismatch between the Imake expected by the
-package and the Imake suported by the host. These problems are much
-rarer with Autoconf, where each package comes with its own independent
-configuration processor.
-
- Also, Imake often suffers from unexpected interactions between
-`make' and the installer's C preprocessor. The fundamental problem
-here is that the C preprocessor was designed to preprocess C programs,
-not `Makefile's. This is much less of a problem with Autoconf, which
-uses the general-purpose preprocessor `m4', and where the package's
-author (rather than the installer) does the preprocessing in a standard
-way.
-
- Finally, Mark Eichin notes:
-
- Imake isn't all that extensible, either. In order to add new
-features to Imake, you need to provide you own project template, and
-duplicate most of the features of the existing one. This means that
-for a sophisticated project, using the vendor-provided Imake templates
-fails to provide any leverage--since they don't cover anything that
-your own project needs (unless it is an X11 program).
-
- On the other side, though:
-
- The one advantage that Imake has over `configure': `Imakefile's tend
-to be much shorter (likewise, less redundant) than `Makefile.in's.
-There is a fix to this, however--at least for the Kerberos V5 tree,
-we've modified things to call in common `post.in' and `pre.in'
-`Makefile' fragments for the entire tree. This means that a lot of
-common things don't have to be duplicated, even though they normally
-are in `configure' setups.
-
-
-File: autoconf.info, Node: Upgrading, Next: History, Prev: Questions, Up: Top
-
-Upgrading From Version 1
-************************
-
- Autoconf version 2 is mostly backward compatible with version 1.
-However, it introduces better ways to do some things, and doesn't
-support some of the ugly things in version 1. So, depending on how
-sophisticated your `configure.in' files are, you might have to do some
-manual work in order to upgrade to version 2. This chapter points out
-some problems to watch for when upgrading. Also, perhaps your
-`configure' scripts could benefit from some of the new features in
-version 2; the changes are summarized in the file `NEWS' in the
-Autoconf distribution.
-
- First, make sure you have GNU `m4' version 1.1 or higher installed,
-preferably 1.3 or higher. Versions before 1.1 have bugs that prevent
-them from working with Autoconf version 2. Versions 1.3 and later are
-much faster than earlier versions, because as of version 1.3, GNU `m4'
-has a more efficient implementation of diversions and can freeze its
-internal state in a file that it can read back quickly.
-
-* Menu:
-
-* Changed File Names:: Files you might rename.
-* Changed Makefiles:: New things to put in `Makefile.in'.
-* Changed Macros:: Macro calls you might replace.
-* Invoking autoupdate:: Replacing old macro names in `configure.in'.
-* Changed Results:: Changes in how to check test results.
-* Changed Macro Writing:: Better ways to write your own macros.
-
-
-File: autoconf.info, Node: Changed File Names, Next: Changed Makefiles, Up: Upgrading
-
-Changed File Names
-==================
-
- If you have an `aclocal.m4' installed with Autoconf (as opposed to
-in a particular package's source directory), you must rename it to
-`acsite.m4'. *Note Invoking autoconf::.
-
- If you distribute `install.sh' with your package, rename it to
-`install-sh' so `make' builtin rules won't inadvertantly create a file
-called `install' from it. `AC_PROG_INSTALL' looks for the script under
-both names, but it is best to use the new name.
-
- If you were using `config.h.top' or `config.h.bot', you still can,
-but you will have less clutter if you merge them into `acconfig.h'.
-*Note Invoking autoheader::.
-
-
-File: autoconf.info, Node: Changed Makefiles, Next: Changed Macros, Prev: Changed File Names, Up: Upgrading
-
-Changed Makefiles
-=================
-
- Add `@CFLAGS@', `@CPPFLAGS@', and `@LDFLAGS@' in your `Makefile.in'
-files, so they can take advantage of the values of those variables in
-the environment when `configure' is run. Doing this isn't necessary,
-but it's a convenience for users.
-
- Also add `@configure_input@' in a comment to each input file for
-`AC_OUTPUT', so that the output files will contain a comment saying
-they were produced by `configure'. Automatically selecting the right
-comment syntax for all the kinds of files that people call `AC_OUTPUT'
-on became too much work.
-
- Add `config.log' and `config.cache' to the list of files you remove
-in `distclean' targets.
-
- If you have the following in `Makefile.in':
-
- prefix = /usr/local
- exec_prefix = ${prefix}
-
-you must change it to:
-
- prefix = @prefix@
- exec_prefix = @exec_prefix@
-
-The old feature of replacing those variables without `@' characters
-around them has been removed.
-
-
-File: autoconf.info, Node: Changed Macros, Next: Invoking autoupdate, Prev: Changed Makefiles, Up: Upgrading
-
-Changed Macros
-==============
-
- Many of the macros were renamed in Autoconf version 2. You can still
-use the old names, but the new ones are clearer, and it's easier to find
-the documentation for them. *Note Old Macro Names::, for a table
-showing the new names for the old macros. Use the `autoupdate' program
-to convert your `configure.in' to using the new macro names. *Note
-Invoking autoupdate::.
-
- Some macros have been superseded by similar ones that do the job
-better, but are not call-compatible. If you get warnings about calling
-obsolete macros while running `autoconf', you may safely ignore them,
-but your `configure' script will generally work better if you follow
-the advice it prints about what to replace the obsolete macros with. In
-particular, the mechanism for reporting the results of tests has
-changed. If you were using `echo' or `AC_VERBOSE' (perhaps via
-`AC_COMPILE_CHECK'), your `configure' script's output will look better
-if you switch to `AC_MSG_CHECKING' and `AC_MSG_RESULT'. *Note Printing
-Messages::. Those macros work best in conjunction with cache
-variables. *Note Caching Results::.
-
-
-File: autoconf.info, Node: Invoking autoupdate, Next: Changed Results, Prev: Changed Macros, Up: Upgrading
-
-Using `autoupdate' to Modernize `configure'
-===========================================
-
- The `autoupdate' program updates a `configure.in' file that calls
-Autoconf macros by their old names to use the current macro names. In
-version 2 of Autoconf, most of the macros were renamed to use a more
-uniform and descriptive naming scheme. *Note Macro Names::, for a
-description of the new scheme. Although the old names still work
-(*note Old Macro Names::., for a list of the old macro names and the
-corresponding new names), you can make your `configure.in' files more
-readable and make it easier to use the current Autoconf documentation
-if you update them to use the new macro names.
-
- If given no arguments, `autoupdate' updates `configure.in', backing
-up the original version with the suffix `~' (or the value of the
-environment variable `SIMPLE_BACKUP_SUFFIX', if that is set). If you
-give `autoupdate' an argument, it reads that file instead of
-`configure.in' and writes the updated file to the standard output.
-
-`autoupdate' accepts the following options:
-
-`--help'
-`-h'
- Print a summary of the command line options and exit.
-
-`--macrodir=DIR'
-`-m DIR'
- Look for the Autoconf macro files in directory DIR instead of the
- default installation directory. You can also set the `AC_MACRODIR'
- environment variable to a directory; this option overrides the
- environment variable.
-
-`--version'
- Print the version number of `autoupdate' and exit.
-
-
-File: autoconf.info, Node: Changed Results, Next: Changed Macro Writing, Prev: Invoking autoupdate, Up: Upgrading
-
-Changed Results
-===============
-
- If you were checking the results of previous tests by examining the
-shell variable `DEFS', you need to switch to checking the values of the
-cache variables for those tests. `DEFS' no longer exists while
-`configure' is running; it is only created when generating output
-files. This difference from version 1 is because properly quoting the
-contents of that variable turned out to be too cumbersome and
-inefficient to do every time `AC_DEFINE' is called. *Note Cache
-Variable Names::.
-
- For example, here is a `configure.in' fragment written for Autoconf
-version 1:
-
- AC_HAVE_FUNCS(syslog)
- case "$DEFS" in
- *-DHAVE_SYSLOG*) ;;
- *) # syslog is not in the default libraries. See if it's in some other.
- saved_LIBS="$LIBS"
- for lib in bsd socket inet; do
- AC_CHECKING(for syslog in -l$lib)
- LIBS="$saved_LIBS -l$lib"
- AC_HAVE_FUNCS(syslog)
- case "$DEFS" in
- *-DHAVE_SYSLOG*) break ;;
- *) ;;
- esac
- LIBS="$saved_LIBS"
- done ;;
- esac
-
- Here is a way to write it for version 2:
-
- AC_CHECK_FUNCS(syslog)
- if test $ac_cv_func_syslog = no; then
- # syslog is not in the default libraries. See if it's in some other.
- for lib in bsd socket inet; do
- AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG)
- LIBS="$LIBS $lib"; break])
- done
- fi
-
- If you were working around bugs in `AC_DEFINE_UNQUOTED' by adding
-backslashes before quotes, you need to remove them. It now works
-predictably, and does not treat quotes (except backquotes) specially.
-*Note Setting Output Variables::.
-
- All of the boolean shell variables set by Autoconf macros now use
-`yes' for the true value. Most of them use `no' for false, though for
-backward compatibility some use the empty string instead. If you were
-relying on a shell variable being set to something like 1 or `t' for
-true, you need to change your tests.
-
-
-File: autoconf.info, Node: Changed Macro Writing, Prev: Changed Results, Up: Upgrading
-
-Changed Macro Writing
-=====================
-
- When defining your own macros, you should now use `AC_DEFUN' instead
-of `define'. `AC_DEFUN' automatically calls `AC_PROVIDE' and ensures
-that macros called via `AC_REQUIRE' do not interrupt other macros, to
-prevent nested `checking...' messages on the screen. There's no actual
-harm in continuing to use the older way, but it's less convenient and
-attractive. *Note Macro Definitions::.
-
- You probably looked at the macros that came with Autoconf as a guide
-for how to do things. It would be a good idea to take a look at the new
-versions of them, as the style is somewhat improved and they take
-advantage of some new features.
-
- If you were doing tricky things with undocumented Autoconf internals
-(macros, variables, diversions), check whether you need to change
-anything to account for changes that have been made. Perhaps you can
-even use an officially supported technique in version 2 instead of
-kludging. Or perhaps not.
-
- To speed up your locally written feature tests, add caching to them.
-See whether any of your tests are of general enough usefulness to
-encapsulate into macros that you can share.
-
-
-File: autoconf.info, Node: History, Next: Old Macro Names, Prev: Upgrading, Up: Top
-
-History of Autoconf
-*******************
-
- You may be wondering, Why was Autoconf originally written? How did
-it get into its present form? (Why does it look like gorilla spit?) If
-you're not wondering, then this chapter contains no information useful
-to you, and you might as well skip it. If you *are* wondering, then
-let there be light...
-
-* Menu:
-
-* Genesis:: Prehistory and naming of `configure'.
-* Exodus:: The plagues of `m4' and Perl.
-* Leviticus:: The priestly code of portability arrives.
-* Numbers:: Growth and contributors.
-* Deuteronomy:: Approaching the promises of easy configuration.
-
-
-File: autoconf.info, Node: Genesis, Next: Exodus, Up: History
-
-Genesis
-=======
-
- In June 1991 I was maintaining many of the GNU utilities for the Free
-Software Foundation. As they were ported to more platforms and more
-programs were added, the number of `-D' options that users had to
-select in the `Makefile' (around 20) became burdensome. Especially for
-me--I had to test each new release on a bunch of different systems. So
-I wrote a little shell script to guess some of the correct settings for
-the fileutils package, and released it as part of fileutils 2.0. That
-`configure' script worked well enough that the next month I adapted it
-(by hand) to create similar `configure' scripts for several other GNU
-utilities packages. Brian Berliner also adapted one of my scripts for
-his CVS revision control system.
-
- Later that summer, I learned that Richard Stallman and Richard Pixley
-were developing similar scripts to use in the GNU compiler tools; so I
-adapted my `configure' scripts to support their evolving interface:
-using the file name `Makefile.in' as the templates; adding `+srcdir',
-the first option (of many); and creating `config.status' files.
-
-
-File: autoconf.info, Node: Exodus, Next: Leviticus, Prev: Genesis, Up: History
-
-Exodus
-======
-
- As I got feedback from users, I incorporated many improvements, using
-Emacs to search and replace, cut and paste, similar changes in each of
-the scripts. As I adapted more GNU utilities packages to use
-`configure' scripts, updating them all by hand became impractical.
-Rich Murphey, the maintainer of the GNU graphics utilities, sent me mail
-saying that the `configure' scripts were great, and asking if I had a
-tool for generating them that I could send him. No, I thought, but I
-should! So I started to work out how to generate them. And the
-journey from the slavery of hand-written `configure' scripts to the
-abundance and ease of Autoconf began.
-
- Cygnus `configure', which was being developed at around that time,
-is table driven; it is meant to deal mainly with a discrete number of
-system types with a small number of mainly unguessable features (such as
-details of the object file format). The automatic configuration system
-that Brian Fox had developed for Bash takes a similar approach. For
-general use, it seems to me a hopeless cause to try to maintain an
-up-to-date database of which features each variant of each operating
-system has. It's easier and more reliable to check for most features on
-the fly--especially on hybrid systems that people have hacked on
-locally or that have patches from vendors installed.
-
- I considered using an architecture similar to that of Cygnus
-`configure', where there is a single `configure' script that reads
-pieces of `configure.in' when run. But I didn't want to have to
-distribute all of the feature tests with every package, so I settled on
-having a different `configure' made from each `configure.in' by a
-preprocessor. That approach also offered more control and flexibility.
-
- I looked briefly into using the Metaconfig package, by Larry Wall,
-Harlan Stenn, and Raphael Manfredi, but I decided not to for several
-reasons. The `Configure' scripts it produces are interactive, which I
-find quite inconvenient; I didn't like the ways it checked for some
-features (such as library functions); I didn't know that it was still
-being maintained, and the `Configure' scripts I had seen didn't work on
-many modern systems (such as System V R4 and NeXT); it wasn't very
-flexible in what it could do in response to a feature's presence or
-absence; I found it confusing to learn; and it was too big and complex
-for my needs (I didn't realize then how much Autoconf would eventually
-have to grow).
-
- I considered using Perl to generate my style of `configure' scripts,
-but decided that `m4' was better suited to the job of simple textual
-substitutions: it gets in the way less, because output is implicit.
-Plus, everyone already has it. (Initially I didn't rely on the GNU
-extensions to `m4'.) Also, some of my friends at the University of
-Maryland had recently been putting `m4' front ends on several programs,
-including `tvtwm', and I was interested in trying out a new language.
-
-
-File: autoconf.info, Node: Leviticus, Next: Numbers, Prev: Exodus, Up: History
-
-Leviticus
-=========
-
- Since my `configure' scripts determine the system's capabilities
-automatically, with no interactive user intervention, I decided to call
-the program that generates them Autoconfig. But with a version number
-tacked on, that name would be too long for old UNIX file systems, so I
-shortened it to Autoconf.
-
- In the fall of 1991 I called together a group of fellow questers
-after the Holy Grail of portability (er, that is, alpha testers) to
-give me feedback as I encapsulated pieces of my handwritten scripts in
-`m4' macros and continued to add features and improve the techniques
-used in the checks. Prominent among the testers were Franc,ois Pinard,
-who came up with the idea of making an `autoconf' shell script to run
-`m4' and check for unresolved macro calls; Richard Pixley, who
-suggested running the compiler instead of searching the file system to
-find include files and symbols, for more accurate results; Karl Berry,
-who got Autoconf to configure TeX and added the macro index to the
-documentation; and Ian Taylor, who added support for creating a C
-header file as an alternative to putting `-D' options in a `Makefile',
-so he could use Autoconf for his UUCP package. The alpha testers
-cheerfully adjusted their files again and again as the names and
-calling conventions of the Autoconf macros changed from release to
-release. They all contributed many specific checks, great ideas, and
-bug fixes.
-
-
-File: autoconf.info, Node: Numbers, Next: Deuteronomy, Prev: Leviticus, Up: History
-
-Numbers
-=======
-
- In July 1992, after months of alpha testing, I released Autoconf 1.0,
-and converted many GNU packages to use it. I was surprised by how
-positive the reaction to it was. More people started using it than I
-could keep track of, including people working on software that wasn't
-part of the GNU Project (such as TCL, FSP, and Kerberos V5). Autoconf
-continued to improve rapidly, as many people using the `configure'
-scripts reported problems they encountered.
-
- Autoconf turned out to be a good torture test for `m4'
-implementations. UNIX `m4' started to dump core because of the length
-of the macros that Autoconf defined, and several bugs showed up in GNU
-`m4' as well. Eventually, we realized that we needed to use some
-features that only GNU `m4' has. 4.3BSD `m4', in particular, has an
-impoverished set of builtin macros; the System V version is better, but
-still doesn't provide everything we need.
-
- More development occurred as people put Autoconf under more stresses
-(and to uses I hadn't anticipated). Karl Berry added checks for X11.
-david zuhn contributed C++ support. Franc,ois Pinard made it diagnose
-invalid arguments. Jim Blandy bravely coerced it into configuring GNU
-Emacs, laying the groundwork for several later improvements. Roland
-McGrath got it to configure the GNU C Library, wrote the `autoheader'
-script to automate the creation of C header file templates, and added a
-`--verbose' option to `configure'. Noah Friedman added the
-`--macrodir' option and `AC_MACRODIR' environment variable. (He also
-coined the term "autoconfiscate" to mean "adapt a software package to
-use Autoconf".) Roland and Noah improved the quoting protection in
-`AC_DEFINE' and fixed many bugs, especially when I got sick of dealing
-with portability problems from February through June, 1993.
-
-
-File: autoconf.info, Node: Deuteronomy, Prev: Numbers, Up: History
-
-Deuteronomy
-===========
-
- A long wish list for major features had accumulated, and the effect
-of several years of patching by various people had left some residual
-cruft. In April 1994, while working for Cygnus Support, I began a major
-revision of Autoconf. I added most of the features of the Cygnus
-`configure' that Autoconf had lacked, largely by adapting the relevant
-parts of Cygnus `configure' with the help of david zuhn and Ken
-Raeburn. These features include support for using `config.sub',
-`config.guess', `--host', and `--target'; making links to files; and
-running `configure' scripts in subdirectories. Adding these features
-enabled Ken to convert GNU `as', and Rob Savoye to convert DejaGNU, to
-using Autoconf.
-
- I added more features in response to other peoples' requests. Many
-people had asked for `configure' scripts to share the results of the
-checks between runs, because (particularly when configuring a large
-source tree, like Cygnus does) they were frustratingly slow. Mike
-Haertel suggested adding site-specific initialization scripts. People
-distributing software that had to unpack on MS-DOS asked for a way to
-override the `.in' extension on the file names, which produced file
-names like `config.h.in' containing two dots. Jim Avera did an
-extensive examination of the problems with quoting in `AC_DEFINE' and
-`AC_SUBST'; his insights led to significant improvements. Richard
-Stallman asked that compiler output be sent to `config.log' instead of
-`/dev/null', to help people debug the Emacs `configure' script.
-
- I made some other changes because of my dissatisfaction with the
-quality of the program. I made the messages showing results of the
-checks less ambiguous, always printing a result. I regularized the
-names of the macros and cleaned up coding style inconsistencies. I
-added some auxiliary utilities that I had developed to help convert
-source code packages to use Autoconf. With the help of Franc,ois
-Pinard, I made the macros not interrupt each others' messages. (That
-feature revealed some performance bottlenecks in GNU `m4', which he
-hastily corrected!) I reorganized the documentation around problems
-people want to solve. And I began a testsuite, because experience had
-shown that Autoconf has a pronounced tendency to regress when we change
-it.
-
- Again, several alpha testers gave invaluable feedback, especially
-Franc,ois Pinard, Jim Meyering, Karl Berry, Rob Savoye, Ken Raeburn,
-and Mark Eichin.
-
- Finally, version 2.0 was ready. And there was much rejoicing. (And
-I have free time again. I think. Yeah, right.)
-
diff --git a/util/autoconf/autoconf.info-5 b/util/autoconf/autoconf.info-5
deleted file mode 100644
index b18e2b3..0000000
--- a/util/autoconf/autoconf.info-5
+++ /dev/null
@@ -1,607 +0,0 @@
-This is Info file autoconf.info, produced by Makeinfo-1.55 from the
-input file ./autoconf.texi.
-
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an `m4' macro
-package.
-
- Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-File: autoconf.info, Node: Old Macro Names, Next: Environment Variable Index, Prev: History, Up: Top
-
-Old Macro Names
-***************
-
- In version 2 of Autoconf, most of the macros were renamed to use a
-more uniform and descriptive naming scheme. Here are the old names of
-the macros that were renamed, followed by the current names of those
-macros. Although the old names are still accepted by the `autoconf'
-program for backward compatibility, the old names are considered
-obsolete. *Note Macro Names::, for a description of the new naming
-scheme.
-
-`AC_ALLOCA'
- `AC_FUNC_ALLOCA'
-
-`AC_ARG_ARRAY'
- removed because of limited usefulness
-
-`AC_CHAR_UNSIGNED'
- `AC_C_CHAR_UNSIGNED'
-
-`AC_CONST'
- `AC_C_CONST'
-
-`AC_CROSS_CHECK'
- `AC_C_CROSS'
-
-`AC_ERROR'
- `AC_MSG_ERROR'
-
-`AC_FIND_X'
- `AC_PATH_X'
-
-`AC_FIND_XTRA'
- `AC_PATH_XTRA'
-
-`AC_FUNC_CHECK'
- `AC_CHECK_FUNC'
-
-`AC_GCC_TRADITIONAL'
- `AC_PROG_GCC_TRADITIONAL'
-
-`AC_GETGROUPS_T'
- `AC_TYPE_GETGROUPS'
-
-`AC_GETLOADAVG'
- `AC_FUNC_GETLOADAVG'
-
-`AC_HAVE_FUNCS'
- `AC_CHECK_FUNCS'
-
-`AC_HAVE_HEADERS'
- `AC_CHECK_HEADERS'
-
-`AC_HAVE_POUNDBANG'
- `AC_SYS_INTERPRETER' (different calling convention)
-
-`AC_HEADER_CHECK'
- `AC_CHECK_HEADER'
-
-`AC_HEADER_EGREP'
- `AC_EGREP_HEADER'
-
-`AC_INLINE'
- `AC_C_INLINE'
-
-`AC_LN_S'
- `AC_PROG_LN_S'
-
-`AC_LONG_DOUBLE'
- `AC_C_LONG_DOUBLE'
-
-`AC_LONG_FILE_NAMES'
- `AC_SYS_LONG_FILE_NAMES'
-
-`AC_MAJOR_HEADER'
- `AC_HEADER_MAJOR'
-
-`AC_MINUS_C_MINUS_O'
- `AC_PROG_CC_C_O'
-
-`AC_MMAP'
- `AC_FUNC_MMAP'
-
-`AC_MODE_T'
- `AC_TYPE_MODE_T'
-
-`AC_OFF_T'
- `AC_TYPE_OFF_T'
-
-`AC_PID_T'
- `AC_TYPE_PID_T'
-
-`AC_PREFIX'
- `AC_PREFIX_PROGRAM'
-
-`AC_PROGRAMS_CHECK'
- `AC_CHECK_PROGS'
-
-`AC_PROGRAMS_PATH'
- `AC_PATH_PROGS'
-
-`AC_PROGRAM_CHECK'
- `AC_CHECK_PROG'
-
-`AC_PROGRAM_EGREP'
- `AC_EGREP_CPP'
-
-`AC_PROGRAM_PATH'
- `AC_PATH_PROG'
-
-`AC_REMOTE_TAPE'
- removed because of limited usefulness
-
-`AC_RESTARTABLE_SYSCALLS'
- `AC_SYS_RESTARTABLE_SYSCALLS'
-
-`AC_RETSIGTYPE'
- `AC_TYPE_SIGNAL'
-
-`AC_RSH'
- removed because of limited usefulness
-
-`AC_SETVBUF_REVERSED'
- `AC_FUNC_SETVBUF_REVERSED'
-
-`AC_SET_MAKE'
- `AC_PROG_MAKE_SET'
-
-`AC_SIZEOF_TYPE'
- `AC_CHECK_SIZEOF'
-
-`AC_SIZE_T'
- `AC_TYPE_SIZE_T'
-
-`AC_STAT_MACROS_BROKEN'
- `AC_HEADER_STAT'
-
-`AC_STDC_HEADERS'
- `AC_HEADER_STDC'
-
-`AC_STRCOLL'
- `AC_FUNC_STRCOLL'
-
-`AC_ST_BLKSIZE'
- `AC_STRUCT_ST_BLKSIZE'
-
-`AC_ST_BLOCKS'
- `AC_STRUCT_ST_BLOCKS'
-
-`AC_ST_RDEV'
- `AC_STRUCT_ST_RDEV'
-
-`AC_SYS_SIGLIST_DECLARED'
- `AC_DECL_SYS_SIGLIST'
-
-`AC_TEST_CPP'
- `AC_TRY_CPP'
-
-`AC_TEST_PROGRAM'
- `AC_TRY_RUN'
-
-`AC_TIMEZONE'
- `AC_STRUCT_TIMEZONE'
-
-`AC_TIME_WITH_SYS_TIME'
- `AC_HEADER_TIME'
-
-`AC_UID_T'
- `AC_TYPE_UID_T'
-
-`AC_UTIME_NULL'
- `AC_FUNC_UTIME_NULL'
-
-`AC_VFORK'
- `AC_FUNC_VFORK'
-
-`AC_VPRINTF'
- `AC_FUNC_VPRINTF'
-
-`AC_WAIT3'
- `AC_FUNC_WAIT3'
-
-`AC_WARN'
- `AC_MSG_WARN'
-
-`AC_WORDS_BIGENDIAN'
- `AC_C_BIGENDIAN'
-
-`AC_YYTEXT_POINTER'
- `AC_DECL_YYTEXT'
-
-
-File: autoconf.info, Node: Environment Variable Index, Next: Output Variable Index, Prev: Old Macro Names, Up: Top
-
-Environment Variable Index
-**************************
-
- This is an alphabetical list of the environment variables that
-Autoconf checks.
-
-* Menu:
-
-* AC_MACRODIR: Invoking autoupdate.
-* AC_MACRODIR: Invoking autoscan.
-* AC_MACRODIR: Invoking autoreconf.
-* AC_MACRODIR: Invoking ifnames.
-* AC_MACRODIR: Invoking autoheader.
-* AC_MACRODIR: Invoking autoconf.
-* CONFIG_FILES: Invoking config.status.
-* CONFIG_HEADERS: Invoking config.status.
-* CONFIG_SHELL: Invoking config.status.
-* CONFIG_SITE: Site Defaults.
-* CONFIG_STATUS: Invoking config.status.
-* SIMPLE_BACKUP_SUFFIX: Invoking autoupdate.
-
-
-File: autoconf.info, Node: Output Variable Index, Next: Preprocessor Symbol Index, Prev: Environment Variable Index, Up: Top
-
-Output Variable Index
-*********************
-
- This is an alphabetical list of the variables that Autoconf can
-substitute into files that it creates, typically one or more
-`Makefile's. *Note Setting Output Variables::, for more information on
-how this is done.
-
-* Menu:
-
-* ALLOCA: Particular Functions.
-* AWK: Particular Programs.
-* build: System Type Variables.
-* build_alias: System Type Variables.
-* build_cpu: System Type Variables.
-* build_os: System Type Variables.
-* build_vendor: System Type Variables.
-* CC: Particular Programs.
-* CC: UNIX Variants.
-* CC: Particular Programs.
-* CFLAGS: Preset Output Variables.
-* CFLAGS: Particular Programs.
-* configure_input: Preset Output Variables.
-* CPP: Particular Programs.
-* CPPFLAGS: Preset Output Variables.
-* CXX: Particular Programs.
-* CXXCPP: Particular Programs.
-* CXXFLAGS: Preset Output Variables.
-* CXXFLAGS: Particular Programs.
-* DEFS: Preset Output Variables.
-* exec_prefix: Preset Output Variables.
-* host: System Type Variables.
-* host_alias: System Type Variables.
-* host_cpu: System Type Variables.
-* host_os: System Type Variables.
-* host_vendor: System Type Variables.
-* INSTALL: Particular Programs.
-* INSTALL_DATA: Particular Programs.
-* INSTALL_PROGRAM: Particular Programs.
-* KMEM_GROUP: Particular Functions.
-* LDFLAGS: Preset Output Variables.
-* LEX: Particular Programs.
-* LEXLIB: Particular Programs.
-* LEX_OUTPUT_ROOT: Particular Programs.
-* LIBOBJS: Particular Functions.
-* LIBOBJS: Particular Functions.
-* LIBOBJS: Generic Functions.
-* LIBOBJS: Structures.
-* LIBS: UNIX Variants.
-* LIBS: UNIX Variants.
-* LIBS: Preset Output Variables.
-* LN_S: Particular Programs.
-* NEED_SETGID: Particular Functions.
-* prefix: Preset Output Variables.
-* program_transform_name: Transforming Names.
-* RANLIB: Particular Programs.
-* SET_MAKE: Output.
-* srcdir: Preset Output Variables.
-* subdirs: Subdirectories.
-* target: System Type Variables.
-* target_alias: System Type Variables.
-* target_cpu: System Type Variables.
-* target_os: System Type Variables.
-* target_vendor: System Type Variables.
-* top_srcdir: Preset Output Variables.
-* X_CFLAGS: System Services.
-* X_EXTRA_LIBS: System Services.
-* X_LIBS: System Services.
-* X_PRE_LIBS: System Services.
-* YACC: Particular Programs.
-
-
-File: autoconf.info, Node: Preprocessor Symbol Index, Next: Macro Index, Prev: Output Variable Index, Up: Top
-
-Preprocessor Symbol Index
-*************************
-
- This is an alphabetical list of the C preprocessor symbols that the
-Autoconf macros define. To work with Autoconf, C source code needs to
-use these names in `#if' directives.
-
-* Menu:
-
-* CLOSEDIR_VOID: Particular Functions.
-* const: Compiler Characteristics.
-* C_ALLOCA: Particular Functions.
-* DGUX: Particular Functions.
-* DIRENT: Particular Headers.
-* GETGROUPS_T: Particular Typedefs.
-* GETLODAVG_PRIVILEGED: Particular Functions.
-* gid_t: Particular Typedefs.
-* HAVE_FUNCTION: Generic Functions.
-* HAVE_HEADER: Generic Headers.
-* HAVE_ALLOCA_H: Particular Functions.
-* HAVE_CONFIG_H: Configuration Headers.
-* HAVE_DIRENT_H: Particular Headers.
-* HAVE_DOPRNT: Particular Functions.
-* HAVE_GETMNTENT: Particular Functions.
-* HAVE_LONG_DOUBLE: Compiler Characteristics.
-* HAVE_LONG_FILE_NAMES: System Services.
-* HAVE_MMAP: Particular Functions.
-* HAVE_NDIR_H: Particular Headers.
-* HAVE_RESTARTABLE_SYSCALLS: System Services.
-* HAVE_STRCOLL: Particular Functions.
-* HAVE_STRFTIME: Particular Functions.
-* HAVE_ST_BLKSIZE: Structures.
-* HAVE_ST_BLOCKS: Structures.
-* HAVE_ST_RDEV: Structures.
-* HAVE_SYS_DIR_H: Particular Headers.
-* HAVE_SYS_NDIR_H: Particular Headers.
-* HAVE_SYS_WAIT_H: Particular Headers.
-* HAVE_TM_ZONE: Structures.
-* HAVE_TZNAME: Structures.
-* HAVE_UNISTD_H: Particular Headers.
-* HAVE_UTIME_NULL: Particular Functions.
-* HAVE_VFORK_H: Particular Functions.
-* HAVE_VPRINTF: Particular Functions.
-* HAVE_WAIT3: Particular Functions.
-* inline: Compiler Characteristics.
-* INT_16_BITS: Compiler Characteristics.
-* LONG_64_BITS: Compiler Characteristics.
-* MAJOR_IN_MKDEV: Particular Headers.
-* MAJOR_IN_SYSMACROS: Particular Headers.
-* mode_t: Particular Typedefs.
-* NDIR: Particular Headers.
-* NEED_MEMORY_H: Particular Headers.
-* NEED_SETGID: Particular Functions.
-* NLIST_NAME_UNION: Particular Functions.
-* NLIST_STRUCT: Particular Functions.
-* NO_MINUS_C_MINUS_O: Particular Programs.
-* off_t: Particular Typedefs.
-* pid_t: Particular Typedefs.
-* RETSIGTYPE: Particular Typedefs.
-* SETVBUF_REVERSED: Particular Functions.
-* size_t: Particular Typedefs.
-* STDC_HEADERS: Particular Headers.
-* SVR4: Particular Functions.
-* SYSDIR: Particular Headers.
-* SYSNDIR: Particular Headers.
-* SYS_SIGLIST_DECLARED: Particular Headers.
-* TIME_WITH_SYS_TIME: Structures.
-* TM_IN_SYS_TIME: Structures.
-* uid_t: Particular Typedefs.
-* UMAX: Particular Functions.
-* UMAX4_3: Particular Functions.
-* USG: Particular Headers.
-* vfork: Particular Functions.
-* VOID_CLOSEDIR: Particular Headers.
-* WORDS_BIGENDIAN: Compiler Characteristics.
-* YYTEXT_POINTER: Particular Programs.
-* _ALL_SOURCE: UNIX Variants.
-* _MINIX: UNIX Variants.
-* _POSIX_1_SOURCE: UNIX Variants.
-* _POSIX_SOURCE: UNIX Variants.
-* _POSIX_SOURCE: UNIX Variants.
-* _POSIX_VERSION: Particular Headers.
-* __CHAR_UNSIGNED__: Compiler Characteristics.
-
-
-File: autoconf.info, Node: Macro Index, Prev: Preprocessor Symbol Index, Up: Top
-
-Macro Index
-***********
-
- This is an alphabetical list of the Autoconf macros. To make the
-list easier to use, the macros are listed without their preceding `AC_'.
-
-* Menu:
-
-* AIX: UNIX Variants.
-* ALLOCA: Old Macro Names.
-* ARG_ARRAY: Old Macro Names.
-* ARG_ENABLE: Package Options.
-* ARG_PROGRAM: Transforming Names.
-* ARG_WITH: External Software.
-* BEFORE: Suggested Ordering.
-* CACHE_VAL: Caching Results.
-* CANONICAL_HOST: Canonicalizing.
-* CANONICAL_SYSTEM: Canonicalizing.
-* CHAR_UNSIGNED: Old Macro Names.
-* CHECKING: Printing Messages.
-* CHECK_FUNC: Generic Functions.
-* CHECK_FUNCS: Generic Functions.
-* CHECK_HEADER: Generic Headers.
-* CHECK_HEADERS: Generic Headers.
-* CHECK_LIB: Libraries.
-* CHECK_PROG: Generic Programs.
-* CHECK_PROGS: Generic Programs.
-* CHECK_SIZEOF: Compiler Characteristics.
-* CHECK_TYPE: Generic Typedefs.
-* COMPILE_CHECK: Examining Libraries.
-* CONFIG_AUX_DIR: Input.
-* CONFIG_HEADER: Configuration Headers.
-* CONFIG_SUBDIRS: Subdirectories.
-* CONST: Old Macro Names.
-* CROSS_CHECK: Old Macro Names.
-* C_BIGENDIAN: Compiler Characteristics.
-* C_CHAR_UNSIGNED: Compiler Characteristics.
-* C_CONST: Compiler Characteristics.
-* C_CROSS: Test Programs.
-* C_INLINE: Compiler Characteristics.
-* C_LONG_DOUBLE: Compiler Characteristics.
-* DECL_SYS_SIGLIST: Particular Headers.
-* DECL_YYTEXT: Particular Programs.
-* DEFINE: Defining Symbols.
-* DEFINE_UNQUOTED: Defining Symbols.
-* DEFUN: Macro Definitions.
-* DIR_HEADER: Particular Headers.
-* DYNIX_SEQ: UNIX Variants.
-* EGREP_CPP: Examining Declarations.
-* EGREP_HEADER: Examining Declarations.
-* ENABLE: Package Options.
-* ERROR: Old Macro Names.
-* FIND_X: Old Macro Names.
-* FIND_XTRA: Old Macro Names.
-* FUNC_ALLOCA: Particular Functions.
-* FUNC_CHECK: Old Macro Names.
-* FUNC_CLOSEDIR_VOID: Particular Functions.
-* FUNC_GETLOADAVG: Particular Functions.
-* FUNC_GETMNTENT: Particular Functions.
-* FUNC_MEMCMP: Particular Functions.
-* FUNC_MMAP: Particular Functions.
-* FUNC_SETVBUF_REVERSED: Particular Functions.
-* FUNC_STRCOLL: Particular Functions.
-* FUNC_STRFTIME: Particular Functions.
-* FUNC_UTIME_NULL: Particular Functions.
-* FUNC_VFORK: Particular Functions.
-* FUNC_VPRINTF: Particular Functions.
-* FUNC_WAIT3: Particular Functions.
-* GCC_TRADITIONAL: Old Macro Names.
-* GETGROUPS_T: Old Macro Names.
-* GETLOADAVG: Old Macro Names.
-* HAVE_FUNCS: Old Macro Names.
-* HAVE_HEADERS: Old Macro Names.
-* HAVE_LIBRARY: Libraries.
-* HAVE_POUNDBANG: Old Macro Names.
-* HEADER_CHECK: Old Macro Names.
-* HEADER_DIRENT: Particular Headers.
-* HEADER_EGREP: Old Macro Names.
-* HEADER_MAJOR: Particular Headers.
-* HEADER_STAT: Structures.
-* HEADER_STDC: Particular Headers.
-* HEADER_SYS_WAIT: Particular Headers.
-* HEADER_TIME: Structures.
-* INIT: Input.
-* INLINE: Old Macro Names.
-* INT_16_BITS: Compiler Characteristics.
-* IRIX_SUN: UNIX Variants.
-* ISC_POSIX: UNIX Variants.
-* LANG_C: Language Choice.
-* LANG_CPLUSPLUS: Language Choice.
-* LANG_RESTORE: Language Choice.
-* LANG_SAVE: Language Choice.
-* LINK_FILES: Using System Type.
-* LN_S: Old Macro Names.
-* LONG_64_BITS: Compiler Characteristics.
-* LONG_DOUBLE: Old Macro Names.
-* LONG_FILE_NAMES: Old Macro Names.
-* MAJOR_HEADER: Old Macro Names.
-* MEMORY_H: Particular Headers.
-* MINIX: UNIX Variants.
-* MINUS_C_MINUS_O: Old Macro Names.
-* MMAP: Old Macro Names.
-* MODE_T: Old Macro Names.
-* MSG_CHECKING: Printing Messages.
-* MSG_ERROR: Printing Messages.
-* MSG_RESULT: Printing Messages.
-* MSG_WARN: Printing Messages.
-* OBSOLETE: Obsolete Macros.
-* OFF_T: Old Macro Names.
-* OUTPUT: Output.
-* PATH_PROG: Generic Programs.
-* PATH_PROGS: Generic Programs.
-* PATH_X: System Services.
-* PATH_XTRA: System Services.
-* PID_T: Old Macro Names.
-* PREFIX: Old Macro Names.
-* PREFIX_PROGRAM: Default Prefix.
-* PREREQ: Versions.
-* PROGRAMS_CHECK: Old Macro Names.
-* PROGRAMS_PATH: Old Macro Names.
-* PROGRAM_CHECK: Old Macro Names.
-* PROGRAM_EGREP: Old Macro Names.
-* PROGRAM_PATH: Old Macro Names.
-* PROG_AWK: Particular Programs.
-* PROG_CC: Particular Programs.
-* PROG_CC_C_O: Particular Programs.
-* PROG_CPP: Particular Programs.
-* PROG_CXX: Particular Programs.
-* PROG_CXXCPP: Particular Programs.
-* PROG_GCC_TRADITIONAL: Particular Programs.
-* PROG_INSTALL: Particular Programs.
-* PROG_LEX: Particular Programs.
-* PROG_LN_S: Particular Programs.
-* PROG_MAKE_SET: Output.
-* PROG_RANLIB: Particular Programs.
-* PROG_YACC: Particular Programs.
-* PROVIDE: Prerequisite Macros.
-* REMOTE_TAPE: Old Macro Names.
-* REPLACE_FUNCS: Generic Functions.
-* REQUIRE: Prerequisite Macros.
-* REQUIRE_CPP: Language Choice.
-* RESTARTABLE_SYSCALLS: Old Macro Names.
-* RETSIGTYPE: Old Macro Names.
-* REVISION: Versions.
-* RSH: Old Macro Names.
-* SCO_INTL: UNIX Variants.
-* SETVBUF_REVERSED: Old Macro Names.
-* SET_MAKE: Old Macro Names.
-* SIZEOF_TYPE: Old Macro Names.
-* SIZE_T: Old Macro Names.
-* STAT_MACROS_BROKEN: Structures.
-* STAT_MACROS_BROKEN: Old Macro Names.
-* STDC_HEADERS: Old Macro Names.
-* STRCOLL: Old Macro Names.
-* STRUCT_ST_BLKSIZE: Structures.
-* STRUCT_ST_BLOCKS: Structures.
-* STRUCT_ST_RDEV: Structures.
-* STRUCT_TIMEZONE: Structures.
-* STRUCT_TM: Structures.
-* ST_BLKSIZE: Old Macro Names.
-* ST_BLOCKS: Old Macro Names.
-* ST_RDEV: Old Macro Names.
-* SUBST: Setting Output Variables.
-* SUBST_FILE: Setting Output Variables.
-* SYS_INTERPRETER: System Services.
-* SYS_LONG_FILE_NAMES: System Services.
-* SYS_RESTARTABLE_SYSCALLS: System Services.
-* SYS_SIGLIST_DECLARED: Old Macro Names.
-* TEST_CPP: Old Macro Names.
-* TEST_PROGRAM: Old Macro Names.
-* TIMEZONE: Old Macro Names.
-* TIME_WITH_SYS_TIME: Old Macro Names.
-* TRY_COMPILE: Examining Syntax.
-* TRY_CPP: Examining Declarations.
-* TRY_LINK: Examining Libraries.
-* TRY_RUN: Test Programs.
-* TYPE_GETGROUPS: Particular Typedefs.
-* TYPE_MODE_T: Particular Typedefs.
-* TYPE_OFF_T: Particular Typedefs.
-* TYPE_PID_T: Particular Typedefs.
-* TYPE_SIGNAL: Particular Typedefs.
-* TYPE_SIZE_T: Particular Typedefs.
-* TYPE_UID_T: Particular Typedefs.
-* UID_T: Old Macro Names.
-* UNISTD_H: Particular Headers.
-* USG: Particular Headers.
-* UTIME_NULL: Old Macro Names.
-* VERBOSE: Printing Messages.
-* VFORK: Old Macro Names.
-* VPRINTF: Old Macro Names.
-* WAIT3: Old Macro Names.
-* WARN: Old Macro Names.
-* WITH: External Software.
-* WORDS_BIGENDIAN: Old Macro Names.
-* XENIX_DIR: UNIX Variants.
-* YYTEXT_POINTER: Old Macro Names.
-
-
diff --git a/util/autoconf/autoconf.m4 b/util/autoconf/autoconf.m4
deleted file mode 100644
index 2b17435..0000000
--- a/util/autoconf/autoconf.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-dnl Driver that loads the Autoconf macro files.
-dnl Requires GNU m4.
-dnl This file is part of Autoconf.
-dnl Copyright (C) 1994 Free Software Foundation, Inc.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2, or (at your option)
-dnl any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-dnl
-dnl Written by David MacKenzie.
-dnl
-include(acgeneral.m4)dnl
-builtin(include, acspecific.m4)dnl
-builtin(include, acoldnames.m4)dnl
-dnl Do not sinclude acsite.m4 here, because it may not be installed
-dnl yet when Autoconf is frozen.
-dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
diff --git a/util/autoconf/autoconf.sh b/util/autoconf/autoconf.sh
deleted file mode 100755
index 5ae95c7..0000000
--- a/util/autoconf/autoconf.sh
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/bin/sh
-# autoconf -- create `configure' using m4 macros
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# If given no args, create `configure' from template file `configure.in'.
-# With one arg, create a configure script on standard output from
-# the given template file.
-
-usage="\
-Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--version] [template-file]"
-
-# NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-
-test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
-test -z "${M4}" && M4=@M4@
-case "${M4}" in
-/*) # Handle the case that m4 has moved since we were configured.
- # It may have been found originally in a build directory.
- test -f "${M4}" || M4=m4 ;;
-esac
-
-tmpout=/tmp/acout.$$
-localdir=
-show_version=no
-
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* )
- echo "${usage}" 1>&2; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m* )
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- AC_MACRODIR="${1}"
- shift ;;
- --version | --v* )
- show_version=yes; shift ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "${usage}" 1>&2; exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-case $# in
- 0) infile=configure.in ;;
- 1) infile="$1" ;;
- *) echo "$usage" >&2; exit 1 ;;
-esac
-
-trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15
-
-tmpin=/tmp/acin.$$ # Always set this, to avoid bogus errors from some rm's.
-if test z$infile = z-; then
- infile=$tmpin
- cat > $infile
-elif test ! -r "$infile"; then
- echo "autoconf: ${infile}: No such file or directory" >&2
- exit 1
-fi
-
-if test -n "$localdir"; then
- use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
-else
- use_localdir=
-fi
-
-# Use the frozen version of Autoconf if available.
-r= f=
-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
-case `$M4 --help < /dev/null 2>&1` in
-*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
-*traditional*) ;;
-*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
-esac
-
-$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
- { rm -f $tmpin $tmpout; exit 2; }
-
-# You could add your own prefixes to pattern if you wanted to check for
-# them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do
-# alternation.
-pattern="AC_"
-
-status=0
-if grep "${pattern}" $tmpout > /dev/null 2>&1; then
- echo "autoconf: Undefined macros:" >&2
- grep "${pattern}" $tmpout | sed "s/.*\(${pattern}[_A-Z0-9]*\).*/\1/" |
- while read name; do
- grep -n $name $infile /dev/null
- done | sort -u >&2
- status=1
-fi
-
-if test $# -eq 0; then
- exec 4> configure; chmod +x configure
-else
- exec 4>&1
-fi
-
-# Put the real line numbers into configure to make config.log more helpful.
-awk '
-/__oline__/ { printf "%d:", NR + 1 }
- { print }
-' $tmpout | sed '
-/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__\(.*\)$/\2\1\3/
-' >&4
-
-rm -f $tmpout
-
-exit $status
diff --git a/util/autoconf/autoconf.texi b/util/autoconf/autoconf.texi
deleted file mode 100644
index 3ec9655..0000000
--- a/util/autoconf/autoconf.texi
+++ /dev/null
@@ -1,5125 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename autoconf.info
-@settitle Autoconf
-@c For double-sided printing, uncomment:
-@c @setchapternewpage odd
-@c %**end of header
-
-@set EDITION 2.1
-@set VERSION 2.1
-@set UPDATED November 1994
-
-@iftex
-@finalout
-@end iftex
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Autoconf: (autoconf). Create source code configuration scripts.
-END-INFO-DIR-ENTRY
-@end format
-
-This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an @code{m4} macro
-package.
-
-Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Foundation.
-@end ifinfo
-
-@titlepage
-@title Autoconf
-@subtitle Creating Automatic Configuration Scripts
-@subtitle Edition @value{EDITION}, for Autoconf version @value{VERSION}
-@subtitle @value{UPDATED}
-@author by David MacKenzie
-@c I think I've rewritten all of Noah and Roland's contributions by now.
-
-@page
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1992, 1993, 1994 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Foundation.
-@end titlepage
-
-@c Define an environment variable index.
-@defcodeindex ev
-@c Define an output variable index.
-@defcodeindex ov
-@c Define a CPP variable index.
-@defcodeindex cv
-@c Define a macro index that @@defmac doesn't write to.
-@defcodeindex ma
-
-@node Top, Introduction, , (dir)
-@comment node-name, next, previous, up
-
-@ifinfo
-This file documents the GNU Autoconf package for creating scripts to
-configure source code packages using templates and an @code{m4} macro
-package. This is edition @value{EDITION}, for Autoconf version @value{VERSION}.
-
-@end ifinfo
-
-@c The master menu, created with texinfo-master-menu, goes here.
-
-@menu
-* Introduction:: Autoconf's purpose, strengths, and weaknesses.
-* Making configure Scripts:: How to organize and produce Autoconf scripts.
-* Setup:: Initialization and output.
-* Existing Tests:: Macros that check for particular features.
-* Writing Tests:: How to write new feature checks.
-* Results:: What to do with results from feature checks.
-* Writing Macros:: Adding new macros to Autoconf.
-* Manual Configuration:: Selecting features that can't be guessed.
-* Site Configuration:: Local defaults for @code{configure}.
-* Invoking configure:: How to use the Autoconf output.
-* Invoking config.status:: Recreating a configuration.
-* Questions:: Questions about Autoconf, with answers.
-* Upgrading:: Tips for upgrading from version 1.
-* History:: History of Autoconf.
-* Old Macro Names:: Backward compatibility macros.
-* Environment Variable Index:: Index of environment variables used.
-* Output Variable Index:: Index of variables set in output files.
-* Preprocessor Symbol Index:: Index of C preprocessor symbols defined.
-* Macro Index:: Index of Autoconf macros.
-
- --- The Detailed Node Listing ---
-
-Making @code{configure} Scripts
-
-* Writing configure.in:: What to put in an Autoconf input file.
-* Invoking autoscan:: Semi-automatic @file{configure.in} writing.
-* Invoking ifnames:: Listing the conditionals in source code.
-* Invoking autoconf:: How to create configuration scripts.
-* Invoking autoreconf:: Remaking multiple @code{configure} scripts.
-
-Initialization and Output Files
-
-* Input:: Where Autoconf should find files.
-* Output:: Creating output files.
-* Makefile Substitutions:: Using output variables in @file{Makefile}s.
-* Configuration Headers:: Creating a configuration header file.
-* Subdirectories:: Configuring independent packages together.
-* Default Prefix:: Changing the default installation prefix.
-* Versions:: Version numbers in @code{configure}.
-
-Substitutions in Makefiles
-
-* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Compiling in a different directory.
-* Automatic Remaking:: Makefile rules for configuring.
-
-Configuration Header Files
-
-* Header Templates:: Input for the configuration headers.
-* Invoking autoheader:: How to create configuration templates.
-
-Existing Tests
-
-* Alternative Programs:: Selecting between alternative programs.
-* Libraries:: Library archives that might be missing.
-* Library Functions:: C library functions that might be missing.
-* Header Files:: Header files that might be missing.
-* Structures:: Structures or members that might be missing.
-* Typedefs:: @code{typedef}s that might be missing.
-* Compiler Characteristics:: C compiler or machine architecture features.
-* System Services:: Operating system services.
-* UNIX Variants:: Special kludges for specific UNIX variants.
-
-Alternative Programs
-
-* Particular Programs:: Special handling to find certain programs.
-* Generic Programs:: How to find other programs.
-
-Library Functions
-
-* Particular Functions:: Special handling to find certain functions.
-* Generic Functions:: How to find other functions.
-
-Header Files
-
-* Particular Headers:: Special handling to find certain headers.
-* Generic Headers:: How to find other headers.
-
-Typedefs
-
-* Particular Typedefs:: Special handling to find certain types.
-* Generic Typedefs:: How to find other types.
-
-Writing Tests
-
-* Examining Declarations:: Detecting header files and declarations.
-* Examining Syntax:: Detecting language syntax features.
-* Examining Libraries:: Detecting functions and global variables.
-* Run Time:: Testing for run-time features.
-* Portable Shell:: Shell script portability pitfalls.
-* Testing Values and Files:: Checking strings and files.
-* Multiple Cases:: Tests for several possible values.
-* Language Choice:: Selecting which language to use for testing.
-
-Checking Run Time Behavior
-
-* Test Programs:: Running test programs.
-* Guidelines:: General rules for writing test programs.
-* Test Functions:: Avoiding pitfalls in test programs.
-
-Results of Tests
-
-* Defining Symbols:: Defining C preprocessor symbols.
-* Setting Output Variables:: Replacing variables in output files.
-* Caching Results:: Speeding up subsequent @code{configure} runs.
-* Printing Messages:: Notifying users of progress or problems.
-
-Caching Results
-
-* Cache Variable Names:: Shell variables used in caches.
-* Cache Files:: Files @code{configure} uses for caching.
-
-Writing Macros
-
-* Macro Definitions:: Basic format of an Autoconf macro.
-* Macro Names:: What to call your new macros.
-* Quoting:: Protecting macros from unwanted expansion.
-* Dependencies Between Macros:: What to do when macros depend on other macros.
-
-Dependencies Between Macros
-
-* Prerequisite Macros:: Ensuring required information.
-* Suggested Ordering:: Warning about possible ordering problems.
-* Obsolete Macros:: Warning about old ways of doing things.
-
-Manual Configuration
-
-* Specifying Names:: Specifying the system type.
-* Canonicalizing:: Getting the canonical system type.
-* System Type Variables:: Variables containing the system type.
-* Using System Type:: What to do with the system type.
-
-Site Configuration
-
-* External Software:: Working with other optional software.
-* Package Options:: Selecting optional features.
-* Site Details:: Configuring site details.
-* Transforming Names:: Changing program names when installing.
-* Site Defaults:: Giving @code{configure} local defaults.
-
-Transforming Program Names When Installing
-
-* Transformation Options:: @code{configure} options to transforme names.
-* Transformation Examples:: Sample uses of transforming names.
-* Transformation Rules:: @file{Makefile} uses of transforming names.
-
-Running @code{configure} Scripts
-
-* Basic Installation:: Instructions for typical cases.
-* Compilers and Options:: Selecting compilers and optimization.
-* Build Directory:: Configuring in a different directory.
-* Installation Names:: Installing in different directories.
-* Optional Features:: Selecting optional features.
-* System Type:: Specifying the system type.
-* Sharing Defaults:: Setting site-wide defaults for @code{configure}.
-* Operation Controls:: Changing how @code{configure} runs.
-
-Questions About Autoconf
-
-* Distributing:: Distributing @code{configure} scripts.
-* Why GNU m4:: Why not use the standard @code{m4}?
-* Bootstrapping:: Autoconf and GNU @code{m4} require each other?
-* Why Not Imake:: Why GNU uses @code{configure} instead of Imake.
-
-Upgrading From Version 1
-
-* Changed File Names:: Files you might rename.
-* Changed Makefiles:: New things to put in @file{Makefile.in}.
-* Changed Macros:: Macro calls you might replace.
-* Invoking autoupdate:: Replacing old macro names in @code{configure.in}.
-* Changed Results:: Changes in how to check test results.
-* Changed Macro Writing:: Better ways to write your own macros.
-
-History of Autoconf
-
-* Genesis:: Prehistory and naming of @code{configure}.
-* Exodus:: The plagues of @code{m4} and Perl.
-* Leviticus:: The priestly code of portability arrives.
-* Numbers:: Growth and contributors.
-* Deuteronomy:: Approaching the promises of easy configuration.
-@end menu
-
-@node Introduction, Making configure Scripts, Top, Top
-@chapter Introduction
-
-@display
-A physicist, an engineer, and a computer scientist were
-discussing the nature of God. Surely a Physicist, said the
-physicist, because early in the Creation, God made Light; and you
-know, Maxwell's equations, the dual nature of electro-magnetic
-waves, the relativist consequences@dots{} An Engineer!, said the
-engineer, because before making Light, God split the Chaos into
-Land and Water; it takes a hell of an engineer to handle that big
-amount of mud, and orderly separation of solids from
-liquids@dots{} The computer scientist shouted: And the Chaos,
-where do you think it was coming from, hmm?
-
----Anonymous
-@end display
-@c (via Franc,ois Pinard)
-
-Autoconf is a tool for producing shell scripts that automatically
-configure software source code packages to adapt to many kinds of
-UNIX-like systems. The configuration scripts produced by Autoconf are
-independent of Autoconf when they are run, so their users do not need to
-have Autoconf.
-
-The configuration scripts produced by Autoconf require no manual user
-intervention when run; they do not normally even need an argument
-specifying the system type. Instead, they test for the presence of each
-feature that the software package they are for might need individually.
-(Before each check, they print a one-line message stating what they are
-checking for, so the user doesn't get too bored while waiting for the
-script to finish.) As a result, they deal well with systems that are
-hybrids or customized from the more common UNIX variants. There is no
-need to maintain files that list the features supported by each release
-of each variant of UNIX.
-
-For each software package that Autoconf is used with, it creates a
-configuration script from a template file that lists the
-system features that the package needs or can use. After the shell code to
-recognize and respond to a system feature has been written,
-Autoconf allows it to be shared by many software packages that can
-use (or need) that feature. If it later turns out that the shell code
-needs adjustment for some reason, it needs to be changed in only one
-place; all of the configuration scripts can be regenerated
-automatically to take advantage of the updated code.
-
-The Metaconfig package is similar in purpose to Autoconf, but
-the scripts it produces require manual user intervention, which is quite
-inconvenient when configuring large source trees. Unlike Metaconfig
-scripts, Autoconf scripts can support cross-compiling, if some care is
-taken in writing them.
-
-There are several jobs related to making portable software packages
-that Autoconf currently does not do. Among these are automatically
-creating @file{Makefile} files with all of the standard targets, and
-supplying replacements for standard library functions and header files on
-systems that lack them. Work is in progress to add those features in
-the future.
-
-Autoconf imposes some restrictions on the names of macros used with
-@code{#ifdef} in C programs (@pxref{Preprocessor Symbol Index}).
-
-Autoconf requires GNU @code{m4} in order to generate the scripts. It
-uses features that some UNIX versions of @code{m4} do not have. It also
-overflows internal limits of some versions of @code{m4}, including GNU
-@code{m4} 1.0. You must use version 1.1 or later of GNU @code{m4}.
-Using version 1.3 or later will be much faster than 1.1 or 1.2.
-
-@xref{Upgrading}, for information about upgrading from version 1.
-@xref{History}, for the story of Autoconf's development.
-@xref{Questions}, for answers to some common questions about Autoconf.
-
-Mail suggestions and bug reports for Autoconf to
-@code{bug-gnu-utils@@prep.ai.mit.edu}. Please include the Autoconf version
-number, which you can get by running @samp{autoconf --version}.
-
-@node Making configure Scripts, Setup, Introduction, Top
-@chapter Making @code{configure} Scripts
-
-The configuration scripts that Autoconf produces are by convention
-called @code{configure}. When run, @code{configure} creates several
-files, replacing configuration parameters in them with appropriate
-values. The files that @code{configure} creates are:
-
-@itemize @bullet
-@item
-one or more @file{Makefile} files, one in each subdirectory of the
-package (@pxref{Makefile Substitutions});
-
-@item
-optionally, a C header file, the name of which is configurable,
-containing @code{#define} directives (@pxref{Configuration Headers});
-
-@item
-a shell script called @file{config.status} that, when run, will recreate
-the files listed above (@pxref{Invoking config.status});
-
-@item
-a shell script called @file{config.cache} that saves the results of
-running many of the tests (@pxref{Cache Files});
-
-@item
-a file called @file{config.log} containing any messages produced by
-compilers, to help debugging if @code{configure} makes a mistake.
-@end itemize
-
-To create a @code{configure} script with Autoconf, you need to write an
-Autoconf input file @file{configure.in} and run @code{autoconf} on it.
-If you write your own feature tests to supplement those that come with
-Autoconf, you might also write files called @file{aclocal.m4} and
-@file{acsite.m4}. If you use a C header file to contain @code{#define}
-directives, you might also write @file{acconfig.h}, and you will
-distribute the Autoconf-generated file @file{config.h.in} with the
-package.
-
-Here is a diagram showing how the files that can be used in
-configuration are produced. Programs that are executed are suffixed by
-@samp{*}. Optional files are enclosed in square brackets (@samp{[]}).
-@code{autoconf} and @code{autoheader} also read the installed Autoconf
-macro files (by reading @file{autoconf.m4}).
-
-@noindent
-Files used in preparing a software package for distribution:
-@example
-@group
-your source files --> [autoscan*] --> [configure.scan] --> configure.in
-
-configure.in --. .------> autoconf* -----> configure
- +---+
-[aclocal.m4] --+ `---.
-[acsite.m4] ---' |
- +--> [autoheader*] -> [config.h.in]
-[acconfig.h] ----. |
- +-----'
-[config.h.top] --+
-[config.h.bot] --'
-
-Makefile.in -------------------------------> Makefile.in
-@end group
-@end example
-
-@noindent
-Files used in configuring a software package:
-@example
-@group
- .-------------> config.cache
-configure* ------------+-------------> config.log
- |
-[config.h.in] -. v .-> [config.h] -.
- +--> config.status* -+ +--> make*
-Makefile.in ---' `-> Makefile ---'
-@end group
-@end example
-
-@menu
-* Writing configure.in:: What to put in an Autoconf input file.
-* Invoking autoscan:: Semi-automatic @file{configure.in} writing.
-* Invoking ifnames:: Listing the conditionals in source code.
-* Invoking autoconf:: How to create configuration scripts.
-* Invoking autoreconf:: Remaking multiple @code{configure} scripts.
-@end menu
-
-@node Writing configure.in, Invoking autoscan, , Making configure Scripts
-@section Writing @file{configure.in}
-
-To produce a @code{configure} script for a software package, create a
-file called @file{configure.in} that contains invocations of the
-Autoconf macros that test the system features your package needs or can
-use. Autoconf macros already exist to check for many features; see
-@ref{Existing Tests}, for their descriptions. For most other
-features, you can use Autoconf template macros to produce custom checks;
-see @ref{Writing Tests}, for information about them. For especially
-tricky or specialized features, @file{configure.in} might need to
-contain some hand-crafted shell commands. The @code{autoscan}
-program can give you a good start in writing @file{configure.in}
-(@pxref{Invoking autoscan}, for more information).
-
-The order in which @file{configure.in} calls the Autoconf macros
-is not important, with a few exceptions. Every
-@file{configure.in} must contain a call to @code{AC_INIT} before
-the checks, and a call to @code{AC_OUTPUT} at the end
-(@pxref{Output}). Additionally, some macros rely on other macros
-having been called first, because they check previously set
-values of some variables to decide what to do. These macros are
-noted in the individual descriptions (@pxref{Existing Tests}),
-and they also warn you when creating @code{configure} if they are
-called out of order.
-
-To encourage consistency, here is a suggested order for calling the
-Autoconf macros. Generally speaking, the things near the end of this
-list could depend on things earlier in it. For example, library
-functions could be affected by typedefs and libraries.
-
-@display
-@group
-@code{AC_INIT(@var{file})}
-checks for programs
-checks for libraries
-checks for header files
-checks for typedefs
-checks for structures
-checks for compiler characteristics
-checks for library functions
-checks for system services
-@code{AC_OUTPUT(@r{[}@var{file@dots{}}@r{]})}
-@end group
-@end display
-
-It is best to put each macro call on its own line in
-@file{configure.in}. Most of the macros don't add extra newlines; they
-rely on the newline after the macro call to terminate the commands.
-This approach makes the generated @code{configure} script a little
-easier to read by not inserting lots of blank lines. It is generally
-safe to set shell variables on the same line as a macro call, because
-the shell allows assignments without intervening newlines.
-
-When calling macros that take arguments, there must not be any blank
-space between the macro name and the open parenthesis. Arguments can be
-more than one line long if they are enclosed within the @code{m4} quote
-characters @samp{[} and @samp{]}. If you have a long line such as a
-list of file names, you can generally use a backslash at the end of a
-line to continue it logically on the next line (this is implemented by
-the shell, not by anything special that Autoconf does).
-
-Some macros handle two cases: what to do if the given condition is met,
-and what to do if the condition is not met. In some places you might
-want to do something if a condition is true but do nothing if it's
-false, or vice versa. To omit the true case, pass an empty value for
-the @var{action-if-found} argument to the macro. To omit the false
-case, omit the @var{action-if-not-found} argument to the macro,
-including the comma before it.
-
-You can include comments in @file{configure.in} files by starting them
-with the @code{m4} builtin macro @code{dnl}, which discards text up
-through the next newline. These comments do not appear in the generated
-@code{configure} scripts. For example, it is helpful to begin
-@file{configure.in} files with a line like this:
-
-@example
-dnl Process this file with autoconf to produce a configure script.
-@end example
-
-@node Invoking autoscan, Invoking ifnames, Writing configure.in, Making configure Scripts
-@section Using @code{autoscan} to Create @file{configure.in}
-
-The @code{autoscan} program can help you create a @file{configure.in}
-file for a software package. @code{autoscan} examines source files in
-the directory tree rooted at a directory given as a command line
-argument, or the current directory if none is given. It searches the
-source files for common portability problems and creates a file
-@file{configure.scan} which is a preliminary @file{configure.in} for
-that package.
-
-You should manually examine @file{configure.scan} before renaming it to
-@file{configure.in}; it will probably need some adjustments.
-Occasionally @code{autoscan} outputs a macro in the wrong order relative
-to another macro, so that @code{autoconf} produces a warning; you need
-to move such macros manually. Also, if you want the package to use a
-configuration header file, you must add a call to
-@code{AC_CONFIG_HEADER} (@pxref{Configuration Headers}). You might also
-have to change or add some @code{#if} directives to your program in
-order to make it work with Autoconf (@pxref{Invoking ifnames}, for
-information about a program that can help with that job).
-
-@code{autoscan} uses several data files, which are installed along with the
-distributed Autoconf macro files, to determine which macros to output
-when it finds particular symbols in a package's source files. These
-files all have the same format. Each line consists of a symbol,
-whitespace, and the Autoconf macro to output if that symbol is
-encountered. Lines starting with @samp{#} are comments.
-
-@code{autoscan} is only installed if you already have Perl installed.
-@code{autoscan} accepts the following options:
-
-@table @code
-@item --help
-Print a summary of the command line options and exit.
-
-@item --macrodir=@var{dir}
-@evindex AC_MACRODIR
-Look for the data files in directory @var{dir} instead of the default
-installation directory. You can also set the @code{AC_MACRODIR}
-environment variable to a directory; this option overrides the
-environment variable.
-
-@item --verbose
-Print the names of the files it examines and the potentially interesting
-symbols it finds in them. This output can be voluminous.
-
-@item --version
-Print the version number of Autoconf and exit.
-@end table
-
-@node Invoking ifnames, Invoking autoconf, Invoking autoscan, Making configure Scripts
-@section Using @code{ifnames} to List Conditionals
-
-@code{ifnames} can help when writing a @file{configure.in} for a
-software package. It prints the identifiers that the package already
-uses in C preprocessor conditionals. If a package has already been set
-up to have some portability, this program can help you figure out what
-its @code{configure} needs to check for. It may help fill in some gaps
-in a @file{configure.in} generated by @code{autoscan} (@pxref{Invoking
-autoscan}).
-
-@code{ifnames} scans all of the C source files named on the command line
-(or the standard input, if none are given) and writes to the standard
-output a sorted list of all the identifiers that appear in those files
-in @code{#if}, @code{#elif}, @code{#ifdef}, or @code{#ifndef}
-directives. It prints each identifier on a line, followed by a
-space-separated list of the files in which that identifier occurs.
-
-@noindent
-@code{ifnames} accepts the following options:
-
-@table @code
-@item --help
-@itemx -h
-Print a summary of the command line options and exit.
-
-@item --macrodir=@var{dir}
-@itemx -m @var{dir}
-@evindex AC_MACRODIR
-Look for the Autoconf macro files in directory @var{dir} instead of the
-default installation directory. Only used to get the version number.
-You can also set the @code{AC_MACRODIR}
-environment variable to a directory; this option overrides the
-environment variable.
-
-@item --version
-Print the version number of Autoconf and exit.
-@end table
-
-@node Invoking autoconf, Invoking autoreconf, Invoking ifnames, Making configure Scripts
-@section Using @code{autoconf} to Create @code{configure}
-
-To create @code{configure} from @file{configure.in}, run the
-@code{autoconf} program with no arguments. @code{autoconf} processes
-@file{configure.in} with the @code{m4} macro processor, using the
-Autoconf macros. If you give @code{autoconf} an argument, it reads that
-file instead of @file{configure.in} and writes the configuration script
-to the standard output instead of to @code{configure}. If you give
-@code{autoconf} the argument @samp{-}, it reads the standard input
-instead of @file{configure.in} and writes the configuration script on
-the standard output.
-
-The Autoconf macros are defined in several files. Some of the files are
-distributed with Autoconf; @code{autoconf} reads them first. Then it
-looks for the optional file @file{acsite.m4} in the directory that
-contains the distributed Autoconf macro files, and for the optional file
-@file{aclocal.m4} in the current directory. Those files can contain
-your site's or the package's own Autoconf macro definitions
-(@pxref{Writing Macros}, for more information). If a macro is defined
-in more than one of the files that @code{autoconf} reads, the last
-definition it reads overrides the earlier ones.
-
-@code{autoconf} accepts the following options:
-
-@table @code
-@item --help
-@itemx -h
-Print a summary of the command line options and exit.
-
-@item --localdir=@var{dir}
-@itemx -l @var{dir}
-Look for the package file @file{aclocal.m4} in directory @var{dir}
-instead of in the current directory.
-
-@item --macrodir=@var{dir}
-@itemx -m @var{dir}
-@evindex AC_MACRODIR
-Look for the installed macro files in directory @var{dir}. You can also
-set the @code{AC_MACRODIR} environment variable to a directory; this
-option overrides the environment variable.
-
-@item --version
-Print the version number of Autoconf and exit.
-@end table
-
-@node Invoking autoreconf, , Invoking autoconf, Making configure Scripts
-@section Using @code{autoreconf} to Update @code{configure} Scripts
-
-If you have a lot of Autoconf-generated @code{configure} scripts, the
-@code{autoreconf} program can save you some work. It runs
-@code{autoconf} (and @code{autoheader}, where appropriate) repeatedly to
-remake the Autoconf @code{configure} scripts and configuration header
-templates in the directory tree rooted at the current directory. By
-default, it only remakes those files that are older than their
-@file{configure.in} or (if present) @file{aclocal.m4}. Since
-@code{autoheader} does not change the timestamp of its output file if
-the file wouldn't be changing, this is not necessarily the minimum
-amount of work. If you install a new version of Autoconf, you can make
-@code{autoreconf} remake @emph{all} of the files by giving it the
-@samp{--force} option.
-
-If you give @code{autoreconf} the @samp{--macrodir=@var{dir}} or
-@samp{--localdir=@var{dir}} options, it passes them down to
-@code{autoconf} and @code{autoheader} (with relative paths adjusted
-properly).
-
-@xref{Automatic Remaking}, for @file{Makefile} rules to automatically
-remake @code{configure} scripts when their source files change. That
-method handles the timestamps of configuration header templates
-properly, but does not pass @samp{--macrodir=@var{dir}} or
-@samp{--localdir=@var{dir}}.
-
-@noindent
-@code{autoreconf} accepts the following options:
-
-@table @code
-@item --help
-@itemx -h
-Print a summary of the command line options and exit.
-
-@item --force
-@itemx -f
-Remake even @file{configure} scripts and configuration headers that are
-newer than their input files (@file{configure.in} and, if present,
-@file{aclocal.m4}).
-
-@item --localdir=@var{dir}
-@itemx -l @var{dir}
-Look for the package files @file{aclocal.m4} and @file{acconfig.h} (but
-not @file{@var{file}.top} and @file{@var{file}.bot}) in directory
-@var{dir} instead of in the directory containing each @file{configure.in}.
-
-@item --macrodir=@var{dir}
-@itemx -m @var{dir}
-@evindex AC_MACRODIR
-Look for the Autoconf macro files in directory @var{dir} instead of the
-default installation directory.
-You can also set the @code{AC_MACRODIR}
-environment variable to a directory; this option overrides the
-environment variable.
-
-@item --verbose
-Print the name of each directory where @code{autoreconf} runs
-@code{autoconf} (and @code{autoheader}, if appropriate).
-
-@item --version
-Print the version number of Autoconf and exit.
-@end table
-
-@node Setup, Existing Tests, Making configure Scripts, Top
-@chapter Initialization and Output Files
-
-Autoconf-generated @code{configure} scripts need some information about
-how to initialize, such as how to find the package's source files; and
-about the output files to produce. The following sections describe
-initialization and creating output files.
-
-@menu
-* Input:: Where Autoconf should find files.
-* Output:: Creating output files.
-* Makefile Substitutions:: Using output variables in @file{Makefile}s.
-* Configuration Headers:: Creating a configuration header file.
-* Subdirectories:: Configuring independent packages together.
-* Default Prefix:: Changing the default installation prefix.
-* Versions:: Version numbers in @code{configure}.
-@end menu
-
-@node Input, Output, , Setup
-@section Finding @code{configure} Input
-
-Every @code{configure} script must call @code{AC_INIT} before doing
-anything else. The only other required macro is @code{AC_OUTPUT}
-(@pxref{Output}).
-
-@defmac AC_INIT (@var{unique-file-in-source-dir})
-@maindex INIT
-Process any command-line arguments and find the source code directory.
-@var{unique-file-in-source-dir} is some file that is in the package's
-source directory; @code{configure} checks for this file's existence to
-make sure that the directory that it is told contains the source code in
-fact does (@pxref{Invoking configure}, for more information).
-@end defmac
-
-Packages that do manual configuration or use the @code{install} program
-might need to tell @code{configure} where to find some other shell
-scripts by calling @code{AC_CONFIG_AUX_DIR}, though the default places
-it looks are correct for most cases.
-
-@defmac AC_CONFIG_AUX_DIR(@var{dir})
-@maindex CONFIG_AUX_DIR
-Use the @file{install-sh}, @file{config.sub}, @file{config.guess}, and
-Cygnus @code{configure} scripts that are in directory @var{dir}. These
-are auxiliary files used in configuration. @var{dir} can be either
-absolute or relative to @file{@var{srcdir}}. The default is
-@file{@var{srcdir}} or @file{@var{srcdir}/..} or
-@file{@var{srcdir}/../..}, whichever is the first that contains
-@file{install-sh}. The other files are not checked for, so that using
-@code{AC_PROG_INSTALL} does not automatically require distributing the
-other auxiliary files. It checks for @file{install.sh} also, but that
-name is obsolete because some @code{make} programs have a rule that
-creates @file{install} from it if there is no @file{Makefile}.
-@end defmac
-
-@node Output, Makefile Substitutions, Input, Setup
-@section Creating Output Files
-
-Every Autoconf-generated @code{configure} script must finish by calling
-@code{AC_OUTPUT}. It is the macro that creates the @file{Makefile}s and
-optional other files resulting from configuration. The only other
-required macro is @code{AC_INIT} (@pxref{Input}).
-
-@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{] [,}@var{init-cmds}@r{]})
-@maindex OUTPUT
-Create output files. The @var{file}@dots{} argument is a
-whitespace-separated list of output files; it may be empty. This macro
-creates each file @file{@var{file}} by copying an input file (by default
-named @file{@var{file}.in}), substituting the output variable values.
-@xref{Makefile Substitutions}, for more information on using output variables.
-@xref{Setting Output Variables}, for more information on creating them. This
-macro creates the directory that the file is in if it doesn't exist (but
-not the parents of that directory). Usually, @file{Makefile}s are
-created this way, but other files, such as @file{.gdbinit}, can be
-specified as well.
-
-If @code{AC_CONFIG_HEADER}, @code{AC_LINK_FILES}, or
-@code{AC_CONFIG_SUBDIRS} has been called, this macro also creates the
-files named as their arguments.
-
-A typical call to @code{AC_OUTPUT} looks like this:
-@example
-AC_OUTPUT(Makefile src/Makefile man/Makefile X/Imakefile)
-@end example
-
-You can override an input file name by appending it to @var{file},
-separated by a colon. For example,
-@example
-AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk)
-@end example
-
-If you pass @var{extra-cmds}, those commands will be inserted into
-@file{config.status} to be run after all its other processing. If
-@var{init-cmds} are given, they are inserted just before
-@var{extra-cmds}, with shell variable, command, and backslash
-substitutions performed on them in @code{configure}. You can use
-@var{init-cmds} to pass variables from @code{configure} to the
-@var{extra-cmds}.
-@end defmac
-
-If you run @code{make} on subdirectories, you should run it using the
-@code{make} variable @code{MAKE}. Most versions of @code{make} set
-@code{MAKE} to the name of the @code{make} program plus any options it
-was given. (But many do not include in it the values of any variables
-set on the command line, so those are not passed on automatically.)
-Some old versions of @code{make} do not set this variable. The
-following macro allows you to use it even with those versions.
-
-@defmac AC_PROG_MAKE_SET
-@maindex PROG_MAKE_SET
-@ovindex SET_MAKE
-If @code{make} predefines the variable @code{MAKE}, define output
-variable @code{SET_MAKE} to be empty. Otherwise, define @code{SET_MAKE}
-to contain @samp{MAKE=make}. Calls @code{AC_SUBST} for @code{SET_MAKE}.
-@end defmac
-
-To use this macro, place a line like this in each @file{Makefile.in}
-that runs @code{MAKE} on other directories:
-
-@example
-@@SET_MAKE@@
-@end example
-
-@node Makefile Substitutions, Configuration Headers, Output, Setup
-@section Substitutions in Makefiles
-
-Each subdirectory in a distribution that contains something to be
-compiled or installed should come with a file @file{Makefile.in}, from
-which @code{configure} will create a @file{Makefile} in that directory.
-To create a @file{Makefile}, @code{configure} performs a simple variable
-substitution, replacing occurrences of @samp{@@@var{variable}@@} in
-@file{Makefile.in} with the value that @code{configure} has determined
-for that variable. Variables that are substituted into output files in
-this way are called @dfn{output variables}. They are ordinary shell
-variables that are set in @code{configure}. To make @code{configure}
-substitute a particular variable into the output files, the macro
-@code{AC_SUBST} must be called with that variable name as an argument.
-Any occurrences of @samp{@@@var{variable}@@} for other variables are
-left unchanged. @xref{Setting Output Variables}, for more information on
-creating output variables with @code{AC_SUBST}.
-
-A software package that uses a @code{configure} script should be
-distributed with a file @file{Makefile.in}, but no @file{Makefile}; that
-way, the user has to properly configure the package for the local system
-before compiling it.
-
-@xref{Makefile Conventions, , Makefile Conventions, standards.info, The
-GNU Coding Standards}, for more information on what to put in
-@file{Makefile}s.
-
-@menu
-* Preset Output Variables:: Output variables that are always set.
-* Build Directories:: Compiling in a different directory.
-* Automatic Remaking:: Makefile rules for configuring.
-@end menu
-
-@node Preset Output Variables, Build Directories, , Makefile Substitutions
-@subsection Preset Output Variables
-
-Some output variables are preset by the Autoconf macros. Some of the
-Autoconf macros set additional output variables, which are mentioned in
-the descriptions for those macros. @xref{Output Variable Index}, for a
-complete list of output variables. Here is what each of the preset ones
-contains.
-
-@defvar configure_input
-@ovindex configure_input
-A comment saying that the file was generated automatically by
-@code{configure} and giving the name of the input file.
-@code{AC_OUTPUT} adds a comment line containing this variable to the top
-of every @file{Makefile} it creates. For other files, you should
-reference this variable in a comment at the top of each input file. For
-example, an input shell script should begin like this:
-
-@example
-#!/bin/sh
-# @@configure_input@@
-@end example
-
-@noindent
-The presence of that line also reminds people editing the file that it
-needs to be processed by @code{configure} in order to be used.
-@end defvar
-
-@defvar exec_prefix
-@ovindex exec_prefix
-The installation prefix for architecture-dependent files.
-@end defvar
-
-@defvar prefix
-@ovindex prefix
-The installation prefix for architecture-independent files.
-@end defvar
-
-@defvar srcdir
-@ovindex srcdir
-The directory that contains the source code for that @file{Makefile}.
-@end defvar
-
-@defvar top_srcdir
-@ovindex top_srcdir
-The top-level source code directory for the package. In the top-level
-directory, this is the same as @code{srcdir}.
-@end defvar
-
-@defvar CFLAGS
-@ovindex CFLAGS
-Debugging and optimization options for the C compiler. If it is not set
-in the environment when @code{configure} runs, the default value is set
-when you call @code{AC_PROG_CC} (or empty if you don't). @code{configure}
-uses this variable when compiling programs to test for C features.
-@end defvar
-
-@defvar CPPFLAGS
-@ovindex CPPFLAGS
-Header file search directory (@samp{-I@var{dir}}) and any other
-miscellaneous options for the C preprocessor and compiler. If it is not
-set in the environment when @code{configure} runs, the default value is
-empty. @code{configure} uses this variable when compiling or
-preprocessing programs to test for C features.
-@end defvar
-
-@defvar CXXFLAGS
-@ovindex CXXFLAGS
-Debugging and optimization options for the C++ compiler. If it is not
-set in the environment when @code{configure} runs, the default value is
-set when you call @code{AC_PROG_CXX} (or empty if you don't).
-@code{configure} uses this variable when compiling programs to test for
-C++ features.
-@end defvar
-
-@defvar DEFS
-@ovindex DEFS
-@samp{-D} options to pass to the C compiler. If @code{AC_CONFIG_HEADER}
-is called, @code{configure} replaces @samp{@@DEFS@@} with
-@samp{-DHAVE_CONFIG_H} instead (@pxref{Configuration Headers}). This
-variable is not defined while @code{configure} is performing its tests,
-only when creating the output files. @xref{Setting Output Variables}, for
-how to check the results of previous tests.
-@end defvar
-
-@defvar LDFLAGS
-@ovindex LDFLAGS
-Stripping (@samp{-s}) and any other miscellaneous options for the
-linker. If it is not set in the environment when @code{configure} runs,
-the default value is empty. @code{configure} uses this variable when
-linking programs to test for C features.
-@end defvar
-
-@defvar LIBS
-@ovindex LIBS
-@samp{-l} and @samp{-L} options to pass to the linker.
-@end defvar
-
-@node Build Directories, Automatic Remaking, Preset Output Variables, Makefile Substitutions
-@subsection Build Directories
-
-You might want to compile a software package in a different directory
-from the one that contains the source code. Doing this allows you to
-compile the package for several architectures simultaneously from the
-same copy of the source code and keep multiple sets of object files on
-disk.
-
-To support doing this, @code{make} uses the @code{VPATH} variable to
-find the files that are in the source directory. GNU @code{make} and
-most other recent @code{make} programs can do this. Older @code{make}
-programs do not support @code{VPATH}; when using them, the source code
-must be in the same directory as the object files.
-
-To support @code{VPATH}, each @file{Makefile.in} should contain two
-lines that look like:
-
-@example
-srcdir = @@srcdir@@
-VPATH = @@srcdir@@
-@end example
-
-Do not set @code{VPATH} to the value of another variable, for example
-@samp{VPATH = $(srcdir)}, because some versions of @code{make} do not do
-variable substitutions on the value of @code{VPATH}.
-
-@code{configure} substitutes in the correct value for @code{srcdir} when
-it produces @file{Makefile.in}.
-
-Do not use the @code{make} variable @code{$<}, which expands to the
-pathname of the file in the source directory (found with @code{VPATH}),
-except in implicit rules. (An implicit rule is one such as @samp{.c.o},
-which tells how to create a @file{.o} file from a @file{.c} file.) Some
-versions of @code{make} do not set @code{$<} in explicit rules; they
-expand it to an empty value.
-
-Instead, @file{Makefile} command lines should always refer to source
-files by prefixing them with @samp{$(srcdir)/}. For example:
-
-@example
-time.info: time.texinfo
- $(MAKEINFO) $(srcdir)/time.texinfo
-@end example
-
-@node Automatic Remaking, , Build Directories, Makefile Substitutions
-@subsection Automatic Remaking
-
-You can put rules like the following in the top-level @file{Makefile.in}
-for a package to automatically update the configuration information when
-you change the configuration files. This example includes all of the
-optional files, such as @file{aclocal.m4} and those related to
-configuration header files. Omit from the @file{Makefile.in} rules any
-of these files that your package does not use.
-
-The @samp{$@{srcdir@}/} prefix is included because of limitations in the
-@code{VPATH} mechanism.
-
-The @file{stamp-} files are necessary because the timestamps of
-@file{config.h.in} and @file{config.h} will not be changed if remaking
-them does not change their contents. This feature avoids unnecessary
-recompilation. You should include the file @file{stamp-h.in} your
-package's distribution, so @code{make} will consider @file{config.h.in}
-up to date. On some old BSD systems, @code{touch} or any command that
-results in an empty file does not update the timestamps, so use a
-command like @code{date} as a workaround.
-
-@example
-@group
-$@{srcdir@}/configure: configure.in aclocal.m4
- cd $@{srcdir@} && autoconf
-
-# autoheader might not change config.h.in, so touch a stamp file.
-$@{srcdir@}/config.h.in: stamp-h.in
-$@{srcdir@}/stamp-h.in: configure.in aclocal.m4 acconfig.h \
- config.h.top config.h.bot
- cd $@{srcdir@} && autoheader
- date > $@{srcdir@}/stamp-h.in
-
-config.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
-@end group
-@end example
-
-In addition, you should pass @samp{date > stamp-h} in the @var{extra-cmds}
-argument to @code{AC_OUTPUT}, so @file{config.status} will ensure that
-@file{config.h} is considered up to date. @xref{Output}, for more
-information about @code{AC_OUTPUT}.
-
-@xref{Invoking config.status}, for more examples of handling
-configuration-related dependencies.
-
-@node Configuration Headers, Subdirectories, Makefile Substitutions, Setup
-@section Configuration Header Files
-
-When a package tests more than a few C preprocessor symbols, the command
-lines to pass @samp{-D} options to the compiler can get quite long.
-This causes two problems. One is that the @code{make} output is hard to
-visually scan for errors. More seriously, the command lines can exceed
-the length limits of some operating systems. As an alternative to
-passing @samp{-D} options to the compiler, @code{configure} scripts can
-create a C header file containing @samp{#define} directives. The
-@code{AC_CONFIG_HEADER} macro selects this kind of output. It should be
-called right after @code{AC_INIT}.
-
-The package should @samp{#include} the configuration header file before
-any other header files, to prevent inconsistencies in declarations (for
-example, if it redefines @code{const}). Use @samp{#include <config.h>}
-instead of @samp{#include "config.h"}, and pass the C compiler a
-@samp{-I.} option (or @samp{-I..}; whichever directory contains
-@file{config.h}). That way, even if the source directory is configured
-itself (perhaps to make a distribution), other build directories can
-also be configured without finding the @file{config.h} from the source
-directory.
-
-@defmac AC_CONFIG_HEADER (@var{header-to-create} @dots{})
-@maindex CONFIG_HEADER
-@cvindex HAVE_CONFIG_H
-Make @code{AC_OUTPUT} create the file(s) in the whitespace-separated
-list @var{header-to-create} containing C preprocessor @code{#define}
-statements, and replace @samp{@@DEFS@@} in generated files with
-@samp{-DHAVE_CONFIG_H} instead of the value of @code{DEFS}. The usual
-name for @var{header-to-create} is @file{config.h}.
-
-If @var{header-to-create} already exists and its contents are identical
-to what @code{AC_OUTPUT} would put in it, it is left alone. Doing this
-allows some changes in configuration without needlessly causing object
-files that depend on the header file to be recompiled.
-
-Usually the input file is named @file{@var{header-to-create}.in};
-however, you can override the input file name by appending it to
-@var{header-to-create}, separated by a colon. For example,
-@example
-AC_CONFIG_HEADER(defines.h:defines.hin)
-@end example
-@noindent
-Doing this allows you to keep your filenames acceptable to MS-DOS.
-@end defmac
-
-@menu
-* Header Templates:: Input for the configuration headers.
-* Invoking autoheader:: How to create configuration templates.
-@end menu
-
-@node Header Templates, Invoking autoheader, , Configuration Headers
-@subsection Configuration Header Templates
-
-Your distribution should contain a template file that looks as you want
-the final header file to look, including comments, with default values
-in the @code{#define} statements. For example, suppose your
-@file{configure.in} makes these calls:
-
-@example
-AC_CONFIG_HEADER(conf.h)
-AC_CHECK_HEADERS(unistd.h)
-@end example
-
-@noindent
-Then you could have code like the following in @file{conf.h.in}.
-On systems that have @file{unistd.h}, @code{configure} will change the 0
-to a 1. On other systems, it will leave the line unchanged.
-
-@example
-@group
-/* Define as 1 if you have unistd.h. */
-#define HAVE_UNISTD_H 0
-@end group
-@end example
-
-Alternately, if your code tests for configuration options using
-@code{#ifdef} instead of @code{#if}, a default value can be to
-@code{#undef} the variable instead of to define it to a value. On
-systems that have @file{unistd.h}, @code{configure} will change the
-second line to read @samp{#define HAVE_UNISTD_H 1}. On other systems,
-it will comment that line out (in case the system predefines that
-symbol).
-
-@example
-@group
-/* Define if you have unistd.h. */
-#undef HAVE_UNISTD_H
-@end group
-@end example
-
-@node Invoking autoheader, , Header Templates, Configuration Headers
-@subsection Using @code{autoheader} to Create @file{config.h.in}
-
-The @code{autoheader} program can create a template file of C
-@samp{#define} statements for @code{configure} to use. If
-@file{configure.in} invokes @code{AC_CONFIG_HEADER(@var{file})},
-@code{autoheader} creates @file{@var{file}.in}. Otherwise,
-@code{autoheader} creates @file{config.h.in}.
-
-If you give @code{autoheader} an argument, it uses that file instead of
-@file{configure.in} and writes the header file to the standard output
-instead of to @file{config.h.in}. If you give @code{autoheader} an
-argument of @samp{-}, it reads the standard input instead of
-@file{configure.in} and writes the header file to the standard output.
-
-@code{autoheader} scans @file{configure.in} and figures out which C
-preprocessor symbols it might define. It copies comments and
-@code{#define} and @code{#undef} statements from a file called
-@file{acconfig.h}, which comes with and is installed with Autoconf. It
-also uses a file called @file{acconfig.h} in the current directory, if
-present. If you @code{AC_DEFINE} any additional symbols, you must
-create that file with entries for them. For symbols defined by
-@code{AC_CHECK_HEADERS}, @code{AC_CHECK_FUNCS}, @code{AC_CHECK_SIZEOF},
-or @code{AC_CHECK_LIB}, @code{autoheader} generates comments and
-@code{#undef} statements itself rather than copying them from a file,
-since the possible symbols are effectively limitless.
-
-The file that @code{autoheader} creates contains mainly @code{#define}
-and @code{#undef} statements and their accompanying comments. If
-@file{./acconfig.h} contains the string @samp{@@TOP@@},
-@code{autoheader} copies the lines before the line containing
-@samp{@@TOP@@} into the top of the file that it generates. Similarly,
-if @file{./acconfig.h} contains the string @samp{@@BOTTOM@@},
-@code{autoheader} copies the lines after that line to the end of the
-file it generates. Either or both of those strings may be omitted.
-
-An alternate way to produce the same effect is to create the files
-@file{@var{file}.top} (typically @file{config.h.top}) and/or
-@file{@var{file}.bot} in the current directory. If they exist,
-@code{autoheader} copies them to the beginning and end, respectively, of
-its output. Their use is discouraged because they have file names that
-contain two periods, and so can not be stored on MS-DOS; also, they are
-two more files to clutter up the directory. But if you use the
-@samp{--localdir=@var{dir}} option to use an @file{acconfig.h} in another
-directory, they give you a way to put custom boilerplate in each
-individual @file{config.h.in}.
-
-@code{autoheader} accepts the following options:
-
-@table @code
-@item --help
-@itemx -h
-Print a summary of the command line options and exit.
-
-@item --localdir=@var{dir}
-@itemx -l @var{dir}
-Look for the package files @file{aclocal.m4} and @file{acconfig.h} (but
-not @file{@var{file}.top} and @file{@var{file}.bot}) in directory
-@var{dir} instead of in the current directory.
-
-@item --macrodir=@var{dir}
-@itemx -m @var{dir}
-@evindex AC_MACRODIR
-Look for the installed macro files and @file{acconfig.h} in directory
-@var{dir}. You can also set the @code{AC_MACRODIR} environment variable
-to a directory; this option overrides the environment variable.
-
-@item --version
-Print the version number of Autoconf and exit.
-@end table
-
-@node Subdirectories, Default Prefix, Configuration Headers, Setup
-@section Configuring Other Packages in Subdirectories
-
-In most situations, calling @code{AC_OUTPUT} is sufficient to produce
-@file{Makefile}s in subdirectories. However, @code{configure} scripts
-that control more than one independent package can use
-@code{AC_CONFIG_SUBDIRS} to run @code{configure} scripts for other
-packages in subdirectories.
-
-@defmac AC_CONFIG_SUBDIRS (@var{dir} @dots{})
-@maindex CONFIG_SUBDIRS
-@ovindex subdirs
-Make @code{AC_OUTPUT} run @code{configure} in each subdirectory
-@var{dir} in the given whitespace-separated list. If a given @var{dir}
-is not found, no error is reported, so a @code{configure} script can
-configure whichever parts of a large source tree are present. If a
-given @var{dir} contains @file{configure.in} but no @code{configure},
-the Cygnus @code{configure} script found by @code{AC_CONFIG_AUXDIR} is
-used. The subdirectory @code{configure} scripts are given the same
-command line options that were given to this @code{configure} script,
-with minor changes if needed (e.g., to adjust a relative path for the
-cache file or source directory). This macro also sets the output
-variable @code{subdirs} to the list of directories @samp{@var{dir}
-@dots{}}. @file{Makefile} rules can use this variable to determine
-which subdirectories to recurse into.
-@end defmac
-
-@node Default Prefix, Versions, Subdirectories, Setup
-@section Default Prefix
-
-By default, @code{configure} sets the prefix for files it installs to
-@file{/usr/local}. The user of @code{configure} can select a different
-prefix using the @samp{--prefix} and @samp{--exec-prefix} options.
-There are two ways to change the default: when creating
-@code{configure}, and when running it.
-
-Some software packages might want to install in a directory besides
-@file{/usr/local} by default. To accomplish that, use the
-@code{AC_PREFIX_DEFAULT} macro.
-
-@defmac AC_PREFIX_DEFAULT (@var{prefix})
-Set the default installation prefix to @var{prefix} instead of @file{/usr/local}.
-@end defmac
-
-It may be convenient for users to have @code{configure} guess the
-installation prefix from the location of a related program that they
-have already installed. If you wish to do that, you can call
-@code{AC_PREFIX_PROGRAM}.
-
-@defmac AC_PREFIX_PROGRAM (@var{program})
-@maindex PREFIX_PROGRAM
-If the user did not specify an installation prefix (using the
-@samp{--prefix} option), guess a value for it by looking for
-@var{program} in @code{PATH}, the way the shell does. If @var{program}
-is found, set the prefix to the parent of the directory containing
-@var{program}; otherwise leave the prefix specified in
-@file{Makefile.in} unchanged. For example, if @var{program} is
-@code{gcc} and the @code{PATH} contains @file{/usr/local/gnu/bin/gcc},
-set the prefix to @file{/usr/local/gnu}.
-@end defmac
-
-@node Versions, , Default Prefix, Setup
-@section Version Numbers in @code{configure}
-
-The following macros manage version numbers for @code{configure}
-scripts. Using them is optional.
-
-@defmac AC_PREREQ (@var{version})
-@maindex PREREQ
-Ensure that a recent enough version of Autoconf is being used. If the
-version of Autoconf being used to create @code{configure} is earlier
-than @var{version}, print an error message on the standard error output
-and do not create @code{configure}. For example:
-
-@example
-AC_PREREQ(1.8)
-@end example
-
-This macro is useful if your @file{configure.in} relies on non-obvious
-behavior that changed between Autoconf releases. If it merely needs
-recently added macros, then @code{AC_PREREQ} is less useful, because the
-@code{autoconf} program already tells the user which macros are not
-found. The same thing happens if @file{configure.in} is processed by a
-version of Autoconf older than when @code{AC_PREREQ} was added.
-@end defmac
-
-@defmac AC_REVISION (@var{revision-info})
-@maindex REVISION
-Copy revision stamp @var{revision-info} into the @code{configure}
-script, with any dollar signs or double-quotes removed. This macro lets
-you put a revision stamp from @file{configure.in} into @code{configure}
-without RCS or CVS changing it when you check in @code{configure}. That
-way, you can determine easily which revision of @file{configure.in} a
-particular @code{configure} corresponds to.
-
-It is a good idea to call this macro before @code{AC_INIT} so that the
-revision number is near the top of both @file{configure.in} and
-@code{configure}. To support doing that, the @code{AC_REVISION} output
-begins with @samp{#!/bin/sh}, like the normal start of a
-@code{configure} script does.
-
-For example, this line in @file{configure.in}:
-
-@c The asis prevents RCS from changing the example in the manual.
-@example
-AC_REVISION($@asis{Revision: 1.30 }$)dnl
-@end example
-
-@noindent
-produces this in @code{configure}:
-
-@example
-#!/bin/sh
-# From configure.in Revision: 1.30
-@end example
-@end defmac
-
-@node Existing Tests, Writing Tests, Setup, Top
-@chapter Existing Tests
-
-These macros test for particular system features that packages
-might need or want to use. If you need to test for a kind of feature
-that none of these macros check for, you can probably do it by calling
-primitive test macros with appropriate arguments (@pxref{Writing Tests}).
-
-These tests print messages telling the user which feature they're
-checking for, and what they find. They cache their results for future
-@code{configure} runs (@pxref{Caching Results}).
-
-Some of these macros set output variables. @xref{Makefile
-Substitutions}, for how to get their values. The phrase ``define
-@var{name}'' is used below as a shorthand to mean ``define C
-preprocessor symbol @var{name} to the value 1''. @xref{Defining
-Symbols}, for how to get those symbol definitions into your program.
-
-@menu
-* Alternative Programs:: Selecting between alternative programs.
-* Libraries:: Library archives that might be missing.
-* Library Functions:: C library functions that might be missing.
-* Header Files:: Header files that might be missing.
-* Structures:: Structures or members that might be missing.
-* Typedefs:: @code{typedef}s that might be missing.
-* Compiler Characteristics:: C compiler or machine architecture features.
-* System Services:: Operating system services.
-* UNIX Variants:: Special kludges for specific UNIX variants.
-@end menu
-
-@node Alternative Programs, Libraries, , Existing Tests
-@section Alternative Programs
-
-These macros check for the presence or behavior of particular programs.
-They are used to choose between several alternative programs and to
-decide what to do once one has been chosen.
-If there is no macro specifically defined to check for a program you need,
-and you don't need to check for any special properties of
-it, then you can use one of the general program check macros.
-
-@menu
-* Particular Programs:: Special handling to find certain programs.
-* Generic Programs:: How to find other programs.
-@end menu
-
-@node Particular Programs, Generic Programs, , Alternative Programs
-@subsection Particular Program Checks
-
-These macros check for particular programs---whether they exist, and
-in some cases whether they support certain features.
-
-@defmac AC_DECL_YYTEXT
-@maindex DECL_YYTEXT
-@cvindex YYTEXT_POINTER
-@ovindex LEX_OUTPUT_ROOT
-Define @code{YYTEXT_POINTER} if @code{yytext} is a @samp{char *} instead
-of a @samp{char []}. Also set output variable @code{LEX_OUTPUT_ROOT} to
-the base of the file name that the lexer generates; usually
-@file{lex.yy}, but sometimes something else. These results vary
-according to whether @code{lex} or @code{flex} is being used.
-@end defmac
-
-@defmac AC_PROG_AWK
-@maindex PROG_AWK
-@ovindex AWK
-Check for @code{mawk}, @code{gawk}, @code{nawk}, and @code{awk}, in that
-order, and set output variable @code{AWK} to the first one that it
-finds. It tries @code{mawk} first because that is reported to be the
-fastest implementation.
-@end defmac
-
-@defmac AC_PROG_CC
-@maindex PROG_CC
-@ovindex CC
-@ovindex CFLAGS
-Determine a C compiler to use. If @code{CC} is not already set in the
-environment, check for @code{gcc}, and use @code{cc} if it's not found.
-Set output variable @code{CC} to the name of the compiler found.
-
-If using the GNU C compiler, set shell variable @code{GCC} to
-@samp{yes}, empty otherwise. If output variable @code{CFLAGS} was
-not already set, set it to @samp{-g -O} for the GNU C compiler
-(@samp{-O} on systems where GCC does not accept @samp{-g}), or @samp{-g}
-for other compilers.
-@end defmac
-
-@defmac AC_PROG_CC_C_O
-@maindex PROG_CC_C_O
-@cvindex NO_MINUS_C_MINUS_O
-If the C compiler does not accept the @samp{-c} and @samp{-o} options
-simultaneously, define @code{NO_MINUS_C_MINUS_O}.
-@end defmac
-
-@defmac AC_PROG_CPP
-@maindex PROG_CPP
-@ovindex CPP
-Set output variable @code{CPP} to a command that runs the
-C preprocessor. If @samp{$CC -E} doesn't work, it uses @file{/lib/cpp}.
-It is only portable to run @code{CPP} on files with a @file{.c}
-extension.
-
-If the current language is C (@pxref{Language Choice}), many of the
-specific test macros use the value of @code{CPP} indirectly by calling
-@code{AC_TRY_CPP}, @code{AC_CHECK_HEADER}, @code{AC_EGREP_HEADER}, or
-@code{AC_EGREP_CPP}.
-@end defmac
-
-@defmac AC_PROG_CXX
-@maindex PROG_CXX
-@ovindex CXX
-@ovindex CXXFLAGS
-Determine a C++ compiler to use. Check if the environment variable
-@code{CXX} or @code{CCC} (in that order) is set; if so, set output
-variable @code{CXX} to its value. Otherwise search for a C++ compiler
-under likely names (@code{c++}, @code{g++}, @code{gcc}, @code{CC}, and
-@code{cxx}). If none of those checks succeed, as a last resort set
-@code{CXX} to @code{gcc}.
-
-If using the GNU C++ compiler, set shell variable @code{GXX} to
-@samp{yes}, empty otherwise. If output variable @code{CXXFLAGS} was
-not already set, set it to @samp{-g -O} for the GNU C++ compiler
-(@samp{-O} on systems where G++ does not accept @samp{-g}), or @samp{-g}
-for other compilers.
-@end defmac
-
-@defmac AC_PROG_CXXCPP
-@maindex PROG_CXXCPP
-@ovindex CXXCPP
-Set output variable @code{CXXCPP} to a command that runs the
-C++ preprocessor. If @samp{$CXX -E} doesn't work, it uses @file{/lib/cpp}.
-It is only portable to run @code{CXXCPP} on files with a @file{.c},
-@file{.C}, or @file{.cc} extension.
-
-If the current language is C++ (@pxref{Language Choice}), many of the
-specific test macros use the value of @code{CXXCPP} indirectly by
-calling @code{AC_TRY_CPP}, @code{AC_CHECK_HEADER},
-@code{AC_EGREP_HEADER}, or @code{AC_EGREP_CPP}.
-@end defmac
-
-@defmac AC_PROG_GCC_TRADITIONAL
-@maindex PROG_GCC_TRADITIONAL
-@ovindex CC
-Add @samp{-traditional} to output variable @code{CC} if using the
-GNU C compiler and @code{ioctl} does not work properly without
-@samp{-traditional}. That usually happens when the fixed header files
-have not been installed on an old system. Since recent versions of the
-GNU C compiler fix the header files automatically when installed, this
-is becoming a less prevalent problem.
-@end defmac
-
-@defmac AC_PROG_INSTALL
-@maindex PROG_INSTALL
-@ovindex INSTALL
-@ovindex INSTALL_PROGRAM
-@ovindex INSTALL_DATA
-Set output variable @code{INSTALL} to the path of a BSD compatible
-@code{install} program, if one is found in the current @code{PATH}.
-Otherwise, set @code{INSTALL} to @samp{@var{dir}/install-sh -c},
-checking the directories specified to @code{AC_CONFIG_AUX_DIR} (or its
-default directories) to determine @var{dir} (@pxref{Output}). Also set
-the variable @code{INSTALL_PROGRAM} to @samp{$@{INSTALL@}} and
-@code{INSTALL_DATA} to @samp{$@{INSTALL@} -m 644}.
-
-This macro screens out various instances of @code{install} known to not
-work. It prefers to find a C program rather than a shell script, for
-speed. Instead of @file{install-sh}, it can also use @file{install.sh},
-but that name is obsolete because some @code{make} programs have a rule
-that creates @file{install} from it if there is no @file{Makefile}.
-
-A copy of @file{install-sh} which you may use comes with Autoconf. If
-you use @code{AC_PROG_INSTALL}, you must include either
-@file{install-sh} or @file{install.sh} in your distribution, or
-@code{configure} will produce an error message saying it can't find
-them---even if the system you're on has a good @code{install} program.
-This check is a safety measure to prevent you from accidentally leaving
-that file out, which would prevent your package from installing on
-systems that don't have a BSD-compatible @code{install} program.
-
-If you need to use your own installation program because it has
-features not found in standard @code{install} programs, there is no
-reason to use @code{AC_PROG_INSTALL}; just put the pathname of your
-program into your @file{Makefile.in} files.
-@end defmac
-
-@defmac AC_PROG_LEX
-@maindex PROG_LEX
-@ovindex LEX
-@ovindex LEXLIB
-If @code{flex} is found, set output variable @code{LEX} to
-@samp{flex} and @code{LEXLIB} to @samp{-lfl}, if that library is in a
-standard place. Otherwise set @code{LEX} to @samp{lex} and
-@code{LEXLIB} to @samp{-ll}.
-@end defmac
-
-@defmac AC_PROG_LN_S
-@maindex PROG_LN_S
-@ovindex LN_S
-If @samp{ln -s} works on the current filesystem (the operating system
-and filesystem support symbolic links), set output
-variable @code{LN_S} to @samp{ln -s}, otherwise set it to @samp{ln}.
-@end defmac
-
-@defmac AC_PROG_RANLIB
-@maindex PROG_RANLIB
-@ovindex RANLIB
-Set output variable @code{RANLIB} to @samp{ranlib} if @code{ranlib}
-is found, otherwise to @samp{:} (do nothing).
-@end defmac
-
-@defmac AC_PROG_YACC
-@maindex PROG_YACC
-@ovindex YACC
-If @code{bison} is found, set output variable @code{YACC} to
-@samp{bison -y}. Otherwise, if @code{byacc} is found, set @code{YACC}
-to @samp{byacc}. Otherwise set @code{YACC} to @samp{yacc}.
-@end defmac
-
-@node Generic Programs, , Particular Programs, Alternative Programs
-@subsection Generic Program Checks
-
-These macros are used to find programs not covered by the particular
-test macros. If you need to check the behavior of a program as well as
-find out whether it is present, you have to write your own test for
-it (@pxref{Writing Tests}).
-
-@defmac AC_CHECK_PROG (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
-@maindex CHECK_PROG
-Check whether program @var{prog-to-check-for} exists in @code{PATH}. If
-it is found, set @var{variable} to @var{value-if-found}, otherwise to
-@var{value-if-not-found}, if given. If @var{variable} was already set,
-do nothing. Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
-@defmac AC_CHECK_PROGS (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex CHECK_PROGS
-Check for each program in the whitespace-separated list
-@var{progs-to-check-for} exists in @code{PATH}. If it is found, set
-@var{variable} to the name of that program. Otherwise, continue
-checking the next program in the list. If none of the programs in the
-list are found, set @var{variable} to @var{value-if-not-found}; if
-@var{value-if-not-found} is not specified, the value of @var{variable}
-is not changed. Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
-@defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PATH_PROG
-Like @code{AC_CHECK_PROG}, but set @var{variable} to the entire
-path of @var{prog-to-check-for} if found.
-@end defmac
-
-@defmac AC_PATH_PROGS (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PATH_PROGS
-Like @code{AC_CHECK_PROGS}, but if any of @var{progs-to-check-for}
-are found, set @var{variable} to the entire path of the program
-found.
-@end defmac
-
-@node Libraries, Library Functions, Alternative Programs, Existing Tests
-@section Library Files
-
-The following macros check for the presence of certain C library archive
-files.
-
-@defmac AC_CHECK_LIB (@var{library}, @var{function} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]})
-@maindex CHECK_LIB
-Try to ensure that C function @var{function} is available by checking
-whether a test C program can be linked with the library @var{library} to
-get the function. @var{library} is the base name of the library; e.g.,
-to check for @samp{-lmp}, use @samp{mp} as the @var{library} argument.
-
-@var{action-if-found} is a list of shell commands to run if the link
-with the library succeeds; @var{action-if-not-found} is a list of shell
-commands to run if the link fails. If @var{action-if-found} and
-@var{action-if-not-found} are not specified, the default action is to
-add @samp{-l@var{library}} to @code{LIBS} and define
-@samp{HAVE_LIB@var{library}} (in all capitals).
-
-If linking with @var{library} results in unresolved symbols, which would
-be resolved by linking with additional libraries, give those libraries
-as the @var{other-libraries} argument, separated by spaces: @samp{-lX11
--lXt}. Otherwise this macro will fail to detect that @var{library} is
-present, because linking the test program will always fail with
-unresolved symbols.
-@end defmac
-
-@defmac AC_HAVE_LIBRARY (@var{library}, @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found} @r{[}, @var{other-libraries}@r{]]]})
-@maindex HAVE_LIBRARY
-This macro is equivalent to calling @code{AC_CHECK_LIB} with a
-@var{function} argument of @code{main}. In addition, @var{library} can
-be written as any of @samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}. In
-all of those cases, the compiler is passed @samp{-lfoo}. However,
-@var{library} can not be a shell variable; it must be a literal name.
-This macro is considered obsolete.
-@end defmac
-
-@node Library Functions, Header Files, Libraries, Existing Tests
-@section Library Functions
-
-The following macros check for particular C library functions.
-If there is no macro specifically defined to check for a function you need,
-and you don't need to check for any special properties of
-it, then you can use one of the general function check macros.
-
-@menu
-* Particular Functions:: Special handling to find certain functions.
-* Generic Functions:: How to find other functions.
-@end menu
-
-@node Particular Functions, Generic Functions, , Library Functions
-@subsection Particular Function Checks
-
-These macros check for particular C functions---whether they exist, and
-in some cases how they respond when given certain arguments.
-
-@defmac AC_FUNC_ALLOCA
-@maindex FUNC_ALLOCA
-@cvindex C_ALLOCA
-@cvindex HAVE_ALLOCA_H
-@ovindex ALLOCA
-Check how to get @code{alloca}. Tries to get a builtin version by
-checking for @file{alloca.h} or the predefined C preprocessor macros
-@code{__GNUC__} and @code{_AIX}. If this macro finds @file{alloca.h},
-it defines @code{HAVE_ALLOCA_H}.
-
-If those attempts fail, it looks for the function in the standard C
-library. If any of those methods succeed, it defines
-@code{HAVE_ALLOCA}. Otherwise, it sets the output variable
-@code{ALLOCA} to @samp{alloca.o} and defines @code{C_ALLOCA} (so
-programs can periodically call @samp{alloca(0)} to garbage collect).
-This variable is separate from @code{LIBOBJS} so multiple programs can
-share the value of @code{ALLOCA} without needing to create an actual
-library, in case only some of them use the code in @code{LIBOBJS}.
-
-This macro does not try to get @code{alloca} from the System V R3
-@file{libPW} or the System V R4 @file{libucb} because those libraries
-contain some incompatible functions that cause trouble. Some versions
-do not even contain @code{alloca} or contain a buggy version. If you
-still want to use their @code{alloca}, use @code{ar} to extract
-@file{alloca.o} from them instead of compiling @file{alloca.c}.
-
-Source files that use @code{alloca} should start with a piece of code
-like the following, to declare it properly. In some versions
-of AIX, the declaration of @code{alloca} must precede everything else
-except for comments and preprocessor directives. The @code{#pragma}
-directive is indented so that pre-ANSI C compilers will ignore it,
-rather than choke on it.
-
-@example
-@group
-/* AIX requires this to be the first thing in the file. */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-@end group
-@end example
-@end defmac
-
-@defmac AC_FUNC_CLOSEDIR_VOID
-@maindex FUNC_CLOSEDIR_VOID
-@cvindex CLOSEDIR_VOID
-If the @code{closedir} function does not return a meaningful value,
-define @code{CLOSEDIR_VOID}. Otherwise, callers ought to check its
-return value for an error indicator.
-@end defmac
-
-@defmac AC_FUNC_GETLOADAVG
-@maindex FUNC_GETLOADAVG
-@cvindex SVR4
-@cvindex DGUX
-@cvindex UMAX
-@cvindex UMAX4_3
-@cvindex NLIST_STRUCT
-@cvindex NLIST_NAME_UNION
-@cvindex GETLODAVG_PRIVILEGED
-@cvindex NEED_SETGID
-@ovindex LIBOBJS
-@ovindex NEED_SETGID
-@ovindex KMEM_GROUP
-Check how to get the system load averages. If the system has the
-@code{getloadavg} function, this macro defines @code{HAVE_GETLOADAVG},
-and adds to @code{LIBS} any libraries needed to get that function.
-
-Otherwise, it adds @samp{getloadavg.o} to the output variable
-@code{LIBOBJS}, and possibly defines several other C preprocessor
-macros and output variables:
-
-@enumerate
-@item
-It defines @code{SVR4}, @code{DGUX}, @code{UMAX}, or @code{UMAX4_3} if
-on those systems.
-
-@item
-If it finds @file{nlist.h}, it defines @code{NLIST_STRUCT}.
-
-@item
-If @samp{struct nlist} has an @samp{n_un} member, it defines
-@code{NLIST_NAME_UNION}.
-
-@item
-If compiling @file{getloadavg.c} defines @code{LDAV_PRIVILEGED},
-programs need to be installed specially on this system for
-@code{getloadavg} to work, and this macro defines
-@code{GETLOADAVG_PRIVILEGED}.
-
-@item
-This macro sets the output variable @code{NEED_SETGID}. The value is
-@samp{true} if special installation is required, @samp{false} if not.
-If @code{NEED_SETGID} is @samp{true}, this macro sets @code{KMEM_GROUP}
-to the name of the group that should own the installed program.
-@end enumerate
-@end defmac
-
-@defmac AC_FUNC_GETMNTENT
-@maindex FUNC_GETMNTENT
-@cvindex HAVE_GETMNTENT
-Check for the @code{getmntent} in the @file{sun} and @file{seq}
-libraries, for Irix 4 and PTX, respectively. Then, if @code{getmntent} is
-available, define @code{HAVE_GETMNTENT}.
-@end defmac
-
-@defmac AC_FUNC_MEMCMP
-@maindex FUNC_MEMCMP
-@ovindex LIBOBJS
-If the @code{memcmp} function is not available, or does not work on
-8-bit data (like the one on SunOS 4.1.3), add @samp{memcmp.o} to output
-variable @code{LIBOBJS}.
-@end defmac
-
-@defmac AC_FUNC_MMAP
-@maindex FUNC_MMAP
-@cvindex HAVE_MMAP
-If the @code{mmap} function exists and works correctly on memory mapped
-files, define @code{HAVE_MMAP}.
-@end defmac
-
-@defmac AC_FUNC_SETVBUF_REVERSED
-@maindex FUNC_SETVBUF_REVERSED
-@cvindex SETVBUF_REVERSED
-If @code{setvbuf} takes the buffering type as its second argument and
-the buffer pointer as the third, instead of the other way around, define
-@code{SETVBUF_REVERSED}. This is the case on System V before release 3.
-@end defmac
-
-@defmac AC_FUNC_STRCOLL
-@maindex FUNC_STRCOLL
-@cvindex HAVE_STRCOLL
-If the @code{strcoll} function exists and works correctly, define
-@code{HAVE_STRCOLL}. This does a bit more than
-@samp{AC_CHECK_FUNCS(strcoll)}, because some systems have incorrect
-definitions of @code{strcoll}, which should not be used.
-@end defmac
-
-@defmac AC_FUNC_STRFTIME
-@maindex FUNC_STRFTIME
-@cvindex HAVE_STRFTIME
-Check for @code{strftime} in the @file{intl} library, for SCO UNIX.
-Then, if @code{strftime} is available, define @code{HAVE_STRFTIME}.
-@end defmac
-
-@defmac AC_FUNC_UTIME_NULL
-@maindex FUNC_UTIME_NULL
-@cvindex HAVE_UTIME_NULL
-If @samp{utime(@var{file}, NULL)} sets @var{file}'s timestamp to
-the present, define @code{HAVE_UTIME_NULL}.
-@end defmac
-
-@defmac AC_FUNC_VFORK
-@maindex FUNC_VFORK
-@cvindex HAVE_VFORK_H
-@cvindex vfork
-If @file{vfork.h} is found, define @code{HAVE_VFORK_H}. If a working
-@code{vfork} is not found, define @code{vfork} to be @code{fork}. This
-macro checks for several known errors in implementations of @code{vfork}
-and considers the system to not have a working @code{vfork} if it
-detects any of them.
-@end defmac
-
-@defmac AC_FUNC_VPRINTF
-@maindex FUNC_VPRINTF
-@cvindex HAVE_VPRINTF
-@cvindex HAVE_DOPRNT
-If @code{vprintf} is found, define @code{HAVE_VPRINTF}. Otherwise, if
-@code{_doprnt} is found, define @code{HAVE_DOPRNT}. (If @code{vprintf}
-is available, you may assume that @code{vfprintf} and @code{vsprintf}
-are also available.)
-@end defmac
-
-@defmac AC_FUNC_WAIT3
-@maindex FUNC_WAIT3
-@cvindex HAVE_WAIT3
-If @code{wait3} is found and fills in the contents of its third argument
-(a @samp{struct rusage *}), which HP-UX does not do, define
-@code{HAVE_WAIT3}.
-@end defmac
-
-@node Generic Functions, , Particular Functions, Library Functions
-@subsection Generic Function Checks
-
-These macros are used to find functions not covered by the particular
-test macros. If the functions might be in libraries other than the
-default C library, first call @code{AC_CHECK_LIB} for those libraries.
-If you need to check the behavior of a function as well as find out
-whether it is present, you have to write your own test for
-it (@pxref{Writing Tests}).
-
-@defmac AC_CHECK_FUNC (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex CHECK_FUNC
-If C function @var{function} is available, run shell commands
-@var{action-if-found}, otherwise @var{action-if-not-found}. If you just
-want to define a symbol if the function is available, consider using
-@code{AC_CHECK_FUNCS} instead. This macro checks for functions with C
-linkage even when @code{AC_LANG_CPLUSPLUS} has been called, since C++ is
-more standardized than C is. (@pxref{Language Choice}, for more
-information about selecting the language for checks.)
-@end defmac
-
-@defmac AC_CHECK_FUNCS (@var{function}@dots{} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]})
-@maindex CHECK_FUNCS
-@cvindex HAVE_@var{function}
-For each given @var{function} in the whitespace-separated argument list
-that is available, define @code{HAVE_@var{function}} (in all capitals). If
-@var{action-if-found} is given, it is additional shell code to execute
-when one of the functions is found. You can give it a value of
-@samp{break} to break out of the loop on the first match. If
-@var{action-if-not-found} is given, it is executed when one of the
-functions is not found.
-@end defmac
-
-@defmac AC_REPLACE_FUNCS (@var{function-name}@dots{})
-@maindex REPLACE_FUNCS
-@ovindex LIBOBJS
-For each given @var{function-name} in the whitespace-separated argument
-list that is not in the C library, add @samp{@var{function-name}.o} to
-the value of the output variable @code{LIBOBJS}.
-@end defmac
-
-@node Header Files, Structures, Library Functions, Existing Tests
-@section Header Files
-
-The following macros check for the presence of certain C header files.
-If there is no macro specifically defined to check for a header file you need,
-and you don't need to check for any special properties of
-it, then you can use one of the general header file check macros.
-
-@menu
-* Particular Headers:: Special handling to find certain headers.
-* Generic Headers:: How to find other headers.
-@end menu
-
-@node Particular Headers, Generic Headers, , Header Files
-@subsection Particular Header Checks
-
-These macros check for particular system header files---whether they
-exist, and in some cases whether they declare certain symbols.
-
-@defmac AC_DECL_SYS_SIGLIST
-@maindex DECL_SYS_SIGLIST
-@cvindex SYS_SIGLIST_DECLARED
-Define @code{SYS_SIGLIST_DECLARED} if the variable @code{sys_siglist} is
-declared in a system header file, either @file{signal.h} or
-@file{unistd.h}.
-@end defmac
-
-@defmac AC_DIR_HEADER
-@maindex DIR_HEADER
-@cvindex DIRENT
-@cvindex SYSDIR
-@cvindex SYSNDIR
-@cvindex NDIR
-@cvindex VOID_CLOSEDIR
-Like calling @code{AC_HEADER_DIRENT} and @code{AC_FUNC_CLOSEDIR_VOID},
-but defines a different set of C preprocessor macros to indicate which
-header file is found. This macro and the names it defines are
-considered obsolete. The names it defines are:
-
-@c The printed table looks too spaced out with blank lines between the entries.
-@table @file
-@item dirent.h
-@code{DIRENT}
-@item sys/ndir.h
-@code{SYSNDIR}
-@item sys/dir.h
-@code{SYSDIR}
-@item ndir.h
-@code{NDIR}
-@end table
-
-In addition, if the @code{closedir} function does not return a
-meaningful value, define @code{VOID_CLOSEDIR}.
-@end defmac
-
-@defmac AC_HEADER_DIRENT
-@maindex HEADER_DIRENT
-@cvindex HAVE_DIRENT_H
-@cvindex HAVE_NDIR_H
-@cvindex HAVE_SYS_DIR_H
-@cvindex HAVE_SYS_NDIR_H
-Check for the following header files, and for the first one that is
-found and defines @samp{DIR}, define the listed C preprocessor macro:
-
-@c The printed table looks too spaced out with blank lines between the entries.
-@table @file
-@item dirent.h
-@code{HAVE_DIRENT_H}
-@item sys/ndir.h
-@code{HAVE_SYS_NDIR_H}
-@item sys/dir.h
-@code{HAVE_SYS_DIR_H}
-@item ndir.h
-@code{HAVE_NDIR_H}
-@end table
-
-The directory library declarations in the source code should look
-something like the following:
-
-@example
-@group
-#if HAVE_DIRENT_H
-# include <dirent.h>
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-#else
-# define dirent direct
-# define NAMLEN(dirent) (dirent)->d_namlen
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
-@end group
-@end example
-
-Using the above declarations, the program would declare variables to be
-type @code{struct dirent}, not @code{struct direct}, and would access
-the length of a directory entry name by passing a pointer to a
-@code{struct dirent} to the @code{NAMLEN} macro.
-
-This macro also checks for the SCO Xenix @file{dir} and @file{x} libraries.
-@end defmac
-
-@defmac AC_HEADER_MAJOR
-@maindex HEADER_MAJOR
-@cvindex MAJOR_IN_MKDEV
-@cvindex MAJOR_IN_SYSMACROS
-If @file{sys/types.h} does not define @code{major}, @code{minor}, and
-@code{makedev}, but @file{sys/mkdev.h} does, define
-@code{MAJOR_IN_MKDEV}; otherwise, if @file{sys/sysmacros.h} does, define
-@code{MAJOR_IN_SYSMACROS}.
-@end defmac
-
-@defmac AC_HEADER_STDC
-@maindex HEADER_STDC
-@cvindex STDC_HEADERS
-Define @code{STDC_HEADERS} if the system has ANSI C header files.
-Specifically, this macro checks for @file{stdlib.h}, @file{stdarg.h},
-@file{string.h}, and @file{float.h}; if the system has those, it
-probably has the rest of the ANSI C header files. This macro also
-checks whether @file{string.h} declares @code{memchr} (and thus
-presumably the other @code{mem} functions), whether @file{stdlib.h}
-declare @code{free} (and thus presumably @code{malloc} and other related
-functions), and whether the @file{ctype.h} macros work on characters
-with the high bit set, as ANSI C requires.
-
-Use @code{STDC_HEADERS} instead of @code{__STDC__} to determine whether
-the system has ANSI-compliant header files (and probably C library
-functions) because many systems that have GCC do not have ANSI C header
-files.
-
-On systems without ANSI C headers, there is so much variation that it is
-probably easier to declare the functions you use than to figure out
-exactly what the system header files declare. Some systems contain a
-mix of functions ANSI and BSD; some are mostly ANSI but lack
-@samp{memmove}; some define the BSD functions as macros in
-@file{string.h} or @file{strings.h}; some have only the BSD functions
-but @file{string.h}; some declare the memory functions in
-@file{memory.h}, some in @file{string.h}; etc. It is probably
-sufficient to check for one string function and one memory function; if
-the library has the ANSI versions of those then it probably has most of
-the others. If you put the following in @file{configure.in}:
-
-@example
-AC_HEADER_STDC
-AC_CHECK_FUNCS(strchr memcpy)
-@end example
-
-@noindent
-then, in your code, you can put declarations like this:
-
-@example
-@group
-#if STDC_HEADERS
-# include <string.h>
-#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
-@end group
-@end example
-
-@noindent
-If you use a function like @code{memchr}, @code{memset}, @code{strtok},
-or @code{strspn}, which have no BSD equivalent, then macros won't
-suffice; you must provide an implementation of each function. An easy
-way to incorporate your implementations only when needed (since the ones
-in system C libraries may be hand optimized) is to, taking @code{memchr}
-for example, put it in @file{memchr.c} and use
-@samp{AC_REPLACE_FUNCS(memchr)}.
-@end defmac
-
-@defmac AC_HEADER_SYS_WAIT
-@maindex HEADER_SYS_WAIT
-@cvindex HAVE_SYS_WAIT_H
-If @file{sys/wait.h} exists and is compatible with POSIX.1, define
-@code{HAVE_SYS_WAIT_H}. Incompatibility can occur if @file{sys/wait.h}
-does not exist, or if it uses the old BSD @code{union wait} instead of
-@code{int} to store a status value. If @file{sys/wait.h} is not POSIX.1
-compatible, then instead of including it, define the POSIX.1 macros with
-their usual interpretations. Here is an example:
-
-@example
-@group
-#include <sys/types.h>
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-@end group
-@end example
-@end defmac
-
-@defmac AC_MEMORY_H
-@maindex MEMORY_H
-@cvindex NEED_MEMORY_H
-Define @code{NEED_MEMORY_H} if @code{memcpy}, @code{memcmp}, etc. are
-not declared in @file{string.h} and @file{memory.h} exists. This macro
-is obsolete; instead, use @code{AC_CHECK_HEADERS(memory.h)}. See the
-example for @code{AC_HEADER_STDC}.
-@end defmac
-
-@defmac AC_UNISTD_H
-@maindex UNISTD_H
-@cvindex HAVE_UNISTD_H
-Define @code{HAVE_UNISTD_H} if the system has @file{unistd.h}. This
-macro is obsolete; instead, use @samp{AC_CHECK_HEADERS(unistd.h)}.
-
-The way to check if the system supports POSIX.1 is:
-
-@example
-@group
-#if HAVE_UNISTD_H
-# include <sys/types.h>
-# include <unistd.h>
-#endif
-
-#ifdef _POSIX_VERSION
-/* Code for POSIX.1 systems. */
-#endif
-@end group
-@end example
-
-@cvindex _POSIX_VERSION
-@code{_POSIX_VERSION} is defined when @file{unistd.h} is included on
-POSIX.1 systems. If there is no @file{unistd.h}, it is definitely not a
-POSIX.1 system. However, some non-POSIX.1 systems do have @file{unistd.h}.
-@end defmac
-
-@defmac AC_USG
-@maindex USG
-@cvindex USG
-Define @code{USG} if the system does not have @file{strings.h},
-@code{rindex}, @code{bzero}, etc. This implies that it has
-@file{string.h}, @code{strrchr}, @code{memset}, etc.
-
-The symbol @code{USG} is obsolete. Instead of this macro, see the
-example for @code{AC_HEADER_STDC}.
-@end defmac
-
-@node Generic Headers, , Particular Headers, Header Files
-@subsection Generic Header Checks
-
-These macros are used to find system header files not covered by the
-particular test macros. If you need to check the contents of a header
-as well as find out whether it is present, you have to write your own
-test for it (@pxref{Writing Tests}).
-
-@defmac AC_CHECK_HEADER (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex CHECK_HEADER
-If the system header file @var{header-file} exists, execute shell commands
-@var{action-if-found}, otherwise execute @var{action-if-not-found}. If
-you just want to define a symbol if the header file is available,
-consider using @code{AC_CHECK_HEADERS} instead.
-@end defmac
-
-@defmac AC_CHECK_HEADERS (@var{header-file}@dots{} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]})
-@maindex CHECK_HEADERS
-@cvindex HAVE_@var{header}
-For each given system header file @var{header-file} in the
-whitespace-separated argument list that exists, define
-@code{HAVE_@var{header-file}} (in all capitals). If @var{action-if-found}
-is given, it is additional shell code to execute when one of the header
-files is found. You can give it a value of @samp{break} to break out of
-the loop on the first match. If @var{action-if-not-found} is given, it
-is executed when one of the header files is not found.
-@end defmac
-
-@node Structures, Typedefs, Header Files, Existing Tests
-@section Structures
-
-The following macros check for certain structures or structure members.
-To check structures not listed here, use @code{AC_EGREP_CPP}
-(@pxref{Examining Declarations}) or @code{AC_TRY_COMPILE}
-(@pxref{Examining Syntax}).
-
-@defmac AC_HEADER_STAT
-@maindex HEADER_STAT
-@maindex STAT_MACROS_BROKEN
-If the macros @code{S_ISDIR}, @code{S_ISREG} et al. defined in
-@file{sys/stat.h} do not work properly (returning false positives),
-define @code{STAT_MACROS_BROKEN}. This is the case on Tektronix UTekV,
-Amdahl UTS and Motorola System V/88.
-@end defmac
-
-@defmac AC_HEADER_TIME
-@maindex HEADER_TIME
-@cvindex TIME_WITH_SYS_TIME
-If a program may include both @file{time.h} and @file{sys/time.h},
-define @code{TIME_WITH_SYS_TIME}. On some older systems,
-@file{sys/time.h} includes @file{time.h}, but @file{time.h} is not
-protected against multiple inclusion, so programs should not explicitly
-include both files. This macro is useful in programs that use, for
-example, @code{struct timeval} or @code{struct timezone} as well as
-@code{struct tm}. It is best used in conjunction with
-@code{HAVE_SYS_TIME_H}, which can be checked for using
-@code{AC_CHECK_HEADERS(sys/time.h)}.
-
-@example
-@group
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-@end group
-@end example
-@end defmac
-
-@defmac AC_STRUCT_ST_BLKSIZE
-@maindex STRUCT_ST_BLKSIZE
-@cvindex HAVE_ST_BLKSIZE
-If @code{struct stat} contains an @code{st_blksize} member, define
-@code{HAVE_ST_BLKSIZE}.
-@end defmac
-
-@defmac AC_STRUCT_ST_BLOCKS
-@maindex STRUCT_ST_BLOCKS
-@cvindex HAVE_ST_BLOCKS
-@ovindex LIBOBJS
-If @code{struct stat} contains an @code{st_blocks} member, define
-@code{HAVE_ST_BLOCKS}. Otherwise, add @samp{fileblocks.o} to the
-output variable @code{LIBOBJS}.
-@end defmac
-
-@defmac AC_STRUCT_ST_RDEV
-@maindex STRUCT_ST_RDEV
-@cvindex HAVE_ST_RDEV
-If @code{struct stat} contains an @code{st_rdev} member, define
-@code{HAVE_ST_RDEV}.
-@end defmac
-
-@defmac AC_STRUCT_TM
-@maindex STRUCT_TM
-@cvindex TM_IN_SYS_TIME
-If @file{time.h} does not define @code{struct tm}, define
-@code{TM_IN_SYS_TIME}, which means that including @file{sys/time.h}
-had better define @code{struct tm}.
-@end defmac
-
-@defmac AC_STRUCT_TIMEZONE
-@maindex STRUCT_TIMEZONE
-@cvindex HAVE_TM_ZONE
-@cvindex HAVE_TZNAME
-Figure out how to get the current timezone. If @code{struct tm} has a
-@code{tm_zone} member, define @code{HAVE_TM_ZONE}. Otherwise, if the
-external array @code{tzname} is found, define @code{HAVE_TZNAME}.
-@end defmac
-
-@node Typedefs, Compiler Characteristics, Structures, Existing Tests
-@section Typedefs
-
-The following macros check for C typedefs. If there is no macro
-specifically defined to check for a typedef you need, and you don't need
-to check for any special properties of it, then you can use a general
-typedef check macro.
-
-@menu
-* Particular Typedefs:: Special handling to find certain types.
-* Generic Typedefs:: How to find other types.
-@end menu
-
-@node Particular Typedefs, Generic Typedefs, , Typedefs
-@subsection Particular Typedef Checks
-
-These macros check for particular C typedefs in @file{sys/types.h} and
-@file{stdlib.h} (if it exists).
-
-@defmac AC_TYPE_GETGROUPS
-@maindex TYPE_GETGROUPS
-@cvindex GETGROUPS_T
-Define @code{GETGROUPS_T} to be whichever of @code{gid_t} or @code{int}
-is the base type of the array argument to @code{getgroups}.
-@end defmac
-
-@defmac AC_TYPE_MODE_T
-@maindex TYPE_MODE_T
-@cvindex mode_t
-If @code{mode_t} is not defined, define @code{mode_t} to be @code{int}.
-@end defmac
-
-@defmac AC_TYPE_OFF_T
-@maindex TYPE_OFF_T
-@cvindex off_t
-If @code{off_t} is not defined, define @code{off_t} to be @code{long}.
-@end defmac
-
-@defmac AC_TYPE_PID_T
-@maindex TYPE_PID_T
-@cvindex pid_t
-If @code{pid_t} is not defined, define @code{pid_t} to be @code{int}.
-@end defmac
-
-@defmac AC_TYPE_SIGNAL
-@maindex TYPE_SIGNAL
-@cvindex RETSIGTYPE
-If @file{signal.h} declares @code{signal} as returning a pointer to a
-function returning @code{void}, define @code{RETSIGTYPE} to be
-@code{void}; otherwise, define it to be @code{int}.
-
-Define signal handlers as returning type @code{RETSIGTYPE}:
-
-@example
-@group
-RETSIGTYPE
-hup_handler ()
-@{
-@dots{}
-@}
-@end group
-@end example
-@end defmac
-
-@defmac AC_TYPE_SIZE_T
-@maindex TYPE_SIZE_T
-@cvindex size_t
-If @code{size_t} is not defined, define @code{size_t} to be
-@code{unsigned}.
-@end defmac
-
-@defmac AC_TYPE_UID_T
-@maindex TYPE_UID_T
-@cvindex uid_t
-@cvindex gid_t
-If @code{uid_t} is not defined, define @code{uid_t} to be @code{int} and
-@code{gid_t} to be @code{int}.
-@end defmac
-
-@node Generic Typedefs, , Particular Typedefs, Typedefs
-@subsection Generic Typedef Checks
-
-This macro is used to check for typedefs not covered by the particular
-test macros.
-
-@defmac AC_CHECK_TYPE (@var{type}, @var{default})
-@maindex CHECK_TYPE
-If the type @var{type} is not defined in @file{sys/types.h} or
-@file{stdlib.h} (if it exists), define it to be the C (or C++)
-builtin type @var{default}; e.g., @samp{short} or @samp{unsigned}.
-@end defmac
-
-@node Compiler Characteristics, System Services, Typedefs, Existing Tests
-@section Compiler Characteristics
-
-The following macros check for C compiler or machine architecture
-features. To check for characteristics not listed here, use
-@code{AC_TRY_COMPILE} (@pxref{Examining Syntax}) or @code{AC_TRY_RUN}
-(@pxref{Run Time})
-
-@defmac AC_C_BIGENDIAN
-@maindex C_BIGENDIAN
-@cvindex WORDS_BIGENDIAN
-If words are stored with the most significant byte first (like Motorola
-and SPARC, but not Intel and VAX, CPUs), define @code{WORDS_BIGENDIAN}.
-@end defmac
-
-@defmac AC_C_CONST
-@maindex C_CONST
-@cvindex const
-If the C compiler does not fully support the keyword @code{const},
-define @code{const} to be empty. Some C compilers that do not define
-@code{__STDC__} do support @code{const}; some compilers that define
-@code{__STDC__} do not completely support @code{const}. Programs can
-simply use @code{const} as if every C compiler supported it; for those
-that don't, the @file{Makefile} or configuration header file will define
-it as empty.
-@end defmac
-
-@defmac AC_C_INLINE
-@maindex C_INLINE
-@cvindex inline
-If the C compiler is a version of GCC that supports the keyword
-@code{__inline} but not @code{inline} (such as some NeXT versions),
-define @code{inline} to be @code{__inline}.
-@end defmac
-
-@defmac AC_C_CHAR_UNSIGNED
-@maindex C_CHAR_UNSIGNED
-@cvindex __CHAR_UNSIGNED__
-If the C type @code{char} is unsigned, define @code{__CHAR_UNSIGNED__},
-unless the C compiler predefines it.
-@end defmac
-
-@defmac AC_C_LONG_DOUBLE
-@maindex C_LONG_DOUBLE
-@cvindex HAVE_LONG_DOUBLE
-If the C compiler supports the @code{long double} type, define
-@code{HAVE_LONG_DOUBLE}. Some C compilers that do not define
-@code{__STDC__} do support the @code{long double} type; some compilers
-that define @code{__STDC__} do not support @code{long double}.
-@end defmac
-
-@defmac AC_CHECK_SIZEOF (@var{type})
-@maindex CHECK_SIZEOF
-Define @code{SIZEOF_@var{uctype}} to be the size in bytes of the C (or
-C++) builtin type @var{type}, e.g. @samp{int} or @samp{char *}. If
-@samp{type} is unknown to the compiler, it gets a size of 0. @var{uctype}
-is @var{type}, with lowercase converted to uppercase, spaces changed to
-underscores, and asterisks changed to @samp{P}. For example, the call
-@example
-AC_CHECK_SIZEOF(int *)
-@end example
-@noindent
-defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems.
-@end defmac
-
-@defmac AC_INT_16_BITS
-@maindex INT_16_BITS
-@cvindex INT_16_BITS
-If the C type @code{int} is 16 bits wide, define @code{INT_16_BITS}.
-This macro is obsolete; it is more general to use
-@samp{AC_CHECK_SIZEOF(int)} instead.
-@end defmac
-
-@defmac AC_LONG_64_BITS
-@maindex LONG_64_BITS
-@cvindex LONG_64_BITS
-If the C type @code{long int} is 64 bits wide, define
-@code{LONG_64_BITS}. This macro is obsolete; it is more general to use
-@samp{AC_CHECK_SIZEOF(long)} instead.
-@end defmac
-
-@node System Services, UNIX Variants, Compiler Characteristics, Existing Tests
-@section System Services
-
-The following macros check for operating system services or capabilities.
-
-@defmac AC_SYS_INTERPRETER
-@maindex SYS_INTERPRETER
-Check whether the system supports starting scripts with a line of the
-form @samp{#!/bin/csh} to select the interpreter to use for the script.
-After running this macro, shell code in @code{configure.in} can check
-the variable @code{ac_cv_sys_interpreter}; it will be set to @samp{yes}
-if the system supports @samp{#!}, @samp{no} if not.
-@end defmac
-
-@defmac AC_PATH_X
-@maindex PATH_X
-Try to locate the X Window System include files and libraries. If the
-user gave the command line options @samp{--x-includes=@var{dir}} and
-@samp{--x-libraries=@var{dir}}, use those directories. If either or
-both were not given, get the missing values by running @code{xmkmf} on a
-trivial @file{Imakefile} and examining the @file{Makefile} that it
-produces. If that fails (such as if @code{xmkmf} is not present), look
-for them in several directories where they often reside. If either
-method is successful, set the shell variables @code{x_includes} and
-@code{x_libraries} to their locations, unless they are in directories
-the compiler searches by default.
-
-If both methods fail, or the user gave the command line option
-@samp{--without-x}, set the shell variable @code{no_x} to @samp{yes};
-otherwise set it to the empty string.
-@end defmac
-
-@defmac AC_PATH_XTRA
-@maindex PATH_XTRA
-@ovindex X_CFLAGS
-@ovindex X_LIBS
-@ovindex X_EXTRA_LIBS
-@ovindex X_PRE_LIBS
-An enhanced version of @code{AC_PATH_X}. Add the C compiler flags that
-X needs to output variable @code{X_CFLAGS}, and the X linker flags to
-@code{X_LIBS}. If X is not available, add @samp{-DX_DISPLAY_MISSING} to
-@code{X_CFLAGS}.
-
-Also check for special libraries that some systems need in order to
-compile X programs. Add any that the system needs to output variable
-@code{X_EXTRA_LIBS}. And check for special X11R6 libraries that need to
-be linked with before @samp{-lX11}, and add any found to the output
-variable @code{X_PRE_LIBS}.
-@end defmac
-
-@defmac AC_SYS_LONG_FILE_NAMES
-@maindex SYS_LONG_FILE_NAMES
-@cvindex HAVE_LONG_FILE_NAMES
-If the system supports file names longer than 14 characters, define
-@code{HAVE_LONG_FILE_NAMES}.
-@end defmac
-
-@defmac AC_SYS_RESTARTABLE_SYSCALLS
-@maindex SYS_RESTARTABLE_SYSCALLS
-@cvindex HAVE_RESTARTABLE_SYSCALLS
-If the system automatically restarts a system call that is interrupted
-by a signal, define @code{HAVE_RESTARTABLE_SYSCALLS}.
-@end defmac
-
-@node UNIX Variants, , System Services, Existing Tests
-@section UNIX Variants
-
-The following macros check for certain operating systems that need
-special treatment for some programs, due to exceptional oddities in
-their header files or libraries. These macros are warts; they will be
-replaced by a more systematic approach, based on the functions they make
-available or the environments they provide.
-
-@defmac AC_AIX
-@maindex AIX
-@cvindex _ALL_SOURCE
-If on AIX, define @code{_ALL_SOURCE}. Allows the use of some BSD
-functions. Should be called before any macros that run the C compiler.
-@end defmac
-
-@defmac AC_DYNIX_SEQ
-@maindex DYNIX_SEQ
-If on Dynix/PTX (Sequent UNIX), add @samp{-lseq} to output
-variable @code{LIBS}. This macro is obsolete; instead, use
-@code{AC_FUNC_GETMNTENT}.
-@end defmac
-
-@defmac AC_IRIX_SUN
-@maindex IRIX_SUN
-If on IRIX (Silicon Graphics UNIX), add @samp{-lsun} to output variable
-@code{LIBS}. This macro is obsolete. If you were using it to get
-@code{getmntent}, use @code{AC_FUNC_GETMNTENT} instead. If you used it
-for the NIS versions of the password and group functions, use
-@samp{AC_CHECK_LIB(sun, getpwnam)}.
-@end defmac
-
-@defmac AC_ISC_POSIX
-@maindex ISC_POSIX
-@cvindex _POSIX_SOURCE
-@ovindex CC
-If on a POSIXized ISC UNIX, define @code{_POSIX_SOURCE} and add
-@samp{-posix} (for the GNU C compiler) or @samp{-Xp} (for other C
-compilers) to output variable @code{CC}. This allows the use of
-POSIX facilities. Must be called after @code{AC_PROG_CC} and before
-any other macros that run the C compiler.
-@end defmac
-
-@defmac AC_MINIX
-@maindex MINIX
-@cvindex _MINIX
-@cvindex _POSIX_SOURCE
-@cvindex _POSIX_1_SOURCE
-If on Minix, define @code{_MINIX} and @code{_POSIX_SOURCE} and define
-@code{_POSIX_1_SOURCE} to be 2. This allows the use of POSIX
-facilities. Should be called before any macros that run the C compiler.
-@end defmac
-
-@defmac AC_SCO_INTL
-@maindex SCO_INTL
-@ovindex LIBS
-If on SCO UNIX, add @samp{-lintl} to output variable @code{LIBS}.
-This macro is obsolete; instead, use @code{AC_FUNC_STRFTIME}.
-@end defmac
-
-@defmac AC_XENIX_DIR
-@maindex XENIX_DIR
-@ovindex LIBS
-If on Xenix, add @samp{-lx} to output variable @code{LIBS}. Also, if
-@file{dirent.h} is being used, add @samp{-ldir} to @code{LIBS}. This
-macro is obsolete; use @code{AC_HEADER_DIRENT} instead.
-@end defmac
-
-@node Writing Tests, Results, Existing Tests, Top
-@chapter Writing Tests
-
-If the existing feature tests don't do something you need, you have to
-write new ones. These macros are the building blocks. They provide
-ways for other macros to check whether various kinds of features are
-available and report the results.
-
-This chapter contains some suggestions and some of the reasons why the
-existing tests are written the way they are. You can also learn a lot
-about how to write Autoconf tests by looking at the existing ones. If
-something goes wrong in one or more of the Autoconf tests, this
-information can help you understand the assumptions behind them, which
-might help you figure out how to best solve the problem.
-
-These macros check the output of the C compiler system. They do
-not cache the results of their tests for future use (@pxref{Caching
-Results}), because they don't know enough about the information they are
-checking for to generate a cache variable name. They also do not print
-any messages, for the same reason. The checks for particular kinds of C
-features call these macros and do cache their results and print messages
-about what they're checking for.
-
-@menu
-* Examining Declarations:: Detecting header files and declarations.
-* Examining Syntax:: Detecting language syntax features.
-* Examining Libraries:: Detecting functions and global variables.
-* Run Time:: Testing for run-time features.
-* Portable Shell:: Shell script portability pitfalls.
-* Testing Values and Files:: Checking strings and files.
-* Multiple Cases:: Tests for several possible values.
-* Language Choice:: Selecting which language to use for testing.
-@end menu
-
-@node Examining Declarations, Examining Syntax, , Writing Tests
-@section Examining Declarations
-
-The macro @code{AC_TRY_CPP} is used to check whether particular header
-files exist. You can check for one at a time, or more than one if you
-need several header files to all exist for some purpose.
-
-@defmac AC_TRY_CPP (@var{includes}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex TRY_CPP
-@var{includes} is C or C++ @code{#include} statements and declarations,
-on which shell variable, backquote, and backslash substitutions are
-performed. (Actually, it can be any C program, but other statements are
-probably not useful.) If the preprocessor produces no error messages
-while processing it, run shell commands @var{action-if-true}. Otherwise
-run shell commands @var{action-if-false}.
-
-This macro uses @code{CPPFLAGS}, but not @code{CFLAGS}, because
-@samp{-g}, @samp{-O}, etc. are not valid options to many C
-preprocessors.
-@end defmac
-
-Here is now to find out whether a header file contains a particular
-declaration, such as a typedef, a structure, a structure member, or a
-function. Use @code{AC_EGREP_HEADER} instead of running @code{grep}
-directly on the header file; on some systems the symbol might be defined
-in another header file that the file you are checking @samp{#include}s.
-
-@defmac AC_EGREP_HEADER (@var{pattern}, @var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex EGREP_HEADER
-If the output of running the preprocessor on the system header file
-@var{header-file} matches the @code{egrep} regular expression
-@var{pattern}, execute shell commands @var{action-if-found}, otherwise
-execute @var{action-if-not-found}.
-@end defmac
-
-To check for C preprocessor symbols, either defined by header files or
-predefined by the C preprocessor, use @code{AC_EGREP_CPP}. Here is an
-example of the latter:
-
-@example
-AC_EGREP_CPP(yes,
-[#ifdef _AIX
- yes
-#endif
-], is_aix=yes, is_aix=no)
-@end example
-
-@defmac AC_EGREP_CPP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex EGREP_CPP
-@var{program} is the text of a C or C++ program, on which shell
-variable, backquote, and backslash substitutions are performed. If the
-output of running the preprocessor on @var{program} matches the
-@code{egrep} regular expression @var{pattern}, execute shell commands
-@var{action-if-found}, otherwise execute @var{action-if-not-found}.
-
-This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending
-on which language is current, @pxref{Language Choice}), if it hasn't
-been called already.
-@end defmac
-
-@node Examining Syntax, Examining Libraries, Examining Declarations, Writing Tests
-@section Examining Syntax
-
-To check for a syntax feature of the C or C++ compiler, such as whether
-it recognizes a certain keyword, use @code{AC_TRY_COMPILE} to try to
-compile a small program that uses that feature. You can also use it to
-check for structures and structure members that are not present on all
-systems.
-
-@defmac AC_TRY_COMPILE (@var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex TRY_COMPILE
-Create a test C program to see whether a function whose body consists of
-@var{function-body} can be compiled; @var{includes} is any
-@code{#include} statements needed by the code in @var{function-body}.
-If the file compiles successfully, run shell commands
-@var{action-if-found}, otherwise run @var{action-if-not-found}. This
-macro uses @code{CFLAGS} or @code{CXXFLAGS}, and @code{CPPFLAGS}, when
-compiling. It does not try to link; use @code{AC_TRY_LINK} if you need
-to do that (@pxref{Examining Libraries}).
-@end defmac
-
-@node Examining Libraries, Run Time, Examining Syntax, Writing Tests
-@section Examining Libraries
-
-To check for a library, a function, or a global variable, Autoconf
-@code{configure} scripts try to compile and link a small program that
-uses it. This is unlike Metaconfig, which by default uses @code{nm}
-or @code{ar} on the C library to try to figure out which functions are
-available. Trying to link with the function is usually a more reliable
-approach because it avoids dealing with the variations in the options
-and output formats of @code{nm} and @code{ar} and in the location of the
-standard libraries. It also allows configuring for cross-compilation or
-checking a function's runtime behavior if needed. On the other hand, it
-can be slower than scanning the libraries once.
-
-A few systems have linkers that do not return a failure exit status when
-there are unresolved functions in the link. This bug makes the
-configuration scripts produced by Autoconf unusable on those systems.
-However, some of them can be given options that make the exit status
-correct. This is a problem that Autoconf does not currently handle
-automatically.
-
-@code{AC_TRY_LINK} is used to compile test programs to test for
-functions and global variables. It is also used (by
-@code{AC_CHECK_LIB}) to check for libraries, by adding the library being
-checked for to @code{LIBS} temporarily and trying to link a small
-program.
-
-@defmac AC_TRY_LINK (@var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex TRY_LINK
-Create a test C program to see whether a function whose body consists of
-@var{function-body} can be compiled and linked; @var{includes} is any
-@code{#include} statements needed by the code in @var{function-body}.
-If the file compiles and links successfully, run shell commands
-@var{action-if-found}, otherwise run @var{action-if-not-found}. This
-macro uses @code{CFLAGS} or @code{CXXFLAGS}, @code{CPPFLAGS},
-@code{LDFLAGS}, and @code{LIBS} when compiling.
-@end defmac
-
-@defmac AC_COMPILE_CHECK (@var{echo-text}, @var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
-@maindex COMPILE_CHECK
-This is an obsolete version of @code{AC_TRY_LINK}, with the addition that it
-prints @samp{checking for @var{echo-text}} to the standard output first,
-if @var{echo-text} is non-empty. Use @code{AC_MSG_CHECKING} and
-@code{AC_MSG_RESULT} instead to print messages (@pxref{Printing Messages}).
-@end defmac
-
-@node Run Time, Portable Shell, Examining Libraries, Writing Tests
-@section Checking Run Time Behavior
-
-Sometimes you need to find out how a system performs at run time, such
-as whether a given function has a certain capability or bug. If you
-can, make such checks when your program runs instead of when it is
-configured. You can check for things like the machine's endianness when
-your program initializes itself.
-
-If you really need to test for a run-time behavior while configuring,
-you can write a test program to determine the result, and compile and
-run it using @code{AC_TRY_RUN}. Avoid running test programs if
-possible, because using them prevents people from configuring your
-package for cross-compiling.
-
-@menu
-* Test Programs:: Running test programs.
-* Guidelines:: General rules for writing test programs.
-* Test Functions:: Avoiding pitfalls in test programs.
-@end menu
-
-@node Test Programs, Guidelines, , Run Time
-@subsection Running Test Programs
-
-Use the following macro if you need to test run-time behavior of the
-system while configuring.
-
-@defmac AC_TRY_RUN (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]})
-@maindex TRY_RUN
-@var{program} is the text of a C program, on which shell variable and
-backquote substitutions are performed. If it compiles and links
-successfully and returns an exit status of 0 when executed, run shell
-commands @var{action-if-true}. Otherwise run shell commands
-@var{action-if-false}; the exit status of the program is available in
-the shell variable @samp{$?}. This macro uses @code{CFLAGS} or
-@code{CXXFLAGS}, @code{CPPFLAGS}, @code{LDFLAGS}, and @code{LIBS} when
-compiling.
-
-If the C compiler being used does not produce executables that run on
-the system where @code{configure} is being run, then the test program is
-not run. If the optional shell commands @var{action-if-cross-compiling}
-are given, they are run instead and this macro calls @code{AC_C_CROSS}
-if it has not already been called. Otherwise, @code{configure} prints
-an error message and exits.
-@end defmac
-
-Try to provide a pessimistic default value to use when cross-compiling
-makes run-time tests impossible. You do this by passing the optional
-last argument to @code{AC_TRY_RUN}. @code{autoconf} prints a warning
-message when creating @code{configure} each time it encounters a call to
-@code{AC_TRY_RUN} with no @var{action-if-cross-compiling} argument
-given. You may ignore the warning, though users will not be able to
-configure your package for cross-compiling. A few of the macros
-distributed with Autoconf produce this warning message.
-
-To configure for cross-compiling you can also choose a value for those
-parameters based on the canonical system name (@pxref{Manual
-Configuration}). Alternatively, set up a test results cache file with
-the correct values for the target system (@pxref{Caching Results}).
-
-To provide a default for calls of @code{AC_TRY_RUN} that are embedded in
-other macros, including a few of the ones that come with Autoconf, you
-can call @code{AC_C_CROSS} before running them. Then, if the shell
-variable @code{cross_compiling} is set to @samp{yes}, use an alternate
-method to get the results instead of calling the macros.
-
-@defmac AC_C_CROSS
-@maindex C_CROSS
-If the C compiler being used does not produce executables that can run
-on the system where @code{configure} is being run, set the shell
-variable @code{cross_compiling} to @samp{yes}, otherwise @samp{no}.
-@end defmac
-
-@node Guidelines, Test Functions, Test Programs, Run Time
-@subsection Guidelines for Test Programs
-
-Test programs should not write anything to the standard output. They
-should return 0 if the test succeeds, nonzero otherwise, so that success
-can be distinguished easily from a core dump or other failure;
-segmentation violations and other failures produce a nonzero exit
-status. Test programs should @code{exit}, not @code{return}, from
-@code{main}, because on some systems (old Suns, at least) the argument
-to @code{return} in @code{main} is ignored.
-
-Test programs can use @code{#if} or @code{#ifdef} to check the values of
-preprocessor macros defined by tests that have already run. For
-example, if you call @code{AC_HEADER_STDC}, then later on in
-@file{configure.in} you can have a test program that includes an ANSI C
-header file conditionally:
-
-@example
-@group
-#if STDC_HEADERS
-# include <stdlib.h>
-#endif
-@end group
-@end example
-
-If a test program needs to use or create a data file, give it a name
-that starts with @file{conftest}, such as @file{conftestdata}. The
-@code{configure} script cleans up by running @samp{rm -rf conftest*}
-after running test programs and if the script is interrupted.
-
-@node Test Functions, , Guidelines, Run Time
-@subsection Test Functions
-
-Function declarations in test programs should have a prototype
-conditionalized for C++. In practice, though, test programs rarely need
-functions that take arguments.
-
-@example
-#ifdef __cplusplus
-foo(int i)
-#else
-foo(i) int i;
-#endif
-@end example
-
-Functions that test programs declare should also be conditionalized for
-C++, which requires @samp{extern "C"} prototypes. Make sure to not
-include any header files containing clashing prototypes.
-
-@example
-#ifdef __cplusplus
-extern "C" void *malloc(size_t);
-#else
-char *malloc();
-#endif
-@end example
-
-If a test program calls a function with invalid parameters (just to see
-whether it exists), organize the program to ensure that it never invokes
-that function. You can do this by calling it in another function that is
-never invoked. You can't do it by putting it after a call to
-@code{exit}, because GCC version 2 knows that @code{exit} never returns
-and optimizes out any code that follows it in the same block.
-
-If you include any header files, make sure to call the functions
-relevant to them with the correct number of arguments, even if they are
-just 0, to avoid compilation errors due to prototypes. GCC version 2
-has internal prototypes for several functions that it automatically
-inlines; for example, @code{memcpy}. To avoid errors when checking for
-them, either pass them the correct number of arguments or redeclare them
-with a different return type (such as @code{char}).
-
-@node Portable Shell, Testing Values and Files, Run Time, Writing Tests
-@section Portable Shell Programming
-
-When writing your own checks, there are some shell script programming
-techniques you should avoid in order to make your code portable. The
-Bourne shell and upward-compatible shells like Bash and the Korn shell
-have evolved over the years, but to prevent trouble, do not take
-advantage of features that were added after UNIX version 7, circa 1977.
-You should not use shell functions, aliases, negated character classes,
-or other features that are not found in all Bourne-compatible shells;
-restrict yourself to the lowest common denominator. Even @code{unset}
-is not supported by all shells!
-
-The set of external programs you should run in a @code{configure} script
-is fairly small. @xref{Utilities in Makefiles, , Utilities in
-Makefiles, standards.info, GNU Coding Standards}, for the list. This
-restriction allows users to start out with a fairly small set of
-programs and build the rest, avoiding too many interdependencies between
-packages.
-
-Some of these external utilities have a portable subset of features, as
-well; for example, don't rely on @code{ln} having a @samp{-f} option or
-@code{cat} having any options. @code{sed} scripts should not contain
-comments or use branch labels longer than 8 characters. Don't use
-@samp{grep -s} to suppress output, because @samp{grep -s} on System V
-does not suppress output, only error messages. Instead, redirect the
-standard output and standard error (in case the file doesn't exist) of
-@code{grep} to @file{/dev/null}. Check the exit status of @code{grep}
-to determine whether it found a match.
-
-@node Testing Values and Files, Multiple Cases, Portable Shell, Writing Tests
-@section Testing Values and Files
-
-@code{configure} scripts need to test properties of many files and
-strings. Here are some portability problems to watch out for when doing
-those tests.
-
-The @code{test} program is the way to perform many file and string
-tests. It is often invoked by the alternate name @samp{[}, but using
-that name in Autoconf code is asking for trouble since it is an
-@code{m4} quote character.
-
-If you need to make multiple checks using @code{test}, combine
-them with the shell operators @samp{&&} and @samp{||} instead of using
-the @code{test} operators @samp{-a} and @samp{-o}. On System V, the
-precedence of @samp{-a} and @samp{-o} is wrong relative to the unary
-operators; consequently, POSIX does not specify them, so using them is
-nonportable. If you combine @samp{&&} and @samp{||} in the same
-statement, keep in mind that they have equal precedence.
-
-To enable @code{configure} scripts to support cross-compilation, they
-shouldn't do anything that tests features of the host system instead of
-the target system. But occasionally you may find it necessary to check
-whether some arbitrary file exists. To do so, use @samp{test -f} or
-@samp{test -r}. Do not use @samp{test -x}, because 4.3BSD does not have
-it.
-
-Another nonportable shell programming construction is
-@example
-@var{var}=$@{@var{var}:-@var{value}@}
-@end example
-@noindent
-The intent is to set @var{var} to @var{value} only if it is not already
-set, but if @var{var} has any value, even the empty string, to leave it
-alone. Old BSD shells, including the Ultrix @code{sh}, don't accept
-the colon, and complain and die. A portable equivalent is
-@example
-: $@{@var{var}=@var{value}@}
-@end example
-
-@node Multiple Cases, Language Choice, Testing Values and Files, Writing Tests
-@section Multiple Cases
-
-Some operations are accomplished in several possible ways, depending on
-the UNIX variant. Checking for them essentially requires a ``case
-statement''. Autoconf does not directly provide one; however, it is
-easy to simulate by using a shell variable to keep track of whether a
-way to perform the operation has been found yet.
-
-Here is an example that uses the shell variable @code{fstype} to keep
-track of whether the remaining cases need to be checked.
-
-@example
-@group
-AC_MSG_CHECKING(how to get filesystem type)
-fstype=no
-# The order of these tests is important.
-AC_TRY_CPP([#include <sys/statvfs.h>
-#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
-if test $fstype = no; then
-AC_TRY_CPP([#include <sys/statfs.h>
-#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
-fi
-if test $fstype = no; then
-AC_TRY_CPP([#include <sys/statfs.h>
-#include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
-fi
-# (more cases omitted here)
-AC_MSG_RESULT($fstype)
-@end group
-@end example
-
-@node Language Choice, , Multiple Cases, Writing Tests
-@section Language Choice
-
-Packages that use both C and C++ need to test features of both
-compilers. Autoconf-generated @code{configure} scripts check for C
-features by default. The following macros determine which language's
-compiler is used in tests that follow in @file{configure.in}.
-
-@defmac AC_LANG_C
-@maindex LANG_C
-Do compilation tests using @code{CC} and @code{CPP} and use extension
-@file{.c} for test programs.
-@end defmac
-
-@defmac AC_LANG_CPLUSPLUS
-@maindex LANG_CPLUSPLUS
-Do compilation tests using @code{CXX} and @code{CXXCPP} and use
-extension @file{.C} for test programs.
-@end defmac
-
-@defmac AC_LANG_SAVE
-@maindex LANG_SAVE
-Remember the current language (as set by @code{AC_LANG_C} or
-@code{AC_LANG_CPLUSPLUS}) on a stack. Does not change which language is
-current. Use this macro and @code{AC_LANG_RESTORE} in macros that need
-to temporarily switch to a particular language.
-@end defmac
-
-@defmac AC_LANG_RESTORE
-@maindex LANG_RESTORE
-Select the language that is saved on the top of the stack, as set by
-@code{AC_LANG_SAVE}, and remove it from the stack. This macro is
-equivalent to either @code{AC_LANG_C} or @code{AC_LANG_CPLUSPLUS},
-whichever had been run most recently when @code{AC_LANG_SAVE} was last
-called.
-
-Do not call this macro more times than @code{AC_LANG_SAVE}.
-@end defmac
-
-@defmac AC_REQUIRE_CPP
-@maindex REQUIRE_CPP
-Ensure that whichever preprocessor would currently be used for tests has
-been found. Calls @code{AC_REQUIRE} (@pxref{Prerequisite Macros}) with an
-argument of either @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP},
-depending on which language is current.
-@end defmac
-
-@node Results, Writing Macros, Writing Tests, Top
-@chapter Results of Tests
-
-Once @code{configure} has determined whether a feature exists, what can
-it do to record that information? There are four sorts of things it can
-do: define a C preprocessor symbol, set a variable in the output files,
-save the result in a cache file for future @code{configure} runs, and
-print a message letting the user know the result of the test.
-
-@menu
-* Defining Symbols:: Defining C preprocessor symbols.
-* Setting Output Variables:: Replacing variables in output files.
-* Caching Results:: Speeding up subsequent @code{configure} runs.
-* Printing Messages:: Notifying users of progress or problems.
-@end menu
-
-@node Defining Symbols, Setting Output Variables, , Results
-@section Defining C Preprocessor Symbols
-
-A common action to take in response to a feature test is to define a C
-preprocessor symbol indicating the results of the test. That is done by
-calling @code{AC_DEFINE} or @code{AC_DEFINE_UNQUOTED}.
-
-By default, @code{AC_OUTPUT} places the symbols defined by these macros
-into the output variable @code{DEFS}, which contains an option
-@samp{-D@var{symbol}=@var{value}} for each symbol defined. Unlike in
-Autoconf version 1, there is no variable @code{DEFS} defined while
-@code{configure} is running. To check whether Autoconf macros have
-already defined a certain C preprocessor symbol, test the value of the
-appropriate cache variable, as in this example:
-
-@example
-AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
-if test "$ac_cv_func_vprintf" != yes; then
-AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
-fi
-@end example
-
-If @code{AC_CONFIG_HEADER} has been called, then instead of creating
-@code{DEFS}, @code{AC_OUTPUT} creates a header file by substituting the
-correct values into @code{#define} statements in a template file.
-@xref{Configuration Headers}, for more information about this kind of
-output.
-
-@defmac AC_DEFINE (@var{variable} @r{[}, @var{value}@r{]})
-@maindex DEFINE
-Define C preprocessor variable @var{variable}. If @var{value} is given,
-set @var{variable} to that value (verbatim), otherwise set it to 1.
-@var{value} should not contain literal newlines, and if you are not
-using @code{AC_CONFIG_HEADER} it should not contain any @samp{#}
-characters, as @code{make} tends to eat them. To use a shell variable
-(which you need to do in order to define a value containing the
-@code{m4} quote characters @samp{[} or @samp{]}), use
-@code{AC_DEFINE_UNQUOTED} instead. The following example defines the C
-preprocessor variable @code{EQUATION} to be the string constant
-@samp{"$a > $b"}:
-
-@example
-AC_DEFINE(EQUATION, "$a > $b")
-@end example
-@end defmac
-
-@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value}@r{]})
-@maindex DEFINE_UNQUOTED
-Like @code{AC_DEFINE}, but three shell expansions are
-performed---once---on @var{variable} and @var{value}: variable expansion
-(@samp{$}), command substitution (@samp{`}), and backslash escaping
-(@samp{\}). Single and double quote characters in the value have no
-special meaning. Use this macro instead of @code{AC_DEFINE} when
-@var{variable} or @var{value} is a shell variable. Examples:
-
-@example
-AC_DEFINE_UNQUOTED(config_machfile, "$@{machfile@}")
-AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
-AC_DEFINE_UNQUOTED($@{ac_tr_hdr@})
-@end example
-@end defmac
-
-Due to the syntactical bizarreness of the Bourne shell, do not use
-semicolons to separate @code{AC_DEFINE} or @code{AC_DEFINE_UNQUOTED}
-calls from other macro calls or shell code; that can cause syntax errors
-in the resulting @code{configure} script. Use either spaces or
-newlines. That is, do this:
-
-@example
-AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) LIBS="$LIBS -lelf")
-@end example
-
-@noindent
-or this:
-
-@example
-AC_CHECK_HEADER(elf.h,
- AC_DEFINE(SVR4)
- LIBS="$LIBS -lelf")
-@end example
-
-@noindent
-instead of this:
-
-@example
-AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf")
-@end example
-
-@node Setting Output Variables, Caching Results, Defining Symbols, Results
-@section Setting Output Variables
-
-One way to record the results of tests is to set @dfn{output variables},
-which are shell variables whose values are substituted into files that
-@code{configure} outputs. The two macros below create new output
-variables. @xref{Preset Output Variables}, for a list of output
-variables that are always available.
-
-@defmac AC_SUBST (@var{variable})
-@maindex SUBST
-Create an output variable from a shell variable. Make @code{AC_OUTPUT}
-substitute the variable @var{variable} into output files (typically one
-or more @file{Makefile}s). This means that @code{AC_OUTPUT} will
-replace instances of @samp{@@@var{variable}@@} in input files with the
-value that the shell variable @var{variable} has when @code{AC_OUTPUT}
-is called. The value of @var{variable} should not contain literal
-newlines.
-@end defmac
-
-@defmac AC_SUBST_FILE (@var{variable})
-@maindex SUBST_FILE
-Another way to create an output variable from a shell variable. Make
-@code{AC_OUTPUT} insert (without substitutions) the contents of the file
-named by shell variable @var{variable} into output files. This means
-that @code{AC_OUTPUT} will replace instances of
-@samp{@@@var{variable}@@} in output files (such as @file{Makefile.in})
-with the contents of the file that the shell variable @var{variable}
-names when @code{AC_OUTPUT} is called. Set the variable to
-@file{/dev/null} for cases that do not have a file to insert.
-
-This macro is useful for inserting @file{Makefile} fragments containing
-special dependencies or other @code{make} directives for particular host
-or target types into @file{Makefile}s. For example, @file{configure.in}
-could contain:
-
-@example
-AC_SUBST_FILE(host_frag)dnl
-host_frag=$srcdir/conf/sun4.mh
-@end example
-
-@noindent
-and then a @file{Makefile.in} could contain:
-
-@example
-@@host_frag@@
-@end example
-@end defmac
-
-@node Caching Results, Printing Messages, Setting Output Variables, Results
-@section Caching Results
-
-To avoid checking for the same features repeatedly in various
-@code{configure} scripts (or repeated runs of one script),
-@code{configure} saves the results of many of its checks in a @dfn{cache
-file}. If, when a @code{configure} script runs, it finds a cache file,
-it reads from it the results from previous runs and avoids rerunning
-those checks. As a result, @code{configure} can run much faster than if
-it had to perform all of the checks every time.
-
-@defmac AC_CACHE_VAL (@var{cache-id}, @var{commands-to-set-it})
-@maindex CACHE_VAL
-Ensure that the results of the check identified by @var{cache-id} are
-available. If the results of the check were in the cache file that was
-read, and @code{configure} was not given the @samp{--quiet} or
-@samp{--silent} option, print a message saying that the result was
-cached; otherwise, run the shell commands @var{commands-to-set-it}.
-Those commands should have no side effects except for setting the
-variable @var{cache-id}. In particular, they should not call
-@code{AC_DEFINE}; the code that follows the call to @code{AC_CACHE_VAL}
-should do that, based on the cached value. Also, they should not print
-any messages, for example with @code{AC_MSG_CHECKING}; do that before
-calling @code{AC_CACHE_VAL}, so the messages are printed regardless of
-whether the results of the check are retrieved from the cache or
-determined by running the shell commands. If the shell commands are run
-to determine the value, the value will be saved in the cache file just
-before @code{configure} creates its output files. @xref{Cache
-Variable Names}, for how to choose the name of the @var{cache-id} variable.
-@end defmac
-
-@menu
-* Cache Variable Names:: Shell variables used in caches.
-* Cache Files:: Files @code{configure} uses for caching.
-@end menu
-
-@node Cache Variable Names, Cache Files, , Caching Results
-@subsection Cache Variable Names
-
-The names of cache variables should have the following format:
-
-@example
-@var{package-prefix}_cv_@var{value-type}_@var{specific-value}@r{[}_@var{additional-options}@r{]}
-@end example
-
-@noindent
-for example, @samp{ac_cv_header_stat_broken} or
-@samp{ac_cv_prog_gcc_traditional}. The parts of the variable name are:
-
-@table @asis
-@item @var{package-prefix}
-An abbreviation for your package or organization; the same prefix you
-begin local Autoconf macros with, except lowercase by convention.
-For cache values used by the distributed Autoconf macros, this value is
-@samp{ac}.
-
-@item @code{_cv_}
-Indicates that this shell variable is a cache value.
-
-@item @var{value-type}
-A convention for classifying cache values, to produce a rational naming
-system. The values used in Autoconf are listed in @ref{Macro Names}.
-
-@item @var{specific-value}
-Which member of the class of cache values this test applies to.
-For example, which function (@samp{alloca}), program (@samp{gcc}), or
-output variable (@samp{INSTALL}).
-
-@item @var{additional-options}
-Any particular behavior of the specific member that this test applies to.
-For example, @samp{broken} or @samp{set}. This part of the name may
-be omitted if it does not apply.
-@end table
-
-Like their names, the values that may be assigned to cache variables
-have a few restrictions. The values may not contain single quotes or
-curly braces. Usually, their values will be boolean (@samp{yes} or
-@samp{no}) or the names of files or functions; so this is not an
-important restriction.
-
-@node Cache Files, , Cache Variable Names, Caching Results
-@subsection Cache Files
-
-A cache file is a shell script that caches the results of configure
-tests run on one system so they can be shared between configure scripts
-and configure runs. It is not useful on other systems. If its contents
-are invalid for some reason, the user may delete or edit it.
-
-By default, configure uses @file{./config.cache} as the cache file,
-creating it if it does not exist already. @code{configure} accepts the
-@samp{--cache-file=@var{file}} option to use a different cache file;
-that is what @code{configure} does when it calls @code{configure}
-scripts in subdirectories, so they share the cache. Giving
-@samp{--cache-file=/dev/null} disables caching, for debugging
-@code{configure}. @xref{Subdirectories}, for information on configuring
-subdirectories with the @code{AC_CONFIG_SUBDIRS} macro.
-@file{config.status} only pays attention to the cache file if it is
-given the @samp{--recheck} option, which makes it rerun
-@code{configure}.
-
-It is wrong to try to distribute cache files for particular system types.
-There is too much room for error in doing that, and too much
-administrative overhead in maintaining them. For any features that
-can't be guessed automatically, use the standard method of the canonical
-system type and linking files (@pxref{Manual Configuration}).
-
-The cache file on a particular system will gradually accumulate whenever
-someone runs a @code{configure} script; it will be initially
-nonexistent. Running @code{configure} merges the new cache results with
-the existing cache file. The site initialization script can specify a
-site-wide cache file to use instead of the default, to make it work
-transparently, as long as the same C compiler is used every time
-(@pxref{Site Defaults}).
-
-@node Printing Messages, , Caching Results, Results
-@section Printing Messages
-
-@code{configure} scripts need to give users running them several kinds
-of information. The following macros print messages in ways appropriate
-for each kind. The arguments to all of them get enclosed in shell
-double quotes, so the shell performs variable and backquote substitution
-on them.
-
-These macros are all wrappers around the @code{echo} shell command.
-@code{configure} scripts should rarely need to run @code{echo} directly
-to print messages for the user. Using these macros makes it easy to
-change how and when each kind of message is printed; such changes need
-only be made to the macro definitions, and all of the callers change
-automatically.
-
-@defmac AC_MSG_CHECKING (@var{feature-description})
-@maindex MSG_CHECKING
-Notify the user that @code{configure} is checking for a particular
-feature. This macro prints a message that starts with @samp{checking }
-and ends with @samp{...} and no newline. It must be followed by a call
-to @code{AC_MSG_RESULT} to print the result of the check and the
-newline. The @var{feature-description} should be something like
-@samp{whether the Fortran compiler accepts C++ comments} or @samp{for
-c89}.
-
-This macro prints nothing if @code{configure} is run with the
-@samp{--quiet} or @samp{--silent} option.
-@end defmac
-
-@defmac AC_MSG_RESULT (@var{result-description})
-@maindex MSG_RESULT
-Notify the user of the results of a check. @var{result-description} is
-almost always the value of the cache variable for the check, typically
-@samp{yes}, @samp{no}, or a file name. This macro should follow a call
-to @code{AC_MSG_CHECKING}, and the @var{result-description} should be
-the completion of the message printed by the call to
-@code{AC_MSG_CHECKING}.
-
-This macro prints nothing if @code{configure} is run with the
-@samp{--quiet} or @samp{--silent} option.
-@end defmac
-
-@defmac AC_MSG_ERROR (@var{error-description})
-@maindex MSG_ERROR
-Notify the user of an error that prevents @code{configure} from
-completing. This macro prints an error message on the standard error
-stream and exits @code{configure} with a nonzero status.
-@var{error-description} should be something like @samp{invalid value
-$HOME for \$HOME}.
-@end defmac
-
-@defmac AC_MSG_WARN (@var{problem-description})
-@maindex MSG_WARN
-Notify the @code{configure} user of a possible problem. This macro
-prints the message on the standard error stream; @code{configure}
-continues running afterward, so macros that call @code{AC_MSG_WARN} should
-provide a default (back-up) behavior for the situations they warn about.
-@var{problem-description} should be something like @samp{ln -s seems to
-make hard links}.
-@end defmac
-
-The following two macros are an obsolete alternative to
-@code{AC_MSG_CHECKING} and @code{AC_MSG_RESULT}.
-
-@defmac AC_CHECKING (@var{feature-description})
-@maindex CHECKING
-This macro is similar to @code{AC_MSG_CHECKING}, except that it prints a
-newline after the @var{feature-description}. It is useful mainly to
-print a general description of the overall purpose of a group of feature
-checks, e.g.,
-
-@example
-AC_CHECKING(if stack overflow is detectable)
-@end example
-@end defmac
-
-@defmac AC_VERBOSE (@var{result-description})
-@maindex VERBOSE
-This macro is similar to @code{AC_MSG_RESULT}, except that it is meant
-to follow a call to @code{AC_CHECKING} instead of
-@code{AC_MSG_CHECKING}; it starts the message it prints with a tab. It
-is considered obsolete.
-@end defmac
-
-@node Writing Macros, Manual Configuration, Results, Top
-@chapter Writing Macros
-
-When you write a feature test that could be applicable to more than one
-software package, the best thing to do is encapsulate it in a new macro.
-Here are some instructions and guidelines for writing Autoconf macros.
-
-@menu
-* Macro Definitions:: Basic format of an Autoconf macro.
-* Macro Names:: What to call your new macros.
-* Quoting:: Protecting macros from unwanted expansion.
-* Dependencies Between Macros:: What to do when macros depend on other macros.
-@end menu
-
-@node Macro Definitions, Macro Names, , Writing Macros
-@section Macro Definitions
-
-@maindex DEFUN
-Autoconf macros are defined using the @code{AC_DEFUN} macro, which is
-similar to the @code{m4} builtin @code{define} macro. In addition to
-defining a macro, @code{AC_DEFUN} adds to it some code which is used to
-constrain the order in which macros are called (@pxref{Prerequisite
-Macros}).
-
-An Autoconf macro definition looks like this:
-
-@example
-AC_DEFUN(@var{macro-name}, [@var{macro-body}])
-@end example
-
-@noindent
-The square brackets here do not indicate optional text: they should
-literally be present in the macro definition to avoid macro expansion
-problems (@pxref{Quoting}). You can refer to any arguments passed to
-the macro as @samp{$1}, @samp{$2}, etc.
-
-To introduce comments in @code{m4}, use the @code{m4} builtin
-@code{dnl}; it causes @code{m4} to discard the text through the next
-newline. It is not needed between macro definitions in @file{acsite.m4}
-and @file{aclocal.m4}, because all output is discarded until
-@code{AC_INIT} is called.
-
-@xref{Definitions, , How to define new macros, m4.info, GNU m4}, for
-more complete information on writing @code{m4} macros.
-
-@node Macro Names, Quoting, Macro Definitions, Writing Macros
-@section Macro Names
-
-All of the Autoconf macros have all-uppercase names starting with
-@samp{AC_} to prevent them from accidentally conflicting with other
-text. All shell variables that they use for internal purposes have
-mostly-lowercase names starting with @samp{ac_}. To ensure that your
-macros don't conflict with present or future Autoconf macros, you should
-prefix your own macro names and any shell variables they use with some
-other sequence. Possibilities include your initials, or an abbreviation
-for the name of your organization or software package.
-
-Most of the Autoconf macros' names follow a structured naming convention
-that indicates the kind of feature check by the name. The macro names
-consist of several words, separated by underscores, going from most
-general to most specific. The names of their cache variables use the
-same convention (@pxref{Cache Variable Names}, for more information on them).
-
-The first word of the name after @samp{AC_} usually tells the category
-of feature being tested. Here are the categories used in Autoconf for
-specific test macros, the kind of macro that you are more likely to
-write. They are also used for cache variables, in all-lowercase. Use
-them where applicable; where they're not, invent your own categories.
-
-@table @code
-@item C
-C language builtin features.
-@item DECL
-Declarations of C variables in header files.
-@item FUNC
-Functions in libraries.
-@item GROUP
-UNIX group owners of files.
-@item HEADER
-Header files.
-@item LIB
-C libraries.
-@item PATH
-The full path names to files, including programs.
-@item PROG
-The base names of programs.
-@item STRUCT
-Definitions of C structures in header files.
-@item SYS
-Operating system features.
-@item TYPE
-C builtin or declared types.
-@item VAR
-C variables in libraries.
-@end table
-
-After the category comes the name of the particular feature being
-tested. Any further words in the macro name indicate particular aspects
-of the feature. For example, @code{AC_FUNC_UTIME_NULL} checks the
-behavior of the @code{utime} function when called with a @code{NULL}
-pointer.
-
-A macro that is an internal subroutine of another macro should have a
-name that starts with the name of that other macro, followed by one or
-more words saying what the internal macro does. For example,
-@code{AC_PATH_X} has internal macros @code{AC_PATH_X_XMKMF} and
-@code{AC_PATH_X_DIRECT}.
-
-@node Quoting, Dependencies Between Macros, Macro Names, Writing Macros
-@section Quoting
-
-Macros that are called by other macros are evaluated by @code{m4}
-several times; each evaluation might require another layer of quotes to
-prevent unwanted expansions of macros or @code{m4} builtins, such as
-@samp{define} and @samp{$1}. Quotes are also required around macro
-arguments that contain commas, since commas separate the arguments from
-each other. It's a good idea to quote any macro arguments that contain
-newlines or calls to other macros, as well.
-
-Autoconf changes the @code{m4} quote characters
-from the default @samp{`} and @samp{'} to @samp{[} and @samp{]}, because
-many of the macros use @samp{`} and @samp{'}, mismatched. However, in a
-few places the macros need to use brackets (usually in C program text or
-regular expressions). In those places, they use the @code{m4} builtin
-command @code{changequote} to temporarily change the quote characters to
-@samp{<<} and @samp{>>}. (Sometimes, if they don't need to quote
-anything, they disable quoting entirely instead by setting the quote
-characters to empty strings.) Here is an example:
-
-@example
-AC_TRY_LINK(
-changequote(<<, >>)dnl
-<<#include <time.h>
-#ifndef tzname /* For SGI. */
-extern char *tzname[]; /* RS6000 and others reject char **tzname. */
-#endif>>,
-changequote([, ])dnl
-[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)
-@end example
-
-When you create a @code{configure} script using newly written macros,
-examine it carefully to check whether you need to add more quotes in
-your macros. If one or more words have disappeared in the @code{m4}
-output, you need more quotes. When in doubt, quote.
-
-However, it's also possible to put on too many layers of quotes. If
-this happens, the resulting @code{configure} script will contain
-unexpanded macros. The @code{autoconf} program checks for this problem
-by doing @samp{grep AC_ configure}.
-
-@node Dependencies Between Macros, , Quoting, Writing Macros
-@section Dependencies Between Macros
-
-Some Autoconf macros depend on other macros having been called first in
-order to work correctly. Autoconf provides a way to ensure that certain
-macros are called if needed and a way to warn the user if macros are
-called in an order that might cause incorrect operation.
-
-@menu
-* Prerequisite Macros:: Ensuring required information.
-* Suggested Ordering:: Warning about possible ordering problems.
-* Obsolete Macros:: Warning about old ways of doing things.
-@end menu
-
-@node Prerequisite Macros, Suggested Ordering, , Dependencies Between Macros
-@subsection Prerequisite Macros
-
-A macro that you write might need to use values that have previously
-been computed by other macros. For example, @code{AC_DECL_YYTEXT}
-examines the output of @code{flex} or @code{lex}, so it depends on
-@code{AC_PROG_LEX} having been called first to set the shell variable
-@code{LEX}.
-
-Rather than forcing the user of the macros to keep track of the
-dependencies between them, you can use the @code{AC_REQUIRE} macro to do
-it automatically. @code{AC_REQUIRE} can ensure that a macro is only
-called if it is needed, and only called once.
-
-@defmac AC_REQUIRE (@var{macro-name})
-@maindex REQUIRE
-If the @code{m4} macro @var{macro-name} has not already been called,
-call it (without any arguments). Make sure to quote @var{macro-name}
-with square brackets. @var{macro-name} must have been defined using
-@code{AC_DEFUN} or else contain a call to @code{AC_PROVIDE} to indicate
-that it has been called.
-@end defmac
-
-An alternative to using @code{AC_DEFUN} is to use @code{define} and call
-@code{AC_PROVIDE}. Because this technique does not prevent nested
-messages, it is considered obsolete.
-
-@defmac AC_PROVIDE (@var{this-macro-name})
-@maindex PROVIDE
-Record the fact that @var{this-macro-name} has been called.
-@var{this-macro-name} should be the name of the macro that is calling
-@code{AC_PROVIDE}. An easy way to get it is from the @code{m4} builtin
-variable @code{$0}, like this:
-
-@example
-AC_PROVIDE([$0])
-@end example
-@end defmac
-
-@node Suggested Ordering, Obsolete Macros, Prerequisite Macros, Dependencies Between Macros
-@subsection Suggested Ordering
-
-Some macros should be run before another macro if both are called, but
-neither @emph{requires} that the other be called. For example, a macro
-that changes the behavior of the C compiler should be called before any
-macros that run the C compiler. Many of these dependencies are noted in
-the documentation.
-
-Autoconf provides the @code{AC_BEFORE} macro to warn users when macros
-with this kind of dependency appear out of order in a
-@file{configure.in} file. The warning occurs when creating
-@code{configure} from @file{configure.in}, not when running
-@code{configure}.
-For example, @code{AC_PROG_CPP} checks whether the C compiler
-can run the C preprocessor when given the @samp{-E} option. It should
-therefore be called after any macros that change which C compiler is
-being used, such as @code{AC_PROG_CC}. So @code{AC_PROG_CC} contains:
-
-@example
-AC_BEFORE([$0], [AC_PROG_CPP])dnl
-@end example
-
-@noindent
-This warns the user if a call to @code{AC_PROG_CPP} has already occurred
-when @code{AC_PROG_CC} is called.
-
-@defmac AC_BEFORE (@var{this-macro-name}, @var{called-macro-name})
-@maindex BEFORE
-Make @code{m4} print a warning message on the standard error output if
-@var{called-macro-name} has already been called. @var{this-macro-name}
-should be the name of the macro that is calling @code{AC_BEFORE}. The
-macro @var{called-macro-name} must have been defined using
-@code{AC_DEFUN} or else contain a call to @code{AC_PROVIDE} to indicate
-that it has been called.
-@end defmac
-
-@node Obsolete Macros, , Suggested Ordering, Dependencies Between Macros
-@subsection Obsolete Macros
-
-Configuration and portability technology has evolved over the years.
-Often better ways of solving a particular problem are developed, or
-ad-hoc approaches are systematized. This process has occurred in many
-parts of Autoconf. One result is that some of the macros are now
-considered @dfn{obsolete}; they still work, but are no longer considered
-the best thing to do. Autoconf provides the @code{AC_OBSOLETE} macro to
-warn users producing @code{configure} scripts when they use obsolete
-macros, to encourage them to modernize. A sample call is:
-
-@example
-AC_OBSOLETE([$0], [; use AC_CHECK_HEADERS(unistd.h) instead])dnl
-@end example
-
-@defmac AC_OBSOLETE (@var{this-macro-name} @r{[}, @var{suggestion}@r{]})
-@maindex OBSOLETE
-Make @code{m4} print a message on the standard error output warning that
-@var{this-macro-name} is obsolete, and giving the file and line number
-where it was called. @var{this-macro-name} should be the name of the
-macro that is calling @code{AC_OBSOLETE}. If @var{suggestion} is given,
-it is printed at the end of the warning message; for example, it can be
-a suggestion for what to use instead of @var{this-macro-name}.
-@end defmac
-
-@node Manual Configuration, Site Configuration, Writing Macros, Top
-@chapter Manual Configuration
-
-A few kinds of features can't be guessed automatically by running test
-programs. For example, the details of the object file format, or
-special options that need to be passed to the compiler or linker. It is
-possible to check for such features using ad-hoc means, such as having
-@code{configure} check the output of the @code{uname} program, or
-looking for libraries that are unique to particular systems. However,
-Autoconf provides a uniform method for handling unguessable features.
-
-@menu
-* Specifying Names:: Specifying the system type.
-* Canonicalizing:: Getting the canonical system type.
-* System Type Variables:: Variables containing the system type.
-* Using System Type:: What to do with the system type.
-@end menu
-
-@node Specifying Names, Canonicalizing, , Manual Configuration
-@section Specifying the System Type
-
-Like other GNU @code{configure} scripts, Autoconf-generated
-@code{configure} scripts can make decisions based on a canonical name
-for the system type, which has the form:
-
-@example
-@var{cpu}-@var{company}-@var{system}
-@end example
-
-@code{configure} can usually guess the canonical name for the type of
-system it's running on. To do so it runs a script called
-@code{config.guess}, which derives the name using the @code{uname}
-command or symbols predefined by the C preprocessor.
-
-Alternately, the user can specify the system type with command line
-arguments to @code{configure}. Doing so is necessary when
-cross-compiling. In the most complex case of cross-compiling, three
-system types are involved. The options to specify them are:
-
-@table @code
-@item --build=@var{build-type}
-the type of system on which the package is being configured and
-compiled (rarely needed);
-
-@item --host=@var{host-type}
-the type of system on which the package will run;
-
-@item --target=@var{target-type}
-the type of system for which any compiler tools in the package will
-produce code.
-@end table
-
-@noindent
-If the user gives @code{configure} a non-option argument, it is used as
-the default for the host, target, and build system types if the user
-does not specify them explicitly with options. The target and build
-types default to the host type if it is given and they are not. If you
-are cross-compiling, you still have to specify the names of the
-cross-tools you use, in particular the C compiler, on the
-@code{configure} command line, e.g.,
-
-@example
-CC=m68k-coff-gcc configure --target=m68k-coff
-@end example
-
-@code{configure} recognizes short aliases for many system types; for
-example, @samp{decstation} can be given on the command line instead of
-@samp{mips-dec-ultrix4.2}. @code{configure} runs a script called
-@code{config.sub} to canonicalize system type aliases.
-
-@node Canonicalizing, System Type Variables, Specifying Names, Manual Configuration
-@section Getting the Canonical System Type
-
-The following macros make the system type available to @code{configure}
-scripts. They run the shell script @code{config.guess} to determine any
-values for the host, target, and build types that they need and the user
-did not specify on the command line. They run @code{config.sub} to
-canonicalize any aliases the user gave. If you use these macros, you
-must distribute those two shell scripts along with your source code.
-@xref{Output}, for information about the @code{AC_CONFIG_AUX_DIR} macro
-which you can use to control which directory @code{configure} looks for
-those scripts in. If you do not use either of these macros,
-@code{configure} ignores any @samp{--host}, @samp{--target}, and
-@samp{--build} options given to it.
-
-@defmac AC_CANONICAL_SYSTEM
-@maindex CANONICAL_SYSTEM
-Determine the system type and set output variables to the names of the
-canonical system types. @xref{System Type Variables}, for details about
-the variables this macro sets.
-@end defmac
-
-@defmac AC_CANONICAL_HOST
-@maindex CANONICAL_HOST
-Perform only the subset of @code{AC_CANONICAL_SYSTEM} relevant to the
-host type. This is all that is needed for programs that are not part of
-a compiler toolchain.
-@end defmac
-
-@node System Type Variables, Using System Type, Canonicalizing, Manual Configuration
-@section System Type Variables
-
-After calling @code{AC_CANONICAL_SYSTEM}, the following output variables
-contain the system type information. After @code{AC_CANONICAL_HOST},
-only the @code{host} variables below are set.
-
-@table @code
-@ovindex build
-@ovindex host
-@ovindex target
-@item @code{build}, @code{host}, @code{target}
-the canonical system names;
-
-@item @code{build_alias}, @code{host_alias}, @code{target_alias}
-@ovindex build_alias
-@ovindex host_alias
-@ovindex target_alias
-the names the user specified, or the canonical names if
-@code{config.guess} was used;
-
-@item @code{build_cpu}, @code{build_vendor}, @code{build_os}
-@itemx @code{host_cpu}, @code{host_vendor}, @code{host_os}
-@itemx @code{target_cpu}, @code{target_vendor}, @code{target_os}
-@ovindex build_cpu
-@ovindex host_cpu
-@ovindex target_cpu
-@ovindex build_vendor
-@ovindex host_vendor
-@ovindex target_vendor
-@ovindex build_os
-@ovindex host_os
-@ovindex target_os
-the individual parts of the canonical names (for convenience).
-@end table
-
-@node Using System Type, , System Type Variables, Manual Configuration
-@section Using the System Type
-
-How do you use a canonical system type? Usually, you use it in one or
-more @code{case} statements in @file{configure.in} to select
-system-specific C files. Then link those files, which have names based
-on the system name, to generic names, such as @file{host.h} or
-@file{target.c}. The @code{case} statement patterns can use shell
-wildcards to group several cases together, like in this fragment:
-
-@example
-case "$target" in
-i386-*-mach* | i386-*-gnu*) obj_format=aout emulation=mach bfd_gas=yes ;;
-i960-*-bout) obj_format=bout ;;
-esac
-@end example
-
-@defmac AC_LINK_FILES (@var{source}@dots{}, @var{dest}@dots{})
-@maindex LINK_FILES
-Make @code{AC_OUTPUT} link each of the existing files @var{source} to
-the corresponding link name @var{dest}. Makes a symbolic link if
-possible, otherwise a hard link. The @var{dest} and @var{source} names
-should be relative to the top level source or build directory.
-
-For example, this call:
-
-@example
-AC_LINK_FILES(config/$@{machine@}.h config/$@{obj_format@}.h, host.h object.h)
-@end example
-
-@noindent
-creates in the current directory @file{host.h}, which is a link to
-@file{@var{srcdir}/config/$@{machine@}.h}, and @file{object.h}, which is a link
-to @file{@var{srcdir}/config/$@{obj_format@}.h}.
-@end defmac
-
-@node Site Configuration, Invoking configure, Manual Configuration, Top
-@chapter Site Configuration
-
-@code{configure} scripts support several kinds of local configuration
-decisions. There are ways for users to specify where external software
-packages are, include or exclude optional features, install programs
-under modified names, and set default values for @code{configure}
-options.
-
-@menu
-* External Software:: Working with other optional software.
-* Package Options:: Selecting optional features.
-* Site Details:: Configuring site details.
-* Transforming Names:: Changing program names when installing.
-* Site Defaults:: Giving @code{configure} local defaults.
-@end menu
-
-@node External Software, Package Options, , Site Configuration
-@section Working With External Software
-
-Some packages require, or can optionally use, other software packages
-which are already installed. The user can give @code{configure}
-command line options to specify which such external software to use.
-The options have one of these forms:
-
-@example
---with-@var{package}@r{[}=@var{arg}@r{]}
---without-@var{package}
-@end example
-
-For example, @samp{--with-gnu-ld} means work with the GNU linker instead
-of some other linker. @samp{--with-x11} means work with X11.
-
-The user can give an argument by following the package name with
-@samp{=} and the argument. Giving an argument of @samp{no} is for
-packages that are used by default; it says to @emph{not} use the
-package. An argument that is neither @samp{yes} nor @samp{no} could
-include a name or number of a version of the other package, to specify
-more precisely which other package this program is supposed to work
-with. If no argument is given, it defaults to @samp{yes}.
-@samp{--without-@var{package}} is equivalent to
-@samp{--with-@var{package}=no}.
-
-For each external software package that may be used, @file{configure.in}
-should call @code{AC_ARG_WITH} to detect whether the @code{configure}
-user asked to use it. Whether each package is used or not by
-default, and which arguments are valid, is up to you.
-
-@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex ARG_WITH
-If the user gave @code{configure} the option @samp{--with-@var{package}}
-or @samp{--without-@var{package}}, run shell commands
-@var{action-if-true}. Otherwise run shell commands
-@var{action-if-false}. The name @var{package} indicates another
-software package that this program should work with. It should consist
-only of alphanumeric characters and dashes.
-
-The option's argument is available to the shell commands
-@var{action-if-true} in the shell variable @code{withval}.
-
-The argument @var{help-string} is a description of the option which
-looks like this:
-@example
- --with-readline support fancy command line editing
-@end example
-@noindent
-@var{help-string} may be more than one line long, if more detail is
-needed. Just make sure the columns line up in @samp{configure --help}.
-Avoid tabs in the help string. You'll need to enclose it in @samp{[}
-and @samp{]} in order to produce the leading spaces.
-@end defmac
-
-@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex WITH
-This is an obsolete version of @code{AC_ARG_WITH} that does not
-support providing a help string.
-@end defmac
-
-@node Package Options, Site Details, External Software, Site Configuration
-@section Choosing Package Options
-
-If a software package has optional compile-time features, the user can
-give @code{configure} command line options to specify whether to
-compile them. The options have one of these forms:
-
-@example
---enable-@var{feature}@r{[}=@var{arg}@r{]}
---disable-@var{feature}
-@end example
-
-These options allow users to choose which optional features to build and
-install. @samp{--enable-@var{feature}} options should never make a
-feature behave differently or cause one feature to replace another.
-They should only cause parts of the program to be built rather than left
-out.
-
-The user can give an argument by following the feature name with
-@samp{=} and the argument. Giving an argument of @samp{no} requests
-that the feature @emph{not} be made available. A feature with an
-argument looks like @samp{--enable-debug=stabs}. If no argument is
-given, it defaults to @samp{yes}. @samp{--disable-@var{feature}} is
-equivalent to @samp{--enable-@var{feature}=no}.
-
-For each optional feature, @file{configure.in} should call
-@code{AC_ARG_ENABLE} to detect whether the @code{configure} user asked
-to include it. Whether each feature is included or not by default, and
-which arguments are valid, is up to you.
-
-@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex ARG_ENABLE
-If the user gave @code{configure} the option
-@samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run
-shell commands @var{action-if-true}. Otherwise run shell commands
-@var{action-if-false}. The name @var{feature} indicates an optional
-user-level facility. It should consist only of alphanumeric characters
-and dashes.
-
-The option's argument is available to the shell commands
-@var{action-if-true} in the shell variable @code{enableval}.
-The @var{help-string} argument is like that of @code{AC_ARG_WITH}
-(@pxref{External Software}).
-@end defmac
-
-@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex ENABLE
-This is an obsolete version of @code{AC_ARG_ENABLE} that does not
-support providing a help string.
-@end defmac
-
-@node Site Details, Transforming Names, Package Options, Site Configuration
-@section Configuring Site Details
-
-Some software packages require complex site-specific information. Some
-examples are host names to use for certain services, company names, and
-email addresses to contact. Since some configuration scripts generated
-by Metaconfig ask for such information interactively, people sometimes
-wonder how to get that information in Autoconf-generated configuration
-scripts, which aren't interactive.
-
-Such site configuration information should be put in a file that is
-edited @emph{only by users}, not by programs. The location of the file
-can either be based on the @code{prefix} variable, or be a standard
-location such as the user's home directory. It could even be specified
-by an environment variable. The programs should examine that file at
-run time, rather than at compile time. That approach is more convenient
-for users and makes the configuration process simpler than getting the
-information while configuring. @xref{Directory Variables, , Variables
-for Installation Directories, standards, GNU Coding Standards}, for more
-information on where to put data files.
-
-@node Transforming Names, Site Defaults, Site Details, Site Configuration
-@section Transforming Program Names When Installing
-
-Autoconf supports changing the names of programs when installing them.
-In order to use these transformations, @file{configure.in} must call the
-macro @code{AC_ARG_PROGRAM}.
-
-@defmac AC_ARG_PROGRAM
-@maindex ARG_PROGRAM
-@ovindex program_transform_name
-Place in output variable @code{program_transform_name} a sequence of
-@code{sed} commands for changing the names of installed programs.
-
-If any of the options described below are given to @code{configure},
-program names are transformed accordingly. Otherwise, if
-@code{AC_CANONICAL_SYSTEM} has been called and a @samp{--target} value
-is given that differs from the host type (specified with @samp{--host}
-or defaulted by @code{config.sub}), the target type followed by a dash
-is used as a prefix. Otherwise, no program name transformation is done.
-@end defmac
-
-@menu
-* Transformation Options:: @code{configure} options to transforme names.
-* Transformation Examples:: Sample uses of transforming names.
-* Transformation Rules:: @file{Makefile} uses of transforming names.
-@end menu
-
-@node Transformation Options, Transformation Examples, , Transforming Names
-@subsection Transformation Options
-
-You can specify name transformations by giving @code{configure} these
-command line options:
-
-@table @code
-@item --program-prefix=@var{prefix}
-prepend @var{prefix} to the names;
-
-@item --program-suffix=@var{suffix}
-append @var{suffix} to the names;
-
-@item --program-transform-name=@var{expression}
-perform @code{sed} substitution @var{expression} on the names.
-@end table
-
-@node Transformation Examples, Transformation Rules, Transformation Options, Transforming Names
-@subsection Transformation Examples
-
-These transformations are useful with programs that can be part of a
-cross-compilation development environment. For example, a
-cross-assembler running on a Sun 4 configured with
-@samp{--target=i960-vxworks} is normally installed as
-@file{i960-vxworks-as}, rather than @file{as}, which could be confused
-with a native Sun 4 assembler.
-
-You can force a program name to begin with @file{g}, if you don't want
-GNU programs installed on your system to shadow other programs with the
-same name. For example, if you configure GNU @code{diff} with
-@samp{--program-prefix=g}, then when you run @samp{make install} it is
-installed as @file{/usr/local/bin/gdiff}.
-
-As a more sophistocated example, you could use
-@example
---program-transform-name='s/^/g/; s/^gg/g/; s/^gless/less/'
-@end example
-@noindent
-to prepend @samp{g} to most of the program names in a source tree,
-excepting those like @code{gdb} that already have one and those like
-@code{less} and @code{lesskey} that aren't GNU programs. (That is
-assuming that you have a source tree containing those programs that is
-set up to use this feature.)
-
-One way to install multiple versions of some programs simultaneously is
-to append a version number to the name of one or both. For example, if
-you want to keep Autoconf version 1 around for awhile, you can configure
-Autoconf version 2 using @samp{--program-suffix=2} to install the
-programs as @file{/usr/local/bin/autoconf2},
-@file{/usr/local/bin/autoheader2}, etc.
-
-@node Transformation Rules, , Transformation Examples, Transforming Names
-@subsection Transformation Rules
-
-Here is how to use the variable @code{program_transform_name} in a
-@file{Makefile.in}:
-
-@example
-transform=@@program_transform_name@@
-install: all
- $(INSTALL_PROGRAM) myprog $(bindir)/`echo myprog|sed '$(transform)'`
-
-uninstall:
- rm -f $(bindir)/`echo myprog|sed '$(transform)'`
-@end example
-
-@noindent
-If you have more than one program to install, you can do it in a loop:
-
-@example
-PROGRAMS=cp ls rm
-install:
- for p in $(PROGRAMS); do \
- $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
-
-uninstall:
- for p in $(PROGRAMS); do \
- rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
- done
-@end example
-
-Whether to do the transformations on documentation files (Texinfo or
-@code{man}) is a tricky question; there seems to be no perfect answer,
-due to the several reasons for name transforming. Documentation is not
-usually particular to a specific architecture, and Texinfo files do not
-conflict with system documentation. But they might conflict with
-earlier versions of the same files, and @code{man} pages sometimes do
-conflict with system documentation. As a compromise, it is probably
-best to do name transformations on @code{man} pages but not on Texinfo
-manuals.
-
-@node Site Defaults, , Transforming Names, Site Configuration
-@section Setting Site Defaults
-
-Autoconf-generated @code{configure} scripts allow your site to provide
-default values for some configuration values. You do this by creating
-site- and system-wide initialization files.
-
-@evindex CONFIG_SITE
-If the environment variable @code{CONFIG_SITE} is set, @code{configure}
-uses its value as the name of a shell script to read. Otherwise, it
-reads the shell script @file{@var{prefix}/share/config.site} if it exists,
-then @file{@var{prefix}/etc/config.site} if it exists. Thus,
-settings in machine-specific files override those in machine-independent
-ones in case of conflict.
-
-Site files can be arbitrary shell scripts, but only certain kinds of
-code are really appropriate to be in them. Because @code{configure}
-reads any cache file after it has read any site files, a site file can
-define a default cache file to be shared between all Autoconf-generated
-@code{configure} scripts run on that system. If you set a default cache
-file in a site file, it is a good idea to also set the output variable
-@code{CC} in that site file, because the cache file is only valid for a
-particular compiler, but many systems have several available.
-
-Site files are also good places to set default values for other output
-variables, such as @code{CFLAGS}, if you need to give them non-default
-values: anything you would normally do, repetitively, on the command
-line. If you use non-default values for @var{prefix} or
-@var{exec_prefix} (wherever you locate the site file), you can set them
-in the site file if you specify it with the @code{CONFIG_SITE}
-environment variable.
-
-You can set some cache values in the site file itself. Doing this is
-useful if you are cross-compiling, so it is impossible to check features
-that require running a test program. You could ``prime the cache'' by
-setting those values correctly for that system in
-@file{@var{prefix}/etc/config.site}. To find out the names of the cache
-variables you need to set, look for shell variables with @samp{_cv_} in
-their names in the affected @code{configure} scripts, or in the Autoconf
-@code{m4} source code for those macros.
-
-The cache file is careful to not override any variables set in the site
-files. Similarly, you should not override command-line options in the
-site files. Your code should check that variables such as @code{prefix}
-and @code{cache_file} have their default values (as set near the top of
-@code{configure}) before changing them.
-
-Here is a sample file @file{/usr/share/local/gnu/share/config.site}. The
-command @samp{configure --prefix=/usr/share/local/gnu} would read this
-file (if @code{CONFIG_SITE} is not set to a different file).
-
-@example
-# config.site for configure
-#
-# Default --prefix and --exec-prefix.
-test "$prefix" = NONE && prefix=/usr/share/local/gnu
-test "$exec_prefix" = NONE && exec_prefix=/usr/local/gnu
-#
-# Give Autoconf 2.x generated configure scripts a shared default
-# cache file for feature test results, architecture-specific.
-if test "$cache_file" = ./config.cache; then
- cache_file="$prefix/var/config.cache"
- # A cache file is only valid for one C compiler.
- CC=gcc
-fi
-@end example
-
-@node Invoking configure, Invoking config.status, Site Configuration, Top
-@chapter Running @code{configure} Scripts
-
-Below are instructions on how to configure a package that uses a
-@code{configure} script, suitable for inclusion as an @file{INSTALL}
-file in the package. A plain-text version of @file{INSTALL} which you
-may use comes with Autoconf.
-
-@menu
-* Basic Installation:: Instructions for typical cases.
-* Compilers and Options:: Selecting compilers and optimization.
-* Build Directory:: Configuring in a different directory.
-* Installation Names:: Installing in different directories.
-* Optional Features:: Selecting optional features.
-* System Type:: Specifying the system type.
-* Sharing Defaults:: Setting site-wide defaults for @code{configure}.
-* Operation Controls:: Changing how @code{configure} runs.
-@end menu
-
-@include install.texi
-
-@node Invoking config.status, Questions, Invoking configure, Top
-@chapter Recreating a Configuration
-
-The @code{configure} script creates a file named @file{config.status}
-which describes which configuration options were specified when the
-package was last configured. This file is a shell script which,
-if run, will recreate the same configuration.
-
-You can give @file{config.status} the @samp{--recheck} option to update
-itself. This option is useful if you change @code{configure}, so that
-the results of some tests might be different from the previous run. The
-@samp{--recheck} option re-runs @code{configure} with the same arguments
-you used before, plus the @samp{--no-create} option, which prevent
-@code{configure} from running @file{config.status} and creating
-@file{Makefile} and other files, and the @samp{--no-recursion} option,
-which prevents @code{configure} from running other @code{configure}
-scripts in subdirectories. (This is so other @file{Makefile} rules can
-run @file{config.status} when it changes; @pxref{Automatic Remaking},
-for an example).
-
-@file{config.status} also accepts the options @samp{--help}, which
-prints a summary of the options to @file{config.status}, and
-@samp{--version}, which prints the version of Autoconf used to create
-the @code{configure} script that generated @file{config.status}.
-
-@file{config.status} checks several optional environment variables that
-can alter its behavior:
-
-@defvar CONFIG_SHELL
-@evindex CONFIG_SHELL
-The shell with which to run @code{configure} for the @samp{--recheck}
-option. It must be Bourne-compatible. The default is @file{/bin/sh}.
-@end defvar
-
-@defvar CONFIG_STATUS
-@evindex CONFIG_STATUS
-The file name to use for the shell script that records the
-configuration. The default is @file{./config.status}. This variable is
-useful when one package uses parts of another and the @code{configure}
-scripts shouldn't be merged because they are maintained separately.
-@end defvar
-
-The following variables provide one way for separately distributed
-packages to share the values computed by @code{configure}. Doing so can
-be useful if some of the packages need a superset of the features that
-one of them, perhaps a common library, does. These variables allow a
-@file{config.status} file to create files other than the ones that its
-@file{configure.in} specifies, so it can be used for a different package.
-
-@defvar CONFIG_FILES
-@evindex CONFIG_FILES
-The files in which to perform @samp{@@@var{variable}@@} substitutions.
-The default is the arguments given to @code{AC_OUTPUT} in @file{configure.in}.
-@end defvar
-
-@defvar CONFIG_HEADERS
-@evindex CONFIG_HEADERS
-The files in which to substitute C @code{#define} statements.
-The default is the arguments given to @code{AC_CONFIG_HEADER}; if that
-macro was not called, @file{config.status} ignores this variable.
-@end defvar
-
-These variables also allow you to write @file{Makefile} rules that
-regenerate only some of the files. For example, in the dependencies
-given above (@pxref{Automatic Remaking}), @file{config.status} is run
-twice when @file{configure.in} has changed. If that bothers you, you
-can make each run only regenerate the files for that rule:
-
-@example
-@group
-config.h: stamp-h
-stamp-h: config.h.in config.status
- CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
- echo > stamp-h
-
-Makefile: Makefile.in config.status
- CONFIG_FILES=Makefile CONFIG_HEADERS= ./config.status
-@end group
-@end example
-
-@noindent
-(If @file{configure.in} does not call @code{AC_CONFIG_HEADER}, there is
-no need to set @code{CONFIG_HEADERS} in the @code{make} rules.)
-
-@node Questions, Upgrading, Invoking config.status, Top
-@chapter Questions About Autoconf
-
-Several questions about Autoconf come up occasionally. Here some of them
-are addressed.
-
-@menu
-* Distributing:: Distributing @code{configure} scripts.
-* Why GNU m4:: Why not use the standard @code{m4}?
-* Bootstrapping:: Autoconf and GNU @code{m4} require each other?
-* Why Not Imake:: Why GNU uses @code{configure} instead of Imake.
-@end menu
-
-@node Distributing, Why GNU m4, , Questions
-@section Distributing @code{configure} Scripts
-
-@display
-What are the restrictions on distributing @code{configure}
-scripts that Autoconf generates? How does that affect my
-programs that use them?
-@end display
-
-There are no restrictions on how the configuration scripts that Autoconf
-produces may be distributed or used. In Autoconf version 1, they were
-covered by the GNU General Public License. We still encourage software
-authors to distribute their work under terms like those of the GPL, but
-doing so is not required to use Autoconf.
-
-Of the other files that might be used with @code{configure},
-@file{config.h.in} is under whatever copyright you use for your
-@file{configure.in}, since it is derived from that file and from the
-public domain file @file{acconfig.h}. @file{config.sub} and
-@file{config.guess} have an exception to the GPL when they are used with
-an Autoconf-generated @code{configure} script, which permits you to
-distribute them under the same terms as the rest of your package.
-@file{install-sh} is from the X Consortium and is not copyrighted.
-
-@node Why GNU m4, Bootstrapping, Distributing, Questions
-@section Why Require GNU @code{m4}?
-
-@display
-Why does Autoconf require GNU @code{m4}?
-@end display
-
-Many @code{m4} implementations have hard-coded limitations on the size
-and number of macros, which Autoconf exceeds. They also lack several
-builtin macros that it would be difficult to get along without in a
-sophisticated application like Autoconf, including:
-
-@example
-builtin
-indir
-patsubst
-__file__
-__line__
-@end example
-
-Since only software maintainers need to use Autoconf, and since GNU
-@code{m4} is simple to configure and install, it seems reasonable to
-require GNU @code{m4} to be installed also. Many maintainers of GNU and
-other free software already have most of the GNU utilities installed,
-since they prefer them.
-
-@node Bootstrapping, Why Not Imake, Why GNU m4, Questions
-@section How Can I Bootstrap?
-
-@display
-If Autoconf requires GNU @code{m4} and GNU @code{m4} has an
-Autoconf @code{configure} script, how do I bootstrap? It seems
-like a chicken and egg problem!
-@end display
-
-This is a misunderstanding. Although GNU @code{m4} does come with a
-@code{configure} script produced by Autoconf, Autoconf is not required
-in order to run the script and install GNU @code{m4}. Autoconf is only
-required if you want to change the @code{m4} @code{configure} script,
-which few people have to do (mainly its maintainer).
-
-@node Why Not Imake, , Bootstrapping, Questions
-@section Why Not Imake?
-
-@display
-Why not use Imake instead of @code{configure} scripts?
-@end display
-
-Several people have written addressing this question, so I include
-adaptations of their explanations here.
-
-The following answer is based on one written by Richard Pixley:
-
-Autoconf generated scripts frequently work on machines which it has
-never been set up to handle before. That is, it does a good job of
-inferring a configuration for a new system. Imake cannot do this.
-
-Imake uses a common database of host specific data. For X11, this makes
-sense because the distribution is made as a collection of tools, by one
-central authority who has control over the database.
-
-GNU tools are not released this way. Each GNU tool has a maintainer;
-these maintainers are scattered across the world. Using a common
-database would be a maintenance nightmare. Autoconf may appear to be
-this kind of database, but in fact it is not. Instead of listing host
-dependencies, it lists program requirements.
-
-Imake is special-purpose. It is directed at building the X11
-distribution. By comparison to the GNU tools, this is a simple problem.
-If you view the GNU suite as a collection of native tools, then the
-problems are similar. But the GNU tools are more powerful than that.
-The development tools can be configured as cross tools in almost any
-host+target permutation. All of these configurations can be installed
-concurrently. They can even be configured to share host independent
-files across hosts. Imake doesn't address these issues.
-
-Imake templates are a form of standardization. The GNU coding standards
-address the same issues without necessarily imposing the same
-restrictions.
-
-Here is some further explanation, written by Per Bothner:
-
-One of the advantages of Imake is that it easy to generate large
-Makefiles using @code{cpp}'s @samp{#include} and macro mechanisms.
-However, @code{cpp} is not programmable: it has limited conditional
-facilities, and no looping. And @code{cpp} cannot inspect its
-environment.
-
-All of these problems are solved by using @code{sh} instead of
-@code{cpp}. The shell is fully programmable, has macro substitution,
-can execute (or source) other shell scripts, and can inspect its
-environment.
-
-Paul Eggert elaborates more:
-
-With Autoconf, installers need not assume that Imake itself is already
-installed and working well. This may not seem like much of an advantage
-to people who are accustomed to Imake. But on many hosts Imake is not
-installed or the default installation is not working well, and requiring
-Imake to install a package hinders the acceptance of that package on
-those hosts. For example, the Imake template and configuration files
-might not be installed properly on a host, or the Imake build procedure
-might wrongly assume that all source files are in one big directory
-tree, or the Imake configuration might assume one compiler whereas the
-package or the installer needs to use another, or there might be a
-version mismatch between the Imake expected by the package and the Imake
-suported by the host. These problems are much rarer with Autoconf,
-where each package comes with its own independent configuration
-processor.
-
-Also, Imake often suffers from unexpected interactions between
-@code{make} and the installer's C preprocessor. The fundamental problem
-here is that the C preprocessor was designed to preprocess C programs,
-not @file{Makefile}s. This is much less of a problem with Autoconf,
-which uses the general-purpose preprocessor @code{m4}, and where the
-package's author (rather than the installer) does the preprocessing in a
-standard way.
-
-Finally, Mark Eichin notes:
-
-Imake isn't all that extensible, either. In order to add new features to
-Imake, you need to provide you own project template, and duplicate most
-of the features of the existing one. This means that for a sophisticated
-project, using the vendor-provided Imake templates fails to provide any
-leverage---since they don't cover anything that your own project needs
-(unless it is an X11 program).
-
-On the other side, though:
-
-The one advantage that Imake has over @code{configure}:
-@file{Imakefile}s tend to be much shorter (likewise, less redundant)
-than @file{Makefile.in}s. There is a fix to this, however---at least
-for the Kerberos V5 tree, we've modified things to call in common
-@file{post.in} and @file{pre.in} @file{Makefile} fragments for the
-entire tree. This means that a lot of common things don't have to be
-duplicated, even though they normally are in @code{configure} setups.
-
-@node Upgrading, History, Questions, Top
-@chapter Upgrading From Version 1
-
-Autoconf version 2 is mostly backward compatible with version 1.
-However, it introduces better ways to do some things, and doesn't
-support some of the ugly things in version 1. So, depending on how
-sophisticated your @file{configure.in} files are, you might have to do
-some manual work in order to upgrade to version 2. This chapter points
-out some problems to watch for when upgrading. Also, perhaps your
-@code{configure} scripts could benefit from some of the new features in
-version 2; the changes are summarized in the file @file{NEWS} in the
-Autoconf distribution.
-
-First, make sure you have GNU @code{m4} version 1.1 or higher installed,
-preferably 1.3 or higher. Versions before 1.1 have bugs that prevent
-them from working with Autoconf version 2. Versions 1.3 and later are
-much faster than earlier versions, because as of version 1.3, GNU
-@code{m4} has a more efficient implementation of diversions and can
-freeze its internal state in a file that it can read back quickly.
-
-@menu
-* Changed File Names:: Files you might rename.
-* Changed Makefiles:: New things to put in @file{Makefile.in}.
-* Changed Macros:: Macro calls you might replace.
-* Invoking autoupdate:: Replacing old macro names in @code{configure.in}.
-* Changed Results:: Changes in how to check test results.
-* Changed Macro Writing:: Better ways to write your own macros.
-@end menu
-
-@node Changed File Names, Changed Makefiles, , Upgrading
-@section Changed File Names
-
-If you have an @file{aclocal.m4} installed with Autoconf (as opposed to
-in a particular package's source directory), you must rename it to
-@file{acsite.m4}. @xref{Invoking autoconf}.
-
-If you distribute @file{install.sh} with your package, rename it to
-@file{install-sh} so @code{make} builtin rules won't inadvertantly
-create a file called @file{install} from it. @code{AC_PROG_INSTALL}
-looks for the script under both names, but it is best to use the new name.
-
-If you were using @file{config.h.top} or @file{config.h.bot}, you still
-can, but you will have less clutter if you merge them into
-@file{acconfig.h}. @xref{Invoking autoheader}.
-
-@node Changed Makefiles, Changed Macros, Changed File Names, Upgrading
-@section Changed Makefiles
-
-Add @samp{@@CFLAGS@@}, @samp{@@CPPFLAGS@@}, and @samp{@@LDFLAGS@@} in
-your @file{Makefile.in} files, so they can take advantage of the values
-of those variables in the environment when @code{configure} is run.
-Doing this isn't necessary, but it's a convenience for users.
-
-Also add @samp{@@configure_input@@} in a comment to each input file for
-@code{AC_OUTPUT}, so that the output files will contain a comment saying
-they were produced by @code{configure}. Automatically selecting the
-right comment syntax for all the kinds of files that people call
-@code{AC_OUTPUT} on became too much work.
-
-Add @file{config.log} and @file{config.cache} to the list of files you
-remove in @code{distclean} targets.
-
-If you have the following in @file{Makefile.in}:
-
-@example
-prefix = /usr/local
-exec_prefix = $@{prefix@}
-@end example
-
-@noindent
-you must change it to:
-
-@example
-prefix = @@prefix@@
-exec_prefix = @@exec_prefix@@
-@end example
-
-@noindent
-The old feature of replacing those variables without @samp{@@}
-characters around them has been removed.
-
-@node Changed Macros, Invoking autoupdate, Changed Makefiles, Upgrading
-@section Changed Macros
-
-Many of the macros were renamed in Autoconf version 2. You can still
-use the old names, but the new ones are clearer, and it's easier to find
-the documentation for them. @xref{Old Macro Names}, for a table showing
-the new names for the old macros. Use the @code{autoupdate} program to
-convert your @file{configure.in} to using the new macro names.
-@xref{Invoking autoupdate}.
-
-Some macros have been superseded by similar ones that do the job better,
-but are not call-compatible. If you get warnings about calling obsolete
-macros while running @code{autoconf}, you may safely ignore them, but
-your @code{configure} script will generally work better if you follow
-the advice it prints about what to replace the obsolete macros with. In
-particular, the mechanism for reporting the results of tests has
-changed. If you were using @code{echo} or @code{AC_VERBOSE} (perhaps
-via @code{AC_COMPILE_CHECK}), your @code{configure} script's output will
-look better if you switch to @code{AC_MSG_CHECKING} and
-@code{AC_MSG_RESULT}. @xref{Printing Messages}. Those macros work best
-in conjunction with cache variables. @xref{Caching Results}.
-
-@node Invoking autoupdate, Changed Results, Changed Macros, Upgrading
-@section Using @code{autoupdate} to Modernize @code{configure}
-
-The @code{autoupdate} program updates a @file{configure.in} file that
-calls Autoconf macros by their old names to use the current macro names.
-In version 2 of Autoconf, most of the macros were renamed to use a more
-uniform and descriptive naming scheme. @xref{Macro Names}, for a
-description of the new scheme. Although the old names still work
-(@pxref{Old Macro Names}, for a list of the old macro names and the
-corresponding new names), you can make your @file{configure.in} files
-more readable and make it easier to use the current Autoconf
-documentation if you update them to use the new macro names.
-
-@evindex SIMPLE_BACKUP_SUFFIX
-If given no arguments, @code{autoupdate} updates @file{configure.in},
-backing up the original version with the suffix @file{~} (or the value
-of the environment variable @code{SIMPLE_BACKUP_SUFFIX}, if that is
-set). If you give @code{autoupdate} an argument, it reads that file
-instead of @file{configure.in} and writes the updated file to the
-standard output.
-
-@noindent
-@code{autoupdate} accepts the following options:
-
-@table @code
-@item --help
-@itemx -h
-Print a summary of the command line options and exit.
-
-@item --macrodir=@var{dir}
-@itemx -m @var{dir}
-@evindex AC_MACRODIR
-Look for the Autoconf macro files in directory @var{dir} instead of the
-default installation directory.
-You can also set the @code{AC_MACRODIR}
-environment variable to a directory; this option overrides the
-environment variable.
-
-@item --version
-Print the version number of @code{autoupdate} and exit.
-@end table
-
-@node Changed Results, Changed Macro Writing, Invoking autoupdate, Upgrading
-@section Changed Results
-
-If you were checking the results of previous tests by examining the
-shell variable @code{DEFS}, you need to switch to checking the values of
-the cache variables for those tests. @code{DEFS} no longer exists while
-@code{configure} is running; it is only created when generating output
-files. This difference from version 1 is because properly quoting the
-contents of that variable turned out to be too cumbersome and
-inefficient to do every time @code{AC_DEFINE} is called. @xref{Cache
-Variable Names}.
-
-For example, here is a @file{configure.in} fragment written for Autoconf
-version 1:
-
-@example
-AC_HAVE_FUNCS(syslog)
-case "$DEFS" in
-*-DHAVE_SYSLOG*) ;;
-*) # syslog is not in the default libraries. See if it's in some other.
- saved_LIBS="$LIBS"
- for lib in bsd socket inet; do
- AC_CHECKING(for syslog in -l$lib)
- LIBS="$saved_LIBS -l$lib"
- AC_HAVE_FUNCS(syslog)
- case "$DEFS" in
- *-DHAVE_SYSLOG*) break ;;
- *) ;;
- esac
- LIBS="$saved_LIBS"
- done ;;
-esac
-@end example
-
-Here is a way to write it for version 2:
-
-@example
-AC_CHECK_FUNCS(syslog)
-if test $ac_cv_func_syslog = no; then
- # syslog is not in the default libraries. See if it's in some other.
- for lib in bsd socket inet; do
- AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG)
- LIBS="$LIBS $lib"; break])
- done
-fi
-@end example
-
-If you were working around bugs in @code{AC_DEFINE_UNQUOTED} by adding
-backslashes before quotes, you need to remove them. It now works
-predictably, and does not treat quotes (except backquotes) specially.
-@xref{Setting Output Variables}.
-
-All of the boolean shell variables set by Autoconf macros now use
-@samp{yes} for the true value. Most of them use @samp{no} for false,
-though for backward compatibility some use the empty string instead. If
-you were relying on a shell variable being set to something like 1 or
-@samp{t} for true, you need to change your tests.
-
-@node Changed Macro Writing, , Changed Results, Upgrading
-@section Changed Macro Writing
-
-When defining your own macros, you should now use @code{AC_DEFUN}
-instead of @code{define}. @code{AC_DEFUN} automatically calls
-@code{AC_PROVIDE} and ensures that macros called via @code{AC_REQUIRE}
-do not interrupt other macros, to prevent nested @samp{checking@dots{}}
-messages on the screen. There's no actual harm in continuing to use the
-older way, but it's less convenient and attractive. @xref{Macro
-Definitions}.
-
-You probably looked at the macros that came with Autoconf as a guide for
-how to do things. It would be a good idea to take a look at the new
-versions of them, as the style is somewhat improved and they take
-advantage of some new features.
-
-If you were doing tricky things with undocumented Autoconf internals
-(macros, variables, diversions), check whether you need to change
-anything to account for changes that have been made. Perhaps you can
-even use an officially supported technique in version 2 instead of
-kludging. Or perhaps not.
-
-To speed up your locally written feature tests, add caching to them.
-See whether any of your tests are of general enough usefulness to
-encapsulate into macros that you can share.
-
-@node History, Old Macro Names, Upgrading, Top
-@chapter History of Autoconf
-
-You may be wondering, Why was Autoconf originally written? How did it
-get into its present form? (Why does it look like gorilla spit?) If
-you're not wondering, then this chapter contains no information useful
-to you, and you might as well skip it. If you @emph{are} wondering,
-then let there be light@dots{}
-
-@menu
-* Genesis:: Prehistory and naming of @code{configure}.
-* Exodus:: The plagues of @code{m4} and Perl.
-* Leviticus:: The priestly code of portability arrives.
-* Numbers:: Growth and contributors.
-* Deuteronomy:: Approaching the promises of easy configuration.
-@end menu
-
-@node Genesis, Exodus, , History
-@section Genesis
-
-In June 1991 I was maintaining many of the GNU utilities for the Free
-Software Foundation. As they were ported to more platforms and more
-programs were added, the number of @samp{-D} options that users had to
-select in the @file{Makefile} (around 20) became burdensome. Especially
-for me---I had to test each new release on a bunch of different systems.
-So I wrote a little shell script to guess some of the correct settings
-for the fileutils package, and released it as part of fileutils 2.0.
-That @code{configure} script worked well enough that the next month I
-adapted it (by hand) to create similar @code{configure} scripts for
-several other GNU utilities packages. Brian Berliner also adapted one
-of my scripts for his CVS revision control system.
-
-Later that summer, I learned that Richard Stallman and Richard Pixley
-were developing similar scripts to use in the GNU compiler tools; so I
-adapted my @code{configure} scripts to support their evolving interface:
-using the file name @file{Makefile.in} as the templates; adding
-@samp{+srcdir}, the first option (of many); and creating
-@file{config.status} files.
-
-@node Exodus, Leviticus, Genesis, History
-@section Exodus
-
-As I got feedback from users, I incorporated many improvements, using
-Emacs to search and replace, cut and paste, similar changes in each of
-the scripts. As I adapted more GNU utilities packages to use
-@code{configure} scripts, updating them all by hand became impractical.
-Rich Murphey, the maintainer of the GNU graphics utilities, sent me mail
-saying that the @code{configure} scripts were great, and asking if I had
-a tool for generating them that I could send him. No, I thought, but
-I should! So I started to work out how to generate them. And the
-journey from the slavery of hand-written @code{configure} scripts to the
-abundance and ease of Autoconf began.
-
-Cygnus @code{configure}, which was being developed at around that time,
-is table driven; it is meant to deal mainly with a discrete number of
-system types with a small number of mainly unguessable features (such as
-details of the object file format). The automatic configuration system
-that Brian Fox had developed for Bash takes a similar approach. For
-general use, it seems to me a hopeless cause to try to maintain an
-up-to-date database of which features each variant of each operating
-system has. It's easier and more reliable to check for most features on
-the fly---especially on hybrid systems that people have hacked on
-locally or that have patches from vendors installed.
-
-I considered using an architecture similar to that of Cygnus
-@code{configure}, where there is a single @code{configure} script that
-reads pieces of @file{configure.in} when run. But I didn't want to have
-to distribute all of the feature tests with every package, so I settled
-on having a different @code{configure} made from each
-@file{configure.in} by a preprocessor. That approach also offered more
-control and flexibility.
-
-I looked briefly into using the Metaconfig package, by Larry Wall,
-Harlan Stenn, and Raphael Manfredi, but I decided not to for several
-reasons. The @code{Configure} scripts it produces are interactive,
-which I find quite inconvenient; I didn't like the ways it checked for
-some features (such as library functions); I didn't know that it was
-still being maintained, and the @code{Configure} scripts I had
-seen didn't work on many modern systems (such as System V R4 and NeXT);
-it wasn't very flexible in what it could do in response to a feature's
-presence or absence; I found it confusing to learn; and it was too big
-and complex for my needs (I didn't realize then how much Autoconf would
-eventually have to grow).
-
-I considered using Perl to generate my style of @code{configure} scripts,
-but decided that @code{m4} was better suited to the job of simple
-textual substitutions: it gets in the way less, because output is
-implicit. Plus, everyone already has it. (Initially I didn't rely on
-the GNU extensions to @code{m4}.) Also, some of my friends at the
-University of Maryland had recently been putting @code{m4} front ends on
-several programs, including @code{tvtwm}, and I was interested in trying
-out a new language.
-
-@node Leviticus, Numbers, Exodus, History
-@section Leviticus
-
-Since my @code{configure} scripts determine the system's capabilities
-automatically, with no interactive user intervention, I decided to call
-the program that generates them Autoconfig. But with a version number
-tacked on, that name would be too long for old UNIX file systems, so
-I shortened it to Autoconf.
-
-In the fall of 1991 I called together a group of fellow questers after
-the Holy Grail of portability (er, that is, alpha testers) to give me
-feedback as I encapsulated pieces of my handwritten scripts in @code{m4}
-macros and continued to add features and improve the techniques used in
-the checks. Prominent among the testers were
-@ifinfo
-Franc,ois
-@end ifinfo
-@tex
-Fran\c cois
-@end tex
-Pinard, who came up with the idea of making an @file{autoconf} shell
-script to run @code{m4} and check for unresolved macro calls; Richard
-Pixley, who suggested running the compiler instead of searching the file
-system to find include files and symbols, for more accurate results;
-Karl Berry, who got Autoconf to configure @TeX{} and added the
-macro index to the documentation; and Ian Taylor, who added support for
-creating a C header file as an alternative to putting @samp{-D} options
-in a @file{Makefile}, so he could use Autoconf for his UUCP package. The
-alpha testers cheerfully adjusted their files again and again as the
-names and calling conventions of the Autoconf macros changed from
-release to release. They all contributed many specific checks, great
-ideas, and bug fixes.
-
-@node Numbers, Deuteronomy, Leviticus, History
-@section Numbers
-
-In July 1992, after months of alpha testing, I released Autoconf 1.0,
-and converted many GNU packages to use it. I was surprised by how
-positive the reaction to it was. More people started using it than I
-could keep track of, including people working on software that wasn't
-part of the GNU Project (such as TCL, FSP, and Kerberos V5).
-Autoconf continued to improve rapidly, as many people using the
-@code{configure} scripts reported problems they encountered.
-
-Autoconf turned out to be a good torture test for @code{m4}
-implementations. UNIX @code{m4} started to dump core because of the
-length of the macros that Autoconf defined, and several bugs showed up
-in GNU @code{m4} as well. Eventually, we realized that we needed to use
-some features that only GNU @code{m4} has. 4.3BSD @code{m4}, in
-particular, has an impoverished set of builtin macros; the System V
-version is better, but still doesn't provide everything we need.
-
-More development occurred as people put Autoconf under more stresses
-(and to uses I hadn't anticipated). Karl Berry added checks for X11.
-david zuhn contributed C++ support.
-@ifinfo
-Franc,ois
-@end ifinfo
-@tex
-Fran\c cois
-@end tex
-Pinard made it diagnose invalid arguments. Jim Blandy bravely coerced
-it into configuring GNU Emacs, laying the groundwork for several later
-improvements. Roland McGrath got it to configure the GNU C Library,
-wrote the @code{autoheader} script to automate the creation of C header
-file templates, and added a @samp{--verbose} option to @code{configure}.
-Noah Friedman added the @samp{--macrodir} option and @code{AC_MACRODIR}
-environment variable. (He also coined the term @dfn{autoconfiscate} to
-mean ``adapt a software package to use Autoconf''.) Roland and Noah
-improved the quoting protection in @code{AC_DEFINE} and fixed many bugs,
-especially when I got sick of dealing with portability problems from
-February through June, 1993.
-
-@node Deuteronomy, , Numbers, History
-@section Deuteronomy
-
-A long wish list for major features had accumulated, and the effect of
-several years of patching by various people had left some residual
-cruft. In April 1994, while working for Cygnus Support, I began a major
-revision of Autoconf. I added most of the features of the Cygnus
-@code{configure} that Autoconf had lacked, largely by adapting the
-relevant parts of Cygnus @code{configure} with the help of david zuhn
-and Ken Raeburn. These features include support for using
-@file{config.sub}, @file{config.guess}, @samp{--host}, and
-@samp{--target}; making links to files; and running @code{configure}
-scripts in subdirectories. Adding these features enabled Ken to convert
-GNU @code{as}, and Rob Savoye to convert DejaGNU, to using Autoconf.
-
-I added more features in response to other peoples' requests. Many
-people had asked for @code{configure} scripts to share the results of
-the checks between runs, because (particularly when configuring a large
-source tree, like Cygnus does) they were frustratingly slow. Mike
-Haertel suggested adding site-specific initialization scripts. People
-distributing software that had to unpack on MS-DOS asked for a way to
-override the @file{.in} extension on the file names, which produced file
-names like @file{config.h.in} containing two dots. Jim Avera did an
-extensive examination of the problems with quoting in @code{AC_DEFINE}
-and @code{AC_SUBST}; his insights led to significant improvements.
-Richard Stallman asked that compiler output be sent to @file{config.log}
-instead of @file{/dev/null}, to help people debug the Emacs
-@code{configure} script.
-
-I made some other changes because of my dissatisfaction with the quality
-of the program. I made the messages showing results of the checks less
-ambiguous, always printing a result. I regularized the names of the
-macros and cleaned up coding style inconsistencies. I added some
-auxiliary utilities that I had developed to help convert source code
-packages to use Autoconf. With the help of
-@ifinfo
-Franc,ois
-@end ifinfo
-@tex
-Fran\c cois
-@end tex
-Pinard, I made the macros not interrupt each others' messages.
-(That feature revealed some performance bottlenecks in GNU @code{m4},
-which he hastily corrected!)
-I reorganized the documentation around problems people want to solve.
-And I began a testsuite, because experience
-had shown that Autoconf has a pronounced tendency to regress when we
-change it.
-
-Again, several alpha testers gave invaluable feedback, especially
-@ifinfo
-Franc,ois
-@end ifinfo
-@tex
-Fran\c cois
-@end tex
-Pinard, Jim Meyering, Karl Berry, Rob Savoye, Ken Raeburn, and Mark Eichin.
-
-Finally, version 2.0 was ready. And there was much rejoicing.
-(And I have free time again. I think. Yeah, right.)
-
-@node Old Macro Names, Environment Variable Index, History, Top
-@chapter Old Macro Names
-
-In version 2 of Autoconf, most of the macros were renamed to use a more
-uniform and descriptive naming scheme. Here are the old names of the
-macros that were renamed, followed by the current names of those macros.
-Although the old names are still accepted by the @code{autoconf} program
-for backward compatibility, the old names are considered obsolete.
-@xref{Macro Names}, for a description of the new naming scheme.
-
-@table @code
-@item AC_ALLOCA
-@maindex ALLOCA
-@code{AC_FUNC_ALLOCA}
-@item AC_ARG_ARRAY
-@maindex ARG_ARRAY
-removed because of limited usefulness
-@item AC_CHAR_UNSIGNED
-@maindex CHAR_UNSIGNED
-@code{AC_C_CHAR_UNSIGNED}
-@item AC_CONST
-@maindex CONST
-@code{AC_C_CONST}
-@item AC_CROSS_CHECK
-@maindex CROSS_CHECK
-@code{AC_C_CROSS}
-@item AC_ERROR
-@maindex ERROR
-@code{AC_MSG_ERROR}
-@item AC_FIND_X
-@maindex FIND_X
-@code{AC_PATH_X}
-@item AC_FIND_XTRA
-@maindex FIND_XTRA
-@code{AC_PATH_XTRA}
-@item AC_FUNC_CHECK
-@maindex FUNC_CHECK
-@code{AC_CHECK_FUNC}
-@item AC_GCC_TRADITIONAL
-@maindex GCC_TRADITIONAL
-@code{AC_PROG_GCC_TRADITIONAL}
-@item AC_GETGROUPS_T
-@maindex GETGROUPS_T
-@code{AC_TYPE_GETGROUPS}
-@item AC_GETLOADAVG
-@maindex GETLOADAVG
-@code{AC_FUNC_GETLOADAVG}
-@item AC_HAVE_FUNCS
-@maindex HAVE_FUNCS
-@code{AC_CHECK_FUNCS}
-@item AC_HAVE_HEADERS
-@maindex HAVE_HEADERS
-@code{AC_CHECK_HEADERS}
-@item AC_HAVE_POUNDBANG
-@maindex HAVE_POUNDBANG
-@code{AC_SYS_INTERPRETER} (different calling convention)
-@item AC_HEADER_CHECK
-@maindex HEADER_CHECK
-@code{AC_CHECK_HEADER}
-@item AC_HEADER_EGREP
-@maindex HEADER_EGREP
-@code{AC_EGREP_HEADER}
-@item AC_INLINE
-@maindex INLINE
-@code{AC_C_INLINE}
-@item AC_LN_S
-@maindex LN_S
-@code{AC_PROG_LN_S}
-@item AC_LONG_DOUBLE
-@maindex LONG_DOUBLE
-@code{AC_C_LONG_DOUBLE}
-@item AC_LONG_FILE_NAMES
-@maindex LONG_FILE_NAMES
-@code{AC_SYS_LONG_FILE_NAMES}
-@item AC_MAJOR_HEADER
-@maindex MAJOR_HEADER
-@code{AC_HEADER_MAJOR}
-@item AC_MINUS_C_MINUS_O
-@maindex MINUS_C_MINUS_O
-@code{AC_PROG_CC_C_O}
-@item AC_MMAP
-@maindex MMAP
-@code{AC_FUNC_MMAP}
-@item AC_MODE_T
-@maindex MODE_T
-@code{AC_TYPE_MODE_T}
-@item AC_OFF_T
-@maindex OFF_T
-@code{AC_TYPE_OFF_T}
-@item AC_PID_T
-@maindex PID_T
-@code{AC_TYPE_PID_T}
-@item AC_PREFIX
-@maindex PREFIX
-@code{AC_PREFIX_PROGRAM}
-@item AC_PROGRAMS_CHECK
-@maindex PROGRAMS_CHECK
-@code{AC_CHECK_PROGS}
-@item AC_PROGRAMS_PATH
-@maindex PROGRAMS_PATH
-@code{AC_PATH_PROGS}
-@item AC_PROGRAM_CHECK
-@maindex PROGRAM_CHECK
-@code{AC_CHECK_PROG}
-@item AC_PROGRAM_EGREP
-@maindex PROGRAM_EGREP
-@code{AC_EGREP_CPP}
-@item AC_PROGRAM_PATH
-@maindex PROGRAM_PATH
-@code{AC_PATH_PROG}
-@item AC_REMOTE_TAPE
-@maindex REMOTE_TAPE
-removed because of limited usefulness
-@item AC_RESTARTABLE_SYSCALLS
-@maindex RESTARTABLE_SYSCALLS
-@code{AC_SYS_RESTARTABLE_SYSCALLS}
-@item AC_RETSIGTYPE
-@maindex RETSIGTYPE
-@code{AC_TYPE_SIGNAL}
-@item AC_RSH
-@maindex RSH
-removed because of limited usefulness
-@item AC_SETVBUF_REVERSED
-@maindex SETVBUF_REVERSED
-@code{AC_FUNC_SETVBUF_REVERSED}
-@item AC_SET_MAKE
-@maindex SET_MAKE
-@code{AC_PROG_MAKE_SET}
-@item AC_SIZEOF_TYPE
-@maindex SIZEOF_TYPE
-@code{AC_CHECK_SIZEOF}
-@item AC_SIZE_T
-@maindex SIZE_T
-@code{AC_TYPE_SIZE_T}
-@item AC_STAT_MACROS_BROKEN
-@maindex STAT_MACROS_BROKEN
-@code{AC_HEADER_STAT}
-@item AC_STDC_HEADERS
-@maindex STDC_HEADERS
-@code{AC_HEADER_STDC}
-@item AC_STRCOLL
-@maindex STRCOLL
-@code{AC_FUNC_STRCOLL}
-@item AC_ST_BLKSIZE
-@maindex ST_BLKSIZE
-@code{AC_STRUCT_ST_BLKSIZE}
-@item AC_ST_BLOCKS
-@maindex ST_BLOCKS
-@code{AC_STRUCT_ST_BLOCKS}
-@item AC_ST_RDEV
-@maindex ST_RDEV
-@code{AC_STRUCT_ST_RDEV}
-@item AC_SYS_SIGLIST_DECLARED
-@maindex SYS_SIGLIST_DECLARED
-@code{AC_DECL_SYS_SIGLIST}
-@item AC_TEST_CPP
-@maindex TEST_CPP
-@code{AC_TRY_CPP}
-@item AC_TEST_PROGRAM
-@maindex TEST_PROGRAM
-@code{AC_TRY_RUN}
-@item AC_TIMEZONE
-@maindex TIMEZONE
-@code{AC_STRUCT_TIMEZONE}
-@item AC_TIME_WITH_SYS_TIME
-@maindex TIME_WITH_SYS_TIME
-@code{AC_HEADER_TIME}
-@item AC_UID_T
-@maindex UID_T
-@code{AC_TYPE_UID_T}
-@item AC_UTIME_NULL
-@maindex UTIME_NULL
-@code{AC_FUNC_UTIME_NULL}
-@item AC_VFORK
-@maindex VFORK
-@code{AC_FUNC_VFORK}
-@item AC_VPRINTF
-@maindex VPRINTF
-@code{AC_FUNC_VPRINTF}
-@item AC_WAIT3
-@maindex WAIT3
-@code{AC_FUNC_WAIT3}
-@item AC_WARN
-@maindex WARN
-@code{AC_MSG_WARN}
-@item AC_WORDS_BIGENDIAN
-@maindex WORDS_BIGENDIAN
-@code{AC_C_BIGENDIAN}
-@item AC_YYTEXT_POINTER
-@maindex YYTEXT_POINTER
-@code{AC_DECL_YYTEXT}
-@end table
-
-@node Environment Variable Index, Output Variable Index, Old Macro Names, Top
-@unnumbered Environment Variable Index
-
-This is an alphabetical list of the environment variables that Autoconf
-checks.
-
-@printindex ev
-
-@node Output Variable Index, Preprocessor Symbol Index, Environment Variable Index, Top
-@unnumbered Output Variable Index
-
-This is an alphabetical list of the variables that Autoconf can
-substitute into files that it creates, typically one or more
-@file{Makefile}s. @xref{Setting Output Variables}, for more information on how
-this is done.
-
-@printindex ov
-
-@node Preprocessor Symbol Index, Macro Index, Output Variable Index, Top
-@unnumbered Preprocessor Symbol Index
-
-This is an alphabetical list of the C preprocessor symbols that the
-Autoconf macros define. To work with Autoconf, C source code needs to
-use these names in @code{#if} directives.
-
-@printindex cv
-
-@node Macro Index, , Preprocessor Symbol Index, Top
-@unnumbered Macro Index
-
-This is an alphabetical list of the Autoconf macros. To make the list
-easier to use, the macros are listed without their preceding @samp{AC_}.
-
-@printindex ma
-
-@contents
-@bye
diff --git a/util/autoconf/autoheader b/util/autoconf/autoheader
deleted file mode 100755
index 54b68d9..0000000
--- a/util/autoconf/autoheader
+++ /dev/null
@@ -1,250 +0,0 @@
-#!/bin/sh
-# autoheader -- create `config.h.in' from `configure.in'
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Written by Roland McGrath.
-
-# If given no args, create `config.h.in' from template file `configure.in'.
-# With one arg, create a header file on standard output from
-# the given template file.
-
-usage="\
-Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--version] [template-file]"
-
-# NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-
-test -z "${AC_MACRODIR}" && AC_MACRODIR=/usr/local/share/autoconf
-test -z "${M4}" && M4=/mit/gnu/rsaixbin/gm4
-case "${M4}" in
-/*) # Handle the case that m4 has moved since we were configured.
- # It may have been found originally in a build directory.
- test -f "${M4}" || M4=m4 ;;
-esac
-
-localdir=.
-show_version=no
-
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* )
- echo "${usage}"; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m* )
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- AC_MACRODIR="${1}"
- shift ;;
- --version | --v* )
- show_version=yes; shift ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "${usage}" 1>&2; exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-TEMPLATES="${AC_MACRODIR}/acconfig.h"
-test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h"
-
-case $# in
- 0) infile=configure.in ;;
- 1) infile=$1 ;;
- *) echo "$usage" >&2; exit 1 ;;
-esac
-
-config_h=config.h
-syms=
-types=
-funcs=
-headers=
-libs=
-
-if test "$localdir" != .; then
- use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
-else
- use_localdir=
-fi
-
-# Use the frozen version of Autoconf if available.
-r= f=
-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
-case `$M4 --help < /dev/null 2>&1` in
-*reload-state*) test -r $AC_MACRODIR/autoheader.m4f && { r=--reload f=f; } ;;
-*traditional*) ;;
-*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;;
-esac
-
-# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the
-# modified autoconf processing of the input file. The sed hair is
-# necessary to win for multi-line macro invocations.
-eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
- sed -n -e '
- : again
- /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
- /^@@@/{
- s/^@@@//p
- n
- s/^/@@@/
- b again
- }'`"
-
-# Make SYMS newline-separated rather than blank-separated, and remove dups.
-# Start each symbol with a blank (to match the blank after "#undef")
-# to reduce the possibility of mistakenly matching another symbol that
-# is a substring of it.
-syms="`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`"
-
-if test $# -eq 0; then
- tmpout=autoh$$
- trap "rm -f $tmpout; exit 1" 1 2 15
- exec > $tmpout
-fi
-
-# Support "outfile[:infile]", defaulting infile="outfile.in".
-case "$config_h" in
-*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'`
- config_h=`echo "$config_h"|sed 's%:.*%%'` ;;
-*) config_h_in="${config_h}.in" ;;
-esac
-
-# Don't write "do not edit" -- it will get copied into the
-# config.h, which it's ok to edit.
-echo "/* ${config_h_in}. Generated automatically from $infile by autoheader. */"
-
-test -r ${config_h}.top && cat ${config_h}.top
-test -r $localdir/acconfig.h &&
- grep @TOP@ $localdir/acconfig.h >/dev/null &&
- sed '/@TOP@/,$d' $localdir/acconfig.h
-
-# This puts each template paragraph on its own line, separated by @s.
-if test -n "$syms"; then
- # Make sure the boundary of template files is also the boundary
- # of the paragraph. Extra newlines don't hurt since they will
- # be removed.
- for t in $TEMPLATES; do cat $t; echo; echo; done |
- # The sed script is suboptimal because it has to take care of
- # some broken seds (e.g. AIX) that remove '\n' from the
- # pattern/hold space if the line is empty. (junio@twinsun.com).
- sed -n -e '
- /^[ ]*$/{
- x
- s/\n/@/g
- p
- s/.*/@/
- x
- }
- H' | sed -e 's/@@*/@/g' |
- # Select each paragraph that refers to a symbol we picked out above.
- fgrep "$syms" |
- tr @ \\012
-fi
-
-echo "$types" | tr , \\012 | sort | uniq | while read ctype; do
- test -z "$ctype" && continue
- # Solaris 2.3 tr rejects noncontiguous characters in character classes.
- sym="`echo "${ctype}" | tr '[a-z] *' '[A-Z]_P'`"
- echo "
-/* The number of bytes in a ${ctype}. */
-#undef SIZEOF_${sym}"
-done
-
-# /bin/sh on the Alpha gives `for' a random value if $funcs is empty.
-if test -n "$funcs"; then
- for func in `for x in $funcs; do echo $x; done | sort | uniq`; do
- sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`"
- echo "
-/* Define if you have the ${func} function. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$headers"; then
- for header in `for x in $headers; do echo $x; done | sort | uniq`; do
- sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`"
- echo "
-/* Define if you have the <${header}> header file. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$libs"; then
- for lib in `for x in $libs; do echo $x; done | sort | uniq`; do
- sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`"
- echo "
-/* Define if you have the ${lib} library (-l${lib}). */
-#undef HAVE_LIB${sym}"
- done
-fi
-
-test -r $localdir/acconfig.h &&
- grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
- sed '1,/@BOTTOM@/d' $localdir/acconfig.h
-test -f ${config_h}.bot && cat ${config_h}.bot
-
-status=0
-
-if test -n "$syms"; then
- for sym in $syms; do
- if fgrep $sym $TEMPLATES >/dev/null; then
- : # All is well.
- else
- echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2
- status=1
- fi
- done
-fi
-
-if test $# -eq 0; then
- if test $status -eq 0; then
- if cmp -s $tmpout ${config_h_in}; then
- rm -f $tmpout
- else
- mv -f $tmpout ${config_h_in}
- fi
- else
- rm -f $tmpout
- fi
-fi
-
-exit $status
diff --git a/util/autoconf/autoheader.m4 b/util/autoconf/autoheader.m4
deleted file mode 100644
index 62427d9..0000000
--- a/util/autoconf/autoheader.m4
+++ /dev/null
@@ -1,84 +0,0 @@
-dnl Driver and redefinitions of some Autoconf macros for autoheader.
-dnl This file is part of Autoconf.
-dnl Copyright (C) 1994 Free Software Foundation, Inc.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2, or (at your option)
-dnl any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-dnl
-dnl Written by Roland McGrath.
-dnl
-include(acgeneral.m4)dnl
-builtin(include, acspecific.m4)dnl
-builtin(include, acoldnames.m4)dnl
-
-dnl These are alternate definitions of some macros, which produce
-dnl strings in the output marked with "@@@" so we can easily extract
-dnl the information we want. The `#' at the end of the first line of
-dnl each definition seems to be necessary to prevent m4 from eating
-dnl the newline, which makes the @@@ not always be at the beginning of
-dnl a line.
-
-define([AC_CHECK_FUNCS], [#
-@@@funcs="$funcs $1"@@@
-])
-
-define([AC_CHECK_HEADERS], [#
-@@@headers="$headers $1"@@@
-])
-
-define([AC_CHECK_HEADERS_DIRENT], [#
-@@@headers="$headers $1"@@@
-])
-
-define([AC_CHECK_LIB], [#
- ifelse([$3], , [
-@@@libs="$libs $1"@@@
-], [
-# If it was found, we do:
-$3
-# If it was not found, we do:
-$4
-])
-])
-
-define([AC_HAVE_LIBRARY], [#
-changequote(<<, >>)dnl
-define(<<AC_LIB_NAME>>, dnl
-patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
-changequote([, ])dnl
- ifelse([$2], , [
-@@@libs="$libs AC_LIB_NAME"@@@
-], [
-# If it was found, we do:
-$2
-# If it was not found, we do:
-$3
-])
-])
-
-define([AC_CHECK_SIZEOF], [#
-@@@types="$types,$1"@@@
-])
-
-define([AC_CONFIG_HEADER], [#
-@@@config_h=$1@@@
-])
-
-define([AC_DEFINE], [#
-@@@syms="$syms $1"@@@
-])
-
-define([AC_DEFINE_UNQUOTED], [#
-@@@syms="$syms $1"@@@
-])
diff --git a/util/autoconf/autoheader.sh b/util/autoconf/autoheader.sh
deleted file mode 100755
index 354d4d0..0000000
--- a/util/autoconf/autoheader.sh
+++ /dev/null
@@ -1,250 +0,0 @@
-#!/bin/sh
-# autoheader -- create `config.h.in' from `configure.in'
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Written by Roland McGrath.
-
-# If given no args, create `config.h.in' from template file `configure.in'.
-# With one arg, create a header file on standard output from
-# the given template file.
-
-usage="\
-Usage: autoheader [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--version] [template-file]"
-
-# NLS nuisances.
-# Only set `LANG' and `LC_ALL' to "C" if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-
-test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
-test -z "${M4}" && M4=@M4@
-case "${M4}" in
-/*) # Handle the case that m4 has moved since we were configured.
- # It may have been found originally in a build directory.
- test -f "${M4}" || M4=m4 ;;
-esac
-
-localdir=.
-show_version=no
-
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* )
- echo "${usage}"; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m* )
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- AC_MACRODIR="${1}"
- shift ;;
- --version | --v* )
- show_version=yes; shift ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "${usage}" 1>&2; exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-TEMPLATES="${AC_MACRODIR}/acconfig.h"
-test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h"
-
-case $# in
- 0) infile=configure.in ;;
- 1) infile=$1 ;;
- *) echo "$usage" >&2; exit 1 ;;
-esac
-
-config_h=config.h
-syms=
-types=
-funcs=
-headers=
-libs=
-
-if test "$localdir" != .; then
- use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
-else
- use_localdir=
-fi
-
-# Use the frozen version of Autoconf if available.
-r= f=
-# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
-case `$M4 --help < /dev/null 2>&1` in
-*reload-state*) test -r $AC_MACRODIR/autoheader.m4f && { r=--reload f=f; } ;;
-*traditional*) ;;
-*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;;
-esac
-
-# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the
-# modified autoconf processing of the input file. The sed hair is
-# necessary to win for multi-line macro invocations.
-eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
- sed -n -e '
- : again
- /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
- /^@@@/{
- s/^@@@//p
- n
- s/^/@@@/
- b again
- }'`"
-
-# Make SYMS newline-separated rather than blank-separated, and remove dups.
-# Start each symbol with a blank (to match the blank after "#undef")
-# to reduce the possibility of mistakenly matching another symbol that
-# is a substring of it.
-syms="`for sym in $syms; do echo $sym; done | sort | uniq | sed 's@^@ @'`"
-
-if test $# -eq 0; then
- tmpout=autoh$$
- trap "rm -f $tmpout; exit 1" 1 2 15
- exec > $tmpout
-fi
-
-# Support "outfile[:infile]", defaulting infile="outfile.in".
-case "$config_h" in
-*:*) config_h_in=`echo "$config_h"|sed 's%.*:%%'`
- config_h=`echo "$config_h"|sed 's%:.*%%'` ;;
-*) config_h_in="${config_h}.in" ;;
-esac
-
-# Don't write "do not edit" -- it will get copied into the
-# config.h, which it's ok to edit.
-echo "/* ${config_h_in}. Generated automatically from $infile by autoheader. */"
-
-test -r ${config_h}.top && cat ${config_h}.top
-test -r $localdir/acconfig.h &&
- grep @TOP@ $localdir/acconfig.h >/dev/null &&
- sed '/@TOP@/,$d' $localdir/acconfig.h
-
-# This puts each template paragraph on its own line, separated by @s.
-if test -n "$syms"; then
- # Make sure the boundary of template files is also the boundary
- # of the paragraph. Extra newlines don't hurt since they will
- # be removed.
- for t in $TEMPLATES; do cat $t; echo; echo; done |
- # The sed script is suboptimal because it has to take care of
- # some broken seds (e.g. AIX) that remove '\n' from the
- # pattern/hold space if the line is empty. (junio@twinsun.com).
- sed -n -e '
- /^[ ]*$/{
- x
- s/\n/@/g
- p
- s/.*/@/
- x
- }
- H' | sed -e 's/@@*/@/g' |
- # Select each paragraph that refers to a symbol we picked out above.
- fgrep "$syms" |
- tr @ \\012
-fi
-
-echo "$types" | tr , \\012 | sort | uniq | while read ctype; do
- test -z "$ctype" && continue
- # Solaris 2.3 tr rejects noncontiguous characters in character classes.
- sym="`echo "${ctype}" | tr '[a-z] *' '[A-Z]_P'`"
- echo "
-/* The number of bytes in a ${ctype}. */
-#undef SIZEOF_${sym}"
-done
-
-# /bin/sh on the Alpha gives `for' a random value if $funcs is empty.
-if test -n "$funcs"; then
- for func in `for x in $funcs; do echo $x; done | sort | uniq`; do
- sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`"
- echo "
-/* Define if you have the ${func} function. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$headers"; then
- for header in `for x in $headers; do echo $x; done | sort | uniq`; do
- sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`"
- echo "
-/* Define if you have the <${header}> header file. */
-#undef HAVE_${sym}"
- done
-fi
-
-if test -n "$libs"; then
- for lib in `for x in $libs; do echo $x; done | sort | uniq`; do
- sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`"
- echo "
-/* Define if you have the ${lib} library (-l${lib}). */
-#undef HAVE_LIB${sym}"
- done
-fi
-
-test -r $localdir/acconfig.h &&
- grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
- sed '1,/@BOTTOM@/d' $localdir/acconfig.h
-test -f ${config_h}.bot && cat ${config_h}.bot
-
-status=0
-
-if test -n "$syms"; then
- for sym in $syms; do
- if fgrep $sym $TEMPLATES >/dev/null; then
- : # All is well.
- else
- echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2
- status=1
- fi
- done
-fi
-
-if test $# -eq 0; then
- if test $status -eq 0; then
- if cmp -s $tmpout ${config_h_in}; then
- rm -f $tmpout
- else
- mv -f $tmpout ${config_h_in}
- fi
- else
- rm -f $tmpout
- fi
-fi
-
-exit $status
diff --git a/util/autoconf/autoreconf b/util/autoconf/autoreconf
deleted file mode 100755
index bc2d61b..0000000
--- a/util/autoconf/autoreconf
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/sh
-# autoreconf - remake all Autoconf configure scripts in a directory tree
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-usage="\
-Usage: autoreconf [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--verbose] [--version]"
-
-localdir=
-verbose=no
-show_version=no
-
-test -z "$AC_MACRODIR" && AC_MACRODIR=/usr/local/share/autoconf
-
-while test $# -gt 0; do
- case "$1" in
- -h | --help | --h*)
- echo "$usage"; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m*)
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- AC_MACRODIR="$1"
- shift ;;
- --verbose | --verb*)
- verbose=yes; shift ;;
- --version | --vers*)
- show_version=yes; shift ;;
- --) # Stop option processing.
- shift; break ;;
- -*) echo "$usage" 1>&2; exit 1 ;;
- *) break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-if test $# -ne 0; then
- echo "$usage" 1>&2; exit 1
-fi
-
-top_autoconf=`echo $0|sed s%autoreconf%autoconf%`
-top_autoheader=`echo $0|sed s%autoreconf%autoheader%`
-
-# The xargs grep filters out Cygnus configure.in files.
-find . -name configure.in -print |
-xargs grep -l AC_OUTPUT |
-sed 's%/configure\.in$%%; s%^./%%' |
-while read dir; do
- (
- cd $dir || continue
-
- case "$dir" in
- .) dots= ;;
- *) # A "../" for each directory in /$dir.
- dots=`echo /$dir|sed 's%/[^/]*%../%g'` ;;
- esac
-
- case "$0" in
- /*) autoconf=$top_autoconf; autoheader=$top_autoheader ;;
- */*) autoconf=$dots$top_autoconf; autoheader=$dots$top_autoheader ;;
- *) autoconf=$top_autoconf; autoheader=$top_autoheader ;;
- esac
-
- case "$AC_MACRODIR" in
- /*) macrodir_opt="--macrodir=$AC_MACRODIR" ;;
- *) macrodir_opt="--macrodir=$dots$AC_MACRODIR" ;;
- esac
-
- case "$localdir" in
- "") localdir_opt= ;;
- /*) localdir_opt="--localdir=$localdir" ;;
- *) localdir_opt="--localdir=$dots$localdir" ;;
- esac
-
- test $verbose = yes && echo running autoconf in $dir
- $autoconf $macrodir_opt $localdir_opt
-
- if grep AC_CONFIG_HEADER configure.in >/dev/null; then
- template=`sed -n '/AC_CONFIG_HEADER/{
-s%[^#]*AC_CONFIG_HEADER(\([^)]*\).*%\1%
-t here
-: here
-s%.*:%%
-t colon
-s%$%.in%
-: colon
-p
-q
-}' configure.in`
- if test ! -f $template || grep autoheader $template >/dev/null; then
- test $verbose = yes && echo running autoheader in $dir
- $autoheader $macrodir_opt $localdir_opt
- fi
- fi
- )
-done
-
diff --git a/util/autoconf/autoreconf.sh b/util/autoconf/autoreconf.sh
deleted file mode 100644
index 4b83f80..0000000
--- a/util/autoconf/autoreconf.sh
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/sh
-# autoreconf - remake all Autoconf configure scripts in a directory tree
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-usage="\
-Usage: autoreconf [-f] [-h] [--help] [-m dir] [--macrodir=dir]
- [-l dir] [--localdir=dir] [--force] [--verbose] [--version]"
-
-localdir=
-verbose=no
-show_version=no
-force=no
-
-test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
-
-while test $# -gt 0; do
- case "$1" in
- -h | --help | --h*)
- echo "$usage"; exit 0 ;;
- --localdir=* | --l*=* )
- localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -l | --localdir | --l*)
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- localdir="${1}"
- shift ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m*)
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- AC_MACRODIR="$1"
- shift ;;
- --verbose | --verb*)
- verbose=yes; shift ;;
- -f | --force)
- force=yes; shift ;;
- --version | --vers*)
- show_version=yes; shift ;;
- --) # Stop option processing.
- shift; break ;;
- -*) echo "$usage" 1>&2; exit 1 ;;
- *) break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-if test $# -ne 0; then
- echo "$usage" 1>&2; exit 1
-fi
-
-top_autoconf=`echo $0|sed s%autoreconf%autoconf%`
-top_autoheader=`echo $0|sed s%autoreconf%autoheader%`
-
-# The xargs grep filters out Cygnus configure.in files.
-find . -name configure.in -print |
-xargs grep -l AC_OUTPUT |
-sed 's%/configure\.in$%%; s%^./%%' |
-while read dir; do
- (
- cd $dir || continue
-
- case "$dir" in
- .) dots= ;;
- *) # A "../" for each directory in /$dir.
- dots=`echo /$dir|sed 's%/[^/]*%../%g'` ;;
- esac
-
- case "$0" in
- /*) autoconf=$top_autoconf; autoheader=$top_autoheader ;;
- */*) autoconf=$dots$top_autoconf; autoheader=$dots$top_autoheader ;;
- *) autoconf=$top_autoconf; autoheader=$top_autoheader ;;
- esac
-
- case "$AC_MACRODIR" in
- /*) macrodir_opt="--macrodir=$AC_MACRODIR" ;;
- *) macrodir_opt="--macrodir=$dots$AC_MACRODIR" ;;
- esac
-
- case "$localdir" in
- "") localdir_opt=
- aclocal=aclocal.m4 ;;
- /*) localdir_opt="--localdir=$localdir"
- aclocal=$localdir/aclocal.m4 ;;
- *) localdir_opt="--localdir=$dots$localdir"
- aclocal=$dots$localdir/aclocal.m4 ;;
- esac
-
- test ! -f $aclocal && aclocal=
-
- if test $force = no && test -f configure &&
- ls -lt configure configure.in $aclocal | sed 1q |
- grep 'configure$' > /dev/null
- then
- :
- else
- test $verbose = yes && echo running autoconf in $dir
- $autoconf $macrodir_opt $localdir_opt
- fi
-
- if grep AC_CONFIG_HEADER configure.in >/dev/null; then
- template=`sed -n '/AC_CONFIG_HEADER/{
-s%[^#]*AC_CONFIG_HEADER(\([^)]*\).*%\1%
-t here
-: here
-s%.*:%%
-t colon
-s%$%.in%
-: colon
-p
-q
-}' configure.in`
- if test ! -f $template || grep autoheader $template >/dev/null; then
- if test $force = no && test -f $template &&
- ls -lt $template configure.in $aclocal | sed 1q |
- grep "$template$" > /dev/null
- then
- :
- else
- test $verbose = yes && echo running autoheader in $dir
- $autoheader $macrodir_opt $localdir_opt
- fi
- fi
- fi
- )
-done
-
diff --git a/util/autoconf/autoscan b/util/autoconf/autoscan
deleted file mode 100755
index 74debe5..0000000
--- a/util/autoconf/autoscan
+++ /dev/null
@@ -1,393 +0,0 @@
-#!/usr/athena/bin/perl
-# autoscan - Create configure.scan (a preliminary configure.in) for a package.
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
-
-require "find.pl";
-
-$datadir = $ENV{"AC_MACRODIR"} || "/usr/local/share/autoconf";
-$verbose = 0;
-# Reference these variables to pacify perl -w.
-undef %identifiers_macros;
-undef %makevars_macros;
-undef %programs_macros;
-
-&parse_args;
-&init_tables;
-&find('.');
-&scan_files;
-&output;
-
-exit 0;
-
-# Process any command line arguments.
-sub parse_args
-{
- local ($usage) =
- "Usage: autoscan [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n";
-
- foreach $_ (@ARGV) {
- if (/^--m[a-z]*=(.*)/) {
- $datadir = $1;
- } elsif (/^--h/) {
- print "$usage";
- exit 0;
- } elsif (/^--verb/) {
- $verbose = 1;
- } elsif (/^--vers/) {
- &version;
- } elsif (/^[^-]/) {
- die "$usage" if defined($srcdir);
- # Top level directory of the package being autoscanned.
- $srcdir = $_;
- } else {
- die "$usage";
- }
- }
-
- $srcdir="." if !defined($srcdir);
-
- print "srcdir=$srcdir\n" if $verbose;
- chdir $srcdir || die "$0: cannot cd to $srcdir: $!\n";
-
- open(CONF, ">configure.scan") ||
- die "$0: cannot create configure.scan: $!\n";
-}
-
-# Print the version number and exit.
-sub version
-{
- open(ACG, "<$datadir/acgeneral.m4") ||
- die "$0: cannot open $datadir/acgeneral.m4: $!\n";
- while (<ACG>) {
- if (/define.AC_ACVERSION.\s*([0-9.]+)/) {
- print "Autoconf version $1\n";
- exit 0;
- }
- }
- die "Autoconf version unknown\n";
-}
-
-# Put values in the tables of what to do with each token.
-sub init_tables
-{
- local($kind, $word, $macro);
-
- # Initialize a table of C keywords (to ignore).
- # Taken from K&R 1st edition p. 180.
- # ANSI C, GNU C, and C++ keywords can introduce portability problems,
- # so don't ignore them.
- foreach $word ('int', 'char', 'float', 'double', 'struct', 'union',
- 'long', 'short', 'unsigned', 'auto', 'extern', 'register',
- 'typedef', 'static', 'goto', 'return', 'sizeof', 'break',
- 'continue', 'if', 'else', 'for', 'do', 'while', 'switch',
- 'case', 'default') {
- $c_keywords{$word} = 0;
- }
-
- # The data file format supports only one line of macros per function.
- # If more than that is required for a common portability problem,
- # a new Autoconf macro should probably be written for that case,
- # instead of duplicating the code in lots of configure.in files.
-
- foreach $kind ('functions', 'headers', 'identifiers', 'programs',
- 'makevars') {
- open(TABLE, "<$datadir/ac$kind") ||
- die "$0: cannot open $datadir/ac$kind: $!\n";
- while (<TABLE>) {
- next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments.
- ($word, $macro) = split;
- eval "\$$kind" . "_macros{\$word} = \$macro";
- }
- close(TABLE);
- }
-}
-
-# Collect names of various kinds of files in the package.
-# Called by &find on each file.
-sub wanted
-{
- if (/^.*\.[chlymC]$/ || /^.*\.cc$/) {
- $name =~ s?^\./??; push(@cfiles, $name);
- }
- elsif (/^[Mm]akefile$/ || /^[Mm]akefile\.in$/ || /^GNUmakefile$/) {
- $name =~ s?^\./??; push(@makefiles, $name);
- }
- elsif (/^.*\.sh$/) {
- $name =~ s?^\./??; push(@shfiles, $name);
- }
-}
-
-# Read through the files and collect lists of tokens in them
-# that might create nonportabilities.
-sub scan_files
-{
- $initfile = $cfiles[0]; # Pick one at random.
-
- if ($verbose) {
- print "cfiles:", join(" ", @cfiles), "\n";
- print "makefiles:", join(" ", @makefiles), "\n";
- print "shfiles:", join(" ", @shfiles), "\n";
- }
-
- foreach $file (@cfiles) {
- &scan_c_file($file);
- }
-
- foreach $file (@makefiles) {
- &scan_makefile($file);
- }
-
- foreach $file (@shfiles) {
- &scan_sh_file($file);
- }
-}
-
-sub scan_c_file
-{
- local($file) = @_;
- local($in_comment) = 0; # Nonzero if in a multiline comment.
-
- open(CFILE, "<$file") || die "$0: cannot open $file: $!\n";
- while (<CFILE>) {
- # Strip out comments, approximately.
- # Ending on this line.
- if ($in_comment && m,\*/,) {
- s,.*\*/,,;
- $in_comment = 0;
- }
- # All on one line.
- s,/\*.*\*/,,g;
- # Starting on this line.
- if (m,/\*,) {
- $in_comment = 1;
- }
- # Continuing on this line.
- next if $in_comment;
-
- # Preprocessor directives.
- if (/^\s*#\s*include\s*<([^>]*)>/) {
- $headers{$1}++;
- }
- # Ignore other preprocessor directives.
- next if /^\s*#/;
-
- # Remove string and character constants.
- s,\"[^\"]*\",,g;
- s,\'[^\']*\',,g;
-
- # Tokens in the code.
- # Maybe we should ignore function definitions (in column 0)?
- while (s/\W([a-zA-Z_]\w*)\s*\(/ /) {
- $functions{$1}++ if !defined($c_keywords{$1});
- }
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
- $identifiers{$1}++ if !defined($c_keywords{$1});
- }
- }
- close(CFILE);
-
- if ($verbose) {
- local($word);
-
- print "\n$file functions:\n";
- foreach $word (sort keys %functions) {
- print "$word $functions{$word}\n";
- }
-
- print "\n$file identifiers:\n";
- foreach $word (sort keys %identifiers) {
- print "$word $identifiers{$word}\n";
- }
-
- print "\n$file headers:\n";
- foreach $word (sort keys %headers) {
- print "$word $headers{$word}\n";
- }
- }
-}
-
-sub scan_makefile
-{
- local($file) = @_;
-
- open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
- while (<MFILE>) {
- # Strip out comments and variable references.
- s/#.*//;
- s/\$\([^\)]*\)//g;
- s/\${[^\}]*}//g;
- s/@[^@]*@//g;
-
- # Variable assignments.
- while (s/\W([a-zA-Z_]\w*)\s*=/ /) {
- $makevars{$1}++;
- }
- # Libraries.
- while (s/\W-l([a-zA-Z_]\w*)\W/ /) {
- $libraries{$1}++;
- }
- # Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
- $programs{$1}++;
- }
- }
- close(MFILE);
-
- if ($verbose) {
- local($word);
-
- print "\n$file makevars:\n";
- foreach $word (sort keys %makevars) {
- print "$word $makevars{$word}\n";
- }
-
- print "\n$file libraries:\n";
- foreach $word (sort keys %libraries) {
- print "$word $libraries{$word}\n";
- }
-
- print "\n$file programs:\n";
- foreach $word (sort keys %programs) {
- print "$word $programs{$word}\n";
- }
- }
-}
-
-sub scan_sh_file
-{
- local($file) = @_;
-
- open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
- while (<MFILE>) {
- # Strip out comments and variable references.
- s/#.*//;
- s/\${[^\}]*}//g;
- s/@[^@]*@//g;
-
- # Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
- $programs{$1}++;
- }
- }
- close(MFILE);
-
- if ($verbose) {
- local($word);
-
- print "\n$file programs:\n";
- foreach $word (sort keys %programs) {
- print "$word $programs{$word}\n";
- }
- }
-}
-
-# Print a configure.in.
-sub output
-{
- local (%unique_makefiles);
-
- print CONF "dnl Process this file with autoconf to produce a configure script.\n";
- print CONF "AC_INIT($initfile)\n";
-
- &output_programs;
- &output_headers;
- &output_identifiers;
- &output_functions;
-
- # Change DIR/Makefile.in to DIR/Makefile.
- foreach $_ (@makefiles) {
- s/\.in$//;
- $unique_makefiles{$_}++;
- }
- print CONF "\nAC_OUTPUT(", join(" ", keys(%unique_makefiles)), ")\n";
-
- close CONF;
-}
-
-# Print Autoconf macro $1 if it's not undef and hasn't been printed already.
-sub print_unique
-{
- local($macro) = @_;
-
- if (defined($macro) && !defined($printed{$macro})) {
- print CONF "$macro\n";
- $printed{$macro} = 1;
- }
-}
-
-sub output_programs
-{
- local ($word);
-
- print CONF "\ndnl Checks for programs.\n";
- foreach $word (sort keys %programs) {
- &print_unique($programs_macros{$word});
- }
- foreach $word (sort keys %makevars) {
- &print_unique($makevars_macros{$word});
- }
- print CONF "\ndnl Checks for libraries.\n";
- foreach $word (sort keys %libraries) {
- print CONF "AC_HAVE_LIBRARY($word)\n";
- }
-}
-
-sub output_headers
-{
- local ($word);
-
- print CONF "\ndnl Checks for header files.\n";
- foreach $word (sort keys %headers) {
- if (defined($headers_macros{$word}) &&
- $headers_macros{$word} eq 'AC_CHECK_HEADERS') {
- push(@have_headers, $word);
- } else {
- &print_unique($headers_macros{$word});
- }
- }
- print CONF "AC_CHECK_HEADERS(" . join(' ', sort(@have_headers)) . ")\n"
- if defined(@have_headers);
-}
-
-sub output_identifiers
-{
- local ($word);
-
- print CONF "\ndnl Checks for typedefs, structures, and compiler characteristics.\n";
- foreach $word (sort keys %identifiers) {
- &print_unique($identifiers_macros{$word});
- }
-}
-
-sub output_functions
-{
- local ($word);
-
- print CONF "\ndnl Checks for library functions.\n";
- foreach $word (sort keys %functions) {
- if (defined($functions_macros{$word}) &&
- $functions_macros{$word} eq 'AC_CHECK_FUNCS') {
- push(@have_funcs, $word);
- } else {
- &print_unique($functions_macros{$word});
- }
- }
- print CONF "AC_CHECK_FUNCS(" . join(' ', sort(@have_funcs)) . ")\n"
- if defined(@have_funcs);
-}
diff --git a/util/autoconf/autoscan.pl b/util/autoconf/autoscan.pl
deleted file mode 100644
index 9f26bfb..0000000
--- a/util/autoconf/autoscan.pl
+++ /dev/null
@@ -1,394 +0,0 @@
-#!@PERL@
-# autoscan - Create configure.scan (a preliminary configure.in) for a package.
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Written by David MacKenzie <djm@gnu.ai.mit.edu>.
-
-require "find.pl";
-
-$datadir = $ENV{"AC_MACRODIR"} || "@datadir@";
-$verbose = 0;
-# Reference these variables to pacify perl -w.
-undef %identifiers_macros;
-undef %makevars_macros;
-undef %programs_macros;
-
-&parse_args;
-&init_tables;
-&find('.');
-&scan_files;
-&output;
-
-exit 0;
-
-# Process any command line arguments.
-sub parse_args
-{
- local ($usage) =
- "Usage: autoscan [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n";
-
- foreach $_ (@ARGV) {
- if (/^--m[a-z]*=(.*)/) {
- $datadir = $1;
- } elsif (/^--h/) {
- print "$usage";
- exit 0;
- } elsif (/^--verb/) {
- $verbose = 1;
- } elsif (/^--vers/) {
- &version;
- } elsif (/^[^-]/) {
- die "$usage" if defined($srcdir);
- # Top level directory of the package being autoscanned.
- $srcdir = $_;
- } else {
- die "$usage";
- }
- }
-
- $srcdir="." if !defined($srcdir);
-
- print "srcdir=$srcdir\n" if $verbose;
- chdir $srcdir || die "$0: cannot cd to $srcdir: $!\n";
-
- open(CONF, ">configure.scan") ||
- die "$0: cannot create configure.scan: $!\n";
-}
-
-# Print the version number and exit.
-sub version
-{
- open(ACG, "<$datadir/acgeneral.m4") ||
- die "$0: cannot open $datadir/acgeneral.m4: $!\n";
- while (<ACG>) {
- if (/define.AC_ACVERSION.\s*([0-9.]+)/) {
- print "Autoconf version $1\n";
- exit 0;
- }
- }
- die "Autoconf version unknown\n";
-}
-
-# Put values in the tables of what to do with each token.
-sub init_tables
-{
- local($kind, $word, $macro);
-
- # Initialize a table of C keywords (to ignore).
- # Taken from K&R 1st edition p. 180.
- # ANSI C, GNU C, and C++ keywords can introduce portability problems,
- # so don't ignore them.
- foreach $word ('int', 'char', 'float', 'double', 'struct', 'union',
- 'long', 'short', 'unsigned', 'auto', 'extern', 'register',
- 'typedef', 'static', 'goto', 'return', 'sizeof', 'break',
- 'continue', 'if', 'else', 'for', 'do', 'while', 'switch',
- 'case', 'default') {
- $c_keywords{$word} = 0;
- }
-
- # The data file format supports only one line of macros per function.
- # If more than that is required for a common portability problem,
- # a new Autoconf macro should probably be written for that case,
- # instead of duplicating the code in lots of configure.in files.
-
- foreach $kind ('functions', 'headers', 'identifiers', 'programs',
- 'makevars') {
- open(TABLE, "<$datadir/ac$kind") ||
- die "$0: cannot open $datadir/ac$kind: $!\n";
- while (<TABLE>) {
- next if /^\s*$/ || /^\s*#/; # Ignore blank lines and comments.
- ($word, $macro) = split;
- eval "\$$kind" . "_macros{\$word} = \$macro";
- }
- close(TABLE);
- }
-}
-
-# Collect names of various kinds of files in the package.
-# Called by &find on each file.
-sub wanted
-{
- if (/^.*\.[chlymC]$/ || /^.*\.cc$/) {
- $name =~ s?^\./??; push(@cfiles, $name);
- }
- elsif (/^[Mm]akefile$/ || /^[Mm]akefile\.in$/ || /^GNUmakefile$/) {
- $name =~ s?^\./??; push(@makefiles, $name);
- }
- elsif (/^.*\.sh$/) {
- $name =~ s?^\./??; push(@shfiles, $name);
- }
-}
-
-# Read through the files and collect lists of tokens in them
-# that might create nonportabilities.
-sub scan_files
-{
- $initfile = $cfiles[0]; # Pick one at random.
-
- if ($verbose) {
- print "cfiles:", join(" ", @cfiles), "\n";
- print "makefiles:", join(" ", @makefiles), "\n";
- print "shfiles:", join(" ", @shfiles), "\n";
- }
-
- foreach $file (@cfiles) {
- &scan_c_file($file);
- }
-
- foreach $file (@makefiles) {
- &scan_makefile($file);
- }
-
- foreach $file (@shfiles) {
- &scan_sh_file($file);
- }
-}
-
-sub scan_c_file
-{
- local($file) = @_;
- local($in_comment) = 0; # Nonzero if in a multiline comment.
-
- open(CFILE, "<$file") || die "$0: cannot open $file: $!\n";
- while (<CFILE>) {
- # Strip out comments, approximately.
- # Ending on this line.
- if ($in_comment && m,\*/,) {
- s,.*\*/,,;
- $in_comment = 0;
- }
- # All on one line.
- s,/\*.*\*/,,g;
- # Starting on this line.
- if (m,/\*,) {
- $in_comment = 1;
- }
- # Continuing on this line.
- next if $in_comment;
-
- # Preprocessor directives.
- if (/^\s*#\s*include\s*<([^>]*)>/) {
- $headers{$1}++;
- }
- # Ignore other preprocessor directives.
- next if /^\s*#/;
-
- # Remove string and character constants.
- s,\"[^\"]*\",,g;
- s,\'[^\']*\',,g;
-
- # Tokens in the code.
- # Maybe we should ignore function definitions (in column 0)?
- while (s/\W([a-zA-Z_]\w*)\s*\(/ /) {
- $functions{$1}++ if !defined($c_keywords{$1});
- }
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
- $identifiers{$1}++ if !defined($c_keywords{$1});
- }
- }
- close(CFILE);
-
- if ($verbose) {
- local($word);
-
- print "\n$file functions:\n";
- foreach $word (sort keys %functions) {
- print "$word $functions{$word}\n";
- }
-
- print "\n$file identifiers:\n";
- foreach $word (sort keys %identifiers) {
- print "$word $identifiers{$word}\n";
- }
-
- print "\n$file headers:\n";
- foreach $word (sort keys %headers) {
- print "$word $headers{$word}\n";
- }
- }
-}
-
-sub scan_makefile
-{
- local($file) = @_;
-
- open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
- while (<MFILE>) {
- # Strip out comments and variable references.
- s/#.*//;
- s/\$\([^\)]*\)//g;
- s/\${[^\}]*}//g;
- s/@[^@]*@//g;
-
- # Variable assignments.
- while (s/\W([a-zA-Z_]\w*)\s*=/ /) {
- $makevars{$1}++;
- }
- # Libraries.
- while (s/\W-l([a-zA-Z_]\w*)\W/ /) {
- $libraries{$1}++;
- }
- # Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
- $programs{$1}++;
- }
- }
- close(MFILE);
-
- if ($verbose) {
- local($word);
-
- print "\n$file makevars:\n";
- foreach $word (sort keys %makevars) {
- print "$word $makevars{$word}\n";
- }
-
- print "\n$file libraries:\n";
- foreach $word (sort keys %libraries) {
- print "$word $libraries{$word}\n";
- }
-
- print "\n$file programs:\n";
- foreach $word (sort keys %programs) {
- print "$word $programs{$word}\n";
- }
- }
-}
-
-sub scan_sh_file
-{
- local($file) = @_;
-
- open(MFILE, "<$file") || die "$0: cannot open $file: $!\n";
- while (<MFILE>) {
- # Strip out comments and variable references.
- s/#.*//;
- s/\${[^\}]*}//g;
- s/@[^@]*@//g;
-
- # Tokens in the code.
- while (s/\W([a-zA-Z_]\w*)\W/ /) {
- $programs{$1}++;
- }
- }
- close(MFILE);
-
- if ($verbose) {
- local($word);
-
- print "\n$file programs:\n";
- foreach $word (sort keys %programs) {
- print "$word $programs{$word}\n";
- }
- }
-}
-
-# Print a configure.in.
-sub output
-{
- local (%unique_makefiles);
-
- print CONF "dnl Process this file with autoconf to produce a configure script.\n";
- print CONF "AC_INIT($initfile)\n";
-
- &output_programs;
- &output_headers;
- &output_identifiers;
- &output_functions;
-
- # Change DIR/Makefile.in to DIR/Makefile.
- foreach $_ (@makefiles) {
- s/\.in$//;
- $unique_makefiles{$_}++;
- }
- print CONF "\nAC_OUTPUT(", join(" ", keys(%unique_makefiles)), ")\n";
-
- close CONF;
-}
-
-# Print Autoconf macro $1 if it's not undef and hasn't been printed already.
-sub print_unique
-{
- local($macro) = @_;
-
- if (defined($macro) && !defined($printed{$macro})) {
- print CONF "$macro\n";
- $printed{$macro} = 1;
- }
-}
-
-sub output_programs
-{
- local ($word);
-
- print CONF "\ndnl Checks for programs.\n";
- foreach $word (sort keys %programs) {
- &print_unique($programs_macros{$word});
- }
- foreach $word (sort keys %makevars) {
- &print_unique($makevars_macros{$word});
- }
- print CONF "\ndnl Checks for libraries.\n";
- foreach $word (sort keys %libraries) {
- print CONF "dnl Replace `\main\' with a function in -l$word:\n";
- print CONF "AC_CHECK_LIB($word, main)\n";
- }
-}
-
-sub output_headers
-{
- local ($word);
-
- print CONF "\ndnl Checks for header files.\n";
- foreach $word (sort keys %headers) {
- if (defined($headers_macros{$word}) &&
- $headers_macros{$word} eq 'AC_CHECK_HEADERS') {
- push(@have_headers, $word);
- } else {
- &print_unique($headers_macros{$word});
- }
- }
- print CONF "AC_CHECK_HEADERS(" . join(' ', sort(@have_headers)) . ")\n"
- if defined(@have_headers);
-}
-
-sub output_identifiers
-{
- local ($word);
-
- print CONF "\ndnl Checks for typedefs, structures, and compiler characteristics.\n";
- foreach $word (sort keys %identifiers) {
- &print_unique($identifiers_macros{$word});
- }
-}
-
-sub output_functions
-{
- local ($word);
-
- print CONF "\ndnl Checks for library functions.\n";
- foreach $word (sort keys %functions) {
- if (defined($functions_macros{$word}) &&
- $functions_macros{$word} eq 'AC_CHECK_FUNCS') {
- push(@have_funcs, $word);
- } else {
- &print_unique($functions_macros{$word});
- }
- }
- print CONF "AC_CHECK_FUNCS(" . join(' ', sort(@have_funcs)) . ")\n"
- if defined(@have_funcs);
-}
diff --git a/util/autoconf/autoupdate b/util/autoconf/autoupdate
deleted file mode 100755
index b69f61b..0000000
--- a/util/autoconf/autoupdate
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/sh
-# autoupdate - modernize a configure.in
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# If given no args, update `configure.in';
-# With one arg, write on the standard output from the given template file.
-#
-# Written by David MacKenzie <djm@gnu.ai.mit.edu>
-
-usage="\
-Usage: autoupdate [-h] [--help] [-m dir] [--macrodir=dir]
- [--version] [template-file]"
-
-sedtmp=/tmp/acups.$$
-# For debugging.
-#sedtmp=/tmp/acups
-show_version=no
-test -z "${AC_MACRODIR}" && AC_MACRODIR=/usr/local/share/autoconf
-
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* )
- echo "${usage}" 1>&2; exit 0 ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m* )
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- AC_MACRODIR="${1}"
- shift ;;
- --version | --versio | --versi | --vers)
- show_version=yes; shift ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "${usage}" 1>&2; exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-: ${SIMPLE_BACKUP_SUFFIX='~'}
-
-tmpout=acupo.$$
-trap 'rm -f $sedtmp $tmpout; exit 1' 1 2 15
-case $# in
- 0) infile=configure.in; out="> $tmpout"
- # Make sure $infile can be read, and $tmpout has the same permissions.
- cp $infile $tmpout || exit
-
- # Make sure $infile can be written.
- if test ! -w $infile; then
- rm -f $tmpout
- echo "$0: $infile: cannot write" >&2
- exit 1
- fi
- ;;
- 1) infile="$1"; out= ;;
- *) echo "$usage" >&2; exit 1 ;;
-esac
-
-# Turn the m4 macro file into a sed script.
-# For each old macro name, make one substitution command to replace it
-# at the end of a line, and one when followed by ( or whitespace.
-# That is easier than splitting the macros up into those that take
-# arguments and those that don't.
-sed -n -e '
-/^AC_DEFUN(/ {
- s//s%/
- s/, *\[indir(\[/$%/
- s/\].*/%/
- p
- s/\$//
- s/%/^/
- s/%/\\([( ]\\)^/
- s/%/\\1^/
- s/\^/%/g
- p
-}' ${AC_MACRODIR}/acoldnames.m4 > $sedtmp
-eval sed -f $sedtmp $infile $out
-
-case $# in
- 0) mv configure.in configure.in${SIMPLE_BACKUP_SUFFIX} &&
- mv $tmpout configure.in ;;
-esac
-
-rm -f $sedtmp $tmpout
-exit 0
diff --git a/util/autoconf/autoupdate.sh b/util/autoconf/autoupdate.sh
deleted file mode 100644
index 8fd1442..0000000
--- a/util/autoconf/autoupdate.sh
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/sh
-# autoupdate - modernize a configure.in
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# If given no args, update `configure.in';
-# With one arg, write on the standard output from the given template file.
-#
-# Written by David MacKenzie <djm@gnu.ai.mit.edu>
-
-usage="\
-Usage: autoupdate [-h] [--help] [-m dir] [--macrodir=dir]
- [--version] [template-file]"
-
-sedtmp=/tmp/acups.$$
-# For debugging.
-#sedtmp=/tmp/acups
-show_version=no
-test -z "${AC_MACRODIR}" && AC_MACRODIR=@datadir@
-
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* )
- echo "${usage}" 1>&2; exit 0 ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m* )
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- AC_MACRODIR="${1}"
- shift ;;
- --version | --versio | --versi | --vers)
- show_version=yes; shift ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "${usage}" 1>&2; exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-: ${SIMPLE_BACKUP_SUFFIX='~'}
-
-tmpout=acupo.$$
-trap 'rm -f $sedtmp $tmpout; exit 1' 1 2 15
-case $# in
- 0) infile=configure.in; out="> $tmpout"
- # Make sure $infile can be read, and $tmpout has the same permissions.
- cp $infile $tmpout || exit
-
- # Make sure $infile can be written.
- if test ! -w $infile; then
- rm -f $tmpout
- echo "$0: $infile: cannot write" >&2
- exit 1
- fi
- ;;
- 1) infile="$1"; out= ;;
- *) echo "$usage" >&2; exit 1 ;;
-esac
-
-# Turn the m4 macro file into a sed script.
-# For each old macro name, make one substitution command to replace it
-# at the end of a line, and one when followed by ( or whitespace.
-# That is easier than splitting the macros up into those that take
-# arguments and those that don't.
-sed -n -e '
-/^AC_DEFUN(/ {
- s//s%/
- s/, *\[indir(\[/$%/
- s/\].*/%/
- p
- s/\$//
- s/%/^/
- s/%/\\([( ]\\)^/
- s/%/\\1^/
- s/\^/%/g
- p
-}' ${AC_MACRODIR}/acoldnames.m4 > $sedtmp
-eval sed -f $sedtmp $infile $out
-
-case $# in
- 0) mv configure.in configure.in${SIMPLE_BACKUP_SUFFIX} &&
- mv $tmpout configure.in ;;
-esac
-
-rm -f $sedtmp $tmpout
-exit 0
diff --git a/util/autoconf/config.cache b/util/autoconf/config.cache
deleted file mode 100644
index 4f62b19..0000000
--- a/util/autoconf/config.cache
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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.
-#
-: ${ac_cv_path_M4='/mit/gnu/rsaixbin/gm4'}
-: ${ac_cv_path_PERL='/usr/athena/bin/perl'}
-: ${ac_cv_path_install='/usr/athena/bin/install -c'}
diff --git a/util/autoconf/config.log b/util/autoconf/config.log
deleted file mode 100644
index fb9038e..0000000
--- a/util/autoconf/config.log
+++ /dev/null
@@ -1,3 +0,0 @@
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
diff --git a/util/autoconf/config.status b/util/autoconf/config.status
deleted file mode 100755
index 4cfaf21..0000000
--- a/util/autoconf/config.status
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host tardis:
-#
-# ./configure
-#
-# 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} ./configure --no-create --no-recursion"
- exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "./config.status generated by autoconf version 2.0"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "$ac_cs_usage"; exit 0 ;;
- *) echo "$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=.
-ac_given_INSTALL="/usr/athena/bin/install -c"
-
-trap 'rm -f Makefile testsuite/Makefile; exit 1' 1 2 15
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
-/^[ ]*VPATH[ ]*=[^:]*$/d
-
-s%@CFLAGS@%%g
-s%@CPPFLAGS@%%g
-s%@CXXFLAGS@%%g
-s%@DEFS@% %g
-s%@LDFLAGS@%%g
-s%@LIBS@%%g
-s%@exec_prefix@%${prefix}%g
-s%@prefix@%/usr/local%g
-s%@program_transform_name@%s,x,x,%g
-s%@M4@%/mit/gnu/rsaixbin/gm4%g
-s%@PERL@%/usr/athena/bin/perl%g
-s%@SCRIPTS@%autoscan%g
-s%@INSTALL_PROGRAM@%${INSTALL}%g
-s%@INSTALL_DATA@%${INSTALL} -m 644%g
-s%@standards_info@%standards.info%g
-s%@standards_dvi@%standards.dvi%g
-
-CEOF
-
-CONFIG_FILES=${CONFIG_FILES-"Makefile testsuite/Makefile"}
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[: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 relative srcdir, etc. 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="/$ac_dir"
- # 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
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
-fi; done
-rm -f conftest.subs
-
-
-
-exit 0
diff --git a/util/autoconf/configure b/util/autoconf/configure
deleted file mode 100755
index 97345c9..0000000
--- a/util/autoconf/configure
+++ /dev/null
@@ -1,736 +0,0 @@
-#!/bin/sh
-
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.1
-# Copyright (C) 1992, 1993, 1994 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:
-
-# 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
-
-# Initialize some other variables.
-subdirs=
-
-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
-
- -build | --build | --buil | --bui | --bu | --b)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
- 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" ;;
-
- -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=PREFIX install architecture-dependent files in PREFIX
- [same as prefix]
- --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
-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
---enable and --with options recognized:$ac_help
-EOF
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$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 ;;
-
- -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 ;;
-
- -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" ;;
-
- -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.1"
- 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 $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 unused; standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 unused; some systems may open it to /dev/tty
-# 4 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 4>/dev/null
-else
- exec 4>&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 LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; 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=acgeneral.m4
-
-# 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} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5'
-ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5'
-
-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
-
-
-
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $.
- echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
-fi
-test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-
-
-for ac_prog in gm4 gnum4 m4
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_path_M4'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- case "$M4" in
- /*)
- ac_cv_path_M4="$M4" # Let the user override the test with a path.
- ;;
- *)
- 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_path_M4="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac
-fi
-M4="$ac_cv_path_M4"
-if test -n "$M4"; then
- echo "$ac_t""$M4" 1>&4
-else
- echo "$ac_t""no" 1>&4
-fi
-
-test -n "$M4" && break
-done
-test -n "$M4" || M4="m4"
-
-
-# Extract the first word of "perl", so it can be a program name with args.
-set dummy perl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_path_PERL'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- case "$PERL" in
- /*)
- ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
- ;;
- *)
- 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_path_PERL="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no"
- ;;
-esac
-fi
-PERL="$ac_cv_path_PERL"
-if test -n "$PERL"; then
- echo "$ac_t""$PERL" 1>&4
-else
- echo "$ac_t""no" 1>&4
-fi
-
-if test "$PERL" != no; then
- SCRIPTS=autoscan
-else
- echo "configure: warning: autoscan will not be built since perl is not found" 1>&2
-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>&4
-if test -z "$INSTALL"; then
-if eval "test \"`echo '${'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- 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"
- # As a last resort, use the slow shell script.
- test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"
-fi
- INSTALL="$ac_cv_path_install"
-fi
-echo "$ac_t""$INSTALL" 1>&4
-
-# 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'
-
-
-# Work with the GNU or Cygnus source tree layout.
-if test -f $srcdir/standards.texi; then
- standards_info=standards.info standards_dvi=standards.dvi
-fi
-
-trap '' 1 2 15
-if test -w $cache_file; then
-echo "updating cache $cache_file"
-cat > $cache_file <<\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
-# Ultrix sh set writes to stderr and can't be redirected directly.
-# Ultrix sh set also returns variables that were read in from the config file
-# with their high bit set.
-(set) 2>&1 | tr '\201-\377' '\001-\177' |
- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
- >> $cache_file
-else
-echo "not updating unwritable cache $cache_file"
-fi
-
-trap 'rm -fr conftest* confdefs* 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
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# 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 <<EOF
-#!/bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/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.1"
- 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 -f Makefile testsuite/Makefile; exit 1' 1 2 15
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g$/%g/' > 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%@M4@%$M4%g
-s%@PERL@%$PERL%g
-s%@SCRIPTS@%$SCRIPTS%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@standards_info@%$standards_info%g
-s%@standards_dvi@%$standards_dvi%g
-
-CEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile testsuite/Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[: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 relative srcdir, etc. 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="/$ac_dir"
- # 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
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
-fi; done
-rm -f conftest.subs
-
-
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
-
diff --git a/util/autoconf/configure.in b/util/autoconf/configure.in
deleted file mode 100644
index 7fd871e..0000000
--- a/util/autoconf/configure.in
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(acgeneral.m4)
-
-AC_ARG_PROGRAM
-
-dnl We use a path for GNU m4 so even if users have another m4 first in
-dnl their path, the installer can configure with a path that has GNU m4
-dnl first and get that path embedded in the installed autoconf and
-dnl autoheader scripts.
-AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
-
-dnl We use a path for perl so the #! line in autoscan will work.
-AC_PATH_PROG(PERL, perl, no)
-AC_SUBST(PERL)dnl
-AC_SUBST(SCRIPTS)dnl
-if test "$PERL" != no; then
- SCRIPTS=autoscan
-else
- AC_MSG_WARN(autoscan will not be built since perl is not found)
-fi
-
-AC_PROG_INSTALL
-
-# Work with the GNU or Cygnus source tree layout.
-if test -f $srcdir/standards.texi; then
- standards_info=standards.info standards_dvi=standards.dvi
-fi
-AC_SUBST(standards_info)dnl
-AC_SUBST(standards_dvi)dnl
-
-AC_OUTPUT(Makefile testsuite/Makefile)
diff --git a/util/autoconf/ifnames b/util/autoconf/ifnames
deleted file mode 100755
index 67f4da1..0000000
--- a/util/autoconf/ifnames
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-# ifnames - print the identifiers used in C preprocessor conditionals
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Reads from stdin if no files are given.
-# Writes to stdout.
-
-# Written by David MacKenzie <djm@gnu.ai.mit.edu>
-
-usage="\
-Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]"
-show_version=no
-
-test -z "$AC_MACRODIR" && AC_MACRODIR=/usr/local/share/autoconf
-
-while test $# -gt 0; do
- case "$1" in
- -h | --help | --h* )
- echo "$usage"; exit 0 ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m* )
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- AC_MACRODIR="$1"
- shift ;;
- --version | --versio | --versi | --vers)
- show_version=yes; shift ;;
- --) # Stop option processing.
- shift; break ;;
- -*) echo "$usage" 1>&2; exit 1 ;;
- *) break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-if test $# -eq 0; then
- cat > stdin
- set stdin
- trap 'rm -f stdin' 0
- trap 'rm -f stdin; exit 1' 1 3 15
-fi
-
-for arg
-do
-# The first two substitutions remove comments. Not perfect, but close enough.
-# The second is for comments that end on a later line. The others do:
-# Enclose identifiers in @ and a space.
-# Handle "#if 0" -- there are no @s to trigger removal.
-# Remove non-identifiers.
-# Remove any spaces at the end.
-# Translate any other spaces to newlines.
-sed -n '
-s%/\*[^/]*\*/%%g
-s%/\*[^/]*%%g
-/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p
-/^[ ]*#[ ]*e*l*if[ ]/{
- s///
- s/@//g
- s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g
- s/$/@ /
- s/@defined //g
- s/[^@]*@\([^ ]* \)[^@]*/\1/g
- s/ *$//
- s/ /\
-/g
- p
-}
-' $arg | sort -u | sed 's%$% '$arg'%'
-done | awk '
-{ files[$1] = files[$1] " " $2 }
-END { for (sym in files) print sym files[sym] }' | sort
diff --git a/util/autoconf/ifnames.sh b/util/autoconf/ifnames.sh
deleted file mode 100644
index cd95da8..0000000
--- a/util/autoconf/ifnames.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-# ifnames - print the identifiers used in C preprocessor conditionals
-# Copyright (C) 1994 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Reads from stdin if no files are given.
-# Writes to stdout.
-
-# Written by David MacKenzie <djm@gnu.ai.mit.edu>
-
-usage="\
-Usage: ifnames [-h] [--help] [-m dir] [--macrodir=dir] [--version] [file...]"
-show_version=no
-
-test -z "$AC_MACRODIR" && AC_MACRODIR=@datadir@
-
-while test $# -gt 0; do
- case "$1" in
- -h | --help | --h* )
- echo "$usage"; exit 0 ;;
- --macrodir=* | --m*=* )
- AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`"
- shift ;;
- -m | --macrodir | --m* )
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- AC_MACRODIR="$1"
- shift ;;
- --version | --versio | --versi | --vers)
- show_version=yes; shift ;;
- --) # Stop option processing.
- shift; break ;;
- -*) echo "$usage" 1>&2; exit 1 ;;
- *) break ;;
- esac
-done
-
-if test $show_version = yes; then
- version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
- $AC_MACRODIR/acgeneral.m4`
- echo "Autoconf version $version"
- exit 0
-fi
-
-if test $# -eq 0; then
- cat > stdin
- set stdin
- trap 'rm -f stdin' 0
- trap 'rm -f stdin; exit 1' 1 3 15
-fi
-
-for arg
-do
-# The first two substitutions remove comments. Not perfect, but close enough.
-# The second is for comments that end on a later line. The others do:
-# Enclose identifiers in @ and a space.
-# Handle "#if 0" -- there are no @s to trigger removal.
-# Remove non-identifiers.
-# Remove any spaces at the end.
-# Translate any other spaces to newlines.
-sed -n '
-s%/\*[^/]*\*/%%g
-s%/\*[^/]*%%g
-/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p
-/^[ ]*#[ ]*e*l*if[ ]/{
- s///
- s/@//g
- s/\([A-Za-z_][A-Za-z_0-9]*\)/@\1 /g
- s/$/@ /
- s/@defined //g
- s/[^@]*@\([^ ]* \)[^@]*/\1/g
- s/ *$//
- s/ /\
-/g
- p
-}
-' $arg | sort -u | sed 's%$% '$arg'%'
-done | awk '
-{ files[$1] = files[$1] " " $2 }
-END { for (sym in files) print sym files[sym] }' | sort
diff --git a/util/autoconf/install.texi b/util/autoconf/install.texi
deleted file mode 100644
index bff0738..0000000
--- a/util/autoconf/install.texi
+++ /dev/null
@@ -1,193 +0,0 @@
-@c This file is included by autoconf.texi and is used to produce
-@c the INSTALL file.
-
-@node Basic Installation
-@section Basic Installation
-
-These are generic installation instructions.
-
-The @code{configure} shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a @file{Makefile} in each directory of the
-package. It may also create one or more @file{.h} files containing
-system-dependent definitions. Finally, it creates a shell script
-@file{config.status} that you can run in the future to recreate the
-current configuration, a file @file{config.cache} that saves the results
-of its tests to speed up reconfiguring, and a file @file{config.log}
-containing compiler output (useful mainly for debugging
-@code{configure}).
-
-If you need to do unusual things to compile the package, please try to
-figure out how @code{configure} could check whether to do them, and mail
-diffs or instructions to the address given in the @file{README} so they
-can be considered for the next release. If at some point
-@file{config.cache} contains results you don't want to keep, you may
-remove or edit it.
-
-The file @file{configure.in} is used to create @file{configure} by a
-program called @code{autoconf}. You only need @file{configure.in} if
-you want to change it or regenerate @file{configure} using a newer
-version of @code{autoconf}.
-
-@noindent
-The simplest way to compile this package is:
-
-@enumerate
-@item
-@code{cd} to the directory containing the package's source code and type
-@samp{./configure} to configure the package for your system. If you're
-using @code{csh} on an old version of System V, you might need to type
-@samp{sh ./configure} instead to prevent @code{csh} from trying to
-execute @code{configure} itself.
-
-Running @code{configure} takes awhile. While running, it prints some
-messages telling which features it is checking for.
-
-@item
-Type @samp{make} to compile the package.
-
-@item
-Optionally, type @samp{make check} to run any self-tests that come with
-the package.
-
-@item
-Type @samp{make install} to install the programs and any data files and
-documentation.
-
-@item
-You can remove the program binaries and object files from the source
-directory by typing @samp{make clean}. To also remove the files that
-@code{configure} created (so you can compile the package for a different
-kind of computer), type @samp{make distclean}.
-@end enumerate
-
-@node Compilers and Options
-@section Compilers and Options
-
-Some systems require unusual options for compilation or linking that
-the @code{configure} script does not know about. You can give
-@code{configure} initial values for variables by setting them in the
-environment. Using a Bourne-compatible shell, you can do that on the
-command line like this:
-@example
-CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
-@end example
-
-@noindent
-Or on systems that have the @code{env} program, you can do it like this:
-@example
-env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
-@end example
-
-@node Build Directory
-@section Using a Different Build Directory
-
-You can compile the package in a different directory from the one
-containing the source code. Doing so allows you to compile it on more
-than one kind of computer at the same time. To do this, you must use a
-version of @code{make} that supports the @code{VPATH} variable, such as
-GNU @code{make}. @code{cd} to the directory where you want the object
-files and executables to go and run the @code{configure} script.
-@code{configure} automatically checks for the source code in the
-directory that @code{configure} is in and in @file{..}.
-
-@node Installation Names
-@section Installation Names
-
-By default, @samp{make install} will install the package's files in
-@file{/usr/local/bin}, @file{/usr/local/man}, etc. You can specify an
-installation prefix other than @file{/usr/local} by giving
-@code{configure} the option @samp{--prefix=@var{path}}.
-
-You can specify separate installation prefixes for architecture-specific
-files and architecture-independent files. If you give @code{configure}
-the option @samp{--exec-prefix=@var{path}}, the package will use
-@var{path} as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
-If the package supports it, you can cause programs to be installed with
-an extra prefix or suffix on their names by giving @code{configure} the
-option @samp{--program-prefix=@var{PREFIX}} or
-@samp{--program-suffix=@var{SUFFIX}}.
-
-@node Optional Features
-@section Optional Features
-
-Some packages pay attention to @samp{--enable-@var{feature}} options to
-@code{configure}, where @var{feature} indicates an optional part of the
-package. They may also pay attention to @samp{--with-@var{package}}
-options, where @var{package} is something like @samp{gnu-as} or @samp{x}
-(for the X Window System). The @file{README} should mention any
-@samp{--enable-} and @samp{--with-} options that the package recognizes.
-
-For packages that use the X Window System, @code{configure} can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the @code{configure} options @samp{--x-includes=@var{dir}}
-and @samp{--x-libraries=@var{dir}} to specify their locations.
-
-@node System Type
-@section Specifying the System Type
-
-There may be some features @code{configure} can not figure out
-automatically, but needs to determine by the type of host the package
-will run on. Usually @code{configure} can figure that out, but if it
-prints a message saying it can not guess the host type, give it the
-@samp{--host=@var{type}} option. @var{type} can either be a short name
-for the system type, such as @samp{sun4}, or a canonical name with three
-fields:
-@example
-@var{cpu}-@var{company}-@var{system}
-@end example
-@noindent
-See the file @file{config.sub} for the possible values of each field.
-If @file{config.sub} isn't included in this package, then this package
-doesn't need to know the host type.
-
-If you are building compiler tools for cross-compiling, you can also use
-the @samp{--target=@var{type}} option to select the type of system
-they will produce code for and the @samp{--build=@var{type}} option
-to select the type of system on which you are compiling the package.
-
-@node Sharing Defaults
-@section Sharing Defaults
-
-If you want to set default values for @code{configure} scripts to share,
-you can create a site shell script called @file{config.site} that gives
-default values for variables like @code{CC}, @code{cache_file}, and
-@code{prefix}. @code{configure} looks for
-@file{@var{prefix}/share/config.site} if it exists, then
-@file{@var{prefix}/etc/config.site} if it exists. Or, you can set
-the @code{CONFIG_SITE} environment variable to the location of the site
-script. A warning: not all @code{configure} scripts look for a site script.
-
-@node Operation Controls
-@section Operation Controls
-
-@code{configure} recognizes the following options to control how it
-operates.
-
-@table @code
-@item --cache-file=@var{file}
-Save the results of the tests in @var{file} instead of
-@file{config.cache}. Set @var{file} to @file{/dev/null} to disable
-caching, for debugging @code{configure}.
-
-@item --help
-Print a summary of the options to @code{configure}, and exit.
-
-@item --quiet
-@itemx --silent
-@itemx -q
-Do not print messages saying which checks are being made.
-
-@item --srcdir=@var{dir}
-Look for the package's source code in directory @var{dir}. Usually
-@code{configure} can determine that directory automatically.
-
-@item --version
-Print the version of Autoconf used to generate the @code{configure}
-script, and exit.
-@end table
-
-@noindent
-@code{configure} also accepts some other, not widely useful, options.
diff --git a/util/autoconf/make-stds.texi b/util/autoconf/make-stds.texi
deleted file mode 100644
index 95a42ec..0000000
--- a/util/autoconf/make-stds.texi
+++ /dev/null
@@ -1,625 +0,0 @@
-@comment This file is included by both standards.texi and make.texinfo.
-@comment It was broken out of standards.texi on 1/6/93 by roland.
-
-@node Makefile Conventions
-@chapter Makefile Conventions
-@comment standards.texi does not print an index, but make.texinfo does.
-@cindex makefile, conventions for
-@cindex conventions for makefiles
-@cindex standards for makefiles
-
-This chapter describes conventions for writing the Makefiles for GNU programs.
-
-@menu
-* Makefile Basics::
-* Utilities in Makefiles::
-* Standard Targets::
-* Command Variables::
-* Directory Variables::
-@end menu
-
-@node Makefile Basics
-@section General Conventions for Makefiles
-
-Every Makefile should contain this line:
-
-@example
-SHELL = /bin/sh
-@end example
-
-@noindent
-to avoid trouble on systems where the @code{SHELL} variable might be
-inherited from the environment. (This is never a problem with GNU
-@code{make}.)
-
-Different @code{make} programs have incompatible suffix lists and
-implicit rules, and this sometimes creates confusion or misbehavior. So
-it is a good idea to set the suffix list explicitly using only the
-suffixes you need in the particular Makefile, like this:
-
-@example
-.SUFFIXES:
-.SUFFIXES: .c .o
-@end example
-
-@noindent
-The first line clears out the suffix list, the second introduces all
-suffixes which may be subject to implicit rules in this Makefile.
-
-Don't assume that @file{.} is in the path for command execution. When
-you need to run programs that are a part of your package during the
-make, please make sure that it uses @file{./} if the program is built as
-part of the make or @file{$(srcdir)/} if the file is an unchanging part
-of the source code. Without one of these prefixes, the current search
-path is used.
-
-The distinction between @file{./} and @file{$(srcdir)/} is important
-when using the @samp{--srcdir} option to @file{configure}. A rule of
-the form:
-
-@smallexample
-foo.1 : foo.man sedscript
- sed -e sedscript foo.man > foo.1
-@end smallexample
-
-@noindent
-will fail when the current directory is not the source directory,
-because @file{foo.man} and @file{sedscript} are not in the current
-directory.
-
-When using GNU @code{make}, relying on @samp{VPATH} to find the source
-file will work in the case where there is a single dependency file,
-since the @file{make} automatic variable @samp{$<} will represent the
-source file wherever it is. (Many versions of @code{make} set @samp{$<}
-only in implicit rules.) A makefile target like
-
-@smallexample
-foo.o : bar.c
- $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o
-@end smallexample
-
-@noindent
-should instead be written as
-
-@smallexample
-foo.o : bar.c
- $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@@
-@end smallexample
-
-@noindent
-in order to allow @samp{VPATH} to work correctly. When the target has
-multiple dependencies, using an explicit @samp{$(srcdir)} is the easiest
-way to make the rule work well. For example, the target above for
-@file{foo.1} is best written as:
-
-@smallexample
-foo.1 : foo.man sedscript
- sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
-@end smallexample
-
-@node Utilities in Makefiles
-@section Utilities in Makefiles
-
-Write the Makefile commands (and any shell scripts, such as
-@code{configure}) to run in @code{sh}, not in @code{csh}. Don't use any
-special features of @code{ksh} or @code{bash}.
-
-The @code{configure} script and the Makefile rules for building and
-installation should not use any utilities directly except these:
-
-@example
-cat cmp cp echo egrep expr grep
-ln mkdir mv pwd rm rmdir sed test touch
-@end example
-
-Stick to the generally supported options for these programs. For
-example, don't use @samp{mkdir -p}, convenient as it may be, because
-most systems don't support it.
-
-The Makefile rules for building and installation can also use compilers
-and related programs, but should do so via @code{make} variables so that the
-user can substitute alternatives. Here are some of the programs we
-mean:
-
-@example
-ar bison cc flex install ld lex
-make makeinfo ranlib texi2dvi yacc
-@end example
-
-Use the following @code{make} variables:
-
-@example
-$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX)
-$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
-@end example
-
-When you use @code{ranlib}, you should make sure nothing bad happens if
-the system does not have @code{ranlib}. Arrange to ignore an error
-from that command, and print a message before the command to tell the
-user that failure of the @code{ranlib} command does not mean a problem.
-
-If you use symbolic links, you should implement a fallback for systems
-that don't have symbolic links.
-
-It is ok to use other utilities in Makefile portions (or scripts)
-intended only for particular systems where you know those utilities to
-exist.
-
-@node Standard Targets
-@section Standard Targets for Users
-
-All GNU programs should have the following targets in their Makefiles:
-
-@table @samp
-@item all
-Compile the entire program. This should be the default target. This
-target need not rebuild any documentation files; Info files should
-normally be included in the distribution, and DVI files should be made
-only when explicitly asked for.
-
-@item install
-Compile the program and copy the executables, libraries, and so on to
-the file names where they should reside for actual use. If there is a
-simple test to verify that a program is properly installed, this target
-should run that test.
-
-The commands should create all the directories in which files are to be
-installed, if they don't already exist. This includes the directories
-specified as the values of the variables @code{prefix} and
-@code{exec_prefix}, as well as all subdirectories that are needed.
-One way to do this is by means of an @code{installdirs} target
-as described below.
-
-Use @samp{-} before any command for installing a man page, so that
-@code{make} will ignore any errors. This is in case there are systems
-that don't have the Unix man page documentation system installed.
-
-The way to install Info files is to copy them into @file{$(infodir)}
-with @code{$(INSTALL_DATA)} (@pxref{Command Variables}), and then run
-the @code{install-info} program if it is present. @code{install-info}
-is a script that edits the Info @file{dir} file to add or update the
-menu entry for the given Info file; it will be part of the Texinfo package.
-Here is a sample rule to install an Info file:
-
-@comment This example has been carefully formatted for the Make manual.
-@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
-@smallexample
-$(infodir)/foo.info: foo.info
-# There may be a newer info file in . than in srcdir.
- -if test -f foo.info; then d=.; \
- else d=$(srcdir); fi; \
- $(INSTALL_DATA) $$d/foo.info $@@; \
-# Run install-info only if it exists.
-# Use `if' instead of just prepending `-' to the
-# line so we notice real errors from install-info.
-# We use `$(SHELL) -c' because some shells do not
-# fail gracefully when there is an unknown command.
- if $(SHELL) -c 'install-info --version' \
- >/dev/null 2>&1; then \
- install-info --infodir=$(infodir) $$d/foo.info; \
- else true; fi
-@end smallexample
-
-@item uninstall
-Delete all the installed files that the @samp{install} target would
-create (but not the noninstalled files such as @samp{make all} would
-create).
-
-@comment The gratuitous blank line here is to make the table look better
-@comment in the printed Make manual. Please leave it in.
-@item clean
-
-Delete all files from the current directory that are normally created by
-building the program. Don't delete the files that record the
-configuration. Also preserve files that could be made by building, but
-normally aren't because the distribution comes with them.
-
-Delete @file{.dvi} files here if they are not part of the distribution.
-
-@item distclean
-Delete all files from the current directory that are created by
-configuring or building the program. If you have unpacked the source
-and built the program without creating any other files, @samp{make
-distclean} should leave only the files that were in the distribution.
-
-@item mostlyclean
-Like @samp{clean}, but may refrain from deleting a few files that people
-normally don't want to recompile. For example, the @samp{mostlyclean}
-target for GCC does not delete @file{libgcc.a}, because recompiling it
-is rarely necessary and takes a lot of time.
-
-@item realclean
-Delete everything from the current directory that can be reconstructed
-with this Makefile. This typically includes everything deleted by
-@code{distclean}, plus more: C source files produced by Bison, tags tables,
-Info files, and so on.
-
-One exception, however: @samp{make realclean} should not delete
-@file{configure} even if @file{configure} can be remade using a rule in
-the Makefile. More generally, @samp{make realclean} should not delete
-anything that needs to exist in order to run @file{configure}
-and then begin to build the program.
-
-@item TAGS
-Update a tags table for this program.
-
-@item info
-Generate any Info files needed. The best way to write the rules is as
-follows:
-
-@smallexample
-info: foo.info
-
-foo.info: foo.texi chap1.texi chap2.texi
- $(MAKEINFO) $(srcdir)/foo.texi
-@end smallexample
-
-@noindent
-You must define the variable @code{MAKEINFO} in the Makefile. It should
-run the @code{makeinfo} program, which is part of the Texinfo
-distribution.
-
-@item dvi
-Generate DVI files for all TeXinfo documentation.
-For example:
-
-@smallexample
-dvi: foo.dvi
-
-foo.dvi: foo.texi chap1.texi chap2.texi
- $(TEXI2DVI) $(srcdir)/foo.texi
-@end smallexample
-
-@noindent
-You must define the variable @code{TEXI2DVI} in the Makefile. It should
-run the program @code{texi2dvi}, which is part of the Texinfo
-distribution. Alternatively, write just the dependencies, and allow GNU
-Make to provide the command.
-
-@item dist
-Create a distribution tar file for this program. The tar file should be
-set up so that the file names in the tar file start with a subdirectory
-name which is the name of the package it is a distribution for. This
-name can include the version number.
-
-For example, the distribution tar file of GCC version 1.40 unpacks into
-a subdirectory named @file{gcc-1.40}.
-
-The easiest way to do this is to create a subdirectory appropriately
-named, use @code{ln} or @code{cp} to install the proper files in it, and
-then @code{tar} that subdirectory.
-
-The @code{dist} target should explicitly depend on all non-source files
-that are in the distribution, to make sure they are up to date in the
-distribution.
-@xref{Releases, , Making Releases, standards, GNU Coding Standards}.
-
-@item check
-Perform self-tests (if any). The user must build the program before
-running the tests, but need not install the program; you should write
-the self-tests so that they work when the program is built but not
-installed.
-@end table
-
-The following targets are suggested as conventional names, for programs
-in which they are useful.
-
-@table @code
-@item installcheck
-Perform installation tests (if any). The user must build and install
-the program before running the tests. You should not assume that
-@file{$(bindir)} is in the search path.
-
-@item installdirs
-It's useful to add a target named @samp{installdirs} to create the
-directories where files are installed, and their parent directories.
-There is a script called @file{mkinstalldirs} which is convenient for
-this; find it in the Texinfo package.@c It's in /gd/gnu/lib/mkinstalldirs.
-You can use a rule like this:
-
-@comment This has been carefully formatted to look decent in the Make manual.
-@comment Please be sure not to make it extend any further to the right.--roland
-@smallexample
-# Make sure all installation directories (e.g. $(bindir))
-# actually exist by making them if necessary.
-installdirs: mkinstalldirs
- $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
- $(libdir) $(infodir) \
- $(mandir)
-@end smallexample
-@end table
-
-@node Command Variables
-@section Variables for Specifying Commands
-
-Makefiles should provide variables for overriding certain commands, options,
-and so on.
-
-In particular, you should run most utility programs via variables.
-Thus, if you use Bison, have a variable named @code{BISON} whose default
-value is set with @samp{BISON = bison}, and refer to it with
-@code{$(BISON)} whenever you need to use Bison.
-
-File management utilities such as @code{ln}, @code{rm}, @code{mv}, and
-so on, need not be referred to through variables in this way, since users
-don't need to replace them with other programs.
-
-Each program-name variable should come with an options variable that is
-used to supply options to the program. Append @samp{FLAGS} to the
-program-name variable name to get the options variable name---for
-example, @code{BISONFLAGS}. (The name @code{CFLAGS} is an exception to
-this rule, but we keep it because it is standard.) Use @code{CPPFLAGS}
-in any compilation command that runs the preprocessor, and use
-@code{LDFLAGS} in any compilation command that does linking as well as
-in any direct use of @code{ld}.
-
-If there are C compiler options that @emph{must} be used for proper
-compilation of certain files, do not include them in @code{CFLAGS}.
-Users expect to be able to specify @code{CFLAGS} freely themselves.
-Instead, arrange to pass the necessary options to the C compiler
-independently of @code{CFLAGS}, by writing them explicitly in the
-compilation commands or by defining an implicit rule, like this:
-
-@smallexample
-CFLAGS = -g
-ALL_CFLAGS = -I. $(CFLAGS)
-.c.o:
- $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
-@end smallexample
-
-Do include the @samp{-g} option in @code{CFLAGS}, because that is not
-@emph{required} for proper compilation. You can consider it a default
-that is only recommended. If the package is set up so that it is
-compiled with GCC by default, then you might as well include @samp{-O}
-in the default value of @code{CFLAGS} as well.
-
-Put @code{CFLAGS} last in the compilation command, after other variables
-containing compiler options, so the user can use @code{CFLAGS} to
-override the others.
-
-Every Makefile should define the variable @code{INSTALL}, which is the
-basic command for installing a file into the system.
-
-Every Makefile should also define the variables @code{INSTALL_PROGRAM}
-and @code{INSTALL_DATA}. (The default for each of these should be
-@code{$(INSTALL)}.) Then it should use those variables as the commands
-for actual installation, for executables and nonexecutables
-respectively. Use these variables as follows:
-
-@example
-$(INSTALL_PROGRAM) foo $(bindir)/foo
-$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
-@end example
-
-@noindent
-Always use a file name, not a directory name, as the second argument of
-the installation commands. Use a separate command for each file to be
-installed.
-
-@node Directory Variables
-@section Variables for Installation Directories
-
-Installation directories should always be named by variables, so it is
-easy to install in a nonstandard place. The standard names for these
-variables are as follows.
-
-These two variables set the root for the installation. All the other
-installation directories should be subdirectories of one of these two,
-and nothing should be directly installed into these two directories.
-
-@table @samp
-@item prefix
-A prefix used in constructing the default values of the variables listed
-below. The default value of @code{prefix} should be @file{/usr/local}
-(at least for now).
-
-@item exec_prefix
-A prefix used in constructing the default values of some of the
-variables listed below. The default value of @code{exec_prefix} should
-be @code{$(prefix)}.
-
-Generally, @code{$(exec_prefix)} is used for directories that contain
-machine-specific files (such as executables and subroutine libraries),
-while @code{$(prefix)} is used directly for other directories.
-@end table
-
-Executable programs are installed in one of the following directories.
-
-@table @samp
-@item bindir
-The directory for installing executable programs that users can run.
-This should normally be @file{/usr/local/bin}, but write it as
-@file{$(exec_prefix)/bin}.
-
-@item sbindir
-The directory for installing executable programs that can be run from
-the shell, but are only generally useful to system administrators. This
-should normally be @file{/usr/local/sbin}, but write it as
-@file{$(exec_prefix)/sbin}.
-
-@item libexecdir
-@comment This paragraph adjusted to avoid overfull hbox --roland 5jul94
-The directory for installing executable programs to be run by other
-programs rather than by users. This directory should normally be
-@file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}.
-@end table
-
-Data files used by the program during its execution are divided into
-categories in two ways.
-
-@itemize @bullet
-@item
-Some files are normally modified by programs; others are never normally
-modified (though users may edit some of these).
-
-@item
-Some files are architecture-independent and can be shared by all
-machines at a site; some are architecture-dependent and can be shared
-only by machines of the same kind and operating system; others may never
-be shared between two machines.
-@end itemize
-
-This makes for six different possibilities. However, we want to
-discourage the use of architecture-dependent files, aside from of object
-files and libraries. It is much cleaner to make other data files
-architecture-independent, and it is generally not hard.
-
-Therefore, here are the variables makefiles should use to specify
-directories:
-
-@table @samp
-@item datadir
-The directory for installing read-only architecture independent data
-files. This should normally be @file{/usr/local/share}, but write it as
-@file{$(prefix)/share}. As a special exception, see @file{$(infodir)}
-and @file{$(includedir)} below.
-
-@item sysconfdir
-The directory for installing read-only data files that pertain to a
-single machine--that is to say, files for configuring a host. Mailer
-and network configuration files, @file{/etc/passwd}, and so forth belong
-here. All the files in this directory should be ordinary ASCII text
-files. This directory should normally be @file{/usr/local/etc}, but
-write it as @file{$(prefix)/etc}.
-
-@c rewritten to avoid overfull hbox --tower
-Do not install executables
-@c here
-in this directory (they probably
-belong in @file{$(libexecdir)} or @file{$(sbindir))}. Also do not
-install files that are modified in the normal course of their use
-(programs whose purpose is to change the configuration of the system
-excluded). Those probably belong in @file{$(localstatedir)}.
-
-@item sharedstatedir
-The directory for installing architecture-independent data files which
-the programs modify while they run. This should normally be
-@file{/usr/local/com}, but write it as @file{$(prefix)/com}.
-
-@item localstatedir
-The directory for installing data files which the programs modify while
-they run, and that pertain to one specific machine. Users should never
-need to modify files in this directory to configure the package's
-operation; put such configuration information in separate files that go
-in @file{datadir} or @file{$(sysconfdir)}. @file{$(localstatedir)}
-should normally be @file{/usr/local/var}, but write it as
-@file{$(prefix)/var}.
-
-@item libdir
-The directory for object files and libraries of object code. Do not
-install executables here, they probably belong in @file{$(libexecdir)}
-instead. The value of @code{libdir} should normally be
-@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}.
-
-@item infodir
-The directory for installing the Info files for this package. By
-default, it should be @file{/usr/local/info}, but it should be written
-as @file{$(prefix)/info}.
-
-@item includedir
-@c rewritten to avoid overfull hbox --roland
-The directory for installing header files to be included by user
-programs with the C @samp{#include} preprocessor directive. This
-should normally be @file{/usr/local/include}, but write it as
-@file{$(prefix)/include}.
-
-Most compilers other than GCC do not look for header files in
-@file{/usr/local/include}. So installing the header files this way is
-only useful with GCC. Sometimes this is not a problem because some
-libraries are only really intended to work with GCC. But some libraries
-are intended to work with other compilers. They should install their
-header files in two places, one specified by @code{includedir} and one
-specified by @code{oldincludedir}.
-
-@item oldincludedir
-The directory for installing @samp{#include} header files for use with
-compilers other than GCC. This should normally be @file{/usr/include}.
-
-The Makefile commands should check whether the value of
-@code{oldincludedir} is empty. If it is, they should not try to use
-it; they should cancel the second installation of the header files.
-
-A package should not replace an existing header in this directory unless
-the header came from the same package. Thus, if your Foo package
-provides a header file @file{foo.h}, then it should install the header
-file in the @code{oldincludedir} directory if either (1) there is no
-@file{foo.h} there or (2) the @file{foo.h} that exists came from the Foo
-package.
-
-To tell whether @file{foo.h} came from the Foo package, put a magic
-string in the file---part of a comment---and grep for that string.
-@end table
-
-Unix-style man pages are installed in one of the following:
-
-@table @samp
-@item mandir
-The directory for installing the man pages (if any) for this package.
-It should include the suffix for the proper section of the
-manual---usually @samp{1} for a utility. It will normally be
-@file{/usr/local/man/man1}, but you should write it as
-@file{$(prefix)/man/man1}.
-
-@item man1dir
-The directory for installing section 1 man pages.
-@item man2dir
-The directory for installing section 2 man pages.
-@item @dots{}
-Use these names instead of @samp{mandir} if the package needs to install man
-pages in more than one section of the manual.
-
-@strong{Don't make the primary documentation for any GNU software be a
-man page. Write a manual in Texinfo instead. Man pages are just for
-the sake of people running GNU software on Unix, which is a secondary
-application only.}
-
-@item manext
-The file name extension for the installed man page. This should contain
-a period followed by the appropriate digit; it should normally be @samp{.1}.
-
-@item man1ext
-The file name extension for installed section 1 man pages.
-@item man2ext
-The file name extension for installed section 2 man pages.
-@item @dots{}
-Use these names instead of @samp{manext} if the package needs to install man
-pages in more than one section of the manual.
-@end table
-
-And finally, you should set the following variable:
-
-@table @samp
-@item srcdir
-The directory for the sources being compiled. The value of this
-variable is normally inserted by the @code{configure} shell script.
-@end table
-
-For example:
-
-@smallexample
-@c I have changed some of the comments here slightly to fix an overfull
-@c hbox, so the make manual can format correctly. --roland
-# Common prefix for installation directories.
-# NOTE: This directory must exist when you start the install.
-prefix = /usr/local
-exec_prefix = $(prefix)
-# Where to put the executable for the command `gcc'.
-bindir = $(exec_prefix)/bin
-# Where to put the directories used by the compiler.
-libexecdir = $(exec_prefix)/libexec
-# Where to put the Info files.
-infodir = $(prefix)/info
-@end smallexample
-
-If your program installs a large number of files into one of the
-standard user-specified directories, it might be useful to group them
-into a subdirectory particular to that program. If you do this, you
-should write the @code{install} rule to create these subdirectories.
-
-Do not expect the user to include the subdirectory name in the value of
-any of the variables listed above. The idea of having a uniform set of
-variable names for installation directories is to enable the user to
-specify the exact same values for several different GNU packages. In
-order for this to be useful, all the packages must be designed so that
-they will work sensibly when the user does so.
-
diff --git a/util/autoconf/mkinstalldirs b/util/autoconf/mkinstalldirs
deleted file mode 100755
index 91f6d04..0000000
--- a/util/autoconf/mkinstalldirs
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Last modified: 1994-03-25
-# Public domain
-
-errstatus=0
-
-for file in ${1+"$@"} ; do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d in ${1+"$@"} ; do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" || errstatus=$?
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
diff --git a/util/autoconf/standards.info b/util/autoconf/standards.info
deleted file mode 100644
index 7f3dda8..0000000
--- a/util/autoconf/standards.info
+++ /dev/null
@@ -1,60 +0,0 @@
-This is Info file ../standards.info, produced by Makeinfo-1.55 from the
-input file ../standards.texi.
-
-START-INFO-DIR-ENTRY
-* Standards: (standards). GNU coding standards.
-END-INFO-DIR-ENTRY
-
- GNU Coding Standards Copyright (C) 1992, 1993, 1994 Free Software
-Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-
-
-Indirect:
-standards.info-1: 960
-standards.info-2: 49450
-
-Tag Table:
-(Indirect)
-Node: Top960
-Node: Preface2096
-Node: Reading Non-Free Code3138
-Node: Contributions4868
-Node: Change Logs6466
-Node: Compatibility10182
-Node: Makefile Conventions11821
-Node: Makefile Basics12178
-Node: Utilities in Makefiles14522
-Node: Standard Targets16219
-Node: Command Variables23328
-Node: Directory Variables26158
-Node: Configuration35220
-Node: Source Language42244
-Node: Formatting43374
-Node: Comments46664
-Node: Syntactic Conventions49450
-Node: Names52342
-Node: Using Extensions53632
-Node: System Functions55373
-Node: Semantics60176
-Node: Errors63464
-Node: Libraries64667
-Node: Portability65891
-Node: User Interfaces69178
-Node: Documentation85106
-Node: Releases89040
-
-End Tag Table
diff --git a/util/autoconf/standards.info-1 b/util/autoconf/standards.info-1
deleted file mode 100644
index 05178a0..0000000
--- a/util/autoconf/standards.info-1
+++ /dev/null
@@ -1,1188 +0,0 @@
-This is Info file ../standards.info, produced by Makeinfo-1.55 from the
-input file ../standards.texi.
-
-START-INFO-DIR-ENTRY
-* Standards: (standards). GNU coding standards.
-END-INFO-DIR-ENTRY
-
- GNU Coding Standards Copyright (C) 1992, 1993, 1994 Free Software
-Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-
-
-File: standards.info, Node: Top, Next: Preface, Prev: (dir), Up: (dir)
-
-Version
-*******
-
- Last updated 21 September 1994.
-
-* Menu:
-
-* Preface:: About the GNU Coding Standards
-* Reading Non-Free Code:: Referring to Proprietary Programs
-* Contributions:: Accepting Contributions
-* Change Logs:: Recording Changes
-* Compatibility:: Compatibility with Other Implementations
-* Makefile Conventions:: Makefile Conventions
-* Configuration:: How Configuration Should Work
-* Source Language:: Using Languages Other Than C
-* Formatting:: Formatting Your Source Code
-* Comments:: Commenting Your Work
-* Syntactic Conventions:: Clean Use of C Constructs
-* Names:: Naming Variables and Functions
-* Using Extensions:: Using Non-standard Features
-* System Functions:: Portability and "standard" library functions
-* Semantics:: Program Behavior for All Programs
-* Errors:: Formatting Error Messages
-* Libraries:: Library Behavior
-* Portability:: Portability As It Applies to GNU
-* User Interfaces:: Standards for Command Line Interfaces
-* Documentation:: Documenting Programs
-* Releases:: Making Releases
-
-
-File: standards.info, Node: Preface, Next: Reading Non-Free Code, Prev: Top, Up: Top
-
-About the GNU Coding Standards
-******************************
-
- The GNU Coding Standards were written by Richard Stallman and other
-GNU Project volunteers. Their purpose is to make the GNU system clean,
-consistent, and easy to install. This document can also be read as a
-guide to write portable, robust and reliable programs. It focuses on
-programs written in C, but many of the rules and principles are useful
-even if you write in another programming language. The rules often
-state reasons for writing in a certain way.
-
- Corrections or suggestions regarding this document should be sent to
-`gnu@prep.ai.mit.edu'. If you make a suggestion, please include a
-suggested new wording for it; our time is limited. We prefer a context
-diff to the `standards.texi' or `make-stds.texi' files, but if you
-don't have those files, please mail your suggestion anyway.
-
- This release of the GNU Coding Standards was last updated 21
-September 1994.
-
-
-File: standards.info, Node: Reading Non-Free Code, Next: Contributions, Prev: Preface, Up: Top
-
-Referring to Proprietary Programs
-*********************************
-
- Don't in any circumstances refer to Unix source code for or during
-your work on GNU! (Or to any other proprietary programs.)
-
- If you have a vague recollection of the internals of a Unix program,
-this does not absolutely mean you can't write an imitation of it, but
-do try to organize the imitation internally along different lines,
-because this is likely to make the details of the Unix version
-irrelevant and dissimilar to your results.
-
- For example, Unix utilities were generally optimized to minimize
-memory use; if you go for speed instead, your program will be very
-different. You could keep the entire input file in core and scan it
-there instead of using stdio. Use a smarter algorithm discovered more
-recently than the Unix program. Eliminate use of temporary files. Do
-it in one pass instead of two (we did this in the assembler).
-
- Or, on the contrary, emphasize simplicity instead of speed. For some
-applications, the speed of today's computers makes simpler algorithms
-adequate.
-
- Or go for generality. For example, Unix programs often have static
-tables or fixed-size strings, which make for arbitrary limits; use
-dynamic allocation instead. Make sure your program handles NULs and
-other funny characters in the input files. Add a programming language
-for extensibility and write part of the program in that language.
-
- Or turn some parts of the program into independently usable
-libraries. Or use a simple garbage collector instead of tracking
-precisely when to free memory, or use a new GNU facility such as
-obstacks.
-
-
-File: standards.info, Node: Contributions, Next: Change Logs, Prev: Reading Non-Free Code, Up: Top
-
-Accepting Contributions
-***********************
-
- If someone else sends you a piece of code to add to the program you
-are working on, we need legal papers to use it--the same sort of legal
-papers we will need to get from you. *Each* significant contributor to
-a program must sign some sort of legal papers in order for us to have
-clear title to the program. The main author alone is not enough.
-
- So, before adding in any contributions from other people, tell us so
-we can arrange to get the papers. Then wait until we tell you that we
-have received the signed papers, before you actually use the
-contribution.
-
- This applies both before you release the program and afterward. If
-you receive diffs to fix a bug, and they make significant change, we
-need legal papers for it.
-
- You don't need papers for changes of a few lines here or there, since
-they are not significant for copyright purposes. Also, you don't need
-papers if all you get from the suggestion is some ideas, not actual code
-which you use. For example, if you write a different solution to the
-problem, you don't need to get papers.
-
- I know this is frustrating; it's frustrating for us as well. But if
-you don't wait, you are going out on a limb--for example, what if the
-contributor's employer won't sign a disclaimer? You might have to take
-that code out again!
-
- The very worst thing is if you forget to tell us about the other
-contributor. We could be very embarrassed in court some day as a
-result.
-
-
-File: standards.info, Node: Change Logs, Next: Compatibility, Prev: Contributions, Up: Top
-
-Change Logs
-***********
-
- Keep a change log for each directory, describing the changes made to
-source files in that directory. The purpose of this is so that people
-investigating bugs in the future will know about the changes that might
-have introduced the bug. Often a new bug can be found by looking at
-what was recently changed. More importantly, change logs can help
-eliminate conceptual inconsistencies between different parts of a
-program; they can give you a history of how the conflicting concepts
-arose.
-
- Use the Emacs command `M-x add-change' to start a new entry in the
-change log. An entry should have an asterisk, the name of the changed
-file, and then in parentheses the name of the changed functions,
-variables or whatever, followed by a colon. Then describe the changes
-you made to that function or variable.
-
- Separate unrelated entries with blank lines. When two entries
-represent parts of the same change, so that they work together, then
-don't put blank lines between them. Then you can omit the file name
-and the asterisk when successive entries are in the same file.
-
- Here are some examples:
-
- * register.el (insert-register): Return nil.
- (jump-to-register): Likewise.
-
- * sort.el (sort-subr): Return nil.
-
- * tex-mode.el (tex-bibtex-file, tex-file, tex-region):
- Restart the tex shell if process is gone or stopped.
- (tex-shell-running): New function.
-
- * expr.c (store_one_arg): Round size up for move_block_to_reg.
- (expand_call): Round up when emitting USE insns.
- * stmt.c (assign_parms): Round size up for move_block_from_reg.
-
- It's important to name the changed function or variable in full.
-Don't abbreviate them; don't combine them. Subsequent maintainers will
-often search for a function name to find all the change log entries that
-pertain to it; if you abbreviate the name, they won't find it when they
-search. For example, some people are tempted to abbreviate groups of
-function names by writing `* register.el ({insert,jump-to}-register)';
-this is not a good idea, since searching for `jump-to-register' or
-`insert-register' would not find the entry.
-
- There's no need to describe the full purpose of the changes or how
-they work together. It is better to put such explanations in comments
-in the code. That's why just "New function" is enough; there is a
-comment with the function in the source to explain what it does.
-
- However, sometimes it is useful to write one line to describe the
-overall purpose of a large batch of changes.
-
- You can think of the change log as a conceptual "undo list" which
-explains how earlier versions were different from the current version.
-People can see the current version; they don't need the change log to
-tell them what is in it. What they want from a change log is a clear
-explanation of how the earlier version differed.
-
- When you change the calling sequence of a function in a simple
-fashion, and you change all the callers of the function, there is no
-need to make individual entries for all the callers. Just write in the
-entry for the function being called, "All callers changed."
-
- When you change just comments or doc strings, it is enough to write
-an entry for the file, without mentioning the functions. Write just,
-"Doc fix." There's no need to keep a change log for documentation
-files. This is because documentation is not susceptible to bugs that
-are hard to fix. Documentation does not consist of parts that must
-interact in a precisely engineered fashion; to correct an error, you
-need not know the history of the erroneous passage.
-
-
-File: standards.info, Node: Compatibility, Next: Makefile Conventions, Prev: Change Logs, Up: Top
-
-Compatibility with Other Implementations
-****************************************
-
- With certain exceptions, utility programs and libraries for GNU
-should be upward compatible with those in Berkeley Unix, and upward
-compatible with ANSI C if ANSI C specifies their behavior, and upward
-compatible with POSIX if POSIX specifies their behavior.
-
- When these standards conflict, it is useful to offer compatibility
-modes for each of them.
-
- ANSI C and POSIX prohibit many kinds of extensions. Feel free to
-make the extensions anyway, and include a `--ansi' or `--compatible'
-option to turn them off. However, if the extension has a significant
-chance of breaking any real programs or scripts, then it is not really
-upward compatible. Try to redesign its interface.
-
- Many GNU programs suppress extensions that conflict with POSIX if the
-environment variable `POSIXLY_CORRECT' is defined (even if it is
-defined with a null value). Please make your program recognize this
-variable if appropriate.
-
- When a feature is used only by users (not by programs or command
-files), and it is done poorly in Unix, feel free to replace it
-completely with something totally different and better. (For example,
-vi is replaced with Emacs.) But it is nice to offer a compatible
-feature as well. (There is a free vi clone, so we offer it.)
-
- Additional useful features not in Berkeley Unix are welcome.
-Additional programs with no counterpart in Unix may be useful, but our
-first priority is usually to duplicate what Unix already has.
-
-
-File: standards.info, Node: Makefile Conventions, Next: Configuration, Prev: Compatibility, Up: Top
-
-Makefile Conventions
-********************
-
- This chapter describes conventions for writing the Makefiles for GNU
-programs.
-
-* Menu:
-
-* Makefile Basics::
-* Utilities in Makefiles::
-* Standard Targets::
-* Command Variables::
-* Directory Variables::
-
-
-File: standards.info, Node: Makefile Basics, Next: Utilities in Makefiles, Up: Makefile Conventions
-
-General Conventions for Makefiles
-=================================
-
- Every Makefile should contain this line:
-
- SHELL = /bin/sh
-
-to avoid trouble on systems where the `SHELL' variable might be
-inherited from the environment. (This is never a problem with GNU
-`make'.)
-
- Different `make' programs have incompatible suffix lists and
-implicit rules, and this sometimes creates confusion or misbehavior. So
-it is a good idea to set the suffix list explicitly using only the
-suffixes you need in the particular Makefile, like this:
-
- .SUFFIXES:
- .SUFFIXES: .c .o
-
-The first line clears out the suffix list, the second introduces all
-suffixes which may be subject to implicit rules in this Makefile.
-
- Don't assume that `.' is in the path for command execution. When
-you need to run programs that are a part of your package during the
-make, please make sure that it uses `./' if the program is built as
-part of the make or `$(srcdir)/' if the file is an unchanging part of
-the source code. Without one of these prefixes, the current search
-path is used.
-
- The distinction between `./' and `$(srcdir)/' is important when
-using the `--srcdir' option to `configure'. A rule of the form:
-
- foo.1 : foo.man sedscript
- sed -e sedscript foo.man > foo.1
-
-will fail when the current directory is not the source directory,
-because `foo.man' and `sedscript' are not in the current directory.
-
- When using GNU `make', relying on `VPATH' to find the source file
-will work in the case where there is a single dependency file, since
-the `make' automatic variable `$<' will represent the source file
-wherever it is. (Many versions of `make' set `$<' only in implicit
-rules.) A makefile target like
-
- foo.o : bar.c
- $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o
-
-should instead be written as
-
- foo.o : bar.c
- $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@
-
-in order to allow `VPATH' to work correctly. When the target has
-multiple dependencies, using an explicit `$(srcdir)' is the easiest way
-to make the rule work well. For example, the target above for `foo.1'
-is best written as:
-
- foo.1 : foo.man sedscript
- sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@
-
-
-File: standards.info, Node: Utilities in Makefiles, Next: Standard Targets, Prev: Makefile Basics, Up: Makefile Conventions
-
-Utilities in Makefiles
-======================
-
- Write the Makefile commands (and any shell scripts, such as
-`configure') to run in `sh', not in `csh'. Don't use any special
-features of `ksh' or `bash'.
-
- The `configure' script and the Makefile rules for building and
-installation should not use any utilities directly except these:
-
- cat cmp cp echo egrep expr grep
- ln mkdir mv pwd rm rmdir sed test touch
-
- Stick to the generally supported options for these programs. For
-example, don't use `mkdir -p', convenient as it may be, because most
-systems don't support it.
-
- The Makefile rules for building and installation can also use
-compilers and related programs, but should do so via `make' variables
-so that the user can substitute alternatives. Here are some of the
-programs we mean:
-
- ar bison cc flex install ld lex
- make makeinfo ranlib texi2dvi yacc
-
- Use the following `make' variables:
-
- $(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX)
- $(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
-
- When you use `ranlib', you should make sure nothing bad happens if
-the system does not have `ranlib'. Arrange to ignore an error from
-that command, and print a message before the command to tell the user
-that failure of the `ranlib' command does not mean a problem.
-
- If you use symbolic links, you should implement a fallback for
-systems that don't have symbolic links.
-
- It is ok to use other utilities in Makefile portions (or scripts)
-intended only for particular systems where you know those utilities to
-exist.
-
-
-File: standards.info, Node: Standard Targets, Next: Command Variables, Prev: Utilities in Makefiles, Up: Makefile Conventions
-
-Standard Targets for Users
-==========================
-
- All GNU programs should have the following targets in their
-Makefiles:
-
-`all'
- Compile the entire program. This should be the default target.
- This target need not rebuild any documentation files; Info files
- should normally be included in the distribution, and DVI files
- should be made only when explicitly asked for.
-
-`install'
- Compile the program and copy the executables, libraries, and so on
- to the file names where they should reside for actual use. If
- there is a simple test to verify that a program is properly
- installed, this target should run that test.
-
- The commands should create all the directories in which files are
- to be installed, if they don't already exist. This includes the
- directories specified as the values of the variables `prefix' and
- `exec_prefix', as well as all subdirectories that are needed. One
- way to do this is by means of an `installdirs' target as described
- below.
-
- Use `-' before any command for installing a man page, so that
- `make' will ignore any errors. This is in case there are systems
- that don't have the Unix man page documentation system installed.
-
- The way to install Info files is to copy them into `$(infodir)'
- with `$(INSTALL_DATA)' (*note Command Variables::.), and then run
- the `install-info' program if it is present. `install-info' is a
- script that edits the Info `dir' file to add or update the menu
- entry for the given Info file; it will be part of the Texinfo
- package. Here is a sample rule to install an Info file:
-
- $(infodir)/foo.info: foo.info
- # There may be a newer info file in . than in srcdir.
- -if test -f foo.info; then d=.; \
- else d=$(srcdir); fi; \
- $(INSTALL_DATA) $$d/foo.info $@; \
- # Run install-info only if it exists.
- # Use `if' instead of just prepending `-' to the
- # line so we notice real errors from install-info.
- # We use `$(SHELL) -c' because some shells do not
- # fail gracefully when there is an unknown command.
- if $(SHELL) -c 'install-info --version' \
- >/dev/null 2>&1; then \
- install-info --infodir=$(infodir) $$d/foo.info; \
- else true; fi
-
-`uninstall'
- Delete all the installed files that the `install' target would
- create (but not the noninstalled files such as `make all' would
- create).
-
-`clean'
- Delete all files from the current directory that are normally
- created by building the program. Don't delete the files that
- record the configuration. Also preserve files that could be made
- by building, but normally aren't because the distribution comes
- with them.
-
- Delete `.dvi' files here if they are not part of the distribution.
-
-`distclean'
- Delete all files from the current directory that are created by
- configuring or building the program. If you have unpacked the
- source and built the program without creating any other files,
- `make distclean' should leave only the files that were in the
- distribution.
-
-`mostlyclean'
- Like `clean', but may refrain from deleting a few files that people
- normally don't want to recompile. For example, the `mostlyclean'
- target for GCC does not delete `libgcc.a', because recompiling it
- is rarely necessary and takes a lot of time.
-
-`realclean'
- Delete everything from the current directory that can be
- reconstructed with this Makefile. This typically includes
- everything deleted by `distclean', plus more: C source files
- produced by Bison, tags tables, Info files, and so on.
-
- One exception, however: `make realclean' should not delete
- `configure' even if `configure' can be remade using a rule in the
- Makefile. More generally, `make realclean' should not delete
- anything that needs to exist in order to run `configure' and then
- begin to build the program.
-
-`TAGS'
- Update a tags table for this program.
-
-`info'
- Generate any Info files needed. The best way to write the rules
- is as follows:
-
- info: foo.info
-
- foo.info: foo.texi chap1.texi chap2.texi
- $(MAKEINFO) $(srcdir)/foo.texi
-
- You must define the variable `MAKEINFO' in the Makefile. It should
- run the `makeinfo' program, which is part of the Texinfo
- distribution.
-
-`dvi'
- Generate DVI files for all TeXinfo documentation. For example:
-
- dvi: foo.dvi
-
- foo.dvi: foo.texi chap1.texi chap2.texi
- $(TEXI2DVI) $(srcdir)/foo.texi
-
- You must define the variable `TEXI2DVI' in the Makefile. It should
- run the program `texi2dvi', which is part of the Texinfo
- distribution. Alternatively, write just the dependencies, and
- allow GNU Make to provide the command.
-
-`dist'
- Create a distribution tar file for this program. The tar file
- should be set up so that the file names in the tar file start with
- a subdirectory name which is the name of the package it is a
- distribution for. This name can include the version number.
-
- For example, the distribution tar file of GCC version 1.40 unpacks
- into a subdirectory named `gcc-1.40'.
-
- The easiest way to do this is to create a subdirectory
- appropriately named, use `ln' or `cp' to install the proper files
- in it, and then `tar' that subdirectory.
-
- The `dist' target should explicitly depend on all non-source files
- that are in the distribution, to make sure they are up to date in
- the distribution. *Note Making Releases: (standards)Releases.
-
-`check'
- Perform self-tests (if any). The user must build the program
- before running the tests, but need not install the program; you
- should write the self-tests so that they work when the program is
- built but not installed.
-
- The following targets are suggested as conventional names, for
-programs in which they are useful.
-
-`installcheck'
- Perform installation tests (if any). The user must build and
- install the program before running the tests. You should not
- assume that `$(bindir)' is in the search path.
-
-`installdirs'
- It's useful to add a target named `installdirs' to create the
- directories where files are installed, and their parent
- directories. There is a script called `mkinstalldirs' which is
- convenient for this; find it in the Texinfo package.You can use a
- rule like this:
-
- # Make sure all installation directories (e.g. $(bindir))
- # actually exist by making them if necessary.
- installdirs: mkinstalldirs
- $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
- $(libdir) $(infodir) \
- $(mandir)
-
-
-File: standards.info, Node: Command Variables, Next: Directory Variables, Prev: Standard Targets, Up: Makefile Conventions
-
-Variables for Specifying Commands
-=================================
-
- Makefiles should provide variables for overriding certain commands,
-options, and so on.
-
- In particular, you should run most utility programs via variables.
-Thus, if you use Bison, have a variable named `BISON' whose default
-value is set with `BISON = bison', and refer to it with `$(BISON)'
-whenever you need to use Bison.
-
- File management utilities such as `ln', `rm', `mv', and so on, need
-not be referred to through variables in this way, since users don't
-need to replace them with other programs.
-
- Each program-name variable should come with an options variable that
-is used to supply options to the program. Append `FLAGS' to the
-program-name variable name to get the options variable name--for
-example, `BISONFLAGS'. (The name `CFLAGS' is an exception to this
-rule, but we keep it because it is standard.) Use `CPPFLAGS' in any
-compilation command that runs the preprocessor, and use `LDFLAGS' in
-any compilation command that does linking as well as in any direct use
-of `ld'.
-
- If there are C compiler options that *must* be used for proper
-compilation of certain files, do not include them in `CFLAGS'. Users
-expect to be able to specify `CFLAGS' freely themselves. Instead,
-arrange to pass the necessary options to the C compiler independently
-of `CFLAGS', by writing them explicitly in the compilation commands or
-by defining an implicit rule, like this:
-
- CFLAGS = -g
- ALL_CFLAGS = -I. $(CFLAGS)
- .c.o:
- $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
-
- Do include the `-g' option in `CFLAGS', because that is not
-*required* for proper compilation. You can consider it a default that
-is only recommended. If the package is set up so that it is compiled
-with GCC by default, then you might as well include `-O' in the default
-value of `CFLAGS' as well.
-
- Put `CFLAGS' last in the compilation command, after other variables
-containing compiler options, so the user can use `CFLAGS' to override
-the others.
-
- Every Makefile should define the variable `INSTALL', which is the
-basic command for installing a file into the system.
-
- Every Makefile should also define the variables `INSTALL_PROGRAM'
-and `INSTALL_DATA'. (The default for each of these should be
-`$(INSTALL)'.) Then it should use those variables as the commands for
-actual installation, for executables and nonexecutables respectively.
-Use these variables as follows:
-
- $(INSTALL_PROGRAM) foo $(bindir)/foo
- $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
-
-Always use a file name, not a directory name, as the second argument of
-the installation commands. Use a separate command for each file to be
-installed.
-
-
-File: standards.info, Node: Directory Variables, Prev: Command Variables, Up: Makefile Conventions
-
-Variables for Installation Directories
-======================================
-
- Installation directories should always be named by variables, so it
-is easy to install in a nonstandard place. The standard names for these
-variables are as follows.
-
- These two variables set the root for the installation. All the other
-installation directories should be subdirectories of one of these two,
-and nothing should be directly installed into these two directories.
-
-`prefix'
- A prefix used in constructing the default values of the variables
- listed below. The default value of `prefix' should be `/usr/local'
- (at least for now).
-
-`exec_prefix'
- A prefix used in constructing the default values of some of the
- variables listed below. The default value of `exec_prefix' should
- be `$(prefix)'.
-
- Generally, `$(exec_prefix)' is used for directories that contain
- machine-specific files (such as executables and subroutine
- libraries), while `$(prefix)' is used directly for other
- directories.
-
- Executable programs are installed in one of the following
-directories.
-
-`bindir'
- The directory for installing executable programs that users can
- run. This should normally be `/usr/local/bin', but write it as
- `$(exec_prefix)/bin'.
-
-`sbindir'
- The directory for installing executable programs that can be run
- from the shell, but are only generally useful to system
- administrators. This should normally be `/usr/local/sbin', but
- write it as `$(exec_prefix)/sbin'.
-
-`libexecdir'
- The directory for installing executable programs to be run by other
- programs rather than by users. This directory should normally be
- `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'.
-
- Data files used by the program during its execution are divided into
-categories in two ways.
-
- * Some files are normally modified by programs; others are never
- normally modified (though users may edit some of these).
-
- * Some files are architecture-independent and can be shared by all
- machines at a site; some are architecture-dependent and can be
- shared only by machines of the same kind and operating system;
- others may never be shared between two machines.
-
- This makes for six different possibilities. However, we want to
-discourage the use of architecture-dependent files, aside from of object
-files and libraries. It is much cleaner to make other data files
-architecture-independent, and it is generally not hard.
-
- Therefore, here are the variables makefiles should use to specify
-directories:
-
-`datadir'
- The directory for installing read-only architecture independent
- data files. This should normally be `/usr/local/share', but write
- it as `$(prefix)/share'. As a special exception, see `$(infodir)'
- and `$(includedir)' below.
-
-`sysconfdir'
- The directory for installing read-only data files that pertain to a
- single machine-that is to say, files for configuring a host.
- Mailer and network configuration files, `/etc/passwd', and so
- forth belong here. All the files in this directory should be
- ordinary ASCII text files. This directory should normally be
- `/usr/local/etc', but write it as `$(prefix)/etc'.
-
- Do not install executables in this directory (they probably belong
- in `$(libexecdir)' or `$(sbindir))'. Also do not install files
- that are modified in the normal course of their use (programs
- whose purpose is to change the configuration of the system
- excluded). Those probably belong in `$(localstatedir)'.
-
-`sharedstatedir'
- The directory for installing architecture-independent data files
- which the programs modify while they run. This should normally be
- `/usr/local/com', but write it as `$(prefix)/com'.
-
-`localstatedir'
- The directory for installing data files which the programs modify
- while they run, and that pertain to one specific machine. Users
- should never need to modify files in this directory to configure
- the package's operation; put such configuration information in
- separate files that go in `datadir' or `$(sysconfdir)'.
- `$(localstatedir)' should normally be `/usr/local/var', but write
- it as `$(prefix)/var'.
-
-`libdir'
- The directory for object files and libraries of object code. Do
- not install executables here, they probably belong in
- `$(libexecdir)' instead. The value of `libdir' should normally be
- `/usr/local/lib', but write it as `$(exec_prefix)/lib'.
-
-`infodir'
- The directory for installing the Info files for this package. By
- default, it should be `/usr/local/info', but it should be written
- as `$(prefix)/info'.
-
-`includedir'
- The directory for installing header files to be included by user
- programs with the C `#include' preprocessor directive. This
- should normally be `/usr/local/include', but write it as
- `$(prefix)/include'.
-
- Most compilers other than GCC do not look for header files in
- `/usr/local/include'. So installing the header files this way is
- only useful with GCC. Sometimes this is not a problem because some
- libraries are only really intended to work with GCC. But some
- libraries are intended to work with other compilers. They should
- install their header files in two places, one specified by
- `includedir' and one specified by `oldincludedir'.
-
-`oldincludedir'
- The directory for installing `#include' header files for use with
- compilers other than GCC. This should normally be `/usr/include'.
-
- The Makefile commands should check whether the value of
- `oldincludedir' is empty. If it is, they should not try to use
- it; they should cancel the second installation of the header files.
-
- A package should not replace an existing header in this directory
- unless the header came from the same package. Thus, if your Foo
- package provides a header file `foo.h', then it should install the
- header file in the `oldincludedir' directory if either (1) there
- is no `foo.h' there or (2) the `foo.h' that exists came from the
- Foo package.
-
- To tell whether `foo.h' came from the Foo package, put a magic
- string in the file--part of a comment--and grep for that string.
-
- Unix-style man pages are installed in one of the following:
-
-`mandir'
- The directory for installing the man pages (if any) for this
- package. It should include the suffix for the proper section of
- the manual--usually `1' for a utility. It will normally be
- `/usr/local/man/man1', but you should write it as
- `$(prefix)/man/man1'.
-
-`man1dir'
- The directory for installing section 1 man pages.
-
-`man2dir'
- The directory for installing section 2 man pages.
-
-`...'
- Use these names instead of `mandir' if the package needs to
- install man pages in more than one section of the manual.
-
- *Don't make the primary documentation for any GNU software be a
- man page. Write a manual in Texinfo instead. Man pages are just
- for the sake of people running GNU software on Unix, which is a
- secondary application only.*
-
-`manext'
- The file name extension for the installed man page. This should
- contain a period followed by the appropriate digit; it should
- normally be `.1'.
-
-`man1ext'
- The file name extension for installed section 1 man pages.
-
-`man2ext'
- The file name extension for installed section 2 man pages.
-
-`...'
- Use these names instead of `manext' if the package needs to
- install man pages in more than one section of the manual.
-
- And finally, you should set the following variable:
-
-`srcdir'
- The directory for the sources being compiled. The value of this
- variable is normally inserted by the `configure' shell script.
-
- For example:
-
- # Common prefix for installation directories.
- # NOTE: This directory must exist when you start the install.
- prefix = /usr/local
- exec_prefix = $(prefix)
- # Where to put the executable for the command `gcc'.
- bindir = $(exec_prefix)/bin
- # Where to put the directories used by the compiler.
- libexecdir = $(exec_prefix)/libexec
- # Where to put the Info files.
- infodir = $(prefix)/info
-
- If your program installs a large number of files into one of the
-standard user-specified directories, it might be useful to group them
-into a subdirectory particular to that program. If you do this, you
-should write the `install' rule to create these subdirectories.
-
- Do not expect the user to include the subdirectory name in the value
-of any of the variables listed above. The idea of having a uniform set
-of variable names for installation directories is to enable the user to
-specify the exact same values for several different GNU packages. In
-order for this to be useful, all the packages must be designed so that
-they will work sensibly when the user does so.
-
-
-File: standards.info, Node: Configuration, Next: Source Language, Prev: Makefile Conventions, Up: Top
-
-How Configuration Should Work
-*****************************
-
- Each GNU distribution should come with a shell script named
-`configure'. This script is given arguments which describe the kind of
-machine and system you want to compile the program for.
-
- The `configure' script must record the configuration options so that
-they affect compilation.
-
- One way to do this is to make a link from a standard name such as
-`config.h' to the proper configuration file for the chosen system. If
-you use this technique, the distribution should *not* contain a file
-named `config.h'. This is so that people won't be able to build the
-program without configuring it first.
-
- Another thing that `configure' can do is to edit the Makefile. If
-you do this, the distribution should *not* contain a file named
-`Makefile'. Instead, include a file `Makefile.in' which contains the
-input used for editing. Once again, this is so that people won't be
-able to build the program without configuring it first.
-
- If `configure' does write the `Makefile', then `Makefile' should
-have a target named `Makefile' which causes `configure' to be rerun,
-setting up the same configuration that was set up last time. The files
-that `configure' reads should be listed as dependencies of `Makefile'.
-
- All the files which are output from the `configure' script should
-have comments at the beginning explaining that they were generated
-automatically using `configure'. This is so that users won't think of
-trying to edit them by hand.
-
- The `configure' script should write a file named `config.status'
-which describes which configuration options were specified when the
-program was last configured. This file should be a shell script which,
-if run, will recreate the same configuration.
-
- The `configure' script should accept an option of the form
-`--srcdir=DIRNAME' to specify the directory where sources are found (if
-it is not the current directory). This makes it possible to build the
-program in a separate directory, so that the actual source directory is
-not modified.
-
- If the user does not specify `--srcdir', then `configure' should
-check both `.' and `..' to see if it can find the sources. If it finds
-the sources in one of these places, it should use them from there.
-Otherwise, it should report that it cannot find the sources, and should
-exit with nonzero status.
-
- Usually the easy way to support `--srcdir' is by editing a
-definition of `VPATH' into the Makefile. Some rules may need to refer
-explicitly to the specified source directory. To make this possible,
-`configure' can add to the Makefile a variable named `srcdir' whose
-value is precisely the specified directory.
-
- The `configure' script should also take an argument which specifies
-the type of system to build the program for. This argument should look
-like this:
-
- CPU-COMPANY-SYSTEM
-
- For example, a Sun 3 might be `m68k-sun-sunos4.1'.
-
- The `configure' script needs to be able to decode all plausible
-alternatives for how to describe a machine. Thus, `sun3-sunos4.1'
-would be a valid alias. So would `sun3-bsd4.2', since SunOS is
-basically BSD and no other BSD system is used on a Sun. For many
-programs, `vax-dec-ultrix' would be an alias for `vax-dec-bsd', simply
-because the differences between Ultrix and BSD are rarely noticeable,
-but a few programs might need to distinguish them.
-
- There is a shell script called `config.sub' that you can use as a
-subroutine to validate system types and canonicalize aliases.
-
- Other options are permitted to specify in more detail the software
-or hardware present on the machine, and include or exclude optional
-parts of the package:
-
-`--enable-FEATURE[=PARAMETER]'
- Configure the package to build and install an optional user-level
- facility called FEATURE. This allows users to choose which
- optional features to include. Giving an optional PARAMETER of
- `no' should omit FEATURE, if it is built by default.
-
- No `--enable' option should *ever* cause one feature to replace
- another. No `--enable' option should ever substitute one useful
- behavior for another useful behavior. The only proper use for
- `--enable' is for questions of whether to build part of the program
- or exclude it.
-
-`--with-PACKAGE'
- The package PACKAGE will be installed, so configure this package
- to work with PACKAGE.
-
- Possible values of PACKAGE include `x', `x-toolkit', `gnu-as' (or
- `gas'), `gnu-ld', `gnu-libc', and `gdb'.
-
- Do not use a `--with' option to specify the file name to use to
- find certain files. That is outside the scope of what `--with'
- options are for.
-
-`--nfp'
- The target machine has no floating point processor.
-
-`--gas'
- The target machine assembler is GAS, the GNU assembler. This is
- obsolete; users should use `--with-gnu-as' instead.
-
-`--x'
- The target machine has the X Window System installed. This is
- obsolete; users should use `--with-x' instead.
-
- All `configure' scripts should accept all of these "detail" options,
-whether or not they make any difference to the particular package at
-hand. In particular, they should accept any option that starts with
-`--with-' or `--enable-'. This is so users will be able to configure
-an entire GNU source tree at once with a single set of options.
-
- You will note that the categories `--with-' and `--enable-' are
-narrow: they *do not* provide a place for any sort of option you might
-think of. That is deliberate. We want to limit the possible
-configuration options in GNU software. We do not want GNU programs to
-have idiosyncratic configuration options.
-
- Packages that perform part of compilation may support
-cross-compilation. In such a case, the host and target machines for
-the program may be different. The `configure' script should normally
-treat the specified type of system as both the host and the target,
-thus producing a program which works for the same type of machine that
-it runs on.
-
- The way to build a cross-compiler, cross-assembler, or what have
-you, is to specify the option `--host=HOSTTYPE' when running
-`configure'. This specifies the host system without changing the type
-of target system. The syntax for HOSTTYPE is the same as described
-above.
-
- Bootstrapping a cross-compiler requires compiling it on a machine
-other than the host it will run on. Compilation packages accept a
-configuration option `--build=HOSTTYPE' for specifying the
-configuration on which you will compile them, in case that is different
-from the host.
-
- Programs for which cross-operation is not meaningful need not accept
-the `--host' option, because configuring an entire operating system for
-cross-operation is not a meaningful thing.
-
- Some programs have ways of configuring themselves automatically. If
-your program is set up to do this, your `configure' script can simply
-ignore most of its arguments.
-
-
-File: standards.info, Node: Source Language, Next: Formatting, Prev: Configuration, Up: Top
-
-Using Languages Other Than C
-****************************
-
- Using a language other than C is like using a non-standard feature:
-it will cause trouble for users. Even if GCC supports the other
-language, users may find it inconvenient to have to install the
-compiler for that other language in order to build your program. So
-please write in C.
-
- There are three exceptions for this rule:
-
- * It is okay to use a special language if the same program contains
- an interpreter for that language.
-
- Thus, it is not a problem that GNU Emacs contains code written in
- Emacs Lisp, because it comes with a Lisp interpreter.
-
- * It is okay to use another language in a tool specifically intended
- for use with that language.
-
- This is okay because the only people who want to build the tool
- will be those who have installed the other language anyway.
-
- * If an application is not of extremely widespread interest, then
- perhaps it's not important if the application is inconvenient to
- install.
-
-
-File: standards.info, Node: Formatting, Next: Comments, Prev: Source Language, Up: Top
-
-Formatting Your Source Code
-***************************
-
- It is important to put the open-brace that starts the body of a C
-function in column zero, and avoid putting any other open-brace or
-open-parenthesis or open-bracket in column zero. Several tools look
-for open-braces in column zero to find the beginnings of C functions.
-These tools will not work on code not formatted that way.
-
- It is also important for function definitions to start the name of
-the function in column zero. This helps people to search for function
-definitions, and may also help certain tools recognize them. Thus, the
-proper format is this:
-
- static char *
- concat (s1, s2) /* Name starts in column zero here */
- char *s1, *s2;
- { /* Open brace in column zero here */
- ...
- }
-
-or, if you want to use ANSI C, format the definition like this:
-
- static char *
- concat (char *s1, char *s2)
- {
- ...
- }
-
- In ANSI C, if the arguments don't fit nicely on one line, split it
-like this:
-
- int
- lots_of_args (int an_integer, long a_long, short a_short,
- double a_double, float a_float)
- ...
-
- For the body of the function, we prefer code formatted like this:
-
- if (x < foo (y, z))
- haha = bar[4] + 5;
- else
- {
- while (z)
- {
- haha += foo (z, z);
- z--;
- }
- return ++x + bar ();
- }
-
- We find it easier to read a program when it has spaces before the
-open-parentheses and after the commas. Especially after the commas.
-
- When you split an expression into multiple lines, split it before an
-operator, not after one. Here is the right way:
-
- if (foo_this_is_long && bar > win (x, y, z)
- && remaining_condition)
-
- Try to avoid having two operators of different precedence at the same
-level of indentation. For example, don't write this:
-
- mode = (inmode[j] == VOIDmode
- || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])
- ? outmode[j] : inmode[j]);
-
- Instead, use extra parentheses so that the indentation shows the
-nesting:
-
- mode = ((inmode[j] == VOIDmode
- || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])))
- ? outmode[j] : inmode[j]);
-
- Insert extra parentheses so that Emacs will indent the code properly.
-For example, the following indentation looks nice if you do it by hand,
-but Emacs would mess it up:
-
- v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
- + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;
-
- But adding a set of parentheses solves the problem:
-
- v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
- + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);
-
- Format do-while statements like this:
-
- do
- {
- a = foo (a);
- }
- while (a > 0);
-
- Please use formfeed characters (control-L) to divide the program into
-pages at logical places (but not within a function). It does not matter
-just how long the pages are, since they do not have to fit on a printed
-page. The formfeeds should appear alone on lines by themselves.
-
-
-File: standards.info, Node: Comments, Next: Syntactic Conventions, Prev: Formatting, Up: Top
-
-Commenting Your Work
-********************
-
- Every program should start with a comment saying briefly what it is
-for. Example: `fmt - filter for simple filling of text'.
-
- Please put a comment on each function saying what the function does,
-what sorts of arguments it gets, and what the possible values of
-arguments mean and are used for. It is not necessary to duplicate in
-words the meaning of the C argument declarations, if a C type is being
-used in its customary fashion. If there is anything nonstandard about
-its use (such as an argument of type `char *' which is really the
-address of the second character of a string, not the first), or any
-possible values that would not work the way one would expect (such as,
-that strings containing newlines are not guaranteed to work), be sure
-to say so.
-
- Also explain the significance of the return value, if there is one.
-
- Please put two spaces after the end of a sentence in your comments,
-so that the Emacs sentence commands will work. Also, please write
-complete sentences and capitalize the first word. If a lower-case
-identifer comes at the beginning of a sentence, don't capitalize it!
-Changing the spelling makes it a different identifier. If you don't
-like starting a sentence with a lower case letter, write the sentence
-differently (e.g., "The identifier lower-case is ...").
-
- The comment on a function is much clearer if you use the argument
-names to speak about the argument values. The variable name itself
-should be lower case, but write it in upper case when you are speaking
-about the value rather than the variable itself. Thus, "the inode
-number NODE_NUM" rather than "an inode".
-
- There is usually no purpose in restating the name of the function in
-the comment before it, because the reader can see that for himself.
-There might be an exception when the comment is so long that the
-function itself would be off the bottom of the screen.
-
- There should be a comment on each static variable as well, like this:
-
- /* Nonzero means truncate lines in the display;
- zero means continue them. */
- int truncate_lines;
-
- Every `#endif' should have a comment, except in the case of short
-conditionals (just a few lines) that are not nested. The comment should
-state the condition of the conditional that is ending, *including its
-sense*. `#else' should have a comment describing the condition *and
-sense* of the code that follows. For example:
-
- #ifdef foo
- ...
- #else /* not foo */
- ...
- #endif /* not foo */
-
-but, by contrast, write the comments this way for a `#ifndef':
-
- #ifndef foo
- ...
- #else /* foo */
- ...
- #endif /* foo */
-
diff --git a/util/autoconf/standards.info-2 b/util/autoconf/standards.info-2
deleted file mode 100644
index 25570a0..0000000
--- a/util/autoconf/standards.info-2
+++ /dev/null
@@ -1,1691 +0,0 @@
-This is Info file ../standards.info, produced by Makeinfo-1.55 from the
-input file ../standards.texi.
-
-START-INFO-DIR-ENTRY
-* Standards: (standards). GNU coding standards.
-END-INFO-DIR-ENTRY
-
- GNU Coding Standards Copyright (C) 1992, 1993, 1994 Free Software
-Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Free Software Foundation.
-
-
-File: standards.info, Node: Syntactic Conventions, Next: Names, Prev: Comments, Up: Top
-
-Clean Use of C Constructs
-*************************
-
- Please explicitly declare all arguments to functions. Don't omit
-them just because they are `int's.
-
- Declarations of external functions and functions to appear later in
-the source file should all go in one place near the beginning of the
-file (somewhere before the first function definition in the file), or
-else should go in a header file. Don't put `extern' declarations inside
-functions.
-
- It used to be common practice to use the same local variables (with
-names like `tem') over and over for different values within one
-function. Instead of doing this, it is better declare a separate local
-variable for each distinct purpose, and give it a name which is
-meaningful. This not only makes programs easier to understand, it also
-facilitates optimization by good compilers. You can also move the
-declaration of each local variable into the smallest scope that includes
-all its uses. This makes the program even cleaner.
-
- Don't use local variables or parameters that shadow global
-identifiers.
-
- Don't declare multiple variables in one declaration that spans lines.
-Start a new declaration on each line, instead. For example, instead of
-this:
-
- int foo,
- bar;
-
-write either this:
-
- int foo, bar;
-
-or this:
-
- int foo;
- int bar;
-
-(If they are global variables, each should have a comment preceding it
-anyway.)
-
- When you have an `if'-`else' statement nested in another `if'
-statement, always put braces around the `if'-`else'. Thus, never write
-like this:
-
- if (foo)
- if (bar)
- win ();
- else
- lose ();
-
-always like this:
-
- if (foo)
- {
- if (bar)
- win ();
- else
- lose ();
- }
-
- If you have an `if' statement nested inside of an `else' statement,
-either write `else if' on one line, like this,
-
- if (foo)
- ...
- else if (bar)
- ...
-
-with its `then'-part indented like the preceding `then'-part, or write
-the nested `if' within braces like this:
-
- if (foo)
- ...
- else
- {
- if (bar)
- ...
- }
-
- Don't declare both a structure tag and variables or typedefs in the
-same declaration. Instead, declare the structure tag separately and
-then use it to declare the variables or typedefs.
-
- Try to avoid assignments inside `if'-conditions. For example, don't
-write this:
-
- if ((foo = (char *) malloc (sizeof *foo)) == 0)
- fatal ("virtual memory exhausted");
-
-instead, write this:
-
- foo = (char *) malloc (sizeof *foo);
- if (foo == 0)
- fatal ("virtual memory exhausted");
-
- Don't make the program ugly to placate `lint'. Please don't insert
-any casts to `void'. Zero without a cast is perfectly fine as a null
-pointer constant.
-
-
-File: standards.info, Node: Names, Next: Using Extensions, Prev: Syntactic Conventions, Up: Top
-
-Naming Variables and Functions
-******************************
-
- Please use underscores to separate words in a name, so that the Emacs
-word commands can be useful within them. Stick to lower case; reserve
-upper case for macros and `enum' constants, and for name-prefixes that
-follow a uniform convention.
-
- For example, you should use names like `ignore_space_change_flag';
-don't use names like `iCantReadThis'.
-
- Variables that indicate whether command-line options have been
-specified should be named after the meaning of the option, not after
-the option-letter. A comment should state both the exact meaning of
-the option and its letter. For example,
-
- /* Ignore changes in horizontal whitespace (-b). */
- int ignore_space_change_flag;
-
- When you want to define names with constant integer values, use
-`enum' rather than `#define'. GDB knows about enumeration constants.
-
- Use file names of 14 characters or less, to avoid creating gratuitous
-problems on System V. You can use the program `doschk' to test for
-this. `doschk' also tests for potential name conflicts if the files
-were loaded onto an MS-DOS file system--something you may or may not
-care about.
-
-
-File: standards.info, Node: Using Extensions, Next: System Functions, Prev: Names, Up: Top
-
-Using Non-standard Features
-***************************
-
- Many GNU facilities that already exist support a number of convenient
-extensions over the comparable Unix facilities. Whether to use these
-extensions in implementing your program is a difficult question.
-
- On the one hand, using the extensions can make a cleaner program.
-On the other hand, people will not be able to build the program unless
-the other GNU tools are available. This might cause the program to
-work on fewer kinds of machines.
-
- With some extensions, it might be easy to provide both alternatives.
-For example, you can define functions with a "keyword" `INLINE' and
-define that as a macro to expand into either `inline' or nothing,
-depending on the compiler.
-
- In general, perhaps it is best not to use the extensions if you can
-straightforwardly do without them, but to use the extensions if they
-are a big improvement.
-
- An exception to this rule are the large, established programs (such
-as Emacs) which run on a great variety of systems. Such programs would
-be broken by use of GNU extensions.
-
- Another exception is for programs that are used as part of
-compilation: anything that must be compiled with other compilers in
-order to bootstrap the GNU compilation facilities. If these require
-the GNU compiler, then no one can compile them without having them
-installed already. That would be no good.
-
- Since most computer systems do not yet implement ANSI C, using the
-ANSI C features is effectively using a GNU extension, so the same
-considerations apply. (Except for ANSI features that we discourage,
-such as trigraphs--don't ever use them.)
-
-
-File: standards.info, Node: System Functions, Next: Semantics, Prev: Using Extensions, Up: Top
-
-Calling System Functions
-************************
-
- C implementations differ substantially. ANSI C reduces but does not
-eliminate the incompatibilities; meanwhile, many users wish to compile
-GNU software with pre-ANSI compilers. This chapter gives
-recommendations for how to use the more or less standard C library
-functions to avoid unnecessary loss of portability.
-
- * Don't use the value of `sprintf'. It returns the number of
- characters written on some systems, but not on all systems.
-
- * Don't declare system functions explicitly.
-
- Almost any declaration for a system function is wrong on some
- system. To minimize conflicts, leave it to the system header
- files to declare system functions. If the headers don't declare a
- function, let it remain undeclared.
-
- While it may seem unclean to use a function without declaring it,
- in practice this works fine for most system library functions on
- the systems where this really happens. The problem is only
- theoretical. By contrast, actual declarations have frequently
- caused actual conflicts.
-
- * If you must declare a system function, don't specify the argument
- types. Use an old-style declaration, not an ANSI prototype. The
- more you specify about the function, the more likely a conflict.
-
- * In particular, don't unconditionally declare `malloc' or `realloc'.
-
- Most GNU programs use those functions just once, in functions
- conventionally named `xmalloc' and `xrealloc'. These functions
- call `malloc' and `realloc', respectively, and check the results.
-
- Because `xmalloc' and `xrealloc' are defined in your program, you
- can declare them in other files without any risk of type conflict.
-
- On most systems, `int' is the same length as a pointer; thus, the
- calls to `malloc' and `realloc' work fine. For the few
- exceptional systems (mostly 64-bit machines), you can use
- *conditionalized* declarations of `malloc' and `realloc'--or put
- these declarations in configuration files specific to those
- systems.
-
- * The string functions require special treatment. Some Unix systems
- have a header file `string.h'; other have `strings.h'. Neither
- file name is portable. There are two things you can do: use
- Autoconf to figure out which file to include, or don't include
- either file.
-
- * If you don't include either strings file, you can't get
- declarations for the string functions from the header file in the
- usual way.
-
- That causes less of a problem than you might think. The newer ANSI
- string functions are off-limits anyway because many systems still
- don't support them. The string functions you can use are these:
-
- strcpy strncpy strcat strncat
- strlen strcmp strncmp
- strchr strrchr
-
- The copy and concatenate functions work fine without a declaration
- as long as you don't use their values. Using their values without
- a declaration fails on systems where the width of a pointer
- differs from the width of `int', and perhaps in other cases. It
- is trivial to avoid using their values, so do that.
-
- The compare functions and `strlen' work fine without a declaration
- on most systems, possibly all the ones that GNU software runs on.
- You may find it necessary to declare them *conditionally* on a few
- systems.
-
- The search functions must be declared to return `char *'. Luckily,
- there is no variation in the data type they return. But there is
- variation in their names. Some systems give these functions the
- names `index' and `rindex'; other systems use the names `strchr'
- and `strrchr'. Some systems support both pairs of names, but
- neither pair works on all systems.
-
- You should pick a single pair of names and use it throughout your
- program. (Nowadays, it is better to choose `strchr' and
- `strrchr'.) Declare both of those names as functions returning
- `char *'. On systems which don't support those names, define them
- as macros in terms of the other pair. For example, here is what
- to put at the beginning of your file (or in a header) if you want
- to use the names `strchr' and `strrchr' throughout:
-
- #ifndef HAVE_STRCHR
- #define strchr index
- #endif
- #ifndef HAVE_STRRCHR
- #define strrchr rindex
- #endif
-
- char *strchr ();
- char *strrchr ();
-
- Here we assume that `HAVE_STRCHR' and `HAVE_STRRCHR' are macros
-defined in systems where the corresponding functions exist. One way to
-get them properly defined is to use Autoconf.
-
-
-File: standards.info, Node: Semantics, Next: Errors, Prev: System Functions, Up: Top
-
-Program Behavior for All Programs
-*********************************
-
- Avoid arbitrary limits on the length or number of *any* data
-structure, including filenames, lines, files, and symbols, by allocating
-all data structures dynamically. In most Unix utilities, "long lines
-are silently truncated". This is not acceptable in a GNU utility.
-
- Utilities reading files should not drop NUL characters, or any other
-nonprinting characters *including those with codes above 0177*. The
-only sensible exceptions would be utilities specifically intended for
-interface to certain types of printers that can't handle those
-characters.
-
- Check every system call for an error return, unless you know you
-wish to ignore errors. Include the system error text (from `perror' or
-equivalent) in *every* error message resulting from a failing system
-call, as well as the name of the file if any and the name of the
-utility. Just "cannot open foo.c" or "stat failed" is not sufficient.
-
- Check every call to `malloc' or `realloc' to see if it returned
-zero. Check `realloc' even if you are making the block smaller; in a
-system that rounds block sizes to a power of 2, `realloc' may get a
-different block if you ask for less space.
-
- In Unix, `realloc' can destroy the storage block if it returns zero.
-GNU `realloc' does not have this bug: if it fails, the original block
-is unchanged. Feel free to assume the bug is fixed. If you wish to
-run your program on Unix, and wish to avoid lossage in this case, you
-can use the GNU `malloc'.
-
- You must expect `free' to alter the contents of the block that was
-freed. Anything you want to fetch from the block, you must fetch before
-calling `free'.
-
- If `malloc' fails in a noninteractive program, make that a fatal
-error. In an interactive program (one that reads commands from the
-user), it is better to abort the command and return to the command
-reader loop. This allows the user to kill other processes to free up
-virtual memory, and then try the command again.
-
- Use `getopt_long' to decode arguments, unless the argument syntax
-makes this unreasonable.
-
- When static storage is to be written in during program execution, use
-explicit C code to initialize it. Reserve C initialized declarations
-for data that will not be changed.
-
- Try to avoid low-level interfaces to obscure Unix data structures
-(such as file directories, utmp, or the layout of kernel memory), since
-these are less likely to work compatibly. If you need to find all the
-files in a directory, use `readdir' or some other high-level interface.
-These will be supported compatibly by GNU.
-
- By default, the GNU system will provide the signal handling
-functions of BSD and of POSIX. So GNU software should be written to use
-these.
-
- In error checks that detect "impossible" conditions, just abort.
-There is usually no point in printing any message. These checks
-indicate the existence of bugs. Whoever wants to fix the bugs will have
-to read the source code and run a debugger. So explain the problem with
-comments in the source. The relevant data will be in variables, which
-are easy to examine with the debugger, so there is no point moving them
-elsewhere.
-
-
-File: standards.info, Node: Errors, Next: Libraries, Prev: Semantics, Up: Top
-
-Formatting Error Messages
-*************************
-
- Error messages from compilers should look like this:
-
- SOURCE-FILE-NAME:LINENO: MESSAGE
-
- Error messages from other noninteractive programs should look like
-this:
-
- PROGRAM:SOURCE-FILE-NAME:LINENO: MESSAGE
-
-when there is an appropriate source file, or like this:
-
- PROGRAM: MESSAGE
-
-when there is no relevant source file.
-
- In an interactive program (one that is reading commands from a
-terminal), it is better not to include the program name in an error
-message. The place to indicate which program is running is in the
-prompt or with the screen layout. (When the same program runs with
-input from a source other than a terminal, it is not interactive and
-would do best to print error messages using the noninteractive style.)
-
- The string MESSAGE should not begin with a capital letter when it
-follows a program name and/or filename. Also, it should not end with a
-period.
-
- Error messages from interactive programs, and other messages such as
-usage messages, should start with a capital letter. But they should not
-end with a period.
-
-
-File: standards.info, Node: Libraries, Next: Portability, Prev: Errors, Up: Top
-
-Library Behavior
-****************
-
- Try to make library functions reentrant. If they need to do dynamic
-storage allocation, at least try to avoid any nonreentrancy aside from
-that of `malloc' itself.
-
- Here are certain name conventions for libraries, to avoid name
-conflicts.
-
- Choose a name prefix for the library, more than two characters long.
-All external function and variable names should start with this prefix.
-In addition, there should only be one of these in any given library
-member. This usually means putting each one in a separate source file.
-
- An exception can be made when two external symbols are always used
-together, so that no reasonable program could use one without the
-other; then they can both go in the same file.
-
- External symbols that are not documented entry points for the user
-should have names beginning with `_'. They should also contain the
-chosen name prefix for the library, to prevent collisions with other
-libraries. These can go in the same files with user entry points if
-you like.
-
- Static functions and variables can be used as you like and need not
-fit any naming convention.
-
-
-File: standards.info, Node: Portability, Next: User Interfaces, Prev: Libraries, Up: Top
-
-Portability As It Applies to GNU
-********************************
-
- Much of what is called "portability" in the Unix world refers to
-porting to different Unix versions. This is a secondary consideration
-for GNU software, because its primary purpose is to run on top of one
-and only one kernel, the GNU kernel, compiled with one and only one C
-compiler, the GNU C compiler. The amount and kinds of variation among
-GNU systems on different cpu's will be like the variation among Berkeley
-4.3 systems on different cpu's.
-
- All users today run GNU software on non-GNU systems. So supporting a
-variety of non-GNU systems is desirable; simply not paramount. The
-easiest way to achieve portability to a reasonable range of systems is
-to use Autoconf. It's unlikely that your program needs to know more
-information about the host machine than Autoconf can provide, simply
-because most of the programs that need such knowledge have already been
-written.
-
- It is difficult to be sure exactly what facilities the GNU kernel
-will provide, since it isn't finished yet. Therefore, assume you can
-use anything in 4.3; just avoid using the format of semi-internal data
-bases (e.g., directories) when there is a higher-level alternative
-(`readdir').
-
- You can freely assume any reasonably standard facilities in the C
-language, libraries or kernel, because we will find it necessary to
-support these facilities in the full GNU system, whether or not we have
-already done so. The fact that there may exist kernels or C compilers
-that lack these facilities is irrelevant as long as the GNU kernel and
-C compiler support them.
-
- It remains necessary to worry about differences among cpu types, such
-as the difference in byte ordering and alignment restrictions. It's
-unlikely that 16-bit machines will ever be supported by GNU, so there
-is no point in spending any time to consider the possibility that an
-int will be less than 32 bits.
-
- You can assume that all pointers have the same format, regardless of
-the type they point to, and that this is really an integer. There are
-some weird machines where this isn't true, but they aren't important;
-don't waste time catering to them. Besides, eventually we will put
-function prototypes into all GNU programs, and that will probably make
-your program work even on weird machines.
-
- Since some important machines (including the 68000) are big-endian,
-it is important not to assume that the address of an `int' object is
-also the address of its least-significant byte. Thus, don't make the
-following mistake:
-
- int c;
- ...
- while ((c = getchar()) != EOF)
- write(file_descriptor, &c, 1);
-
- You can assume that it is reasonable to use a meg of memory. Don't
-strain to reduce memory usage unless it can get to that level. If your
-program creates complicated data structures, just make them in core and
-give a fatal error if malloc returns zero.
-
- If a program works by lines and could be applied to arbitrary
-user-supplied input files, it should keep only a line in memory, because
-this is not very hard and users will want to be able to operate on input
-files that are bigger than will fit in core all at once.
-
-
-File: standards.info, Node: User Interfaces, Next: Documentation, Prev: Portability, Up: Top
-
-Standards for Command Line Interfaces
-*************************************
-
- Please don't make the behavior of a utility depend on the name used
-to invoke it. It is useful sometimes to make a link to a utility with
-a different name, and that should not change what it does.
-
- Instead, use a run time option or a compilation switch or both to
-select among the alternate behaviors.
-
- Likewise, please don't make the behavior of the program depend on the
-type of output device it is used with. Device independence is an
-important principle of the system's design; do not compromise it merely
-to save someone from typing an option now and then.
-
- If you think one behavior is most useful when the output is to a
-terminal, and another is most useful when the output is a file or a
-pipe, then it is usually best to make the default behavior the one that
-is useful with output to a terminal, and have an option for the other
-behavior.
-
- Compatibility requires certain programs to depend on the type of
-output device. It would be disastrous if `ls' or `sh' did not do so in
-the way all users expect. In some of these cases, we supplement the
-program with a preferred alternate version that does not depend on the
-output device type. For example, we provide a `dir' program much like
-`ls' except that its default output format is always multi-column
-format.
-
- It is a good idea to follow the POSIX guidelines for the
-command-line options of a program. The easiest way to do this is to use
-`getopt' to parse them. Note that the GNU version of `getopt' will
-normally permit options anywhere among the arguments unless the special
-argument `--' is used. This is not what POSIX specifies; it is a GNU
-extension.
-
- Please define long-named options that are equivalent to the
-single-letter Unix-style options. We hope to make GNU more user
-friendly this way. This is easy to do with the GNU function
-`getopt_long'.
-
- One of the advantages of long-named options is that they can be
-consistent from program to program. For example, users should be able
-to expect the "verbose" option of any GNU program which has one, to be
-spelled precisely `--verbose'. To achieve this uniformity, look at the
-table of common long-option names when you choose the option names for
-your program. The table appears below.
-
- If you use names not already in the table, please send
-`gnu@prep.ai.mit.edu' a list of them, with their meanings, so we can
-update the table.
-
- It is usually a good idea for file names given as ordinary arguments
-to be input files only; any output files would be specified using
-options (preferably `-o'). Even if you allow an output file name as an
-ordinary argument for compatibility, try to provide a suitable option
-as well. This will lead to more consistency among GNU utilities, so
-that there are fewer idiosyncracies for users to remember.
-
- Programs should support an option `--version' which prints the
-program's version number on standard output and exits successfully, and
-an option `--help' which prints option usage information on standard
-output and exits successfully. These options should inhibit the normal
-function of the command; they should do nothing except print the
-requested information.
-
-`auto-check'
- `-a' in `recode'.
-
-`auto-reference'
- `-A' in `ptx'.
-
-`after-date'
- `-N' in `tar'.
-
-`all'
- `-a' in `du', `ls', `nm', `stty', `uname', and `unexpand'.
-
-`all-text'
- `-a' in `diff'.
-
-`almost-all'
- `-A' in `ls'.
-
-`append'
- `-a' in `etags', `tee', `time'; `-r' in `tar'.
-
-`archive'
- `-a' in `cp'.
-
-`archive-name'
- `-n' in `shar'.
-
-`arglength'
- `-l' in `m4'.
-
-`ascii'
- `-a' in `diff'.
-
-`assume-new'
- `-W' in Make.
-
-`assume-old'
- `-o' in Make.
-
-`backward-search'
- `-B' in etags.
-
-`basename'
- `-f' in `shar'.
-
-`batch'
- Used in GDB.
-
-`baud'
- Used in GDB.
-
-`before'
- `-b' in `tac'.
-
-`binary'
- `-b' in `cpio' and `diff'.
-
-`bits-per-code'
- `-b' in `shar'.
-
-`block-size'
- Used in `cpio' and `tar'.
-
-`blocks'
- `-b' in `head' and `tail'.
-
-`break-file'
- `-b' in `ptx'.
-
-`brief'
- Used in various programs to make output shorter.
-
-`bytes'
- `-c' in `head', `split', and `tail'.
-
-`c++'
- `-C' in `etags'.
-
-`catenate'
- `-A' in `tar'.
-
-`cd'
- Used in various programs to specify the directory to use.
-
-`changes'
- `-c' in `chgrp' and `chown'.
-
-`classify'
- `-F' in `ls'.
-
-`colons'
- `-c' in `recode'.
-
-`command'
- `-c' in `su'; `-x' in GDB.
-
-`compare'
- `-d' in `tar'.
-
-`compress'
- `-Z' in `tar' and `shar'.
-
-`concatenate'
- `-A' in `tar'.
-
-`confirmation'
- `-w' in `tar'.
-
-`context'
- Used in `diff'.
-
-`copyright'
- `-C' in `ptx' and `recode'.
-
-`core'
- Used in GDB.
-
-`count'
- `-q' in `who'.
-
-`count-links'
- `-l' in `du'.
-
-`create'
- Used in `tar' and `cpio'.
-
-`cut-mark'
- `-c' in `shar'.
-
-`cxref'
- `-x' in `etags'.
-
-`date'
- `-d' in `touch'.
-
-`debug'
- `-d' in Make and `m4'; `-t' in Bison.
-
-`define'
- `-D' in `m4'.
-
-`defines'
- `-d' in Bison and `etags'.
-
-`delete'
- `-D' in `tar'.
-
-`dereference'
- `-L' in `chgrp', `chown', `cpio', `du', `ls', and `tar'.
-
-`dereference-args'
- `-D' in `du'.
-
-`diacritics'
- `-d' in `recode'.
-
-`dictionary-order'
- `-d' in `look'.
-
-`diff'
- `-d' in `tar'.
-
-`digits'
- `-n' in `csplit'.
-
-`directory'
- Specify the directory to use, in various programs. In `ls', it
- means to show directories themselves rather than their contents.
- In `rm' and `ln', it means to not treat links to directories
- specially.
-
-`discard-all'
- `-x' in `strip'.
-
-`discard-locals'
- `-X' in `strip'.
-
-`diversions'
- `-N' in `m4'.
-
-`dry-run'
- `-n' in Make.
-
-`ed'
- `-e' in `diff'.
-
-`elide-empty-files'
- `-z' in `csplit'.
-
-`entire-new-file'
- `-N' in `diff'.
-
-`environment-overrides'
- `-e' in Make.
-
-`eof'
- `-e' in `xargs'.
-
-`epoch'
- Used in GDB.
-
-`error-limit'
- Used in Makeinfo.
-
-`error-output'
- `-o' in `m4'.
-
-`escape'
- `-b' in `ls'.
-
-`exclude-from'
- `-X' in `tar'.
-
-`exec'
- Used in GDB.
-
-`exit'
- `-x' in `xargs'.
-
-`exit-0'
- `-e' in `unshar'.
-
-`expand-tabs'
- `-t' in `diff'.
-
-`expression'
- `-e' in `sed'.
-
-`extern-only'
- `-g' in `nm'.
-
-`extract'
- `-i' in `cpio'; `-x' in `tar'.
-
-`faces'
- `-f' in `finger'.
-
-`fast'
- `-f' in `su'.
-
-`fatal-warnings'
- `-E' in `m4'.
-
-`file'
- `-f' in `info', Make, `mt', and `tar'; `-n' in `sed'; `-r' in
- `touch'.
-
-`file-prefix'
- `-b' in Bison.
-
-`file-type'
- `-F' in `ls'.
-
-`files-from'
- `-T' in `tar'.
-
-`fill-column'
- Used in Makeinfo.
-
-`flag-truncation'
- `-F' in `ptx'.
-
-`fixed-output-files'
- `-y' in Bison.
-
-`follow'
- `-f' in `tail'.
-
-`footnote-style'
- Used in Makeinfo.
-
-`force'
- `-f' in `cp', `ln', `mv', and `rm'.
-
-`force-prefix'
- `-F' in `shar'.
-
-`format'
- Used in `ls', `time', and `ptx'.
-
-`forward-search'
- `-F' in `etags'.
-
-`fullname'
- Used in GDB.
-
-`gap-size'
- `-g' in `ptx'.
-
-`get'
- `-x' in `tar'.
-
-`graphic'
- `-i' in `ul'.
-
-`graphics'
- `-g' in `recode'.
-
-`group'
- `-g' in `install'.
-
-`gzip'
- `-z' in `tar' and `shar'.
-
-`hashsize'
- `-H' in `m4'.
-
-`header'
- `-h' in `objdump' and `recode'
-
-`heading'
- `-H' in `who'.
-
-`help'
- Used to ask for brief usage information.
-
-`here-delimiter'
- `-d' in `shar'.
-
-`hide-control-chars'
- `-q' in `ls'.
-
-`idle'
- `-u' in `who'.
-
-`ifdef'
- `-D' in `diff'.
-
-`ignore'
- `-I' in `ls'; `-x' in `recode'.
-
-`ignore-all-space'
- `-w' in `diff'.
-
-`ignore-backups'
- `-B' in `ls'.
-
-`ignore-blank-lines'
- `-B' in `diff'.
-
-`ignore-case'
- `-f' in `look' and `ptx'; `-i' in `diff'.
-
-`ignore-errors'
- `-i' in Make.
-
-`ignore-file'
- `-i' in `ptx'.
-
-`ignore-indentation'
- `-S' in `etags'.
-
-`ignore-init-file'
- `-f' in Oleo.
-
-`ignore-interrupts'
- `-i' in `tee'.
-
-`ignore-matching-lines'
- `-I' in `diff'.
-
-`ignore-space-change'
- `-b' in `diff'.
-
-`ignore-zeros'
- `-i' in `tar'.
-
-`include'
- `-i' in `etags'; `-I' in `m4'.
-
-`include-dir'
- `-I' in Make.
-
-`incremental'
- `-G' in `tar'.
-
-`info'
- `-i', `-l', and `-m' in Finger.
-
-`initial'
- `-i' in `expand'.
-
-`initial-tab'
- `-T' in `diff'.
-
-`inode'
- `-i' in `ls'.
-
-`interactive'
- `-i' in `cp', `ln', `mv', `rm'; `-e' in `m4'; `-p' in `xargs';
- `-w' in `tar'.
-
-`intermix-type'
- `-p' in `shar'.
-
-`jobs'
- `-j' in Make.
-
-`just-print'
- `-n' in Make.
-
-`keep-going'
- `-k' in Make.
-
-`keep-files'
- `-k' in `csplit'.
-
-`kilobytes'
- `-k' in `du' and `ls'.
-
-`level-for-gzip'
- `-g' in `shar'.
-
-`line-bytes'
- `-C' in `split'.
-
-`lines'
- Used in `split', `head', and `tail'.
-
-`link'
- `-l' in `cpio'.
-
-`list'
- `-t' in `cpio'; `-l' in `recode'.
-
-`list'
- `-t' in `tar'.
-
-`literal'
- `-N' in `ls'.
-
-`load-average'
- `-l' in Make.
-
-`login'
- Used in `su'.
-
-`machine'
- No listing of which programs already use this; someone should
- check to see if any actually do and tell `gnu@prep.ai.mit.edu'.
-
-`macro-name'
- `-M' in `ptx'.
-
-`mail'
- `-m' in `hello' and `uname'.
-
-`make-directories'
- `-d' in `cpio'.
-
-`makefile'
- `-f' in Make.
-
-`mapped'
- Used in GDB.
-
-`max-args'
- `-n' in `xargs'.
-
-`max-chars'
- `-n' in `xargs'.
-
-`max-lines'
- `-l' in `xargs'.
-
-`max-load'
- `-l' in Make.
-
-`max-procs'
- `-P' in `xargs'.
-
-`mesg'
- `-T' in `who'.
-
-`message'
- `-T' in `who'.
-
-`minimal'
- `-d' in `diff'.
-
-`mixed-uuencode'
- `-M' in `shar'.
-
-`mode'
- `-m' in `install', `mkdir', and `mkfifo'.
-
-`modification-time'
- `-m' in `tar'.
-
-`multi-volume'
- `-M' in `tar'.
-
-`name-prefix'
- `-a' in Bison.
-
-`nesting-limit'
- `-L' in `m4'.
-
-`net-headers'
- `-a' in `shar'.
-
-`new-file'
- `-W' in Make.
-
-`no-builtin-rules'
- `-r' in Make.
-
-`no-character-count'
- `-w' in `shar'.
-
-`no-check-existing'
- `-x' in `shar'.
-
-`no-create'
- `-c' in `touch'.
-
-`no-defines'
- `-D' in `etags'.
-
-`no-dereference'
- `-d' in `cp'.
-
-`no-keep-going'
- `-S' in Make.
-
-`no-lines'
- `-l' in Bison.
-
-`no-piping'
- `-P' in `shar'.
-
-`no-prof'
- `-e' in `gprof'.
-
-`no-sort'
- `-p' in `nm'.
-
-`no-split'
- Used in Makeinfo.
-
-`no-static'
- `-a' in `gprof'.
-
-`no-time'
- `-E' in `gprof'.
-
-`no-timestamp'
- `-m' in `shar'.
-
-`no-validate'
- Used in Makeinfo.
-
-`no-verbose'
- `-v' in `shar'.
-
-`no-warn'
- Used in various programs to inhibit warnings.
-
-`node'
- `-n' in `info'.
-
-`nodename'
- `-n' in `uname'.
-
-`nonmatching'
- `-f' in `cpio'.
-
-`nstuff'
- `-n' in `objdump'.
-
-`null'
- `-0' in `xargs'.
-
-`number'
- `-n' in `cat'.
-
-`number-nonblank'
- `-b' in `cat'.
-
-`numeric-sort'
- `-n' in `nm'.
-
-`numeric-uid-gid'
- `-n' in `cpio' and `ls'.
-
-`nx'
- Used in GDB.
-
-`old-archive'
- `-o' in `tar'.
-
-`old-file'
- `-o' in Make.
-
-`one-file-system'
- `-l' in `tar', `cp', and `du'.
-
-`only-file'
- `-o' in `ptx'.
-
-`only-prof'
- `-f' in `gprof'.
-
-`only-time'
- `-F' in `gprof'.
-
-`output'
- In various programs, specify the output file name.
-
-`output-prefix'
- `-o' in `shar'.
-
-`override'
- `-o' in `rm'.
-
-`overwrite'
- `-c' in `unshar'.
-
-`owner'
- `-o' in `install'.
-
-`paginate'
- `-l' in `diff'.
-
-`paragraph-indent'
- Used in Makeinfo.
-
-`parents'
- `-p' in `mkdir' and `rmdir'.
-
-`pass-all'
- `-p' in `ul'.
-
-`pass-through'
- `-p' in `cpio'.
-
-`port'
- `-P' in `finger'.
-
-`portability'
- `-c' in `cpio' and `tar'.
-
-`prefix-builtins'
- `-P' in `m4'.
-
-`prefix'
- `-f' in `csplit'.
-
-`preserve'
- Used in `tar' and `cp'.
-
-`preserve-environment'
- `-p' in `su'.
-
-`preserve-modification-time'
- `-m' in `cpio'.
-
-`preserve-order'
- `-s' in `tar'.
-
-`preserve-permissions'
- `-p' in `tar'.
-
-`print'
- `-l' in `diff'.
-
-`print-chars'
- `-L' in `cmp'.
-
-`print-data-base'
- `-p' in Make.
-
-`print-directory'
- `-w' in Make.
-
-`print-file-name'
- `-o' in `nm'.
-
-`print-symdefs'
- `-s' in `nm'.
-
-`query-user'
- `-X' in `shar'.
-
-`question'
- `-q' in Make.
-
-`quiet'
- Used in many programs to inhibit the usual output. *Note:* every
- program accepting `--quiet' should accept `--silent' as a synonym.
-
-`quote-name'
- `-Q' in `ls'.
-
-`rcs'
- `-n' in `diff'.
-
-`read-full-blocks'
- `-B' in `tar'.
-
-`readnow'
- Used in GDB.
-
-`recon'
- `-n' in Make.
-
-`record-number'
- `-R' in `tar'.
-
-`recursive'
- Used in `chgrp', `chown', `cp', `ls', `diff', and `rm'.
-
-`reference-limit'
- Used in Makeinfo.
-
-`references'
- `-r' in `ptx'.
-
-`regex'
- `-r' in `tac'.
-
-`release'
- `-r' in `uname'.
-
-`relocation'
- `-r' in `objdump'.
-
-`rename'
- `-r' in `cpio'.
-
-`replace'
- `-i' in `xargs'.
-
-`report-identical-files'
- `-s' in `diff'.
-
-`reset-access-time'
- `-a' in `cpio'.
-
-`reverse'
- `-r' in `ls' and `nm'.
-
-`reversed-ed'
- `-f' in `diff'.
-
-`right-side-defs'
- `-R' in `ptx'.
-
-`same-order'
- `-s' in `tar'.
-
-`same-permissions'
- `-p' in `tar'.
-
-`save'
- `-g' in `stty'.
-
-`se'
- Used in GDB.
-
-`sentence-regexp'
- `-S' in `ptx'.
-
-`separate-dirs'
- `-S' in `du'.
-
-`separator'
- `-s' in `tac'.
-
-`sequence'
- Used by `recode' to chose files or pipes for sequencing passes.
-
-`shell'
- `-s' in `su'.
-
-`show-all'
- `-A' in `cat'.
-
-`show-c-function'
- `-p' in `diff'.
-
-`show-ends'
- `-E' in `cat'.
-
-`show-function-line'
- `-F' in `diff'.
-
-`show-tabs'
- `-T' in `cat'.
-
-`silent'
- Used in many programs to inhibit the usual output. *Note:* every
- program accepting `--silent' should accept `--quiet' as a synonym.
-
-`size'
- `-s' in `ls'.
-
-`sort'
- Used in `ls'.
-
-`sparse'
- `-S' in `tar'.
-
-`speed-large-files'
- `-H' in `diff'.
-
-`split-at'
- `-E' in `unshar'.
-
-`split-size-limit'
- `-L' in `shar'.
-
-`squeeze-blank'
- `-s' in `cat'.
-
-`starting-file'
- Used in `tar' and `diff' to specify which file within a directory
- to start processing with.
-
-`stdin-file-list'
- `-S' in `shar'.
-
-`stop'
- `-S' in Make.
-
-`strict'
- `-s' in `recode'.
-
-`strip'
- `-s' in `install'.
-
-`strip-all'
- `-s' in `strip'.
-
-`strip-debug'
- `-S' in `strip'.
-
-`submitter'
- `-s' in `shar'.
-
-`suffix'
- `-S' in `cp', `ln', `mv'.
-
-`suffix-format'
- `-b' in `csplit'.
-
-`sum'
- `-s' in `gprof'.
-
-`summarize'
- `-s' in `du'.
-
-`symbolic'
- `-s' in `ln'.
-
-`symbols'
- Used in GDB and `objdump'.
-
-`synclines'
- `-s' in `m4'.
-
-`sysname'
- `-s' in `uname'.
-
-`tabs'
- `-t' in `expand' and `unexpand'.
-
-`tabsize'
- `-T' in `ls'.
-
-`terminal'
- `-T' in `tput' and `ul'.
-
-`text'
- `-a' in `diff'.
-
-`text-files'
- `-T' in `shar'.
-
-`time'
- Used in `ls' and `touch'.
-
-`to-stdout'
- `-O' in `tar'.
-
-`total'
- `-c' in `du'.
-
-`touch'
- `-t' in Make, `ranlib', and `recode'.
-
-`trace'
- `-t' in `m4'.
-
-`traditional'
- `-t' in `hello'; `-G' in `m4' and `ptx'.
-
-`tty'
- Used in GDB.
-
-`typedefs'
- `-t' in `etags'.
-
-`typedefs-and-c++'
- `-T' in `etags'.
-
-`typeset-mode'
- `-t' in `ptx'.
-
-`uncompress'
- `-z' in `tar'.
-
-`unconditional'
- `-u' in `cpio'.
-
-`undefine'
- `-U' in `m4'.
-
-`undefined-only'
- `-u' in `nm'.
-
-`update'
- `-u' in `cp', `etags', `mv', `tar'.
-
-`uuencode'
- `-B' in `shar'.
-
-`vanilla-operation'
- `-V' in `shar'.
-
-`verbose'
- Print more information about progress. Many programs support this.
-
-`verify'
- `-W' in `tar'.
-
-`version'
- Print the version number.
-
-`version-control'
- `-V' in `cp', `ln', `mv'.
-
-`vgrind'
- `-v' in `etags'.
-
-`volume'
- `-V' in `tar'.
-
-`what-if'
- `-W' in Make.
-
-`whole-size-limit'
- `-l' in `shar'.
-
-`width'
- `-w' in `ls' and `ptx'.
-
-`word-regexp'
- `-W' in `ptx'.
-
-`writable'
- `-T' in `who'.
-
-`zeros'
- `-z' in `gprof'.
-
-
-File: standards.info, Node: Documentation, Next: Releases, Prev: User Interfaces, Up: Top
-
-Documenting Programs
-********************
-
- Please use Texinfo for documenting GNU programs. See the Texinfo
-manual, either the hardcopy or the version in the GNU Emacs Info
-subsystem (`C-h i'). See existing GNU Texinfo files (e.g., those under
-the `man/' directory in the GNU Emacs distribution) for examples.
-
- The title page of the manual should state the version of the program
-which the manual applies to. The Top node of the manual should also
-contain this information. If the manual is changing more frequently
-than or independent of the program, also state a version number for the
-manual in both of these places.
-
- The manual should document all command-line arguments and all
-commands. It should give examples of their use. But don't organize
-the manual as a list of features. Instead, organize it by the concepts
-a user will have before reaching that point in the manual. Address the
-goals that a user will have in mind, and explain how to accomplish
-them. Don't use Unix man pages as a model for how to write GNU
-documentation; they are a bad example to follow.
-
- The manual should have a node named `PROGRAM Invocation' or
-`Invoking PROGRAM', where PROGRAM stands for the name of the program
-being described, as you would type it in the shell to run the program.
-This node (together with its subnodes, if any) should describe the
-program's command line arguments and how to run it (the sort of
-information people would look in a man page for). Start with an
-`@example' containing a template for all the options and arguments that
-the program uses.
-
- Alternatively, put a menu item in some menu whose item name fits one
-of the above patterns. This identifies the node which that item points
-to as the node for this purpose, regardless of the node's actual name.
-
- There will be automatic features for specifying a program name and
-quickly reading just this part of its manual.
-
- If one manual describes several programs, it should have such a node
-for each program described.
-
- In addition to its manual, the package should have a file named
-`NEWS' which contains a list of user-visible changes worth mentioning.
-In each new release, add items to the front of the file and identify
-the version they pertain to. Don't discard old items; leave them in
-the file after the newer items. This way, a user upgrading from any
-previous version can see what is new.
-
- If the `NEWS' file gets very long, move some of the older items into
-a file named `ONEWS' and put a note at the end referring the user to
-that file.
-
- Please do not use the term "pathname" that is used in Unix
-documentation; use "file name" (two words) instead. We use the term
-"path" only for search paths, which are lists of file names.
-
- It is ok to supply a man page for the program as well as a Texinfo
-manual if you wish to. But keep in mind that supporting a man page
-requires continual effort, each time the program is changed. Any time
-you spend on the man page is time taken away from more useful things you
-could contribute.
-
- Thus, even if a user volunteers to donate a man page, you may find
-this gift costly to accept. Unless you have time on your hands, it may
-be better to refuse the man page unless the same volunteer agrees to
-take full responsibility for maintaining it--so that you can wash your
-hands of it entirely. If the volunteer ceases to do the job, then
-don't feel obliged to pick it up yourself; it may be better to withdraw
-the man page until another volunteer offers to carry on with it.
-
- Alternatively, if you expect the discrepancies to be small enough
-that the man page remains useful, put a prominent note near the
-beginning of the man page explaining that you don't maintain it and
-that the Texinfo manual is more authoritative, and describing how to
-access the Texinfo documentation.
-
-
-File: standards.info, Node: Releases, Prev: Documentation, Up: Top
-
-Making Releases
-***************
-
- Package the distribution of Foo version 69.96 in a gzipped tar file
-named `foo-69.96.tar.gz'. It should unpack into a subdirectory named
-`foo-69.96'.
-
- Building and installing the program should never modify any of the
-files contained in the distribution. This means that all the files
-that form part of the program in any way must be classified into "source
-files" and "non-source files". Source files are written by humans and
-never changed automatically; non-source files are produced from source
-files by programs under the control of the Makefile.
-
- Naturally, all the source files must be in the distribution. It is
-okay to include non-source files in the distribution, provided they are
-up-to-date and machine-independent, so that building the distribution
-normally will never modify them. We commonly include non-source files
-produced by Bison, Lex, TeX, and Makeinfo; this helps avoid unnecessary
-dependencies between our distributions, so that users can install
-whichever packages they want to install.
-
- Non-source files that might actually be modified by building and
-installing the program should *never* be included in the distribution.
-So if you do distribute non-source files, always make sure they are up
-to date when you make a new distribution.
-
- Make sure that the directory into which the distribution unpacks (as
-well as any subdirectories) are all world-writable (octal mode 777).
-This is so that old versions of `tar' which preserve the ownership and
-permissions of the files from the tar archive will be able to extract
-all the files even if the user is unprivileged.
-
- Make sure that all the files in the distribution are world-readable.
-
- Make sure that no file name in the distribution is more than 14
-characters long. Likewise, no file created by building the program
-should have a name longer than 14 characters. The reason for this is
-that some systems adhere to a foolish interpretation of the POSIX
-standard, and refuse to open a longer name, rather than truncating as
-they did in the past.
-
- Don't include any symbolic links in the distribution itself. If the
-tar file contains symbolic links, then people cannot even unpack it on
-systems that don't support symbolic links. Also, don't use multiple
-names for one file in different directories, because certain file
-systems cannot handle this and that prevents unpacking the distribution.
-
- Try to make sure that all the file names will be unique on MS-DOG. A
-name on MS-DOG consists of up to 8 characters, optionally followed by a
-period and up to three characters. MS-DOG will truncate extra
-characters both before and after the period. Thus, `foobarhacker.c'
-and `foobarhacker.o' are not ambiguous; they are truncated to
-`foobarha.c' and `foobarha.o', which are distinct.
-
- Include in your distribution a copy of the `texinfo.tex' you used to
-test print any `*.texinfo' files.
-
- Likewise, if your program uses small GNU software packages like
-regex, getopt, obstack, or termcap, include them in the distribution
-file. Leaving them out would make the distribution file a little
-smaller at the expense of possible inconvenience to a user who doesn't
-know what other files to get.
-
-
diff --git a/util/autoconf/standards.texi b/util/autoconf/standards.texi
deleted file mode 100644
index e50b367..0000000
--- a/util/autoconf/standards.texi
+++ /dev/null
@@ -1,2409 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename standards.info
-@settitle GNU Coding Standards
-@c UPDATE THIS DATE WHENEVER YOU MAKE CHANGES!
-@set lastupdate 21 September 1994
-@c %**end of header
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* Standards: (standards). GNU coding standards.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@setchapternewpage off
-
-@ifinfo
-GNU Coding Standards
-Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-@end ignore
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-@end ifinfo
-
-@titlepage
-@title GNU Coding Standards
-@author Richard Stallman
-@author last updated @value{lastupdate}
-@page
-
-@vskip 0pt plus 1filll
-Copyright @copyright{} 1992, 1993 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the entire
-resulting derived work is distributed under the terms of a permission
-notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions,
-except that this permission notice may be stated in a translation approved
-by the Free Software Foundation.
-@end titlepage
-
-@ifinfo
-@node Top, Preface, (dir), (dir)
-@top Version
-
-Last updated @value{lastupdate}.
-@end ifinfo
-
-@menu
-* Preface:: About the GNU Coding Standards
-* Reading Non-Free Code:: Referring to Proprietary Programs
-* Contributions:: Accepting Contributions
-* Change Logs:: Recording Changes
-* Compatibility:: Compatibility with Other Implementations
-* Makefile Conventions:: Makefile Conventions
-* Configuration:: How Configuration Should Work
-* Source Language:: Using Languages Other Than C
-* Formatting:: Formatting Your Source Code
-* Comments:: Commenting Your Work
-* Syntactic Conventions:: Clean Use of C Constructs
-* Names:: Naming Variables and Functions
-* Using Extensions:: Using Non-standard Features
-* System Functions:: Portability and ``standard'' library functions
-* Semantics:: Program Behavior for All Programs
-* Errors:: Formatting Error Messages
-* Libraries:: Library Behavior
-* Portability:: Portability As It Applies to GNU
-* User Interfaces:: Standards for Command Line Interfaces
-* Documentation:: Documenting Programs
-* Releases:: Making Releases
-@end menu
-
-@node Preface
-@chapter About the GNU Coding Standards
-
-The GNU Coding Standards were written by Richard Stallman and other GNU
-Project volunteers. Their purpose is to make the GNU system clean,
-consistent, and easy to install. This document can also be read as a
-guide to write portable, robust and reliable programs. It focuses on
-programs written in C, but many of the rules and principles are useful
-even if you write in another programming language. The rules often
-state reasons for writing in a certain way.
-
-Corrections or suggestions regarding this document should be sent to
-@code{gnu@@prep.ai.mit.edu}. If you make a suggestion, please include a
-suggested new wording for it; our time is limited. We prefer a context
-diff to the @file{standards.texi} or @file{make-stds.texi} files, but if
-you don't have those files, please mail your suggestion anyway.
-
-This release of the GNU Coding Standards was last updated
-@value{lastupdate}.
-
-@node Reading Non-Free Code
-@chapter Referring to Proprietary Programs
-
-Don't in any circumstances refer to Unix source code for or during
-your work on GNU! (Or to any other proprietary programs.)
-
-If you have a vague recollection of the internals of a Unix program,
-this does not absolutely mean you can't write an imitation of it, but
-do try to organize the imitation internally along different lines,
-because this is likely to make the details of the Unix version
-irrelevant and dissimilar to your results.
-
-For example, Unix utilities were generally optimized to minimize
-memory use; if you go for speed instead, your program will be very
-different. You could keep the entire input file in core and scan it
-there instead of using stdio. Use a smarter algorithm discovered more
-recently than the Unix program. Eliminate use of temporary files. Do
-it in one pass instead of two (we did this in the assembler).
-
-Or, on the contrary, emphasize simplicity instead of speed. For some
-applications, the speed of today's computers makes simpler algorithms
-adequate.
-
-Or go for generality. For example, Unix programs often have static
-tables or fixed-size strings, which make for arbitrary limits; use
-dynamic allocation instead. Make sure your program handles NULs and
-other funny characters in the input files. Add a programming language
-for extensibility and write part of the program in that language.
-
-Or turn some parts of the program into independently usable libraries.
-Or use a simple garbage collector instead of tracking precisely when
-to free memory, or use a new GNU facility such as obstacks.
-
-
-@node Contributions
-@chapter Accepting Contributions
-
-If someone else sends you a piece of code to add to the program you are
-working on, we need legal papers to use it---the same sort of legal
-papers we will need to get from you. @emph{Each} significant
-contributor to a program must sign some sort of legal papers in order
-for us to have clear title to the program. The main author alone is not
-enough.
-
-So, before adding in any contributions from other people, tell us
-so we can arrange to get the papers. Then wait until we tell you
-that we have received the signed papers, before you actually use the
-contribution.
-
-This applies both before you release the program and afterward. If
-you receive diffs to fix a bug, and they make significant change, we
-need legal papers for it.
-
-You don't need papers for changes of a few lines here or there, since
-they are not significant for copyright purposes. Also, you don't need
-papers if all you get from the suggestion is some ideas, not actual code
-which you use. For example, if you write a different solution to the
-problem, you don't need to get papers.
-
-I know this is frustrating; it's frustrating for us as well. But if
-you don't wait, you are going out on a limb---for example, what if the
-contributor's employer won't sign a disclaimer? You might have to take
-that code out again!
-
-The very worst thing is if you forget to tell us about the other
-contributor. We could be very embarrassed in court some day as a
-result.
-
-@node Change Logs
-@chapter Change Logs
-
-Keep a change log for each directory, describing the changes made to
-source files in that directory. The purpose of this is so that people
-investigating bugs in the future will know about the changes that
-might have introduced the bug. Often a new bug can be found by
-looking at what was recently changed. More importantly, change logs
-can help eliminate conceptual inconsistencies between different parts
-of a program; they can give you a history of how the conflicting
-concepts arose.
-
-Use the Emacs command @kbd{M-x add-change} to start a new entry in the
-change log. An entry should have an asterisk, the name of the changed
-file, and then in parentheses the name of the changed functions,
-variables or whatever, followed by a colon. Then describe the changes
-you made to that function or variable.
-
-Separate unrelated entries with blank lines. When two entries
-represent parts of the same change, so that they work together, then
-don't put blank lines between them. Then you can omit the file name
-and the asterisk when successive entries are in the same file.
-
-Here are some examples:
-
-@example
-* register.el (insert-register): Return nil.
-(jump-to-register): Likewise.
-
-* sort.el (sort-subr): Return nil.
-
-* tex-mode.el (tex-bibtex-file, tex-file, tex-region):
-Restart the tex shell if process is gone or stopped.
-(tex-shell-running): New function.
-
-* expr.c (store_one_arg): Round size up for move_block_to_reg.
-(expand_call): Round up when emitting USE insns.
-* stmt.c (assign_parms): Round size up for move_block_from_reg.
-@end example
-
-It's important to name the changed function or variable in full. Don't
-abbreviate them; don't combine them. Subsequent maintainers will often
-search for a function name to find all the change log entries that
-pertain to it; if you abbreviate the name, they won't find it when they
-search. For example, some people are tempted to abbreviate groups of
-function names by writing @samp{* register.el
-(@{insert,jump-to@}-register)}; this is not a good idea, since searching
-for @code{jump-to-register} or @code{insert-register} would not find the
-entry.
-
-There's no need to describe the full purpose of the changes or how they
-work together. It is better to put such explanations in comments in the
-code. That's why just ``New function'' is enough; there is a comment
-with the function in the source to explain what it does.
-
-However, sometimes it is useful to write one line to describe the
-overall purpose of a large batch of changes.
-
-You can think of the change log as a conceptual ``undo list'' which
-explains how earlier versions were different from the current version.
-People can see the current version; they don't need the change log
-to tell them what is in it. What they want from a change log is a
-clear explanation of how the earlier version differed.
-
-When you change the calling sequence of a function in a simple
-fashion, and you change all the callers of the function, there is no
-need to make individual entries for all the callers. Just write in
-the entry for the function being called, ``All callers changed.''
-
-When you change just comments or doc strings, it is enough to write an
-entry for the file, without mentioning the functions. Write just,
-``Doc fix.'' There's no need to keep a change log for documentation
-files. This is because documentation is not susceptible to bugs that
-are hard to fix. Documentation does not consist of parts that must
-interact in a precisely engineered fashion; to correct an error, you
-need not know the history of the erroneous passage.
-
-
-@node Compatibility
-@chapter Compatibility with Other Implementations
-
-With certain exceptions, utility programs and libraries for GNU should
-be upward compatible with those in Berkeley Unix, and upward compatible
-with @sc{ANSI} C if @sc{ANSI} C specifies their behavior, and upward
-compatible with @sc{POSIX} if @sc{POSIX} specifies their behavior.
-
-When these standards conflict, it is useful to offer compatibility
-modes for each of them.
-
-@sc{ANSI} C and @sc{POSIX} prohibit many kinds of extensions. Feel
-free to make the extensions anyway, and include a @samp{--ansi} or
-@samp{--compatible} option to turn them off. However, if the extension
-has a significant chance of breaking any real programs or scripts,
-then it is not really upward compatible. Try to redesign its
-interface.
-
-Many GNU programs suppress extensions that conflict with POSIX if the
-environment variable @code{POSIXLY_CORRECT} is defined (even if it is
-defined with a null value). Please make your program recognize this
-variable if appropriate.
-
-When a feature is used only by users (not by programs or command
-files), and it is done poorly in Unix, feel free to replace it
-completely with something totally different and better. (For example,
-vi is replaced with Emacs.) But it is nice to offer a compatible
-feature as well. (There is a free vi clone, so we offer it.)
-
-Additional useful features not in Berkeley Unix are welcome.
-Additional programs with no counterpart in Unix may be useful,
-but our first priority is usually to duplicate what Unix already
-has.
-
-@comment The makefile standards are in a separate file that is also
-@comment included by make.texinfo. Done by roland@gnu.ai.mit.edu on 1/6/93.
-@include make-stds.texi
-
-@node Configuration
-@chapter How Configuration Should Work
-
-Each GNU distribution should come with a shell script named
-@code{configure}. This script is given arguments which describe the
-kind of machine and system you want to compile the program for.
-
-The @code{configure} script must record the configuration options so
-that they affect compilation.
-
-One way to do this is to make a link from a standard name such as
-@file{config.h} to the proper configuration file for the chosen system.
-If you use this technique, the distribution should @emph{not} contain a
-file named @file{config.h}. This is so that people won't be able to
-build the program without configuring it first.
-
-Another thing that @code{configure} can do is to edit the Makefile. If
-you do this, the distribution should @emph{not} contain a file named
-@file{Makefile}. Instead, include a file @file{Makefile.in} which
-contains the input used for editing. Once again, this is so that people
-won't be able to build the program without configuring it first.
-
-If @code{configure} does write the @file{Makefile}, then @file{Makefile}
-should have a target named @file{Makefile} which causes @code{configure}
-to be rerun, setting up the same configuration that was set up last
-time. The files that @code{configure} reads should be listed as
-dependencies of @file{Makefile}.
-
-All the files which are output from the @code{configure} script should
-have comments at the beginning explaining that they were generated
-automatically using @code{configure}. This is so that users won't think
-of trying to edit them by hand.
-
-The @code{configure} script should write a file named @file{config.status}
-which describes which configuration options were specified when the
-program was last configured. This file should be a shell script which,
-if run, will recreate the same configuration.
-
-The @code{configure} script should accept an option of the form
-@samp{--srcdir=@var{dirname}} to specify the directory where sources are found
-(if it is not the current directory). This makes it possible to build
-the program in a separate directory, so that the actual source directory
-is not modified.
-
-If the user does not specify @samp{--srcdir}, then @code{configure} should
-check both @file{.} and @file{..} to see if it can find the sources. If
-it finds the sources in one of these places, it should use them from
-there. Otherwise, it should report that it cannot find the sources, and
-should exit with nonzero status.
-
-Usually the easy way to support @samp{--srcdir} is by editing a
-definition of @code{VPATH} into the Makefile. Some rules may need to
-refer explicitly to the specified source directory. To make this
-possible, @code{configure} can add to the Makefile a variable named
-@code{srcdir} whose value is precisely the specified directory.
-
-The @code{configure} script should also take an argument which specifies the
-type of system to build the program for. This argument should look like
-this:
-
-@example
-@var{cpu}-@var{company}-@var{system}
-@end example
-
-For example, a Sun 3 might be @samp{m68k-sun-sunos4.1}.
-
-The @code{configure} script needs to be able to decode all plausible
-alternatives for how to describe a machine. Thus, @samp{sun3-sunos4.1}
-would be a valid alias. So would @samp{sun3-bsd4.2}, since SunOS is
-basically @sc{BSD} and no other @sc{BSD} system is used on a Sun. For many
-programs, @samp{vax-dec-ultrix} would be an alias for
-@samp{vax-dec-bsd}, simply because the differences between Ultrix and
-@sc{BSD} are rarely noticeable, but a few programs might need to distinguish
-them.
-
-There is a shell script called @file{config.sub} that you can use
-as a subroutine to validate system types and canonicalize aliases.
-
-Other options are permitted to specify in more detail the software
-or hardware present on the machine, and include or exclude optional
-parts of the package:
-
-@table @samp
-@item --enable-@var{feature}@r{[}=@var{parameter}@r{]}
-Configure the package to build and install an optional user-level
-facility called @var{feature}. This allows users to choose which
-optional features to include. Giving an optional @var{parameter} of
-@samp{no} should omit @var{feature}, if it is built by default.
-
-No @samp{--enable} option should @strong{ever} cause one feature to
-replace another. No @samp{--enable} option should ever substitute one
-useful behavior for another useful behavior. The only proper use for
-@samp{--enable} is for questions of whether to build part of the program
-or exclude it.
-
-@item --with-@var{package}
-@c @r{[}=@var{parameter}@r{]}
-The package @var{package} will be installed, so configure this package
-to work with @var{package}.
-
-@c Giving an optional @var{parameter} of
-@c @samp{no} should omit @var{package}, if it is used by default.
-
-Possible values of @var{package} include @samp{x}, @samp{x-toolkit},
-@samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc}, and
-@samp{gdb}.
-
-Do not use a @samp{--with} option to specify the file name to use to
-find certain files. That is outside the scope of what @samp{--with}
-options are for.
-
-@item --nfp
-The target machine has no floating point processor.
-
-@item --gas
-The target machine assembler is GAS, the GNU assembler.
-This is obsolete; users should use @samp{--with-gnu-as} instead.
-
-@item --x
-The target machine has the X Window System installed.
-This is obsolete; users should use @samp{--with-x} instead.
-@end table
-
-All @code{configure} scripts should accept all of these ``detail''
-options, whether or not they make any difference to the particular
-package at hand. In particular, they should accept any option that
-starts with @samp{--with-} or @samp{--enable-}. This is so users will
-be able to configure an entire GNU source tree at once with a single set
-of options.
-
-You will note that the categories @samp{--with-} and @samp{--enable-}
-are narrow: they @strong{do not} provide a place for any sort of option
-you might think of. That is deliberate. We want to limit the possible
-configuration options in GNU software. We do not want GNU programs to
-have idiosyncratic configuration options.
-
-Packages that perform part of compilation may support cross-compilation.
-In such a case, the host and target machines for the program may be
-different. The @code{configure} script should normally treat the
-specified type of system as both the host and the target, thus producing
-a program which works for the same type of machine that it runs on.
-
-The way to build a cross-compiler, cross-assembler, or what have you, is
-to specify the option @samp{--host=@var{hosttype}} when running
-@code{configure}. This specifies the host system without changing the
-type of target system. The syntax for @var{hosttype} is the same as
-described above.
-
-Bootstrapping a cross-compiler requires compiling it on a machine other
-than the host it will run on. Compilation packages accept a
-configuration option @samp{--build=@var{hosttype}} for specifying the
-configuration on which you will compile them, in case that is different
-from the host.
-
-Programs for which cross-operation is not meaningful need not accept the
-@samp{--host} option, because configuring an entire operating system for
-cross-operation is not a meaningful thing.
-
-Some programs have ways of configuring themselves automatically. If
-your program is set up to do this, your @code{configure} script can simply
-ignore most of its arguments.
-
-
-@node Source Language
-@chapter Using Languages Other Than C
-
-Using a language other than C is like using a non-standard feature: it
-will cause trouble for users. Even if GCC supports the other language,
-users may find it inconvenient to have to install the compiler for that
-other language in order to build your program. So please write in C.
-
-There are three exceptions for this rule:
-
-@itemize @bullet
-@item
-It is okay to use a special language if the same program contains an
-interpreter for that language.
-
-Thus, it is not a problem that GNU Emacs contains code written in Emacs
-Lisp, because it comes with a Lisp interpreter.
-
-@item
-It is okay to use another language in a tool specifically intended for
-use with that language.
-
-This is okay because the only people who want to build the tool will be
-those who have installed the other language anyway.
-
-@item
-If an application is not of extremely widespread interest, then perhaps
-it's not important if the application is inconvenient to install.
-@end itemize
-
-@node Formatting
-@chapter Formatting Your Source Code
-
-It is important to put the open-brace that starts the body of a C
-function in column zero, and avoid putting any other open-brace or
-open-parenthesis or open-bracket in column zero. Several tools look
-for open-braces in column zero to find the beginnings of C functions.
-These tools will not work on code not formatted that way.
-
-It is also important for function definitions to start the name of the
-function in column zero. This helps people to search for function
-definitions, and may also help certain tools recognize them. Thus,
-the proper format is this:
-
-@example
-static char *
-concat (s1, s2) /* Name starts in column zero here */
- char *s1, *s2;
-@{ /* Open brace in column zero here */
- @dots{}
-@}
-@end example
-
-@noindent
-or, if you want to use @sc{ANSI} C, format the definition like this:
-
-@example
-static char *
-concat (char *s1, char *s2)
-@{
- @dots{}
-@}
-@end example
-
-In @sc{ANSI} C, if the arguments don't fit nicely on one line,
-split it like this:
-
-@example
-int
-lots_of_args (int an_integer, long a_long, short a_short,
- double a_double, float a_float)
-@dots{}
-@end example
-
-For the body of the function, we prefer code formatted like this:
-
-@example
-if (x < foo (y, z))
- haha = bar[4] + 5;
-else
- @{
- while (z)
- @{
- haha += foo (z, z);
- z--;
- @}
- return ++x + bar ();
- @}
-@end example
-
-We find it easier to read a program when it has spaces before the
-open-parentheses and after the commas. Especially after the commas.
-
-When you split an expression into multiple lines, split it
-before an operator, not after one. Here is the right way:
-
-@example
-if (foo_this_is_long && bar > win (x, y, z)
- && remaining_condition)
-@end example
-
-Try to avoid having two operators of different precedence at the same
-level of indentation. For example, don't write this:
-
-@example
-mode = (inmode[j] == VOIDmode
- || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])
- ? outmode[j] : inmode[j]);
-@end example
-
-Instead, use extra parentheses so that the indentation shows the nesting:
-
-@example
-mode = ((inmode[j] == VOIDmode
- || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])))
- ? outmode[j] : inmode[j]);
-@end example
-
-Insert extra parentheses so that Emacs will indent the code properly.
-For example, the following indentation looks nice if you do it by hand,
-but Emacs would mess it up:
-
-@example
-v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
- + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;
-@end example
-
-But adding a set of parentheses solves the problem:
-
-@example
-v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
- + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);
-@end example
-
-Format do-while statements like this:
-
-@example
-do
- @{
- a = foo (a);
- @}
-while (a > 0);
-@end example
-
-Please use formfeed characters (control-L) to divide the program into
-pages at logical places (but not within a function). It does not matter
-just how long the pages are, since they do not have to fit on a printed
-page. The formfeeds should appear alone on lines by themselves.
-
-
-@node Comments
-@chapter Commenting Your Work
-
-Every program should start with a comment saying briefly what it is for.
-Example: @samp{fmt - filter for simple filling of text}.
-
-Please put a comment on each function saying what the function does,
-what sorts of arguments it gets, and what the possible values of
-arguments mean and are used for. It is not necessary to duplicate in
-words the meaning of the C argument declarations, if a C type is being
-used in its customary fashion. If there is anything nonstandard about
-its use (such as an argument of type @code{char *} which is really the
-address of the second character of a string, not the first), or any
-possible values that would not work the way one would expect (such as,
-that strings containing newlines are not guaranteed to work), be sure
-to say so.
-
-Also explain the significance of the return value, if there is one.
-
-Please put two spaces after the end of a sentence in your comments, so
-that the Emacs sentence commands will work. Also, please write
-complete sentences and capitalize the first word. If a lower-case
-identifer comes at the beginning of a sentence, don't capitalize it!
-Changing the spelling makes it a different identifier. If you don't
-like starting a sentence with a lower case letter, write the sentence
-differently (e.g., ``The identifier lower-case is @dots{}'').
-
-The comment on a function is much clearer if you use the argument
-names to speak about the argument values. The variable name itself
-should be lower case, but write it in upper case when you are speaking
-about the value rather than the variable itself. Thus, ``the inode
-number NODE_NUM'' rather than ``an inode''.
-
-There is usually no purpose in restating the name of the function in
-the comment before it, because the reader can see that for himself.
-There might be an exception when the comment is so long that the function
-itself would be off the bottom of the screen.
-
-There should be a comment on each static variable as well, like this:
-
-@example
-/* Nonzero means truncate lines in the display;
- zero means continue them. */
-int truncate_lines;
-@end example
-
-Every @samp{#endif} should have a comment, except in the case of short
-conditionals (just a few lines) that are not nested. The comment should
-state the condition of the conditional that is ending, @emph{including
-its sense}. @samp{#else} should have a comment describing the condition
-@emph{and sense} of the code that follows. For example:
-
-@example
-#ifdef foo
- @dots{}
-#else /* not foo */
- @dots{}
-#endif /* not foo */
-@end example
-
-@noindent
-but, by contrast, write the comments this way for a @samp{#ifndef}:
-
-@example
-#ifndef foo
- @dots{}
-#else /* foo */
- @dots{}
-#endif /* foo */
-@end example
-
-
-@node Syntactic Conventions
-@chapter Clean Use of C Constructs
-
-Please explicitly declare all arguments to functions.
-Don't omit them just because they are @code{int}s.
-
-Declarations of external functions and functions to appear later in the
-source file should all go in one place near the beginning of the file
-(somewhere before the first function definition in the file), or else
-should go in a header file. Don't put @code{extern} declarations inside
-functions.
-
-It used to be common practice to use the same local variables (with
-names like @code{tem}) over and over for different values within one
-function. Instead of doing this, it is better declare a separate local
-variable for each distinct purpose, and give it a name which is
-meaningful. This not only makes programs easier to understand, it also
-facilitates optimization by good compilers. You can also move the
-declaration of each local variable into the smallest scope that includes
-all its uses. This makes the program even cleaner.
-
-Don't use local variables or parameters that shadow global identifiers.
-
-Don't declare multiple variables in one declaration that spans lines.
-Start a new declaration on each line, instead. For example, instead
-of this:
-
-@example
-int foo,
- bar;
-@end example
-
-@noindent
-write either this:
-
-@example
-int foo, bar;
-@end example
-
-@noindent
-or this:
-
-@example
-int foo;
-int bar;
-@end example
-
-@noindent
-(If they are global variables, each should have a comment preceding it
-anyway.)
-
-When you have an @code{if}-@code{else} statement nested in another
-@code{if} statement, always put braces around the @code{if}-@code{else}.
-Thus, never write like this:
-
-@example
-if (foo)
- if (bar)
- win ();
- else
- lose ();
-@end example
-
-@noindent
-always like this:
-
-@example
-if (foo)
- @{
- if (bar)
- win ();
- else
- lose ();
- @}
-@end example
-
-If you have an @code{if} statement nested inside of an @code{else}
-statement, either write @code{else if} on one line, like this,
-
-@example
-if (foo)
- @dots{}
-else if (bar)
- @dots{}
-@end example
-
-@noindent
-with its @code{then}-part indented like the preceding @code{then}-part,
-or write the nested @code{if} within braces like this:
-
-@example
-if (foo)
- @dots{}
-else
- @{
- if (bar)
- @dots{}
- @}
-@end example
-
-Don't declare both a structure tag and variables or typedefs in the
-same declaration. Instead, declare the structure tag separately
-and then use it to declare the variables or typedefs.
-
-Try to avoid assignments inside @code{if}-conditions. For example,
-don't write this:
-
-@example
-if ((foo = (char *) malloc (sizeof *foo)) == 0)
- fatal ("virtual memory exhausted");
-@end example
-
-@noindent
-instead, write this:
-
-@example
-foo = (char *) malloc (sizeof *foo);
-if (foo == 0)
- fatal ("virtual memory exhausted");
-@end example
-
-Don't make the program ugly to placate @code{lint}. Please don't insert any
-casts to @code{void}. Zero without a cast is perfectly fine as a null
-pointer constant.
-
-@node Names
-@chapter Naming Variables and Functions
-
-Please use underscores to separate words in a name, so that the Emacs
-word commands can be useful within them. Stick to lower case; reserve
-upper case for macros and @code{enum} constants, and for name-prefixes
-that follow a uniform convention.
-
-For example, you should use names like @code{ignore_space_change_flag};
-don't use names like @code{iCantReadThis}.
-
-Variables that indicate whether command-line options have been
-specified should be named after the meaning of the option, not after
-the option-letter. A comment should state both the exact meaning of
-the option and its letter. For example,
-
-@example
-/* Ignore changes in horizontal whitespace (-b). */
-int ignore_space_change_flag;
-@end example
-
-When you want to define names with constant integer values, use
-@code{enum} rather than @samp{#define}. GDB knows about enumeration
-constants.
-
-Use file names of 14 characters or less, to avoid creating gratuitous
-problems on System V. You can use the program @code{doschk} to test for
-this. @code{doschk} also tests for potential name conflicts if the
-files were loaded onto an MS-DOS file system---something you may or may
-not care about.
-
-
-@node Using Extensions
-@chapter Using Non-standard Features
-
-Many GNU facilities that already exist support a number of convenient
-extensions over the comparable Unix facilities. Whether to use these
-extensions in implementing your program is a difficult question.
-
-On the one hand, using the extensions can make a cleaner program.
-On the other hand, people will not be able to build the program
-unless the other GNU tools are available. This might cause the
-program to work on fewer kinds of machines.
-
-With some extensions, it might be easy to provide both alternatives.
-For example, you can define functions with a ``keyword'' @code{INLINE}
-and define that as a macro to expand into either @code{inline} or
-nothing, depending on the compiler.
-
-In general, perhaps it is best not to use the extensions if you can
-straightforwardly do without them, but to use the extensions if they
-are a big improvement.
-
-An exception to this rule are the large, established programs (such as
-Emacs) which run on a great variety of systems. Such programs would
-be broken by use of GNU extensions.
-
-Another exception is for programs that are used as part of
-compilation: anything that must be compiled with other compilers in
-order to bootstrap the GNU compilation facilities. If these require
-the GNU compiler, then no one can compile them without having them
-installed already. That would be no good.
-
-Since most computer systems do not yet implement @sc{ANSI} C, using the
-@sc{ANSI} C features is effectively using a GNU extension, so the
-same considerations apply. (Except for @sc{ANSI} features that we
-discourage, such as trigraphs---don't ever use them.)
-
-
-@node System Functions
-@chapter Calling System Functions
-
-C implementations differ substantially. ANSI C reduces but does not
-eliminate the incompatibilities; meanwhile, many users wish to compile
-GNU software with pre-ANSI compilers. This chapter gives
-recommendations for how to use the more or less standard C library
-functions to avoid unnecessary loss of portability.
-
-@itemize @bullet
-@item
-Don't use the value of @code{sprintf}. It returns the number of
-characters written on some systems, but not on all systems.
-
-@item
-Don't declare system functions explicitly.
-
-Almost any declaration for a system function is wrong on some system.
-To minimize conflicts, leave it to the system header files to declare
-system functions. If the headers don't declare a function, let it
-remain undeclared.
-
-While it may seem unclean to use a function without declaring it, in
-practice this works fine for most system library functions on the
-systems where this really happens. The problem is only theoretical. By
-contrast, actual declarations have frequently caused actual conflicts.
-
-@item
-If you must declare a system function, don't specify the argument types.
-Use an old-style declaration, not an ANSI prototype. The more you
-specify about the function, the more likely a conflict.
-
-@item
-In particular, don't unconditionally declare @code{malloc} or
-@code{realloc}.
-
-Most GNU programs use those functions just once, in functions
-conventionally named @code{xmalloc} and @code{xrealloc}. These
-functions call @code{malloc} and @code{realloc}, respectively, and
-check the results.
-
-Because @code{xmalloc} and @code{xrealloc} are defined in your program,
-you can declare them in other files without any risk of type conflict.
-
-On most systems, @code{int} is the same length as a pointer; thus, the
-calls to @code{malloc} and @code{realloc} work fine. For the few
-exceptional systems (mostly 64-bit machines), you can use
-@strong{conditionalized} declarations of @code{malloc} and
-@code{realloc}---or put these declarations in configuration files
-specific to those systems.
-
-@item
-The string functions require special treatment. Some Unix systems have
-a header file @file{string.h}; other have @file{strings.h}. Neither
-file name is portable. There are two things you can do: use Autoconf to
-figure out which file to include, or don't include either file.
-
-@item
-If you don't include either strings file, you can't get declarations for
-the string functions from the header file in the usual way.
-
-That causes less of a problem than you might think. The newer ANSI
-string functions are off-limits anyway because many systems still don't
-support them. The string functions you can use are these:
-
-@example
-strcpy strncpy strcat strncat
-strlen strcmp strncmp
-strchr strrchr
-@end example
-
-The copy and concatenate functions work fine without a declaration as
-long as you don't use their values. Using their values without a
-declaration fails on systems where the width of a pointer differs from
-the width of @code{int}, and perhaps in other cases. It is trivial to
-avoid using their values, so do that.
-
-The compare functions and @code{strlen} work fine without a declaration
-on most systems, possibly all the ones that GNU software runs on.
-You may find it necessary to declare them @strong{conditionally} on a
-few systems.
-
-The search functions must be declared to return @code{char *}. Luckily,
-there is no variation in the data type they return. But there is
-variation in their names. Some systems give these functions the names
-@code{index} and @code{rindex}; other systems use the names
-@code{strchr} and @code{strrchr}. Some systems support both pairs of
-names, but neither pair works on all systems.
-
-You should pick a single pair of names and use it throughout your
-program. (Nowadays, it is better to choose @code{strchr} and
-@code{strrchr}.) Declare both of those names as functions returning
-@code{char *}. On systems which don't support those names, define them
-as macros in terms of the other pair. For example, here is what to put
-at the beginning of your file (or in a header) if you want to use the
-names @code{strchr} and @code{strrchr} throughout:
-
-@example
-#ifndef HAVE_STRCHR
-#define strchr index
-#endif
-#ifndef HAVE_STRRCHR
-#define strrchr rindex
-#endif
-
-char *strchr ();
-char *strrchr ();
-@end example
-@end itemize
-
-Here we assume that @code{HAVE_STRCHR} and @code{HAVE_STRRCHR} are
-macros defined in systems where the corresponding functions exist.
-One way to get them properly defined is to use Autoconf.
-
-@node Semantics
-@chapter Program Behavior for All Programs
-
-Avoid arbitrary limits on the length or number of @emph{any} data
-structure, including filenames, lines, files, and symbols, by allocating
-all data structures dynamically. In most Unix utilities, ``long lines
-are silently truncated''. This is not acceptable in a GNU utility.
-
-Utilities reading files should not drop NUL characters, or any other
-nonprinting characters @emph{including those with codes above 0177}. The
-only sensible exceptions would be utilities specifically intended for
-interface to certain types of printers that can't handle those characters.
-
-Check every system call for an error return, unless you know you wish to
-ignore errors. Include the system error text (from @code{perror} or
-equivalent) in @emph{every} error message resulting from a failing
-system call, as well as the name of the file if any and the name of the
-utility. Just ``cannot open foo.c'' or ``stat failed'' is not
-sufficient.
-
-Check every call to @code{malloc} or @code{realloc} to see if it
-returned zero. Check @code{realloc} even if you are making the block
-smaller; in a system that rounds block sizes to a power of 2,
-@code{realloc} may get a different block if you ask for less space.
-
-In Unix, @code{realloc} can destroy the storage block if it returns
-zero. GNU @code{realloc} does not have this bug: if it fails, the
-original block is unchanged. Feel free to assume the bug is fixed. If
-you wish to run your program on Unix, and wish to avoid lossage in this
-case, you can use the GNU @code{malloc}.
-
-You must expect @code{free} to alter the contents of the block that was
-freed. Anything you want to fetch from the block, you must fetch before
-calling @code{free}.
-
-If @code{malloc} fails in a noninteractive program, make that a fatal
-error. In an interactive program (one that reads commands from the
-user), it is better to abort the command and return to the command
-reader loop. This allows the user to kill other processes to free up
-virtual memory, and then try the command again.
-
-Use @code{getopt_long} to decode arguments, unless the argument syntax
-makes this unreasonable.
-
-When static storage is to be written in during program execution, use
-explicit C code to initialize it. Reserve C initialized declarations
-for data that will not be changed.
-
-Try to avoid low-level interfaces to obscure Unix data structures (such
-as file directories, utmp, or the layout of kernel memory), since these
-are less likely to work compatibly. If you need to find all the files
-in a directory, use @code{readdir} or some other high-level interface.
-These will be supported compatibly by GNU.
-
-By default, the GNU system will provide the signal handling functions of
-@sc{BSD} and of @sc{POSIX}. So GNU software should be written to use
-these.
-
-In error checks that detect ``impossible'' conditions, just abort.
-There is usually no point in printing any message. These checks
-indicate the existence of bugs. Whoever wants to fix the bugs will have
-to read the source code and run a debugger. So explain the problem with
-comments in the source. The relevant data will be in variables, which
-are easy to examine with the debugger, so there is no point moving them
-elsewhere.
-
-
-@node Errors
-@chapter Formatting Error Messages
-
-Error messages from compilers should look like this:
-
-@example
-@var{source-file-name}:@var{lineno}: @var{message}
-@end example
-
-Error messages from other noninteractive programs should look like this:
-
-@example
-@var{program}:@var{source-file-name}:@var{lineno}: @var{message}
-@end example
-
-@noindent
-when there is an appropriate source file, or like this:
-
-@example
-@var{program}: @var{message}
-@end example
-
-@noindent
-when there is no relevant source file.
-
-In an interactive program (one that is reading commands from a
-terminal), it is better not to include the program name in an error
-message. The place to indicate which program is running is in the
-prompt or with the screen layout. (When the same program runs with
-input from a source other than a terminal, it is not interactive and
-would do best to print error messages using the noninteractive style.)
-
-The string @var{message} should not begin with a capital letter when
-it follows a program name and/or filename. Also, it should not end
-with a period.
-
-Error messages from interactive programs, and other messages such as
-usage messages, should start with a capital letter. But they should not
-end with a period.
-
-
-@node Libraries
-@chapter Library Behavior
-
-Try to make library functions reentrant. If they need to do dynamic
-storage allocation, at least try to avoid any nonreentrancy aside from
-that of @code{malloc} itself.
-
-Here are certain name conventions for libraries, to avoid name
-conflicts.
-
-Choose a name prefix for the library, more than two characters long.
-All external function and variable names should start with this
-prefix. In addition, there should only be one of these in any given
-library member. This usually means putting each one in a separate
-source file.
-
-An exception can be made when two external symbols are always used
-together, so that no reasonable program could use one without the
-other; then they can both go in the same file.
-
-External symbols that are not documented entry points for the user
-should have names beginning with @samp{_}. They should also contain
-the chosen name prefix for the library, to prevent collisions with
-other libraries. These can go in the same files with user entry
-points if you like.
-
-Static functions and variables can be used as you like and need not
-fit any naming convention.
-
-
-@node Portability
-@chapter Portability As It Applies to GNU
-
-Much of what is called ``portability'' in the Unix world refers to
-porting to different Unix versions. This is a secondary consideration
-for GNU software, because its primary purpose is to run on top of one
-and only one kernel, the GNU kernel, compiled with one and only one C
-compiler, the GNU C compiler. The amount and kinds of variation among
-GNU systems on different cpu's will be like the variation among Berkeley
-4.3 systems on different cpu's.
-
-All users today run GNU software on non-GNU systems. So supporting a
-variety of non-GNU systems is desirable; simply not paramount.
-The easiest way to achieve portability to a reasonable range of systems
-is to use Autoconf. It's unlikely that your program needs to know more
-information about the host machine than Autoconf can provide, simply
-because most of the programs that need such knowledge have already been
-written.
-
-It is difficult to be sure exactly what facilities the GNU kernel
-will provide, since it isn't finished yet. Therefore, assume you can
-use anything in 4.3; just avoid using the format of semi-internal data
-bases (e.g., directories) when there is a higher-level alternative
-(@code{readdir}).
-
-You can freely assume any reasonably standard facilities in the C
-language, libraries or kernel, because we will find it necessary to
-support these facilities in the full GNU system, whether or not we
-have already done so. The fact that there may exist kernels or C
-compilers that lack these facilities is irrelevant as long as the GNU
-kernel and C compiler support them.
-
-It remains necessary to worry about differences among cpu types, such
-as the difference in byte ordering and alignment restrictions. It's
-unlikely that 16-bit machines will ever be supported by GNU, so there
-is no point in spending any time to consider the possibility that an
-int will be less than 32 bits.
-
-You can assume that all pointers have the same format, regardless
-of the type they point to, and that this is really an integer.
-There are some weird machines where this isn't true, but they aren't
-important; don't waste time catering to them. Besides, eventually
-we will put function prototypes into all GNU programs, and that will
-probably make your program work even on weird machines.
-
-Since some important machines (including the 68000) are big-endian,
-it is important not to assume that the address of an @code{int} object
-is also the address of its least-significant byte. Thus, don't
-make the following mistake:
-
-@example
-int c;
-@dots{}
-while ((c = getchar()) != EOF)
- write(file_descriptor, &c, 1);
-@end example
-
-You can assume that it is reasonable to use a meg of memory. Don't
-strain to reduce memory usage unless it can get to that level. If
-your program creates complicated data structures, just make them in
-core and give a fatal error if malloc returns zero.
-
-If a program works by lines and could be applied to arbitrary
-user-supplied input files, it should keep only a line in memory, because
-this is not very hard and users will want to be able to operate on input
-files that are bigger than will fit in core all at once.
-
-
-@node User Interfaces
-@chapter Standards for Command Line Interfaces
-
-Please don't make the behavior of a utility depend on the name used
-to invoke it. It is useful sometimes to make a link to a utility
-with a different name, and that should not change what it does.
-
-Instead, use a run time option or a compilation switch or both
-to select among the alternate behaviors.
-
-Likewise, please don't make the behavior of the program depend on the
-type of output device it is used with. Device independence is an
-important principle of the system's design; do not compromise it
-merely to save someone from typing an option now and then.
-
-If you think one behavior is most useful when the output is to a
-terminal, and another is most useful when the output is a file or a
-pipe, then it is usually best to make the default behavior the one that
-is useful with output to a terminal, and have an option for the other
-behavior.
-
-Compatibility requires certain programs to depend on the type of output
-device. It would be disastrous if @code{ls} or @code{sh} did not do so
-in the way all users expect. In some of these cases, we supplement the
-program with a preferred alternate version that does not depend on the
-output device type. For example, we provide a @code{dir} program much
-like @code{ls} except that its default output format is always
-multi-column format.
-
-It is a good idea to follow the @sc{POSIX} guidelines for the
-command-line options of a program. The easiest way to do this is to use
-@code{getopt} to parse them. Note that the GNU version of @code{getopt}
-will normally permit options anywhere among the arguments unless the
-special argument @samp{--} is used. This is not what @sc{POSIX}
-specifies; it is a GNU extension.
-
-Please define long-named options that are equivalent to the
-single-letter Unix-style options. We hope to make GNU more user
-friendly this way. This is easy to do with the GNU function
-@code{getopt_long}.
-
-One of the advantages of long-named options is that they can be
-consistent from program to program. For example, users should be able
-to expect the ``verbose'' option of any GNU program which has one, to be
-spelled precisely @samp{--verbose}. To achieve this uniformity, look at
-the table of common long-option names when you choose the option names
-for your program. The table appears below.
-
-If you use names not already in the table, please send
-@samp{gnu@@prep.ai.mit.edu} a list of them, with their meanings, so we
-can update the table.
-
-It is usually a good idea for file names given as ordinary arguments
-to be input files only; any output files would be specified using
-options (preferably @samp{-o}). Even if you allow an output file name
-as an ordinary argument for compatibility, try to provide a suitable
-option as well. This will lead to more consistency among GNU
-utilities, so that there are fewer idiosyncracies for users to
-remember.
-
-Programs should support an option @samp{--version} which prints the
-program's version number on standard output and exits successfully, and
-an option @samp{--help} which prints option usage information on
-standard output and exits successfully. These options should inhibit
-the normal function of the command; they should do nothing except print
-the requested information.
-
-@c Please leave newlines between items in this table; it's much easier
-@c to update when it isn't completely squashed together and unreadable.
-@c When there is more than one short option for a long option name, put
-@c a semicolon between the lists of the programs that use them, not a
-@c period. --friedman
-
-@table @samp
-
-@item auto-check
-@samp{-a} in @code{recode}.
-
-@item auto-reference
-@samp{-A} in @code{ptx}.
-
-@item after-date
-@samp{-N} in @code{tar}.
-
-@item all
-@samp{-a} in @code{du}, @code{ls}, @code{nm}, @code{stty}, @code{uname},
-and @code{unexpand}.
-
-@item all-text
-@samp{-a} in @code{diff}.
-
-@item almost-all
-@samp{-A} in @code{ls}.
-
-@item append
-@samp{-a} in @code{etags}, @code{tee}, @code{time};
-@samp{-r} in @code{tar}.
-
-@item archive
-@samp{-a} in @code{cp}.
-
-@item archive-name
-@samp{-n} in @code{shar}.
-
-@item arglength
-@samp{-l} in @code{m4}.
-
-@item ascii
-@samp{-a} in @code{diff}.
-
-@item assume-new
-@samp{-W} in Make.
-
-@item assume-old
-@samp{-o} in Make.
-
-@item backward-search
-@samp{-B} in etags.
-
-@item basename
-@samp{-f} in @code{shar}.
-
-@item batch
-Used in GDB.
-
-@item baud
-Used in GDB.
-
-@item before
-@samp{-b} in @code{tac}.
-
-@item binary
-@samp{-b} in @code{cpio} and @code{diff}.
-
-@item bits-per-code
-@samp{-b} in @code{shar}.
-
-@item block-size
-Used in @code{cpio} and @code{tar}.
-
-@item blocks
-@samp{-b} in @code{head} and @code{tail}.
-
-@item break-file
-@samp{-b} in @code{ptx}.
-
-@item brief
-Used in various programs to make output shorter.
-
-@item bytes
-@samp{-c} in @code{head}, @code{split}, and @code{tail}.
-
-@item c@t{++}
-@samp{-C} in @code{etags}.
-
-@item catenate
-@samp{-A} in @code{tar}.
-
-@item cd
-Used in various programs to specify the directory to use.
-
-@item changes
-@samp{-c} in @code{chgrp} and @code{chown}.
-
-@item classify
-@samp{-F} in @code{ls}.
-
-@item colons
-@samp{-c} in @code{recode}.
-
-@item command
-@samp{-c} in @code{su};
-@samp{-x} in GDB.
-
-@item compare
-@samp{-d} in @code{tar}.
-
-@item compress
-@samp{-Z} in @code{tar} and @code{shar}.
-
-@item concatenate
-@samp{-A} in @code{tar}.
-
-@item confirmation
-@samp{-w} in @code{tar}.
-
-@item context
-Used in @code{diff}.
-
-@item copyright
-@samp{-C} in @code{ptx} and @code{recode}.
-
-@item core
-Used in GDB.
-
-@item count
-@samp{-q} in @code{who}.
-
-@item count-links
-@samp{-l} in @code{du}.
-
-@item create
-Used in @code{tar} and @code{cpio}.
-
-@item cut-mark
-@samp{-c} in @code{shar}.
-
-@item cxref
-@samp{-x} in @code{etags}.
-
-@item date
-@samp{-d} in @code{touch}.
-
-@item debug
-@samp{-d} in Make and @code{m4};
-@samp{-t} in Bison.
-
-@item define
-@samp{-D} in @code{m4}.
-
-@item defines
-@samp{-d} in Bison and @code{etags}.
-
-@item delete
-@samp{-D} in @code{tar}.
-
-@item dereference
-@samp{-L} in @code{chgrp}, @code{chown}, @code{cpio}, @code{du},
-@code{ls}, and @code{tar}.
-
-@item dereference-args
-@samp{-D} in @code{du}.
-
-@item diacritics
-@samp{-d} in @code{recode}.
-
-@item dictionary-order
-@samp{-d} in @code{look}.
-
-@item diff
-@samp{-d} in @code{tar}.
-
-@item digits
-@samp{-n} in @code{csplit}.
-
-@item directory
-Specify the directory to use, in various programs. In @code{ls}, it
-means to show directories themselves rather than their contents. In
-@code{rm} and @code{ln}, it means to not treat links to directories
-specially.
-
-@item discard-all
-@samp{-x} in @code{strip}.
-
-@item discard-locals
-@samp{-X} in @code{strip}.
-
-@item diversions
-@samp{-N} in @code{m4}.
-
-@item dry-run
-@samp{-n} in Make.
-
-@item ed
-@samp{-e} in @code{diff}.
-
-@item elide-empty-files
-@samp{-z} in @code{csplit}.
-
-@item entire-new-file
-@samp{-N} in @code{diff}.
-
-@item environment-overrides
-@samp{-e} in Make.
-
-@item eof
-@samp{-e} in @code{xargs}.
-
-@item epoch
-Used in GDB.
-
-@item error-limit
-Used in Makeinfo.
-
-@item error-output
-@samp{-o} in @code{m4}.
-
-@item escape
-@samp{-b} in @code{ls}.
-
-@item exclude-from
-@samp{-X} in @code{tar}.
-
-@item exec
-Used in GDB.
-
-@item exit
-@samp{-x} in @code{xargs}.
-
-@item exit-0
-@samp{-e} in @code{unshar}.
-
-@item expand-tabs
-@samp{-t} in @code{diff}.
-
-@item expression
-@samp{-e} in @code{sed}.
-
-@item extern-only
-@samp{-g} in @code{nm}.
-
-@item extract
-@samp{-i} in @code{cpio};
-@samp{-x} in @code{tar}.
-
-@item faces
-@samp{-f} in @code{finger}.
-
-@item fast
-@samp{-f} in @code{su}.
-
-@item fatal-warnings
-@samp{-E} in @code{m4}.
-
-@item file
-@samp{-f} in @code{info}, Make, @code{mt}, and @code{tar};
-@samp{-n} in @code{sed};
-@samp{-r} in @code{touch}.
-
-@item file-prefix
-@samp{-b} in Bison.
-
-@item file-type
-@samp{-F} in @code{ls}.
-
-@item files-from
-@samp{-T} in @code{tar}.
-
-@item fill-column
-Used in Makeinfo.
-
-@item flag-truncation
-@samp{-F} in @code{ptx}.
-
-@item fixed-output-files
-@samp{-y} in Bison.
-
-@item follow
-@samp{-f} in @code{tail}.
-
-@item footnote-style
-Used in Makeinfo.
-
-@item force
-@samp{-f} in @code{cp}, @code{ln}, @code{mv}, and @code{rm}.
-
-@item force-prefix
-@samp{-F} in @code{shar}.
-
-@item format
-Used in @code{ls}, @code{time}, and @code{ptx}.
-
-@item forward-search
-@samp{-F} in @code{etags}.
-
-@item fullname
-Used in GDB.
-
-@item gap-size
-@samp{-g} in @code{ptx}.
-
-@item get
-@samp{-x} in @code{tar}.
-
-@item graphic
-@samp{-i} in @code{ul}.
-
-@item graphics
-@samp{-g} in @code{recode}.
-
-@item group
-@samp{-g} in @code{install}.
-
-@item gzip
-@samp{-z} in @code{tar} and @code{shar}.
-
-@item hashsize
-@samp{-H} in @code{m4}.
-
-@item header
-@samp{-h} in @code{objdump} and @code{recode}
-
-@item heading
-@samp{-H} in @code{who}.
-
-@item help
-Used to ask for brief usage information.
-
-@item here-delimiter
-@samp{-d} in @code{shar}.
-
-@item hide-control-chars
-@samp{-q} in @code{ls}.
-
-@item idle
-@samp{-u} in @code{who}.
-
-@item ifdef
-@samp{-D} in @code{diff}.
-
-@item ignore
-@samp{-I} in @code{ls};
-@samp{-x} in @code{recode}.
-
-@item ignore-all-space
-@samp{-w} in @code{diff}.
-
-@item ignore-backups
-@samp{-B} in @code{ls}.
-
-@item ignore-blank-lines
-@samp{-B} in @code{diff}.
-
-@item ignore-case
-@samp{-f} in @code{look} and @code{ptx};
-@samp{-i} in @code{diff}.
-
-@item ignore-errors
-@samp{-i} in Make.
-
-@item ignore-file
-@samp{-i} in @code{ptx}.
-
-@item ignore-indentation
-@samp{-S} in @code{etags}.
-
-@item ignore-init-file
-@samp{-f} in Oleo.
-
-@item ignore-interrupts
-@samp{-i} in @code{tee}.
-
-@item ignore-matching-lines
-@samp{-I} in @code{diff}.
-
-@item ignore-space-change
-@samp{-b} in @code{diff}.
-
-@item ignore-zeros
-@samp{-i} in @code{tar}.
-
-@item include
-@samp{-i} in @code{etags};
-@samp{-I} in @code{m4}.
-
-@item include-dir
-@samp{-I} in Make.
-
-@item incremental
-@samp{-G} in @code{tar}.
-
-@item info
-@samp{-i}, @samp{-l}, and @samp{-m} in Finger.
-
-@item initial
-@samp{-i} in @code{expand}.
-
-@item initial-tab
-@samp{-T} in @code{diff}.
-
-@item inode
-@samp{-i} in @code{ls}.
-
-@item interactive
-@samp{-i} in @code{cp}, @code{ln}, @code{mv}, @code{rm};
-@samp{-e} in @code{m4};
-@samp{-p} in @code{xargs};
-@samp{-w} in @code{tar}.
-
-@item intermix-type
-@samp{-p} in @code{shar}.
-
-@item jobs
-@samp{-j} in Make.
-
-@item just-print
-@samp{-n} in Make.
-
-@item keep-going
-@samp{-k} in Make.
-
-@item keep-files
-@samp{-k} in @code{csplit}.
-
-@item kilobytes
-@samp{-k} in @code{du} and @code{ls}.
-
-@item level-for-gzip
-@samp{-g} in @code{shar}.
-
-@item line-bytes
-@samp{-C} in @code{split}.
-
-@item lines
-Used in @code{split}, @code{head}, and @code{tail}.
-
-@item link
-@samp{-l} in @code{cpio}.
-
-@item list
-@samp{-t} in @code{cpio};
-@samp{-l} in @code{recode}.
-
-@item list
-@samp{-t} in @code{tar}.
-
-@item literal
-@samp{-N} in @code{ls}.
-
-@item load-average
-@samp{-l} in Make.
-
-@item login
-Used in @code{su}.
-
-@item machine
-No listing of which programs already use this;
-someone should check to
-see if any actually do and tell @code{gnu@@prep.ai.mit.edu}.
-
-@item macro-name
-@samp{-M} in @code{ptx}.
-
-@item mail
-@samp{-m} in @code{hello} and @code{uname}.
-
-@item make-directories
-@samp{-d} in @code{cpio}.
-
-@item makefile
-@samp{-f} in Make.
-
-@item mapped
-Used in GDB.
-
-@item max-args
-@samp{-n} in @code{xargs}.
-
-@item max-chars
-@samp{-n} in @code{xargs}.
-
-@item max-lines
-@samp{-l} in @code{xargs}.
-
-@item max-load
-@samp{-l} in Make.
-
-@item max-procs
-@samp{-P} in @code{xargs}.
-
-@item mesg
-@samp{-T} in @code{who}.
-
-@item message
-@samp{-T} in @code{who}.
-
-@item minimal
-@samp{-d} in @code{diff}.
-
-@item mixed-uuencode
-@samp{-M} in @code{shar}.
-
-@item mode
-@samp{-m} in @code{install}, @code{mkdir}, and @code{mkfifo}.
-
-@item modification-time
-@samp{-m} in @code{tar}.
-
-@item multi-volume
-@samp{-M} in @code{tar}.
-
-@item name-prefix
-@samp{-a} in Bison.
-
-@item nesting-limit
-@samp{-L} in @code{m4}.
-
-@item net-headers
-@samp{-a} in @code{shar}.
-
-@item new-file
-@samp{-W} in Make.
-
-@item no-builtin-rules
-@samp{-r} in Make.
-
-@item no-character-count
-@samp{-w} in @code{shar}.
-
-@item no-check-existing
-@samp{-x} in @code{shar}.
-
-@item no-create
-@samp{-c} in @code{touch}.
-
-@item no-defines
-@samp{-D} in @code{etags}.
-
-@item no-dereference
-@samp{-d} in @code{cp}.
-
-@item no-keep-going
-@samp{-S} in Make.
-
-@item no-lines
-@samp{-l} in Bison.
-
-@item no-piping
-@samp{-P} in @code{shar}.
-
-@item no-prof
-@samp{-e} in @code{gprof}.
-
-@item no-sort
-@samp{-p} in @code{nm}.
-
-@item no-split
-Used in Makeinfo.
-
-@item no-static
-@samp{-a} in @code{gprof}.
-
-@item no-time
-@samp{-E} in @code{gprof}.
-
-@item no-timestamp
-@samp{-m} in @code{shar}.
-
-@item no-validate
-Used in Makeinfo.
-
-@item no-verbose
-@samp{-v} in @code{shar}.
-
-@item no-warn
-Used in various programs to inhibit warnings.
-
-@item node
-@samp{-n} in @code{info}.
-
-@item nodename
-@samp{-n} in @code{uname}.
-
-@item nonmatching
-@samp{-f} in @code{cpio}.
-
-@item nstuff
-@samp{-n} in @code{objdump}.
-
-@item null
-@samp{-0} in @code{xargs}.
-
-@item number
-@samp{-n} in @code{cat}.
-
-@item number-nonblank
-@samp{-b} in @code{cat}.
-
-@item numeric-sort
-@samp{-n} in @code{nm}.
-
-@item numeric-uid-gid
-@samp{-n} in @code{cpio} and @code{ls}.
-
-@item nx
-Used in GDB.
-
-@item old-archive
-@samp{-o} in @code{tar}.
-
-@item old-file
-@samp{-o} in Make.
-
-@item one-file-system
-@samp{-l} in @code{tar}, @code{cp}, and @code{du}.
-
-@item only-file
-@samp{-o} in @code{ptx}.
-
-@item only-prof
-@samp{-f} in @code{gprof}.
-
-@item only-time
-@samp{-F} in @code{gprof}.
-
-@item output
-In various programs, specify the output file name.
-
-@item output-prefix
-@samp{-o} in @code{shar}.
-
-@item override
-@samp{-o} in @code{rm}.
-
-@item overwrite
-@samp{-c} in @code{unshar}.
-
-@item owner
-@samp{-o} in @code{install}.
-
-@item paginate
-@samp{-l} in @code{diff}.
-
-@item paragraph-indent
-Used in Makeinfo.
-
-@item parents
-@samp{-p} in @code{mkdir} and @code{rmdir}.
-
-@item pass-all
-@samp{-p} in @code{ul}.
-
-@item pass-through
-@samp{-p} in @code{cpio}.
-
-@item port
-@samp{-P} in @code{finger}.
-
-@item portability
-@samp{-c} in @code{cpio} and @code{tar}.
-
-@item prefix-builtins
-@samp{-P} in @code{m4}.
-
-@item prefix
-@samp{-f} in @code{csplit}.
-
-@item preserve
-Used in @code{tar} and @code{cp}.
-
-@item preserve-environment
-@samp{-p} in @code{su}.
-
-@item preserve-modification-time
-@samp{-m} in @code{cpio}.
-
-@item preserve-order
-@samp{-s} in @code{tar}.
-
-@item preserve-permissions
-@samp{-p} in @code{tar}.
-
-@item print
-@samp{-l} in @code{diff}.
-
-@item print-chars
-@samp{-L} in @code{cmp}.
-
-@item print-data-base
-@samp{-p} in Make.
-
-@item print-directory
-@samp{-w} in Make.
-
-@item print-file-name
-@samp{-o} in @code{nm}.
-
-@item print-symdefs
-@samp{-s} in @code{nm}.
-
-@item query-user
-@samp{-X} in @code{shar}.
-
-@item question
-@samp{-q} in Make.
-
-@item quiet
-Used in many programs to inhibit the usual output. @strong{Note:} every
-program accepting @samp{--quiet} should accept @samp{--silent} as a
-synonym.
-
-@item quote-name
-@samp{-Q} in @code{ls}.
-
-@item rcs
-@samp{-n} in @code{diff}.
-
-@item read-full-blocks
-@samp{-B} in @code{tar}.
-
-@item readnow
-Used in GDB.
-
-@item recon
-@samp{-n} in Make.
-
-@item record-number
-@samp{-R} in @code{tar}.
-
-@item recursive
-Used in @code{chgrp}, @code{chown}, @code{cp}, @code{ls}, @code{diff},
-and @code{rm}.
-
-@item reference-limit
-Used in Makeinfo.
-
-@item references
-@samp{-r} in @code{ptx}.
-
-@item regex
-@samp{-r} in @code{tac}.
-
-@item release
-@samp{-r} in @code{uname}.
-
-@item relocation
-@samp{-r} in @code{objdump}.
-
-@item rename
-@samp{-r} in @code{cpio}.
-
-@item replace
-@samp{-i} in @code{xargs}.
-
-@item report-identical-files
-@samp{-s} in @code{diff}.
-
-@item reset-access-time
-@samp{-a} in @code{cpio}.
-
-@item reverse
-@samp{-r} in @code{ls} and @code{nm}.
-
-@item reversed-ed
-@samp{-f} in @code{diff}.
-
-@item right-side-defs
-@samp{-R} in @code{ptx}.
-
-@item same-order
-@samp{-s} in @code{tar}.
-
-@item same-permissions
-@samp{-p} in @code{tar}.
-
-@item save
-@samp{-g} in @code{stty}.
-
-@item se
-Used in GDB.
-
-@item sentence-regexp
-@samp{-S} in @code{ptx}.
-
-@item separate-dirs
-@samp{-S} in @code{du}.
-
-@item separator
-@samp{-s} in @code{tac}.
-
-@item sequence
-Used by @code{recode} to chose files or pipes for sequencing passes.
-
-@item shell
-@samp{-s} in @code{su}.
-
-@item show-all
-@samp{-A} in @code{cat}.
-
-@item show-c-function
-@samp{-p} in @code{diff}.
-
-@item show-ends
-@samp{-E} in @code{cat}.
-
-@item show-function-line
-@samp{-F} in @code{diff}.
-
-@item show-tabs
-@samp{-T} in @code{cat}.
-
-@item silent
-Used in many programs to inhibit the usual output.
-@strong{Note:} every program accepting
-@samp{--silent} should accept @samp{--quiet} as a synonym.
-
-@item size
-@samp{-s} in @code{ls}.
-
-@item sort
-Used in @code{ls}.
-
-@item sparse
-@samp{-S} in @code{tar}.
-
-@item speed-large-files
-@samp{-H} in @code{diff}.
-
-@item split-at
-@samp{-E} in @code{unshar}.
-
-@item split-size-limit
-@samp{-L} in @code{shar}.
-
-@item squeeze-blank
-@samp{-s} in @code{cat}.
-
-@item starting-file
-Used in @code{tar} and @code{diff} to specify which file within
-a directory to start processing with.
-
-@item stdin-file-list
-@samp{-S} in @code{shar}.
-
-@item stop
-@samp{-S} in Make.
-
-@item strict
-@samp{-s} in @code{recode}.
-
-@item strip
-@samp{-s} in @code{install}.
-
-@item strip-all
-@samp{-s} in @code{strip}.
-
-@item strip-debug
-@samp{-S} in @code{strip}.
-
-@item submitter
-@samp{-s} in @code{shar}.
-
-@item suffix
-@samp{-S} in @code{cp}, @code{ln}, @code{mv}.
-
-@item suffix-format
-@samp{-b} in @code{csplit}.
-
-@item sum
-@samp{-s} in @code{gprof}.
-
-@item summarize
-@samp{-s} in @code{du}.
-
-@item symbolic
-@samp{-s} in @code{ln}.
-
-@item symbols
-Used in GDB and @code{objdump}.
-
-@item synclines
-@samp{-s} in @code{m4}.
-
-@item sysname
-@samp{-s} in @code{uname}.
-
-@item tabs
-@samp{-t} in @code{expand} and @code{unexpand}.
-
-@item tabsize
-@samp{-T} in @code{ls}.
-
-@item terminal
-@samp{-T} in @code{tput} and @code{ul}.
-
-@item text
-@samp{-a} in @code{diff}.
-
-@item text-files
-@samp{-T} in @code{shar}.
-
-@item time
-Used in @code{ls} and @code{touch}.
-
-@item to-stdout
-@samp{-O} in @code{tar}.
-
-@item total
-@samp{-c} in @code{du}.
-
-@item touch
-@samp{-t} in Make, @code{ranlib}, and @code{recode}.
-
-@item trace
-@samp{-t} in @code{m4}.
-
-@item traditional
-@samp{-t} in @code{hello};
-@samp{-G} in @code{m4} and @code{ptx}.
-
-@item tty
-Used in GDB.
-
-@item typedefs
-@samp{-t} in @code{etags}.
-
-@item typedefs-and-c++
-@samp{-T} in @code{etags}.
-
-@item typeset-mode
-@samp{-t} in @code{ptx}.
-
-@item uncompress
-@samp{-z} in @code{tar}.
-
-@item unconditional
-@samp{-u} in @code{cpio}.
-
-@item undefine
-@samp{-U} in @code{m4}.
-
-@item undefined-only
-@samp{-u} in @code{nm}.
-
-@item update
-@samp{-u} in @code{cp}, @samp{etags}, @samp{mv}, @samp{tar}.
-
-@item uuencode
-@samp{-B} in @code{shar}.
-
-@item vanilla-operation
-@samp{-V} in @code{shar}.
-
-@item verbose
-Print more information about progress. Many programs support this.
-
-@item verify
-@samp{-W} in @code{tar}.
-
-@item version
-Print the version number.
-
-@item version-control
-@samp{-V} in @code{cp}, @code{ln}, @code{mv}.
-
-@item vgrind
-@samp{-v} in @code{etags}.
-
-@item volume
-@samp{-V} in @code{tar}.
-
-@item what-if
-@samp{-W} in Make.
-
-@item whole-size-limit
-@samp{-l} in @code{shar}.
-
-@item width
-@samp{-w} in @code{ls} and @code{ptx}.
-
-@item word-regexp
-@samp{-W} in @code{ptx}.
-
-@item writable
-@samp{-T} in @code{who}.
-
-@item zeros
-@samp{-z} in @code{gprof}.
-
-@end table
-
-@node Documentation
-@chapter Documenting Programs
-
-Please use Texinfo for documenting GNU programs. See the Texinfo
-manual, either the hardcopy or the version in the GNU Emacs Info
-subsystem (@kbd{C-h i}). See existing GNU Texinfo files (e.g., those
-under the @file{man/} directory in the GNU Emacs distribution) for
-examples.
-
-The title page of the manual should state the version of the program
-which the manual applies to. The Top node of the manual should also
-contain this information. If the manual is changing more frequently
-than or independent of the program, also state a version number for
-the manual in both of these places.
-
-The manual should document all command-line arguments and all
-commands. It should give examples of their use. But don't organize
-the manual as a list of features. Instead, organize it by the
-concepts a user will have before reaching that point in the manual.
-Address the goals that a user will have in mind, and explain how to
-accomplish them. Don't use Unix man pages as a model for how to
-write GNU documentation; they are a bad example to follow.
-
-The manual should have a node named @samp{@var{program} Invocation} or
-@samp{Invoking @var{program}}, where @var{program} stands for the name
-of the program being described, as you would type it in the shell to run
-the program. This node (together with its subnodes, if any) should
-describe the program's command line arguments and how to run it (the
-sort of information people would look in a man page for). Start with an
-@samp{@@example} containing a template for all the options and arguments
-that the program uses.
-
-Alternatively, put a menu item in some menu whose item name fits one of
-the above patterns. This identifies the node which that item points to
-as the node for this purpose, regardless of the node's actual name.
-
-There will be automatic features for specifying a program name and
-quickly reading just this part of its manual.
-
-If one manual describes several programs, it should have such a node for
-each program described.
-
-In addition to its manual, the package should have a file named
-@file{NEWS} which contains a list of user-visible changes worth
-mentioning. In each new release, add items to the front of the file and
-identify the version they pertain to. Don't discard old items; leave
-them in the file after the newer items. This way, a user upgrading from
-any previous version can see what is new.
-
-If the @file{NEWS} file gets very long, move some of the older items
-into a file named @file{ONEWS} and put a note at the end referring the
-user to that file.
-
-Please do not use the term ``pathname'' that is used in Unix
-documentation; use ``file name'' (two words) instead. We use the term
-``path'' only for search paths, which are lists of file names.
-
-It is ok to supply a man page for the program as well as a Texinfo
-manual if you wish to. But keep in mind that supporting a man page
-requires continual effort, each time the program is changed. Any time
-you spend on the man page is time taken away from more useful things you
-could contribute.
-
-Thus, even if a user volunteers to donate a man page, you may find this
-gift costly to accept. Unless you have time on your hands, it may be
-better to refuse the man page unless the same volunteer agrees to take
-full responsibility for maintaining it---so that you can wash your hands
-of it entirely. If the volunteer ceases to do the job, then don't feel
-obliged to pick it up yourself; it may be better to withdraw the man
-page until another volunteer offers to carry on with it.
-
-Alternatively, if you expect the discrepancies to be small enough that
-the man page remains useful, put a prominent note near the beginning of
-the man page explaining that you don't maintain it and that the Texinfo
-manual is more authoritative, and describing how to access the Texinfo
-documentation.
-
-@node Releases
-@chapter Making Releases
-
-Package the distribution of Foo version 69.96 in a gzipped tar file
-named @file{foo-69.96.tar.gz}. It should unpack into a subdirectory
-named @file{foo-69.96}.
-
-Building and installing the program should never modify any of the files
-contained in the distribution. This means that all the files that form
-part of the program in any way must be classified into @dfn{source
-files} and @dfn{non-source files}. Source files are written by humans
-and never changed automatically; non-source files are produced from
-source files by programs under the control of the Makefile.
-
-Naturally, all the source files must be in the distribution. It is okay
-to include non-source files in the distribution, provided they are
-up-to-date and machine-independent, so that building the distribution
-normally will never modify them. We commonly include non-source files
-produced by Bison, Lex, @TeX{}, and Makeinfo; this helps avoid
-unnecessary dependencies between our distributions, so that users can
-install whichever packages they want to install.
-
-Non-source files that might actually be modified by building and
-installing the program should @strong{never} be included in the
-distribution. So if you do distribute non-source files, always make
-sure they are up to date when you make a new distribution.
-
-Make sure that the directory into which the distribution unpacks (as
-well as any subdirectories) are all world-writable (octal mode 777).
-This is so that old versions of @code{tar} which preserve the
-ownership and permissions of the files from the tar archive will be
-able to extract all the files even if the user is unprivileged.
-
-Make sure that all the files in the distribution are world-readable.
-
-Make sure that no file name in the distribution is more than 14
-characters long. Likewise, no file created by building the program
-should have a name longer than 14 characters. The reason for this is
-that some systems adhere to a foolish interpretation of the POSIX
-standard, and refuse to open a longer name, rather than truncating as
-they did in the past.
-
-Don't include any symbolic links in the distribution itself. If the tar
-file contains symbolic links, then people cannot even unpack it on
-systems that don't support symbolic links. Also, don't use multiple
-names for one file in different directories, because certain file
-systems cannot handle this and that prevents unpacking the
-distribution.
-
-Try to make sure that all the file names will be unique on MS-DOG. A
-name on MS-DOG consists of up to 8 characters, optionally followed by a
-period and up to three characters. MS-DOG will truncate extra
-characters both before and after the period. Thus,
-@file{foobarhacker.c} and @file{foobarhacker.o} are not ambiguous; they
-are truncated to @file{foobarha.c} and @file{foobarha.o}, which are
-distinct.
-
-Include in your distribution a copy of the @file{texinfo.tex} you used
-to test print any @file{*.texinfo} files.
-
-Likewise, if your program uses small GNU software packages like regex,
-getopt, obstack, or termcap, include them in the distribution file.
-Leaving them out would make the distribution file a little smaller at
-the expense of possible inconvenience to a user who doesn't know what
-other files to get.
-
-@contents
-
-@bye
diff --git a/util/autoconf/testsuite/Makefile b/util/autoconf/testsuite/Makefile
deleted file mode 100644
index e69de29..0000000
--- a/util/autoconf/testsuite/Makefile
+++ /dev/null
diff --git a/util/autoconf/texinfo.tex b/util/autoconf/texinfo.tex
deleted file mode 100644
index e544dc6..0000000
--- a/util/autoconf/texinfo.tex
+++ /dev/null
@@ -1,4355 +0,0 @@
-%% TeX macros to handle texinfo files
-
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 1994 Free Software Foundation, Inc.
-
-%This texinfo.tex file is free software; you can redistribute it and/or
-%modify it under the terms of the GNU General Public License as
-%published by the Free Software Foundation; either version 2, or (at
-%your option) any later version.
-
-%This texinfo.tex file is distributed in the hope that it will be
-%useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%General Public License for more details.
-
-%You should have received a copy of the GNU General Public License
-%along with this texinfo.tex file; see the file COPYING. If not, write
-%to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
-%USA.
-
-
-%In other words, you are welcome to use, share and improve this program.
-%You are forbidden to forbid anyone else to use, share and improve
-%what you give them. Help stamp out software-hoarding!
-
-% This automatically updates the version number based on RCS.
-\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision$
-\message{Loading texinfo package [Version \texinfoversion]:}
-
-% Print the version number if in a .fmt file.
-\everyjob{\message{[Texinfo version \texinfoversion]}\message{}}
-
-% Save some parts of plain tex whose names we will redefine.
-
-\let\ptextilde=\~
-\let\ptexlbrace=\{
-\let\ptexrbrace=\}
-\let\ptexdots=\dots
-\let\ptexdot=\.
-\let\ptexstar=\*
-\let\ptexend=\end
-\let\ptexbullet=\bullet
-\let\ptexb=\b
-\let\ptexc=\c
-\let\ptexi=\i
-\let\ptext=\t
-\let\ptexl=\l
-\let\ptexL=\L
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- \gdef\tie{\leavevmode\penalty\@M\ }
-}
-\let\~ = \tie % And make it available as @~.
-
-\message{Basics,}
-\chardef\other=12
-
-% If this character appears in an error message or help string, it
-% starts a new line in the output.
-\newlinechar = `^^J
-
-% Set up fixed words for English.
-\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
-\def\putwordInfo{Info}%
-\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
-\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
-\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
-\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
-\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
-\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
-\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
-\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
-\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
-
-% Ignore a token.
-%
-\def\gobble#1{}
-
-\hyphenation{ap-pen-dix}
-\hyphenation{mini-buf-fer mini-buf-fers}
-\hyphenation{eshell}
-
-% Margin to add to right of even pages, to left of odd pages.
-\newdimen \bindingoffset \bindingoffset=0pt
-\newdimen \normaloffset \normaloffset=\hoffset
-\newdimen\pagewidth \newdimen\pageheight
-\pagewidth=\hsize \pageheight=\vsize
-
-% Sometimes it is convenient to have everything in the transcript file
-% and nothing on the terminal. We don't just call \tracingall here,
-% since that produces some useless output on the terminal.
-%
-\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\def\loggingall{\tracingcommands2 \tracingstats2
- \tracingpages1 \tracingoutput1 \tracinglostchars1
- \tracingmacros2 \tracingparagraphs1 \tracingrestores1
- \showboxbreadth\maxdimen\showboxdepth\maxdimen
-}%
-
-%---------------------Begin change-----------------------
-%
-%%%% For @cropmarks command.
-% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
-%
-\newdimen\cornerlong \newdimen\cornerthick
-\newdimen \topandbottommargin
-\newdimen \outerhsize \newdimen \outervsize
-\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
-\outerhsize=7in
-%\outervsize=9.5in
-% Alternative @smallbook page size is 9.25in
-\outervsize=9.25in
-\topandbottommargin=.75in
-%
-%---------------------End change-----------------------
-
-% \onepageout takes a vbox as an argument. Note that \pagecontents
-% does insertions itself, but you have to call it yourself.
-\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
-\def\onepageout#1{\hoffset=\normaloffset
-\ifodd\pageno \advance\hoffset by \bindingoffset
-\else \advance\hoffset by -\bindingoffset\fi
-{\escapechar=`\\\relax % makes sure backslash is used in output files.
-\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
-{\let\hsize=\pagewidth \makefootline}}}%
-\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
-
-%%%% For @cropmarks command %%%%
-
-% Here is a modification of the main output routine for Near East Publications
-% This provides right-angle cropmarks at all four corners.
-% The contents of the page are centerlined into the cropmarks,
-% and any desired binding offset is added as an \hskip on either
-% site of the centerlined box. (P. A. MacKay, 12 November, 1986)
-%
-\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
-{\escapechar=`\\\relax % makes sure backslash is used in output files.
- \shipout
- \vbox to \outervsize{\hsize=\outerhsize
- \vbox{\line{\ewtop\hfill\ewtop}}
- \nointerlineskip
- \line{\vbox{\moveleft\cornerthick\nstop}
- \hfill
- \vbox{\moveright\cornerthick\nstop}}
- \vskip \topandbottommargin
- \centerline{\ifodd\pageno\hskip\bindingoffset\fi
- \vbox{
- {\let\hsize=\pagewidth \makeheadline}
- \pagebody{#1}
- {\let\hsize=\pagewidth \makefootline}}
- \ifodd\pageno\else\hskip\bindingoffset\fi}
- \vskip \topandbottommargin plus1fill minus1fill
- \boxmaxdepth\cornerthick
- \line{\vbox{\moveleft\cornerthick\nsbot}
- \hfill
- \vbox{\moveright\cornerthick\nsbot}}
- \nointerlineskip
- \vbox{\line{\ewbot\hfill\ewbot}}
- }}
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
-%
-% Do @cropmarks to get crop marks
-\def\cropmarks{\let\onepageout=\croppageout }
-
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
-{\catcode`\@ =11
-\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
-\dimen@=\dp#1 \unvbox#1
-\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
-\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
-}
-
-%
-% Here are the rules for the cropmarks. Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
-% Parse an argument, then pass it to #1. The argument is the rest of
-% the input line (except we remove a trailing comment). #1 should be a
-% macro which expects an ordinary undelimited TeX argument.
-%
-\def\parsearg#1{%
- \let\next = #1%
- \begingroup
- \obeylines
- \futurelet\temp\parseargx
-}
-
-% If the next token is an obeyed space (from an @example environment or
-% the like), remove it and recurse. Otherwise, we're done.
-\def\parseargx{%
- % \obeyedspace is defined far below, after the definition of \sepspaces.
- \ifx\obeyedspace\temp
- \expandafter\parseargdiscardspace
- \else
- \expandafter\parseargline
- \fi
-}
-
-% Remove a single space (as the delimiter token to the macro call).
-{\obeyspaces %
- \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
-
-{\obeylines %
- \gdef\parseargline#1^^M{%
- \endgroup % End of the group started in \parsearg.
- %
- % First remove any @c comment, then any @comment.
- % Result of each macro is put in \toks0.
- \argremovec #1\c\relax %
- \expandafter\argremovecomment \the\toks0 \comment\relax %
- %
- % Call the caller's macro, saved as \next in \parsearg.
- \expandafter\next\expandafter{\the\toks0}%
- }%
-}
-
-% Since all \c{,omment} does is throw away the argument, we can let TeX
-% do that for us. The \relax here is matched by the \relax in the call
-% in \parseargline; it could be more or less anything, its purpose is
-% just to delimit the argument to the \c.
-\def\argremovec#1\c#2\relax{\toks0 = {#1}}
-\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
-
-% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
-% @end itemize @c foo
-% will have two active spaces as part of the argument with the
-% `itemize'. Here we remove all active spaces from #1, and assign the
-% result to \toks0.
-%
-% This loses if there are any *other* active characters besides spaces
-% in the argument -- _ ^ +, for example -- since they get expanded.
-% Fortunately, Texinfo does not define any such commands. (If it ever
-% does, the catcode of the characters in questionwill have to be changed
-% here.) But this means we cannot call \removeactivespaces as part of
-% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
-% that \parsearg gets might well have any character at all in it.
-%
-\def\removeactivespaces#1{%
- \begingroup
- \ignoreactivespaces
- \edef\temp{#1}%
- \global\toks0 = \expandafter{\temp}%
- \endgroup
-}
-
-% Change the active space to expand to nothing.
-%
-\begingroup
- \obeyspaces
- \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
-\endgroup
-
-
-\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-
-%% These are used to keep @begin/@end levels from running away
-%% Call \inENV within environments (after a \begingroup)
-\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
-\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment. Type Return to continue.}
-\endgroup\fi} % This is not perfect, but it should reduce lossage
-
-% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Type <Return> to continue.}
-
-\outer\def\begin{\parsearg\beginxxx}
-
-\def\beginxxx #1{%
-\expandafter\ifx\csname #1\endcsname\relax
-{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
-\csname #1\endcsname\fi}
-
-% @end foo executes the definition of \Efoo.
-%
-\def\end{\parsearg\endxxx}
-\def\endxxx #1{%
- \removeactivespaces{#1}%
- \edef\endthing{\the\toks0}%
- %
- \expandafter\ifx\csname E\endthing\endcsname\relax
- \expandafter\ifx\csname \endthing\endcsname\relax
- % There's no \foo, i.e., no ``environment'' foo.
- \errhelp = \EMsimple
- \errmessage{Undefined command `@end \endthing'}%
- \else
- \unmatchedenderror\endthing
- \fi
- \else
- % Everything's ok; the right environment has been started.
- \csname E\endthing\endcsname
- \fi
-}
-
-% There is an environment #1, but it hasn't been started. Give an error.
-%
-\def\unmatchedenderror#1{%
- \errhelp = \EMsimple
- \errmessage{This `@end #1' doesn't have a matching `@#1'}%
-}
-
-% Define the control sequence \E#1 to give an unmatched @end error.
-%
-\def\defineunmatchedend#1{%
- \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
-}
-
-
-% Single-spacing is done by various environments (specifically, in
-% \nonfillstart and \quotations).
-\newskip\singlespaceskip \singlespaceskip = 12.5pt
-\def\singlespace{%
- % Why was this kern here? It messes up equalizing space above and below
- % environments. --karl, 6may93
- %{\advance \baselineskip by -\singlespaceskip
- %\kern \baselineskip}%
- \setleading \singlespaceskip
-}
-
-%% Simple single-character @ commands
-
-% @@ prints an @
-% Kludge this until the fonts are right (grr).
-\def\@{{\tt \char '100}}
-
-% This is turned off because it was never documented
-% and you can use @w{...} around a quote to suppress ligatures.
-%% Define @` and @' to be the same as ` and '
-%% but suppressing ligatures.
-%\def\`{{`}}
-%\def\'{{'}}
-
-% Used to generate quoted braces.
-
-\def\mylbrace {{\tt \char '173}}
-\def\myrbrace {{\tt \char '175}}
-\let\{=\mylbrace
-\let\}=\myrbrace
-
-% @: forces normal size whitespace following.
-\def\:{\spacefactor=1000 }
-
-% @* forces a line break.
-\def\*{\hfil\break\hbox{}\ignorespaces}
-
-% @. is an end-of-sentence period.
-\def\.{.\spacefactor=3000 }
-
-% @enddots{} is an end-of-sentence ellipsis.
-\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
-
-% @! is an end-of-sentence bang.
-\gdef\!{!\spacefactor=3000 }
-
-% @? is an end-of-sentence query.
-\gdef\?{?\spacefactor=3000 }
-
-% @w prevents a word break. Without the \leavevmode, @w at the
-% beginning of a paragraph, when TeX is still in vertical mode, would
-% produce a whole line of output instead of starting the paragraph.
-\def\w#1{\leavevmode\hbox{#1}}
-
-% @group ... @end group forces ... to be all on one page, by enclosing
-% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
-% to keep its height that of a normal line. According to the rules for
-% \topskip (p.114 of the TeXbook), the glue inserted is
-% max (\topskip - \ht (first item), 0). If that height is large,
-% therefore, no glue is inserted, and the space between the headline and
-% the text is small, which looks bad.
-%
-\def\group{\begingroup
- \ifnum\catcode13=\active \else
- \errhelp = \groupinvalidhelp
- \errmessage{@group invalid in context where filling is enabled}%
- \fi
- %
- % The \vtop we start below produces a box with normal height and large
- % depth; thus, TeX puts \baselineskip glue before it, and (when the
- % next line of text is done) \lineskip glue after it. (See p.82 of
- % the TeXbook.) Thus, space below is not quite equal to space
- % above. But it's pretty close.
- \def\Egroup{%
- \egroup % End the \vtop.
- \endgroup % End the \group.
- }%
- %
- \vtop\bgroup
- % We have to put a strut on the last line in case the @group is in
- % the midst of an example, rather than completely enclosing it.
- % Otherwise, the interline space between the last line of the group
- % and the first line afterwards is too small. But we can't put the
- % strut in \Egroup, since there it would be on a line by itself.
- % Hence this just inserts a strut at the beginning of each line.
- \everypar = {\strut}%
- %
- % Since we have a strut on every line, we don't need any of TeX's
- % normal interline spacing.
- \offinterlineskip
- %
- % OK, but now we have to do something about blank
- % lines in the input in @example-like environments, which normally
- % just turn into \lisppar, which will insert no space now that we've
- % turned off the interline space. Simplest is to make them be an
- % empty paragraph.
- \ifx\par\lisppar
- \edef\par{\leavevmode \par}%
- %
- % Reset ^^M's definition to new definition of \par.
- \obeylines
- \fi
- %
- % Do @comment since we are called inside an environment such as
- % @example, where each end-of-line in the input causes an
- % end-of-line in the output. We don't want the end-of-line after
- % the `@group' to put extra space in the output. Since @group
- % should appear on a line by itself (according to the Texinfo
- % manual), we don't worry about eating any user text.
- \comment
-}
-%
-% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
-% message, so this ends up printing `@group can only ...'.
-%
-\newhelp\groupinvalidhelp{%
-group can only be used in environments such as @example,^^J%
-where each line of input produces a line of output.}
-
-% @need space-in-mils
-% forces a page break if there is not space-in-mils remaining.
-
-\newdimen\mil \mil=0.001in
-
-\def\need{\parsearg\needx}
-
-% Old definition--didn't work.
-%\def\needx #1{\par %
-%% This method tries to make TeX break the page naturally
-%% if the depth of the box does not fit.
-%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
-%\prevdepth=-1000pt
-%}}
-
-\def\needx#1{%
- % Go into vertical mode, so we don't make a big box in the middle of a
- % paragraph.
- \par
- %
- % Don't add any leading before our big empty box, but allow a page
- % break, since the best break might be right here.
- \allowbreak
- \nointerlineskip
- \vtop to #1\mil{\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
-}
-
-% @br forces paragraph break
-
-\let\br = \par
-
-% @dots{} output some dots
-
-\def\dots{$\ldots$}
-
-% @page forces the start of a new page
-
-\def\page{\par\vfill\supereject}
-
-% @exdent text....
-% outputs text on separate line in roman font, starting at standard page margin
-
-% This records the amount of indent in the innermost environment.
-% That's how much \exdent should take out.
-\newskip\exdentamount
-
-% This defn is used inside fill environments such as @defun.
-\def\exdent{\parsearg\exdentyyy}
-\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
-
-% This defn is used inside nofill environments such as @example.
-\def\nofillexdent{\parsearg\nofillexdentyyy}
-\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
-\leftline{\hskip\leftskip{\rm#1}}}}
-
-%\hbox{{\rm#1}}\hfil\break}}
-
-% @include file insert text of that file as input.
-
-\def\include{\parsearg\includezzz}
-%Use \input\thisfile to avoid blank after \input, which may be an active
-%char (in which case the blank would become the \input argument).
-%The grouping keeps the value of \thisfile correct even when @include
-%is nested.
-\def\includezzz #1{\begingroup
-\def\thisfile{#1}\input\thisfile
-\endgroup}
-
-\def\thisfile{}
-
-% @center line outputs that line, centered
-
-\def\center{\parsearg\centerzzz}
-\def\centerzzz #1{{\advance\hsize by -\leftskip
-\advance\hsize by -\rightskip
-\centerline{#1}}}
-
-% @sp n outputs n lines of vertical space
-
-\def\sp{\parsearg\spxxx}
-\def\spxxx #1{\par \vskip #1\baselineskip}
-
-% @comment ...line which is ignored...
-% @c is the same as @comment
-% @ignore ... @end ignore is another way to write a comment
-
-\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
-\parsearg \commentxxx}
-
-\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
-
-\let\c=\comment
-
-% Prevent errors for section commands.
-% Used in @ignore and in failing conditionals.
-\def\ignoresections{%
-\let\chapter=\relax
-\let\unnumbered=\relax
-\let\top=\relax
-\let\unnumberedsec=\relax
-\let\unnumberedsection=\relax
-\let\unnumberedsubsec=\relax
-\let\unnumberedsubsection=\relax
-\let\unnumberedsubsubsec=\relax
-\let\unnumberedsubsubsection=\relax
-\let\section=\relax
-\let\subsec=\relax
-\let\subsubsec=\relax
-\let\subsection=\relax
-\let\subsubsection=\relax
-\let\appendix=\relax
-\let\appendixsec=\relax
-\let\appendixsection=\relax
-\let\appendixsubsec=\relax
-\let\appendixsubsection=\relax
-\let\appendixsubsubsec=\relax
-\let\appendixsubsubsection=\relax
-\let\contents=\relax
-\let\smallbook=\relax
-\let\titlepage=\relax
-}
-
-% Used in nested conditionals, where we have to parse the Texinfo source
-% and so want to turn off most commands, in case they are used
-% incorrectly.
-%
-\def\ignoremorecommands{%
- \let\defcv = \relax
- \let\deffn = \relax
- \let\deffnx = \relax
- \let\defindex = \relax
- \let\defivar = \relax
- \let\defmac = \relax
- \let\defmethod = \relax
- \let\defop = \relax
- \let\defopt = \relax
- \let\defspec = \relax
- \let\deftp = \relax
- \let\deftypefn = \relax
- \let\deftypefun = \relax
- \let\deftypevar = \relax
- \let\deftypevr = \relax
- \let\defun = \relax
- \let\defvar = \relax
- \let\defvr = \relax
- \let\ref = \relax
- \let\xref = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\settitle = \relax
- \let\include = \relax
- \let\lowersections = \relax
- \let\down = \relax
- \let\raisesections = \relax
- \let\up = \relax
- \let\set = \relax
- \let\clear = \relax
- \let\item = \relax
- \let\message = \relax
-}
-
-% Ignore @ignore ... @end ignore.
-%
-\def\ignore{\doignore{ignore}}
-
-% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
-%
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\html{\doignore{html}}
-\def\menu{\doignore{menu}}
-\def\direntry{\doignore{direntry}}
-
-% Ignore text until a line `@end #1'.
-%
-\def\doignore#1{\begingroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define a command to swallow text until we reach `@end #1'.
- \long\def\doignoretext##1\end #1{\enddoignore}%
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode32 = 10
- %
- % And now expand that command.
- \doignoretext
-}
-
-% What we do to finish off ignored text.
-%
-\def\enddoignore{\endgroup\ignorespaces}%
-
-\newif\ifwarnedobs\warnedobsfalse
-\def\obstexwarn{%
- \ifwarnedobs\relax\else
- % We need to warn folks that they may have trouble with TeX 3.0.
- % This uses \immediate\write16 rather than \message to get newlines.
- \immediate\write16{}
- \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
- \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
- \immediate\write16{If you are running another version of TeX, relax.}
- \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
- \immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{If you are stuck with version 3.0, run the}
- \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
- \immediate\write16{ to use a workaround.}
- \immediate\write16{}
- \warnedobstrue
- \fi
-}
-
-% **In TeX 3.0, setting text in \nullfont hangs tex. For a
-% workaround (which requires the file ``dummy.tfm'' to be installed),
-% uncomment the following line:
-%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
-
-% Ignore text, except that we keep track of conditional commands for
-% purposes of nesting, up to an `@end #1' command.
-%
-\def\nestedignore#1{%
- \obstexwarn
- % We must actually expand the ignored text to look for the @end
- % command, so that nested ignore constructs work. Thus, we put the
- % text into a \vbox and then do nothing with the result. To minimize
- % the change of memory overflow, we follow the approach outlined on
- % page 401 of the TeXbook: make the current font be a dummy font.
- %
- \setbox0 = \vbox\bgroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define `@end #1' to end the box, which will in turn undefine the
- % @end command again.
- \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
- %
- % We are going to be parsing Texinfo commands. Most cause no
- % trouble when they are used incorrectly, but some commands do
- % complicated argument parsing or otherwise get confused, so we
- % undefine them.
- %
- % We can't do anything about stray @-signs, unfortunately;
- % they'll produce `undefined control sequence' errors.
- \ignoremorecommands
- %
- % Set the current font to be \nullfont, a TeX primitive, and define
- % all the font commands to also use \nullfont. We don't use
- % dummy.tfm, as suggested in the TeXbook, because not all sites
- % might have that installed. Therefore, math mode will still
- % produce output, but that should be an extremely small amount of
- % stuff compared to the main input.
- %
- \nullfont
- \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
- \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
- \let\tensf = \nullfont
- % Similarly for index fonts (mostly for their use in
- % smallexample)
- \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
- \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
- \let\indsf = \nullfont
- %
- % Don't complain when characters are missing from the fonts.
- \tracinglostchars = 0
- %
- % Don't bother to do space factor calculations.
- \frenchspacing
- %
- % Don't report underfull hboxes.
- \hbadness = 10000
- %
- % Do minimal line-breaking.
- \pretolerance = 10000
- %
- % Do not execute instructions in @tex
- \def\tex{\doignore{tex}}
-}
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it.
-%
-\def\set{\parsearg\setxxx}
-\def\setxxx#1{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- \def\temp{#2}%
- \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
- \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
- \fi
-}
-\def\setzzz#1#2 \endsetzzz{\expandafter\xdef\csname SET#1\endcsname{#2}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\def\clear{\parsearg\clearxxx}
-\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
-
-% @value{foo} gets the text saved in variable foo.
-%
-\def\value#1{\expandafter
- \ifx\csname SET#1\endcsname\relax
- {\{No value for ``#1''\}}
- \else \csname SET#1\endcsname \fi}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
-%
-\def\ifset{\parsearg\ifsetxxx}
-\def\ifsetxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifsetfail
- \else
- \expandafter\ifsetsucceed
- \fi
-}
-\def\ifsetsucceed{\conditionalsucceed{ifset}}
-\def\ifsetfail{\nestedignore{ifset}}
-\defineunmatchedend{ifset}
-
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-\def\ifclear{\parsearg\ifclearxxx}
-\def\ifclearxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifclearsucceed
- \else
- \expandafter\ifclearfail
- \fi
-}
-\def\ifclearsucceed{\conditionalsucceed{ifclear}}
-\def\ifclearfail{\nestedignore{ifclear}}
-\defineunmatchedend{ifclear}
-
-% @iftex always succeeds; we read the text following, through @end
-% iftex). But `@end iftex' should be valid only after an @iftex.
-%
-\def\iftex{\conditionalsucceed{iftex}}
-\defineunmatchedend{iftex}
-
-% We can't just want to start a group at @iftex (for example) and end it
-% at @end iftex, since then @set commands inside the conditional have no
-% effect (they'd get reverted at the end of the group). So we must
-% define \Eiftex to redefine itself to be its previous value. (We can't
-% just define it to fail again with an ``unmatched end'' error, since
-% the @ifset might be nested.)
-%
-\def\conditionalsucceed#1{%
- \edef\temp{%
- % Remember the current value of \E#1.
- \let\nece{prevE#1} = \nece{E#1}%
- %
- % At the `@end #1', redefine \E#1 to be its previous value.
- \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
- }%
- \temp
-}
-
-% We need to expand lots of \csname's, but we don't want to expand the
-% control sequences after we've constructed them.
-%
-\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
-
-% @asis just yields its argument. Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math means output in math mode.
-% We don't use $'s directly in the definition of \math because control
-% sequences like \math are expanded when the toc file is written. Then,
-% we read the toc file back, the $'s will be normal characters (as they
-% should be, according to the definition of Texinfo). So we must use a
-% control sequence to switch into and out of math mode.
-%
-% This isn't quite enough for @math to work properly in indices, but it
-% seems unlikely it will ever be needed there.
-%
-\let\implicitmath = $
-\def\math#1{\implicitmath #1\implicitmath}
-
-% @bullet and @minus need the same treatment as @math, just above.
-\def\bullet{\implicitmath\ptexbullet\implicitmath}
-\def\minus{\implicitmath-\implicitmath}
-
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
-\let\nwnode=\node
-\let\lastnode=\relax
-
-\def\donoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\setref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\unnumbnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\appendixnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\let\refill=\relax
-
-% @setfilename is done at the beginning of every texinfo file.
-% So open here the files we need to have open while reading the input.
-% This makes it possible to make a .fmt file for texinfo.
-\def\setfilename{%
- \readauxfile
- \opencontents
- \openindices
- \fixbackslash % Turn off hack to swallow `\input texinfo'.
- \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
- \comment % Ignore the actual filename.
-}
-
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-
-\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
- node \samp{\ignorespaces#1{}}}
-
-\message{fonts,}
-
-% Font-change commands.
-
-% Texinfo supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf analogous to plain's \rm, etc.
-\newfam\sffam
-\def\sf{\fam=\sffam \tensf}
-\let\li = \sf % Sometimes we call it \li, not \sf.
-
-%% Try out Computer Modern fonts at \magstephalf
-\let\mainmagstep=\magstephalf
-
-\ifx\bigger\relax
-\let\mainmagstep=\magstep1
-\font\textrm=cmr12
-\font\texttt=cmtt12
-\else
-\font\textrm=cmr10 scaled \mainmagstep
-\font\texttt=cmtt10 scaled \mainmagstep
-\fi
-% Instead of cmb10, you many want to use cmbx10.
-% cmbx10 is a prettier font on its own, but cmb10
-% looks better when embedded in a line with cmr10.
-\font\textbf=cmb10 scaled \mainmagstep
-\font\textit=cmti10 scaled \mainmagstep
-\font\textsl=cmsl10 scaled \mainmagstep
-\font\textsf=cmss10 scaled \mainmagstep
-\font\textsc=cmcsc10 scaled \mainmagstep
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-
-% A few fonts for @defun, etc.
-\font\defbf=cmbx10 scaled \magstep1 %was 1314
-\font\deftt=cmtt10 scaled \magstep1
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
-
-% Fonts for indices and small examples.
-% We actually use the slanted font rather than the italic,
-% because texinfo normally uses the slanted fonts for that.
-% Do not make many font distinctions in general in the index, since they
-% aren't very useful.
-\font\ninett=cmtt9
-\font\indrm=cmr9
-\font\indit=cmsl9
-\let\indsl=\indit
-\let\indtt=\ninett
-\let\indsf=\indrm
-\let\indbf=\indrm
-\let\indsc=\indrm
-\font\indi=cmmi9
-\font\indsy=cmsy9
-
-% Fonts for headings
-\font\chaprm=cmbx12 scaled \magstep2
-\font\chapit=cmti12 scaled \magstep2
-\font\chapsl=cmsl12 scaled \magstep2
-\font\chaptt=cmtt12 scaled \magstep2
-\font\chapsf=cmss12 scaled \magstep2
-\let\chapbf=\chaprm
-\font\chapsc=cmcsc10 scaled\magstep3
-\font\chapi=cmmi12 scaled \magstep2
-\font\chapsy=cmsy10 scaled \magstep3
-
-\font\secrm=cmbx12 scaled \magstep1
-\font\secit=cmti12 scaled \magstep1
-\font\secsl=cmsl12 scaled \magstep1
-\font\sectt=cmtt12 scaled \magstep1
-\font\secsf=cmss12 scaled \magstep1
-\font\secbf=cmbx12 scaled \magstep1
-\font\secsc=cmcsc10 scaled\magstep2
-\font\seci=cmmi12 scaled \magstep1
-\font\secsy=cmsy10 scaled \magstep2
-
-% \font\ssecrm=cmbx10 scaled \magstep1 % This size an font looked bad.
-% \font\ssecit=cmti10 scaled \magstep1 % The letters were too crowded.
-% \font\ssecsl=cmsl10 scaled \magstep1
-% \font\ssectt=cmtt10 scaled \magstep1
-% \font\ssecsf=cmss10 scaled \magstep1
-
-%\font\ssecrm=cmb10 scaled 1315 % Note the use of cmb rather than cmbx.
-%\font\ssecit=cmti10 scaled 1315 % Also, the size is a little larger than
-%\font\ssecsl=cmsl10 scaled 1315 % being scaled magstep1.
-%\font\ssectt=cmtt10 scaled 1315
-%\font\ssecsf=cmss10 scaled 1315
-
-%\let\ssecbf=\ssecrm
-
-\font\ssecrm=cmbx12 scaled \magstephalf
-\font\ssecit=cmti12 scaled \magstephalf
-\font\ssecsl=cmsl12 scaled \magstephalf
-\font\ssectt=cmtt12 scaled \magstephalf
-\font\ssecsf=cmss12 scaled \magstephalf
-\font\ssecbf=cmbx12 scaled \magstephalf
-\font\ssecsc=cmcsc10 scaled \magstep1
-\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled \magstep1
-% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
-% but that is not a standard magnification.
-
-% Fonts for title page:
-\font\titlerm = cmbx12 scaled \magstep3
-\let\authorrm = \secrm
-
-% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families. Since
-% texinfo doesn't allow for producing subscripts and superscripts, we
-% don't bother to reset \scriptfont and \scriptscriptfont (which would
-% also require loading a lot more fonts).
-%
-\def\resetmathfonts{%
- \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
- \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
- \textfont\ttfam = \tentt \textfont\sffam = \tensf
-}
-
-
-% The font-changing commands redefine the meanings of \tenSTYLE, instead
-% of just \STYLE. We do this so that font changes will continue to work
-% in math mode, where it is the current \fam that is relevant in most
-% cases, not the current. Plain TeX does, for example,
-% \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need
-% to redefine \bf itself.
-\def\textfonts{%
- \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
- \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
- \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
- \resetmathfonts}
-\def\chapfonts{%
- \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
- \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
- \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
- \resetmathfonts}
-\def\secfonts{%
- \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
- \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
- \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
- \resetmathfonts}
-\def\subsecfonts{%
- \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
- \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
- \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
- \resetmathfonts}
-\def\indexfonts{%
- \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
- \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
- \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy
- \resetmathfonts}
-
-% Set up the default fonts, so we can use them for creating boxes.
-%
-\textfonts
-
-% Count depth in font-changes, for error checks
-\newcount\fontdepth \fontdepth=0
-
-% Fonts for short table of contents.
-\font\shortcontrm=cmr12
-\font\shortcontbf=cmbx12
-\font\shortcontsl=cmsl12
-
-%% Add scribe-like font environments, plus @l for inline lisp (usually sans
-%% serif) and @ii for TeX italic
-
-% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
-% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
-\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
-
-\let\i=\smartitalic
-\let\var=\smartitalic
-\let\dfn=\smartitalic
-\let\emph=\smartitalic
-\let\cite=\smartitalic
-
-\def\b#1{{\bf #1}}
-\let\strong=\b
-
-% We can't just use \exhyphenpenalty, because that only has effect at
-% the end of a paragraph. Restore normal hyphenation at the end of the
-% group within which \nohyphenation is presumably called.
-%
-\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
-\def\restorehyphenation{\hyphenchar\font = `- }
-
-\def\t#1{%
- {\tt \nohyphenation \rawbackslash \frenchspacing #1}%
- \null
-}
-\let\ttfont = \t
-%\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
-\def\samp #1{`\tclose{#1}'\null}
-\def\key #1{{\tt \nohyphenation \uppercase{#1}}\null}
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-\let\file=\samp
-
-% @code is a modification of @t,
-% which makes spaces the same size as normal in the surrounding text.
-\def\tclose#1{%
- {%
- % Change normal interword space to be same as for the current font.
- \spaceskip = \fontdimen2\font
- %
- % Switch to typewriter.
- \tt
- %
- % But `\ ' produces the large typewriter interword space.
- \def\ {{\spaceskip = 0pt{} }}%
- %
- % Turn off hyphenation.
- \nohyphenation
- %
- \rawbackslash
- \frenchspacing
- #1%
- }%
- \null
-}
-
-% We *must* turn on hyphenation at `-' and `_' in \code.
-% Otherwise, it is too hard to avoid overful hboxes
-% in the Emacs manual, the Library manual, etc.
-
-% Unfortunately, TeX uses one parameter (\hyphenchar) to control
-% both hyphenation at - and hyphenation within words.
-% We must therefore turn them both off (\tclose does that)
-% and arrange explicitly to hyphenate an a dash.
-% -- rms.
-{
-\catcode`\-=\active
-\catcode`\_=\active
-\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
-% The following is used by \doprintindex to insure that long function names
-% wrap around. It is necessary for - and _ to be active before the index is
-% read from the file, as \entry parses the arguments long before \code is
-% ever called. -- mycroft
-\global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder}
-}
-\def\realdash{-}
-\def\realunder{_}
-\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{\normalunderscore\discretionary{}{}{}}
-\def\codex #1{\tclose{#1}\endgroup}
-
-%\let\exp=\tclose %Was temporary
-
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else\tclose{\look}\fi
-\else\tclose{\look}\fi}
-
-% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of
-% @dmn{}pt.
-%
-\def\dmn#1{\thinspace #1}
-
-\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
-
-\def\l#1{{\li #1}\null} %
-
-\def\r#1{{\rm #1}} % roman font
-% Use of \lowercase was suggested.
-\def\sc#1{{\smallcaps#1}} % smallcaps font
-\def\ii#1{{\it #1}} % italic font
-
-\message{page headings,}
-
-\newskip\titlepagetopglue \titlepagetopglue = 1.5in
-\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
-
-% First the title page. Must do @settitle before @titlepage.
-\def\titlefont#1{{\titlerm #1}}
-
-\newif\ifseenauthor
-\newif\iffinishedtitlepage
-
-\def\shorttitlepage{\parsearg\shorttitlepagezzz}
-\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
- \endgroup\page\hbox{}\page}
-
-\def\titlepage{\begingroup \parindent=0pt \textfonts
- \let\subtitlerm=\tenrm
-% I deinstalled the following change because \cmr12 is undefined.
-% This change was not in the ChangeLog anyway. --rms.
-% \let\subtitlerm=\cmr12
- \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
- %
- \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
- %
- % Leave some space at the very top of the page.
- \vglue\titlepagetopglue
- %
- % Now you can print the title using @title.
- \def\title{\parsearg\titlezzz}%
- \def\titlezzz##1{\leftline{\titlefont{##1}}
- % print a rule at the page bottom also.
- \finishedtitlepagefalse
- \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
- % No rule at page bottom unless we print one at the top with @title.
- \finishedtitlepagetrue
- %
- % Now you can put text using @subtitle.
- \def\subtitle{\parsearg\subtitlezzz}%
- \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
- %
- % @author should come last, but may come many times.
- \def\author{\parsearg\authorzzz}%
- \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
- {\authorfont \leftline{##1}}}%
- %
- % Most title ``pages'' are actually two pages long, with space
- % at the top of the second. We don't want the ragged left on the second.
- \let\oldpage = \page
- \def\page{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- \oldpage
- \let\page = \oldpage
- \hbox{}}%
-% \def\page{\oldpage \hbox{}}
-}
-
-\def\Etitlepage{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- % It is important to do the page break before ending the group,
- % because the headline and footline are only empty inside the group.
- % If we use the new definition of \page, we always get a blank page
- % after the title page, which we certainly don't want.
- \oldpage
- \endgroup
- \HEADINGSon
-}
-
-\def\finishtitlepage{%
- \vskip4pt \hrule height 2pt width \hsize
- \vskip\titlepagebottomglue
- \finishedtitlepagetrue
-}
-
-%%% Set up page headings and footings.
-
-\let\thispage=\folio
-
-\newtoks \evenheadline % Token sequence for heading line of even pages
-\newtoks \oddheadline % Token sequence for heading line of odd pages
-\newtoks \evenfootline % Token sequence for footing line of even pages
-\newtoks \oddfootline % Token sequence for footing line of odd pages
-
-% Now make Tex use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
- \else \the\evenheadline \fi}}
-\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
- \else \the\evenfootline \fi}\HEADINGShook}
-\let\HEADINGShook=\relax
-
-% Commands to set those variables.
-% For example, this is what @headings on does
-% @evenheading @thistitle|@thispage|@thischapter
-% @oddheading @thischapter|@thispage|@thistitle
-% @evenfooting @thisfile||
-% @oddfooting ||@thisfile
-
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\everyheading{\parsearg\everyheadingxxx}
-
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\everyfooting{\parsearg\everyfootingxxx}
-
-{\catcode`\@=0 %
-
-\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
-\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
-\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
-\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
-\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
-\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
-\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-%
-}% unbind the catcode of @.
-
-% @headings double turns headings on for double-sided printing.
-% @headings single turns headings on for single-sided printing.
-% @headings off turns them off.
-% @headings on same as @headings double, retained for compatibility.
-% @headings after turns on double-sided headings after this page.
-% @headings doubleafter turns on double-sided headings after this page.
-% @headings singleafter turns on single-sided headings after this page.
-% By default, they are off.
-
-\def\headings #1 {\csname HEADINGS#1\endcsname}
-
-\def\HEADINGSoff{
-\global\evenheadline={\hfil} \global\evenfootline={\hfil}
-\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
-\HEADINGSoff
-% When we turn headings on, set the page number to 1.
-% For double-sided printing, put current file name in lower left corner,
-% chapter name on inside top of right hand pages, document
-% title on inside top of left hand pages, and page numbers on outside top
-% edge of all pages.
-\def\HEADINGSdouble{
-%\pagealignmacro
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-}
-% For single-sided printing, chapter title goes across top left of page,
-% page number on top right.
-\def\HEADINGSsingle{
-%\pagealignmacro
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-}
-\def\HEADINGSon{\HEADINGSdouble}
-
-\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
-\let\HEADINGSdoubleafter=\HEADINGSafter
-\def\HEADINGSdoublex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-}
-
-\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
-\def\HEADINGSsinglex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-}
-
-% Subroutines used in generating headings
-% Produces Day Month Year style of output.
-\def\today{\number\day\space
-\ifcase\month\or
-January\or February\or March\or April\or May\or June\or
-July\or August\or September\or October\or November\or December\fi
-\space\number\year}
-
-% Use this if you want the Month Day, Year style of output.
-%\def\today{\ifcase\month\or
-%January\or February\or March\or April\or May\or June\or
-%July\or August\or September\or October\or November\or December\fi
-%\space\number\day, \number\year}
-
-% @settitle line... specifies the title of the document, for headings
-% It generates no output of its own
-
-\def\thistitle{No Title}
-\def\settitle{\parsearg\settitlezzz}
-\def\settitlezzz #1{\gdef\thistitle{#1}}
-
-\message{tables,}
-
-% @tabs -- simple alignment
-
-% These don't work. For one thing, \+ is defined as outer.
-% So these macros cannot even be defined.
-
-%\def\tabs{\parsearg\tabszzz}
-%\def\tabszzz #1{\settabs\+#1\cr}
-%\def\tabline{\parsearg\tablinezzz}
-%\def\tablinezzz #1{\+#1\cr}
-%\def\&{&}
-
-% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
-
-% default indentation of table text
-\newdimen\tableindent \tableindent=.8in
-% default indentation of @itemize and @enumerate text
-\newdimen\itemindent \itemindent=.3in
-% margin between end of table item and start of table text.
-\newdimen\itemmargin \itemmargin=.1in
-
-% used internally for \itemindent minus \itemmargin
-\newdimen\itemmax
-
-% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
-% these defs.
-% They also define \itemindex
-% to index the item name in whatever manner is desired (perhaps none).
-
-\newif\ifitemxneedsnegativevskip
-
-\def\itemxpar{\par\ifitemxneedsnegativevskip\vskip-\parskip\nobreak\fi}
-
-\def\internalBitem{\smallbreak \parsearg\itemzzz}
-\def\internalBitemx{\itemxpar \parsearg\itemzzz}
-
-\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
-\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
-
-\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
-\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
-
-\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
- \itemzzz {#1}}
-
-\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
- \itemzzz {#1}}
-
-\def\itemzzz #1{\begingroup %
- \advance\hsize by -\rightskip
- \advance\hsize by -\tableindent
- \setbox0=\hbox{\itemfont{#1}}%
- \itemindex{#1}%
- \nobreak % This prevents a break before @itemx.
- %
- % Be sure we are not still in the middle of a paragraph.
- %{\parskip = 0in
- %\par
- %}%
- %
- % If the item text does not fit in the space we have, put it on a line
- % by itself, and do not allow a page break either before or after that
- % line. We do not start a paragraph here because then if the next
- % command is, e.g., @kindex, the whatsit would get put into the
- % horizontal list on a line by itself, resulting in extra blank space.
- \ifdim \wd0>\itemmax
- %
- % Make this a paragraph so we get the \parskip glue and wrapping,
- % but leave it ragged-right.
- \begingroup
- \advance\leftskip by-\tableindent
- \advance\hsize by\tableindent
- \advance\rightskip by0pt plus1fil
- \leavevmode\unhbox0\par
- \endgroup
- %
- % We're going to be starting a paragraph, but we don't want the
- % \parskip glue -- logically it's part of the @item we just started.
- \nobreak \vskip-\parskip
- %
- % Stop a page break at the \parskip glue coming up. Unfortunately
- % we can't prevent a possible page break at the following
- % \baselineskip glue.
- \nobreak
- \endgroup
- \itemxneedsnegativevskipfalse
- \else
- % The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line. Since that
- % text will be indented by \tableindent, we make the item text be in
- % a zero-width box.
- \noindent
- \rlap{\hskip -\tableindent\box0}\ignorespaces%
- \endgroup%
- \itemxneedsnegativevskiptrue%
- \fi
-}
-
-\def\item{\errmessage{@item while not in a table}}
-\def\itemx{\errmessage{@itemx while not in a table}}
-\def\kitem{\errmessage{@kitem while not in a table}}
-\def\kitemx{\errmessage{@kitemx while not in a table}}
-\def\xitem{\errmessage{@xitem while not in a table}}
-\def\xitemx{\errmessage{@xitemx while not in a table}}
-
-%% Contains a kludge to get @end[description] to work
-\def\description{\tablez{\dontindex}{1}{}{}{}{}}
-
-\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
-{\obeylines\obeyspaces%
-\gdef\tablex #1^^M{%
-\tabley\dontindex#1 \endtabley}}
-
-\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
-{\obeylines\obeyspaces%
-\gdef\ftablex #1^^M{%
-\tabley\fnitemindex#1 \endtabley
-\def\Eftable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
-{\obeylines\obeyspaces%
-\gdef\vtablex #1^^M{%
-\tabley\vritemindex#1 \endtabley
-\def\Evtable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\dontindex #1{}
-\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
-\def\vritemindex #1{\doind {vr}{\code{#1}}}%
-
-{\obeyspaces %
-\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
-\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
-
-\def\tablez #1#2#3#4#5#6{%
-\aboveenvbreak %
-\begingroup %
-\def\Edescription{\Etable}% Neccessary kludge.
-\let\itemindex=#1%
-\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
-\ifnum 0#4>0 \tableindent=#4\mil \fi %
-\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
-\def\itemfont{#2}%
-\itemmax=\tableindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \tableindent %
-\exdentamount=\tableindent
-\parindent = 0pt
-\parskip = \smallskipamount
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def\Etable{\endgraf\afterenvbreak\endgroup}%
-\let\item = \internalBitem %
-\let\itemx = \internalBitemx %
-\let\kitem = \internalBkitem %
-\let\kitemx = \internalBkitemx %
-\let\xitem = \internalBxitem %
-\let\xitemx = \internalBxitemx %
-}
-
-% This is the counter used by @enumerate, which is really @itemize
-
-\newcount \itemno
-
-\def\itemize{\parsearg\itemizezzz}
-
-\def\itemizezzz #1{%
- \begingroup % ended by the @end itemsize
- \itemizey {#1}{\Eitemize}
-}
-
-\def\itemizey #1#2{%
-\aboveenvbreak %
-\itemmax=\itemindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \itemindent %
-\exdentamount=\itemindent
-\parindent = 0pt %
-\parskip = \smallskipamount %
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def#2{\endgraf\afterenvbreak\endgroup}%
-\def\itemcontents{#1}%
-\let\item=\itemizeitem}
-
-% Set sfcode to normal for the chars that usually have another value.
-% These are `.?!:;,'
-\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
- \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
-
-% \splitoff TOKENS\endmark defines \first to be the first token in
-% TOKENS, and \rest to be the remainder.
-%
-\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
-
-% Allow an optional argument of an uppercase letter, lowercase letter,
-% or number, to specify the first label in the enumerated list. No
-% argument is the same as `1'.
-%
-\def\enumerate{\parsearg\enumeratezzz}
-\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
-\def\enumeratey #1 #2\endenumeratey{%
- \begingroup % ended by the @end enumerate
- %
- % If we were given no argument, pretend we were given `1'.
- \def\thearg{#1}%
- \ifx\thearg\empty \def\thearg{1}\fi
- %
- % Detect if the argument is a single token. If so, it might be a
- % letter. Otherwise, the only valid thing it can be is a number.
- % (We will always have one token, because of the test we just made.
- % This is a good thing, since \splitoff doesn't work given nothing at
- % all -- the first parameter is undelimited.)
- \expandafter\splitoff\thearg\endmark
- \ifx\rest\empty
- % Only one token in the argument. It could still be anything.
- % A ``lowercase letter'' is one whose \lccode is nonzero.
- % An ``uppercase letter'' is one whose \lccode is both nonzero, and
- % not equal to itself.
- % Otherwise, we assume it's a number.
- %
- % We need the \relax at the end of the \ifnum lines to stop TeX from
- % continuing to look for a <number>.
- %
- \ifnum\lccode\expandafter`\thearg=0\relax
- \numericenumerate % a number (we hope)
- \else
- % It's a letter.
- \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
- \lowercaseenumerate % lowercase letter
- \else
- \uppercaseenumerate % uppercase letter
- \fi
- \fi
- \else
- % Multiple tokens in the argument. We hope it's a number.
- \numericenumerate
- \fi
-}
-
-% An @enumerate whose labels are integers. The starting integer is
-% given in \thearg.
-%
-\def\numericenumerate{%
- \itemno = \thearg
- \startenumeration{\the\itemno}%
-}
-
-% The starting (lowercase) letter is in \thearg.
-\def\lowercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more lowercase letters in @enumerate; get a bigger
- alphabet}%
- \fi
- \char\lccode\itemno
- }%
-}
-
-% The starting (uppercase) letter is in \thearg.
-\def\uppercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more uppercase letters in @enumerate; get a bigger
- alphabet}
- \fi
- \char\uccode\itemno
- }%
-}
-
-% Call itemizey, adding a period to the first argument and supplying the
-% common last two arguments. Also subtract one from the initial value in
-% \itemno, since @item increments \itemno.
-%
-\def\startenumeration#1{%
- \advance\itemno by -1
- \itemizey{#1.}\Eenumerate\flushcr
-}
-
-% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
-% to @enumerate.
-%
-\def\alphaenumerate{\enumerate{a}}
-\def\capsenumerate{\enumerate{A}}
-\def\Ealphaenumerate{\Eenumerate}
-\def\Ecapsenumerate{\Eenumerate}
-
-% Definition of @item while inside @itemize.
-
-\def\itemizeitem{%
-\advance\itemno by 1
-{\let\par=\endgraf \smallbreak}%
-\ifhmode \errmessage{\in hmode at itemizeitem}\fi
-{\parskip=0in \hskip 0pt
-\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
-\vadjust{\penalty 1200}}%
-\flushcr}
-
-% @multitable macros
-% Amy Hendrickson, 8/18/94
-%
-% @multitable ... @endmultitable will make as many columns as desired.
-% Contents of each column will wrap at width given in preamble. Width
-% can be specified either with sample text given in a template line,
-% or in percent of \hsize, the current width of text on page.
-
-% Table can continue over pages but will only break between lines.
-
-% To make preamble:
-%
-% Either define widths of columns in terms of percent of \hsize:
-% @multitable @percentofhsize .2 .3 .5
-% @item ...
-%
-% Numbers following @percentofhsize are the percent of the total
-% current hsize to be used for each column. You may use as many
-% columns as desired.
-
-% Or use a template:
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item ...
-% using the widest term desired in each column.
-
-
-% Each new table line starts with @item, each subsequent new column
-% starts with @tab. Empty columns may be produced by supplying @tab's
-% with nothing between them for as many times as empty columns are needed,
-% ie, @tab@tab@tab will produce two empty columns.
-
-% @item, @tab, @multicolumn or @endmulticolumn do not need to be on their
-% own lines, but it will not hurt if they are.
-
-% Sample multitable:
-
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item first col stuff @tab second col stuff @tab third col
-% @item
-% first col stuff
-% @tab
-% second col stuff
-% @tab
-% third col
-% @item first col stuff @tab second col stuff
-% @tab Many paragraphs of text may be used in any column.
-%
-% They will wrap at the width determined by the template.
-% @item@tab@tab This will be in third column.
-% @endmultitable
-
-% Default dimensions may be reset by user.
-% @intableparskip will set vertical space between paragraphs in table.
-% @intableparindent will set paragraph indent in table.
-% @spacebetweencols will set horizontal space to be left between columns.
-% @spacebetweenlines will set vertical space to be left between lines.
-
-%%%%
-% Dimensions
-
-\newdimen\intableparskip
-\newdimen\intableparindent
-\newdimen\spacebetweencols
-\newdimen\spacebetweenlines
-\intableparskip=0pt
-\intableparindent=6pt
-\spacebetweencols=12pt
-\spacebetweenlines=12pt
-
-%%%%
-% Macros used to set up halign preamble:
-\let\endsetuptable\relax
-\def\xendsetuptable{\endsetuptable}
-\let\percentofhsize\relax
-\def\xpercentofhsize{\percentofhsize}
-\newif\ifsetpercent
-
-\newcount\colcount
-\def\setuptable#1{\def\firstarg{#1}%
-\ifx\firstarg\xendsetuptable\let\go\relax%
-\else
- \ifx\firstarg\xpercentofhsize\global\setpercenttrue%
- \else
- \ifsetpercent
- \if#1.\else%
- \global\advance\colcount by1 %
- \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
- \fi
- \else
- \global\advance\colcount by1
- \setbox0=\hbox{#1}%
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
- \fi%
- \fi%
- \let\go\setuptable%
-\fi\go}
-%%%%
-% multitable syntax
-\def\tab{&}
-
-%%%%
-% @multitable ... @endmultitable definitions:
-
-\def\multitable#1\item{\bgroup
-\let\item\cr
-\tolerance=9500
-\hbadness=9500
-\parskip=\intableparskip
-\parindent=\intableparindent
-\overfullrule=0pt
-\global\colcount=0\relax%
-\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
- % To parse everything between @multitable and @item :
-\def\one{#1}\expandafter\setuptable\one\endsetuptable
- % Need to reset this to 0 after \setuptable.
-\global\colcount=0\relax%
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
-\halign\bgroup&\global\advance\colcount by 1\relax%
-\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \spacebetweencols to all columns after
- % the first one.
- % If a template has been used, we will add \spacebetweencols
- % to the width of each template entry.
- % If user has set preamble in terms of percent of \hsize
- % we will use that dimension as the width of the column, and
- % the \leftskip will keep entries from bumping into each other.
- % Table will start at left margin and final column will justify at
- % right margin.
-\ifnum\colcount=1
-\else
- \ifsetpercent
- \else
- % If user has <not> set preamble in terms of percent of \hsize
- % we will advance \hsize by \spacebetweencols
- \advance\hsize by \spacebetweencols
- \fi
- % In either case we will make \leftskip=\spacebetweencols:
-\leftskip=\spacebetweencols
-\fi
-\noindent##}\cr%
- % \everycr will reset column counter, \colcount, at the end of
- % each line. Every column entry will cause \colcount to advance by one.
- % The table preamble
- % looks at the current \colcount to find the correct column width.
-\global\everycr{\noalign{\nointerlineskip\vskip\spacebetweenlines
-\filbreak%% keeps underfull box messages off when table breaks over pages.
-\global\colcount=0\relax}}}
-
-\message{indexing,}
-% Index generation facilities
-
-% Define \newwrite to be identical to plain tex's \newwrite
-% except not \outer, so it can be used within \newindex.
-{\catcode`\@=11
-\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
-
-% \newindex {foo} defines an index named foo.
-% It automatically defines \fooindex such that
-% \fooindex ...rest of line... puts an entry in the index foo.
-% It also defines \fooindfile to be the number of the output channel for
-% the file that accumulates this index. The file's extension is foo.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
-
-\def\newindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#1}}
-}
-
-% @defindex foo == \newindex{foo}
-
-\def\defindex{\parsearg\newindex}
-
-% Define @defcodeindex, like @defindex except put all entries in @code.
-
-\def\newcodeindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#1}}
-}
-
-\def\defcodeindex{\parsearg\newcodeindex}
-
-% @synindex foo bar makes index foo feed into index bar.
-% Do this instead of @defindex foo if you don't want it as a separate index.
-\def\synindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#2}}%
-}
-
-% @syncodeindex foo bar similar, but put all entries made for index foo
-% inside @code.
-\def\syncodeindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#2}}%
-}
-
-% Define \doindex, the driver for all \fooindex macros.
-% Argument #1 is generated by the calling \fooindex macro,
-% and it is "foo", the name of the index.
-
-% \doindex just uses \parsearg; it calls \doind for the actual work.
-% This is because \doind is more useful to call from other macros.
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-
-\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
-\def\singleindexer #1{\doind{\indexname}{#1}}
-
-% like the previous two, but they put @code around the argument.
-\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
-\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-
-\def\indexdummies{%
-% Take care of the plain tex accent commands.
-\def\"{\realbackslash "}%
-\def\`{\realbackslash `}%
-\def\'{\realbackslash '}%
-\def\^{\realbackslash ^}%
-\def\~{\realbackslash ~}%
-\def\={\realbackslash =}%
-\def\b{\realbackslash b}%
-\def\c{\realbackslash c}%
-\def\d{\realbackslash d}%
-\def\u{\realbackslash u}%
-\def\v{\realbackslash v}%
-\def\H{\realbackslash H}%
-% Take care of the plain tex special European modified letters.
-\def\oe{\realbackslash oe}%
-\def\ae{\realbackslash ae}%
-\def\aa{\realbackslash aa}%
-\def\OE{\realbackslash OE}%
-\def\AE{\realbackslash AE}%
-\def\AA{\realbackslash AA}%
-\def\o{\realbackslash o}%
-\def\O{\realbackslash O}%
-\def\l{\realbackslash l}%
-\def\L{\realbackslash L}%
-\def\ss{\realbackslash ss}%
-% Take care of texinfo commands likely to appear in an index entry.
-\def\_{{\realbackslash _}}%
-\def\w{\realbackslash w }%
-\def\bf{\realbackslash bf }%
-\def\rm{\realbackslash rm }%
-\def\sl{\realbackslash sl }%
-\def\sf{\realbackslash sf}%
-\def\tt{\realbackslash tt}%
-\def\gtr{\realbackslash gtr}%
-\def\less{\realbackslash less}%
-\def\hat{\realbackslash hat}%
-\def\char{\realbackslash char}%
-\def\TeX{\realbackslash TeX}%
-\def\dots{\realbackslash dots }%
-\def\copyright{\realbackslash copyright }%
-\def\tclose##1{\realbackslash tclose {##1}}%
-\def\code##1{\realbackslash code {##1}}%
-\def\samp##1{\realbackslash samp {##1}}%
-\def\t##1{\realbackslash r {##1}}%
-\def\r##1{\realbackslash r {##1}}%
-\def\i##1{\realbackslash i {##1}}%
-\def\b##1{\realbackslash b {##1}}%
-\def\cite##1{\realbackslash cite {##1}}%
-\def\key##1{\realbackslash key {##1}}%
-\def\file##1{\realbackslash file {##1}}%
-\def\var##1{\realbackslash var {##1}}%
-\def\kbd##1{\realbackslash kbd {##1}}%
-\def\dfn##1{\realbackslash dfn {##1}}%
-\def\emph##1{\realbackslash emph {##1}}%
-}
-
-% \indexnofonts no-ops all font-change commands.
-% This is used when outputting the strings to sort the index by.
-\def\indexdummyfont#1{#1}
-\def\indexdummytex{TeX}
-\def\indexdummydots{...}
-
-\def\indexnofonts{%
-% Just ignore accents.
-\let\"=\indexdummyfont
-\let\`=\indexdummyfont
-\let\'=\indexdummyfont
-\let\^=\indexdummyfont
-\let\~=\indexdummyfont
-\let\==\indexdummyfont
-\let\b=\indexdummyfont
-\let\c=\indexdummyfont
-\let\d=\indexdummyfont
-\let\u=\indexdummyfont
-\let\v=\indexdummyfont
-\let\H=\indexdummyfont
-% Take care of the plain tex special European modified letters.
-\def\oe{oe}%
-\def\ae{ae}%
-\def\aa{aa}%
-\def\OE{OE}%
-\def\AE{AE}%
-\def\AA{AA}%
-\def\o{o}%
-\def\O{O}%
-\def\l{l}%
-\def\L{L}%
-\def\ss{ss}%
-\let\w=\indexdummyfont
-\let\t=\indexdummyfont
-\let\r=\indexdummyfont
-\let\i=\indexdummyfont
-\let\b=\indexdummyfont
-\let\emph=\indexdummyfont
-\let\strong=\indexdummyfont
-\let\cite=\indexdummyfont
-\let\sc=\indexdummyfont
-%Don't no-op \tt, since it isn't a user-level command
-% and is used in the definitions of the active chars like <, >, |...
-%\let\tt=\indexdummyfont
-\let\tclose=\indexdummyfont
-\let\code=\indexdummyfont
-\let\file=\indexdummyfont
-\let\samp=\indexdummyfont
-\let\kbd=\indexdummyfont
-\let\key=\indexdummyfont
-\let\var=\indexdummyfont
-\let\TeX=\indexdummytex
-\let\dots=\indexdummydots
-}
-
-% To define \realbackslash, we must make \ not be an escape.
-% We must first make another character (@) an escape
-% so we do not become unable to do a definition.
-
-{\catcode`\@=0 \catcode`\\=\other
-@gdef@realbackslash{\}}
-
-\let\indexbackslash=0 %overridden during \printindex.
-
-\def\doind #1#2{%
-{\count10=\lastpenalty %
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\escapechar=`\\%
-{\let\folio=0% Expand all macros now EXCEPT \folio
-\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
-% so it will be output as is; and it will print as backslash in the indx.
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}}}%
-\temp }%
-}\penalty\count10}}
-
-\def\dosubind #1#2#3{%
-{\count10=\lastpenalty %
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\escapechar=`\\%
-{\let\folio=0%
-\def\rawbackslashxx{\indexbackslash}%
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2 #3}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
-\temp }%
-}\penalty\count10}}
-
-% The index entry written in the file actually looks like
-% \entry {sortstring}{page}{topic}
-% or
-% \entry {sortstring}{page}{topic}{subtopic}
-% The texindex program reads in these files and writes files
-% containing these kinds of lines:
-% \initial {c}
-% before the first topic whose initial is c
-% \entry {topic}{pagelist}
-% for a topic that is used without subtopics
-% \primary {topic}
-% for the beginning of a topic that is used with subtopics
-% \secondary {subtopic}{pagelist}
-% for each subtopic.
-
-% Define the user-accessible indexing commands
-% @findex, @vindex, @kindex, @cindex.
-
-\def\findex {\fnindex}
-\def\kindex {\kyindex}
-\def\cindex {\cpindex}
-\def\vindex {\vrindex}
-\def\tindex {\tpindex}
-\def\pindex {\pgindex}
-
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
-% Define the macros used in formatting output of the sorted index material.
-
-% This is what you call to cause a particular index to get printed.
-% Write
-% @unnumbered Function Index
-% @printindex fn
-
-\def\printindex{\parsearg\doprintindex}
-
-\def\doprintindex#1{%
- \tex
- \dobreak \chapheadingskip {10000}
- \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
- \catcode`\$=\other
- \catcode`\~=\other
- \indexbreaks
- %
- % The following don't help, since the chars were translated
- % when the raw index was written, and their fonts were discarded
- % due to \indexnofonts.
- %\catcode`\"=\active
- %\catcode`\^=\active
- %\catcode`\_=\active
- %\catcode`\|=\active
- %\catcode`\<=\active
- %\catcode`\>=\active
- % %
- \def\indexbackslash{\rawbackslashxx}
- \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
- \begindoublecolumns
- %
- % See if the index file exists and is nonempty.
- \openin 1 \jobname.#1s
- \ifeof 1
- % \enddoublecolumns gets confused if there is no text in the index,
- % and it loses the chapter title and the aux file entries for the
- % index. The easiest way to prevent this problem is to make sure
- % there is some text.
- (Index is nonexistent)
- \else
- %
- % If the index file exists but is empty, then \openin leaves \ifeof
- % false. We have to make TeX try to read something from the file, so
- % it can discover if there is anything in it.
- \read 1 to \temp
- \ifeof 1
- (Index is empty)
- \else
- \input \jobname.#1s
- \fi
- \fi
- \closein 1
- \enddoublecolumns
- \Etex
-}
-
-% These macros are used by the sorted index file itself.
-% Change them to control the appearance of the index.
-
-% Same as \bigskipamount except no shrink.
-% \balancecolumns gets confused if there is any shrink.
-\newskip\initialskipamount \initialskipamount 12pt plus4pt
-
-\def\initial #1{%
-{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
-\ifdim\lastskip<\initialskipamount
-\removelastskip \penalty-200 \vskip \initialskipamount\fi
-\line{\secbf#1\hfill}\kern 2pt\penalty10000}}
-
-% This typesets a paragraph consisting of #1, dot leaders, and then #2
-% flush to the right margin. It is used for index and table of contents
-% entries. The paragraph is indented by \leftskip.
-%
-\def\entry #1#2{\begingroup
- %
- % Start a new paragraph if necessary, so our assignments below can't
- % affect previous text.
- \par
- %
- % Do not fill out the last line with white space.
- \parfillskip = 0in
- %
- % No extra space above this paragraph.
- \parskip = 0in
- %
- % Do not prefer a separate line ending with a hyphen to fewer lines.
- \finalhyphendemerits = 0
- %
- % \hangindent is only relevant when the entry text and page number
- % don't both fit on one line. In that case, bob suggests starting the
- % dots pretty far over on the line. Unfortunately, a large
- % indentation looks wrong when the entry text itself is broken across
- % lines. So we use a small indentation and put up with long leaders.
- %
- % \hangafter is reset to 1 (which is the value we want) at the start
- % of each paragraph, so we need not do anything with that.
- \hangindent=2em
- %
- % When the entry text needs to be broken, just fill out the first line
- % with blank space.
- \rightskip = 0pt plus1fil
- %
- % Start a ``paragraph'' for the index entry so the line breaking
- % parameters we've set above will have an effect.
- \noindent
- %
- % Insert the text of the index entry. TeX will do line-breaking on it.
- #1%
- % The following is kluged to not output a line of dots in the index if
- % there are no page numbers. The next person who breaks this will be
- % cursed by a Unix daemon.
- \def\tempa{{\rm }}%
- \def\tempb{#2}%
- \edef\tempc{\tempa}%
- \edef\tempd{\tempb}%
- \ifx\tempc\tempd\ \else%
- %
- % If we must, put the page number on a line of its own, and fill out
- % this line with blank space. (The \hfil is overwhelmed with the
- % fill leaders glue in \indexdotfill if the page number does fit.)
- \hfil\penalty50
- \null\nobreak\indexdotfill % Have leaders before the page number.
- %
- % The `\ ' here is removed by the implicit \unskip that TeX does as
- % part of (the primitive) \par. Without it, a spurious underfull
- % \hbox ensues.
- \ #2% The page number ends the paragraph.
- \fi%
- \par
-\endgroup}
-
-% Like \dotfill except takes at least 1 em.
-\def\indexdotfill{\cleaders
- \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
-
-\def\primary #1{\line{#1\hfil}}
-
-\newskip\secondaryindent \secondaryindent=0.5cm
-
-\def\secondary #1#2{
-{\parfillskip=0in \parskip=0in
-\hangindent =1in \hangafter=1
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
-}}
-
-%% Define two-column mode, which is used in indexes.
-%% Adapted from the TeXbook, page 416.
-\catcode `\@=11
-
-\newbox\partialpage
-
-\newdimen\doublecolumnhsize
-
-\def\begindoublecolumns{\begingroup
- % Grab any single-column material above us.
- \output = {\global\setbox\partialpage
- =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
- \eject
- %
- % Now switch to the double-column output routine.
- \output={\doublecolumnout}%
- %
- % Change the page size parameters. We could do this once outside this
- % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
- % format, but then we repeat the same computation. Repeating a couple
- % of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it once.
- %
- % First we halve the line length, less a little for the gutter between
- % the columns. We compute the gutter based on the line length, so it
- % changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +- <
- % 1pt) as it did when we hard-coded it.
- %
- % We put the result in a separate register, \doublecolumhsize, so we
- % can restore it in \pagesofar, after \hsize itself has (potentially)
- % been clobbered.
- %
- \doublecolumnhsize = \hsize
- \advance\doublecolumnhsize by -.04154\hsize
- \divide\doublecolumnhsize by 2
- \hsize = \doublecolumnhsize
- %
- % Double the \vsize as well. (We don't need a separate register here,
- % since nobody clobbers \vsize.)
- \vsize = 2\vsize
- \doublecolumnpagegoal
-}
-
-\def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage}
-
-\def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth
- \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage
- \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1}
- \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3}
- \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi
- \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi
-}
-\def\doublecolumnpagegoal{%
- \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@
-}
-\def\pagesofar{\unvbox\partialpage %
- \hsize=\doublecolumnhsize % have to restore this since output routine
- \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
-\def\doublecolumnout{%
- \setbox5=\copy255
- {\vbadness=10000 \doublecolumnsplit}
- \ifvbox255
- \setbox0=\vtop to\dimen@{\unvbox0}
- \setbox2=\vtop to\dimen@{\unvbox2}
- \onepageout\pagesofar \unvbox255 \penalty\outputpenalty
- \else
- \setbox0=\vbox{\unvbox5}
- \ifvbox0
- \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
- \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth
- {\vbadness=10000
- \loop \global\setbox5=\copy0
- \setbox1=\vsplit5 to\dimen@
- \setbox3=\vsplit5 to\dimen@
- \ifvbox5 \global\advance\dimen@ by1pt \repeat
- \setbox0=\vbox to\dimen@{\unvbox1}
- \setbox2=\vbox to\dimen@{\unvbox3}
- \global\setbox\partialpage=\vbox{\pagesofar}
- \doublecolumnpagegoal
- }
- \fi
- \fi
-}
-
-\catcode `\@=\other
-\message{sectioning,}
-% Define chapters, sections, etc.
-
-\newcount \chapno
-\newcount \secno \secno=0
-\newcount \subsecno \subsecno=0
-\newcount \subsubsecno \subsubsecno=0
-
-% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount \appendixno \appendixno = `\@
-\def\appendixletter{\char\the\appendixno}
-
-\newwrite \contentsfile
-% This is called from \setfilename.
-\def\opencontents{\openout \contentsfile = \jobname.toc}
-
-% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it. @section does likewise
-
-\def\thischapter{} \def\thissection{}
-\def\seccheck#1{\if \pageno<0 %
-\errmessage{@#1 not allowed after generating table of contents}\fi
-%
-}
-
-\def\chapternofonts{%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\def\result{\realbackslash result}
-\def\equiv{\realbackslash equiv}
-\def\expansion{\realbackslash expansion}
-\def\print{\realbackslash print}
-\def\TeX{\realbackslash TeX}
-\def\dots{\realbackslash dots}
-\def\copyright{\realbackslash copyright}
-\def\tt{\realbackslash tt}
-\def\bf{\realbackslash bf }
-\def\w{\realbackslash w}
-\def\less{\realbackslash less}
-\def\gtr{\realbackslash gtr}
-\def\hat{\realbackslash hat}
-\def\char{\realbackslash char}
-\def\tclose##1{\realbackslash tclose {##1}}
-\def\code##1{\realbackslash code {##1}}
-\def\samp##1{\realbackslash samp {##1}}
-\def\r##1{\realbackslash r {##1}}
-\def\b##1{\realbackslash b {##1}}
-\def\key##1{\realbackslash key {##1}}
-\def\file##1{\realbackslash file {##1}}
-\def\kbd##1{\realbackslash kbd {##1}}
-% These are redefined because @smartitalic wouldn't work inside xdef.
-\def\i##1{\realbackslash i {##1}}
-\def\cite##1{\realbackslash cite {##1}}
-\def\var##1{\realbackslash var {##1}}
-\def\emph##1{\realbackslash emph {##1}}
-\def\dfn##1{\realbackslash dfn {##1}}
-}
-
-\newcount\absseclevel % used to calculate proper heading level
-\newcount\secbase\secbase=0 % @raise/lowersections modify this count
-
-% @raisesections: treat @section as chapter, @subsection as section, etc.
-\def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
-
-% @lowersections: treat @chapter as section, @section as subsection, etc.
-\def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
-
-% Choose a numbered-heading macro
-% #1 is heading level if unmodified by @raisesections or @lowersections
-% #2 is text for heading
-\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \chapterzzz{#2}
-\or
- \seczzz{#2}
-\or
- \numberedsubseczzz{#2}
-\or
- \numberedsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \chapterzzz{#2}
- \else
- \numberedsubsubseczzz{#2}
- \fi
-\fi
-}
-
-% like \numhead, but chooses appendix heading levels
-\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \appendixzzz{#2}
-\or
- \appendixsectionzzz{#2}
-\or
- \appendixsubseczzz{#2}
-\or
- \appendixsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \appendixzzz{#2}
- \else
- \appendixsubsubseczzz{#2}
- \fi
-\fi
-}
-
-% like \numhead, but chooses numberless heading levels
-\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \unnumberedzzz{#2}
-\or
- \unnumberedseczzz{#2}
-\or
- \unnumberedsubseczzz{#2}
-\or
- \unnumberedsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \unnumberedzzz{#2}
- \else
- \unnumberedsubsubseczzz{#2}
- \fi
-\fi
-}
-
-
-\def\thischaptername{No Chapter Title}
-\outer\def\chapter{\parsearg\chapteryyy}
-\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz #1{\seccheck{chapter}%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{Chapter \the\chapno}%
-\chapmacro {#1}{\the\chapno}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-% We don't substitute the actual chapter name into \thischapter
-% because we don't want its macros evaluated now.
-\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
-{\chapternofonts%
-\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
-}}
-
-\outer\def\appendix{\parsearg\appendixyyy}
-\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz #1{\seccheck{appendix}%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
-\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
-{\chapternofonts%
-\edef\temp{{\realbackslash chapentry
- {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\global\let\section = \appendixsec
-\global\let\subsection = \appendixsubsec
-\global\let\subsubsection = \appendixsubsubsec
-}}
-
-\outer\def\top{\parsearg\unnumberedyyy}
-\outer\def\unnumbered{\parsearg\unnumberedyyy}
-\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz #1{\seccheck{unnumbered}%
-\secno=0 \subsecno=0 \subsubsecno=0
-%
-% This used to be simply \message{#1}, but TeX fully expands the
-% argument to \message. Therefore, if #1 contained @-commands, TeX
-% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
-% expanded @cite (which turns out to cause errors because \cite is meant
-% to be executed, not expanded).
-%
-% Anyway, we don't want the fully-expanded definition of @cite to appear
-% as a result of the \message, we just want `@cite' itself. We use
-% \the<toks register> to achieve this: TeX expands \the<toks> only once,
-% simply yielding the contents of the <toks register>.
-\toks0 = {#1}\message{(\the\toks0)}%
-%
-\unnumbchapmacro {#1}%
-\gdef\thischapter{#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\global\let\section = \unnumberedsec
-\global\let\subsection = \unnumberedsubsec
-\global\let\subsubsection = \unnumberedsubsubsec
-}}
-
-\outer\def\numberedsec{\parsearg\secyyy}
-\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz #1{\seccheck{section}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash secentry %
-{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appenixsection{\parsearg\appendixsecyyy}
-\outer\def\appendixsec{\parsearg\appendixsecyyy}
-\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz #1{\seccheck{appendixsection}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash secentry %
-{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
-\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
-\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz #1{\seccheck{subsection}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsecentry %
-{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
-\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsecentry %
-{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
-\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
-\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsubsecentry %
- {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
- {\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
-\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\edef\temp{{\realbackslash subsubsecentry{#1}%
- {\appendixletter}
- {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
-\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-% These are variants which are not "outer", so they can appear in @ifinfo.
-% Actually, they should now be obsolete; ordinary section commands should work.
-\def\infotop{\parsearg\unnumberedzzz}
-\def\infounnumbered{\parsearg\unnumberedzzz}
-\def\infounnumberedsec{\parsearg\unnumberedseczzz}
-\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
-\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
-
-\def\infoappendix{\parsearg\appendixzzz}
-\def\infoappendixsec{\parsearg\appendixseczzz}
-\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
-\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
-
-\def\infochapter{\parsearg\chapterzzz}
-\def\infosection{\parsearg\sectionzzz}
-\def\infosubsection{\parsearg\subsectionzzz}
-\def\infosubsubsection{\parsearg\subsubsectionzzz}
-
-% These macros control what the section commands do, according
-% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
-% Define them by default for a numbered chapter.
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
-
-% Define @majorheading, @heading and @subheading
-
-% NOTE on use of \vbox for chapter headings, section headings, and
-% such:
-% 1) We use \vbox rather than the earlier \line to permit
-% overlong headings to fold.
-% 2) \hyphenpenalty is set to 10000 because hyphenation in a
-% heading is obnoxious; this forbids it.
-% 3) Likewise, headings look best if no \parindent is used, and
-% if justification is not attempted. Hence \raggedright.
-
-
-\def\majorheading{\parsearg\majorheadingzzz}
-\def\majorheadingzzz #1{%
-{\advance\chapheadingskip by 10pt \chapbreak }%
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
-
-\def\chapheading{\parsearg\chapheadingzzz}
-\def\chapheadingzzz #1{\chapbreak %
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
-
-\def\heading{\parsearg\secheadingi}
-
-\def\subheading{\parsearg\subsecheadingi}
-
-\def\subsubheading{\parsearg\subsubsecheadingi}
-
-% These macros generate a chapter, section, etc. heading only
-% (including whitespace, linebreaking, etc. around it),
-% given all the information in convenient, parsed form.
-
-%%% Args are the skip and penalty (usually negative)
-\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
-
-%%% Define plain chapter starts, and page on/off switching for it
-% Parameter controlling skip before chapter headings (if needed)
-
-\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
-
-\def\chapbreak{\dobreak \chapheadingskip {-4000}}
-\def\chappager{\par\vfill\supereject}
-\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
-
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-
-\def\CHAPPAGoff{
-\global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
-
-\def\CHAPPAGon{
-\global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager
-\global\def\HEADINGSon{\HEADINGSsingle}}
-
-\def\CHAPPAGodd{
-\global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage
-\global\def\HEADINGSon{\HEADINGSdouble}}
-
-\CHAPPAGon
-
-\def\CHAPFplain{
-\global\let\chapmacro=\chfplain
-\global\let\unnumbchapmacro=\unnchfplain}
-
-\def\chfplain #1#2{%
- \pchapsepmacro
- {%
- \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #2\enspace #1}%
- }%
- \bigskip
- \penalty5000
-}
-
-\def\unnchfplain #1{%
-\pchapsepmacro %
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 10000 %
-}
-\CHAPFplain % The default
-
-\def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 10000 %
-}
-
-\def\chfopen #1#2{\chapoddpage {\chapfonts
-\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
-\par\penalty 5000 %
-}
-
-\def\CHAPFopen{
-\global\let\chapmacro=\chfopen
-\global\let\unnumbchapmacro=\unnchfopen}
-
-% Parameter controlling skip before section headings.
-
-\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
-\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
-
-\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt
-\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
-
-% @paragraphindent is defined for the Info formatting commands only.
-\let\paragraphindent=\comment
-
-% Section fonts are the base font at magstep2, which produces
-% a size a bit more than 14 points in the default situation.
-
-\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
-\def\plainsecheading #1{\secheadingi {#1}}
-\def\secheadingi #1{{\advance \secheadingskip by \parskip %
-\secheadingbreak}%
-{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}%
-\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
-
-
-% Subsection fonts are the base font at magstep1,
-% which produces a size of 12 points.
-
-\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
-\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
-\subsecheadingbreak}%
-{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}%
-\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
-
-\def\subsubsecfonts{\subsecfonts} % Maybe this should change:
- % Perhaps make sssec fonts scaled
- % magstep half
-\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
-\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
-\subsecheadingbreak}%
-{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}%
-\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
-
-
-\message{toc printing,}
-
-% Finish up the main text and prepare to read what we've written
-% to \contentsfile.
-
-\newskip\contentsrightmargin \contentsrightmargin=1in
-\def\startcontents#1{%
- \pagealignmacro
- \immediate\closeout \contentsfile
- \ifnum \pageno>0
- \pageno = -1 % Request roman numbered pages.
- \fi
- % Don't need to put `Contents' or `Short Contents' in the headline.
- % It is abundantly clear what they are.
- \unnumbchapmacro{#1}\def\thischapter{}%
- \begingroup % Set up to handle contents files properly.
- \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
- \raggedbottom % Worry more about breakpoints than the bottom.
- \advance\hsize by -\contentsrightmargin % Don't use the full line length.
-}
-
-
-% Normal (long) toc.
-\outer\def\contents{%
- \startcontents{\putwordTableofContents}%
- \input \jobname.toc
- \endgroup
- \vfill \eject
-}
-
-% And just the chapters.
-\outer\def\summarycontents{%
- \startcontents{\putwordShortContents}%
- %
- \let\chapentry = \shortchapentry
- \let\unnumbchapentry = \shortunnumberedentry
- % We want a true roman here for the page numbers.
- \secfonts
- \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
- \rm
- \advance\baselineskip by 1pt % Open it up a little.
- \def\secentry ##1##2##3##4{}
- \def\unnumbsecentry ##1##2{}
- \def\subsecentry ##1##2##3##4##5{}
- \def\unnumbsubsecentry ##1##2{}
- \def\subsubsecentry ##1##2##3##4##5##6{}
- \def\unnumbsubsubsecentry ##1##2{}
- \input \jobname.toc
- \endgroup
- \vfill \eject
-}
-\let\shortcontents = \summarycontents
-
-% These macros generate individual entries in the table of contents.
-% The first argument is the chapter or section name.
-% The last argument is the page number.
-% The arguments in between are the chapter number, section number, ...
-
-% Chapter-level things, for both the long and short contents.
-\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
-
-% See comments in \dochapentry re vbox and related settings
-\def\shortchapentry#1#2#3{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
-}
-
-% Typeset the label for a chapter or appendix for the short contents.
-% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
-% We could simplify the code here by writing out an \appendixentry
-% command in the toc file for appendices, instead of using \chapentry
-% for both, but it doesn't seem worth it.
-\setbox0 = \hbox{\shortcontrm \putwordAppendix }
-\newdimen\shortappendixwidth \shortappendixwidth = \wd0
-
-\def\shortchaplabel#1{%
- % We typeset #1 in a box of constant width, regardless of the text of
- % #1, so the chapter titles will come out aligned.
- \setbox0 = \hbox{#1}%
- \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
- %
- % This space should be plenty, since a single number is .5em, and the
- % widest letter (M) is 1em, at least in the Computer Modern fonts.
- % (This space doesn't include the extra space that gets added after
- % the label; that gets put in in \shortchapentry above.)
- \advance\dimen0 by 1.1em
- \hbox to \dimen0{#1\hfil}%
-}
-
-\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
-\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
-
-% Sections.
-\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
-\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
-
-% Subsections.
-\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
-\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
-
-% And subsubsections.
-\def\subsubsecentry#1#2#3#4#5#6{%
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
-\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
-
-
-% This parameter controls the indentation of the various levels.
-\newdimen\tocindent \tocindent = 3pc
-
-% Now for the actual typesetting. In all these, #1 is the text and #2 is the
-% page number.
-%
-% If the toc has to be broken over pages, we would want to be at chapters
-% if at all possible; hence the \penalty.
-\def\dochapentry#1#2{%
- \penalty-300 \vskip\baselineskip
- \begingroup
- \chapentryfonts
- \tocentry{#1}{\dopageno{#2}}%
- \endgroup
- \nobreak\vskip .25\baselineskip
-}
-
-\def\dosecentry#1#2{\begingroup
- \secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-\def\dosubsecentry#1#2{\begingroup
- \subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-\def\dosubsubsecentry#1#2{\begingroup
- \subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-% Final typesetting of a toc entry; we use the same \entry macro as for
-% the index entries, but we want to suppress hyphenation here. (We
-% can't do that in the \entry macro, since index entries might consist
-% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
-%
-\def\tocentry#1#2{\begingroup
- \hyphenpenalty = 10000
- \entry{#1}{#2}%
-\endgroup}
-
-% Space between chapter (or whatever) number and the title.
-\def\labelspace{\hskip1em \relax}
-
-\def\dopageno#1{{\rm #1}}
-\def\doshortpageno#1{{\rm #1}}
-
-\def\chapentryfonts{\secfonts \rm}
-\def\secentryfonts{\textfonts}
-\let\subsecentryfonts = \textfonts
-\let\subsubsecentryfonts = \textfonts
-
-
-\message{environments,}
-
-% Since these characters are used in examples, it should be an even number of
-% \tt widths. Each \tt character is 1en, so two makes it 1em.
-% Furthermore, these definitions must come after we define our fonts.
-\newbox\dblarrowbox \newbox\longdblarrowbox
-\newbox\pushcharbox \newbox\bullbox
-\newbox\equivbox \newbox\errorbox
-
-\let\ptexequiv = \equiv
-
-%{\tentt
-%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
-%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
-%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
-%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
-% Adapted from the manmac format (p.420 of TeXbook)
-%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
-% depth .1ex\hfil}
-%}
-
-\def\point{$\star$}
-
-\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
-\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
-\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
-
-\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
-
-% Adapted from the TeXbook's \boxit.
-{\tentt \global\dimen0 = 3em}% Width of the box.
-\dimen2 = .55pt % Thickness of rules
-% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
-
-\global\setbox\errorbox=\hbox to \dimen0{\hfil
- \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
- \advance\hsize by -2\dimen2 % Rules.
- \vbox{
- \hrule height\dimen2
- \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
- \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
- \kern3pt\vrule width\dimen2}% Space to right.
- \hrule height\dimen2}
- \hfil}
-
-% The @error{} command.
-\def\error{\leavevmode\lower.7ex\copy\errorbox}
-
-% @tex ... @end tex escapes into raw Tex temporarily.
-% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain tex @ character.
-
-\def\tex{\begingroup
-\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
-\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
-\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
-\catcode `\%=14
-\catcode 43=12
-\catcode`\"=12
-\catcode`\==12
-\catcode`\|=12
-\catcode`\<=12
-\catcode`\>=12
-\escapechar=`\\
-%
-\let\~=\ptextilde
-\let\{=\ptexlbrace
-\let\}=\ptexrbrace
-\let\.=\ptexdot
-\let\*=\ptexstar
-\let\dots=\ptexdots
-\def\@{@}%
-\let\bullet=\ptexbullet
-\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
-\let\L=\ptexL
-%
-\let\Etex=\endgroup}
-
-% Define @lisp ... @endlisp.
-% @lisp does a \begingroup so it can rebind things,
-% including the definition of @endlisp (which normally is erroneous).
-
-% Amount to narrow the margins by for @lisp.
-\newskip\lispnarrowing \lispnarrowing=0.4in
-
-% This is the definition that ^^M gets inside @lisp, @example, and other
-% such environments. \null is better than a space, since it doesn't
-% have any width.
-\def\lisppar{\null\endgraf}
-
-% Make each space character in the input produce a normal interword
-% space in the output. Don't allow a line break at this space, as this
-% is used only in environments like @example, where each line of input
-% should produce a line of output anyway.
-%
-{\obeyspaces %
-\gdef\sepspaces{\obeyspaces\let =\tie}}
-
-% Define \obeyedspace to be our active space, whatever it is. This is
-% for use in \parsearg.
-{\sepspaces%
-\global\let\obeyedspace= }
-
-% This space is always present above and below environments.
-\newskip\envskipamount \envskipamount = 0pt
-
-% Make spacing and below environment symmetrical. We use \parskip here
-% to help in doing that, since in @example-like environments \parskip
-% is reset to zero; thus the \afterenvbreak inserts no space -- but the
-% start of the next paragraph will insert \parskip
-%
-\def\aboveenvbreak{{\advance\envskipamount by \parskip
-\endgraf \ifdim\lastskip<\envskipamount
-\removelastskip \penalty-50 \vskip\envskipamount \fi}}
-
-\let\afterenvbreak = \aboveenvbreak
-
-% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
-\let\nonarrowing=\relax
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \cartouche: draw rectangle w/rounded corners around argument
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
-%
-\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
-\def\ctr{{\hskip 6pt\circle\char'010}}
-\def\cbl{{\circle\char'012\hskip -6pt}}
-\def\cbr{{\hskip 6pt\circle\char'011}}
-\def\carttop{\hbox to \cartouter{\hskip\lskip
- \ctl\leaders\hrule height\circthick\hfil\ctr
- \hskip\rskip}}
-\def\cartbot{\hbox to \cartouter{\hskip\lskip
- \cbl\leaders\hrule height\circthick\hfil\cbr
- \hskip\rskip}}
-%
-\newskip\lskip\newskip\rskip
-
-\long\def\cartouche{%
-\begingroup
- \lskip=\leftskip \rskip=\rightskip
- \leftskip=0pt\rightskip=0pt %we want these *outside*.
- \cartinner=\hsize \advance\cartinner by-\lskip
- \advance\cartinner by-\rskip
- \cartouter=\hsize
- \advance\cartouter by 18pt % allow for 3pt kerns on either
-% side, and for 6pt waste from
-% each corner char
- \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
- % Flag to tell @lisp, etc., not to narrow margin.
- \let\nonarrowing=\comment
- \vbox\bgroup
- \baselineskip=0pt\parskip=0pt\lineskip=0pt
- \carttop
- \hbox\bgroup
- \hskip\lskip
- \vrule\kern3pt
- \vbox\bgroup
- \hsize=\cartinner
- \kern3pt
- \begingroup
- \baselineskip=\normbskip
- \lineskip=\normlskip
- \parskip=\normpskip
- \vskip -\parskip
-\def\Ecartouche{%
- \endgroup
- \kern3pt
- \egroup
- \kern3pt\vrule
- \hskip\rskip
- \egroup
- \cartbot
- \egroup
-\endgroup
-}}
-
-
-% This macro is called at the beginning of all the @example variants,
-% inside a group.
-\def\nonfillstart{%
- \aboveenvbreak
- \inENV % This group ends at the end of the body
- \hfuzz = 12pt % Don't be fussy
- \sepspaces % Make spaces be word-separators rather than space tokens.
- \singlespace
- \let\par = \lisppar % don't ignore blank lines
- \obeylines % each line of input is a line of output
- \parskip = 0pt
- \parindent = 0pt
- \emergencystretch = 0pt % don't try to avoid overfull boxes
- % @cartouche defines \nonarrowing to inhibit narrowing
- % at next level down.
- \ifx\nonarrowing\relax
- \advance \leftskip by \lispnarrowing
- \exdentamount=\lispnarrowing
- \let\exdent=\nofillexdent
- \let\nonarrowing=\relax
- \fi
-}
-
-% To ending an @example-like environment, we first end the paragraph
-% (via \afterenvbreak's vertical glue), and then the group. That way we
-% keep the zero \parskip that the environments set -- \parskip glue
-% will be inserted at the beginning of the next paragraph in the
-% document, after the environment.
-%
-\def\nonfillfinish{\afterenvbreak\endgroup}%
-
-% This macro is
-\def\lisp{\begingroup
- \nonfillstart
- \let\Elisp = \nonfillfinish
- \tt
- \rawbackslash % have \ input char produce \ char from current font
- \gobble
-}
-
-% Define the \E... control sequence only if we are inside the
-% environment, so the error checking in \end will work.
-%
-% We must call \lisp last in the definition, since it reads the
-% return following the @example (or whatever) command.
-%
-\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-
-% @smallexample and @smalllisp. This is not used unless the @smallbook
-% command is given. Originally contributed by Pavel@xerox.
-%
-\def\smalllispx{\begingroup
- \nonfillstart
- \let\Esmalllisp = \nonfillfinish
- \let\Esmallexample = \nonfillfinish
- %
- % Smaller interline space and fonts for small examples.
- \setleading{10pt}%
- \indexfonts \tt
- \rawbackslash % make \ output the \ character from the current font (tt)
- \gobble
-}
-
-% This is @display; same as @lisp except use roman font.
-%
-\def\display{\begingroup
- \nonfillstart
- \let\Edisplay = \nonfillfinish
- \gobble
-}
-
-% This is @format; same as @display except don't narrow margins.
-%
-\def\format{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eformat = \nonfillfinish
- \gobble
-}
-
-% @flushleft (same as @format) and @flushright.
-%
-\def\flushleft{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushleft = \nonfillfinish
- \gobble
-}
-\def\flushright{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushright = \nonfillfinish
- \advance\leftskip by 0pt plus 1fill
- \gobble}
-
-% @quotation does normal linebreaking (hence we can't use \nonfillstart)
-% and narrows the margins.
-%
-\def\quotation{%
- \begingroup\inENV %This group ends at the end of the @quotation body
- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \singlespace
- \parindent=0pt
- % We have retained a nonzero parskip for the environment, since we're
- % doing normal filling. So to avoid extra space below the environment...
- \def\Equotation{\parskip = 0pt \nonfillfinish}%
- %
- % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
- \ifx\nonarrowing\relax
- \advance\leftskip by \lispnarrowing
- \advance\rightskip by \lispnarrowing
- \exdentamount = \lispnarrowing
- \let\nonarrowing = \relax
- \fi
-}
-
-\message{defuns,}
-% Define formatter for defuns
-% First, allow user to change definition object font (\df) internally
-\def\setdeffont #1 {\csname DEF#1\endcsname}
-
-\newskip\defbodyindent \defbodyindent=.4in
-\newskip\defargsindent \defargsindent=50pt
-\newskip\deftypemargin \deftypemargin=12pt
-\newskip\deflastargmargin \deflastargmargin=18pt
-
-\newcount\parencount
-% define \functionparens, which makes ( and ) and & do special things.
-% \functionparens affects the group it is contained in.
-\def\activeparens{%
-\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
-\catcode`\[=\active \catcode`\]=\active}
-
-% Make control sequences which act like normal parenthesis chars.
-\let\lparen = ( \let\rparen = )
-
-{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
-
-% Be sure that we always have a definition for `(', etc. For example,
-% if the fn name has parens in it, \boldbrax will not be in effect yet,
-% so TeX would otherwise complain about undefined control sequence.
-\global\let(=\lparen \global\let)=\rparen
-\global\let[=\lbrack \global\let]=\rbrack
-
-\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
-\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
-
-% Definitions of (, ) and & used in args for functions.
-% This is the definition of ( outside of all parentheses.
-\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
-\global\advance\parencount by 1 }
-%
-% This is the definition of ( when already inside a level of parens.
-\gdef\opnested{\char`\(\global\advance\parencount by 1 }
-%
-\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
-% also in that case restore the outer-level definition of (.
-\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
-\global\advance \parencount by -1 }
-% If we encounter &foo, then turn on ()-hacking afterwards
-\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
-%
-\gdef\normalparens{\boldbrax\let&=\ampnr}
-} % End of definition inside \activeparens
-%% These parens (in \boldbrax) actually are a little bolder than the
-%% contained text. This is especially needed for [ and ]
-\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
-\def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
-
-% First, defname, which formats the header line itself.
-% #1 should be the function name.
-% #2 should be the type of definition, such as "Function".
-
-\def\defname #1#2{%
-% Get the values of \leftskip and \rightskip as they were
-% outside the @def...
-\dimen2=\leftskip
-\advance\dimen2 by -\defbodyindent
-\dimen3=\rightskip
-\advance\dimen3 by -\defbodyindent
-\noindent %
-\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
-\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %
-% Now output arg 2 ("Function" or some such)
-% ending at \deftypemargin from the right margin,
-% but stuck inside a box of width 0 so it does not interfere with linebreaking
-{% Adjust \hsize to exclude the ambient margins,
-% so that \rightline will obey them.
-\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
-% Make all lines underfull and no complaints:
-\tolerance=10000 \hbadness=10000
-\advance\leftskip by -\defbodyindent
-\exdentamount=\defbodyindent
-{\df #1}\enskip % Generate function name
-}
-
-% Actually process the body of a definition
-% #1 should be the terminating control sequence, such as \Edefun.
-% #2 should be the "another name" control sequence, such as \defunx.
-% #3 should be the control sequence that actually processes the header,
-% such as \defunheader.
-
-\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active % 61 is `='
-\obeylines\activeparens\spacesplit#3}
-
-\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
-
-\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
-
-% These parsing functions are similar to the preceding ones
-% except that they do not make parens into active characters.
-% These are used for "variables" since they have no arguments.
-
-\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active %
-\obeylines\spacesplit#3}
-
-% This is used for \def{tp,vr}parsebody. It could probably be used for
-% some of the others, too, with some judicious conditionals.
-%
-\def\parsebodycommon#1#2#3{%
- \begingroup\inENV %
- \medbreak %
- % Define the end token that this defining construct specifies
- % so that it will exit this group.
- \def#1{\endgraf\endgroup\medbreak}%
- \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
- \parindent=0in
- \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
- \exdentamount=\defbodyindent
- \begingroup\obeylines
-}
-
-\def\defvrparsebody#1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \spacesplit{#3{#4}}%
-}
-
-% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
-% type is just `struct', because we lose the braces in `{struct
-% termios}' when \spacesplit reads its undelimited argument. Sigh.
-% \let\deftpparsebody=\defvrparsebody
-%
-% So, to get around this, we put \empty in with the type name. That
-% way, TeX won't find exactly `{...}' as an undelimited argument, and
-% won't strip off the braces.
-%
-\def\deftpparsebody #1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \spacesplit{\parsetpheaderline{#3{#4}}}\empty
-}
-
-% Fine, but then we have to eventually remove the \empty *and* the
-% braces (if any). That's what this does, putting the result in \tptemp.
-%
-\def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}%
-
-% After \spacesplit has done its work, this is called -- #1 is the final
-% thing to call, #2 the type name (which starts with \empty), and #3
-% (which might be empty) the arguments.
-%
-\def\parsetpheaderline#1#2#3{%
- \removeemptybraces#2\relax
- #1{\tptemp}{#3}%
-}%
-
-\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\spacesplit{#3{#5}}}
-
-% Split up #2 at the first space token.
-% call #1 with two arguments:
-% the first is all of #2 before the space token,
-% the second is all of #2 after that space token.
-% If #2 contains no space token, all of it is passed as the first arg
-% and the second is passed as empty.
-
-{\obeylines
-\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
-\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
-\ifx\relax #3%
-#1{#2}{}\else #1{#2}{#3#4}\fi}}
-
-% So much for the things common to all kinds of definitions.
-
-% Define @defun.
-
-% First, define the processing that is wanted for arguments of \defun
-% Use this to expand the args and terminate the paragraph they make up
-
-\def\defunargs #1{\functionparens \sl
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-\hyphenchar\tensl=0
-#1%
-\hyphenchar\tensl=45
-\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
-}
-
-\def\deftypefunargs #1{%
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-\functionparens
-\tclose{#1}% avoid \code because of side effects on active chars
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
-}
-
-% Do complete processing of one @defun or @defunx line already parsed.
-
-% @deffn Command forward-char nchars
-
-\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
-
-\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defun == @deffn Function
-
-\def\defun{\defparsebody\Edefun\defunx\defunheader}
-
-\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Function}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefun int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
-
-% #1 is the data type. #2 is the name and args.
-\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
-% #1 is the data type, #2 the name, #3 the args.
-\def\deftypefunheaderx #1#2 #3\relax{%
-\doind {fn}{\code{#2}}% Make entry in function index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
-\deftypefunargs {#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
-
-% \defheaderxcond#1\relax$$$
-% puts #1 in @code, followed by a space, but does nothing if #1 is null.
-\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
-
-% #1 is the classification. #2 is the data type. #3 is the name and args.
-\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
-% #1 is the classification, #2 the data type, #3 the name, #4 the args.
-\def\deftypefnheaderx #1#2#3 #4\relax{%
-\doind {fn}{\code{#3}}% Make entry in function index
-\begingroup
-\normalparens % notably, turn off `&' magic, which prevents
-% at least some C++ text from working
-\defname {\defheaderxcond#2\relax$$$#3}{#1}%
-\deftypefunargs {#4}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defmac == @deffn Macro
-
-\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
-
-\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Macro}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defspec == @deffn Special Form
-
-\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
-
-\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Special Form}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% This definition is run if you use @defunx
-% anywhere other than immediately after a @defun or @defunx.
-
-\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
-\def\defunx #1 {\errmessage{@defunx in invalid context}}
-\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
-\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
-\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
-\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
-
-% @defmethod, and so on
-
-% @defop {Funny Method} foo-class frobnicate argument
-
-\def\defop #1 {\def\defoptype{#1}%
-\defopparsebody\Edefop\defopx\defopheader\defoptype}
-
-\def\defopheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype{} on #1}%
-\defunargs {#3}\endgroup %
-}
-
-% @defmethod == @defop Method
-
-\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
-
-\def\defmethodheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% entry in function index
-\begingroup\defname {#2}{Method on #1}%
-\defunargs {#3}\endgroup %
-}
-
-% @defcv {Class Option} foo-class foo-flag
-
-\def\defcv #1 {\def\defcvtype{#1}%
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
-
-\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype{} of #1}%
-\defvarargs {#3}\endgroup %
-}
-
-% @defivar == @defcv {Instance Variable}
-
-\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
-
-\def\defivarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{Instance Variable of #1}%
-\defvarargs {#3}\endgroup %
-}
-
-% These definitions are run if you use @defmethodx, etc.,
-% anywhere other than immediately after a @defmethod, etc.
-
-\def\defopx #1 {\errmessage{@defopx in invalid context}}
-\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
-\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
-\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
-
-% Now @defvar
-
-% First, define the processing that is wanted for arguments of @defvar.
-% This is actually simple: just print them in roman.
-% This must expand the args and terminate the paragraph they make up
-\def\defvarargs #1{\normalparens #1%
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000}
-
-% @defvr Counter foo-count
-
-\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
-
-\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
-
-% @defvar == @defvr Variable
-
-\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
-
-\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{Variable}%
-\defvarargs {#2}\endgroup %
-}
-
-% @defopt == @defvr {User Option}
-
-\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
-
-\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{User Option}%
-\defvarargs {#2}\endgroup %
-}
-
-% @deftypevar int foobar
-
-\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
-
-% #1 is the data type. #2 is the name.
-\def\deftypevarheader #1#2{%
-\doind {vr}{\code{#2}}% Make entry in variables index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
-\endgroup}
-
-% @deftypevr {Global Flag} int enable
-
-\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
-
-\def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
-\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
-\endgroup}
-
-% This definition is run if you use @defvarx
-% anywhere other than immediately after a @defvar or @defvarx.
-
-\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
-\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
-\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
-
-% Now define @deftp
-% Args are printed in bold, a slight difference from @defvar.
-
-\def\deftpargs #1{\bf \defvarargs{#1}}
-
-% @deftp Class window height width ...
-
-\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
-
-\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
-\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-
-% This definition is run if you use @deftpx, etc
-% anywhere other than immediately after a @deftp, etc.
-
-\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
-
-\message{cross reference,}
-% Define cross-reference macros
-\newwrite \auxfile
-
-\newif\ifhavexrefs % True if xref values are known.
-\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-
-% \setref{foo} defines a cross-reference point named foo.
-
-\def\setref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ysectionnumberandtype}}
-
-\def\unnumbsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ynothing}}
-
-\def\appendixsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Yappendixletterandtype}}
-
-% \xref, \pxref, and \ref generate cross-references to specified points.
-% For \xrefX, #1 is the node name, #2 the name of the Info
-% cross-reference, #3 the printed node name, #4 the name of the Info
-% file, #5 the name of the printed manual. All but the node name can be
-% omitted.
-%
-\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
-\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
-\def\ref#1{\xrefX[#1,,,,,,,]}
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
- \def\printedmanual{\ignorespaces #5}%
- \def\printednodename{\ignorespaces #3}%
- \setbox1=\hbox{\printedmanual}%
- \setbox0=\hbox{\printednodename}%
- \ifdim \wd0 = 0pt
- % No printed node name was explicitly given.
- \ifx\SETxref-automatic-section-title\relax %
- % Use the actual chapter/section title appear inside
- % the square brackets. Use the real section title if we have it.
- \ifdim \wd1>0pt%
- % It is in another manual, so we don't have it.
- \def\printednodename{\ignorespaces #1}%
- \else
- \ifhavexrefs
- % We know the real title if we have the xref values.
- \def\printednodename{\refx{#1-title}}%
- \else
- % Otherwise just copy the Info node name.
- \def\printednodename{\ignorespaces #1}%
- \fi%
- \fi
- \def\printednodename{#1-title}%
- \else
- % Use the node name inside the square brackets.
- \def\printednodename{\ignorespaces #1}%
- \fi
- \fi
- %
- % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
- % insert empty discretionaries after hyphens, which means that it will
- % not find a line break at a hyphen in a node names. Since some manuals
- % are best written with fairly long node names, containing hyphens, this
- % is a loss. Therefore, we give the text of the node name again, so it
- % is as if TeX is seeing it for the first time.
- \ifdim \wd1 > 0pt
- \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
- \else
- % _ (for example) has to be the character _ for the purposes of the
- % control sequence corresponding to the node, but it has to expand
- % into the usual \leavevmode...\vrule stuff for purposes of
- % printing. So we \turnoffactive for the \refx-snt, back on for the
- % printing, back off for the \refx-pg.
- {\turnoffactive \refx{#1-snt}{}}%
- \space [\printednodename],\space
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
- \fi
-\endgroup}
-
-% \dosetq is the interface for calls from other macros
-
-% Use \turnoffactive so that punctuation chars such as underscore
-% work in node names.
-\def\dosetq #1#2{{\let\folio=0 \turnoffactive%
-\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
-\next}}
-
-% \internalsetq {foo}{page} expands into
-% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
-% When the aux file is read, ' is the escape character
-
-\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
-
-% Things to be expanded by \internalsetq
-
-\def\Ypagenumber{\folio}
-
-\def\Ytitle{\thissection}
-
-\def\Ynothing{}
-
-\def\Ysectionnumberandtype{%
-\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
-\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\def\Yappendixletterandtype{%
-\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
-\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\gdef\xreftie{'tie}
-
-% Use TeX 3.0's \inputlineno to get the line number, for better error
-% messages, but if we're using an old version of TeX, don't do anything.
-%
-\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Non-3.0.
-\else
- \def\linenumber{\the\inputlineno:\space}
-\fi
-
-% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
-% If its value is nonempty, SUFFIX is output afterward.
-
-\def\refx#1#2{%
- \expandafter\ifx\csname X#1\endcsname\relax
- % If not defined, say something at least.
- $\langle$un\-de\-fined$\rangle$%
- \ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
- \fi
- \fi
- \else
- % It's defined, so just use it.
- \csname X#1\endcsname
- \fi
- #2% Output the suffix in any case.
-}
-
-% Read the last existing aux file, if any. No error if none exists.
-
-% This is the macro invoked by entries in the aux file.
-\def\xrdef #1#2{
-{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
-
-\def\readauxfile{%
-\begingroup
-\catcode `\^^@=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\^^C=\other
-\catcode `\^^D=\other
-\catcode `\^^E=\other
-\catcode `\^^F=\other
-\catcode `\^^G=\other
-\catcode `\^^H=\other
-\catcode `\ =\other
-\catcode `\^^L=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode 26=\other
-\catcode `\^^[=\other
-\catcode `\^^\=\other
-\catcode `\^^]=\other
-\catcode `\^^^=\other
-\catcode `\^^_=\other
-\catcode `\@=\other
-\catcode `\^=\other
-\catcode `\~=\other
-\catcode `\[=\other
-\catcode `\]=\other
-\catcode`\"=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode `\$=\other
-\catcode `\#=\other
-\catcode `\&=\other
-% `\+ does not work, so use 43.
-\catcode 43=\other
-% Make the characters 128-255 be printing characters
-{%
- \count 1=128
- \def\loop{%
- \catcode\count 1=\other
- \advance\count 1 by 1
- \ifnum \count 1<256 \loop \fi
- }%
-}%
-% the aux file uses ' as the escape.
-% Turn off \ as an escape so we do not lose on
-% entries which were dumped with control sequences in their names.
-% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
-% Reference to such entries still does not work the way one would wish,
-% but at least they do not bomb out when the aux file is read in.
-\catcode `\{=1 \catcode `\}=2
-\catcode `\%=\other
-\catcode `\'=0
-\catcode `\\=\other
-\openin 1 \jobname.aux
-\ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
-\global\warnedobstrue
-\fi
-% Open the new aux file. Tex will close it automatically at exit.
-\openout \auxfile=\jobname.aux
-\endgroup}
-
-
-% Footnotes.
-
-\newcount \footnoteno
-
-% The trailing space in the following definition for supereject is
-% vital for proper filling; pages come out unaligned when you do a
-% pagealignmacro call if that space before the closing brace is
-% removed.
-\def\supereject{\par\penalty -20000\footnoteno =0 }
-
-% @footnotestyle is meaningful for info output only..
-\let\footnotestyle=\comment
-
-\let\ptexfootnote=\footnote
-
-{\catcode `\@=11
-%
-% Auto-number footnotes. Otherwise like plain.
-\gdef\footnote{%
- \global\advance\footnoteno by \@ne
- \edef\thisfootno{$^{\the\footnoteno}$}%
- %
- % In case the footnote comes at the end of a sentence, preserve the
- % extra spacing after we do the footnote number.
- \let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
- %
- % Remove inadvertent blank space before typesetting the footnote number.
- \unskip
- \thisfootno\@sf
- \footnotezzz
-}%
-
-% Don't bother with the trickery in plain.tex to not require the
-% footnote text as a parameter. Our footnotes don't need to be so general.
-%
-\long\gdef\footnotezzz#1{\insert\footins{%
- % We want to typeset this text as a normal paragraph, even if the
- % footnote reference occurs in (for example) a display environment.
- % So reset some parameters.
- \interlinepenalty\interfootnotelinepenalty
- \splittopskip\ht\strutbox % top baseline for broken footnotes
- \splitmaxdepth\dp\strutbox
- \floatingpenalty\@MM
- \leftskip\z@skip
- \rightskip\z@skip
- \spaceskip\z@skip
- \xspaceskip\z@skip
- \parindent\defaultparindent
- %
- % Hang the footnote text off the number.
- \hang
- \textindent{\thisfootno}%
- %
- % Don't crash into the line above the footnote text. Since this
- % expands into a box, it must come within the paragraph, lest it
- % provide a place where TeX can split the footnote.
- \footstrut
- #1\strut}%
-}
-
-}%end \catcode `\@=11
-
-% Set the baselineskip to #1, and the lineskip and strut size
-% correspondingly. There is no deep meaning behind these magic numbers
-% used as factors; they just match (closely enough) what Knuth defined.
-%
-\def\lineskipfactor{.08333}
-\def\strutheightpercent{.70833}
-\def\strutdepthpercent {.29167}
-%
-\def\setleading#1{%
- \normalbaselineskip = #1\relax
- \normallineskip = \lineskipfactor\normalbaselineskip
- \normalbaselines
- \setbox\strutbox =\hbox{%
- \vrule width0pt height\strutheightpercent\baselineskip
- depth \strutdepthpercent \baselineskip
- }%
-}
-
-% @| inserts a changebar to the left of the current line. It should
-% surround any changed text. This approach does *not* work if the
-% change spans more than two lines of output. To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change).
-%
-\def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
-}
-
-% For a final copy, take out the rectangles
-% that mark overfull boxes (in case you have decided
-% that the text looks ok even though it passes the margin).
-%
-\def\finalout{\overfullrule=0pt}
-
-
-% End of control word definitions.
-
-\message{and turning on texinfo input format.}
-
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
-}
-
-% Set some numeric style parameters, for 8.5 x 11 format.
-
-%\hsize = 6.5in
-\newdimen\defaultparindent \defaultparindent = 15pt
-\parindent = \defaultparindent
-\parskip 18pt plus 1pt
-\setleading{15pt}
-\advance\topskip by 1.2cm
-
-% Prevent underfull vbox error messages.
-\vbadness=10000
-
-% Following George Bush, just get rid of widows and orphans.
-\widowpenalty=10000
-\clubpenalty=10000
-
-% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
-% using an old version of TeX, don't do anything. We want the amount of
-% stretch added to depend on the line length, hence the dependence on
-% \hsize. This makes it come to about 9pt for the 8.5x11 format.
-%
-\ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
-\else
- \emergencystretch = \hsize
- \divide\emergencystretch by 45
-\fi
-
-% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
-\def\smallbook{
-
-% These values for secheadingskip and subsecheadingskip are
-% experiments. RJC 7 Aug 1992
-\global\secheadingskip = 17pt plus 6pt minus 3pt
-\global\subsecheadingskip = 14pt plus 6pt minus 3pt
-
-\global\lispnarrowing = 0.3in
-\setleading{12pt}
-\advance\topskip by -1cm
-\global\parskip 3pt plus 1pt
-\global\hsize = 5in
-\global\vsize=7.5in
-\global\tolerance=700
-\global\hfuzz=1pt
-\global\contentsrightmargin=0pt
-\global\deftypemargin=0pt
-\global\defbodyindent=.5cm
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-
-\global\let\smalllisp=\smalllispx
-\global\let\smallexample=\smalllispx
-\global\def\Esmallexample{\Esmalllisp}
-}
-
-% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{
-\global\tolerance=700
-\global\hfuzz=1pt
-\setleading{12pt}
-\global\parskip 15pt plus 1pt
-
-\global\vsize= 53\baselineskip
-\advance\vsize by \topskip
-%\global\hsize= 5.85in % A4 wide 10pt
-\global\hsize= 6.5in
-\global\outerhsize=\hsize
-\global\advance\outerhsize by 0.5in
-\global\outervsize=\vsize
-\global\advance\outervsize by 0.6in
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-}
-
-% Allow control of the text dimensions. Parameters in order: textheight;
-% textwidth; \voffset; \hoffset (!); binding offset. All require a dimension;
-% header is additional; added length extends the bottom of the page.
-
-\def\changepagesizes#1#2#3#4#5
-{\global\vsize= #1
- \advance\vsize by \topskip
- \global\voffset= #3
- \global\hsize= #2
- \global\outerhsize=\hsize
- \global\advance\outerhsize by 0.5in
- \global\outervsize=\vsize
- \global\advance\outervsize by 0.6in
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- \global\normaloffset= #4
- \global\bindingoffset= #5}
-
-% This layout is compatible with Latex on A4 paper.
-
-\def\afourlatex{\changepagesizes{22cm}{15cm}{7mm}{4.6mm}{5mm}}
-
-% Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other
-\catcode`\~=\other
-\catcode`\^=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode`\+=\other
-\def\normaldoublequote{"}
-\def\normaltilde{~}
-\def\normalcaret{^}
-\def\normalunderscore{_}
-\def\normalverticalbar{|}
-\def\normalless{<}
-\def\normalgreater{>}
-\def\normalplus{+}
-
-% This macro is used to make a character print one way in ttfont
-% where it can probably just be output, and another way in other fonts,
-% where something hairier probably needs to be done.
-%
-% #1 is what to print if we are indeed using \tt; #2 is what to print
-% otherwise. Since all the Computer Modern typewriter fonts have zero
-% interword stretch (and shrink), and it is reasonable to expect all
-% typewriter fonts to have this, we can check that font parameter.
-%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
-
-% Turn off all special characters except @
-% (and those which the user can use as if they were ordinary).
-% Most of these we simply print from the \tt font, but for some, we can
-% use math or other variants that look better in normal text.
-
-\catcode`\"=\active
-\def\activedoublequote{{\tt \char '042}}
-\let"=\activedoublequote
-\catcode`\~=\active
-\def~{{\tt \char '176}}
-\chardef\hat=`\^
-\catcode`\^=\active
-\def^{{\tt \hat}}
-
-\catcode`\_=\active
-\def_{\ifusingtt\normalunderscore\_}
-% Subroutine for the previous macro.
-\def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}}
-
-% \lvvmode is equivalent in function to \leavevmode.
-% Using \leavevmode runs into trouble when written out to
-% an index file due to the expansion of \leavevmode into ``\unhbox
-% \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
-% magic tricks with @.
-\def\lvvmode{\vbox to 0pt{}}
-
-\catcode`\|=\active
-\def|{{\tt \char '174}}
-\chardef \less=`\<
-\catcode`\<=\active
-\def<{{\tt \less}}
-\chardef \gtr=`\>
-\catcode`\>=\active
-\def>{{\tt \gtr}}
-\catcode`\+=\active
-\def+{{\tt \char 43}}
-%\catcode 27=\active
-%\def^^[{$\diamondsuit$}
-
-% Set up an active definition for =, but don't enable it most of the time.
-{\catcode`\==\active
-\global\def={{\tt \char 61}}}
-
-\catcode`\@=0
-
-% \rawbackslashxx output one backslash character in current font
-\global\chardef\rawbackslashxx=`\\
-%{\catcode`\\=\other
-%@gdef@rawbackslashxx{\}}
-
-% \rawbackslash redefines \ as input to do \rawbackslashxx.
-{\catcode`\\=\active
-@gdef@rawbackslash{@let\=@rawbackslashxx }}
-
-% \normalbackslash outputs one backslash in fixed width font.
-\def\normalbackslash{{\tt\rawbackslashxx}}
-
-% Say @foo, not \foo, in error messages.
-\escapechar=`\@
-
-% \catcode 17=0 % Define control-q
-\catcode`\\=\active
-
-% Used sometimes to turn off (effectively) the active characters
-% even after parsing them.
-@def@turnoffactive{@let"=@normaldoublequote
-@let\=@realbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus}
-
-@def@normalturnoffactive{@let"=@normaldoublequote
-@let\=@normalbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus}
-
-% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
-% That is what \eatinput is for; after that, the `\' should revert to printing
-% a backslash.
-%
-@gdef@eatinput input texinfo{@fixbackslash}
-@global@let\ = @eatinput
-
-% On the other hand, perhaps the file did not have a `\input texinfo'. Then
-% the first `\{ in the file would cause an error. This macro tries to fix
-% that, assuming it is called before the first `\' could plausibly occur.
-%
-@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi}
-
-%% These look ok in all fonts, so just make them not special. The @rm below
-%% makes sure that the current font starts out as the newly loaded cmr10
-@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
-
-@textfonts
-@rm
-
-@c Local variables:
-@c page-delimiter: "^\\\\message"
-@c End:
diff --git a/util/configure.in b/util/configure.in
deleted file mode 100644
index 909913d..0000000
--- a/util/configure.in
+++ /dev/null
@@ -1,7 +0,0 @@
-AC_INIT(configure.in)
-CONFIG_RULES
-AC_SET_BUILDTOP
-CONFIG_DIRS(et ss)
-MAKE_SUBDIRS("making",all)
-MAKE_SUBDIRS("cleaning",clean)
-V5_AC_OUTPUT_MAKEFILE
diff --git a/util/et/ChangeLog b/util/et/ChangeLog
deleted file mode 100644
index 2e7f1eb..0000000
--- a/util/et/ChangeLog
+++ /dev/null
@@ -1,69 +0,0 @@
-Fri Nov 18 00:34:29 1994 Mark Eichin <eichin@cygnus.com>
-
- * configure.in: add caching to perror check (from epeisach).
-
-Fri Oct 21 21:06:48 1994 (tytso@rsx-11)
-
- * Makefile.in (SED): Don't specify an explicit pathname for sed.
-
-Tue Oct 11 12:43:00 1994 Theodore Y. Ts'o (tytso@dcl)
-
- * Makefile.in: Don't rm the awk and sed scripts during a make clean!
-
-Thu Oct 6 19:39:11 1994 Theodore Y. Ts'o (tytso@dcl)
-
- * compile_et.sh: Replace basename with sed -- more portable.
-
-Mon Oct 3 17:27:28 1994 Theodore Y. Ts'o (tytso@dcl)
-
- * Makefile.in:
- configure.in: Don't try to compile compile_et. Use awk/sed
- version instead. It's more apt to be portable, since it
- doesn't use awk or sed. :-(
-
-
-Fri Sep 30 17:12:15 1994 Theodore Y. Ts'o (tytso@dcl)
-
- * compile_et.c: Add declaration of error_message() manually.
-
- * internal.h: Use autoconf to determine whether or not to declare
- perror().
-
- * configure.in:
- compiler.h:
- internal.h:
- compilet_et.c:
- init_et.c: Let configure take care of removing const with AC_CONST.
-
-Thu Sep 8 22:33:07 1994 Theodore Y. Ts'o (tytso@pinata)
-
- * com_err.c (default_com_err_proc): Reversed order of \n\r to make
- jik happy.
-
-Wed Jul 13 23:19:34 1994 Tom Yu (tlyu at dragons-lair)
-
- * Makefile.in: nuke the libcom_err.a.bak stuff
-
-Sun Jul 3 07:48:04 1994 Tom Yu (tlyu at dragons-lair)
-
- * Makefile.in: cleaning up to not spew ignored errors
-
-Wed Jun 22 18:47:36 1994 Mark Eichin (eichin@tweedledumber.cygnus.com)
-
- * com_err.h: Only set STDARG_PROTOTYPES based on STDC if it isn't
- set already (clean up warnings.)
-
-Wed Jun 22 17:55:48 1994 Mark Eichin (eichin@cygnus.com)
-
- * Makefile.in (CP): set CP so CopySrcHeader actually works.
-
-Tue Jun 21 00:20:44 1994 Tom Yu (tlyu at dragons-lair)
-
- * Makefile.in: add "includes" to "all" dependencies
-
- * configure.in: should be CopySrcHeader
-
-Mon Jun 20 21:59:37 1994 Tom Yu (tlyu at dragons-lair)
-
- * configure.in: install com_err.h during build
-
diff --git a/util/et/Makefile.in b/util/et/Makefile.in
deleted file mode 100644
index 0b37e72..0000000
--- a/util/et/Makefile.in
+++ /dev/null
@@ -1,126 +0,0 @@
-CFLAGS = $(CCOPTS) $(DEFS) $(LOCALINCLUDE)
-LDFLAGS = -g
-SED = sed
-
-INSTALLFILE = cp
-
-all::
-
-LINTFLAGS=-uhvb
-LINTFILES= error_message.c et_name.c init_et.c com_err.c
-LIBOBJS= error_message.o et_name.o init_et.o com_err.o
-# for et_lex.lex.c include in error_table.y
-LOCALINCLUDE=-I. -I$(srcdir)
-
-FILES= Makefile et_name.c error_message.c compile_et.c \
- et_lex.lex.l error_table.y init_et.c \
- com_err.c com_err.h \
- error_table.h mit-sipb-copyright.h \
- test_et.c test1.et test2.et \
- compiler.h internal.h \
- com_err.texinfo texinfo.tex
-CFILES= compile_et.c error_table.c error_message.c et_name.c \
- init_et.c com_err.c
-
-SRCS=$(CFILES)
-
-#
-# what to build...
-#
-
-#
-# rules
-#
-error_table.o: et_lex.lex.c
-
-#
-# real entries...
-#
-
-all:: compile_et includes
-
-# The realm compile_et just isn't portable. (But then again, anything using
-# lex and yacc isn't portable by definition. :-( )
-#
-#compile_et: compile_et.o error_table.o
-# $(CC) $(CFLAGS) -o $@ compile_et.o error_table.o $(LEXLIB) $(BSDLIB)
-#
-#install::
-# $(INSTALLPROG) compile_et ${DESTDIR}$(PROGDIR)/compile_et
-
-compile_et: $(srcdir)/compile_et.sh $(srcdir)/config_script
- $(srcdir)/config_script $(srcdir)/compile_et.sh $(AWK) $(SED) > compile_et
- chmod 755 compile_et
-
-et_c.awk: $(srcdir)/et_c.awk
- $(CP) $(srcdir)/et_c.awk et_c.awk
-
-et_h.awk: $(srcdir)/et_h.awk
- $(CP) $(srcdir)/et_h.awk et_h.awk
-
-clean::
- $(RM) compile_et compile_et.o error_table.o
-
-depend::
-
-install:: com_err.h
- $(INSTALLFILE) $(srcdir)/com_err.h $(DESTDIR)$(INCLDIR)/com_err.h
-
-install:: mit-sipb-copyright.h
- $(INSTALLFILE) $(srcdir)/mit-sipb-copyright.h $(DESTDIR)$(INCLDIR)/mit-sipb-copyright.h
-
-install:: com_err.3
- $(INSTALLFILE) $(srcdir)/com_err.3 ${DESTDIR}${MANDIR}/man3/com_err.3
-
-install:: compile_et.1
- $(INSTALLFILE) $(srcdir)/compile_et.1 ${DESTDIR}${MANDIR}/man1/compile_et.1
-
-
-## install_library_target(com_err,$(LIBOBJS),$(LINTFILES),)
-all:: libcom_err.a
-
-libcom_err.a: $(LIBOBJS)
- $(ARCHIVE) $@ $(LIBOBJS)
- $(RANLIB) $@
-
-clean::
- $(RM) libcom_err.a
- $(RM) $(LIBOBJS)
-
-install::
- $(INSTALLLIB) libcom_err.a $(DESTDIR)$(LIBDIR)/libcom_err.a
- $(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libcom_err.a
- $(RANLIB) $(DESTDIR)$(LIBDIR)/libcom_err.a
- $(CHMOD) 444 $(DESTDIR)$(LIBDIR)/libcom_err.a
-##
-
-clean::
- rm -f *~ \#* *.bak \
- *.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
- *.cp *.fn *.ky *.log *.pg *.tp *.vr \
- *.o profiled/?*.o libcom_err.a libcom_err_p.a \
- com_err.o compile_et \
- et.ar TAGS y.tab.c lex.yy.c error_table.c \
- et_lex.lex.c \
- test1.h test1.c test2.h test2.c test_et \
- eddep makedep *.ln
-
-
-
-com_err.ps : com_err.dvi
-com_err.dvi: com_err.texinfo
-
-libcom_err.o: $(LIBOBJS)
- ld -r -s -o libcom_err.o $(LIBOBJS)
- chmod -x libcom_err.o
-
-
-archive: et.tar
-
-TAGS: et_name.c error_message.c compile_et.c error_table.c \
- lex.yy.c init_et.c
- etags et_name.c error_message.c compile_et.c \
- error_table.c init_et.c
-
-depend:: et_lex.lex.c
-
diff --git a/util/et/com_err.3 b/util/et/com_err.3
deleted file mode 100644
index ee4375b..0000000
--- a/util/et/com_err.3
+++ /dev/null
@@ -1,96 +0,0 @@
-.\" Copyright (c) 1988 Massachusetts Institute of Technology,
-.\" Student Information Processing Board. All rights reserved.
-.\"
-.\" $Header$
-.\"
-.TH COM_ERR 3 "22 Nov 1988" SIPB
-.SH NAME
-com_err \- common error display routine
-.SH SYNOPSIS
-.nf
- #include <com_err.h>
-.PP
-void com_err (whoami, code, format, ...);
- const char *whoami;
- long code;
- const char *format;
-.PP
-proc = set_com_err_hook (proc);
-.fi
-void (*
-.I proc
-) (const char *, long, const char *, va_list);
-.nf
-.PP
-proc = reset_com_err_hook ();
-.PP
-void initialize_XXXX_error_table ();
-.fi
-.SH DESCRIPTION
-.I Com_err
-displays an error message on the standard error stream
-.I stderr
-(see
-.IR stdio (3S))
-composed of the
-.I whoami
-string, which should specify the program name or some subportion of
-a program, followed by an error message generated from the
-.I code
-value (derived from
-.IR compile_et (1)),
-and a string produced using the
-.I format
-string and any following arguments, in the same style as
-.IR fprintf (3).
-
-The behavior of
-.I com_err
-can be modified using
-.I set_com_err_hook;
-this defines a procedure which is called with the arguments passed to
-.I com_err,
-instead of the default internal procedure which sends the formatted
-text to error output. Thus the error messages from a program can all
-easily be diverted to another form of diagnostic logging, such as
-.IR syslog (3).
-.I Reset_com_err_hook
-may be used to restore the behavior of
-.I com_err
-to its default form. Both procedures return the previous ``hook''
-value. These ``hook'' procedures must have the declaration given for
-.I proc
-above in the synopsis.
-
-The
-.I initialize_XXXX_error_table
-routine is generated mechanically by
-.IR compile_et (1)
-from a source file containing names and associated strings. Each
-table has a name of up to four characters, which is used in place of
-the
-.B XXXX
-in the name of the routine. These routines should be called before
-any of the corresponding error codes are used, so that the
-.I com_err
-library will recognize error codes from these tables when they are
-used.
-
-The
-.B com_err.h
-header file should be included in any source file that uses routines
-from the
-.I com_err
-library; executable files must be linked using
-.I ``-lcom_err''
-in order to cause the
-.I com_err
-library to be included.
-
-.\" .IR for manual entries
-.\" .PP for paragraph breaks
-
-.SH "SEE ALSO"
-compile_et (1), syslog (3).
-
-Ken Raeburn, "A Common Error Description Library for UNIX".
diff --git a/util/et/com_err.c b/util/et/com_err.c
deleted file mode 100644
index 8860446..0000000
--- a/util/et/com_err.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 1987, 1988 by MIT Student Information Processing Board.
- *
- * For copyright info, see mit-sipb-copyright.h.
- */
-
-#include <stdio.h>
-#include "mit-sipb-copyright.h"
-
-#ifdef STDARG_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#define VARARGS
-#endif
-
-#include "error_table.h"
-#include "internal.h"
-
-#ifdef notdef
-/*
- * Protect us from header version (externally visible) of com_err, so
- * we can survive in a <varargs.h> environment. I think.
- */
-#define com_err com_err_external
-#include "com_err.h"
-#undef com_err
-#endif
-
-/* We have problems with varargs definitions if we include com_err.h */
-
-/*
- * XXX for now, we define error_message by hand. Ultimately, we
- * should fix up com_err.h so that it's safe to #include here
- * directly.
- */
-#ifdef __STDC__
-extern char const *error_message (long);
-#else
-extern char *error_message ();
-#endif
-
-static void
-#ifdef __STDC__
- default_com_err_proc (const char *whoami, long code, const char *fmt, va_list args)
-#else
- default_com_err_proc (whoami, code, fmt, args)
- const char *whoami;
- long code;
- const char *fmt;
- va_list args;
-#endif
-{
- if (whoami) {
- fputs(whoami, stderr);
- fputs(": ", stderr);
- }
- if (code) {
- fputs(error_message(code), stderr);
- fputs(" ", stderr);
- }
- if (fmt) {
- vfprintf (stderr, fmt, args);
- }
- /* should do this only on a tty in raw mode */
- putc('\r', stderr);
- putc('\n', stderr);
- fflush(stderr);
-}
-
-#ifdef __STDC__
-typedef void (*errf) (const char *, long, const char *, va_list);
-#else
-typedef void (*errf) ();
-#endif
-
-errf com_err_hook = default_com_err_proc;
-
-void com_err_va (whoami, code, fmt, args)
- const char *whoami;
- long code;
- const char *fmt;
- va_list args;
-{
- (*com_err_hook) (whoami, code, fmt, args);
-}
-
-#ifndef VARARGS
-void com_err (const char *whoami,
- long code,
- const char *fmt, ...)
-{
-#else
-void com_err (va_alist)
- va_dcl
-{
- const char *whoami, *fmt;
- long code;
-#endif
- va_list pvar;
-
- if (!com_err_hook)
- com_err_hook = default_com_err_proc;
-#ifdef VARARGS
- va_start (pvar);
- whoami = va_arg (pvar, const char *);
- code = va_arg (pvar, long);
- fmt = va_arg (pvar, const char *);
-#else
- va_start(pvar, fmt);
-#endif
- com_err_va (whoami, code, fmt, pvar);
- va_end(pvar);
-}
-
-errf set_com_err_hook (new_proc)
- errf new_proc;
-{
- errf x = com_err_hook;
-
- if (new_proc)
- com_err_hook = new_proc;
- else
- com_err_hook = default_com_err_proc;
-
- return x;
-}
-
-errf reset_com_err_hook () {
- errf x = com_err_hook;
- com_err_hook = default_com_err_proc;
- return x;
-}
diff --git a/util/et/com_err.h b/util/et/com_err.h
deleted file mode 100644
index 0190a3e..0000000
--- a/util/et/com_err.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Header file for common error description library.
- *
- * Copyright 1988, Student Information Processing Board of the
- * Massachusetts Institute of Technology.
- *
- * For copyright and distribution info, see the documentation supplied
- * with this package.
- */
-
-#ifndef __COM_ERR_H
-
-#ifndef STDARG_PROTOTYPES
-/* Imake needs this -- oh well */
-#ifdef __STDC__
-#define STDARG_PROTOTYPES
-#endif
-#endif
-
-#ifdef STDARG_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#ifdef __STDC__
-/* ANSI C -- use prototypes etc */
-void com_err (const char *, long, const char *, ...);
-char const *error_message (long);
-void (*com_err_hook) (const char *, long, const char *, va_list);
-void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
- (const char *, long, const char *, va_list);
-void (*reset_com_err_hook ()) (const char *, long, const char *, va_list);
-#else
-/* no prototypes */
-void com_err ();
-char *error_message ();
-void (*com_err_hook) ();
-void (*set_com_err_hook ()) ();
-void (*reset_com_err_hook ()) ();
-#endif
-
-#define __COM_ERR_H
-#endif /* ! defined(__COM_ERR_H) */
diff --git a/util/et/com_err.texinfo b/util/et/com_err.texinfo
deleted file mode 100644
index 2f4b266..0000000
--- a/util/et/com_err.texinfo
+++ /dev/null
@@ -1,554 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-
-@c $Header$
-@c $Source$
-@c $Locker$
-
-@c Note that although this source file is in texinfo format (more
-@c or less), it is not yet suitable for turning into an ``info''
-@c file. Sorry, maybe next time.
-@c
-@c In order to produce hardcopy documentation from a texinfo file,
-@c run ``tex com_err.texinfo'' which will load in texinfo.tex,
-@c provided in this distribution. (texinfo.tex is from the Free
-@c Software Foundation, and is under different copyright restrictions
-@c from the rest of this package.)
-
-@ifinfo
-@barfo
-@end ifinfo
-
-@iftex
-@tolerance 10000
-
-@c Mutate section headers...
-@begingroup
- @catcode#=6
- @gdef@secheading#1#2#3{@secheadingi {#3@enspace #1}}
-@endgroup
-@end iftex
-
-@setfilename com_err
-@settitle A Common Error Description Library for UNIX
-
-@ifinfo
-This file documents the use of the Common Error Description library.
-
-Copyright (C) 1987, 1988 Student Information Processing Board of the
-Massachusetts Institute of Technology.
-
-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 names of M.I.T. and the M.I.T. S.I.P.B. not be
-used in advertising or publicity pertaining to distribution of the software
-without specific, written prior permission. M.I.T. and the M.I.T. S.I.P.B.
-make no representations about the suitability of this software for any
-purpose. It is provided "as is" without express or implied warranty.
-
-Note that the file texinfo.tex, provided with this distribution, is from
-the Free Software Foundation, and is under different copyright restrictions
-from the remainder of this package.
-
-@end ifinfo
-
-@ignore
-Permission is granted to process this file through Tex and print the
-results, provided the printed document carries copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-
-@setchapternewpage odd
-
-@titlepage
-@center @titlefont{A Common Error Description}
-@center @titlefont{Library for UNIX}
-@sp 2
-@center Ken Raeburn
-@center Bill Sommerfeld
-@sp 1
-@center MIT Student Information Processing Board
-@sp 3
-@center last updated 1 January 1989
-@center for version 1.2
-@center ***DRAFT COPY ONLY***
-
-@vskip 2in
-
-@center @b{Abstract}
-
-UNIX has always had a clean and simple system call interface, with a
-standard set of error codes passed between the kernel and user
-programs. Unfortunately, the same cannot be said of many of the
-libraries layered on top of the primitives provided by the kernel.
-Typically, each one has used a different style of indicating errors to
-their callers, leading to a total hodgepodge of error handling, and
-considerable amounts of work for the programmer. This paper describes
-a library and associated utilities which allows a more uniform way for
-libraries to return errors to their callers, and for programs to
-describe errors and exceptional conditions to their users.
-
-@page
-@vskip 0pt plus 1filll
-
-Copyright @copyright{} 1987, 1988 by the Student Information Processing
-Board of the Massachusetts Institute of Technology.
-
-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 names of M.I.T. and the M.I.T. S.I.P.B. not be
-used in advertising or publicity pertaining to distribution of the software
-without specific, written prior permission. M.I.T. and the M.I.T. S.I.P.B.
-make no representations about the suitability of this software for any
-purpose. It is provided "as is" without express or implied warranty.
-
-Note that the file texinfo.tex, provided with this distribution, is from
-the Free Software Foundation, and is under different copyright restrictions
-from the remainder of this package.
-
-@end titlepage
-
-@ifinfo
-@c should put a menu here someday....
-@end ifinfo
-
-@page
-
-@section Why com_err?
-
-In building application software packages, a programmer often has to
-deal with a number of libraries, each of which can use a different
-error-reporting mechanism. Sometimes one of two values is returned,
-indicating simply SUCCESS or FAILURE, with no description of errors
-encountered. Sometimes it is an index into a table of text strings,
-where the name of the table used is dependent on the library being
-used when the error is generated; since each table starts numbering at
-0 or 1, additional information as to the source of the error code is
-needed to determine which table to look at. Sometimes no text messages are
-supplied at all, and the programmer must supply them at any point at which
-he may wish to report error conditions.
-Often, a global variable is assigned some value describing the error, but
-the programmer has to know in each case whether to look at @code{errno},
-@code{h_errno}, the return value from @code{hes_err()}, or whatever other
-variables or routines are specified.
-And what happens if something
-in the procedure of
-examining or reporting the error changes the same variable?
-
-The package we have developed is an attempt to present a common
-error-handling mechanism to manipulate the most common form of error code
-in a fashion that does not have the problems listed above.
-
-A list of up to 256 text messages is supplied to a translator we have
-written, along with the three- to four-character ``name'' of the error
-table. The library using this error table need only call a routine
-generated from this error-table source to make the table ``known'' to the
-com_err library, and any error code the library generates can be converted
-to the corresponding error message. There is also a default format for
-error codes accidentally returned before making the table known, which is
-of the form @samp{unknown code foo 32}, where @samp{foo} would be the name
-of the table.
-
-@section Error codes
-
-Error codes themselves are 32 bit (signed) integers, of which the high
-order 24 bits are an identifier of which error table the error code is
-from, and the low order 8 bits are a sequential error number within
-the table. An error code may thus be easily decomposed into its component
-parts. Only the lowest 32 bits of an error code are considered significant
-on systems which support wider values.
-
-Error table 0 is defined to match the UNIX system call error table
-(@code{sys_errlist}); this allows @code{errno} values to be used directly
-in the library (assuming that @code{errno} is of a type with the same width
-as @t{long}). Other error table numbers are formed by compacting together
-the first four characters of the error table name. The mapping between
-characters in the name and numeric values in the error code are defined in
-a system-independent fashion, so that two systems that can pass integral
-values between them can reliably pass error codes without loss of meaning;
-this should work even if the character sets used are not the same.
-(However, if this is to be done, error table 0 should be avoided, since the
-local system call error tables may differ.)
-
-Any variable which is to contain an error code should be declared @t{long}.
-The draft proposed American National Standard for C (as of May, 1988)
-requires that @t{long} variables be at least 32 bits; any system which does
-not support 32-bit @t{long} values cannot make use of this package (nor
-much other software that assumes an ANSI-C environment base) without
-significant effort.
-
-@section Error table source file
-
-The error table source file begins with the declaration of the table name,
-as
-
-@example
-error_table @var{tablename}
-@end example
-
-Individual error codes are
-specified with
-
-@example
-error_code @var{ERROR_NAME}, @var{"text message"}
-@end example
-
-where @samp{ec} can also be used as a short form of @samp{error_code}. To
-indicate the end of the table, use @samp{end}. Thus, a (short) sample
-error table might be:
-
-@example
-
- error_table dsc
-
- error_code DSC_DUP_MTG_NAME,
- "Meeting already exists"
-
- ec DSC_BAD_PATH,
- "A bad meeting pathname was given"
-
- ec DSC_BAD_MODES,
- "Invalid mode for this access control list"
-
- end
-
-@end example
-
-@section The error-table compiler
-
-The error table compiler is named @code{compile_et}. It takes one
-argument, the pathname of a file (ending in @samp{.et}, e.g.,
-@samp{dsc_err.et}) containing an error table source file. It parses the
-error table, and generates two output files -- a C header file
-(@samp{discuss_err.h}) which contains definitions of the numerical values
-of the error codes defined in the error table, and a C source file which
-should be compiled and linked with the executable. The header file must be
-included in the source of a module which wishes to reference the error
-codes defined; the object module generated from the C code may be linked in
-to a program which wishes to use the printed forms of the error codes.
-
-This translator accepts a @kbd{-language @var{lang}} argument, which
-determines for which language (or language variant) the output should be
-written. At the moment, @var{lang} is currently limited to @kbd{ANSI-C}
-and @kbd{K&R-C}, and some abbreviated forms of each. Eventually, this will
-be extended to include some support for C++. The default is currently
-@kbd{K&R-C}, though the generated sources will have ANSI-C code
-conditionalized on the symbol @t{__STDC__}.
-
-@section Run-time support routines
-
-Any source file which uses the routines supplied with or produced by the
-com_err package should include the header file @file{<com_err.h>}. It
-contains declarations and definitions which may be needed on some systems.
-(Some functions cannot be referenced properly without the return type
-declarations in this file. Some functions may work properly on most
-architectures even without the header file, but relying on this is not
-recommended.)
-
-The run-time support routines and variables provided via this package
-include the following:
-
-@example
-void initialize_@var{xxxx}_error_table (void);
-@end example
-
-One of these routines is built by the error compiler for each error table.
-It makes the @var{xxxx} error table ``known'' to the error reporting
-system. By convention, this routine should be called in the initialization
-routine of the @var{xxxx} library. If the library has no initialization
-routine, some combination of routines which form the core of the library
-should ensure that this routine is called. It is not advised to leave it
-the caller to make this call.
-
-There is no harm in calling this routine more than once.
-
-@example
-#define ERROR_TABLE_BASE_@var{xxxx} @var{nnnnn}L
-@end example
-
-This symbol contains the value of the first error code entry in the
-specified table.
-This rarely needs be used by the
-programmer.
-
-@example
-const char *error_message (long code);
-@end example
-
-This routine returns the character string error message associated
-with @code{code}; if this is associated with an unknown error table, or
-if the code is associated with a known error table but the code is not
-in the table, a string of the form @samp{Unknown code @var{xxxx nn}} is
-returned, where @var{xxxx} is the error table name produced by
-reversing the compaction performed on the error table number implied
-by that error code, and @var{nn} is the offset from that base value.
-
-Although this routine is available for use when needed, its use should be
-left to circumstances which render @code{com_err} (below) unusable.
-
-@example
-void com_err (const char *whoami, /* module reporting error */
- long code, /* error code */
- const char *format, /* format for additional detail */
- ...); /* (extra parameters) */
-@end example
-
-This routine provides an alternate way to print error messages to
-standard error; it allows the error message to be passed in as a
-parameter, rather than in an external variable. @emph{Provide grammatical
-context for ``message.''}
-
-If @var{format} is @code{(char *)NULL}, the formatted message will not be
-printed. @var{format} may not be omitted.
-
-@example
-#include <stdarg.h>
-
-void com_err_va (const char *whoami,
- long code,
- const char *format,
- va_list args);
-@end example
-
-This routine provides an interface, equivalent to @code{com_err} above,
-which may be used by higher-level variadic functions (functions which
-accept variable numbers of arguments).
-
-@example
-#include <stdarg.h>
-
-void (*set_com_err_hook (void (*proc) ())) ();
-
-void (*@var{proc}) (const char *whoami, long code, va_list args);
-
-void reset_com_err_hook ();
-@end example
-
-These two routines allow a routine to be dynamically substituted for
-@samp{com_err}. After @samp{set_com_err_hook} has been called,
-calls to @samp{com_err} will turn into calls to the new hook routine.
-@samp{reset_com_err_hook} turns off this hook. This may intended to
-be used in daemons (to use a routine which calls @var{syslog(3)}), or
-in a window system application (which could pop up a dialogue box).
-
-If a program is to be used in an environment in which simply printing
-messages to the @code{stderr} stream would be inappropriate (such as in a
-daemon program which runs without a terminal attached),
-@code{set_com_err_hook} may be used to redirect output from @code{com_err}.
-The following is an example of an error handler which uses @var{syslog(3)}
-as supplied in BSD 4.3:
-
-@example
-#include <stdio.h>
-#include <stdarg.h>
-#include <syslog.h>
-
-/* extern openlog (const char * name, int logopt, int facility); */
-/* extern syslog (int priority, char * message, ...); */
-
-void hook (const char * whoami, long code,
- const char * format, va_list args)
-@{
- char buffer[BUFSIZ];
- static int initialized = 0;
- if (!initialized) @{
- openlog (whoami,
- LOG_NOWAIT|LOG_CONS|LOG_PID|LOG_NDELAY,
- LOG_DAEMON);
- initialized = 1;
- @}
- vsprintf (buffer, format, args);
- syslog (LOG_ERR, "%s %s", error_message (code), buffer);
-@}
-@end example
-
-After making the call
-@code{set_com_err_hook (hook);},
-any calls to @code{com_err} will result in messages being sent to the
-@var{syslogd} daemon for logging.
-The name of the program, @samp{whoami}, is supplied to the
-@samp{openlog()} call, and the message is formatted into a buffer and
-passed to @code{syslog}.
-
-Note that since the extra arguments to @code{com_err} are passed by
-reference via the @code{va_list} value @code{args}, the hook routine may
-place any form of interpretation on them, including ignoring them. For
-consistency, @code{printf}-style interpretation is suggested, via
-@code{vsprintf} (or @code{_doprnt} on BSD systems without full support for
-the ANSI C library).
-
-@section Coding Conventions
-
-The following conventions are just some general stylistic conventions
-to follow when writing robust libraries and programs. Conventions
-similar to this are generally followed inside the UNIX kernel and most
-routines in the Multics operating system. In general, a routine
-either succeeds (returning a zero error code, and doing some side
-effects in the process), or it fails, doing minimal side effects; in
-any event, any invariant which the library assumes must be maintained.
-
-In general, it is not in the domain of non user-interface library
-routines to write error messages to the user's terminal, or halt the
-process. Such forms of ``error handling'' should be reserved for
-failures of internal invariants and consistancy checks only, as it
-provides the user of the library no way to clean up for himself in the
-event of total failure.
-
-Library routines which can fail should be set up to return an error
-code. This should usually be done as the return value of the
-function; if this is not acceptable, the routine should return a
-``null'' value, and put the error code into a parameter passed by
-reference.
-
-Routines which use the first style of interface can be used from
-user-interface levels of a program as follows:
-
-@example
-@{
- if ((code = initialize_world(getuid(), random())) != 0) @{
- com_err("demo", code,
- "when trying to initialize world");
- exit(1);
- @}
- if ((database = open_database("my_secrets", &code))==NULL) @{
- com_err("demo", code,
- "while opening my_secrets");
- exit(1);
- @}
-@}
-@end example
-
-A caller which fails to check the return status is in error. It is
-possible to look for code which ignores error returns by using lint;
-look for error messages of the form ``foobar returns value which is
-sometimes ignored'' or ``foobar returns value which is always
-ignored.''
-
-Since libraries may be built out of other libraries, it is often necessary
-for the success of one routine to depend on another. When a lower level
-routine returns an error code, the middle level routine has a few possible
-options. It can simply return the error code to its caller after doing
-some form of cleanup, it can substitute one of its own, or it can take
-corrective action of its own and continue normally. For instance, a
-library routine which makes a ``connect'' system call to make a network
-connection may reflect the system error code @code{ECONNREFUSED}
-(Connection refused) to its caller, or it may return a ``server not
-available, try again later,'' or it may try a different server.
-
-Cleanup which is typically necessary may include, but not be limited
-to, freeing allocated memory which will not be needed any more,
-unlocking concurrancy locks, dropping reference counts, closing file
-descriptors, or otherwise undoing anything which the procedure did up
-to this point. When there are a lot of things which can go wrong, it
-is generally good to write one block of error-handling code which is
-branched to, using a goto, in the event of failure. A common source
-of errors in UNIX programs is failing to close file descriptors on
-error returns; this leaves a number of ``zombied'' file descriptors
-open, which eventually causes the process to run out of file
-descriptors and fall over.
-
-@example
-@{
- FILE *f1=NULL, *f2=NULL, *f3=NULL;
- int status = 0;
-
- if ( (f1 = fopen(FILE1, "r")) == NULL) @{
- status = errno;
- goto error;
- @}
-
- /*
- * Crunch for a while
- */
-
- if ( (f2 = fopen(FILE2, "w")) == NULL) @{
- status = errno;
- goto error;
- @}
-
- if ( (f3 = fopen(FILE3, "a+")) == NULL) @{
- status = errno;
- goto error;
- @}
-
- /*
- * Do more processing.
- */
- fclose(f1);
- fclose(f2);
- fclose(f3);
- return 0;
-
-error:
- if (f1) fclose(f1);
- if (f2) fclose(f2);
- if (f3) fclose(f3);
- return status;
-@}
-@end example
-
-@section Building and Installation
-
-The distribution of this package will probably be done as a compressed
-``tar''-format file available via anonymous FTP from SIPB.MIT.EDU.
-Retrieve @samp{pub/com_err.tar.Z} and extract the contents. A subdirectory
-@t{profiled} should be created to hold objects compiled for profiling.
-Running ``make all'' should then be sufficient to build the library and
-error-table compiler. The files @samp{libcom_err.a},
-@samp{libcom_err_p.a}, @samp{com_err.h}, and @samp{compile_et} should be
-installed for use; @samp{com_err.3} and @samp{compile_et.1} can also be
-installed as manual pages.
-
-Potential problems:
-
-@itemize @bullet
-
-@item Use of @code{strcasecmp}, a routine provided in BSD for
-case-insensitive string comparisons. If an equivalent routine is
-available, you can modify @code{CFLAGS} in the makefile to define
-@code{strcasecmp} to the name of that routine.
-
-@item Compilers that defined @code{__STDC__} without providing the header
-file @code{<stdarg.h>}. One such example is Metaware's High ``C''
-compiler, as provided at Project Athena on the IBM RT/PC workstation; if
-@code{__HIGHC__} is defined, it is assumed that @code{<stdarg.h>} is not
-available, and therefore @code{<varargs.h>} must be used. If the symbol
-@code{VARARGS} is defined (e.g., in the makefile), @code{<varargs.h>} will
-be used.
-
-@item If your linker rejects symbols that are simultaneously defined in two
-library files, edit @samp{Makefile} to remove @samp{perror.c} from the
-library. This file contains a version of @var{perror(3)} which calls
-@code{com_err} instead of calling @code{write} directly.
-
-@end itemize
-
-As I do not have access to non-BSD systems, there are probably
-bugs present that may interfere with building or using this package on
-other systems. If they are reported to me, they can probably be fixed for
-the next version.
-
-@section Bug Reports
-
-Please send any comments or bug reports to the principal author: Ken
-Raeburn, @t{Raeburn@@Athena.MIT.EDU}.
-
-@section Acknowledgements
-
-I would like to thank: Bill Sommerfeld, for his help with some of this
-documentation, and catching some of the bugs the first time around;
-Honeywell Information Systems, for not killing off the @emph{Multics}
-operating system before I had an opportunity to use it; Honeywell's
-customers, who persuaded them not to do so, for a while; Ted Anderson of
-CMU, for catching some problems before version 1.2 left the nest; Stan
-Zanarotti and several others of MIT's Student Information Processing Board,
-for getting us started with ``discuss,'' for which this package was
-originally written; and everyone I've talked into --- I mean, asked to read
-this document and the ``man'' pages.
-
-@bye
diff --git a/util/et/compile_et.1 b/util/et/compile_et.1
deleted file mode 100644
index f17a278..0000000
--- a/util/et/compile_et.1
+++ /dev/null
@@ -1,79 +0,0 @@
-.\" Copyright (c) 1988 Massachusetts Institute of Technology,
-.\" Student Information Processing Board. All rights reserved.
-.\"
-.\" $Header$
-.\"
-.TH COMPILE_ET 1 "22 Nov 1988" SIPB
-.SH NAME
-compile_et \- error table compiler
-.SH SYNOPSIS
-.B compile_et
-file
-.SH DESCRIPTION
-.B Compile_et
-converts a table listing error-code names and associated messages into
-a C source file suitable for use with the
-.IR com_err (3)
-library.
-
-The source file name must end with a suffix of ``.et''; the file
-consists of a declaration supplying the name (up to four characters
-long) of the error-code table:
-
-.B error_table
-.I name
-
-followed by up to 256 entries of the form:
-
-.B error_code
-.I name,
-"
-.I string
-"
-
-and a final
-
-.B end
-
-to indicate the end of the table.
-
-The name of the table is used to construct the name of a subroutine
-.I initialize_XXXX_error_table
-which must be called in order for the
-.I com_err
-library to recognize the error table.
-
-The various error codes defined are assigned sequentially increasing
-numbers (starting with a large number computed as a hash function of
-the name of the table); thus for compatibility it is suggested that
-new codes be added only to the end of an existing table, and that no
-codes be removed from tables.
-
-The names defined in the table are placed into a C header file with
-preprocessor directives defining them as integer constants of up to
-32 bits in magnitude.
-
-A C source file is also generated which should be compiled and linked
-with the object files which reference these error codes; it contains
-the text of the messages and the initialization subroutine. Both C
-files have names derived from that of the original source file, with
-the ``.et'' suffix replaced by ``.c'' and ``.h''.
-
-A ``#'' in the source file is treated as a comment character, and all
-remaining text to the end of the source line will be ignored.
-
-.SH BUGS
-
-Since
-.B compile_et
-uses a very simple parser based on
-.IR yacc (1),
-its error recovery leaves much to be desired.
-
-.\" .IR for manual entries
-.\" .PP for paragraph breaks
-
-.SH "SEE ALSO"
-com_err (3).
-
-Ken Raeburn, "A Common Error Description Library for UNIX".
diff --git a/util/et/compile_et.c b/util/et/compile_et.c
deleted file mode 100644
index a6bf02c..0000000
--- a/util/et/compile_et.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- *
- * Copyright 1986, 1987, 1988
- * by MIT Student Information Processing Board.
- *
- * For copyright info, see "mit-sipb-copyright.h".
- *
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/file.h>
-#include <string.h>
-#include <sys/param.h>
-#include "mit-sipb-copyright.h"
-#include "compiler.h"
-
-#ifndef lint
-static const char copyright[] =
- "Copyright 1987,1988 by MIT Student Information Processing Board";
-#endif
-
-extern char *gensym();
-extern char *current_token;
-extern int table_number, current;
-char buffer[BUFSIZ];
-char *table_name = (char *)NULL;
-FILE *hfile, *cfile;
-
-/* C library */
-extern char *malloc();
-extern int errno;
-
-/* lex stuff */
-extern FILE *yyin;
-extern int yylineno;
-
-char * xmalloc (size) unsigned int size; {
- char * p = malloc (size);
- if (!p) {
- perror (whoami);
- exit (1);
- }
- return p;
-}
-
-static int check_arg (str_list, arg) char const *const *str_list, *arg; {
- while (*str_list)
- if (!strcmp(arg, *str_list++))
- return 1;
- return 0;
-}
-
-static const char *const debug_args[] = {
- "d",
- "debug",
- 0,
-};
-
-static const char *const lang_args[] = {
- "lang",
- "language",
- 0,
-};
-
-static const char *const language_names[] = {
- "C",
- "K&R C",
- "C++",
- 0,
-};
-
-static const char * const c_src_prolog[] = {
- "static const char * const text[] = {\n",
- 0,
-};
-
-static const char * const krc_src_prolog[] = {
- "#ifdef __STDC__\n",
- "#define NOARGS void\n",
- "#else\n",
- "#define NOARGS\n",
- "#define const\n",
- "#endif\n\n",
- "static const char * const text[] = {\n",
- 0,
-};
-
-static const char *const struct_def[] = {
- "struct error_table {\n",
- " char const * const * msgs;\n",
- " long base;\n",
- " int n_msgs;\n",
- "};\n",
- "struct et_list {\n",
- " struct et_list *next;\n",
- " const struct error_table * table;\n",
- "};\n",
- "extern struct et_list *_et_list;\n",
- "\n", 0,
-};
-
-static const char warning[] =
- "/*\n * %s:\n * This file is automatically generated; please do not edit it.\n */\n";
-
-/* pathnames */
-char c_file[MAXPATHLEN]; /* output file */
-char h_file[MAXPATHLEN]; /* output */
-
-static void usage () {
- fprintf (stderr, "%s: usage: %s ERROR_TABLE\n",
- whoami, whoami);
- exit (1);
-}
-
-static void dup_err (type, one, two) char const *type, *one, *two; {
- fprintf (stderr, "%s: multiple %s specified: `%s' and `%s'\n",
- whoami, type, one, two);
- usage ();
-}
-
-int main (argc, argv) int argc; char **argv; {
- char *p, *ename;
- int len;
- char const * const *cpp;
- int got_language = 0;
-
- /* argument parsing */
- debug = 0;
- filename = 0;
- whoami = argv[0];
- p = strrchr (whoami, '/');
- if (p)
- whoami = p+1;
- while (argv++, --argc) {
- char *arg = *argv;
- if (arg[0] != '-') {
- if (filename)
- dup_err ("filenames", filename, arg);
- filename = arg;
- }
- else {
- arg++;
- if (check_arg (debug_args, arg))
- debug++;
- else if (check_arg (lang_args, arg)) {
- got_language++;
- arg = *++argv, argc--;
- if (!arg)
- usage ();
- if (language)
- dup_err ("languanges", language_names[(int)language], arg);
-#define check_lang(x,v) else if (!strcasecmp(arg,x)) language = v
- check_lang ("c", lang_C);
- check_lang ("ansi_c", lang_C);
- check_lang ("ansi-c", lang_C);
- check_lang ("krc", lang_KRC);
- check_lang ("kr_c", lang_KRC);
- check_lang ("kr-c", lang_KRC);
- check_lang ("k&r-c", lang_KRC);
- check_lang ("k&r_c", lang_KRC);
- check_lang ("c++", lang_CPP);
- check_lang ("cplusplus", lang_CPP);
- check_lang ("c-plus-plus", lang_CPP);
-#undef check_lang
- else {
- fprintf (stderr, "%s: unknown language name `%s'\n",
- whoami, arg);
- fprintf (stderr, "\tpick one of: C K&R-C\n");
- exit (1);
- }
- }
- else {
- fprintf (stderr, "%s: unknown control argument -`%s'\n",
- whoami, arg);
- usage ();
- }
- }
- }
- if (!filename)
- usage ();
- if (!got_language)
- language = lang_KRC;
- else if (language == lang_CPP) {
- fprintf (stderr, "%s: Sorry, C++ support is not yet finished.\n",
- whoami);
- exit (1);
- }
-
- p = xmalloc (strlen (filename) + 5);
- strcpy (p, filename);
- filename = p;
- p = strrchr(filename, '/');
- if (p == (char *)NULL)
- p = filename;
- else
- p++;
- ename = p;
- len = strlen (ename);
- p += len - 3;
- if (strcmp (p, ".et"))
- p += 3;
- *p++ = '.';
- /* now p points to where "et" suffix should start */
- /* generate new filenames */
- strcpy (p, "c");
- strcpy (c_file, ename);
- *p = 'h';
- strcpy (h_file, ename);
- strcpy (p, "et");
-
- yyin = fopen(filename, "r");
- if (!yyin) {
- perror(filename);
- exit(1);
- }
-
- hfile = fopen(h_file, "w");
- if (hfile == (FILE *)NULL) {
- perror(h_file);
- exit(1);
- }
- fprintf (hfile, warning, h_file);
-
- cfile = fopen(c_file, "w");
- if (cfile == (FILE *)NULL) {
- perror(c_file);
- exit(1);
- }
- fprintf (cfile, warning, c_file);
-
- /* prologue */
- if (language == lang_C)
- cpp = c_src_prolog;
- else if (language == lang_KRC)
- cpp = krc_src_prolog;
- else
- abort ();
- while (*cpp)
- fputs (*cpp++, cfile);
-
- /* parse it */
- yyparse();
- fclose(yyin); /* bye bye input file */
-
- fputs (" 0\n};\n\n", cfile);
- for (cpp = struct_def; *cpp; cpp++)
- fputs (*cpp, cfile);
- fprintf(cfile,
- "static const struct error_table et = { text, %ldL, %d };\n\n",
- table_number, current);
- fputs("static struct et_list link = { 0, 0 };\n\n",
- cfile);
- fprintf(cfile, "void initialize_%s_error_table (%s) {\n",
- table_name, (language == lang_C) ? "void" : "NOARGS");
- fputs(" if (!link.table) {\n", cfile);
- fputs(" link.next = _et_list;\n", cfile);
- fputs(" link.table = &et;\n", cfile);
- fputs(" _et_list = &link;\n", cfile);
- fputs(" }\n", cfile);
- fputs("}\n", cfile);
- fclose(cfile);
-
- fprintf (hfile, "extern void initialize_%s_error_table ();\n",
- table_name);
- fprintf (hfile, "#define ERROR_TABLE_BASE_%s (%ldL)\n",
- table_name, table_number);
- /* compatibility... */
- fprintf (hfile, "\n/* for compatibility with older versions... */\n");
- fprintf (hfile, "#define init_%s_err_tbl initialize_%s_error_table\n",
- table_name, table_name);
- fprintf (hfile, "#define %s_err_base ERROR_TABLE_BASE_%s\n", table_name,
- table_name);
- fclose(hfile); /* bye bye include file */
-
- return 0;
-}
-
-int yyerror(s) char *s; {
- fputs(s, stderr);
-#ifdef NO_YYLINENO
- fprintf(stderr, "\nLast token was '%s'\n", current_token);
-#else
- fprintf(stderr, "\nLine number %d; last token was '%s'\n",
- yylineno, current_token);
-#endif
-}
-
-#ifdef NEED_STRCASECMP
-/* Need strcasecmp for this machine */
-/*
- * Copyright (c) 1987 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- */
-
-/* based on @(#)strcasecmp.c 1.3 (Berkeley) 8/3/87 */
-
-/*
- * 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',
-};
-
-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]);
-}
-
-#endif
diff --git a/util/et/compile_et.sh b/util/et/compile_et.sh
deleted file mode 100755
index 2b17bff..0000000
--- a/util/et/compile_et.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-#
-#
-AWK=@AWK@
-DIR=@DIR@
-
-ROOT=`echo $1 | sed -e s/.et$//`
-BASE=`echo $ROOT | sed -e 's;.*/;;'`
-
-$AWK -f ${DIR}/et_h.awk outfile=${BASE}.h $ROOT.et
-$AWK -f ${DIR}/et_c.awk outfile=${BASE}.c $ROOT.et
diff --git a/util/et/compiler.h b/util/et/compiler.h
deleted file mode 100644
index 3e23f12..0000000
--- a/util/et/compiler.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * definitions common to the source files of the error table compiler
- */
-
-enum lang {
- lang_C, /* ANSI C (default) */
- lang_KRC, /* C: ANSI + K&R */
- lang_CPP /* C++ */
-};
-
-int debug; /* dump debugging info? */
-char *filename; /* error table source */
-enum lang language;
-const char *whoami;
diff --git a/util/et/config.log b/util/et/config.log
deleted file mode 100644
index fb9038e..0000000
--- a/util/et/config.log
+++ /dev/null
@@ -1,3 +0,0 @@
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
diff --git a/util/et/config_script b/util/et/config_script
deleted file mode 100755
index e3de35c..0000000
--- a/util/et/config_script
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# This program takes a shell script and configures for the following
-# variables: @DIR@
-# @AWK@
-# @SED@
-#
-# Usage: config_script <filename> [<awk>] [<sed>]
-#
-
-FILE=$1
-AWK=$2
-SED=$3
-
-# Grr.... not all Unix's have the dirname command
-TMP=`echo $1 | sed -e 's;[^/]*$;;' -e 's/^$/./'`
-DIR=`cd ${TMP}; pwd`
-
-if test "${AWK}x" = "x" ; then
- AWK=awk
-fi
-if test "${SED}x" = "x" ; then
- SED=sed
-fi
-sed -e "s;@DIR@;${DIR};" -e "s;@AWK@;${AWK};" -e "s;@SED@;${SED};" $FILE
diff --git a/util/et/configure b/util/et/configure
deleted file mode 100755
index e67c5da..0000000
--- a/util/et/configure
+++ /dev/null
@@ -1,1200 +0,0 @@
-#!/bin/sh
-
-
-# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.1
-# Copyright (C) 1992, 1993, 1994 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_help="$ac_help
- --with-ccopts=CCOPTS select compiler command line options"
-ac_help="$ac_help
- --with-cc=COMPILER select compiler to use"
-ac_help="$ac_help
- --with-cppopts=CPPOPTS select compiler preprocessor command line options"
-
-# 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
-
-# Initialize some other variables.
-subdirs=
-
-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
-
- -build | --build | --buil | --bui | --bu | --b)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
- 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" ;;
-
- -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=PREFIX install architecture-dependent files in PREFIX
- [same as prefix]
- --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
-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
---enable and --with options recognized:$ac_help
-EOF
- exit 0 ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host="$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 ;;
-
- -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 ;;
-
- -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" ;;
-
- -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.1"
- 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 $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 unused; standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 unused; some systems may open it to /dev/tty
-# 4 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 4>/dev/null
-else
- exec 4>&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 LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; 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=error_table.y
-
-# 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} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5'
-ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5'
-
-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
-
-
-
-# Check whether --with-ccopts or --without-ccopts was given.
-withval="$with_ccopts"
-if test -n "$withval"; then
- echo "$ac_t""CCOPTS is $withval" 1>&4
-CCOPTS=$withval
-CFLAGS="$CFLAGS $withval"
-else
- CCOPTS=
-fi
-
-
-
-# Check whether --with-cc or --without-cc was given.
-withval="$with_cc"
-if test -n "$withval"; then
- echo "$ac_t""CC=$withval" 1>&4
-CC=$withval
-else
- if test -z "$CC" ; then CC=cc; fi
-echo "$ac_t""CC defaults to $CC" 1>&4
-fi
-
-# Check whether --with-cppopts or --without-cppopts was given.
-withval="$with_cppopts"
-if test -n "$withval"; then
- echo "$ac_t""CPPOPTS=$withval" 1>&4
-CPPOPTS=$withval
-CPPFLAGS="$CPPFLAGS $withval"
-else
- echo "$ac_t""CPPOPTS defaults to $CPPOPTS" 1>&4
-fi
-
-ac_config_fragdir=
-for ac_dir in . .. ../.. ../../.. ../../../.. ../../../../.. ../../../../../..; do
- if test -d $srcdir/$ac_dir/config; then
- ac_reltopdir=$ac_dir
- ac_topdir=$srcdir/$ac_reltopdir
- ac_config_fragdir=$ac_reltopdir/config
- break
- fi
-done
-if test -z "$ac_config_fragdir"; then
- { echo "configure: error: can not find config/ directory in . .. ../.. ../../.. ../../../.. ../../../../.. ../../../../../.." 1>&2; exit 1; }
-else
- ac_aux_dir=
-for ac_dir in $ac_config_fragdir $srcdir/$ac_config_fragdir; 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 $ac_config_fragdir $srcdir/$ac_config_fragdir" 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.
-
-fi
- ac_tmpin="$srcdir/${ac_config_fragdir}/pre.in"
- if test -r $ac_tmpin; then
- ac_prepend=$ac_config_fragdir/pre.in
- else
- ac_prepend=
- fi
- ac_tmpin="$srcdir/${ac_config_fragdir}/post.in"
- if test -r $ac_tmpin; then
- ac_postpend=$ac_config_fragdir/post.in
- else
- ac_postpend=
- fi
-BUILDTOP=$ac_reltopdir
-
-echo $ac_n "checking for working const""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 492 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero;
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
-
-; return 0; }
-EOF
-if eval $ac_compile; then
- rm -rf conftest*
- ac_cv_c_const=yes
-else
- rm -rf conftest*
- ac_cv_c_const=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$ac_cv_c_const" 1>&4
-if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
-
-fi
-
-# Extract the first word of "flex", so it can be a program name with args.
-set dummy flex; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_LEX'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- if test -n "$LEX"; then
- ac_cv_prog_LEX="$LEX" # 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_LEX="flex"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
-fi
-fi
-LEX="$ac_cv_prog_LEX"
-if test -n "$LEX"; then
- echo "$ac_t""$LEX" 1>&4
-else
- echo "$ac_t""no" 1>&4
-fi
-if test -z "$LEXLIB"
-then
- case "$LEX" in
- flex*) echo $ac_n "checking for -lfl""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_lib_fl'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- ac_save_LIBS="$LIBS"
-LIBS="$LIBS -lfl "
-cat > conftest.$ac_ext <<EOF
-#line 597 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
-main()
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_lib_fl=yes"
-else
- rm -rf conftest*
- eval "ac_cv_lib_fl=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'fl`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- LEXLIB="-lfl"
-else
- echo "$ac_t""no" 1>&4
-fi
- ;;
- *) echo $ac_n "checking for -ll""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_lib_l'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- ac_save_LIBS="$LIBS"
-LIBS="$LIBS -ll "
-cat > conftest.$ac_ext <<EOF
-#line 630 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
-main()
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_lib_l=yes"
-else
- rm -rf conftest*
- eval "ac_cv_lib_l=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'l`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- LEXLIB="-ll"
-else
- echo "$ac_t""no" 1>&4
-fi
- ;;
- esac
-fi
-echo "$ac_t""setting LEXLIB to $LEXLIB" 1>&4
-
-for ac_prog in 'bison -y' byacc
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_YACC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- if test -n "$YACC"; then
- ac_cv_prog_YACC="$YACC" # 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_YACC="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-YACC="$ac_cv_prog_YACC"
-if test -n "$YACC"; then
- echo "$ac_t""$YACC" 1>&4
-else
- echo "$ac_t""no" 1>&4
-fi
-
-test -n "$YACC" && break
-done
-test -n "$YACC" || YACC="yacc"
-
-for ac_prog in mawk gawk nawk awk
-do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_AWK'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-AWK="$ac_cv_prog_AWK"
-if test -n "$AWK"; then
- echo "$ac_t""$AWK" 1>&4
-else
- echo "$ac_t""no" 1>&4
-fi
-
-test -n "$AWK" && break
-done
-
-# Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_ARCHIVE'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- if test -n "$ARCHIVE"; then
- ac_cv_prog_ARCHIVE="$ARCHIVE" # 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_ARCHIVE="ar qv"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_ARCHIVE" && ac_cv_prog_ARCHIVE="false"
-fi
-fi
-ARCHIVE="$ac_cv_prog_ARCHIVE"
-if test -n "$ARCHIVE"; then
- echo "$ac_t""$ARCHIVE" 1>&4
-else
- echo "$ac_t""no" 1>&4
-fi
-
-# 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>&4
-if eval "test \"`echo '${'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-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>&4
-else
- echo "$ac_t""no" 1>&4
-fi
-
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&4
-# 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>&4
-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 <<EOF
-#line 796 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 810 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- :
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- CPP=/lib/cpp
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
-fi
-CPP="$ac_cv_prog_CPP"
-echo "$ac_t""$CPP" 1>&4
-
-echo $ac_n "checking for yylineno declaration""... $ac_c" 1>&4
-if eval "test \"`echo '${'krb5_cv_type_yylineno'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- # some systems have yylineno, others don't...
- echo '%%
-%%' | ${LEX} -t > conftest.out
- if egrep yylineno conftest.out >/dev/null 2>&1; then
- krb5_cv_type_yylineno=yes
- else
- krb5_cv_type_yylineno=no
- fi
- rm -f conftest.out
-fi
-
- echo "$ac_t""$krb5_cv_type_yylineno" 1>&4
- if test $krb5_cv_type_yylineno = no; then
- cat >> confdefs.h <<\EOF
-#define NO_YYLINENO 1
-EOF
-
- fi
-
-
-echo $ac_n "checking for sys_errlist declaration""... $ac_c" 1>&4
-if eval "test \"`echo '${'krb5_cv_decl_errlist'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 862 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-#include <errno.h>
-int main() { return 0; }
-int t() {
-1+sys_nerr;
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- krb5_cv_decl_errlist=yes
-else
- rm -rf conftest*
- krb5_cv_decl_errlist=no
-fi
-rm -f conftest*
-
-fi
-
-echo "$ac_t""$krb5_cv_decl_errlist" 1>&4
-if test $krb5_cv_decl_errlist = no; then
- cat >> confdefs.h <<\EOF
-#define NEED_SYS_ERRLIST 1
-EOF
-
-fi
-
-echo $ac_n "checking for perror declaration""... $ac_c" 1>&4
-if eval "test \"`echo '${'krb5_cv_decl_perror'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 895 "configure"
-#include "confdefs.h"
-#include <errno.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "perror" >/dev/null 2>&1; then
- rm -rf conftest*
- krb5_cv_decl_perror=yes
-else
- rm -rf conftest*
- krb5_cv_decl_perror=no
-fi
-rm -f conftest*
-
-fi
-echo "$ac_t""$krb5_cv_decl_perror" 1>&4
-if test $krb5_cv_decl_perror = yes; then
- cat >> confdefs.h <<\EOF
-#define HDR_HAS_PERROR 1
-EOF
-
-fi
-
-ac_safe=`echo "stdarg.h" | tr './\055' '___'`
-echo $ac_n "checking for stdarg.h""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 924 "configure"
-#include "confdefs.h"
-#include <stdarg.h>
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-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
- 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>&4
- cat >> confdefs.h <<\EOF
-#define STDARG_PROTOTYPES 1
-EOF
-
-else
- echo "$ac_t""no" 1>&4
-fi
-
-for ac_hdr in stdlib.h
-do
-ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 958 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-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
- 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>&4
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
- cat <<EOF | tr '\201-\377' '\001-\177' >> confdefs.h
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&4
-fi
-done
-
-
-
-trap '' 1 2 15
-if test -w $cache_file; then
-echo "updating cache $cache_file"
-cat > $cache_file <<\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
-# Ultrix sh set writes to stderr and can't be redirected directly.
-# Ultrix sh set also returns variables that were read in from the config file
-# with their high bit set.
-(set) 2>&1 | tr '\201-\377' '\001-\177' |
- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
- >> $cache_file
-else
-echo "not updating unwritable cache $cache_file"
-fi
-
-trap 'rm -fr conftest* confdefs* 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
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-cat > conftest.defs <<\EOF
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
-s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
-s%\[%\\&%g
-s%\]%\\&%g
-s%\$%$$%g
-EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
-rm -f conftest.defs
-
-
-# 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 <<EOF
-#!/bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/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.1"
- 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
-
-trap 'rm -f pre.out:$ac_prepend Makefile.out:Makefile.in post.out:$ac_postpend; exit 1' 1 2 15
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g$/%g/' > 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%@CCOPTS@%$CCOPTS%g
-s%@CC@%$CC%g
-s%@CPPOPTS@%$CPPOPTS%g
-s%@BUILDTOP@%$BUILDTOP%g
-s%@LEX@%$LEX%g
-s%@LEXLIB@%$LEXLIB%g
-s%@YACC@%$YACC%g
-s%@AWK@%$AWK%g
-s%@ARCHIVE@%$ARCHIVE%g
-s%@RANLIB@%$RANLIB%g
-s%@CPP@%$CPP%g
-
-CEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"pre.out:$ac_prepend Makefile.out:Makefile.in post.out:$ac_postpend"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[: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 relative srcdir, etc. 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="/$ac_dir"
- # 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
-
- 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
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
-fi; done
-rm -f conftest.subs
-
-EOF
-cat >> $CONFIG_STATUS <<EOF
-cat pre.out Makefile.out post.out > Makefile
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-
-cat >> Makefile <<"SUBDIREOF"
-# [DIVERSION_MAKEFILE] contents
-
-SHELL=/bin/sh
-
-Makefile: $(srcdir)/Makefile.in config.status $(SRCTOP)/config/pre.in $(SRCTOP)/config/post.in
- $(SHELL) config.status
-config.status: $(srcdir)/configure
- $(SHELL) config.status --recheck
-$(srcdir)/configure: $(srcdir)/configure.in $(SRCTOP)/aclocal.m4
- cd $(srcdir); autoconf --localdir=$(BUILDTOP) --macrodir=$(BUILDTOP)/util/autoconf
-
-
-includes:: com_err.h
- @if test -d $(BUILDTOP)/include; then :; else mkdir $(BUILDTOP)/include; fi
- @if cmp $(srcdir)/com_err.h $(BUILDTOP)/include/com_err.h >/dev/null 2>&1; then :; \
- else \
- (set -x; $(RM) $(BUILDTOP)/include/com_err.h; $(CP) $(srcdir)/com_err.h $(BUILDTOP)/include/com_err.h) \
- fi
-
-clean::
- $(RM) $(BUILDTOP)/include/com_err.h
-
-
-SUBDIREOF
-
-exit 0
-EOF
-chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
-
diff --git a/util/et/configure.in b/util/et/configure.in
deleted file mode 100644
index 1e44821..0000000
--- a/util/et/configure.in
+++ /dev/null
@@ -1,26 +0,0 @@
-AC_INIT(error_table.y)
-CONFIG_RULES
-AC_SET_BUILDTOP
-AC_CONST
-AC_PROG_LEX
-AC_PROG_YACC
-AC_PROG_AWK
-AC_PROG_ARCHIVE
-AC_PROG_RANLIB
-HAVE_YYLINENO
-DECLARE_SYS_ERRLIST
-dnl
-dnl Fancy caching of perror result...
-AC_MSG_CHECKING(for perror declaration)
-AC_CACHE_VAL(krb5_cv_decl_perror,
-[AC_HEADER_EGREP(perror, errno.h,
- krb5_cv_decl_perror=yes, krb5_cv_decl_perror=no)])dnl
-AC_MSG_RESULT($krb5_cv_decl_perror)
-if test $krb5_cv_decl_perror = yes; then
- AC_DEFINE(HDR_HAS_PERROR)
-fi
-dnl
-CHECK_STDARG
-AC_HAVE_HEADERS(stdlib.h)
-CopySrcHeader(com_err.h,$(BUILDTOP)/include)
-V5_AC_OUTPUT_MAKEFILE
diff --git a/util/et/error_message.c b/util/et/error_message.c
deleted file mode 100644
index 507e0f1..0000000
--- a/util/et/error_message.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * util/et/error_message.c
- *
- * Copyright 1987 by the Student Information Processing Board
- * of the Massachusetts Institute of Technology
- *
- * For copyright info, see "mit-sipb-copyright.h".
- */
-
-#include <stdio.h>
-#include "error_table.h"
-#include "mit-sipb-copyright.h"
-#include "internal.h"
-
-static const char copyright[] =
- "Copyright 1986, 1987, 1988 by the Student Information Processing Board\nand the department of Information Systems\nof the Massachusetts Institute of Technology";
-
-static char buffer[25];
-
-struct et_list * _et_list = (struct et_list *) NULL;
-
-const char * error_message (code)
-long code;
-{
- int offset;
- struct et_list *et;
- int table_num;
- int started = 0;
- char *cp;
-
- offset = code & ((1<<ERRCODE_RANGE)-1);
- table_num = code - offset;
- if (!table_num) {
- if (offset < sys_nerr)
- return(sys_errlist[offset]);
- else
- goto oops;
- }
- for (et = _et_list; et; et = et->next) {
- if (et->table->base == table_num) {
- /* This is the right table */
- if (et->table->n_msgs <= offset)
- goto oops;
- return(et->table->msgs[offset]);
- }
- }
-oops:
- strcpy (buffer, "Unknown code ");
- if (table_num) {
- strcat (buffer, error_table_name (table_num));
- strcat (buffer, " ");
- }
- for (cp = buffer; *cp; cp++)
- ;
- if (offset >= 100) {
- *cp++ = '0' + offset / 100;
- offset %= 100;
- started++;
- }
- if (started || offset >= 10) {
- *cp++ = '0' + offset / 10;
- offset %= 10;
- }
- *cp++ = '0' + offset;
- *cp = '\0';
- return(buffer);
-}
diff --git a/util/et/error_table.h b/util/et/error_table.h
deleted file mode 100644
index 78f7db2..0000000
--- a/util/et/error_table.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 1988 by the Student Information Processing Board of the
- * Massachusetts Institute of Technology.
- *
- * For copyright info, see mit-sipb-copyright.h.
- */
-
-#ifndef _ET_H
-/* Are we using ANSI C? */
-#ifndef __STDC__
-#define const
-#endif
-extern int errno;
-struct error_table {
- char const * const * msgs;
- long base;
- int n_msgs;
-};
-struct et_list {
- struct et_list *next;
- const struct error_table *table;
-};
-extern struct et_list * _et_list;
-
-#define ERRCODE_RANGE 8 /* # of bits to shift table number */
-#define BITS_PER_CHAR 6 /* # bits to shift per character in name */
-
-extern const char *error_table_name();
-#define _ET_H
-#endif
diff --git a/util/et/error_table.y b/util/et/error_table.y
deleted file mode 100644
index ad4ffb1..0000000
--- a/util/et/error_table.y
+++ /dev/null
@@ -1,230 +0,0 @@
-%{
-#include <stdio.h>
-char *str_concat(), *ds(), *quote();
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-char *current_token = (char *)NULL;
-extern char *table_name;
-%}
-%union {
- char *dynstr;
-}
-
-%token ERROR_TABLE ERROR_CODE_ENTRY END
-%token <dynstr> STRING QUOTED_STRING
-%type <dynstr> ec_name description table_id
-%{
-%}
-%start error_table
-%%
-
-error_table : ERROR_TABLE table_id error_codes END
- { table_name = ds($2);
- current_token = table_name;
- put_ecs(); }
- ;
-
-table_id : STRING
- { current_token = $1;
- set_table_num($1);
- $$ = $1; }
- ;
-
-error_codes : error_codes ec_entry
- | ec_entry
- ;
-
-ec_entry : ERROR_CODE_ENTRY ec_name ',' description
- { add_ec($2, $4);
- free($2);
- free($4); }
- | ERROR_CODE_ENTRY ec_name '=' STRING ',' description
- { add_ec_val($2, $4, $6);
- free($2);
- free($4);
- free($6);
- }
- ;
-
-ec_name : STRING
- { $$ = ds($1);
- current_token = $$; }
- ;
-
-description : QUOTED_STRING
- { $$ = ds($1);
- current_token = $$; }
- ;
-
-%%
-/*
- *
- * Copyright 1986, 1987 by the MIT Student Information Processing Board
- *
- * For copyright info, see mit-sipb-copyright.h.
- */
-
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include "internal.h"
-#include "error_table.h"
-#include "mit-sipb-copyright.h"
-
-
-extern FILE *hfile, *cfile;
-
-static long gensym_n = 0;
-char *
-gensym(x)
- char const *x;
-{
- char *symbol;
- if (!gensym_n) {
- struct timeval tv;
- struct timezone tzp;
- gettimeofday(&tv, &tzp);
- gensym_n = (tv.tv_sec%10000)*100 + tv.tv_usec/10000;
- }
- symbol = malloc(32 * sizeof(char));
- gensym_n++;
- sprintf(symbol, "et%ld", gensym_n);
- return(symbol);
-}
-
-char *
-ds(string)
- char const *string;
-{
- char *rv;
- rv = malloc(strlen(string)+1);
- strcpy(rv, string);
- return(rv);
-}
-
-char *
-quote(string)
- char const *string;
-{
- char *rv;
- rv = malloc(strlen(string)+3);
- strcpy(rv, "\"");
- strcat(rv, string);
- strcat(rv, "\"");
- return(rv);
-}
-
-long table_number;
-int current = 0;
-char **error_codes = (char **)NULL;
-
-add_ec(name, description)
- char const *name, *description;
-{
- fprintf(cfile, "\t\"%s\",\n", description);
- if (error_codes == (char **)NULL) {
- error_codes = (char **)malloc(sizeof(char *));
- *error_codes = (char *)NULL;
- }
- error_codes = (char **)realloc((char *)error_codes,
- (current + 2)*sizeof(char *));
- error_codes[current++] = ds(name);
- error_codes[current] = (char *)NULL;
-}
-
-add_ec_val(name, val, description)
- char const *name, *val, *description;
-{
- const int ncurrent = atoi(val);
- if (ncurrent < current) {
- printf("Error code %s (%d) out of order", name,
- current);
- return;
- }
-
- while (ncurrent > current)
- fputs("\t(char *)NULL,\n", cfile), current++;
-
- fprintf(cfile, "\t\"%s\",\n", description);
- if (error_codes == (char **)NULL) {
- error_codes = (char **)malloc(sizeof(char *));
- *error_codes = (char *)NULL;
- }
- error_codes = (char **)realloc((char *)error_codes,
- (current + 2)*sizeof(char *));
- error_codes[current++] = ds(name);
- error_codes[current] = (char *)NULL;
-}
-
-put_ecs()
-{
- int i;
- for (i = 0; i < current; i++) {
- if (error_codes[i] != (char *)NULL)
- fprintf(hfile, "#define %-40s (%ldL)\n",
- error_codes[i], table_number + i);
- }
-}
-
-/*
- * char_to_num -- maps letters and numbers into a small numbering space
- * uppercase -> 1-26
- * lowercase -> 27-52
- * digits -> 53-62
- * underscore-> 63
- */
-
-static const char char_set[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
-
-int char_to_num(c)
- char c;
-{
- const char *where;
- int diff;
-
- where = strchr (char_set, c);
- if (where) {
- diff = where - char_set + 1;
- assert (diff < (1 << ERRCODE_RANGE));
- return diff;
- }
- else if (isprint (c))
- fprintf (stderr,
- "Illegal character `%c' in error table name\n",
- c);
- else
- fprintf (stderr,
- "Illegal character %03o in error table name\n",
- c);
- exit (1);
-}
-
-set_table_num(string)
- char *string;
-{
- if (char_to_num (string[0]) > char_to_num ('z')) {
- fprintf (stderr, "%s%s%s%s",
- "First character of error table name must be ",
- "a letter; name ``",
- string, "'' rejected\n");
- exit (1);
- }
- if (strlen(string) > 4) {
- fprintf(stderr, "Table name %s too long, truncated ",
- string);
- string[4] = '\0';
- fprintf(stderr, "to %s\n", string);
- }
- while (*string != '\0') {
- table_number = (table_number << BITS_PER_CHAR)
- + char_to_num(*string);
- string++;
- }
- table_number = table_number << ERRCODE_RANGE;
-}
-
-#include "et_lex.lex.c"
diff --git a/util/et/et_c.awk b/util/et/et_c.awk
deleted file mode 100644
index 4f53fc3..0000000
--- a/util/et/et_c.awk
+++ /dev/null
@@ -1,183 +0,0 @@
-BEGIN {
-char_shift=64
-## "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
-c2n["A"]=1
-c2n["B"]=2
-c2n["C"]=3
-c2n["D"]=4
-c2n["E"]=5
-c2n["F"]=6
-c2n["G"]=7
-c2n["H"]=8
-c2n["I"]=9
-c2n["J"]=10
-c2n["K"]=11
-c2n["L"]=12
-c2n["M"]=13
-c2n["N"]=14
-c2n["O"]=15
-c2n["P"]=16
-c2n["Q"]=17
-c2n["R"]=18
-c2n["S"]=19
-c2n["T"]=20
-c2n["U"]=21
-c2n["V"]=22
-c2n["W"]=23
-c2n["X"]=24
-c2n["Y"]=25
-c2n["Z"]=26
-c2n["a"]=27
-c2n["b"]=28
-c2n["c"]=29
-c2n["d"]=30
-c2n["e"]=31
-c2n["f"]=32
-c2n["g"]=33
-c2n["h"]=34
-c2n["i"]=35
-c2n["j"]=36
-c2n["k"]=37
-c2n["l"]=38
-c2n["m"]=39
-c2n["n"]=40
-c2n["o"]=41
-c2n["p"]=42
-c2n["q"]=43
-c2n["r"]=44
-c2n["s"]=45
-c2n["t"]=46
-c2n["u"]=47
-c2n["v"]=48
-c2n["w"]=49
-c2n["x"]=50
-c2n["y"]=51
-c2n["z"]=52
-c2n["0"]=53
-c2n["1"]=54
-c2n["2"]=55
-c2n["3"]=56
-c2n["4"]=57
-c2n["5"]=58
-c2n["6"]=59
-c2n["7"]=60
-c2n["8"]=61
-c2n["9"]=62
-c2n["_"]=63
-}
-/^#/ { next }
-/^[ \t]*(error_table|et)[ \t]+[a-zA-Z][a-zA-Z0-9_]+/ {
- table_number = 0
- table_name = $2
- mod_base = 1000000
- for(i=1; i<=length(table_name); i++) {
- table_number=(table_number*char_shift)+c2n[substr(table_name,i,1)]
- }
-
- # We start playing *_high, *low games here because the some
- # awk programs do not have the necessary precision (sigh)
- tab_base_low = table_number % mod_base
- tab_base_high = int(table_number / mod_base)
- tab_base_sign = 1;
-
- # figure out: table_number_base=table_number*256
- tab_base_low = tab_base_low * 256
- tab_base_high = (tab_base_high * 256) + \
- int(tab_base_low / mod_base)
- tab_base_low = tab_base_low % mod_base
-
- if (table_number > 128*256*256) {
- # figure out: table_number_base -= 256*256*256*256
- # sub_high, sub_low is 256*256*256*256
- sub_low = 256*256*256 % mod_base
- sub_high = int(256*256*256 / mod_base)
-
- sub_low = sub_low * 256
- sub_high = (sub_high * 256) + int(sub_low / mod_base)
- sub_low = sub_low % mod_base
-
- tab_base_low = sub_low - tab_base_low;
- tab_base_high = sub_high - tab_base_high;
- tab_base_sign = -1;
- if (tab_base_low < 0) {
- tab_base_low = tab_base_low + mod_base
- tab_base_high--
- }
- }
- print "/*" > outfile
- print " * " outfile ":" > outfile
- print " * This file is automatically generated; please do not edit it." > outfile
- print " */" > outfile
-
- print "#ifdef __STDC__" > outfile
- print "#define NOARGS void" > outfile
- print "#else" > outfile
- print "#define NOARGS" > outfile
- print "#define const" > outfile
- print "#endif" > outfile
- print "" > outfile
- print "static const char * const text[] = {" > outfile
- table_item_count = 0
-}
-
-/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,[ \t]*$/ {
- skipone=1
- next
-}
-
-/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,[ \t]*".*"[ \t]*$/ {
- text=""
- for (i=3; i<=NF; i++) {
- text = text FS $i
- }
- text=substr(text,2,length(text)-1);
- printf "\t%s,\n", text > outfile
- table_item_count++
-}
-
-{
- if (skipone) {
- printf "\t%s,\n", $0 > outfile
- table_item_count++
- }
- skipone=0
-}
-END {
-
-
- print " 0" > outfile
- print "};" > outfile
- print "" > outfile
- print "struct error_table {" > outfile
- print " char const * const * msgs;" > outfile
- print " long base;" > outfile
- print " int n_msgs;" > outfile
- print "};" > outfile
- print "struct et_list {" > outfile
- print " struct et_list *next;" > outfile
- print " const struct error_table * table;" > outfile
- print "};" > outfile
- print "extern struct et_list *_et_list;" > outfile
- print "" > outfile
- if (tab_base_high == 0) {
- print "static const struct error_table et = { text, " \
- sprintf("%dL, %d };", tab_base_sign*tab_base_low, \
- table_item_count) > outfile
- } else {
- print "static const struct error_table et = { text, " \
- sprintf("%d%06dL, %d };", tab_base_sign*tab_base_high, \
- tab_base_low, table_item_count) > outfile
- }
- print "" > outfile
- print "static struct et_list link = { 0, 0 };" > outfile
- print "" > outfile
- print "void initialize_" table_name "_error_table (NOARGS) {" > outfile
- print " if (!link.table) {" > outfile
- print " link.next = _et_list;" > outfile
- print " link.table = &et;" > outfile
- print " _et_list = &link;" > outfile
- print " }" > outfile
- print "}" > outfile
-
-
-}
diff --git a/util/et/et_h.awk b/util/et/et_h.awk
deleted file mode 100644
index 5851dd8..0000000
--- a/util/et/et_h.awk
+++ /dev/null
@@ -1,150 +0,0 @@
-BEGIN {
-char_shift=64
-## "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
-c2n["A"]=1
-c2n["B"]=2
-c2n["C"]=3
-c2n["D"]=4
-c2n["E"]=5
-c2n["F"]=6
-c2n["G"]=7
-c2n["H"]=8
-c2n["I"]=9
-c2n["J"]=10
-c2n["K"]=11
-c2n["L"]=12
-c2n["M"]=13
-c2n["N"]=14
-c2n["O"]=15
-c2n["P"]=16
-c2n["Q"]=17
-c2n["R"]=18
-c2n["S"]=19
-c2n["T"]=20
-c2n["U"]=21
-c2n["V"]=22
-c2n["W"]=23
-c2n["X"]=24
-c2n["Y"]=25
-c2n["Z"]=26
-c2n["a"]=27
-c2n["b"]=28
-c2n["c"]=29
-c2n["d"]=30
-c2n["e"]=31
-c2n["f"]=32
-c2n["g"]=33
-c2n["h"]=34
-c2n["i"]=35
-c2n["j"]=36
-c2n["k"]=37
-c2n["l"]=38
-c2n["m"]=39
-c2n["n"]=40
-c2n["o"]=41
-c2n["p"]=42
-c2n["q"]=43
-c2n["r"]=44
-c2n["s"]=45
-c2n["t"]=46
-c2n["u"]=47
-c2n["v"]=48
-c2n["w"]=49
-c2n["x"]=50
-c2n["y"]=51
-c2n["z"]=52
-c2n["0"]=53
-c2n["1"]=54
-c2n["2"]=55
-c2n["3"]=56
-c2n["4"]=57
-c2n["5"]=58
-c2n["6"]=59
-c2n["7"]=60
-c2n["8"]=61
-c2n["9"]=62
-c2n["_"]=63
-}
-/^#/ { next }
-/^[ \t]*(error_table|et)[ \t]+[a-zA-Z][a-zA-Z0-9_]+/ {
- table_number = 0
- table_name = $2
- mod_base = 1000000
- for(i=1; i<=length(table_name); i++) {
- table_number=(table_number*char_shift)+c2n[substr(table_name,i,1)]
- }
- # We start playing *_high, *low games here because the some
- # awk programs do not have the necessary precision (sigh)
- tab_base_low = table_number % mod_base
- tab_base_high = int(table_number / mod_base)
- tab_base_sign = 1;
-
- # figure out: table_number_base=table_number*256
- tab_base_low = tab_base_low * 256
- tab_base_high = (tab_base_high * 256) + \
- int(tab_base_low / mod_base)
- tab_base_low = tab_base_low % mod_base
-
- if (table_number > 128*256*256) {
- # figure out: table_number_base -= 256*256*256*256
- # sub_high, sub_low is 256*256*256*256
- sub_low = 256*256*256 % mod_base
- sub_high = int(256*256*256 / mod_base)
-
- sub_low = sub_low * 256
- sub_high = (sub_high * 256) + int(sub_low / mod_base)
- sub_low = sub_low % mod_base
-
- tab_base_low = sub_low - tab_base_low;
- tab_base_high = sub_high - tab_base_high;
- tab_base_sign = -1;
- if (tab_base_low < 0) {
- tab_base_low = tab_base_low + mod_base
- tab_base_high--
- }
- }
- curr_low = tab_base_low
- curr_high = tab_base_high
- curr_sign = tab_base_sign
- print "/*" > outfile
- print " * " outfile ":" > outfile
- print " * This file is automatically generated; please do not edit it." > outfile
- print " */" > outfile
-}
-
-/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,/ {
- tag=substr($2,1,length($2)-1)
- if (curr_high == 0) {
- printf "#define %-40s (%dL)\n", tag, \
- curr_sign*curr_low > outfile
- } else {
- printf "#define %-40s (%d%06dL)\n", tag, curr_high*curr_sign, \
- curr_low > outfile
- }
- curr_low += curr_sign;
- if (curr_low >= mod_base) {
- curr_low -= mod_base;
- curr_high++
- }
- if (curr_low < 0) {
- cur_low += mod_base
- cur_high--
- }
-}
-
-END {
- print "extern void initialize_" table_name "_error_table ();" > outfile
- if (tab_base_high == 0) {
- print "#define ERROR_TABLE_BASE_" table_name " (" \
- sprintf("%d", tab_base_sign*tab_base_low) \
- "L)" > outfile
- } else {
- print "#define ERROR_TABLE_BASE_" table_name " (" \
- sprintf("%d%06d", tab_base_sign*tab_base_high, \
- tab_base_low) "L)" > outfile
- }
- print "" > outfile
- print "/* for compatibility with older versions... */" > outfile
- print "#define init_" table_name "_err_tbl initialize_" table_name "_error_table" > outfile
- print "#define " table_name "_err_base ERROR_TABLE_BASE_" table_name > outfile
-}
diff --git a/util/et/et_lex.lex.l b/util/et/et_lex.lex.l
deleted file mode 100644
index b363e8c..0000000
--- a/util/et/et_lex.lex.l
+++ /dev/null
@@ -1,23 +0,0 @@
-PC [^\"]
-AN [A-Z_a-z0-9]
-%%
-
-error_table return ERROR_TABLE;
-et return ERROR_TABLE;
-error_code return ERROR_CODE_ENTRY;
-ec return ERROR_CODE_ENTRY;
-end return END;
-
-[\t\n ] ;
-
-\"{PC}*\" { register char *p; yylval.dynstr = ds(yytext+1);
- if (p=strrchr(yylval.dynstr, '"')) *p='\0';
- return QUOTED_STRING;
- }
-
-{AN}* { yylval.dynstr = ds(yytext); return STRING; }
-
-#.*\n ;
-
-. { return (*yytext); }
-%%
diff --git a/util/et/et_name.c b/util/et/et_name.c
deleted file mode 100644
index 044302b..0000000
--- a/util/et/et_name.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 1987 by MIT Student Information Processing Board
- *
- * For copyright info, see mit-sipb-copyright.h.
- */
-
-#include "error_table.h"
-#include "mit-sipb-copyright.h"
-#include "internal.h"
-
-#ifndef lint
-static const char copyright[] =
- "Copyright 1987,1988 by Student Information Processing Board, Massachusetts Institute of Technology";
-#endif
-
-static const char char_set[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
-
-static char buf[6];
-
-const char * error_table_name(num)
- int num;
-{
- int ch;
- int i;
- char *p;
-
- /* num = aa aaa abb bbb bcc ccc cdd ddd d?? ??? ??? */
- p = buf;
- num >>= ERRCODE_RANGE;
- /* num = ?? ??? ??? aaa aaa bbb bbb ccc ccc ddd ddd */
- num &= 077777777;
- /* num = 00 000 000 aaa aaa bbb bbb ccc ccc ddd ddd */
- for (i = 4; i >= 0; i--) {
- ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1);
- if (ch != 0)
- *p++ = char_set[ch-1];
- }
- *p = '\0';
- return(buf);
-}
diff --git a/util/et/init_et.c b/util/et/init_et.c
deleted file mode 100644
index f52faca..0000000
--- a/util/et/init_et.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * util/et/init_et.c
- *
- * Copyright 1986, 1987, 1988 by MIT Information Systems and
- * the MIT Student Information Processing Board.
- *
- * For copyright info, see mit-sipb-copyright.h.
- */
-
-#include <stdio.h>
-#include "error_table.h"
-#include "mit-sipb-copyright.h"
-
-extern char *malloc(), *realloc();
-
-struct foobar {
- struct et_list etl;
- struct error_table et;
-};
-
-extern struct et_list * _et_list;
-
-int init_error_table(msgs, base, count)
- const char * const * msgs;
- int base;
- int count;
-{
- struct foobar * new_et;
-
- if (!base || !count || !msgs)
- return 0;
-
- new_et = (struct foobar *) malloc(sizeof(struct foobar));
- if (!new_et)
- return errno; /* oops */
- new_et->etl.table = &new_et->et;
- new_et->et.msgs = msgs;
- new_et->et.base = base;
- new_et->et.n_msgs= count;
-
- new_et->etl.next = _et_list;
- _et_list = &new_et->etl;
- return 0;
-}
diff --git a/util/et/internal.h b/util/et/internal.h
deleted file mode 100644
index a101f26..0000000
--- a/util/et/internal.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * internal include file for com_err package
- */
-#include "mit-sipb-copyright.h"
-
-#include <errno.h>
-
-#ifdef NEED_SYS_ERRLIST
-extern char const * const sys_errlist[];
-extern const int sys_nerr;
-#endif
-
-#if defined(__STDC__) && !defined(HDR_HAS_PERROR)
-void perror (const char *);
-#endif
diff --git a/util/et/mit-sipb-copyright.h b/util/et/mit-sipb-copyright.h
deleted file mode 100644
index 2f7eb29..0000000
--- a/util/et/mit-sipb-copyright.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-
-Copyright 1987, 1988 by the Student Information Processing Board
- of the Massachusetts Institute of Technology
-
-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 names of M.I.T. and the M.I.T. S.I.P.B. not be
-used in advertising or publicity pertaining to distribution
-of the software without specific, written prior permission.
-M.I.T. and the M.I.T. S.I.P.B. make no representations about
-the suitability of this software for any purpose. It is
-provided "as is" without express or implied warranty.
-
-*/
-
diff --git a/util/et/test1.et b/util/et/test1.et
deleted file mode 100644
index 4c7b77f..0000000
--- a/util/et/test1.et
+++ /dev/null
@@ -1,69 +0,0 @@
- error_table krb
-
- error_code KRB_MK_AP_TKFIL,
- "Can't read ticket file"
-
- ec KRB_MK_AP_NOTKT,
- "Can't find ticket or TGT"
-
- ec KRB_MK_AP_TGTEXP,
- "TGT expired"
-
- ec KRB_RD_AP_UNDEC,
- "Can't decode authenticator"
-
- ec KRB_RD_AP_EXP,
- "Ticket expired"
-
- ec KRB_RD_AP_REPEAT,
- "Repeated request"
-
- ec KRB_RD_AP_NOT_US,
- "The ticket isn't for us"
-
- ec KRB_RD_AP_INCON,
- "Request is inconsistent"
-
- ec KRB_RD_AP_TIME,
- "Delta-T too big"
-
- ec KRB_RD_AP_BADD,
- "Incorrect net address"
-
- ec KRB_RD_AP_VERSION,
- "Protocol version mismatch"
-
- ec KRB_RD_AP_MSG_TYPE,
- "Invalid message type"
-
- ec KRB_RD_AP_MODIFIED,
- "Message stream modified"
-
- ec KRB_RD_AP_ORDER,
- "Message out of order"
-
- ec KRB_RD_AP_UNAUTHOR,
- "Unauthorized request"
-
- ec KRB_GT_PW_NULL,
- "Current password is null"
-
- ec KRB_GT_PW_BADPW,
- "Incorrect current password"
-
- ec KRB_GT_PW_PROT,
- "Protocol error"
-
- ec KRB_GT_PW_KDCERR,
- "Error returned by KDC"
-
- ec KRB_GT_PW_NULLTKT,
- "Null ticket returned by KDC"
-
- ec KRB_SKDC_RETRY,
- "Retry count exceeded"
-
- ec KRB_SKDC_CANT,
- "Can't send request"
-
- end
diff --git a/util/et/test2.et b/util/et/test2.et
deleted file mode 100644
index 55ad74e..0000000
--- a/util/et/test2.et
+++ /dev/null
@@ -1,9 +0,0 @@
- error_table quux
-
- ec FOO_ERR, "foo"
-
- ec BAR_ERR, "bar"
-
- ec BAZ_ERR, "meow"
-
- end
diff --git a/util/et/test_et.c b/util/et/test_et.c
deleted file mode 100644
index 955cb96..0000000
--- a/util/et/test_et.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <stdio.h>
-#include <errno.h>
-#include "com_err.h"
-#include "test1.h"
-#include "test2.h"
-
-extern int sys_nerr, errno;
-
-main()
-{
- printf("Before initiating error table:\n\n");
- printf("Table name '%s'\n", error_table_name(KRB_MK_AP_TGTEXP));
- printf("UNIX name '%s'\n", error_table_name(EPERM));
- printf("Msg TGT-expired is '%s'\n", error_message(KRB_MK_AP_TGTEXP));
- printf("Msg EPERM is '%s'\n", error_message(EPERM));
- printf("Msg FOO_ERR is '%s'\n", error_message(FOO_ERR));
- printf("Msg {sys_nerr-1} is '%s'\n", error_message(sys_nerr-1));
- printf("Msg {sys_nerr} is '%s'\n", error_message(sys_nerr));
-
- printf("With 0: tgt-expired -> %s\n", error_message(KRB_MK_AP_TGTEXP));
-
- initialize_krb_error_table();
- printf("KRB error table initialized: base %d (%s), name %s\n",
- ERROR_TABLE_BASE_krb, error_message(ERROR_TABLE_BASE_krb),
- error_table_name(ERROR_TABLE_BASE_krb));
- initialize_krb_error_table();
- printf("With krb: tgt-expired -> %s\n",
- error_message(KRB_MK_AP_TGTEXP));
-
- initialize_quux_error_table();
- printf("QUUX error table initialized: base %d (%s), name %s\n",
- ERROR_TABLE_BASE_quux, error_message(ERROR_TABLE_BASE_quux),
- error_table_name(ERROR_TABLE_BASE_quux));
-
- printf("Msg for TGT-expired is '%s'\n",
- error_message(KRB_MK_AP_TGTEXP));
- printf("Msg {sys_nerr-1} is '%s'\n", error_message(sys_nerr-1));
- printf("Msg FOO_ERR is '%s'\n", error_message(FOO_ERR));
- printf("Msg KRB_SKDC_CANT is '%s'\n",
- error_message(KRB_SKDC_CANT));
- printf("Msg 1e6 (8B 64) is '%s'\n", error_message(1000000));
- printf("\n\nCOM_ERR tests:\n");
- com_err("whoami", FOO_ERR, (char *)NULL);
- com_err("whoami", FOO_ERR, " -- message goes %s", "here");
- com_err("whoami", 0, (char *)0);
- com_err("whoami", 0, "error number %d\n", 0);
-}
diff --git a/util/et/texinfo.tex b/util/et/texinfo.tex
deleted file mode 100644
index 838160c..0000000
--- a/util/et/texinfo.tex
+++ /dev/null
@@ -1,2077 +0,0 @@
-%% TeX macros to handle texinfo files
-
-% Copyright (C) 1985, 1986, 1988 Richard M. Stallman
-
-% NO WARRANTY
-
-% BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
-%NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
-%WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
-%RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
-%WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
-%BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-%FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
-%AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
-%DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
-%CORRECTION.
-
-% IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
-%STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
-%WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
-%LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
-%OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-%USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
-%DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
-%A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
-%PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
-%DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
-
-% GENERAL PUBLIC LICENSE TO COPY
-
-% 1. You may copy and distribute verbatim copies of this source file
-%as you receive it, in any medium, provided that you conspicuously
-%and appropriately publish on each copy a valid copyright notice
-%"Copyright (C) 1986 Richard M. Stallman"; and include
-%following the copyright notice a verbatim copy of the above disclaimer
-%of warranty and of this License.
-
-% 2. You may modify your copy or copies of this source file or
-%any portion of it, and copy and distribute such modifications under
-%the terms of Paragraph 1 above, provided that you also do the following:
-
-% a) cause the modified files to carry prominent notices stating
-% that you changed the files and the date of any change; and
-
-% b) cause the whole of any work that you distribute or publish,
-% that in whole or in part contains or is a derivative of this
-% program or any part thereof, to be licensed at no charge to all
-% third parties on terms identical to those contained in this
-% License Agreement (except that you may choose to grant more extensive
-% warranty protection to some or all third parties, at your option).
-
-% c) You may charge a distribution fee for the physical act of
-% transferring a copy, and you may at your option offer warranty
-% protection in exchange for a fee.
-
-%Mere aggregation of another unrelated program with this program (or its
-%derivative) on a volume of a storage or distribution medium does not bring
-%the other program under the scope of these terms.
-
-% 3. You may copy and distribute this program (or a portion or derivative
-%of it, under Paragraph 2) in object code or executable form under the terms
-%of Paragraphs 1 and 2 above provided that you also do one of the following:
-
-% a) accompany it with the complete corresponding machine-readable
-% source code, which must be distributed under the terms of
-% Paragraphs 1 and 2 above; or,
-
-% b) accompany it with a written offer, valid for at least three
-% years, to give any third party free (except for a nominal
-% shipping charge) a complete machine-readable copy of the
-% corresponding source code, to be distributed under the terms of
-% Paragraphs 1 and 2 above; or,
-
-% c) accompany it with the information you received as to where the
-% corresponding source code may be obtained. (This alternative is
-% allowed only for noncommercial distribution and only if you
-% received the program in object code or executable form alone.)
-
-%For an executable file, complete source code means all the source code for
-%all modules it contains; but, as a special exception, it need not include
-%source code for modules which are standard libraries that accompany the
-%operating system on which the executable file runs.
-
-% 4. You may not copy, sublicense, distribute or transfer this program
-%except as expressly provided under this License Agreement. Any attempt
-%otherwise to copy, sublicense, distribute or transfer this program is void and
-%your rights to use the program under this License agreement shall be
-%automatically terminated. However, parties who have received computer
-%software programs from you with this License Agreement will not have
-%their licenses terminated so long as such parties remain in full compliance.
-
-% 5. If you wish to incorporate parts of this program into other free
-%programs whose distribution conditions are different, write to the Free
-%Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not yet
-%worked out a simple rule that can be stated here, but we will often permit
-%this. We will be guided by the two goals of preserving the free status of
-%all derivatives of our free software and of promoting the sharing and reuse of
-%software.
-
-%In other words, you are welcome to use, share and improve this program.
-%You are forbidden to forbid anyone else to use, share and improve
-%what you give them. Help stamp out software-hoarding!
-
-\def\texinfoversion{1.18}
-\message{Loading texinfo package [Version \texinfoversion]:}
-\message{}
-
-% Save some parts of plain tex whose names we will redefine.
-
-\let\ptexlbrace=\{
-\let\ptexrbrace=\}
-\let\ptexdot=\.
-\let\ptexstar=\*
-\let\ptexend=\end
-\let\ptexbullet=\bullet
-\let\ptexb=\b
-\let\ptexc=\c
-\let\ptexi=\i
-\let\ptext=\t
-\let\ptexl=\l
-\let\ptexL=\L
-
-\def\tie{\penalty 10000\ } % Save plain tex definition of ~.
-
-\message{Basics,}
-\chardef\other=12
-
-\hyphenation{ap-pen-dix}
-\hyphenation{mini-buf-fer mini-buf-fers}
-\hyphenation{eshell}
-
-% Margin to add to right of even pages, to left of odd pages.
-\newdimen \bindingoffset \bindingoffset=0pt
-\newdimen \normaloffset \normaloffset=\hoffset
-\newdimen\pagewidth \newdimen\pageheight
-\pagewidth=\hsize \pageheight=\vsize
-
-%---------------------Begin change-----------------------
-%
-% Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
-%
-\newdimen\cornerlong \newdimen\cornerthick
-\newdimen \topandbottommargin
-\newdimen \outerhsize \newdimen \outervsize
-\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
-\outerhsize=7in
-\outervsize=9.5in
-\topandbottommargin=.75in
-%
-%---------------------End change-----------------------
-
-% \onepageout takes a vbox as an argument. Note that \pagecontents
-% does insertions itself, but you have to call it yourself.
-\chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
-\def\onepageout#1{\hoffset=\normaloffset
-\ifodd\pageno \advance\hoffset by \bindingoffset
-\else \advance\hoffset by -\bindingoffset\fi
-\shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
- {\let\hsize=\pagewidth \makefootline}}
-\advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
-
-
-% Here is a modification of the main output routine for Near East Publications
-% This provides right-angle cropmarks at all four corners.
-% The contents of the page are centerlined into the cropmarks,
-% and any desired binding offset is added as an \hskip on either
-% site of the centerlined box. (P. A. MacKay, 12 November, 1986)
-%
-\def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
- \shipout
- \vbox to \outervsize{\hsize=\outerhsize
- \vbox{\line{\ewtop\hfill\ewtop}}
- \nointerlineskip
- \line{\vbox{\moveleft\cornerthick\nstop}
- \hfill
- \vbox{\moveright\cornerthick\nstop}}
- \vskip \topandbottommargin
- \centerline{\ifodd\pageno\hskip\bindingoffset\fi
- \vbox{
- {\let\hsize=\pagewidth \makeheadline}
- \pagebody{#1}
- {\let\hsize=\pagewidth \makefootline}}
- \ifodd\pageno\else\hskip\bindingoffset\fi}
- \vskip \topandbottommargin plus1fill minus1fill
- \boxmaxdepth\cornerthick
- \line{\vbox{\moveleft\cornerthick\nsbot}
- \hfill
- \vbox{\moveright\cornerthick\nsbot}}
- \nointerlineskip
- \vbox{\line{\ewbot\hfill\ewbot}}
- }
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
-%
-% Do @cropmarks to get crop marks
-\def\cropmarks{\let\onepageout=\croppageout }
-
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
-{\catcode`\@ =11
-\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
-\dimen@=\dp#1 \unvbox#1
-\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
-\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
-}
-
-%
-% Here are the rules for the cropmarks. Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
-% Parse an argument, then pass it to #1.
-% The argument can be delimited with [...] or with "..." or braces
-% or it can be a whole line.
-% #1 should be a macro which expects
-% an ordinary undelimited TeX argument.
-
-\def\parsearg #1{\let\next=#1\begingroup\obeylines\futurelet\temp\parseargx}
-
-\def\parseargx{%
-\ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
-\aftergroup \parseargline %
-\fi \endgroup}
-
-{\obeyspaces %
-\gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
-
-\gdef\obeyedspace{\ }
-
-\def\parseargline{\begingroup \obeylines \parsearglinex}
-{\obeylines %
-\gdef\parsearglinex #1^^M{\endgroup \next {#1}}}
-
-\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-
-%% These are used to keep @begin/@end levels from running away
-%% Call \inENV within environments (after a \begingroup)
-\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
-\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment. Type Return to continue.}
-\endgroup\fi} % This is not perfect, but it should reduce lossage
-
-% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Type <Return> to continue}
-
-\outer\def\begin{\parsearg\beginxxx}
-
-\def\beginxxx #1{%
-\expandafter\ifx\csname #1\endcsname\relax
-{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
-\csname #1\endcsname\fi}
-
-%% @end foo executes the definition of \Efoo.
-%% foo can be delimited by doublequotes or brackets.
-
-\def\end{\parsearg\endxxx}
-
-\def\endxxx #1{%
-\expandafter\ifx\csname E#1\endcsname\relax
-\expandafter\ifx\csname #1\endcsname\relax
-\errmessage{Undefined command @end #1}\else
-\errorE{#1}\fi\fi
-\csname E#1\endcsname}
-\def\errorE#1{
-{\errhelp=\EMsimple \errmessage{@end #1 not within #1 environment}}}
-
-% Single-spacing is done by various environments.
-
-\newskip\singlespaceskip \singlespaceskip = \baselineskip
-\def\singlespace{%
-{\advance \baselineskip by -\singlespaceskip
-\kern \baselineskip}%
-\baselineskip=\singlespaceskip
-}
-
-%% Simple single-character @ commands
-
-% @@ prints an @
-% Kludge this until the fonts are right (grr).
-\def\@{{\sf \char '100}}
-
-% Define @` and @' to be the same as ` and '
-% but suppressing ligatures.
-\def\`{{`}}
-\def\'{{'}}
-
-% Used to generate quoted braces.
-
-\def\mylbrace {{\tt \char '173}}
-\def\myrbrace {{\tt \char '175}}
-\let\{=\mylbrace
-\let\}=\myrbrace
-
-% @: forces normal size whitespace following.
-\def\:{\spacefactor=1000 }
-
-% @* forces a line break.
-\def\*{\hfil\break}
-
-% @. is an end-of-sentence period.
-\def\.{.\spacefactor=3000 }
-
-% @w prevents a word break
-\def\w #1{\hbox{#1}}
-
-% @group ... @end group forces ... to be all on one page.
-
-\def\group{\begingroup% \inENV ???
-\def \Egroup{\egroup\endgroup}
-\vbox\bgroup}
-
-% @br forces paragraph break
-
-\let\br = \par
-
-% @dots{} output some dots
-
-\def\dots{$\ldots$}
-
-% @page forces the start of a new page
-
-\def\page{\par\vfill\supereject}
-
-% @exdent text....
-% outputs text on separate line in roman font, starting at standard page margin
-
-\def\exdent{\errmessage{@exdent in filled text}}
- % @lisp, etc, define \exdent locally from \internalexdent
-
-{\obeyspaces
-\gdef\internalexdent{\parsearg\exdentzzz}}
-
-\def\exdentzzz #1{{\advance \leftskip by -\lispnarrowing
-\advance \hsize by -\leftskip
-\advance \hsize by -\rightskip
-\leftline{{\rm#1}}}}
-
-% @include file insert text of that file as input.
-
-\def\include{\parsearg\includezzz}
-\def\includezzz #1{{\def\thisfile{#1}\input #1
-}}
-
-\def\thisfile{}
-
-% @center line outputs that line, centered
-
-\def\center{\parsearg\centerzzz}
-\def\centerzzz #1{{\advance\hsize by -\leftskip
-\advance\hsize by -\rightskip
-\centerline{#1}}}
-
-% @sp n outputs n lines of vertical space
-
-\def\sp{\parsearg\spxxx}
-\def\spxxx #1{\par \vskip #1\baselineskip}
-
-% @comment ...line which is ignored...
-% @c is the same as @comment
-% @ignore ... @end ignore is another way to write a comment
-
-\def\comment{\parsearg \commentxxx}
-
-\def\commentxxx #1{}
-
-\let\c=\comment
-
-\long\def\ignore #1\end ignore{}
-
-\outer\def\ifset{\parsearg\ifsetxxx}
-
-\def\ifsetxxx #1#2\end ifset{%
-\expandafter\ifx\csname IF#1\endcsname\relax \else #2\fi}
-
-\outer\def\ifclear{\parsearg\ifclearxxx}
-
-\def\ifclearxxx #1#2\end ifclear{%
-\expandafter\ifx\csname IF#1\endcsname\relax #2\fi}
-
-% Some texinfo constructs that are trivial in tex
-
-\def\iftex{}
-\def\Eiftex{}
-\long\def\ifinfo #1\end ifinfo{}
-\long\def\menu #1\end menu{}
-\def\asis#1{#1}
-
-\def\node{\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
-\let\lastnode=\relax
-
-\def\donoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\setref{\lastnode}\fi
-\let\lastnode=\relax}
-
-\def\unnumbnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
-\let\lastnode=\relax}
-
-\let\refill=\relax
-
-\let\setfilename=\comment
-
-\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}}, node `\losespace#1{}'}
-\def\losespace #1{#1}
-
-\message{fonts,}
-
-% Font-change commands.
-
-%% Try out Computer Modern fonts at \magstephalf
-\font\tenrm=cmr10 scaled \magstephalf
-\font\tentt=cmtt10 scaled \magstephalf
-% Instead of cmb10, you many want to use cmbx10.
-% cmbx10 is a prettier font on its own, but cmb10
-% looks better when embedded in a line with cmr10.
-\font\tenbf=cmb10 scaled \magstephalf
-\font\tenit=cmti10 scaled \magstephalf
-\font\tensl=cmsl10 scaled \magstephalf
-\font\tensf=cmss10 scaled \magstephalf
-\def\li{\sf}
-\font\tensc=cmcsc10 scaled \magstephalf
-
-% Fonts for @defun, etc.
-\font\defbf=cmbx10 scaled \magstep1 %was 1314
-\let\deftt=\tentt
-\def\df{\let\tt=\deftt \defbf}
-
-% Font for title
-\font\titlerm = cmbx10 scaled \magstep5
-
-% Fonts for indices
-\font\indit=cmti9 \font\indrm=cmr9
-\def\indbf{\indrm} \def\indsl{\indit}
-\def\indexfonts{\let\it=\indit \let\sl=\indsl \let\bf=\indbf \let\rm=\indrm}
-
-% Fonts for headings
-\font\chaprm=cmbx10 scaled \magstep3
-\font\chapit=cmti10 scaled \magstep3
-\font\chapsl=cmsl10 scaled \magstep3
-\font\chaptt=cmtt10 scaled \magstep3
-\font\chapsf=cmss10 scaled \magstep3
-\let\chapbf=\chaprm
-
-\font\secrm=cmbx10 scaled \magstep2
-\font\secit=cmti10 scaled \magstep2
-\font\secsl=cmsl10 scaled \magstep2
-\font\sectt=cmtt10 scaled \magstep2
-\font\secsf=cmss10 scaled \magstep2
-\let\secbf=\secrm
-
-\font\ssecrm=cmbx10 scaled \magstep1
-\font\ssecit=cmti10 scaled \magstep1
-\font\ssecsl=cmsl10 scaled \magstep1
-\font\ssectt=cmtt10 scaled \magstep1
-\font\ssecsf=cmss10 scaled \magstep1
-\let\ssecbf=\ssecrm
-
-\def\textfonts{\let\rm=\tenrm\let\it=\tenit\let\sl=\tensl\let\bf=\tenbf%
-\let\sc=\tensc\let\sf=\tensf}
-\def\chapfonts{\let\rm=\chaprm\let\it=\chapit\let\sl=\chapsl\let\bf=\chapbf\let\tt=\chaptt\let\sf=\chapsf}
-\def\secfonts{\let\rm=\secrm\let\it=\secit\let\sl=\secsl\let\bf=\secbf\let\tt=\sectt\let\sf=\secsf}
-\def\subsecfonts{\let\rm=\ssecrm\let\it=\ssecit\let\sl=\ssecsl\let\bf=\ssecbf\let\tt=\ssectt\let\sf=\ssecsf}
-% Count depth in font-changes, for error checks
-\newcount\fontdepth \fontdepth=0
-
-%% Add scribe-like font environments, plus @l for inline lisp (usually sans
-%% serif) and @ii for TeX italic
-
-\def\i#1{{\sl #1}}
-\let\var=\i
-\let\dfn=\i
-\let\emph=\i
-\let\cite=\i
-
-\def\b#1{{\bf #1}}
-\let\strong=\b
-
-\def\t#1{{\tt \rawbackslash \frenchspacing #1}\null}
-\let\ttfont = \t
-\let\kbd=\t
-\let\code=\t
-\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
-\def\key #1{{\tt \uppercase{#1}}\null}
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-\let\file=\samp
-
-\def\l#1{{\li #1}\null}
-
-\def\r#1{{\rm #1}}
-\def\s#1{{\sc #1}}
-\def\ii#1{{\it #1}}
-
-\def\titlefont#1{{\titlerm #1}}
-
-\def\titlepage{\begingroup \parindent=0pt \hbox{}%
-\let\oldpage=\page
-\def\page{\oldpage \hbox{}}}
-
-\def\Etitlepage{\endgroup\page\HEADINGSon}
-
-% Make altmode in file print out right
-
-\catcode `\^^[=\active \def^^[{$\diamondsuit$}
-
-\message{page headings,}
-
-%%% Set up page headings and footings.
-
-\let\thispage=\folio
-
-\newtoks \evenheadline % Token sequence for heading line of even pages
-\newtoks \oddheadline % Token sequence for heading line of odd pages
-\newtoks \evenfootline % Token sequence for footing line of even pages
-\newtoks \oddfootline % Token sequence for footing line of odd pages
-
-% Now make Tex use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}}
-\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}}
-
-% Commands to set those variables.
-% For example, this is what @headings on does
-% @evenheading @thistitle|@thispage|@thischapter
-% @oddheading @thischapter|@thispage|@thistitle
-% @evenfooting @thisfile||
-% @oddfooting ||@thisfile
-
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\everyheading{\parsearg\everyheadingxxx}
-
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\everyfooting{\parsearg\everyfootingxxx}
-
-{\catcode`\@=0 %
-
-\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
-\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
-\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
-\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
-\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
-\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
-\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-%
-}% unbind the catcode of @.
-
-% @headings on turns them on.
-% @headings off turns them off.
-% By default, they are off.
-
-\def\headings #1 {\csname HEADINGS#1\endcsname}
-
-\def\HEADINGSoff{
-\global\evenheadline={\hfil} \global\evenfootline={\hfil}
-\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
-\HEADINGSoff
-% When we turn headings on, set the page number to 1,
-% Put current file name in lower left corner,
-% Put chapter name on inside top of right hand pages, document
-% title on inside top of left hand pages, and page numbers on outside top
-% edge of all pages.
-\def\HEADINGSon{
-\pagealignmacro
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-}
-
-% Subroutines used in generating headings
-% Produces Day Month Year style of output.
-\def\today{\number\day\space
-\ifcase\month\or
-January\or February\or March\or April\or May\or June\or
-July\or August\or September\or October\or November\or December\fi
-\space\number\year}
-
-% Use this if you want the Month Day, Year style of output.
-%\def\today{\ifcase\month\or
-%January\or February\or March\or April\or May\or June\or
-%July\or August\or September\or October\or November\or December\fi
-%\space\number\day, \number\year}
-
-% @settitle line... specifies the title of the document, for headings
-% It generates no output of its own
-
-\def\thistitle{No Title}
-\def\settitle{\parsearg\settitlezzz}
-\def\settitlezzz #1{\gdef\thistitle{#1}}
-
-\message{tables,}
-
-% Tables -- @table, @ftable, @item(x), @kitem(x), @xitem(x).
-
-% default indentation of table text
-\newdimen\tableindent \tableindent=.8in
-% default indentation of @itemize and @enumerate text
-\newdimen\itemindent \itemindent=.3in
-% margin between end of table item and start of table text.
-\newdimen\itemmargin \itemmargin=.1in
-
-% used internally for \itemindent minus \itemmargin
-\newdimen\itemmax
-
-% Note @table and @ftable define @item, @itemx, etc., with these defs.
-% They also define \itemindex
-% to index the item name in whatever manner is desired (perhaps none).
-
-\def\internalBitem{\smallbreak \parsearg\itemzzz}
-\def\internalBitemx{\par \parsearg\itemzzz}
-
-\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
-\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
-
-\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
-\def\internalBkitemx{\par \parsearg\kitemzzz}
-
-\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}\itemzzz {#1}}
-
-\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}\itemzzz {#1}}
-
-\def\itemzzz #1{\begingroup %
-\advance \hsize by -\rightskip %
-\advance \hsize by -\leftskip %
-\setbox0=\hbox{\itemfont{#1}}%
-\itemindex{#1}%
-\parskip=0in %
-\noindent %
-\ifdim \wd0>\itemmax %
-\vadjust{\penalty 10000}%
-\hbox to \hsize{\hskip -\tableindent\box0\hss}\ %
-\else %
-\hbox to 0pt{\hskip -\tableindent\box0\hss}%
-\fi %
-\endgroup %
-}
-
-\def\item{\errmessage{@item while not in a table}}
-\def\itemx{\errmessage{@itemx while not in a table}}
-\def\kitem{\errmessage{@kitem while not in a table}}
-\def\kitemx{\errmessage{@kitemx while not in a table}}
-\def\xitem{\errmessage{@xitem while not in a table}}
-\def\xitemx{\errmessage{@xitemx while not in a table}}
-
-%% Contains a kludge to get @end[description] to work
-\def\description{\tablez{\dontindex}{1}{}{}{}{}}
-
-\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
-{\obeylines\obeyspaces%
-\gdef\tablex #1^^M{%
-\tabley\dontindex#1 \endtabley}}
-
-\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
-{\obeylines\obeyspaces%
-\gdef\ftablex #1^^M{%
-\tabley\fnitemindex#1 \endtabley}}
-
-\def\dontindex #1{}
-\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
-
-{\obeyspaces %
-\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
-\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
-
-\def\tablez #1#2#3#4#5#6{%
-\aboveenvbreak %
-\begingroup %
-\def\Edescription{\Etable}% Neccessary kludge.
-\let\itemindex=#1%
-\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
-\ifnum 0#4>0 \tableindent=#4\mil \fi %
-\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
-\def\itemfont{#2}%
-\itemmax=\tableindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \tableindent %
-\parindent = 0pt
-\parskip = \smallskipamount
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def\Etable{\endgraf\endgroup\afterenvbreak}%
-\let\item = \internalBitem %
-\let\itemx = \internalBitemx %
-\let\kitem = \internalBkitem %
-\let\kitemx = \internalBkitemx %
-\let\xitem = \internalBxitem %
-\let\xitemx = \internalBxitemx %
-}
-
-% This is the counter used by @enumerate, which is really @itemize
-
-\newcount \itemno
-
-\def\itemize{\parsearg\itemizezzz}
-
-\def\itemizezzz #1{\itemizey {#1}{\Eitemize}}
-
-\def\itemizey #1#2{%
-\aboveenvbreak %
-\begingroup %
-\itemno = 0 %
-\itemmax=\itemindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \itemindent %
-\parindent = 0pt
-\parskip = \smallskipamount
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def#2{\endgraf\endgroup\afterenvbreak}%
-\def\itemcontents{#1}%
-\let\item=\itemizeitem}
-
-\def\bullet{$\ptexbullet$}
-\def\minus{$-$}
-
-\def\enumerate{\itemizey{\the\itemno.}\Eenumerate\flushcr}
-
-% Definition of @item while inside @itemize.
-
-\def\itemizeitem{%
-\advance\itemno by 1
-{\let\par=\endgraf \smallbreak}%
-\ifhmode \errmessage{\in hmode at itemizeitem}\fi
-{\parskip=0in \hskip 0pt
-\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
-\vadjust{\penalty 300}}%
-\flushcr}
-
-\message{indexing,}
-% Index generation facilities
-
-% Define \newwrite to be identical to plain tex's \newwrite
-% except not \outer, so it can be used within \newindex.
-{\catcode`\@=11
-\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
-
-% \newindex {foo} defines an index named foo.
-% It automatically defines \fooindex such that
-% \fooindex ...rest of line... puts an entry in the index foo.
-% It also defines \fooindfile to be the number of the output channel for
-% the file that accumulates this index. The file's extension is foo.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
-
-\def\newindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#1}}
-}
-
-% @defindex foo == \newindex{foo}
-
-\def\defindex{\parsearg\newindex}
-
-% Define @defcodeindex, like @defindex except put all entries in @code.
-
-\def\newcodeindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#1}}
-}
-
-\def\defcodeindex{\parsearg\newcodeindex}
-
-% @synindex foo bar makes index foo feed into index bar.
-% Do this instead of @defindex foo if you don't want it as a separate index.
-\def\synindex #1 #2 {%
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#2}}%
-}
-
-% @syncodeindex foo bar similar, but put all entries made for index foo
-% inside @code.
-\def\syncodeindex #1 #2 {%
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#2}}%
-}
-
-% Define \doindex, the driver for all \fooindex macros.
-% Argument #1 is generated by the calling \fooindex macro,
-% and it is "foo", the name of the index.
-
-% \doindex just uses \parsearg; it calls \doind for the actual work.
-% This is because \doind is more useful to call from other macros.
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-
-\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
-\def\singleindexer #1{\doind{\indexname}{#1}}
-
-% like the previous two, but they put @code around the argument.
-\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
-\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-
-\def\indexdummies{%
-\def\bf{\realbackslash bf }%
-\def\rm{\realbackslash rm }%
-\def\sl{\realbackslash sl }%
-\def\dots{\realbackslash dots }%
-\def\copyright{\realbackslash copyright }%
-}
-
-% \indexnofonts no-ops all font-change commands.
-% This is used when outputting the strings to sort the index by.
-\def\indexdummyfont#1{#1}
-\def\indexnofonts{%
-\let\code=\indexdummyfont
-\let\samp=\indexdummyfont
-\let\kbd=\indexdummyfont
-\let\key=\indexdummyfont
-\let\var=\indexdummyfont
-}
-
-% To define \realbackslash, we must make \ not be an escape.
-% We must first make another character (@) an escape
-% so we do not become unable to do a definition.
-
-{\catcode`\@=0 \catcode`\\=\other
-@gdef@realbackslash{\}}
-
-\let\indexbackslash=0 %overridden during \printindex.
-
-\def\doind #1#2{%
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\count10=\lastpenalty %
-\escapechar=`\\%
-{\let\folio=0% Expand all macros now EXCEPT \folio
-\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
-% so it will be output as is; and it will print as backslash in the indx.
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}}}%
-\temp }%
-\penalty\count10}}
-
-\def\dosubind #1#2#3{%
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\count10=\lastpenalty %
-\escapechar=`\\%
-{\let\folio=0%
-\def\rawbackslashxx{\indexbackslash}%
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2 #3}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
-\temp }%
-\penalty\count10}}
-
-% The index entry written in the file actually looks like
-% \entry {sortstring}{page}{topic}
-% or
-% \entry {sortstring}{page}{topic}{subtopic}
-% The texindex program reads in these files and writes files
-% containing these kinds of lines:
-% \initial {c}
-% before the first topic whose initial is c
-% \entry {topic}{pagelist}
-% for a topic that is used without subtopics
-% \primary {topic}
-% for the beginning of a topic that is used with subtopics
-% \secondary {subtopic}{pagelist}
-% for each subtopic.
-
-% Define the user-accessible indexing commands
-% @findex, @vindex, @kindex, @cindex.
-
-\def\findex {\fnindex}
-\def\kindex {\kyindex}
-\def\cindex {\cpindex}
-\def\vindex {\vrindex}
-\def\tindex {\tpindex}
-\def\pindex {\pgindex}
-
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
-% Define the macros used in formatting output of the sorted index material.
-
-% This is what you call to cause a particular index to get printed.
-% Write
-% @unnumbered Function Index
-% @printindex fn
-
-\def\printindex{\parsearg\doprintindex}
-
-\def\doprintindex#1{\tex %
-\catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
-\catcode`\$=\other\catcode`\_=\other
-\catcode`\~=\other
-\def\indexbackslash{\rawbackslashxx}
-\indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
-\begindoublecolumns
-\openin 1 \jobname.#1s
-\ifeof 1 \else \closein 1 \input \jobname.#1s
-\fi
-\enddoublecolumns
-\Etex}
-
-% These macros are used by the sorted index file itself.
-% Change them to control the appearance of the index.
-
-% Same as \bigskipamount except no shrink.
-% \balancecolumns gets confused if there is any shrink.
-\newskip\initialskipamount \initialskipamount 12pt plus4pt
-
-\outer\def\initial #1{%
-{\let\tentt=\sectt \let\sf=\sectt
-\ifdim\lastskip<\initialskipamount
-\removelastskip \penalty-200 \vskip \initialskipamount\fi
-\line{\secbf#1\hfill}\kern 2pt\penalty3000}}
-
-\outer\def\entry #1#2{
-{\parfillskip=0in \parskip=0in \parindent=0in
-\hangindent=1in \hangafter=1%
-\noindent\hbox{#1}\leaders\Dotsbox\hskip 0pt plus 1filll #2\par
-}}
-
-\def\primary #1{\line{#1\hfil}}
-
-\newskip\secondaryindent \secondaryindent=0.5cm
-
-\def\secondary #1#2{
-{\parfillskip=0in \parskip=0in
-\hangindent =1in \hangafter=1
-\noindent\hskip\secondaryindent\hbox{#1}\leaders\Dotsbox\hskip 0pt plus 1filll#2\par
-}}
-
-%% Define two-column mode, which is used in indexes.
-%% Adapted from the TeXBook, page 416
-\catcode `\@=11
-
-\newbox\partialpage
-
-\newdimen\doublecolumnhsize \doublecolumnhsize = 3.11in
-\newdimen\doublecolumnvsize \doublecolumnvsize = 19.1in
-
-\def\begindoublecolumns{\begingroup
- \output={\global\setbox\partialpage=\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}\eject
- \output={\doublecolumnout} \hsize=\doublecolumnhsize \vsize=\doublecolumnvsize}
-\def\enddoublecolumns{\output={\balancecolumns}\eject
- \endgroup \pagegoal=\vsize}
-
-\def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
- \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
- \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
-\def\pagesofar{\unvbox\partialpage %
- \hsize=\doublecolumnhsize % have to restore this since output routine
-% changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
- \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
-\def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen@=\ht0
- \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
- \divide\dimen@ by2 \splittopskip=\topskip
- {\vbadness=10000 \loop \global\setbox3=\copy0
- \global\setbox1=\vsplit3 to\dimen@
- \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
- \setbox0=\vbox to\dimen@{\unvbox1} \setbox2=\vbox to\dimen@{\unvbox3}
- \pagesofar}
-
-\catcode `\@=\other
-\message{sectioning,}
-% Define chapters, sections, etc.
-
-\newcount \chapno
-\newcount \secno
-\newcount \subsecno
-\newcount \subsubsecno
-
-% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount \appendixno \appendixno = `\@
-\def\appendixletter{\char\the\appendixno}
-
-\newwrite \contentsfile
-\openout \contentsfile = \jobname.toc
-
-% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it. @section does likewise
-
-\def\thischapter{} \def\thissection{}
-\def\seccheck#1{\if \pageno<0 %
-\errmessage{@#1 not allowed after generating table of contents}\fi
-%
-}
-
-\outer\def\chapter{\parsearg\chapterzzz}
-\def\chapterzzz #1{\seccheck{chapter}%
-\secno=0 \subsecno=0 \subsubsecno=0 \global\advance \chapno by 1 \message{Chapter \the\chapno}%
-\chapmacro {#1}{\the\chapno}%
-\gdef\thissection{#1}\gdef\thischapter{#1}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-}
-
-\outer\def\appendix{\parsearg\appendixzzz}
-\def\appendixzzz #1{\seccheck{appendix}%
-\secno=0 \subsecno=0 \subsubsecno=0 \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
-\chapmacro {#1}{Appendix \appendixletter}%
-\gdef\thischapter{#1}\gdef\thissection{#1}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash chapentry {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-}
-
-\outer\def\unnumbered{\parsearg\unnumberedzzz}
-\def\unnumberedzzz #1{\seccheck{unnumbered}%
-\secno=0 \subsecno=0 \subsubsecno=0 \message{(#1)}
-\unnumbchapmacro {#1}%
-\gdef\thischapter{#1}\gdef\thissection{#1}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-}
-
-\outer\def\section{\parsearg\sectionzzz}
-\def\sectionzzz #1{\seccheck{section}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash secentry %
-{#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}
-
-\outer\def\appendixsection{\parsearg\appendixsectionzzz}
-\outer\def\appendixsec{\parsearg\appendixsectionzzz}
-\def\appendixsectionzzz #1{\seccheck{appendixsection}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash secentry %
-{#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}
-
-\outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
-\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}
-
-\outer\def\subsection{\parsearg\subsectionzzz}
-\def\subsectionzzz #1{\seccheck{subsection}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash subsecentry %
-{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}
-
-\outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
-\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash subsecentry %
-{#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}
-
-\outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
-\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}
-
-\outer\def\subsubsection{\parsearg\subsubsectionzzz}
-\def\subsubsectionzzz #1{\seccheck{subsubsection}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash subsubsecentry %
-{#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}
-
-\outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
-\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash subsubsecentry{#1}%
-{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}
-
-\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
-\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-\let\rawbackslash=\relax%
-\let\frenchspacing=\relax%
-\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}
-
-% Define @majorheading, @heading and @subheading
-
-\outer\def\majorheading #1{%
-{\advance\chapheadingskip by 10pt \chapbreak }%
-{\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 200}
-
-\outer\def\chapheading #1{\chapbreak %
-{\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 200}
-
-\let\heading=\secheadingi
-\let\subheading=\subsecheadingi
-\let\subsubheading=\subsubsecheadingi
-
-% These macros generate a chapter, section, etc. heading only
-% (including whitespace, linebreaking, etc. around it),
-% given all the information in convenient, parsed form.
-
-%%% Args are the skip and penalty (usually negative)
-\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
-
-%%% Define plain chapter starts, and page on/off switching for it
-% Parameter controlling skip before chapter headings (if needed)
-
-\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
-
-\def\chapbreak{\dobreak \chapheadingskip {-4000}}
-\def\chappager{\par\vfill\supereject}
-\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
-
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-
-\def\CHAPPAGoff{
-\global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
-
-\def\CHAPPAGon{
-\global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager}
-
-\def\CHAPPAGodd{
-\global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage}
-
-\CHAPPAGon
-
-\def\CHAPFplain{
-\global\let\chapmacro=\chfplain
-\global\let\unnumbchapmacro=\unnchfplain}
-
-\def\chfplain #1#2{%
-\pchapsepmacro %
-{\chapfonts \line{\chaprm #2.\enspace #1\hfill}}\bigskip \par\penalty 5000 %
-}
-
-\def\unnchfplain #1{%
-\pchapsepmacro %
-{\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 10000 %
-}
-\CHAPFplain % The default
-
-\def\unnchfopen #1{%
-\chapoddpage {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 10000 %
-}
-
-\def\chfopen #1#2{\chapoddpage {\chapfonts
-\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
-\par\penalty 5000 %
-}
-
-\def\CHAPFopen{
-\global\let\chapmacro=\chfopen
-\global\let\unnumbchapmacro=\unnchfopen}
-
-% Parameter controlling skip before section headings.
-
-\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
-\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
-
-\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt
-\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
-
-\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
-\def\plainsecheading #1{\secheadingi {#1}}
-\def\secheadingi #1{{\advance \secheadingskip by \parskip %
-\secheadingbreak}%
-{\secfonts \line{\secrm #1\hfill}}%
-\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
-
-\def\subsecheading #1#2#3#4{{\advance \subsecheadingskip by \parskip %
-\subsecheadingbreak}%
-{\secfonts \line{\secrm#2.#3.#4\enspace #1\hfill}}%
-\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
-
-\def\subsubsecfonts{\subsecfonts} % Maybe this should change
-
-\def\subsubsecheading #1#2#3#4#5{{\advance \subsecheadingskip by \parskip %
-\subsecheadingbreak}%
-{\secfonts \line{\secrm#2.#3.#4.#5\enspace #1\hfill}}%
-\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
-
-\message{toc printing,}
-
-\def\Dotsbox{\hbox to 1em{\hss.\hss}} % Used by index macros
-
-\def\finishcontents{%
-\ifnum\pageno>0 %
-\pagealignmacro %
-\immediate\closeout \contentsfile%
-\pageno=-1 % Request roman numbered pages
-\fi}
-
-\outer\def\contents{%
-\finishcontents %
-\unnumbchapmacro{Table of Contents}
-\def\thischapter{Table of Contents}
-{\catcode`\\=0
-\catcode`\{=1 % Set up to handle contents files properly
-\catcode`\}=2
-\catcode`\@=11
-\input \jobname.toc
-}
-\vfill \eject}
-
-\outer\def\summarycontents{%
-\finishcontents %
-\unnumbchapmacro{Summary Table of Contents}
-\def\thischapter{Summary Table of Contents}
-{\catcode`\\=0
-\catcode`\{=1 % Set up to handle contents files properly
-\catcode`\}=2
-\catcode`\@=11
-\def\smallbreak{}
-\def\secentry ##1##2##3##4{}
-\def\subsecentry ##1##2##3##4##5{}
-\def\subsubsecentry ##1##2##3##4##5##6{}
-\def\unnumbsecentry ##1##2{}
-\def\unnumbsubsecentry ##1##2{}
-\def\unnumbsubsubsecentry ##1##2{}
-\let\medbreak=\smallbreak
-\input \jobname.toc
-}
-\vfill \eject}
-
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-
-% These macros generate individual entries in the table of contents
-% The first argument is the chapter or section name.
-% The last argument is the page number.
-% The arguments in between are the chapter number, section number, ...
-
-\def\chapentry #1#2#3{%
-\medbreak
-\line{#2.\space#1\leaders\hbox to 1em{\hss.\hss}\hfill #3}
-}
-
-\def\unnumbchapentry #1#2{%
-\medbreak
-\line{#1\leaders\Dotsbox\hfill #2}
-}
-
-\def\secentry #1#2#3#4{%
-\line{\enspace\enspace#2.#3\space#1\leaders\Dotsbox\hfill#4}
-}
-
-\def\unnumbsecentry #1#2{%
-\line{\enspace\enspace#1\leaders\Dotsbox\hfill #2}
-}
-
-\def\subsecentry #1#2#3#4#5{%
-\line{\enspace\enspace\enspace\enspace
-#2.#3.#4\space#1\leaders\Dotsbox\hfill #5}
-}
-
-\def\unnumbsubsecentry #1#2{%
-\line{\enspace\enspace\enspace\enspace#1\leaders\Dotsbox\hfill #2}
-}
-
-\def\subsubsecentry #1#2#3#4#5#6{%
-\line{\enspace\enspace\enspace\enspace\enspace\enspace
-#2.#3.#4.#5\space#1\leaders\Dotsbox\hfill #6}
-}
-
-\def\unnumbsubsubsecentry #1#2{%
-\line{\enspace\enspace\enspace\enspace\enspace\enspace#1\leaders\Dotsbox\hfill #2}
-}
-
-\message{environments,}
-
-% @tex ... @end tex escapes into raw Tex temporarily.
-% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain tex @ character.
-
-\def\tex{\begingroup
-\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
-\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
-\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
-\catcode `\%=14
-\catcode`\"=12
-\catcode`\|=12
-\catcode`\<=12
-\catcode`\>=12
-\escapechar=`\\
-%
-\let\{=\ptexlbrace
-\let\}=\ptexrbrace
-\let\.=\ptexdot
-\let\*=\ptexstar
-\def\@={@}%
-\let\bullet=\ptexbullet
-\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
-\let\L=\ptexL
-%
-\let\Etex=\endgroup}
-
-% Define @lisp ... @endlisp.
-% @lisp does a \begingroup so it can rebind things,
-% including the definition of @endlisp (which normally is erroneous).
-
-% Amount to narrow the margins by for @lisp.
-\newskip\lispnarrowing \lispnarrowing=0.4in
-
-% This is the definition that ^M gets inside @lisp
-% phr: changed space to \null, to avoid overfull hbox problems.
-{\obeyspaces%
-\gdef\lisppar{\null\endgraf}}
-
-% Cause \obeyspaces to make each Space cause a word-separation
-% rather than the default which is that it acts punctuation.
-% This is because space in tt font looks funny.
-{\obeyspaces %
-\gdef\sepspaces{\def {\ }}}
-
-\newskip\aboveenvskipamount \aboveenvskipamount= 0pt
-\def\aboveenvbreak{{\advance\aboveenvskipamount by \parskip
-\endgraf \ifdim\lastskip<\aboveenvskipamount
-\removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}}
-
-\def\afterenvbreak{\endgraf \ifdim\lastskip<\aboveenvskipamount
-\removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}
-
-\def\lisp{\aboveenvbreak\begingroup\inENV %This group ends at the end of the @lisp body
-\hfuzz=12truept % Don't be fussy
-% Make spaces be word-separators rather than space tokens.
-\sepspaces %
-% Single space lines
-\singlespace %
-% The following causes blank lines not to be ignored
-% by adding a space to the end of each line.
-\let\par=\lisppar
-\def\Elisp{\endgroup\afterenvbreak}%
-\parskip=0pt \advance \rightskip by \lispnarrowing
-\advance \leftskip by \lispnarrowing
-\parindent=0pt
-\let\exdent=\internalexdent
-\obeyspaces \obeylines \tt \rawbackslash
-\def\next##1{}\next}
-
-
-\let\example=\lisp
-\def\Eexample{\Elisp}
-
-\let\smallexample=\lisp
-\def\Esmallexample{\Elisp}
-
-% Macro for 9 pt. examples, necessary to print with 5" lines.
-% From Pavel@xerox. This is not really used unless the
-% @smallbook command is given.
-
-\def\smalllispx{\aboveenvbreak\begingroup\inENV
-% This group ends at the end of the @lisp body
-\hfuzz=12truept % Don't be fussy
-% Make spaces be word-separators rather than space tokens.
-\sepspaces %
-% Single space lines
-\singlespace %
-% The following causes blank lines not to be ignored
-% by adding a space to the end of each line.
-\let\par=\lisppar
-\def\Esmalllisp{\endgroup\afterenvbreak}%
-\parskip=0pt \advance \rightskip by \lispnarrowing
-\advance \leftskip by \lispnarrowing
-\parindent=0pt
-\let\exdent=\internalexdent
-\obeyspaces \obeylines \ninett \rawbackslash
-\def\next##1{}\next}
-
-% This is @display; same as @lisp except use roman font.
-
-\def\display{\begingroup\inENV %This group ends at the end of the @display body
-\aboveenvbreak
-% Make spaces be word-separators rather than space tokens.
-\sepspaces %
-% Single space lines
-\singlespace %
-% The following causes blank lines not to be ignored
-% by adding a space to the end of each line.
-\let\par=\lisppar
-\def\Edisplay{\endgroup\afterenvbreak}%
-\parskip=0pt \advance \rightskip by \lispnarrowing
-\advance \leftskip by \lispnarrowing
-\parindent=0pt
-\let\exdent=\internalexdent
-\obeyspaces \obeylines
-\def\next##1{}\next}
-
-% This is @format; same as @lisp except use roman font and don't narrow margins
-
-\def\format{\begingroup\inENV %This group ends at the end of the @format body
-\aboveenvbreak
-% Make spaces be word-separators rather than space tokens.
-\sepspaces %
-\singlespace %
-% The following causes blank lines not to be ignored
-% by adding a space to the end of each line.
-\let\par=\lisppar
-\def\Eformat{\endgroup\afterenvbreak}
-\parskip=0pt \parindent=0pt
-\obeyspaces \obeylines
-\def\next##1{}\next}
-
-% @flushleft and @flushright
-
-\def\flushleft{\begingroup\inENV %This group ends at the end of the @format body
-\aboveenvbreak
-% Make spaces be word-separators rather than space tokens.
-\sepspaces %
-% The following causes blank lines not to be ignored
-% by adding a space to the end of each line.
-% This also causes @ to work when the directive name
-% is terminated by end of line.
-\let\par=\lisppar
-\def\Eflushleft{\endgroup\afterenvbreak}%
-\parskip=0pt \parindent=0pt
-\obeyspaces \obeylines
-\def\next##1{}\next}
-
-\def\flushright{\begingroup\inENV %This group ends at the end of the @format body
-\aboveenvbreak
-% Make spaces be word-separators rather than space tokens.
-\sepspaces %
-% The following causes blank lines not to be ignored
-% by adding a space to the end of each line.
-% This also causes @ to work when the directive name
-% is terminated by end of line.
-\let\par=\lisppar
-\def\Eflushright{\endgroup\afterenvbreak}%
-\parskip=0pt \parindent=0pt
-\advance \leftskip by 0pt plus 1fill
-\obeyspaces \obeylines
-\def\next##1{}\next}
-
-% @quotation - narrow the margins.
-
-\def\quotation{\begingroup\inENV %This group ends at the end of the @quotation body
-{\parskip=0pt % because we will skip by \parskip too, later
-\aboveenvbreak}%
-\singlespace
-\parindent=0pt
-\def\Equotation{\par\endgroup\afterenvbreak}%
-\advance \rightskip by \lispnarrowing
-\advance \leftskip by \lispnarrowing}
-
-\message{defuns,}
-% Define formatter for defuns
-% First, allow user to change definition object font (\df) internally
-\def\setdeffont #1 {\csname DEF#1\endcsname}
-
-\newskip\defbodyindent \defbodyindent=36pt
-\newskip\defargsindent \defargsindent=50pt
-\newskip\deftypemargin \deftypemargin=12pt
-\newskip\deflastargmargin \deflastargmargin=18pt
-
-\newcount\parencount
-% define \functionparens, which makes ( and ) and & do special things.
-% \functionparens affects the group it is contained in.
-\def\activeparens{%
-\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
-\catcode`\[=\active \catcode`\]=\active}
-{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
-\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
-\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
-
-% Definitions of (, ) and & used in args for functions.
-% This is the definition of ( outside of all parentheses.
-\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
-\global\advance\parencount by 1 }
-%
-% This is the definition of ( when already inside a level of parens.
-\gdef\opnested{\char`\(\global\advance\parencount by 1 }
-%
-\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
-% also in that case restore the outer-level definition of (.
-\ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
-\global\advance \parencount by -1 }
-% If we encounter &foo, then turn on ()-hacking afterwards
-\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
-%
-\gdef\normalparens{\boldbrax\let&=\ampnr}
-} % End of definition inside \activeparens
-%% These parens (in \boldbrax) actually are a little bolder than the
-%% contained text. This is especially needed for [ and ]
-\def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
-\def\lbrb{{\tt\char`\[}} \def\rbrb{{\tt\char`\]}}
-
-% First, defname, which formats the header line itself.
-% #1 should be the function name.
-% #2 should be the type of definition, such as "Function".
-
-\def\defname #1#2{%
-\leftskip = 0in %
-\noindent %
-\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
-\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %
-% Now output arg 2 ("Function" or some such)
-% ending at \deftypemargin from the right margin,
-% but stuck inside a box of width 0 so it does not interfere with linebreaking
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}%
-\tolerance=10000 \hbadness=10000 % Make all lines underfull and no complaints
-{\df #1}\enskip % Generate function name
-}
-
-% Actually process the body of a definition
-% #1 should be the terminating control sequence, such as \Edefun.
-% #2 should be the "another name" control sequence, such as \defunx.
-% #3 should be the control sequence that actually processes the header,
-% such as \defunheader.
-
-\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
-\parindent=0in \leftskip=\defbodyindent %
-\begingroup\obeylines\activeparens\spacesplit#3}
-
-\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
-\parindent=0in \leftskip=\defbodyindent %
-\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
-
-% Split up #2 at the first space token.
-% call #1 with two arguments:
-% the first is all of #2 before the space token,
-% the second is all of #2 after that space token.
-% If #2 contains no space token, all of it is passed as the first arg
-% and the second is passed as empty.
-
-{\obeylines
-\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
-\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
-\ifx\relax #3%
-#1{#2}{}\else #1{#2}{#3#4}\fi}}
-
-% So much for the things common to all kinds of definitions.
-
-% Define @defun.
-
-% First, define the processing that is wanted for arguments of \defun
-% Use this to expand the args and terminate the paragraph they make up
-
-\def\defunargs #1{\functionparens \sl #1%
-\ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
-\interlinepenalty=10000
-\endgraf\vskip -\parskip \penalty 10000}
-
-% Do complete processing of one @defun or @defunx line already parsed.
-
-% @deffn Command forward-char nchars
-
-\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
-
-\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup}
-
-% @defun == @deffn Function
-
-\def\defun{\defparsebody\Edefun\defunx\defunheader}
-
-\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Function}%
-\defunargs {#2}\endgroup %
-}
-
-% @defmac == @deffn Macro
-
-\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
-
-\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Macro}%
-\defunargs {#2}\endgroup %
-}
-
-% @defspec == @deffn Special Form
-
-\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
-
-\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Special form}%
-\defunargs {#2}\endgroup %
-}
-
-% This definition is run if you use @defunx
-% anywhere other than immediately after a @defun or @defunx.
-
-\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
-\def\defunx #1 {\errmessage{@defunx in invalid context}}
-\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
-\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
-
-% @defmethod, and so on
-
-% @defop {Funny Method} foo-class frobnicate argument
-
-\def\defop #1 {\def\defoptype{#1}%
-\defmethparsebody\Edefop\defopx\defopheader}
-
-\def\defopheader #1#2#3{\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype{} on #1}%
-\defunargs {#3}\endgroup %
-}
-
-% @defmethod == @defop Method
-
-\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
-
-\def\defmethodheader #1#2#3{\dosubind {fn}{\code{#2}}{on #1}% entry in function index
-\begingroup\defname {#2}{Operation on #1}%
-\defunargs {#3}\endgroup %
-}
-
-% @defcv {Class Option} foo-class foo-flag
-
-\def\defcv #1 {\def\defcvtype{#1}%
-\defmethparsebody\Edefcv\defcvx\defcvheader}
-
-\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype of #1}%
-\defvarargs {#3}\endgroup %
-}
-
-% @defivar == @defcv {Instance Variable}
-
-\def\defivar{\defmethparsebody\Edefivar\defivarx\defivarheader}
-
-\def\defivarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{Instance variable of #1}%
-\defvarargs {#3}\endgroup %
-}
-
-% These definitions are run if you use @defmethodx, etc.,
-% anywhere other than immediately after a @defmethod, etc.
-
-\def\defopx #1 {\errmessage{@defopx in invalid context}}
-\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
-\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
-\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
-
-% Now @defvar
-
-% First, define the processing that is wanted for arguments of @defvar.
-% This is actually simple: just print them in roman.
-% This must expand the args and terminate the paragraph they make up
-\def\defvarargs #1{\normalparens #1%
-\interlinepenalty=10000
-\endgraf\vskip -\parskip \penalty 10000}
-
-% @defvr Counter foo-count
-
-\def\defvr{\defmethparsebody\Edefvr\defvrx\defvrheader}
-
-\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
-
-% @defvar == @defvr Variable
-
-\def\defvar{\defparsebody\Edefvar\defvarx\defvarheader}
-
-\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{Variable}%
-\defvarargs {#2}\endgroup %
-}
-
-% @defopt == @defvr {User Option}
-
-\def\defopt{\defparsebody\Edefopt\defoptx\defoptheader}
-
-\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{User Option}%
-\defvarargs {#2}\endgroup %
-}
-
-% This definition is run if you use @defvarx
-% anywhere other than immediately after a @defvar or @defvarx.
-
-\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
-\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-
-% Now define @deftp
-% Args are printed in bold, a slight difference from @defvar.
-
-\def\deftpargs #1{\bf \defvarargs{#1}}
-
-% @deftp Class window height width ...
-
-\def\deftp{\defmethparsebody\Edeftp\deftpx\deftpheader}
-
-\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
-\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-
-% This definition is run if you use @deftpx, etc
-% anywhere other than immediately after a @deftp, etc.
-
-\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
-
-\message{cross reference,}
-% Define cross-reference macros
-\newwrite \auxfile
-
-% \setref{foo} defines a cross-reference point named foo.
-
-\def\setref#1{%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ysectionnumberandtype}}
-
-\def\unnumbsetref#1{%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ynothing}}
-
-% \xref and \pxref generate cross references to specified points.
-
-\def\pxref #1{see \xrefX [#1,,,,,,,]}
-\def\xref #1{See \xrefX [#1,,,,,,,]}
-\def\xrefX [#1,#2,#3,#4,#5,#6]{%
-\setbox1=\hbox{\i{\losespace#5{}}}%
-\setbox0=\hbox{\losespace#3{}}%
-\ifdim \wd0 =0pt \setbox0=\hbox{\losespace#1{}}\fi%
-\ifdim \wd1 >0pt%
-section \unhbox0{} in \unhbox1%
-\else%
-\refx{#1-snt} [\unhbox0], page\tie \refx{#1-pg}%
-\fi }
-
-% \dosetq is the interface for calls from other macros
-
-\def\dosetq #1#2{{\let\folio=0%
-\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
-\next}}
-
-% \internalsetq {foo}{page} expands into CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
-% When the aux file is read, ' is the escape character
-
-\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
-
-% Things to be expanded by \internalsetq
-
-\def\Ypagenumber{\folio}
-
-\def\Ynothing{}
-
-\def\Ysectionnumberandtype{%
-\ifnum\secno=0 chapter\xreftie\the\chapno %
-\else \ifnum \subsecno=0 section\xreftie\the\chapno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-section\xreftie\the\chapno.\the\secno.\the\subsecno %
-\else %
-section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\gdef\xreftie{'tie}
-
-% Define @refx to reference a specific cross-reference string.
-
-\def\refx#1{%
-{%
-\expandafter\ifx\csname X#1\endcsname\relax
-% If not defined, say something at least.
-\expandafter\gdef\csname X#1\endcsname {$<$undefined$>$}%
-\message {WARNING: Cross-reference "#1" used but not yet defined}%
-\message {}%
-\fi %
-\csname X#1\endcsname %It's defined, so just use it.
-}}
-
-% Read the last existing aux file, if any. No error if none exists.
-
-% This is the macro invoked by entries in the aux file.
-\def\xrdef #1#2{
-{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
-
-{
-\catcode `\^^@=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\^^C=\other
-\catcode `\^^D=\other
-\catcode `\^^E=\other
-\catcode `\^^F=\other
-\catcode `\^^G=\other
-\catcode `\^^H=\other
-\catcode `\ =\other
-\catcode `\^^L=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\=\other
-\catcode `\^^[=\other
-\catcode `\^^\=\other
-\catcode `\^^]=\other
-\catcode `\^^^=\other
-\catcode `\^^_=\other
-\catcode `\@=\other
-\catcode `\^=\other
-\catcode `\~=\other
-\catcode `\[=\other
-\catcode `\]=\other
-\catcode`\"=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode `\$=\other
-\catcode `\#=\other
-\catcode `\&=\other
-
-% the aux file uses ' as the escape.
-% Turn off \ as an escape so we do not lose on
-% entries which were dumped with control sequences in their names.
-% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
-% Reference to such entries still does not work the way one would wish,
-% but at least they do not bomb out when the aux file is read in.
-
-\catcode `\{=1 \catcode `\}=2
-\catcode `\%=\other
-\catcode `\'=0
-\catcode `\\=\other
-
-'openin 1 'jobname.aux
-'ifeof 1 'else 'closein 1 'input 'jobname.aux
-'fi
-}
-
-% Open the new aux file. Tex will close it automatically at exit.
-
-\openout \auxfile=\jobname.aux
-
-% Footnotes.
-
-\newcount \footnoteno
-
-\def\supereject{\par\penalty -20000\footnoteno =0 }
-
-\let\ptexfootnote=\footnote
-
-{\catcode `\@=11
-\gdef\footnote{\global\advance \footnoteno by \@ne
-\edef\thisfootno{$^{\the\footnoteno}$}%
-\let\@sf\empty
-\ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
-\thisfootno\@sf\parsearg\footnotezzz}
-
-\gdef\footnotezzz #1{\insert\footins{
-\interlinepenalty\interfootnotelinepenalty
-\splittopskip\ht\strutbox % top baseline for broken footnotes
-\splitmaxdepth\dp\strutbox \floatingpenalty\@MM
-\leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
-\footstrut\hang\textindent{\thisfootno}#1\strut}}
-
-}%end \catcode `\@=11
-
-% End of control word definitions.
-
-\message{and turning on texinfo input format.}
-
-\newindex{cp}
-\newcodeindex{fn}
-\newcodeindex{vr}
-\newcodeindex{tp}
-\newcodeindex{ky}
-\newcodeindex{pg}
-
-% Set some numeric style parameters, for 8.5 x 11 format.
-
-\hsize = 6.5in
-\parindent 15pt
-\parskip 18pt plus 1pt
-\baselineskip 15pt
-\advance\topskip by 1.2cm
-
-% Prevent underfull vbox error messages.
-\vbadness=10000
-
-% Use @smallbook to reset parameters for 7x9.5 format
-\def\smallbook{
-\global\lispnarrowing = 0.3in
-\global\baselineskip 12pt
-\global\parskip 3pt plus 1pt
-\global\hsize = 5in
-\global\doublecolumnhsize=2.4in \global\doublecolumnvsize=15.0in
-\global\vsize=7.5in
-\global\tolerance=700
-\global\hfuzz=1pt
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-\global\font\ninett=cmtt9
-
-\global\let\smalllisp=\smalllispx
-\global\let\smallexample=\smalllispx
-\global\def\Esmallexample{\Esmalllisp}
-}
-
-%% For a final copy, take out the rectangles
-%% that mark overfull boxes (in case you have decided
-%% that the text looks ok even though it passes the margin).
-\def\finalout{\overfullrule=0pt}
-
-% Turn off all special characters except @
-% (and those which the user can use as if they were ordinary)
-% Define certain chars to be always in tt font.
-
-\catcode`\"=\active
-\def\activedoublequote{{\tt \char '042}}
-\let"=\activedoublequote
-\catcode`\~=\active
-\def~{{\tt \char '176}}
-\chardef\hat=`\^
-\catcode`\^=\active
-\def^{{\tt \hat}}
-\catcode`\_=\active
-\def_{{\tt \char '137}}
-\catcode`\|=\active
-\def|{{\tt \char '174}}
-\chardef \less=`\<
-\catcode`\<=\active
-\def<{{\tt \less}}
-\chardef \gtr=`\>
-\catcode`\>=\active
-\def>{{\tt \gtr}}
-
-\catcode`\@=0
-
-% \rawbackslashxx output one backslash character in current font
-{\catcode`\\=\other
-@gdef@rawbackslashxx{\}}
-
-% \rawbackslash redefines \ as input to do \rawbackslashxx.
-{\catcode`\\=\active
-@gdef@rawbackslash{@let\=@rawbackslashxx }}
-
-% \normalbackslash outputs one backslash in fixed width font.
-\def\normalbackslash{{\tt\rawbackslashxx}}
-
-% Say @foo, not \foo, in error messages.
-\escapechar=`\@
-
-%% These look ok in all fonts, so just make them not special. The @rm below
-%% makes sure that the current font starts out as the newly loaded cmr10
-\catcode`\$=\other \catcode`\%=\other \catcode`\&=\other \catcode`\#=\other
-
-\catcode 17=0 @c Define control-q
-\catcode`\\=\active
-@let\=@normalbackslash
-
-@textfonts
-@rm
diff --git a/util/et/vfprintf.c b/util/et/vfprintf.c
deleted file mode 100644
index 6558992..0000000
--- a/util/et/vfprintf.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley. 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'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* based on @(#)vfprintf.c 5.2 (Berkeley) 6/27/88 */
-
-#include <stdio.h>
-#include <varargs.h>
-
-int
-vfprintf(iop, fmt, ap)
- FILE *iop;
- char *fmt;
- va_list ap;
-{
- int len;
- char localbuf[BUFSIZ];
-
- if (iop->_flag & _IONBF) {
- iop->_flag &= ~_IONBF;
- iop->_ptr = iop->_base = localbuf;
- len = _doprnt(fmt, ap, iop);
- (void) fflush(iop);
- iop->_flag |= _IONBF;
- iop->_base = NULL;
- iop->_bufsiz = 0;
- iop->_cnt = 0;
- } else
- len = _doprnt(fmt, ap, iop);
-
- return (ferror(iop) ? EOF : len);
-}
diff --git a/util/reconf b/util/reconf
deleted file mode 100755
index f10f3ea..0000000
--- a/util/reconf
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-force=
-
-usage="Usage: ./config.status [--recheck] [--version] [--help]"
-for option
-do
- case "$option" in
- --force | -f)
- echo "Remaking all configuration files"
- force=--force ;;
- -help | --help | --hel | --he | --h)
- echo "$usage"; exit 0 ;;
- *) echo "$usage"; exit 1 ;;
- esac
-done
-
-./util/autoconf/autoreconf -m util/autoconf -l . --verbose $force