home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / pcmail2.lzh / pcmail.7 < prev    next >
Encoding:
Text File  |  1990-01-31  |  59.2 KB  |  2,334 lines

  1.  
  2. #! /bin/sh
  3. # This is a shell archive.  Remove anything before this line, then unpack
  4. # it by saving it into a file and typing "sh file".  To overwrite existing
  5. # files, type "sh file -c".  You can also feed this as standard input via
  6. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  7. # will see the following message at the end:
  8. #        "End of archive 7 (of 11)."
  9. # Contents:  main/deskutil.c main/errdisp.c main/file.c main/kphys.c
  10. #   main/makefile.msc main/makefile.unx main/xpres.c
  11. # Wrapped by wswietse@tuewsa on Mon Jan 22 17:27:19 1990
  12. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  13. if test -f main/deskutil.c -a "${1}" != "-c" ; then 
  14.   echo shar: Will not over-write existing file \"main/deskutil.c\"
  15. else
  16. echo shar: Extracting \"main/deskutil.c\" \(7193 characters\)
  17. sed "s/^X//" >main/deskutil.c <<'END_OF_main/deskutil.c'
  18. X/*++
  19. X/* NAME
  20. X/*    deskutil 3
  21. X/* SUMMARY
  22. X/*    utility functions
  23. X/* PROJECT
  24. X/*    pc-mail
  25. X/* PACKAGE
  26. X/*    mail
  27. X/* SYNOPSIS
  28. X/*    #include "mail.h"
  29. X/*
  30. X/*    void patience()
  31. X/*
  32. X/*    int when()
  33. X/*
  34. X/*    int delete()
  35. X/*
  36. X/*    int unspool()
  37. X/*
  38. X/*    int print()
  39. X/*
  40. X/*    int save()
  41. X/*
  42. X/*    int filter()
  43. X/*
  44. X/*    char *tstamp(ltime)
  45. X/*    long *ltime()
  46. X/* DESCRIPTION
  47. X/*    tstamp() converts absolute time to a string. If called with a
  48. X/*    recent time argument (less than 100 days ago) the string will
  49. X/*    be of the form "Sun Apr 17 12:50", otherwise "Sun Apr 17  1988".
  50. X/*
  51. X/*      delete() gives the user another chance before a message is deleted.
  52. X/*
  53. X/*      unspool() actually deletes a message. As a side effect it destroys
  54. X/*      the current mail box display so that the next display will
  55. X/*    reflect the actual status of the spool directory.
  56. X/*    The affected message and meta file names are taken from the
  57. X/*    global "message" and "commant" string variables.
  58. X/*
  59. X/*    print() copies a pager file to the printer.
  60. X/*
  61. X/*    save() asks where the pager file should be saved.
  62. X/*
  63. X/*    filter() asks the command through which the file being shown should be
  64. X/*    piped. The original file is used.
  65. X/*
  66. X/*    when() should be called after the user has entered a mail destination
  67. X/*    address. It informs the user that messages are not sent right away, 
  68. X/*    but after selection of the Network option in the main menu. This
  69. X/*    function is a no-op on systems that use daemons for message transport.
  70. X/*
  71. X/*    patience() prints a 'one moment please' message in the middle
  72. X/*    screen window. As a side effect, the current pager file is set
  73. X/*    to none.
  74. X/* FILES
  75. X/*      mail header files in the spool directory
  76. X/* SEE ALSO
  77. X/*      pager(3), pager(5), kbdinp(3)
  78. X/* AUTHOR(S)
  79. X/*      W.Z. Venema
  80. X/*      Eindhoven University of Technology
  81. X/*      Department of Mathematics and Computer Science
  82. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  83. X/* CREATION DATE
  84. X/*    Tue May 12 15:35:20 GMT+1:00 1987
  85. X/* LAST MODIFICATION
  86. X/*    90/01/22 13:01:32
  87. X/* VERSION/RELEASE
  88. X/*    2.1
  89. X/*--*/
  90. X
  91. X#include <stdio.h>
  92. X#include <errno.h>
  93. X#include <time.h>
  94. X
  95. X#include "defs.h"
  96. X#include "pager.h"
  97. X#include "mail.h"
  98. X#include "screen.h"
  99. X#include "status.h"
  100. X
  101. Xextern struct tm *localtime();        /* std C library */
  102. X
  103. Xhidden int save_util();
  104. Xhidden int pipe_util();
  105. X
  106. X/* patience - say this will take some time */
  107. X
  108. Xpublic void patience()
  109. X{
  110. X    static char *m_wait[] = {
  111. X    "",
  112. X    "One moment please...",
  113. X    0,
  114. X    };
  115. X
  116. X    register File *pp = open_pager();        /* create pager file */
  117. X
  118. X    mesg_pager(pp,m_wait);            /* write pager file */
  119. X    ds_pager();                    /* show on middle window */
  120. X    close_pager(pp);                /* forget pager file */
  121. X}
  122. X
  123. X/* delete - user wants to delete a message; ask for confirmation */
  124. X
  125. Xpublic int delete()
  126. X{
  127. X    static Screen screen[] = {
  128. X    ESCCR,    "Enter",    unspool,int_error,
  129. X    0,    0,        0,
  130. X    "Press ESC to cancel. Confirm with ENTER",
  131. X    };
  132. X
  133. X    return(kbdinp(screen)|S_REDRAW);
  134. X}
  135. X
  136. X/* unspool - actually delete a message; force mail box display rebuild */
  137. X
  138. Xpublic int unspool()
  139. X{
  140. X    if (((chmod(message,0666) || unlink(message)) && errno != ENOENT)
  141. X    || ((chmod(comment,0666) || unlink(comment)) && errno != ENOENT)) {
  142. X    errdisp(E_UNLINK);            /* notify user of problem */
  143. X    return(S_REDRAW);            /* say screen has changed */
  144. X    } else {
  145. X    junk_desk();                /* say mail box has changed */
  146. X    return(S_BREAK);            /* no more work to do */
  147. X    }
  148. X}
  149. X
  150. X/* print - print pager display on default printer */
  151. X
  152. Xpublic int print()
  153. X{
  154. X    return(pr_pager() ? (errdisp(E_PRINTERR),S_REDRAW) : 0);
  155. X}
  156. X
  157. X/* save - ask where pager display should be copied to */
  158. X
  159. Xpublic int save()
  160. X{
  161. X    static Screen screen[] = {
  162. X    STRING,    0,              save_util,int_error,
  163. X    0,    0,              0,
  164. X    "Press ESC to cancel. Save to file:",
  165. X    };
  166. X
  167. X    kbdinp(screen);            /* prompt for file name, then copy */
  168. X    return(S_REDRAW);            /* force screen repaint */
  169. X}
  170. X
  171. X/* save_util - copy pager file to ordinary file */
  172. X
  173. Xhidden int save_util(to)
  174. Xchar *to;
  175. X{
  176. X    if (cp_pager(to)) {            /* if file copy failed */
  177. X    unlink(to);            /* remove that file */
  178. X    errdisp(E_WRITERR);        /* notify the user */
  179. X    return(S_BREAK|S_REDRAW);    /* redisplay, terminate caller */
  180. X    } else {
  181. X    junk_file();            /* say file display maybe outdated */
  182. X    return(S_BREAK);        /* terminate caller */
  183. X    }
  184. X}
  185. X
  186. X/* filter - ask command through which the pager display should be piped */
  187. X
  188. Xpublic int filter()
  189. X{
  190. X    static Screen screen[] = {
  191. X    STRING,    0,              pipe_util,int_error,
  192. X    0,    0,              0,
  193. X    "Press ESC to cancel. Filter through command:",
  194. X    };
  195. X
  196. X    kbdinp(screen);            /* prompt for file name, then copy */
  197. X    return(S_REDRAW);            /* force screen repaint */
  198. X}
  199. X
  200. X/* redirect - make old refer to new, close redundant file descriptors */
  201. X
  202. Xhidden int redirect(old, new)
  203. Xint     old;
  204. Xint     new;
  205. X{
  206. X    register int ret;
  207. X
  208. X    (void) close(old);
  209. X    ret = dup(new);
  210. X    (void) close(new);
  211. X    return (ret != old);
  212. X}
  213. X
  214. X/* pipe_util - pipe external file through command */
  215. X
  216. Xhidden int pipe_util(cmd)
  217. Xchar   *cmd;
  218. X{
  219. X    register int fd_stdin;
  220. X    register int fd_msg;
  221. X
  222. X    /*
  223. X     * Run command with standard input redirected to the file displayed, and
  224. X     * clean up. Note that the original file is used, not the contents of the
  225. X     * pager. We use system(3), so that the command can be a pipeline. This
  226. X     * code is a bit messy, since it has to run both with UNIX and MS-DOS.
  227. X     */
  228. X
  229. X    if ((fd_msg = open(message, 0)) < 0) {
  230. X    errdisp(E_READERR);
  231. X    } else {
  232. X    kbdrest();                /* cooked-mode input */
  233. X    if ((fd_stdin = dup(0)) < 0) {        /* save standard input */
  234. X        kbdinit();                /* raw-mode input */
  235. X        errdisp(E_SYSFAIL);
  236. X    } else {
  237. X        (void) putchar('\n');
  238. X        if (redirect(0, fd_msg))        /* re-direct standard input */
  239. X        fatal("cannot re-direct standard input");
  240. X        (void) system(cmd);            /* try to execute command */
  241. X        if (redirect(0, fd_stdin))        /* restore standard input */
  242. X        fatal("cannot restore standard input");
  243. X        kbdinit();                /* raw-mode input */
  244. X        (void) printf(anykey);
  245. X        (void) getkey();
  246. X        junk_file();            /* file display outdated */
  247. X    }
  248. X    }
  249. X    return (S_BREAK | S_REDRAW);        /* terminate caller */
  250. X}
  251. X
  252. X/* when - say when mail will actually be sent */
  253. X
  254. Xpublic int when()
  255. X{
  256. X#ifndef    DAEMON
  257. X    static char *msg[] = {
  258. X    "",
  259. X    "To send messages through the network, use the Network",
  260. X    "option in the main menu.",
  261. X    0,
  262. X    };
  263. X    File *pp = open_pager();            /* open new pager file */
  264. X
  265. X    mesg_pager(pp,msg);                /* fill pager file */
  266. X    ds_pager();                    /* display the file */
  267. X    close_pager(pp);                /* forget pager file */
  268. X#endif
  269. X    return(0);                    /* don't care value */
  270. X}
  271. X
  272. X/* tstamp - time format as produced by the ls(1) command */
  273. X
  274. Xpublic char *tstamp(ltime)
  275. Xlong   *ltime;
  276. X{
  277. X    static char buf[25];
  278. X
  279. X    /*
  280. X     * Output from asctime() is of the form
  281. X     * 
  282. X     * "Sun Apr 17 13:34:35 1988\n"
  283. X     * 
  284. X     * Depending on how recent the time in question is, we supress the time or
  285. X     * year field. The weekday field is always suppressed.
  286. X     */
  287. X
  288. X    (void) strcpy(buf, asctime(localtime(ltime)));
  289. X    if (time((long *) 0) - *ltime > 60L * 60L * 24L * 100L) {
  290. X    buf[24] = '\0';                /* remove the \n */
  291. X    (void) strcpy(buf + 11, buf + 19);    /* old, show year */
  292. X    } else
  293. X    buf[16] = '\0';                /* recent, show time */
  294. X    return (buf + 4);
  295. X}
  296. END_OF_main/deskutil.c
  297. if test 7193 -ne `wc -c <main/deskutil.c`; then
  298.     echo shar: \"main/deskutil.c\" unpacked with wrong size!
  299. fi
  300. # end of overwriting check
  301. fi
  302. if test -f main/errdisp.c -a "${1}" != "-c" ; then 
  303.   echo shar: Will not over-write existing file \"main/errdisp.c\"
  304. else
  305. echo shar: Extracting \"main/errdisp.c\" \(8055 characters\)
  306. sed "s/^X//" >main/errdisp.c <<'END_OF_main/errdisp.c'
  307. X/*++
  308. X/* NAME
  309. X/*      errdisp 3
  310. X/* SUMMARY
  311. X/*      produce an error message display
  312. X/* PROJECT
  313. X/*      pc-mail
  314. X/* PACKAGE
  315. X/*      mail
  316. X/* SYNOPSIS
  317. X/*      int errdisp(errcode);
  318. X/*      int errcode;
  319. X/* DESCRIPTION
  320. X/*      errdisp() produces an error display in the middle screen
  321. X/*      window. The error code must be one defined in status.h.
  322. X/*    Otherwise, an "unknown error" message is displayed.
  323. X/*    errdisp() gives the user a chance to read it, before resuming
  324. X/*      the program. errdisp() returns its argument, or the
  325. X/*    value E_UNKNOWN if an unknown error code was specified.
  326. X/* FUNCTIONS AND MACROS
  327. X/*      kbdinp(), open_pager(), app_pager(), ds_pager(), close_pager()
  328. X/* BUGS
  329. X/*      Cannot force the user to really stop. It just recommends
  330. X/*      to do so.
  331. X/* AUTHOR(S)
  332. X/*      W.Z. Venema
  333. X/*      Eindhoven University of Technology
  334. X/*      Department of Mathematics and Computer Science
  335. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  336. X/* CREATION DATE
  337. X/*      Thu Apr  9 21:19:05 GMT+1:00 1987
  338. X/* LAST MODIFICATION
  339. X/*    90/01/22 13:01:36
  340. X/* VERSION/RELEASE
  341. X/*    2.1
  342. X/*--*/
  343. X
  344. X#include "defs.h"
  345. X#include "screen.h"
  346. X#include "pager.h"
  347. X#include "status.h"
  348. X#include "window.h"
  349. X
  350. X/* forward declarations */
  351. X
  352. Xhidden int ds_error();
  353. X
  354. X/* A list of error mesages */
  355. X
  356. X/* when the spool directory is not found */
  357. X
  358. Xhidden char *e_nospool[] = {
  359. X    "",
  360. X    "The mail program cannot access essential data files.",
  361. X    "",
  362. X    "Please check whether the spool directory is present",
  363. X    "and whether the environment variable MAILDIR has been",
  364. X    "set correctly.",
  365. X    0,
  366. X};
  367. X
  368. X/* when we cannot open as many files as we need */
  369. X
  370. Xhidden char *e_fileno[] = {
  371. X    "",
  372. X#ifdef  MSDOS
  373. X    "Check your CONFIG.SYS file. It should have a line",
  374. X    "stating (for example)",
  375. X    "    FILES = 20 .",
  376. X    "While you're at it, also make sure that file also",
  377. X    "has a line (for example)",
  378. X    "    DEVICE = ANSI.SYS .",
  379. X    "If your system does not have such a file create",
  380. X    "one with an editor and place the file in the root",
  381. X    "directory.",
  382. X    "Reboot after making the changes and try again.",
  383. X#endif
  384. X#ifdef  unix
  385. X    "Your UNIX is crippled (not enough file descriptors",
  386. X    "per process). Rebuild the system or buy a better one.",
  387. X#endif
  388. X    0,
  389. X};
  390. X
  391. X/* when a program is not found */
  392. X
  393. Xhidden char *e_noprog[] = {
  394. X    "",
  395. X    "The mail program cannot execute an essential program file.",
  396. X    "",
  397. X    "Please make sure that the environment variable PATH has",
  398. X    "been set to include the directories with the SMAIL, NMAIL,",
  399. X#ifdef    DAEMON
  400. X    "and EDITOR programs.",
  401. X#else
  402. X    "CICO and EDITOR programs.",
  403. X#endif
  404. X    "Also, make sure that the environment variable EDITOR has",
  405. X    "been set to the editor of your preference, and that the",
  406. X    "machine has enough free memory",
  407. X    0,
  408. X};
  409. X
  410. X/* when a read error ocurred, or a file could not be opened */
  411. X
  412. Xhidden char *e_readerr[] = {
  413. X    "",
  414. X    "The mail program cannot read a data file.",
  415. X    "",
  416. X    "Please check your disk. This may be a serious problem.",
  417. X    0,
  418. X};
  419. X
  420. X/* when a write error occurred */
  421. X
  422. Xhidden char *e_writerr[] = {
  423. X    "",
  424. X    "The mail program cannot write a data file.",
  425. X    "",
  426. X    "Please make sure that the disk is not write protected",
  427. X    "and that there is sufficient free space.",
  428. X    0,
  429. X};
  430. X
  431. X/* when the program is confused */
  432. X
  433. Xhidden char *e_confused[] = {
  434. X    "",
  435. X    "The mail program has detected a serious internal problem.",
  436. X    "",
  437. X    "You are requested to leave the mail system as it is and",
  438. X    "call an expert.",
  439. X    0,
  440. X};
  441. X
  442. X/* an unknown error (perhaps the editor returned a nonzero status) */
  443. X
  444. Xhidden char *e_unknown[] = {
  445. X    "",
  446. X    "The mail program has detected a unknown error. This may",
  447. X    "not be a serious problem.",
  448. X    0,
  449. X};
  450. X
  451. X/* when the UNIX host does not ask for login/password */
  452. X
  453. Xhidden char *e_noline[] = {
  454. X    "",
  455. X    "The mail program is not able to exchange mail with the",
  456. X    "network.",
  457. X    "",
  458. X    "Please check the password, or try again later.",
  459. X    0,
  460. X};
  461. X
  462. X/* when the UNIX host does not send initial protocol messages */
  463. X
  464. Xhidden char *e_noresp[] = {
  465. X    "",
  466. X    "The mail program is not able to exchange mail with the",
  467. X    "network. Probably the password was incorrect.",
  468. X    0,
  469. X};
  470. X
  471. X/* when the UNIX host does not want to talk to us */
  472. X
  473. Xhidden char *e_reject[] = {
  474. X    "",
  475. X    "The mail program is not able to exchange mail with the",
  476. X    "network. Please contact the system administrator who is",
  477. X    "responsible for the nearest UNIX system.",
  478. X    0,
  479. X};
  480. X
  481. X/* when the link is lost (timeout,...) */
  482. X
  483. Xhidden char *e_lost[] = {
  484. X    "",
  485. X    "The mail program has lost contact with the network.",
  486. X    "",
  487. X    "We suggest that you try again at a later time.",
  488. X    0,
  489. X};
  490. X
  491. X/* the resources are exhausted */
  492. X
  493. Xhidden char *e_sysfail[] = {
  494. X    "",
  495. X    "The mail program cannot proceed due to the fact",
  496. X    "that the computer system is overloaded.",
  497. X    "",
  498. X    "Consult your local systems manager.",
  499. X    0,
  500. X};
  501. X
  502. X/* bad setup parameter */
  503. X
  504. Xhidden char *e_badsetup[] = {
  505. X    "",
  506. X    "The mail program cannot communicate with the network",
  507. X    "due to missing or invalid data in the setup.",
  508. X    "",
  509. X    "Check the Setup command in the main menu.",
  510. X    0,
  511. X};
  512. X
  513. X/* when a file could not be removed */
  514. X
  515. Xhidden char *e_unlink[] = {
  516. X    "",
  517. X    "The mail program cannot remove a data file.",
  518. X    "",
  519. X    "Please make sure that your disk is not write protected",
  520. X    0,
  521. X};
  522. X
  523. X/* when a file could not be printed */
  524. X
  525. Xhidden char *e_printerr[] = {
  526. X    "",
  527. X    "The mail programm cannot write to the printer",
  528. X    "",
  529. X    "Please check your default printer device",
  530. X    0,
  531. X};
  532. X
  533. Xhidden char *e_nouser[] = {
  534. X    "",
  535. X    "An unknown local user name was specified",
  536. X    "",
  537. X    "Please check the list of user names",
  538. X    0,
  539. X};
  540. X
  541. Xhidden char *e_ovalias[] = {
  542. X    "",
  543. X    "There probably is an error in your alias data base,",
  544. X    "such that an alias is defined in terms of itself.",
  545. X    "",
  546. X    "Please check your alias data base, and then try to",
  547. X    "send this message again.",
  548. X    0,
  549. X};
  550. X
  551. Xhidden char *e_toolong[] = {
  552. X    "",
  553. X    "The list of recipients is too long.",
  554. X    "",
  555. X    "There is no easy solution to this problem; you might",
  556. X    "ask your UNIX system administrator to set up a mailing",
  557. X    "list, and use the name of that mailing list instead.",
  558. X    0,
  559. X};
  560. X
  561. X/* The folowing data structure links an error code to an error message */
  562. X
  563. Xtypedef struct {
  564. X    short code;                /* error return value */
  565. X    char **msg;                /* associated message */
  566. X} msgmap;
  567. X
  568. Xhidden msgmap errmap[] = {        /* lookup table for error codes */
  569. X    E_UNKNOWN,    e_unknown,        /* don't remove this one! */
  570. X    E_SYSFAIL,    e_sysfail,
  571. X    E_NOPROG,    e_noprog,        /* and error messages */
  572. X    E_NOSPOOL,    e_nospool,
  573. X    E_READERR,    e_readerr,
  574. X    E_WRITERR,    e_writerr,
  575. X    E_CONFUSED,    e_confused,
  576. X    E_FILENO,    e_fileno,
  577. X    E_NOLINE,    e_noline,
  578. X    E_NORESP,    e_noresp,
  579. X    E_REJECT,    e_reject,
  580. X    E_LOST,    e_lost,
  581. X    E_BADSETUP,    e_badsetup,
  582. X    E_UNLINK,    e_unlink,
  583. X    E_PRINTERR,    e_printerr,
  584. X    E_NOUSER,    e_nouser,
  585. X    E_OVALIAS,    e_ovalias,
  586. X    E_TOOLONG,    e_toolong,
  587. X    0,        0,            /* terminator */
  588. X};
  589. X
  590. X/* errdisp - set up error pager file, return error code */
  591. X
  592. Xpublic int errdisp(code)
  593. Xint code;
  594. X{
  595. X    static Screen screen[] = {
  596. X    ENTER,    "Enter",        0,      "Resume the mail program",
  597. X    0,    0,              ds_error,"Press ENTER to continue",
  598. X    };
  599. X    register msgmap *mp;
  600. X
  601. X    /* linear table search; this code is not used heavily */
  602. X
  603. X    for (mp = errmap; mp->code && mp->code != code; mp++)
  604. X    /* void */ ;                /* look it up in table */
  605. X    if (mp->code == 0) {
  606. X    return(errdisp(E_UNKNOWN));        /* unknown error code */
  607. X    } else {
  608. X    File *pp = open_pager();        /* open pager file */
  609. X    mesg_pager(pp,mp->msg);            /* copy to pager file */
  610. X    beep();                    /* red alert! red alert! */
  611. X    kbdinp(screen);                /* give a chance to read it */
  612. X    close_pager(pp);            /* forget screen display */
  613. X    return(code);                /* return error code */
  614. X    }
  615. X}
  616. X
  617. X/* ds_error - display error window */
  618. X
  619. Xhidden int ds_error()
  620. X{
  621. X    ds_pager();                    /* use "current" pager file */
  622. X    return(0);                    /* say screen up-to-date */
  623. X}
  624. END_OF_main/errdisp.c
  625. if test 8055 -ne `wc -c <main/errdisp.c`; then
  626.     echo shar: \"main/errdisp.c\" unpacked with wrong size!
  627. fi
  628. # end of overwriting check
  629. fi
  630. if test -f main/file.c -a "${1}" != "-c" ; then 
  631.   echo shar: Will not over-write existing file \"main/file.c\"
  632. else
  633. echo shar: Extracting \"main/file.c\" \(7309 characters\)
  634. sed "s/^X//" >main/file.c <<'END_OF_main/file.c'
  635. X/*++
  636. X/* NAME
  637. X/*      file 3
  638. X/* SUMMARY
  639. X/*      manipulate ordinary files
  640. X/* PROJECT
  641. X/*      pc-mail
  642. X/* PACKAGE
  643. X/*      mail
  644. X/* SYNOPSIS
  645. X/*      int file()
  646. X/*
  647. X/*    int junk_file()
  648. X/* DESCRIPTION
  649. X/*      file() is called when the user selected the "file" option
  650. X/*    in the main menu. The pager displays a directory listing on the
  651. X/*      screen. The user may then walk through the file display and
  652. X/*    select a file or directory. 
  653. X/*
  654. X/*    In case a regular file is selected the user may specify
  655. X/*    an action (send file as mail, delete file, display
  656. X/*    file, print file, copy file to workfile for subsequent
  657. X/*    editing etc.).
  658. X/*
  659. X/*    junk_file() should be invoked when the file display is no longer
  660. X/*    valid.
  661. X/* FILES
  662. X/*      By selecting directory files the user can walk through the whole
  663. X/*      file system.
  664. X/* SEE ALSO
  665. X/*      kbdinp(3), pager(3)
  666. X/* BUGS
  667. X/*    MS-DOS has no "." or ".." entries in the root directory, and
  668. X/*    subdirectories of an MS-DOS root directory have no ".." entry.
  669. X/*
  670. X/*    Changing the current directory may cause problems if
  671. X/*    environment variables are defined in terms of relative path names.
  672. X/*
  673. X/*    There is no provision to change the "default drive" on systems
  674. X/*    that use such abominations.
  675. X/* AUTHOR(S)
  676. X/*      W.Z. Venema
  677. X/*      Eindhoven University of Technology
  678. X/*      Department of Mathematics and Computer Science
  679. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  680. X/* CREATION DATE
  681. X/*      Sun Apr  5 17:18:06 GMT+1:00 1987
  682. X/* LAST MODIFICATION
  683. X/*    90/01/22 13:01:37
  684. X/* VERSION/RELEASE
  685. X/*    2.1
  686. X/*--*/
  687. X
  688. X#include <stdio.h>
  689. X#include <time.h>
  690. X#include <sys/types.h>
  691. X#include <sys/stat.h>
  692. X#include <ctype.h>
  693. X
  694. X#include "defs.h"
  695. X#include "screen.h"
  696. X#include "pager.h"
  697. X#include "mail.h"
  698. X#include "ndir.h"
  699. X#include "path.h"
  700. X#include "status.h"
  701. X#include "window.h"
  702. X
  703. Xextern struct tm *localtime();        /* std C library */
  704. X
  705. Xhidden File *bldlist();            /* forward declaration */
  706. Xhidden int show_list();
  707. Xhidden int pick_file();
  708. Xhidden int delfile();
  709. Xhidden int show_file();
  710. Xhidden int rmfile();
  711. X
  712. Xhidden File *dfile = 0;            /* file listing */
  713. Xhidden File *dirfile = 0;        /* directory listing */
  714. Xhidden char file_prompt[BUFSIZ];    /* prompt with directory name */
  715. Xhidden char file_dir[BUFSIZ];        /* prompt with directory name */
  716. Xhidden char prompt_fmt[] = "To display a file, select it with \
  717. Xthe cursor keys, then press ENTER\n(showing directory: \"%s\")";
  718. X
  719. X/* file - called from keyboard interpreter, call keyboard driver */
  720. X
  721. Xpublic int file()
  722. X{
  723. X    char *getcwd();
  724. X    char  thisdir[BUFSIZ];
  725. X
  726. X    static Screen screen[] = {
  727. X    'C',    "Close",0,    prevscreen,
  728. X    'P',    "Print",print,    "Print file listing",
  729. X    'S',    "Save",    save,    "Save file listing to ordinary file",
  730. X    PGUP,    PgUp,    pu_pager,pageup,
  731. X    PGDN,    PgDn,    pd_pager,pagedn,
  732. X    UP,    "Up",    up_pager,csrup,
  733. X    DOWN,    "Down",    dn_pager,csrdn,
  734. X    ENTER,    "Enter",pick_file,"Display file at cursor",
  735. X    0,    0,    show_list,
  736. X    file_prompt,
  737. X    };
  738. X
  739. X    (void) getcwd(thisdir, sizeof(thisdir));    /* save current directory */
  740. X    sprintf(file_prompt, prompt_fmt, thisdir);    /* put cwd in prompt */
  741. X    kbdinp(screen);                /* set up dialogue */
  742. X    close_pager(dirfile);            /* deallocate pager file */
  743. X    dirfile = 0;                /* say it's gone */
  744. X    (void) chdir(thisdir);            /* restore current directory */
  745. X    return (S_REDRAW);                /* force screen update */
  746. X}
  747. X
  748. X/* show_list - create or refresh file listing */
  749. X
  750. Xhidden int show_list()
  751. X{
  752. X    if (dirfile == 0) {                /* no pager file? */
  753. X    dirfile = bldlist();            /* create one */
  754. X    } else {
  755. X    set_pager(dirfile);            /* select existing pager file */
  756. X    }
  757. X    ds_pager();                    /* display the thing */
  758. X    return (0);                    /* say screen is up-to-date */
  759. X}
  760. X
  761. X/* bldlist - build file listing display */
  762. X
  763. Xhidden File *bldlist()
  764. X{
  765. X    register File *pp;
  766. X    register DIR *dp;
  767. X    register struct direct *de;
  768. X    struct stat s;
  769. X
  770. X    patience();
  771. X
  772. X    if ((dp = opendir(THISDIR)) == 0) {
  773. X    fatal("insufficient memory for operation");
  774. X    /* NOTREACHED */
  775. X    } else {
  776. X    pp = open_pager();            /* allocate pager file */
  777. X
  778. X    while (de = readdir(dp)) {        /* read next file name */
  779. X        if (stat(de->d_name, &s) == 0) {    /* get file info */
  780. X        if ((s.st_mode & S_IFMT) == S_IFDIR)
  781. X            app_pager(pp, strcons("%-20s %9s %s", de->d_name,
  782. X                      "<dir>", tstamp(&s.st_mtime)));
  783. X        else
  784. X            app_pager(pp, strcons("%-20s %9ld %s", de->d_name,
  785. X                      s.st_size, tstamp(&s.st_mtime)));
  786. X        }
  787. X    }
  788. X    sort_pager(pp, FORW_SORT);        /* sort by file name */
  789. X
  790. X    (void) getcwd(file_dir, sizeof(file_dir));
  791. X    sprintf(file_prompt, prompt_fmt, file_dir);    /* put cwd in prompt */
  792. X
  793. X    closedir(dp);                /* directory search done */
  794. X    return (pp);                /* current pager file */
  795. X    }
  796. X}
  797. X/* pick_file - display selected file or change directory */
  798. X
  799. Xhidden int pick_file()
  800. X{
  801. X    static char botline[80];
  802. X    static Screen screen[] = {
  803. X    'C',    "Close",0,        "Return to file listing",
  804. X    'D',    "Delete",delfile,    "Delete this file",
  805. X    'M',    "Mail",    mailfile,    "Mail a copy of this file",
  806. X    'P',    "Print",print,        "Print this file",
  807. X    'S',    "Save",    save,        "Save a copy to an ordinary file",
  808. X    'W',    "Work",    makework,    "Save a copy to a work file",
  809. X    '|',    "|",    filter,        "Filter file through command",
  810. X    PGUP,    PgUp,    pu_pager,    pageup,
  811. X    PGDN,    PgDn,    pd_pager,    pagedn,
  812. X    UP,    "Up",    up_pager,    csrup,
  813. X    DOWN,    "Down",    dn_pager,    csrdn,
  814. X    0,    0,    show_file,
  815. X    botline,
  816. X    };
  817. X    struct stat s;
  818. X
  819. X    if (!sscanf(gets_pager(), "%s", message)) {    /* cannot read name */
  820. X    beep();                    /* "notify" user */
  821. X    return (0);                /* nothing happened */
  822. X    } else if (access(message, 04) 
  823. X    || stat(message, &s)) {            /* cannot read file */
  824. X    beep();                    /* "notify" user */
  825. X    return (0);                /* nothing happened */
  826. X    } else if ((s.st_mode & S_IFMT) == S_IFDIR) {    /* directory file */
  827. X    chdir(message);                /* change directory */
  828. X    close_pager(dirfile);            /* purge display */
  829. X    dirfile = bldlist();            /* new file display */
  830. X    return (S_REDRAW);            /* update display */
  831. X    } else {                    /* ordinary file */
  832. X    sprintf(botline, "(Reading file \"%s\")", message);
  833. X    kbdinp(screen);                /* look at screen */
  834. X    close_pager(dfile);            /* and forget it */
  835. X    dfile = 0;                /* say it's gone */
  836. X    return (S_REDRAW);            /* force redrawing */
  837. X    }
  838. X}
  839. X
  840. X/* show_file - create or refresh display of selected file */
  841. X
  842. Xhidden int show_file()
  843. X{
  844. X    if (dfile) {
  845. X    set_pager(dfile);            /* select dispay */
  846. X    } else {
  847. X    if (rd_pager(dfile = open_pager(),
  848. X             message))            /* try to read file */
  849. X        mesg_pager(dfile, m_msgread);    /* read error */
  850. X    }
  851. X    ds_pager();                    /* rewrite screen */
  852. X    return (0);                    /* screen up-to-date */
  853. X}
  854. X
  855. X/* delfile - ask confirmation before removing a file */
  856. X
  857. Xhidden int delfile()
  858. X{
  859. X    static Screen screen[] = {
  860. X    ESCCR, 0, rmfile, int_error,
  861. X    0, 0, 0,
  862. X    "Press ESC to cancel. Confirm with ENTER",
  863. X    };
  864. X
  865. X    return (kbdinp(screen) | S_REDRAW);        /* "are you sure?" */
  866. X}
  867. X
  868. X/* rmfile - actually remove file */
  869. X
  870. Xhidden int rmfile()
  871. X{
  872. X    if (unlink(message)) {            /* try to remove file */
  873. X    errdisp(E_UNLINK);            /* notify the user */
  874. X    return (S_BREAK | S_REDRAW);        /* redisplay, stop caller */
  875. X    } else {
  876. X    junk_file();                /* say file display outdated */
  877. X    return (S_BREAK);            /* terminate caller */
  878. X    }
  879. X}
  880. X
  881. X/* junk_file - directory listing is no longer up to date */
  882. X
  883. Xpublic int junk_file()
  884. X{
  885. X    if (dirfile) {
  886. X    close_pager(dirfile);            /* close pager file */
  887. X    dirfile = 0;                /* say it is gone */
  888. X    }
  889. X    return (0);                    /* in case we need that */
  890. X}
  891. END_OF_main/file.c
  892. if test 7309 -ne `wc -c <main/file.c`; then
  893.     echo shar: \"main/file.c\" unpacked with wrong size!
  894. fi
  895. # end of overwriting check
  896. fi
  897. if test -f main/kphys.c -a "${1}" != "-c" ; then 
  898.   echo shar: Will not over-write existing file \"main/kphys.c\"
  899. else
  900. echo shar: Extracting \"main/kphys.c\" \(7513 characters\)
  901. sed "s/^X//" >main/kphys.c <<'END_OF_main/kphys.c'
  902. X/*++
  903. X/* NAME
  904. X/*      kphys 3
  905. X/* SUMMARY
  906. X/*      k protocol packet exchange
  907. X/* PACKAGE
  908. X/*      uucp across the TUEnet
  909. X/* SYNOPSIS
  910. X/*      #include "kp.h"
  911. X/*
  912. X/*      kspack(fd,type,num,size,data) 
  913. X/*      int fd, num, size;
  914. X/*      char type, data[MAXPACKSIZ];
  915. X/*
  916. X/*      krpack(fd,num,size,data)
  917. X/*      int fd, *num, *size;
  918. X/*      char data[MAXPACKSIZ];
  919. X/* DESCRIPTION
  920. X/*      The functions in this file take care of data framing and verification. 
  921. X/*
  922. X/*      Kspack() sends a packet of the specified type and number,
  923. X/*      and with len data bytes.
  924. X/*
  925. X/*      Krpack() tries to receive a packet and returns: the packet type plus
  926. X/*      size and data, or TIME (no packet) or FAIL (bad checksum).
  927. X/*
  928. X/*      The data format has been derived from kermit implementations:
  929. X/*
  930. X/* .nf
  931. X/* .in +5
  932. X/*      SOH     packet header, ASCII control-P
  933. X/*      len     (size of data, low 6 bits) + 32
  934. X/*      len     (size of data, high 6 bits) + 32
  935. X/*      num     (packet number mod 64) + 32
  936. X/*      type    packet type
  937. X/*      check   one-byte type-1 kermit checksum
  938. X/*
  939. X/*      The header is followed by checksummed data if len >0:
  940. X/*
  941. X/* .nf
  942. X/* .in +5
  943. X/*      data    len data bytes
  944. X/*      check1  (upper 2 bits of type-3 kermit 16-bit checksum) + 32
  945. X/*      check2  (middle 6 bits of type-3 kermit 16-bit checksum) + 32
  946. X/*      check3  (lower 6 bits of type-3 kermit 16-bit checksum) + 32
  947. X/*
  948. X/*      Every packet is followed by an ASCII carriage return, which is
  949. X/*      ignored upon reception of a packet. It prevents timeout errors
  950. X/*      when one byte gets lost (the most common case).
  951. X/* BUGS
  952. X/*      It is yet another convention for data framing.
  953. X/* AUTHOR(S)
  954. X/*      Wietse Venema
  955. X/*      Eindhoven University of Technology
  956. X/*      Department of Mathematics and Computer Science
  957. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  958. X/* CREATION DATE
  959. X/*      Mon Feb  3 13:38:14 MET 1986
  960. X/* LAST MODIFICATION
  961. X/*    90/01/22 13:01:56
  962. X/* VERSION/RELEASE
  963. X/*    2.1
  964. X/*--*/
  965. X
  966. X#include <signal.h>
  967. X#include <setjmp.h>
  968. X#include "kp.h"
  969. X
  970. X#define READS(fd,ch)    {if (read(fd,&ch,1) < 0) clkint(); if ((ch &= 0177) == SOH) goto SYNC;}
  971. X
  972. Xjmp_buf env;                /* Environment ptr for timeout longjump */
  973. X
  974. Xclkint()                                /* Timer interrupt handler */
  975. X{
  976. X    longjmp(env,TRUE);                  /* Tell krpack to give up */
  977. X}
  978. X
  979. Xkspack(fd,type,num,len,data)
  980. Xint fd;
  981. Xchar type, *data;
  982. Xint num, len;
  983. X{
  984. X    char chksum, header[6], chk[3];     /* Checksums, header */
  985. X
  986. X    DEBUG(7,"xmt: type %c\n",type);
  987. X    if (len > 0)
  988. X    DEBUG(7,"xmt: data %d\n",len);
  989. X
  990. X    header[0] = SOH;                    /* Packet marker (SOH) */
  991. X    header[1] = tosix(len);             /* Send the character count */
  992. X    chksum    = header[1];              /* Initialize the checksum */
  993. X    header[2] = tosix(len>>OUT);        /* Send the character count */
  994. X    chksum   += header[2];              /* Update checksum */
  995. X    header[3] = tochar(num);            /* Packet number */
  996. X    chksum   += header[3];              /* Update checksum */
  997. X    header[4] = type;                   /* Packet type */
  998. X    chksum   += header[4];              /* Update checksum */
  999. X    chksum    = (((chksum&0300) >> 6)+chksum)&077; /* Compute header checksum */
  1000. X    header[5] = tochar(chksum);         /* Put it in the packet */
  1001. X    write(fd,header,6);                /* Send the header */
  1002. X
  1003. X    if (len > 0) {                      /* Make data packet */
  1004. X    write(fd,data,len);           /* Send data */
  1005. X    chk3(data,len,chk);           /* Compute 16-bit checksum */
  1006. X    write(fd,chk,3);              /* Send checksum */
  1007. X    }
  1008. X    write(fd,"\r",1);                   /* Extra-packet line terminator */
  1009. X}
  1010. X
  1011. Xkrpack(fd,num,len,data)
  1012. Xint fd;
  1013. Xint *num;                               /* Packet number */
  1014. Xint *len;                               /* Packet length */
  1015. Xchar *data;                             /* Packet data */
  1016. X{
  1017. X    int i;                              /* Data character number, loop exit */
  1018. X    char t,                             /* Current input character */
  1019. X    type,                           /* Packet type */
  1020. X    rchk[3],                        /* Data checksum from host */
  1021. X    cchk[3],                        /* Data checksum computed here */
  1022. X    cchksum,                        /* Our (computed) checksum */
  1023. X    rchksum;                        /* Header checksum from other host */
  1024. X
  1025. X    if (setjmp(env)) {
  1026. X    DEBUG(7,"rcv: timed out\n","");
  1027. X    return TIME;                    /* Timed out */
  1028. X    }
  1029. X    signal(SIGALRM,clkint);             /* Setup the timeout */
  1030. X    alarm(TIMEOUT);
  1031. X
  1032. X    for (;;)                            /* Wait for packet header */
  1033. X    READS(fd,t);
  1034. XSYNC:                                   /* Got SOH */
  1035. X    alarm(TIMEOUT);
  1036. X    DEBUG(7,"rcv: found sync\n","");
  1037. X    READS(fd,t);                        /* Get character */
  1038. X    cchksum = t;                        /* Start the checksum */
  1039. X    *len = unchar(t);                   /* Character count, low six bits */
  1040. X
  1041. X    READS(fd,t);                        /* Get character */
  1042. X    cchksum += t;                       /* Update checksum */
  1043. X    *len += (unchar(t)<<OUT);           /* Character count, high six bits */
  1044. X
  1045. X    READS(fd,t);                        /* Get character */
  1046. X    cchksum += t;                       /* Update checksum */
  1047. X    *num = unchar(t);                   /* Packet number */
  1048. X
  1049. X    READS(fd,t);                        /* Get character */
  1050. X    cchksum += t;                       /* Update checksum */
  1051. X    type = t;                           /* Packet type */
  1052. X
  1053. X    READS(fd,t);                        /* Get header checksum */
  1054. X    rchksum = unchar(t);                /* Convert to numeric */
  1055. X    /* Fold in bits 7,8 to compute */
  1056. X    cchksum = (((cchksum&0300) >> 6)+cchksum)&077; /* header checksum */
  1057. X
  1058. X    if (cchksum != rchksum) {
  1059. X    DEBUG(7,"rcv: bad header\n","");
  1060. X    alarm(0);                       /* Disable the timer interrupt */
  1061. X    return FAIL;
  1062. X    } 
  1063. X    DEBUG(7,"rcv: type %c\n",type);
  1064. X
  1065. X    if ((*len > 0) && (data != NULLP))
  1066. X    {
  1067. X    for (i=0; i<*len; i++)          /* The data itself, if any */
  1068. X    {                               /* Loop for character count */
  1069. X        READS(fd,t);                /* Get character */
  1070. X        data[i] = t;                /* Keep data */
  1071. X    }
  1072. X
  1073. X    for (i=0; i<3; i++)             /* 16-bit CRC checksum */
  1074. X    {
  1075. X        READS(fd,t);                /* Get character */
  1076. X        rchk[i] = t;                /* Keep data */
  1077. X    }
  1078. X
  1079. X    chk3(data,*len,cchk);           /* Compute CRC */
  1080. X    if (strncmp(rchk,cchk,3)) {     /* Check with received CRC */
  1081. X        DEBUG(7,"rcv: bad data\n","");
  1082. X        alarm(0);                   /* Disable the timer interrupt */
  1083. X        return FAIL;
  1084. X    }
  1085. X    DEBUG(7,"rcv: data %d\n",*len);
  1086. X    }
  1087. X    alarm(0);                /* Disable the timer interrupt */
  1088. X    return(type);                       /* All OK, return packet type */
  1089. X}
  1090. X
  1091. X/*  C H K 3  --  Compute a type-3 Kermit block check.  */
  1092. X/*
  1093. XCalculate the 16-bit CRC of a string using a byte-oriented
  1094. Xtableless algorithm invented by Andy Lowry (Columbia University).  The
  1095. Xmagic number 010201 is derived from the CRC-CCITT polynomial x^16+x^12+x^5+1.
  1096. X*/
  1097. Xstatic chk3(s,len,chk) 
  1098. Xchar *s, *chk; 
  1099. Xint len; 
  1100. X{
  1101. X    unsigned int c, q;
  1102. X    long crc = 0;
  1103. X
  1104. X    while (len--) {
  1105. X    c = *s++;
  1106. X    q = (crc ^ c) & 017;            /* Low-order nibble */
  1107. X    crc = (crc >> 4) ^ (q * 010201);
  1108. X    q = (crc ^ (c >> 4)) & 017;     /* High order nibble */
  1109. X    crc = (crc >> 4) ^ (q * 010201);
  1110. X    }
  1111. X    *chk++ = tochar(((unsigned)(crc & 0170000)) >> 12);
  1112. X    *chk++ = tochar((crc & 07700) >> 6);
  1113. X    *chk++ = tochar(crc & 077);
  1114. X}
  1115. END_OF_main/kphys.c
  1116. if test 7513 -ne `wc -c <main/kphys.c`; then
  1117.     echo shar: \"main/kphys.c\" unpacked with wrong size!
  1118. fi
  1119. # end of overwriting check
  1120. fi
  1121. if test -f main/makefile.msc -a "${1}" != "-c" ; then 
  1122.   echo shar: Will not over-write existing file \"main/makefile.msc\"
  1123. else
  1124. echo shar: Extracting \"main/makefile.msc\" \(8027 characters\)
  1125. sed "s/^X//" >main/makefile.msc <<'END_OF_main/makefile.msc'
  1126. X# @(#) makefile.msc 2.1 1/22/90 13:02:07
  1127. X
  1128. X# Makefile for Microsoft C and MS-DOS
  1129. X
  1130. X##################
  1131. X# Beginning of configurable options
  1132. X
  1133. X# Choose a message-transport mechanism, and select the corresponding definition
  1134. X# of the DAEMON and PROGRAMS macros:
  1135. X#
  1136. X# 1 - The UUCP file transfer software provided with pc-mail (see the DEFAULT.ins
  1137. X#     document):
  1138. X#
  1139. X#    DAEMON    =
  1140. X#    PROGRAMS= mail.exe smail.exe nmail.exe cmail.exe cico.exe
  1141. X#
  1142. X# 2 - Daemon processes, presumably running on a file server (see the SLAVE.ins
  1143. X#     document):
  1144. X#
  1145. X#    DAEMON    = -DDAEMON
  1146. X#    PROGRAMS= mail.exe smail.exe nmail.exe cmail.exe
  1147. X#
  1148. X# 3 - Message transport by GNUUCP (see the GNUUCP.ins document):
  1149. X#
  1150. X#    DAEMON    = -DDAEMON
  1151. X#    PROGRAMS= mail.exe.exe smail.exe nmail.exe cmail.exe gmail.exe lmail.exe
  1152. X
  1153. XDAEMON    =
  1154. XPROGRAMS= mail.exe smail.exe nmail.exe cmail.exe
  1155. X
  1156. X# Memory model; use large for everything but the cico program.
  1157. X
  1158. XMODEL    = -Ml
  1159. X
  1160. X# End of configurable options
  1161. X##################
  1162. X
  1163. XMV    = ren
  1164. XRM    = del
  1165. XCC    = cl
  1166. XCFLAGS    = $(DAEMON) $(MODEL)
  1167. XLDFLAGS    = -F 2000 $(MODEL)
  1168. X
  1169. XTERMCAP    = ..\termcap\termcap.lib
  1170. X
  1171. XSHOBJ1    = call.obj email.obj file.obj screen.obj mbox.obj desk.obj reply.obj
  1172. XSHOBJ2    = create.obj kbdinp.obj pager.obj window.obj setup.obj errdisp.obj
  1173. XSHOBJ3    = invoke.obj textcopy.obj makework.obj mailfile.obj deskutil.obj
  1174. XSHOBJ4    = submit.obj edit.obj alias.obj snapshot.obj
  1175. XSHLIBS    = shlib1.lib shlib2.lib shlib3.lib shlib4.lib
  1176. X
  1177. XSMOBJ    = smail.obj unalias.obj hsearch.obj
  1178. X
  1179. XCMOBJ    = cmail.obj invoke.obj
  1180. X
  1181. XNMOBJ    = nmail.obj
  1182. X
  1183. XGMOBJ    = gmail.obj
  1184. X
  1185. XLMOBJ    = lmail.obj
  1186. X
  1187. XCIOBJ    = cico.obj comport.obj
  1188. XCIOBJ1    = comm.obj connect.obj getwork.obj kphys.obj kpres.obj ktrans.obj
  1189. XCIOBJ2    = logs.obj newseqno.obj protomsg.obj rmtname.obj scanwork.obj gphys.obj
  1190. XCIOBJ3    = sendwork.obj startup.obj switcher.obj xpres.obj gpres.obj gtrans.obj
  1191. XCILIBS    = cilib1.lib cilib2.lib cilib3.lib
  1192. X
  1193. XGNOBJ    = msd_dir.obj myalloc.obj params.obj path.obj newseqno.obj ascf.obj \
  1194. X    spoolfil.obj str.obj ms_parse.obj
  1195. X
  1196. X.SUFFIXES: .obj .asm
  1197. X
  1198. X.asm.obj:
  1199. X    masm $*.asm ;
  1200. X
  1201. X.c.obj:
  1202. X    $(CC) $(CFLAGS) -c $*.c
  1203. X
  1204. Xall:    $(PROGRAMS)
  1205. X
  1206. Xmail.exe: mail.obj $(SHLIBS) libgen.lib
  1207. X    $(CC) $(LDFLAGS) -o $@ mail.obj -link $(SHLIBS) libgen.lib $(TERMCAP)
  1208. X    -exepack $@ junk
  1209. X    $(RM) $@
  1210. X    $(MV) junk $@
  1211. X
  1212. Xsmail.exe: $(SMOBJ) libgen.lib
  1213. X    $(CC) $(LDFLAGS) -o $@ $(SMOBJ) -link libgen.lib
  1214. X    -exepack $@ junk
  1215. X    $(RM) $@
  1216. X    $(MV) junk $@
  1217. X
  1218. Xcmail.exe: $(CMOBJ) libgen.lib
  1219. X    $(CC) $(LDFLAGS) -o $@ $(CMOBJ) -link libgen.lib
  1220. X    -exepack $@ junk
  1221. X    $(RM) $@
  1222. X    $(MV) junk $@
  1223. X
  1224. Xnmail.exe: $(NMOBJ) libgen.lib
  1225. X    $(CC) $(LDFLAGS) -o $@ $(NMOBJ) -link libgen.lib
  1226. X    -exepack $@ junk
  1227. X    $(RM) $@
  1228. X    $(MV) junk $@
  1229. X
  1230. Xgmail.exe: $(GMOBJ) libgen.lib
  1231. X    $(CC) $(LDFLAGS) -o $@ $(GMOBJ) -link libgen.lib
  1232. X    -exepack $@ junk
  1233. X    $(RM) $@
  1234. X    $(MV) junk $@
  1235. X
  1236. Xlmail.exe: $(LMOBJ) libgen.lib
  1237. X    $(CC) $(LDFLAGS) -o $@ $(LMOBJ) -link libgen.lib
  1238. X    -exepack $@ junk
  1239. X    $(RM) $@
  1240. X    $(MV) junk $@
  1241. X
  1242. Xcico.exe: $(CIOBJ) $(CILIBS) libgen.lib
  1243. X    $(CC) $(LDFLAGS) -o $@ $(CIOBJ) -link $(CILIBS) libgen.lib
  1244. X    -exepack $@ junk
  1245. X    $(RM) $@
  1246. X    $(MV) junk $@
  1247. X
  1248. Xshlib1.lib: $(SHOBJ1)
  1249. X    $(RM) $@
  1250. X    lib $@ $(SHOBJ1) ;
  1251. X
  1252. Xshlib2.lib: $(SHOBJ2)
  1253. X    $(RM) $@
  1254. X    lib $@ $(SHOBJ2) ;
  1255. X
  1256. Xshlib3.lib: $(SHOBJ3)
  1257. X    $(RM) $@
  1258. X    lib $@ $(SHOBJ3) ;
  1259. X
  1260. Xshlib4.lib: $(SHOBJ4)
  1261. X    $(RM) $@
  1262. X    lib $@ $(SHOBJ4) ;
  1263. X
  1264. Xlibgen.lib: $(GNOBJ)
  1265. X    $(RM) $@
  1266. X    lib libgen $(GNOBJ) ;
  1267. X
  1268. Xcilib1.lib: $(CIOBJ1)
  1269. X    $(RM) $@
  1270. X    lib $@ $(CIOBJ1) ;
  1271. X
  1272. Xcilib2.lib: $(CIOBJ2)
  1273. X    $(RM) $@
  1274. X    lib $@ $(CIOBJ2) ;
  1275. X
  1276. Xcilib3.lib: $(CIOBJ3)
  1277. X    $(RM) $@
  1278. X    lib $@ $(CIOBJ3) ;
  1279. X
  1280. Xdepend:
  1281. X    @grep '^# *include *"' *.c|sed 's/c:# *include *"\([^"]*\)".*/obj:    \1/g'
  1282. X
  1283. Xalias.obj:    defs.h
  1284. Xalias.obj:    path.h
  1285. Xalias.obj:    pager.h
  1286. Xalias.obj:    mail.h
  1287. Xalias.obj:    screen.h
  1288. Xalias.obj:    status.h
  1289. Xascf.obj:    defs.h
  1290. Xascf.obj:    ascf.h
  1291. Xcall.obj:    defs.h
  1292. Xcall.obj:    path.h
  1293. Xcall.obj:    screen.h
  1294. Xcall.obj:    pager.h
  1295. Xcall.obj:    mail.h
  1296. Xcico.obj:    defs.h
  1297. Xcico.obj:    logs.h
  1298. Xcico.obj:    params.h
  1299. Xcico.obj:    comm.h
  1300. Xcico.obj:    status.h
  1301. Xcico.obj:    path.h
  1302. Xcmail.obj:    defs.h
  1303. Xcmail.obj:    ndir.h
  1304. Xcmail.obj:    path.h
  1305. Xcmail.obj:    status.h
  1306. Xcomm.obj:    defs.h
  1307. Xcomm.obj:    params.h
  1308. Xcomm.obj:    comm.h
  1309. Xconnect.obj:    defs.h
  1310. Xconnect.obj:    params.h
  1311. Xconnect.obj:    status.h
  1312. Xconnect.obj:    comm.h
  1313. Xconnect.obj:    logs.h
  1314. Xconnect.obj:    sysdep.h
  1315. Xcreate.obj:    defs.h
  1316. Xcreate.obj:    path.h
  1317. Xcreate.obj:    mail.h
  1318. Xcreate.obj:    status.h
  1319. Xcreate.obj:    screen.h
  1320. Xdesk.obj:    defs.h
  1321. Xdesk.obj:    mail.h
  1322. Xdesk.obj:    path.h
  1323. Xdesk.obj:    ndir.h
  1324. Xdesk.obj:    pager.h
  1325. Xdesk.obj:    screen.h
  1326. Xdesk.obj:    status.h
  1327. Xdesk.obj:    window.h
  1328. Xdesk.obj:    ascf.h
  1329. Xdesk.obj:    snapshot.h
  1330. Xdeskutil.obj:    defs.h
  1331. Xdeskutil.obj:    pager.h
  1332. Xdeskutil.obj:    mail.h
  1333. Xdeskutil.obj:    screen.h
  1334. Xdeskutil.obj:    status.h
  1335. Xedit.obj:    defs.h
  1336. Xedit.obj:    path.h
  1337. Xedit.obj:    mail.h
  1338. Xedit.obj:    status.h
  1339. Xemail.obj:    defs.h
  1340. Xemail.obj:    path.h
  1341. Xemail.obj:    pager.h
  1342. Xemail.obj:    screen.h
  1343. Xemail.obj:    mail.h
  1344. Xemail.obj:    status.h
  1345. Xerrdisp.obj:    defs.h
  1346. Xerrdisp.obj:    screen.h
  1347. Xerrdisp.obj:    pager.h
  1348. Xerrdisp.obj:    status.h
  1349. Xerrdisp.obj:    window.h
  1350. Xfile.obj:    defs.h
  1351. Xfile.obj:    screen.h
  1352. Xfile.obj:    pager.h
  1353. Xfile.obj:    mail.h
  1354. Xfile.obj:    ndir.h
  1355. Xfile.obj:    path.h
  1356. Xfile.obj:    status.h
  1357. Xfile.obj:    window.h
  1358. Xgetwork.obj:    defs.h
  1359. Xgetwork.obj:    logs.h
  1360. Xgetwork.obj:    status.h
  1361. Xgetwork.obj:    work.h
  1362. Xgetwork.obj:    params.h
  1363. Xgetwork.obj:    comm.h
  1364. Xgmail.obj:    defs.h
  1365. Xgmail.obj:    ndir.h
  1366. Xgmail.obj:    path.h
  1367. Xgphys.obj:    gp.h
  1368. Xgpres.obj:    gp.h
  1369. Xgtrans.obj:    gp.h
  1370. Xhsearch.obj:    hsearch.h
  1371. Xinvoke.obj:    defs.h
  1372. Xinvoke.obj:    status.h
  1373. Xkbdinp.obj:    defs.h
  1374. Xkbdinp.obj:    mail.h
  1375. Xkbdinp.obj:    screen.h
  1376. Xkbdinp.obj:    window.h
  1377. Xkio.obj:    uucp.h
  1378. Xkphys.obj:    kp.h
  1379. Xkpres.obj:    kp.h
  1380. Xktrans.obj:    kp.h
  1381. Xlmail.obj:    defs.h
  1382. Xlmail.obj:    path.h
  1383. Xlogs.obj:    defs.h
  1384. Xlogs.obj:    logs.h
  1385. Xlogs.obj:    path.h
  1386. Xlogs.obj:    status.h
  1387. Xmail.obj:    defs.h
  1388. Xmail.obj:    path.h
  1389. Xmail.obj:    status.h
  1390. Xmail.obj:    mail.h
  1391. Xmail.obj:    window.h
  1392. Xmailfile.obj:    defs.h
  1393. Xmailfile.obj:    path.h
  1394. Xmailfile.obj:    screen.h
  1395. Xmailfile.obj:    mail.h
  1396. Xmakework.obj:    defs.h
  1397. Xmakework.obj:    path.h
  1398. Xmakework.obj:    screen.h
  1399. Xmakework.obj:    mail.h
  1400. Xmbox.obj:    defs.h
  1401. Xmbox.obj:    path.h
  1402. Xmbox.obj:    pager.h
  1403. Xmbox.obj:    screen.h
  1404. Xmbox.obj:    mail.h
  1405. Xmbox.obj:    ascf.h
  1406. Xmbox.obj:    params.h
  1407. Xmbox.obj:    ms_parse.h
  1408. Xms_parse.obj:    defs.h
  1409. Xms_parse.obj:    ms_parse.h
  1410. Xmyalloc.obj:    defs.h
  1411. Xndir.obj:    ndir.h
  1412. Xnewseqno.obj:    defs.h
  1413. Xnewseqno.obj:    path.h
  1414. Xnewseqno.obj:    ndir.h
  1415. Xnewseqno.obj:    status.h
  1416. Xnmail.obj:    defs.h
  1417. Xnmail.obj:    ndir.h
  1418. Xnmail.obj:    path.h
  1419. Xnmail.obj:    status.h
  1420. Xnmail.obj:    ms_parse.h
  1421. Xpager.obj:    defs.h
  1422. Xpager.obj:    window.h
  1423. Xpager.obj:    pager.h
  1424. Xpager.obj:    path.h
  1425. Xpager.obj:    ascf.h
  1426. Xparams.obj:    defs.h
  1427. Xparams.obj:    path.h
  1428. Xparams.obj:    params.h
  1429. Xpath.obj:    defs.h
  1430. Xpath.obj:    path.h
  1431. Xpath.obj:    status.h
  1432. Xprotomsg.obj:    defs.h
  1433. Xprotomsg.obj:    params.h
  1434. Xprotomsg.obj:    comm.h
  1435. Xprotomsg.obj:    logs.h
  1436. Xprotomsg.obj:    status.h
  1437. Xreply.obj:    defs.h
  1438. Xreply.obj:    path.h
  1439. Xreply.obj:    pager.h
  1440. Xreply.obj:    screen.h
  1441. Xreply.obj:    status.h
  1442. Xreply.obj:    mail.h
  1443. Xreply.obj:    ascf.h
  1444. Xreply.obj:    ms_parse.h
  1445. Xrmtname.obj:    defs.h
  1446. Xrmtname.obj:    params.h
  1447. Xrmtname.obj:    comm.h
  1448. Xrmtname.obj:    logs.h
  1449. Xrmtname.obj:    status.h
  1450. Xrmtname.obj:    path.h
  1451. Xscanwork.obj:    defs.h
  1452. Xscanwork.obj:    params.h
  1453. Xscanwork.obj:    comm.h
  1454. Xscanwork.obj:    work.h
  1455. Xscanwork.obj:    path.h
  1456. Xscanwork.obj:    ndir.h
  1457. Xscanwork.obj:    logs.h
  1458. Xscreen.obj:    defs.h
  1459. Xscreen.obj:    screen.h
  1460. Xsendwork.obj:    defs.h
  1461. Xsendwork.obj:    work.h
  1462. Xsendwork.obj:    logs.h
  1463. Xsendwork.obj:    status.h
  1464. Xsendwork.obj:    params.h
  1465. Xsendwork.obj:    comm.h
  1466. Xsetup.obj:    defs.h
  1467. Xsetup.obj:    path.h
  1468. Xsetup.obj:    screen.h
  1469. Xsetup.obj:    mail.h
  1470. Xsetup.obj:    pager.h
  1471. Xsetup.obj:    params.h
  1472. Xsetup.obj:    status.h
  1473. Xsetup.obj:    window.h
  1474. Xsmail.obj:    defs.h
  1475. Xsmail.obj:    path.h
  1476. Xsmail.obj:    status.h
  1477. Xsnapshot.obj:    defs.h
  1478. Xsnapshot.obj:    path.h
  1479. Xsnapshot.obj:    ndir.h
  1480. Xsnapshot.obj:    snapshot.h
  1481. Xspoolfil.obj:    defs.h
  1482. Xspoolfil.obj:    path.h
  1483. Xspoolfil.obj:    ascf.h
  1484. Xspoolfil.obj:    status.h
  1485. Xspoolfil.obj:    ms_parse.h
  1486. Xstartup.obj:    defs.h
  1487. Xstartup.obj:    params.h
  1488. Xstartup.obj:    comm.h
  1489. Xstartup.obj:    logs.h
  1490. Xstartup.obj:    status.h
  1491. Xstartup.obj:    sysdep.h
  1492. Xstr.obj:    defs.h
  1493. Xsubmit.obj:    defs.h
  1494. Xsubmit.obj:    path.h
  1495. Xswitcher.obj:    defs.h
  1496. Xswitcher.obj:    work.h
  1497. Xswitcher.obj:    params.h
  1498. Xswitcher.obj:    comm.h
  1499. Xswitcher.obj:    logs.h
  1500. Xswitcher.obj:    status.h
  1501. Xsysdep.obj:    sysdep.h
  1502. Xtextcopy.obj:    defs.h
  1503. Xtextcopy.obj:    ascf.h
  1504. Xunalias.obj:    defs.h
  1505. Xunalias.obj:    hsearch.h
  1506. Xunalias.obj:    path.h
  1507. Xunalias.obj:    ascf.h
  1508. Xwindow.obj:    defs.h
  1509. Xwindow.obj:    window.h
  1510. Xxpres.obj:    defs.h
  1511. Xxpres.obj:    params.h
  1512. Xxpres.obj:    comm.h
  1513. Xxpres.obj:    status.h
  1514. Xxpres.obj:    sysdep.h
  1515. Xxpres.obj:    logs.h
  1516. END_OF_main/makefile.msc
  1517. if test 8027 -ne `wc -c <main/makefile.msc`; then
  1518.     echo shar: \"main/makefile.msc\" unpacked with wrong size!
  1519. fi
  1520. # end of overwriting check
  1521. fi
  1522. if test -f main/makefile.unx -a "${1}" != "-c" ; then 
  1523.   echo shar: Will not over-write existing file \"main/makefile.unx\"
  1524. else
  1525. echo shar: Extracting \"main/makefile.unx\" \(9508 characters\)
  1526. sed "s/^X//" >main/makefile.unx <<'END_OF_main/makefile.unx'
  1527. X# @(#) makefile.unx 2.1 1/22/90 13:02:09
  1528. X
  1529. X# Makefile for various versions of UNIX
  1530. X
  1531. X##################
  1532. X# Beginning of configurable options
  1533. X
  1534. X# Choose a message-transport mechanism, and select the corresponding definitions
  1535. X# for the DAEMON and PROGRAMS macros.
  1536. X#
  1537. X# 1 - The UUCP file transfer software provided with pc-mail (see the DEFAULT.ins
  1538. X#     document):
  1539. X#
  1540. X#    DAEMON =
  1541. X#    PROGRAMS = mail smail nmail cmail cico
  1542. X#
  1543. X# 2 - Daemon processes, presumably running on a file server (see the SLAVE.ins
  1544. X#     document):
  1545. X#
  1546. X#    DAEMON = -DDAEMON
  1547. X#    PROGRAMS = mail smail nmail cmail
  1548. X#
  1549. X# 3 - Message transport by GNUUCP (see the GNUUCP.ins document):
  1550. X#
  1551. X#    DAEMON = -DDAEMON
  1552. X#    PROGRAMS = mail smail nmail cmail gmail lmail
  1553. X
  1554. XDAEMON    =
  1555. XPROGRAMS= mail smail nmail cmail cico
  1556. X
  1557. X# Flags seen by both the c compiler and by the lint command
  1558. X#
  1559. X#    COPTS    = -DSIII -DUSENDIR    for AT&T unix System-III or System-V.2
  1560. X#    COPTS    = -DUSENDIR        for V7
  1561. X#    COPTS    = -Ddirect=dirent    SunOS 4.x
  1562. X#    COPTS    =             for most BSD4.x versions and clones
  1563. X
  1564. XCOPTS    = -DSIII -DUSENDIR
  1565. X
  1566. X# Object libraries needed for the interactive shell. The program only needs the
  1567. X# low-level terminal control routines and does its own screen management.
  1568. X#
  1569. X#    SHLIBS    = -lcurses    for SYSV.2
  1570. X#    SHLIBS    = -ltermcap    for V7+, BSD4.x, SunOS
  1571. X
  1572. XSHLIBS    = -lcurses
  1573. X
  1574. X# Object libraries needed by most other programs, e.g. for directory access.
  1575. X
  1576. XLIBS    =
  1577. X
  1578. X# Memory model, if you have to
  1579. X
  1580. XMODEL    = -Ml
  1581. X
  1582. X# End of configurable options
  1583. X##################
  1584. X
  1585. XSHELL    = /bin/sh
  1586. X
  1587. XCFLAGS    = -g $(COPTS) $(MODEL)
  1588. X
  1589. XRETRIEVE= xarch
  1590. X
  1591. XFILES    = README ascf.c ascf.h call.c cico.c cmail.c comm.c comm.h \
  1592. X    connect.c create.c defs.h desk.c deskutil.c \
  1593. X    email.c errdisp.c file.c getwork.c gp.h \
  1594. X    gphys.c gpres.c gtrans.c invoke.c kbdinp.c kio.c kp.h \
  1595. X    kphys.c kpres.c ktrans.c logs.c logs.h mailfile.c \
  1596. X    mail.c makework.c mbox.c myalloc.c \
  1597. X    newseqno.c pager.c pager.h params.c params.h path.c path.h \
  1598. X    protomsg.c nmail.c rmtname.c scanwork.c screen.c screen.h \
  1599. X    sendwork.c setup.c smail.c spoolfil.c startup.c \
  1600. X    status.h switcher.c sysdep.h window.c window.h \
  1601. X    work.h xpres.c comport.asm str.c alias.c edit.c submit.c \
  1602. X    unalias.c hsearch.c hsearch.h clmap.h comport.h hsearch.3 \
  1603. X    kproto.ms Beware makefile.unx makefile.msc \
  1604. X    mail.h Implement msd_dir.h \
  1605. X    msd_dir.c ndir.h ndir.c ms_parse.c ms_parse.h reply.c \
  1606. X    textcopy.c snapshot.c snapshot.h gmail.c lmail.c tutorial.ms \
  1607. X    DEFAULT.ins SLAVE.ins GNUUCP.ins DEFAULT.bat SLAVE.bat GNUUCP.bat \
  1608. X    PORTING 
  1609. X
  1610. X# Sources and objects for the interactive mail program
  1611. X
  1612. XSHSRC    = mail.c call.c desk.c file.c screen.c mbox.c kbdinp.c \
  1613. X    pager.c window.c setup.c errdisp.c invoke.c path.c myalloc.c \
  1614. X    ndir.c params.c newseqno.c email.c spoolfil.c ascf.c \
  1615. X    makework.c mailfile.c deskutil.c str.c alias.c edit.c submit.c \
  1616. X    ms_parse.c reply.c textcopy.c snapshot.c create.c
  1617. XSHOBJ    = mail.o call.o desk.o file.o screen.o mbox.o kbdinp.o \
  1618. X    pager.o window.o setup.o errdisp.o invoke.o path.o myalloc.o \
  1619. X    ndir.o params.o newseqno.o email.o spoolfil.o ascf.o \
  1620. X    makework.o mailfile.o deskutil.o str.o alias.o edit.o submit.o \
  1621. X    ms_parse.o reply.o textcopy.o snapshot.o create.o
  1622. X
  1623. X# Sources and objects for the smail program
  1624. X
  1625. XSMSRC    = smail.c path.c ndir.c newseqno.c ascf.c spoolfil.c str.c \
  1626. X    unalias.c hsearch.c ms_parse.c
  1627. XSMOBJ    = smail.o path.o ndir.o newseqno.o ascf.o spoolfil.o str.o \
  1628. X    unalias.o hsearch.o ms_parse.o
  1629. X
  1630. X# Sources and objects for the nmail program
  1631. X
  1632. XNMSRC    = nmail.c path.c ndir.c str.c newseqno.c ms_parse.c
  1633. XNMOBJ    = nmail.o path.o ndir.o str.o newseqno.o ms_parse.o
  1634. X
  1635. X# Sources and objects for the cmail program
  1636. X
  1637. XCMSRC    = cmail.c path.c ndir.c invoke.c str.c newseqno.c
  1638. XCMOBJ    = cmail.o path.o ndir.o invoke.o str.o newseqno.o
  1639. X
  1640. X# Sources and objects for the gmail program
  1641. X
  1642. XGMSRC    = gmail.c ndir.c path.c str.c newseqno.c
  1643. XGMOBJ    = gmail.o ndir.o path.o str.o newseqno.o
  1644. X
  1645. X# Sources and objects for the lmail program
  1646. X
  1647. XLMSRC    = lmail.c ndir.c path.c str.c newseqno.c
  1648. XLMOBJ    = lmail.o ndir.o path.o str.o newseqno.o
  1649. X
  1650. X# Sources and objects for the cico program
  1651. X
  1652. XCISRC    = ndir.c comm.c connect.c getwork.c kphys.c kpres.c ktrans.c logs.c \
  1653. X    cico.c myalloc.c newseqno.c params.c path.c protomsg.c rmtname.c \
  1654. X    scanwork.c sendwork.c startup.c switcher.c xpres.c \
  1655. X    gpres.c gtrans.c gphys.c str.c
  1656. XCIOBJ    = ndir.o comm.o connect.o getwork.o kphys.o kpres.o ktrans.o logs.o \
  1657. X    cico.o myalloc.o newseqno.o params.o path.o protomsg.o rmtname.o \
  1658. X    scanwork.o sendwork.o startup.o switcher.o xpres.o \
  1659. X    gpres.o gtrans.o gphys.o str.o
  1660. X
  1661. Xall:    $(PROGRAMS)
  1662. X
  1663. Xmail:    $(SHOBJ)
  1664. X    $(CC) $(CFLAGS) -o $@ $(SHOBJ) $(SHLIBS) $(LIBS)
  1665. X
  1666. Xsmail:    $(SMOBJ)
  1667. X    $(CC) $(CFLAGS) -o $@ $(SMOBJ) $(LIBS)
  1668. X
  1669. Xnmail:    $(NMOBJ)
  1670. X    $(CC) $(CFLAGS) -o $@ $(NMOBJ) $(LIBS)
  1671. X
  1672. Xcmail:    $(CMOBJ)
  1673. X    $(CC) $(CFLAGS) -o $@ $(CMOBJ) $(LIBS)
  1674. X
  1675. Xcico:    $(CIOBJ)
  1676. X    $(CC) $(CFLAGS) -o $@ $(CIOBJ) $(LIBS)
  1677. X
  1678. Xgmail:    $(GMOBJ)
  1679. X    $(CC) $(CFLAGS) -o $@ $(GMOBJ) $(LIBS)
  1680. X
  1681. Xlmail:    $(LMOBJ)
  1682. X    $(CC) $(CFLAGS) -o $@ $(LMOBJ) $(LIBS)
  1683. X
  1684. X# Linting targets
  1685. X
  1686. Xmlint:
  1687. X    lint $(COPTS) $(SHSRC)
  1688. X
  1689. Xnlint:
  1690. X    lint $(COPTS) $(NMSRC)
  1691. X
  1692. Xslint:
  1693. X    lint $(COPTS) $(SMSRC)
  1694. X
  1695. Xclint:
  1696. X    lint $(COPTS) $(CISRC)
  1697. X
  1698. Xglint:
  1699. X    lint $(COPTS) $(GMSRC)
  1700. X
  1701. Xllint:
  1702. X    lint $(COPTS) $(LMSRC)
  1703. X
  1704. X# Other targets
  1705. X
  1706. Xtutorial.doc: tutorial.ms
  1707. X    nroff -ms $? | col -b >$@
  1708. X
  1709. X$(FILES):
  1710. X    $(RETRIEVE) $@
  1711. X
  1712. Xclean:
  1713. X    rm -f *.o core *.out
  1714. X
  1715. Xclobber: clean
  1716. X    rm -f mail cmail nmail smail gmail lmail cico
  1717. X
  1718. Xshar:    $(FILES) tutorial.doc
  1719. X    shar $(FILES) tutorial.doc
  1720. X
  1721. Xdepend:
  1722. X    @grep '^# *include *"' *.c|sed 's/c:# *include *"\([^"]*\)".*/o:    \1/g'
  1723. X
  1724. Xalias.o:    defs.h
  1725. Xalias.o:    path.h
  1726. Xalias.o:    pager.h
  1727. Xalias.o:    mail.h
  1728. Xalias.o:    screen.h
  1729. Xalias.o:    status.h
  1730. Xascf.o:    defs.h
  1731. Xascf.o:    ascf.h
  1732. Xcall.o:    defs.h
  1733. Xcall.o:    path.h
  1734. Xcall.o:    screen.h
  1735. Xcall.o:    pager.h
  1736. Xcall.o:    mail.h
  1737. Xcico.o:    defs.h
  1738. Xcico.o:    logs.h
  1739. Xcico.o:    params.h
  1740. Xcico.o:    comm.h
  1741. Xcico.o:    status.h
  1742. Xcico.o:    path.h
  1743. Xcmail.o:    defs.h
  1744. Xcmail.o:    ndir.h
  1745. Xcmail.o:    path.h
  1746. Xcmail.o:    status.h
  1747. Xcomm.o:    defs.h
  1748. Xcomm.o:    params.h
  1749. Xcomm.o:    comm.h
  1750. Xconnect.o:    defs.h
  1751. Xconnect.o:    params.h
  1752. Xconnect.o:    status.h
  1753. Xconnect.o:    comm.h
  1754. Xconnect.o:    logs.h
  1755. Xconnect.o:    sysdep.h
  1756. Xcreate.o:    defs.h
  1757. Xcreate.o:    path.h
  1758. Xcreate.o:    mail.h
  1759. Xcreate.o:    status.h
  1760. Xcreate.o:    screen.h
  1761. Xdesk.o:    defs.h
  1762. Xdesk.o:    mail.h
  1763. Xdesk.o:    path.h
  1764. Xdesk.o:    ndir.h
  1765. Xdesk.o:    pager.h
  1766. Xdesk.o:    screen.h
  1767. Xdesk.o:    status.h
  1768. Xdesk.o:    window.h
  1769. Xdesk.o:    ascf.h
  1770. Xdesk.o:    snapshot.h
  1771. Xdeskutil.o:    defs.h
  1772. Xdeskutil.o:    pager.h
  1773. Xdeskutil.o:    mail.h
  1774. Xdeskutil.o:    screen.h
  1775. Xdeskutil.o:    status.h
  1776. Xedit.o:    defs.h
  1777. Xedit.o:    path.h
  1778. Xedit.o:    mail.h
  1779. Xedit.o:    status.h
  1780. Xemail.o:    defs.h
  1781. Xemail.o:    path.h
  1782. Xemail.o:    pager.h
  1783. Xemail.o:    screen.h
  1784. Xemail.o:    mail.h
  1785. Xemail.o:    status.h
  1786. Xerrdisp.o:    defs.h
  1787. Xerrdisp.o:    screen.h
  1788. Xerrdisp.o:    pager.h
  1789. Xerrdisp.o:    status.h
  1790. Xerrdisp.o:    window.h
  1791. Xfile.o:    defs.h
  1792. Xfile.o:    screen.h
  1793. Xfile.o:    pager.h
  1794. Xfile.o:    mail.h
  1795. Xfile.o:    ndir.h
  1796. Xfile.o:    path.h
  1797. Xfile.o:    status.h
  1798. Xfile.o:    window.h
  1799. Xgetwork.o:    defs.h
  1800. Xgetwork.o:    logs.h
  1801. Xgetwork.o:    status.h
  1802. Xgetwork.o:    work.h
  1803. Xgetwork.o:    params.h
  1804. Xgetwork.o:    comm.h
  1805. Xgmail.o:    defs.h
  1806. Xgmail.o:    ndir.h
  1807. Xgmail.o:    path.h
  1808. Xgphys.o:    gp.h
  1809. Xgpres.o:    gp.h
  1810. Xgtrans.o:    gp.h
  1811. Xhsearch.o:    hsearch.h
  1812. Xinvoke.o:    defs.h
  1813. Xinvoke.o:    status.h
  1814. Xkbdinp.o:    defs.h
  1815. Xkbdinp.o:    mail.h
  1816. Xkbdinp.o:    screen.h
  1817. Xkbdinp.o:    window.h
  1818. Xkio.o:    uucp.h
  1819. Xkphys.o:    kp.h
  1820. Xkpres.o:    kp.h
  1821. Xktrans.o:    kp.h
  1822. Xlmail.o:    defs.h
  1823. Xlmail.o:    path.h
  1824. Xlogs.o:    defs.h
  1825. Xlogs.o:    logs.h
  1826. Xlogs.o:    path.h
  1827. Xlogs.o:    status.h
  1828. Xmail.o:    defs.h
  1829. Xmail.o:    path.h
  1830. Xmail.o:    status.h
  1831. Xmail.o:    mail.h
  1832. Xmail.o:    window.h
  1833. Xmailfile.o:    defs.h
  1834. Xmailfile.o:    path.h
  1835. Xmailfile.o:    screen.h
  1836. Xmailfile.o:    mail.h
  1837. Xmakework.o:    defs.h
  1838. Xmakework.o:    path.h
  1839. Xmakework.o:    screen.h
  1840. Xmakework.o:    mail.h
  1841. Xmbox.o:    defs.h
  1842. Xmbox.o:    path.h
  1843. Xmbox.o:    pager.h
  1844. Xmbox.o:    screen.h
  1845. Xmbox.o:    mail.h
  1846. Xmbox.o:    ascf.h
  1847. Xmbox.o:    params.h
  1848. Xmbox.o:    ms_parse.h
  1849. Xms_parse.o:    defs.h
  1850. Xms_parse.o:    ms_parse.h
  1851. Xmyalloc.o:    defs.h
  1852. Xndir.o:    ndir.h
  1853. Xnewseqno.o:    defs.h
  1854. Xnewseqno.o:    path.h
  1855. Xnewseqno.o:    ndir.h
  1856. Xnewseqno.o:    status.h
  1857. Xnmail.o:    defs.h
  1858. Xnmail.o:    ndir.h
  1859. Xnmail.o:    path.h
  1860. Xnmail.o:    status.h
  1861. Xnmail.o:    ms_parse.h
  1862. Xpager.o:    defs.h
  1863. Xpager.o:    window.h
  1864. Xpager.o:    pager.h
  1865. Xpager.o:    path.h
  1866. Xpager.o:    ascf.h
  1867. Xparams.o:    defs.h
  1868. Xparams.o:    path.h
  1869. Xparams.o:    params.h
  1870. Xpath.o:    defs.h
  1871. Xpath.o:    path.h
  1872. Xpath.o:    status.h
  1873. Xprotomsg.o:    defs.h
  1874. Xprotomsg.o:    params.h
  1875. Xprotomsg.o:    comm.h
  1876. Xprotomsg.o:    logs.h
  1877. Xprotomsg.o:    status.h
  1878. Xreply.o:    defs.h
  1879. Xreply.o:    path.h
  1880. Xreply.o:    pager.h
  1881. Xreply.o:    screen.h
  1882. Xreply.o:    status.h
  1883. Xreply.o:    mail.h
  1884. Xreply.o:    ascf.h
  1885. Xreply.o:    ms_parse.h
  1886. Xrmtname.o:    defs.h
  1887. Xrmtname.o:    params.h
  1888. Xrmtname.o:    comm.h
  1889. Xrmtname.o:    logs.h
  1890. Xrmtname.o:    status.h
  1891. Xrmtname.o:    path.h
  1892. Xscanwork.o:    defs.h
  1893. Xscanwork.o:    params.h
  1894. Xscanwork.o:    comm.h
  1895. Xscanwork.o:    work.h
  1896. Xscanwork.o:    path.h
  1897. Xscanwork.o:    ndir.h
  1898. Xscanwork.o:    logs.h
  1899. Xscreen.o:    defs.h
  1900. Xscreen.o:    screen.h
  1901. Xsendwork.o:    defs.h
  1902. Xsendwork.o:    work.h
  1903. Xsendwork.o:    logs.h
  1904. Xsendwork.o:    status.h
  1905. Xsendwork.o:    params.h
  1906. Xsendwork.o:    comm.h
  1907. Xsetup.o:    defs.h
  1908. Xsetup.o:    path.h
  1909. Xsetup.o:    screen.h
  1910. Xsetup.o:    mail.h
  1911. Xsetup.o:    pager.h
  1912. Xsetup.o:    params.h
  1913. Xsetup.o:    status.h
  1914. Xsetup.o:    window.h
  1915. Xsmail.o:    defs.h
  1916. Xsmail.o:    path.h
  1917. Xsmail.o:    status.h
  1918. Xsnapshot.o:    defs.h
  1919. Xsnapshot.o:    path.h
  1920. Xsnapshot.o:    ndir.h
  1921. Xsnapshot.o:    snapshot.h
  1922. Xspoolfil.o:    defs.h
  1923. Xspoolfil.o:    path.h
  1924. Xspoolfil.o:    ascf.h
  1925. Xspoolfil.o:    status.h
  1926. Xspoolfil.o:    ms_parse.h
  1927. Xstartup.o:    defs.h
  1928. Xstartup.o:    params.h
  1929. Xstartup.o:    comm.h
  1930. Xstartup.o:    logs.h
  1931. Xstartup.o:    status.h
  1932. Xstartup.o:    sysdep.h
  1933. Xstr.o:    defs.h
  1934. Xsubmit.o:    defs.h
  1935. Xsubmit.o:    path.h
  1936. Xswitcher.o:    defs.h
  1937. Xswitcher.o:    work.h
  1938. Xswitcher.o:    params.h
  1939. Xswitcher.o:    comm.h
  1940. Xswitcher.o:    logs.h
  1941. Xswitcher.o:    status.h
  1942. Xsysdep.o:    sysdep.h
  1943. Xtextcopy.o:    defs.h
  1944. Xtextcopy.o:    ascf.h
  1945. Xunalias.o:    defs.h
  1946. Xunalias.o:    hsearch.h
  1947. Xunalias.o:    path.h
  1948. Xunalias.o:    ascf.h
  1949. Xwindow.o:    defs.h
  1950. Xwindow.o:    window.h
  1951. Xxpres.o:    defs.h
  1952. Xxpres.o:    params.h
  1953. Xxpres.o:    comm.h
  1954. Xxpres.o:    status.h
  1955. Xxpres.o:    sysdep.h
  1956. Xxpres.o:    logs.h
  1957. END_OF_main/makefile.unx
  1958. if test 9508 -ne `wc -c <main/makefile.unx`; then
  1959.     echo shar: \"main/makefile.unx\" unpacked with wrong size!
  1960. fi
  1961. # end of overwriting check
  1962. fi
  1963. if test -f main/xpres.c -a "${1}" != "-c" ; then 
  1964.   echo shar: Will not over-write existing file \"main/xpres.c\"
  1965. else
  1966. echo shar: Extracting \"main/xpres.c\" \(6977 characters\)
  1967. sed "s/^X//" >main/xpres.c <<'END_OF_main/xpres.c'
  1968. X/*++
  1969. X/* NAME
  1970. X/*      xpres 3
  1971. X/* SUMMARY
  1972. X/*      communications port i/o
  1973. X/* PROJECT
  1974. X/*      pc-mail
  1975. X/* PACKAGE
  1976. X/*      cico
  1977. X/* SYNOPSIS
  1978. X/*      xopen()
  1979. X/*
  1980. X/*      xclose()
  1981. X/*
  1982. X/*      xread(dummy,buf,len)
  1983. X/*      int dummy,len;
  1984. X/*      char *buf;
  1985. X/*
  1986. X/*      xwrite(dummy,buf,len)
  1987. X/*      int dummy,len;
  1988. X/*      char *buf;
  1989. X/*
  1990. X/*      xioctl(flag)
  1991. X/*      int flag;
  1992. X/* DESCRIPTION
  1993. X/*      The functions in this module perform functions analogous
  1994. X/*      to unix system calls, for the serial port of IBM-PC workalikes.
  1995. X/*
  1996. X/*      xopen() initializes a serial port. Also needed under UNIX.
  1997. X/*
  1998. X/*      xclose() closes a port.
  1999. X/*
  2000. X/*      xread(), xwrite() do not use their first argument. Under UNIX
  2001. X/*    one should use the standard read() and write() system calls.
  2002. X/*
  2003. X/*      xioctl() enables xon/xoff flow control if its argument
  2004. X/*      is nonzero. Not used under UNIX.
  2005. X/* SEE ALSO
  2006. X/*      comport.asm, IBM-PC comm routines by Tim Pozar
  2007. X/* DIAGNOSTICS
  2008. X/*      The read functions returns EOF in case of timeout; the write
  2009. X/*      function never detects any failure.
  2010. X/* BUGS
  2011. X/*      The xioctl() function is utterly primitive.
  2012. X/* AUTHOR(S)
  2013. X/*      MS-DOS parts derived from uuslave software (John Gilmore)
  2014. X/*    published on usenet early 1987. Bugs fixed & severely hacked by
  2015. X/*
  2016. X/*      W.Z. Venema
  2017. X/*      Eindhoven University of Technology
  2018. X/*      Department of Mathematics and Computer Science
  2019. X/*      Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  2020. X/* CREATION DATE
  2021. X/*      Sat Mar 28 23:01:43 GMT+1:00 1987
  2022. X/* LAST MODIFICATION
  2023. X/*    90/01/22 13:02:59
  2024. X/* VERSION/RELEASE
  2025. X/*    2.1
  2026. X/*--*/
  2027. X
  2028. X#include <stdio.h>
  2029. X
  2030. X#include "defs.h"
  2031. X#include "params.h"
  2032. X#include "comm.h"            /* baud rates, tty ports,... */
  2033. X#include "status.h"
  2034. X#include "sysdep.h"            /* other system dependencies */
  2035. X#include "logs.h"
  2036. X
  2037. X#ifdef    unix
  2038. X#   include <sgtty.h>
  2039. X#   include <signal.h>
  2040. X#   include <setjmp.h>
  2041. X#endif
  2042. X
  2043. X#ifdef    MSDOS
  2044. X#   define B(x)    (115200/(x))
  2045. Xstatic int sigint();
  2046. Xstatic void get_time();
  2047. X
  2048. X#endif
  2049. X
  2050. Xtypedef struct {            /* baud-rate lookup table */
  2051. X    char   *name;
  2052. X    int     code;
  2053. X} Baud_table;
  2054. X
  2055. XBaud_table btable[] = {
  2056. X#ifdef    unix
  2057. X    "50",    B50,
  2058. X    "75",    B75,
  2059. X    "110",    B110,
  2060. X    "134",    B134,
  2061. X    "150",    B150,
  2062. X    "300",    B300,
  2063. X    "600",    B600,
  2064. X    "1200",    B1200,
  2065. X    "1800",    B1800,
  2066. X    "2400",    B2400,
  2067. X    "4800",    B4800,
  2068. X    "9600",    B9600,
  2069. X#endif
  2070. X#ifdef    MSDOS
  2071. X    "50",    B(50),
  2072. X    "75",    B(75),
  2073. X    "110",    B(110),
  2074. X    "134",    B(134),
  2075. X    "150",    B(150),
  2076. X    "300",    B(300),
  2077. X    "600",    B(600),
  2078. X    "1200",    B(1200),
  2079. X    "1800",    B(1800),
  2080. X    "2400",    B(2400),
  2081. X    "4800",    B(4800),
  2082. X    "9600",    B(9600),
  2083. X#endif
  2084. X    0,        0,
  2085. X};
  2086. X
  2087. X/* xopen - open communications port; parameters taken from setup table */
  2088. X
  2089. Xxopen()
  2090. X{
  2091. X    register Baud_table *bp;
  2092. X
  2093. X#ifdef    unix
  2094. X    struct sgttyb ttmode;
  2095. X
  2096. X#endif
  2097. X
  2098. X    for (bp = btable; bp->name; bp++)        /* look up baud rate */
  2099. X    if (strcmp(bp->name, COMM_RATE) == 0)
  2100. X        break;
  2101. X    if (bp->name == 0) {            /* bad baud rate in setup */
  2102. X    debug(4) ("Invalid baud rate %s\n", COMM_RATE);
  2103. X    exit(E_BADSETUP);
  2104. X    }
  2105. X#ifdef    unix
  2106. X    if ((ttfd = open(COMM_LINE, 2)) < 0) {    /* try to access port */
  2107. X    debug(4) ("Cannot access %s\n", COMM_LINE);
  2108. X    exit(E_BADSETUP);
  2109. X    }
  2110. X#ifndef SIII
  2111. X    if (ioctl(ttfd, TIOCEXCL))            /* exclusive access */
  2112. X    exit(E_BADSETUP);            /* not a terminal */
  2113. X#endif
  2114. X    ioctl(ttfd, TIOCHPCL);            /* hangup when done */
  2115. X    gtty(ttfd, &ttmode);            /* get port status */
  2116. X    ttmode.sg_ispeed = ttmode.sg_ospeed = bp->code;    /* set baud rate */
  2117. X    ttmode.sg_flags |= (RAW);            /* raw mode */
  2118. X#ifdef    SIII
  2119. X    ttmode.sg_flags &= ~ECHO;
  2120. X#else
  2121. X    ttmode.sg_flags &= ~(ECHO | TANDEM | CBREAK);    /* no echo, crlf, flow
  2122. X                             * control */
  2123. X#endif
  2124. X    stty(ttfd, &ttmode);
  2125. X#endif
  2126. X
  2127. X#ifdef MSDOS
  2128. X    set_tty(bp->code);                /* set baud rate, DTR */
  2129. X    init_comm();                /* turn interrupts on */
  2130. X    signal(SIGINT, sigint);            /* must reset tty */
  2131. X    inp_flush();                /* flush garbage */
  2132. X    sleep(3);
  2133. X#endif
  2134. X}
  2135. X
  2136. X/* xclose - release the communications port */
  2137. X
  2138. Xxclose()
  2139. X{
  2140. X#ifdef    unix
  2141. X    close(ttfd);
  2142. X#endif
  2143. X
  2144. X#ifdef MSDOS
  2145. X    uninit_comm();
  2146. X#endif
  2147. X}
  2148. X
  2149. X/* xread - read from the serial port */
  2150. X
  2151. X#ifdef    MSDOS
  2152. X
  2153. Xxread(fd, buf, cnt)
  2154. Xint     fd;
  2155. Xchar   *buf;
  2156. Xregister int cnt;
  2157. X{
  2158. X    register char *p = buf;
  2159. X    register int c;
  2160. X
  2161. X    while (cnt > 0 && (c = xgetc()) != EOF) {
  2162. X    *p++ = c;
  2163. X    cnt--;
  2164. X    }
  2165. X    return (p - buf ? p - buf : -1);
  2166. X}
  2167. X
  2168. X#endif                    /* MSDOS xwrite() */
  2169. X
  2170. X/* xgetc - read one character from serial port */
  2171. X
  2172. X#ifdef    unix
  2173. Xjmp_buf xbuf;
  2174. X
  2175. Xstatic  timeout()
  2176. X{                    /* aux function for xgetc */
  2177. X    longjmp(xbuf, 1);
  2178. X}
  2179. X
  2180. Xxgetc()
  2181. X{                    /* return next char */
  2182. X    char    ch;
  2183. X
  2184. X    if (setjmp(xbuf))                /* in case we time out */
  2185. X    return (EOF);                /* we just did */
  2186. X    signal(SIGALRM, timeout);            /* set timer response */
  2187. X    alarm(BYTE_TIMEOUT);            /* set timer */
  2188. X
  2189. X    if (read(ttfd, &ch, 1) != 1)        /* go wait for character */
  2190. X    return(EOF);
  2191. X    alarm(0);                    /* turn timer off */
  2192. X    return (ch & 0377);                /* successfull termination */
  2193. X}
  2194. X
  2195. X#endif                    /* unix xgetc() */
  2196. X
  2197. X#ifdef MSDOS
  2198. X
  2199. Xxgetc()
  2200. X{
  2201. X    char    data;
  2202. X
  2203. X    int     i;
  2204. X    unsigned s;
  2205. X    TIME    n;
  2206. X
  2207. X    i = 0;
  2208. X    get_time(&n);
  2209. X    s = n.sec;
  2210. X
  2211. X    /*
  2212. X     * Implement timeouts by staring at the clock while we wait. When the
  2213. X     * second hand moves, bump our counter.  This is a lot easier than
  2214. X     * figuring out the time when we'd time out (in hours, minutes, and
  2215. X     * seconds!) and comparing against that, which is what people tend to do
  2216. X     * in Unix where the time is just an integer number of seconds.
  2217. X     */
  2218. X    while (i < BYTE_TIMEOUT) {
  2219. X    while (s == n.sec) {
  2220. X        if (inp_cnt() != 0) {
  2221. X        data = inp_char();
  2222. X        return (data & 0xFF);
  2223. X        }
  2224. X        get_time(&n);
  2225. X    }
  2226. X    s = n.sec;
  2227. X    ++i;
  2228. X    }
  2229. X    return (EOF);
  2230. X}
  2231. X
  2232. X/* xwrite - write buffer to serial port */
  2233. X
  2234. Xxwrite(fd, buf, ctr)
  2235. Xint     fd;
  2236. Xregister char *buf;
  2237. Xint     ctr;
  2238. X{
  2239. X    register int i = ctr;
  2240. X
  2241. X    while (i-- > 0)
  2242. X    outp_char(*buf++);
  2243. X    return ctr;
  2244. X}
  2245. X
  2246. X/*
  2247. X * Routines specific to MS-DOS
  2248. X *
  2249. X * xioctl()    enable xon/xoff
  2250. X * get_timer()    read current time
  2251. X * sigint()    clean up interrupt handler and exit
  2252. X * sleep()    unix lookalike
  2253. X */
  2254. X
  2255. X/* xioctl - enable xon/xoff protocol */
  2256. X
  2257. Xxioctl(flag)
  2258. Xint     flag;
  2259. X{
  2260. X    set_xoff(flag);                /* Enable (flag != 0) or
  2261. X                         * disable flow control */
  2262. X}
  2263. X
  2264. X/* sigint - restore terminal settings on dialout line */
  2265. X
  2266. Xstatic int sigint()
  2267. X{
  2268. X    uninit_comm();
  2269. X    reset_tty();
  2270. X    exit(0);
  2271. X}
  2272. X
  2273. X/* get_time - read time with dos call */
  2274. X
  2275. Xstatic void get_time(n)
  2276. XTIME_PTR n;
  2277. X{
  2278. X    union REGS inregs;
  2279. X    union REGS outregs;
  2280. X
  2281. X    inregs.h.ah = 0x2c;                /* Please make a #define for
  2282. X                         * this, Tim */
  2283. X
  2284. X    int86(0x21, &inregs, &outregs);        /* Please #define the 0x21
  2285. X                         * too */
  2286. X
  2287. X    n->hour = outregs.h.ch;
  2288. X    n->minute = outregs.h.cl;
  2289. X    n->sec = outregs.h.dh;
  2290. X    n->hsec = outregs.h.dl;
  2291. X}
  2292. X
  2293. X#define    get_sec(n)    (get_time(&n),n.sec)
  2294. X
  2295. Xsleep(x)
  2296. Xint     x;
  2297. X{
  2298. X    TIME    n;                /* current time record */
  2299. X    unsigned s = get_sec(n);
  2300. X
  2301. X    while (x-- > 0) {
  2302. X    while (s == get_sec(n))
  2303. X         /* void */ ;
  2304. X    s = n.sec;
  2305. X    }
  2306. X}
  2307. X
  2308. X#endif                    /* MSDOS */
  2309. END_OF_main/xpres.c
  2310. if test 6977 -ne `wc -c <main/xpres.c`; then
  2311.     echo shar: \"main/xpres.c\" unpacked with wrong size!
  2312. fi
  2313. # end of overwriting check
  2314. fi
  2315. echo shar: End of archive 7 \(of 11\).
  2316. cp /dev/null ark7isdone
  2317. MISSING=""
  2318. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  2319.     if test ! -f ark${I}isdone ; then
  2320.     MISSING="${MISSING} ${I}"
  2321.     fi
  2322. done
  2323. if test "${MISSING}" = "" ; then
  2324.     echo You have unpacked all 11 archives.
  2325.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2326. else
  2327.     echo You still need to unpack the following archives:
  2328.     echo "        " ${MISSING}
  2329. fi
  2330. ##  End of shell archive.
  2331. exit 0
  2332.  
  2333.  
  2334.