home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / UUPC11XT.ZIP / RN / HELP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-21  |  10.9 KB  |  335 lines

  1. /* $Header: E:\SRC\UUPC\RN\RCS/HELP.C 1.1 1992/11/21 06:14:58 ahd Exp $
  2.  *
  3.  * $Log: HELP.C $
  4.  * Revision 1.1  1992/11/21  06:14:58  ahd
  5.  * Initial
  6.  *
  7.  *
  8.  *    Rev 1.0   18 Nov 1990  0:22:10
  9.  * Initial revision.
  10.  * Revision 4.3.1.2  85/09/10  11:05:39  lwall
  11.  * Improved %m in in_char().
  12.  *
  13.  * Revision 4.3.1.1  85/05/10  11:33:10  lwall
  14.  * Branch for patches.
  15.  *
  16.  * Revision 4.3  85/05/01  11:38:59  lwall
  17.  * Baseline for release with 4.3bsd.
  18.  *
  19.  */
  20.  
  21. #include "EXTERN.h"
  22. #include "common.h"
  23. #include "rn.h"
  24. #include "term.h"
  25. #include "INTERN.h"
  26. #include "help.h"
  27.  
  28. void
  29.   help_init()
  30. {
  31.    ;
  32. }
  33.  
  34. int
  35.   help_page()
  36. {
  37.    int cmd;
  38.  
  39. #ifdef PAGERHELP
  40.    doshell(sh, filexp(PAGERHELP));
  41. #else
  42.    page_init();
  43.    if ((cmd = print_lines("\
  44. Paging commands:\n\
  45. ", STANDOUT)) ||
  46.          (cmd = print_lines("\n\
  47. SP      Display the next page.\n\
  48. x       Display the next page decrypted (rot13).\n\
  49. d       Display half a page more.\n\
  50. CR      Display one more line.\n\
  51. ^R,v,^X Restart the current article (v=verbose header, ^X=rot13).\n\
  52. ", NOMARKING)) ||
  53.          (cmd = print_lines("\
  54. ^B      Back up one page.\n\
  55. ^L,X    Refresh the screen (X=rot13).\n\
  56. g pat   Go to (search forward within article for) pattern.\n\
  57. G       Search again for current pattern within article.\n\
  58. ^G      Search for next line beginning with \"Subject:\".\n\
  59. TAB     Search for next line beginning with a different character.\n\
  60. q       Quit the pager, go to end of article.  Leave article read or unread.\n\
  61. j       Junk this article (mark it read).  Goes to end of article.\n\
  62. \n\
  63. ", NOMARKING)) ||
  64.          (cmd = print_lines("\
  65. The following commands skip the rest of the current article, then behave\n\
  66. just as if typed to the 'What next?' prompt at the end of the article:\n\
  67. ", STANDOUT)) ||
  68.          (cmd = print_lines("\n\
  69. n       Scan forward for next unread article.\n\
  70. N       Go to next article.\n\
  71. ^N      Scan forward for next unread article with same title.\n\
  72. p,P,^P  Same as n,N,^N, only going backwards.\n\
  73. -       Go to previously displayed article.\n\
  74. \n\
  75. ", NOMARKING)) ||
  76.          (cmd = print_lines("\
  77. The following commands also take you to the end of the article.\n\
  78. Type h at end of article for a description of these commands:\n\
  79. ", STANDOUT)) ||
  80.          (cmd = print_lines("\
  81.         # $ & / = ? c C f F k K ^K m M number r R ^R s S u v w W Y ^ |\n\
  82. \n\
  83. (To return to the middle of the article after one of these commands, type ^L.)\n\
  84. ", NOMARKING)))
  85.       return cmd;
  86. #endif
  87.  
  88.    return 0;
  89. }
  90.  
  91. int
  92.   help_art()
  93. {
  94.    int cmd;
  95.  
  96. #ifdef ARTHELP
  97.    doshell(sh, filexp(ARTHELP));
  98. #else
  99.    page_init();
  100.    if ((cmd = print_lines("\
  101. Article Selection commands:\n\
  102. ", STANDOUT)) ||
  103.          (cmd = print_lines("\n\
  104. n,SP    Scan forward for next unread article.\n\
  105. N       Go to next article.\n\
  106. ^N      Scan forward for next unread article with same subject.\n\
  107. p,P,^P  Same as n,N,^N, only going backwards.\n\
  108. -       Go to previously displayed article.\n\
  109. ", NOMARKING)) ||
  110.          (cmd = print_lines("\
  111. number  Go to specified article.\n\
  112. range{,range} command{:command}\n\
  113.         Apply one or more commands to one or more ranges of articles.\n\
  114.         Ranges are of the form: number | number-number.  You may use . for\n\
  115.         the current article, and $ for the last article.\n\
  116.         Valid commands are: j, m, M, s, S, and !.\n\
  117. ", NOMARKING)) ||
  118.          (cmd = print_lines("\
  119. /pattern/modifiers\n\
  120.         Scan forward for article containing pattern in the subject line.\n\
  121.         (Use ?pat? to scan backwards; append h to scan headers, a to scan\n\
  122.         entire articles, r to scan read articles, c to make case sensitive.\n\
  123. /pattern/modifiers:command{:command}\n\
  124.         Apply one or more commands to the set of articles matching pattern.\n\
  125.         Use a K modifier to save entire command to the KILL file for this\n\
  126.         newsgroup.  Commands m and M, if first, imply an r modifier.\n\
  127.         Valid commands are: j, m, M, s, S, and !.\n\
  128. ", NOMARKING)) ||
  129.          (cmd = print_lines("\
  130. f,F     Submit a followup article (F = include this article).\n\
  131. r,R     Reply through net mail (R = include this article).\n\
  132. s ...   Save to file or pipe via sh.\n\
  133. S ...   Save via preferred shell.\n\
  134. w,W     Like s and S but save without the header.\n\
  135. | ...   Same as s|...\n\
  136. C       Cancel this article, if yours.\n\
  137. ", NOMARKING)) ||
  138.          (cmd = print_lines("\
  139. ^R,v    Restart article (v=verbose).\n\
  140. ^X      Restart article, rot13 mode.\n\
  141. c       Catch up (mark all articles as read).\n\
  142. ^B      Back up one page.\n\
  143. ^L      Refresh the screen.  You can get back to the pager with this.\n\
  144. X       Refresh screen in rot13 mode.\n\
  145. ", NOMARKING)) ||
  146.          (cmd = print_lines("\
  147. ^       Go to first unread article.  Disables subject search mode.\n\
  148. $       Go to end of newsgroup.  Disables subject search mode.\n\
  149. ", NOMARKING)) ||
  150.          (cmd = print_lines("#       Print last article number.\n\
  151. &       Print current values of command-line switches.\n\
  152. &switch {switch}\n\
  153.         Set or unset more switches.\n\
  154. &&      Print current macro definitions.\n\
  155. &&def   Define a new macro.\n\
  156. ", NOMARKING)) ||
  157.          (cmd = print_lines("\
  158. j       Junk this article (mark it read).  Stays at end of article.\n\
  159. m       Mark article as still unread.\n\
  160. M       Mark article as still unread upon exiting newsgroup or Y command.\n\
  161. ", NOMARKING)) ||
  162.          (cmd = print_lines("\
  163. Y       Yank back articles marked temporarily read via M.\n\
  164. k       Mark current SUBJECT as read.\n\
  165. K       Mark current SUBJECT as read, and save command in KILL file.\n\
  166. =       List subjects of unread articles.\n\
  167. ", NOMARKING)) ||
  168.          (cmd = print_lines("\
  169. u       Unsubscribe to this newsgroup.\n\
  170. ^K      Edit local KILL file (the one for this newsgroup).\n\
  171. q       Quit this newsgroup for now.\n\
  172. Q       Quit newsgroup, staying at current newsgroup.\n\
  173. ", NOMARKING)))
  174.       return cmd;
  175. #endif
  176.  
  177.    return 0;
  178. }
  179.  
  180. int
  181.   help_ng()
  182. {
  183.    int cmd;
  184.  
  185. #ifdef NGHELP
  186.    doshell(sh, filexp(NGHELP));
  187. #else
  188.    page_init();
  189.    if (cmd = print_lines("\
  190. Newsgroup Selection commands:\n\
  191. ", STANDOUT))
  192.       return cmd;
  193.    if (ng != nextrcline)
  194.    {
  195.       if (cmd = print_lines("\
  196. \n\
  197. y,SP    Do this newsgroup now.\n\
  198. .cmd    Do this newsgroup, executing cmd as first command.\n\
  199. =       Equivalent to .=<carriage return>.\n\
  200. u       Unsubscribe from this newsgroup.\n\
  201. c       Catch up (mark this newsgroup all read).\n\
  202. ", NOMARKING))
  203.          return cmd;
  204.    }
  205.    if ((cmd = print_lines("\
  206. \n\
  207. n       Go to the next newsgroup with unread news.\n\
  208. N       Go to the next newsgroup.\n\
  209. p       Go to the previous newsgroup with unread news.\n\
  210. P       Go to the previous newsgroup.\n\
  211. ", NOMARKING)) ||
  212.          (cmd = print_lines("\
  213. -       Go to the previously displayed newsgroup.\n\
  214. 1       Go to the first newsgroup.\n\
  215. ^       Go to the first newsgroup with unread news.\n\
  216. $       Go to the last newsgroup.\n\
  217. ", NOMARKING)) ||
  218.          (cmd = print_lines("\
  219. g name  Go to the named newsgroup.  Subscribe to new newsgroups this way too.\n\
  220. /pat    Search forward for newsgroup matching pattern.\n\
  221. ?pat    Search backward for newsgroup matching pattern.\n\
  222.         (Use * and ? style patterns.  Append r to include read newsgroups.)\n\
  223. ", NOMARKING)) ||
  224.          (cmd = print_lines("\
  225. l pat   List unsubscribed newsgroups containing pattern.\n\
  226. m name  Move named newsgroup elsewhere (no name moves current newsgroup).\n\
  227. o pat   Only display newsgroups matching pattern.  Omit pat to unrestrict.\n\
  228. a pat   Like o, but also scans for unsubscribed newsgroups matching pattern.\n\
  229. L       List current .newsrc.\n\
  230. ", NOMARKING)) ||
  231.          (cmd = print_lines("\
  232. &       Print current command-line switch settings.\n\
  233. &switch {switch}\n\
  234.         Set (or unset) more command-line switches.\n\
  235. &&      Print current macro definitions.\n\
  236. &&def   Define a new macro.\n\
  237. !cmd    Shell escape.\n\
  238. ", NOMARKING)) ||
  239.          (cmd = print_lines("\
  240. q       Quit rn.\n\
  241. ^K      Edit the global KILL file.  Use commands like /pattern/j to suppress\n\
  242.         pattern in every newsgroup.\n\
  243. v       Print version.\n\
  244. ", NOMARKING)))
  245.       return cmd;
  246. #endif
  247.  
  248. #ifdef PUSHBACK
  249.    if (cmd = get_anything())
  250.       return cmd;
  251.    show_macros();
  252. #endif
  253.  
  254.    return 0;
  255. }
  256.  
  257. #ifdef ESCSUBS
  258. int
  259.   help_subs()
  260. {
  261.    int cmd;
  262.  
  263. #ifdef SUBSHELP
  264.    doshell(sh, filexp(SUBSHELP));
  265. #else
  266.    page_init();
  267.    if ((cmd = print_lines("\
  268. Valid substitutions are:\n\
  269. ", STANDOUT)) ||
  270.          (cmd = print_lines("\
  271. \n\
  272. a       Current article number\n\
  273. A       Full name of current article (%P/%c/%a)\n\
  274. b       Destination of last save command, often a mailbox\n\
  275. B       Bytes to ignore at beginning of last saved article\n\
  276. ", NOMARKING)) ||
  277.          (cmd = print_lines("\
  278. c       Current newsgroup, directory form\n\
  279. C       Current newsgroup, dot form\n\
  280. d       Full name of newsgroup directory (%P/%c)\n\
  281. D       Distribution line from current article\
  282. ", NOMARKING)) ||
  283.          (cmd = print_lines("\
  284. f       Who the current article is from\n\
  285. F       Newsgroups to followup to (from Newsgroups and Followup-To)\n\
  286. h       (This help message)\n\
  287. H       Host name (yours)\n\
  288. i       Message-I.D. line from current article, with <>\n\
  289. I       Reference indicator mark (see -F switch)\n\
  290. ", NOMARKING)) ||
  291.          (cmd = print_lines("\
  292. l       News administrator's login name, if any\n\
  293. L       Login name (yours)\n\
  294. m       Current mode, first letter of (init, newsgroup, article, pager,\n\
  295.                 Add, Catchup, Delete bogus, Mailbox, Resubscribe)\n\
  296. M       Number of article marked with M\n\
  297. n       Newsgroups from current article\n\
  298. N       Full name (yours)\n\
  299. ", NOMARKING)) ||
  300.          (cmd = print_lines("\
  301. o       Organization (yours)\n\
  302. O       Original working directory (where you ran rn from)\n\
  303. p       Your private news directory (from -d)\n\
  304. P       Public news spool directory\n\
  305. ", NOMARKING)) ||
  306.          (cmd = print_lines("\
  307. r       Last reference (parent article id)\n\
  308. R       References list for followup article\n\
  309. s       Subject, with all Re's and (nf)'s stripped off\n\
  310. S       Subject, with one Re stripped off\
  311. ", NOMARKING)) ||
  312.          (cmd = print_lines("\
  313. t       New To line derived from From and Reply-To (Internet format)\n\
  314. T       New To line derived from Path\n\
  315. u       Number of unread articles\n\
  316. U       Number of unread articles not counting current article\n\
  317. x       News library directory\n\
  318. X       Rn library directory\n\
  319. z       Length of current article in bytes\n\
  320. ", NOMARKING)) ||
  321.          (cmd = print_lines("\
  322. ~       Your home directory\n\
  323. .       Directory containing . files\n\
  324. $       Current process number\n\
  325. /       Last search string\n\
  326. ESC     Run preceding command through % interpretation\n\
  327. ", NOMARKING)))
  328.       return cmd;
  329. #endif
  330.  
  331.    return 0;
  332. }
  333.  
  334. #endif
  335.