topic 10644 src/simh/scp.c struct topic *parent; topic 10645 src/simh/scp.c struct topic **children; topic 10675 src/simh/scp.c static void appendText (TOPIC *topic, const char *text, size_t len) topic 10682 src/simh/scp.c newt = (char *)realloc (topic->text, topic->len + len +1); topic 10688 src/simh/scp.c topic->text = newt; topic 10689 src/simh/scp.c memcpy (newt + topic->len, text, len); topic 10690 src/simh/scp.c topic->len +=len; topic 10691 src/simh/scp.c newt[topic->len] = '\0'; topic 10697 src/simh/scp.c static void cleanHelp (TOPIC *topic) topic 10702 src/simh/scp.c FREE (topic->title); topic 10703 src/simh/scp.c FREE (topic->text); topic 10704 src/simh/scp.c FREE (topic->label); topic 10705 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 10706 src/simh/scp.c child = topic->children[i]; topic 10710 src/simh/scp.c FREE (topic->children); topic 10717 src/simh/scp.c static TOPIC *buildHelp (TOPIC *topic, DEVICE *dptr, topic 10757 src/simh/scp.c appendText (topic, " ", 4); /* Basic indentation */ topic 10761 src/simh/scp.c appendText (topic, " ", 4); topic 10772 src/simh/scp.c appendText (topic, start, htext - start); /* Flush up to escape */ topic 10779 src/simh/scp.c appendText (topic, buf, strlen (buf)); topic 10784 src/simh/scp.c appendText (topic, dptr->name, strlen (dptr->name)); topic 10787 src/simh/scp.c appendText (topic, sim_name, strlen (sim_name)); topic 10790 src/simh/scp.c appendText (topic, "%", 1); topic 10793 src/simh/scp.c appendText (topic, "+", 1); topic 10822 src/simh/scp.c appendText (topic, start, ep - start); topic 10826 src/simh/scp.c appendText (topic, " ", 4); topic 10833 src/simh/scp.c appendText (topic, start, ep-start); topic 10845 src/simh/scp.c appendText (topic, start, htext - start); topic 10863 src/simh/scp.c FAIL (SCPE_ARG, Invalid topic heading, htext); topic 10866 src/simh/scp.c if (n <= topic->level) { /* Find level for new topic */ topic 10867 src/simh/scp.c while (n <= topic->level) topic 10868 src/simh/scp.c topic = topic->parent; topic 10871 src/simh/scp.c if (n > topic->level + 1) { /* Skipping down more than 1 */ topic 10881 src/simh/scp.c FAIL (SCPE_ARG, Missing topic name, htext); topic 10889 src/simh/scp.c FAIL (SCPE_ARG, Null topic name, htext); topic 10934 src/simh/scp.c children = (TOPIC **) realloc (topic->children, topic 10935 src/simh/scp.c (topic->kids +1) * sizeof (TOPIC *)); topic 10943 src/simh/scp.c topic->children = children; topic 10944 src/simh/scp.c topic->children[topic->kids++] = newt; topic 10946 src/simh/scp.c newt->parent = topic; topic 10948 src/simh/scp.c if (n > topic->kidwid) topic 10949 src/simh/scp.c topic->kidwid = n; topic 10950 src/simh/scp.c (void)sprintf (nbuf, ".%u", topic->kids); topic 10951 src/simh/scp.c n = strlen (topic->label) + strlen (nbuf) + 1; topic 10955 src/simh/scp.c topic->children[topic->kids -1] = NULL; topic 10961 src/simh/scp.c (void)sprintf (newt->label, "%s%s", topic->label, nbuf); topic 10962 src/simh/scp.c topic = newt; topic 10978 src/simh/scp.c return topic; topic 10985 src/simh/scp.c static char *helpPrompt ( TOPIC *topic, const char *pstring, t_bool oneword ) topic 10990 src/simh/scp.c if (topic->level == 0) { topic 11000 src/simh/scp.c prefix = helpPrompt (topic->parent, "", oneword); topic 11002 src/simh/scp.c newp = (char *) malloc (strlen (prefix) + 1 + strlen (topic->title) + 1 + topic 11011 src/simh/scp.c if (topic->children) { topic 11012 src/simh/scp.c if (topic->level != 0) topic 11014 src/simh/scp.c newt = (topic->flags & HLP_MAGIC_TOPIC)? topic 11015 src/simh/scp.c topic->title+1: topic->title; topic 11034 src/simh/scp.c static void displayMagicTopic (FILE *st, DEVICE *dptr, TOPIC *topic) topic 11061 src/simh/scp.c if (topic->title) topic 11062 src/simh/scp.c (void)fprintf (st, "%s\n", topic->title+1); topic 11065 src/simh/scp.c if (topic->title) { topic 11066 src/simh/scp.c if (!strcmp (topic->title+1, "Registers")) { topic 11071 src/simh/scp.c if (!strcmp (topic->title+1, "Set commands")) { topic 11076 src/simh/scp.c if (!strcmp (topic->title+1, "Show commands")) { topic 11107 src/simh/scp.c TOPIC *topic, va_list ap ) topic 11111 src/simh/scp.c if (topic->flags & HLP_MAGIC_TOPIC) { topic 11112 src/simh/scp.c (void)fprintf (st, "\n%s ", topic->label); topic 11113 src/simh/scp.c displayMagicTopic (st, dptr, topic); topic 11116 src/simh/scp.c (void)fprintf (st, "\n%s %s\n", topic->label, topic->title); topic 11123 src/simh/scp.c if (topic->text) topic 11124 src/simh/scp.c fputs (topic->text, st); topic 11126 src/simh/scp.c for (i = 0; i < topic->kids; i++) topic 11127 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic->children[i], ap); topic 11135 src/simh/scp.c static size_t matchHelpTopicName (TOPIC *topic, const char *token) topic 11144 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 11145 src/simh/scp.c strcpy (cbuf,topic->children[i]->title + topic 11146 src/simh/scp.c ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0)); topic 11175 src/simh/scp.c TOPIC *topic = ⊤ topic 11279 src/simh/scp.c match = matchHelpTopicName (topic, gbuf); topic 11282 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 11287 src/simh/scp.c (void)fprintf (st, "\n%s is ambiguous in %s\n", gbuf, topic->title); topic 11291 src/simh/scp.c (void)fprintf (st, "\n%s is not available in %s\n", gbuf, topic->title); topic 11294 src/simh/scp.c topic = topic->children[match-1]; topic 11299 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 11312 src/simh/scp.c if (topic->flags & HLP_MAGIC_TOPIC) { topic 11314 src/simh/scp.c displayMagicTopic (st, dptr, topic); topic 11317 src/simh/scp.c (void)fprintf (st, "\n%s\n", topic->title); topic 11323 src/simh/scp.c if (topic->text) topic 11324 src/simh/scp.c fputs (topic->text, st); topic 11326 src/simh/scp.c if (topic->kids) { topic 11332 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 11333 src/simh/scp.c strcpy (tbuf, topic->children[i]->title + topic 11334 src/simh/scp.c ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0)); topic 11339 src/simh/scp.c w += 4 + topic->kidwid; topic 11341 src/simh/scp.c w = 4 + topic->kidwid; topic 11344 src/simh/scp.c (void)fprintf (st, " %-*s", (int32_t)topic->kidwid, tbuf); topic 11348 src/simh/scp.c pstring = helpPrompt (topic, "", TRUE); topic 11360 src/simh/scp.c if (topic->kids == 0) topic 11361 src/simh/scp.c topic = topic->parent; topic 11362 src/simh/scp.c pstring = helpPrompt (topic, prompt[topic->kids != 0], FALSE); topic 11377 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 11381 src/simh/scp.c if (topic->level == 0) topic 11383 src/simh/scp.c topic = topic->parent; topic 11397 src/simh/scp.c if (!topic->kids) { topic 11402 src/simh/scp.c match = matchHelpTopicName (topic, gbuf); topic 11416 src/simh/scp.c topic = topic->children[match-1];