home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / TCPIP / NETKIT-M.01 / NETKIT-M~ / NetKit-M-0.01 / mush-7.2.5.dif < prev    next >
Encoding:
Text File  |  1994-07-17  |  9.3 KB  |  349 lines

  1. --- Makefile.Linux
  2. +++ Makefile.Linux    1994/07/17 21:18:34
  3. @@ -0,0 +1,12 @@
  4. +config.h: config.h-dist
  5. +    ln -s config.h-dist config.h
  6. +
  7. +Makefile: makefile.sys.v
  8. +    ln -s makefile.sys.v Makefile
  9. +
  10. +compile: config.h Makefile
  11. +    make
  12. +
  13. +install: compile
  14. +    make install
  15. +
  16. --- config.h-dist
  17. +++ config.h-dist    1994/07/17 21:18:34
  18. @@ -1,5 +1,7 @@
  19.  /* config.h 1.1    (c) copyright 1986 (Dan Heller) */
  20.  
  21. +/* #define HOMEMAIL */
  22. +
  23.  /* Default names and locations for files */
  24.  #define MAILRC        ".mushrc"
  25.  #define ALTERNATE_RC    ".mailrc"
  26. @@ -33,9 +35,9 @@
  27.  
  28.  /* default settings for some variable strings */
  29.  #define DEF_PROMPT    "Msg %m of %t: "
  30. -#define DEF_PAGER    "more" /* set to "internal" to use internal pager */
  31. -#define DEF_SHELL    "csh"
  32. -#define DEF_EDITOR    "vi"
  33. +#define DEF_PAGER    "less" /* set to "internal" to use internal pager */
  34. +#define DEF_SHELL    "sh"
  35. +#define DEF_EDITOR    "elvis"
  36.  #define DEF_FOLDER    "~/Mail"        /* default Mail folder */
  37.  #define DEF_MBOX    "~/mbox"    /* default mbox */
  38.  #define DEF_INDENT_STR    "> "        /* indent included mail */
  39. @@ -110,7 +112,7 @@
  40.  /*
  41.   * If you are not using MMDF, check these definitions.
  42.   */
  43. -#define MAIL_DELIVERY    "/usr/lib/sendmail -i" /* "-i" works like "-oi" */
  44. +#define MAIL_DELIVERY    "/usr/sbin/sendmail -i" /* "-i" works like "-oi" */
  45.  #define VERBOSE_ARG    "-v"    /* undef if none exists */
  46.  #define METOO_ARG    "-m"    /* man sendmail for more info. */
  47.  #define MTA_EXIT    0    /* exit status for successful mail delivery */
  48. @@ -146,13 +148,13 @@
  49.  #endif /* MMDF */
  50.  
  51.  #ifdef HOMEMAIL
  52. -#define MAILFILE    "Mailbox"    /* or whatever */
  53. +#define MAILFILE    ".mail"    /* or whatever */
  54.  #else /* HOMEMAIL */
  55.  #ifndef MAILDIR
  56.  #if defined(SYSV) && !defined(SVR4)
  57. -#define MAILDIR        "/usr/mail"
  58. +#define MAILDIR        "/var/mail"
  59.  #else /* BSD || SVR4 */
  60. -#define MAILDIR        "/usr/spool/mail"
  61. +#define MAILDIR        "/var/mail"
  62.  #endif /* SYSV && !SVR4 */
  63.  #endif /* MAILDIR */
  64.  #endif /* HOMEMAIL */
  65. @@ -186,13 +188,13 @@
  66.   * is known not to be RFC822 compiant (xenix, older sys-v) or can be
  67.   * counted on to pass through user-defined headers without modification.
  68.   */
  69. -/* #define PICKY_MAILER /**/
  70. +#define PICKY_MAILER /**/
  71.  
  72.  /* If your system supports the vprintf() functions, True for sys-v and
  73.   * later sun versions (3.0+ ?).  Typically not true for BSD systems, but
  74.   * that will probably change in the future.
  75.   */
  76. -#if defined(SYSV) || defined(sun)
  77. +#if 1 || defined(SYSV) || defined(sun)
  78.  #define VPRINTF
  79.  #endif /* SYSV || sun */
  80.  
  81. @@ -204,7 +206,7 @@
  82.  /* If your system has the BSD-style directory routines (opendir/readdir),
  83.   * define DIRECTORY.  This happens automatically in glob.h for BSD.
  84.   */
  85. -#ifdef SVR4
  86. +#if 1
  87.  #define DIRECTORY
  88.  #endif /* SVR4 */
  89.  
  90. @@ -212,7 +214,7 @@
  91.   * define POSIX_UTIME.  You may have to change <sys/utime.h> to <utime.h>
  92.   * in mush.h.
  93.   */
  94. -#if defined(SVR4) && !defined(sun)
  95. +#if 1
  96.  #define POSIX_UTIME
  97.  #endif /* SVR4 && !sun */
  98.  
  99. --- glob.c
  100. +++ glob.c    1994/07/17 21:18:34
  101. @@ -31,6 +31,8 @@
  102.  #define TESTGLOB(str1,str2) \
  103.      printf("%s %s = %s\n",str1,str2,glob(str1,str2)?"TRUE":"FALSE")
  104.  
  105. +static int sglob();
  106. +
  107.  main(argc, argv)
  108.  int argc;
  109.  char **argv;
  110. --- init.c
  111. +++ init.c    1994/07/17 21:18:35
  112. @@ -3,6 +3,7 @@
  113.  /* init.c -- functions and whatnot that initialize everything */
  114.  #include "mush.h"
  115.  #include <pwd.h>
  116. +#include <netdb.h>
  117.  
  118.  #if defined(BSD) || defined(HPUX) || defined(IRIX4)
  119.  #include <netdb.h>
  120. @@ -18,8 +19,10 @@
  121.      char         *home, *realname, *argv[4];
  122.      extern char        *getlogin();
  123.      char        buf[MAXPATHLEN];
  124. -#if defined(SYSV) && !defined(HPUX) && !defined(IRIX4)
  125. +#if defined(SYSV) && !defined(HPUX) && !defined(IRIX4) && !defined(__linux__)
  126. +#ifndef __linux__
  127.      extern struct passwd *getpwuid();  /* sys-v forgot this in pwd.h! */
  128. +#endif
  129.      struct utsname ourhost;
  130.  #else
  131.      char ourhost[128];
  132. @@ -27,7 +30,7 @@
  133.      register char     *p;
  134.      struct passwd     *entry;
  135.      int            cnt;
  136. -#if defined(BSD) || defined(HPUX) || defined(IRIX4)
  137. +#if defined(BSD) || defined(HPUX) || defined(IRIX4) || defined(__linux__)
  138.      struct hostent     *hp;
  139.  #endif /* BSD || HPUX || IRIX4 */
  140.  
  141. @@ -98,7 +101,7 @@
  142.      escape = DEF_ESCAPE;
  143.      prompt = DEF_PROMPT;
  144.  
  145. -#if defined(BSD) || defined(HPUX) || defined(IRIX4)
  146. +#if defined(BSD) || defined(HPUX) || defined(IRIX4) || defined(__linux__)
  147.      (void) gethostname(ourhost, sizeof ourhost);
  148.      if (!(hp = gethostbyname(ourhost))) {
  149.      if (ourname = (char **)calloc((unsigned)2, sizeof (char *)))
  150. --- lock.c
  151. +++ lock.c    1994/07/17 21:29:17
  152. @@ -14,6 +14,12 @@
  153.  #include <sys/locking.h>
  154.  #endif /* SYSV && !USG */
  155.  
  156. +#ifdef __linux__
  157. +#undef USG
  158. +#undef SYSV
  159. +#define BSD
  160. +#endif
  161. +
  162.  #ifdef DOT_LOCK
  163.  
  164.  #ifndef DOLOCK_PATH
  165. @@ -253,6 +259,7 @@
  166.  /*
  167.   * Define some BSD names for the SYSV world
  168.   */
  169. +#ifndef __linux__
  170.  #ifdef USG
  171.  #define LOCK_SH F_RDLCK
  172.  #define LOCK_EX F_WRLCK
  173. @@ -263,6 +270,7 @@
  174.  #define LOCK_UN LK_UNLCK
  175.  #endif /* USG */
  176.  #define LOCK_NB 0    /* Always non-blocking in this case */
  177. +#endif /* __linux__ */
  178.  
  179.  #ifdef EWOULDBLOCK
  180.  #undef EWOULDBLOCK
  181. --- mail.c
  182. +++ mail.c    1994/07/17 21:18:35
  183. @@ -26,6 +26,8 @@
  184.  FILE *ed_fp;
  185.  char *hfile, *mktemp();
  186.  
  187. +static int mail_someone();
  188. +
  189.  /* argc and argv could be null if coming from tool mode compose */
  190.  do_mail(n, argv, list)
  191.  register int n;   /* no need for "argc", so use the space for a variable */
  192. --- makefile.sys.v
  193. +++ makefile.sys.v    1994/07/17 21:18:35
  194. @@ -23,7 +23,7 @@
  195.  
  196.  # Sun OS systems who wish to compile with sys-v options:
  197.  # CC= /usr/5bin/cc
  198. -# CFLAGS=     -O -DSYSV -DCURSES -DUSG -DDIRECTORY
  199. +# CFLAGS=     -O -DSYSV -DCURSES -DUSG -DDIRECTORY -UREGCMP
  200.  # LIBS= -L/usr/5lib -lcurses
  201.  
  202.  # IRIX 3.2 systems (SGI Iris workstations) should add -DDIRECTORY to CFLAGS
  203. @@ -31,9 +31,9 @@
  204.  # System V Release 4 (SunOS 5?) should add -DSVR4 -DDIRECTORY to CFLAGS and
  205.  #  should replace -lPW with -lgen
  206.  
  207. -CFLAGS=     -O -DSYSV -DUSG -DCURSES -DREGCMP -DSIGRET=void
  208. +CFLAGS= -fwritable-strings -O6 -fomit-frame-pointer -m486 -DSYSV -DUSG -DCURSES -DSIGRET=void -DENV_MAIL
  209.  LDFLAGS=
  210. -LIBS=         -lcurses -lPW
  211. +LIBS=         -lcurses -ltermcap #-lPW
  212.  OTHERLIBS=
  213.  # Use some variant of this one if you #define MMDF in config.h
  214.  #OTHERLIBS=/usr/src/mmdf/lib/libmmdf.a
  215. @@ -47,10 +47,10 @@
  216.  $(OBJS2): $(HDRS1) $(HDRS2) $(HDRS3)
  217.  loop.o: version.h
  218.  
  219. -BINDIR= /usr/local/bin
  220. -LIBDIR= /usr/local/lib
  221. +BINDIR= /usr/bin
  222. +LIBDIR= /usr/lib
  223.  MRCDIR= /usr/lib
  224. -MANDIR= /usr/local/man/man1
  225. +MANDIR= /usr/man/man1
  226.  MANEXT= 1
  227.  
  228.  install: mush
  229. --- msgs.c
  230. +++ msgs.c    1994/07/17 21:18:35
  231. @@ -516,7 +516,9 @@
  232.      struct utimbuf times[1];
  233.      (void) fflush(mail_fp); /* just in case */
  234.      times[0].modtime = time(×[0].actime) - 2;
  235. +#ifndef __linux__
  236.      times[0].ausec = times[0].modusec = 0;
  237. +#endif /* __linux__ */
  238.  #else /* !POSIX_UTIME */
  239.      long times[2];
  240.      (void) fflush(mail_fp); /* just in case */
  241. --- mush.h
  242. +++ mush.h    1994/07/17 21:18:35
  243. @@ -31,7 +31,7 @@
  244.  #else /* CURSES */
  245.  #include <stdio.h>
  246.  #if defined(SYSV) && defined(USG) || defined(AIX)
  247. -#include <termio.h>
  248. +#include <termios.h>
  249.  #endif /* SYSV && USG */
  250.  #endif /* CURSES */
  251.  
  252. @@ -39,6 +39,7 @@
  253.  #include <sys/ttold.h>
  254.  #endif /* SVR4 */
  255.  
  256. +#include <sys/param.h>
  257.  #include <ctype.h>
  258.  #include <errno.h>
  259.  #include <setjmp.h>
  260. @@ -91,7 +92,7 @@
  261.  #endif /* SUNTOOL */
  262.  
  263.  #ifdef POSIX_UTIME
  264. -#include <sys/utime.h>
  265. +#include <utime.h> /* <sys/utime.h> */
  266.  #endif /* POSIX_UTIME */
  267.  #include <sys/stat.h>
  268.  #include <sys/file.h>
  269. @@ -165,7 +166,7 @@
  270.  #define stty(fd, sgttybuf)    ioctl(fd, TIOCSETN, sgttybuf)
  271.  #endif /* TIOCSETN */
  272.  
  273. -/* for system-V machines that run termio */
  274. +/* for system-V machines that run termios */
  275.  #if defined(SYSV) && defined(USG) || defined(AIX)
  276.  #ifdef crmode
  277.  #undef crmode
  278. @@ -173,13 +174,13 @@
  279.  #endif /* nocrmode */
  280.  
  281.  unsigned char vmin, vtime;
  282. -#define sg_erase  c_cc[2]
  283. +#define sg_erase  c_cc[VERASE]
  284.  #define sg_flags  c_lflag
  285. -#define sg_kill   c_cc[3]
  286. +#define sg_kill   c_cc[VKILL]
  287.  #define sg_ospeed c_cflag
  288. -#define gtty(fd, SGTTYbuf)    ioctl(fd, TCGETA, SGTTYbuf)
  289. +#define gtty(fd, SGTTYbuf)    ioctl(fd, TCGETS, SGTTYbuf)
  290.  #undef stty
  291. -#define stty(fd, SGTTYbuf)    ioctl(fd, TCSETAW, SGTTYbuf)
  292. +#define stty(fd, SGTTYbuf)    ioctl(fd, TCSETSW, SGTTYbuf)
  293.  #define echon()    (_tty.sg_flags |= (ECHO|ECHOE),    stty(0, &_tty))
  294.  #define echoff()   (_tty.sg_flags &= ~ECHO,   stty(0, &_tty))
  295.  #define cbrkon()   \
  296. @@ -187,14 +188,17 @@
  297.  #define cbrkoff()  \
  298.      (_tty.sg_flags |= ICANON,_tty.c_cc[VMIN] = vmin,_tty.c_iflag |= ICRNL, \
  299.          _tty.c_cc[VTIME] = vtime, stty(0, &_tty))
  300. +#undef savetty
  301.  #define savetty()  \
  302.      (void) gtty(0, &_tty), vtime = _tty.c_cc[VTIME], vmin = _tty.c_cc[VMIN]
  303. +#undef cbreak
  304.  #define cbreak()   cbrkon()
  305. +#undef nocbreak
  306.  #define nocbreak() cbrkoff()
  307.  
  308.  /* If curses isn't defined, declare our 'tty' and macros for echo/cbreak */
  309.  #ifndef CURSES
  310. -typedef struct termio SGTTY;
  311. +typedef struct termios SGTTY;
  312.  #define echom()    echon()
  313.  #define noechom()  echoff()
  314.  #define crmode()   cbrkon()
  315. --- signals.c
  316. +++ signals.c    1994/07/17 21:18:35
  317. @@ -8,6 +8,7 @@
  318.  
  319.  static int was_stopped;
  320.  
  321. +#ifndef __linux__
  322.  #ifndef SYSV
  323.  extern char *sys_siglist[];
  324.  #else
  325. @@ -35,6 +36,7 @@
  326.  /* SIGPWR */    "power-fail restart"
  327.  };
  328.  #endif /* SYSV */
  329. +#endif /* __linux__ */
  330.  
  331.  SIGRET
  332.  intrpt(sig)
  333. --- sort.c
  334. +++ sort.c    1994/07/17 21:18:35
  335. @@ -13,11 +13,12 @@
  336.  static int depth, order, ignore_case;
  337.  static jmp_buf sortbuf;
  338.  
  339. +static int msg_cmp();
  340. +
  341.  sort(argc, argv, list)
  342.  register int argc;
  343.  register char *argv[], list[];
  344.  {
  345. -    int msg_cmp();
  346.      SIGRET (*oldint)(), (*oldquit)();
  347.      int n, offset = -1, range = 0;
  348.      long curr_msg_off = msg[current_msg].m_offset;
  349.