Ejemplo n.º 1
0
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, &para_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);
}
Ejemplo n.º 2
0
Local void remember(short s1, short s2, struct LOC_grep *LINK)
{
  if (LINK->index > 9)
    _Escape(9999);
  LINK->p1[LINK->index] = s1;
  LINK->p2[LINK->index] = s2;
  LINK->s = s2 + 1;
  LINK->index++;
}
Ejemplo n.º 3
0
static void _PutRecord(ofstream& os, Array<String>& fields)
{
    for (Uint32 i = 0, n = fields.size(); i < n; i++)
    {
        // Calling getCString to ensure utf-8 goes to the file
        // Calling write to ensure no data conversion by the stream
        CString  buffer = _Escape(fields[i]).getCString();
        os.write((const char *)buffer,
            static_cast<streamsize>(strlen((const char *)buffer)));
        os <<  endl;
    }
    os << endl;
}