47 for (wl = top->text; wl; wl = wl->
wl_next)
75 if (!top->subtopics && !top->seealso)
102 mesg =
"Selection (`?' for help): ";
111 for (s = buf; *s && isspace(*s); s++)
116 "\nType the number of a sub-topic or see also, or one of:\n\ 117 \tr\tReprint the current topic\n\ 118 \tp or CR\tReturn to the previous topic\n\ 120 \t?\tPrint this message\n\n");
129 if ((ss = strchr(s,
'\n')) !=
NULL)
132 if ((ss = strchr(s,
'>')) ==
NULL) {
170 fprintf(
cp_err,
"Invalid command\n");
175 fprintf(
cp_err,
"Bad choice.\n");
187 fprintf(
cp_err,
"Bad choice.\n");
221 if (((*s ==
'\033') && s[1]) ||
222 ((*s ==
'_') && (s[1] ==
'\b')))
242 int width, maxwidth = 0, ncols, nrows, nbuts = 0, i, j, k;
250 for (tt = tl; tt; tt = tt->
next) {
255 ncols = width / maxwidth;
257 fprintf(stderr,
"Help, button too big!!\n");
262 maxwidth = width / ncols;
263 nrows = nbuts / ncols;
264 if (nrows * ncols < nbuts)
267 for (i = 0; i < nrows; i++) {
268 for (tt = tl, j = 0; j < i; j++, tt = tt->
next)
270 for (j = 0; j < ncols; j++) {
272 out_printf(
"%2d) %-*s ", base + j * nrows + i +
273 1, maxwidth - 5, tt->description);
274 for (k = 0; k < nrows; k++)
static char buf[MAXPROMPT]
void hlp_tkillwin(topic *top)
char * SCEDfgets(char *s, int n, FILE *fp, char *prompt)
toplink * hlp_thandle(topic **parent)
bool hlp_tdisplay(topic *top)
struct wordlist * wl_next
void cprint(int clr, char *buf)