void readTopic( fstream& textFile, THelpFile& helpFile ) { TParagraph *p; THelpTopic *topic; TTopicDefinition *topicDef; int i, j, offset; TCrossRef ref; TCrossRefNode *refNode; // Get screen command skipBlankLines(textFile); strcpy(line, getLine(textFile)); topicDef = topicHeader(line); topic = new THelpTopic; // read paragraphs xRefs = 0; offset = 0; p = readParagraph(textFile, offset, xRefs); while (p != 0) { topic->addParagraph(p); p = readParagraph(textFile, offset, xRefs); } i = xRefCount(); topic->setNumCrossRefs(i); refNode = xRefs; for( j = 0; j < i; ++j) { ref.offset = refNode->offset; ref.length = refNode->length; ref.ref = j; topic->setCrossRef(j, ref); refNode = refNode->next; } recordTopicDefinitions(topicDef, helpFile); crossRefHandler = handleCrossRefs; helpFile.putTopic(topic); if (topic != 0) delete topic; if (topicDef != 0) delete topicDef; disposeXRefs(xRefs); skipBlankLines(textFile); }
main(int argc, Char *argv[]) { /* ---- Main program ------------------------ */ PASCAL_MAIN(argc, argv); strcpy(this_version, version); strcpy(this_version_date, version_date); printf("==> This is M-Tx %s (Music from TeXt) %s\n", version, version_date); mtxLevel(version); OpenFiles(); no_commands_yet = true; preambleDefaults(); no_report_errors = false; topOfPMXfile(); do { readParagraph(P, orig_line_no, ¶_len); control_paragraph = isControlParagraph(P, para_len); if (control_paragraph) { augmentPreamble(no_report_errors); no_report_errors = true; if (para_len == 0) error("No music paragraphs!", !print); } } while (control_paragraph); doPreamble(); doMusic(); if (!pmx_preamble_done) error("No music paragraphs!", !print); putLine("% Coded by M-Tx"); CloseFiles(); printf("PrePMX done. Now run PMX.\n"); _Escape(0); exit(EXIT_SUCCESS); }
void DocxReader::readBody() { while (m_xml.readNextStartElement()) { if (m_xml.qualifiedName() == "w:p") { readParagraph(); } else { m_xml.skipCurrentElement(); } } }
Static void doMusic(void) { Char STR1[256], STR2[256]; Char STR4[256]; first_paragraph = true; pmx_preamble_done = false; bar_no = 1; *repeat_sign = '\0'; must_respace = false; must_restyle = false; do { final_paragraph = endOfInfile(); memcpy(orig_P, P, sizeof(paragraph)); if (para_len > 0 && !ignore_input && thisCase()) { if (no_commands_yet) { interpretCommands(); printFeatures(false); one_beat = 64 / meterdenom; full_bar = meternum * one_beat; if (nvoices > standardPMXvoices) { sprintf(STR4, "You have %s voices; standard PMX can only handle %s", toString(STR1, nvoices), toString(STR2, standardPMXvoices)); warning(STR4, !print); } initMTX(); initUptext(); initStatus(); initLyrics(); no_commands_yet = false; } if (startsWithBracedWord(P[0])) lyricsParagraph(); else { musicParagraph(); first_paragraph = false; writeRepeat(repeat_sign); } } readParagraph(P, orig_line_no, ¶_len); } while (para_len != 0); }