home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume15 / getty_ps / part04 < prev    next >
Encoding:
Text File  |  1990-10-05  |  48.8 KB  |  2,006 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: paul@devon.lns.pa.us
  3. organization: Devon Computer Services, Lancaster, PA
  4. keywords: getty uugetty
  5. subject: v15i007: Enhanced SYSV Getty/Uugetty, Ver 2.0, part 4 of 5 (REPOST)
  6. from: paul@devon.lns.pa.us (Paul Sutcliffe Jr.)
  7. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  8.  
  9. Posting-number: Volume 15, Issue 7
  10. Submitted-by: paul@devon.lns.pa.us (Paul Sutcliffe Jr.)
  11. Archive-name: getty_ps/part04
  12.  
  13. #! /bin/sh
  14.  
  15. # Make a new directory for the getty sources, cd to it, and run kits 1
  16. # thru 5 through sh.  When all 5 kits have been run, read README.
  17.  
  18. echo "This is getty 2.0 kit 4 (of 5).  If kit 4 is complete, the line"
  19. echo '"'"End of kit 4 (of 5)"'" will echo at the end.'
  20. echo ""
  21. export PATH || (echo "You didn't use sh, you clunch." ; kill $$)
  22. mkdir man 2>/dev/null
  23. echo Extracting man/gettytab.m4
  24. sed >man/gettytab.m4 <<'!STUFFY!FUNK!' -e 's/X//'
  25. X.\" +----------
  26. X.\" |    $Id: gettytab.m4,v 2.0 90/09/19 20:12:26 paul Rel $
  27. X.\" |
  28. X.\" |    GETTYTAB man page.
  29. X.\" |
  30. X.\" |    Copyright 1989,1990 by Paul Sutcliffe Jr.
  31. X.\" |
  32. X.\" |    Permission is hereby granted to copy, reproduce, redistribute,
  33. X.\" |    or otherwise use this software as long as: there is no monetary
  34. X.\" |    profit gained specifically from the use or reproduction or this
  35. X.\" |    software, it is not sold, rented, traded or otherwise marketed,
  36. X.\" |    and this copyright notice is included prominently in any copy
  37. X.\" |    made.
  38. X.\" |
  39. X.\" |    The author make no claims as to the fitness or correctness of
  40. X.\" |    this software for any use whatsoever, and it is provided as is. 
  41. X.\" |    Any use of this software is at the user's own risk.
  42. X.\" |
  43. X.\"
  44. X.\" +----------
  45. X.\" |    $Log:    gettytab.m4,v $
  46. X.\" |    Revision 2.0  90/09/19  20:12:26  paul
  47. X.\" |    Initial 2.0 release
  48. X.\" |    
  49. X.\" |    
  50. X.\" 
  51. X.\" +----------
  52. X.\" | M4 configuration
  53. X.\"
  54. Xinclude(config.m4).\"
  55. X.\"
  56. X.\" define(`_temp_', maketemp(m4bXXXXX))
  57. X.\" syscmd(echo _gtab_ | tr "[a-z]" "[A-Z]" | tr -d "\012" > _temp_)
  58. X.\" define(`_GTAB_', include(_temp_))
  59. X.\" syscmd(rm -f _temp_)
  60. X.\"
  61. X.\" +----------
  62. X.\" | Manpage source follows:
  63. X.\"
  64. X.TH _GTAB_ _file_section_
  65. X.SH NAME
  66. X_gtab_ \- speed and tty settings used by getty
  67. X.SH DESCRIPTION
  68. XThe file
  69. X.B _gettytab_
  70. Xcontains information used by
  71. X.IR getty (_mcmd_section_)
  72. Xto set up the speed and tty settings for a line.  It supplies
  73. Xinformation on what the
  74. X.I login-prompt
  75. Xshould look like.  It also supplies the speed to try next if
  76. Xthe user indicates the current speed is not correct by typing a
  77. X.I <break>
  78. Xcharacter.
  79. X.PP
  80. XEach entry in
  81. X.B _gettytab_
  82. Xhas the following format:
  83. X
  84. X.in +.2i
  85. X.ll 7.5i
  86. Xlabel# initial-flags # final-flags # login-prompt #next-label
  87. X.ll
  88. X.in -.2i
  89. X
  90. XEach entry is followed by a blank line.  Lines that begin with
  91. X.B \#
  92. Xare ignored and may be used to comment the file.  The various
  93. Xfields can contain quoted characters of the form
  94. X\fB\\b\fR, \fB\\n\fR, \fB\\c\fR, etc., as well as \fB\\\fInnn\fR,
  95. Xwhere
  96. X.I nnn
  97. Xis the octal value of the desired character.  The various fields are:
  98. X.TP 16
  99. X.I label
  100. XThis is the string against which
  101. X.I getty
  102. Xtries to match its second argument. It is often the speed, such as
  103. X.BR 1200 ,
  104. Xat which the terminal is supposed to run, but it needn't be (see below).
  105. X.TP
  106. X.I initial-flags
  107. XThese flags are the initial
  108. X.IR ioctl (_system_section_)
  109. Xsettings to which the terminal is to be set if a terminal type is
  110. Xnot specified to
  111. X.IR getty .
  112. X.I Getty
  113. Xunderstands the symbolic names specified in
  114. X.B /usr/`include'/termio.h
  115. X(see
  116. X.\" +----------
  117. X.\" | M4_start (trs16)
  118. Xifdef(`trs16',
  119. X.IR tty `('_misc_section_`)).',
  120. X.\" | else (trs16)
  121. X.IR termio `('_misc_section_`)).')
  122. X.\" | M4_end (trs16)
  123. X.\" +----------
  124. XNormally only the speed flag is required in the
  125. X.I initial-flags
  126. Xfield.
  127. X.I Getty
  128. Xautomatically sets the terminal to raw input mode and takes care of
  129. Xmost of the other flags.  The
  130. X.I initial-flag
  131. Xsettings remain in effect until
  132. X.I getty
  133. Xexecutes
  134. X.IR login (_mcmd_section_).
  135. X.TP
  136. X.I final-flags
  137. XThese flags take the same values as the
  138. X.I initial-flags
  139. Xand are set just prior to
  140. X.I getty
  141. Xexecutes
  142. X.BR _login_ .
  143. XThe speed flag is again required.  The composite flag
  144. X.B SANE
  145. Xtakes care of most of the other flags that need to be set so that
  146. Xthe processor and terminal are communicating in a rational fashion.
  147. XThe other two commonly specified
  148. X.I final-flags
  149. Xare
  150. X.BR TAB3 ,
  151. Xso that tabs are sent to the terminal as spaces, and
  152. X.BR HUPCL ,
  153. Xso that the line is hung up on the final close.
  154. X.TP
  155. X.I login-prompt
  156. XThis entire field is printed as the
  157. X.IR login-prompt .
  158. XUnlike the above fields where white space is ignored (a space,
  159. Xtab or new-line), they are included in the
  160. X.I login-prompt
  161. Xfield.
  162. X
  163. XThe
  164. X.I login-prompt
  165. Xmay contain various
  166. X.BI @ char
  167. Xand
  168. X\fB\\\fIchar\fR
  169. Xparameters.  These are described in full in the
  170. X.IR getty (_mcmd_section_)
  171. Xsection PROMPT SUBSTITUTIONS.
  172. X.TP
  173. X.I next-label
  174. XThis indicates the next
  175. X.I label
  176. Xof the entry in the table that
  177. X.I getty
  178. Xshould use if the user types a
  179. X.I <break>
  180. Xor the input cannot be read.  Usually, a series of speeds are linked
  181. Xtogether in this fashion, into a closed set.  For instance,
  182. X.B 2400
  183. Xlinked to
  184. X.BR 1200 ,
  185. Xwhich in turn is linked to
  186. X.BR 300 ,
  187. Xwhich finally is linked back to
  188. X.BR 2400 .
  189. X.P
  190. XIf
  191. X.I getty
  192. Xis called without a
  193. X.I speed
  194. Xargument, then the first entry of
  195. X.B _gettytab_
  196. Xis used, thus making the first entry of
  197. X.B _gettytab_
  198. Xthe default entry. It is also used if
  199. X.I getty
  200. Xcan't find the specified
  201. X.I label.
  202. XIf
  203. X.B _gettytab_
  204. Xitself is missing, there is one entry built into
  205. X.I getty
  206. Xwhich will bring up a terminal at 9600 baud.
  207. X.P
  208. XIt is strongly recommended that after making or modifying
  209. X.BR _gettytab_ `,'
  210. Xit be run through
  211. X.I getty
  212. Xwith the check (\fB\-c\fR) option to be sure there are no errors.
  213. X.SH FILES
  214. X_gettytab_
  215. X.SH "SEE ALSO"
  216. Xlogin(_mcmd_section_),
  217. Xgetty(_mcmd_section_),
  218. Xioctl(_system_section_),
  219. X.\" +----------
  220. X.\" | M4_start (trs16)
  221. Xifdef(`trs16',
  222. Xtty`('_misc_section_`)',
  223. X.\" | else (trs16)
  224. Xtermio`('_misc_section_`)')
  225. X.\" | M4_end (trs16)
  226. X.\" +----------
  227. !STUFFY!FUNK!
  228. echo Extracting makedep.SH
  229. sed >makedep.SH <<'!STUFFY!FUNK!' -e 's/X//'
  230. X:
  231. X# $Id: makedep.SH,v 2.0 90/09/19 20:04:37 paul Rel $
  232. X#
  233. X# $Log:    makedep.SH,v $
  234. X# Revision 2.0  90/09/19  20:04:37  paul
  235. X# Initial 2.0 release
  236. X# 
  237. X# 
  238. X
  239. Xcase $CONFIG in
  240. X'')
  241. X    if test ! -f config.sh; then
  242. X    ln ../config.sh . || \
  243. X    ln ../../config.sh . || \
  244. X    ln ../../../config.sh . || \
  245. X    (echo "Can't find config.sh."; exit 1)
  246. X    fi
  247. X    . ./config.sh
  248. X    ;;
  249. Xesac
  250. Xcase "$0" in
  251. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  252. Xesac
  253. Xecho "Extracting makedep (with variable substitutions)"
  254. X$spitshell >makedep <<!GROK!THIS!
  255. X$startsh
  256. X#
  257. X# makedep
  258. X#
  259. X# Creates dependencies for Makefile
  260. X#
  261. X
  262. Xexport PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh \$0; kill \$\$)
  263. X
  264. Xcat='$cat'
  265. Xccflags='$ccflags'
  266. Xcp='$cp'
  267. Xcpp='$cppstdin'
  268. Xecho='$echo'
  269. Xegrep='$egrep'
  270. Xexpr='$expr'
  271. Xmv='$mv'
  272. Xrm='$rm'
  273. Xsed='$sed'
  274. Xsort='$sort'
  275. Xtest='$test'
  276. Xtr='$tr'
  277. Xuniq='$uniq'
  278. X!GROK!THIS!
  279. X
  280. X$spitshell >>makedep <<'!NO!SUBS!'
  281. X
  282. X: the following weeds options from ccflags that are of no interest to cpp
  283. Xcase "$ccflags" in
  284. X'');;
  285. X*)  set X $ccflags
  286. X    ccflags=''
  287. X    for flag do
  288. X    case $flag in
  289. X    -D*|-I*) ccflags="$ccflags $flag";;
  290. X    esac
  291. X    done
  292. X    ;;
  293. Xesac
  294. X
  295. X$cat /dev/null >.deptmp
  296. X$rm -f *.c.c c/*.c.c
  297. Xif test -f Makefile; then
  298. X    mf=Makefile
  299. Xelse
  300. X    mf=makefile
  301. Xfi
  302. Xif test -f $mf; then
  303. X    defrule=`<$mf sed -n        \
  304. X    -e '/^\.c\.o:.*;/{'        \
  305. X    -e    's/\$\*\.c//'        \
  306. X    -e    's/^[^;]*;[     ]*//p'    \
  307. X    -e    q                \
  308. X    -e '}'                \
  309. X    -e '/^\.c\.o: *$/{'        \
  310. X    -e    N                \
  311. X    -e    's/\$\*\.c//'        \
  312. X    -e    's/^.*\n[     ]*//p'        \
  313. X    -e    q                \
  314. X    -e '}'`
  315. Xfi
  316. Xcase "$defrule" in
  317. X'') defrule='$(CC) -c $(CFLAGS)' ;;
  318. Xesac
  319. X
  320. Xmake clist || ($echo "Searching for .c files..."; \
  321. X    $echo *.c | $tr ' ' '\012' | $egrep -v '\*' >.clist)
  322. Xfor file in `$cat .clist`; do
  323. X# for file in `cat /dev/null`; do
  324. X    case "$file" in
  325. X    *.c) filebase=`basename $file .c` ;;
  326. X    *.y) filebase=`basename $file .c` ;;
  327. X    esac
  328. X    $echo "Finding dependencies for $filebase.o."
  329. X    $sed -n <$file >$file.c \
  330. X    -e "/^${filebase}_init(/q" \
  331. X    -e '/^#/{' \
  332. X    -e 's|/\*.*$||' \
  333. X    -e 's|\\$||' \
  334. X    -e p \
  335. X    -e '}'
  336. X    $cpp -I. $ccflags $file.c | \
  337. X    $sed \
  338. X    -e '/^# *[0-9]/!d' \
  339. X    -e 's/^.*"\(.*\)".*$/'$filebase'.o: \1/' \
  340. X    -e 's|: \./|: |' \
  341. X    -e 's|\.c\.c|.c|' | \
  342. X    $uniq | $sort | $uniq >> .deptmp
  343. Xdone
  344. X
  345. X$sed <Makefile >Makefile.new -e '1,/^# AUTOMATICALLY/!d'
  346. X
  347. Xmake shlist || ($echo "Searching for .SH files..."; \
  348. X    $echo *.SH | $tr ' ' '\012' | $egrep -v '\*' >.shlist)
  349. Xif $test -s .deptmp; then
  350. X    for file in `cat .shlist`; do
  351. X    $echo `$expr X$file : 'X\(.*\).SH`: $file config.sh \; \
  352. X        /bin/sh $file >> .deptmp
  353. X    done
  354. X    $echo "Updating Makefile..."
  355. X    $echo "# If this runs make out of memory, delete /usr/include lines." \
  356. X    >> Makefile.new
  357. X    $sed 's|^\(.*\.o:\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \
  358. X       >>Makefile.new
  359. Xelse
  360. X    make hlist || ($echo "Searching for .h files..."; \
  361. X    $echo *.h | $tr ' ' '\012' | $egrep -v '\*' >.hlist)
  362. X    $echo "You don't seem to have a proper C preprocessor.  Using grep instead."
  363. X    $egrep '^#include ' `cat .clist` `cat .hlist`  >.deptmp
  364. X    $echo "Updating Makefile..."
  365. X    <.clist $sed -n                            \
  366. X    -e '/\//{'                            \
  367. X    -e   's|^\(.*\)/\(.*\)\.c|\2.o: \1/\2.c; '"$defrule \1/\2.c|p"    \
  368. X    -e   d                                \
  369. X    -e '}'                                \
  370. X    -e 's|^\(.*\)\.c|\1.o: \1.c|p' >> Makefile.new
  371. X    <.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed
  372. X    <.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \
  373. X       $sed 's|^[^;]*/||' | \
  374. X       $sed -f .hsed >> Makefile.new
  375. X    <.deptmp $sed -n 's|c:#include <\(.*\)>.*$|o: /usr/include/\1|p' \
  376. X       >> Makefile.new
  377. X    <.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \
  378. X       $sed -f .hsed >> Makefile.new
  379. X    <.deptmp $sed -n 's|h:#include <\(.*\)>.*$|h: /usr/include/\1|p' \
  380. X       >> Makefile.new
  381. X    for file in `$cat .shlist`; do
  382. X    $echo `$expr X$file : 'X\(.*\).SH`: $file config.sh \; \
  383. X        /bin/sh $file >> Makefile.new
  384. X    done
  385. Xfi
  386. X$rm -f Makefile.old
  387. X$cp Makefile Makefile.old
  388. X$cp Makefile.new Makefile
  389. X$rm Makefile.new
  390. X$echo "# WARNING: Put nothing here or make depend will gobble it up!" >> Makefile
  391. X$rm -f .deptmp `sed 's/\.c/.c.c/' .clist` .shlist .clist .hlist .hsed
  392. X
  393. X!NO!SUBS!
  394. X$eunicefix makedep
  395. Xchmod +x makedep
  396. Xcase `pwd` in
  397. X*SH)
  398. X    $rm -f ../makedep
  399. X    ln makedep ../makedep
  400. X    ;;
  401. Xesac
  402. !STUFFY!FUNK!
  403. echo Extracting config.h.SH
  404. sed >config.h.SH <<'!STUFFY!FUNK!' -e 's/X//'
  405. X:
  406. X# $Id: config.h.SH,v 2.0 90/09/19 19:37:01 paul Rel $
  407. X#
  408. X# Creates config.h file for getty distribution
  409. X#
  410. X# $Log:    config.h.SH,v $
  411. X# Revision 2.0  90/09/19  19:37:01  paul
  412. X# Initial 2.0 release
  413. X# 
  414. X#
  415. X
  416. Xcase $CONFIG in
  417. X'')
  418. X    if test ! -f config.sh; then
  419. X    ln ../config.sh . || \
  420. X    ln ../../config.sh . || \
  421. X    ln ../../../config.sh . || \
  422. X    (echo "Can't find config.sh."; exit 1)
  423. X    fi
  424. X    . config.sh
  425. X    ;;
  426. Xesac
  427. Xcase "$0" in
  428. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  429. Xesac
  430. X
  431. Xcase "$d_phostname" in
  432. X$define) phostname='\"$phostname\"' ;;
  433. X$undef)  phostname='' ;;
  434. Xesac
  435. X
  436. Xecho "Extracting config.h (with variable substitutions)"
  437. X$spitshell >config.h <<!GROK!THIS!
  438. X/*
  439. X**    config.h
  440. X**
  441. X**    Getty configuration.
  442. X*/
  443. X
  444. X/*
  445. X**    Copyright 1989,1990 by Paul Sutcliffe Jr.
  446. X**
  447. X**    Permission is hereby granted to copy, reproduce, redistribute,
  448. X**    or otherwise use this software as long as: there is no monetary
  449. X**    profit gained specifically from the use or reproduction or this
  450. X**    software, it is not sold, rented, traded or otherwise marketed,
  451. X**    and this copyright notice is included prominently in any copy
  452. X**    made.
  453. X**
  454. X**    The author make no claims as to the fitness or correctness of
  455. X**    this software for any use whatsoever, and it is provided as is. 
  456. X**    Any use of this software is at the user's own risk.
  457. X*/
  458. X
  459. X
  460. X#include "tune.h"            /* defs needed below */
  461. X
  462. X
  463. X/*  These are set by config.sh.
  464. X *  If you change them here, they will be reset
  465. X *  the next time you run Configure.
  466. X */
  467. X
  468. X#$d_portable    PORTABLE        /* compile for more than one site */
  469. X#$d_getutent    GETUTENT        /* we have getutent() and friends */
  470. X#$d_strdup    STRDUP            /* we have strdup() */
  471. X#$d_putenv    PUTENV            /* we have putenv() */
  472. X
  473. X#$d_ttytype    TTYTYPE   "$ttytype"    /* file used to identify terminals */
  474. X#$define    GETTYTAB  "$gettytab"    /* file used for speed/termio table */
  475. X
  476. X#$define    STDCHAR   $stdchar    /* signed or unsigned chars in stdio */
  477. X#$define    UIDTYPE      $uidtype    /* storage type of UID's */
  478. X#$define    GIDTYPE      $gidtype    /* storage type of GID's */
  479. X
  480. X#$d_fcntl    FCNTL            /* include fcntl.h? */
  481. X#$d_ioctl    IOCTL            /* include sys/ioctl.h? */
  482. X#$i_pwd        PWD            /* include pwd.h? */
  483. X#$i_time    I_TIME            /* include time.h? */
  484. X#$i_systime    I_SYSTIME        /* include sys/time.h? */
  485. X#$d_systimekernel    SYSTIMEKERNEL
  486. X#$d_varargs    VARARGS            /* include varargs.h? */
  487. X
  488. X#$d_index    index      strchr    /* use these instead */
  489. X#$d_index    rindex      strrchr
  490. X
  491. X#$d_voidsig    VOIDSIG            /* you have 'void (*signal)()' */
  492. X
  493. X#ifdef    VOIDSIG                /* define sig_t appropriately */
  494. Xtypedef    void    sig_t;
  495. X#else    /* VOIDSIG */
  496. Xtypedef    int    sig_t;
  497. X#endif    /* VOIDSIG */
  498. X
  499. X#ifndef    VOIDUSED
  500. X#$define    VOIDUSED  $defvoidused
  501. X#endif    /* VOIDUSED */
  502. X#$define    VOIDFLAGS $voidflags
  503. X#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
  504. X#$define    void      int        /* is void to be avoided? */
  505. X#$define    M_VOID            /* Xenix strikes again */
  506. X#endif    /* VOIDFLAGS & VOIDUSED */
  507. X
  508. X#ifndef    PORTABLE
  509. X#$define    HOSTNAME  "$hostname"    /* compile node name in */
  510. X#else    /* PORTABLE */
  511. X#$d_douname    DOUNAME            /* use uname() to get node name */
  512. X#$d_phostname    PHOSTNAME $phostname    /* get node name from this command */
  513. X#endif    /* PORTABLE */
  514. X
  515. X#ifndef    UTMP_FILE
  516. X#$define    UTMP_FILE "$utmp"    /* name of the utmp file */
  517. X#endif    /* UTMP_FILE */
  518. X
  519. X#ifdef    LOGUTMP
  520. X#ifndef    WTMP_FILE
  521. X#$define    WTMP_FILE "$wtmp"    /* name of the wtmp file */
  522. X#endif    /* WTMP_FILE */
  523. X#endif    /* LOGUTMP */
  524. X
  525. X#ifdef    TRYMAIL
  526. X#$define    MAILER      "$mailer"    /* mail agent */
  527. X#endif    /* TRYMAIL */
  528. X
  529. X#ifdef    UUGETTY
  530. X#$d_asciipid    ASCIIPID        /* PID stored in ASCII in lock file */
  531. X#$define    LOCK      "$lock/LCK..%s"    /* lock file name */
  532. X#$define    UUCPID      $uucpid    /* uid of UUCP account */
  533. X#endif    /* UUGETTY */
  534. X
  535. X
  536. X/* end of config.h */
  537. X!GROK!THIS!
  538. Xchmod 644 config.h
  539. X$eunicefix config.h
  540. !STUFFY!FUNK!
  541. echo Extracting Makefile.SH
  542. sed >Makefile.SH <<'!STUFFY!FUNK!' -e 's/X//'
  543. X:
  544. X# $Id: Makefile.SH,v 2.0 90/09/19 19:28:46 paul Rel $
  545. X#
  546. X# Creates Makefile for getty distribution
  547. X#
  548. X# $Log:    Makefile.SH,v $
  549. X# Revision 2.0  90/09/19  19:28:46  paul
  550. X# Initial 2.0 release
  551. X# 
  552. X# 
  553. X
  554. Xcase $CONFIG in
  555. X'')
  556. X    if test ! -f config.sh; then
  557. X    ln ../config.sh . || \
  558. X    ln ../../config.sh . || \
  559. X    ln ../../../config.sh . || \
  560. X    (echo "Can't find config.sh."; exit 1)
  561. X    fi
  562. X    . config.sh
  563. X    ;;
  564. Xesac
  565. Xcase "$0" in
  566. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  567. Xesac
  568. X
  569. X: add necessary modules based on config.sh
  570. Xcase "$d_getutent" in
  571. X"$define")
  572. X    src=""
  573. X    obj=""
  574. X    ;;
  575. X"$undef")
  576. X    src="getutent.c"
  577. X    obj="getutent.o"
  578. X    ;;
  579. Xesac
  580. Xcase "$d_strdup" in
  581. X"$undef")
  582. X    src="$src strdup.c"
  583. X    obj="$obj strdup.o"
  584. X    ;;
  585. Xesac
  586. Xcase "$d_putenv" in
  587. X"$undef")
  588. X    src="$src putenv.c"
  589. X    obj="$obj putenv.o"
  590. X    ;;
  591. Xesac
  592. X
  593. Xecho "Extracting Makefile (with variable substitutions)"
  594. X$spitshell >Makefile <<!GROK!THIS!
  595. X#
  596. X# Makefile for getty distribution
  597. X#
  598. X# To recreate this file, make any changes in config.sh and then
  599. X# say "sh Makefile.SH"
  600. X#
  601. X
  602. XSHELL=    /bin/sh
  603. X
  604. X# compiler stuff -- check these
  605. XCC=    $cc
  606. XCFLAGS=    $optimize $ccflags $small
  607. XLFLAGS=    $ldflags $split
  608. XLIBS=    $libs
  609. XLINT=    lint -abchuvx
  610. XLLIBS=    $llib_termlib
  611. X
  612. X# where things go
  613. XBIN=    $bin
  614. XUUBIN=    $bin
  615. X
  616. X# what are we making
  617. XSH=    Makefile.SH config.h.SH makedep.SH
  618. XHDRS=    config.h defaults.h extern.h funcs.h getty.h patchlevel.h \\
  619. X    table.h tune.h
  620. XSRC=    main.c funcs.c defaults.c table.c $src
  621. XOBJ=    main.o funcs.o defaults.o table.o $obj
  622. XUUSRC=    umain.c funcs.c defaults.c table.c $src
  623. XUUOBJ=    umain.o funcs.o defaults.o table.o $obj
  624. X
  625. X# rules
  626. X
  627. Xall:    getty uugetty manpages
  628. X
  629. Xclist:
  630. X    @echo $(SRC) $(UUSRC) | $tr ' ' '\012' | $sort | $uniq > .clist
  631. X
  632. Xhlist:
  633. X    @echo $(HDRS) | $tr ' ' '\012' > .hlist
  634. X
  635. Xshlist:
  636. X    @echo $(SH) | $tr ' ' '\012' > .shlist
  637. X!GROK!THIS!
  638. X$spitshell >>Makefile <<'!NO!SUBS!'
  639. X
  640. Xgetty:    $(OBJ)
  641. X    $(CC) $(LFLAGS) -o $@ $(OBJ) $(LIBS) 
  642. X
  643. Xuugetty: $(UUOBJ)
  644. X    $(CC) $(LFLAGS) -o $@ $(UUOBJ) $(LIBS) 
  645. X
  646. Xmanpages:
  647. X    cd man; make
  648. X
  649. Xinstall: getty uugetty
  650. X    -mv $(BIN)/getty $(BIN)/getty-
  651. X    -mv $(UUBIN)/uugetty $(UUBIN)/uugetty-
  652. X    cp getty $(BIN)
  653. X    cp uugetty $(UUBIN)
  654. X    chmod 700 $(BIN)/getty $(UUBIN)/uugetty
  655. X    strip $(BIN)/getty $(UUBIN)/uugetty
  656. X    cd man; make install
  657. X
  658. Xlint:    $(SRC) umain.c
  659. X    @echo "linting getty sources..."
  660. X    echo "GETTY" >lint.out
  661. X    $(LINT) $(SRC) $(LLIBS) >>lint.out
  662. X    @echo "linting uugetty sources..."
  663. X    @echo ' ' >>lint.out
  664. X    echo 'UUGETTY' >>lint.out
  665. X    $(LINT) -DUUGETTY $(UUSRC) $(LLIBS) >>lint.out
  666. X    @echo "lint output is in lint.out"
  667. X
  668. Xclean:
  669. X    rm -f umain.c *.o core *.out .*list *.ln Makefile.old
  670. X    cd man; make clean
  671. X
  672. Xclobber: clean
  673. X    rm -f getty uugetty
  674. X    cd man; make clobber
  675. X
  676. Xrealclean: clobber
  677. X
  678. Xdepend:    makedep umain.c tune.h
  679. X    chmod +x makedep
  680. X    ./makedep
  681. X
  682. X# special dependancies follow
  683. X
  684. Xumain.c: main.c
  685. X    -ln main.c umain.c
  686. X
  687. Xumain.o:
  688. X    $(CC) $(CFLAGS) -DUUGETTY -c umain.c
  689. X
  690. Xtune.h:    tune.H
  691. X    @echo "------------------------------------------------"
  692. X    @echo "Making a tune.h from the tune.H prototype file. "
  693. X    @echo "You may wish to edit tune.h before making getty."
  694. X    @echo "------------------------------------------------"
  695. X    -cp tune.H tune.h
  696. X
  697. X# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
  698. X!NO!SUBS!
  699. Xchmod 644 Makefile
  700. X$eunicefix Makefile
  701. !STUFFY!FUNK!
  702. echo Extracting man/makeconfig
  703. sed >man/makeconfig <<'!STUFFY!FUNK!' -e 's/X//'
  704. X:
  705. X#
  706. X# $Id: makeconfig,v 2.0 90/09/19 20:13:46 paul Rel $
  707. X#
  708. X# $Log:    makeconfig,v $
  709. X# Revision 2.0  90/09/19  20:13:46  paul
  710. X# Initial 2.0 release
  711. X# 
  712. X#
  713. X
  714. Xcase $CONFIG in
  715. X'')
  716. X    if test ! -f config.sh; then
  717. X    ln ../config.sh . || \
  718. X    ln ../../config.sh . || \
  719. X    ln ../../../config.sh . || \
  720. X    (echo "Can't find config.sh."; exit 1)
  721. X    fi
  722. X    . config.sh
  723. X    ;;
  724. Xesac
  725. Xcase "$0" in
  726. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  727. Xesac
  728. X
  729. Xtmp=/tmp/mc$$
  730. Xrmlist="$tmp"
  731. Xtrap 'echo " "; $rm -f $rmlist; exit 1' 1 2 3
  732. X
  733. X: where is the source
  734. Xsrc=..
  735. Xtune=$src/tune.h
  736. Xrelease=$src/release.h
  737. X
  738. X: is package complete
  739. Xif $test ! -f $tune; then
  740. X    echo "Can't find tune.h."
  741. X    exit 1
  742. Xfi
  743. X
  744. X: things we can tell from tune.h
  745. Xcppout=".cppout"
  746. Xtuneout=".tune"
  747. Xrmlist="$cppout $tuneout $rmlist"
  748. X$cppstdin -I$src -I. $cppminus <<EOS >$cppout
  749. X#include <$tune>
  750. X#include <$release>
  751. Xconsole=CONSOLE
  752. Xdefaults=DEFAULTS
  753. Xissue=ISSUE
  754. Xlogin=LOGIN
  755. Xconnect=DEF_CONNECT
  756. X#ifdef    LOGUTMP
  757. Xlogutmp="$define"
  758. X#endif
  759. X#ifdef    TRS16
  760. Xtrs16="$define"
  761. X#endif
  762. X#ifdef    TRYMAIL
  763. Xtrymail="$define"
  764. Xnotify=NOTIFY
  765. X#endif
  766. X#ifdef    WARNCASE
  767. Xwarncase="$define"
  768. X#endif
  769. Xrelease=RELEASE
  770. Xdate=DATE
  771. XEOS
  772. X$sed 's/[     ]//' <$cppout >$tuneout
  773. Xchmod +x $tuneout
  774. X. $tuneout
  775. X
  776. Xdefaults=`$echo $defaults | $sed 's;/\%s;;'`
  777. X$sed 's;\\;\\\\;g' <<EOS >$tmp
  778. X$connect
  779. XEOS
  780. Xconnect=`cat $tmp`
  781. X
  782. X: things we cannot tell from tune.h
  783. Xif $test ! -d /usr/lib/terminfo; then
  784. X    termcap="$define"
  785. Xfi
  786. Xsystems=L.sys
  787. Xif $test -f /usr/lib/uucp/Systems; then
  788. X    systems=Systems
  789. Xfi
  790. Xgtab=`basename $gettytab`
  791. X
  792. X: name the man pages
  793. Xcase "$xenix" in
  794. X"$define")
  795. X    cmd=C; mcmd=M; system=S; library=S; file=F; misc=M
  796. X    ;;
  797. X"$undef")
  798. X    cmd=1; mcmd=1m; system=2; library=3; file=4; misc=7
  799. X    ;;
  800. Xesac
  801. X
  802. X$cat <<EOC >config.m4
  803. X.\" +----------
  804. X.\" | local GETTY configurations
  805. X.\"
  806. X.\" define(\`_cmd_section_', $cmd)
  807. X.\" define(\`_mcmd_section_', $mcmd)
  808. X.\" define(\`_system_section_', $system)
  809. X.\" define(\`_library_section_', $library)
  810. X.\" define(\`_file_section_', $file)
  811. X.\" define(\`_misc_section_', $misc)
  812. X.\" define(\`_console_', $console)
  813. X.\" define(\`_defaults_', $defaults)
  814. X.\" define(\`_gettytab_', $gettytab)
  815. X.\" define(\`_gtab_', $gtab)
  816. X.\" define(\`_issue_', $issue)
  817. X.\" define(\`_login_', $login)
  818. X.\" define(\`_utmp_', $utmp)
  819. X.\" define(\`_wtmp_', $wtmp)
  820. X.\" define(\`_systems_', $systems)
  821. X.\" define(\`_connect_', $connect)
  822. X.\" define(\`RELEASE', $release)
  823. X.\" define(\`DATE', $date)
  824. X.\"
  825. XEOC
  826. X
  827. Xcase "$logutmp" in
  828. X"$define") $cat <<EOC >>config.m4
  829. X.\" define(\`logutmp')
  830. XEOC
  831. X;;
  832. Xesac
  833. Xcase "$termcap" in
  834. X"$define") $cat <<EOC >>config.m4
  835. X.\" define(\`termcap')
  836. XEOC
  837. X;;
  838. Xesac
  839. Xcase "$trs16" in
  840. X"$define") $cat <<EOC >>config.m4
  841. X.\" define(\`trs16')
  842. XEOC
  843. X;;
  844. Xesac
  845. Xcase "$trymail" in
  846. X"$define") $cat <<EOC >>config.m4
  847. X.\" define(\`trymail')
  848. X.\" define(\`_notify_', $notify)
  849. XEOC
  850. X;;
  851. Xesac
  852. Xcase "$ttytype" in
  853. X"/*") $cat <<EOC >>config.m4
  854. X.\" define(\`ttytype', $ttytype)
  855. XEOC
  856. X;;
  857. Xesac
  858. Xcase "$warncase" in
  859. X"$define") $cat <<EOC >>config.m4
  860. X.\" define(\`warncase')
  861. XEOC
  862. X;;
  863. Xesac
  864. X
  865. X$rm -f $rmlist
  866. X# grrr, don't ask
  867. X$rm -f $cppout
  868. X$rm -f $tuneout
  869. !STUFFY!FUNK!
  870. echo Extracting man/getutent.m4
  871. sed >man/getutent.m4 <<'!STUFFY!FUNK!' -e 's/X//'
  872. X.\" +----------
  873. X.\" |    $Id: getutent.m4,v 2.0 90/09/19 20:12:55 paul Rel $
  874. X.\" |
  875. X.\" |    GETUTENT man page.
  876. X.\" |
  877. X.\" |    Copyright 1989,1990 by Paul Sutcliffe Jr.
  878. X.\" |
  879. X.\" |    Permission is hereby granted to copy, reproduce, redistribute,
  880. X.\" |    or otherwise use this software as long as: there is no monetary
  881. X.\" |    profit gained specifically from the use or reproduction or this
  882. X.\" |    software, it is not sold, rented, traded or otherwise marketed,
  883. X.\" |    and this copyright notice is included prominently in any copy
  884. X.\" |    made.
  885. X.\" |
  886. X.\" |    The author make no claims as to the fitness or correctness of
  887. X.\" |    this software for any use whatsoever, and it is provided as is. 
  888. X.\" |    Any use of this software is at the user's own risk.
  889. X.\" |
  890. X.\"
  891. X.\" +----------
  892. X.\" |    $Log:    getutent.m4,v $
  893. X.\" |    Revision 2.0  90/09/19  20:12:55  paul
  894. X.\" |    Initial 2.0 release
  895. X.\" |    
  896. X.\" |    
  897. X.\" 
  898. X.\" +----------
  899. X.\" | M4 configuration
  900. X.\"
  901. Xinclude(config.m4).\"
  902. X.\"
  903. X.\" +----------
  904. X.\" | Manpage source follows:
  905. X.\"
  906. X.TH GETUTENT _library_section_
  907. X.SH NAME
  908. Xgetutent, getutline, setutent, endutent,
  909. Xutmpname \- access utmp file entry
  910. X.SH SYNOPSIS
  911. X.B \#include <utmp.h>
  912. X
  913. X.B struct utmp *getutent();
  914. X
  915. X.B struct utmp *getutline(\fIline\fB)\fR;
  916. X.br
  917. X.B struct utmp *\fIline\fR;
  918. X
  919. X.B void setutent();
  920. X
  921. X.B void endutent();
  922. X
  923. X.B void utmpname(\fIfile\fB)\fR;
  924. X.br
  925. X.B char *\fIfile\fR;
  926. X.SH DESCRIPTION
  927. X.I Getutent
  928. Xand
  929. X.I getutline
  930. Xeach return a pointer to a structure of the following type:
  931. X.nf
  932. X
  933. X    struct utmp {
  934. X        char    ut_line[8];        /* tty name */
  935. X        char    ut_name[8];        /* user id */
  936. X        long    ut_time;           /* time on */
  937. X    };
  938. X
  939. X.fi
  940. X.I Getutent
  941. Xreads in the next entry from a
  942. X.IR utmp \-like
  943. Xfile.  If the file is not already open, it opens it.  If it
  944. Xreaches the end of file, it fails.
  945. X.PP
  946. X.I Getutline
  947. Xsearches forward from the current point in the
  948. X.I utmp
  949. Xfile until it finds an entry which has a
  950. X.I ut_line
  951. Xstring matching the
  952. X.I line\->ut_line
  953. Xstring.  If the end of file is reached without a match, it fails.
  954. X.PP
  955. X.I Setutent
  956. Xresets the input stream to the beginning of the file.  This should be
  957. Xdone before each search for a new entry if it is desired that the
  958. Xentire file be examined.
  959. X.PP
  960. X.I Endutent
  961. Xcloses the currently open file.
  962. X.PP
  963. X.I Utmpname
  964. Xallows the user to change the name of the file examined, from
  965. X.B _utmp_
  966. Xto any other file.  It is most often expected that this other file
  967. Xwill be
  968. X.BR _wtmp_ .
  969. XIf the file does not exist, this will not be apparent until the first
  970. Xattempt to reference the file is made.
  971. X.I Utmpname
  972. Xdoes not open the file.  It just closes the old file if it is
  973. Xcurrently open and saves the new file name.
  974. X.SH FILES
  975. X_utmp_
  976. X.br
  977. X_wtmp_
  978. X.SH BUGS
  979. XThe most current entry is saved in a static structure.  Multiple
  980. Xaccesses require that it be copied before further accesses are made.
  981. X.PP
  982. XThese routines use buffered standard I/O for input.
  983. X.SH "SEE ALSO"
  984. Xutmp(_file_section_)
  985. X.SH AUTHOR
  986. X.nf
  987. XPaul Sutcliffe, Jr.  <paul@devon.lns.pa.us>
  988. XUUCP: ...!rutgers!devon!paul
  989. !STUFFY!FUNK!
  990. echo Extracting tune.H
  991. sed >tune.H <<'!STUFFY!FUNK!' -e 's/X//'
  992. X/*
  993. X**    $Id: tune.H,v 2.0 90/09/19 20:19:47 paul Rel $
  994. X**
  995. X**    Getty tuneable parameters.
  996. X*/
  997. X
  998. X/*
  999. X**    Copyright 1989,1990 by Paul Sutcliffe Jr.
  1000. X**
  1001. X**    Permission is hereby granted to copy, reproduce, redistribute,
  1002. X**    or otherwise use this software as long as: there is no monetary
  1003. X**    profit gained specifically from the use or reproduction or this
  1004. X**    software, it is not sold, rented, traded or otherwise marketed,
  1005. X**    and this copyright notice is included prominently in any copy
  1006. X**    made.
  1007. X**
  1008. X**    The author make no claims as to the fitness or correctness of
  1009. X**    this software for any use whatsoever, and it is provided as is. 
  1010. X**    Any use of this software is at the user's own risk.
  1011. X*/
  1012. X
  1013. X/*
  1014. X**    $Log:    tune.H,v $
  1015. X**    Revision 2.0  90/09/19  20:19:47  paul
  1016. X**    Initial 2.0 release
  1017. X**    
  1018. X*/
  1019. X
  1020. X
  1021. X#define    boolean     int            /* does your cc know about boolean? */
  1022. X
  1023. X#define    DEF_CFL     (CS7 | PARENB)        /* default word-len/parity */
  1024. X
  1025. X#define    DEF_CONNECT  "CONNECT\s\A\r\n"    /* default CONNECT string */
  1026. X
  1027. X
  1028. X/*  Feature selection
  1029. X */
  1030. X
  1031. X#undef    DEBUG                /* include debugging code */
  1032. X#define    LOGUTMP                /* need to update utmp/wtmp files */
  1033. X#define    MY_CANON            /* use my own ERASE and KILL chars */
  1034. X#define    RCSID                /* include RCS ID info in objects */
  1035. X#define    SETTERM                /* need to set TERM in environment */
  1036. X#define    TELEBIT                /* include Telebit FAST parsing */
  1037. X#define    TRYMAIL                /* mail errors if CONSOLE unavailable */
  1038. X#define    WARNCASE            /* warn user if login is UPPER case */
  1039. X
  1040. X/*  define your ERASE and KILL characters here
  1041. X */
  1042. X#ifdef    MY_CANON
  1043. X#define    MY_ERASE '\010'            /* 010 = ^H, backspace */
  1044. X#define    MY_KILL     '\025'            /* 025 = ^U, nak */
  1045. X#endif
  1046. X
  1047. X/*  define your Telebit FAST speed here
  1048. X */
  1049. X#ifdef    TELEBIT
  1050. X#define    TB_FAST     "19200"        /* CONNECT FAST == this speed */
  1051. X#endif    /* TELEBIT */
  1052. X
  1053. X/*  who should be notified of errors?
  1054. X */
  1055. X#ifdef    TRYMAIL
  1056. X#define    NOTIFY     "root"
  1057. X#endif
  1058. X
  1059. X
  1060. X/*  Where to find things
  1061. X */
  1062. X
  1063. X#define    CONSOLE     "/dev/console"        /* place to log errors */
  1064. X#define    DEFAULTS "/etc/default/%s"    /* name of defaults file */
  1065. X#define    ISSUE     "/etc/issue"        /* name of the issue file;
  1066. X                       say "#undef ISSUE" to turn off
  1067. X                       the issue feature */
  1068. X#define    LOGIN     "/bin/login"        /* name of login program */
  1069. X
  1070. X
  1071. X/*  Special cases
  1072. X */
  1073. X
  1074. X#undef    TRS16                /* you are a Tandy 6000 or equivilent */
  1075. X
  1076. X
  1077. X/*  You probably shouldn't fool with these
  1078. X */
  1079. X
  1080. X#define    MAXDEF     100            /* max # lines in defaults file */
  1081. X#define    MAXLINE     256            /* max # chars in a line */
  1082. X#define    MAXID     12            /* max # chars in Gtab Id */
  1083. X#define    MAXLOGIN 80            /* max # chars in Gtab Login */
  1084. X
  1085. X
  1086. X/* end of tune.h */
  1087. !STUFFY!FUNK!
  1088. echo Extracting getty.h
  1089. sed >getty.h <<'!STUFFY!FUNK!' -e 's/X//'
  1090. X/*
  1091. X**    $Id: getty.h,v 2.0 90/09/19 19:59:15 paul Rel $
  1092. X**
  1093. X**    Included by all getty modules
  1094. X*/
  1095. X
  1096. X/*
  1097. X**    Copyright 1989,1990 by Paul Sutcliffe Jr.
  1098. X**
  1099. X**    Permission is hereby granted to copy, reproduce, redistribute,
  1100. X**    or otherwise use this software as long as: there is no monetary
  1101. X**    profit gained specifically from the use or reproduction or this
  1102. X**    software, it is not sold, rented, traded or otherwise marketed,
  1103. X**    and this copyright notice is included prominently in any copy
  1104. X**    made.
  1105. X**
  1106. X**    The author make no claims as to the fitness or correctness of
  1107. X**    this software for any use whatsoever, and it is provided as is. 
  1108. X**    Any use of this software is at the user's own risk.
  1109. X*/
  1110. X
  1111. X/*
  1112. X**    $Log:    getty.h,v $
  1113. X**    Revision 2.0  90/09/19  19:59:15  paul
  1114. X**    Initial 2.0 release
  1115. X**    
  1116. X*/
  1117. X
  1118. X
  1119. X#include "config.h"
  1120. X
  1121. X#include <stdio.h>
  1122. X#include <string.h>
  1123. X#include <sys/types.h>
  1124. X#include <termio.h>
  1125. X#ifdef    IOCTL
  1126. X#include <sys/ioctl.h>
  1127. X#endif    /* IOCTL */
  1128. X#ifdef    FCNTL
  1129. X#include <fcntl.h>
  1130. X#endif    /* FCNTL */
  1131. X#include <utmp.h>
  1132. X
  1133. X#include "extern.h"
  1134. X#include "funcs.h"
  1135. X
  1136. X
  1137. X/*    General purpose defines
  1138. X */
  1139. X
  1140. X#ifndef    FALSE
  1141. X#define    FALSE    (0)
  1142. X#endif    /* FALSE */
  1143. X#ifndef    TRUE
  1144. X#define    TRUE    (1)
  1145. X#endif    /* TRUE */
  1146. X
  1147. X#define OK    (0)
  1148. X
  1149. X#define SUCCESS    (0)        /* normal return */
  1150. X#define FAIL    (-1)        /* error return */
  1151. X
  1152. X#define    STDIN    fileno(stdin)
  1153. X#define    STDOUT    fileno(stdout)
  1154. X
  1155. X#define strequal(s1, s2)    (strcmp(s1, s2) == 0)
  1156. X#define strnequal(s1, s2, n)    (strncmp(s1, s2, n) == 0)
  1157. X#define    strncopy(s1, s2)    (strncpy(s1, s2, sizeof(s1)))
  1158. X
  1159. Xtypedef    struct termio    TERMIO;
  1160. X
  1161. X
  1162. X#ifdef    DEBUG
  1163. X
  1164. X/* debug levels
  1165. X */
  1166. X#define    D_OPT    0001        /* option settings */
  1167. X#define    D_DEF    0002        /* defaults file processing */
  1168. X#define    D_UTMP    0004        /* utmp/wtmp processing */
  1169. X#define    D_INIT    0010        /* line initialization (INIT) */
  1170. X#define    D_GTAB    0020        /* gettytab file processing */
  1171. X#define    D_GETL    0040        /* get login name routine */
  1172. X#define    D_RUN    0100        /* other runtime diagnostics */
  1173. X
  1174. X#ifdef    UUGETTY
  1175. X#define    D_LOCK    0200        /* uugetty lockfile processing */
  1176. X#endif    /* UUGETTY */
  1177. X
  1178. X/* debug defs
  1179. X */
  1180. X#define    debug1(a,b)        dprint(a,b)
  1181. X#define    debug2(a,b)        debug(a,b)
  1182. X#define    debug3(a,b,c)        debug(a,b,c)
  1183. X#define    debug4(a,b,c,d)        debug(a,b,c,d)
  1184. X#define    debug5(a,b,c,d,e)    debug(a,b,c,d,e)
  1185. X#define    debug6(a,b,c,d,e,f)    debug(a,b,c,d,e,f)
  1186. X
  1187. X#else    /* DEBUG */
  1188. X
  1189. X#define    debug1(a,b)        /* define to nothing, disables debugging */
  1190. X#define    debug2(a,b)
  1191. X#define    debug3(a,b,c)
  1192. X#define    debug4(a,b,c,d)
  1193. X#define    debug5(a,b,c,d,e)
  1194. X#define    debug6(a,b,c,d,e,f)
  1195. X
  1196. X#endif    /* DEBUG */
  1197. X
  1198. X
  1199. X/* end of getty.h */
  1200. !STUFFY!FUNK!
  1201. echo Extracting man/putenv.m4
  1202. sed >man/putenv.m4 <<'!STUFFY!FUNK!' -e 's/X//'
  1203. X.\" +----------
  1204. X.\" |    $Id: putenv.m4,v 2.0 90/09/19 20:14:13 paul Rel $
  1205. X.\" |
  1206. X.\" |    PUTENV man page.
  1207. X.\" |
  1208. X.\" |    Copyright 1989,1990 by Paul Sutcliffe Jr.
  1209. X.\" |
  1210. X.\" |    Permission is hereby granted to copy, reproduce, redistribute,
  1211. X.\" |    or otherwise use this software as long as: there is no monetary
  1212. X.\" |    profit gained specifically from the use or reproduction or this
  1213. X.\" |    software, it is not sold, rented, traded or otherwise marketed,
  1214. X.\" |    and this copyright notice is included prominently in any copy
  1215. X.\" |    made.
  1216. X.\" |
  1217. X.\" |    The author make no claims as to the fitness or correctness of
  1218. X.\" |    this software for any use whatsoever, and it is provided as is. 
  1219. X.\" |    Any use of this software is at the user's own risk.
  1220. X.\" |
  1221. X.\"
  1222. X.\" +----------
  1223. X.\" |    $Log:    putenv.m4,v $
  1224. X.\" |    Revision 2.0  90/09/19  20:14:13  paul
  1225. X.\" |    Initial 2.0 release
  1226. X.\" |    
  1227. X.\" |    
  1228. X.\" 
  1229. X.\" +----------
  1230. X.\" | M4 configuration
  1231. X.\"
  1232. Xinclude(config.m4).\"
  1233. X.\"
  1234. X.\" +----------
  1235. X.\" | Manpage source follows:
  1236. X.\"
  1237. X.TH PUTENV _library_section_
  1238. X.SH NAME
  1239. Xputenv \- change or add value to environment
  1240. X.SH SYNOPSIS
  1241. X.B int putenv(\fIstring\fB)\fR;
  1242. X.br
  1243. X.B char *\fIstring\fR;
  1244. X.SH DESCRIPTION
  1245. X.I String
  1246. Xpoints to a string of the form
  1247. X.I name=value.
  1248. X.I Putenv
  1249. Xmakes the value of the environment variable
  1250. X.I name
  1251. Xequal to
  1252. X.I value
  1253. Xby altering an existing variable or creating a new one.  In either
  1254. Xcase, the string pointed to by
  1255. X.I string
  1256. Xbecomes part of the environment, so altering the string changes
  1257. Xthe environment.  The space used by
  1258. X.I string
  1259. Xis no longer used once a new string\-defining
  1260. X.I name
  1261. Xis passed to
  1262. X.I putenv.
  1263. X.SH "RETURN VALUE"
  1264. X.I Putenv
  1265. Xreturns non\-zero if it was unable to obtain enough space via
  1266. X.I malloc
  1267. Xfor an expanded environment, otherwise zero.
  1268. X.SH "SEE ALSO"
  1269. Xexec(_system_section_),
  1270. Xgetenv(_library_section_),
  1271. Xmalloc(_library_section_),
  1272. Xenviron(_file_section_)
  1273. X.SH WARNINGS
  1274. X.I Putenv
  1275. Xmanipulates the environment pointed to by
  1276. X.I environ,
  1277. Xand can be used in conjunction with
  1278. X.I getenv.
  1279. XHowever,
  1280. X.I envp
  1281. X(the third argument to
  1282. X.IR main )
  1283. Xis not changed.
  1284. X.PP
  1285. XThis routine uses
  1286. X.IR malloc (_library_section_)
  1287. Xto enlarge the environment.
  1288. X.PP
  1289. XAfter
  1290. X.I putenv
  1291. Xis called, environmental variables are not in alphabetical order.
  1292. X.PP
  1293. XA potential error is to call
  1294. X.I putenv
  1295. Xwith an automatic variable as the argument, then exit the calling
  1296. Xfunction while
  1297. X.I string
  1298. Xis still part of the environment.
  1299. X.SH AUTHOR
  1300. X.nf
  1301. XPaul Sutcliffe, Jr.  <paul@devon.lns.pa.us>
  1302. XUUCP: ...!rutgers!devon!paul
  1303. !STUFFY!FUNK!
  1304. echo Extracting putenv.c
  1305. sed >putenv.c <<'!STUFFY!FUNK!' -e 's/X//'
  1306. X/*
  1307. X**    $Id: putenv.c,v 2.0 90/09/19 20:16:07 paul Rel $
  1308. X**
  1309. X**    Implements putenv(3c).
  1310. X*/
  1311. X
  1312. X/*
  1313. X**    Copyright 1989,1990 by Paul Sutcliffe Jr.
  1314. X**
  1315. X**    Permission is hereby granted to copy, reproduce, redistribute,
  1316. X**    or otherwise use this software as long as: there is no monetary
  1317. X**    profit gained specifically from the use or reproduction or this
  1318. X**    software, it is not sold, rented, traded or otherwise marketed,
  1319. X**    and this copyright notice is included prominently in any copy
  1320. X**    made.
  1321. X**
  1322. X**    The author make no claims as to the fitness or correctness of
  1323. X**    this software for any use whatsoever, and it is provided as is. 
  1324. X**    Any use of this software is at the user's own risk.
  1325. X*/
  1326. X
  1327. X/*
  1328. X**    $Log:    putenv.c,v $
  1329. X**    Revision 2.0  90/09/19  20:16:07  paul
  1330. X**    Initial 2.0 release
  1331. X**    
  1332. X*/
  1333. X
  1334. X
  1335. X#include "getty.h"
  1336. X
  1337. X#if defined(RCSID) && !defined(lint)
  1338. Xstatic char *RcsId =
  1339. X"@(#)$Id: putenv.c,v 2.0 90/09/19 20:16:07 paul Rel $";
  1340. X#endif
  1341. X
  1342. X#ifndef    MAXENV
  1343. X#define    MAXENV    64    /* max # lines in envorinment */
  1344. X#endif    /* MAXENV */
  1345. X
  1346. X
  1347. X/*
  1348. X**    putenv() - change or add value to environment
  1349. X**
  1350. X**    Returns non-zero if an error occurrs, zero otherwise.
  1351. X*/
  1352. X
  1353. Xextern char **environ;
  1354. X
  1355. Xint
  1356. Xputenv(s)
  1357. Xchar *s;
  1358. X{
  1359. X    register int i;
  1360. X    register char *p;
  1361. X    char *q, **envp, *env[MAXENV];
  1362. X    boolean match = FALSE;
  1363. X
  1364. X    if (s == (char *) NULL)
  1365. X        return(FAIL);    /* can't add NULL to the environment */
  1366. X
  1367. X    if ((p = malloc((unsigned) strlen(s)+1)) == (char *) NULL)
  1368. X        return(FAIL);    /* malloc failed */
  1369. X
  1370. X    (void) strcpy(p, s);
  1371. X    if ((q = index(p, '=')) == (char *) NULL) {
  1372. X        free(p);
  1373. X        return(FAIL);    /* not in the form ``name=value'' */
  1374. X    }
  1375. X
  1376. X    *q = '\0';        /* split into two fields, name & value */
  1377. X
  1378. X    /* copy the environ list, replacing `s' if a match is found
  1379. X     */
  1380. X    for (i=0, envp=environ; *envp != (char *) NULL; i++, envp++) {
  1381. X        if (strnequal(*envp, p, strlen(p))) {
  1382. X            match = TRUE;
  1383. X            env[i] = s;
  1384. X        } else
  1385. X            env[i] = *envp;
  1386. X    }
  1387. X
  1388. X    if (!match) {
  1389. X        *q = '=';    /* put back the equal sign */
  1390. X        env[i++] = p;    /* add p to env list */
  1391. X    } else
  1392. X        free(p);    /* not needed, s replaced old value */
  1393. X
  1394. X    env[i++] = (char *) NULL;
  1395. X
  1396. X    /* now dup env to make new environment
  1397. X     */
  1398. X    if ((envp = (char **) malloc((unsigned) (i*sizeof(char *)))) ==
  1399. X        (char **) NULL) {
  1400. X        return(FAIL);
  1401. X    }
  1402. X    environ = envp;        /* point to new area */
  1403. X    for (i=0; env[i] != (char *) NULL; i++)
  1404. X        *envp++ = env[i];
  1405. X    *envp = (char *) NULL;
  1406. X
  1407. X    return(SUCCESS);
  1408. X}
  1409. X
  1410. X
  1411. X/* end of putenv.c */
  1412. !STUFFY!FUNK!
  1413. echo Extracting sample.files
  1414. sed >sample.files <<'!STUFFY!FUNK!' -e 's/X//'
  1415. XThese examples are from the author's system.
  1416. X
  1417. XSample `/etc/issue' file:
  1418. X+---------
  1419. X| Devon Computer Services, Lancaster, PA  (@S)
  1420. X| Tandy XENIX/68000 Version @V
  1421. X+---------
  1422. X
  1423. XSample `/etc/default/uugetty' file:
  1424. X+---------
  1425. X| ISSUE=[@D, @T]\nDevon Computer Services - Tandy 6000  (@S)\n
  1426. X| INIT="" A\pA\pA\pAT\r OK\r\n-ATZ\r-OK\r\n ATZ\r OK\r\n
  1427. X| TIMEOUT=60
  1428. X| #
  1429. X| # set S0=0 (no answer); wait for RING, then go to answer mode and
  1430. X| # look for the right speed
  1431. X| #
  1432. X| WAITFOR=RING
  1433. X| CONNECT="" ATA\r CONNECT\s\A
  1434. X+---------
  1435. X
  1436. XSample `/etc/gettydefs' file:
  1437. X+---------
  1438. X| #
  1439. X| # Sample /etc/gettydefs file; use at your own risk!
  1440. X| #
  1441. X| # default entry:
  1442. X| 0# B9600 CS8 # B9600 CLOCAL TAB3 ECHO SANE #login: #0
  1443. X| 
  1444. X| # to toggle between 300 and 1200 baud on a modem line:
  1445. X| #
  1446. X| 1# B300 ISTRIP CS8 CR1 # B300 HUPCL CS8 TAB3 SANE CR1 #login: #2
  1447. X| 
  1448. X| 2# B1200 ISTRIP CS8 # B1200 HUPCL CS8 TAB3 SANE #login: #1
  1449. X| 
  1450. X| # to toggle between 300, 1200 and 2400 baud on a modem line:
  1451. X| #
  1452. X| 3# B300 ISTRIP CS8 CR1 # B300 HUPCL CS8 TAB3 SANE CR1 #login: #4
  1453. X| 
  1454. X| 4# B1200 ISTRIP CS8 # B1200 HUPCL CS8 TAB3 SANE #login: #5
  1455. X| 
  1456. X| 5# B2400 ISTRIP CS8 # B2400 HUPCL CS8 TAB3 SANE #login: #3
  1457. X| 
  1458. X| # a telebit tb plus:
  1459. X| #
  1460. X| 6# B9600 ISTRIP CS8 # B9600 HUPCL CS8 TAB3 SANE #FAST login: #7
  1461. X| 
  1462. X| 7# B2400 ISTRIP CS8 # B2400 HUPCL CS8 TAB3 SANE #login: #8
  1463. X| 
  1464. X| 8# B1200 ISTRIP CS8 # B1200 HUPCL CS8 TAB3 SANE #login: #6
  1465. X| 
  1466. X| # various hard-wired speeds
  1467. X| a# B50 ISTRIP CS8 NL1 CR3 TAB2 # B50 CS8 CLOCAL SANE NL1 CR3 TAB2 #login: #a
  1468. X| 
  1469. X| b# B75 ISTRIP CS8 NL1 CR2 TAB2 # B75 CS8 CLOCAL SANE NL1 CR2 TAB2 #login: #b
  1470. X| 
  1471. X| c# B110 ISTRIP CS8 NL1 CR1 TAB1 # B110 CS8 CLOCAL SANE NL1 CR1 TAB1 #login: #c
  1472. X| 
  1473. X| d# B134 ISTRIP CS8 NL1 CR1 TAB1 # B134 CS8 CLOCAL SANE NL1 CR1 TAB1 #login: #d
  1474. X| 
  1475. X| e# B150 ISTRIP CS8 NL1 CR1 # B150 CS8 CLOCAL TAB3 SANE NL1 CR1 #login: #e
  1476. X| 
  1477. X| f# B200 ISTRIP CS8 NL1 CR1 # B200 CS8 CLOCAL TAB3 SANE NL1 CR1 #login: #f
  1478. X| 
  1479. X| g# B300 ISTRIP CS8 CR1 # B300 CS8 CLOCAL TAB3 SANE CR1 #login: #g
  1480. X| 
  1481. X| h# B600 ISTRIP CS8 # B600 CS8 CLOCAL TAB3 SANE #login: #h
  1482. X| 
  1483. X| i# B1200 ISTRIP CS8 # B1200 CS8 CLOCAL TAB3 SANE #login: #i
  1484. X| 
  1485. X| j# B1800 ISTRIP CS8 # B1800 CS8 CLOCAL TAB3 SANE #login: #j
  1486. X| 
  1487. X| k# B2400 ISTRIP CS8 # B2400 CS8 CLOCAL TAB3 SANE #login: #k
  1488. X| 
  1489. X| l# B4800 ISTRIP CS8 # B4800 CS8 CLOCAL TAB3 SANE #login: #l
  1490. X| 
  1491. X| m# B9600 ISTRIP CS8 # B9600 CS8 CLOCAL TAB3 SANE #login: #m
  1492. X| 
  1493. X+---------
  1494. !STUFFY!FUNK!
  1495. echo Extracting getutent.c
  1496. sed >getutent.c <<'!STUFFY!FUNK!' -e 's/X//'
  1497. X/*
  1498. X**    $Id: getutent.c,v 2.0 90/09/19 20:00:51 paul Rel $
  1499. X**
  1500. X**    Implements getutent(3).
  1501. X*/
  1502. X
  1503. X/*
  1504. X**    Copyright 1989,1990 by Paul Sutcliffe Jr.
  1505. X**
  1506. X**    Permission is hereby granted to copy, reproduce, redistribute,
  1507. X**    or otherwise use this software as long as: there is no monetary
  1508. X**    profit gained specifically from the use or reproduction or this
  1509. X**    software, it is not sold, rented, traded or otherwise marketed,
  1510. X**    and this copyright notice is included prominently in any copy
  1511. X**    made.
  1512. X**
  1513. X**    The author make no claims as to the fitness or correctness of
  1514. X**    this software for any use whatsoever, and it is provided as is. 
  1515. X**    Any use of this software is at the user's own risk.
  1516. X*/
  1517. X
  1518. X/*
  1519. X**    $Log:    getutent.c,v $
  1520. X**    Revision 2.0  90/09/19  20:00:51  paul
  1521. X**    Initial 2.0 release
  1522. X**    
  1523. X*/
  1524. X
  1525. X
  1526. X#include "getty.h"
  1527. X
  1528. X#if defined(RCSID) && !defined(lint)
  1529. Xstatic char *RcsId =
  1530. X"@(#)$Id: getutent.c,v 2.0 90/09/19 20:00:51 paul Rel $";
  1531. X#endif
  1532. X
  1533. Xtypedef    struct utmp    UTMP;
  1534. X
  1535. Xstatic    char    *utmpfil = UTMP_FILE;    /* default utmp file */
  1536. Xstatic    FILE    *ufp = (FILE *) NULL;    /* file pointer to utmp file */
  1537. X                    /* NULL = no utmp file open  */
  1538. Xstatic    UTMP    ut;            /* buffer for utmp record */
  1539. X
  1540. X
  1541. X/*
  1542. X**    getutent() - get next valid utmp entry
  1543. X**
  1544. X**    Returns (UTMP*)NULL if no vaild entry found.
  1545. X*/
  1546. X
  1547. XUTMP *
  1548. Xgetutent()
  1549. X{
  1550. X    if (ufp == (FILE *) NULL)
  1551. X        if ((ufp = fopen(utmpfil, "r+")) == (FILE *) NULL)
  1552. X            return((UTMP *) NULL);
  1553. X
  1554. X    do {
  1555. X        if (fread((char *)&ut, sizeof(ut), 1, ufp) != 1)
  1556. X            return((UTMP *) NULL);
  1557. X
  1558. X    } while (ut.ut_name[0] == '\0');    /* valid entry? */
  1559. X
  1560. X    return(&ut);
  1561. X}
  1562. X
  1563. X
  1564. X/*
  1565. X**    getutline() - get utmp entry that matches line.
  1566. X**
  1567. X**    Returns (UTMP*)NULL if no match found.
  1568. X*/
  1569. X
  1570. XUTMP *
  1571. Xgetutline(line)
  1572. Xregister UTMP *line;
  1573. X{
  1574. X    do {
  1575. X        if (strequal(ut.ut_line, line->ut_line))
  1576. X            return(&ut);    /* match! */
  1577. X
  1578. X    } while (getutent() != NULL);
  1579. X
  1580. X    return((UTMP *) NULL);
  1581. X}
  1582. X
  1583. X
  1584. X/*
  1585. X**    setutent() - rewind utmp back to beginning
  1586. X*/
  1587. X
  1588. Xvoid
  1589. Xsetutent()
  1590. X{
  1591. X    if (ufp != (FILE *) NULL)
  1592. X        rewind(ufp);
  1593. X}
  1594. X    
  1595. X
  1596. X/*
  1597. X**    endutent() - close utmp file
  1598. X*/
  1599. X
  1600. Xvoid
  1601. Xendutent()
  1602. X{
  1603. X    if (ufp != (FILE *) NULL) {
  1604. X        (void) fclose(ufp);
  1605. X        ufp = (FILE *) NULL;
  1606. X    }
  1607. X}
  1608. X
  1609. X
  1610. X/*
  1611. X**    utmpname() - change utmp file name to "file"
  1612. X*/
  1613. X
  1614. Xvoid
  1615. Xutmpname(file)
  1616. Xregister char *file;
  1617. X{
  1618. X    endutent();
  1619. X    utmpfil = strdup(file);
  1620. X}
  1621. X
  1622. X
  1623. X/* end of getutent.c */
  1624. !STUFFY!FUNK!
  1625. echo Extracting man/Makefile.SH
  1626. sed >man/Makefile.SH <<'!STUFFY!FUNK!' -e 's/X//'
  1627. X:
  1628. X# $Id: Makefile.SH,v 2.0 90/09/19 20:07:16 paul Rel $
  1629. X#
  1630. X# Creates man/Makefile for getty distribution
  1631. X#
  1632. X# $Log:    Makefile.SH,v $
  1633. X# Revision 2.0  90/09/19  20:07:16  paul
  1634. X# Initial 2.0 release
  1635. X# 
  1636. X# 
  1637. X
  1638. Xcase $CONFIG in
  1639. X'')
  1640. X    if test ! -f config.sh; then
  1641. X    ln ../config.sh . || \
  1642. X    ln ../../config.sh . || \
  1643. X    ln ../../../config.sh . || \
  1644. X    (echo "Can't find config.sh."; exit 1)
  1645. X    fi
  1646. X    . config.sh
  1647. X    ;;
  1648. Xesac
  1649. Xcase "$0" in
  1650. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  1651. Xesac
  1652. X
  1653. Xgtab=`basename $gettytab`
  1654. Xall="getty.1m $gtab.4 issue.4"
  1655. Xman="getty.man $gtab.man issue.man"
  1656. Xcase "$d_getutent" in
  1657. X"$undef")
  1658. X    all="$all getutent.3"
  1659. X    man="$man getutent.man"
  1660. X    ;;
  1661. Xesac
  1662. Xcase "$d_strdup" in
  1663. X"$undef")
  1664. X    all="$all strdup.3"
  1665. X    man="$man strdup.man"
  1666. X    ;;
  1667. Xesac
  1668. Xcase "$d_putenv" in
  1669. X"$undef")
  1670. X    all="$all putenv.3"
  1671. X    man="$man putenv.man"
  1672. X    ;;
  1673. Xesac
  1674. X
  1675. Xecho "Extracting man/Makefile (with variable substitutions)"
  1676. X$spitshell >Makefile <<!GROK!THIS!
  1677. X#
  1678. X# Makefile for getty man pages
  1679. X#
  1680. X
  1681. XSHELL=    /bin/sh
  1682. X# no nroff?  get Henry Spencer's AWF!
  1683. XROFF=    nroff -man
  1684. X
  1685. XSRC=    ..
  1686. XTUNE=    $(SRC)/tune.h
  1687. XRELEASE=$(SRC)/release.h
  1688. X
  1689. X# what to make
  1690. Xall:    $all
  1691. X
  1692. Xman:    $man
  1693. X
  1694. Xinstall:
  1695. X    @echo "Manpage installation must be done manually, Sorry."
  1696. X
  1697. X# how to make it
  1698. X.SUFFIXES: .m4 .3 .man
  1699. X
  1700. X.m4.3:
  1701. X    m4 \$*.m4 > \$*.3
  1702. X
  1703. X.3.man:
  1704. X    $(ROFF) \$*.3 > \$*.man
  1705. X
  1706. X# dependencies
  1707. Xconfig.m4:    $(SRC)/config.sh $(TUNE) $(RELEASE)
  1708. X    chmod +x makeconfig
  1709. X    ./makeconfig
  1710. X
  1711. Xgetty.1m:    getty.m4 config.m4
  1712. X    m4 getty.m4 > getty.1m
  1713. X
  1714. Xgetty.man:    getty.1m
  1715. X    $(ROFF) getty.1m > getty.man
  1716. X
  1717. X$gtab.4:    gettytab.m4 config.m4
  1718. X    m4 gettytab.m4 > $gtab.4
  1719. X
  1720. X$gtab.man:    $gtab.4
  1721. X    $(ROFF) $gtab.4 > $gtab.man
  1722. X
  1723. Xissue.4:    issue.m4 config.m4
  1724. X    m4 issue.m4 > issue.4
  1725. X
  1726. Xissue.man:    issue.4
  1727. X    $(ROFF) issue.4 > issue.man
  1728. X
  1729. Xgetutent.3:    getutent.m4 config.m4
  1730. X
  1731. Xgetutent.man:    getutent.3
  1732. X
  1733. Xstrdup.3:    strdup.m4 config.m4
  1734. X
  1735. Xstrdup.man:    strdup.3
  1736. X
  1737. Xputenv.3:    putenv.m4 config.m4
  1738. X
  1739. Xputenv.man:    putenv.3
  1740. X
  1741. Xclean:
  1742. X    rm -f *.out config.m4 config.sh core
  1743. X
  1744. Xclobber: clean
  1745. X    rm -f *.1m *.[34] *.man
  1746. X
  1747. X!GROK!THIS!
  1748. Xchmod 644 Makefile
  1749. X$eunicefix Makefile
  1750. !STUFFY!FUNK!
  1751. echo Extracting MANIFEST
  1752. sed >MANIFEST <<'!STUFFY!FUNK!' -e 's/X//'
  1753. XAfter all the getty kits are run you should have the following files:
  1754. X
  1755. XFilename        Kit Description
  1756. X--------        --- -----------
  1757. XConfigure                2 Determines system configuration.
  1758. XMANIFEST                 4 Packing list.
  1759. XMakefile.SH              4 Creates Makefile file.
  1760. XREADME                   1 The Instructions.
  1761. Xconfig.h.SH              4 Creates config.h file.
  1762. Xdefaults.c               3 Routines to access the runtime defaults file.
  1763. Xdefaults.h               5 Defines the defaults file structures.
  1764. Xextern.h                 3 Defines all external values.
  1765. Xfuncs.c                  3 Miscellaneous routines.
  1766. Xfuncs.h                  5 Definitions for miscellaneous routines.
  1767. Xgetty.h                  4 Common header for all modules.
  1768. Xgetutent.c               4 Implements getutent(3).
  1769. Xmain.c                   1 Main body of program.
  1770. Xmakedep.SH               4 Creates makedep file.
  1771. Xman/Makefile.SH          4 Creates man/Makefile file.
  1772. Xman/README               1 Notes about the manual pages.
  1773. Xman/getty.m4             3 M4 source to getty manpage.
  1774. Xman/gettytab.m4          4 M4 source to gettytab manpage.
  1775. Xman/getutent.m4          4 M4 source to getutent manpage.
  1776. Xman/issue.m4             4 M4 source to issue manpage.
  1777. Xman/makeconfig           4 Creates config.m4 file.
  1778. Xman/putenv.m4            4 M4 source to putenv manpage.
  1779. Xman/strdup.m4            4 M4 source to strdup manpage.
  1780. Xpatchlevel.h             3 Getty patchlevel.
  1781. Xputenv.c                 4 Implements putenv(3c).
  1782. Xrelease.h                1 Getty release/date.
  1783. Xsample.files             4 Sample ancillary files.
  1784. Xstrdup.c                 5 Implements strdup(3c).
  1785. Xtable.c                  1 Routines to process the gettytab file.
  1786. Xtable.h                  4 Defines the gettytab structures.
  1787. Xtune.H                   4 Sample tune.h file.
  1788. !STUFFY!FUNK!
  1789. echo Extracting man/strdup.m4
  1790. sed >man/strdup.m4 <<'!STUFFY!FUNK!' -e 's/X//'
  1791. X.\" +----------
  1792. X.\" |    $Id: strdup.m4,v 2.0 90/09/19 20:14:57 paul Rel $
  1793. X.\" |
  1794. X.\" |    STRDUP man page.
  1795. X.\" |
  1796. X.\" |    Copyright 1989,1990 by Paul Sutcliffe Jr.
  1797. X.\" |
  1798. X.\" |    Permission is hereby granted to copy, reproduce, redistribute,
  1799. X.\" |    or otherwise use this software as long as: there is no monetary
  1800. X.\" |    profit gained specifically from the use or reproduction or this
  1801. X.\" |    software, it is not sold, rented, traded or otherwise marketed,
  1802. X.\" |    and this copyright notice is included prominently in any copy
  1803. X.\" |    made.
  1804. X.\" |
  1805. X.\" |    The author make no claims as to the fitness or correctness of
  1806. X.\" |    this software for any use whatsoever, and it is provided as is. 
  1807. X.\" |    Any use of this software is at the user's own risk.
  1808. X.\" |
  1809. X.\"
  1810. X.\" +----------
  1811. X.\" |    $Log:    strdup.m4,v $
  1812. X.\" |    Revision 2.0  90/09/19  20:14:57  paul
  1813. X.\" |    Initial 2.0 release
  1814. X.\" |    
  1815. X.\" |    
  1816. X.\" 
  1817. X.\" +----------
  1818. X.\" | M4 configuration
  1819. X.\"
  1820. Xinclude(config.m4).\"
  1821. X.\"
  1822. X.\" +----------
  1823. X.\" | Manpage source follows:
  1824. X.\"
  1825. X.TH STRDUP _library_section_
  1826. X.SH NAME
  1827. Xstrdup \- duplicate a string in memory
  1828. X.SH SYNOPSIS
  1829. X.B char *strdup(\fIstring\fB)\fR;
  1830. X.br
  1831. X.B char *\fIstring\fR;
  1832. X.SH DESCRIPTION
  1833. X.I Strdup
  1834. Xallocates storage space (with a call to
  1835. X.IR malloc (_library_section_))
  1836. Xfor a copy of
  1837. X.I string
  1838. Xand returns a pointer to the storage space containing the copied
  1839. Xstring.
  1840. X.SH "RETURN VALUE"
  1841. X.I Strdup
  1842. Xreturns NULL if storage cannot be allocated.  Otherwise, a valid
  1843. Xpointer is returned.
  1844. X.SH "SEE ALSO"
  1845. Xmalloc(_library_section_),
  1846. Xstring(_library_section_)
  1847. X.SH AUTHOR
  1848. X.nf
  1849. XPaul Sutcliffe, Jr.  <paul@devon.lns.pa.us>
  1850. XUUCP: ...!rutgers!devon!paul
  1851. !STUFFY!FUNK!
  1852. echo Extracting table.h
  1853. sed >table.h <<'!STUFFY!FUNK!' -e 's/X//'
  1854. X/*
  1855. X**    $Id: table.h,v 2.0 90/09/19 20:19:21 paul Rel $
  1856. X**
  1857. X**    Defines the structures and functions used to parse the
  1858. X**    gettytab file.
  1859. X*/
  1860. X
  1861. X/*
  1862. X**    Copyright 1989,1990 by Paul Sutcliffe Jr.
  1863. X**
  1864. X**    Permission is hereby granted to copy, reproduce, redistribute,
  1865. X**    or otherwise use this software as long as: there is no monetary
  1866. X**    profit gained specifically from the use or reproduction or this
  1867. X**    software, it is not sold, rented, traded or otherwise marketed,
  1868. X**    and this copyright notice is included prominently in any copy
  1869. X**    made.
  1870. X**
  1871. X**    The author make no claims as to the fitness or correctness of
  1872. X**    this software for any use whatsoever, and it is provided as is. 
  1873. X**    Any use of this software is at the user's own risk.
  1874. X*/
  1875. X
  1876. X/*
  1877. X**    $Log:    table.h,v $
  1878. X**    Revision 2.0  90/09/19  20:19:21  paul
  1879. X**    Initial 2.0 release
  1880. X**    
  1881. X*/
  1882. X
  1883. X
  1884. X#ifndef    LDISC0
  1885. X#define    LDISC0    0            /* default line discipline */
  1886. X#endif    /* LDISC0 */
  1887. X
  1888. X#ifndef    GETTYTAB
  1889. X#define    GETTYTAB  "/etc/gettydefs"    /* default name of the gettytab file */
  1890. X#endif    /* GETTYTAB */
  1891. X
  1892. X/*     Modes for gtabvalue()
  1893. X */
  1894. X#define    G_CHECK    0            /* nothing */
  1895. X#define    G_FIND    1            /* find requested entry only */
  1896. X#define    G_FORCE    2            /* make alternate choices */
  1897. X
  1898. Xtypedef    struct Gettytab {
  1899. X    char    *cur_id;        /* current label */
  1900. X    TERMIO    itermio;        /* initial termio flags */
  1901. X    TERMIO    ftermio;        /* final termio flags */
  1902. X    char    *login;            /* login prompt */
  1903. X    char    *next_id;        /* next label */
  1904. X} GTAB;
  1905. X
  1906. Xtypedef    struct SymTab {
  1907. X    char    *symbol;        /* symbolic name */
  1908. X    ushort    value;            /* actual value */
  1909. X} SYMTAB;
  1910. X
  1911. XGTAB    *gtabvalue();
  1912. X
  1913. X
  1914. X/* end of table.h */
  1915. !STUFFY!FUNK!
  1916. echo Extracting man/issue.m4
  1917. sed >man/issue.m4 <<'!STUFFY!FUNK!' -e 's/X//'
  1918. X.\" +----------
  1919. X.\" |    $Id: issue.m4,v 2.0 90/09/19 20:13:21 paul Rel $
  1920. X.\" |
  1921. X.\" |    ISSUE man page.
  1922. X.\" |
  1923. X.\" |    Copyright 1989,1990 by Paul Sutcliffe Jr.
  1924. X.\" |
  1925. X.\" |    Permission is hereby granted to copy, reproduce, redistribute,
  1926. X.\" |    or otherwise use this software as long as: there is no monetary
  1927. X.\" |    profit gained specifically from the use or reproduction or this
  1928. X.\" |    software, it is not sold, rented, traded or otherwise marketed,
  1929. X.\" |    and this copyright notice is included prominently in any copy
  1930. X.\" |    made.
  1931. X.\" |
  1932. X.\" |    The author make no claims as to the fitness or correctness of
  1933. X.\" |    this software for any use whatsoever, and it is provided as is. 
  1934. X.\" |    Any use of this software is at the user's own risk.
  1935. X.\" |
  1936. X.\"
  1937. X.\" +----------
  1938. X.\" |    $Log:    issue.m4,v $
  1939. X.\" |    Revision 2.0  90/09/19  20:13:21  paul
  1940. X.\" |    Initial 2.0 release
  1941. X.\" |    
  1942. X.\" |    
  1943. X.\" 
  1944. X.\" +----------
  1945. X.\" | M4 configuration
  1946. X.\"
  1947. Xinclude(config.m4).\"
  1948. X.\"
  1949. X.\" +----------
  1950. X.\" | Manpage source follows:
  1951. X.\"
  1952. X.TH ISSUE _file_section_
  1953. X.SH NAME
  1954. Xissue \- issue identification file
  1955. X.SH DESCRIPTION
  1956. XThe file
  1957. X.B _issue_
  1958. Xcontains the
  1959. X.I issue
  1960. Xor project identification to be printed as a login prompt.  This
  1961. Xis an ASCII file which is read by the program
  1962. X.IR getty (_mcmd_section_)
  1963. Xand then written to the terminal just prior to printing the
  1964. X.I login:
  1965. Xprompt.
  1966. X.PP
  1967. XThe line(s) may contain various
  1968. X.BI @ char
  1969. Xand
  1970. X\fB\\\fIchar\fR
  1971. Xparameters.  These are described in full in the
  1972. X.IR getty (_mcmd_section_)
  1973. Xsection PROMPT SUBSTITUTIONS.
  1974. X.SH FILES
  1975. X_issue_
  1976. X.SH "SEE ALSO"
  1977. Xgetty(_mcmd_section_)
  1978. !STUFFY!FUNK!
  1979. echo ""
  1980. echo "End of kit 4 (of 5)"
  1981. cat /dev/null >kit4isdone
  1982. run=''
  1983. config=''
  1984. for iskit in 1 2 3 4 5; do
  1985.     if test -f kit${iskit}isdone; then
  1986.     run="$run $iskit"
  1987.     else
  1988.     todo="$todo $iskit"
  1989.     fi
  1990. done
  1991. case $todo in
  1992.     '')
  1993.     echo "You have run all your kits.  Please read README and then type Configure."
  1994.     chmod 755 Configure
  1995.     ;;
  1996.     *)  echo "You have run$run."
  1997.     echo "You still need to run$todo."
  1998.     ;;
  1999. esac
  2000. : Someone might mail this, so...
  2001. exit
  2002.  
  2003. INTERNET:  paul@devon.lns.pa.us        |      If life's a bitch, then
  2004. UUCP:      ...!rutgers!devon!paul      |      we must be her puppies.
  2005.  
  2006.