topic 10197 src/simh/scp.c struct topic *parent; topic 10198 src/simh/scp.c struct topic **children; topic 10228 src/simh/scp.c static void appendText (TOPIC *topic, const char *text, size_t len) topic 10235 src/simh/scp.c newt = (char *)realloc (topic->text, topic->len + len +1); topic 10241 src/simh/scp.c topic->text = newt; topic 10242 src/simh/scp.c memcpy (newt + topic->len, text, len); topic 10243 src/simh/scp.c topic->len +=len; topic 10244 src/simh/scp.c newt[topic->len] = '\0'; topic 10250 src/simh/scp.c static void cleanHelp (TOPIC *topic) topic 10255 src/simh/scp.c FREE (topic->title); topic 10256 src/simh/scp.c FREE (topic->text); topic 10257 src/simh/scp.c FREE (topic->label); topic 10258 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 10259 src/simh/scp.c child = topic->children[i]; topic 10263 src/simh/scp.c FREE (topic->children); topic 10270 src/simh/scp.c static TOPIC *buildHelp (TOPIC *topic, DEVICE *dptr, topic 10310 src/simh/scp.c appendText (topic, " ", 4); /* Basic indentation */ topic 10314 src/simh/scp.c appendText (topic, " ", 4); topic 10325 src/simh/scp.c appendText (topic, start, htext - start); /* Flush up to escape */ topic 10332 src/simh/scp.c appendText (topic, buf, strlen (buf)); topic 10337 src/simh/scp.c appendText (topic, dptr->name, strlen (dptr->name)); topic 10340 src/simh/scp.c appendText (topic, sim_name, strlen (sim_name)); topic 10343 src/simh/scp.c appendText (topic, "%", 1); topic 10346 src/simh/scp.c appendText (topic, "+", 1); topic 10375 src/simh/scp.c appendText (topic, start, ep - start); topic 10379 src/simh/scp.c appendText (topic, " ", 4); topic 10386 src/simh/scp.c appendText (topic, start, ep-start); topic 10398 src/simh/scp.c appendText (topic, start, htext - start); topic 10416 src/simh/scp.c FAIL (SCPE_ARG, Invalid topic heading, htext); topic 10419 src/simh/scp.c if (n <= topic->level) { /* Find level for new topic */ topic 10420 src/simh/scp.c while (n <= topic->level) topic 10421 src/simh/scp.c topic = topic->parent; topic 10424 src/simh/scp.c if (n > topic->level +1) { /* Skipping down more than 1 */ topic 10434 src/simh/scp.c FAIL (SCPE_ARG, Missing topic name, htext); topic 10442 src/simh/scp.c FAIL (SCPE_ARG, Null topic name, htext); topic 10487 src/simh/scp.c children = (TOPIC **) realloc (topic->children, topic 10488 src/simh/scp.c (topic->kids +1) * sizeof (TOPIC *)); topic 10496 src/simh/scp.c topic->children = children; topic 10497 src/simh/scp.c topic->children[topic->kids++] = newt; topic 10499 src/simh/scp.c newt->parent = topic; topic 10501 src/simh/scp.c if (n > topic->kidwid) topic 10502 src/simh/scp.c topic->kidwid = n; topic 10503 src/simh/scp.c sprintf (nbuf, ".%u", topic->kids); topic 10504 src/simh/scp.c n = strlen (topic->label) + strlen (nbuf) + 1; topic 10508 src/simh/scp.c topic->children[topic->kids -1] = NULL; topic 10514 src/simh/scp.c sprintf (newt->label, "%s%s", topic->label, nbuf); topic 10515 src/simh/scp.c topic = newt; topic 10531 src/simh/scp.c return topic; topic 10538 src/simh/scp.c static char *helpPrompt ( TOPIC *topic, const char *pstring, t_bool oneword ) topic 10543 src/simh/scp.c if (topic->level == 0) { topic 10553 src/simh/scp.c prefix = helpPrompt (topic->parent, "", oneword); topic 10555 src/simh/scp.c newp = (char *) malloc (strlen (prefix) + 1 + strlen (topic->title) + 1 + topic 10564 src/simh/scp.c if (topic->children) { topic 10565 src/simh/scp.c if (topic->level != 0) topic 10567 src/simh/scp.c newt = (topic->flags & HLP_MAGIC_TOPIC)? topic 10568 src/simh/scp.c topic->title+1: topic->title; topic 10587 src/simh/scp.c static void displayMagicTopic (FILE *st, DEVICE *dptr, TOPIC *topic) topic 10613 src/simh/scp.c if (topic->title) topic 10614 src/simh/scp.c fprintf (st, "%s\n", topic->title+1); topic 10617 src/simh/scp.c if (topic->title) { topic 10618 src/simh/scp.c if (!strcmp (topic->title+1, "Registers")) { topic 10623 src/simh/scp.c if (!strcmp (topic->title+1, "Set commands")) { topic 10628 src/simh/scp.c if (!strcmp (topic->title+1, "Show commands")) { topic 10656 src/simh/scp.c TOPIC *topic, va_list ap ) topic 10660 src/simh/scp.c if (topic->flags & HLP_MAGIC_TOPIC) { topic 10661 src/simh/scp.c fprintf (st, "\n%s ", topic->label); topic 10662 src/simh/scp.c displayMagicTopic (st, dptr, topic); topic 10665 src/simh/scp.c fprintf (st, "\n%s %s\n", topic->label, topic->title); topic 10672 src/simh/scp.c if (topic->text) topic 10673 src/simh/scp.c fputs (topic->text, st); topic 10675 src/simh/scp.c for (i = 0; i < topic->kids; i++) topic 10676 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic->children[i], ap); topic 10684 src/simh/scp.c static size_t matchHelpTopicName (TOPIC *topic, const char *token) topic 10693 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 10694 src/simh/scp.c strcpy (cbuf,topic->children[i]->title + topic 10695 src/simh/scp.c ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0)); topic 10725 src/simh/scp.c TOPIC *topic = ⊤ topic 10830 src/simh/scp.c match = matchHelpTopicName (topic, gbuf); topic 10832 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 10837 src/simh/scp.c fprintf (st, "\n%s is ambiguous in %s\n", gbuf, topic->title); topic 10841 src/simh/scp.c fprintf (st, "\n%s is not available in %s\n", gbuf, topic->title); topic 10844 src/simh/scp.c topic = topic->children[match-1]; topic 10849 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 10862 src/simh/scp.c if (topic->flags & HLP_MAGIC_TOPIC) { topic 10864 src/simh/scp.c displayMagicTopic (st, dptr, topic); topic 10867 src/simh/scp.c fprintf (st, "\n%s\n", topic->title); topic 10873 src/simh/scp.c if (topic->text) topic 10874 src/simh/scp.c fputs (topic->text, st); topic 10876 src/simh/scp.c if (topic->kids) { topic 10882 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 10883 src/simh/scp.c strcpy (tbuf, topic->children[i]->title + topic 10884 src/simh/scp.c ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0)); topic 10889 src/simh/scp.c w += 4 + topic->kidwid; topic 10891 src/simh/scp.c w = 4 + topic->kidwid; topic 10894 src/simh/scp.c fprintf (st, " %-*s", topic->kidwid, tbuf); topic 10898 src/simh/scp.c pstring = helpPrompt (topic, "", TRUE); topic 10910 src/simh/scp.c if (topic->kids == 0) topic 10911 src/simh/scp.c topic = topic->parent; topic 10912 src/simh/scp.c pstring = helpPrompt (topic, prompt[topic->kids != 0], FALSE); topic 10927 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 10931 src/simh/scp.c if (topic->level == 0) topic 10933 src/simh/scp.c topic = topic->parent; topic 10947 src/simh/scp.c if (!topic->kids) { topic 10952 src/simh/scp.c match = matchHelpTopicName (topic, gbuf); topic 10966 src/simh/scp.c topic = topic->children[match-1];