home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / networking / tcpip / amitcp-support / ncftp-1.5.6 / src / rcs / tips.c,v < prev    next >
Encoding:
Text File  |  1994-06-29  |  5.8 KB  |  203 lines

  1. head    14020.12;
  2. access;
  3. symbols
  4.     ORIGINAL:14020.11;
  5. locks; strict;
  6. comment    @ * @;
  7.  
  8.  
  9. 14020.12
  10. date    93.10.10.20.03.06;    author alph;    state Exp;
  11. branches;
  12. next    14020.11;
  13.  
  14. 14020.11
  15. date    93.05.21.05.44.39;    author alph;    state Exp;
  16. branches;
  17. next    ;
  18.  
  19.  
  20. desc
  21. @Original version
  22. @
  23.  
  24.  
  25. 14020.12
  26. log
  27. @amigados changes
  28. @
  29. text
  30. @/* tips.c */
  31.  
  32. /*  $RCSfile: tips.c,v $
  33.  *  $Revision: 1.1 $
  34.  *  $Date: 1993/10/02 10:34:34 $
  35.  */
  36.  
  37. #include "sys.h"
  38.  
  39. #ifndef NO_TIPS
  40.  
  41. #include "util.h"
  42. #ifndef NO_UNISTDH
  43. #   include <unistd.h>
  44. #endif
  45.  
  46. /* Make sure that the indentations are spaces, not tabs.
  47.  * Try newform -i-4 < tips.c > tips.c.new
  48.  *
  49.  * Always add new tips right above the last one.
  50.  */
  51.  
  52. static char *tiplist[] = {
  53.     "Have you tried typing 'open' by itself lately?",
  54.  
  55.     "If you don't want a .ncrecent file in your home directory, put the \n\
  56.      command '#unset recent-list' in your .ncftprc file.",
  57.  
  58.     "pseudo-filename-completion is supported in some commands.  To use it,\n\
  59.      use a wildcard expression that will match exactly one file.  I.e., if you\n\
  60.      want to fetch obnoxiouslylongfilename.zip, try 'get obn*.zip.'  Note that\n\
  61.      you can't use the cd command with this feature (yet).",
  62.  
  63.     "You don't need to type the exact site name with open.  If a site is in\n\
  64.      your .ncftprc or the recent-file (.ncrecent), just type a unique\n\
  65.      abbreviation (substring really).   I.e. 'open wuar' if you have the site\n\
  66.      wuarchive.wustl.edu in your rc or recent-file.",
  67.  
  68.     "You can put set commands in your .ncftprc, by adding lines such\n\
  69.      as '#set local-dir /usr/tmp' to the file, which will be run at startup.",
  70.  
  71.     "Use the .ncftprc file to set variables at startup and to add sites that \n\
  72.      need init macros.\n\
  73.      Sample .ncftprc:\n\
  74.      #set pager \"less -M\"\n\
  75.      \n\
  76.      machine wuarchive.wustl.edu\n\
  77.          macdef init\n\
  78.          cd /pub\n\
  79.          get README\n\
  80.          dir\n\
  81.          (blank line to end macro)",
  82.     
  83.     "If you want to keep your .netrc's for ftp and ncftp separate, name\n\
  84.      ncftp's rc to .ncftprc.",
  85.  
  86.     "Type 'open' by itself to get a list of the sites in your recent-file and\n\
  87.      your .ncftprc.  You can then supply '#5' at the prompt, or use 'open #5'\n\
  88.      later.",
  89.  
  90.     "Colon-mode is a quick way to get a file from your shell.  Try something\n\
  91.      like 'ncftp wuarchive.wustl.edu:/pub/README.'",
  92.  
  93.     "The open command accepts several flags.  Do a 'help open' for details.",
  94.  
  95.     "Sometimes a directory listing is several screens long and you won't\n\
  96.      remember the thing you wanted.  Use the 'predir' command to re-view the\n\
  97.      listing.  The program keeps the copy locally, so you won't have to wait\n\
  98.      for the remote server to re-send it to you.",
  99.  
  100.     "Use the 'page' (or 'more') command to view a remote file with your pager.",
  101.  
  102.     "ncftp may be keeping detailed information on everything you transfer.\n\
  103.      Run the 'version' command and if you see SYSLOG, your actions are being\n\
  104.      recorded on the system log.",
  105.  
  106.     "Try the 'redir' command to re-display the last directory listing (ls,\n\
  107.      dir, ls -lrt, etc).  'predir' does the same, only with your pager.",
  108.  
  109.     "This program is pronounced Nik-F-T-P.  NCEMRSoft is Nik'-mer-soft.",
  110.  
  111.     "Never pick Nebraska to win a big game.",
  112.  
  113. #ifdef GETLINE
  114.     "NcFTP was compiled with the Getline command-line/history editor! (by\n\
  115.      Chris Thewalt <thewalt@@ce.berkeley.edu>).  To activate it, use the up\n\
  116.      and down arrows to scroll through the history, and/or use EMACS-style\n\
  117.      commands to edit the line.",
  118. #endif
  119.  
  120. #ifdef READLINE
  121.     "NcFTP was compiled with the GNU Readline command-line/history editor!\n\
  122.      To activate it, use the up & down arrows to scroll through the history,\n\
  123.      and/or use EMACS-style (or maybe VI-style) commands to edit the line.",
  124. #endif
  125.  
  126.     "You can get the newest version of NcFTP from cse.unl.edu, in the\n\
  127.      /pub/mgleason directory.",
  128.  
  129.     "The type of progress-meter that will be used depends if the remote host\n\
  130.      supports the SIZE command, and whether your terminal is capable of ANSI\n\
  131.      escape codes.",
  132.  
  133.     "To report a bug, mail your message to mgleason@@cse.unl.edu.  Include the\n\
  134.      output of the 'version' command in your message.  An easy way to do that\n\
  135.      is to compose your message, then do a 'ncftp -H >> msg.'",
  136.  
  137.     "Don't put a site in your .ncftprc unless you want an 'init' macro.  The \n\
  138.      recent-file saves sites with the last directory you were in, unlike \n\
  139.      the rc file, while still letting you use sitename abbreviations.",
  140.  
  141.     "Sick and tired of these tips?  Put '#unset tips' in your .ncftprc."
  142. };
  143.  
  144. /* Not another dinky header, por favor. */
  145. #define NTIPS ((int) (sizeof(tiplist) / sizeof(char *)))
  146. void PrintTip(void);
  147. extern int fromatty, debug;
  148.  
  149. int tips = 1;
  150. #endif  /* NO_TIPS */
  151.  
  152. void PrintTip(void)
  153. {
  154. #ifndef NO_TIPS
  155.     int cheap_rn, i, tn;
  156.     string str;
  157.  
  158.     if (tips && fromatty) {
  159. #ifndef NO_GETPID    
  160.         cheap_rn = (int) getpid() % NTIPS;
  161. #else
  162.     cheap_rn = 0;
  163. #endif
  164.         if (debug) {
  165. #ifndef NO_GETPID    
  166.             (void) printf("pid: %d;  ntips: %d\n", getpid(), NTIPS);
  167. #else
  168.             (void) printf("(faked) pid: %d;  ntips: %d\n", 0, NTIPS);
  169. #endif
  170.             (void) Gets("*** Tip# (-1 == all): ", str, sizeof(str));
  171.             tn = atoi(str) - 1;
  172.             if (tn == -1)
  173.                 tn = 0;
  174.             if (tn < -1)
  175.                 for(i=0; i<NTIPS; i++)
  176.                     (void) printf("Tip: %s\n", tiplist[i]);
  177.             else if (tn < NTIPS)
  178.                 (void) printf("Tip: %s\n", tiplist[tn]);
  179.         } else
  180.             (void) printf("Tip: %s\n", tiplist[cheap_rn]);
  181.     }
  182. #endif  /* NO_TIPS */
  183. }   /* PrintTip */
  184.  
  185. /* tips.c */
  186. @
  187.  
  188.  
  189. 14020.11
  190. log
  191. @checked in with -k by alph at 1993/10/10 19:59:56
  192. @
  193. text
  194. @d4 2
  195. a5 2
  196.  *  $Revision: 14020.11 $
  197.  *  $Date: 93/05/21 05:44:39 $
  198. d130 1
  199. d132 3
  200. d136 1
  201. d138 3
  202. @
  203.