topic            10785 src/simh/scp.c     struct topic  *parent;
topic            10786 src/simh/scp.c     struct topic **children;
topic            10816 src/simh/scp.c static void appendText (TOPIC *topic, const char *text, size_t len)
topic            10823 src/simh/scp.c newt = (char *)realloc (topic->text, topic->len + len +1);
topic            10829 src/simh/scp.c topic->text = newt;
topic            10830 src/simh/scp.c memcpy (newt + topic->len, text, len);
topic            10831 src/simh/scp.c topic->len +=len;
topic            10832 src/simh/scp.c newt[topic->len] = '\0';
topic            10838 src/simh/scp.c static void cleanHelp (TOPIC *topic)
topic            10843 src/simh/scp.c FREE (topic->title);
topic            10844 src/simh/scp.c FREE (topic->text);
topic            10845 src/simh/scp.c FREE (topic->label);
topic            10846 src/simh/scp.c for (i = 0; i < topic->kids; i++) {
topic            10847 src/simh/scp.c     child = topic->children[i];
topic            10851 src/simh/scp.c FREE (topic->children);
topic            10858 src/simh/scp.c static TOPIC *buildHelp (TOPIC *topic, DEVICE *dptr,
topic            10898 src/simh/scp.c             appendText (topic, "    ", 4);      /* Basic indentation */
topic            10902 src/simh/scp.c                     appendText (topic, "    ", 4);
topic            10913 src/simh/scp.c                     appendText (topic, start, htext - start); /* Flush up to escape */
topic            10920 src/simh/scp.c                                 appendText (topic, buf, strlen (buf));
topic            10925 src/simh/scp.c                                 appendText (topic, dptr->name, strlen (dptr->name));
topic            10928 src/simh/scp.c                             appendText (topic, sim_name, strlen (sim_name));
topic            10931 src/simh/scp.c                             appendText (topic, "%", 1);
topic            10934 src/simh/scp.c                             appendText (topic, "+", 1);
topic            10963 src/simh/scp.c                                         appendText (topic, start, ep - start);
topic            10967 src/simh/scp.c                                                 appendText (topic, "    ", 4);
topic            10974 src/simh/scp.c                                 appendText (topic, start, ep-start);
topic            10986 src/simh/scp.c                     appendText (topic, start, htext - start);
topic            11004 src/simh/scp.c                 FAIL (SCPE_ARG, Invalid topic heading, htext);
topic            11007 src/simh/scp.c             if (n <= topic->level) {            /* Find level for new topic */
topic            11008 src/simh/scp.c                 while (n <= topic->level)
topic            11009 src/simh/scp.c                     topic = topic->parent;
topic            11012 src/simh/scp.c                 if (n > topic->level + 1) {     /* Skipping down more than 1 */
topic            11022 src/simh/scp.c                 FAIL (SCPE_ARG, Missing topic name, htext);
topic            11030 src/simh/scp.c                 FAIL (SCPE_ARG, Null topic name, htext);
topic            11076 src/simh/scp.c             children = (TOPIC **) realloc (topic->children,
topic            11077 src/simh/scp.c                                            (topic->kids +1) * sizeof (TOPIC *));
topic            11085 src/simh/scp.c             topic->children = children;
topic            11086 src/simh/scp.c             topic->children[topic->kids++] = newt;
topic            11088 src/simh/scp.c             newt->parent = topic;
topic            11090 src/simh/scp.c             if (n > topic->kidwid)
topic            11091 src/simh/scp.c                 topic->kidwid = n;
topic            11092 src/simh/scp.c             (void)sprintf (nbuf, ".%u", topic->kids);
topic            11093 src/simh/scp.c             n = strlen (topic->label) + strlen (nbuf) + 1;
topic            11097 src/simh/scp.c                 topic->children[topic->kids -1] = NULL;
topic            11103 src/simh/scp.c             (void)sprintf (newt->label, "%s%s", topic->label, nbuf);
topic            11104 src/simh/scp.c             topic = newt;
topic            11120 src/simh/scp.c return topic;
topic            11127 src/simh/scp.c static char *helpPrompt ( TOPIC *topic, const char *pstring, t_bool oneword )
topic            11132 src/simh/scp.c if (topic->level == 0) {
topic            11142 src/simh/scp.c     prefix = helpPrompt (topic->parent, "", oneword);
topic            11144 src/simh/scp.c newp = (char *) malloc (strlen (prefix) + 1 + strlen (topic->title) + 1 +
topic            11153 src/simh/scp.c if (topic->children) {
topic            11154 src/simh/scp.c     if (topic->level != 0)
topic            11156 src/simh/scp.c     newt = (topic->flags & HLP_MAGIC_TOPIC)?
topic            11157 src/simh/scp.c             topic->title+1: topic->title;
topic            11176 src/simh/scp.c static void displayMagicTopic (FILE *st, DEVICE *dptr, TOPIC *topic)
topic            11203 src/simh/scp.c if (topic->title)
topic            11204 src/simh/scp.c     (void)fprintf (st, "%s\r\n", topic->title+1);
topic            11207 src/simh/scp.c if (topic->title) {
topic            11208 src/simh/scp.c   if (!strcmp (topic->title+1, "Registers")) {
topic            11213 src/simh/scp.c       if (!strcmp (topic->title+1, "Set commands")) {
topic            11218 src/simh/scp.c           if (!strcmp (topic->title+1, "Show commands")) {
topic            11249 src/simh/scp.c                                TOPIC *topic, va_list ap )
topic            11253 src/simh/scp.c if (topic->flags & HLP_MAGIC_TOPIC) {
topic            11254 src/simh/scp.c     (void)fprintf (st, "\r\n%s ", topic->label);
topic            11255 src/simh/scp.c     displayMagicTopic (st, dptr, topic);
topic            11258 src/simh/scp.c     (void)fprintf (st, "\r\n%s %s\r\n", topic->label, topic->title);
topic            11265 src/simh/scp.c if (topic->text)
topic            11266 src/simh/scp.c     fputs (topic->text, st);
topic            11268 src/simh/scp.c for (i = 0; i < topic->kids; i++)
topic            11269 src/simh/scp.c     displayFlatHelp (st, dptr, uptr, flag, topic->children[i], ap);
topic            11277 src/simh/scp.c static size_t matchHelpTopicName (TOPIC *topic, const char *token)
topic            11286 src/simh/scp.c for (i = 0; i < topic->kids; i++) {
topic            11287 src/simh/scp.c     strcpy (cbuf,topic->children[i]->title +
topic            11288 src/simh/scp.c             ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0));
topic            11317 src/simh/scp.c TOPIC *topic = &top;
topic            11421 src/simh/scp.c     match =  matchHelpTopicName (topic, gbuf);
topic            11424 src/simh/scp.c             displayFlatHelp (st, dptr, uptr, flag, topic, ap);
topic            11429 src/simh/scp.c         (void)fprintf (st, "\r\n%s is ambiguous in %s\r\n", gbuf, topic->title);
topic            11433 src/simh/scp.c         (void)fprintf (st, "\r\n%s is not available in %s\r\n", gbuf, topic->title);
topic            11436 src/simh/scp.c     topic = topic->children[match-1];
topic            11441 src/simh/scp.c     displayFlatHelp (st, dptr, uptr, flag, topic, ap);
topic            11454 src/simh/scp.c     if (topic->flags & HLP_MAGIC_TOPIC) {
topic            11456 src/simh/scp.c         displayMagicTopic (st, dptr, topic);
topic            11459 src/simh/scp.c         (void)fprintf (st, "\r\n%s\r\n", topic->title);
topic            11465 src/simh/scp.c     if (topic->text)
topic            11466 src/simh/scp.c         fputs (topic->text, st);
topic            11468 src/simh/scp.c     if (topic->kids) {
topic            11474 src/simh/scp.c         for (i = 0; i < topic->kids; i++) {
topic            11475 src/simh/scp.c             strcpy (tbuf, topic->children[i]->title +
topic            11476 src/simh/scp.c                     ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0));
topic            11481 src/simh/scp.c             w += 4 + topic->kidwid;
topic            11483 src/simh/scp.c                 w = 4 + topic->kidwid;
topic            11487 src/simh/scp.c             (void)fprintf (st, "    %-*s", (int32_t)topic->kidwid, tbuf);
topic            11491 src/simh/scp.c             pstring = helpPrompt (topic, "", TRUE);
topic            11503 src/simh/scp.c         if (topic->kids == 0)
topic            11504 src/simh/scp.c             topic = topic->parent;
topic            11505 src/simh/scp.c         pstring = helpPrompt (topic, prompt[topic->kids != 0], FALSE);
topic            11520 src/simh/scp.c         displayFlatHelp (st, dptr, uptr, flag, topic, ap);
topic            11524 src/simh/scp.c         if (topic->level == 0)
topic            11526 src/simh/scp.c         topic = topic->parent;
topic            11540 src/simh/scp.c     if (!topic->kids) {
topic            11545 src/simh/scp.c     match = matchHelpTopicName (topic, gbuf);
topic            11559 src/simh/scp.c     topic = topic->children[match-1];