pci: don't do sanity check for missing pci bus, the check can misfire.
[minix.git] / commands / elle / eehelp.c
blob11dc426601c7c4aef4d5806308ce9e8844ac0e3f
1 /* ELLE - Copyright 1982, 1987 by Ken Harrenstien, SRI International
2 * This software is quasi-public; it may be used freely with
3 * like software, but may NOT be sold or made part of licensed
4 * products without permission of the author.
5 */
6 /* EEHELP - Help function
7 */
9 #include "elle.h" /* include structure definitions */
12 #if FX_DESCRIBE
13 /* EFUN: "Describe" */
14 /* DESCRIBE - Help-command hack.
15 ** Crude approximation of EMACS function.
17 static struct buffer *help_buf;
19 f_describe()
20 { register char *cp;
21 register int i, c;
22 char str[10];
23 struct buffer *savbuf, *b, *make_buf();
24 chroff bdot;
26 saynow("Help for command: ");
27 i = cmd_idx(c = cmd_read()); /* Get function idx for cmd */
28 if(c&CB_META) sayntoo("M-");
29 if(i == FN_PFXMETA)
30 { sayntoo("M-");
31 i = cmd_idx(c = (cmd_read() | CB_META));
33 else if(i == FN_PFXEXT)
34 { sayntoo("^X-");
35 i = cmd_idx(c = (cmd_read() | CB_EXT));
37 str[0] = c&0177;
38 str[1] = 0;
39 sayntoo(str);
41 /* Now read in the help file, if necessary */
42 savbuf = cur_buf;
43 if(help_buf)
44 chg_buf(help_buf);
45 else
47 saynow("Loading ");
48 sayntoo(ev_helpfile);
49 sayntoo("...");
50 chg_buf(help_buf = make_buf(" **HELP**"));
51 if(read_file(ev_helpfile) == 0)
52 { chg_buf(savbuf);
53 kill_buf(help_buf);
54 help_buf = 0;
55 return;
60 /* Find function index in current buffer */
61 cp = str;
62 *cp++ = '<';
63 *cp++ = 'F';
64 cp = dottoa(cp, (chroff)i);
65 *cp++ = '>';
66 e_gobob();
67 if(e_search(str, cp-str, 0) == 0)
68 sayntoo(" No help found");
69 else
71 bdot = e_dot();
72 while(!e_lblankp()) e_gonl(); /* Move past 1st blank line */
73 b = make_buf(" *SHOW*");
74 sb_sins((SBBUF *)b, e_copyn(bdot - e_dot()));
75 mk_showin(b); /* Show the stuff */
76 kill_buf(b);
77 sayclr();
79 chg_buf(savbuf);
81 #endif /*FX_DESCRIBE*/