topic            10582 src/simh/scp.c     struct topic  *parent;
topic            10583 src/simh/scp.c     struct topic **children;
topic            10613 src/simh/scp.c static void appendText (TOPIC *topic, const char *text, size_t len)
topic            10620 src/simh/scp.c newt = (char *)realloc (topic->text, topic->len + len +1);
topic            10626 src/simh/scp.c topic->text = newt;
topic            10627 src/simh/scp.c memcpy (newt + topic->len, text, len);
topic            10628 src/simh/scp.c topic->len +=len;
topic            10629 src/simh/scp.c newt[topic->len] = '\0';
topic            10635 src/simh/scp.c static void cleanHelp (TOPIC *topic)
topic            10640 src/simh/scp.c FREE (topic->title);
topic            10641 src/simh/scp.c FREE (topic->text);
topic            10642 src/simh/scp.c FREE (topic->label);
topic            10643 src/simh/scp.c for (i = 0; i < topic->kids; i++) {
topic            10644 src/simh/scp.c     child = topic->children[i];
topic            10648 src/simh/scp.c FREE (topic->children);
topic            10655 src/simh/scp.c static TOPIC *buildHelp (TOPIC *topic, DEVICE *dptr,
topic            10695 src/simh/scp.c             appendText (topic, "    ", 4);      /* Basic indentation */
topic            10699 src/simh/scp.c                     appendText (topic, "    ", 4);
topic            10710 src/simh/scp.c                     appendText (topic, start, htext - start); /* Flush up to escape */
topic            10717 src/simh/scp.c                                 appendText (topic, buf, strlen (buf));
topic            10722 src/simh/scp.c                                 appendText (topic, dptr->name, strlen (dptr->name));
topic            10725 src/simh/scp.c                             appendText (topic, sim_name, strlen (sim_name));
topic            10728 src/simh/scp.c                             appendText (topic, "%", 1);
topic            10731 src/simh/scp.c                             appendText (topic, "+", 1);
topic            10760 src/simh/scp.c                                         appendText (topic, start, ep - start);
topic            10764 src/simh/scp.c                                                 appendText (topic, "    ", 4);
topic            10771 src/simh/scp.c                                 appendText (topic, start, ep-start);
topic            10783 src/simh/scp.c                     appendText (topic, start, htext - start);
topic            10801 src/simh/scp.c                 FAIL (SCPE_ARG, Invalid topic heading, htext);
topic            10804 src/simh/scp.c             if (n <= topic->level) {            /* Find level for new topic */
topic            10805 src/simh/scp.c                 while (n <= topic->level)
topic            10806 src/simh/scp.c                     topic = topic->parent;
topic            10809 src/simh/scp.c                 if (n > topic->level + 1) {     /* Skipping down more than 1 */
topic            10819 src/simh/scp.c                 FAIL (SCPE_ARG, Missing topic name, htext);
topic            10827 src/simh/scp.c                 FAIL (SCPE_ARG, Null topic name, htext);
topic            10872 src/simh/scp.c             children = (TOPIC **) realloc (topic->children,
topic            10873 src/simh/scp.c                                            (topic->kids +1) * sizeof (TOPIC *));
topic            10881 src/simh/scp.c             topic->children = children;
topic            10882 src/simh/scp.c             topic->children[topic->kids++] = newt;
topic            10884 src/simh/scp.c             newt->parent = topic;
topic            10886 src/simh/scp.c             if (n > topic->kidwid)
topic            10887 src/simh/scp.c                 topic->kidwid = n;
topic            10888 src/simh/scp.c             (void)sprintf (nbuf, ".%u", topic->kids);
topic            10889 src/simh/scp.c             n = strlen (topic->label) + strlen (nbuf) + 1;
topic            10893 src/simh/scp.c                 topic->children[topic->kids -1] = NULL;
topic            10899 src/simh/scp.c             (void)sprintf (newt->label, "%s%s", topic->label, nbuf);
topic            10900 src/simh/scp.c             topic = newt;
topic            10916 src/simh/scp.c return topic;
topic            10923 src/simh/scp.c static char *helpPrompt ( TOPIC *topic, const char *pstring, t_bool oneword )
topic            10928 src/simh/scp.c if (topic->level == 0) {
topic            10938 src/simh/scp.c     prefix = helpPrompt (topic->parent, "", oneword);
topic            10940 src/simh/scp.c newp = (char *) malloc (strlen (prefix) + 1 + strlen (topic->title) + 1 +
topic            10949 src/simh/scp.c if (topic->children) {
topic            10950 src/simh/scp.c     if (topic->level != 0)
topic            10952 src/simh/scp.c     newt = (topic->flags & HLP_MAGIC_TOPIC)?
topic            10953 src/simh/scp.c             topic->title+1: topic->title;
topic            10972 src/simh/scp.c static void displayMagicTopic (FILE *st, DEVICE *dptr, TOPIC *topic)
topic            10999 src/simh/scp.c if (topic->title)
topic            11000 src/simh/scp.c     (void)fprintf (st, "%s\n", topic->title+1);
topic            11003 src/simh/scp.c if (topic->title) {
topic            11004 src/simh/scp.c   if (!strcmp (topic->title+1, "Registers")) {
topic            11009 src/simh/scp.c       if (!strcmp (topic->title+1, "Set commands")) {
topic            11014 src/simh/scp.c           if (!strcmp (topic->title+1, "Show commands")) {
topic            11045 src/simh/scp.c                                TOPIC *topic, va_list ap )
topic            11049 src/simh/scp.c if (topic->flags & HLP_MAGIC_TOPIC) {
topic            11050 src/simh/scp.c     (void)fprintf (st, "\n%s ", topic->label);
topic            11051 src/simh/scp.c     displayMagicTopic (st, dptr, topic);
topic            11054 src/simh/scp.c     (void)fprintf (st, "\n%s %s\n", topic->label, topic->title);
topic            11061 src/simh/scp.c if (topic->text)
topic            11062 src/simh/scp.c     fputs (topic->text, st);
topic            11064 src/simh/scp.c for (i = 0; i < topic->kids; i++)
topic            11065 src/simh/scp.c     displayFlatHelp (st, dptr, uptr, flag, topic->children[i], ap);
topic            11073 src/simh/scp.c static size_t matchHelpTopicName (TOPIC *topic, const char *token)
topic            11082 src/simh/scp.c for (i = 0; i < topic->kids; i++) {
topic            11083 src/simh/scp.c     strcpy (cbuf,topic->children[i]->title +
topic            11084 src/simh/scp.c             ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0));
topic            11113 src/simh/scp.c TOPIC *topic = &top;
topic            11217 src/simh/scp.c     match =  matchHelpTopicName (topic, gbuf);
topic            11219 src/simh/scp.c         displayFlatHelp (st, dptr, uptr, flag, topic, ap);
topic            11224 src/simh/scp.c         (void)fprintf (st, "\n%s is ambiguous in %s\n", gbuf, topic->title);
topic            11228 src/simh/scp.c         (void)fprintf (st, "\n%s is not available in %s\n", gbuf, topic->title);
topic            11231 src/simh/scp.c     topic = topic->children[match-1];
topic            11236 src/simh/scp.c     displayFlatHelp (st, dptr, uptr, flag, topic, ap);
topic            11249 src/simh/scp.c     if (topic->flags & HLP_MAGIC_TOPIC) {
topic            11251 src/simh/scp.c         displayMagicTopic (st, dptr, topic);
topic            11254 src/simh/scp.c         (void)fprintf (st, "\n%s\n", topic->title);
topic            11260 src/simh/scp.c     if (topic->text)
topic            11261 src/simh/scp.c         fputs (topic->text, st);
topic            11263 src/simh/scp.c     if (topic->kids) {
topic            11269 src/simh/scp.c         for (i = 0; i < topic->kids; i++) {
topic            11270 src/simh/scp.c             strcpy (tbuf, topic->children[i]->title +
topic            11271 src/simh/scp.c                     ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0));
topic            11276 src/simh/scp.c             w += 4 + topic->kidwid;
topic            11278 src/simh/scp.c                 w = 4 + topic->kidwid;
topic            11281 src/simh/scp.c             (void)fprintf (st, "    %-*s", (int32_t)topic->kidwid, tbuf);
topic            11285 src/simh/scp.c             pstring = helpPrompt (topic, "", TRUE);
topic            11297 src/simh/scp.c         if (topic->kids == 0)
topic            11298 src/simh/scp.c             topic = topic->parent;
topic            11299 src/simh/scp.c         pstring = helpPrompt (topic, prompt[topic->kids != 0], FALSE);
topic            11314 src/simh/scp.c         displayFlatHelp (st, dptr, uptr, flag, topic, ap);
topic            11318 src/simh/scp.c         if (topic->level == 0)
topic            11320 src/simh/scp.c         topic = topic->parent;
topic            11334 src/simh/scp.c     if (!topic->kids) {
topic            11339 src/simh/scp.c     match = matchHelpTopicName (topic, gbuf);
topic            11353 src/simh/scp.c     topic = topic->children[match-1];