home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume10 / pcmail2 / part07 < prev    next >
Text File  |  1990-01-24  |  61KB  |  2,341 lines

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