topic 9963 src/simh/scp.c struct topic *parent; topic 9964 src/simh/scp.c struct topic **children; topic 9994 src/simh/scp.c static void appendText (TOPIC *topic, const char *text, size_t len) topic 10001 src/simh/scp.c newt = (char *)realloc (topic->text, topic->len + len +1); topic 10007 src/simh/scp.c topic->text = newt; topic 10008 src/simh/scp.c memcpy (newt + topic->len, text, len); topic 10009 src/simh/scp.c topic->len +=len; topic 10010 src/simh/scp.c newt[topic->len] = '\0'; topic 10016 src/simh/scp.c static void cleanHelp (TOPIC *topic) topic 10021 src/simh/scp.c FREE (topic->title); topic 10022 src/simh/scp.c FREE (topic->text); topic 10023 src/simh/scp.c FREE (topic->label); topic 10024 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 10025 src/simh/scp.c child = topic->children[i]; topic 10029 src/simh/scp.c FREE (topic->children); topic 10036 src/simh/scp.c static TOPIC *buildHelp (TOPIC *topic, DEVICE *dptr, topic 10076 src/simh/scp.c appendText (topic, " ", 4); /* Basic indentation */ topic 10080 src/simh/scp.c appendText (topic, " ", 4); topic 10091 src/simh/scp.c appendText (topic, start, htext - start); /* Flush up to escape */ topic 10098 src/simh/scp.c appendText (topic, buf, strlen (buf)); topic 10103 src/simh/scp.c appendText (topic, dptr->name, strlen (dptr->name)); topic 10106 src/simh/scp.c appendText (topic, sim_name, strlen (sim_name)); topic 10109 src/simh/scp.c appendText (topic, "%", 1); topic 10112 src/simh/scp.c appendText (topic, "+", 1); topic 10141 src/simh/scp.c appendText (topic, start, ep - start); topic 10145 src/simh/scp.c appendText (topic, " ", 4); topic 10152 src/simh/scp.c appendText (topic, start, ep-start); topic 10164 src/simh/scp.c appendText (topic, start, htext - start); topic 10182 src/simh/scp.c FAIL (SCPE_ARG, Invalid topic heading, htext); topic 10185 src/simh/scp.c if (n <= topic->level) { /* Find level for new topic */ topic 10186 src/simh/scp.c while (n <= topic->level) topic 10187 src/simh/scp.c topic = topic->parent; topic 10190 src/simh/scp.c if (n > topic->level +1) { /* Skipping down more than 1 */ topic 10200 src/simh/scp.c FAIL (SCPE_ARG, Missing topic name, htext); topic 10208 src/simh/scp.c FAIL (SCPE_ARG, Null topic name, htext); topic 10253 src/simh/scp.c children = (TOPIC **) realloc (topic->children, topic 10254 src/simh/scp.c (topic->kids +1) * sizeof (TOPIC *)); topic 10262 src/simh/scp.c topic->children = children; topic 10263 src/simh/scp.c topic->children[topic->kids++] = newt; topic 10265 src/simh/scp.c newt->parent = topic; topic 10267 src/simh/scp.c if (n > topic->kidwid) topic 10268 src/simh/scp.c topic->kidwid = n; topic 10269 src/simh/scp.c sprintf (nbuf, ".%u", topic->kids); topic 10270 src/simh/scp.c n = strlen (topic->label) + strlen (nbuf) + 1; topic 10274 src/simh/scp.c topic->children[topic->kids -1] = NULL; topic 10280 src/simh/scp.c sprintf (newt->label, "%s%s", topic->label, nbuf); topic 10281 src/simh/scp.c topic = newt; topic 10297 src/simh/scp.c return topic; topic 10304 src/simh/scp.c static char *helpPrompt ( TOPIC *topic, const char *pstring, t_bool oneword ) topic 10309 src/simh/scp.c if (topic->level == 0) { topic 10319 src/simh/scp.c prefix = helpPrompt (topic->parent, "", oneword); topic 10321 src/simh/scp.c newp = (char *) malloc (strlen (prefix) + 1 + strlen (topic->title) + 1 + topic 10330 src/simh/scp.c if (topic->children) { topic 10331 src/simh/scp.c if (topic->level != 0) topic 10333 src/simh/scp.c newt = (topic->flags & HLP_MAGIC_TOPIC)? topic 10334 src/simh/scp.c topic->title+1: topic->title; topic 10353 src/simh/scp.c static void displayMagicTopic (FILE *st, DEVICE *dptr, TOPIC *topic) topic 10379 src/simh/scp.c if (topic->title) topic 10380 src/simh/scp.c fprintf (st, "%s\n", topic->title+1); topic 10383 src/simh/scp.c if (topic->title) { topic 10384 src/simh/scp.c if (!strcmp (topic->title+1, "Registers")) { topic 10389 src/simh/scp.c if (!strcmp (topic->title+1, "Set commands")) { topic 10394 src/simh/scp.c if (!strcmp (topic->title+1, "Show commands")) { topic 10422 src/simh/scp.c TOPIC *topic, va_list ap ) topic 10426 src/simh/scp.c if (topic->flags & HLP_MAGIC_TOPIC) { topic 10427 src/simh/scp.c fprintf (st, "\n%s ", topic->label); topic 10428 src/simh/scp.c displayMagicTopic (st, dptr, topic); topic 10431 src/simh/scp.c fprintf (st, "\n%s %s\n", topic->label, topic->title); topic 10438 src/simh/scp.c if (topic->text) topic 10439 src/simh/scp.c fputs (topic->text, st); topic 10441 src/simh/scp.c for (i = 0; i < topic->kids; i++) topic 10442 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic->children[i], ap); topic 10450 src/simh/scp.c static size_t matchHelpTopicName (TOPIC *topic, const char *token) topic 10459 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 10460 src/simh/scp.c strcpy (cbuf,topic->children[i]->title + topic 10461 src/simh/scp.c ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0)); topic 10491 src/simh/scp.c TOPIC *topic = ⊤ topic 10596 src/simh/scp.c match = matchHelpTopicName (topic, gbuf); topic 10598 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 10603 src/simh/scp.c fprintf (st, "\n%s is ambiguous in %s\n", gbuf, topic->title); topic 10607 src/simh/scp.c fprintf (st, "\n%s is not available in %s\n", gbuf, topic->title); topic 10610 src/simh/scp.c topic = topic->children[match-1]; topic 10615 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 10628 src/simh/scp.c if (topic->flags & HLP_MAGIC_TOPIC) { topic 10630 src/simh/scp.c displayMagicTopic (st, dptr, topic); topic 10633 src/simh/scp.c fprintf (st, "\n%s\n", topic->title); topic 10639 src/simh/scp.c if (topic->text) topic 10640 src/simh/scp.c fputs (topic->text, st); topic 10642 src/simh/scp.c if (topic->kids) { topic 10648 src/simh/scp.c for (i = 0; i < topic->kids; i++) { topic 10649 src/simh/scp.c strcpy (tbuf, topic->children[i]->title + topic 10650 src/simh/scp.c ((topic->children[i]->flags & HLP_MAGIC_TOPIC)? 1 : 0)); topic 10655 src/simh/scp.c w += 4 + topic->kidwid; topic 10657 src/simh/scp.c w = 4 + topic->kidwid; topic 10660 src/simh/scp.c fprintf (st, " %-*s", topic->kidwid, tbuf); topic 10664 src/simh/scp.c pstring = helpPrompt (topic, "", TRUE); topic 10676 src/simh/scp.c if (topic->kids == 0) topic 10677 src/simh/scp.c topic = topic->parent; topic 10678 src/simh/scp.c pstring = helpPrompt (topic, prompt[topic->kids != 0], FALSE); topic 10693 src/simh/scp.c displayFlatHelp (st, dptr, uptr, flag, topic, ap); topic 10697 src/simh/scp.c if (topic->level == 0) topic 10699 src/simh/scp.c topic = topic->parent; topic 10713 src/simh/scp.c if (!topic->kids) { topic 10718 src/simh/scp.c match = matchHelpTopicName (topic, gbuf); topic 10732 src/simh/scp.c topic = topic->children[match-1];