home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / mush.lzh / mush.19 < prev    next >
Text File  |  1990-05-06  |  48KB  |  1,531 lines

  1.  
  2. #! /bin/sh
  3. # This is a shell archive.  Remove anything before this line, then feed it
  4. # into a shell via "sh file" or similar.  To overwrite existing files,
  5. # type "sh file -c".
  6. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  7. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  8. # If this archive is complete, you will see the following message at the end:
  9. #        "End of archive 19 (of 19)."
  10. # Contents:  mush/Gnurc mush/Mailrc mush/advanced.mushrc
  11. #   mush/bindings.h mush/config.h-dist mush/digestify mush/execute.c
  12. #   mush/glob.h mush/lock.c mush/mail.icon.1 mush/mail.icon.2
  13. #   mush/makefile.hpux mush/makefile.sys.v
  14. # Wrapped by argv@turnpike on Wed May  2 13:59:57 1990
  15. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  16. if test -f 'mush/Gnurc' -a "${1}" != "-c" ; then 
  17.   echo shar: Will not clobber existing file \"'mush/Gnurc'\"
  18. else
  19. echo shar: Extracting \"'mush/Gnurc'\" \(3198 characters\)
  20. sed "s/^X//" >'mush/Gnurc' <<'END_OF_FILE'
  21. X# .mushrc to simulate Gnu emacs (NOT Rmail!) for curses mode
  22. X# -- Bart Schaefer (schaefer@cse.ogc.edu)
  23. X#---------------------------------------------------------------------------
  24. X# Shortcomings:
  25. X#  In compose mode, can't use C-h, C-r, C-w, DEL, etc.
  26. X#  Ought to delete most of the default bindings.  If you want remove the
  27. X#   default bindings, you can:
  28. X#    Run "mush -noinit" and do a "saveopts";
  29. X#    Edit the saved file and change every "bind" to an "unbind";
  30. X#    Remove all other extranous commands;
  31. X#    Include the resulting list at the TOP of this file.
  32. X#---------------------------------------------------------------------------
  33. X#
  34. Xset no_reverse
  35. X#
  36. X# TTY setup -- you may want to customize this, because the old interrupt
  37. X#  character and so on might not be reset correctly when mush exits.
  38. X#
  39. Xcmd ntty 'stty intr ^G dsusp undef stop undef start undef lnext undef'
  40. Xcmd rtty 'stty intr ^C dsusp ^Y stop ^S start ^Q lnext ^V'
  41. Xcmd exit 'rtty; \exit'
  42. Xcmd xit exit
  43. Xcmd x exit
  44. Xcmd quit 'update; exit'
  45. Xcmd q quit
  46. Xcmd curses 'ntty; \curses; rtty'
  47. X#
  48. X# Curses mode bindings
  49. X#
  50. X# Exiting -- try to make sure tty gets reset
  51. Xbind-macro '\CX\CC' '[line-mode]exit\n'
  52. Xbind-macro x [no-op]
  53. Xbind-macro X [no-op]
  54. Xbind-macro q [no-op]
  55. Xbind-macro Q [no-op]
  56. X# Files (folders)
  57. Xbind '\CX\CF' folder
  58. Xbind '\CX\CS' update
  59. Xbind-macro '\CXi' '[line-mode]merge '
  60. Xbind '\CX\CV' folder
  61. Xbind-macro '\CX\CW' '[save-list]*\n'
  62. X# Help
  63. Xbind '\CX\CH' help    # Can't use just C-h, it's a prefix of the others
  64. Xbind-macro '\CHa' '[bind]_\n\n\CH'    # List all curses commands
  65. Xbind-macro '\CHc' '[line-mode]bind '    # Show one binding
  66. Xbind-macro '\CHf' '[line-mode]? '    # Explain line-mode function
  67. X# Error Recovery -- very primitive, sorry
  68. Xbind '\CXu' undelete-list
  69. Xbind '\C_' undelete-list
  70. X# Searching -- sorry, can't be incremental
  71. X#  also can't repeat with same key
  72. Xbind '\CS' search-next
  73. Xbind '\CR' search-back
  74. X# Motion (the important part)
  75. Xbind '\CB' back-msg
  76. Xbind '\Eb' back-msg
  77. Xbind '\CP' back-msg
  78. Xbind '\CF' next-msg
  79. Xbind '\Ef' next-msg
  80. Xbind '\CN' next-msg
  81. Xbind '\Ea' back-msg
  82. Xbind '\Ee' next-msg
  83. Xbind '\E[' top-page
  84. Xbind '\E]' bottom-page
  85. Xbind '\CX[' screen-back
  86. Xbind '\CX]' screen-next
  87. Xbind '\E<' first-msg
  88. Xbind '\E>' last-msg
  89. Xbind '\CV' screen-next
  90. Xbind '\Ev' screen-back
  91. X# Killing/deleting ("forward", i.e. at cursor, only)
  92. Xbind '\CD' delete
  93. Xbind '\Ed' delete
  94. Xbind '\CK' delete
  95. Xbind '\Ek' delete
  96. Xbind-macro '\CW' '[line-mode]delete [getstr] | set kill\n[no-op]'
  97. Xbind-macro '\CY' '[undelete-list]$kill\n'
  98. X# Marking -- somewhat limited because can't use C-SPC (C-@)
  99. Xbind-macro '\CX\CX' '[line-mode].|set mark\n[no-op]'
  100. Xbind-macro '\Eh' '[line-mode]h|set mark\n[no-op]'
  101. Xbind-macro '\CXCP' '[line-mode]h|set mark\n[no-op]'
  102. Xbind-macro '\CXh' '[line-mode]*|set mark\n[no-op]'
  103. X# Buffers -- treated same as folders
  104. Xbind '\CXb' folder
  105. Xbind-macro '\CX\CB' '[folder]?\n\CH'    # List folders and back out
  106. Xbind-macro '\CXk' '[delete-list]*\n'
  107. X# Shells
  108. Xbind-macro '\E!'\
  109. X    '[line-mode]rtty\n[shell-escape][getline][line-mode]ntty\n'
  110. Xbind-macro '\Ex!' '[line-mode]rtty;sh\n[line-mode]ntty\n'
  111. X# Macros
  112. X#  Sorry, no appending to macros, and end with <RETURN> not `C-x )'
  113. Xbind '\CX(' bind-macro
  114. X#
  115. X# Lastly, actually reset the tty
  116. X#
  117. Xif iscurses
  118. X    ntty
  119. Xendif
  120. END_OF_FILE
  121. if test 3198 -ne `wc -c <'mush/Gnurc'`; then
  122.     echo shar: \"'mush/Gnurc'\" unpacked with wrong size!
  123. fi
  124. # end of 'mush/Gnurc'
  125. fi
  126. if test -f 'mush/Mailrc' -a "${1}" != "-c" ; then 
  127.   echo shar: Will not clobber existing file \"'mush/Mailrc'\"
  128. else
  129. echo shar: Extracting \"'mush/Mailrc'\" \(1955 characters\)
  130. sed "s/^X//" >'mush/Mailrc' <<'END_OF_FILE'
  131. X# .mushrc to cause Mush to emulate UCB Mail
  132. X# -- Bart Schaefer (schaefer@cse.ogi.edu)
  133. X#
  134. X# This file can be used as either the DEFAULT_RC or the ALT_DEF_RC (see
  135. X#  config.h) but such use is NOT recommended.  Instead, you should modify
  136. X#  one of those files to "source" this file.
  137. X#
  138. X#----------------------------------------------------------------------------
  139. X# Shortcomings:
  140. X#  Mush does not support the "noisy phone line" flags of Mail
  141. X#   (-i command line option or "set ignore" to ignore RUBOUT characters)
  142. X#  Mush will never remove a system mailbox (no "unset keep" equivalent)
  143. X#  See comments below on (lack of) command prefix recognition
  144. X#----------------------------------------------------------------------------
  145. X#
  146. X# Set up prompting, headers
  147. X#
  148. Xset prompt='& '
  149. Xset mil_time date_received
  150. Xset hdr_format='%8.80a %D %M %-2N %5T  %l/%c "%.29s"'
  151. X#
  152. X# Set up mailing/replying miscellaneous
  153. X#
  154. Xset indent_str = "    "
  155. Xset reply_to_hdr auto_route
  156. X#
  157. X# Set up command interface
  158. X#  Note that a full emulation is difficult, because Mush does not support
  159. X#  command prefix recognition (e.g., Mail interprets "Rep" as "Reply").
  160. X#
  161. X# Don't barf if history doesn't work, but still do cmd expansion
  162. X#
  163. Xset nonobang
  164. X#
  165. X# This stuff is fine, but really needs prefix recognition.
  166. X#
  167. Xcmd Reply replysender
  168. Xcmd R replysender
  169. Xcmd alt alternates
  170. Xcmd chdir cd
  171. Xcmd chd cd
  172. Xcmd + next
  173. Xcmd ch cd
  174. Xcmd c copy
  175. Xcmd file folder
  176. Xcmd fi folder
  177. Xcmd hold preserve
  178. Xcmd ho hold
  179. Xcmd reply replyall
  180. Xcmd r replyall
  181. Xcmd retain "set show_hdrs='\!*'"    # Not quite right, but ...
  182. Xcmd se set
  183. Xcmd shell sh
  184. Xcmd so source
  185. Xcmd un undelete
  186. Xcmd unread 'flags \!* U'    # "unread" is undocumented in Mail
  187. Xcmd uns unset
  188. Xcmd vi v
  189. Xcmd z 'z \!* + | from -'    # "z" changes current message in Mail
  190. Xcmd z+ z
  191. Xcmd z- 'z \!* -'
  192. X#
  193. X# You may want this file sourced, especially if you are not using the
  194. X#  supplied Mushrc file as your DEFAULT_RC.
  195. X#
  196. X# set ALT_DEF_RC = "/usr/lib/Mail.rc"
  197. X# source $ALT_DEF_RC
  198. X# unset ALT_DEF_RC
  199. END_OF_FILE
  200. if test 1955 -ne `wc -c <'mush/Mailrc'`; then
  201.     echo shar: \"'mush/Mailrc'\" unpacked with wrong size!
  202. fi
  203. # end of 'mush/Mailrc'
  204. fi
  205. if test -f 'mush/advanced.mushrc' -a "${1}" != "-c" ; then 
  206.   echo shar: Will not clobber existing file \"'mush/advanced.mushrc'\"
  207. else
  208. echo shar: Extracting \"'mush/advanced.mushrc'\" \(4967 characters\)
  209. sed "s/^X//" >'mush/advanced.mushrc' <<'END_OF_FILE'
  210. X# advanced.mushrc
  211. X# by Bart Schaefer
  212. X# with special thanks to Phil Lapsley <phil@east.Berkeley.EDU>, who
  213. X# provided the original files on which this example is based.  Most of
  214. X# Phil's stuff is still here -- just reorganized and updated to use
  215. X# mush 6.4 features that were unavailable when Phil did the originals.
  216. X#
  217. X# This file is intended to demonstrate helpful ways to use the
  218. X# .mushrc, not advanced mush commands.
  219. X
  220. X# The variable $thisfolder is always set EXCEPT when the .mushrc file
  221. X# is read the first time.  A test for non-existance of $thisfolder
  222. X# allows the same .mushrc file to be sourced repeatedly without
  223. X# redundant execution of the initialization commands.
  224. X#
  225. Xif ! $?thisfolder
  226. X    # Ignore the usual stuff
  227. X    ignore    received via message-id status
  228. X    # Hide folders in ~/.mail and save read mail in spool
  229. X    set        folder=~/.mail hold
  230. X    # Remember a few commands, set up editors, act like a shell
  231. X    set        history=20 editor=ex visual=vi unix
  232. X    # Prompt has folder name, message number, history number
  233. X    set        prompt="%f %m (!) & "
  234. X    # Header summaries show name, date, and subject
  235. X    set        hdr_format="%25n %-15d  %27s"
  236. X    # Initialize the cmds below (see later comments)
  237. X    set        first_time=1
  238. X
  239. X    # These two commands are used for automated "bursting" of the spool
  240. X    # mailbox.  This means that the messages are reorganized into new
  241. X    # folders to be read in a prearranged order.  See comments below.
  242. X    #
  243. X    # n brings up the next folder, not the next message
  244. X    cmd        n    'source ~/.mushrc'
  245. X    # N gets the next folder without "bursting"
  246. X    cmd        N    'set first_time=0; source ~/.mushrc'
  247. X
  248. X    # Delete messages by pattern-matching.  Examples:
  249. X    #  del f mailer-daemon        Delete mail from mailer-daemon
  250. X    #  del t mush-users            Delete mail to mush-users
  251. X    cmd        del    'pick -i -\!* | delete'
  252. X    # Forwarding
  253. X    cmd        for    'mail -f'
  254. X    # Quick folder change
  255. X    cmd        F    'folder'
  256. X
  257. X    # Some useful aliases
  258. X    alias    dheller    'The Mush God <argv@sun.com>'
  259. X    alias    barts    'Archangel Mushael <schaefer@cse.ogi.edu>'
  260. X
  261. X    # On init, don't source beyond this point
  262. X    exit
  263. Xendif    # End of init section -- read on startup only
  264. X
  265. X# This part of the file handles "bursting".  A burst is done when the
  266. X# n cmd is used the first time.  This is most useful if you habitually
  267. X# have lots of mail when you first log in each morning; unwanted mail
  268. X# can be deleted, and other mail organized for you.
  269. X#
  270. X# The folders in this example bursting scheme are:
  271. X#    mush-users    anything to or cc'ed to mush-users
  272. X#    stats        daily stats
  273. X#    root        root mail other than daily stats
  274. X# Mail not falling into one of these categories is left in the system
  275. X# mailbox to be dealt with first.
  276. X#
  277. Xif $first_time
  278. X    # Kill off some uucp garbage
  279. X    pick -i -s "file c.* delete" | delete
  280. X    pick -i -s "file .* can.t access" | delete
  281. X    pick -i -s "remote access to path/file denied" | delete
  282. X    # Nuke the boring usenet stuff
  283. X    pick -i -f usenet | pick -i -s "uucp map for" | delete
  284. X    pick -i -t usenet | pick -i -s "returned mail" | delete
  285. X    pick -i -t usenet | pick -i -s "automatic test echo" | delete
  286. X    pick -i -t "owner-post" | pick -i -s "unknown mailer" | delete
  287. X    pick -i -s "usenet disk space report" | delete
  288. X    pick -i -s "very old news articles" | delete
  289. X    pick -i -s "uucp map for" | delete
  290. X    # Wipe out some uninteresting daily stats
  291. X    pick -i -s "the maid was here." | delete
  292. X    pick -i -s "daily accounting" | delete
  293. X    pick -i -t netsurvey | delete
  294. X    # Get rid of these things for good.  This isn't essential, but
  295. X    # avoids complexity in the later "pick" commands.
  296. X    update
  297. X    # Save anything "to" or "cc" to mush-users in that folder.
  298. X    pick -i -t mush-users | save +mush-users
  299. X    pick -i -h cc mush-users | save +mush-users
  300. X    # Also save interesting daily stat mail and generic root mail
  301. X    pick -i -f root | pick -i -s stats | save +stats
  302. X    pick -i -f root | pick -i -s report | save +stats
  303. X    pick -i -f uucp | pick -i -s report | save +stats
  304. X    pick -i -f root | pick -i -s summary | save +stats
  305. X    pick -i -f root | pick -i -s munge | save +stats
  306. X    pick -i -t root | save +root
  307. X    # Again, make the changes permanent.  Saved mail gets deleted.
  308. X    # This won't work if you have $keepsave set.
  309. X    update
  310. X
  311. X    # Make sure we don't burst again needlessly.
  312. X    set first_time=0
  313. X
  314. X    # Stop sourcing here.  Otherwise, we'd change folders without
  315. X    # handling the mail left in the system mailbox.
  316. X    exit
  317. Xendif
  318. X
  319. X# Finally, handle stepping through the folders one by one.  This has been
  320. X# set up for sendmail, where the system mailbox is /usr/spool/mail/$USER,
  321. X# but could easily be modified for other mailers.
  322. X#
  323. X# $thisfolder:t returns the tail only of the folder name.
  324. X
  325. Xif $thisfolder:t == $USER
  326. X    folder +stats
  327. X    exit
  328. Xendif
  329. X
  330. Xif $thisfolder:t == stats
  331. X    folder +mush-users
  332. X    exit
  333. Xendif
  334. X
  335. Xif $thisfolder:t == mush-users
  336. X    folder +root
  337. X    exit
  338. Xendif
  339. X
  340. X# Default back to the system mailbox
  341. Xfolder %
  342. X
  343. X# End of advanced.mushrc
  344. END_OF_FILE
  345. if test 4967 -ne `wc -c <'mush/advanced.mushrc'`; then
  346.     echo shar: \"'mush/advanced.mushrc'\" unpacked with wrong size!
  347. fi
  348. # end of 'mush/advanced.mushrc'
  349. fi
  350. if test -f 'mush/bindings.h' -a "${1}" != "-c" ; then 
  351.   echo shar: Will not clobber existing file \"'mush/bindings.h'\"
  352. else
  353. echo shar: Extracting \"'mush/bindings.h'\" \(2947 characters\)
  354. sed "s/^X//" >'mush/bindings.h' <<'END_OF_FILE'
  355. X/* bindings.h  -- command bindings */
  356. X
  357. X#define MAX_BIND_LEN 20   /* max length a string can be to bind to a command */
  358. X#define MAX_MACRO_LEN 256 /* max length of a macro bound to a command */
  359. X
  360. X/* to see if a key sequence matches, prefixes or misses a set binding */
  361. X#define NO_MATCH    0
  362. X#define MATCH        1
  363. X#define A_PREFIX_B    2
  364. X#define B_PREFIX_A    3
  365. X
  366. X/*
  367. X * Constants to define curses mode functions.
  368. X */
  369. X#ifdef NULL_MAP
  370. X#undef NULL_MAP
  371. X#endif /* NULL_MAP */
  372. X#define NULL_MAP    (struct cmd_map *)0
  373. X
  374. X#define C_ERROR        (-1L)
  375. X#define C_NULL        0L
  376. X#define C_GOTO_MSG    1L
  377. X#define C_WRITE_LIST    2L
  378. X#define C_WRITE_MSG    3L
  379. X#define C_SAVE_LIST    4L
  380. X#define C_SAVE_MSG    5L
  381. X#define C_COPY_LIST    6L
  382. X#define C_COPY_MSG    7L
  383. X#define C_DELETE_LIST    8L
  384. X#define C_DELETE_MSG    9L
  385. X#define C_UNDEL_LIST    10L
  386. X#define C_UNDEL_MSG    11L
  387. X#define C_REDRAW    12L
  388. X#define C_REVERSE    13L
  389. X#define C_NEXT_MSG    14L
  390. X#define C_PREV_MSG    15L
  391. X#define C_FIRST_MSG    16L
  392. X#define C_LAST_MSG    17L
  393. X#define C_TOP_PAGE    18L
  394. X#define C_BOTTOM_PAGE    19L
  395. X#define C_NEXT_SCREEN    20L
  396. X#define C_PREV_SCREEN    21L
  397. X#define C_SOURCE    22L
  398. X#define C_SAVEOPTS    23L
  399. X#define C_NEXT_SEARCH    24L
  400. X#define C_PREV_SEARCH    25L
  401. X#define C_CONT_SEARCH    26L
  402. X#define C_PRESERVE    27L
  403. X#define C_REV_SORT    28L
  404. X#define C_SORT        29L
  405. X#define C_QUIT_HARD    30L
  406. X#define C_QUIT        31L
  407. X#define C_EXIT_HARD    32L
  408. X#define C_EXIT        33L
  409. X#define C_UPDATE    34L
  410. X#define C_FOLDER    35L
  411. X#define C_SHELL_ESC    36L
  412. X#define C_CURSES_ESC    37L
  413. X#define C_PRINT_MSG    38L
  414. X#define C_CHDIR        39L
  415. X#define C_VAR_SET    40L
  416. X#define C_IGNORE    41L
  417. X#define C_ALIAS        42L
  418. X#define C_OWN_HDR    43L
  419. X#define C_VERSION    44L
  420. X#define C_MAIL_FLAGS    45L
  421. X#define C_MAIL        46L
  422. X#define C_REPLY_ALL    47L
  423. X#define C_REPLY_SENDER    48L
  424. X#define C_DISPLAY_NEXT    49L
  425. X#define C_DISPLAY_MSG    50L
  426. X#define C_TOP_MSG    51L
  427. X#define C_BIND_MACRO    52L
  428. X#define C_BIND        53L
  429. X#define C_UNBIND    54L
  430. X#define C_MAP_BANG    55L
  431. X#define C_MAP        56L
  432. X#define C_MACRO        57L
  433. X#define C_HELP        58L/* THIS MUST BE THE LAST ITEM */
  434. X
  435. Xstruct cmd_map {
  436. X    /* long so glob_flags can be saved in mac_stack */
  437. X    long m_cmd;   /* the command this is mapped to  */
  438. X    char *m_str;  /* the string user types (cbreak) */
  439. X    char *x_str;  /* the string executed if a macro */
  440. X    struct cmd_map *m_next;
  441. X};
  442. X
  443. X#ifdef CURSES
  444. X
  445. X/*
  446. X * Pointers to the current active command or macro and to the map list.
  447. X *  This ought to be handled by having getcmd() return struct cmd_map *,
  448. X *  but curses_command() depends too heavily on getcmd() returning int.
  449. X */
  450. Xextern struct cmd_map *active_cmd, *cmd_map;
  451. X
  452. X#endif /* CURSES */
  453. X
  454. X/* This must be OUTSIDE the #ifdef CURSES -- needed in other modes */
  455. Xextern struct cmd_map *mac_hide;
  456. X
  457. X/*
  458. X * Special bracketing recognized within an executing
  459. X *  macro as surrounding a curses function name
  460. X */
  461. X#define MAC_LONG_CMD    '['
  462. X#define MAC_LONG_END    ']'
  463. X#define MAC_GET_STR    "getstr"
  464. X#define MAC_GET_LINE    "getline"
  465. X#define MAX_LONG_CMD    32
  466. X
  467. X/*
  468. X * External declarations for map and map! purposes
  469. X */
  470. Xextern char *c_macro();
  471. Xextern struct cmd_map *line_map, *bang_map;
  472. END_OF_FILE
  473. if test 2947 -ne `wc -c <'mush/bindings.h'`; then
  474.     echo shar: \"'mush/bindings.h'\" unpacked with wrong size!
  475. fi
  476. # end of 'mush/bindings.h'
  477. fi
  478. if test -f 'mush/config.h-dist' -a "${1}" != "-c" ; then 
  479.   echo shar: Will not clobber existing file \"'mush/config.h-dist'\"
  480. else
  481. echo shar: Extracting \"'mush/config.h-dist'\" \(5391 characters\)
  482. sed "s/^X//" >'mush/config.h-dist' <<'END_OF_FILE'
  483. X/* config.h 1.1    (c) copyright 1986 (Dan Heller) */
  484. X
  485. X/* Default names and locations for files */
  486. X#define MAILRC        ".mushrc"
  487. X#define ALTERNATE_RC    ".mailrc"
  488. X#define DEFAULT_RC    "/usr/lib/Mushrc"
  489. X#define ALT_DEF_RC    "/usr/lib/Mail.rc"
  490. X#define COMMAND_HELP    "/usr/lib/cmd_help"
  491. X#ifdef SUNTOOL
  492. X#    define TOOL_HELP    "/usr/lib/tool_help"
  493. X#endif /* SUNTOOL */
  494. X#define ALTERNATE_HOME    "/tmp"       /* Path must be read/write to EVERYONE */
  495. X#define EDFILE      ".edXXXXXX"  /* file/pathname added to user's "home" */
  496. X
  497. X/*
  498. X * Define INTERNAL_MALLOC and recompile if you have trouble with mush
  499. X * core-dumping due to malloc/free errors.  Also, if you run a System 5
  500. X * variant, you might notice a performance improvement if you define this
  501. X * variable.  It uses the malloc distributed by Larry Wall for perl v2.
  502. X */
  503. X/* #define INTERNAL_MALLOC /**/
  504. X
  505. X/*
  506. X * Define TIMEZONE if your system has neither the SysV external variable
  507. X * tzname nor the BSD timezone() function.  The example below is for
  508. X * Gould BSD4.3 systems; others should define it as a string, e.g. "PST"
  509. X * If TIMEZONE is defined, DAYLITETZ can also be defined, e.g. "PDT"
  510. X */
  511. X/* #define TIMEZONE T->tm_zone /**/
  512. X
  513. X/* mail delivery system macros and defines... */
  514. X
  515. X/*
  516. X * If you are using MMDF, define MMDF here.
  517. X */
  518. X/* #define MMDF /**/
  519. X#ifdef MMDF
  520. X/*
  521. X * If MMDF delivers mail the user's home directory, define HOMEMAIL.
  522. X * Also check the definition of the delivery file name MAILFILE, below.
  523. X */
  524. X/* #define HOMEMAIL /**/
  525. X#define MAIL_DELIVERY    "exec /usr/mmdf/bin/submit -mlnr"
  526. X#define VERBOSE_ARG    "Ww"
  527. X#define MTA_EXIT    9    /* exit status for successful submit */
  528. X#else /* MMDF */
  529. X/*
  530. X * If you are not using MMDF, check these definitions.
  531. X */
  532. X#define MAIL_DELIVERY    "/usr/lib/sendmail -i" /* "-i" works like "-oi" */
  533. X#define VERBOSE_ARG    "-v"    /* undef if none exists */
  534. X#define METOO_ARG    "-m"    /* man sendmail for more info. */
  535. X#define MTA_EXIT    0    /* exit status for successful mail delivery */
  536. X#endif /* MMDF */
  537. X
  538. X/* If your mail transfer agent uses something *besides* "From " to separate
  539. X * adjacent messages in a folder, define MSG_SEPARATOR to be this string.
  540. X * If that string is 4 ^A's, then the string would be "\001\001\001\001".
  541. X * With the exception of MMDF, below, you should OMIT a trailing newline
  542. X * from the setting of MSG_SEPARATOR.
  543. X * If you don't know what any of this means, leave it alone.
  544. X */
  545. X/* #define MSG_SEPARATOR "From " /**/
  546. X#ifdef MMDF
  547. X/*
  548. X * These values should be identical (respectively) to the contents of
  549. X * delim1 and delim2 in MMDFSRC/conf/yoursite/conf.c (sans newline).
  550. X */
  551. X#define MSG_SEPARATOR    "\001\001\001\001\n"
  552. X#define END_MSG_SEP    "\001\001\001\001\n"
  553. X/*
  554. X * You only need to define LCKDFLDIR if you have MMDF configured to use the
  555. X * locking routines in lib/util/lk_lock.c (ie., link(2)-based locking).
  556. X * Most of you WILL NOT need this, since you probably use one of the more
  557. X * sophisticated locking modules provided with MMDF.  Remember to alter the
  558. X * Makefile so as to access the MMDF library at the link step.
  559. X */
  560. X/* #define LCKDFLDIR    "/usr/spool/mmdf/lockfiles" /* (for example) */
  561. X#else /* !MMDF */
  562. X#ifdef M_XENIX
  563. X#define DOT_LOCK    /* DOT_LOCK should be used for SCO Xenix */
  564. X#endif /* M_XENIX */
  565. X#endif /* MMDF */
  566. X
  567. X/* If your mailer does not understand commas between addresses, you should
  568. X * define NO_COMMAS.  This includes pre-3.0 smail and default MTAs used on
  569. X * xenix, and sys-v systems.
  570. X * This does NOT apply to MMDF or sendmail.
  571. X */
  572. X/* #define NO_COMMAS /**/
  573. X
  574. X/*
  575. X * Most RFC822 compliant mailers (sendmail) will add the headers From:
  576. X * and Date: on outgoing mail.  If the user or UA sends these headers,
  577. X * most MTAs will not append them automatically.  However, there are
  578. X * certain MTAs which will not allow this -- these "picky mailers" will
  579. X * precede such headers with a '>' and make the headers very ugly and
  580. X * somewhat redundant or contradictory.  It is advisable to set this
  581. X * *UNLESS* your MTA is not RFC822 compiant -- therefore you should NOT
  582. X * set this (xenix, sys-v).
  583. X */
  584. X/* #define PICKY_MAILER /**/
  585. X
  586. X/* Headers that will NOT be included when forwarding mail */
  587. X#define IGNORE_ON_FWD    "status"    /* comma or space separated list */
  588. X
  589. X#define    MAXMSGS        1000    /* maximum number of messages we can read */
  590. X#define HDRSIZ BUFSIZ    /* This should not be < BUFSIZ! (but can be >) */
  591. X
  592. X/* If your system supports the vprintf() functions, True for sys-v and
  593. X * later sun versions (3.0+ ?).  Typically not true for BSD systems, but
  594. X * that will probably change in the future.
  595. X */
  596. X#if defined(SYSV) || defined(sun)
  597. X#define VPRINTF
  598. X#endif /* SYSV || sun */
  599. X
  600. X#define LS_COMMAND    "ls"
  601. X#define FORTUNE        "/usr/games/fortune"
  602. X#define LPR        "lpr"
  603. X#define SIGNATURE    ".signature"
  604. X#ifdef HOMEMAIL
  605. X#define MAILFILE    "Mailbox"    /* or whatever */
  606. X#else /* HOMEMAIL */
  607. X#define MAILDIR        "/usr/spool/mail"
  608. X#endif /* HOMEMAIL */
  609. X
  610. X/* default settings for some variable strings */
  611. X#define DEF_PROMPT    "Msg %m of %t: "
  612. X#define DEF_PAGER    "more" /* set to "internal" to use internal pager */
  613. X#define DEF_SHELL    "csh"
  614. X#define DEF_EDITOR    "vi"
  615. X#define DEF_FOLDER    "~/Mail"        /* default Mail folder */
  616. X#define DEF_MBOX    "~/mbox"    /* default mbox */
  617. X#define DEF_INDENT_STR    "> "        /* indent included mail */
  618. X#define DEF_PRINTER    "lp"
  619. X#define DEF_ESCAPE    "~"
  620. X#define DEF_HDR_FMT    "%25f %7d (%l/%c) \"%s\"" /* default hdr_format */
  621. X#define DEF_CURSES_HELP    \
  622. X    "display save mail reply next-msg back-msg screen-next screen-back"
  623. END_OF_FILE
  624. if test 5391 -ne `wc -c <'mush/config.h-dist'`; then
  625.     echo shar: \"'mush/config.h-dist'\" unpacked with wrong size!
  626. fi
  627. # end of 'mush/config.h-dist'
  628. fi
  629. if test -f 'mush/digestify' -a "${1}" != "-c" ; then 
  630.   echo shar: Will not clobber existing file \"'mush/digestify'\"
  631. else
  632. echo shar: Extracting \"'mush/digestify'\" \(3468 characters\)
  633. sed "s/^X//" >'mush/digestify' <<'END_OF_FILE'
  634. X#! ../bin/mush -F!
  635. X#
  636. X# Mush digestifier.  Makes a folder or a list of messages into a digest.
  637. X#
  638. X# A "digest" is a collection of E-mail messages bundled together into a
  639. X# single message for ease of redistribution.  The individual messages
  640. X# in the digest are called "articles".  Each article has a small set of
  641. X# essential headers (usually From:, Date:, and Subject:) and is divided
  642. X# from the preceding and following articles by an "article separator"
  643. X# string (usually eight hyphens, "--------").  The Mush built-in command
  644. X# "undigest" unpacks most digests, including those made by this script.
  645. X#
  646. X# Usage:
  647. X#  From your shell:        digestify -f mailbox
  648. X#  From within mush:    
  649. X#    First:        cmd digest "set digest = '\!*' ; source digestify"
  650. X#    Then:        digest [msg-list]
  651. X#    Or:        message-selection-command | digest
  652. X#
  653. X# Note that by default it makes a digest of the ENTIRE folder!
  654. X#
  655. X
  656. X#
  657. X# Rudimentary sanity checks
  658. X#
  659. Xif ! $?version
  660. X    echo "You must have Mush version 7.0 or higher to run this script"
  661. X    exit
  662. Xendif
  663. Xif ! $?thisfolder
  664. X    echo "You can't use this script as an init file; try using -F"
  665. X    exit
  666. Xendif
  667. X
  668. X#
  669. X# Set up defaults
  670. X#
  671. Xif ! $?digest
  672. X    set digest = *
  673. X    if $?interact
  674. X    unset interact        # Assume non-interactive if no input list
  675. X    endif
  676. Xelse
  677. X    set interact        # Note that this is interactive
  678. X    if "X$digest" == X
  679. X        set digest = *        # Default to all messages for empty input
  680. X    else
  681. X    $digest | set digest    # Pre-expand message numbers
  682. X    endif
  683. Xendif
  684. X
  685. X#
  686. X# Suppress any "that isn't set" messages from "unset"
  687. X#
  688. Xif $?warning
  689. X    set savewarn
  690. Xendif
  691. Xunset warning oldpre oldpost oldindent oldign oldshow
  692. X
  693. X#
  694. X# Save everything in case the user wants it back.
  695. X# Could wrap all this with "if $?interact" but this script
  696. X# might be read by "mush -F", in which case we need this.
  697. X#
  698. Xif $?pre_indent_str
  699. X    set oldpre = "$pre_indent_str"
  700. Xendif
  701. Xif $?post_indent_str
  702. X    set oldpost = "$post_indent_str"
  703. Xendif
  704. Xif $?indent_str
  705. X    set oldindent = "$indent_str"
  706. Xendif
  707. Xif $?alwaysignore
  708. X    set oldign = "$alwaysignore"
  709. Xendif
  710. Xif $?show_hdrs
  711. X    set oldshow = "$show_hdrs"
  712. Xendif
  713. Xif $?quiet
  714. X    set oldquiet = "$quiet"
  715. Xendif
  716. Xif $?no_expand
  717. X    set savenoex
  718. Xendif
  719. X
  720. X#
  721. X# Prepare to form the digest.
  722. X#
  723. Xset indent_str no_expand alwaysignore=include quiet=await,newmail
  724. Xunset post_indent_str
  725. Xalias DIGEST $thisfolder        # Any target in place of $thisfolder
  726. Xset pre_indent_str="--------"        # Insert your digest separator here
  727. Xset show_hdrs=from,date,subject        # Add any other headers you want
  728. X
  729. X#
  730. X# Now do it.  All that work for a two-line operation ....
  731. X# NOTE: If you change DIGEST above, remove the "await" command here!
  732. X# Backslashes prevent any cmd expansion from confusing us.
  733. X#
  734. X\delete $digest
  735. X\mail -UH /dev/null -I $digest -s "Digest of $thisfolder" DIGEST; \await -T 1
  736. X
  737. X#
  738. X# Clean out the deleted stuff if not interactive
  739. X#
  740. Xif ! $?interact
  741. X    \update
  742. Xendif
  743. X
  744. X#
  745. X# Be neat and put everything back the way it was.
  746. X#
  747. Xunset indent_str no_expand alwaysignore quiet pre_indent_str show_hdrs
  748. Xunalias DIGEST
  749. Xif $?savenoex
  750. X    set no_expand
  751. Xendif
  752. Xif $?oldquiet
  753. X    set quiet = "$oldquiet"
  754. Xendif
  755. Xif $?oldpre
  756. X    set pre_indent_str = "$oldpre"
  757. Xendif
  758. Xif $?oldpost
  759. X    set post_indent_str = "$oldpost"
  760. Xendif
  761. Xif $?oldindent
  762. X    set indent_str = "$oldindent"
  763. Xendif
  764. Xif $?oldign
  765. X    set alwaysignore = "$oldign"
  766. Xendif
  767. Xif $?oldshow
  768. X    set show_hdrs = "$oldshow"
  769. Xendif
  770. Xunset oldpre oldpost oldindent oldign oldshow oldquiet nonoex digest
  771. Xif $?savewarn
  772. X    unset savewarn
  773. X    set warning
  774. Xendif
  775. END_OF_FILE
  776. if test 3468 -ne `wc -c <'mush/digestify'`; then
  777.     echo shar: \"'mush/digestify'\" unpacked with wrong size!
  778. fi
  779. chmod +x 'mush/digestify'
  780. # end of 'mush/digestify'
  781. fi
  782. if test -f 'mush/execute.c' -a "${1}" != "-c" ; then 
  783.   echo shar: Will not clobber existing file \"'mush/execute.c'\"
  784. else
  785. echo shar: Extracting \"'mush/execute.c'\" \(4203 characters\)
  786. sed "s/^X//" >'mush/execute.c' <<'END_OF_FILE'
  787. X/* execute.c     (c) copyright    10/28/86 (Dan Heller) */
  788. X
  789. X#include "mush.h"
  790. X#ifdef BSD
  791. X#include <sys/wait.h>
  792. X#else
  793. X#ifndef SYSV
  794. X#include <wait.h>
  795. X#endif /* SYSV */
  796. X#endif /* BSD */
  797. X
  798. X#ifdef lint
  799. X#include <sys/resource.h>
  800. X#endif /* lint */
  801. X
  802. Xstatic jmp_buf execjbuf;
  803. X
  804. X#ifdef SUNTOOL
  805. X
  806. X/*ARGSUSED*/
  807. Xstatic
  808. XNotify_value
  809. Xmy_wait3(tty, pid, status, rusage)
  810. XTty tty;
  811. Xint pid;
  812. Xunion wait *status;
  813. Xstruct rusage *rusage;
  814. X{
  815. X    extern Panel_item edit_item;
  816. X    Textsw textsw = (Textsw)window_get(tty, WIN_CLIENT_DATA);
  817. X    char *file = (char *)window_get(textsw, TEXTSW_CLIENT_DATA);
  818. X    int i = 0;
  819. X
  820. X    if (WIFSTOPPED(*status)) {
  821. X    kill(pid, SIGCONT);
  822. X    return (NOTIFY_IGNORED);
  823. X    }
  824. X    if (pid != exec_pid || exec_pid <= 0) /* if the editor didn't die, return */
  825. X    return NOTIFY_DONE;
  826. X    /* editor died -- reset exec_pid so no one thinks we're running */
  827. X    exec_pid = 0;
  828. X    (void) window_set(tty, TTY_ARGV, TTY_ARGV_DO_NOT_FORK, NULL);
  829. X    wprint("Editor done.\n");
  830. X    (void) window_set(tty_sw, WIN_SHOW, FALSE, NULL);
  831. X#ifdef SUN_4_0 /* SunOS 4.0+ */
  832. X    (void) window_set(textsw,
  833. X    WIN_SHOW,        TRUE,
  834. X    TEXTSW_FILE_CONTENTS,    file,
  835. X    NULL);
  836. X#else /* SUN_4_0 */
  837. X    textsw_load_file(textsw, file, 1, 0, 0);
  838. X    textsw_set(textsw, WIN_SHOW, TRUE, NULL);
  839. X#endif /* SUN_4_0 */
  840. X    textsw_normalize_view(textsw, (Textsw_index)0);
  841. X    (void) unlink(file);
  842. X    set_comp_items(panel_get(edit_item, PANEL_PARENT_PANEL));
  843. X
  844. X    return NOTIFY_DONE;
  845. X}
  846. X
  847. Xtool_edit_letter(textsw, argv)
  848. XTextsw textsw;
  849. Xchar **argv;
  850. X{
  851. X    Rect *msg_rect = (Rect *)window_get(textsw, WIN_RECT);
  852. X
  853. X    wprint("Starting \"%s\"...\n", *argv);
  854. X#ifdef SUN_4_0
  855. X    window_set(textsw, WIN_SHOW, FALSE, NULL);
  856. X#else /* SUN_4_0 */
  857. X    textsw_set(textsw, WIN_SHOW, FALSE, NULL);
  858. X#endif /* SUN_4_0 */
  859. X    ttysw_output(tty_sw, "\f", 1);  /* clear screen */
  860. X    (void) window_set(tty_sw,
  861. X    WIN_RECT,    msg_rect,
  862. X    TTY_ARGV,    argv,
  863. X    WIN_SHOW,    TRUE,
  864. X    NULL);
  865. X    if ((exec_pid = (int) window_get(tty_sw, TTY_PID)) == -1) {
  866. X    error("Couldn't execute %s", *argv);
  867. X    return -1;
  868. X    }
  869. X    notify_set_wait3_func(tty_sw, my_wait3, exec_pid);
  870. X    Debug("tty pid = %d\n", exec_pid);
  871. X    return 0;
  872. X}
  873. X#endif /* SUNTOOL */
  874. X
  875. Xexecute(argv)
  876. Xchar **argv;
  877. X{
  878. X#ifdef SYSV
  879. X    int status;
  880. X#else
  881. X    union wait status;
  882. X#endif /* SYSV */
  883. X#ifdef SIGCONT
  884. X    SIGRET (*oldstop)(), (*oldcont)();
  885. X#endif /* SIGCONT */
  886. X    int pid;
  887. X    SIGRET (*oldint)(), (*oldquit)();
  888. X
  889. X    oldint = signal(SIGINT, SIG_IGN);
  890. X    oldquit = signal(SIGQUIT, SIG_IGN);
  891. X#ifdef SIGCONT
  892. X    oldstop = signal(SIGTSTP, SIG_DFL);
  893. X    oldcont = signal(SIGCONT, SIG_DFL);
  894. X#endif /* SIGCONT */
  895. X    turnon(glob_flags, IGN_SIGS);
  896. X
  897. X    echo_on();
  898. X    if (!setjmp(execjbuf)) {
  899. X    if ((exec_pid = vfork()) == 0) {
  900. X        (void) signal(SIGINT, SIG_DFL);
  901. X        (void) signal(SIGQUIT, SIG_DFL);
  902. X        (void) signal(SIGPIPE, SIG_DFL);
  903. X        (void) closefileds(3);    /* close all descriptors above 2 */
  904. X        execvp(*argv, argv);
  905. X        if (errno == ENOENT)
  906. X        print("%s: command not found.\n", *argv);
  907. X        else
  908. X        error(*argv);
  909. X        _exit(-1);
  910. X    }
  911. X    /* Parent's got to do something; sigchldcatcher may also be waiting.
  912. X     * This loop will usually get broken by the longjmp() (except tool),
  913. X     * but in certain circumstances sigchldcatcher isn't yet active.
  914. X     */
  915. X    while ((pid = wait(&status)) != -1 && pid != exec_pid)
  916. X        Debug("The exec loop caught a signal? (pid = %d)\n", pid);
  917. X    }
  918. X    /* reset our ttymodes */
  919. X    echo_off();
  920. X    (void) signal(SIGINT, oldint);
  921. X    (void) signal(SIGQUIT, oldquit);
  922. X#ifdef SIGCONT
  923. X    (void) signal(SIGTSTP, oldstop);
  924. X    (void) signal(SIGCONT, oldcont);
  925. X#endif /* SIGCONT */
  926. X    turnoff(glob_flags, IGN_SIGS);
  927. X}
  928. X
  929. XSIGRET
  930. Xsigchldcatcher()
  931. X{
  932. X#ifdef SYSV
  933. X    int status;
  934. X#else
  935. X    union wait status;
  936. X#endif /* SYSV */
  937. X    int       pid;
  938. X
  939. X#ifdef BSD
  940. X    while ((pid = wait3(&status, WNOHANG, (struct rusage *)0)) > 0) {
  941. X    Debug("%d died...\n", pid);
  942. X    if (pid == exec_pid)
  943. X        break;
  944. X    }
  945. X#else
  946. X#ifndef SYSV
  947. X    while ((pid = wait2(&status, WNOHANG)) > 0 && pid != exec_pid)
  948. X    Debug("%d died...\n", pid);
  949. X#else /* SYSV */
  950. X    while ((pid = wait((int *)0)) > 0 && pid != exec_pid)
  951. X    Debug("%d died...\n", pid);
  952. X#endif /* SYSV */
  953. X#endif /* BSD */
  954. X    if (pid == exec_pid && pid > 0) {
  955. X    exec_pid = 0;
  956. X    longjmp(execjbuf, 1);
  957. X    }
  958. X}
  959. END_OF_FILE
  960. if test 4203 -ne `wc -c <'mush/execute.c'`; then
  961.     echo shar: \"'mush/execute.c'\" unpacked with wrong size!
  962. fi
  963. # end of 'mush/execute.c'
  964. fi
  965. if test -f 'mush/glob.h' -a "${1}" != "-c" ; then 
  966.   echo shar: Will not clobber existing file \"'mush/glob.h'\"
  967. else
  968. echo shar: Extracting \"'mush/glob.h'\" \(1985 characters\)
  969. sed "s/^X//" >'mush/glob.h' <<'END_OF_FILE'
  970. X#ifdef BSD
  971. X#define DIRECTORY
  972. X#endif /* BSD */
  973. X
  974. X#ifdef DIRECTORY
  975. X#include <sys/dir.h>
  976. X#define dirent direct
  977. X#else /* !DIRECTORY */
  978. X
  979. X/*
  980. X *  4.2BSD directory access emulation for non-4.2 systems.
  981. X *  Based upon routines in appendix D of Portable C and Unix System
  982. X *  Programming by J. E. Lapin (Rabbit Software).
  983. X *
  984. X *  No responsibility is taken for any error in accuracies inherent
  985. X *  either to the comments or the code of this program, but if
  986. X *  reported to me then an attempt will be made to fix them.
  987. X */
  988. X
  989. X#ifndef  DEV_BSIZE
  990. X#define  DEV_BSIZE  512           /* Device block size. */
  991. X#endif
  992. X
  993. X#define  DIRBLKSIZ  DEV_BSIZE
  994. X#define  MAXNAMLEN  255           /* Name must be no longer than this. */
  995. X
  996. Xstruct dirent
  997. X{
  998. X  long  d_fileno ;                /* Inode number of entry. */
  999. X  short d_reclen ;                /* Length of this record. */
  1000. X  short d_namlen ;                /* Length of d_name string. */
  1001. X  char  d_name[MAXNAMLEN + 1] ;   /* Directory name. */
  1002. X} ;
  1003. X
  1004. X/*  The DIRSIZ macro gives the minimum record length that will hold the
  1005. X *  directory entry. This requires the amount of space in struct direct
  1006. X *  without the d_name field, plus enough space for the name with a
  1007. X *  terminating null byte (dp->d_namlen+1), rounded up to a 4 byte
  1008. X *  boundary.
  1009. X */
  1010. X
  1011. X#undef   DIRSIZ
  1012. X#define  DIRSIZ(dp)                                \
  1013. X         ((sizeof (struct dirent) - (MAXNAMLEN+1)) \
  1014. X         + (((dp)->d_namlen+1 + 3) &~ 3))
  1015. X
  1016. X/*  Definitions for library routines operating on directories. */
  1017. X
  1018. Xtypedef struct _dirdesc
  1019. X{
  1020. X  int    dd_fd ;
  1021. X  long   dd_loc ;
  1022. X  long   dd_size ;
  1023. X  char   dd_buf[DIRBLKSIZ] ;
  1024. X} DIR ;
  1025. X
  1026. X#ifndef  NULL
  1027. X#define  NULL  0
  1028. X#endif
  1029. X
  1030. Xextern  DIR              *opendir() ;
  1031. Xextern  struct dirent    *readdir() ;
  1032. Xextern  long             telldir() ;
  1033. Xextern  void             seekdir() ;
  1034. X#define rewinddir(dirp)  seekdir((dirp), (long) 0)
  1035. Xextern  void             closedir() ;
  1036. X
  1037. X#endif /* DIRECTORY */
  1038. X
  1039. X#define DELIM " \t;|"
  1040. X#define META "/?*[{"
  1041. X#define FMETA "?*[{"
  1042. END_OF_FILE
  1043. if test 1985 -ne `wc -c <'mush/glob.h'`; then
  1044.     echo shar: \"'mush/glob.h'\" unpacked with wrong size!
  1045. fi
  1046. # end of 'mush/glob.h'
  1047. fi
  1048. if test -f 'mush/lock.c' -a "${1}" != "-c" ; then 
  1049.   echo shar: Will not clobber existing file \"'mush/lock.c'\"
  1050. else
  1051. echo shar: Extracting \"'mush/lock.c'\" \(4593 characters\)
  1052. sed "s/^X//" >'mush/lock.c' <<'END_OF_FILE'
  1053. X/*
  1054. X * lock.c -- deal with file locking on various architectures and UNIXs.
  1055. X * dot_lock() creates a file with the same name as the parameter passed
  1056. X * with the appendage ".lock" -- this is to be compatible with certain
  1057. X * systems that don't use flock or lockf or whatever they have available
  1058. X * that they don't use.
  1059. X */
  1060. X
  1061. X#ifdef USG
  1062. X#include <unistd.h>
  1063. X#endif /* USG */
  1064. X#include "mush.h"
  1065. X#if defined(SYSV) && !defined(USG)
  1066. X#include <sys/locking.h>
  1067. X#endif /* SYSV && !USG */
  1068. X
  1069. X#ifdef DOT_LOCK
  1070. Xextern int sgid;
  1071. X#ifdef BSD
  1072. Xextern int rgid;
  1073. X#endif /* BSD */
  1074. X
  1075. Xdot_lock(filename)
  1076. Xchar *filename;
  1077. X{
  1078. X    char buf[MAXPATHLEN];
  1079. X    int lockfd, cnt = 0;
  1080. X    SIGRET (*oldint)(), (*oldquit)();
  1081. X
  1082. X#ifdef SYSV
  1083. X    /* Only the spoolfile needs to be dot_locked -- other files are
  1084. X     * handled by lock_fopen, below.  To avoid collisions with 14-char
  1085. X     * file name limits, we allow dot_locking ONLY of the spoolfile.
  1086. X     */
  1087. X    if (strcmp(spoolfile, filename) != 0)
  1088. X    return 0;
  1089. X#endif
  1090. X#ifdef BSD
  1091. X    setregid(rgid, sgid);
  1092. X#else /* BSD */
  1093. X    setgid(sgid);
  1094. X#endif /* BSD */
  1095. X#ifdef M_XENIX
  1096. X    (void) sprintf(buf, "/tmp/%.10s.mlk", login);
  1097. X#else /* M_XENIX */
  1098. X    (void) sprintf(buf, "%s.lock", filename);
  1099. X#endif /* M_XENIX */
  1100. X    on_intr();
  1101. X    while ((lockfd = open(buf, O_CREAT|O_WRONLY|O_EXCL, 0444)) == -1) {
  1102. X    if (errno != EEXIST) {
  1103. X        error("unable to lock %s", filename);
  1104. X        break;
  1105. X    }
  1106. X    if (cnt++ == 0)
  1107. X        print("%s already locked, waiting", filename);
  1108. X    else
  1109. X        print_more(".");
  1110. X    sleep(1);
  1111. X    if (ison(glob_flags, WAS_INTR)) {
  1112. X        print_more("\nAborted.\n");
  1113. X        break;
  1114. X    }
  1115. X    }
  1116. X    off_intr();
  1117. X    if (lockfd != -1) {
  1118. X    if (cnt)
  1119. X        print("done.\n");
  1120. X    (void) close(lockfd);
  1121. X    }
  1122. X#ifdef BSD
  1123. X    setregid(sgid, rgid);
  1124. X#else
  1125. X    setgid(getgid());
  1126. X#endif /* BSD */
  1127. X    return lockfd == -1? -1 : 0;
  1128. X}
  1129. X#endif /* DOT_LOCK */
  1130. X
  1131. X#ifdef SYSV
  1132. X
  1133. X/*
  1134. X * Define some BSD names for the SYSV world
  1135. X */
  1136. X#ifdef USG
  1137. X#define LOCK_SH F_RDLCK
  1138. X#define LOCK_EX F_WRLCK
  1139. X#define LOCK_UN F_UNLCK
  1140. X#else /* USG */
  1141. X#define LOCK_SH LK_LOCK
  1142. X#define LOCK_EX LK_LOCK
  1143. X#define LOCK_UN LK_UNLCK
  1144. X#endif /* USG */
  1145. X#define LOCK_NB 0    /* Always non-blocking in this case */
  1146. X
  1147. X#ifdef HPUX
  1148. X#undef EWOULDBLOCK
  1149. X#endif /* HPUX */
  1150. X#define EWOULDBLOCK    EAGAIN
  1151. X
  1152. Xflock(fd, op)
  1153. Xint fd, op;
  1154. X{
  1155. X#ifndef USG
  1156. X    (void) locking(fd, op, 0); /* old xenix (sys III) */
  1157. X    return 0;
  1158. X#else
  1159. X    struct flock l;
  1160. X
  1161. X    l.l_len = 0L;
  1162. X    l.l_start = 0L;
  1163. X    l.l_whence = 1;
  1164. X    l.l_type = op;
  1165. X
  1166. X    return fcntl(fd, F_SETLK, &l);
  1167. X#endif /* USG */
  1168. X}
  1169. X
  1170. X#endif /* SYSV */
  1171. X
  1172. XFILE *
  1173. Xlock_fopen(filename, mode)
  1174. Xchar *filename;
  1175. Xchar *mode;
  1176. X{
  1177. X    FILE *mail_fp = NULL_FILE;
  1178. X#ifndef LCKDFLDIR
  1179. X    int fd, lk;
  1180. X    int cnt = 0;
  1181. X    SIGRET (*oldint)(), (*oldquit)();
  1182. X#else /* LCKDFLDIR */
  1183. X    extern FILE *lk_fopen();
  1184. X#endif /* !LCKDFLDIR */
  1185. X
  1186. X    if (debug && do_set(set_options, "deadlock")) {
  1187. X    (void) un_set(&set_options, "deadlock");
  1188. X    return NULL_FILE;
  1189. X    }
  1190. X
  1191. X#ifdef LCKDFLDIR
  1192. X    return lk_fopen(filename, mode, NULL, NULL, 0);
  1193. X#else /* !LCKDFLDIR */
  1194. X
  1195. X#ifdef DOT_LOCK
  1196. X    if (dot_lock(filename) == 0)
  1197. X#endif /* DOT_LOCK */
  1198. X    mail_fp = mask_fopen(filename, mode);
  1199. X    if (!mail_fp)
  1200. X    return NULL_FILE;
  1201. X    fd = fileno(mail_fp);
  1202. X
  1203. X    if (mode[0] != 'r' || mode[1] == '+')
  1204. X    lk = LOCK_EX | LOCK_NB;
  1205. X    else
  1206. X    lk = LOCK_SH | LOCK_NB;
  1207. X
  1208. X    on_intr();
  1209. X    while (isoff(glob_flags, WAS_INTR) && flock(fd, lk)) {
  1210. X    if (errno == EWOULDBLOCK) {
  1211. X        if (isoff(glob_flags, REDIRECT))
  1212. X        if (!cnt++)
  1213. X            print("\nwaiting to lock");
  1214. X        else
  1215. X            print(".");
  1216. X    } else {
  1217. X        error("Unable to lock \"%s\"", filename);
  1218. X        (void) fclose(mail_fp);
  1219. X        off_intr();
  1220. X        return NULL_FILE;
  1221. X    }
  1222. X    (void) fflush(stdout);
  1223. X    sleep(1);
  1224. X    }
  1225. X    if (cnt)
  1226. X    print("\n");
  1227. X    cnt = (ison(glob_flags, WAS_INTR) != 0);
  1228. X    off_intr();
  1229. X    if (cnt) {
  1230. X    (void) fclose(mail_fp);
  1231. X    return NULL_FILE;
  1232. X    }
  1233. X    return mail_fp;
  1234. X#endif /* LCKDFLDIR */
  1235. X}
  1236. X
  1237. X/*ARGSUSED*/
  1238. Xclose_lock(filename, fp)
  1239. Xchar *filename;
  1240. XFILE *fp;
  1241. X#ifdef LCKDFLDIR
  1242. X{
  1243. X    return lk_fclose(fp, filename, NULL, NULL);
  1244. X}
  1245. X#else /* !LCKDFLDIR */
  1246. X{
  1247. X#ifdef DOT_LOCK
  1248. X    char buf[MAXPATHLEN];
  1249. X#endif /* DOT_LOCK */
  1250. X
  1251. X    fflush(fp);
  1252. X#ifdef DOT_LOCK
  1253. X#ifdef BSD
  1254. X    setregid(rgid, sgid);
  1255. X#else
  1256. X    setgid(sgid);
  1257. X#endif /* BSD */
  1258. X#ifdef SYSV
  1259. X    if (strcmp(spoolfile, filename) == 0)
  1260. X#endif /* SYSV */
  1261. X#ifdef M_XENIX
  1262. X    (void) unlink(sprintf(buf, "/tmp/%.10s.mlk", login));
  1263. X#else /* M_XENIX */
  1264. X    (void) unlink(sprintf(buf, "%s.lock", filename));
  1265. X#endif /* M_XENIX */
  1266. X#ifdef BSD
  1267. X    setregid(sgid, rgid);
  1268. X#else
  1269. X    setgid(getgid());
  1270. X#endif /* BSD */
  1271. X#endif /* DOT_LOCK */
  1272. X
  1273. X    (void) flock(fileno(fp), LOCK_UN);
  1274. X    return fclose(fp);
  1275. X}
  1276. X#endif /* LCKDFLDIR */
  1277. END_OF_FILE
  1278. if test 4593 -ne `wc -c <'mush/lock.c'`; then
  1279.     echo shar: \"'mush/lock.c'\" unpacked with wrong size!
  1280. fi
  1281. # end of 'mush/lock.c'
  1282. fi
  1283. if test -f 'mush/mail.icon.1' -a "${1}" != "-c" ; then 
  1284.   echo shar: Will not clobber existing file \"'mush/mail.icon.1'\"
  1285. else
  1286. echo shar: Extracting \"'mush/mail.icon.1'\" \(1933 characters\)
  1287. sed "s/^X//" >'mush/mail.icon.1' <<'END_OF_FILE'
  1288. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1289. X */
  1290. X    0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
  1291. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1292. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1293. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1294. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x1FFF,0xFFFF,0xFE01,
  1295. X    0x8000,0xFE00,0x0000,0x0181,0x8007,0x01C0,0x0000,0x0061,
  1296. X    0x8018,0x0030,0x0000,0x0011,0x8020,0x7008,0x0000,0x0011,
  1297. X    0x80C1,0xFC06,0x0000,0x0009,0x8101,0xFC01,0x0000,0x0009,
  1298. X    0x8103,0xFE01,0x0000,0x0005,0x8203,0xFE00,0x8000,0x0005,
  1299. X    0x8403,0xFE00,0x4000,0x0005,0x8401,0xFC00,0x4000,0x0005,
  1300. X    0x8801,0xFC00,0x2000,0x0005,0x8800,0x7000,0x2000,0x0005,
  1301. X    0x8800,0x0000,0x3000,0x0005,0x9000,0x0000,0x1000,0x0005,
  1302. X    0x9000,0x0000,0x1000,0x0005,0x93FF,0xFFFF,0x9000,0x0025,
  1303. X    0xA200,0x0000,0x9000,0x00E5,0xA200,0x0000,0x9000,0x03A5,
  1304. X    0xA200,0x0000,0x9000,0x0625,0xA3FF,0xFFFF,0x9000,0x1C25,
  1305. X    0xA000,0x0000,0x1000,0x3425,0xA000,0x0000,0x1000,0xC425,
  1306. X    0xA000,0x0000,0x1003,0x8425,0xA000,0x0000,0x1006,0x0425,
  1307. X    0xA000,0x0000,0x101C,0x0425,0xA000,0x0000,0x11F0,0x0425,
  1308. X    0xA000,0x0000,0x13E0,0x0445,0xA000,0x0000,0x13E0,0x0585,
  1309. X    0xA000,0x0000,0x13E0,0x0605,0xA000,0x0000,0x11C0,0x0405,
  1310. X    0xA000,0x0000,0x1000,0x000D,0xA000,0x0000,0x1000,0x0011,
  1311. X    0xA000,0x0000,0x1000,0x0021,0xA000,0x0000,0x1000,0x00C1,
  1312. X    0xA000,0x0000,0x1000,0x0101,0xA000,0x0000,0x1000,0x0601,
  1313. X    0xA000,0x0000,0x1000,0x0801,0xA000,0x0000,0x1000,0x3801,
  1314. X    0xA000,0x0000,0x1000,0x4801,0xA000,0x0000,0x1000,0x8801,
  1315. X    0xA000,0x0000,0x1003,0x0801,0xA000,0x0000,0x1004,0x0801,
  1316. X    0xA000,0x0000,0x101C,0x0801,0xA000,0x0000,0x1024,0x0801,
  1317. X    0xA000,0x0000,0x1044,0x0801,0xA000,0x0000,0x1184,0x0801,
  1318. X    0xA000,0x0000,0x1204,0x0801,0xA000,0x0000,0x1404,0x0801,
  1319. X    0xBFFF,0xFFFF,0xF804,0x0801,0x8000,0x0000,0x0004,0x0801,
  1320. X    0x8000,0x0000,0x0004,0x0801,0x8000,0x0000,0x0004,0x0801,
  1321. X    0x8000,0x0000,0x0004,0x0801,0xFFFF,0xFFFF,0xFFFF,0xFFFF
  1322. END_OF_FILE
  1323. if test 1933 -ne `wc -c <'mush/mail.icon.1'`; then
  1324.     echo shar: \"'mush/mail.icon.1'\" unpacked with wrong size!
  1325. fi
  1326. # end of 'mush/mail.icon.1'
  1327. fi
  1328. if test -f 'mush/mail.icon.2' -a "${1}" != "-c" ; then 
  1329.   echo shar: Will not clobber existing file \"'mush/mail.icon.2'\"
  1330. else
  1331. echo shar: Extracting \"'mush/mail.icon.2'\" \(1933 characters\)
  1332. sed "s/^X//" >'mush/mail.icon.2' <<'END_OF_FILE'
  1333. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1334. X */
  1335. X    0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
  1336. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x00E0,0x0001,
  1337. X    0x8000,0x0000,0x00DE,0x0001,0x8000,0x0000,0x00C1,0xE001,
  1338. X    0x8000,0x0000,0x00C0,0x1801,0x8000,0x0000,0x00C0,0x0801,
  1339. X    0x8000,0x0000,0x00C0,0x0801,0x8000,0x1FFF,0xFFC0,0x0E01,
  1340. X    0x8000,0xFE00,0x00C0,0x0981,0x8007,0x01C0,0x00C0,0x0861,
  1341. X    0x8018,0x0030,0x00C0,0x0811,0x8020,0x7008,0x00C0,0x0811,
  1342. X    0x80C1,0xFC06,0x00C0,0x1809,0x8101,0xBC01,0x00C0,0x6009,
  1343. X    0x8103,0x1E01,0x00C1,0x8005,0x8202,0x0E00,0x80C6,0x0005,
  1344. X    0x8404,0x0400,0x40D8,0x0005,0x8408,0x0200,0x40E0,0x0005,
  1345. X    0x8810,0x0100,0x20C0,0x0005,0x8820,0x6080,0x20C0,0x0005,
  1346. X    0x8840,0x4040,0x30C0,0x0005,0x9081,0x3020,0x10C0,0x0005,
  1347. X    0x9041,0x9C10,0x10C0,0x0005,0x93E0,0x8A0F,0x90C0,0x0005,
  1348. X    0xA210,0x6404,0x90C0,0x0005,0xA208,0x3002,0x90C0,0x0005,
  1349. X    0xA204,0x1401,0x90C0,0x0005,0xA3FF,0xFFFF,0x90C0,0x0005,
  1350. X    0xA000,0x0000,0x10C0,0x0005,0xA000,0x0000,0x10C0,0x0005,
  1351. X    0xA000,0x0000,0x10C0,0x0005,0xA000,0x0000,0x10C0,0x0005,
  1352. X    0xA000,0x0000,0x10C0,0x0005,0xA000,0x0000,0x11C0,0x0005,
  1353. X    0xA000,0x0000,0x13E0,0x0005,0xA000,0x0000,0x13E0,0x0005,
  1354. X    0xA000,0x0000,0x13E0,0x0005,0xA000,0x0000,0x11C0,0x0005,
  1355. X    0xA000,0x0000,0x1000,0x000D,0xA000,0x0000,0x1000,0x0011,
  1356. X    0xA000,0x0000,0x1000,0x0021,0xA000,0x0000,0x1000,0x00C1,
  1357. X    0xA000,0x0000,0x1000,0x0101,0xA000,0x0000,0x1000,0x0601,
  1358. X    0xA000,0x0000,0x1000,0x0801,0xA000,0x0000,0x1000,0x3001,
  1359. X    0xA000,0x0000,0x1000,0x4001,0xA000,0x0000,0x1000,0x8001,
  1360. X    0xA000,0x0000,0x1003,0x8001,0xA000,0x0000,0x1004,0x8001,
  1361. X    0xA000,0x0000,0x1018,0x8001,0xA000,0x0000,0x1020,0x8001,
  1362. X    0xA000,0x0000,0x1060,0x8001,0xA000,0x0000,0x1180,0x8001,
  1363. X    0xA000,0x0000,0x1280,0x8001,0xA000,0x0000,0x1480,0x8001,
  1364. X    0xBFFF,0xFFFF,0xFC80,0x8001,0x8000,0x0000,0x0080,0x8001,
  1365. X    0x8000,0x0000,0x0080,0x8001,0x8000,0x0000,0x0080,0x8001,
  1366. X    0x8000,0x0000,0x0080,0x8001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
  1367. END_OF_FILE
  1368. if test 1933 -ne `wc -c <'mush/mail.icon.2'`; then
  1369.     echo shar: \"'mush/mail.icon.2'\" unpacked with wrong size!
  1370. fi
  1371. # end of 'mush/mail.icon.2'
  1372. fi
  1373. if test -f 'mush/makefile.hpux' -a "${1}" != "-c" ; then 
  1374.   echo shar: Will not clobber existing file \"'mush/makefile.hpux'\"
  1375. else
  1376. echo shar: Extracting \"'mush/makefile.hpux'\" \(1687 characters\)
  1377. sed "s/^X//" >'mush/makefile.hpux' <<'END_OF_FILE'
  1378. X# Mush makefile for HP/UX.
  1379. X#
  1380. XHDRS1= mush.h config.h
  1381. XHDRS2= strings.h options.h
  1382. XHDRS3= bindings.h glob.h
  1383. XHDRS4= version.h
  1384. XSRCS1= commands.c dates.c execute.c expr.c folders.c \
  1385. X    hdrs.c init.c loop.c mail.c main.c misc.c msgs.c pick.c \
  1386. X    print.c setopts.c signals.c sort.c viewopts.c options.c lock.c
  1387. XSRCS2= bind.c curs_io.c curses.c file.c strings.c macros.c \
  1388. X    addrs.c malloc.c glob.c
  1389. X
  1390. XOBJS1= commands.o dates.o execute.o expr.o folders.o \
  1391. X    hdrs.o init.o loop.o mail.o main.o misc.o msgs.o pick.o \
  1392. X    print.o setopts.o signals.o sort.o viewopts.o options.o lock.o
  1393. XOBJS2= bind.o curs_io.o curses.o file.o strings.o macros.o \
  1394. X    addrs.o malloc.o glob.o
  1395. X
  1396. XHELP_FILES= README README-7.0 README-7.1 mush.1 cmd_help \
  1397. X    Mushrc Mailrc Gnurc sample.mushrc advanced.mushrc digestify
  1398. X
  1399. X# If your HP-UX version is older than 6.5, you will need remove -DDIRECTORY
  1400. X
  1401. XHPFLAGS=    -DHPUX -DSELECT -DDIRECTORY
  1402. XCFLAGS=     -O -DSYSV -DUSG -DCURSES -DREGCMP -DSIGRET=void $(HPFLAGS)
  1403. XLDFLAGS=
  1404. XLIBS=         -lcurses -lPW -lmalloc
  1405. XOTHERLIBS=
  1406. X# Use some variant of this one if you #define MMDF in config.h
  1407. X#OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a
  1408. XPROG=        mush
  1409. X
  1410. X$(PROG): $(OBJS1) $(OBJS2)
  1411. X    @echo loading...
  1412. X    @$(CC) $(LDFLAGS) $(OBJS1) $(OBJS2) -o $(PROG) $(LIBS) $(OTHERLIBS)
  1413. X
  1414. X$(OBJS1): $(HDRS1) $(HDRS2)
  1415. X$(OBJS2): $(HDRS1) $(HDRS2) $(HDRS3)
  1416. Xloop.o: version.h
  1417. X
  1418. XBINDIR= /usr/local/bin
  1419. XLIBDIR= /usr/local/lib
  1420. XMRCDIR= /usr/lib
  1421. XMANDIR= /usr/local/man/man1
  1422. XMANEXT= 1
  1423. X
  1424. Xinstall: mush
  1425. X    cp mush $(BINDIR)
  1426. X    strip $(BINDIR)/mush
  1427. X    chmod 0755 $(BINDIR)/mush
  1428. X    cp mush.1 $(MANDIR)/mush.$(MANEXT)
  1429. X    chmod 0644 $(MANDIR)/mush.$(MANEXT)
  1430. X    cp cmd_help $(LIBDIR)
  1431. X    chmod 0644 $(LIBDIR)/cmd_help
  1432. X    cp Mushrc $(MRCDIR)/Mushrc
  1433. X    chmod 0644 $(MRCDIR)/Mushrc
  1434. END_OF_FILE
  1435. if test 1687 -ne `wc -c <'mush/makefile.hpux'`; then
  1436.     echo shar: \"'mush/makefile.hpux'\" unpacked with wrong size!
  1437. fi
  1438. # end of 'mush/makefile.hpux'
  1439. fi
  1440. if test -f 'mush/makefile.sys.v' -a "${1}" != "-c" ; then 
  1441.   echo shar: Will not clobber existing file \"'mush/makefile.sys.v'\"
  1442. else
  1443. echo shar: Extracting \"'mush/makefile.sys.v'\" \(1899 characters\)
  1444. sed "s/^X//" >'mush/makefile.sys.v' <<'END_OF_FILE'
  1445. X# Mush makefile for system V.  Note: SIGRET should return void for normal
  1446. X# sys-v, but Att PC users should *not* have it defined.  See the README!!
  1447. X#
  1448. XHDRS1= mush.h config.h
  1449. XHDRS2= strings.h options.h
  1450. XHDRS3= bindings.h glob.h
  1451. XHDRS4= version.h
  1452. XSRCS1= commands.c dates.c execute.c expr.c folders.c \
  1453. X    hdrs.c init.c loop.c mail.c main.c misc.c msgs.c pick.c \
  1454. X    print.c setopts.c signals.c sort.c viewopts.c options.c lock.c
  1455. XSRCS2= bind.c curs_io.c curses.c file.c strings.c macros.c \
  1456. X    addrs.c malloc.c glob.c
  1457. X
  1458. XOBJS1= commands.o dates.o execute.o expr.o folders.o \
  1459. X    hdrs.o init.o loop.o mail.o main.o misc.o msgs.o pick.o \
  1460. X    print.o setopts.o signals.o sort.o viewopts.o options.o lock.o
  1461. XOBJS2= bind.o curs_io.o curses.o file.o strings.o macros.o \
  1462. X    addrs.o malloc.o glob.o
  1463. X
  1464. XHELP= README README-7.0 README-7.1 mush.1 cmd_help \
  1465. X    Mushrc Mailrc Gnurc sample.mushrc advanced.mushrc digestify
  1466. X
  1467. X# Sun OS systems who wish to compile with sys-v options:
  1468. X# CC= /usr/5bin/cc
  1469. X# CFLAGS=     -O -DSYSV -DCURSES -DUSG -DDIRECTORY
  1470. X# LIBS= -L/usr/5lib -lcurses
  1471. X
  1472. X# IRIX 3.2 systems (SGI Iris workstations) should add -DDIRECTORY to CFLAGS
  1473. X
  1474. XCFLAGS=     -O -DSYSV -DUSG -DCURSES -DREGCMP -DSIGRET=void
  1475. XLDFLAGS=
  1476. XLIBS=         -lcurses -lPW
  1477. XOTHERLIBS=
  1478. X# Use some variant of this one if you #define MMDF in config.h
  1479. X#OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a
  1480. XPROG=        mush
  1481. X
  1482. X$(PROG): $(OBJS1) $(OBJS2)
  1483. X    @echo loading...
  1484. X    @$(CC) $(LDFLAGS) $(OBJS1) $(OBJS2) -o $(PROG) $(LIBS) $(OTHERLIBS)
  1485. X
  1486. X$(OBJS1): $(HDRS1) $(HDRS2)
  1487. X$(OBJS2): $(HDRS1) $(HDRS2) $(HDRS3)
  1488. Xloop.o: version.h
  1489. X
  1490. XBINDIR= /usr/local/bin
  1491. XLIBDIR= /usr/local/lib
  1492. XMRCDIR= /usr/lib
  1493. XMANDIR= /usr/local/man/man1
  1494. XMANEXT= 1
  1495. X
  1496. Xinstall: mush
  1497. X    cp mush $(BINDIR)
  1498. X    strip $(BINDIR)/mush
  1499. X    chmod 0755 $(BINDIR)/mush
  1500. X    cp mush.1 $(MANDIR)/mush.$(MANEXT)
  1501. X    chmod 0644 $(MANDIR)/mush.$(MANEXT)
  1502. X    cp cmd_help $(LIBDIR)
  1503. X    chmod 0644 $(LIBDIR)/cmd_help
  1504. X    cp Mushrc $(MRCDIR)/Mushrc
  1505. X    chmod 0644 $(MRCDIR)/Mushrc
  1506. END_OF_FILE
  1507. if test 1899 -ne `wc -c <'mush/makefile.sys.v'`; then
  1508.     echo shar: \"'mush/makefile.sys.v'\" unpacked with wrong size!
  1509. fi
  1510. # end of 'mush/makefile.sys.v'
  1511. fi
  1512. echo shar: End of archive 19 \(of 19\).
  1513. cp /dev/null ark19isdone
  1514. MISSING=""
  1515. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
  1516.     if test ! -f ark${I}isdone ; then
  1517.     MISSING="${MISSING} ${I}"
  1518.     fi
  1519. done
  1520. if test "${MISSING}" = "" ; then
  1521.     echo You have unpacked all 19 archives.
  1522.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1523. else
  1524.     echo You still need to unpack the following archives:
  1525.     echo "        " ${MISSING}
  1526. fi
  1527. ##  End of shell archive.
  1528. exit 0
  1529.  
  1530.  
  1531.