3 * Copyright 1991 by the Massachusetts Institute of Technology.
5 * For further information on copyright and distribution
6 * see the file mit-copyright.h
9 #include <mit-copyright.h>
19 FILE *helpfile = NULL;
20 char buf[1024], key[32], *msg, helpbuf[10240], *filename;
21 char *realloc(), *getenv();
23 sprintf(key, "*%s\n", node);
24 filename = resources.help_file;
27 helpfile = fopen(filename, "r");
28 if (helpfile == NULL) {
29 display_error("Sorry, help is currently unavailable.\n");
32 while (fgets(buf, sizeof(buf), helpfile))
33 if (!strcmp(buf, key))
35 if (strcmp(buf, key)) {
36 sprintf(buf, "Sorry, unable to find help on topic \"%s\".\n", node);
42 while (fgets(buf, sizeof(buf), helpfile))
47 if (!strcmp(buf, "\n"))
49 msg = realloc(msg, strlen(msg) + strlen(buf) + 2);
57 printf("%s\r\n", msg);
65 help_form_callback(dummy, form)
72 /* undocumented Motif internal routine to advance in tab group.
73 * In this case we're going backwards because for some reason
74 * the form advances whenever this button is pressed.
75 * However, it doesn't seem to go backwards even though source
76 * implies that it should. So we go forward until we wrap.
79 for (p = form->inputlines; *p; p++)
80 if (!((*p)->insensitive))
83 _XmMgrTraversal(form->formpointer, XmTRAVERSE_PREV_TAB_GROUP);