diff -Nru abcm2ps-7.8.9/abc2ps.c abcm2ps-8.14.2/abc2ps.c --- abcm2ps-7.8.9/abc2ps.c 2014-03-26 08:08:20.000000000 +0000 +++ abcm2ps-8.14.2/abc2ps.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,980 +0,0 @@ -/* - * abcm2ps: a program to typeset tunes written in ABC format using PostScript - * - * Copyright (C) 1998-2014 Jean-François Moine (http://moinejf.free.fr) - * - * Adapted from abc2ps-1.2.5: - * Copyright (C) 1996,1997 Michael Methfessel (msm@ihp-ffo.de) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - */ - -#include -#include -#include -#include -#include -#include -#include -#ifdef linux -#include -#endif - -#include "abc2ps.h" -#include "front.h" - -/* -- global variables -- */ - -INFO info; -unsigned char deco[256]; -struct SYMBOL *sym; /* (points to the symbols of the current voice) */ - -int tunenum; /* number of current tune */ -int pagenum = 1; /* current page in output file */ - - /* switches modified by command line flags: */ -int quiet; /* quiet mode */ -int secure; /* secure mode */ -int annotate; /* output source references */ -int pagenumbers; /* write page numbers */ -int epsf; /* for EPSF (1) or SVG (2) output */ -int svg; /* SVG (1) or XML (2 - HTML + SVG) output */ -int showerror; /* show the errors */ - -char outfn[FILENAME_MAX]; /* output file name */ -int file_initialized; /* for output file */ -FILE *fout; /* output file */ -char *in_fname; /* current input file name */ -time_t mtime; /* last modification time of the input file */ -static time_t fmtime; /* " " of all files */ - -int s_argc; /* command line arguments */ -char **s_argv; - -struct tblt_s *tblts[MAXTBLT]; -struct cmdtblt_s cmdtblts[MAXCMDTBLT]; -int ncmdtblt; - -/* -- local variables -- */ - -static char abc_fn[FILENAME_MAX]; /* buffer for ABC file name */ -static char *styd = DEFAULT_FDIR; /* format search directory */ -static int def_fmt_done = 0; /* default format read */ -static struct SYMBOL notitle; - -/* memory arena (for clrarena, lvlarena & getarena) */ -#define MAXAREAL 3 /* max area levels: - * 0; global, 1: tune, 2: generation */ -#define AREANASZ 8192 /* standard allocation size */ -#define MAXAREANASZ 0x20000 /* biggest allocation size */ -static int str_level; /* current arena level */ -static struct str_a { - struct str_a *n; /* next area */ - char *p; /* pointer in area */ - int r; /* remaining space in area */ - int sz; /* size of str[] */ - char str[2]; /* start of memory area */ -} *str_r[MAXAREAL], *str_c[MAXAREAL]; /* root and current area pointers */ - -/* -- local functions -- */ -static void read_def_format(void); -static void treat_file(char *fn, char *ext); - -static FILE *open_ext(char *fn, char *ext) -{ - FILE *fp; - char *p; - - if ((fp = fopen(fn, "rb")) != NULL) - return fp; - if ((p = strrchr(fn, DIRSEP)) == NULL) - p = fn; - if (strrchr(p, '.') != NULL) - return NULL; - strcat(p, "."); - strcat(p, ext); - if ((fp = fopen(fn, "rb")) != NULL) - return fp; - return NULL; -} - -/* -- open a file for reading -- */ -FILE *open_file(char *fn, /* file name */ - char *ext, /* file type */ - char *rfn) /* returned real file name */ -{ - FILE *fp; - char *p; - int l; - - /* if there was some ABC file, try its directory */ - if (in_fname && in_fname != fn - && (p = strrchr(in_fname, DIRSEP)) != NULL) { - l = p - in_fname + 1; - strncpy(rfn, in_fname, l); - strcpy(&rfn[l], fn); - if ((fp = open_ext(rfn, ext)) != NULL) - return fp; - } - - /* try locally */ - strcpy(rfn, fn); - if ((fp = open_ext(rfn, ext)) != NULL) - return fp; - - /* try a format in the format directory */ - if (*ext != 'f' || *styd == '\0') - return NULL; - l = strlen(styd) - 1; - if (styd[l] == DIRSEP) - sprintf(rfn, "%s%s", styd, fn); - else - sprintf(rfn, "%s%c%s", styd, DIRSEP, fn); - return open_ext(rfn, ext); -} - -/* -- read a whole input file -- */ -/* the real/full file name is put in tex_buf[] */ -static char *read_file(char *fn, char *ext) -{ - size_t fsize; - FILE *fin; - char *file; - - if (*fn == '\0') { - strcpy(tex_buf, "stdin"); - fsize = 0; - file = malloc(8192); - for (;;) { - int l; - - l = fread(&file[fsize], 1, 8192, stdin); - fsize += l; - if (l != 8192) - break; - file = realloc(file, fsize + 8192); - } - if (ferror(stdin) != 0) { - free(file); - return 0; - } - if (fsize % 8192 == 0) - file = realloc(file, fsize + 2); - time(&fmtime); - } else { - struct stat sbuf; - - fin = open_file(fn, ext, tex_buf); - if (!fin) - return NULL; - if (fseek(fin, 0L, SEEK_END) < 0) { - fclose(fin); - return NULL; - } - fsize = ftell(fin); - rewind(fin); - if ((file = malloc(fsize + 2)) == NULL) { - fclose(fin); - return NULL; - } - - if (fread(file, 1, fsize, fin) != fsize) { - fclose(fin); - free(file); - return NULL; - } - fstat(fileno(fin), &sbuf); - memcpy(&fmtime, &sbuf.st_mtime, sizeof fmtime); - fclose(fin); - } - file[fsize] = '\0'; - return file; -} - -/* call back to handle %%format/%%abc-include - see front.c */ -static void include_cb(unsigned char *fn) -{ - char abc_fn_sav[FILENAME_MAX]; - - strcpy(abc_fn_sav, abc_fn); - treat_file((char *) fn, "fmt"); - strcpy(abc_fn, abc_fn_sav); -} - -/* -- treat an input file and generate the ABC file -- */ -static void treat_file(char *fn, char *ext) -{ - struct abctune *t; - char *file, *file2; - int file_type, l; - static int nbfiles; - - if (nbfiles > 2) { - error(1, 0, "Too many included files"); - return; - } - - /* initialize if not already done */ - if (!fout) - read_def_format(); - - /* read the file into memory */ - /* the real/full file name is in tex_buf[] */ - if ((file = read_file(fn, ext)) == NULL) { - if (strcmp(fn, "default.fmt") != 0) { - error(1, NULL, "Cannot read the input file '%s'", fn); -#if defined(unix) || defined(__unix__) - perror(" read_file"); -#endif - } - return; - } - if (!quiet) - fprintf(stderr, "File %s\n", tex_buf); - - /* convert the strings */ - l = strlen(tex_buf); - if (strcmp(&tex_buf[l - 3], ".ps") == 0) { - file_type = FE_PS; - frontend((unsigned char *) "%%beginps\n", 0); - } else if (strcmp(&tex_buf[l - 4], ".fmt") == 0) { - file_type = FE_FMT; - } else { - file_type = FE_ABC; - strcpy(abc_fn, tex_buf); - in_fname = abc_fn; - mtime = fmtime; - } - - nbfiles++; - file2 = (char *) frontend((unsigned char *) file, file_type); - nbfiles--; - free(file); - - if (file_type == FE_PS) /* PostScript file */ - file2 = (char *) frontend((unsigned char *) "%%endps", 0); - - if (nbfiles > 0) /* if %%format */ - return; /* don't free the preprocessed buffer */ - -// memcpy(&deco_tune, &deco_glob, sizeof deco_tune); - if (file_type == FE_ABC) { /* if ABC file */ -// if (!epsf) -// open_output_file(); - clrarena(1); /* clear previous tunes */ - } - t = abc_parse(file2); - free(file2); - front_init(0, 0, include_cb); /* reinit the front-end */ - if (!t) { - if (file_type == FE_ABC) - error(1, NULL, "File '%s' is empty!", tex_buf); - return; - } - - while (t) { - if (t->first_sym) /*fixme:last tune*/ - do_tune(t); /* generate */ - t = t->next; - } -/* abc_free(t); (useless) */ -} - -/* -- read the default format -- */ -static void read_def_format(void) -{ - if (def_fmt_done) - return; - def_fmt_done = 1; - treat_file("default.fmt", "fmt"); -} - -/* -- set extension on a file name -- */ -void strext(char *fn, char *ext) -{ - char *p, *q; - - if ((p = strrchr(fn, DIRSEP)) == NULL) - p = fn; - if ((q = strrchr(p, '.')) == NULL) - strcat(p, "."); - else - q[1] = '\0'; - strcat(p, ext); -} - -/* -- write the program version -- */ -static void display_version(int full) -{ - fputs("abcm2ps-" VERSION " (" VDATE ")\n", stderr); - if (!full) - return; - fputs("Compiled: " __DATE__ "\n" - "Options:" -#ifdef A4_FORMAT - " A4_FORMAT" -#endif -#ifdef DECO_IS_ROLL - " DECO_IS_ROLL" -#endif -#ifdef HAVE_PANGO - " PANGO" -#endif -#if !defined(A4_FORMAT) && !defined(DECO_IS_ROLL) && !defined(HAVE_PANGO) - " NONE" -#endif - "\n", stderr); - if (styd[0] != '\0') - fprintf(stderr, "Default format directory: %s\n", styd); -} - -/* -- display usage and exit -- */ -static void usage(void) -{ - display_version(0); - printf( "ABC to Postscript translator.\n" - "Usage: abcm2ps [options] file [file_options] ..\n" - "where:\n" - " file input ABC file, or '-'\n" - " options and file_options:\n" - " .output file options:\n" - " -E produce EPSF output, one tune per file\n" - " -g produce SVG output, one tune per file\n" - " -v produce SVG output, one page per file\n" - " -X produce SVG output in one XHTML file\n" - " -O fff set outfile name to fff\n" - " -O = make outfile name from infile/title\n" - " -i indicate where are the errors\n" - " -k kk size of the PS output buffer in Kibytes\n" - " .output formatting:\n" - " -s xx set scale factor to xx\n" - " -w xx set staff width (cm/in/pt)\n" - " -m xx set left margin (cm/in/pt)\n" - " -d xx set staff separation (cm/in/pt)\n" - " -a xx set max shrinkage to xx (between 0 and 1)\n" - " -F foo read format file \"foo.fmt\"\n" - " -D bar look for format files in directory \"bar\"\n" - " .output options:\n" - " -l landscape mode\n" - " -I xx indent 1st line (cm/in/pt)\n" - " -x add xref numbers in titles\n" - " -M don't output the lyrics\n" - " -N n set page numbering mode to n=\n" - " 0=off 1=left 2=right 3=even left,odd right 4=even right,odd left\n" - " -1 write one tune per page\n" - " -G no slur in grace notes\n" - " -j n[b] number the measures every n bars (or on the left if n=0)\n" - " if 'b', display in a box\n" - " -b n set the first measure number to n\n" - " -f have flat beams\n" - " -T n[v] output the tablature 'n' for voice 'v' / all voices\n" - " .line breaks:\n" - " -c auto line break\n" - " -B n break every n bars\n" - " .input file selection/options:\n" - " -e pattern\n" - " tune selection\n" - " .help/configuration:\n" - " -V show program version\n" - " -h show this command summary\n" - " -H show the format parameters\n" - " -S secure mode\n" - " -q quiet mode\n"); - exit(EXIT_SUCCESS); -} - -#ifdef linux -/* -- where is the default format directory -- */ -static void wherefmtdir(void) -{ - char exe[512], *p; - FILE *f; - int l; - - if ((l = readlink("/proc/self/exe", exe, sizeof exe)) <= 0) - return; - if ((p = strrchr(exe, '/')) == NULL) - return; - p++; - if (p > &exe[5] && strncmp(p - 5, "/bin", 4) == 0) { - strcpy(p - 4, "share/abcm2ps/"); - p += -4 + 14; - } - /* else, assume this is the source directory */ - - /* check if a format file is present */ - strcpy(p, "tight.fmt"); - if ((f = fopen(exe, "r")) == NULL) - return; - fclose(f); - - /* change the format directory */ - p[-1] = '\0'; - styd = strdup(exe); -} -#endif - -/* -- parse the tablature command ('-T n[v]') -- */ -static struct cmdtblt_s *cmdtblt_parse(char *p) -{ - struct cmdtblt_s *cmdtblt; - short val; - - if (ncmdtblt >= MAXCMDTBLT) { - error(1, NULL, "++++ Too many '-T'"); - return NULL; - } - if (*p == '\0') - val = -1; - else { - val = *p++ - '0' - 1; - if ((unsigned) val > MAXTBLT) { - error(1, NULL, "++++ Bad tablature number in '-T'\n"); - return 0; - } - } - cmdtblt = &cmdtblts[ncmdtblt++]; - cmdtblt->index = val; - cmdtblt->vn = p; - return cmdtblt; -} - -/* set a command line option */ -static void set_opt(char *w, char *v) -{ - static char prefix = '%'; /* pseudo-comment prefix */ - - if (!v) - v = ""; - if (strlen(w) + strlen(v) >= TEX_BUF_SZ - 10) { - error(1, NULL, "Command line '%s' option too long", w); - return; - } - sprintf(tex_buf, /* this buffer is available */ - "%%%c%s %s lock\n", prefix, w, v); - if (strcmp(w, "abcm2ps") == 0) - prefix = *v; - frontend((unsigned char *) tex_buf, 0); -} - -/* -- main program -- */ -int main(int argc, char **argv) -{ - unsigned j; - char *p, c, *aaa; - - if (argc <= 1) - usage(); - - /* set the global flags */ - s_argc = argc; - s_argv = argv; - aaa = NULL; - while (--argc > 0) { - argv++; - p = *argv; - if (*p != '-' || p[1] == '-') { - if (*p == '+' && p[1] == 'F') /* +F : no default format */ - def_fmt_done = 1; - continue; - } - while ((c = *++p) != '\0') { /* '-xxx' */ - switch (c) { - case 'E': - svg = 0; /* EPS */ - epsf = 1; - break; - case 'g': - svg = 0; /* SVG one file per tune */ - epsf = 2; - break; - case 'h': - usage(); /* no return */ - case 'q': - quiet = 1; - break; - case 'S': - secure = 1; - break; - case 'V': - display_version(1); - return EXIT_SUCCESS; - case 'v': - svg = 1; /* SVG one file per pagee */ - epsf = 0; - break; - case 'X': - svg = 2; /* SVG/XHTML */ - epsf = 0; - break; - case 'k': - if (p[1] == '\0') { - if (--argc <= 0) { - error(1, NULL, "No value for '-k' - aborting"); - return EXIT_FAILURE; - } - aaa = *++argv; - } else { - aaa = p + 1; - p += strlen(p) - 1; - } - break; - default: - if (strchr("aBbDdeFfIjmNOsTw", c)) /* if with arg */ - p += strlen(p) - 1; /* skip */ - break; - } - } - } - if (!quiet) - display_version(0); - - /* initialize */ - outfn[0] = '\0'; - clrarena(0); /* global */ - clrarena(1); /* tunes */ - clrarena(2); /* generation */ - if (aaa) { /* '-k' output buffer size */ - int kbsz; - - sscanf(aaa, "%d", &kbsz); - init_outbuf(kbsz); - } else { - init_outbuf(0); - } - abc_init(getarena, /* alloc */ - 0, /* free */ - (void (*)(int level)) lvlarena, /* new level */ - sizeof(struct SYMBOL) - sizeof(struct abcsym), - 0); /* don't keep comments */ -// memset(&info, 0, sizeof info); - info['T' - 'A'] = ¬itle; - notitle.as.text = "T:"; - set_format(); - reset_deco(); - front_init(0, 0, include_cb); - -#ifdef linux - /* if not set, try to find where is the default format directory */ - if (styd[0] == '\0') - wherefmtdir(); -#endif -#ifdef HAVE_PANGO - pg_init(); -#endif - - /* parse the arguments - finding a new file, treat the previous one */ - argc = s_argc; - argv = s_argv; - while (--argc > 0) { - argv++; - p = *argv; - if ((c = *p) == '\0') - continue; - if (c == '-') { - int i; - - if (p[1] == '\0') { /* '-' alone */ - if (in_fname) { - treat_file(in_fname, "abc"); - frontend((unsigned char *) "select\n", 0); - } - in_fname = ""; /* read from stdin */ - continue; - } - i = strlen(p) - 1; - if (p[i] == '-' - && p[1] != '-' -//fixme: 'e' may be preceded by other options - && p[1] != 'e' - && p[i -1] != 'O') - c = '+'; /* switch off flags with '-x-' */ - } - if (c == '+') { /* switch off flags with '+' */ - while (*++p != '\0') { - switch (*p) { - case '-': - break; - case 'B': - cfmt.barsperstaff = 0; - lock_fmt(&cfmt.barsperstaff); - break; - case 'c': - cfmt.continueall = 0; - lock_fmt(&cfmt.continueall); - break; - case 'F': -// def_fmt_done = 1; - break; - case 'G': - cfmt.graceslurs = 1; - lock_fmt(&cfmt.graceslurs); - break; - case 'i': - showerror = 0; - break; - case 'j': - cfmt.measurenb = -1; - lock_fmt(&cfmt.measurenb); - break; - case 'l': - cfmt.landscape = 0; - lock_fmt(&cfmt.landscape); - break; - case 'M': - cfmt.fields[1] = 1 << ('w' - 'a'); - lock_fmt(&cfmt.fields); - break; - case 'N': - pagenumbers = 0; - break; - case 'O': - outfn[0] = '\0'; - break; - case 'T': { - struct cmdtblt_s *cmdtblt; - - aaa = p + 1; - if (*aaa == '\0') { - if (argc > 1 - && argv[1][0] != '-') { - aaa = *++argv; - argc--; - } - } else { - while (p[1] != '\0') /* stop */ - p++; - if (*p == '-') - *p-- = '\0'; /* (not clean) */ - } - cmdtblt = cmdtblt_parse(aaa); - if (cmdtblt != 0) - cmdtblt->active = 0; - break; - } - case 'x': - cfmt.fields[0] &= ~(1 << ('X' - 'A')); - lock_fmt(&cfmt.fields); - break; - case '0': - cfmt.splittune = 0; - lock_fmt(&cfmt.splittune); - break; - case '1': - cfmt.oneperpage = 0; - lock_fmt(&cfmt.oneperpage); - break; - default: - error(1, NULL, - "++++ Cannot switch off flag: +%c", - *p); - break; - } - } - continue; - } - - if (c == '-') { /* interpret a flag with '-' */ - if (p[1] == '-') { /* long argument */ - p += 2; - if (--argc <= 0) { - error(1, NULL, "No argument for '--'"); - return EXIT_FAILURE; - } - argv++; - set_opt(p, *argv); - continue; - } - while ((c = *++p) != '\0') { - switch (c) { - - /* simple flags */ - case 'A': - annotate = 1; - break; - case 'c': - cfmt.continueall = 1; - lock_fmt(&cfmt.continueall); - break; - case 'E': - break; - case 'f': - cfmt.flatbeams = 1; - lock_fmt(&cfmt.flatbeams); - break; - case 'G': - cfmt.graceslurs = 0; - lock_fmt(&cfmt.graceslurs); - break; - case 'g': - break; - case 'H': - if (!fout) { - read_def_format(); - make_font_list(); - } - print_format(); - return EXIT_SUCCESS; - case 'i': - showerror = 1; - break; - case 'l': - cfmt.landscape = 1; - lock_fmt(&cfmt.landscape); - break; - case 'M': - cfmt.fields[1] &= ~(1 << ('w' - 'a')); - lock_fmt(&cfmt.fields); - break; - case 'q': - case 'S': - break; - case 'v': - case 'X': - break; - case 'x': - cfmt.fields[0] |= 1 << ('X' - 'A'); - lock_fmt(&cfmt.fields); - break; - case '0': - cfmt.splittune = 1; - lock_fmt(&cfmt.splittune); - break; - case '1': - cfmt.oneperpage = 1; - lock_fmt(&cfmt.oneperpage); - break; - - /* flag with optional parameter */ - case 'N': - if (p[1] == '\0' - && (argc <= 1 - || !isdigit((unsigned) argv[1][0]))) { - pagenumbers = 2; /* old behaviour */ - break; - } - /* fall thru */ - /* flags with parameter.. */ - case 'a': - case 'B': - case 'b': - case 'D': - case 'd': - case 'e': - case 'F': - case 'I': - case 'j': - case 'k': - case 'L': - case 'm': - case 'O': - case 's': - case 'T': - case 'w': - aaa = p + 1; - if (*aaa == '\0') { - aaa = *++argv; - if (--argc <= 0 - || (*aaa == '-' && c != 'O')) { - error(1, NULL, - "Missing parameter after '-%c' - aborting", - c); - return EXIT_FAILURE; - } - } else { - p += strlen(p) - 1; /* stop */ - } - - if (strchr("BbfjkNs", c)) { /* check num args */ - for (j = 0; j < strlen(aaa); j++) { - if (!strchr("0123456789.", - aaa[j])) { - if (aaa[j] == 'b' - && aaa[j + 1] == '\0' - && c == 'j') - break; - error(1, NULL, - "Invalid parameter <%s> for flag -%c", - aaa, c); - return EXIT_FAILURE; - } - } - } - - switch (c) { - case 'a': - set_opt("maxshrink", aaa); - break; - case 'B': - set_opt("barsperstaff", aaa); - break; - case 'b': - set_opt("measurefirst", aaa); - break; - case 'D': - styd = aaa; - break; - case 'd': - set_opt("staffsep", aaa); - break; - case 'e': - set_opt("select", aaa); - break; - case 'F': - treat_file(aaa, "fmt"); - break; - case 'I': - set_opt("indent", aaa); - break; - case 'j': - sscanf(aaa, "%d", &cfmt.measurenb); - lock_fmt(&cfmt.measurenb); - if (aaa[strlen(aaa) - 1] == 'b') - cfmt.measurebox = 1; - else - cfmt.measurebox = 0; - lock_fmt(&cfmt.measurebox); - break; - case 'k': - break; - case 'm': - set_opt("leftmargin", aaa); - break; - case 'N': - sscanf(aaa, "%d", &pagenumbers); - if ((unsigned) pagenumbers > 4) { - error(1, NULL, - "'-N' value %s - changed to 2", - aaa); - pagenumbers = 2; - } - break; - case 'O': - if (strlen(aaa) >= sizeof outfn) { - error(1, NULL, "'-O' too large - aborting"); - exit(EXIT_FAILURE); - } - strcpy(outfn, aaa); - break; - case 's': - set_opt("scale", aaa); - break; - case 'T': { - struct cmdtblt_s *cmdtblt; - - cmdtblt = cmdtblt_parse(aaa); - if (cmdtblt) - cmdtblt->active = 1; - break; - } - case 'w': - set_opt("staffwidth", aaa); - break; - } - break; - default: - error(1, NULL, - "Unknown flag: -%c ignored", c); - break; - } - } - continue; - } - - if (in_fname) { - treat_file(in_fname, "abc"); - frontend((unsigned char *) "select\n", 0); - } - in_fname = p; - } - - if (in_fname) - treat_file(in_fname, "abc"); - if (multicol_start != 0) { /* lack of %%multicol end */ - error(1, NULL, "Lack of %%%%multicol end"); - multicol_start = 0; - buffer_eob(); - if (!info['X' - 'A'] - && !epsf) - write_buffer(); - } - if (!epsf && !fout) { - error(1, NULL, "No input file specified"); - return EXIT_FAILURE; - } - close_output_file(); - return severity == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -/* -- arena routines -- */ -void clrarena(int level) -{ - struct str_a *a_p; - - if ((a_p = str_r[level]) == NULL) { - str_r[level] = a_p = malloc(sizeof *str_r[0] + AREANASZ - 2); - a_p->sz = AREANASZ; - a_p->n = 0; - } - str_c[level] = a_p; - a_p->p = a_p->str; - a_p->r = sizeof a_p->str; -} - -int lvlarena(int level) -{ - int old_level; - - old_level = str_level; - str_level = level; - return old_level; -} - -/* The area is 8 bytes aligned to handle correctly int and pointers access - * on some machines as Sun Sparc. */ -void *getarena(int len) -{ - char *p; - struct str_a *a_p; - - a_p = str_c[str_level]; - len = (len + 7) & ~7; /* align at 64 bits boundary */ - if (len > a_p->r) { - if (len > MAXAREANASZ) { - error(1, NULL, - "getarena - data too wide %d - aborting", - len); - exit(EXIT_FAILURE); - } - if (len > AREANASZ) { /* big allocation */ - struct str_a *a_n; - - a_n = a_p->n; - a_p->n = malloc(sizeof *str_r[0] + len - 2); - a_p->n->n = a_n; - a_p->n->sz = len; - } else if (a_p->n == 0) { /* standard allocation */ - a_p->n = malloc(sizeof *str_r[0] + AREANASZ - 2); - a_p->n->n = 0; - a_p->n->sz = AREANASZ; - } - str_c[str_level] = a_p = a_p->n; - a_p->p = a_p->str; - a_p->r = a_p->sz; - } - p = a_p->p; - a_p->p += len; - a_p->r -= len; - return p; -} diff -Nru abcm2ps-7.8.9/abc2ps.h abcm2ps-8.14.2/abc2ps.h --- abcm2ps-7.8.9/abc2ps.h 2014-04-01 18:23:39.000000000 +0000 +++ abcm2ps-8.14.2/abc2ps.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,614 +0,0 @@ -/* -- general macros -- */ - -#include -#include - -#include "config.h" -#include "abcparse.h" - -#define OUTPUTFILE "Out.ps" /* standard output file */ -#ifndef WIN32 -#define DIRSEP '/' -#else -#define DIRSEP '\\' -#endif - -#define CM * 28.35 /* factor to transform cm to pt */ -#define PT /* factor to transform pt to pt */ -#define IN * 72.0 /* factor to transform inch to pt */ - -/* basic page dimensions */ -#ifdef A4_FORMAT -#define PAGEHEIGHT (29.7 CM) -#define PAGEWIDTH (21.0 CM) -#define MARGIN (1.8 CM) -#else -#define PAGEHEIGHT (11.0 IN) -#define PAGEWIDTH (8.5 IN) -#define MARGIN (0.7 IN) -#endif - -/* -- macros controlling music typesetting -- */ - -#define STEM_YOFF 1.0 /* offset stem from note center */ -#define STEM_XOFF 3.5 -#define STEM 20 /* default stem height */ -#define STEM_MIN 16 /* min stem height under beams */ -#define STEM_MIN2 14 /* ... for notes with two beams */ -#define STEM_MIN3 12 /* ... for notes with three beams */ -#define STEM_MIN4 10 /* ... for notes with four beams */ -#define STEM_CH_MIN 14 /* min stem height for chords under beams */ -#define STEM_CH_MIN2 10 /* ... for notes with two beams */ -#define STEM_CH_MIN3 9 /* ... for notes with three beams */ -#define STEM_CH_MIN4 9 /* ... for notes with four beams */ -#define BEAM_DEPTH 3.2 /* width of a beam stroke */ -#define BEAM_OFFSET 0.25 /* pos of flat beam relative to staff line */ -#define BEAM_SHIFT 5.0 /* shift of second and third beams */ -/* To align the 4th beam as the 1st: shift=6-(depth-2*offset)/3 */ -#define BEAM_FLATFAC 0.6 /* factor to decrease slope of long beams */ -#define BEAM_THRESH 0.06 /* flat beam if slope below this threshold */ -#define BEAM_SLOPE 0.5 /* max slope of a beam */ -#define BEAM_STUB 6.0 /* length of stub for flag under beam */ -#define SLUR_SLOPE 1.0 /* max slope of a slur */ -#define DOTSHIFT 5 /* dot shift when up flag on note */ -#define GSTEM 14 /* grace note stem length */ -#define GSTEM_XOFF 1.6 /* x offset for grace note stem */ - -#define BETA_C 0.1 /* max expansion for flag -c */ -#define BETA_X 1.0 /* max expansion before complaining */ - -#define VOCPRE 0.4 /* portion of vocals word before note */ -#define GCHPRE 0.4 /* portion of guitar chord before note */ - -/* -- Parameters for note spacing -- */ -/* fnn multiplies the spacing under a beam, to compress the notes a bit */ - -#define fnnp 0.9 - -/* -- macros for program internals -- */ - -#define STRL1 256 /* string length for file names */ -#define MAXSTAFF 16 /* max staves */ -#define BSIZE 512 /* buffer size for one input string */ - -#define BREVE (BASE_LEN * 2) /* double note (square note) */ -#define SEMIBREVE BASE_LEN /* whole note */ -#define MINIM (BASE_LEN / 2) /* half note (white note) */ -#define CROTCHET (BASE_LEN / 4) /* quarter note (black note) */ -#define QUAVER (BASE_LEN / 8) /* 1/8 note */ -#define SEMIQUAVER (BASE_LEN / 16) /* 1/16 note */ - -#define MAXFONTS 30 /* max number of fonts */ - -#define T_LEFT 0 -#define T_JUSTIFY 1 -#define T_FILL 2 -#define T_CENTER 3 -#define T_SKIP 4 -#define T_RIGHT 5 - -#define YSTEP 128 /* number of steps for y offsets */ - -extern unsigned char deco[256]; - -struct FONTSPEC { - int fnum; /* index to font tables in format.c */ - float size; - float swfac; -}; -extern char *fontnames[MAXFONTS]; /* list of font names */ - -/* lyrics */ -#define LY_HYPH 0x10 /* replacement character for hyphen */ -#define LY_UNDER 0x11 /* replacement character for underscore */ -#define MAXLY 16 /* max number of lyrics */ -struct lyl { - struct FONTSPEC *f; /* font */ - float w; /* width */ - float s; /* shift / note */ - char t[1]; /* word */ -}; -struct lyrics { - struct lyl *lyl[MAXLY]; /* ptr to lyric lines */ -}; - -/* guitar chord / annotations */ -#define MAXGCH 8 /* max number of guitar chords / annotations */ -struct gch { - char type; /* ann. char, 'g' gchord, 'r' repeat, '\0' end */ - unsigned char idx; /* index in as.text */ - unsigned char font; /* font */ - char box; /* 1 if in box */ - float x, y; /* x y offset / note + (top or bottom) of staff */ - float w; /* width */ -}; - -/* positions / directions */ -/* 0: auto, 1: above/up (SL_ABOVE), 2: below/down (SL_BELOW) - * 3: hidden (SL_AUTO) or opposite for gstemdir */ -#define SL_HIDDEN SL_AUTO -struct posit_s { - unsigned short dyn:2; /* %%dynamic */ - unsigned short gch:2; /* %%gchord */ - unsigned short orn:2; /* %%ornament */ - unsigned short voc:2; /* %%vocal */ - unsigned short vol:2; /* %%volume */ - unsigned short std:2; /* %%stemdir */ - unsigned short gsd:2; /* %%gstemdir */ -}; - -/* music element */ -struct SYMBOL { /* struct for a drawable symbol */ - struct abcsym as; /* abc symbol !!must be the first field!! */ - struct SYMBOL *next, *prev; /* voice linkage */ - struct SYMBOL *ts_next, *ts_prev; /* time linkage */ - struct SYMBOL *extra; /* extra symbols (grace notes, tempo... */ - unsigned char type; /* symbol type */ -#define NO_TYPE 0 /* invalid type */ -#define NOTEREST 1 /* valid symbol types */ -#define SPACE 2 -#define BAR 3 -#define CLEF 4 -#define TIMESIG 5 -#define KEYSIG 6 -#define TEMPO 7 -#define STAVES 8 -#define MREST 9 -#define PART 10 -#define GRACE 11 -#define FMTCHG 12 -#define TUPLET 13 -#define STBRK 14 -#define CUSTOS 15 -#define NSYMTYPES 16 - unsigned char voice; /* voice (0..nvoice) */ - unsigned char staff; /* staff (0..nstaff) */ - unsigned char nhd; /* number of notes in chord - 1 */ - int dur; /* main note duration */ - signed char pits[MAXHD]; /* pitches for notes */ - int time; /* starting time */ - unsigned int sflags; /* symbol flags */ -#define S_EOLN 0x0001 /* end of line */ -#define S_BEAM_ST 0x0002 /* beam starts here */ -#define S_BEAM_BR1 0x0004 /* 2nd beam must restart here */ -#define S_BEAM_BR2 0x0008 /* 3rd beam must restart here */ -#define S_BEAM_END 0x0010 /* beam ends here */ -#define S_OTHER_HEAD 0x0020 /* don't draw any note head */ -#define S_IN_TUPLET 0x0040 /* in a tuplet */ -#define S_TREM2 0x0080 /* tremolo on 2 notes */ -#define S_RRBAR 0x0100 /* right repeat bar (when bar) */ -#define S_XSTEM 0x0200 /* cross-staff stem (when note) */ -#define S_BEAM_ON 0x0400 /* continue beaming */ -#define S_SL1 0x0800 /* some chord slur start */ -#define S_SL2 0x1000 /* some chord slur end */ -#define S_TI1 0x2000 /* some chord tie start */ -#define S_PERC 0x4000 /* percussion */ -#define S_RBSTOP 0x8000 /* repeat bracket stop */ -#define S_FEATHERED_BEAM 0x00010000 /* feathered beam */ -#define S_REPEAT 0x00020000 /* sequence / measure repeat */ -#define S_NL 0x00040000 /* start of new music line */ -#define S_SEQST 0x00080000 /* start of vertical sequence */ -#define S_SECOND 0x00100000 /* symbol on a secondary voice */ -#define S_FLOATING 0x00200000 /* symbol on a floating voice */ -#define S_NOREPBRA 0x00400000 /* don't print the repeat bracket */ -#define S_TREM1 0x00800000 /* tremolo on 1 note */ -#define S_TEMP 0x01000000 /* temporary symbol */ -#define S_SHIFTUNISON_1 0x02000000 /* %%shiftunison 1 */ -#define S_SHIFTUNISON_2 0x04000000 /* %%shiftunison 2 */ - struct posit_s posit; /* positions / directions */ - signed char stem; /* 1 / -1 for stem up / down */ - signed char nflags; /* number of note flags when > 0 */ - char dots; /* number of dots */ - unsigned char head; /* head type */ -#define H_FULL 0 -#define H_EMPTY 1 -#define H_OVAL 2 -#define H_SQUARE 3 - signed char multi; /* multi voice in the staff (+1, 0, -1) */ - signed char nohdix; /* no head index (for unison) */ - short u; /* auxillary information: - * - CLEF: small clef - * - KEYSIG: old key signature - * - BAR: new bar number - * - TUPLET: tuplet format - * - NOTE: tremolo number / feathered beam - * - FMTCHG (format change): subtype */ -#define PSSEQ 0 /* postscript sequence */ -#define SVGSEQ 1 /* SVG sequence */ -#define REPEAT 2 /* repeat sequence or measure - * doty: # measures if > 0 - * # notes/rests if < 0 - * nohdix: # repeat */ - float x; /* x offset */ - signed char y; /* y offset of note head */ - signed char ymn, ymx, yav; /* min, max, avg note head y offset */ - float xmx; /* max h-pos of a head rel to top - * width when STBRK */ - float xs, ys; /* coord of stem end / bar height */ - float wl, wr; /* left, right min width */ - float space; /* natural space before symbol */ - float shrink; /* minimum space before symbol */ - float xmax; /* max x offset */ - float shhd[MAXHD]; /* horizontal shift for heads */ - float shac[MAXHD]; /* horizontal shift for accidentals */ - struct gch *gch; /* guitar chords / annotations */ - struct lyrics *ly; /* lyrics */ - signed char doty; /* NOTEREST: y pos of dot when voices overlap - * STBRK: forced - * FMTCHG REPEAT: infos */ -}; - -/* bar types !tied to abcparse.h! */ -#define B_SINGLE B_BAR /* | single bar */ -#define B_DOUBLE 0x11 /* || thin double bar */ -#define B_THIN_THICK 0x13 /* |] thick at section end */ -#define B_THICK_THIN 0x21 /* [| thick at section start */ -#define B_LREP 0x14 /* |: left repeat bar */ -#define B_RREP 0x41 /* :| right repeat bar */ -#define B_DREP 0x44 /* :: double repeat bar */ -#define B_DASH 0x04 /* : dashed bar */ - -extern unsigned short *micro_tb; /* ptr to the microtone table of the tune */ - -struct FORMAT { /* struct for page layout */ - float pageheight, pagewidth; - float topmargin, botmargin, leftmargin, rightmargin; - float topspace, wordsspace, titlespace, subtitlespace, partsspace; - float composerspace, musicspace, vocalspace, textspace; - float breaklimit, maxshrink, lineskipfac, parskipfac, stemheight; - float indent, infospace, slurheight, notespacingfactor, scale; - float staffsep, sysstaffsep, maxstaffsep, maxsysstaffsep, stretchlast; - int abc2pscompat, alignbars, aligncomposer, autoclef; - int barsperstaff, breakoneoln, bstemdown, cancelkey; - int combinevoices, contbarnb, continueall, custos; - int dblrepbar, dynalign, flatbeams; - int infoline, gchordbox, graceslurs, gracespace, hyphencont; - int keywarn, landscape, linewarn; - int measurebox, measurefirst, measurenb, micronewps, microscale; - int oneperpage; -#ifdef HAVE_PANGO - int pango; -#endif - int partsbox, pdfmark; - int setdefl, shiftunison, splittune, squarebreve; - int staffnonote, straightflags, stretchstaff; - int textoption, titlecaps, titleleft, titletrim; - int timewarn, transpose, tuplets; - char *bgcolor, *dateformat, *header, *footer, *titleformat; -#define FONT_UMAX 5 /* max number of user fonts */ -#define ANNOTATIONFONT 5 -#define COMPOSERFONT 6 -#define FOOTERFONT 7 -#define GCHORDFONT 8 -#define HEADERFONT 9 -#define HISTORYFONT 10 -#define INFOFONT 11 -#define MEASUREFONT 12 -#define PARTSFONT 13 -#define REPEATFONT 14 -#define SUBTITLEFONT 15 -#define TEMPOFONT 16 -#define TEXTFONT 17 -#define TITLEFONT 18 -#define VOCALFONT 19 -#define VOICEFONT 20 -#define WORDSFONT 21 -#define FONT_DYN 22 /* index of dynamic fonts (gch, an, ly) */ -#define FONT_DYNX 12 /* number of dynamic fonts */ -#define FONT_MAX (FONT_DYN+FONT_DYNX) /* whole number of fonts */ - struct FONTSPEC font_tb[FONT_MAX]; - char ndfont; /* current index of dynamic fonts */ - unsigned char gcf, anf, vof; /* fonts for guitar chords, - * annotations and lyrics */ - unsigned int fields[2]; /* info fields to print - *[0] is 'A'..'Z', [1] is 'a'..'z' */ - struct posit_s posit; -}; - -extern struct FORMAT cfmt; /* current format */ -extern struct FORMAT dfmt; /* global format */ - -typedef struct SYMBOL *INFO[26]; /* information fields ('A' .. 'Z') */ -extern INFO info; - -extern char *outbuf; /* output buffer.. should hold one tune */ -extern char *mbf; /* where to PUTx() */ -extern int use_buffer; /* 1 if lines are being accumulated */ - -extern int outft; /* last font in the output file */ -extern int tunenum; /* number of current tune */ -extern int pagenum; /* current page number */ -extern int nbar; /* current measure number */ -extern int in_page; -extern int defl; /* decoration flags */ -#define DEF_NOST 0x01 /* long deco with no start */ -#define DEF_NOEN 0x02 /* long deco with no end */ -#define DEF_STEMUP 0x04 /* stem up (1) or down (0) */ - - /* switches modified by flags: */ -extern int quiet; /* quiet mode */ -extern int secure; /* secure mode */ -extern int annotate; /* output source references */ -extern int pagenumbers; /* write page numbers */ -extern int epsf; /* EPSF (1) / SVG (2) output */ -extern int svg; /* SVG (1) or XML (2 - HTML + SVG) output */ -extern int showerror; /* show the errors */ - -extern char outfn[FILENAME_MAX]; /* output file name */ -extern char *in_fname; /* current input file name */ -extern time_t mtime; /* last modification time of the input file */ - -extern int file_initialized; /* for output file */ -extern FILE *fout; /* output file */ - -#define MAXTBLT 8 -struct tblt_s { - char *head; /* PS head function */ - char *note; /* PS note function */ - char *bar; /* PS bar function */ - float wh; /* width of head */ - float ha; /* height above the staff */ - float hu; /* height under the staff */ - short pitch; /* pitch when no associated 'w:' / 0 */ - char instr[2]; /* instrument pitch */ -}; -extern struct tblt_s *tblts[MAXTBLT]; - -#define MAXCMDTBLT 4 /* max number of -T in command line */ -struct cmdtblt_s { - short index; /* tablature number */ - short active; /* activate or not */ - char *vn; /* voice name */ -}; -extern struct cmdtblt_s cmdtblts[MAXCMDTBLT]; -extern int ncmdtblt; - -extern int s_argc; /* command line arguments */ -extern char **s_argv; - -struct STAFF_S { - struct clef_s clef; /* base clef */ - char forced_clef; /* explicit clef */ - char empty; /* no symbol on this staff */ - short botbar, topbar; /* bottom and top of bar */ - float y; /* y position */ - float top[YSTEP], bot[YSTEP]; /* top/bottom y offsets */ -}; -extern struct STAFF_S staff_tb[MAXSTAFF]; -extern int nstaff; /* (0..MAXSTAFF-1) */ - -struct VOICE_S { - struct VOICE_S *next; /* link */ - struct SYMBOL *sym; /* associated symbols */ - struct SYMBOL *last_sym; /* last symbol while scanning */ - struct SYMBOL *lyric_start; /* start of lyrics while scanning */ - char id[VOICE_ID_SZ]; /* voice id */ - char *nm; /* voice name */ - char *snm; /* voice subname */ - char *bar_text; /* bar text at start of staff when bar_start */ - struct gch *bar_gch; /* bar text */ - struct SYMBOL *tie; /* note with ties of previous line */ - struct SYMBOL *rtie; /* note with ties before 1st repeat bar */ - struct tblt_s *tblts[2]; /* tablatures */ - float scale; /* scale */ - int time; /* current time (parsing) */ - struct clef_s clef; /* current clef */ - struct key_s key; /* current key signature */ - struct meter_s meter; /* current time signature */ - struct key_s ckey; /* key signature while parsing */ - struct key_s okey; /* original key signature (parsing) */ - unsigned hy_st; /* lyrics hyphens at start of line (bit array) */ - unsigned ignore:1; /* ignore this voice (%%staves) */ - unsigned forced_clef:1; /* explicit clef */ - unsigned second:1; /* secondary voice in a brace/parenthesis */ - unsigned floating:1; /* floating voice in a brace system */ - unsigned bar_repeat:1; /* bar at start of staff is a repeat bar */ - unsigned norepbra:1; /* don't display the repeat brackets */ - unsigned have_ly:1; /* some lyrics in this voice */ - unsigned new_name:1; /* redisplay the voice name */ - unsigned space:1; /* have a space before the next note (parsing) */ - unsigned perc:1; /* percussion */ - unsigned auto_len:1; /* auto L: (parsing) */ - short wmeasure; /* measure duration (parsing) */ - short transpose; /* transposition (parsing) */ - short bar_start; /* bar type at start of staff / 0 */ - struct posit_s posit; /* positions / directions */ - signed char octave; /* octave (parsing) */ - signed char clone; /* duplicate from this voice number */ - signed char over; /* overlay of this voice number */ - unsigned char staff; /* staff (0..n-1) */ - unsigned char cstaff; /* staff (parsing) */ - unsigned char slur_st; /* slurs at start of staff */ -}; -extern struct VOICE_S voice_tb[MAXVOICE]; /* voice table */ -extern struct VOICE_S *first_voice; /* first_voice */ - -extern struct SYMBOL *tsfirst; /* first symbol in the time linked list */ -extern struct SYMBOL *tsnext; /* next line when cut */ -extern float realwidth; /* real staff width while generating */ - -#define NFLAGS_SZ 10 /* size of note flags tables */ -#define C_XFLAGS 5 /* index of crotchet in flags tables */ -extern float space_tb[NFLAGS_SZ]; /* note spacing */ - -struct SYSTEM { /* staff system */ - struct SYSTEM *next; - short top_voice; /* first voice in the staff system */ - short nstaff; - struct { - short flags; -#define OPEN_BRACE 0x01 -#define CLOSE_BRACE 0x02 -#define OPEN_BRACKET 0x04 -#define CLOSE_BRACKET 0x08 -#define OPEN_PARENTH 0x10 -#define CLOSE_PARENTH 0x20 -#define STOP_BAR 0x40 -#define FL_VOICE 0x80 -#define OPEN_BRACE2 0x0100 -#define CLOSE_BRACE2 0x0200 -#define OPEN_BRACKET2 0x0400 -#define CLOSE_BRACKET2 0x0800 - char empty; - char dum; - struct clef_s clef; - float sep, maxsep; - } staff[MAXSTAFF]; - struct { - signed char range; - unsigned char staff; - char second; - char dum; - float sep, maxsep; - struct clef_s clef; - } voice[MAXVOICE]; -}; -struct SYSTEM *cursys; /* current staff system */ - -/* -- external routines -- */ -/* abc2ps.c */ -void clrarena(int level); -int lvlarena(int level); -void *getarena(int len); -void strext(char *fid, char *ext); -/* buffer.c */ -void a2b(char *fmt, ...) -#ifdef __GNUC__ - __attribute__ ((format (printf, 1, 2))) -#endif - ; -void block_put(void); -void buffer_eob(void); -void marg_init(void); -void bskip(float h); -void check_buffer(void); -void init_outbuf(int kbsz); -void close_output_file(void); -void close_page(void); -float get_bposy(void); -void write_buffer(void); -int (*output)(FILE *out, const char *fmt, ...) -#ifdef __GNUC__ - __attribute__ ((format (printf, 2, 3))) -#endif - ; -void write_eps(void); -/* deco.c */ -void deco_add(char *text); -void deco_cnv(struct deco *dc, struct SYMBOL *s, struct SYMBOL *prev); -unsigned char deco_intern(unsigned char deco); -unsigned char deco_define(char *name); -void deco_update(struct SYMBOL *s, float dx); -float deco_width(struct SYMBOL *s); -void draw_all_deco(void); -int draw_deco_head(int deco, float x, float y, int stem); -void draw_all_deco_head(struct SYMBOL *s, float x, float y); -void draw_deco_near(void); -void draw_deco_note(void); -void draw_deco_staff(void); -float draw_partempo(int staff, float top); -void draw_measnb(void); -void reset_deco(void); -void set_defl(int new_defl); -float tempo_width(struct SYMBOL *s); -void write_tempo(struct SYMBOL *s, - int beat, - float sc); -float y_get(int staff, - int up, - float x, - float w); -void y_set(int staff, - int up, - float x, - float w, - float y); -/* draw.c */ -void draw_sym_near(void); -void draw_all_symb(void); -float draw_systems(float indent); -void output_ps(struct SYMBOL *s, int state); -void putf(float f); -void putx(float x); -void puty(float y); -void putxy(float x, float y); -void set_scale(struct SYMBOL *s); -void set_sscale(int staff); -/* format.c */ -void define_fonts(void); -int get_textopt(char *p); -int get_font_encoding(int ft); -void interpret_fmt_line(char *w, char *p, int lock); -void lock_fmt(void *fmt); -void make_font_list(void); -FILE *open_file(char *fn, - char *ext, - char *rfn); -void print_format(void); -void set_font(int ft); -void set_format(void); -void set_voice_param(struct VOICE_S *p_voice, int state, char *w, char *p); -struct tblt_s *tblt_parse(char *p); -/* glyph.c */ -char *glyph_out(char *p); -void glyph_add(char *p); -/* music.c */ -void output_music(void); -void reset_gen(void); -void unlksym(struct SYMBOL *s); -/* parse.c */ -extern float multicol_start; -void do_tune(struct abctune *t); -void identify_note(struct SYMBOL *s, - int len, - int *p_head, - int *p_dots, - int *p_flags); -void sort_pitch(struct SYMBOL *s, int combine); -struct SYMBOL *sym_add(struct VOICE_S *p_voice, - int type); -/* subs.c */ -void bug(char *msg, int fatal); -void error(int sev, struct SYMBOL *s, char *fmt, ...); -float scan_u(char *str); -float cwid(unsigned short c); -void get_str_font(int *cft, int *dft); -void set_str_font(int cft, int dft); -#ifdef HAVE_PANGO -void pg_init(void); -void pg_reset_font(void); -#endif -void put_history(void); -void put_words(struct SYMBOL *words); -void str_font(int ft); -#define A_LEFT 0 -#define A_CENTER 1 -#define A_RIGHT 2 -#define A_LYRIC 3 -#define A_GCHORD 4 -#define A_ANNOT 5 -#define A_GCHEXP 6 -void str_out(char *p, int action); -void put_str(char *str, int action); -float tex_str(char *s); -extern char tex_buf[]; /* result of tex_str() */ -#define TEX_BUF_SZ 512 -char *trim_title(char *p, struct SYMBOL *title); -void user_ps_add(char *s, char use); -void user_ps_write(void); -void write_title(struct SYMBOL *s); -void write_heading(struct abctune *t); -void write_user_ps(void); -void write_text(char *cmd, char *s, int job); -/* svg.c */ -void define_svg_symbols(char *title, int num, float w, float h); -int svg_output(FILE *out, const char *fmt, ...) -#ifdef __GNUC__ - __attribute__ ((format (printf, 2, 3))) -#endif - ; -void svg_write(char *buf, int len); -void svg_close(); -/* syms.c */ -void define_font(char *name, int num, int enc); -void define_symbols(void); Binary files /tmp/tmputFabm/2sug4RLyYU/abcm2ps-7.8.9/abc2svg.ttf and /tmp/tmputFabm/amw0CNkIJH/abcm2ps-8.14.2/abc2svg.ttf differ diff -Nru abcm2ps-7.8.9/abcm2ps.c abcm2ps-8.14.2/abcm2ps.c --- abcm2ps-7.8.9/abcm2ps.c 1970-01-01 00:00:00.000000000 +0000 +++ abcm2ps-8.14.2/abcm2ps.c 2018-12-18 15:18:26.000000000 +0000 @@ -0,0 +1,1118 @@ +/* + * abcm2ps: a program to typeset tunes written in ABC format + * using PostScript or SVG + * + * Copyright (C) 1998-2017 Jean-François Moine (http://moinejf.free.fr) + * + * Adapted from abc2ps-1.2.5: + * Copyright (C) 1996,1997 Michael Methfessel (msm@ihp-ffo.de) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include + +#include "abcm2ps.h" + +#ifdef HAVE_MMAP +#include +#include +#elif defined(linux) +#include +#endif + +/* -- global variables -- */ + +INFO info; +struct SYMBOL *sym; /* (points to the symbols of the current voice) */ + +int tunenum; /* number of current tune */ +int pagenum = 1; /* current page in output file */ +int pagenum_nr = 1; /* current page (non-resettable) */ + + /* switches modified by command line flags: */ +int quiet; /* quiet mode */ +int secure; /* secure mode */ +int annotate; /* output source references */ +int pagenumbers; /* write page numbers */ +int epsf; /* 1: EPSF, 2: SVG, 3: embedded ABC */ +int svg; /* 1: SVG, 2: XHTML */ +int showerror; /* show the errors */ +int pipeformat = 0; /* format for bagpipes regardless of key */ + +char outfn[FILENAME_MAX]; /* output file name */ +int file_initialized; /* for output file */ +FILE *fout; /* output file */ +char *in_fname; /* top level input file name */ +time_t mtime; /* last modification time of the input file */ +static time_t fmtime; /* " " of all files */ + +int s_argc; /* command line arguments */ +char **s_argv; + +struct tblt_s *tblts[MAXTBLT]; +struct cmdtblt_s cmdtblts[MAXCMDTBLT]; +int ncmdtblt; + +/* -- local variables -- */ + +static char *styd = DEFAULT_FDIR; /* format search directory */ +static int def_fmt_done = 0; /* default format read */ +static struct SYMBOL notitle; + +/* memory arena (for clrarena, lvlarena & getarena) */ +#define MAXAREAL 3 /* max area levels: + * 0; global, 1: tune, 2: generation */ +#define AREANASZ 0x4000 /* standard allocation size */ +#define MAXAREANASZ 0x20000 /* biggest allocation size */ +static int str_level; /* current arena level */ +static struct str_a { + struct str_a *n; /* next area */ + char *p; /* pointer in area */ + int r; /* remaining space in area */ + int sz; /* size of str[] */ + char str[2]; /* start of memory area */ +} *str_r[MAXAREAL], *str_c[MAXAREAL]; /* root and current area pointers */ + +/* -- local functions -- */ +static void read_def_format(void); + +static FILE *open_ext(char *fn, char *ext) +{ + FILE *fp; + char *p; + + if ((fp = fopen(fn, "rb")) != NULL) + return fp; + if ((p = strrchr(fn, DIRSEP)) == NULL) + p = fn; + if (strrchr(p, '.') != NULL) + return NULL; + strcat(p, "."); + strcat(p, ext); + if ((fp = fopen(fn, "rb")) != NULL) + return fp; + return NULL; +} + +/* -- open a file for reading -- */ +FILE *open_file(char *fn, /* file name */ + char *ext, /* file type */ + char *rfn) /* returned real file name */ +{ + FILE *fp; + char *p; + int l; + + /* if there was some ABC file, try its directory */ + if (in_fname && in_fname != fn + && (p = strrchr(in_fname, DIRSEP)) != NULL) { + l = p - in_fname + 1; + strncpy(rfn, in_fname, l); + strcpy(&rfn[l], fn); + if ((fp = open_ext(rfn, ext)) != NULL) + return fp; + } + + /* try locally */ + strcpy(rfn, fn); + if ((fp = open_ext(rfn, ext)) != NULL) + return fp; + + /* try a format in the format directory */ + if (*ext != 'f' || *styd == '\0') + return NULL; + l = strlen(styd) - 1; + if (styd[l] == DIRSEP) + sprintf(rfn, "%s%s", styd, fn); + else + sprintf(rfn, "%s%c%s", styd, DIRSEP, fn); + return open_ext(rfn, ext); +} + +/* -- read a whole input file -- */ +/* return the real/full file name in tex_buf[] */ +static char *read_file(char *fn, char *ext) +{ + size_t fsize; + FILE *fin; + char *file; + + if (*fn == '\0') { + strcpy(tex_buf, "stdin"); + fsize = 0; + file = malloc(8192); + for (;;) { + int l; + + l = fread(&file[fsize], 1, 8192, stdin); + fsize += l; + if (l != 8192) + break; + file = realloc(file, fsize + 8192); + } + if (ferror(stdin) != 0) { + free(file); + return 0; + } + if (fsize % 8192 == 0) + file = realloc(file, fsize + 2); + time(&fmtime); + } else { + struct stat sbuf; + + fin = open_file(fn, ext, tex_buf); + if (!fin) + return NULL; + if (fseek(fin, 0L, SEEK_END) < 0) { + fclose(fin); + return NULL; + } + fsize = ftell(fin); + rewind(fin); + if ((file = malloc(fsize + 2)) == NULL) { + fclose(fin); + return NULL; + } + + if (fread(file, 1, fsize, fin) != fsize) { + fclose(fin); + free(file); + return NULL; + } + fstat(fileno(fin), &sbuf); + memcpy(&fmtime, &sbuf.st_mtime, sizeof fmtime); + fclose(fin); + } + file[fsize] = '\0'; + return file; +} + +/* -- treat an input file and generate the ABC file -- */ +static void treat_file(char *fn, char *ext) +{ + char *file; + char *abc_fn; + int file_type, l; + + /* initialize if not already done */ + if (!fout) { + read_def_format(); + if (strcmp(fn, tex_buf) == 0) + return; // if xx.default.fmt, done + } + + /* read the file into memory */ + /* the real/full file name is put in tex_buf[] */ + if ((file = read_file(fn, ext)) == NULL) { + if (strcmp(fn, "default.fmt") != 0) { + error(1, NULL, "Cannot read the input file '%s'", fn); +#if defined(unix) || defined(__unix__) + perror(" read_file"); +#endif + } + return; + } + abc_fn = strdup(tex_buf); + if (!quiet) + fprintf(strcmp(outfn, "-") == 0 ? stderr : stdout, + "File %s\n", abc_fn); + + /* convert the strings */ + l = strlen(abc_fn); + if (strcmp(&abc_fn[l - 3], ".ps") == 0) { + file_type = FE_PS; + } else if (strcmp(&abc_fn[l - 4], ".fmt") == 0) { + file_type = FE_FMT; + } else { + file_type = FE_ABC; +// in_fname = abc_fn; + mtime = fmtime; + } + + frontend((unsigned char *) file, file_type, + abc_fn, 0); + free(file); + + if (file_type == FE_PS) /* PostScript file */ + frontend((unsigned char *) "%%endps", FE_ABC, + abc_fn, 0); + if (file_type == FE_ABC) /* if ABC file */ + clrarena(1); /* clear previous tunes */ +} + +/* call back to handle %%format/%%abc-include - see front.c */ +void include_file(unsigned char *fn) +{ + static int nbfiles; + + if (nbfiles > 2) { + error(1, NULL, "Too many included files"); + return; + } + + nbfiles++; + treat_file((char *) fn, "fmt"); + nbfiles--; +} + +/* -- treat an ABC input file and generate the music -- */ +/* this function also treats ABC in XHTML */ +static void treat_abc_file(char *fn) +{ + FILE *fin; + char *file, *file_tmp; + char *abc_fn, *p, *q; + size_t fsize, l, l2; + int linenum; +#ifdef HAVE_MMAP + int fd; +#endif + + lvlarena(0); + parse.abc_state = ABC_S_GLOBAL; + + if (epsf != 3) { + treat_file(fn, "abc"); /* not '-z' */ + return; + } + + if (*fn == '\0') { + error(1, NULL, "cannot use stdin with -z - aborting"); + exit(EXIT_FAILURE); + } + + fin = open_file(fn, "abc", tex_buf); + if (!fin) + goto err; + if (fseek(fin, 0L, SEEK_END) < 0) { + fclose(fin); + goto err; + } + fsize = ftell(fin); + rewind(fin); +#ifdef HAVE_MMAP + fd = fileno(fin); + file = mmap(NULL, fsize, PROT_READ, MAP_PRIVATE, fd, 0); + if (!file) + goto err; +#else + file = malloc(fsize); + if (!file) + goto err; + if (fread(file, 1, fsize, fin) != fsize) { + free(file); + goto err; + } + fclose(fin); +#endif + + /* copy the HTML/XML/XHTML file and generate the music */ + abc_fn = strdup(tex_buf); + l = fsize; + p = file; + linenum = 0; + while (l > 0) { + + /* search the start of ABC lines */ +#if 1 + for (q = p, l2 = l - 10; l2 > 0; l2--, q++) { + if (strncmp(q, "\n%abc", 5) == 0 +// || strncmp(q, "\n%%", 3) == 0 + || strncmp(q, "\nX:", 3) == 0) + break; + } +#else + for (q = p, l2 = l - 5; l2 > 0; l2--, q++) + if (strncmp(q, "", 5) == 0) + break; +#endif + if (l2 <= 0) { + fwrite(p, 1, l, fout); + break; + } + q++; + fwrite(p, 1, q - p, fout); + l -= q - p; + while (p != q) { + if (*p++ == '\n') + linenum++; + } + + /* search the end of ABC lines */ + for (q = p, l2 = l - 10; l2 > 0; l2--, q++) + if (*q == '\n' && q[1] == '<') + break; + if (l2 <= 0) { + error(1, NULL, "no end of ABC sequence"); + q += 9; +// break; + } + q++; + + /* must copy ... :( */ + l2 = q - p; + file_tmp = malloc(l2 + 1); + if (!file_tmp) { + error(1, NULL, "out of memory"); + break; + } + memcpy(file_tmp, p, l2); + file_tmp[l2] = '\0'; + + frontend((unsigned char *) file_tmp, FE_ABC, + abc_fn, linenum); + free(file_tmp); + + clrarena(1); /* clear previous tunes */ + file_initialized = -1; /* don't put
before first image */ + + l -= q - p; + while (p != q) { + if (*p++ == '\n') + linenum++; + } + } + +#ifdef HAVE_MMAP + munmap(file, fsize); + fclose(fin); +#else + free(file); +#endif + return; +err: + error(1, NULL, "input file %s error %s - aborting", fn, strerror(errno)); + exit(EXIT_FAILURE); +} + +/* -- read the default format -- */ +static void read_def_format(void) +{ + if (def_fmt_done) + return; + def_fmt_done = 1; + treat_file("default.fmt", "fmt"); +} + +/* -- set extension on a file name -- */ +void strext(char *fn, char *ext) +{ + char *p, *q; + + if ((p = strrchr(fn, DIRSEP)) == NULL) + p = fn; + if ((q = strrchr(p, '.')) == NULL) + strcat(p, "."); + else + q[1] = '\0'; + strcat(p, ext); +} + +/* -- write the program version -- */ +static void display_version(int full) +{ + FILE *log = strcmp(outfn, "-") == 0 ? stderr : stdout; + + fputs("abcm2ps-" VERSION " (" VDATE ")\n", log); + if (!full) + return; + fputs("Options:" +#ifdef A4_FORMAT + " A4_FORMAT" +#endif +#ifdef DECO_IS_ROLL + " DECO_IS_ROLL" +#endif +#ifdef HAVE_PANGO + " PANGO" +#endif +#if !defined(A4_FORMAT) && !defined(DECO_IS_ROLL) && !defined(HAVE_PANGO) + " NONE" +#endif + "\n", log); + if (styd[0] != '\0') + fprintf(log, "Default format directory: %s\n", styd); +} + +/* -- display usage and exit -- */ +static void usage(void) +{ + display_version(0); + printf( "ABC to Postscript/SVG translator.\n" + "Usage: abcm2ps [options] file [file_options] ..\n" + "where:\n" + " file input ABC file, or '-'\n" + " options and file_options:\n" + " .output file options:\n" + " -E produce EPSF output, one tune per file\n" + " -g produce SVG output, one tune per file\n" + " -v produce SVG output, one page per file\n" + " -X produce SVG output in one XHTML file\n" + " -z produce SVG output from embedded ABC\n" + " -O fff set outfile name to fff\n" + " -O = make outfile name from infile/title\n" + " -i indicate where are the errors\n" + " -k kk size of the PS output buffer in Kibytes\n" + " .output formatting:\n" + " -s xx set scale factor to xx\n" + " -w xx set staff width (cm/in/pt)\n" + " -m xx set left margin (cm/in/pt)\n" + " -d xx set staff separation (cm/in/pt)\n" + " -a xx set max shrinkage to xx (between 0 and 1)\n" + " -F foo read format file \"foo.fmt\"\n" + " -D bar look for format files in directory \"bar\"\n" + " -p format for bagpipes regardless of key\n" + " .output options:\n" + " -l landscape mode\n" + " -I xx indent 1st line (cm/in/pt)\n" + " -x add xref numbers in titles\n" + " -M don't output the lyrics\n" + " -N n set page numbering mode to n=\n" + " 0=off 1=left 2=right 3=even left,odd right 4=even right,odd left\n" + " -1 write one tune per page\n" + " -G no slur in grace notes\n" + " -j n[b] number the measures every n bars (or on the left if n=0)\n" + " if 'b', display in a box\n" + " -b n set the first measure number to n\n" + " -f have flat beams\n" + " -T n[v] output the tablature 'n' for voice 'v' / all voices\n" + " .line breaks:\n" + " -c auto line break\n" + " -B n break every n bars\n" + " .input file selection/options:\n" + " -e pattern\n" + " tune selection\n" + " .help/configuration:\n" + " -V show program version\n" + " -h show this command summary\n" + " -H show the format parameters\n" + " -S secure mode\n" + " -q quiet mode\n"); + exit(EXIT_SUCCESS); +} + +#ifdef linux +/* -- where is the default format directory -- */ +static void wherefmtdir(void) +{ + char exe[512], *p; + FILE *f; + int l; + + if ((l = readlink("/proc/self/exe", exe, sizeof exe)) <= 0) + return; + if ((p = strrchr(exe, '/')) == NULL) + return; + p++; + if (p > &exe[5] && strncmp(p - 5, "/bin", 4) == 0) { + strcpy(p - 4, "share/abcm2ps/"); + p += -4 + 14; + } + /* else, assume this is the source directory */ + + /* check if a format file is present */ + strcpy(p, "tight.fmt"); + if ((f = fopen(exe, "r")) == NULL) + return; + fclose(f); + + /* change the format directory */ + p[-1] = '\0'; + styd = strdup(exe); +} +#endif + +/* -- parse the tablature command ('-T n[v]') -- */ +static struct cmdtblt_s *cmdtblt_parse(char *p) +{ + struct cmdtblt_s *cmdtblt; + short val; + + if (ncmdtblt >= MAXCMDTBLT) { + error(1, NULL, "++++ Too many '-T'"); + return NULL; + } + if (*p == '\0') + val = -1; + else { + val = *p++ - '0' - 1; + if ((unsigned) val > MAXTBLT) { + error(1, NULL, "++++ Bad tablature number in '-T'\n"); + return 0; + } + } + cmdtblt = &cmdtblts[ncmdtblt++]; + cmdtblt->index = val; + cmdtblt->vn = p; + return cmdtblt; +} + +/* set a command line option */ +static void set_opt(char *w, char *v) +{ + static char prefix = '%'; /* pseudo-comment prefix */ + + if (!v) + v = ""; + if (strlen(w) + strlen(v) >= TEX_BUF_SZ - 10) { + error(1, NULL, "Command line '%s' option too long", w); + return; + } + sprintf(tex_buf, /* this buffer is available */ + "%%%c%s %s lock\n", prefix, w, v); + if (strcmp(w, "abcm2ps") == 0) + prefix = *v; + frontend((unsigned char *) tex_buf, FE_ABC, + "cmd_line", 0); +} + +/* -- main program -- */ +int main(int argc, char **argv) +{ + unsigned j; + char *p, c, *aaa; + + if (argc <= 1) + usage(); + + outfn[0] = '\0'; + init_outbuf(64); + + /* set the global flags */ + s_argc = argc; + s_argv = argv; + aaa = NULL; + while (--argc > 0) { + argv++; + p = *argv; + if (*p != '-' || p[1] == '-') { + if (*p == '+' && p[1] == 'F') /* +F : no default format */ + def_fmt_done = 1; + continue; + } + while ((c = *++p) != '\0') { /* '-xxx' */ + switch (c) { + case 'E': + svg = 0; /* EPS */ + epsf = 1; + break; + case 'g': + svg = 0; /* SVG one file per tune */ + epsf = 2; + break; + case 'H': + quiet = 1; // don't output the version + break; + case 'h': + usage(); /* no return */ + case 'p': + pipeformat = 1; /* format for bagpipe regardless of key */ + break; + case 'q': + quiet = 1; + break; + case 'S': + secure = 1; + break; + case 'V': + display_version(1); + return EXIT_SUCCESS; + case 'v': + svg = 1; /* SVG one file per page */ + epsf = 0; + break; + case 'X': + svg = 2; /* SVG/XHTML */ + epsf = 0; + break; + case 'k': { + int kbsz; + + if (p[1] == '\0') { + if (--argc <= 0) { + error(1, NULL, "No value for '-k' - aborting"); + return EXIT_FAILURE; + } + aaa = *++argv; + } else { + aaa = p + 1; + p += strlen(p) - 1; + } + + sscanf(aaa, "%d", &kbsz); + init_outbuf(kbsz); + break; + } + case 'O': + if (p[1] == '\0') { + if (--argc <= 0) { + error(1, NULL, "No value for '-O' - aborting"); + return EXIT_FAILURE; + } + aaa = *++argv; + } else { + aaa = p + 1; + p += strlen(p) - 1; + } + if (strlen(aaa) >= sizeof outfn) { + error(1, NULL, "'-O' too large - aborting"); + return EXIT_FAILURE; + } + strcpy(outfn, aaa); + break; + case 'z': + epsf = 3; /* ABC embedded in XML */ + svg = 0; + break; + default: + if (strchr("aBbDdeFfIjmNOsTw", c)) /* if with arg */ + p += strlen(p) - 1; /* skip */ + break; + } + } + } + if (!quiet) + display_version(0); + + /* initialize */ + clrarena(0); /* global */ + clrarena(1); /* tunes */ + clrarena(2); /* generation */ +// memset(&info, 0, sizeof info); + info['T' - 'A'] = ¬itle; + notitle.text = "T:"; + set_format(); + init_deco(); + +#ifdef linux + /* if not set, try to find where is the default format directory */ + if (styd[0] == '\0') + wherefmtdir(); +#endif +#ifdef HAVE_PANGO + pg_init(); +#endif + + /* if ABC embedded in XML, open the output file */ + if (epsf == 3) { + open_fout(); + read_def_format(); + } + + /* parse the arguments - finding a new file, treat the previous one */ + argc = s_argc; + argv = s_argv; + while (--argc > 0) { + argv++; + p = *argv; + if ((c = *p) == '\0') + continue; + if (c == '-') { + int i; + + if (p[1] == '\0') { /* '-' alone */ + if (in_fname) { + treat_abc_file(in_fname); + frontend((unsigned char *) "select\n", FE_FMT, + "cmd_line", 0); + } + in_fname = ""; /* read from stdin */ + continue; + } + i = strlen(p) - 1; + if (p[i] == '-' + && p[1] != '-' +//fixme: 'e' may be preceded by other options + && p[1] != 'e' + && p[i -1] != 'O') + c = '+'; /* switch off flags with '-x-' */ + } + if (c == '+') { /* switch off flags with '+' */ + while (*++p != '\0') { + switch (*p) { + case '-': + break; + case 'B': + cfmt.barsperstaff = 0; + lock_fmt(&cfmt.barsperstaff); + break; + case 'c': + cfmt.continueall = 0; + lock_fmt(&cfmt.continueall); + break; + case 'F': +// def_fmt_done = 1; + break; + case 'G': + cfmt.graceslurs = 1; + lock_fmt(&cfmt.graceslurs); + break; + case 'i': + showerror = 0; + break; + case 'j': + cfmt.measurenb = -1; + lock_fmt(&cfmt.measurenb); + break; + case 'l': + cfmt.landscape = 0; + lock_fmt(&cfmt.landscape); + break; + case 'M': + cfmt.fields[1] = 1 << ('w' - 'a'); + lock_fmt(&cfmt.fields); + break; + case 'N': + pagenumbers = 0; + break; + case 'O': + outfn[0] = '\0'; + break; + case 'T': { + struct cmdtblt_s *cmdtblt; + + aaa = p + 1; + if (*aaa == '\0') { + if (argc > 1 + && argv[1][0] != '-') { + aaa = *++argv; + argc--; + } + } else { + while (p[1] != '\0') /* stop */ + p++; + if (*p == '-') + *p-- = '\0'; /* (not clean) */ + } + cmdtblt = cmdtblt_parse(aaa); + if (cmdtblt != 0) + cmdtblt->active = 0; + break; + } + case 'x': + cfmt.fields[0] &= ~(1 << ('X' - 'A')); + lock_fmt(&cfmt.fields); + break; + case '0': + cfmt.splittune = 0; + lock_fmt(&cfmt.splittune); + break; + case '1': + cfmt.oneperpage = 0; + lock_fmt(&cfmt.oneperpage); + break; + default: + error(1, NULL, + "++++ Cannot switch off flag: +%c", + *p); + break; + } + } + continue; + } + + if (c == '-') { /* interpret a flag with '-' */ + if (p[1] == '-') { /* long argument */ + p += 2; + if (--argc <= 0) { + error(1, NULL, "No argument for '--'"); + return EXIT_FAILURE; + } + argv++; + set_opt(p, *argv); + continue; + } + while ((c = *++p) != '\0') { + switch (c) { + + /* simple flags */ + case 'A': + annotate = 1; + break; + case 'c': + cfmt.continueall = 1; + lock_fmt(&cfmt.continueall); + break; + case 'E': + break; + case 'f': + cfmt.flatbeams = 1; + lock_fmt(&cfmt.flatbeams); + break; + case 'G': + cfmt.graceslurs = 0; + lock_fmt(&cfmt.graceslurs); + break; + case 'g': + break; + case 'H': + if (!fout) { + read_def_format(); + make_font_list(); + do_tune(); + } + print_format(); + return EXIT_SUCCESS; + case 'i': + showerror = 1; + break; + case 'l': + cfmt.landscape = 1; + lock_fmt(&cfmt.landscape); + break; + case 'M': + cfmt.fields[1] &= ~(1 << ('w' - 'a')); + lock_fmt(&cfmt.fields); + break; + case 'p': + case 'q': + case 'S': + break; + case 'v': + case 'X': + case 'z': + break; + case 'x': + cfmt.fields[0] |= 1 << ('X' - 'A'); + lock_fmt(&cfmt.fields); + break; + case '0': + cfmt.splittune = 1; + lock_fmt(&cfmt.splittune); + break; + case '1': + cfmt.oneperpage = 1; + lock_fmt(&cfmt.oneperpage); + break; + + /* flag with optional parameter */ + case 'N': + if (p[1] == '\0' + && (argc <= 1 + || !isdigit((unsigned) argv[1][0]))) { + pagenumbers = 2; /* old behaviour */ + break; + } + /* fall thru */ + /* flags with parameter.. */ + case 'a': + case 'B': + case 'b': + case 'D': + case 'd': + case 'e': + case 'F': + case 'I': + case 'j': + case 'k': + case 'L': + case 'm': + case 'O': + case 's': + case 'T': + case 'w': + aaa = p + 1; + if (*aaa == '\0') { + aaa = *++argv; + if (--argc <= 0 + || (*aaa == '-' && c != 'O')) { + error(1, NULL, + "Missing parameter after '-%c' - aborting", + c); + return EXIT_FAILURE; + } + } else { + p += strlen(p) - 1; /* stop */ + } + + if (strchr("BbfjkNs", c)) { /* check num args */ + for (j = 0; j < strlen(aaa); j++) { + if (!strchr("0123456789.", + aaa[j])) { + if (aaa[j] == 'b' + && aaa[j + 1] == '\0' + && c == 'j') + break; + error(1, NULL, + "Invalid parameter <%s> for flag -%c", + aaa, c); + return EXIT_FAILURE; + } + } + } + + switch (c) { + case 'a': + set_opt("maxshrink", aaa); + break; + case 'B': + set_opt("barsperstaff", aaa); + break; + case 'b': + set_opt("measurefirst", aaa); + break; + case 'D': + styd = aaa; + break; + case 'd': + set_opt("staffsep", aaa); + break; + case 'e': + set_opt("select", aaa); + break; + case 'F': + treat_file(aaa, "fmt"); + break; + case 'I': + set_opt("indent", aaa); + break; + case 'j': + sscanf(aaa, "%d", &cfmt.measurenb); + lock_fmt(&cfmt.measurenb); + if (aaa[strlen(aaa) - 1] == 'b') + cfmt.measurebox = 1; + else + cfmt.measurebox = 0; + lock_fmt(&cfmt.measurebox); + break; + case 'k': + break; + case 'm': + set_opt("leftmargin", aaa); + break; + case 'N': + sscanf(aaa, "%d", &pagenumbers); + if ((unsigned) pagenumbers > 4) { + error(1, NULL, + "'-N' value %s - changed to 2", + aaa); + pagenumbers = 2; + } + break; + case 'O': + if (strlen(aaa) >= sizeof outfn) { + error(1, NULL, "'-O' too large - aborting"); + exit(EXIT_FAILURE); + } + strcpy(outfn, aaa); + break; + case 's': + set_opt("scale", aaa); + break; + case 'T': { + struct cmdtblt_s *cmdtblt; + + cmdtblt = cmdtblt_parse(aaa); + if (cmdtblt) + cmdtblt->active = 1; + break; + } + case 'w': + set_opt("staffwidth", aaa); + break; + } + break; + default: + error(1, NULL, + "Unknown flag: -%c ignored", c); + break; + } + } + continue; + } + + if (in_fname) { + treat_abc_file(in_fname); + frontend((unsigned char *) "select\n", FE_FMT, + "cmd_line", 0); + } + in_fname = p; + } + + if (in_fname) + treat_abc_file(in_fname); + if (multicol_start != 0) { /* lack of %%multicol end */ + error(1, NULL, "Lack of %%%%multicol end"); + multicol_start = 0; + buffer_eob(0); + if (!info['X' - 'A'] + && !epsf) + write_buffer(); + } + if (!epsf && !fout) { + error(1, NULL, "Nothing to generate!"); + return EXIT_FAILURE; + } + close_output_file(); + return severity == 0 ? EXIT_SUCCESS : EXIT_FAILURE; +} + +/* -- arena routines -- */ +void clrarena(int level) +{ + struct str_a *a_p; + + if ((a_p = str_r[level]) == NULL) { + str_r[level] = a_p = malloc(sizeof *str_r[0] + AREANASZ - 2); + a_p->sz = AREANASZ; + a_p->n = NULL; + } + str_c[level] = a_p; + a_p->p = a_p->str; + a_p->r = a_p->sz; +} + +int lvlarena(int level) +{ + int old_level; + + old_level = str_level; + str_level = level; + return old_level; +} + +/* The area is 8 bytes aligned to handle correctly int and pointers access + * on some machines as Sun Sparc. */ +void *getarena(int len) +{ + char *p; + struct str_a *a_p; + + a_p = str_c[str_level]; + len = (len + 7) & ~7; /* align at 64 bits boundary */ + if (len > a_p->r) { + if (len > MAXAREANASZ) { + error(1, NULL, + "getarena - data too wide %d - aborting", + len); + exit(EXIT_FAILURE); + } + if (len > AREANASZ) { /* big allocation */ + struct str_a *a_n; + + a_n = a_p->n; + a_p->n = malloc(sizeof *str_r[0] + len - 2); + a_p->n->n = a_n; + a_p->n->sz = len; + } else if (a_p->n == 0) { /* standard allocation */ + a_p->n = malloc(sizeof *str_r[0] + AREANASZ - 2); + a_p->n->n = NULL; + a_p->n->sz = AREANASZ; + } + str_c[str_level] = a_p = a_p->n; + a_p->p = a_p->str; + a_p->r = a_p->sz; + } + p = a_p->p; + a_p->p += len; + a_p->r -= len; + return p; +} diff -Nru abcm2ps-7.8.9/abcm2ps.h abcm2ps-8.14.2/abcm2ps.h --- abcm2ps-7.8.9/abcm2ps.h 1970-01-01 00:00:00.000000000 +0000 +++ abcm2ps-8.14.2/abcm2ps.h 2018-12-18 15:18:26.000000000 +0000 @@ -0,0 +1,903 @@ +/* -- general macros -- */ + +#include +#include + +#include "config.h" + +#define MAXVOICE 32 /* max number of voices */ + +#define MAXHD 8 /* max heads in a chord */ +#define MAXDC 32 /* max decorations per symbol */ +#define MAXMICRO 32 /* max microtone values (5 bits in accs[]) */ +#define DC_NAME_SZ 128 /* size of the decoration name table */ + +#define BASE_LEN 1536 /* basic note length (semibreve or whole note - same as MIDI) */ + +#define VOICE_ID_SZ 16 /* max size of the voice identifiers */ + +/* accidentals */ +enum accidentals { + A_NULL, /* none */ + A_SH, /* sharp */ + A_NT, /* natural */ + A_FT, /* flat */ + A_DS, /* double sharp */ + A_DF /* double flat */ +}; + +/* bar types - 4 bits per symbol */ +#define B_BAR 1 /* | */ +#define B_OBRA 2 /* [ */ +#define B_CBRA 3 /* ] */ +#define B_COL 4 /* : */ + +#define B_SINGLE 0x01 /* | single bar */ +#define B_DOUBLE 0x11 /* || thin double bar */ +#define B_THIN_THICK 0x13 /* |] thick at section end */ +#define B_THICK_THIN 0x21 /* [| thick at section start */ +#define B_LREP 0x14 /* |: left repeat bar */ +#define B_RREP 0x41 /* :| right repeat bar */ +#define B_DREP 0x44 /* :: double repeat bar */ +#define B_DASH 0x04 /* : dashed bar */ + +/* slur/tie types (4 bits) */ +#define SL_ABOVE 0x01 +#define SL_BELOW 0x02 +#define SL_HIDDEN 0x03 /* also opposite for gstemdir */ +#define SL_AUTO 0x04 +#define SL_DOTTED 0x08 /* (modifier bit) */ + +#define OUTPUTFILE "Out.ps" /* standard output file */ + +#ifndef WIN32 +#define DIRSEP '/' +#else +#define DIRSEP '\\' +#define strcasecmp stricmp +#define strncasecmp _strnicmp +#define strdup _strdup +#define snprintf _snprintf +#ifdef _MSC_VER +#define fileno _fileno +#endif +#endif + +#define CM * 37.8 /* factor to transform cm to pt */ +#define PT /* factor to transform pt to pt */ +#define IN * 96.0 /* factor to transform inch to pt */ + +/* basic page dimensions */ +#ifdef A4_FORMAT +#define PAGEHEIGHT (29.7 CM) +#define PAGEWIDTH (21.0 CM) +#define MARGIN (1.8 CM) +#else +#define PAGEHEIGHT (11.0 IN) +#define PAGEWIDTH (8.5 IN) +#define MARGIN (0.7 IN) +#endif + +/* -- macros controlling music typesetting -- */ + +#define STEM_YOFF 1.0 /* offset stem from note center */ +#define STEM_XOFF 3.5 +#define STEM 21 /* default stem height = one octave */ +#define STEM_MIN 16 /* min stem height under beams */ +#define STEM_MIN2 14 /* ... for notes with two beams */ +#define STEM_MIN3 12 /* ... for notes with three beams */ +#define STEM_MIN4 10 /* ... for notes with four beams */ +#define STEM_CH_MIN 14 /* min stem height for chords under beams */ +#define STEM_CH_MIN2 10 /* ... for notes with two beams */ +#define STEM_CH_MIN3 9 /* ... for notes with three beams */ +#define STEM_CH_MIN4 9 /* ... for notes with four beams */ +#define BEAM_DEPTH 3.2 /* width of a beam stroke */ +#define BEAM_OFFSET 0.25 /* pos of flat beam relative to staff line */ +#define BEAM_SHIFT 5.0 /* shift of second and third beams */ +/* To align the 4th beam as the 1st: shift=6-(depth-2*offset)/3 */ +#define BEAM_FLATFAC 0.6 /* factor to decrease slope of long beams */ +#define BEAM_THRESH 0.06 /* flat beam if slope below this threshold */ +#define BEAM_SLOPE 0.5 /* max slope of a beam */ +#define BEAM_STUB 7.0 /* length of stub for flag under beam */ +#define SLUR_SLOPE 1.0 /* max slope of a slur */ +#define GSTEM 15 /* grace note stem length */ +#define GSTEM_XOFF 2.3 /* x offset for grace note stem */ + +#define BETA_C 0.1 /* max expansion for flag -c */ +#define BETA_X 1.0 /* max expansion before complaining */ + +#define VOCPRE 0.4 /* portion of vocals word before note */ +#define GCHPRE 0.4 /* portion of guitar chord before note */ + +/* -- Parameters for note spacing -- */ +/* fnn multiplies the spacing under a beam, to compress the notes a bit */ + +#define fnnp 0.9 + +/* -- macros for program internals -- */ + +#define STRL1 256 /* string length for file names */ +#define MAXSTAFF 32 /* max staves */ +#define BSIZE 512 /* buffer size for one input string */ + +#define BREVE (BASE_LEN * 2) /* double note (square note) */ +#define SEMIBREVE BASE_LEN /* whole note */ +#define MINIM (BASE_LEN / 2) /* half note (white note) */ +#define CROTCHET (BASE_LEN / 4) /* quarter note (black note) */ +#define QUAVER (BASE_LEN / 8) /* 1/8 note */ +#define SEMIQUAVER (BASE_LEN / 16) /* 1/16 note */ + +#define MAXFONTS 30 /* max number of fonts */ + +#define T_LEFT 0 +#define T_JUSTIFY 1 +#define T_FILL 2 +#define T_CENTER 3 +#define T_SKIP 4 +#define T_RIGHT 5 + +#define YSTEP 128 /* number of steps for y offsets */ + +struct decos { /* decorations */ + char n; /* whole number of decorations */ + struct { + unsigned char t; /* decoration index */ + signed char m; /* index in chord when note / -1 */ + } tm[MAXDC]; +}; + +struct note_map { /* note mapping */ + struct note_map *next; /* note linkage */ + char type; /* map type */ +#define MAP_ONE 0 +#define MAP_OCT 1 +#define MAP_KEY 2 +#define MAP_ALL 3 + signed char pit; /* note pitch and accidental */ + unsigned char acc; + char *heads; /* comma separated list of note heads */ + int color; /* color */ + signed char print_pit; /* print pitch */ + unsigned char print_acc; /* print acc */ +}; +struct map { /* voice mapping */ + struct map *next; /* name linkage */ + char *name; + struct note_map *notes; /* mapping of the notes */ +}; +extern struct map *maps; /* note mappings */ + +struct note { /* note head */ + int len; /* note duration (# pts in [1] if space) */ + signed char pit; /* absolute pitch from source - used for ties and map */ + unsigned char acc; /* code for accidental & index in micro_tb */ + unsigned char sl1; /* slur start */ + char sl2; /* number of slur ends */ + char ti1; /* flag to start tie here */ + char hlen; /* length of the head string */ + char invisible; /* alternate note head */ + float shhd; /* horizontal head shift (#pts if space) */ + float shac; /* horizontal accidental shift */ + char *head; /* head */ + int color; /* heads when note mapping */ +}; + +struct notes { /* note chord or rest */ + struct note notes[MAXHD]; /* note heads */ + unsigned char slur_st; /* slurs starting here (2 bits array) */ + char slur_end; /* number of slurs ending here */ + signed char brhythm; /* broken rhythm */ + unsigned char microscale; /* microtone denominator - 1 */ + float sdx; /* x offset of the stem */ + struct decos dc; /* decorations */ +}; + +extern int severity; + +extern char *deco[256]; + +struct FONTSPEC { + int fnum; /* index to font tables in format.c */ + float size; + float swfac; +}; +extern char *fontnames[MAXFONTS]; /* list of font names */ + +/* lyrics */ +#define LY_HYPH 0x10 /* replacement character for hyphen */ +#define LY_UNDER 0x11 /* replacement character for underscore */ +#define MAXLY 16 /* max number of lyrics */ +struct lyl { + struct FONTSPEC *f; /* font */ + float w; /* width */ + float s; /* shift / note */ + char t[256]; /* word (dummy size) */ +}; +struct lyrics { + struct lyl *lyl[MAXLY]; /* ptr to lyric lines */ +}; + +/* guitar chord / annotations */ +#define MAXGCH 8 /* max number of guitar chords / annotations */ +struct gch { + char type; /* ann. char, 'g' gchord, 'r' repeat, '\0' end */ + unsigned char idx; /* index in as.text */ + unsigned char font; /* font */ + char box; /* 1 if in box */ + float x, y; /* x y offset / note + (top or bottom) of staff */ + float w; /* width */ +}; + +/* positions / directions - see SL_xxx */ +struct posit_s { + unsigned short dyn:4; /* %%dynamic */ + unsigned short gch:4; /* %%gchord */ + unsigned short orn:4; /* %%ornament */ + unsigned short voc:4; /* %%vocal */ + unsigned short vol:4; /* %%volume */ + unsigned short std:4; /* %%stemdir */ + unsigned short gsd:4; /* %%gstemdir */ +}; + +/* music element */ +struct SYMBOL { /* struct for a drawable symbol */ + struct SYMBOL *abc_next, *abc_prev; /* source linkage */ + struct SYMBOL *next, *prev; /* voice linkage */ + struct SYMBOL *ts_next, *ts_prev; /* time linkage */ + struct SYMBOL *extra; /* extra symbols (grace notes, tempo... */ + char abc_type; /* ABC symbol type */ +#define ABC_T_NULL 0 +#define ABC_T_INFO 1 /* (text[0] gives the info type) */ +#define ABC_T_PSCOM 2 +#define ABC_T_CLEF 3 +#define ABC_T_NOTE 4 +#define ABC_T_REST 5 +#define ABC_T_BAR 6 +#define ABC_T_EOLN 7 +#define ABC_T_MREST 8 /* multi-measure rest */ +#define ABC_T_MREP 9 /* measure repeat */ +#define ABC_T_V_OVER 10 /* voice overlay */ +#define ABC_T_TUPLET 11 + unsigned char type; /* symbol type */ +#define NO_TYPE 0 /* invalid type */ +#define NOTEREST 1 /* valid symbol types */ +#define SPACE 2 +#define BAR 3 +#define CLEF 4 +#define TIMESIG 5 +#define KEYSIG 6 +#define TEMPO 7 +#define STAVES 8 +#define MREST 9 +#define PART 10 +#define GRACE 11 +#define FMTCHG 12 +#define TUPLET 13 +#define STBRK 14 +#define CUSTOS 15 +#define NSYMTYPES 16 + unsigned char voice; /* voice (0..nvoice) */ + unsigned char staff; /* staff (0..nstaff) */ + unsigned char nhd; /* number of notes in chord - 1 */ + signed char pits[MAXHD]; /* pitches / clef */ + int dur; /* main note duration */ + int time; /* starting time */ + unsigned int sflags; /* symbol flags */ +#define S_EOLN 0x0001 /* end of line */ +#define S_BEAM_ST 0x0002 /* beam starts here */ +#define S_BEAM_BR1 0x0004 /* 2nd beam must restart here */ +#define S_BEAM_BR2 0x0008 /* 3rd beam must restart here */ +#define S_BEAM_END 0x0010 /* beam ends here */ +#define S_CLEF_AUTO 0x0020 /* auto clef (when clef) */ +#define S_IN_TUPLET 0x0040 /* in a tuplet */ +#define S_TREM2 0x0080 /* tremolo on 2 notes */ +#define S_RRBAR 0x0100 /* right repeat bar (when bar) */ +#define S_XSTEM 0x0200 /* cross-staff stem (when note) */ +#define S_BEAM_ON 0x0400 /* continue beaming */ +#define S_SL1 0x0800 /* some chord slur start */ +#define S_SL2 0x1000 /* some chord slur end */ +#define S_TI1 0x2000 /* some chord tie start */ +#define S_PERC 0x4000 /* percussion */ +#define S_RBSTOP 0x8000 // end of repeat bracket +#define S_FEATHERED_BEAM 0x00010000 /* feathered beam */ +#define S_REPEAT 0x00020000 /* sequence / measure repeat */ +#define S_NL 0x00040000 /* start of new music line */ +#define S_SEQST 0x00080000 /* start of vertical sequence */ +#define S_SECOND 0x00100000 /* symbol on a secondary voice */ +#define S_FLOATING 0x00200000 /* symbol on a floating voice */ +#define S_NOREPBRA 0x00400000 /* don't print the repeat bracket */ +#define S_TREM1 0x00800000 /* tremolo on 1 note */ +#define S_TEMP 0x01000000 /* temporary symbol */ +#define S_SHIFTUNISON_1 0x02000000 /* %%shiftunison 1 */ +#define S_SHIFTUNISON_2 0x04000000 /* %%shiftunison 2 */ +#define S_NEW_SY 0x08000000 /* staff system change (%%staves) */ +#define S_RBSTART 0x10000000 // start of repeat bracket + struct posit_s posit; /* positions / directions */ + signed char stem; /* 1 / -1 for stem up / down */ + signed char combine; /* voice combine */ + signed char nflags; /* number of note flags when > 0 */ + char dots; /* number of dots */ + unsigned char head; /* head type */ +#define H_FULL 0 +#define H_EMPTY 1 +#define H_OVAL 2 +#define H_SQUARE 3 + signed char multi; /* multi voice in the staff (+1, 0, -1) */ + signed char nohdi1; /* no head index (for unison) / nb of repeat */ + signed char nohdi2; + signed char doty; /* NOTEREST: y pos of dot when voices overlap + * STBRK: forced + * FMTCHG REPEAT: infos */ + short aux; /* auxillary information: + * - CLEF: small clef + * - KEYSIG: old key signature + * - BAR: new bar number + * - TUPLET: tuplet format + * - NOTE: tremolo number / feathered beam + * - FMTCHG (format change): subtype */ +#define PSSEQ 0 /* postscript sequence */ +#define SVGSEQ 1 /* SVG sequence */ +#define REPEAT 2 /* repeat sequence or measure + * doty: # measures if > 0 + * # notes/rests if < 0 + * nohdi1: # repeat */ + int color; + float x; /* x offset */ + signed char y; /* y offset of note head */ + signed char ymn, ymx; /* min, max, note head y offset */ + signed char mid; // y offset of the staff middle line + float xmx; /* max h-pos of a head rel to top + * width when STBRK */ + float xs, ys; /* coord of stem end / bar height */ + float wl, wr; /* left, right min width */ + float space; /* natural space before symbol */ + float shrink; /* minimum space before symbol */ + float xmax; /* max x offset */ + struct gch *gch; /* guitar chords / annotations */ + struct lyrics *ly; /* lyrics */ + + char state; /* symbol state in file/tune */ +#define ABC_S_GLOBAL 0 /* global */ +#define ABC_S_HEAD 1 /* in header (after X:) */ +#define ABC_S_TUNE 2 /* in tune (after K:) */ + unsigned short flags; +#define ABC_F_ERROR 0x0001 /* error around this symbol */ +#define ABC_F_INVIS 0x0002 /* invisible symbol */ +#define ABC_F_SPACE 0x0004 /* space before a note */ +#define ABC_F_STEMLESS 0x0008 /* note with no stem */ +#define ABC_F_LYRIC_START 0x0010 /* may start a lyric here */ +#define ABC_F_GRACE 0x0020 /* grace note */ +#define ABC_F_GR_END 0x0040 /* end of grace note sequence */ +#define ABC_F_SAPPO 0x0080 /* short appoggiatura */ +#define ABC_F_RBSTART 0x0100 // start of repeat bracket and mark +#define ABC_F_RBSTOP 0x0200 // end of repeat bracket and mark + unsigned short colnum; /* ABC source column number */ + int linenum; /* ABC source line number */ + char *fn; /* ABC source file name */ + char *text; /* main text (INFO, PSCOM), + * guitar chord (NOTE, REST, BAR) */ + union { /* type dependent part */ + struct key_s { /* K: info */ + signed char sf; /* sharp (> 0) flats (< 0) */ + char empty; /* clef alone if 1, 'none' if 2 */ + char exp; /* exp (1) or mod (0) */ +// char mode; /* mode */ +// /* 0: Ionian, 1: Dorian, 2: Phrygian, 3: Lydian, +// * 4: Mixolydian, 5: Aeolian, 6: Locrian */ + char instr; /* specific instrument */ +#define K_HP 1 /* bagpipe */ +#define K_Hp 2 +#define K_DRUM 3 /* percussion */ + signed char nacc; /* number of explicit accidentals */ + signed char cue; /* cue voice (scale 0.7) */ + signed char octave; /* 'octave=' */ +#define NO_OCTAVE 10 /* no 'octave=' */ + unsigned char microscale; /* microtone denominator - 1 */ + char clef_delta; /* clef delta */ + char key_delta; // tonic base + char *stafflines; + float staffscale; + signed char pits[8]; + unsigned char accs[8]; + } key; + struct { /* L: info */ + int base_length; /* basic note length */ + } length; + struct meter_s { /* M: info */ + short wmeasure; /* duration of a measure */ + unsigned char nmeter; /* number of meter elements */ + char expdur; /* explicit measure duration */ +#define MAX_MEASURE 16 + struct { + char top[8]; /* top value */ + char bot[2]; /* bottom value */ + } meter[MAX_MEASURE]; + } meter; + struct { /* Q: info */ + char *str1; /* string before */ + short beats[4]; /* up to 4 beats */ + short circa; /* "ca. " */ + short tempo; /* number of beats per mn or */ + short new_beat; /* old beat */ + char *str2; /* string after */ + } tempo; + struct { /* V: info */ + char id[VOICE_ID_SZ]; /* voice ID */ + char *fname; /* full name */ + char *nname; /* nick name */ + float scale; /* != 0 when change */ + unsigned char voice; /* voice number */ + signed char octave; /* 'octave=' - same as in K: */ + char merge; /* merge with previous voice */ + signed char stem; /* have stems up or down (2 = auto) */ + signed char gstem; /* have grace stems up or down (2 = auto) */ + signed char dyn; /* have dynamic marks above or below the staff */ + signed char lyrics; /* have lyrics above or below the staff */ + signed char gchord; /* have gchord above or below the staff */ + signed char cue; /* cue voice (scale 0.7) */ + char *stafflines; + float staffscale; + } voice; + struct { /* bar, mrest or mrep */ + int type; + char repeat_bar; + char len; /* len if mrest or mrep */ + char dotted; + struct decos dc; /* decorations */ + } bar; + struct clef_s { /* clef */ + char *name; /* PS drawing function */ + signed char type; +#define TREBLE 0 +#define ALTO 1 +#define BASS 2 +#define PERC 3 +#define AUTOCLEF 4 + char line; + signed char octave; /* '+8' / '-8' */ + signed char transpose; /* if '^8' / '_8' */ + char invis; /* clef 'none' */ + char check_pitch; /* check if old abc2ps transposition */ + } clef; + struct notes note; /* note, rest */ + struct { /* user defined accent */ + unsigned char symbol; + unsigned char value; + } user; + struct { + char type; /* 0: end of line + * 1: continuation ('\') + * 2: line break ('!') */ + } eoln; + struct { /* voice overlay */ + char type; +#define V_OVER_V 0 /* & */ +#define V_OVER_S 1 /* (& */ +#define V_OVER_E 2 /* &) */ + unsigned char voice; + } v_over; + struct { /* tuplet */ + char p_plet, q_plet, r_plet; + } tuplet; + } u; +}; + +/* parse definition */ +struct parse { + struct SYMBOL *first_sym; /* first symbol */ + struct SYMBOL *last_sym; /* last symbol */ + int abc_vers; /* ABC version = (H << 16) + (M << 8) + L */ + char *deco_tb[DC_NAME_SZ]; /* decoration names */ + unsigned short micro_tb[MAXMICRO]; /* microtone values [ (n-1) | (d-1) ] */ + int abc_state; /* parser state */ +}; +extern struct parse parse; + +#define FONT_UMAX 10 /* max number of user fonts 0..9 */ +enum e_fonts { + ANNOTATIONFONT = FONT_UMAX, + COMPOSERFONT, + FOOTERFONT, + GCHORDFONT, + HEADERFONT, + HISTORYFONT, + INFOFONT, + MEASUREFONT, + PARTSFONT, + REPEATFONT, + SUBTITLEFONT, + TEMPOFONT, + TEXTFONT, + TITLEFONT, + VOCALFONT, + VOICEFONT, + WORDSFONT, + FONT_DYN /* index of dynamic fonts (gch, an, ly) */ +}; +#define FONT_DYNX 12 /* number of dynamic fonts */ +#define FONT_MAX (FONT_DYN + FONT_DYNX) /* whole number of fonts */ + +struct FORMAT { /* struct for page layout */ + float pageheight, pagewidth; + float topmargin, botmargin, leftmargin, rightmargin; + float topspace, wordsspace, titlespace, subtitlespace, partsspace; + float composerspace, musicspace, vocalspace, textspace; + float breaklimit, maxshrink, lineskipfac, parskipfac, stemheight; + float gutter, indent, infospace, slurheight, notespacingfactor, scale; + float staffsep, sysstaffsep, maxstaffsep, maxsysstaffsep, stretchlast; + int abc2pscompat, alignbars, aligncomposer, autoclef; + int barsperstaff, breakoneoln, bstemdown, cancelkey, capo; + int combinevoices, contbarnb, continueall, custos; + int dblrepbar, decoerr, dynalign, flatbeams, infoline; + int gchordbox, graceslurs, graceword,gracespace, hyphencont; + int keywarn, landscape, linewarn; + int measurebox, measurefirst, measurenb, micronewps; + int oneperpage; +#ifdef HAVE_PANGO + int pango; +#endif + int partsbox, pdfmark; + int rbdbstop, rbmax, rbmin; + int setdefl, shiftunison, splittune, squarebreve; + int staffnonote, straightflags, stretchstaff; + int textoption, titlecaps, titleleft, titletrim; + int timewarn, transpose, tuplets; + char *bgcolor, *dateformat, *header, *footer, *titleformat; + char *musicfont; + struct FONTSPEC font_tb[FONT_MAX]; + char ndfont; /* current index of dynamic fonts */ + unsigned char gcf, anf, vof; /* fonts for guitar chords, + * annotations and lyrics */ + unsigned int fields[2]; /* info fields to print + *[0] is 'A'..'Z', [1] is 'a'..'z' */ + struct posit_s posit; +}; + +extern struct FORMAT cfmt; /* current format */ +extern struct FORMAT dfmt; /* global format */ + +typedef struct SYMBOL *INFO[26]; /* information fields ('A' .. 'Z') */ +extern INFO info; + +extern char *outbuf; /* output buffer.. should hold one tune */ +extern int outbufsz; /* size of outbuf */ +extern char *mbf; /* where to PUTx() */ +extern int use_buffer; /* 1 if lines are being accumulated */ + +extern int outft; /* last font in the output file */ +extern int tunenum; /* number of current tune */ +extern int pagenum; /* current page number */ +extern int pagenum_nr; /* current page (non-resettable) */ +extern int nbar; /* current measure number */ +extern int in_page; +extern int defl; /* decoration flags */ +#define DEF_NOST 0x01 /* long deco with no start */ +#define DEF_NOEN 0x02 /* long deco with no end */ +#define DEF_STEMUP 0x04 /* stem up (1) or down (0) */ + + /* switches modified by flags: */ +extern int quiet; /* quiet mode */ +extern int secure; /* secure mode */ +extern int annotate; /* output source references */ +extern int pagenumbers; /* write page numbers */ +extern int epsf; /* 1: EPSF, 2: SVG, 3: embedded ABC */ +extern int svg; /* 1: SVG, 2: XHTML */ +extern int showerror; /* show the errors */ +extern int pipeformat; /* format for bagpipes */ + +extern char outfn[FILENAME_MAX]; /* output file name */ +extern char *in_fname; /* current input file name */ +extern time_t mtime; /* last modification time of the input file */ + +extern int file_initialized; /* for output file */ +extern FILE *fout; /* output file */ + +#define MAXTBLT 8 +struct tblt_s { + char *head; /* PS head function */ + char *note; /* PS note function */ + char *bar; /* PS bar function */ + float wh; /* width of head */ + float ha; /* height above the staff */ + float hu; /* height under the staff */ + short pitch; /* pitch when no associated 'w:' / 0 */ + char instr[2]; /* instrument pitch */ +}; +extern struct tblt_s *tblts[MAXTBLT]; + +#define MAXCMDTBLT 4 /* max number of -T in command line */ +struct cmdtblt_s { + short index; /* tablature number */ + short active; /* activate or not */ + char *vn; /* voice name */ +}; +extern struct cmdtblt_s cmdtblts[MAXCMDTBLT]; +extern int ncmdtblt; + +extern int s_argc; /* command line arguments */ +extern char **s_argv; + +struct STAFF_S { + struct SYMBOL *s_clef; /* clef at start of music line */ + char empty; /* no symbol on this staff */ + char *stafflines; + float staffscale; + short botbar, topbar; /* bottom and top of bar */ + float y; /* y position */ + float top[YSTEP], bot[YSTEP]; /* top/bottom y offsets */ +}; +extern struct STAFF_S staff_tb[MAXSTAFF]; +extern int nstaff; /* (0..MAXSTAFF-1) */ + +struct VOICE_S { + char id[VOICE_ID_SZ]; /* voice id */ + /* generation */ + struct VOICE_S *next; /* link */ + struct SYMBOL *sym; /* associated symbols */ + struct SYMBOL *last_sym; /* last symbol while scanning */ + struct SYMBOL *lyric_start; /* start of lyrics while scanning */ + char *nm; /* voice name */ + char *snm; /* voice subname */ + char *bar_text; /* bar text at start of staff when bar_start */ + struct gch *bar_gch; /* bar text */ + struct SYMBOL *tie; /* note with ties of previous line */ + struct SYMBOL *rtie; /* note with ties before 1st repeat bar */ + struct tblt_s *tblts[2]; /* tablatures */ + float scale; /* scale */ + int time; /* current time (parsing) */ + struct SYMBOL *s_clef; /* clef at end of music line */ + struct key_s key; /* current key signature */ + struct meter_s meter; /* current time signature */ + struct key_s ckey; /* key signature while parsing */ + struct key_s okey; /* original key signature (parsing) */ + unsigned hy_st; /* lyrics hyphens at start of line (bit array) */ + unsigned ignore:1; /* ignore this voice (%%staves) */ + unsigned second:1; /* secondary voice in a brace/parenthesis */ + unsigned floating:1; /* floating voice in a brace system */ + unsigned bar_repeat:1; /* bar at start of staff is a repeat bar */ + unsigned norepbra:1; /* don't display the repeat brackets */ + unsigned have_ly:1; /* some lyrics in this voice */ + unsigned new_name:1; /* redisplay the voice name */ + unsigned space:1; /* have a space before the next note (parsing) */ + unsigned perc:1; /* percussion */ + unsigned auto_len:1; /* auto L: (parsing) */ + short wmeasure; /* measure duration (parsing) */ + short transpose; /* transposition (parsing) */ + short bar_start; /* bar type at start of staff / 0 */ + struct posit_s posit; /* positions / directions */ + signed char octave; /* octave (parsing) */ + signed char ottava; /* !8va(! ... (parsing) */ + signed char clone; /* duplicate from this voice number */ + signed char over; /* overlay of this voice number */ + unsigned char staff; /* staff (0..n-1) */ + unsigned char cstaff; /* staff (parsing) */ + unsigned char slur_st; /* slurs at start of staff */ + signed char combine; /* voice combine */ + int color; + char *stafflines; + float staffscale; + /* parsing */ + struct SYMBOL *last_note; /* last note or rest */ + char *map_name; + int ulen; /* unit note length */ + unsigned char microscale; /* microtone scale */ + unsigned char mvoice; /* main voice when voice overlay */ +}; +extern struct VOICE_S *curvoice; /* current voice while parsing */ +extern struct VOICE_S voice_tb[MAXVOICE]; /* voice table */ +extern struct VOICE_S *first_voice; /* first_voice */ + +extern struct SYMBOL *tsfirst; /* first symbol in the time linked list */ +extern struct SYMBOL *tsnext; /* next line when cut */ +extern float realwidth; /* real staff width while generating */ + +#define NFLAGS_SZ 10 /* size of note flags tables */ +#define C_XFLAGS 5 /* index of crotchet in flags tables */ +extern float space_tb[NFLAGS_SZ]; /* note spacing */ +extern float hw_tb[]; // width of note heads + +struct SYSTEM { /* staff system */ + struct SYSTEM *next; + short top_voice; /* first voice in the staff system */ + short nstaff; + struct { + short flags; +#define OPEN_BRACE 0x01 +#define CLOSE_BRACE 0x02 +#define OPEN_BRACKET 0x04 +#define CLOSE_BRACKET 0x08 +#define OPEN_PARENTH 0x10 +#define CLOSE_PARENTH 0x20 +#define STOP_BAR 0x40 +#define FL_VOICE 0x80 +#define OPEN_BRACE2 0x0100 +#define CLOSE_BRACE2 0x0200 +#define OPEN_BRACKET2 0x0400 +#define CLOSE_BRACKET2 0x0800 +#define MASTER_VOICE 0x1000 + char empty; + char *stafflines; + float staffscale; +// struct clef_s clef; + float sep, maxsep; + } staff[MAXSTAFF]; + struct { + signed char range; + unsigned char staff; + char second; + char dum; + float sep, maxsep; +// struct clef_s clef; + } voice[MAXVOICE]; +}; +extern struct SYSTEM *cursys; /* current staff system */ + +/* -- external routines -- */ +/* abcm2ps.c */ +void include_file(unsigned char *fn); +void clrarena(int level); +int lvlarena(int level); +void *getarena(int len); +void strext(char *fid, char *ext); +/* abcparse.c */ +void abc_parse(char *p, char *fname, int linenum); +void abc_eof(void); +char *get_str(char *d, + char *s, + int maxlen); +char *parse_acc_pit(char *p, + int *pit, + int *acc); +/* buffer.c */ +void a2b(char *fmt, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 1, 2))) +#endif + ; +void block_put(void); +void buffer_eob(int eot); +void marg_init(void); +void bskip(float h); +void check_buffer(void); +void init_outbuf(int kbsz); +void close_output_file(void); +void close_page(void); +float get_bposy(void); +void open_fout(void); +void write_buffer(void); +extern int (*output)(FILE *out, const char *fmt, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))) +#endif + ; +void write_eps(void); +/* deco.c */ +void deco_add(char *text); +void deco_cnv(struct decos *dc, struct SYMBOL *s, struct SYMBOL *prev); +void deco_update(struct SYMBOL *s, float dx); +float deco_width(struct SYMBOL *s); +void draw_all_deco(void); +//int draw_deco_head(int deco, float x, float y, int stem); +void draw_deco_near(void); +void draw_deco_note(void); +void draw_deco_staff(void); +float draw_partempo(int staff, float top); +void draw_measnb(void); +void init_deco(void); +void reset_deco(void); +void set_defl(int new_defl); +float tempo_width(struct SYMBOL *s); +void write_tempo(struct SYMBOL *s, + int beat, + float sc); +float y_get(int staff, + int up, + float x, + float w); +void y_set(int staff, + int up, + float x, + float w, + float y); +/* draw.c */ +void draw_sym_near(void); +void draw_all_symb(void); +float draw_systems(float indent); +void output_ps(struct SYMBOL *s, int color); +struct SYMBOL *prev_scut(struct SYMBOL *s); +void putf(float f); +void putx(float x); +void puty(float y); +void putxy(float x, float y); +void set_scale(struct SYMBOL *s); +void set_sscale(int staff); +void set_color(int color); +/* format.c */ +void define_fonts(void); +int get_textopt(char *p); +int get_font_encoding(int ft); +int get_bool(char *p); +void interpret_fmt_line(char *w, char *p, int lock); +void lock_fmt(void *fmt); +void make_font_list(void); +FILE *open_file(char *fn, + char *ext, + char *rfn); +void print_format(void); +void set_font(int ft); +void set_format(void); +void set_voice_param(struct VOICE_S *p_voice, int state, char *w, char *p); +struct tblt_s *tblt_parse(char *p); +/* front.c */ +#define FE_ABC 0 +#define FE_FMT 1 +#define FE_PS 2 +void frontend(unsigned char *s, + int ftype, + char *fname, + int linenum); +/* glyph.c */ +char *glyph_out(char *p); +void glyph_add(char *p); +/* music.c */ +void output_music(void); +void reset_gen(void); +void unlksym(struct SYMBOL *s); +/* parse.c */ +extern float multicol_start; +void do_tune(void); +void identify_note(struct SYMBOL *s, + int len, + int *p_head, + int *p_dots, + int *p_flags); +void sort_pitch(struct SYMBOL *s); +struct SYMBOL *sym_add(struct VOICE_S *p_voice, + int type); +/* subs.c */ +void bug(char *msg, int fatal); +void error(int sev, struct SYMBOL *s, char *fmt, ...); +float scan_u(char *str, int type); +float cwid(unsigned char c); +void get_str_font(int *cft, int *dft); +void set_str_font(int cft, int dft); +#ifdef HAVE_PANGO +void pg_init(void); +void pg_reset_font(void); +#endif +void put_history(void); +void put_words(struct SYMBOL *words); +void str_font(int ft); +#define A_LEFT 0 +#define A_CENTER 1 +#define A_RIGHT 2 +#define A_LYRIC 3 +#define A_GCHORD 4 +#define A_ANNOT 5 +#define A_GCHEXP 6 +void str_out(char *p, int action); +void put_str(char *str, int action); +float tex_str(char *s); +extern char tex_buf[]; /* result of tex_str() */ +#define TEX_BUF_SZ 512 +char *trim_title(char *p, struct SYMBOL *title); +void user_ps_add(char *s, char use); +void user_ps_write(void); +void write_title(struct SYMBOL *s); +void write_heading(void); +void write_user_ps(void); +void write_text(char *cmd, char *s, int job); +/* svg.c */ +void define_svg_symbols(char *title, int num, float w, float h); +void svg_def_id(char *id, int idsz); +void svg_font_switch(void); +int svg_output(FILE *out, const char *fmt, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))) +#endif + ; +void svg_write(char *buf, int len); +void svg_close(); +/* syms.c */ +void define_font(char *name, int num, int enc); +void define_symbols(void); diff -Nru abcm2ps-7.8.9/abcm2ps.rst abcm2ps-8.14.2/abcm2ps.rst --- abcm2ps-7.8.9/abcm2ps.rst 1970-01-01 00:00:00.000000000 +0000 +++ abcm2ps-8.14.2/abcm2ps.rst 2018-12-18 15:18:26.000000000 +0000 @@ -0,0 +1,662 @@ +.. + Process this file with rst2man from python-docutils + to generate a nroff manual page + +======= +abcm2ps +======= + +-------------------------------------------------- +translate ABC music notation to PostScript or SVG +-------------------------------------------------- + +SYNOPSIS +======== + + ``abcm2ps`` [global_options] ABC_file [file_options] ... + +DESCRIPTION +=========== + +``abcm2ps`` translates tunes written in +the ABC music notation format to customary sheet music scores in +PostScript or SVG. It is based on ``abc2ps`` 1.2.5 and was +developed mainly to print Baroque organ scores that have +independent voices played on multiple keyboards and a +pedal-board. The program has since been extended to support +various other notation conventions in use for sheet music. + +Options given immediately after the command name apply to +the run as a whole; options given after an ABC file name apply +to that file. + +Formatting parameters can also be set in "format files" and +in the ABC files themselves. + +OPTIONS +======= + +The list of the command line options may be known running:: + + abcm2ps -h + +The options may be grouped when they have no argument, but the +last one (ex: ``-lnGI20``). + +The options may be disabled when starting with '+' or ending with '-' +(ex: ``+MT1`` is the same as ``-MT1-``). + +The general output format is the last found in the command line. +It may be: + +-E for Encapsulated PostScript, one file per tune + +-g for SVG, one file per tune + +-v for SVG, one file per page + +-X for XHTML+SVG + +-z for (X)HTML+SVG with (X)HTML+ABC input + +(see below for more information) + +List of the options +------------------- + +\- + Read the abc file from stdin. + +\-- + Set the parameter to . + + This has the same effect as a format parameter + directly in the source file. + +-a + Maximal horizontal compression when staff breaks are + chosen automatically. Must be a float between 0 and 1. + + This correspond to the ``%%maxshrink`` + formatting parameter (default: 0.65). + +-A + This option inserts reference elements in the PostScript + or SVG output. + +-B , +B + Try to typeset bars on each staff line. + + This corresponds to the ``%%barsperstaff`` formatting parameter. + +-b + Start measure numbering at . + + This corresponds to the ``%%measurefirst`` formatting parameter. + +-c, +c + The continuation symbol is implicitly appended to each + music line. This amounts to automatic line breaking. + + This corresponds to the ``%%continueall`` formatting parameter. + +-D + Search the format files in the directory . + +-d + Set the vertical interstaff space to . + + This corresponds to the ``%%staffsep`` formatting parameter + (default: 46pt). + +-E + Produce EPS output instead of simple PS. + + In this mode, each tune goes to a different file which + name is "nnn.eps" or ".eps" (see option '-O') + + - 'nnn' is a sequence number incremented at each tune + + Output to stdout is forbidden. + + EPS files are normally embedded into Postscript documents, + but they may be a way to generate graphical images. For + example, using GhostScript:: + + abcm2ps voices -Ee7 + gs -sDEVICE=pngmono -r80 -g590x174 \ + -dBATCH -dNOPAUSE \ + -sOutputFile=quitolis.png Out001.eps + + \(the values for -g are the values of the bounding box in + the .eps, multiplied by (80 / 72), where 80 is the value + for -r, and 72 is the default resolution) + +-e [ <tune index list> ] [ <regular expression> ] + Select which tunes from an ABC file to print. + + <tune index list> is either a comma-separated list of tune + numbers (as per the ``X:`` header), or a regular expression + which will be matched against the tune headers as a whole. + The ``-e`` option must occur after an ABC file + name and applies to that file. + + Ranges of tune numbers may be specified like ``<t1>-<t2>``; + <t2> may be omitted which means + "all remaining tunes until the end of file". Note that + filtering may cause problems, e.g., with global (non-tune) + definitions in the ABC file. + + This corresponds to the ``%%select`` formatting parameter. + +-F <file>, +F + Read the format (or PostScript) file <file>. + + When omitted, the default type of a format file is '.fmt'. + + In the form '+F', the default format file ('default.fmt') is not + read. + +-f + Enable flat beams (useful for bagpipe tunes). + + This corresponds to the ``%%flatbeams`` formatting parameter. + +-G, +G + Omit slurs on grace notes. + + This corresponds to the ``%%graceslurs`` formatting parameter. + +-g + Produce SVG output instead of EPS. + + In this mode each tune goes to a different file which name + is 'Outnnn.svg' (see option '-O'). + + If the output is stdout (option '-O-'), all the SVG images + are output without XML header. + +-H + Display the current format values. + +-h + Quick help, equivalent to "abcm2ps" without any arguments. + + This also shows the default settings for some parameters. + +-I <unit> + Indent the first line of the tune by <unit> (default: 0). + + This corresponds to the ``%%indent`` formatting parameter. + +-i, +i + Insert a red cercle around the errors in the PostScript output. + +-j <int>[b], +j + Output a measure number every <int> measures. + + If <int> is 0, the measure number appears at the left of each staff. + The trailing ``b`` causes a box to be drawn + around each measure number (default: no measure numbering). + + This corresponds to the ``%%measurenb`` formatting parameter. + +-k <int> + Set the size of the PostScript output buffer in Kibytes. + + Setting this value to a higher value permits the + generation of big tunes with -E or -g. The default value is 64. + +-l, +l + Generate landscape output. + + This corresponds to the ``%%landscape`` formatting parameter. + +-M, +M + Suppress lyrics. + + See the ``%%writefields w`` formatting parameter. + +-m <unit> + Set the left margin to <unit> (default: 1.8cm). + + This corresponds to the ``%%leftmargin`` formatting parameter. + +-N <int>, +N + Number the pages. + + <int> indicates the mode: + + 0 + no page numbers + 1 + at top left + 2 + at top right + 3 + at top left on even pages, top right on odd pages + 4 + at top right on even pages, top left on odd pages + + For compatibility with previous versions, '+N' is the same as + '-N0', and '-N' is the same as '-N2'. + + If a header is defined ("%%header"), this option is ignored. + +-n, +n + Include notes and history from ABC tune ``N:`` fields. + + See the ``%%writehistory N`` formatting parameter. + +-O [ <directory> ] [ <name> ], +O + Define the output file directory and/or name. + + The directory must end with the directory separator + ('/' for unix/windows, '\\' for mac). + + By default, the output file goes to the current directory + with the name: + + 'Out.ps' for PS, + + 'Outnnn.eps' for EPS (see option '-E'), + + 'Outnnn.svg' for SVG (see options '-g' and '-v') or + + 'Out.xhtml' for XHTML+SVG (see options '-X' and '-z'). + + 'nnn' is a sequence number. + + When <name> is present, it is the name of the file, or it + replaces "Out" in the file name. + + If <name> is '=', it is replaced by the name of the ABC + source file (not for '-z'). + + If <name> is '-', the result is output to stdout (not for EPS). + '+O' resets the output file directory and name to their defaults. + +-p + Bagpipe format. + + When present, format output for bagpipe regardless of key. + +-q + Quiet mode. + + When present, only the errors are shown. + +-s <float> + Set the page scale factor to <float>. Note that the header + and footer are not scaled (default: 0.75). + + This corresponds to the ``%%scale`` formatting parameter. + +-S + Secure mode. + + When present, file inclusion (%%format and %%EPS) and PostScript + injection (%%beginps and %%postscript) are disabled. + +-T <int> [ <voice> ], +T [ <int> [<voice> ] ] + Activate or deactivate tablature drawing. + + - <int> is the tablature number as defined in ``%%tablature``. + There may be only 8 different tablatures. + + - <voice> is the voice name, full name or subname as found in V:. + When absent, apply to all voices. + + Up to 4 such commands may be defined. + + Ex: '-T1flute +T2' + +-V + Show the version number. + +-v + Produce SVG output instead of simple PS. + + In this mode each page goes to a different file which name + is 'Outnnn.svg' (see option '-O'). + +-w <unit> + Adjust the right margin such that the staff width + is <unit> (default: none). + + This corresponds to the ``%%staffwidth`` formatting parameter. + +-X + Produce XML+SVG output instead of simple PS. + + The default file name is 'Out.xhtml' (see option '-O'). + +-x, +x + Include the ``X:`` tune number in the title. + + This corresponds to the ``%%writefields`` formatting parameter. + +-z + Produce SVG images from ABC embedded in markup language files + (HTML, XHTML..). + + The source file is copied to the output file and the ABC sequences + are converted to SVG images. + The ABC sequences start by either ``%abc..`` or ``X:..`` + and stop on the first markup tag (``<..``). + + The generation creates one image per block, i.e. a music line + or a text block. For a same rendering as the other SVG generation + (-g, -v or -X), don't forget to set the line space to null, for + example enclosing the ABC sequences by:: + + <div style="line-height:0"> .. </div> + + There can be only one output file. + + Note that the default output file is 'Out.xhtml', so, don't + forget to change the file type if you generate HTML (.html) + or XML (.xml) files. + + See "sample8.html" for a source example. + +-0, +0 + Split tunes across page breaks if necessary. + + This corresponds to the ``%%splittune`` formatting parameter. + +-1, +1 + Output one tune per page. + + This corresponds to the ``%%oneperpage`` formatting parameter. + +ADDITIONAL FEATURES +=================== + +Clefs + Clefs can be given in ``K:`` and ``V:`` headers. + The full syntax is:: + + clef=<type><line>[+8|-8] + + "clef=" can be omitted when the <type> is a clef name. + + <type> denotes the clef type. It may be: + + - A note pitch (``G``, ``C``, or ``F``) + + The pitch indicates which clef is meant: + ``G`` is the treble clef, + ``C`` the alto clef and + ``F`` the bass clef. + It also gives the name of the note that appears + on the clef's line. + + - A clef name + + The available clef names are + ``treble`` (clef gives the pitch for ``G``), + ``alto`` or ``tenor`` (``C``), and + ``bass`` (``F``). + + - ``perc`` or ``P`` + + In percussion mode, accidentals change the glyphs used for + note heads. By default, sharp notes are drawn as "x" and + flat notes as circled "x". + This may be changed by redefining the PostScript functions + ``pshhd`` and ``pflhd``. + + - ``none`` + + No clef will be displayed. + + The <line> gives the number of + the line within the staff that the base clef will be written + on. The default values are 2 for the treble clef, 3 for the + alto clef, and 4 for the tenor and bass clefs. + + The "+8" and "-8" + options draw an 8 above or below the staff, respectively. + + When no clef is specified, clef changes + between "bass" + and "treble" will be inserted + automatically. + +Multi-voice typesetting + Multiple voices may be defined within the header or the + tune using:: + + V:<name> <definition> ... + + where <name> is a word consisting of letters and digits only + (like "violin1"). In the tune body, the + following notes refer to this voice until + another "V:" is encountered. + + A <definition> can be one of: + + * "clef="... + + See above + + * "name="<name> or "nm="<name> + + The <name> will be + displayed at the beginning of the first staff. It can + contain "\\n" sequences + which will force line breaks. If it contains + whitespace it must be double-quoted. + + * "subname="<name> or "snm="<name> + + The <name> will be displayed at the beginning of all staves + except for the first. It can + contain "\\n" sequences + which will force line breaks. If it contains + whitespace it must be double-quoted. + + * "merge" + + The voice goes on the same staff as the previous voice. + + * "up" or "down" + + Forces the direction of the stems for the voice. + + * "dyn=up" or "dyn=down" or "dyn=auto" + + Forces positioning of dynamic marks (above or + below the staff) or reverts to automatic positioning + (the default). + + * "gstem=up" or "gstem=down" or "gstem=auto" + + Forces the direction of the stems of grace + notes (always up or always down) or reverts to + automatic positioning (the default). + + * "stem=auto" + + Reverts to automatic positioning of note stems + (up or down) (the default). + + * "lyrics=up" or "lyrics=down" or "lyrics=auto" + + Places lyrics above or below the staff or + reverts to automatic positioning (the default) + + * "gchord=up" or "gchord=down" + + Places guitar chords above (the default) or below the staff. + + * "stafflines="<value> + + Sets the number of lines on the staff in question. (default: 5) + + * "staffscale="<value> + + Sets the scale of the associated staff up to 3. (default: 1) + + All other definitions are ignored. + +Definition of the staff system + By default, each voice goes on its own + staff. The ``%%staves <definition>`` + pseudo-comment can be used to control staff + assignment. The <definition> + consists of voice names (from ``V:``) and pairs of + parentheses, braces or brackets. + + - When a voice name is not within a pair of + special characters, it goes on a separate staff. + + - For voice names enclosed in brackets, a bracket + is displayed at the beginning of each line that joins + the staves of the voices in question. + + - For voice names enclosed in braces, all the + voices go on two staves (keyboard score). There can be + at most four voices between a single pair of braces. + + - For voice names enclosed in parentheses, all the + voices appear on a single staff. + + The ``|`` character prevents measure bars from + being drawn between two staves. + If ``%%staves`` occurs in a tune, all the + voices not mentioned will not be output at all. + + The ``%%score`` directive occurs in the ABC + draft 2.0 standard and is similar to + the ``%%staves`` specification described + above. The rules are: + + - Voice names within parentheses form a "voice + group" and go on a single staff. A voice name that is + not within parentheses forms its own voice group and + goes on a staff by itself. + + - Voice groups within braces form a "voice block" + and are preceded by a big brace in the output. This is + especially useful for keyboard music. + + - Voice groups or voice blocks within brackets + form a "voice block" and will be preceded by a big + bracket in the output. + + - If a ``|`` character occurs between two + voice groups or voice blocks, the bar lines in all of + the associated staves will be continuous. + + - A single voice surrounded by two voice groups + can be preceded by an asterisk to make it into a + "floating" voice. This means that, for each note of the + voice, a separate decision is made whether it is printed + on the preceding or the following voice group's staff. + + - Voices that appear in the tune body but not in + the ``%%score`` directive will not be output at + all. If there is no ``%%score`` directive, each + voice will be output on its own staff. + + - A ``%%score`` directive inside a tune + resets the mechanism so voices can be removed or added. + +Voice overlay + You can add notes to a staff without introducing a + complete extra voice by using the ampersand + (``&``). A single measure can be split into two voices like:: + + |F2A2Bc&F2c2bc| + + The ``(&...&...&)`` construction allows splitting multiple + measures:: + + |!f!(&GG<G|GG F=E| E2 E(_D/E)|_D D C D |C4- |C + &DC<C|CC_D C|=B,2_B,B, |_A,A,(G,/A,/)B,|F,4-|F,&)zzD=E| + + A double ampersand (``&&``) will allow + overlaying more than two lines of music but this feature has + not yet been implemented. + +Lyrics + Aligned lyrics under a staff are written as a + ``w:`` line directly below the staff line. For example:: + + edc2 edc2| + w:Three blind mice, three blind mice + + Each word in the ``w:`` line (delimited by + blanks) is associated with one note, in sequence. The + following special symbols modify this behaviour: + + ``*`` + Skips one note. + + ``-`` + Splits a word into two syllables which are + associated with two adjacent notes. A "-" is drawn + between them. + + ``|`` + Advances to the next bar line. + + ``~`` + Is output as a space, but unites two words so + they appear under a single note. + + ``_`` + Draws a thin underscore from the previous note + to the next. + + To include more than one line of lyrics, use + multiple ``w:`` lines. To include hyphens without + splitting a word over multiple notes, + use ``\-``. + + If a word starts with a digit, this is interpreted as a + stanza number and outdented a bit to the left. + +Slurs and ties + The direction of slurs and ties may be controlled using + the "(," / "('" and "-," / "-'" constructions. + +Microtone pitches + Microtone pitches are indicated by a fraction after an + accidental, as in ``^3/4c``. When omitted, the + numerator defaultes to 1 and the denominator to 2 + (so ``^/c`` is the same as ``^1/2c``). The + numerator and denominator values may not exceed 256. There + is built-in support for quarter-tone accidentals (1/2 and + 3/2 sharps and flats); for other values, rendering functions + must be defined using ``%%postscript``. + +EPS inclusion + EPS files may be included inside tunes using the + pseudo-comment ``%%EPS <file>``. + +SEE ALSO +======== + +A brief introduction referencing further documentation is +installed in <docdir>/abcm2ps/README.md. + +The ABC music notation is at http://abcnotation.com/. + +Especially, you may find a discussion of differences with the +ABC standard at http://moinejf.free.fr/abcm2ps-doc/features.xhtml +and a list of formatting options at http://moinejf.free.fr/abcm2ps-doc/. + +AUTHOR +====== + +``abcm2ps`` was written by Jean-François Moine <http://moinejf.free.fr/> +starting from ``abc2ps`` by Michael Methfessel. + +Parts of this manual have been written by Anselm Lingnau +<lingnau@debian.org> for the ``Debian`` system. + +Permission is granted to copy, distribute and/or modify this +document as long as its origin is not misrepresented. diff -Nru abcm2ps-7.8.9/abcparse.c abcm2ps-8.14.2/abcparse.c --- abcm2ps-7.8.9/abcparse.c 2014-07-12 17:03:05.000000000 +0000 +++ abcm2ps-8.14.2/abcparse.c 2018-12-18 15:18:26.000000000 +0000 @@ -1,22 +1,13 @@ /* * Generic ABC parser. * - * Copyright (C) 1998-2014 Jean-François Moine + * Copyright (C) 1998-2018 Jean-François Moine * Adapted from abc2ps, Copyright (C) 1996, 1997 Michael Methfessel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #include "config.h" @@ -25,71 +16,57 @@ #include <string.h> #include <ctype.h> -#include "abcparse.h" - -/* interface */ -static void *(*alloc_f)(int size); -static void (*free_f)(void *); -static void (*level_f)(int level); -static int client_sz; -static int keep_comment; +#include "abcm2ps.h" /* global values */ -char *deco_tb[128]; /* decoration names */ int severity; /* error severity */ -static int abc_vers; /* abc version */ -static short abc_state; /* parse state */ -static short ulen; /* unit note length set by M: or L: */ +static int ulen; /* unit note length set by M: or L: */ static short meter; /* upper value of time sig for n-plets */ static unsigned char microscale; /* current microtone scale */ static signed char vover; /* voice overlay (1: single bar, -1: multi-bar */ static char lyric_started; /* lyric started */ static char *gchord; /* guitar chord */ -static struct deco dc; /* decorations */ -static struct abcsym *deco_start; /* 1st note of the line for d: / s: */ -static struct abcsym *deco_cont; /* current symbol when d: / s: continuation */ -static unsigned short *p_micro; /* ptr to the microtone table of the tune */ - -#define VOICE_NAME_SZ 64 /* max size of a voice name */ +static struct decos dc; /* decorations */ +static struct SYMBOL *deco_start; /* 1st note of the line for d: / s: */ +static struct SYMBOL *deco_cont; /* current symbol when d: / s: continuation */ + +static int g_abc_vers, g_ulen, g_microscale; +static char g_char_tb[128]; +static char *g_deco_tb[128]; /* global decoration names */ +static unsigned short g_micro_tb[MAXMICRO]; /* global microtone values */ -static char *file; /* remaining abc file */ +static char *abc_fn; /* current source file name */ static int linenum; /* current source line number */ static int colnum; /* current source column number */ static char *abc_line; /* line being parsed */ -static struct abcsym *last_sym; /* last symbol for errors */ +static struct SYMBOL *last_sym; /* last symbol for errors */ static short nvoice; /* number of voices (0..n-1) */ -static struct { /* voice table and current pointer */ - char id[VOICE_ID_SZ]; /* voice ID */ - struct abcsym *last_note; /* last note or rest */ - short ulen; /* unit note length */ - unsigned char microscale; /* microtone scale */ - unsigned char mvoice; /* main voice when voice overlay */ -} voice_tb[MAXVOICE], *curvoice; +struct VOICE_S *curvoice; /* current voice while parsing */ + +struct parse parse; /* char table for note line parsing */ #define CHAR_BAD 0 #define CHAR_IGN 1 #define CHAR_NOTE 2 -#define CHAR_REST 3 -#define CHAR_ACC 4 -#define CHAR_GR_ST 5 -#define CHAR_DECO 6 -#define CHAR_GCHORD 7 -#define CHAR_BSLASH 8 -#define CHAR_OBRA 9 -#define CHAR_BAR 10 -#define CHAR_OPAR 11 -#define CHAR_VOV 12 -#define CHAR_SPAC 13 -#define CHAR_MINUS 14 -#define CHAR_CPAR 15 -#define CHAR_BRHY 16 -#define CHAR_DECOS 17 -#define CHAR_SLASH 18 -#define CHAR_GR_EN 19 -#define CHAR_LINEBREAK 20 +#define CHAR_GR_ST 3 +#define CHAR_DECO 4 +#define CHAR_GCHORD 5 +#define CHAR_BSLASH 6 +#define CHAR_OBRA 7 +#define CHAR_BAR 8 +#define CHAR_OPAR 9 +#define CHAR_VOV 10 +#define CHAR_SPAC 11 +#define CHAR_MINUS 12 +#define CHAR_CPAR 13 +#define CHAR_BRHY 14 +#define CHAR_DECOS 15 +#define CHAR_SLASH 16 +#define CHAR_GR_EN 17 +#define CHAR_LINEBREAK 18 static char char_tb[256] = { 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 07 */ 0, CHAR_SPAC, CHAR_LINEBREAK, 0, 0, 0, 0, 0, /* 08 - 0f */ @@ -102,22 +79,22 @@ CHAR_BAD, CHAR_BAD, CHAR_BAD, CHAR_BAD, /* 0 1 2 3 */ CHAR_BAD, CHAR_BAD, CHAR_BAD, CHAR_BAD, /* 4 5 6 7 */ CHAR_BAD, CHAR_BAD, CHAR_BAR, CHAR_BAD, /* 8 9 : ; */ - CHAR_BRHY, CHAR_ACC, CHAR_BRHY, CHAR_BAD, /* < = > ? */ + CHAR_BRHY, CHAR_NOTE, CHAR_BRHY, CHAR_BAD, /* < = > ? */ CHAR_BAD, CHAR_NOTE, CHAR_NOTE, CHAR_NOTE, /* @ A B C */ CHAR_NOTE, CHAR_NOTE, CHAR_NOTE, CHAR_NOTE, /* D E F G */ CHAR_DECO, CHAR_DECO, CHAR_DECO, CHAR_DECO, /* H I J K */ CHAR_DECO, CHAR_DECO, CHAR_DECO, CHAR_DECO, /* L M N O */ CHAR_DECO, CHAR_DECO, CHAR_DECO, CHAR_DECO, /* P Q R S */ CHAR_DECO, CHAR_DECO, CHAR_DECO, CHAR_DECO, /* T U V W */ - CHAR_REST, CHAR_DECO, CHAR_REST, CHAR_OBRA, /* X Y Z [ */ - CHAR_BSLASH, CHAR_BAR, CHAR_ACC, CHAR_ACC, /* \ ] ^ _ */ + CHAR_NOTE, CHAR_DECO, CHAR_NOTE, CHAR_OBRA, /* X Y Z [ */ + CHAR_BSLASH, CHAR_BAR, CHAR_NOTE, CHAR_NOTE, /* \ ] ^ _ */ CHAR_IGN, CHAR_NOTE, CHAR_NOTE, CHAR_NOTE, /* ` a b c */ CHAR_NOTE, CHAR_NOTE, CHAR_NOTE, CHAR_NOTE, /* d e f g */ CHAR_DECO, CHAR_DECO, CHAR_DECO, CHAR_DECO, /* h i j k */ CHAR_DECO, CHAR_DECO, CHAR_DECO, CHAR_DECO, /* l m n o */ CHAR_DECO, CHAR_DECO, CHAR_DECO, CHAR_DECO, /* p q r s */ CHAR_DECO, CHAR_DECO, CHAR_DECO, CHAR_DECO, /* t u v w */ - CHAR_REST, CHAR_REST, CHAR_REST, CHAR_GR_ST, /* x y z { */ + CHAR_NOTE, CHAR_NOTE, CHAR_NOTE, CHAR_GR_ST, /* x y z { */ CHAR_BAR, CHAR_GR_EN, CHAR_DECO, CHAR_BAD, /* | } ~ (del) */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9f */ @@ -131,22 +108,10 @@ static const char all_notes[] = "CDEFGABcdefgab"; -static char *get_line(void); -static char *parse_len(char *p, - int *p_len); -static char *parse_basic_note(char *p, - int *pitch, - int *length, - int *accidental, - int *stemless); -static int parse_info(struct abctune *t, - char *p, - char *comment); +static int parse_info(char *p); static char *parse_gchord(char *p); -static int parse_line(struct abctune *t, - char *p); -static char *parse_note(struct abctune *t, - char *p, +static int parse_line(char *p); +static char *parse_note(char *p, int flags); static void syntax(char *msg, char *q); static void vover_new(void); @@ -155,305 +120,98 @@ static void print_error(char *s, int col) { if (col >= 0) - fprintf(stderr, "Error in line %d.%d: %s\n", linenum, col, s); + fprintf(stderr, "%s:%d:%d: error: %s\n", abc_fn, linenum, col, s); else - fprintf(stderr, "Error in line %d: %s\n", linenum, s); -} - -/* -- delete an ABC symbol -- */ -void abc_delete(struct abcsym *as) -{ - switch (as->type) { - case ABC_T_INFO: - switch (as->text[0]) { - case 'Q': - if (as->u.tempo.str1) - free_f(as->u.tempo.str1); - if (as->u.tempo.value) - free_f(as->u.tempo.value); - if (as->u.tempo.str2) - free_f(as->u.tempo.str2); - break; - case 'V': - if (as->u.voice.fname) - free_f(as->u.voice.fname); - if (as->u.voice.nname) - free_f(as->u.voice.nname); - break; - } - break; - } - if (as->text) - free_f(as->text); - if (as->comment) - free_f(as->comment); - - if (as->prev) - as->prev->next = as->next; - if (as->next) - as->next->prev = as->prev; - if (as->tune->first_sym == as) - as->tune->first_sym = as->next; - if (as->tune->last_sym == as) - as->tune->last_sym = as->prev; - free_f(as); -} - -/* -- free the memory areas of all tunes -- */ -void abc_free(struct abctune *t) -{ - struct abctune *tn; - struct abcsym *s, *sn; - - if (!free_f) - return; - for (;;) { - if (!t) - break; - s = t->first_sym; - - /* free the associated symbols */ - for (;;) { - sn = s->next; - abc_delete(s); - if ((s = sn) == NULL) - break; - } - - /* free the tune */ - tn = t->next; - free_f(t); - t = tn; - } + fprintf(stderr, "%s:%d: error: %s\n", abc_fn, linenum, s); } -/* -- initialize the parser -- */ -void abc_init(void *alloc_f_api(int size), - void free_f_api(void *ptr), - void level_f_api(int level), - int client_sz_api, - int keep_comment_api) +/* -- new symbol -- */ +static struct SYMBOL *abc_new(int type, char *text) { - if (alloc_f) { - fprintf(stderr, "abc_init already initialized\n"); - return; - } - alloc_f = alloc_f_api; - free_f = free_f_api; - level_f = level_f_api; - client_sz = client_sz_api; - keep_comment = keep_comment_api; -} - -/* -- insert an ABC description -- */ -void abc_insert(char *file_api, - struct abcsym *s) -{ - struct abctune *t; - char *p; - - /* initialize */ - file = file_api; - if (level_f) - level_f(abc_state != ABC_S_GLOBAL); - abc_state = ABC_S_TUNE; - linenum = 0; - t = s->tune; - t->last_sym = s; + struct SYMBOL *s; - /* scan till end of description */ - for (;;) { - if ((p = get_line()) == NULL) - break; /* done */ - if (*p == '\0') - break; /* blank line --> done */ -/*fixme-insert: don't accept X:*/ - /* parse the music line */ - if (parse_line(t, p)) - break; - } -} - -/* -- new symbol -- */ -struct abcsym *abc_new(struct abctune *t, - char *text, - char *comment) -{ - struct abcsym *s; - - s = alloc_f(sizeof *s + client_sz); - memset(s, 0, sizeof *s + client_sz); - s->tune = t; + s = getarena(sizeof(struct SYMBOL)); + memset(s, 0, sizeof(struct SYMBOL)); if (text) { - s->text = alloc_f(strlen(text) + 1); + s->text = getarena(strlen(text) + 1); strcpy(s->text, text); } - if (comment) { - s->comment = alloc_f(strlen(comment) + 1); - strcpy(s->comment, comment); - } - if (!t->last_sym) { - t->first_sym = s; + if (!parse.last_sym) { + parse.first_sym = s; } else { - if ((s->next = t->last_sym->next) != NULL) - s->next->prev = s; - t->last_sym->next = s; - s->prev = t->last_sym; - } - last_sym = t->last_sym = s; - s->state = abc_state; + if ((s->abc_next = parse.last_sym->abc_next) != NULL) + s->abc_next->abc_prev = s; + parse.last_sym->abc_next = s; + s->abc_prev = parse.last_sym; + } + last_sym = parse.last_sym = s; + s->abc_type = type; + s->state = parse.abc_state; + s->fn = abc_fn; s->linenum = linenum; s->colnum = colnum; return s; } -/* get the ABC version */ -static void get_vers(char *p) +/* -- parse an ABC line -- */ +void abc_parse(char *p, char *fname, int ln) { - int i, j,k; - - i = j = k = 0; - if (sscanf(p, "%d.%d.%d", &i, &j, &k) != 3) - if (sscanf(p, "%d.%d", &i, &j) != 2) - sscanf(p, "%d", &i); - abc_vers = (i << 16) + (j << 8) + k; -} - -/* -- parse an ABC file -- */ -struct abctune *abc_parse(char *file_api) -{ - struct abctune *first_tune = NULL; - struct abctune *t, *last_tune; - /* saved global variables */ - int g_abc_vers, g_ulen, g_microscale; - char *p; - char g_char_tb[128]; - - /* initialize */ - file = file_api; - t = NULL; - abc_state = ABC_S_GLOBAL; - if (level_f) - level_f(0); - linenum = 0; - last_tune = NULL; - g_abc_vers = g_ulen = g_microscale = 0; /* (have gcc happy) */ - - /* scan till end of file */ - for (;;) { - if ((p = get_line()) == NULL) { - if (abc_state == ABC_S_HEAD) { - syntax("Unexpected EOF in header definition", - p); - severity = 1; - } - if (t) - t->abc_vers = abc_vers; - if (abc_state != ABC_S_GLOBAL) { - abc_vers = g_abc_vers; - ulen = g_ulen; - microscale = g_microscale; - memcpy(char_tb, g_char_tb, sizeof g_char_tb); - } - break; /* done */ - } + abc_fn = fname; + linenum = ln; + abc_line = p; - /* start a new tune if not done */ - if (!t) { - if (*p == '\0') - continue; - t = alloc_f(sizeof *t); - memset(t, 0 , sizeof *t); - if (!last_tune) - first_tune = t; - else - last_tune->next = t; - last_tune = t; - p_micro = t->micro_tb; - meter = 0; - } - - /* parse the music line */ - switch (parse_line(t, p)) { - case 2: /* start of tune */ - g_abc_vers = abc_vers; - g_ulen = ulen; - g_microscale = microscale; - memcpy(g_char_tb, char_tb, sizeof g_char_tb); - break; - case 1: /* end of tune */ - t->abc_vers = abc_vers; - abc_state = ABC_S_GLOBAL; - t = NULL; - abc_vers = g_abc_vers; - ulen = g_ulen; - microscale = g_microscale; - memcpy(char_tb, g_char_tb, sizeof g_char_tb); - if (level_f) - level_f(0); - if (dc.n > 0) - syntax("Decoration without symbol", 0); - dc.n = dc.h = dc.s = 0; - break; - } + /* parse the music line */ + switch (parse_line(p)) { + case 2: /* start of tune (X:) */ + g_abc_vers = parse.abc_vers; + g_ulen = ulen; + g_microscale = microscale; + + meter = 2; + memcpy(g_char_tb, char_tb, sizeof g_char_tb); + memcpy(g_deco_tb, parse.deco_tb, sizeof g_deco_tb); + memcpy(g_micro_tb, parse.micro_tb, sizeof g_micro_tb); + break; + case 1: /* end of tune */ + if (parse.first_sym) { + do_tune(); + parse.first_sym = parse.last_sym = NULL; + } + parse.abc_state = ABC_S_GLOBAL; + parse.abc_vers = g_abc_vers; + ulen = g_ulen; + microscale = g_microscale; + memcpy(char_tb, g_char_tb, sizeof g_char_tb); + memcpy(parse.deco_tb, g_deco_tb, sizeof parse.deco_tb); + memcpy(parse.micro_tb, g_micro_tb, sizeof parse.micro_tb); + lvlarena(0); + if (dc.n > 0) + syntax("Decoration without symbol", 0); + dc.n = 0; + break; } - return first_tune; } -/* -- cut off after % and remove trailing blanks -- */ -static char *decomment_line(char *p) +/* treat the end of file */ +void abc_eof(void) { - char *q, c, *comment = NULL; - - q = p; - for (;;) { - c = *p; - if (c == '\0') - break; - if (c == '\\') { - p++; - if (*p == '\0') - return 0; - p++; - continue; - } - if (c == '%') { - if (keep_comment) { - comment = p + 1; - break; - } - break; - } - if (c == '"') { - for (;;) { - p++; - if (*p == '\0') - break; - if (*p == '"' && p[-1] != '\\') { - p++; - break; - } - } - } else { - p++; - } +// if (parse.abc_state == ABC_S_HEAD) +// severity = 1; + do_tune(); + parse.first_sym = parse.last_sym = NULL; + if (parse.abc_state != ABC_S_GLOBAL) { + parse.abc_vers = g_abc_vers; + ulen = g_ulen; + microscale = g_microscale; + memcpy(char_tb, g_char_tb, sizeof g_char_tb); } - - /* remove the trailing blanks */ - while (p > q) { - c = *--p; - if (!isspace((unsigned char) c)) { - p[1] = '\0'; - break; - } - } - return comment; } /* -- treat the broken rhythm '>' and '<' -- */ -static void broken_rhythm(struct note *note, +static void broken_rhythm(struct SYMBOL *s, int num) /* >0: do dot, <0: do half */ { + struct notes *notes = &s->u.note; int l, m, n; num *= 2; @@ -461,19 +219,19 @@ if (num == 6) num = 8; n = num * 2 - 1; - for (m = 0; m <= note->nhd; m++) - note->lens[m] = (note->lens[m] * n) / num; + for (m = 0; m <= s->nhd; m++) + notes->notes[m].len = (notes->notes[m].len * n) / num; } else { n = -num; if (n == 6) n = 8; - for (m = 0; m <= note->nhd; m++) - note->lens[m] /= n; + for (m = 0; m <= s->nhd; m++) + notes->notes[m].len /= n; } - l = note->lens[0]; - for (m = 1; m <= note->nhd; m++) - if (note->lens[m] < l) - l = note->lens[m]; + l = notes->notes[0].len; + for (m = 1; m <= s->nhd; m++) + if (notes->notes[m].len < l) + l = notes->notes[m].len; } /* -- check for the '!' as end of line (ABC2Win) -- */ @@ -499,9 +257,11 @@ static char *parse_extra(char *p, char **p_name, char **p_middle, - char **p_lines, + char **p_stlines, char **p_scale, - char **p_octave) + char **p_octave, + char **p_cue, + char **p_map) { for (;;) { if (strncmp(p, "clef=", 5) == 0 @@ -513,11 +273,13 @@ if (*p_name) syntax("Double clef name", p); *p_name = p; - } else if (strncmp(p, "microscale=", 11) == 0) { + } else if (strncmp(p, "microscale=", 11) == 0 + || strncmp(p, "uscale=", 7) == 0) { int i; - i = atoi(p + 11); - if (i < 4 || i > 256) + p += p[0] == 'm' ? 11 : 7; + i = atoi(p); + if (i < 4 || i >= 256) syntax("Invalid value in microscale=", p); else microscale = i; @@ -531,16 +293,51 @@ syntax("Double octave=", p); *p_octave = p + 7; } else if (strncmp(p, "stafflines=", 11) == 0) { - if (*p_lines) + int l; + char *q; + + if (*p_stlines) syntax("Double stafflines", p); - *p_lines = p + 11; + p += 11; + if (isdigit((unsigned char) *p)) { + switch (atoi(p)) { + case 0: *p_stlines = "..."; break; + case 1: *p_stlines = "..|"; break; + case 2: *p_stlines = ".||"; break; + case 3: *p_stlines = ".|||"; break; + case 4: *p_stlines = "||||"; break; + case 5: *p_stlines = "|||||"; break; + case 6: *p_stlines = "||||||"; break; + case 7: *p_stlines = "|||||||"; break; + case 8: *p_stlines = "||||||||"; break; + default: + syntax("Bad number of lines", p); + break; + } + } else { + q = p; + while (!isspace((unsigned char) *p) && *p != '\0') + p++; + l = p - q; + *p_stlines = getarena(l + 1); + strncpy(*p_stlines, q, l); + (*p_stlines)[l] = '\0'; + } } else if (strncmp(p, "staffscale=", 11) == 0) { if (*p_scale) syntax("Double staffscale", p); *p_scale = p + 11; - } else if (strncmp(p, "transpose=", 10) == 0 - || strncmp(p, "t=", 2) == 0) { - ; /* ignored */ + } else if (strncmp(p, "cue=", 4) == 0) { + if (*p_cue) + syntax("Double cue", p); + *p_cue = p + 4; + } else if (strncmp(p, "map=", 4) == 0) { + if (*p_map) + syntax("Double map", p); + *p_map = p + 4; +// } else if (strncmp(p, "transpose=", 10) == 0 +// || strncmp(p, "t=", 2) == 0) { +// ; /* ignored - abcMIDI */ } else { break; } @@ -556,12 +353,12 @@ /* -- parse a decoration 'xxx<decosep>' -- */ static char *get_deco(char *p, - unsigned char *p_deco) + unsigned char *p_dc) { char *q, sep, **t; unsigned i, l; - *p_deco = 0; + *p_dc = 0; q = p; sep = q[-1]; if (char_tb[(unsigned char) sep] == CHAR_DECOS) { @@ -582,26 +379,26 @@ l = p - q; if (*p == sep) p++; - for (i = 1, t = &deco_tb[1]; - *t && i < 128; + for (i = 1, t = &parse.deco_tb[1]; + *t && i < DC_NAME_SZ; i++, t++) { if (strlen(*t) == l && strncmp(*t, q, l) == 0) { - *p_deco = i + 128; + *p_dc = i + 128; return p; } } /* new decoration */ - if (i < 128) { - if (level_f && abc_state != ABC_S_GLOBAL) - level_f(0); - *t = alloc_f(l + 1); - if (level_f && abc_state != ABC_S_GLOBAL) - level_f(1); + if (i < DC_NAME_SZ) { +// if (parse.abc_state != ABC_S_GLOBAL) +// lvlarena(0); + *t = getarena(l + 1); +// if (parse.abc_state != ABC_S_GLOBAL) +// lvlarena(1); memcpy(*t, q, l); (*t)[l] = '\0'; - *p_deco = i + 128; + *p_dc = i + 128; } else { syntax("Too many decoration types", q); } @@ -610,20 +407,20 @@ /* -- parse a list of accidentals (K:) -- */ static char *parse_acc(char *p, - struct abcsym *s) + struct SYMBOL *s) { - int pit, len, acc, nostem; + int pit, acc; unsigned nacc; - if (s->u.key.empty == 2) - syntax("cannot have 'none' and a list of accidentals", p); nacc = 0; for (;;) { if (nacc >= sizeof s->u.key.pits) { syntax("Too many accidentals", p); break; } - p = parse_basic_note(p, &pit, &len, &acc, &nostem); + p = parse_acc_pit(p, &pit, &acc); + if (acc < 0) + break; s->u.key.pits[nacc] = pit; s->u.key.accs[nacc++] = acc; while (isspace((unsigned char) *p)) @@ -640,11 +437,9 @@ } /* -- parse a clef (K: or V:) -- */ -static void parse_clef(struct abcsym *s, +static void parse_clef(struct SYMBOL *s, char *name, - char *middle, - char *lines, - char *scale) + char *middle) { int clef = -1; int transpose = 0; @@ -658,7 +453,7 @@ switch (*name) { case '\"': name = get_str(str, name, sizeof str); - s->u.clef.name = alloc_f(strlen(str) + 1); + s->u.clef.name = getarena(strlen(str) + 1); strcpy(s->u.clef.name, str); clef = TREBLE; break; @@ -689,6 +484,7 @@ break; case 'P': clef = PERC; + clef_line = 3; break; } if (clef >= 0) { @@ -725,6 +521,10 @@ name += 5; } else if (!strncmp(name, "perc", 4)) { clef = PERC; + clef_line = 3; + name += 4; + } else if (!strncmp(name, "auto", 4)) { + clef = AUTOCLEF; name += 4; } else if (strncmp(name, "none", 4) == 0) { clef = TREBLE; @@ -733,19 +533,13 @@ name += 4; } else { syntax("Unknown clef", name); + clef = TREBLE; } } if (clef >= 0) { - switch (*name) { - case '1': - case '2': - case '3': - case '4': - case '5': + if (isdigit((unsigned char) *name)) clef_line = *name++ - '0'; - break; - } if (name[1] == '8') { switch (*name) { case '^': @@ -763,13 +557,15 @@ } if (middle) { - int pit, len, acc, nostem, l; + int pit, acc, l; static const char line_tb[7] = {ALTO, TREBLE, ALTO, BASS, ALTO, BASS, ALTO}; warn = middle; /* 'middle=<note pitch>' */ - parse_basic_note(middle, &pit, &len, &acc, &nostem); + parse_acc_pit(middle, &pit, &acc); + if (acc < 0) // if error + pit = 22; if (clef < 0) clef = line_tb[(pit + 7) % 7]; @@ -799,26 +595,6 @@ s->u.clef.type = clef; s->u.clef.line = clef_line; s->u.clef.transpose = transpose; - s->u.clef.stafflines = -1; - s->u.clef.staffscale = 0; - if (lines) { - int l; - - l = atoi(lines); - if ((unsigned) l < 10) - s->u.clef.stafflines = l; - else - syntax("Bad value of stafflines", lines); - } - if (scale) { - float sc; - - sc = atof(scale); - if (sc >= 0.5 && sc <= 3) - s->u.clef.staffscale = sc; - else - syntax("Bad value of staffscale", scale); - } if (warn) { int sev_sav; @@ -848,30 +624,25 @@ /* -- parse a 'K:' -- */ static void parse_key(char *p, - struct abcsym *s) + struct SYMBOL *s) { - int sf, mode; - char *clef_name, *clef_middle, *clef_lines, *clef_scale; - char *p_octave; + int sf, empty, instr; +// int mode; + char *clef_name, *clef_middle, *clef_stlines, *clef_scale; + char *p_octave, *p_cue, *p_map; + + // set important default values +// s->u.key.stafflines = "|||||"; + s->u.key.octave = NO_OCTAVE; if (*p == '\0') { - s->u.key.empty = 2; + s->u.key.empty = 1; return; } - if (strncasecmp(p, "none", 4) == 0) { - s->u.key.empty = 2; - p += 4; - while (isspace((unsigned char) *p)) - p++; - if (*p == '\0') - return; - } - clef_name = clef_middle = clef_lines = clef_scale = NULL; - p_octave = NULL; - p = parse_extra(p, &clef_name, &clef_middle, &clef_lines, - &clef_scale, &p_octave); sf = 0; - mode = MAJOR; +// mode = 0; + empty = 0; + instr = 0; switch (*p++) { case 'F': sf = -1; break; case 'B': sf++; @@ -882,55 +653,56 @@ case 'C': break; case 'H': if (*p == 'P') { - mode = BAGPIPE; + instr = K_HP; p++; } else if (*p == 'p') { - mode = BAGPIPE + 1; + instr = K_Hp; sf = 2; p++; } else { syntax("Unknown bagpipe-like key", p); } break; - case '^': - case '_': - case '=': - p--; /* explicit accidentals */ - break; - case '\0': - if (s->u.key.empty == 0) - s->u.key.empty = 1; - p--; + case 'P': + instr = K_DRUM; + p++; break; + case 'n': + if (strncmp(p, "one", 3) == 0) { // none + empty = 2; + p += 3; + while (isspace((unsigned char) *p)) + p++; + if (*p == '\0') { + s->u.key.empty = empty; + return; + } + break; + } + // fall thru default: p--; - if (s->u.key.empty != 2) - syntax("Key not recognized", p); + empty = 1; break; } - if (*p == '#') { - sf += 7; - p++; - } else if (*p == 'b') { - sf -= 7; - p++; - } + s->u.key.empty = empty; - while (*p != '\0') { + if (!empty) { + if (*p == '#') { + sf += 7; + p++; + } else if (*p == 'b') { + sf -= 7; + p++; + } while (isspace((unsigned char) *p)) p++; - if (*p == '\0') - break; - p = parse_extra(p, &clef_name, &clef_middle, &clef_lines, - &clef_scale, &p_octave); - if (*p == '\0') - break; switch (*p) { case 'a': case 'A': if (strncasecmp(p, "aeo", 3) == 0) { sf -= 3; - mode = 5; +// mode = 5; break; } goto unk; @@ -938,21 +710,14 @@ case 'D': if (strncasecmp(p, "dor", 3) == 0) { sf -= 2; - mode = 1; - break; - } - goto unk; - case 'e': - case 'E': - if (strncasecmp(p, "exp", 3) == 0) { - s->u.key.exp = 1; +// mode = 1; break; } goto unk; case 'i': case 'I': if (strncasecmp(p, "ion", 3) == 0) { - mode = 0; +// mode = 0; break; } goto unk; @@ -960,12 +725,12 @@ case 'L': if (strncasecmp(p, "loc", 3) == 0) { sf -= 5; - mode = 6; +// mode = 6; break; } if (strncasecmp(p, "lyd", 3) == 0) { sf += 1; - mode = 3; +// mode = 3; break; } goto unk; @@ -975,13 +740,13 @@ break; if (strncasecmp(p, "mix", 3) == 0) { sf -= 1; - mode = 4; +// mode = 4; break; } if (strncasecmp(p, "min", 3) == 0 || !isalpha((unsigned char) p[1])) { /* 'm' alone */ sf -= 3; - mode = MINOR; +// mode = 5; break; } goto unk; @@ -989,24 +754,43 @@ case 'P': if (strncasecmp(p, "phr", 3) == 0) { sf -= 4; - mode = 2; +// mode = 2; break; } goto unk; - case '^': - case '_': - case '=': - p = parse_acc(p, s); /* explicit accidentals */ - continue; default: - unk: - syntax("Unknown token in key specifier", p); - while (!isspace((unsigned char) *p) && *p != '\0') +unk: + empty = 1; // (local value) + break; + } + if (!empty) { + while (isalpha((unsigned char) *p)) + p++; + while (isspace((unsigned char) *p)) p++; - continue; } - while (isalpha((unsigned char) *p)) - p++; + + // [exp] accidentals + if (strncmp(p, "exp ", 4) == 0) { + p += 4; + while (isspace((unsigned char) *p)) + p++; + if (*p == '\0') + syntax("no accidental after 'exp'", p); + s->u.key.exp = 1; + } + if (s->u.key.exp && strncmp(p, "none", 4) == 0) { + sf = 0; + p += 4; + while (isspace((unsigned char) *p)) + p++; + } else switch (*p) { + case '^': + case '_': + case '=': + p = parse_acc(p, s); /* accidentals */ + break; + } } if (sf > 7 || sf < -7) { @@ -1016,26 +800,54 @@ else sf += 12; } + + // extra parameters + clef_name = clef_middle = clef_stlines = clef_scale = NULL; + p_octave = p_cue = p_map = NULL; + parse_extra(p, &clef_name, &clef_middle, &clef_stlines, + &clef_scale, &p_octave, &p_cue, &p_map); + s->u.key.sf = sf; - s->u.key.mode = mode; +// s->u.key.mode = mode; + s->u.key.instr = instr; s->u.key.octave = parse_octave(p_octave); + if (p_cue) { + if (strncmp(p_cue, "on", 2) == 0) + s->u.key.cue = 1; + else + s->u.key.cue = -1; + } + if (clef_stlines) + s->u.key.stafflines = clef_stlines; + if (clef_scale) { + float sc; - if (clef_name || clef_middle || clef_lines || clef_scale) { - s = abc_new(s->tune, NULL, NULL); - s->type = ABC_T_CLEF; - parse_clef(s, clef_name, clef_middle, clef_lines, - clef_scale); + sc = atof(clef_scale); + if (sc >= 0.5 && sc <= 3) + s->u.key.staffscale = sc; + else + syntax("Bad value of staffscale", clef_scale); + } + if (clef_name || clef_middle) { + s = abc_new(ABC_T_CLEF, NULL); + parse_clef(s, clef_name, clef_middle); + } + if (p_map) { + strcpy(tex_buf, "%%voicemap "); + get_str(&tex_buf[11], p_map, TEX_BUF_SZ - 12); + abc_new(ABC_T_PSCOM, tex_buf); } } /* -- set default length from 'L:' -- */ static char *get_len(char *p, - struct abcsym *s) + struct SYMBOL *s) { int l1, l2, d; char *error_txt = NULL; if (strcmp(p, "auto") == 0) { /* L:auto */ + ulen = 15120; // 2*2*2*2*3*3*3*5*7 s->u.length.base_length = -1; return error_txt; } @@ -1067,123 +879,26 @@ return error_txt; } -/* -- get a new line from the current file in memory -- */ -static char *get_line(void) -{ - int l; - char *p, *q; - - p = file; - if (*p == '\0') - return 0; - abc_line = p; - linenum++; - - /* handle %%begin .. %%end */ - if (strncmp(p, "%%begin", 7) == 0) { - for (;;) { - while (*p != '\0' - && *p != '\n') - p++; - if (*p == '\0') { - syntax("No %%end after %%begin", 0); - break; - } - linenum++; - p++; - if (strncmp(p, "%%end", 5) == 0) { - p[-1] = '\0'; - while (*p != '\0' - && *p != '\n') - p++; - if (*p != '\0') - *p++ = '\0'; - break; - } - } - file = p; - return abc_line; - } - - /* set the end of line and - * memorize the beginning of the next line */ - while (*p != '\0' - && *p != '\n') - p++; - if (*p != '\0') - *p++ = '\0'; - file = p; - - /* special case for continuation lines in ABC version 2.0 */ - if (abc_vers == (2 << 16)) { - p = abc_line; - for (;;) { - while (*p != '\0') { - if (*p == '"') { - for (;;) { - p++; - if (*p == '\0') - break; - if (*p == '"' && p[-1] != '\\') { - p++; - break; - } - } - continue; - } - if (*p == '\\' - && p[1] != '\\' - && p[1] != '%') { - q = p + 1; - while (isspace((unsigned char) *q)) - q++; - if (*q == '\0' || *q == '%') - break; - p = q; - continue; - } - p++; - } - if (*p == '\0') - break; - - /* continuation found */ - q = file; - if (*q == '\0') - break; - linenum++; - while (*q != '\0' - && *q != '\n') - q++; - l = q - file; - memmove(p, file, l); /* concatenate */ - p[l] = '\0'; - if (*q == '\0') - break; - file = q + 1; - } - } - return abc_line; -} - /* -- parse a 'M:' -- */ static char *parse_meter(char *p, - struct abcsym *s) + struct SYMBOL *s) { int m1, m2, d, wmeasure, nm, in_parenth; unsigned i; char *q; -static char *top_err = "Cannot identify meter top"; +static char top_err[] = "Cannot identify meter top"; if (*p == '\0') return "Empty meter string"; nm = 0; in_parenth = 0; - wmeasure = 0; m1 = 0; if (strncmp(p, "none", 4) == 0) { p += 4; /* no meter */ - } else while (*p != '\0') { + wmeasure = 1; /* simplify measure numbering and MREST conversion */ + } else { + wmeasure = 0; + while (*p != '\0') { if (*p == '=') break; if (nm >= MAX_MEASURE) @@ -1278,6 +993,7 @@ p++; else if (*p == '+') s->u.meter.meter[nm++].top[0] = *p++; + } } meter = m1; if (*p == '=') { @@ -1291,10 +1007,10 @@ s->u.meter.wmeasure = wmeasure; s->u.meter.nmeter = nm; - /* if in the header, change the unit note length */ - if (abc_state == ABC_S_HEAD && ulen == 0) { + /* in the tune header, change the unit note length */ + if (parse.abc_state == ABC_S_HEAD && ulen == 0) { if (wmeasure >= BASE_LEN * 3 / 4 - || wmeasure == 0) + || wmeasure <= 1) ulen = BASE_LEN / 8; else ulen = BASE_LEN / 16; @@ -1345,72 +1061,82 @@ /* -- parse a tempo (Q:) -- */ static char *parse_tempo(char *p, - struct abcsym *s) + struct SYMBOL *s) { - int l; - char *q, str[80]; + char c, str[80]; + int i, l, n, top, bot; /* string before */ if (*p == '"') { p = get_str(str, p, sizeof str); - s->u.tempo.str1 = alloc_f(strlen(str) + 1); + s->u.tempo.str1 = getarena(strlen(str) + 1); strcpy(s->u.tempo.str1, str); } /* beat */ if (*p == 'C' || *p == 'c' || *p == 'L' || *p == 'l') { - int len; - + s->u.tempo.beats[0] = ulen; + if (parse.abc_vers >= (2 << 16)) + syntax("Deprecated Q: value", p); p++; - if (*p != '=') - goto inval; - p = parse_len(p + 1, &len); - if (len <= 0) - goto inval; - s->u.tempo.length[0] = len * ulen / BASE_LEN; while (isspace((unsigned char) *p)) p++; - if (abc_vers >= (2 << 16)) - syntax("Deprecated Q: value", p); - } else if (isdigit((unsigned char) *p) && strchr(p, '/') != 0) { - unsigned i; - - i = 0; - while (isdigit((unsigned char) *p)) { - int top, bot, n; - - if (sscanf(p, "%d /%d%n", &top, &bot, &n) != 2 - || bot <= 0) - goto inval; - l = (BASE_LEN * top) / bot; - if (l <= 0 - || i >= sizeof s->u.tempo.length - / sizeof s->u.tempo.length[0]) + if (*p != '=') + goto inval; + c = '='; + p--; + } else if (isdigit((unsigned char) *p)) { + if (strchr(p, '/') != NULL) { + i = 0; + while (isdigit((unsigned char) *p)) { + if (sscanf(p, "%d/%d%n", &top, &bot, &n) != 2 + || bot <= 0) + goto inval; + l = (BASE_LEN * top) / bot; + if (l <= 0 + || i >= sizeof s->u.tempo.beats + / sizeof s->u.tempo.beats[0]) + goto inval; + s->u.tempo.beats[i++] = l; + p += n; + while (isspace((unsigned char) *p)) + p++; + } + c = *p; + if (c != '=') goto inval; - s->u.tempo.length[i++] = l; - p += n; - while (isspace((unsigned char) *p)) - p++; + } else { + s->u.tempo.beats[0] = ulen; + if (parse.abc_vers >= (2 << 16)) + syntax("Deprecated Q: value", p); + c = '='; + p--; } + } else { + c = '\0'; } - /* tempo value ('Q:beat=value' or 'Q:value') */ - if (*p == '=') { + /* tempo value */ + if (c == '=') { p++; - while (isspace((unsigned char) *p)) - p++; - } - if (*p != '\0' && *p != '"') { - q = p; - while (*p != '"' && *p != '\0') - p++; - while (isspace((unsigned char) p[-1])) - p--; - l = p - q; - s->u.tempo.value = alloc_f(l + 1); - strncpy(s->u.tempo.value, q, l); - s->u.tempo.value[l] = '\0'; + if (strncmp(p, "ca. ", 4) == 0) { + s->u.tempo.circa = 1; + p += 4; + } + if (sscanf(p, "%d/%d%n", &top, &bot, &n) == 2) { + if (bot <= 0) + goto inval; + l = (BASE_LEN * top) / bot; + if (l <= 0) + goto inval; + s->u.tempo.new_beat = l; + } else { + if (sscanf(p, "%d%n", &top, &n) != 1) + goto inval; + s->u.tempo.tempo = top; + } + p += n; while (isspace((unsigned char) *p)) p++; } @@ -1418,17 +1144,10 @@ /* string after */ if (*p == '"') { p = get_str(str, p, sizeof str); - s->u.tempo.str2 = alloc_f(strlen(str) + 1); + s->u.tempo.str2 = getarena(strlen(str) + 1); strcpy(s->u.tempo.str2, str); } - if (!s->u.tempo.str1 && !s->u.tempo.str2 - && s->u.tempo.length[0] == 0) { - if (s->u.tempo.value == 0) - return "Empty tempo"; - if (abc_vers >= (2 << 16)) - syntax("Deprecated Q: value", p); - } return 0; inval: return "Invalid tempo"; @@ -1436,7 +1155,7 @@ /* -- get a user defined symbol (U:) -- */ static char *get_user(char *p, - struct abcsym *s) + struct SYMBOL *s) { unsigned char c; char *value; @@ -1475,9 +1194,11 @@ p++; /*fixme: 'U: <char> = "text"' is not treated */ get_deco(p, &s->u.user.value); + if (!s->u.user.value) + return 0; /* treat special pseudo decorations */ - value = deco_tb[s->u.user.value - 128]; + value = parse.deco_tb[s->u.user.value - 128]; if (strcmp(value, "beambreak") == 0) char_tb[c] = CHAR_SPAC; else if (strcmp(value, "ignore") == 0) @@ -1493,13 +1214,12 @@ /* -- parse the voice parameters (V:) -- */ static char *parse_voice(char *p, - struct abcsym *s) + struct SYMBOL *s) { int voice; char *error_txt = NULL; - char name[VOICE_NAME_SZ]; - char *clef_name, *clef_middle, *clef_lines, *clef_scale; - char *p_octave; + char *clef_name, *clef_middle, *clef_stlines, *clef_scale; + char *p_octave, *p_cue, *p_map; signed char *p_stem; static struct kw_s { char *name; @@ -1530,7 +1250,7 @@ curvoice->microscale = microscale; if (voice_tb[0].id[0] == '\0') { - switch (s->prev->type) { + switch (s->abc_prev->abc_type) { case ABC_T_EOLN: case ABC_T_NOTE: case ABC_T_REST: @@ -1571,22 +1291,22 @@ s->u.voice.voice = voice; /* if in tune, set the voice parameters */ - if (abc_state == ABC_S_TUNE) { + if (parse.abc_state == ABC_S_TUNE) { ulen = curvoice->ulen; microscale = curvoice->microscale; } /* parse the other parameters */ - clef_name = clef_middle = clef_lines = clef_scale = NULL; - p_octave = NULL; + clef_name = clef_middle = clef_stlines = clef_scale = NULL; + p_octave = p_cue = p_map = NULL; p_stem = &s->u.voice.stem; for (;;) { while (isspace((unsigned char) *p)) p++; if (*p == '\0') break; - p = parse_extra(p, &clef_name, &clef_middle, &clef_lines, - &clef_scale, &p_octave); + p = parse_extra(p, &clef_name, &clef_middle, &clef_stlines, + &clef_scale, &p_octave, &p_cue, &p_map); if (*p == '\0') break; for (kw = kw_tb; kw->name; kw++) { @@ -1601,14 +1321,14 @@ p += kw->len; switch (kw->index) { case 0: /* name */ - p = get_str(name, p, VOICE_NAME_SZ); - s->u.voice.fname = alloc_f(strlen(name) + 1); - strcpy(s->u.voice.fname, name); + p = get_str(tex_buf, p, TEX_BUF_SZ); + s->u.voice.fname = getarena(strlen(tex_buf) + 1); + strcpy(s->u.voice.fname, tex_buf); break; case 1: /* subname */ - p = get_str(name, p, VOICE_NAME_SZ); - s->u.voice.nname = alloc_f(strlen(name) + 1); - strcpy(s->u.voice.nname, name); + p = get_str(tex_buf, p, TEX_BUF_SZ); + s->u.voice.nname = getarena(strlen(tex_buf) + 1); + strcpy(s->u.voice.nname, tex_buf); break; case 2: /* merge */ s->u.voice.merge = 1; @@ -1653,25 +1373,46 @@ } s->u.voice.octave = parse_octave(p_octave); + if (p_cue) { + if (strncmp(p_cue, "on", 2) == 0) + s->u.voice.cue = 1; + else + s->u.voice.cue = -1; + } + if (clef_stlines) + s->u.voice.stafflines = clef_stlines; +// else +// s->u.voice.stafflines = "|||||"; + if (clef_scale) { + float sc; - if (clef_name || clef_middle || clef_lines || clef_scale) { - s = abc_new(s->tune, NULL, NULL); - s->type = ABC_T_CLEF; - parse_clef(s, clef_name, clef_middle, clef_lines, - clef_scale); + sc = atof(clef_scale); + if (sc >= 0.5 && sc <= 3) + s->u.voice.staffscale = sc; + else + syntax("Bad value of staffscale", clef_scale); + } + if (clef_name || clef_middle) { + s = abc_new(ABC_T_CLEF, NULL); + parse_clef(s, clef_name, clef_middle); + } + if (p_map) { + strcpy(tex_buf, "%%voicemap "); + get_str(&tex_buf[11], p_map, TEX_BUF_SZ - 12); + abc_new(ABC_T_PSCOM, tex_buf); } return error_txt; } /* -- parse a bar -- */ -static char *parse_bar(struct abctune *t, - char *p) +static char *parse_bar(char *p) { - struct abcsym *s; - int bar_type; + struct SYMBOL *s; + char *q; + int bar_type, i; char repeat_value[32]; - p--; + q = --p; // keep the first char bar_type = 0; for (;;) { switch (*p++) { @@ -1714,19 +1455,37 @@ curvoice = &voice_tb[curvoice->mvoice]; vover = 0; } - s = abc_new(t, gchord, NULL); - if (gchord) { - if (free_f) - free_f(gchord); + s = abc_new(ABC_T_BAR, gchord); + if (gchord) gchord = NULL; + + /* handle the repeat sequences */ + if (bar_type == B_COL) { + bar_type = B_BAR; + s->u.bar.dotted = 1; + } else { + if (*q == ']') { /* repeat bar stop */ + i = p - q - 1; + if (i > 0) /* remove the starting ']' */ + s->u.bar.type &= (1 << (i * 4)) - 1; + s->flags |= ABC_F_RBSTOP; + s->sflags |= S_RBSTOP; + } else if ((bar_type & 0x0f) == B_COL /* left or */ + || *q == ':') { /* right repeat bar */ + s->flags |= ABC_F_RBSTOP; + s->sflags |= S_RBSTOP; + if (*q == ':') /* right repeat bar */ + s->sflags |= S_RRBAR; + } } - s->type = ABC_T_BAR; + s->u.bar.type = bar_type; if (dc.n > 0) { memcpy(&s->u.bar.dc, &dc, sizeof s->u.bar.dc); - dc.n = dc.h = dc.s = 0; + dc.n = 0; } + if (!lyric_started) { lyric_started = 1; s->flags |= ABC_F_LYRIC_START; @@ -1755,57 +1514,53 @@ } if (bar_type != B_OBRA || s->text) { - s = abc_new(t, repeat_value, NULL); - s->type = ABC_T_BAR; + s = abc_new(ABC_T_BAR, repeat_value); s->u.bar.type = B_OBRA; } else { - s->text = alloc_f(strlen(repeat_value) + 1); + s->text = getarena(strlen(repeat_value) + 1); strcpy(s->text, repeat_value); } s->u.bar.repeat_bar = 1; + s->flags |= ABC_F_RBSTART | ABC_F_RBSTOP; + s->sflags |= S_RBSTART | S_RBSTOP; return p; } -/* -- parse note or rest with pitch and length -- */ -/* in case of error, 'accidental' is set to -1 */ -static char *parse_basic_note(char *p, - int *pitch, - int *length, - int *accidental, - int *stemless) +// parse the note accidental and pitch +char *parse_acc_pit(char *p, + int *pit, + int *acc) { - int pit, len, acc, nostem; - - acc = pit = nostem = 0; - /* look for accidental sign */ switch (*p) { case '^': p++; if (*p == '^') { p++; - acc = A_DS; + *acc = A_DS; } else { - acc = A_SH; + *acc = A_SH; } break; case '=': p++; - acc = A_NT; + *acc = A_NT; break; case '_': p++; if (*p == '_') { p++; - acc = A_DF; + *acc = A_DF; } else { - acc = A_FT; + *acc = A_FT; } break; + default: + *acc = 0; } /* look for microtone value */ - if (acc != 0 + if (*acc != 0 && (isdigit((unsigned char) *p) || (*p == '/' && microscale == 0))) { int n, d; @@ -1829,10 +1584,10 @@ d--; d += (n - 1) << 8; /* short [ (n-1) | (d-1) ] */ for (n = 1; n < MAXMICRO; n++) { - if (p_micro[n] == d) + if (parse.micro_tb[n] == d) break; - if (p_micro[n] == 0) { - p_micro[n] = d; + if (parse.micro_tb[n] == 0) { + parse.micro_tb[n] = d; break; } } @@ -1841,7 +1596,7 @@ n = 0; } } - acc += (n << 3); + *acc += (n << 3); } /* get the pitch */ @@ -1849,58 +1604,49 @@ char *p_n; p_n = strchr(all_notes, *p); - if (!p_n) { - syntax(acc ? "Missing note after accidental" + if (!p_n || *p == '\0') { + syntax(*acc ? "Missing note after accidental" : "Not a note", p); - acc = -1; + *acc = -1; if (*p == '\0') p--; } else { - pit = p_n - all_notes + 16; + *pit = p_n - all_notes + 16; } p++; } while (*p == '\'') { /* eat up following ' chars */ - pit += 7; + *pit += 7; p++; } while (*p == ',') { /* eat up following , chars */ - pit -= 7; + *pit -= 7; p++; } - if (*p == '0') { - nostem = 1; - p++; - } - p = parse_len(p, &len); - - *pitch = pit; - *length = len; - *accidental = acc; - *stemless = nostem; return p; } /* -- parse the decorations of notes and bars -- */ -char *parse_deco(char *p, - struct deco *deco) +static char *parse_deco(char *p, + struct decos *deco, + int m) /* note index / -1 */ { int n; - unsigned char c, d; + unsigned char t; n = deco->n; for (;;) { - c = (unsigned char) *p++; - if (char_tb[c] != CHAR_DECO && char_tb[c] != CHAR_DECOS) + t = (unsigned char) *p++; + if (char_tb[t] != CHAR_DECO && char_tb[t] != CHAR_DECOS) break; - if (char_tb[c] == CHAR_DECOS) { - p = get_deco(p, &d); - c = d; - } - if (n >= MAXDC) + if (char_tb[t] == CHAR_DECOS) + p = get_deco(p, &t); + if (n >= MAXDC) { syntax("Too many decorations for the note", p); - else if (c != 0) - deco->t[n++] = c; + } else if (t != 0) { + deco->tm[n].t = t; + deco->tm[n++].m = m; + } } deco->n = n; return p - 1; @@ -1909,8 +1655,8 @@ /* -- parse a decoration line (d: or s:) -- */ static char *parse_decoline(char *p) { - struct abcsym *is; - unsigned char d; + struct SYMBOL *is; + unsigned char t; int n; if ((is = deco_cont) == NULL) @@ -1926,24 +1672,24 @@ break; switch (*p) { case '|': - while (is && (is->type != ABC_T_BAR + while (is && (is->abc_type != ABC_T_BAR || is->u.bar.type == B_OBRA)) - is = is->next; + is = is->abc_next; if (!is) { syntax("Not enough bar lines for deco line", p); return NULL; } - is = is->next; + is = is->abc_next; p++; continue; case '*': - while (is && is->type != ABC_T_NOTE) - is = is->next; + while (is && is->abc_type != ABC_T_NOTE) + is = is->abc_next; if (!is) { syntax("Not enough notes for deco line", p); return NULL; } - is = is->next; + is = is->abc_next; p++; continue; case '\\': @@ -1961,16 +1707,16 @@ break; default: if (char_tb[(unsigned char) *p] == CHAR_DECOS) - p = get_deco(p + 1, &d); + p = get_deco(p + 1, &t); else - d = (unsigned char) *p++; + t = (unsigned char) *p++; break; } - /* store the decoration / gchord/annotation in the next note */ - while (is && (is->type != ABC_T_NOTE + /* store the decoration and gchord/annotation in the next note */ + while (is && (is->abc_type != ABC_T_NOTE || (is->flags & ABC_F_GRACE))) - is = is->next; + is = is->abc_next; if (!is) return "Not enough notes for deco line"; @@ -1979,14 +1725,10 @@ char *gch; n = strlen(is->text); - gch = alloc_f(n + strlen(gchord) + 2); + gch = getarena(n + strlen(gchord) + 2); strcpy(gch, is->text); gch[n] = '\n'; strcpy(gch + n + 1, gchord); - if (free_f) { - free_f(gchord); - free_f(is->text); - } gchord = gch; } is->text = gchord; @@ -1995,12 +1737,13 @@ n = is->u.note.dc.n; if (n >= MAXDC) { syntax("Too many decorations for the note", p); - } else if (d != 0) { - is->u.note.dc.t[n] = d; - is->u.note.dc.n = n + 1; + } else if (t != 0) { + is->u.note.dc.tm[n].t = t; + is->u.note.dc.tm[n].m = -1; + is->u.note.dc.n = ++n; } } - is = is->next; + is = is->abc_next; } return NULL; } @@ -2027,16 +1770,14 @@ /* many guitar chords: concatenate with '\n' */ l2 = strlen(gchord); - gch = alloc_f(l2 + 1 + l + 1); + gch = getarena(l2 + 1 + l + 1); strcpy(gch, gchord); gch[l2++] = '\n'; strncpy(&gch[l2], q, l); gch[l2 + l] = '\0'; - if (free_f) - free_f(gchord); gchord = gch; } else { - gchord = alloc_f(l + 1); + gchord = getarena(l + 1); strncpy(gchord, q, l); gchord[l] = '\0'; } @@ -2047,12 +1788,13 @@ /* -- parse a note length -- */ static char *parse_len(char *p, + int dur_u, int *p_len) { int len, fac; char *q; - len = BASE_LEN; + len = dur_u; if (isdigit((unsigned char) *p)) { len *= strtol(p, &q, 10); if (len <= 0) { @@ -2084,51 +1826,32 @@ /* -- parse a ABC line -- */ /* return 1 on end of tune, and 2 on start of new tune */ -static int parse_line(struct abctune *t, - char *p) +static int parse_line(char *p) { - struct abcsym *s; - char *comment, *q, c; - struct abcsym *last_note_sav = NULL; - struct deco dc_sav; + struct SYMBOL *s; + char *q, c; + char *dot = NULL; + struct SYMBOL *last_note_sav = NULL; + struct decos dc_sav; int i, flags, flags_sav = 0, slur; static char qtb[10] = {0, 1, 3, 2, 3, 0, 2, 0, 3, 0}; colnum = 0; switch (*p) { case '\0': /* blank line */ - switch (abc_state) { + switch (parse.abc_state) { case ABC_S_GLOBAL: + if (parse.last_sym + && parse.last_sym->abc_type != ABC_T_NULL) + abc_new(ABC_T_NULL, NULL); case ABC_S_HEAD: /*fixme: may have blank lines in headers?*/ - if (keep_comment || abc_state == ABC_S_GLOBAL) { - if (t->last_sym - && t->last_sym->type != ABC_T_NULL) { - s = abc_new(t, NULL, NULL); - s->type = ABC_T_NULL; - } - } return 0; } return 1; case '%': - if (p[1] == '@') { /* line number - see front.c */ - linenum = atol(p + 2); - if (linenum == 0 && strncmp(file, "%abc-", 5) == 0) - get_vers(file + 5); - return 0; - } if (p[1] == '%') { - if (strncmp(p + 2, "begin", 5) != 0) - comment = decomment_line(p + 2); - else - comment = NULL; - s = abc_new(t, p, comment); - s->type = ABC_T_PSCOM; + s = abc_new(ABC_T_PSCOM, p); p += 2; /* skip '%%' */ - if (strncasecmp(p, "abc-version ", 12) == 0) { - get_vers(p + 12); - return 0; - } if (strncasecmp(p, "decoration ", 11) == 0) { p += 11; while (isspace((unsigned char) *p)) @@ -2169,9 +1892,9 @@ = CHAR_LINEBREAK; break; case '<': - if (strcmp(p, "<none>") == 0) + if (strncmp(p, "<none>", 6) == 0) return 0; - if (strcmp(p, "<EOL>") == 0) { + if (strncmp(p, "<EOL>", 5) == 0) { char_tb['\n'] = CHAR_LINEBREAK; p += 5; break; @@ -2186,6 +1909,19 @@ } return 0; } + if (strncasecmp(p, "microscale ", 11) == 0) { + int v; + + p += 11; + while (isspace((unsigned char) *p)) + p++; + sscanf(p, "%d", &v); + if (v < 4 || v >= 256 || v & 1) + syntax("Invalid value in %%microscale", p); + else + microscale = v; + return 0; + } if (strncasecmp(p, "user ", 5) == 0) { p += 5; while (isspace((unsigned char) *p)) @@ -2197,25 +1933,20 @@ } /* fall thru */ case '\\': /* abc2mtex specific lines */ - if (keep_comment) { - s = abc_new(t, p, NULL); - s->type = ABC_T_NULL; - } return 0; /* skip */ } - comment = decomment_line(p); /* header fields */ if (p[1] == ':' && *p != '|' && *p != ':') { /* not '|:' nor '::' */ int new_tune; - new_tune = parse_info(t, p, comment); + new_tune = parse_info(p); /* handle BarFly voice definition */ /* 'V:n <note line ending with a bar>' */ if (*p != 'V' - || abc_state != ABC_S_TUNE) + || parse.abc_state != ABC_S_TUNE) return new_tune; /* (normal return) */ c = p[strlen(p) - 1]; if (c != '|' && c != ']') @@ -2225,17 +1956,12 @@ while (isspace((unsigned char) *p)) p++; } - if (abc_state != ABC_S_TUNE) { - if (keep_comment) { - s = abc_new(t, p, comment); - s->type = ABC_T_NULL; - } + if (parse.abc_state != ABC_S_TUNE) return 0; - } + /* music */ flags = 0; - - if (abc_vers <= (2 << 16)) + if (parse.abc_vers <= (2 << 16)) lyric_started = 0; deco_start = deco_cont = NULL; slur = 0; @@ -2253,7 +1979,7 @@ last_note_sav = curvoice->last_note; curvoice->last_note = NULL; memcpy(&dc_sav, &dc, sizeof dc); - dc.n = dc.h = dc.s = 0; + dc.n = 0; flags_sav = flags; flags = ABC_F_GRACE; if (*p == '/') { @@ -2264,7 +1990,9 @@ case CHAR_GR_EN: /* '}' */ if (!(flags & ABC_F_GRACE)) goto bad_char; - t->last_sym->flags |= ABC_F_GR_END; + parse.last_sym->flags |= ABC_F_GR_END; + if (dc.n != 0) + syntax("Decoration ignored", p); curvoice->last_note = last_note_sav; memcpy(&dc, &dc_sav, sizeof dc); flags = flags_sav; @@ -2273,39 +2001,36 @@ if (p[-1] == '!' && char_tb['\n'] == CHAR_LINEBREAK && check_nl(p)) { - s = abc_new(t, NULL, NULL); /* abc2win EOL */ - s->type = ABC_T_EOLN; + s = abc_new(ABC_T_EOLN, NULL); /* abc2win EOL */ s->u.eoln.type = 2; break; } /* fall thru */ case CHAR_DECO: if (p[-1] == '.') { - if (*p == '(' || *p == '-' || *p == ')') - break; - if (*p == '|') { - p = parse_bar(t, p + 1); - t->last_sym->u.bar.dotted = 1; + if (*p == '(' || *p == '-') { + dot = p; break; } +// if (*p == '|') { +// p = parse_bar(p + 1); +// parse.last_sym->u.bar.dotted = 1; +// break; +// } } - p = parse_deco(p - 1, &dc); - dc.h = dc.s = dc.n; + p = parse_deco(p - 1, &dc, -1); break; case CHAR_LINEBREAK: - s = abc_new(t, NULL, NULL); - s->type = ABC_T_EOLN; + s = abc_new(ABC_T_EOLN, NULL); // s->u.eoln.type = 0; break; - case CHAR_ACC: case CHAR_NOTE: - case CHAR_REST: - p = parse_note(t, p - 1, flags); + p = parse_note(p - 1, flags); flags &= ABC_F_GRACE; - t->last_sym->u.note.slur_st = slur; + parse.last_sym->u.note.slur_st = slur; slur = 0; - if (t->last_sym->u.note.lens[0] > 0) /* if not space */ - curvoice->last_note = t->last_sym; + if (parse.last_sym->u.note.notes[0].len > 0) /* if not space */ + curvoice->last_note = parse.last_sym; break; case CHAR_SLASH: /* '/' */ if (flags & ABC_F_GRACE) @@ -2315,8 +2040,7 @@ q++; if (char_tb[(unsigned char) *q] != CHAR_BAR) goto bad_char; - s = abc_new(t, NULL, NULL); - s->type = ABC_T_MREP; + s = abc_new(ABC_T_MREP, NULL); s->u.bar.type = 0; s->u.bar.len = q - p + 1; syntax("Non standard measure repeat syntax", p - 1); @@ -2333,19 +2057,19 @@ || *p == ' ') { if (flags & ABC_F_GRACE) goto bad_char; - p = parse_bar(t, p); + p = parse_bar(p); break; } if (p[1] != ':') { - p = parse_note(t, p - 1, flags); /* chord */ + p = parse_note(p - 1, flags); /* chord */ flags &= ABC_F_GRACE; - t->last_sym->u.note.slur_st = slur; + parse.last_sym->u.note.slur_st = slur; slur = 0; - curvoice->last_note = t->last_sym; + curvoice->last_note = parse.last_sym; break; } - /* embedded header */ + /* embedded information field */ #if 0 /*fixme:OK for [I:staff n], ?? for other headers*/ if (flags & ABC_F_GRACE) @@ -2366,7 +2090,7 @@ } else { *p = '\0'; } - parse_info(t, q, NULL); + parse_info(q); *p = c; if (c != '\0') p++; @@ -2374,17 +2098,13 @@ case CHAR_BAR: /* '|', ':' or ']' */ if (flags & ABC_F_GRACE) goto bad_char; - p = parse_bar(t, p); + p = parse_bar(p); break; case CHAR_OPAR: /* '(' */ - if (isdigit((unsigned char) *p)) { + if (*p > '0' && *p <= '9') { int pplet, qplet, rplet; pplet = strtol(p, &q, 10); - if (pplet <= 1) { - syntax("Invalid 'p' in tuplet", p); - pplet = 0; - } p = q; if ((unsigned) pplet < sizeof qtb / sizeof qtb[0]) qplet = qtb[pplet]; @@ -2405,16 +2125,17 @@ } } } - if (pplet == 0) - break; if (rplet < 1) { syntax("Invalid 'r' in tuplet", p); break; } + if (pplet >= 128 || qplet >= 128 || rplet >= 128) { + syntax("Invalid 'p:q:r' in tuplet", p); + break; + } if (qplet == 0) qplet = meter % 3 == 0 ? 3 : 2; - s = abc_new(t, NULL, NULL); - s->type = ABC_T_TUPLET; + s = abc_new(ABC_T_TUPLET, NULL); s->u.tuplet.p_plet = pplet; s->u.tuplet.q_plet = qplet; s->u.tuplet.r_plet = rplet; @@ -2429,15 +2150,14 @@ syntax("Nested voice overlay", p - 1); break; } - s = abc_new(t, NULL, NULL); - s->type = ABC_T_V_OVER; + s = abc_new(ABC_T_V_OVER, NULL); s->u.v_over.type = V_OVER_S; s->u.v_over.voice = curvoice - voice_tb; vover = -1; /* multi-bars */ break; } - slur <<= 3; - if (p[-2] == '.' && dc.n == 0) + slur <<= 4; + if (p == dot + 1 && dc.n == 0) slur |= SL_DOTTED; switch (*p) { case '\'': @@ -2454,14 +2174,14 @@ } break; case CHAR_CPAR: /* ')' */ - switch (t->last_sym->type) { + switch (parse.last_sym->abc_type) { case ABC_T_NOTE: case ABC_T_REST: break; default: goto bad_char; } - t->last_sym->u.note.slur_end++; + parse.last_sym->u.note.slur_end++; break; case CHAR_VOV: /* '&' */ if (flags & ABC_F_GRACE) @@ -2472,8 +2192,7 @@ syntax("Bad start of voice overlay", p); break; } - s = abc_new(t, NULL, NULL); - s->type = ABC_T_V_OVER; + s = abc_new(ABC_T_V_OVER, NULL); /*s->u.v_over.type = V_OVER_V; */ vover_new(); s->u.v_over.voice = curvoice - voice_tb; @@ -2483,8 +2202,7 @@ } p++; vover = 0; - s = abc_new(t, NULL, NULL); - s->type = ABC_T_V_OVER; + s = abc_new(ABC_T_V_OVER, NULL); s->u.v_over.type = V_OVER_E; s->u.v_over.voice = curvoice->mvoice; curvoice->last_note = NULL; /* ?? */ @@ -2497,9 +2215,9 @@ int tie_pos; if (!curvoice->last_note - || curvoice->last_note->type != ABC_T_NOTE) + || curvoice->last_note->abc_type != ABC_T_NOTE) goto bad_char; - if (p[-2] == '.' && dc.n == 0) + if (p == dot + 1 && dc.n == 0) tie_pos = SL_DOTTED; else tie_pos = 0; @@ -2516,10 +2234,10 @@ tie_pos += SL_AUTO; break; } - for (i = 0; i <= curvoice->last_note->u.note.nhd; i++) { - if (curvoice->last_note->u.note.ti1[i] == 0) - curvoice->last_note->u.note.ti1[i] = tie_pos; - else if (curvoice->last_note->u.note.nhd == 0) + for (i = 0; i <= curvoice->last_note->nhd; i++) { + if (curvoice->last_note->u.note.notes[i].ti1 == 0) + curvoice->last_note->u.note.notes[i].ti1 = tie_pos; + else if (curvoice->last_note->nhd == 0) syntax("Too many ties", p); } break; @@ -2538,7 +2256,7 @@ } if (p[-1] == '<') i = -i; - broken_rhythm(&curvoice->last_note->u.note, i); + broken_rhythm(curvoice->last_note, i); curvoice->last_note->u.note.brhythm = i; break; case CHAR_IGN: /* '*' & '`' */ @@ -2563,37 +2281,33 @@ } /* add eoln */ - s = abc_new(t, NULL, NULL); - s->type = ABC_T_EOLN; + s = abc_new(ABC_T_EOLN, NULL); if (flags & ABC_F_SPACE) s->flags |= ABC_F_SPACE; if (p[-1] == '\\' || char_tb['\n'] != CHAR_LINEBREAK) s->u.eoln.type = 1; /* no break */ + return 0; } /* -- parse a note or a rest -- */ -static char *parse_note(struct abctune *t, - char *p, +static char *parse_note(char *p, int flags) { - struct abcsym *s; + struct SYMBOL *s; char *q; - int pit, len, acc, nostem, chord, j, m; + int pit, len, acc, nostem, chord, j, m, n; if (flags & ABC_F_GRACE) { /* in a grace note sequence */ - s = abc_new(t, NULL, NULL); + s = abc_new(ABC_T_NOTE, NULL); } else { - s = abc_new(t, gchord, NULL); - if (gchord) { - if (free_f) - free_f(gchord); + s = abc_new(ABC_T_NOTE, gchord); + if (gchord) gchord = NULL; - } } - s->type = ABC_T_NOTE; s->flags |= flags; + s->u.note.notes[0].color = -1; if (!lyric_started) { lyric_started = 1; @@ -2604,14 +2318,14 @@ if (!deco_start) deco_start = s; } + chord = 0; /* rest */ switch (*p) { case 'X': + s->flags |= ABC_F_INVIS; case 'Z': /* multi-rest */ - s->type = ABC_T_MREST; - if (*p == 'X') - s->flags |= ABC_F_INVIS; + s->abc_type = ABC_T_MREST; p++; len = 1; if (isdigit((unsigned char) *p)) { @@ -2626,88 +2340,81 @@ s->u.bar.len = len; goto add_deco; case 'y': /* space (BarFly) */ - s->type = ABC_T_REST; + s->abc_type = ABC_T_REST; s->flags |= ABC_F_INVIS; p++; - if (isdigit((unsigned char) *p)) { /* number of points */ - s->u.note.lens[1] = strtol(p, &q, 10); + if (isdigit((unsigned char) *p) /* number of points */ + || *p == '-') { /* accept negative offset... */ + s->u.note.notes[0].shhd = strtol(p, &q, 10); p = q; } else { - s->u.note.lens[1] = -1; + s->u.note.notes[0].shhd = 10; // default } goto add_deco; case 'x': /* invisible rest */ s->flags |= ABC_F_INVIS; /* fall thru */ case 'z': - s->type = ABC_T_REST; - p = parse_len(p + 1, &len); - s->u.note.lens[0] = len * ulen / BASE_LEN; + s->abc_type = ABC_T_REST; + p = parse_len(p + 1, ulen, &len); + s->u.note.notes[0].len = len; goto do_brhythm; - } - - chord = 0; - q = p; - if (*p == '[') { /* '[..]' = chord */ + case '[': /* '[..]' = chord */ chord = 1; p++; + break; } + q = p; + /* get pitch, length and possible accidental */ m = 0; nostem = 0; for (;;) { - int tmp; - if (chord) { if (m >= MAXHD) { syntax("Too many notes in chord", p); m--; } - tmp = 0; + n = 0; if (*p == '.') { - tmp = SL_DOTTED; + n = SL_DOTTED; p++; } if (*p == '(') { p++; switch (*p) { case '\'': - tmp += SL_ABOVE; + n += SL_ABOVE; p++; break; case ',': - tmp += SL_BELOW; + n += SL_BELOW; p++; break; default: - tmp += SL_AUTO; + n += SL_AUTO; break; } - s->u.note.sl1[m] = (s->u.note.sl1[m] << 3) - + tmp; + s->u.note.notes[m].sl1 = (s->u.note.notes[m].sl1 << 3) + + n; } } - tmp = dc.n; - p = parse_deco(p, &dc); /* note head decorations */ - if (dc.n != tmp) { - if (dc.n - tmp >= 8) { - syntax("Too many decorations on this head", p); - tmp = dc.n - 7; - } - s->u.note.decs[m] = (tmp << 3) + dc.n - tmp; - dc.s = dc.n; - } - p = parse_basic_note(p, &pit, &len, &acc, &tmp); - if (!(flags & ABC_F_GRACE)) - len = len * ulen / BASE_LEN; - else - len /= 8; /* for grace note alone */ - - s->u.note.pits[m] = pit; - s->u.note.lens[m] = len; - s->u.note.accs[m] = acc; - nostem |= tmp; + p = parse_deco(p, &dc, m); /* note head decorations */ + p = parse_acc_pit(p, &pit, &acc); + if (*p == '0') { + nostem = 1; + p++; + } + p = parse_len(p, (flags & ABC_F_GRACE) ? + BASE_LEN / 8 : // for grace note alone + ulen, + &len); + s->u.note.notes[m].pit = pit; + s->pits[m] = pit; + s->u.note.notes[m].len = len; + s->u.note.notes[m].acc = acc; + s->u.note.notes[m].color = -1; if (chord) { for (;;) { @@ -2719,19 +2426,19 @@ if (*p == '-') { switch (p[1]) { case '\'': - s->u.note.ti1[m] = SL_ABOVE; + s->u.note.notes[m].ti1 = SL_ABOVE; p++; break; case ',': - s->u.note.ti1[m] = SL_BELOW; + s->u.note.notes[m].ti1 = SL_BELOW; p++; break; default: - s->u.note.ti1[m] = SL_AUTO; + s->u.note.notes[m].ti1 = SL_AUTO; break; } } else if (*p == ')') { - s->u.note.sl2[m]++; + s->u.note.notes[m].sl2++; } else { break; } @@ -2746,15 +2453,14 @@ if (*p == ']') { p++; if (*p == '0') { - nostem |= 1; + nostem = 1; p++; } if (*p == '/' || isdigit((unsigned char) *p)) { - p = parse_len(p, &len); - s->u.note.chlen = len; + p = parse_len(p, ulen, &len); for (j = 0; j < m; j++) { - tmp = len * s->u.note.lens[j]; - s->u.note.lens[j] = tmp / BASE_LEN; + s->u.note.notes[j].len = + len * s->u.note.notes[j].len / ulen; } } break; @@ -2771,55 +2477,53 @@ goto err; s->u.note.microscale = microscale; - s->u.note.nhd = m - 1; + s->nhd = m - 1; + do_brhythm: if (curvoice->last_note && curvoice->last_note->u.note.brhythm != 0) - broken_rhythm(&s->u.note, - -curvoice->last_note->u.note.brhythm); + broken_rhythm(s, -curvoice->last_note->u.note.brhythm); add_deco: if (dc.n > 0) { - memcpy(s->type != ABC_T_MREST ? &s->u.note.dc + memcpy(s->abc_type != ABC_T_MREST ? &s->u.note.dc : &s->u.bar.dc, &dc, sizeof dc); - dc.n = dc.h = dc.s = 0; + dc.n = 0; } + /* forbid rests in grace note sequences */ - if (s->type != ABC_T_NOTE && (flags & ABC_F_GRACE)) { + if (s->abc_type != ABC_T_NOTE && (flags & ABC_F_GRACE)) { syntax("Not a note in grace note sequence", p); goto err; } return p; err: - if ((t->last_sym = s->prev) == NULL) { - t->first_sym = NULL; + if ((parse.last_sym = s->abc_prev) == NULL) { + parse.first_sym = NULL; } else { - s->prev->next = NULL; - s->prev->flags |= (s->flags & ABC_F_ERROR); + s->abc_prev->abc_next = NULL; + s->abc_prev->flags |= (s->flags & ABC_F_ERROR); } return p; } /* -- parse an information field -- */ /* return 2 on start of new tune */ -static int parse_info(struct abctune *t, - char *p, - char *comment) +static int parse_info(char *p) { - struct abcsym *s; + struct SYMBOL *s; char info_type = *p; char *error_txt = NULL; - s = abc_new(t, p, comment); - s->type = ABC_T_INFO; + s = abc_new(ABC_T_INFO, p); p += 2; switch (info_type) { case 'd': case 's': - if (abc_state == ABC_S_GLOBAL) + if (parse.abc_state == ABC_S_GLOBAL) break; if (!deco_start) { error_txt = "Erroneous 'd:'/'s:'"; @@ -2828,13 +2532,13 @@ error_txt = parse_decoline(p); break; case 'K': - if (abc_state == ABC_S_GLOBAL) + if (parse.abc_state == ABC_S_GLOBAL) break; parse_key(p, s); - if (abc_state == ABC_S_HEAD) { + if (parse.abc_state == ABC_S_HEAD) { int i; - abc_state = ABC_S_TUNE; + parse.abc_state = ABC_S_TUNE; if (ulen == 0) ulen = BASE_LEN / 8; for (i = MAXVOICE; --i >= 0; ) @@ -2857,17 +2561,16 @@ error_txt = get_user(p, s); break; case 'V': - if (abc_state == ABC_S_GLOBAL) + if (parse.abc_state == ABC_S_GLOBAL) break; error_txt = parse_voice(p, s); break; case 'X': memset(voice_tb, 0, sizeof voice_tb); nvoice = 0; - curvoice = &voice_tb[0]; - abc_state = ABC_S_HEAD; - if (level_f) - level_f(1); + curvoice = voice_tb; + parse.abc_state = ABC_S_HEAD; + lvlarena(1); return 2; } if (error_txt) diff -Nru abcm2ps-7.8.9/abcparse.h abcm2ps-8.14.2/abcparse.h --- abcm2ps-7.8.9/abcparse.h 2014-03-26 07:49:34.000000000 +0000 +++ abcm2ps-8.14.2/abcparse.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,238 +0,0 @@ -/*++ - * Declarations for abcparse.c. - * - *-*/ - -#define MAXVOICE 32 /* max number of voices */ - -#define MAXHD 8 /* max heads in a chord */ -#define MAXDC 45 /* max decorations per note/chord/bar */ -#define MAXMICRO 32 /* max microtone values (5 bits in accs[]) */ - -#define BASE_LEN 1536 /* basic note length (semibreve or whole note - same as MIDI) */ - -#define VOICE_ID_SZ 16 /* max size of the voice identifiers */ - -/* accidentals */ -enum accidentals { - A_NULL, /* none */ - A_SH, /* sharp */ - A_NT, /* natural */ - A_FT, /* flat */ - A_DS, /* double sharp */ - A_DF /* double flat */ -}; - -/* bar types - 4 bits per symbol */ -#define B_BAR 1 /* | */ -#define B_OBRA 2 /* [ */ -#define B_CBRA 3 /* ] */ -#define B_COL 4 /* : */ - -/* slur/tie types (3 bits) */ -#define SL_ABOVE 0x01 -#define SL_BELOW 0x02 -#define SL_AUTO 0x03 -#define SL_DOTTED 0x04 /* (modifier bit) */ - -/* note structure */ -struct deco { /* decorations */ - char n; /* whole number of decorations */ - char h; /* start of head decorations */ - char s; /* start of decorations from s: (d:) */ - unsigned char t[MAXDC]; /* decoration type */ -}; - -struct note { /* note or rest */ - signed char pits[MAXHD]; /* pitches */ - short lens[MAXHD]; /* note lengths (# pts in [1] if space) */ - unsigned char accs[MAXHD]; /* code for accidentals & index in micro_tb */ - unsigned char sl1[MAXHD]; /* slur start per head */ - char sl2[MAXHD]; /* number of slur end per head */ - char ti1[MAXHD]; /* flag to start tie here */ - unsigned char decs[MAXHD]; /* head decorations (index: 5 bits, len: 3 bits) */ - short chlen; /* chord length */ - char nhd; /* number of notes in chord - 1 */ - unsigned char slur_st; /* slurs starting here (2 bits array) */ - char slur_end; /* number of slurs ending here */ - signed char brhythm; /* broken rhythm */ - unsigned char microscale; /* microtone denominator - 1 */ - struct deco dc; /* decorations */ -}; - -/* symbol definition */ -struct abctune; -struct abcsym { - struct abctune *tune; /* tune */ - struct abcsym *next, *prev; /* next / previous symbol */ - char type; /* symbol type */ -#define ABC_T_NULL 0 -#define ABC_T_INFO 1 /* (text[0] gives the info type) */ -#define ABC_T_PSCOM 2 -#define ABC_T_CLEF 3 -#define ABC_T_NOTE 4 -#define ABC_T_REST 5 -#define ABC_T_BAR 6 -#define ABC_T_EOLN 7 -#define ABC_T_MREST 8 /* multi-measure rest */ -#define ABC_T_MREP 9 /* measure repeat */ -#define ABC_T_V_OVER 10 /* voice overlay */ -#define ABC_T_TUPLET 11 - char state; /* symbol state in file/tune */ -#define ABC_S_GLOBAL 0 /* global */ -#define ABC_S_HEAD 1 /* in header (after X:) */ -#define ABC_S_TUNE 2 /* in tune (after K:) */ - unsigned short flags; -#define ABC_F_ERROR 0x0001 /* error around this symbol */ -#define ABC_F_INVIS 0x0002 /* invisible symbol */ -#define ABC_F_SPACE 0x0004 /* space before a note */ -#define ABC_F_STEMLESS 0x0008 /* note with no stem */ -#define ABC_F_LYRIC_START 0x0010 /* may start a lyric here */ -#define ABC_F_GRACE 0x0020 /* grace note */ -#define ABC_F_GR_END 0x0040 /* end of grace note sequence */ -#define ABC_F_SAPPO 0x0080 /* short appoggiatura */ - unsigned short colnum; /* ABC source column number */ - int linenum; /* ABC source line number */ - char *fn; /* ABC source file name */ - char *text; /* main text (INFO, PSCOM), - * guitar chord (NOTE, REST, BAR) */ - char *comment; /* comment part (when keep_comment) */ - union { /* type dependent part */ - struct key_s { /* K: info */ - signed char sf; /* sharp (> 0) flats (< 0) */ - char empty; /* clef alone if 1, 'none' if 2 */ - char exp; /* exp (1) or mod (0) */ - char mode; /* mode */ -/* 0: Ionian, 1: Dorian, 2: Phrygian, 3: Lydian, 4: Mixolydian - * 5: Aeolian, 6: Locrian, 7: major, 8:minor, 9: HP, 10: Hp */ -#define MAJOR 7 -#define MINOR 8 -#define BAGPIPE 9 /* bagpipe when >= 8 */ - signed char nacc; /* number of explicit accidentals */ - /* (-1) if no accidental */ - signed char octave; /* 'octave=' */ -#define NO_OCTAVE 10 /* no 'octave=' */ - unsigned char microscale; /* microtone denominator - 1 */ - signed char pits[8]; - unsigned char accs[8]; - } key; - struct { /* L: info */ - int base_length; /* basic note length */ - } length; - struct meter_s { /* M: info */ - short wmeasure; /* duration of a measure */ - unsigned char nmeter; /* number of meter elements */ - char expdur; /* explicit measure duration */ -#define MAX_MEASURE 6 - struct { - char top[8]; /* top value */ - char bot[2]; /* bottom value */ - } meter[MAX_MEASURE]; - } meter; - struct { /* Q: info */ - char *str1; /* string before */ - short length[4]; /* up to 4 note lengths */ - char *value; /* tempo value */ - char *str2; /* string after */ - } tempo; - struct { /* V: info */ - char id[VOICE_ID_SZ]; /* voice ID */ - char *fname; /* full name */ - char *nname; /* nick name */ - float scale; /* != 0 when change */ - unsigned char voice; /* voice number */ - signed char octave; /* 'octave=' - same as in K: */ - char merge; /* merge with previous voice */ - signed char stem; /* have stems up or down (2 = auto) */ - signed char gstem; /* have grace stems up or down (2 = auto) */ - signed char dyn; /* have dynamic marks above or below the staff */ - signed char lyrics; /* have lyrics above or below the staff */ - signed char gchord; /* have gchord above or below the staff */ - } voice; - struct { /* bar, mrest or mrep */ - int type; - char repeat_bar; - char len; /* len if mrest or mrep */ - char dotted; - struct deco dc; /* decorations */ - } bar; - struct clef_s { /* clef (and staff!) */ - char *name; /* PS drawing function */ - float staffscale; /* != 0 when change */ - signed char stafflines; /* >= 0 when change */ - signed char type; /* no clef if < 0 */ -#define TREBLE 0 -#define ALTO 1 -#define BASS 2 -#define PERC 3 - char line; - signed char octave; - signed char transpose; - char invis; - char check_pitch; /* check if old abc2ps transposition */ - } clef; - struct note note; /* note, rest */ - struct { /* user defined accent */ - unsigned char symbol; - unsigned char value; - } user; - struct { - char type; /* 0: end of line - * 1: continuation ('\') - * 2: line break ('!') */ - } eoln; - struct { /* voice overlay */ - char type; -#define V_OVER_V 0 /* & */ -#define V_OVER_S 1 /* (& */ -#define V_OVER_E 2 /* &) */ - unsigned char voice; - } v_over; - struct { /* tuplet */ - char p_plet, q_plet, r_plet; - } tuplet; - } u; -}; - -/* tune definition */ -struct abctune { - struct abctune *next; /* next tune */ - struct abcsym *first_sym; /* first symbol */ - struct abcsym *last_sym; /* last symbol */ - int abc_vers; /* ABC version = (H << 16) + (M << 8) + L */ - void *client_data; /* client data */ - unsigned short micro_tb[MAXMICRO]; /* microtone values [ (n-1) | (d-1) ] */ -}; - -#ifdef WIN32 -#define strcasecmp stricmp -#define strncasecmp strnicmp -#endif - -#if defined(__cplusplus) -extern "C" { -#endif -extern char *deco_tb[]; -extern int severity; - -void abc_delete(struct abcsym *as); -void abc_free(struct abctune *first_tune); -void abc_init(void *alloc_f_api(int size), - void free_f_api(void *ptr), - void level_f_api(int level), - int client_sz_api, - int keep_comment_api); -void abc_insert(char *file_api, - struct abcsym *s); -struct abcsym *abc_new(struct abctune *t, - char *p, - char *comment); -struct abctune *abc_parse(char *file_api); -char *get_str(char *d, - char *s, - int maxlen); -char *parse_deco(char *p, - struct deco *deco); -#if defined(__cplusplus) -} -#endif diff -Nru abcm2ps-7.8.9/accordion.abc abcm2ps-8.14.2/accordion.abc --- abcm2ps-7.8.9/accordion.abc 2011-11-03 18:22:22.000000000 +0000 +++ abcm2ps-8.14.2/accordion.abc 2018-12-18 15:18:26.000000000 +0000 @@ -45,7 +45,7 @@ M:4/4 K:Am %%tablature 70 accordh accordn accordb - "A"A2 cA "F" aAce | "G"dGBd "C"e4 | "F"fedc "G"B2 AB |1 "F"cABc "E"B4 :|2 "F"cABc "A"A4 :|\ + "A"A2 cA "F" aAce | "G"dGBd "C"e4 | "F"fedc "G"B2 AB |1 "F"cABc "E"B4 :|2 "F"cABc "A"A4 :| w: * * * * * * * 8 6 7 8 7' * * * * * * * * * * * 7 * * * * * w: 7 8 7 11 7 8 9 * * * * * 8' 9 7' 8 6' 7 6' 8 7 6' 8 * 8 7 6' 8 7 "A"A2 GF "E"E3 B | "E"c2 d2 "C"e4 | "F"fedc "G"B2 AB |1 "F"cABc "E"B4 :|2 "F"cABc "A"A4 :| diff -Nru abcm2ps-7.8.9/bravura.abc abcm2ps-8.14.2/bravura.abc --- abcm2ps-7.8.9/bravura.abc 1970-01-01 00:00:00.000000000 +0000 +++ abcm2ps-8.14.2/bravura.abc 2018-12-18 15:18:26.000000000 +0000 @@ -0,0 +1,56 @@ +% example of musical symbols by Bravura + +% --- definitions for SVG output --- +%%beginsvg +<style type="text/css"> + @font-face { + font-family: 'Bravura'; + src: url(/home/jef/abcm2ps-devel/bravura/woff/Bravura.woff); + font-weight: normal; + font-style: normal; + } +</style> +<defs> + <text id="brace" x="-3" y="0" transform="scale(3,-4.2)" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="tclef" x="-8" y="-6" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="cclef" x="-7" y="-12" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="bclef" x="-7" y="-18" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="csig" x="-5" y="-12" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="ft0" x="-2" y="0" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="nt0" x="-2" y="0" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="sh0" x="-2" y="0" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="dsh0" x="-2" y="0" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="dft0" x="-3" y="0" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> + <text id="turn" x="-4" y="0" font-family="Bravura" + font-size="24" font-weight="normal" font-style="normal"></text> +</defs> +%%endsvg + +% --- definitions for PostScript output --- +%%beginps nosvg +/brace{/Bravura 24 selectfont + gsave + T -7.5 0 M -.042 mul 3 exch scale + /uniE000 glyphshow + grestore}! +/tclef{/Bravura 24 selectfont M -8 6 RM/uniE050 glyphshow}! +/cclef{/Bravura 24 selectfont M -8 12 RM/uniE05C glyphshow}! +/bclef{/Bravura 24 selectfont M -8 18 RM/uniE062 glyphshow}! +/csig{/Bravura 24 selectfont M -5 12 RM/uniE08A glyphshow}! +/ft0{/Bravura 24 selectfont M -2 0 RM/uniE260 glyphshow}! +/nt0{/Bravura 24 selectfont M -2 0 RM/uniE261 glyphshow}! +/sh0{/Bravura 24 selectfont M -2 0 RM/uniE262 glyphshow}! +/dsh0{/Bravura 24 selectfont M -2 0 RM/uniE263 glyphshow}! +/dft0{/Bravura 24 selectfont M -3 0 RM/uniE264 glyphshow}! +/turn{/Bravura 24 selectfont M -4 0 RM/uniE567 glyphshow}! +%%endps diff -Nru abcm2ps-7.8.9/buffer.c abcm2ps-8.14.2/buffer.c --- abcm2ps-7.8.9/buffer.c 2014-07-04 18:10:30.000000000 +0000 +++ abcm2ps-8.14.2/buffer.c 2018-12-18 15:18:26.000000000 +0000 @@ -3,22 +3,13 @@ * * This file is part of abcm2ps. * - * Copyright (C) 1998-2014 Jean-François Moine + * Copyright (C) 1998-2017 Jean-François Moine * Adapted from abc2ps, Copyright (C) 1996,1997 Michael Methfessel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #include <stdarg.h> @@ -26,12 +17,9 @@ #include <string.h> #include <ctype.h> -#ifdef WIN32 -#define snprintf _snprintf -#endif - -#include "abc2ps.h" +#include "abcm2ps.h" +#define PPI_96_72 0.75 // convert page format to 72 PPI #define BUFFLN 80 /* max number of lines in output buffer */ static int ln_num; /* number of lines in buffer */ @@ -43,11 +31,12 @@ static float cur_lmarg = 0; /* current left margin */ static float min_lmarg, max_rmarg; /* margins for -E/-g */ static float cur_scale = 1.0; /* current scale */ -static float maxy; /* remaining vertical space in page */ +static float maxy; /* usable vertical space in page */ +static float remy; /* remaining vertical space in page */ static float bposy; /* current position in buffered data */ static int nepsf; /* counter for -E/-g output files */ static int nbpages; /* number of pages in the output file */ -static int outbufsz; /* size of outbuf */ + int outbufsz; /* size of outbuf */ static char outfnam[FILENAME_MAX]; /* internal file name for open/close */ static struct FORMAT *p_fmt; /* current format while treating a new page */ @@ -57,6 +46,11 @@ char *outbuf; /* output buffer.. should hold one tune */ char *mbf; /* where to a2b() */ int use_buffer; /* 1 if lines are being accumulated */ +int (*output)(FILE *out, const char *fmt, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))) +#endif + ; /* -- cut off extension on a file identifier -- */ static void cutext(char *fid) @@ -70,7 +64,7 @@ } /* -- open the output file -- */ -static void open_fout(void) +void open_fout(void) { int i; char fnm[FILENAME_MAX]; @@ -78,29 +72,20 @@ strcpy(fnm, outfn); i = strlen(fnm) - 1; if (i < 0) { - strcpy(fnm, svg ? "Out.xhtml" : OUTPUTFILE); -#if 1 + strcpy(fnm, svg || epsf > 1 ? "Out.xhtml" : OUTPUTFILE); } else if (i != 0 || fnm[0] != '-') { -#else - } else if (i == 0 && fnm[0] == '-') { - if (svg == 1) { - error(1, 0, "Cannot use stdout with '-v' - abort"); - exit(EXIT_FAILURE); - } - } else { -#endif - if (fnm[i] == '=') { + if (fnm[i] == '=' && in_fname) { char *p; - if ((p = strrchr(in_fname, DIRSEP)) == 0) + if ((p = strrchr(in_fname, DIRSEP)) == NULL) p = in_fname; else p++; -/*fixme: should check if there is a DIRSEP at the end of fnm*/ strcpy(&fnm[i], p); - strext(fnm, svg ? "xhtml" : "ps"); + strext(fnm, svg || epsf > 1 ? "xhtml" : "ps"); } else if (fnm[i] == DIRSEP) { - strcpy(&fnm[i + 1], OUTPUTFILE); + strcpy(&fnm[i + 1], + svg || epsf > 1 ? "Out.xhtml" : OUTPUTFILE); } #if 0 /*fixme: fnm may be a directory*/ @@ -153,23 +138,23 @@ { time_t ltime; unsigned i; - char version[32]; + char version[] = "/creator [(abcm2ps) " VERSION "] def"; if (epsf) { cur_lmarg = min_lmarg - 10; fprintf(fout, "%%!PS-Adobe-2.0 EPSF-2.0\n" "%%%%BoundingBox: 0 0 %.0f %.0f\n", - (p_fmt->landscape ? p_fmt->pageheight : p_fmt->pagewidth) - - cur_lmarg - max_rmarg + 10, - -bposy); + ((p_fmt->landscape ? p_fmt->pageheight : p_fmt->pagewidth) + - cur_lmarg - max_rmarg + 10) * PPI_96_72, + -bposy * PPI_96_72); marg_init(); } else { if (!fout) open_fout(); fprintf(fout, "%%!PS-Adobe-2.0\n"); fprintf(fout, "%%%%BoundingBox: 0 0 %.0f %.0f\n", - p_fmt->pagewidth, - p_fmt->pageheight); + p_fmt->pagewidth * PPI_96_72, + p_fmt->pageheight * PPI_96_72); } fprintf(fout, "%%%%Title: %s\n", str); time(<ime); @@ -208,7 +193,6 @@ fprintf(fout, "\n\n"); if (epsf) fprintf(fout, "save\n"); - strcpy(version, "/creator [(abcm2ps) " VERSION "] def"); for (i = 0; i < strlen(version); i++) { if (version[i] == '.') version[i] = ' '; @@ -226,16 +210,22 @@ "/SLW/setlinewidth load def\n" "/defl 0 def\n" /* decoration flags - see deco.c for values */ "/dlw{0.7 SLW}!\n" - "%s\n", version); define_symbols(); output = fprintf; user_ps_write(); define_fonts(); - if (!epsf) + if (!epsf) { fprintf(fout, "/setpagedevice where{pop\n" - " <</PageSize[%.0f %.0f]>>setpagedevice}if\n", - p_fmt->pagewidth, p_fmt->pageheight); + " <</PageSize[%.0f %.0f]", + p_fmt->pagewidth * PPI_96_72, + p_fmt->pageheight * PPI_96_72); + if (cfmt.gutter) + fprintf(fout, + "\n /BeginPage{1 and 0 eq{%.1f 0 T}{-%.1f 0 T}ifelse}bind\n ", + cfmt.gutter, cfmt.gutter); + fprintf(fout, ">>setpagedevice}if\n"); + } fprintf(fout, "%%%%EndSetup\n"); file_initialized = 1; } @@ -246,8 +236,8 @@ cur_lmarg = min_lmarg - 10; output = svg_output; #if 1 //fixme:test - if (file_initialized) - fprintf(stderr, "??? init_svg: file_initialized"); + if (file_initialized > 0) + fprintf(stderr, "??? init_svg: file_initialized\n"); #endif define_svg_symbols(str, nepsf, (p_fmt->landscape ? p_fmt->pageheight : p_fmt->pagewidth) @@ -267,11 +257,10 @@ goto out1; m = ftell(fout); if (epsf || svg == 1) - fprintf(stderr, "Output written on %s (%ld bytes)\n", + printf("Output written on %s (%ld bytes)\n", outfnam, m); else - fprintf(stderr, - "Output written on %s (%d page%s, %d title%s, %ld bytes)\n", + printf("Output written on %s (%d page%s, %d title%s, %ld bytes)\n", outfnam, nbpages, nbpages == 1 ? "" : "s", tunenum, tunenum == 1 ? "" : "s", @@ -297,17 +286,25 @@ if (tunenum == 0) error(0, NULL, "No tunes written to output file"); close_page(); - if (!svg) { - fprintf(fout, "%%%%Trailer\n" - "%%%%Pages: %d\n" - "%%EOF\n", nbpages); + switch (svg) { + case 0: /* PS */ + if (epsf == 0) + fprintf(fout, "%%%%Trailer\n" + "%%%%Pages: %d\n" + "%%EOF\n", nbpages); close_fout(); - } else if (svg == 2) { + break; + case 2: /* -X */ fputs("</body>\n" "</html>\n", fout); + case 3: /* -z */ close_fout(); - } /* else (svg == 1) - * 'fout' is closed in close_page */ + break; +// default: +// case 1: /* -v */ +// 'fout' is closed in close_page + } + nbpages = tunenum = 0; defl = 0; } @@ -322,23 +319,18 @@ svg_close(); if (svg == 1 && fout != stdout) close_fout(); - else - fputs("</p>\n", fout); +// else +// fputs("</p>\n", fout); } else { -#if 1 fprintf(fout, "grestore\n" "showpage\n" "%%%%EndPage: %d %d\n", nbpages, nbpages); -#else - fputs("%%PageTrailer\n" - "grestore\n" - "showpage\n", fout); -#endif } cur_lmarg = 0; cur_scale = 1.0; outft = -1; + use_buffer = 0; } /* -- output a header/footer element -- */ @@ -390,7 +382,7 @@ p++; if (*p < 'A' || *p > 'Z' || !info[*p - 'A']) break; - d += sprintf(d, "%s", &info[*p - 'A']->as.text[2]); + d += sprintf(d, "%s", &info[*p - 'A']->text[2]); break; case 'P': /* page number */ if (p[1] == '0') { @@ -404,8 +396,20 @@ } d += sprintf(d, "%d", pagenum); break; + case 'Q': /* non-resetting page number */ + if (p[1] == '0') { + p++; + if (pagenum_nr & 1) + break; + } else if (p[1] == '1') { + p++; + if ((pagenum_nr & 1) == 0) + break; + } + d += sprintf(d, "%d", pagenum_nr); + break; case 'T': /* tune title */ - q = &info['T' - 'A']->as.text[2]; + q = &info['T' - 'A']->text[2]; tex_str(q); d += sprintf(d, "%s", tex_buf); break; @@ -425,11 +429,12 @@ float pwidth, float pheight) { - char tmp[TEX_BUF_SZ], str[TEX_BUF_SZ + 1024]; - char *p, *q, *r, *mbf_sav; + char tmp[2048], str[TEX_BUF_SZ + 512]; + char *p, *q, *r, *outbuf_sav, *mbf_sav; float size, y, wsize; struct FONTSPEC *f, f_sav; - int cft_sav, dft_sav; + + int cft_sav, dft_sav, outbufsz_sav; if (header) { p = cfmt.header; @@ -463,6 +468,10 @@ *r = '\0'; } mbf_sav = mbf; + outbuf_sav = outbuf; + outbufsz_sav = outbufsz; + outbuf = tmp; + outbufsz = sizeof tmp; for (;;) { tex_str(p); strcpy(tmp, tex_buf); @@ -475,13 +484,13 @@ *q = '\0'; output(fout, "%.1f %.1f M ", p_fmt->leftmargin, y); + mbf = tmp; str_out(p, A_LEFT); a2b("\n"); - mbf = mbf_sav; if (svg) - svg_write(mbf, strlen(mbf)); + svg_write(tmp, strlen(tmp)); else - fputs(mbf, fout); + fputs(tmp, fout); } p = q + 1; } @@ -492,13 +501,13 @@ if (q != p) { output(fout, "%.1f %.1f M ", pwidth * 0.5, y); + mbf = tmp; str_out(p, A_CENTER); a2b("\n"); - mbf = mbf_sav; if (svg) - svg_write(mbf, strlen(mbf)); + svg_write(tmp, strlen(tmp)); else - fputs(mbf, fout); + fputs(tmp, fout); } /* right side */ @@ -507,13 +516,13 @@ if (*p != '\0') { output(fout, "%.1f %.1f M ", pwidth - p_fmt->rightmargin, y); + mbf = tmp; str_out(p, A_RIGHT); a2b("\n"); - mbf = mbf_sav; if (svg) - svg_write(mbf, strlen(mbf)); + svg_write(tmp, strlen(tmp)); else - fputs(mbf, fout); + fputs(tmp, fout); } } if (!r) @@ -524,8 +533,10 @@ y -= size; } - /* restore the fonts */ - *mbf_sav = '\0'; + /* restore the buffer and fonts */ + outbuf = outbuf_sav; + outbufsz = outbufsz_sav; + mbf = mbf_sav; memcpy(&cfmt.font_tb[0], &f_sav, sizeof cfmt.font_tb[0]); set_str_font(cft_sav, dft_sav); return wsize; @@ -541,12 +552,13 @@ nbpages++; if (svg) { - if (!file_initialized) { + if (file_initialized <= 0) { if (!fout) open_fout(); define_svg_symbols(in_fname, nbpages, cfmt.landscape ? p_fmt->pageheight : p_fmt->pagewidth, cfmt.landscape ? p_fmt->pagewidth : p_fmt->pageheight); + user_ps_write(); file_initialized = 1; output = svg_output; } else { @@ -554,8 +566,7 @@ cfmt.landscape ? p_fmt->pageheight : p_fmt->pagewidth, cfmt.landscape ? p_fmt->pagewidth : p_fmt->pageheight); } - user_ps_write(); - } else if (!file_initialized) { + } else if (file_initialized <= 0) { init_ps(in_fname); } in_page = 1; @@ -569,13 +580,13 @@ pwidth = cfmt.pageheight; if (!svg) fprintf(fout, "%%%%PageOrientation: Landscape\n" - "gsave 90 rotate 0 %.1f T\n", + "gsave 0.75 dup scale 90 rotate 0 %.1f T\n", -cfmt.topmargin); } else { pheight = cfmt.pageheight; pwidth = p_fmt->pagewidth; if (!svg) - fprintf(fout, "gsave 0 %.1f T\n", + fprintf(fout, "gsave 0.75 dup scale 0 %.1f T\n", pheight - cfmt.topmargin); } if (svg) @@ -583,10 +594,10 @@ else output(fout, "%% --- width %.1f\n", /* for index */ - ((cfmt.landscape ? cfmt.pageheight : cfmt.pagewidth) - - cfmt.leftmargin - cfmt.rightmargin) / cfmt.scale); + (pwidth - cfmt.leftmargin - cfmt.rightmargin) / + cfmt.scale); - maxy = pheight - cfmt.topmargin - cfmt.botmargin; + remy = maxy = pheight - cfmt.topmargin - cfmt.botmargin; /* output the header and footer */ if (!cfmt.header) { @@ -607,12 +618,13 @@ dy = headfooter(1, pwidth, pheight); if (dy != 0) { output(fout, "0 %.1f T\n", -dy); - maxy -= dy; + remy -= dy; } } if (cfmt.footer) - maxy -= headfooter(0, pwidth, pheight); + remy -= headfooter(0, pwidth, pheight); pagenum++; + pagenum_nr++; outft = -1; } @@ -635,7 +647,7 @@ { unsigned char c; - snprintf(p, sz, "%.72s (%.4s)", in_fname, &info['X' - 'A']->as.text[2]); + snprintf(p, sz, "%.72s (%.4s)", in_fname, &info['X' - 'A']->text[2]); while ((c = (unsigned char) *p) != '\0') { if (c >= 0x80) { if ((c & 0xf8) == 0xf0) { @@ -670,61 +682,60 @@ p_fmt = &cfmt; /* tune format */ - strcpy(outfnam, outfn); - if (outfnam[0] == '\0') - strcpy(outfnam, OUTPUTFILE); - cutext(outfnam); - i = strlen(outfnam) - 1; - if (i == 0 && outfnam[0] == '-') { - if (epsf == 1) { - error(1, NULL, "Cannot use stdout with '-E' - abort"); - exit(EXIT_FAILURE); - } - fout = stdout; - } else { - if (outfnam[i] == '=') { - p = &info['T' - 'A']->as.text[2]; - while (isspace((unsigned char) *p)) - p++; - strncpy(&outfnam[i], p, sizeof outfnam - i - 4); - outfnam[sizeof outfnam - 5] = '\0'; - epsf_fn_adj(&outfnam[i]); + if (epsf != 3) { /* if not -z */ + strcpy(outfnam, outfn); + if (outfnam[0] == '\0') + strcpy(outfnam, OUTPUTFILE); + cutext(outfnam); + i = strlen(outfnam) - 1; + if (i == 0 && outfnam[0] == '-') { + if (epsf == 1) { + error(1, NULL, "Cannot use stdout with '-E' - abort"); + exit(EXIT_FAILURE); + } + fout = stdout; } else { - if (i >= sizeof outfnam - 4 - 3) - i = sizeof outfnam - 4 - 3; - sprintf(&outfnam[i + 1], "%03d", ++nepsf); - } - strcat(outfnam, epsf == 1 ? ".eps" : ".svg"); - if ((fout = fopen(outfnam, "w")) == NULL) { - error(1, NULL, "Cannot open output file %s - abort", - outfnam); - exit(EXIT_FAILURE); + if (outfnam[i] == '=') { + p = &info['T' - 'A']->text[2]; + while (isspace((unsigned char) *p)) + p++; + strncpy(&outfnam[i], p, sizeof outfnam - i - 4); + outfnam[sizeof outfnam - 5] = '\0'; + epsf_fn_adj(&outfnam[i]); + } else { + if (i >= sizeof outfnam - 4 - 3) + i = sizeof outfnam - 4 - 3; + sprintf(&outfnam[i + 1], "%03d", ++nepsf); + } + strcat(outfnam, epsf == 1 ? ".eps" : ".svg"); + if ((fout = fopen(outfnam, "w")) == NULL) { + error(1, NULL, "Cannot open output file %s - abort", + outfnam); + exit(EXIT_FAILURE); + } } } epsf_title(title, sizeof title); if (epsf == 1) { init_ps(title); - fprintf(fout, "0 %.1f T\n", -bposy); + fprintf(fout, "0.75 dup scale 0 %.1f T\n", -bposy); write_buffer(); fprintf(fout, "showpage\nrestore\n"); } else { + if (epsf == 3 && file_initialized == 0) + fputs("<br/>\n", fout); /* new image in the same flow */ init_svg(title); write_buffer(); svg_close(); } - close_fout(); + if (epsf != 3) + close_fout(); + else + file_initialized = 0; cur_lmarg = 0; cur_scale = 1.0; } -/* -- start a new page -- */ -/* epsf is always null */ -static void newpage(void) -{ - close_page(); - init_page(); -} - /* subroutines to handle output buffer */ /* -- update the output buffer pointer -- */ @@ -740,7 +751,7 @@ } error(0, NULL, "Possible buffer overflow"); write_buffer(); - use_buffer = 0; +// use_buffer = 0; } va_start(args, fmt); mbf += vsnprintf(mbf, outbuf + outbufsz - mbf, fmt, args); @@ -750,6 +761,8 @@ /* -- translate down by 'h' scaled points in output buffer -- */ void bskip(float h) { + if (h == 0) + return; bposy -= h * cfmt.scale; a2b("0 %.2f T\n", -h); } @@ -760,8 +773,8 @@ if (outbuf) free(outbuf); outbufsz = kbsz * 1024; - if (outbufsz < 0x10000) - outbufsz = 0x10000; +// if (outbufsz < 0x10000) +// outbufsz = 0x10000; outbuf = malloc(outbufsz); if (!outbuf) { error(1, NULL, "Out of memory for outbuf - abort"); @@ -802,9 +815,10 @@ } } dp = ln_pos[l] - p1; - np = maxy + dp < 0 && !epsf; + np = remy + dp < 0 && !epsf; if (np) { - newpage(); + close_page(); + init_page(); if (ln_font[l] >= 0) { struct FONTSPEC *f; @@ -825,10 +839,10 @@ } if (np) { output(fout, "0 %.2f T\n", -cfmt.topspace); - maxy -= cfmt.topspace * cfmt.scale; + remy -= cfmt.topspace * cfmt.scale; } if (*p_buf != '\001') { - if (epsf == 2 || svg) + if (epsf > 1 || svg) svg_write(p_buf, ln_buf[l] - p_buf); else fwrite(p_buf, 1, ln_buf[l] - p_buf, fout); @@ -846,7 +860,7 @@ if ((f = fopen(p, "r")) == NULL) { error(1, NULL, "Cannot open EPS file '%s'", p); } else { - if (epsf == 2 || svg) { + if (epsf > 1 || svg) { fprintf(fout, "<!--Begin document %s-->\n", p); svg_output(fout, "gsave\n" @@ -875,27 +889,33 @@ } } p_buf = ln_buf[l]; - maxy += dp; + remy += dp; p1 = ln_pos[l]; } #if 1 //fixme:test - if (*p_buf != '\0') - fprintf(stderr, "??? bug - buffer not empty:\n%s\n", p_buf); + if (*p_buf != '\0') { +// fprintf(stderr, "??? bug - buffer not empty:\n%s\n", p_buf); + memcpy(outbuf, p_buf, strlen(p_buf) + 1); + mbf = &outbuf[strlen(outbuf)]; + } else { + mbf = outbuf; + } #endif outft = outft_sav; bposy = 0; ln_num = 0; - mbf = outbuf; + if (epsf != 3) + use_buffer = 0; } -/* -- add a block in the output buffer -- */ +/* -- add a block of commmon margins / scale in the output buffer -- */ void block_put(void) { if (mbf == outbuf) return; //fixme: should be done sooner and should be adjusted when cfmt change... - if (maxy == 0) - maxy = (cfmt.landscape ? cfmt.pagewidth : cfmt.pageheight) + if (remy == 0) + remy = maxy = (cfmt.landscape ? cfmt.pagewidth : cfmt.pageheight) - cfmt.topmargin - cfmt.botmargin; if (ln_num > 0 && mbf == ln_buf[ln_num - 1]) return; /* no data */ @@ -909,10 +929,10 @@ c = *p; /* (avoid "buffer not empty") */ *p = '\0'; write_buffer(); - multicol_start = maxy + bposy; + multicol_start = remy + bposy; *p = c; strcpy(outbuf, p); - use_buffer = 0; +// use_buffer = 0; } ln_buf[ln_num] = mbf; ln_pos[ln_num] = multicol_start == 0 ? bposy : 1; @@ -927,26 +947,65 @@ ln_font[ln_num] = outft; ln_num++; - if (!use_buffer) { + if (!use_buffer) write_buffer(); - return; - } } /* -- handle completed block in buffer -- */ /* if the added stuff does not fit on current page, write it out after page break and change buffer handling mode to pass though */ -void buffer_eob(void) +void buffer_eob(int eot) { block_put(); - if (maxy + bposy < 0 - && !epsf - && multicol_start == 0) { - if (in_page) - newpage(); - write_buffer(); - use_buffer = 0; + if (epsf) { + if (epsf == 3) + write_eps(); /* close the image */ + return; } + if (remy + bposy >= 0 + || multicol_start != 0) + return; + + // page full + if (!in_page) { + if ((cfmt.splittune == 2 && !(nbpages & 1)) + || (cfmt.splittune == 3 && (nbpages & 1))) { // wrong odd/even page + if (remy + maxy + bposy < 0) { // 2nd overflow + init_page(); + close_page(); + write_buffer(); + return; + } + if (eot) + write_buffer(); + return; + } + } else { + close_page(); + } + if ((cfmt.splittune == 2 && !(nbpages & 1)) + || (cfmt.splittune == 3 && (nbpages & 1))) + use_buffer = 1; // if wrong odd/even page + else + write_buffer(); +#if 0 +--- old + if (use_buffer + && !eot + && ((cfmt.splittune == 2 && !(nbpages & 1)) + || (cfmt.splittune == 3 && (nbpages & 1)))) { + init_page(); +// 8.7.4 + use_buffer = 1; + } else { +// 8.7.5 - required to avoid buffer overflow + write_buffer(); + } +//8.7.0 +// write_buffer(); +//8.6.2 +// use_buffer = 0; +#endif } /* -- dump buffer if not enough place for a music line -- */ @@ -956,12 +1015,12 @@ error(0, NULL, "Possibly bad page breaks, outbufsz exceeded"); write_buffer(); - use_buffer = 0; +// use_buffer = 0; } } /* -- return the current vertical offset in the page -- */ float get_bposy(void) { - return maxy + bposy; + return remy + bposy; } diff -Nru abcm2ps-7.8.9/build.ninja abcm2ps-8.14.2/build.ninja --- abcm2ps-7.8.9/build.ninja 2014-10-14 16:53:06.000000000 +0000 +++ abcm2ps-8.14.2/build.ninja 2018-12-18 15:18:26.000000000 +0000 @@ -1,97 +1,58 @@ -# rules for ninja (ninja-build) +# rules for ninja (ninja-build) or samurai -VERSION = 7.8.9 - -cflags = -g -O2 -Wall -pipe -DHAVE_CONFIG_H -I. -#cflags = -g -Wall -pipe -DHAVE_CONFIG_H -I. -ldflags = -lm +cc=musl-gcc +#cc=gcc +#cc=clang + +#cflags = -O2 -Wall -pipe -I. -fpie +cflags = -g -Wall -pipe -I. -fpie +ldflags=-static -Wl,--no-dynamic-linker -lm rule cc -# command = gcc $cflags -c $in -o $out - command = clang $cflags -c $in -o $out -# -mcpu=iwmmxt -# -mcpu=iwmmxt2 -# -mthumb -march=armv7-a + command = $cc $cflags -c $in -o $out rule ld -# command = cc $ldflags -o $out $in - command = clang $ldflags -o $out $in + command = $cc $ldflags -o $out $in -build abc2ps.o: cc abc2ps.c | config.h abcparse.h abc2ps.h front.h -build abcparse.o: cc abcparse.c | config.h abcparse.h -build buffer.o: cc buffer.c | config.h abcparse.h abc2ps.h -build deco.o: cc deco.c | config.h abcparse.h abc2ps.h -build draw.o: cc draw.c | config.h abcparse.h abc2ps.h -build format.o: cc format.c | config.h abcparse.h abc2ps.h -build front.o: cc front.c | config.h abcparse.h abc2ps.h front.h slre.h -build glyph.o: cc glyph.c | config.h abcparse.h abc2ps.h -build music.o: cc music.c | config.h abcparse.h abc2ps.h -build parse.o: cc parse.c | config.h abcparse.h abc2ps.h -build slre.o: cc slre.c | slre.h -build subs.o: cc subs.c | config.h abcparse.h abc2ps.h -build svg.o: cc svg.c | config.h abcparse.h abc2ps.h -build syms.o: cc syms.c | config.h abcparse.h abc2ps.h +build abcm2ps.o: cc abcm2ps.c | config.h abcm2ps.h +build abcparse.o: cc abcparse.c | config.h abcm2ps.h +build buffer.o: cc buffer.c | config.h abcm2ps.h +build deco.o: cc deco.c | config.h abcm2ps.h +build draw.o: cc draw.c | config.h abcm2ps.h +build format.o: cc format.c | config.h abcm2ps.h +build front.o: cc front.c | config.h abcm2ps.h +build glyph.o: cc glyph.c | config.h abcm2ps.h +build music.o: cc music.c | config.h abcm2ps.h +build parse.o: cc parse.c | config.h abcm2ps.h +build subs.o: cc subs.c | config.h abcm2ps.h +build svg.o: cc svg.c | config.h abcm2ps.h +build syms.o: cc syms.c | config.h abcm2ps.h -build abcm2ps: ld abc2ps.o abcparse.o buffer.o deco.o draw.o format.o front.o $ - glyph.o music.o parse.o slre.o subs.o svg.o syms.o +build abcm2ps: ld abcm2ps.o abcparse.o buffer.o deco.o draw.o format.o front.o $ + glyph.o music.o parse.o subs.o svg.o syms.o default abcm2ps -rule dist_tar - command = ln -s . abcm2ps-$VERSION; $ - tar -zcvf $out $ - abcm2ps-$VERSION/Changes $ - abcm2ps-$VERSION/INSTALL $ - abcm2ps-$VERSION/License $ - abcm2ps-$VERSION/Makefile $ - abcm2ps-$VERSION/Makefile.in $ - abcm2ps-$VERSION/README $ - abcm2ps-$VERSION/abc2ps.c $ - abcm2ps-$VERSION/abc2ps.h $ - abcm2ps-$VERSION/abcparse.c $ - abcm2ps-$VERSION/abcparse.h $ - abcm2ps-$VERSION/accordion.abc $ - abcm2ps-$VERSION/build.ninja $ - abcm2ps-$VERSION/buffer.c $ - abcm2ps-$VERSION/chinese.abc $ - abcm2ps-$VERSION/configure $ - abcm2ps-$VERSION/configure.in $ - abcm2ps-$VERSION/config.h $ - abcm2ps-$VERSION/config.h.in $ - abcm2ps-$VERSION/config.guess $ - abcm2ps-$VERSION/config.sub $ - abcm2ps-$VERSION/deco.c $ - abcm2ps-$VERSION/deco.abc $ - abcm2ps-$VERSION/draw.c $ - abcm2ps-$VERSION/features.txt $ - abcm2ps-$VERSION/flute.fmt $ - abcm2ps-$VERSION/format.c $ - abcm2ps-$VERSION/format.txt $ - abcm2ps-$VERSION/front.c $ - abcm2ps-$VERSION/front.h $ - abcm2ps-$VERSION/glyph.c $ - abcm2ps-$VERSION/install.sh $ - abcm2ps-$VERSION/landscape.fmt $ - abcm2ps-$VERSION/music.c $ - abcm2ps-$VERSION/musicfont.fmt $ - abcm2ps-$VERSION/newfeatures.abc $ - abcm2ps-$VERSION/options.txt $ - abcm2ps-$VERSION/parse.c $ - abcm2ps-$VERSION/sample.abc $ - abcm2ps-$VERSION/sample2.abc $ - abcm2ps-$VERSION/sample3.abc $ - abcm2ps-$VERSION/sample3.eps $ - abcm2ps-$VERSION/sample4.abc $ - abcm2ps-$VERSION/sample5.abc $ - abcm2ps-$VERSION/slre.c $ - abcm2ps-$VERSION/slre.h $ - abcm2ps-$VERSION/subs.c $ - abcm2ps-$VERSION/svg.c $ - abcm2ps-$VERSION/syms.c $ - abcm2ps-$VERSION/tight.fmt $ - abcm2ps-$VERSION/voices.abc;$ - rm abcm2ps-$VERSION - -build abcm2ps-$VERSION.tar.gz: dist_tar - -build dist: phony abcm2ps-$VERSION.tar.gz +# GitHub releases +rule version + command = tag=`grep VERSION= configure|cut -d'=' -f2`;$ + if [ $out = minor ]; then$ + m=$${tag#*.};$ + m=$${m%%.*};$ + m=$$((m + 1));$ + newtag="$${tag%%.*}.$$m.0";$ + else$ + p=$${tag##*.};$ + p=$$((p + 1));$ + newtag="$${tag%.*}.$$p";$ + fi;$ + p=`grep VDATE= configure|cut -d'=' -f2`;$ + m=`date +%F`;$ + mv configure configure~;$ + sed -e "s/$$tag/$$newtag/;s/$$p/$$m/" configure~ > configure;$ + chmod +x configure;$ + echo "New release v$$newtag" | git commit -F- configure;$ + git tag -a v$$newtag;$ + echo "Don't forget: git push --follow-tags; configure" +build minor: version +build patch: version diff -Nru abcm2ps-7.8.9/Changes abcm2ps-8.14.2/Changes --- abcm2ps-7.8.9/Changes 2014-10-14 16:51:26.000000000 +0000 +++ abcm2ps-8.14.2/Changes 1970-01-01 00:00:00.000000000 +0000 @@ -1,914 +0,0 @@ ----- Version 7.8.9 - 14/10/14 ---- - -Fix crash when %%combinevoices on beamed notes since 7.8.7 - (reported by David Lacroix). -Fix bad start/stop of ties since 7.8.4. -Fix possible crash with %%alignbars. -Fix crash when tune starting with grace note in the middle voice - of a 3-voices staff. - ----- Version 7.8.8 - 14/08/29 ---- - -Fix loss of indentation since 7.8.4 - (reported by David Lacroix). -Fix bad stem direction in lowest voice when invisible and visible rests - at a same time in a measure since 7.8.4 - (reported by Eric Reinbold). -Fix crash when multi-rest at start of a second voice of a staff. - ----- Version 7.8.7 - 14/08/09 ---- - -Fix crash when %%combinevoices and different beaming. -Always remove the invisible rests at start of tune when L:auto. -Fix some compilation warnings - (reported by Daniel Branning). -Fix bad split of tune into music lines (imported from 8.1.5) - (reported by Stephen West). -Fix bad horizontal offset of rests alone in a measure - (reported by Stephen West). - ----- Version 7.8.6 - 14/07/17 ---- - -Fix lack of source last character in syntax errors. -Fix double information about the titles/subtitles in the PostScript - output for (external) index generation since 7.8.5 - (reported by Tim Macdonald). -Fix double interpretation of '.' in "!p!.(c" - (reported by David Lacroix). -Fix the size of font of the page header/footer, broken in 7.8.5 - (reported by Francis Stevens). - ----- Version 7.8.5 - 14/07/01 ---- - -Add more information about the titles/subtitles in the PostScript - output for (external) index generation - (asked by Tim Macdonald). -Add Δ (delta) in the known glyphs - (asked by Chuck Boody). -Fix some bad 'Line overfull' messages when automatic line break. -Fix bad interval between staff systems according to %%staffsep - (reported by Eric Reinbold and David Lacroix). -Fix bad %%header/%%footer vertical offsets. -Don't put the last music line on a new page when page overflow on W:. - ----- Version 7.8.4 - 14/06/18 ---- - -Fix clash of voice name with staff when new voice after %%staves. -Fix bad indentation when more staves further in the tune. -Set the ties closer to the notes. -Fix bad handling of '|' when first character in w: - (reported by Alex Scheutzow). -Check the floating voices in %%score/%%staves. -Fix bad stem direction when %%combinevoices. -Fix crash when measure bar numbering and less notes in the upper staff - (reported by : J.Joao Almeida). -Fix too big syntax error messages - (reported by David Lacroix). -Fix bad horizontal offset of full rests in voice overlay - (reported by J.C.L.). - ----- Version 7.8.3 - 14/05/23 ---- - -Fix too wide space between text paragraphs when not fill or justify. -Fix crash when utf-8 and latin characters in a same file - (reported by Henry Bley-Vroman). -Change internal fonts to 'serif' on SVG output. -Forbid rests in grace note sequences. -Fix crash when rest in grace note sequence. -Fix direction of ties in chords with odd number of notes. -Fix bad direction of beam stub when last note with !beambr1! / !beambr2! - (reported by David Lacroix). -Fix crash when only P: or Q: in a generation sequence - (reported by Henry Bley-Vroman). - ----- Version 7.8.2 - 14/05/05 ---- - -Fix non-function of %%voice inside %%tune since some 7.5.x - (reported by Gerhard Schacherl). -Fix small internal problem with decorations. -Fix position of accent marks (!>!) - (reported by Paul Rosen). -Fix bad margins when tune inside %%multicol - (reported by A.B. Steen). -Don't draw repeat brackets when bar between 2 staves. -Fix lack of EOS in some internal strings - (fixed by Olivier Levon). -Fix bad guitar chord / annotation when '\' inside. -Fix double transposition of 2 octaves when both %%abc2pscompat - and octave= in K:/V:. -Fix compilation warnings on MAC - (reported by Chuck Boody). - ----- Version 7.8.1 - 14/04/02 ---- - -Fix bad text justication with PostScript output - (reported by Gerhard Schacherl). -Fix loss of positions (decorations, lyrics..) when described in format file - (reported by John Taylor). -Fix loss of tie at end of line - (reported by David Lacroix). -Fix loss of vertical space above the staves (%%staffsep) since 7.6.10 - (reported by David Lacroix). - ----- Version 7.8.0 - 14/03/26 ---- - -Fix bad buffer size when blank after '-k'. -Fix time shift when L:auto and multi-rests in 2nd voices. -Fix bad %%abcm2ps and %%abc-charset when redefined inside previous tune. -Fix loss of time signature when empty staff system at start of tune. -Add 'forall', 'search' and string comparison to the mini PS interpreter - (asked by Chuck Boody for easynotes.fmt). -Fix bad handling of %%abcm2ps. -Fix bad tie when %%combinevoices and chord behind measure bar and other symbol. - ----- Version 7.7.2 - 14/03/07 ---- - -Fix loss of parameters after '--abcm2ps x' in command line. -Fix loss of lyric word when note as last music line symbol. -Fix bad handling of multi-rests when L:auto. -Fix bad vertical of rests when no notes in voice and clef != treble. -Fix lack of time signature at start of line when %%timewarn. -Fix %%stretchstaff which did not work. -Fix %%parskipfac for non fill/justified texts. -Fix %%infoline in some cases. -Fix %%combinevoices 0 and the rests. -Fix %%break which could not be put in the tune header. -Fix bad generation when SVG output of justified text. -Fix bad %%voice filtering. -Remove option '-u' (abs2pscompat in command line). -Fix bad 'M' decoration when abc2pscompat. -Fix bad duration of notes when grace notes and L:auto. -Fix bad behaviour of '%%gstemdir 3' when at start of n-plet - (reported by David Lacroix). - ----- Version 7.7.1 - 14/02/18 ---- - -Fix crash when decoration at start of tune - (reported by Jean-Luc Zins). - ----- Version 7.7.0 - 14/02/17 ---- - -Fix bad indentation when new name of a voice appearing later in the - music line. -Fix bad rest offset when in 2nd voice and longer than notes of 1st voice. -Fix bad tie when combinevoices and chord behind measure bar. -Change again the behaviour of %%staffnonote. -Set correct vertical space for elements of invisible staves. -Don't output errors when w: found in ignored voice (not in %%staves). -Add option 'opposite' in %%gstemdir - (requested by David Lacroix). -Fix documentation about the default value of %%staffnonote. -Add line number in more 'Too many words..' error messages. -Fix compilation warning. - ----- Version 7.6.10 - 14/01/23 ---- - -Fix crash with rests in previous release - (reported by David Lacroix). - ----- Version 7.6.9 - 14/01/23 ---- - -Change the function name to 'fraction of tone' instead of 'fraction of - semitone' when no 'microscale=', but '%%micronewps 1' - !!compatibility!!. -Add line number when 'Too many words in lyric line' error - (reported by Seymour Shlien). -Fix bad PS functions when K: with explicit list of microtone accidentals. -Include glyphs for microscale=4. -Set %%micronewps when 'microscale=' in K: or V:. -Fix erroneous 'bad tie' when tie at end of line and clef change - in the upper voice. -Do %%tablature work again. -Fix clash of rest with notes when rest between notes since 7.6.8 - (reported by David Lacroix). -Change the behaviour of %%staffnonote - (asked by Atte André Jensen and Steve West). -Fix crash when last music line contains only invisible rests - and %%cfmt.measurenb >= 0. - ----- Version 7.6.8 - 13/11/21 ---- - -Don't display the staves which contain only invisible rests. -Keep the brace staff systems when '%%staffnonote 0' and - at least one staff has some notes. -Have better ties when clef or staff change. -Have better vertical offset of rests in multi-voice tunes - (reported by Eric Reinbold). -Fix bad slur endpoint when above/below a tuplet. -Have better display of mixed slurs and tuplets - (asked by David Lacroix). -Accept %%bgcolor for .xhtml output. -Adjust the offset of elements in empty staves when '%%staffnonote 0'. -Fix bad handling of tuplets with %%combinevoices, sometimes - giving a program crash. -Permit output to stdout with option '-v'. - ----- Version 7.6.7 - 13/11/03 ---- - -Fix again bad <meta> tag in XHTML output - (reported by David Lacroix). - ----- Version 7.6.6 - 13/11/03 ---- - -Add page/sequence information in the SVG headers. -Fix bad <meta> tag in XHTML output - (reported by David Lacroix). - ----- Version 7.6.5 - 13/11/02 ---- - -Fix bad SVG/XHTML output when '--' in the command line. -Put program information in XHTML header only. - ----- Version 7.6.4 - 13/11/01 ---- - -Add more information in svg images (program, command line, - title for building index). -Set no margin for XHTML printing. -Adjust the scale of the SVG images. - ----- Version 7.6.3 - 13/10/25 ---- - -Fix loss of line break when %%postscript at start of line. -Fix bad SVG output when 'show' before 'stroke' or 'fill' - (reported by David Lacroix). -Fix bad position of elements built from PostScript code with 'ltr' - in SVG rendering. - (reported by David Lacroix). -Update config.guess and config.sub from http://git.savannah.gnu.org/ - (asked by Deepak C Shetty and Snehal). -Add 'color="black"' in <svg> tag. -Fix bad font of string starting with non-ascii character (PS output) - (reported by David Lacroix). - ----- Version 7.6.2 - 13/10/18 ---- - -Fix bad tie when ending note is combined with previous voice - (reported by Brian J. Dumont). -Fix loss of gchord/annotation when combine voices and - both notes have guitar chord/annotation - (reported by Atte André Jensen). -Fix bad dash lines with SVG output - (reported by David Lacroix). -Accept XML character references in texts. -Fix bad glyph names of characters greater than latin2 - (reported by David Lacroix). - ----- Version 7.6.1 - 13/10/16 ---- - -Fix bad staff system when %%staves with floating voices. -Permit unlimited PS elements in SVG rendering. -Fix memory overflow with PS 'getinterval' in SVG rendering. -Fix loss of tempo when tune starts with invisible symbol (n-plet, P:..). -Don't raise errors when "%%writefields w 0" and "+:xxx" lines of w:. -Accept a string in 'cvx' for SVG output. -Fix tuplet number vertical offset when slur starting/ending on a same note - (reported by David Lacroix). -Set a correct approximate width of the unicode characters of which - the ending bits are ASCII control characters - (reported by Mike Scott). -Adjust the SVG output closer to PS: - - greater font sizes, - - smaller note heads, - - thiner staff lines and stems. -Update documentation about %%continueall. - ----- Version 7.6.0 - 13/08/20 ---- - -Add build with ninja-build and clang. -Fix %%staves parsing problem which could give bad PS output. -%%glyph added. -Change PS utf-8 handling !!compatibility!!. - ----- Version 7.5.8 - 13/08/07 ---- - -Fix bad offset of rests when under the duration of an upper voice - (reported by David Lacroix). -Check '!' as linebreak only when <EOL> does a linebreak. -Accept latin names of guitar chords on %%transpose. -Fix loss of lyrics under staff when %%alignbars. -Do %%clip without start work again. -Fix bad PS output when many lines in program command line. -Apply L:auto to all voices when declared in the tune header. -Fix L:auto when duration of auto measure > M: duration. -Add more explanations in the file format.txt - (thanks to Seymour Shlien). - ----- Version 7.5.7 - 13/07/16 ---- - -Fix bad horizontal offset of EPS images - (reported by Gerhard Schacherl). -Fix bad clef change when 2 voices on the staff and invisible rests. -Add 'L:auto'. -Better vertical offset of rests when many voices per staff - (reported by David Lacroix). -Fix bad staff on multi-rest expansion when the voice goes later - to an other staff. -Fix bad line break when asked before a bar. -Do %%clip work again. -Fix bad music line breaks with %%break after generation restart. -Fix bad music line breaks with %%barperline and generation restart - (reported by David Lacroix). -Add the command line option '-k'. -Fix bad horizontal offset of stems in SVG output. - ----- Version 7.5.6 - 13/06/17 ---- - -Have better horizontal spacing when music line is too much shrunk. -Fix bad horizontal spacing when high long notes before measure bars - (reported by Mike Scott). -Handle more than 2 unison notes in chords - (asked by Hudson Flávio Meneses Lacerda). -Remove the shift of volume decorations which does not work well - (reported by Jean-Luc Zins). -Fix crash when beam to a repeated sequence - (reported by Søren Bak Vestergaard). -Fix abnormal slur when tuplet or slur over a repeated sequence - (reported by Søren Bak Vestergaard). - ----- Version 7.5.5 - 13/06/06 ---- - -Fix bad position of shifted volume decorations - (reported by David Lacroix). -Fix bad %%transpose of more than one octave down. -Extend %%shiftunison - (asked by David Lacroix). -Keep the natural accidentals when transposing K:none - (reported by David Lacroix). -Fix bad handling of %%splittune - (reported by Gerhard Schacherl). -Allow back text insertion commands in tune header. -Put the measure number a bit higher when at start of line with - a key signature with sharps. -Look to the next note for B stem direction when at start of bar - (requested by Mike Scott). - ----- Version 7.5.4 - 13/05/27 ---- - -Fix abnormal note shift when inverted voices in the staff - since previous release. -Accept %%ps the same as %%postscript - (asked by David Lacroix). -Fix crash with grace notes since previous release - (reported by David Lacroix). -Fix again bad accidentals of 2nd notes in a measure when transposing K:none - (reported by David Lacroix). - ----- Version 7.5.3 - 13/05/24 ---- - -Fix clash of stem and note when bigger stem due to beam - (reported by Hudson Flávio Meneses Lacerda). -Permit %%break in tune header (i.e. out of %%tune). -Fix abnormal error when %%tune folowed by %%break. -Have less width of explicit key signature with same accidentals at octave. -Better handling of %%staffbreak. -Fix lack of staves after %%staves and new staves. -Fix bad line splitting with measure repeat - (reported by Gerhard Schacherl). -Fix bad vertical offset of tune on auto newpage - (reported by Gerhard Schacherl). -Fix the behaviour of "\n" in guitar chord since version 7.x.x - (reported by Gerhard Schacherl). -Don't raise error when %%textfont in tune header. -Have smaller stems in some cases when the voices are inverted on a staff. -Fix loss of deco/stem position/direction when declared in V: - after T: / %%vskip / ... - (reported by Colin Hume). -Don't set natural accidentals when transposing K:none. -Fix bad accidentals of 2nd notes in a measure when transposing K:none - (reported by David Lacroix). -Have half ties when clef or staff change - (reported by David Webber). -Don't shift a voice when no overlap with the previous one. -Don't have one head when unison and different dots - (reported by Hudson Flávio Meneses Lacerda). -Center the repeat measure signs. -Don't have any slur starting from measure repeat signs - (reported by Søren Bak Vestergaard). -Have a longer tie when the ending note is shifted. -Vertically center the rests when alone in a staff - (reported by Hudson Flávio Meneses Lacerda). -Shift on the left the volume decorations (ff, pp..) when under a note - with a stem down - (asked by Hudson Flávio Meneses Lacerda). -Fix loss of rest when %%combinevoices >= 0 and invisible 1st rest. -Extend %%combinevoices and remove %%comball. -Put the dot decorations on the stems - (asked by Hudson Flávio Meneses Lacerda). -Have a better tie vertical offset - (asked by Hudson Flávio Meneses Lacerda). -Fix loss of position/direction commands when after K: or T: inside tune - (reported by Hudson Flávio Meneses Lacerda). -Fix loss of tempo when 'y' at start of tune in secondary voice - (reported by Hudson Flávio Meneses Lacerda). -Don't allow text insertion commands in tune header. -Fix bad horizontal offset of stem when unison and shifted note head - (reported by Hudson Flávio Meneses Lacerda). -Fix nested tuplets vertical offset when slurs - (reported by Hudson Flávio Meneses Lacerda). -Fix a crash when tune with only repeat bars - (reported by Colin Hume). -Fix a crash when K:none and %%transpose - (reported by David Lacroix). - ----- Version 7.5.2 - 13/03/22 ---- - -Fix bad display when %%combinevoice + %%comball and imbricated chords. -Have wider horizontal space at end of music line when no bar. -Fix a crash on explicit music break without a bar - since previous version - (reported by Hudson Flávio Meneses Lacerda). -Define the page format in the PS output. - This fixes page size problems when converting PS to PDF - (asked by Martin Tarenskeen). -Fix a loop when a tune ends with Z, a bar and a chord - (reported by Hudson Flávio Meneses Lacerda). -Check the number of measures of X/Z (multi-rests). - ----- Version 7.5.1 - 13/03/17 ---- - -Fix some clashes of accidentals when same notes in 2 voices on the same staff - (reported by Hudson Flávio Meneses Lacerda). -Fix loss of line at end of %%tune/%%voice - (reported by Hudson Flávio Meneses Lacerda). -Fix bad handling of many %%voice's in %%tune - (reported by Hudson Flávio Meneses Lacerda). -Fix bad horizontal space when note with stem up followed by note - with stem down - (reported by Hudson Flávio Meneses Lacerda). -Fix bad accidentals of tied notes when transpose with K:none - (reported by David Lacroix). -Have smaller vertical space for !emphasis! (accent) - (asked by Hudson Flávio Meneses Lacerda). -Have thicker slurs - (asked by Hudson Flávio Meneses Lacerda). -Have one more beam in feathered beams - (asked by Hudson Flávio Meneses Lacerda). -Fix bad note head when !beam-rall! on quavers - (reported by Hudson Flávio Meneses Lacerda). -Replace the clef of V: in case of voice filter with %%clef - (reported by Hudson Flávio Meneses Lacerda). -Fix bad handling of %%score/%%staves when found after %%voice - (reported by Hudson Flávio Meneses Lacerda). -Fix bad handling of %%beginxx/%%endxx with different abcm2ps - pseudo-comment prefixes. - (reported by Hudson Flávio Meneses Lacerda). -Fix bad music line cut when less notes in the master voice - and no bar at end of line - (reported by Hudson Flávio Meneses Lacerda). -Add 'true' and 'false' in the PS to SVG interpreter - (asked by Hudson Flávio Meneses Lacerda). -Fix bad PS output when 2 empty lines at end of a justified text sequence - (reported by Hudson Flávio Meneses Lacerda). -Fix crash when %%clef in %%voice - (reported by Hudson Flávio Meneses Lacerda). -Fix overlay voice inheritance (%%transpose and glyph placements). -Apply %%transpose in tune header or after first K: to all voices. - ----- Version 7.5.0 - 13/03/01 ---- - -Fix loss of multi-rest when alone in a music line. -Fix clash of rests when 3 voices per staff - (reported by David Lacroix). -Fix loss of %%clef after first K:. -Implement "^8" and "_8" in clef= and %%clef. -Fix abnormal subtitle output when T: found outside of tune - (reported by Henry Bley-Vroman). -Fix bad transposition of chords - (reported by Jean-Luc Zins). -Don't scale the measure numbers when the first staff is scaled - (asked by Hudson Flávio Meneses Lacerda). -!! Accept 'clef=F' as 'clef=F,' !! - (needed for ABC 2.1.1). -Handle many times 'repeat 2 measures' - (asked by Atte André Jensen). -Permit a measure repeat to be at start of music line - (asked by Atte André Jensen). -Fix crash when measure repeat at start of music line - (reported by Atte André Jensen). -Don't output error when info-like 'x:' found outside of tune. - ----- Version 7.4.2 - 13/02/13 ---- - -Fix bad vertical offset of Q: when %%text after first K:. -Extend %%abcm2ps with up to 3 characters. -Don't output the words after tune on %%leftmargin/rightmargin/scale. -Fix bad horizontal place of the tune title when %%leftmargin after K: - (reported by Tim Goetze). -!! Don't start anymore a tune on T: !! - (asked by Henry Bley-Vroman). -Handle %%stafflines after %%score. -Add missing definitions for Microsoft Visual Basic - (reported by Jean-Luc Zins). -Fix bad test of buffer overflow on command options - (reported by Jean-Luc Zins). -Remove extra invisible staff when %%score before %%vskip - (reported by Tim Goetze). -Fix bad warning message when "P: K: Q:" at end of line - (reported by Jean-Luc Zins). -Fix bad tune selection when many files in the command line - (reported by Larry). -Fix lack of slurs when beam on 2 staves - (reported by David Lacroix). -Fix abnormal natural signs after some %%transpose - (reported by Jean-Luc Zins). - ----- Version 7.4.1 - 13/02/11 ---- - -Better error messages when error found at end of ABC line. -Warn on deprecated syntaxes of Q: - (asked by Chuck Boody). -Fix double slurs when beam on 2 staves - (reported by David Lacroix). -Extend %%repeat for working with many voices - (reported by Atte André Jensen). - ----- Version 7.4.0 - 13/01/29 ---- - -Do better transposition of microtonal tunes - (asked by David Lacroix). -Fix bad vertical offset of some decorations (dot, tenuto) when inverted - stems and multi-voice - (reported by David Lacroix). -Use the glyphs of the simple accidentals of PS fonts instead of internal ones - when they exist. -!! Always use UTF-8 characters for simple accidentals (sharp, flat, natural) - in PS output !! (see the new insertion of ellipsis in sample.abc) -Fix double tie when beam continued on next line - (reported by David Lacroix). -Extend the %%voicescale possible values to [0.6 .. 1.5]. - ----- Version 7.3.5 - 13/01/15 ---- - -Fix crash when "%%gchord hidden". - ----- Version 7.3.4 - 13/01/08 ---- - -%%abcm2ps added. -Bad octave in overlay voices when "octave=" in main voice - (reported by Colin Hume). -Let more slurs under the tuplets - (asked by David Lacroix). -Don't keep the K:'s with same key signature when %%keywarn is set - (reported by Henry Bley-Vroman). - ----- Version 7.3.3 - 12/12/14 ---- - -Remove some example files from the distribution. -Draw the staves with spaces ('y') only and "%%staffnonote 1". -Fix %%alignbars which was broken in 7.2.1. -Set as tune global some info fields (K:, M: and Q:) and pseudo-comments - after the first K: and middle-tune T:. -Better note shifts of 3rd voice of a same staff. -Change %%shiftunisson to %%shiftunison. -In unison, shift the note with a down stem - (reported by Paolo Minazzi). -Fix bad output file when note head decoration since 7.3.2. -%%voicescale added. -Fix loss of %%indent since 7.2.2 - (reported by David Lacroix). -Remove the horizontal space of empty key signatures - (reported by David Lacroix). -Fix bad beam at end of voice overlay since 7.3.0 - (reported by David Lacroix). - ----- Version 7.3.2 - 12/12/07 ---- - -Don't do a page break after the tune title when %%scale after 1st K:. -Fix clash of beams with grace notes when down stems. -Display better slurs on grace notes with down stems. -Fix abnormal error on w: ending with '\' (continuation). -Fix loss of tempo (Q: in tune header) when %%scale/%%rightmargin/... - after first K:. -Fix again clash of slurs with decorations/tuplets/... -Fix bad slurs when inside the staff since 7.3.0 - (reported by David Lacroix). -Fix %%select when tunes have blank lines (%%begintext..) - (reported by Henry Bley-Vroman). - ----- Version 7.3.1 - 12/11/28 ---- - -Fix left width of heads in flute.fmt. -Fix the documentation about flute.fmt. -Do %%ornament work. -Add "hidden" in %%dynamic, %%gchord, %%ornament, %%vocal and %%volume. -Don't do an error on the information field "r:". -Fix no output when lack of "%%multicol end" - (reported by Henry Bley-Vroman). -Fix crash on "%%multicol end" with -E or -g. -Handle "%% endxx" (space after %%) - (reported by Henry Bley-Vroman). -Check again if not enough words in lyrics (w:) - (asked by Steve West). -Handle ties from notes to grace notes - (asked by David Lacroix). -Fix bad width of hole on %%staffbreak multi-voice. -Fix bad offset of the slurs since previous version - (reported by David Lacroix). -Don't display a key signature on %%transpose from K:none - (reported by David Lacroix). - ----- Version 7.3.0 - 12/11/17 ---- - -Don't let annotations move the next key or time signature to the right. -Fix lack of key/time warnings at end of line - (reported by Jean-Luc Zins). -Don't continue beaming in voice overlay - (reported by Jean-Luc Zins). -Don't shift notes with guitar chord after repeat bracket with long text - (reported by Norman Bearon). -Fix bad ties from grace notes - (reported by David Lacroix). -!! Change %%stretchlast to a floating point value. !! -Fix clash of slurs with decorations/tuplets/... - (reported by John Walsh). - ----- Version 7.2.2 - 12/11/07 ---- - -Fix bad bars between staves with %%score. -Fix bad explicit line breaks after notes. -Don't try to stretch the last music line when %%stretchlast 0 - (reported by Chuck Boody). -Fix too much space above the staff when scaled staff and P: or Q:. -Fix left indentation when empty staves and %%staffnonote. -Fix bad offset of measure numbers when 1st staff empty and %%staffnonote. -Fix bad offset of measure numbers when 1st staff is scaled - (reported by Hudson Flávio Meneses Lacerda). -Change default value of %%hyphencont to 1 - (asked by David Webber). -Don't draw repeat brackets when bar between 2 staves - (reported by David Webber). - ----- Version 7.2.1 - 12/10/30 ---- - -Fix crash when centered decoration under staff at start of new staff system. -Add %%breaklimit. -Change the internal algorithm of automatic line breaking. - (reported by Steve West). -Fix loss of gchord/annot or bad font when scaled staves - (reported by Hudson Flávio Meneses Lacerda). -Fix bad vertical offset of lyrics when scaled staves and slurs in lower voice. -Fix bad horizontal offset of lyrics on scaled staves. -Handle the line breaks of the top voice only. -Add %%staffscale and %%stafflines. -Fix bad handling of '=' in M:none. -Fix bad handling of %%barsperline when M:none - (reported by David Lacroix). - ----- Version 7.2.0 - 12/10/25 ---- - -Fix crash when mid-staff decoration in new voice at start of line - (reported by David Lacroix). -Add "ignore" as special U: value. -Extend %%linebreak to * ; ? and @. -!! Put the output annotations (-A) after the symbols. !! -Add more symbols in output annotations (-A). -Adjust the width scale of all fonts when set in %%font. -Fix "error w: without music" in secondary voices when ABC version >= 2.1 - (reported by Frédéric Aupépin). - ----- Version 7.1.3 - 12/10/18 ---- - -Fix bad slur vertical offsets on scaled staves. -Fix loss of key/time warning when preceeded by %%stave - (reported by Mike Scott). -Fix bad left side of staff systems when some %%score in the line. -Handle the line breaks of all primary voices. -Fix internal linkage errors. -Fix error "w: without music" when Q: in tune header - (reported by Frédéric Aupépin). -Fix bad line width after some decorations in SVG output. -Bad measure number after time signature change - (reported by Jean-Luc Zins). -Bad clef when P: or Q: between first K: and %%staves - followed by K: or V: with a clef != treble - (reported by Jean-Luc Zins). - ----- Version 7.1.2 - 12/10/09 ---- - -Treat "%%writefield M 0". -Add %%dblrepbar and draw :|: and :||: as :: - (asked by Nils Liberg). -Fix bad parsing of the "%abc-<version>" at start of file. -Do more control of ties between two different notes. -Add %%keywarn - (asked by John Chambers). -Fix clash of subtitle and guitar chord since 7.1.1. -Fix bad staff key signature when "| $ [P:] [K:] |" - (reported by John Chambers). -Fix bad staff key/time signatures when P: or Q: before K:/M: in tune - (reported by John Chambers). -Fix crash when %%continueall and music line cut on a bar with !beamon! - (also when %%breakoneoln 0) and handle beams on two music lines - (reported by Guido Gonzato). - ----- Version 7.1.1 - 12/09/29 ---- - -Convert multi-rests of one measure to rests - (reported by David Webber). -Move the decorations to the last rest on multi-rest expand - (reported by David Webber). -Remove the test messages 'y_set i:-xx'. -May change the guitar chord position (%%gchord) inside the tunes - (and internal change of guitar chord / annotation handling). -Add %%user. -Add !beam-accel! and !beam-rall! - (asked by Hudson Flávio Meneses Lacerda). -Reduce a bit the space before the measure bars. - ----- Version 7.1.0 - 12/09/13 ---- - -Fix bad accidentals when clef one octave higher or lower than normal. -Add a letter to select a repeated measure in tune selection - (asked by Hudson Flávio Meneses Lacerda). -Fix bad music position in tune selection (%%break / %%clip) - (reported by Hudson Flávio Meneses Lacerda). -Fix lack of tune selection (%%break / %%clip) of the first measures (0 and 1) - (reported by Hudson Flávio Meneses Lacerda). -Remove extra vertical space between staves after a staff with no note - (reported by Chuck Boody). -Add "%%tune end" and authorize blank lines in %%tune sequences - !! compatibility !! - (asked by Hudson Flávio Meneses Lacerda). -Change %%acccancel to %%cancelkey !! compatibility !!. -Accept time signatures as "M:5 ((2+3)/4)" and "M:5 (2/4+3/4)". -Display the parenthesis of "M:7/8 (3+2+2)" - (reported by Guido Gonzato). - ----- Version 7.0.16 - 12/09/06 ---- - -Fix bad measure numbering when contbarnb and "y" between "|" and "[number" - (reported by Hudson Flávio Meneses Lacerda). -Fix clash of measure numbering with key signature. -Add 'microscale= in K: and V:. -Fix bad handling of '/symbol' for "cvx" in the mini PS interpreter. -Add %%micronewps. -Fix abnormal new music line when Q: or P: followed by [V:x] and grace notes. -Fix loss of tempo when second voice starting with grace notes - (reported by Wim Rotty). - ----- Version 7.0.15 - 12/08/27 ---- - -Fix %%transpose ignored in file or tune header - (reported by David Webber). -Fix octave= ignored when no clef= in K: and V: - (reported by Alex Scheutzow). -Add %%acccancel. - ----- Version 7.0.14 - 12/07/22 ---- - -Fix crash with floating point sensitive machines as ARM. -Remove the 'title only' selection in %%select. -Extend the %%tune filter to the whole tune header. -Fix bad file date in header/footer ('$d') when %%format in the ABC file - (reported by D. Glenn Arthur Jr.). - ----- Version 7.0.13 - 12/06/17 ---- - -Fix array overflow on %%writefields Q. -Fix bad note heads when both normal and percussion voices in a same staff - (reported by Frédéric Boulanger). -Don't transpose the percussion voices. -Fix bad expansion of 'Xn' when multi-staves - (reported by Jose Joao Dias de Almeida). - ----- Version 7.0.12 - 12/06/10 ---- - -Fix bad tie when at end of repeat and start of new repeat ("c- :|2 c") - (reported by Nils Liberg). -Fix crash when PS code at end of line since 7.0.11 - (reported by David Lacroix). -Fix loss of next lyric lines when error found in a w: line - (reported by Nils Liberg). - ----- Version 7.0.11 - 12/06/02 ---- - -Better hyphen in lyrics lines when big space between notes - (reported by Nils Liberg). -Fix presence of tempo when "%%writefields Q 0" before first K: - (reported by Nils Liberg). -Fix abnormal line with one note when line cut should be on a clef change - (reported by Alex Scheutzow). -Fix presence of meter at start of line when empty voice. -Don't remove '%%' in %%beginps/%%endps sequences. -Fix array overflow and possible crash with empty %%beginxxx/%endxxx - (reported by Nils Liberg). - ----- Version 7.0.10 - 12/05/28 ---- - -Extend %%voice to any options. -Fix crash when K: without more symbol at end of tune - (reported by Nils Liberg). -Add %%stemdir, %%gstemdir and %%clef. -Fix clash of '8' in clef with octave +/-8 - (reported by David Lacroix). - ----- Version 7.0.9 - 12/05/23 ---- - -Fix program loop when width of measure bigger than staff width. -Fix bad last measure bar position again - (reported by many people). -Fix loss of music line break when line ending with grace note(s), - note and no bar - (reported by John Chambers). - ----- Version 7.0.8 - 12/05/21 ---- - -Fix loss of paragraph break on empty lines. -Fix crash in %%begintext with fill/justify and pango on an empty line. -Fix bad offset of lyrics after tune when new page - (reported by Christian Schnarr). -Fix bad last measure bar position since 7.0.6. -Handle 'X' (invisible multi-rest). -Don't do "titletrim" when the length of last word of the title - is greater than 4. -Fix lack of tempo at start of tune when "%%writefields Q 0" is declared - further in the tune. - ----- Version 7.0.7 - 12/05/16 ---- - -Fix bad line numbers in errors and svg annotations - (reported by Nils Liberg). - ----- Version 7.0.6 - 12/05/13 ---- - -Fix lack of key signature when K: + clef inside music line. -Fix lack of accidentals when spaces in the accidental list of K:. -Fix placement errors when scaled voice or staff - (reported by D. Glenn Arthur Jr.). -Don't put a measure bar at end of line when the measure is incomplete - (reported by Christian Schnarr). -Fix ps2pdf error when unknown UTF-8 characters - (reported by Nils Liberg). - ----- Version 7.0.5 - 12/04/30 ---- - -Update the documentation: there is no %%ignore - (reported-by D. Glenn Arthur Jr.). -Bad offset of %%EPS since version 5.x.x - (reported-by D. Glenn Arthur Jr.). -Handle more lowercase to uppercase letters when %%titlecaps - (reported by Christian Schnarr). - ----- Version 7.0.4 - 12/03/31 ---- - -Fix loss of music after abc 2.0 continuation ('\'). -Fix a loss of voices when appearing in a new %%staves/%%score. -Handle the ABC 2.1 "w:" behaviour (with "+:"). -Fix misplaced part (P:) when followed by K:, or M: - (reported by Richard Walker). -Accept 'K' in %%titleformat and (text) notes after tune. -Crash when misplaced dble repeat bar in second voice at end of tune - (reported by Simon Wascher). -Fix X: value in title when ', The' at end of T: - (reported by Paul Hardy). - ----- Version 7.0.3 - 12/03/03 ---- - -Don't print the tempo in tune when '%%writefields Q 0' - (reported by Martin Tarenskeen). -Let less space at end of line when key signature change. -Fix a scanning problem with the command line parameter '--header'. -Update the %%staves/%%score in tune(s) when defined in %%tune. - ----- Version 7.0.2 - 12/02/21 ---- - -Don't add the %%transpose values - (reported by Alex Scheutzow). -Accept empty K: as K:none. -Fix lack of key signature change when exp accidental list of the same size. -Fix bad slur on grace notes when staffscale != 1 - (reported by Pete Showman). -Treat 'I:' as '%%' (accept I:abc-include and I:abc-charset). -Ignore %%sep and %%vskip when global and -E or -g. -Accept any format parameter in %%tune sequences. -Fix crash when some output needed in format files by ignoring %%text... -Stop %%tune/%%voice options on empty lines. -Fix %%abc2pscompat again. -Fix some errors "??? buffer not empty:". -Fix vertical offset problems on page breaks with %%multicol. -Fix bad page header when %%multicol outside and inside tunes. -Don't use pango when only accidentals in string - (reported by John Collins). -Ignore %%writefields when outputting %%titleformat - (reported by Pete S). -Reset the default standard title format when %%titleformat is empty. - ----- Version 7.0.1 - 12/02/06 ---- - -Fix loss of music when voices disappear and reappear by %%score - (reported by John Collins). -Fix some warnings in slre.c compilation - (reported by Chuck Boody). -Add %%custos. -Fix some cases of error "Line too much shrunk". -Bad computation of the page height letting to much space in (portrait) - or going out of (landscape) the bottom of the page when - using %%multicol. - ----- Version 7.0.0 - 12/02/02 ---- - -Permit more pseudo-comments to be defined at command-line level. -Add %%tune, %%voice, %%break, %%clip and %%select. -Add tune selection with '-e' by regular expression. -Permit the clefs to go under or above the notes/rests. -Creation from abcm2ps version 6.6.4. diff -Nru abcm2ps-7.8.9/chinese.abc abcm2ps-8.14.2/chinese.abc --- abcm2ps-7.8.9/chinese.abc 2012-01-03 14:34:13.000000000 +0000 +++ abcm2ps-8.14.2/chinese.abc 2018-12-18 15:18:26.000000000 +0000 @@ -1,19 +1,7 @@ +%abc-2.1 % abcm2ps sample file with chinese characters -% define the chinese utf-8 truetype font -%%font UKaiCN-UTF8-H native - -% add the utf8 -> CID translator -%%beginps nosvg -/UKaiCN-UTF8-H /UniGB-UTF8-H [ /UKaiCN ] composefont pop -%%endps - -% define some fonts -%%titlefont UKaiCN-UTF8-H native 20 -%%subtitlefont UKaiCN-UTF8-H native 16 -%%textfont UKaiCN-UTF8-H native 16 -%%vocalfont UKaiCN-UTF8-H native 13 -%%wordsfont UKaiCN-UTF8-H native 16 +% this file works with truetype fonts (as UKaiCN) and pango support in abcm2ps X: 1 T: Green Island Serenade diff -Nru abcm2ps-7.8.9/config.guess abcm2ps-8.14.2/config.guess --- abcm2ps-7.8.9/config.guess 2013-10-24 05:54:43.000000000 +0000 +++ abcm2ps-8.14.2/config.guess 1970-01-01 00:00:00.000000000 +0000 @@ -1,1558 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-06-10' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches with a ChangeLog entry to config-patches@gnu.org. - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include <features.h> - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; -esac - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff -Nru abcm2ps-7.8.9/config.h abcm2ps-8.14.2/config.h --- abcm2ps-7.8.9/config.h 2014-10-14 16:52:39.000000000 +0000 +++ abcm2ps-8.14.2/config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in */ - -/* default directory to search for format files */ -#define DEFAULT_FDIR "/usr/local/share/abcm2ps" - -/* Define if you have the strtol function. */ -/* #undef HAVE_STRTOL */ - -/* Define if you have the <malloc.h> header file. */ -#define HAVE_MALLOC_H 1 - -/* Define to handle the european A4 format. */ -/* #undef A4_FORMAT */ - -/* Define to have ~ as roll instead of twiddle. */ -/* #undef DECO_IS_ROLL */ - -#define VERSION "7.8.9" -#define VDATE "October 14, 2014" diff -Nru abcm2ps-7.8.9/config.h.in abcm2ps-8.14.2/config.h.in --- abcm2ps-7.8.9/config.h.in 2010-02-08 19:41:29.000000000 +0000 +++ abcm2ps-8.14.2/config.h.in 2018-12-18 15:18:26.000000000 +0000 @@ -1,19 +1,16 @@ /* config.h.in */ -/* default directory to search for format files */ -#define DEFAULT_FDIR xxx - -/* Define if you have the strtol function. */ -#undef HAVE_STRTOL +/* uncomment to handle the european A4 format. */ +//#define A4_FORMAT 1 -/* Define if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H +/* uncomment to have ~ as roll instead of twiddle. */ +//#define DECO_IS_ROLL 1 -/* Define to handle the european A4 format. */ -#undef A4_FORMAT +/* comment if you have not mmap() */ +#define HAVE_MMAP 1 -/* Define to have ~ as roll instead of twiddle. */ -#undef DECO_IS_ROLL +/* default directory to search for format files */ +#define DEFAULT_FDIR xxx #define VERSION xxx #define VDATE xxx diff -Nru abcm2ps-7.8.9/config.sub abcm2ps-8.14.2/config.sub --- abcm2ps-7.8.9/config.sub 2013-10-24 06:12:07.000000000 +0000 +++ abcm2ps-8.14.2/config.sub 1970-01-01 00:00:00.000000000 +0000 @@ -1,1793 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-10-01' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches with a ChangeLog entry to config-patches@gnu.org. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2013 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or1k-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff -Nru abcm2ps-7.8.9/configure abcm2ps-8.14.2/configure --- abcm2ps-7.8.9/configure 2014-10-14 16:52:24.000000000 +0000 +++ abcm2ps-8.14.2/configure 2018-12-18 15:18:26.000000000 +0000 @@ -1,4795 +1,102 @@ #! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 </dev/null -exec 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="abc2ps.h" -# Factoring default headers for most tests. -ac_includes_default="\ -#include <stdio.h> -#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#ifdef HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#ifdef STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# ifdef HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#ifdef HAVE_INTTYPES_H -# include <inttypes.h> -#endif -#ifdef HAVE_STDINT_H -# include <stdint.h> -#endif -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif" - -ac_subst_vars='LTLIBOBJS -LIBOBJS -CPPPANGO -VERSION -EGREP -GREP -CPP -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_pango -enable_a4 -enable_deco_is_roll -with_def_fdir -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-pango Use pango if available [default: yes] - --enable-a4 Handle european A4 format instead of default US letter - --enable-deco-is-roll Have ~ as roll instead of twiddle - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-def-fdir=directory Default format directory - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - LIBS libraries to pass to the linker, e.g. -l<library> - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if - you have headers in a nonstandard directory <include dir> - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.68 - -Copyright (C) 2010 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -VERSION=7.8.9 -VDATE='October 14, 2014' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if ${ac_cv_target+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -ac_config_headers="$ac_config_headers config.h" - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi +# (automatic update) +VERSION=8.14.2 +VDATE=2018-12-18 -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +CC=gcc +CFLAGS="-g -O2 -Wall -pipe" +srcdir=. +prefix=/usr/local -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi +INSTALL="/usr/bin/install -c" +if test -f ./custom; then + . ./custom fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" +for c in "$@"; do + case "$c" in + --*=*) + c="${c#--}" + eval "${c%%=*}='${c#*=}'" + ;; + esac +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +case "$srcdir" in + *\ *) + echo "srcpath cannot contain spaces" + exit 1 esac - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no +if test "x$INSTALL_DATA" = x; then + INSTALL_DATA='${INSTALL} -m 644' fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +if test "x$INSTALL_PROGRAM" = x; then + INSTALL_PROGRAM='${INSTALL}' fi +if test "x$exec_prefix" = x; then + exec_prefix='${prefix}' fi +if test "x$bindir" = x; then + bindir='${exec_prefix}/bin' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - +if test "x$datarootdir" = x; then + datarootdir='${prefix}/share' fi - -done - - -for ac_header in malloc.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" -if test "x$ac_cv_header_malloc_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MALLOC_H 1 -_ACEOF - +if test "x$docdir" = x; then + docdir='${prefix}/share/doc' fi - -done - - -if test "X$GCC" = "Xyes" ; then - CFLAGS="$CFLAGS -Wall -pipe" +if test "x$mandir" = x; then + mandir='${prefix}/share/man' fi - -test "x$prefix" = xNONE && prefix=$ac_default_prefix - - -# Check whether --enable-pango was given. -if test "${enable_pango+set}" = set; then : - enableval=$enable_pango; checkpango="$enableval" -else - checkpango="yes" +if test "x$DEFAULT_FDIR" = x; then + DEFAULT_FDIR="$prefix/share/abcm2ps" fi - -if test "$checkpango" = "yes"; then -$as_echo_n "checking for pango... " >&6 if which pkg-config > /dev/null ; then - if pkg-config --exists freetype2 ; then if pkg-config --exists pangocairo ; then - $as_echo "yes" >&6 - CPPFLAGS="$CPPFLAGS -DHAVE_PANGO=1" - CPPPANGO="`pkg-config pango cairo freetype2 --cflags`" - LDFLAGS="$LDFLAGS `pkg-config pangocairo pangoft2 freetype2 --libs`" + CPPFLAGS="$CPPFLAGS -DHAVE_PANGO=1 `pkg-config pango cairo freetype2 --cflags`" + LDLIBS="$LDLIBS `pkg-config pangocairo pangoft2 freetype2 --libs`" else - $as_echo "no" >&6 + echo "pangocairo not found - no pango support" fi else - $as_echo "pangocairo not found" >&6 + echo "freetype2 not found - no pango support" fi else - $as_echo "pkg-config not found" >&6 -fi -fi - -# Check whether --enable-a4 was given. -if test "${enable_a4+set}" = set; then : - enableval=$enable_a4; if test "$enableval" = "yes"; then - $as_echo "#define A4_FORMAT 1" >>confdefs.h -fi -fi - - -# Check whether --enable-deco-is-roll was given. -if test "${enable_deco_is_roll+set}" = set; then : - enableval=$enable_deco_is_roll; if test "$enableval" = "yes"; then - $as_echo "#define DECO_IS_ROLL 1" >>confdefs.h -fi -fi - - -DEFAULT_FDIR="$prefix/share/abcm2ps" - -# Check whether --with-def-fdir was given. -if test "${with_def_fdir+set}" = set; then : - withval=$with_def_fdir; DEFAULT_FDIR="$withval" -fi - - - - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define VDATE "$VDATE" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define DEFAULT_FDIR "$DEFAULT_FDIR" -_ACEOF - - -ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.68, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' + echo "pkg-config not found - no pango support" fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. +CPPFLAGS="$CPPFLAGS -I." +# ./config.h will not be found in srcdir. -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' <confdefs.h | sed ' -s/'"$ac_delim"'/"\\\ -"/g' >>$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi - ;; - - - esac - -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi +LDLIBS="$LDLIBS -lm" +# Useful on some architectures. +sed "s+@CC@+$CC+ +s+@CPPFLAGS@+$CPPFLAGS+ +s+@CFLAGS@+$CFLAGS+ +s+@LDFLAGS@+$LDFLAGS+ +s+@LDLIBS@+$LDLIBS+ +s+@INSTALL@+$INSTALL+ +s+@INSTALL_DATA@+$INSTALL_DATA+ +s+@INSTALL_PROGRAM@+$INSTALL_PROGRAM+ +s+@prefix@+$prefix+ +s+@exec_prefix@+$exec_prefix+ +s+@srcdir@+$srcdir+ +s+@bindir@+$bindir+ +s+@datarootdir@+$datarootdir+ +s+@mandir@+$mandir+ +s+@docdir@+$docdir+" "$srcdir/Makefile.in" > Makefile +echo "Makefile created" + +sed "s/define VERSION xxx/\define VERSION \"$VERSION\"/ +s/define VDATE xxx/define VDATE \"$VDATE\"/ +s+define DEFAULT_FDIR xxx+define DEFAULT_FDIR \"$DEFAULT_FDIR\"+ +" "$srcdir/config.h.in" > config.h +echo "config.h created" diff -Nru abcm2ps-7.8.9/configure.in abcm2ps-8.14.2/configure.in --- abcm2ps-7.8.9/configure.in 2014-10-14 16:52:08.000000000 +0000 +++ abcm2ps-8.14.2/configure.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -dnl Configure source for abcm2ps -*- sh -*- -dnl Copyright (C) 2001-2014 JF Moine. - -AC_INIT(abc2ps.h) - -VERSION=7.8.9 -VDATE='October 14, 2014' - -AC_CANONICAL_SYSTEM - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_INSTALL -dnl AC_PROG_MAKE_SET - -AC_CONFIG_HEADER(config.h) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(malloc.h) - -if test "X$GCC" = "Xyes" ; then - CFLAGS="$CFLAGS -Wall -pipe" -fi - -test "x$prefix" = xNONE && prefix=$ac_default_prefix - -dnl Check for options - -AC_ARG_ENABLE(pango, -[ --enable-pango Use pango if available [[default: yes]]], -[checkpango="$enableval"], -[checkpango="yes"]) - -if test "$checkpango" = "yes"; then -$as_echo_n "checking for pango... " >&6 -if which pkg-config > /dev/null ; then - -dnl Checks freetype2 - if pkg-config --exists freetype2 ; then -dnl Checks pangocairo - if pkg-config --exists pangocairo ; then - $as_echo "yes" >&6 - CPPFLAGS="$CPPFLAGS -DHAVE_PANGO=1" - CPPPANGO="`pkg-config pango cairo freetype2 --cflags`" - LDFLAGS="$LDFLAGS `pkg-config pangocairo pangoft2 freetype2 --libs`" - else - $as_echo "no" >&6 - fi - else - $as_echo "pangocairo not found" >&6 - fi -else - $as_echo "pkg-config not found" >&6 -fi -fi - -AC_ARG_ENABLE(a4, -[ --enable-a4 Handle european A4 format instead of default US letter], -[if test "$enableval" = "yes"; then - AC_DEFINE(A4_FORMAT)dnl -fi]) - -AC_ARG_ENABLE(deco-is-roll, -[ --enable-deco-is-roll Have ~ as roll instead of twiddle], -[if test "$enableval" = "yes"; then - AC_DEFINE(DECO_IS_ROLL)dnl -fi]) - -DEFAULT_FDIR="$prefix/share/abcm2ps" -AC_ARG_WITH(def-fdir, - [ --with-def-fdir=directory Default format directory], - [DEFAULT_FDIR="$withval"]) - -dnl Build characteristics -AC_SUBST(VERSION) -AC_SUBST(CPPPANGO) - -AC_DEFINE_UNQUOTED(VERSION, "$VERSION") -AC_DEFINE_UNQUOTED(VDATE, "$VDATE") -AC_DEFINE_UNQUOTED(DEFAULT_FDIR, "$DEFAULT_FDIR") - -AC_OUTPUT(Makefile) diff -Nru abcm2ps-7.8.9/COPYING abcm2ps-8.14.2/COPYING --- abcm2ps-7.8.9/COPYING 1970-01-01 00:00:00.000000000 +0000 +++ abcm2ps-8.14.2/COPYING 2018-12-18 15:18:26.000000000 +0000 @@ -0,0 +1,675 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. + diff -Nru abcm2ps-7.8.9/debian/abcm2ps.1 abcm2ps-8.14.2/debian/abcm2ps.1 --- abcm2ps-7.8.9/debian/abcm2ps.1 2014-10-18 21:39:28.000000000 +0000 +++ abcm2ps-8.14.2/debian/abcm2ps.1 1970-01-01 00:00:00.000000000 +0000 @@ -1,560 +0,0 @@ -.TH "ABCM2PS" "1" -.SH "NAME" -abcm2ps \(em translate ABC music notation to PostScript -.SH "SYNOPSIS" -.PP -\fBabcm2ps\fR [\fIoptions\fR] [\fIabc-file\fR \fI[file-options]\fR] [...] -.PP -\fBabcm2ps\fR [\fB-h\fP] -.SH "DESCRIPTION" -.PP -\fBabcm2ps\fR translates tunes written in -the ABC music notation format to customary sheet music scores in -PostScript. It is based on \fBabc2ps\fR 1.2.5 and was -developed mainly to print Baroque organ scores that have -independent voices played on multiple keyboards and a -pedal-board. The program has since been extended to support -various other notation conventions in use for sheet music. -.PP -Options given immediately after the command name apply to -the run as a whole; options given after an ABC file name apply -to that file. -.PP -Formatting parameters can also be set in `format files' and -in the ABC files themselves. -.SH "OPTIONS" -.IP "\fB-0\fP" 10 -Split tunes across page breaks if necessary. -.IP "\fB+0\fP" 10 -Start a new page if a tune doesn't fit on the current -one (default). -.IP "\fB-1\fP" 10 -Output one tune per page. -.IP "\fB+1\fP" 10 -Output multiple tunes per page (default). -.IP "\fB-a \fIa\fR\fP" 10 -Maximal horizontal compression when staff breaks are -chosen automatically. Must be between 0 and 1. This -corresponds to the -`\fB%%maxshrink\fP \fIa\fR' -formatting parameter (default: 0.65) -.IP "\fB-A\fP" 10 -This option inserts reference elements in the -PostScript or SVG output. -.IP "\fB-B \fIb\fR\fP" 10 -Try to typeset \fIb\fR bars on -each staff line. This corresponds to the -`\fB%%barsperstaff\fP \fIb\fR' -formatting parameter. -.IP "\fB+B\fP" 10 -Don't try to typeset a fixed number of bars on each -staff line (default). This corresponds to the -`\fB%%barsperstaff\fP \fB0\fP' -formatting parameter. -.IP "\fB-b \fIb\fR\fP" 10 -Start measure numbering at \fIb\fR. -.IP "\fB-c\fP" 10 -The continuation symbol is implicitly appended to each -music line. This amounts to automatic line breaking. -.IP "\fB+c\fP" 10 -Automatic line breaking is turned off (default). -.IP "\fB-D \fIdirectory\fR\fP" 10 -Search format files in -\fIdirectory\fR. -.IP "\fB-d \fIlength\fR\fP" 10 -Set the vertical interstaff space to -\fIlength\fR. This corresponds to the -`\fB%%staffsep\fP \fIlength\fR' -formatting parameter (default: 46pt) -.IP "\fB-E\fP" 10 -Output is generated in EPS format, one file per page. -.IP "\fB-e \fIlist\fR\fP" 10 -Select which tunes from an ABC file to print. -\fIlist\fR is either a -comma-separated list of tune numbers (as per the `X:' -header), or a regular expression which will be matched -against the tune headers as a whole. The -\fB-e\fP option must occur after an ABC file -name and applies to that file. -.IP "" 10 -Ranges of tune numbers may -be specified like -\fIt1\fR-\fIt2\fR; -\fIt2\fR may be omitted which means -`all remaining tunes until the end of file'. Note that -filtering may cause problems, e.g., with global (non-tune) -definitions in the ABC file. -.IP "\fB-F \fIfile\fR\fP" 10 -Read the format file -\fIfile\fR.fmt. -.IP "\fB+F\fP" 10 -Do not read the default format file. -.IP "\fB-f\fP" 10 -Enable flat beams (useful for bagpipe tunes). This -corresponds to the -`\fB%%flatbeams\fP \fB1\fP' -formatting parameter. -.IP "\fB-G\fP" 10 -Omit slurs on grace notes. This corresponds to the -`\fB%%graceslurs\fP \fB0\fP' -formatting parameter. -.IP "\fB+G\fP" 10 -Draw slurs on grace notes (default). This corresponds -to the `\fB%%graceslurs\fP \fB1\fP' -formatting parameter. -.IP "\fB-g\fP" 10 -Produce SVG output instead of EPS. In this mode, each -tune goes to a separate file whose name -is `Out\fInnn\fR.svg' (see -option \fB-O\fP). -.IP "" 10 -If output is directed to stdout -(`\fB-O-\fP'), all SVG images are output -without an XML header. -.IP "\fB-H\fP" 10 -Display the current values of the formatting parameters. -.IP "\fB-h\fP" 10 -Display program usage hints and quit. -.IP "\fB-I \fIlength\fR\fP" 10 -Indent the first line of the tune by -\fIlength\fR (default: 0). -This corresponds to the -`\fB%%indent\fP \fIlength\fR' -formatting parameter. -.IP "\fB-i\fP, \fB+i\fP" 10 -Insert a red circle around errors in the PostScript -output. -.IP "\fB-j\fIb\fR\fI[b]\fR\fP" 10 -Output a measure number every -\fIb\fR measures. If -\fIb\fR is 0, the measure number -appears at the left of each staff. The trailing -\fBb\fP causes a box to be drawn around each -measure number (default: no measure numbering). -This corresponds to the \fB%%measurenb\fP formatting parameter. -.IP "\fB+j\fP" 10 -Don't output measure numbers. This corresponds to -the `\fB%%measurenb\fP \fB-1\fP' -formatting parameter. -.IP "\fB-k\fP" 10 -Sets the size of the PostScript output buffer in -kibibytes. Specifying a higher value permits the generation -of big tunes with \fB-E\fP or \fB-g\fP (default: 64). -.IP "\fB-l\fP" 10 -Generate landscape output. This corresponds to the -`\fB%%landscape\fP \fB1\fP' -formatting parameter. -.IP "\fB+l\fP" 10 -Generate portrait output (default). This corresponds -to the `\fB%%landscape\fP \fB0\fP' -formatting parameter. -.IP "\fB-M\fP" 10 -Suppress lyrics. See the \fB%%writefields\fP formatting parameter. -.IP "\fB+M\fP" 10 -Include lyrics (default). See the \fB%%writefields\fP formatting parameter. -.IP "\fB-m \fIlength\fR\fP" 10 -Set the left margin to -\fIlength\fR (default: 1.8cm). This -corresponds to the -`\fB%%leftmargin\fP \fIlength\fR' -formatting parameter. -.IP "\fB-N\fI[mode]\fR\fP" 10 -Number pages according to the -\fImode\fR: -.RS -.IP "\fB0\fP" 10 -no page numbers -.IP "\fB1\fP" 10 -page numbers at top left -of page -.IP "\fB2\fP" 10 -page numbers at top right -of page -.IP "\fB3\fP" 10 -page numbers at top left of -even-numbered pages, top right of odd-numbered -pages -.IP "\fB4\fP" 10 -page numbers at top right of -even-numbered pages, top left of odd-numbered -pages -.RE -.IP "" 10 -For compatibility, -\fB-N\fP is equivalent to -\fB-N2\fP (default: \fB-N0\fP). -.IP "" 10 -If a header is defined using -`\fB%%header\fP', this option is ignored. -.IP "\fB+N\fP" 10 -Equivalent to \fB-N0\fP (no page -numbering). -.IP "\fB-n\fP" 10 -Include notes and history from ABC tune `N:' -fields. See the \fB%%writefields\fP formatting -parameter. -.IP "\fB+n\fP" 10 -Omit notes and history from ABC tune `N:' fields -(default). See the \fB%%writefields\fP formatting -parameter. -.IP "\fB-O \fIname\fR\fP" 10 -Define the output file name. By default, the output -file name is `Out.ps' for PostScript output, -`Out\fInnn\fR.eps' for EPS output (see -\fB-E\fP), or -`Out\fInnn\fR.svg' for SVG output -(see -\fB-g\fP), where \fInnn\fR is a sequence number. If this option is given, the output -name will be \fIname\fR (for -PostScript output), or \fIname\fR will replace `Out' in the output file name (for EPS and -SVG output), respectively. If -\fIname\fR is `=', the output file name -will be the name of the ABC source file with the extension -`.ps', `.eps', or `.svg'. If \fIname\fR is `\-', -the output is written to stdout. -.IP "\fB+O\fP" 10 -Revert to the default output file name (`Out.ps' or -`Out\fInnn\fR.eps') -.IP "\fB-q\fP" 10 -Quiet mode, only error messages will be shown. -.IP "\fB-S\fP" 10 -Secure mode; disables file inclusion via -\fB%%format\fP and \fB%%EPS\fP and disallows direct PostScript injection via -\fB%%beginps\fP and -\fB%%postscript\fP. -.IP "\fB-s \fIscale\fR\fP" 10 -Set the page scale factor to -\fIscale\fR. Note that the header and -footer are not scaled (default: 0.75). This corresponds -to the -`\fB%%scale\fP \fIscale\fR' -formatting parameter. -.IP "\fB-T\fIn\fR[\fIvoice\fR]\fP, \fB+T\fIn\fR[\fIvoice\fR]\fP" 10 -Activate (or deactivate) tabulature -drawing. \fIn\fR is the tabulature -number as defined in \fB%%tabulature\fP (up to a maximum of 8 tabulatures), -and \fIvoice\fR is the voice name, -full name or subname as found in \fBV:\fP. When -this is absent, the option applies to all voices. Up to 4 -such options may be given. See -also \fBformat.txt\fP. -.IP "\fB-V\fP" 10 -Output version number and quit. -.IP "\fB-v\fP" 10 -Produce SVG output instead of simple PS. In this mode, -each page goes to a separate output file called -`Out\fInnn\fR.svg' (see -option \fB-O\fP). -.IP "\fB-w \fIlength\fR\fP" 10 -Adjust the right margin such that the staff width is -\fIlength\fR (default: none). This -corresponds to the -`\fB%%staffwidth\fP \fIlength\fR' -formatting parameter. -.IP "\fB-X\fP" 10 -Produce XML+SVG output instead of simple PS. The -default file name is `Out.xhtml' (see option `\-O'). -.IP "\fB-x\fP" 10 -Include the `X:' tune number in the title. See -the \fB%%writefields\fP formatting parameter. -.IP "\fB+x\fP" 10 -Do not include the `X:' tune number in the title -(default). See the \fB%%writefields\fP formatting -parameter. -.SH "FORMATTING PARAMETERS" -.PP -Abcm2ps supports a vast number of formatting parameters that -govern the appearance of the typeset output. Please refer to -the \fB/usr/share/doc/abcm2ps/format.txt\fP file or -the formatting parameter documentation on the -\fIofficial -abcm2ps web site (link to URL http://moinejf.free.fr/abcm2ps-doc/index.html) \fR. -.SH "ADDITIONAL FEATURES" -.SS "Clefs" -.PP -Clefs can be given in \fBK:\fP and -\fBV:\fP headers. The full syntax is - -.PP -.nf -[\fBclef=\fP]\fItype\fR[\fIline\fR][\fB+8\fP|\fB-8\fP] [\fBmiddle=\fP\fIpitch\fR] -.fi - -.PP -The `\fBclef=\fP' can be omitted when the -\fItype\fR is a clef name. - -.PP -\fItype\fR denotes the clef type. It may -be: - -.IP "A note pitch (\fBG\fP, \fBC\fP, or \fBF\fP)" 10 -The pitch indicates which clef is meant: -\fBG\fP is the treble clef, -\fBC\fP the alto clef and -\fBF\fP the bass clef. It also gives the -name of the note that appears on the clef's line. -.IP "A clef name" 10 -The available clef names are -\fBtreble\fP (clef gives the pitch for -\fBG\fP), \fBalto\fP or -\fBtenor\fP (\fBC\fP), and -\fBbass\fP (\fBF\fP) -.IP "\fBperc\fP or \fBP\fP" 10 -In percussion mode, accidentals change the glyphs used -for note heads. By default, sharp notes are drawn as `x' -and flat notes as circled `x'. This may be changed by -redefining the PostScript -functions \fBpshhd\fP and \fBpflhd\fP. -.IP "\fBnone\fP" 10 -No clef will be displayed. -.PP -The \fIline\fR gives the number of the -line within the staff that the base clef will be written -on. The default values are 2 for the treble clef, 3 for the -alto clef, and 4 for the tenor and bass clefs. - -.PP -The \fB+8\fP and \fB-8\fP options -draw an 8 above or below the staff, respectively. -`\fBmiddle=\fP\fIpitch\fR' -(or `\fBm=\fP\fIpitch\fR', -for short) is an alternative way of defining the line number -of the clef: -The \fIpitch\fR indicates what note will be -displayed on the middle line of the staff. -.PP -When no clef is specified, clef changes between -\fBbass\fP and \fBtreble\fP will be -inserted automatically. - -.SS "Multi-voice typesetting" -.PP -Multiple voices may be defined within the header or the -tune using - -.PP -.nf -\fBV:\fP\fIname\fR \fIdefinition\fR ... - -.fi -.PP -where \fIname\fR is a word consisting of -letters and digits only (like \fBviolin1\fP). In -the tune body, the following notes refer to this voice until -another \fBV:\fP is encountered. A -\fIdefinition\fR can be one of: - -.IP "\fBclef=\fP..." 10 -See above -.IP "\fBname=\fP\fIname\fR or \fBnm=\fP\fIname\fR" 10 -The \fIname\fR will be -displayed at the beginning of the first staff. It can -contain \fB\\n\fP sequences which will -force line breaks. If it contains whitespace it must be -double-quoted. -.IP "\fBsubname=\fP\fIname\fR or \fBsnm=\fP\fIname\fR" 10 -The \fIname\fR will be -displayed at the beginning of all staves except for the -first. It can -contain \fB\\n\fP sequences which will -force line breaks. If it contains whitespace it must be -double-quoted. -.IP "\fBmerge\fP" 10 -The voice goes on the same staff as the previous -voice. -.IP "\fBup\fP or \fBdown\fP" 10 -Forces the direction of the stems for the voice. -.IP "\fBdyn=up\fP or \fBdyn=down\fP or \fBdyn=auto\fP" 10 -Forces positioning of dynamic marks (above or -below the staff) or reverts to automatic positioning -(the default) -.IP "\fBgstem=up\fP or \fBgstem=down\fP or \fBgstem=auto\fP" 10 -Forces the direction of the stems of grace notes (always -up or always down) or reverts to automatic positioning -(the default) -.IP "\fBstem=auto\fP" 10 -Reverts to automatic positioning of note stems (up or -down) (the default) -.IP "\fBlyrics=up\fP or \fBlyrics=down\fP or \fBlyrics=auto\fP" 10 -Places lyrics above or below the staff or reverts to -automatic positioning (the default) -.IP "\fBgchord=up\fP or \fBgchord=down\fP" 10 -Places guitar chords above (the default) or below the -staff. -.IP "\fBstafflines=\fP\fIvalue\fR" 10 -Sets the number of lines on the staff in question. -(default: 5) -.IP "\fBstaffscale=\fP\fIvalue\fR" 10 -Sets the scale of the associated staff up to 3. -(default: 1) All other definitions are ignored. -.PP -By default, each voice goes on its own staff. The `%%staves -\fIdefinition\fR' -pseudo-comment can be used to control staff assignment. The -\fIdefinition\fR consists of voice names -(from \fBV:\fP) and pairs of parentheses, braces -or brackets. - -.IP " \(bu" 6 -When a voice name is not within a pair of special -characters, it goes on a separate staff. -.IP " \(bu" 6 -For voice names enclosed in brackets, a bracket is -displayed at the beginning of each line that joins the -staves of the voices in question. -.IP " \(bu" 6 -For voice names enclosed in braces, all the voices -go on two staves (keyboard score). There can be at most -four voices between a single pair of braces. -.IP " \(bu" 6 -For voice names enclosed in parentheses, all the -voices appear on a single staff. -.PP -The `\fB|\fP' character prevents measure bars from -being drawn between two staves. -.PP -If `%%staves' occurs in a tune, all the voices not mentioned -will not be output at all. -.SS "The \fB%%score\fP directive" -.PP -The \fB%%score\fP directive occurs in the ABC -draft 2.0 standard and is similar to the \fB%%staves\fP specification described earlier. The rules are: - -.IP " \(bu" 6 -Voice names within parentheses form a "voice group" -and go on a single staff. A voice name that is not -within parentheses forms its own voice group and goes on -a staff by itself. -.IP " \(bu" 6 -Voice groups within braces form a "voice block" and -are preceded by a big brace in the output. This is -especially useful for keyboard music. -.IP " \(bu" 6 -Voice groups or voice blocks within brackets form a -"voice block" and will be preceded by a big bracket in -the output. -.IP " \(bu" 6 -If a `\fB|\fP' character occurs between -two voice groups or voice blocks, the bar lines in all -of the associated staves will be continuous. -.IP " \(bu" 6 -A single voice surrounded by two voice groups can be -preceded by an asterisk to make it into a `floating' -voice. This means that, for each note of the voice, a -separate decision is made whether it is printed on the -preceding or the following voice group's staff. -.IP " \(bu" 6 -Voices that appear in the tune body but not in -the \fB%%score\fP directive will not be -output at all. If there is no \fB%%score\fP directive, each voice will be output on its own -staff. -.IP " \(bu" 6 -A \fB%%score\fP directive inside a tune -resets the mechanism so voices can be removed or -added. -.SS "Voice overlay" -.PP -You can add notes to a staff without introducing a -complete extra voice by using the ampersand (\fB&\fP). -A single measure can be split into two voices like - -.PP -.nf -|F2A2Bc&F2c2bc| - -.fi -.PP -The \fB(&...&...&)\fP construction -allows splitting multiple measures: - -.PP -.nf -|!f!(&GG<G|GG F=E| E2 E(_D/E)|_D D C D |C4- |C -\ \ \ \ \ &DC<C|CC_D C|=B,2_B,B, |_A,A,(G,/A,/)B,|F,4-|F,)zzD=E| - -.fi -.PP -A double ampersand (\fB&&\fP) will allow -overlaying more than two lines of music but this feature has -not yet been implemented. - -.SS "Lyrics" -.PP -Aligned lyrics under a staff are written as a -\fBw:\fP line directly below the staff line. For -example: - -.PP -.nf -edc2 edc2| -w:Three blind mice, three blind mice - -.fi -.PP -Each word in the \fBw:\fP line (delimited by -blanks) is associated with one note, in sequence. The -following special symbols modify this behaviour: - -.IP "\fB*\fP" 10 -Skips one note. -.IP "\fB-\fP" 10 -Splits a word into two syllables which are -associated with two adjacent notes. A `\-' is drawn -between them. -.IP "\fB|\fP" 10 -Advances to the next bar -line -.IP "\fB~\fP" 10 -Is output as a space, but unites two words -so they appear under a single note. -.IP "\fB_\fP" 10 -Draws a thin underscore from the -previous note to the next. -.PP -To include more than one line of lyrics, use multiple -\fBw:\fP lines. To include hyphens without -splitting a word over multiple notes, use -\fB\-\fP. - -.PP -If a word starts with a digit, this is interpreted as a stanza -number and outdented a bit to the left. - -.SS "Slurs and ties" -.PP -The direction of slurs and ties may be controlled using -the \fB(,\fP and \fB('\fP, -and \fB-,\fP and \fB-'\fP, constructions. - -.SS "Microtone pitches" -.PP -Microtone pitches are indicated by a fraction after an -accidental, as in \fB -3/4c\fP. When omitted, the -numerator defaultes to 1 and the denominator to 2 (so \fB -/c\fP is the same as \fB -1/2c\fP). The numerator and denominator -values may not exceed 256. There is built-in support for -quarter-tone accidentals (1/2 and 3/2 sharps and flats); -for other values, rendering functions must be defined using -\fB%%postscript\fP (see -\fBfeatures.txt\fP). -.SS "EPS inclusion" -.PP -EPS files may be included inside tunes using the -pseudo-comment `%%EPS \fIfile\fR'. -.SH "SEE ALSO" -.PP -The original documentation can be found in files -\fBfeatures.txt\fP, -\fBformat.txt\fP, and \fBoptions.txt\fP, -which on a Debian system are in -\fB/usr/share/doc/abcm2ps\fP. -.SH "AUTHOR" -.PP -This manual page was written by Anselm Lingnau <lingnau@debian.org> for -the \fBDebian\fP system (but may be used by others). Permission is -granted to copy, distribute and/or modify this document as long -as its origin is not misrepresented. -.\" created by instant / docbook-to-man, Sat 18 Oct 2014, 23:39 diff -Nru abcm2ps-7.8.9/debian/abcm2ps.docs abcm2ps-8.14.2/debian/abcm2ps.docs --- abcm2ps-7.8.9/debian/abcm2ps.docs 2014-10-17 15:48:32.000000000 +0000 +++ abcm2ps-8.14.2/debian/abcm2ps.docs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -README -*.txt \ No newline at end of file diff -Nru abcm2ps-7.8.9/debian/abcm2ps.examples abcm2ps-8.14.2/debian/abcm2ps.examples --- abcm2ps-7.8.9/debian/abcm2ps.examples 2014-10-17 15:48:28.000000000 +0000 +++ abcm2ps-8.14.2/debian/abcm2ps.examples 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -*.abc -*.eps \ No newline at end of file diff -Nru abcm2ps-7.8.9/debian/abcm2ps.manpages abcm2ps-8.14.2/debian/abcm2ps.manpages --- abcm2ps-7.8.9/debian/abcm2ps.manpages 2014-10-17 16:09:17.000000000 +0000 +++ abcm2ps-8.14.2/debian/abcm2ps.manpages 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/abcm2ps.1 diff -Nru abcm2ps-7.8.9/debian/abcm2ps.sgml abcm2ps-8.14.2/debian/abcm2ps.sgml --- abcm2ps-7.8.9/debian/abcm2ps.sgml 2014-10-18 15:42:46.000000000 +0000 +++ abcm2ps-8.14.2/debian/abcm2ps.sgml 1970-01-01 00:00:00.000000000 +0000 @@ -1,953 +0,0 @@ -<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [ - -<!-- Process this file with docbook-to-man to generate an nroff manual - page: `docbook-to-man manpage.sgml > manpage.1'. You may view - the manual page with: `docbook-to-man manpage.sgml | nroff -man | - less'. A typical entry in a Makefile or Makefile.am is: - -manpage.1: manpage.sgml - docbook-to-man $< > $@ - - - The docbook-to-man binary is found in the docbook-to-man package. - Please remember that if you create the nroff version in one of the - debian/rules file targets (such as build), you will need to include - docbook-to-man in your Build-Depends control field. - - --> - - <!ENTITY dhfirstname "<firstname>Anselm</firstname>"> - <!ENTITY dhsurname "<surname>Lingnau</surname>"> - <!ENTITY dhdate "<date>October 17, 2014</date>"> - <!ENTITY dhsection "<manvolnum>1</manvolnum>"> - <!ENTITY dhemail "<email>lingnau@debian.org</email>"> - <!ENTITY dhusername "Anselm Lingnau"> - <!ENTITY dhucpackage "<refentrytitle>ABCM2PS</refentrytitle>"> - <!ENTITY dhpackage "abcm2ps"> - - <!ENTITY debian "<productname>Debian</productname>"> - <!ENTITY gnu "<acronym>GNU</acronym>"> - <!ENTITY gpl "&gnu; <acronym>GPL</acronym>"> -]> - -<refentry> - <refentryinfo> - <address> - &dhemail; - </address> - <author> - &dhfirstname; - &dhsurname; - </author> - <copyright> - <year>2014</year> - <holder>&dhusername;</holder> - </copyright> - &dhdate; - </refentryinfo> - <refmeta> - &dhucpackage; - - &dhsection; - </refmeta> - <refnamediv> - <refname>&dhpackage;</refname> - - <refpurpose>translate ABC music notation to PostScript</refpurpose> - </refnamediv> - <refsynopsisdiv> - <cmdsynopsis> - <command>&dhpackage;</command> - - <arg><replaceable>options</replaceable></arg> - <arg><replaceable>abc-file</replaceable> <replaceable><optional>file-options</optional></replaceable></arg> <arg>...</arg> - </cmdsynopsis> - <cmdsynopsis> - <command>&dhpackage;</command> - <arg><option>-h</option></arg> - </cmdsynopsis> - </refsynopsisdiv> - <refsect1> - <title>DESCRIPTION - - &dhpackage; translates tunes written in - the ABC music notation format to customary sheet music scores in - PostScript. It is based on abc2ps 1.2.5 and was - developed mainly to print Baroque organ scores that have - independent voices played on multiple keyboards and a - pedal-board. The program has since been extended to support - various other notation conventions in use for sheet music. - Options given immediately after the command name apply to - the run as a whole; options given after an ABC file name apply - to that file. - Formatting parameters can also be set in `format files' and - in the ABC files themselves. - - - - OPTIONS - - - - - - Split tunes across page breaks if necessary. - - - - - - Start a new page if a tune doesn't fit on the current - one (default). - - - - - - Output one tune per page. - - - - - - Output multiple tunes per page (default). - - - - - - Maximal horizontal compression when staff breaks are - chosen automatically. Must be between 0 and 1. This - corresponds to the - ` a' - formatting parameter (default: 0.65) - - - - - - This option inserts reference elements in the - PostScript or SVG output. - - - - - - Try to typeset b bars on - each staff line. This corresponds to the - ` b' - formatting parameter. - - - - - - Don't try to typeset a fixed number of bars on each - staff line (default). This corresponds to the - ` 0' - formatting parameter. - - - - - - Start measure numbering at b. - - - - - - The continuation symbol is implicitly appended to each - music line. This amounts to automatic line breaking. - - - - - - Automatic line breaking is turned off (default). - - - - - - Search format files in - directory. - - - - - - Set the vertical interstaff space to - length. This corresponds to the - ` length' - formatting parameter (default: 46pt) - - - - - - Output is generated in EPS format, one file per page. - - - - - - - Select which tunes from an ABC file to print. - list is either a - comma-separated list of tune numbers (as per the `X:' - header), or a regular expression which will be matched - against the tune headers as a whole. The - option must occur after an ABC file - name and applies to that file. - Ranges of tune numbers may - be specified like - t1-t2; - t2 may be omitted which means - `all remaining tunes until the end of file'. Note that - filtering may cause problems, e.g., with global (non-tune) - definitions in the ABC file. - - - - - - Read the format file - file.fmt. - - - - - - Do not read the default format file. - - - - - - Enable flat beams (useful for bagpipe tunes). This - corresponds to the - ` 1' - formatting parameter. - - - - - - Omit slurs on grace notes. This corresponds to the - ` 0' - formatting parameter. - - - - - - Draw slurs on grace notes (default). This corresponds - to the ` 1' - formatting parameter. - - - - - - Produce SVG output instead of EPS. In this mode, each - tune goes to a separate file whose name - is `Outnnn.svg' (see - option ). - If output is directed to stdout - (`'), all SVG images are output - without an XML header. - - - - - - Display the current values of the formatting parameters. - - - - - - Display program usage hints and quit. - - - - - - Indent the first line of the tune by - length (default: 0). - This corresponds to the - ` length' - formatting parameter. - - - - , - - Insert a red circle around errors in the PostScript - output. - - - - - - Output a measure number every - b measures. If - b is 0, the measure number - appears at the left of each staff. The trailing - causes a box to be drawn around each - measure number (default: no measure numbering). - This corresponds to the - formatting parameter. - - - - - - Don't output measure numbers. This corresponds to - the ` -1' - formatting parameter. - - - - - - Sets the size of the PostScript output buffer in - kibibytes. Specifying a higher value permits the generation - of big tunes with - or (default: 64). - - - - - - Generate landscape output. This corresponds to the - ` 1' - formatting parameter. - - - - - - Generate portrait output (default). This corresponds - to the ` 0' - formatting parameter. - - - - - - Suppress lyrics. See the - formatting parameter. - - - - - - Include lyrics (default). See the - formatting parameter. - - - - - - Set the left margin to - length (default: 1.8cm). This - corresponds to the - ` length' - formatting parameter. - - - - - - Number pages according to the - mode: - - - no page numbers - - - page numbers at top left - of page - - - page numbers at top right - of page - - - page numbers at top left of - even-numbered pages, top right of odd-numbered - pages - - - page numbers at top right of - even-numbered pages, top left of odd-numbered - pages - - - For compatibility, - is equivalent to - (default: ). - If a header is defined using - `', this option is ignored. - - - - - - Equivalent to (no page - numbering). - - - - - - Include notes and history from ABC tune `N:' - fields. See the formatting - parameter. - - - - - - Omit notes and history from ABC tune `N:' fields - (default). See the formatting - parameter. - - - - - - Define the output file name. By default, the output - file name is `Out.ps' for PostScript output, - `Outnnn.eps' for EPS output (see - ), or - `Outnnn.svg' for SVG output - (see - ), where nnn - is a sequence number. If this option is given, the output - name will be name (for - PostScript output), or name - will replace `Out' in the output file name (for EPS and - SVG output), respectively. If - name is `=', the output file name - will be the name of the ABC source file with the extension - `.ps', `.eps', or `.svg'. If name is `-', - the output is written to stdout. - - - - - - Revert to the default output file name (`Out.ps' or - `Outnnn.eps') - - - - - - Quiet mode, only error messages will be shown. - - - - - - Secure mode; disables file inclusion via - and - and disallows direct PostScript injection via - and - . - - - - - - Set the page scale factor to - scale. Note that the header and - footer are not scaled (default: 0.75). This corresponds - to the - ` scale' - formatting parameter. - - - - , - - Activate (or deactivate) tabulature - drawing. n is the tabulature - number as defined in - (up to a maximum of 8 tabulatures), - and voice is the voice name, - full name or subname as found in . When - this is absent, the option applies to all voices. Up to 4 - such options may be given. See - also format.txt. - - - - - - Output version number and quit. - - - - - - Produce SVG output instead of simple PS. In this mode, - each page goes to a separate output file called - `Outnnn.svg' (see - option ). - - - - - - Adjust the right margin such that the staff width is - length (default: none). This - corresponds to the - ` length' - formatting parameter. - - - - - - Produce XML+SVG output instead of simple PS. The - default file name is `Out.xhtml' (see option `-O'). - - - - - - Include the `X:' tune number in the title. See - the formatting parameter. - - - - - - Do not include the `X:' tune number in the title - (default). See the formatting - parameter. - - - - - - FORMATTING PARAMETERS - - Abcm2ps supports a vast number of formatting parameters that - govern the appearance of the typeset output. Please refer to - the /usr/share/doc/abcm2ps/format.txt file or - the formatting parameter documentation on the - official - abcm2ps web site. - - - ADDITIONAL FEATURES - - - Clefs - Clefs can be given in K: and - V: headers. The full syntax is - -clef=typeline+8|-8 middle=pitch - - - - The `clef=' can be omitted when the - type is a clef name. - - - type denotes the clef type. It may - be: - - - A note pitch (G, C, or F) - - The pitch indicates which clef is meant: - G is the treble clef, - C the alto clef and - F the bass clef. It also gives the - name of the note that appears on the clef's line. - - - - A clef name - - The available clef names are - treble (clef gives the pitch for - G), alto or - tenor (C), and - bass (F) - - - - perc or P - - In percussion mode, accidentals change the glyphs used - for note heads. By default, sharp notes are drawn as `x' - and flat notes as circled `x'. This may be changed by - redefining the PostScript - functions pshhd and pflhd. - - - - none - - No clef will be displayed. - - - - - - The line gives the number of the - line within the staff that the base clef will be written - on. The default values are 2 for the treble clef, 3 for the - alto clef, and 4 for the tenor and bass clefs. - - - The +8 and -8 options - draw an 8 above or below the staff, respectively. - `middle=pitch' - (or `m=pitch', - for short) is an alternative way of defining the line number - of the clef: - The pitch indicates what note will be - displayed on the middle line of the staff. - - When no clef is specified, clef changes between - bass and treble will be - inserted automatically. - - - - Multi-voice typesetting - Multiple voices may be defined within the header or the - tune using - -V:name definition ... - - where name is a word consisting of - letters and digits only (like violin1). In - the tune body, the following notes refer to this voice until - another V: is encountered. A - definition can be one of: - - - clef=... - See above - - - name=name or nm=name - - The name will be - displayed at the beginning of the first staff. It can - contain sequences which will - force line breaks. If it contains whitespace it must be - double-quoted. - - - - subname=name or snm=name - - The name will be - displayed at the beginning of all staves except for the - first. It can - contain sequences which will - force line breaks. If it contains whitespace it must be - double-quoted. - - - - merge - - The voice goes on the same staff as the previous - voice. - - - - up or down - - Forces the direction of the stems for the voice. - - - - dyn=up or dyn=down or dyn=auto - - Forces positioning of dynamic marks (above or - below the staff) or reverts to automatic positioning - (the default) - - - - gstem=up or gstem=down or gstem=auto - - Forces the direction of the stems of grace notes (always - up or always down) or reverts to automatic positioning - (the default) - - - - stem=auto - - Reverts to automatic positioning of note stems (up or - down) (the default) - - - - lyrics=up or lyrics=down or lyrics=auto - - Places lyrics above or below the staff or reverts to - automatic positioning (the default) - - - - gchord=up - or gchord=down - - Places guitar chords above (the default) or below the - staff. - - - - stafflines=value - - Sets the number of lines on the staff in question. - (default: 5) - - - - staffscale=value - - Sets the scale of the associated staff up to 3. - (default: 1) - - - - All other definitions are ignored. - - By default, each voice goes on its own staff. The `%%staves - definition' - pseudo-comment can be used to control staff assignment. The - definition consists of voice names - (from V:) and pairs of parentheses, braces - or brackets. - - - When a voice name is not within a pair of special - characters, it goes on a separate staff. - - - For voice names enclosed in brackets, a bracket is - displayed at the beginning of each line that joins the - staves of the voices in question. - - - For voice names enclosed in braces, all the voices - go on two staves (keyboard score). There can be at most - four voices between a single pair of braces. - - - For voice names enclosed in parentheses, all the - voices appear on a single staff. - - - - - The `|' character prevents measure bars from - being drawn between two staves. - - If `%%staves' occurs in a tune, all the voices not mentioned - will not be output at all. - - - The <literal>%%score</literal> directive - The %%score directive occurs in the ABC - draft 2.0 standard and is similar to the %%staves - specification described earlier. The rules are: - - - Voice names within parentheses form a "voice group" - and go on a single staff. A voice name that is not - within parentheses forms its own voice group and goes on - a staff by itself. - - - Voice groups within braces form a "voice block" and - are preceded by a big brace in the output. This is - especially useful for keyboard music. - - - Voice groups or voice blocks within brackets form a - "voice block" and will be preceded by a big bracket in - the output. - - - If a `|' character occurs between - two voice groups or voice blocks, the bar lines in all - of the associated staves will be continuous. - - - A single voice surrounded by two voice groups can be - preceded by an asterisk to make it into a `floating' - voice. This means that, for each note of the voice, a - separate decision is made whether it is printed on the - preceding or the following voice group's staff. - - - Voices that appear in the tune body but not in - the %%score directive will not be - output at all. If there is no %%score - directive, each voice will be output on its own - staff. - - - A %%score directive inside a tune - resets the mechanism so voices can be removed or - added. - - - - - - Voice overlay - You can add notes to a staff without introducing a - complete extra voice by using the ampersand (&). - A single measure can be split into two voices like - -|F2A2Bc&F2c2bc| - - The (&...&...&) construction - allows splitting multiple measures: - -|!f!(&GG<G|GG F=E| E2 E(_D/E)|_D D C D |C4- |C -     &DC<C|CC_D C|=B,2_B,B, |_A,A,(G,/A,/)B,|F,4-|F,)zzD=E| - - A double ampersand (&&) will allow - overlaying more than two lines of music but this feature has - not yet been implemented. - - - - Lyrics - Aligned lyrics under a staff are written as a - w: line directly below the staff line. For - example: - -edc2 edc2| -w:Three blind mice, three blind mice - - Each word in the w: line (delimited by - blanks) is associated with one note, in sequence. The - following special symbols modify this behaviour: - - - * - Skips one note. - - - - - Splits a word into two syllables which are - associated with two adjacent notes. A `-' is drawn - between them. - - - - | - Advances to the next bar - line - - - ~ - Is output as a space, but unites two words - so they appear under a single note. - - - _ - Draws a thin underscore from the - previous note to the next. - - - - - To include more than one line of lyrics, use multiple - w: lines. To include hyphens without - splitting a word over multiple notes, use - \-. - - - If a word starts with a digit, this is interpreted as a stanza - number and outdented a bit to the left. - - - - Slurs and ties - The direction of slurs and ties may be controlled using - the (, and (', - and -, and -', constructions. - - - - Microtone pitches - Microtone pitches are indicated by a fraction after an - accidental, as in ^3/4c. When omitted, the - numerator defaultes to 1 and the denominator to 2 (so ^/c is the same as ^1/2c). The numerator and denominator - values may not exceed 256. There is built-in support for - quarter-tone accidentals (1/2 and 3/2 sharps and flats); - for other values, rendering functions must be defined using - %%postscript (see - features.txt). - - - EPS inclusion - EPS files may be included inside tunes using the - pseudo-comment `%%EPS file'. - - - - - - SEE ALSO - - The original documentation can be found in files - features.txt, - format.txt, and options.txt, - which on a Debian system are in - /usr/share/doc/abcm2ps. - - - AUTHOR - - This manual page was written by &dhusername; <&dhemail;> for - the &debian; system (but may be used by others). Permission is - granted to copy, distribute and/or modify this document as long - as its origin is not misrepresented. - - - - - - - diff -Nru abcm2ps-7.8.9/debian/autoreconf.after abcm2ps-8.14.2/debian/autoreconf.after --- abcm2ps-7.8.9/debian/autoreconf.after 2014-10-18 21:33:46.000000000 +0000 +++ abcm2ps-8.14.2/debian/autoreconf.after 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -f4824da45e378bcb070b7b87474e86eb ./config.h -b8e950f1ad7d7895e601cf097f2dd9d6 ./front.h -1ab8527608f1b33d402d69e8c1586f0d ./Makefile.in -0db7321045da1ed1803f9bb218832d92 ./syms.c -a8d108b4b7cdd65ebbb7b946ec5e8b59 ./front.c -7e90a8aeaa971b9dd65a806060bc4589 ./sample4.abc -5e499de1a338f95b8b9655e08a8436d1 ./options.txt -9f051f44e12ad79557745fe36577c7a7 ./.pc/applied-patches -9e2ac60900b53e2c4b5356fa1e854c93 ./.pc/makefile-in-ignore-docs/Makefile.in -e8a673d5d4d69a5fd11c880fd4c3c481 ./.pc/.quilt_series -1ab8527608f1b33d402d69e8c1586f0d ./.pc/foo/Makefile.in -f99354f92d8902fe9434c996df51da93 ./.pc/makefile-add-destdir/Makefile.in -266f9759f56277b2751b24d1eb17c50f ./.pc/.quilt_patches -96e58a5a62ecb2f0888ad2ba9f67786e ./.pc/sample5-remove-bad-tie/sample5.abc -26ab0db90d72e28ad0ba1e22ee510510 ./.pc/.version -bd6ee3eeb1dd78f75c2e7e109175e787 ./format.txt -2d282d75e7d081f7ca606c9c6131ff71 ./build.ninja -14bfa0aa98aafe288172b86f61030b23 ./sample3.eps -1c9bc45610c4abfd6de1853d08986e0f ./musicfont.fmt -65cd3370f8faff628e74afbf70e7d074 ./INSTALL -6017b3f62efa060a4c64855c87d6d146 ./chinese.abc -ad3796823c017dd53e7e58525f21ca47 ./autom4te.cache/traces.0 -98d6103f1568d5c96e1f7c8d315885c6 ./autom4te.cache/output.1 -98d6103f1568d5c96e1f7c8d315885c6 ./autom4te.cache/output.0 -9db09e5d0a1242dae03ec5857e08029f ./autom4te.cache/requests -f96bbaa7e041f1412f0cccb5553a5c97 ./autom4te.cache/traces.1 -5557399ba0d9040b551eda85d4e39107 ./slre.h -771b8427d144b944c20ee96d99d1c268 ./Makefile -e7b0d3295bf35ab1521dbda45413e4a2 ./abc2ps.c -8ca43cbc842c2336e835926c2166c28b ./License -3c9461428618429ad3d7d1ac3adbb3f1 ./accordion.abc -e85622606c1389829cf7a314a9d7ea9c ./config.status -0bde4a7aa5954c3f506c470d717ce03c ./slre.c -2cc5a23d6ac9c36102c4aa4621814d69 ./abcparse.c -f9bccbdb1a2993065a7b36de308f277c ./Changes -5dda26326cc79312c7997716476a80df ./sample3.abc -053a0c420936ac6b912dbf985ab98502 ./draw.c -937d853fd3f12f364fed6406503e6abd ./subs.c -4733b2c522b38c34dcd6ed9f8dce17de ./tight.fmt -f61202614c097bef0424961ffc690890 ./glyph.c -aba7b0bf357485930a66c821ff144602 ./deco.abc -5da768a0039a349923fc29c8eb9a054f ./configure.in -197c6d0bbafc000ea39ddb977bacfc3c ./abc2ps.h -b9c53b7c71a9279df92c4010ff2fa8af ./Out.ps -f3898ff16ed30953373da45d317d26aa ./sample.abc -3f3a88337a881eadea7562fd03c3a55d ./features.txt -8515516ed374102024ed7886a1678b13 ./deco.c -3b00a59ff8ebe369491ad94d661b777d ./sample2.abc -eea34cf893bb060ee20189e256a8065a ./config.guess -6225417f7eb2054f9561687b44f24f6b ./buffer.c -9b9a3382dc6798b6cc9db374e5ca6c9e ./install.sh -83fc71392718ddfc451723e63b5feedc ./parse.c -a07ff13e03981eeec642ccd69ae96140 ./config.h.in -4dccd848193c7a5fd7aab347c25a225e ./config.log -f23fe8508a6bd647aa185d03c7fd1e74 ./svg.c -0ed23f3b85f1885fe5f19df337724369 ./newfeatures.abc -ad70c20ccee42e67261474d5ea5185fb ./configure -4f45209b150d4462a73a43a672bd8cbb ./music.c -431baec5af8c656c3febfdab3601c427 ./format.c -d883f7146ee423dc80af1207927b0565 ./sample5.abc -6a10740a5946c1ce08f4ed66368f4187 ./README -9e38dc3cc2b4e471ea192c8984fb0cd1 ./config.sub -0186451df142f38e59ec80c514af4091 ./landscape.fmt -2488e4d585cc953b1d3a41fc90f6b8ff ./flute.fmt -2f4076c49ab7c93ef126637a311a1c01 ./abcparse.h -5ea499c0b09fbcb3d77cbeb2f6fadb2a ./voices.abc diff -Nru abcm2ps-7.8.9/debian/autoreconf.before abcm2ps-8.14.2/debian/autoreconf.before --- abcm2ps-7.8.9/debian/autoreconf.before 2014-10-18 21:33:40.000000000 +0000 +++ abcm2ps-8.14.2/debian/autoreconf.before 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -f4824da45e378bcb070b7b87474e86eb ./config.h -b8e950f1ad7d7895e601cf097f2dd9d6 ./front.h -1ab8527608f1b33d402d69e8c1586f0d ./Makefile.in -0db7321045da1ed1803f9bb218832d92 ./syms.c -a8d108b4b7cdd65ebbb7b946ec5e8b59 ./front.c -7e90a8aeaa971b9dd65a806060bc4589 ./sample4.abc -5e499de1a338f95b8b9655e08a8436d1 ./options.txt -9f051f44e12ad79557745fe36577c7a7 ./.pc/applied-patches -9e2ac60900b53e2c4b5356fa1e854c93 ./.pc/makefile-in-ignore-docs/Makefile.in -e8a673d5d4d69a5fd11c880fd4c3c481 ./.pc/.quilt_series -1ab8527608f1b33d402d69e8c1586f0d ./.pc/foo/Makefile.in -f99354f92d8902fe9434c996df51da93 ./.pc/makefile-add-destdir/Makefile.in -266f9759f56277b2751b24d1eb17c50f ./.pc/.quilt_patches -96e58a5a62ecb2f0888ad2ba9f67786e ./.pc/sample5-remove-bad-tie/sample5.abc -26ab0db90d72e28ad0ba1e22ee510510 ./.pc/.version -bd6ee3eeb1dd78f75c2e7e109175e787 ./format.txt -2d282d75e7d081f7ca606c9c6131ff71 ./build.ninja -14bfa0aa98aafe288172b86f61030b23 ./sample3.eps -1c9bc45610c4abfd6de1853d08986e0f ./musicfont.fmt -65cd3370f8faff628e74afbf70e7d074 ./INSTALL -6017b3f62efa060a4c64855c87d6d146 ./chinese.abc -5557399ba0d9040b551eda85d4e39107 ./slre.h -771b8427d144b944c20ee96d99d1c268 ./Makefile -e7b0d3295bf35ab1521dbda45413e4a2 ./abc2ps.c -8ca43cbc842c2336e835926c2166c28b ./License -3c9461428618429ad3d7d1ac3adbb3f1 ./accordion.abc -e85622606c1389829cf7a314a9d7ea9c ./config.status -0bde4a7aa5954c3f506c470d717ce03c ./slre.c -2cc5a23d6ac9c36102c4aa4621814d69 ./abcparse.c -f9bccbdb1a2993065a7b36de308f277c ./Changes -5dda26326cc79312c7997716476a80df ./sample3.abc -053a0c420936ac6b912dbf985ab98502 ./draw.c -937d853fd3f12f364fed6406503e6abd ./subs.c -4733b2c522b38c34dcd6ed9f8dce17de ./tight.fmt -f61202614c097bef0424961ffc690890 ./glyph.c -aba7b0bf357485930a66c821ff144602 ./deco.abc -5da768a0039a349923fc29c8eb9a054f ./configure.in -197c6d0bbafc000ea39ddb977bacfc3c ./abc2ps.h -b9c53b7c71a9279df92c4010ff2fa8af ./Out.ps -f3898ff16ed30953373da45d317d26aa ./sample.abc -3f3a88337a881eadea7562fd03c3a55d ./features.txt -8515516ed374102024ed7886a1678b13 ./deco.c -3b00a59ff8ebe369491ad94d661b777d ./sample2.abc -eea34cf893bb060ee20189e256a8065a ./config.guess -6225417f7eb2054f9561687b44f24f6b ./buffer.c -9b9a3382dc6798b6cc9db374e5ca6c9e ./install.sh -83fc71392718ddfc451723e63b5feedc ./parse.c -a07ff13e03981eeec642ccd69ae96140 ./config.h.in -4dccd848193c7a5fd7aab347c25a225e ./config.log -f23fe8508a6bd647aa185d03c7fd1e74 ./svg.c -0ed23f3b85f1885fe5f19df337724369 ./newfeatures.abc -cd197153dd955d927bd7aa5268a187bd ./configure -4f45209b150d4462a73a43a672bd8cbb ./music.c -431baec5af8c656c3febfdab3601c427 ./format.c -d883f7146ee423dc80af1207927b0565 ./sample5.abc -6a10740a5946c1ce08f4ed66368f4187 ./README -9e38dc3cc2b4e471ea192c8984fb0cd1 ./config.sub -0186451df142f38e59ec80c514af4091 ./landscape.fmt -2488e4d585cc953b1d3a41fc90f6b8ff ./flute.fmt -2f4076c49ab7c93ef126637a311a1c01 ./abcparse.h -5ea499c0b09fbcb3d77cbeb2f6fadb2a ./voices.abc diff -Nru abcm2ps-7.8.9/debian/changelog abcm2ps-8.14.2/debian/changelog --- abcm2ps-7.8.9/debian/changelog 2018-04-03 12:11:49.000000000 +0000 +++ abcm2ps-8.14.2/debian/changelog 2019-01-27 17:50:50.000000000 +0000 @@ -1,8 +1,34 @@ -abcm2ps (7.8.9-1build1) bionic; urgency=high +abcm2ps (8.14.2-0.2) unstable; urgency=medium - * No change rebuild to pick up -fPIE compiler default + * Non-maintainer upload. + * Drop obsolete README.Debian. Closes: #919514. + * Debhelper 12. + * Cherry-pick bad-ps-when-centered-or-right-aligned.diff from upstream CVS. + * Fix the build with an explicit debhelper build system. Closes: #919219. + + -- Nicolas Boulenguez Sun, 27 Jan 2019 18:50:50 +0100 - -- Balint Reczey Tue, 03 Apr 2018 12:11:49 +0000 +abcm2ps (8.14.2-0.1) unstable; urgency=medium + + * Non-maintainer upload. + * New upstream release. Closes: #825386, #833017, #897966, #898130. + Addresses security issues: CVE-2018-10753, CVE-2018-10771. + * Forward all changes not specific to Debian. + * Remove autoreconf generated files from source package. + * Remove white spaces from this changelog and source/format. + * Debhelper 11. + * Build-Depends: pango-dev to enable optional pango fonts support. + * Standards-Version: 4.3.0. + * Rules-Requires-Root: no. + * Add Homepage. + * HTTPS protocol in copyright format. + * Enable all Debian hardening build flags. + * Link with --as-needed to remove some library dependencies. + * Add minimal run time test. + * Update watch file. + * Cherry-pick fix-loss-of-sep.diff from upstream VCS. + + -- Nicolas Boulenguez Sat, 29 Dec 2018 14:56:32 +0100 abcm2ps (7.8.9-1) unstable; urgency=low @@ -11,7 +37,7 @@ * Uses autotools-dev (closes: #759458, #765192). * Added machine-readable copyright file. * Bumped Standards-Version up to 3.9.6. - + -- Anselm Lingnau Sat, 18 Oct 2014 23:09:44 +0200 abcm2ps (5.9.25-1) unstable; urgency=low @@ -38,7 +64,7 @@ * New upstream release. * Added dependency on ${misc:Depends} to binary package for debhelper. * Bumped Standards-Version up to 3.9.1. - + -- Anselm Lingnau Thu, 17 Feb 2011 10:40:29 +0100 abcm2ps (5.9.13-0.1) unstable; urgency=low @@ -63,7 +89,7 @@ * Updated to policy version 3.8.2. * The maintainer for this package isn't dead, he's just pining for the fjords (Closes: #540854). - + * The "unexpected result with K:D =c" bug no longer applies to the current software version and the current (draft) ABC standard (Closes: #338867). @@ -83,7 +109,7 @@ * New upstream release * Updated to policy version 3.8.0 - + -- Anselm Lingnau Sat, 05 Jul 2008 11:32:07 +0200 abcm2ps (5.5.2-1) unstable; urgency=low @@ -124,9 +150,9 @@ * Removed extraneous /usr/sbin directory from the package. * Various documentation changes as per upstream. * Updated to policy version 3.6.2. - + -- Anselm Lingnau Tue, 11 Oct 2005 20:12:38 +0200 - + abcm2ps (4.9.4-1) unstable; urgency=low * New upstream release @@ -158,7 +184,7 @@ * Updated manual page as per upstream changes. * Converted control file to UTF-8. * Added versioned depends clause on docbook-to-man (closes: #255804). - + -- Anselm Lingnau Wed, 25 Aug 2004 00:10:18 +0200 abcm2ps (4.5.0-1) unstable; urgency=low @@ -196,4 +222,3 @@ * Initial Release. -- Anselm Lingnau Mon, 5 Jan 2004 02:41:57 +0100 - diff -Nru abcm2ps-7.8.9/debian/compat abcm2ps-8.14.2/debian/compat --- abcm2ps-7.8.9/debian/compat 2014-10-16 10:51:39.000000000 +0000 +++ abcm2ps-8.14.2/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru abcm2ps-7.8.9/debian/control abcm2ps-8.14.2/debian/control --- abcm2ps-7.8.9/debian/control 2018-04-03 12:11:49.000000000 +0000 +++ abcm2ps-8.14.2/debian/control 2019-01-27 17:39:38.000000000 +0000 @@ -1,10 +1,16 @@ Source: abcm2ps Section: text Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Anselm Lingnau -Build-Depends: debhelper (>> 9), autotools-dev, docbook-to-man (>> 2.0.0-13) -Standards-Version: 3.9.6.0 +Maintainer: Anselm Lingnau +Build-Depends: + debhelper-compat (= 12), + libfreetype6-dev, + libpango1.0-dev, + pkg-config, + python3-docutils, +Standards-Version: 4.3.0 +Rules-Requires-Root: no +Homepage: http://moinejf.free.fr/ Package: abcm2ps Architecture: any diff -Nru abcm2ps-7.8.9/debian/copyright abcm2ps-8.14.2/debian/copyright --- abcm2ps-7.8.9/debian/copyright 2014-10-18 21:07:18.000000000 +0000 +++ abcm2ps-8.14.2/debian/copyright 2019-01-27 17:39:38.000000000 +0000 @@ -1,16 +1,16 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: abcm2ps Upstream-Contact: Jean-François Moine Source: http://moinejf.free.fr/ License: GPL-2+ Files: * -Copyright: Copyright (C) 2000-2014, Jean-François Moine. - Based on abc2ps by Michael Methfessel . +Copyright: 2000-2018 Jean-François Moine (http://moinejf.free.fr) + 1996-1997 Michael Methfessel License: GPL-2+ Files: debian/* -Copyright: Copyright 2014 Anselm Lingnau +Copyright: 2004-2018 Anselm Lingnau License: GPL-2+ License: GPL-2+ diff -Nru abcm2ps-7.8.9/debian/patches/bad-ps-when-centered-or-right-aligned.diff abcm2ps-8.14.2/debian/patches/bad-ps-when-centered-or-right-aligned.diff --- abcm2ps-7.8.9/debian/patches/bad-ps-when-centered-or-right-aligned.diff 1970-01-01 00:00:00.000000000 +0000 +++ abcm2ps-8.14.2/debian/patches/bad-ps-when-centered-or-right-aligned.diff 2019-01-27 17:45:27.000000000 +0000 @@ -0,0 +1,16 @@ +Description: fix: bad PS output when centered or right aligned text with pango + Reported by Hudson Lacerda. +Author: Jean-Francois Moine +Origin: upstream https://github.com/leesavide/abcm2ps/commit/2eb380926b02edde530d4e1bfbe54d9f9ddf94fc + +--- a/subs.c ++++ b/subs.c +@@ -566,7 +566,7 @@ + wi /= 2; + // w = (float) wi / PG_SCALE; + w = (float) wi / PANGO_SCALE; +- a2b("-%.1f 0 RM ", w); ++ a2b(" -%.1f 0 RM", w); + break; + } + pg_line_output(line); diff -Nru abcm2ps-7.8.9/debian/patches/fix-loss-of-sep.diff abcm2ps-8.14.2/debian/patches/fix-loss-of-sep.diff --- abcm2ps-7.8.9/debian/patches/fix-loss-of-sep.diff 1970-01-01 00:00:00.000000000 +0000 +++ abcm2ps-8.14.2/debian/patches/fix-loss-of-sep.diff 2019-01-27 17:49:25.000000000 +0000 @@ -0,0 +1,32 @@ +Description: fix: loss of %%sep since commit 2f84d97448 + Reported by David Lacroix. +Author: Jean-Francois Moine +Origin: upstream https://github.com/leesavide/abcm2ps/commit/76087efbcd39749c60a05c86ffacd34110aa0f24 +From 76087efbcd39749c60a05c86ffacd34110aa0f24 Mon Sep 17 00:00:00 2001 + +--- a/parse.c ++++ b/parse.c +@@ -5158,16 +5158,17 @@ static void get_map(char *p) + static struct SYMBOL *process_pscomment(struct SYMBOL *s) + { + char w[32], *p, *q; +- int lock, voice; ++ int voice; + float h1; ++ int lock = 0; + + p = s->text + 2; /* skip '%%' */ + q = p + strlen(p) - 5; +- if (q < p) +- return s; +- lock = strncmp(q, " lock", 5) == 0; +- if (lock) +- *q = '\0'; ++ if (q > p ++ && strncmp(q, " lock", 5) == 0) { ++ lock = 1; ++ *q = '\0'; ++ } + p = get_str(w, p, sizeof w); + if (s->state == ABC_S_HEAD + && !check_header(s)) { diff -Nru abcm2ps-7.8.9/debian/patches/makefile-add-destdir abcm2ps-8.14.2/debian/patches/makefile-add-destdir --- abcm2ps-7.8.9/debian/patches/makefile-add-destdir 2014-10-16 11:22:04.000000000 +0000 +++ abcm2ps-8.14.2/debian/patches/makefile-add-destdir 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -Description: Add DESTDIR variable to Makefile.in - This patch adds a DESTDIR variable to the Makefile.in template in order - to allow installation into a subdirectory when the package is built. -Author: Anselm Lingnau - ---- abcm2ps-7.8.9.orig/Makefile.in -+++ abcm2ps-7.8.9/Makefile.in -@@ -43,15 +43,15 @@ abcmfe: front.c front.h slre.h - DOCFILES=$(addprefix $(srcdir)/,Changes License README *.abc *.eps *.txt) - - install: abcm2ps -- mkdir -p $(bindir); \ -- mkdir -p $(datadir)/abcm2ps; \ -- mkdir -p $(docdir)/abcm2ps; \ -- $(INSTALL_PROGRAM) abcm2ps $(bindir) -+ mkdir -p $(DESTDIR)$(bindir); \ -+ mkdir -p $(DESTDIR)$(datadir)/abcm2ps; \ -+ mkdir -p $(DESTDIR)$(docdir)/abcm2ps; \ -+ $(INSTALL_PROGRAM) abcm2ps $(DESTDIR)$(bindir) - for f in $(srcdir)/*.fmt; do \ -- $(INSTALL_DATA) $$f $(datadir)/abcm2ps; \ -+ $(INSTALL_DATA) $$f $(DESTDIR)$(datadir)/abcm2ps; \ - done - for f in $(DOCFILES); do \ -- $(INSTALL_DATA) $$f $(docdir)/abcm2ps; \ -+ $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/abcm2ps; \ - done - - uninstall: diff -Nru abcm2ps-7.8.9/debian/patches/makefile-install-ignore-docs abcm2ps-8.14.2/debian/patches/makefile-install-ignore-docs --- abcm2ps-7.8.9/debian/patches/makefile-install-ignore-docs 2014-10-17 15:58:23.000000000 +0000 +++ abcm2ps-8.14.2/debian/patches/makefile-install-ignore-docs 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -Description: Ignore documentation on "make install" - This patch changes the "install" target in the Makefile.in template such - that it does not attempt to install documentation. We take care of - installing the documentation and examples properly through the packaging - metadata. -Author: Anselm Lingnau - ---- abcm2ps-7.8.9.orig/Makefile.in -+++ abcm2ps-7.8.9/Makefile.in -@@ -45,14 +45,13 @@ DOCFILES=$(addprefix $(srcdir)/,Changes - install: abcm2ps - mkdir -p $(DESTDIR)$(bindir); \ - mkdir -p $(DESTDIR)$(datadir)/abcm2ps; \ -- mkdir -p $(DESTDIR)$(docdir)/abcm2ps; \ - $(INSTALL_PROGRAM) abcm2ps $(DESTDIR)$(bindir) - for f in $(srcdir)/*.fmt; do \ - $(INSTALL_DATA) $$f $(DESTDIR)$(datadir)/abcm2ps; \ - done -- for f in $(DOCFILES); do \ -- $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/abcm2ps; \ -- done -+ # for f in $(DOCFILES); do \ -+ # $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/abcm2ps; \ -+ # done - - uninstall: - echo "uninstalling..."; \ diff -Nru abcm2ps-7.8.9/debian/patches/non-resettable-pagenumber abcm2ps-8.14.2/debian/patches/non-resettable-pagenumber --- abcm2ps-7.8.9/debian/patches/non-resettable-pagenumber 2014-10-18 16:44:41.000000000 +0000 +++ abcm2ps-8.14.2/debian/patches/non-resettable-pagenumber 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -Description: Add "$Q" key in header for page numbers that don't reset - abcm2ps supports a "$P" key in header or footer lines that will output - the current page number and can be reset using "%%newpage". In my - books of SCD ball sets, I like to include both the page number inside - the tune and the page number inside the book on every page, so the - "$Q" adds another page number that is not changeable by the user. -Author: Anselm Lingnau -Last-Update: 2014-10-18 - ---- abcm2ps-7.8.9.orig/abc2ps.c -+++ abcm2ps-7.8.9/abc2ps.c -@@ -42,6 +42,7 @@ struct SYMBOL *sym; /* (points to the s - - int tunenum; /* number of current tune */ - int pagenum = 1; /* current page in output file */ -+int pagenum_nr = 1; /* current page (non-resettable) */ - - /* switches modified by command line flags: */ - int quiet; /* quiet mode */ ---- abcm2ps-7.8.9.orig/abc2ps.h -+++ abcm2ps-7.8.9/abc2ps.h -@@ -318,6 +318,7 @@ extern int use_buffer; /* 1 if lines ar - extern int outft; /* last font in the output file */ - extern int tunenum; /* number of current tune */ - extern int pagenum; /* current page number */ -+extern int pagenum_nr; /* current page (non-resettable) */ - extern int nbar; /* current measure number */ - extern int in_page; - extern int defl; /* decoration flags */ ---- abcm2ps-7.8.9.orig/buffer.c -+++ abcm2ps-7.8.9/buffer.c -@@ -404,6 +404,18 @@ static void format_hf(char *d, char *p) - } - d += sprintf(d, "%d", pagenum); - break; -+ case 'Q': /* non-resetting page number */ -+ if (p[1] == '0') { -+ p++; -+ if (pagenum_nr & 1) -+ break; -+ } else if (p[1] == '1') { -+ p++; -+ if ((pagenum_nr & 1) == 0) -+ break; -+ } -+ d += sprintf(d, "%d", pagenum_nr); -+ break; - case 'T': /* tune title */ - q = &info['T' - 'A']->as.text[2]; - tex_str(q); -@@ -613,6 +625,7 @@ static void init_page(void) - if (cfmt.footer) - maxy -= headfooter(0, pwidth, pheight); - pagenum++; -+ pagenum_nr++; - outft = -1; - } - diff -Nru abcm2ps-7.8.9/debian/patches/sample5-remove-bad-tie abcm2ps-8.14.2/debian/patches/sample5-remove-bad-tie --- abcm2ps-7.8.9/debian/patches/sample5-remove-bad-tie 2014-10-16 11:15:34.000000000 +0000 +++ abcm2ps-8.14.2/debian/patches/sample5-remove-bad-tie 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -Description: Tweak sample5.abc to make tests work - This change removes a "bad tie" from sample5 in order to make the - dh run work. It makes no visible difference in the output. - ---- abcm2ps-7.8.9.orig/sample5.abc -+++ abcm2ps-7.8.9/sample5.abc -@@ -77,7 +77,7 @@ B,/G,/ C=A,=B, CF, _B,_A,/G,/\ - V:1s - |fB _e_d/c/ dG\ - V:3s --|_A,_D- D/C/F/E/ D/C/D-\ -+|_A,_D- D/C/F/E/ D/C/D\ - V:1 - |fB _ed/c/ dG\ - V:2 diff -Nru abcm2ps-7.8.9/debian/patches/series abcm2ps-8.14.2/debian/patches/series --- abcm2ps-7.8.9/debian/patches/series 2014-10-18 16:38:51.000000000 +0000 +++ abcm2ps-8.14.2/debian/patches/series 2019-01-27 17:48:44.000000000 +0000 @@ -1,4 +1,2 @@ -sample5-remove-bad-tie -makefile-add-destdir -makefile-install-ignore-docs -non-resettable-pagenumber +fix-loss-of-sep.diff +bad-ps-when-centered-or-right-aligned.diff diff -Nru abcm2ps-7.8.9/debian/README.Debian abcm2ps-8.14.2/debian/README.Debian --- abcm2ps-7.8.9/debian/README.Debian 2014-10-16 10:50:57.000000000 +0000 +++ abcm2ps-8.14.2/debian/README.Debian 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -abcm2ps for Debian ------------------- - -This is a Debianization of Jef Moine's abcm2ps package. It differs -from the original in the following respects: - - - It contains an SGML-based manual page. - - Format files are placed in /usr/share/abcm2ps rather than - /usr/local/share/abcm2ps. - - abcm2ps assumes A4 paper by default. - - -- Anselm Lingnau , Mon Jan 5 03:02:59 2004 diff -Nru abcm2ps-7.8.9/debian/rules abcm2ps-8.14.2/debian/rules --- abcm2ps-7.8.9/debian/rules 2014-10-18 21:38:25.000000000 +0000 +++ abcm2ps-8.14.2/debian/rules 2019-01-27 17:39:38.000000000 +0000 @@ -1,11 +1,7 @@ #!/usr/bin/make -f -%: - dh $@ --with autotools-dev - -override_dh_auto_build: - docbook-to-man debian/abcm2ps.sgml >debian/abcm2ps.1 - dh_auto_build +export DEB_BUILD_MAINT_OPTIONS := hardening=+all +export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed -override_dh_auto_install: - $(MAKE) DESTDIR=$$(pwd)/debian/abcm2ps prefix=/usr install +%: + dh $@ --buildsystem=autoconf diff -Nru abcm2ps-7.8.9/debian/source/format abcm2ps-8.14.2/debian/source/format --- abcm2ps-7.8.9/debian/source/format 2014-10-16 10:58:20.000000000 +0000 +++ abcm2ps-8.14.2/debian/source/format 2019-01-27 17:39:38.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) \ No newline at end of file +3.0 (quilt) diff -Nru abcm2ps-7.8.9/debian/source/options abcm2ps-8.14.2/debian/source/options --- abcm2ps-7.8.9/debian/source/options 2014-10-16 11:13:07.000000000 +0000 +++ abcm2ps-8.14.2/debian/source/options 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -extend-diff-ignore = "(^|/)(config.sub|config.guess|config.h|config.log|config.status|Makefile|Out.ps)$" diff -Nru abcm2ps-7.8.9/debian/tests/control abcm2ps-8.14.2/debian/tests/control --- abcm2ps-7.8.9/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ abcm2ps-8.14.2/debian/tests/control 2019-01-27 17:39:38.000000000 +0000 @@ -0,0 +1 @@ +Test-Command: abcm2ps /usr/share/doc/abcm2ps/examples/sample2.abc -O "$AUTOPKGTEST_TMP/Out.eps" diff -Nru abcm2ps-7.8.9/debian/watch abcm2ps-8.14.2/debian/watch --- abcm2ps-7.8.9/debian/watch 2014-10-18 20:53:37.000000000 +0000 +++ abcm2ps-8.14.2/debian/watch 2019-01-27 17:39:38.000000000 +0000 @@ -1,7 +1,5 @@ -# Note that abcm2ps 7.x is the stable version. There is a version 8.x on the -# site but that is a potentially unstable development version which we do not -# package for the time being. +version=4 -# Site Directory Pattern Version Script -version=3 -http://moinejf.free.fr/abcm2ps-(7\..*)\.tar\.gz +opts=\ + filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/abcm2ps-$1\.tar\.gz/ \ +https://github.com/leesavide/abcm2ps/releases .*/v?(\d\S+)\.tar\.gz diff -Nru abcm2ps-7.8.9/deco.abc abcm2ps-8.14.2/deco.abc --- abcm2ps-7.8.9/deco.abc 2013-12-18 19:21:38.000000000 +0000 +++ abcm2ps-8.14.2/deco.abc 2018-12-18 15:18:26.000000000 +0000 @@ -6,34 +6,19 @@ % % == postscript definitions - must be before any tune == % +%%setfont-1 Times-Italic 14 % dynamics +%%setfont-2 Times-BoldItalic 16 +%%setfont-3 Times-Roman 11 % optional notes +%%setfont-4 Times-Roman 16 % 'al Coda' + +%%beginsvg + + + +%%endsvg + %%beginps -% -- cresc / decresc / dimin -/crdc{ % usage: str x y crdc - cresc, decresc, .. - /Times-Italic 14 selectfont - M -6 4 RM show}! -% -% -- alternate piano/forte indication between parenthesis -/apf{ % usage: str x y apf - M -6 5 RM - /Times-Italic 16 selectfont(\()show - /Times-BoldItalic 16 selectfont show - /Times-Italic 16 selectfont(\))show}! -% -% -- draw parenthesis around a note -/opnot{ % usage: x y opnot - M -5.5 -3 RM /Times-Roman 15 selectfont(\( \))show}! -% -- same, but inside a chord (x is not the same) -/opchnot{ % usage: x y opchnot - M -10.5 -3 RM /Times-Roman 15 selectfont(\( \))show}! -% -% -- sforzando accent -/sfa{ % usage: x y sfa - 1.2 SLW M -2.4 4.8 RM - 2.4 8.0 RL - 2.4 -7.4 RL - -1.0 0.0 RL - -1.8 6.4 RL - stroke}! % % -- draw octava indication /octava{ % usage: w x y octava @@ -107,7 +92,7 @@ % % -- pedal off glyph % (from CMN http://ccrma-www.stanford.edu/software/cmn/cmn/cmn.html) -/pedoff{ % usage: str x y ped +/pedoff{ % usage: str x y pedoff gsave 4 add exch -5 add exch T 26 dup scale 0.219 0.198 moveto 0.231 0.172 0.195 0.138 0.162 0.173 curveto @@ -147,19 +132,6 @@ 0.138 0.297 0.116 0.275 0.144 0.242 curveto fill pop grestore}! % -% -- glissendo -/gliss{ % usage: x2 y2 x1 y1 gliss - gsave exch 13 add exch 2 copy T 0 0 M - exch 4 -1 roll exch sub 3 1 roll sub % dx dy - 2 copy exch atan dup rotate % dx dy alpha - exch pop cos div % len -% 9 sub 0 RL % simple line - 9 sub 0 8 3 -1 roll{ % squiggly line - 2 -1.15 2.30 150 30 arcn 4 0 T - 2 1.15 2.30 -150 -30 arc 4 0 T pop - }for - 1 SLW stroke grestore}! -% % -- upper glissendo /glissup{ % usage: x y glissup gsave T 5 0 T @@ -171,7 +143,7 @@ 1 SLW stroke grestore}! % % -- note decorations -% (sorry for I don't know the name of these: there so many ones) +% (sorry for I don't know the name of these: there are so many ones) % The convention I use here is: % - t2 or t3: mordent with 2 or 3 peeks % - ta or tb: turn from above or from below @@ -205,23 +177,13 @@ /t3b{ % usage: x y t3b - upper + lower mordent 2 copy exch -7.5 add exch 4 add tr3 0.6 SLW M 2.5 0 RM 0 8 RL stroke}! -/sharp{ % usage: x y sharp - sharp above note - 4 add gsave T 0.6 dup scale 0 0 sh0 grestore}! -/flat{ % usage: x y flat - flat above note - 4 add gsave T 0.6 dup scale 0 0 ft0 grestore}! -/natural{ % usage: x y natural - natural sign above note - 4 add gsave T 0.6 dup scale 0 0 nt0 grestore}! -% -% -- 'treble-8' customization -/octl{ - /Times-BoldItalic 16 selectfont M 5.5 -14 RM(8vb)show}! % % -- latin guitar chords % note: 'Ré' cannot be used /gcshow{ dup 0 get dup dup 65 ge exch 71 le and{ - 65 sub[(La)(Si)(Do)(Re)(Mi)(Fa)(Sol )]exch get show + 65 sub[(La)(Si)(Do)(Re)(Mi)(Fa)(Sol)]exch get show dup length 1 sub 1 exch getinterval }if show}! % @@ -278,13 +240,13 @@ 3 -1 roll pop % discard 'h' exch dup x gt {pop x} if exch % have room for accidentals y 1 index sub 3 1 roll % new height - arp}! + arp}def % % -- optional breath /brth{6 add /xbr 2 index def /ybr 1 index def - /Times-BoldItalic 30 selectfont M (,) show}! + /Times-BoldItalic 30 selectfont M (,) show}def /opbrth{pop pop xbr 10 sub ybr 5 sub - /Times-Roman 20 selectfont M (\( \)) show}! + /Times-Roman 20 selectfont M (\( \)) show}def % % -- head decorations / replacement % lower mordent @@ -297,12 +259,12 @@ 1 -2.5 6.5 0 5.5 2.5 RC fill}! % -- measure bar between two staves (1 and 2) /hbar{ % usage: x y hbar - dlw pop dup 0 y0 M 24 y1 lineto stroke}! + dlw pop dup 0 y0 M 24 y1 lineto stroke}def %%endps % % == decoration definitions == % -% actual syntax (see format.txt): +% actual syntax (see http://moinejf.free.fr/abcm2ps-doc/index.html): % %%deco [] % % -- accent near the note / sforzando @@ -311,26 +273,27 @@ % % -- dynamic indication below the staff %%deco fp 6 pf 18 5 11 fp -%%deco cresc 6 crdc 20 4 28 Cresc. -%%deco decresc 6 crdc 20 4 32 Decresc. -%%deco dimin 6 crdc 20 4 28 Dimin. -%%deco riten 6 crdc 20 8 40 Poco riten. +%%deco cresc 6 @ 20 10 22 "@-8,4$1Cresc." +%%deco decresc 6 @ 20 10 26 "@-8,4$1Decresc." +%%deco dimin 6 @ 20 10 22 "@-8,4$1Dimin." +%%deco riten 6 @ 20 12 34 "@-8,4$1Poco riten." % % -- dynamic indication below the staff between parenthesis -%%deco (p) 6 apf 20 8 16 p -%%deco (pp) 6 apf 20 8 24 pp -%%deco (f) 6 apf 20 8 16 f -%%deco (ff) 6 apf 20 8 24 ff +%%deco (p) 6 @ 20 8 16 "@-8,4$1($2p$1)" +%%deco (pp) 6 @ 20 8 24 "@-8,4$1($2pp$1)" +%%deco (f) 6 @ 20 8 16 "@-8,4$1($2f$1)" +%%deco (ff) 6 @ 20 8 24 "@-8,4$1($2ff$1)" % % -- repeat indication above the staff -%%deco alcoda 3 dacs 20 0 0 al Coda +%%deco alcoda 3 @ 20 0 0 "@0,5$4al Coda" % % -- who asked for a Pedal indication ? %%deco ped 6 ped 20 0 0 -%%deco ped-end 6 pedoff 20 0 0 +%%deco ped-up 6 pedoff 20 0 0 % % -- optional note -%%deco () 1 opnot 0 0 0 +%%deco () 0 @ 0 0 0 "@-8,-3$3( )" +%%deco ()l 0 @ 0 0 0 "@-16,-3$3( )" % % -- start / stop of octava indication %%deco 8( 5 - 24 0 0 @@ -344,8 +307,6 @@ % ... % % -- glissendo -%%deco -( 1 - 0 0 0 -%%deco -) 1 gliss 0 0 0 %%deco - 1 glissup 0 2 10 % % -- note decorations @@ -355,9 +316,9 @@ %%deco tbt3 3 tbt3 14 14 18 %%deco t2ta 3 t2ta 12 5 15 %%deco t3b 3 t3b 12 5 15 -%%deco # 3 sharp 8 0 0 -%%deco b 3 flat 8 0 0 -%%deco = 3 natural 8 0 0 +%%deco # 3 @ 8 0 0 "@0,0♯" +%%deco b 3 @ 8 0 0 "@0,0♭" +%%deco = 3 @ 8 0 0 "@0,0♮" % % -- 'tr' + long trill %%deco tr( 5 - 11 0 0 @@ -378,7 +339,6 @@ %%deco opbrth 3 opbrth 0 0 0 % % -- head decorations -%%deco op 1 opchnot 0 0 0 % optional head %%deco m 0 hlmrd 0 0 0 % lower mordent on the left %%deco head-x 0 dsh0 0 0 0 % X head %%deco head-shd 0 shd 0 0 0 % small head @@ -391,24 +351,24 @@ M:C L:1/8 K:C treble-8 -!biga!y!fp!"C"C!t2ub!C !cresc!"D"D!t3tab!D !decresc!"E"E!ubt3ta!E !dimin!"F"F!tbt3!F|\ +!biga!y20!fp!"C"C!t2ub!C !cresc!"D"D!t3tab!D !decresc!"E"E!ubt3ta!E !dimin!"F"F!tbt3!F|\ !mp!"G"G!t2ta!G !(p)!A!t3b!c T!b!!(pp)!A2 P!#!!(f)!B2|M!=!!(ff)!c8| % K: clef=treble -!8(!!riten!EF !-!G2 !ped!GA!ped-end!B!8)!c|!8b(!!bigb!C2!()!E2 !tr(!G3!tr)!!8b)!c!alcoda!|\ +!8(!!riten!EF !-!G2 !ped!GA!ped-up!B!8)!c|!8b(!!bigb!C2[!()l!_E2] !tr(!G3!tr)!!8b)!c!alcoda!|\ CE!-(!G2!-)!C2c2| % "Dm"!Dm!e3/d/ d6 | "Bb"!Bb!z2 d/d3/ "C7"!C7!cB/A/- AG |\ F!accent!G!accn!AB !sfa!c4|| -X:3 +X:2 T:Decorations with abcm2ps 4.x.x M:C L:1/4 %%staves {1 2} K:C V:1 -!arpu![!op!C!op!Gc]4 !hbar![] !breath!!opbrth!!arpd![CGc]4 |\ +!arpu![!()!C!()!Gc]4 !hbar![] !breath!!opbrth!!arpd![CGc]4 |\ !arps![CGc]4 | z3/[!head-x!B]/ [c!m!eg]2 | c4 || V:2 !arpeggio![C,,G,,C,]4 [] [C,,G,,C,]4 |\ diff -Nru abcm2ps-7.8.9/deco.c abcm2ps-8.14.2/deco.c --- abcm2ps-7.8.9/deco.c 2014-06-03 18:24:21.000000000 +0000 +++ abcm2ps-8.14.2/deco.c 2018-12-18 15:18:26.000000000 +0000 @@ -3,21 +3,12 @@ * * This file is part of abcm2ps. * - * Copyright (C) 2000-2014, Jean-François Moine. + * Copyright (C) 2000-2017, Jean-François Moine. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #include @@ -29,9 +20,10 @@ #define lroundf(x) ((long) ((x) + 0.5)) #endif -#include "abc2ps.h" +#include "abcm2ps.h" int defl; /* decoration flags */ +char *deco[256]; /* decoration names */ static struct deco_elt { struct deco_elt *next, *prev; /* next/previous decoration */ @@ -42,19 +34,22 @@ unsigned char flags; #define DE_VAL 0x01 /* put extra value if 1 */ #define DE_UP 0x02 /* above the staff */ -#define DE_BELOW 0x08 /* below the staff */ -#define DE_GRACE 0x10 /* in grace note */ +//#define DE_BELOW 0x08 /* below the staff */ +//#define DE_GRACE 0x10 /* in grace note */ #define DE_INV 0x20 /* invert the glyph */ #define DE_LDST 0x40 /* start of long decoration */ #define DE_LDEN 0x80 /* end of long decoration */ unsigned char defl; /* decorations flags - see DEF_xx */ + signed char m; /* chord index */ float x, y; /* x, y */ - float v; /* extra value */ - char *str; /* string / 0 */ + float dy; /* dy for annotation strings */ + float val; /* extra value */ +// char *str; /* string / 0 */ } *deco_head, *deco_tail; typedef void draw_f(struct deco_elt *de); -static draw_f d_arp, d_cresc, d_near, d_slide, d_upstaff, d_pf, d_trill; +static draw_f d_arp, d_cresc, d_near, d_slide, d_upstaff, + d_pf, d_trill; /* decoration table */ /* !! don't change the order of the numbered items !! */ @@ -63,11 +58,11 @@ unsigned char func; /* function index */ signed char ps_func; /* postscript function index */ unsigned char h; /* height */ - unsigned char wl; /* width */ - unsigned char wr; + unsigned char wl, wr; /* left and right widths */ unsigned char strx; /* string index - 255=deco name */ + unsigned char ld_start; /* index of start of long decoration */ unsigned char ld_end; /* index of end of long decoration */ - unsigned char dum; + unsigned char flags; /* only DE_LDST and DE_LDEN */ } deco_def_tb[128]; /* c function table */ @@ -81,6 +76,9 @@ d_pf, /* 6 - tied to staff (dynamic marks) */ d_cresc, /* 7 */ }; +static const short f_near = (1 << 0) | (1 << 1) | (1 << 2); +static const short f_note = (1 << 3) | (1 << 4) | (1 << 5); +static const short f_staff = (1 << 6) | (1 << 7); /* postscript function table */ static char *ps_func_tb[128]; @@ -120,6 +118,8 @@ "+ 3 dplus 7 3 3", "accent 3 accent 7 4 4", "> 3 accent 7 4 4", + "marcato 3 marcato 9 3 3", + "^ 3 marcato 9 3 3", "D.C. 3 dacs 16 10 10 D.C.", "D.S. 3 dacs 16 10 10 D.S.", "fine 3 dacs 16 10 10 FINE", @@ -137,22 +137,32 @@ "pppp 6 pf 18 10 25", "pralltriller 3 umrd 10 2 2", "sfz 6 sfz 18 4 10", + "ped 4 ped 20 0 0", + "ped-up 4 pedoff 20 0 0", "turn 3 turn 10 0 5", "wedge 3 wedge 8 1 1", "turnx 3 turnx 10 0 5", - "trill( 5 - 8 0 0", - "trill) 5 ltr 8 0 0", + "trill( 3 ltr 8 0 0", + "trill) 3 ltr 8 0 0", "snap 3 snap 14 3 3", "thumb 3 thumb 14 2 2", "arpeggio 2 arp 12 10 0", - "crescendo( 7 - 18 0 0", - "crescendo) 7 cresc 18 0 0", - "<( 7 - 18 0 0", - "<) 7 cresc 18 0 0", - "diminuendo( 7 - 18 0 0", - "diminuendo) 7 dim 18 0 0", - ">( 7 - 18 0 0", - ">) 7 dim 18 0 0", + "crescendo( 6 cresc 18 0 0", + "crescendo) 6 cresc 18 0 0", + "<( 6 cresc 18 0 0", + "<) 6 cresc 18 0 0", + "diminuendo( 6 dim 18 0 0", + "diminuendo) 6 dim 18 0 0", + ">( 6 dim 18 0 0", + ">) 6 dim 18 0 0", + "-( 8 gliss 0 0 0", + "-) 8 gliss 0 0 0", + "~( 8 glisq 0 0 0", + "~) 8 glisq 0 0 0", + "8va( 3 o8va 10 0 0", + "8va) 3 o8va 10 0 0", + "8vb( 4 o8vb 10 0 0", + "8vb) 4 o8vb 10 0 0", "invisible 32 0 0 0 0", "beamon 33 0 0 0 0", "trem1 34 0 0 0 0", @@ -168,17 +178,20 @@ "/// 38 0 0 6 6", "beam-accel 39 0 0 0 0", "beam-rall 39 0 0 0 0", + "stemless 40 0 0 0 0", + "rbend 41 0 0 0 0", 0 }; /* user decorations */ static struct u_deco { struct u_deco *next; - char text[2]; + char text[256]; // dummy size } *user_deco; -static struct SYMBOL *first_note; /* first note/rest of the line */ +//static struct SYMBOL *first_note; /* first note/rest of the line */ +static unsigned char deco_define(char *name); static void draw_gchord(struct SYMBOL *s, float gchy_min, float gchy_max); /* -- get the max/min vertical offset -- */ @@ -259,6 +272,20 @@ } } +//// set the string of a decoration +//static char *set_str(struct deco_elt *de, char *str) +//{ +// float dx, dy; +// int n; +// +// if (sscanf(str, "@%f,%f%n", &dx, &dy, &n) == 2) { +// de->x += dx; +// de->dy = dy; +// return str + n; +// } +// return str; +//} + /* -- get the staff position of the dynamic and volume marks -- */ static int up_p(struct SYMBOL *s, int pos) { @@ -278,7 +305,7 @@ } /* -- drawing functions -- */ -/* special case for arpeggio */ +/* 2: special case for arpeggio */ static void d_arp(struct deco_elt *de) { struct SYMBOL *s; @@ -290,10 +317,10 @@ dd = &deco_def_tb[de->t]; xc = 0; for (m = 0; m <= s->nhd; m++) { - if (s->as.u.note.accs[m]) { - dx = 5 + s->shac[m]; + if (s->u.note.notes[m].acc) { + dx = 5 + s->u.note.notes[m].shac; } else { - dx = 6 - s->shhd[m]; + dx = 6 - s->u.note.notes[m].shhd; switch (s->head) { case H_SQUARE: case H_OVAL: @@ -310,12 +337,12 @@ h = m; de->flags |= DE_VAL; - de->v = h; + de->val = h; de->x = s->x - xc; de->y = (float) (3 * (s->pits[0] - 18)) - 3; } -/* special case for crescendo/diminuendo */ +/* special case for long dynamics */ static void d_cresc(struct deco_elt *de) { struct SYMBOL *s, *s2; @@ -328,13 +355,19 @@ return; s2 = de->s; de1 = de->start; /* start of the deco */ - if (de1) { +// if (de1) { s = de1->s; x = s->x + 3; - } else { /* end without start */ - s = first_note; - x = s->x - s->wl - 4; - } +// } else { /* end without start */ +// if (!first_note) { +// dd = &deco_def_tb[de->t]; +// error(1, s2, "No start of deco !%s!", dd->name); +// de->t = 0; +// return; +// } +// s = first_note; +// x = s->x - s->wl - 4; +// } de->staff = s2->staff; de->flags &= ~DE_LDEN; /* old behaviour */ de->flags |= DE_VAL; @@ -346,8 +379,8 @@ if (de1 && de1->prev && de1->prev->s == s && ((de->flags ^ de1->prev->flags) & DE_UP) == 0) { dd2 = &deco_def_tb[de1->prev->t]; - if (dd2->func >= 6) { - x2 = de1->prev->x + de1->prev->v + 4; + if (f_staff & (1 << dd2->func)) { + x2 = de1->prev->x + de1->prev->val + 4; if (x2 > x) x = x2; } @@ -364,28 +397,44 @@ if (de->next && de->next->s == s && ((de->flags ^ de->next->flags) & DE_UP) == 0) { dd2 = &deco_def_tb[de->next->t]; - if (dd2->func >= 6) /* if dynamic mark */ + if (f_staff & (1 << dd2->func)) /* if dynamic mark */ x2 -= 5; } dx = x2 - x - 4; if (dx < 20) { x -= (20 - dx) * 0.5; - if (de->start == 0) - x -= (20 - dx) * 0.5; +// if (!de->start) +// x -= (20 - dx) * 0.5; dx = 20; } } - de->v = dx; + de->val = dx; de->x = x; - dd = &deco_def_tb[de->t]; de->y = y_get(de->staff, up, x, dx); - if (!up) + if (!up) { + dd = &deco_def_tb[de->t]; de->y -= dd->h; + } /* (y_set is done later in draw_deco_staff) */ } -/* near the note (dot, tenuto) */ +/* special case for glissendo */ +static void d_gliss(struct deco_elt *de2) +{ + struct deco_elt *de1; + struct SYMBOL *s1, *s2; + + de1 = de2->start; + s1 = de1->s; + if (s1->dots) + de1->x += 5 + s1->xmx; + s2 = de2->s; + de2->x -= 2 + s2->u.note.notes[0].shac ? + (s2->u.note.notes[0].shac + 3) : hw_tb[s2->head]; +} + +/* 0: near the note (dot, tenuto) */ static void d_near(struct deco_elt *de) { struct SYMBOL *s; @@ -394,6 +443,7 @@ s = de->s; dd = &deco_def_tb[de->t]; + if (s->multi) up = s->multi > 0; else @@ -412,7 +462,9 @@ else s->ymn = y; de->y = (float) y; - de->x = s->x + s->shhd[s->stem >= 0 ? 0 : s->nhd]; + de->x = s->x; + if (s->type == NOTEREST) + de->x += s->u.note.notes[s->stem >= 0 ? 0 : s->nhd].shhd; if (dd->name[0] == 'd' /* if dot decoration */ && s->nflags >= -1) { /* on stem */ if (up) { @@ -423,21 +475,34 @@ de->x -= STEM_XOFF; } } + if (dd->strx != 0 && dd->strx != 255) { + de->x = s->x; + de->y = s->y; +// de->str = set_str(de, str_tb[dd->strx]); + } } -/* special case for piano/forte indications */ +/* 6: dynamic marks */ static void d_pf(struct deco_elt *de) { struct SYMBOL *s; struct deco_def_s *dd, *dd2; float x, x2; - char *str; +// char *str; int up; + // don't treat here the long decorations + if (de->flags & DE_LDST) + return; + if (de->start) { + d_cresc(de); + return; + } + s = de->s; dd = &deco_def_tb[de->t]; - de->v = dd->wl + dd->wr; + de->val = dd->wl + dd->wr; up = up_p(s, s->posit.vol); if (up) @@ -447,8 +512,8 @@ if (de->prev && de->prev->s == s && ((de->flags ^ de->prev->flags) & DE_UP) == 0) { dd2 = &deco_def_tb[de->prev->t]; - if (dd2->func >= 6) { /* if dynamic mark */ - x2 = de->prev->x + de->prev->v + 4; + if (f_staff & (1 << dd2->func)) { /* if dynamic mark */ + x2 = de->prev->x + de->prev->val + 4; if (x2 > x) x = x2; } @@ -460,31 +525,31 @@ float y; x2 = x - (STEM_XOFF + dd->wr + 4); - y = y_get(s->staff, up, x2, de->v); + y = y_get(s->staff, up, x2, de->val); if (y > s->ymn) { x = x2; } else { x2 -= 3; - y = y_get(s->staff, up, x2, de->v); + y = y_get(s->staff, up, x2, de->val); if (y > s->ymn) x = x2; } #endif } - str = dd->name; - if (dd->strx != 0 && dd->strx != 255) - str = str_tb[dd->strx]; - de->x = x; - de->y = y_get(s->staff, up, x, de->v); + de->y = y_get(s->staff, up, x, de->val); if (!up) de->y -= dd->h; - de->str = str; + +// str = dd->name; +// if (dd->strx != 0 && dd->strx != 255) +// str = set_str(de, str_tb[dd->strx]); +// de->str = str; /* (y_set is done later in draw_deco_staff) */ } -/* special case for slide and tremolo */ +/* 1: special case for slide */ static void d_slide(struct deco_elt *de) { struct SYMBOL *s; @@ -494,26 +559,28 @@ s = de->s; yc = s->pits[0]; xc = 5; - for (m = 0; m <= s->nhd; m++) { - if (s->as.u.note.accs[m]) { - dx = 4 + s->shac[m]; - } else { - dx = 5 - s->shhd[m]; - switch (s->head) { - case H_SQUARE: - case H_OVAL: - dx += 2.5; - break; + if (s->type == NOTEREST) { + for (m = 0; m <= s->nhd; m++) { + if (s->u.note.notes[m].acc) { + dx = 4 + s->u.note.notes[m].shac; + } else { + dx = 5 - s->u.note.notes[m].shhd; + switch (s->head) { + case H_SQUARE: + case H_OVAL: + dx += 2.5; + break; + } } + if (s->pits[m] <= yc + 3 && dx > xc) + xc = dx; } - if (s->pits[m] <= yc + 3 && dx > xc) - xc = dx; } de->x = s->x - xc; de->y = (float) (3 * (yc - 18)); } -/* special case for long trill */ +/* special case for long decoration */ static void d_trill(struct deco_elt *de) { struct SYMBOL *s, *s2; @@ -525,19 +592,31 @@ return; s2 = de->s; - if (de->start) { /* deco start */ +// if (de->start) { /* deco start */ s = de->start->s; x = s->x; - if (s->as.type == ABC_T_NOTE - && s->as.u.note.dc.n > 1) + if (s->abc_type == ABC_T_NOTE + && s->u.note.dc.n > 1) x += 10; - } else { /* end without start */ - s = first_note; - x = s->x - s->wl - 4; - } +// } else { /* end without start */ +// s = first_note; +// if (!s) { +// dd = &deco_def_tb[de->t]; +// error(1, s2, "No start of deco !%s!", dd->name); +// de->t = 0; +// return; +// } +// x = s->x - s->wl - 4; +// } de->staff = staff = s2->staff; - up = s2->multi >= 0; + dd = &deco_def_tb[de->t]; + if (dd->func == 4) // if below + up = 0; + else if (strcmp(ps_func_tb[dd->ps_func], "o8va") == 0) + up = 1; + else + up = s2->multi >= 0; if (de->defl & DEF_NOEN) { /* if no decoration end */ w = de->x - x; if (w < 20) { @@ -546,17 +625,16 @@ } } else { w = s2->x - x - 6; - if (s2->as.type == ABC_T_NOTE) + if (s2->abc_type == ABC_T_NOTE) w -= 6; if (w < 20) { x -= (20 - w) * 0.5; - if (de->start == 0) - x -= (20 - w) * 0.5; +// if (!de->start) +// x -= (20 - w) * 0.5; w = 20; } } - dd = &deco_def_tb[de->t]; y = y_get(staff, up, x, w); if (up) { float stafft; @@ -574,7 +652,7 @@ } de->flags &= ~DE_LDEN; de->flags |= DE_VAL; - de->v = w; + de->val = w; de->x = x; de->y = y; if (up) @@ -586,39 +664,54 @@ s->ymn = s2->ymn = y; } -/* above (or below) the staff */ +/* 3, 4: above (or below) the staff */ static void d_upstaff(struct deco_elt *de) { struct SYMBOL *s; struct deco_def_s *dd; + char *ps_name; float x, yc, stafft, staffb, w; - int inv; + int up, inv; + + // don't treat here the long decorations + if (de->flags & DE_LDST) + return; + if (de->start) { + d_trill(de); + return; + } s = de->s; dd = &deco_def_tb[de->t]; inv = 0; - x = s->x + s->shhd[s->stem >= 0 ? 0 : s->nhd]; + x = s->x; + if (s->type == NOTEREST) + x += s->u.note.notes[s->stem >= 0 ? 0 : s->nhd].shhd; w = dd->wl + dd->wr; stafft = staff_tb[s->staff].topbar + 2; staffb = staff_tb[s->staff].botbar - 2; - if (dd->strx != 0) - de->str = dd->strx == 255 ? dd->name : str_tb[dd->strx]; - switch (s->posit.orn) { - case SL_ABOVE: - de->flags &= ~DE_BELOW; - break; - case SL_BELOW: - de->flags |= DE_BELOW; - break; + up = -1; // undefined + if (dd->func == 4) { // upstaff below + up = 0; + } else { + switch (s->posit.orn) { + case SL_ABOVE: + up = 1; + break; + case SL_BELOW: + up = 0; + break; + } } - if (strcmp(dd->name, ">") == 0 - || strcmp(dd->name, "accent") == 0 - || strcmp(dd->name, "emphasis") == 0 - || strcmp(dd->name, "roll") == 0) { - if (s->multi < 0 - || (s->multi == 0 && s->stem > 0)) { + ps_name = ps_func_tb[dd->ps_func]; + if (strcmp(ps_name, "accent") == 0 + || strcmp(ps_name, "cpu") == 0) { + if (!up + || (up < 0 + && (s->multi < 0 + || (s->multi == 0 && s->stem > 0)))) { yc = y_get(s->staff, 0, s->x - dd->wl, w); if (yc > staffb) yc = staffb; @@ -630,17 +723,18 @@ yc = y_get(s->staff, 1, s->x, 0); if (yc < stafft) yc = stafft; -// if (s->stem <= 0 -// && (s->dots == 0 || ((int) s->y % 6))) -// yc -= 2; y_set(s->staff, 1, s->x - dd->wl, w, yc + dd->h); s->ymx = yc + dd->h; } - } else if (strcmp(dd->name, "breath") == 0 - || strcmp(dd->name, "longphrase") == 0 - || strcmp(dd->name, "mediumphrase") == 0 - || strcmp(dd->name, "shortphrase") == 0) { + } else if (strcmp(ps_name, "brth") == 0 + || strcmp(ps_name, "lphr") == 0 + || strcmp(ps_name, "mphr") == 0 + || strcmp(ps_name, "sphr") == 0) { yc = stafft + 1; + if (ps_name[0] == 'b') { // if breath + if (yc < s->ymx) + yc = s->ymx; + } for (s = s->ts_next; s; s = s->ts_next) if (s->shrink != 0) break; @@ -649,12 +743,11 @@ else x += (realwidth - x) * 0.4; } else { - if (strcmp(dd->name, "invertedturn") == 0 - || strcmp(dd->name, "invertedturnx") == 0) + if (strncmp(dd->name, "invert", 6) == 0) inv = 1; - if (s->multi >= 0 - && strcmp(dd->name, "invertedfermata") != 0 - && !(de->flags & DE_BELOW)) { + if (strcmp(dd->name, "invertedfermata") != 0 + && (up > 0 + || (up < 0 && s->multi >= 0))) { yc = y_get(s->staff, 1, s->x - dd->wl, w); if (yc < stafft) yc = stafft; @@ -666,8 +759,8 @@ yc = staffb; yc -= dd->h; y_set(s->staff, 0, s->x - dd->wl, w, yc); - if (strcmp(dd->name, "fermata") == 0 - || strcmp(dd->name, "invertedfermata") == 0) + if (strcmp(dd->name, "fermata") == 0) +// || strcmp(dd->name, "invertedfermata") == 0) inv = 1; s->ymn = yc; } @@ -678,6 +771,13 @@ } de->x = x; de->y = yc; + +// if (dd->strx != 0) { +// if (dd->strx == 255) +// de->str = dd->name; +// else +// de->str = set_str(de, str_tb[dd->strx]); +// } } /* -- add a decoration - from %%deco -- */ @@ -696,31 +796,51 @@ user_deco = d; } -static unsigned char deco_build(char *text) +static int get_deco(char *name) +{ + struct deco_def_s *dd; + int ideco; + + for (ideco = 1, dd = &deco_def_tb[1]; ideco < 128; ideco++, dd++) { + if (!dd->name + || strcmp(dd->name, name) == 0) + return ideco; + } + error(1, NULL, "Too many decorations"); + return ideco; +} + +static unsigned char deco_build(char *name, char *text) { struct deco_def_s *dd; int c_func, ideco, h, o, wl, wr, n; unsigned l, ps_x, strx; - char name[32]; + char name2[32]; char ps_func[16]; /* extract the arguments */ if (sscanf(text, "%15s %d %15s %d %d %d%n", - name, &c_func, ps_func, &h, &wl, &wr, &n) != 6) { - error(1, 0, "Invalid deco %s", text); + name2, &c_func, ps_func, &h, &wl, &wr, &n) != 6) { + error(1, NULL, "Invalid %%%%deco %s", text); return 128; } - if ((unsigned) c_func >= sizeof func_tb / sizeof func_tb[0] - && (c_func < 32 || c_func > 39)) { - error(1, 0, "%%%%deco: bad C function index (%s)", text); + + if ((unsigned) c_func > 10 + && (c_func < 32 || c_func > 41)) { + error(1, NULL, "%%%%deco: bad C function index (%s)", text); return 128; } + if (c_func == 5) // old !trill(! + c_func = 3; + if (c_func == 7) // old !cresc(! + c_func = 6; + if (h < 0 || wl < 0 || wr < 0) { - error(1, 0, "%%%%deco: cannot have a negative value (%s)", text); + error(1, NULL, "%%%%deco: cannot have a negative value (%s)", text); return 128; } if (h > 50 || wl > 80 || wr > 80) { - error(1, 0, "%%%%deco: abnormal h/wl/wr value (%s)", text); + error(1, NULL, "%%%%deco: abnormal h/wl/wr value (%s)", text); return 128; } text += n; @@ -728,15 +848,10 @@ text++; /* search the decoration */ - for (ideco = 1, dd = &deco_def_tb[1]; ideco < 128; ideco++, dd++) { - if (!dd->name - || strcmp(dd->name, name) == 0) - break; - } - if (ideco == 128) { - error(1, 0, "Too many decorations"); - return 128; - } + ideco = get_deco(name); + if (ideco == 128) + return ideco; + dd = &deco_def_tb[ideco]; /* search the postscript function */ for (ps_x = 0; ps_x < sizeof ps_func_tb / sizeof ps_func_tb[0]; ps_x++) { @@ -745,20 +860,20 @@ break; } if (ps_x == sizeof ps_func_tb / sizeof ps_func_tb[0]) { - error(1, 0, "Too many postscript functions"); + error(1, NULL, "Too many postscript functions"); return 128; } /* have an index for the string */ - if (*text == '\0') { - strx = 0; - } else if (strcmp(text, name) == 0) { + if (strcmp(text, name) == 0) { strx = 255; + } else if (*text == '\0') { + strx = c_func == 6 ? 255 : 0; } else { for (strx = 1; strx < sizeof str_tb / sizeof str_tb[0]; strx++) { - if (str_tb[strx] == 0) { + if (!str_tb[strx]) { if (*text == '"') { text++; l = strlen(text); @@ -774,15 +889,15 @@ break; } if (strx == sizeof str_tb / sizeof str_tb[0]) { - error(1, 0, "Too many decoration strings"); + error(1, NULL, "Too many decoration strings"); return 128; } } /* set the values */ if (!dd->name) - dd->name = strdup(name); /* new decoration */ - dd->func = c_func; + dd->name = name; /* new decoration */ + dd->func = strncmp(dd->name, "head-", 5) == 0 ? 9 : c_func; if (!ps_func_tb[ps_x]) { if (ps_func[0] == '-' && ps_func[1] == '\0') ps_x = -1; @@ -793,34 +908,44 @@ dd->h = h; dd->wl = wl; dd->wr = wr; - dd->strx = strx; /* link the start and end of long decorations */ l = strlen(name); if (l == 0) return ideco; l--; - if (name[l] == '(' || name[l] == ')') { + if (name[l] == '(' + || (name[l] == ')' && !strchr(name, '('))) { struct deco_def_s *ddo; + strx = 0; // (no string) + strcpy(name2, name); + if (name[l] == '(') { + dd->flags = DE_LDST; + name2[l] = ')'; + } else { + dd->flags = DE_LDEN; + name2[l] = '('; + } for (o = 1, ddo = &deco_def_tb[1]; o < 128; o++, ddo++) { if (!ddo->name) break; - if (strlen(ddo->name) == l + 1 - && strncmp(ddo->name, name, l) == 0) { - if (name[l] == '(' - && ddo->name[l] == ')') { + if (strcmp(ddo->name, name2) == 0) { + if (name[l] == '(') { + ddo->ld_start = ideco; dd->ld_end = o; - break; - } - if (name[l] == ')' - && ddo->name[l] == '(') { + } else { + dd->ld_start = o; ddo->ld_end = ideco; - break; } + break; } } + if (o >= 128 || !ddo->name) +//fixme: memory leak... + deco_define(strdup(name2)); } + dd->strx = strx; return ideco; } @@ -836,11 +961,11 @@ d = s1->dur; s2 = NULL; n = 1; - for (s = (struct SYMBOL *) s1->as.next; + for (s = (struct SYMBOL *) s1->abc_next; s; - s = (struct SYMBOL *) s->as.next) { + s = (struct SYMBOL *) s->abc_next) { if (s->dur != d - || (s->as.flags & ABC_F_SPACE)) + || (s->flags & ABC_F_SPACE)) break; s2 = s; n++; @@ -854,7 +979,7 @@ if (accel) { /* !beam-accel! */ for (s = s1, i = n - 1; s != s2; - s = (struct SYMBOL *) s->as.next, i--) { + s = (struct SYMBOL *) s->abc_next, i--) { d = (int) lroundf(a * i) + b; s->dur = d; t += d; @@ -862,7 +987,7 @@ } else { /* !beam-rall! */ for (s = s1, i = 0; s != s2; - s = (struct SYMBOL *) s->as.next, i++) { + s = (struct SYMBOL *) s->abc_next, i++) { d = (int) lroundf(a * i) + b; s->dur = d; t += d; @@ -871,155 +996,256 @@ s2->dur = tt - t; } +/* -- define a decoration -- */ +static unsigned char deco_define(char *name) +{ + struct u_deco *d; + unsigned char ideco; + int l; + + l = strlen(name); + for (d = user_deco; d; d = d->next) { + if (strncmp(d->text, name, l) == 0 + && d->text[l] == ' ') + return deco_build(name, d->text); + } + for (ideco = 0; ; ideco++) { + if (!std_deco_tb[ideco]) + break; + if (strncmp(std_deco_tb[ideco], name, l) == 0 + && std_deco_tb[ideco][l] == ' ') + return deco_build(name, std_deco_tb[ideco]); + } + return 128; +} + +/* -- convert the external deco number to the internal one -- */ +static unsigned char deco_intern(unsigned char ideco, + struct SYMBOL *s) +{ + char *name; + + name = ideco < 128 ? deco[ideco] : parse.deco_tb[ideco - 128]; + if (!name) { + error(1, s, "Bad character '%c'", ideco); + return 0; + } + for (ideco = 1; ideco < 128; ideco++) { + if (!deco_def_tb[ideco].name) { + ideco = deco_define(name); + break; + } + if (strcmp(deco_def_tb[ideco].name, name) == 0) + break; + } + if (ideco == 128) { + if (cfmt.decoerr) + error(1, s, "Decoration !%s! not defined", name); + ideco = 0; + } + return ideco; +} + /* -- convert the decorations -- */ -void deco_cnv(struct deco *dc, +void deco_cnv(struct decos *dc, struct SYMBOL *s, struct SYMBOL *prev) { - int i, j; + int i, j, m, n; struct deco_def_s *dd; unsigned char ideco; static char must_note_fmt[] = "Deco !%s! must be on a note"; for (i = dc->n; --i >= 0; ) { - if ((ideco = dc->t[i]) == 0) + if ((ideco = dc->tm[i].t) == 0) continue; - if (ideco < 128) { - ideco = deco[ideco]; - if (ideco == 0) - error(1, s, - "Notation '%c' not treated", dc->t[i]); - } else { - ideco = deco_intern(ideco); - } - dc->t[i] = ideco; + ideco = deco_intern(ideco, s); + dc->tm[i].t = ideco; if (ideco == 0) continue; + dd = &deco_def_tb[ideco]; + m = dc->tm[i].m; /* special decorations */ - dd = &deco_def_tb[ideco]; switch (dd->func) { + case 2: // arp + if (m >= 0) { + error(1, s, + "!%s! cannot be on a head (function 2)", + dd->name); + break; + } + /* fall thru */ + case 0: // near + + /* special case for dotted bars */ + if (dd->func == 0 && s->abc_type == ABC_T_BAR + && strcmp(dd->name, "dot") == 0) { + s->u.bar.dotted = 1; + break; + } + // fall thru + case 1: // slide + if (s->abc_type != ABC_T_NOTE + && s->abc_type != ABC_T_REST) { + error(1, s, + "!%s! must be on a note or a rest", + dd->name); + break; + } + continue; + case 8: // gliss: move to the upper note of the chord + if (s->abc_type != ABC_T_NOTE) { + error(1, s, "!%s! must be on a note", + dd->name); + break; + } + if (m < 0) + dc->tm[i].m = s->nhd; + continue; + case 9: // move the alternate head of the chord to the notes + if (s->abc_type != ABC_T_NOTE + && s->abc_type != ABC_T_REST) { + error(1, s, + "!%s! must be on a note or a rest", + dd->name); + break; + } + if (m >= 0) { + s->u.note.notes[m].invisible = 1; + continue; + } + + // apply !head-xx! to each head + dc->tm[i].m = 0; + s->u.note.notes[0].invisible = 1; + n = dc->n; + for (m = 1; m <= s->nhd; m++) { + if (n >= MAXDC) { + error(1, s, + "Too many decorations"); + break; + } + dc->tm[n].t = ideco; + dc->tm[n++].m = m; + s->u.note.notes[m].invisible = 1; + } + dc->n = n; + continue; default: + if (strlen(dd->name) >= 4 + && dd->name[0] == '8' && dd->name[1] == 'v' + && dd->name[4] == '\0') { + if (dd->name[3] == '(') { + if (dd->name[2] == 'a') + curvoice->ottava = -7; + else if (dd->name[2] == 'b') + curvoice->ottava = 7; + } else if (dd->name[3] == ')') { + if (dd->name[2] == 'a' + || dd->name[2] == 'b') + curvoice->ottava = 0; + } + } continue; - case 32: /* 32 = invisible */ - s->as.flags |= ABC_F_INVIS; + case 32: /* invisible */ + if (m < 0) + s->flags |= ABC_F_INVIS; + else + s->u.note.notes[m].invisible = 1; break; - case 33: /* 33 = beamon */ + case 33: /* beamon */ s->sflags |= S_BEAM_ON; break; - case 34: /* 34 = trem1..trem4 */ - if (s->as.type != ABC_T_NOTE + case 34: /* trem1..trem4 */ + if (s->abc_type != ABC_T_NOTE || !prev - || prev->as.type != ABC_T_NOTE) { + || prev->abc_type != ABC_T_NOTE) { error(1, s, "!%s! must be on the last of a couple of notes", dd->name); break; } + if (strlen(dd->name) != 5) + n = 0; + else + n = dd->name[4] - '0'; + if (n <= 0 || n > 4) { + error(1, s, "bad definition of !%s!", dd->name); + break; + } s->sflags |= (S_TREM2 | S_BEAM_END); s->sflags &= ~S_BEAM_ST; prev->sflags |= (S_TREM2 | S_BEAM_ST); prev->sflags &= ~S_BEAM_END; - s->u = prev->u = dd->name[4] - '0'; + s->aux = prev->aux = n; for (j = 0; j <= s->nhd; j++) - s->as.u.note.lens[j] *= 2; + s->u.note.notes[j].len *= 2; for (j = 0; j <= prev->nhd; j++) - prev->as.u.note.lens[j] *= 2; + prev->u.note.notes[j].len *= 2; break; - case 35: /* 35 = xstem */ - if (s->as.type != ABC_T_NOTE) { + case 35: /* xstem */ + if (s->abc_type != ABC_T_NOTE) { error(1, s, must_note_fmt, dd->name); break; } s->sflags |= S_XSTEM; break; - case 36: /* 36 = beambr1 / beambr2 */ - if (s->as.type != ABC_T_NOTE) { + case 36: /* beambr1 / beambr2 */ + if (s->abc_type != ABC_T_NOTE) { error(1, s, must_note_fmt, dd->name); break; } + if (strlen(dd->name) != 7 + || (dd->name[6] != '1' && dd->name[6] != '2')) { + error(1, s, "bad definition of !%s!", dd->name); + break; + } s->sflags |= dd->name[6] == '1' ? S_BEAM_BR1 : S_BEAM_BR2; break; - case 37: /* 37 = rbstop */ + case 37: /* rbstop */ s->sflags |= S_RBSTOP; break; - case 38: /* 38 = /, // and /// = tremolo */ - if (s->as.type != ABC_T_NOTE) { + case 38: /* /, // and /// = tremolo */ + if (s->abc_type != ABC_T_NOTE) { error(1, s, must_note_fmt, dd->name); break; } + n = strlen(dd->name); + if (n > 3) { + error(1, s, "bad definition of !%s!", dd->name); + break; + } s->sflags |= S_TREM1; - s->u = strlen(dd->name); /* 1, 2 or 3 */ + s->aux = n; /* 1, 2 or 3 */ break; - case 39: /* 39 = beam-accel/beam-rall */ - if (s->as.type != ABC_T_NOTE) { + case 39: /* beam-accel/beam-rall */ + if (s->abc_type != ABC_T_NOTE) { error(1, s, must_note_fmt, dd->name); break; } + if (strlen(dd->name) < 6) { + error(1, s, "bad definition of !%s!", dd->name); + break; + } s->sflags |= S_FEATHERED_BEAM; set_feathered_beam(s, dd->name[5] == 'a'); break; - } - dc->t[i] = 0; /* already treated */ - } -} - -/* -- define a user decoration -- */ -static unsigned char user_deco_define(char *name) -{ - struct u_deco *d; - int l; - - l = strlen(name); - for (d = user_deco; d; d = d->next) { - if (strncmp(d->text, name, l) == 0 - && d->text[l] == ' ') - return deco_build(d->text); - } - return 128; -} - -/* -- define a standard decoration -- */ -unsigned char deco_define(char *name) -{ - unsigned char ideco; - int l; - - l = strlen(name); - for (ideco = 0; ; ideco++) { - if (!std_deco_tb[ideco]) - return 128; - if (strncmp(std_deco_tb[ideco], name, l) == 0 - && std_deco_tb[ideco][l] == ' ') + case 40: /* stemless */ + if (s->abc_type != ABC_T_NOTE) { + error(1, s, must_note_fmt, dd->name); + break; + } + s->flags |= ABC_F_STEMLESS; break; - } - return deco_build(std_deco_tb[ideco]); -} - -/* -- convert the external deco number to the internal one -- */ -unsigned char deco_intern(unsigned char ideco) -{ - char *name; - - if (ideco == 0) - return ideco; - name = deco_tb[ideco - 128]; - for (ideco = 1; ideco < 128; ideco++) { - if (!deco_def_tb[ideco].name) { - ideco = user_deco_define(name); /* try a user decoration */ - if (ideco == 128) /* try a standard decoration */ - ideco = deco_define(name); + case 41: /* rbend */ + s->flags |= ABC_F_RBSTOP; /* with bracket end */ + s->sflags |= S_RBSTOP; break; } - if (strcmp(deco_def_tb[ideco].name, name) == 0) - break; - } - if (ideco == 128) { - error(1, 0, "Decoration !%s! not treated", name); - ideco = 0; + dc->tm[i].t = 0; /* already treated */ } - return ideco; } /* -- update the x position of a decoration -- */ @@ -1041,19 +1267,19 @@ /* -- adjust the symbol width -- */ float deco_width(struct SYMBOL *s) { - struct deco *dc; + struct decos *dc; int i; float wl; wl = 0; if (s->type == BAR) - dc = &s->as.u.bar.dc; + dc = &s->u.bar.dc; else - dc = &s->as.u.note.dc; + dc = &s->u.note.dc; for (i = dc->n; --i >= 0; ) { struct deco_def_s *dd; - dd = &deco_def_tb[dc->t[i]]; + dd = &deco_def_tb[dc->tm[i].t]; switch (dd->func) { case 1: /* slide */ if (wl < 7) @@ -1076,7 +1302,9 @@ { struct deco_elt *de; struct deco_def_s *dd; - int f, staff; + struct SYMBOL *s; + int f, staff, l; + char *gl, *p; float x, y, y2, ym; float ymid[MAXSTAFF]; @@ -1091,15 +1319,53 @@ } for (de = deco_head; de; de = de->next) { + if (de->t == 0) // deleted + continue; dd = &deco_def_tb[de->t]; +// if ((dd->flags & DE_LDST) && dd->ld_end != 0) + if (dd->ld_end != 0) + continue; // start of long decoration if ((f = dd->ps_func) < 0) - continue; + continue; // old behaviour + + // handle the stem direction + gl = ps_func_tb[f]; // glyph name(s) + p = strchr(gl, '/'); + if (p) { + if (de->s->stem >= 0) { + l = (int) (p - gl); + } else { + gl = p + 1; + l = strlen(gl); + } + } else { + l = strlen(gl); + } + + s = de->s; +// David Lacroix - 16-12-28 +// set_color(s->color); + + // no scale if staff decoration + if (f_staff & (1 << dd->func)) + set_sscale(-1); + else + set_scale(s); + staff = de->staff; + x = de->x; +// y = de->y + staff_tb[staff].y / staff_tb[staff].staffscale; y = de->y + staff_tb[staff].y; + /* update the coordinates if head decoration */ + if (de->m >= 0) { + x += s->u.note.notes[de->m].shhd * + staff_tb[staff].staffscale; + /* center the dynamic marks between two staves */ /*fixme: KO when deco on other voice and same direction*/ - if (dd->func >= 6 && !cfmt.dynalign + } else if ((f_staff & (1 << dd->func)) + && !cfmt.dynalign && (((de->flags & DE_UP) && staff > 0) || (!(de->flags & DE_UP) && staff < nstaff))) { if (de->flags & DE_UP) @@ -1109,18 +1375,15 @@ ym -= dd->h * 0.5; if (((de->flags & DE_UP) && y < ym) || (!(de->flags & DE_UP) && y > ym)) { - struct SYMBOL *s; - - s = de->s; - if (s->staff > staff) { - while (s->staff != staff) - s = s->ts_prev; - } else if (s->staff < staff) { - while (s->staff != staff) - s = s->ts_next; - } +// if (s->staff > staff) { +// while (s->staff != staff) +// s = s->ts_prev; +// } else if (s->staff < staff) { +// while (s->staff != staff) +// s = s->ts_next; +// } y2 = y_get(staff, !(de->flags & DE_UP), - de->x, de->v) + de->x, de->val) + staff_tb[staff].y; if (de->flags & DE_UP) y2 -= dd->h; @@ -1128,23 +1391,49 @@ || (!(de->flags & DE_UP) && y2 < ym)) { y = ym; y_set(staff, de->flags & DE_UP, - de->x, de->v, + de->x, de->val, ((de->flags & DE_UP) ? y + dd->h : y) - staff_tb[staff].y); } } } - set_scale(de->s); set_defl(de->defl); -/*fixme: scaled or not?*/ - if (de->flags & DE_VAL) - putf(de->v); - if (de->str) { + if (de->flags & DE_VAL) { + if (dd->func != 2 + || voice_tb[s->voice].scale != 1) + putx(de->val); + else + putf(de->val); + } + if (dd->strx != 0) { char *p, *q; + y += dd->h * 0.2; // font descent + if (dd->strx == 255) { + p = dd->name; + } else { + p = str_tb[dd->strx]; + if (*p == '@') { + float dx, dy; + int n; + + if (sscanf(p, "@%f,%f%n", + &dx, &dy, &n) == 2) { + x += dx; + y += dy; + p += n; + } + str_font(ANNOTATIONFONT); + outft = -1; // force font selection + putxy(x, y); + a2b("M"); + put_str(p, A_LEFT); + continue; + } + } a2b("("); - q = p = de->str; + q = p; while (*p != '\0') { if (*p == '(' || *p == ')') { if (p != q) @@ -1158,145 +1447,43 @@ a2b("%.*s", (int) (p - q), q); a2b(")"); } - putxy(de->x, y); + putxy(x, y); if (de->flags & DE_LDEN) { - if (de->start) { +// if (de->start) { x = de->start->x; y = de->start->y + staff_tb[de->start->staff].y; - } else { - x = first_note->x - first_note->wl - 4; - } +// } else { +// x = first_note->x - first_note->wl - 4; +// } if (x > de->x - 20) x = de->x - 20; putxy(x, y); } - if (de->flags & DE_GRACE) { - if (de->flags & DE_INV) - a2b("gsave T 0.7 -0.7 scale 0 0 %s grestore\n", - ps_func_tb[f]); - else - a2b("gsave T 0.7 dup scale 0 0 %s grestore\n", - ps_func_tb[f]); - } else { - if (de->flags & DE_INV) - a2b("gsave 1 -1 scale neg %s grestore\n", - ps_func_tb[f]); - else - a2b("%s\n", ps_func_tb[f]); - } + if (de->flags & DE_INV) + a2b("gsave 1 -1 scale neg %.*s grestore\n", + l, gl); + else + a2b("%.*s\n", l, gl); } set_sscale(-1); /* restore the scale */ -} - -/* -- draw a decoration relative to a note head -- */ -/* return 1 if the decoration is a head */ -int draw_deco_head(int ideco, float x, float y, int stem) -{ - struct deco_def_s *dd; - char *str; - - if (ideco == 0) - return 0; - dd = &deco_def_tb[ideco]; - if (dd->ps_func < 0) - return 0; - if (cfmt.setdefl) - set_defl(stem >= 0 ? DEF_STEMUP : 0); - switch (dd->func) { - case 2: - case 5: - case 7: - a2b("0 "); - break; - case 3: - case 4: - if (dd->strx == 0) - break; - /* fall thru */ - case 6: - str = dd->name; - if (dd->strx != 0 && dd->strx != 255) - str = str_tb[dd->strx]; - a2b("(%s)", str); - break; - } - putxy(x, y); - a2b("%s ", ps_func_tb[dd->ps_func]); - return strncmp(dd->name, "head-", 5) == 0; -} - -/* -- draw the chord decorations relative to the heads -- */ -void draw_all_deco_head(struct SYMBOL *s, float x, float y) -{ - int k; - unsigned char ideco; - struct deco *dc; - struct deco_def_s *dd; - - dc = &s->as.u.note.dc; - for (k = dc->n; --k >= 0; ) { - if (k >= dc->h && k < dc->s) /* skip the head decorations */ - continue; - if ((ideco = dc->t[k]) == 0) - continue; - dd = &deco_def_tb[ideco]; - - if (strncmp(dd->name, "head-", 5) != 0) - continue; - draw_deco_head(ideco, x, y, s->stem); - } + set_color(0); } /* -- create the deco elements, and treat the near ones -- */ static void deco_create(struct SYMBOL *s, - struct deco *dc) + struct decos *dc) { - int k, l, posit; + int k, m, posit; unsigned char ideco; struct deco_def_s *dd; struct deco_elt *de; -#if 1 -/*fixme:pb with decorations above the staff*/ - for (k = 0; k < dc->n; k++) { - if (k >= dc->h && k < dc->s) /* skip the head decorations */ - continue; - if ((ideco = dc->t[k]) == 0) - continue; - dd = &deco_def_tb[ideco]; -#else - int i, j; - struct deco_def_s *d_tb[MAXDC]; - /* the decorations above the staff must be treated in reverse order */ - memset(&d_tb, 0, sizeof d_tb); - i = 0; - j = dc->n; +/*fixme:pb with decorations above the staff*/ for (k = 0; k < dc->n; k++) { - if (k >= dc->h && k < dc->s) /* skip the head decorations */ - continue; - if ((ideco = dc->t[k]) == 0) + m = dc->tm[k].m; + if ((ideco = dc->tm[k].t) == 0) continue; dd = &deco_def_tb[ideco]; - if (dd->func < 3) { /* if near the note */ - if (s->multi > 0 - || (s->multi == 0 && s->stem < 0)) { - d_tb[--j] = dd; - continue; - } - } else if (dd->func == 3 /* if tied to note (not below) */ - || dd->func == 5) { - if (s->multi >= 0) { - d_tb[--j] = dd; - continue; - } - } - d_tb[i++] = dd; - } - - for (k = 0; k < dc->n; k++) { - if ((dd = d_tb[k]) == 0) - continue; -#endif /* check if hidden */ switch (dd->func) { default: @@ -1304,8 +1491,6 @@ break; case 3: /* d_upstaff */ case 4: -//fixme:trill does not work yet - case 5: /* trill */ posit = s->posit.orn; break; case 6: /* d_pf */ @@ -1316,23 +1501,10 @@ break; } if (posit == SL_HIDDEN) { - dc->t[k] = 0; + dc->tm[k].t = 0; continue; } - /* memorize the decorations, but not the head ones */ - if (strncmp(dd->name, "head-", 5) == 0) { - switch (s->type) { - case NOTEREST: - s->sflags |= S_OTHER_HEAD; - break; - default: - error(1, s, "Cannot have !%s! on a bar", - dd->name); - break; - } - continue; - } de = (struct deco_elt *) getarena(sizeof *de); memset(de, 0, sizeof *de); de->prev = deco_tail; @@ -1344,68 +1516,173 @@ de->s = s; de->t = dd - deco_def_tb; de->staff = s->staff; - if (s->as.type == ABC_T_NOTE - && (s->as.flags & ABC_F_GRACE)) - de->flags = DE_GRACE; - if (dd->ld_end != 0) { + de->m = m; +// if (s->flags & ABC_F_GRACE) +// de->flags = DE_GRACE; + if (dd->flags & DE_LDST) { de->flags |= DE_LDST; - } else { - l = strlen(dd->name) - 1; - if (l > 0 && dd->name[l] == ')') { - if (strchr(dd->name, '(') == 0) { - de->flags |= DE_LDEN; - de->defl = DEF_NOST; - } - } + } else if (dd->flags & DE_LDEN) { + de->flags |= DE_LDEN; + de->defl = DEF_NOST; } if (cfmt.setdefl && s->stem >= 0) de->defl |= DEF_STEMUP; - if (dd->func >= 3) /* if not near the note */ - continue; - if (s->as.type != ABC_T_NOTE) { - error(1, s, - "Cannot have !%s! on a rest or a bar", - dd->name); + /* set the coordinates of the decoration */ + if (m >= 0) { /* head decoration */ + de->x = s->x; + de->y = 3 * (s->pits[m] - 18); +// if (dd->func == 9) /* alternate note head */ +// s->u.note.notes[m].invisible = 1; continue; } + if (!(f_near & (1 << dd->func))) /* if not near the note */ + continue; func_tb[dd->func](de); } } +// link the long decorations +static void ll_deco(void) +{ + struct deco_elt *de, *de2, *tail; + struct deco_def_s *dd; + int t, voice, staff; + + // add ending decorations + tail = deco_tail; + if (!tail) + return; + for (de = deco_head; ; de = de->next) { + t = de->t; + dd = &deco_def_tb[t]; + + if (!(de->flags & DE_LDST)) { + if (de == tail) + break; + continue; + } + t = dd->ld_end; +#if 0 + if (t == 0) { // if long deco has no end + int l; // create one + char *name; + + l = strlen(dd->name); + name = getarena(l + 1); + strcpy(name, dd->name); + name[l - 1] = ')'; + t = get_deco(name); + if (t != 128) { + struct deco_def_s *dd2; + + dd2 = &deco_def_tb[t]; + dd2->name = name; + dd2->func = dd->func; + dd2->ps_func = dd->ps_func; + dd2->h = dd->h; + dd->ld_end = t; + } else { + t = 0; + } + } +#endif + voice = de->s->voice; /* search later in the voice */ + for (de2 = de->next; de2; de2 = de2->next) + if (!de2->start + && de2->t == t && de2->s->voice == voice) + break; + if (!de2) { /* no end, search in the staff */ + staff = de->s->staff; + for (de2 = de->next; de2; de2 = de2->next) + if (!de2->start + && de2->t == t && de2->s->staff == staff) + break; + } + if (!de2) { /* no end, insert one */ + de2 = (struct deco_elt *) getarena(sizeof *de2); + memset(de2, 0, sizeof *de2); + de2->prev = deco_tail; + deco_tail->next = de2; + deco_tail = de2; + de2->s = de->s; + de2->t = t; + de2->defl = DEF_NOEN; + de2->flags = DE_LDEN; + de2->x = realwidth - 6; + de2->y = de->s->y; + de2->m = de->m; + } + de2->start = de; + de2->defl &= ~DEF_NOST; + if (dd->func == 8) + d_gliss(de2); + if (de == tail) + break; + } + + // add starting decorations + for (de2 = deco_head; ; de2 = de2->next) { + if (!(de2->flags & DE_LDEN) // not the end of long decoration + || de2->start) { // start already found + if (de2 == tail) + break; + continue; + } + t = de2->t; + dd = &deco_def_tb[t]; + de = (struct deco_elt *) getarena(sizeof *de); + memset(de, 0, sizeof *de); + de->prev = deco_tail; + deco_tail->next = de; + deco_tail = de; + de->s = prev_scut(de2->s); + de->t = dd->ld_start; + de->flags = DE_LDST; + de->defl = DEF_NOST; + de->x = de->s->x; //de2->s->x - de2->s->wl - 4; + de->y = de2->s->y; + de->m = de2->m; + de2->start = de; +// de2->defl &= ~DEF_NOST; + if (de2 == tail) + break; + } +} + /* -- create the decorations and treat the ones near the notes -- */ /* (the staves are not yet defined) */ /* this function must be called first as it builds the deco element table */ void draw_deco_near(void) { struct SYMBOL *s, *g; - struct deco *dc; - struct SYMBOL *first; + struct decos *dc; +// struct SYMBOL *first; deco_head = deco_tail = NULL; - first = NULL; +// first = NULL; for (s = tsfirst; s; s = s->ts_next) { switch (s->type) { case BAR: case MREST: - if (s->as.u.bar.dc.n == 0) + if (s->u.bar.dc.n == 0) continue; - dc = &s->as.u.bar.dc; + dc = &s->u.bar.dc; break; case NOTEREST: case SPACE: - if (!first) - first = s; - if (s->as.u.note.dc.n == 0) +// if (!first) +// first = s; + if (s->u.note.dc.n == 0) continue; - dc = &s->as.u.note.dc; + dc = &s->u.note.dc; break; case GRACE: for (g = s->extra; g; g = g->next) { - if (g->as.type != ABC_T_NOTE - || g->as.u.note.dc.n == 0) + if (g->abc_type != ABC_T_NOTE + || g->u.note.dc.n == 0) continue; - dc = &g->as.u.note.dc; + dc = &g->u.note.dc; deco_create(g, dc); } /* fall thru */ @@ -1414,64 +1691,161 @@ } deco_create(s, dc); } - first_note = first; +// first_note = first; + + ll_deco(); // link the long decorations } /* -- draw the decorations tied to a note -- */ /* (the staves are not yet defined) */ void draw_deco_note(void) { - struct deco_elt *de, *de2; + struct deco_elt *de; struct deco_def_s *dd; - int f, t, staff, voice; + int f, t; for (de = deco_head; de; de = de->next) { t = de->t; dd = &deco_def_tb[t]; - if (de->flags & DE_LDST) { /* start of long decoration */ - t = dd->ld_end; - voice = de->s->voice; /* search in the voice */ - for (de2 = de->next; de2; de2 = de2->next) - if (de2->t == t && de2->s->voice == voice) - break; - if (!de2) { /* search in the staff */ - staff = de->s->staff; - for (de2 = de->next; de2; de2 = de2->next) - if (de2->t == t && de2->s->staff == staff) - break; - } - if (!de2) { /* no end, insert one */ - de2 = (struct deco_elt *) getarena(sizeof *de2); - memset(de2, 0, sizeof *de2); - de2->prev = deco_tail; - deco_tail->next = de2; - deco_tail = de2; - de2->s = de->s; - de2->t = t; - de2->defl = DEF_NOEN; - de2->flags = DE_LDEN; - de2->x = realwidth - 6; - de2->y = de->s->y; - } - de2->start = de; - de2->defl &= ~DEF_NOST; - } f = dd->func; - if (f < 3 || f >= 6) - continue; /* not tied to the note */ - if (f == 4) - de->flags |= DE_BELOW; + if (!(f_note & (1 << f)) /* if not tied to the note */ + || de->m >= 0) /* or head decoration */ + continue; +// if (f == 4) +// de->flags |= DE_BELOW; func_tb[f](de); } } +/* draw the repeat brackets */ +static void draw_repbra(struct VOICE_S *p_voice) +{ + struct SYMBOL *s, *s1, *s2, *first_repeat; + int i; + float x, y, y2, w; + + /* search the max y offset */ + y = staff_tb[p_voice->staff].topbar + 6 + 20; + first_repeat = 0; + for (s = p_voice->sym->next; s; s = s->next) { + if (s->type != BAR) + continue; + if (!(s->sflags & S_RBSTART) + || (s->sflags & S_NOREPBRA)) + continue; +/*fixme: line cut on repeat!*/ + if (!s->next) + break; + if (!first_repeat) + first_repeat = s; + s1 = s; + for (;;) { + if (!s->next) + break; + s = s->next; + if (s->sflags & S_RBSTOP) + break; + } + y2 = y_get(p_voice->staff, 1, s1->x, s->x - s1->x); + if (y < y2) + y = y2; + + /* have room for the repeat numbers */ + if (s1->gch) { + w = s1->gch->w; + y2 = y_get(p_voice->staff, 1, s1->x + 4, w); + y2 += cfmt.font_tb[REPEATFONT].size + 2; + if (y < y2) + y = y2; + } + if (s->sflags & S_RBSTART) + s = s->prev; + } + + /* draw the repeat indications */ + s = first_repeat; + if (!s) + return; +// set_sscale(p_voice->staff); +//temporary + set_sscale(-1); + set_font(REPEATFONT); + for ( ; s; s = s->next) { + char *p; + + if (!(s->sflags & S_RBSTART) + || (s->sflags & S_NOREPBRA)) + continue; + s1 = s; + for (;;) { + if (!s->next) + break; + s = s->next; + if (s->sflags & S_RBSTOP) + break; + } + s2 = s; + if (s1 == s2) + break; + x = s1->x; + if ((s1->u.bar.type & 0x0f) == B_COL) + x -= 4; + if (s2->type != BAR) { + if (s2->sflags & S_RBSTOP) + w = 0; + else + w = s2->x - realwidth + 4; + } else if (((s2->u.bar.type & 0xf0) /* if complex bar */ + && s2->u.bar.type != (B_OBRA | B_CBRA)) + || s2->u.bar.type == B_CBRA) { + if (s2->u.bar.type == B_CBRA) + s2->flags |= ABC_F_INVIS; +/*fixme:%%staves: cursys moved?*/ + if (s1->staff > 0 + && !(cursys->staff[s1->staff - 1].flags & STOP_BAR)) + w = s2->wl; + else if ((s2->u.bar.type & 0x0f) == B_COL) + w = 12; + else if (!(s2->sflags & S_RRBAR)) +// || s2->u.bar.type == B_CBRA) + w = 0; /* explicit repeat end */ + else + w = 8; + } else { + w = (s2->sflags & S_RBSTOP) ? 0 : 8; + } + w = s2->x - x - w; + p = s1->text; + if (!p) + p = ""; + if (!s2->next /* 2nd ending at end of line */ + && !(s2->sflags & S_RBSTOP) + && (p_voice->bar_start == 0)) { + p_voice->bar_start = B_OBRA | 0x1000; /* S_RBSTART */ + p_voice->bar_repeat = 1; /* continue on next line */ + } + if (s1->flags & ABC_F_RBSTART) + i = (s2->flags & ABC_F_RBSTOP) ? 3 : 1; + else + i = (s2->flags & ABC_F_RBSTOP) ? 2 : 0; + a2b("(%s)-%.1f %d ", + p, cfmt.font_tb[REPEATFONT].size * 0.8 + 1, i); + putx(w); + putxy(x, y * staff_tb[s1->staff].staffscale); + a2b("yns%d repbra\n", s1->staff); + y_set(s1->staff, 1, x, w, y + 2); + if (s->u.bar.repeat_bar) + s = s->prev; + } +} + /* -- draw the music elements tied to the staff -- */ /* (the staves are not yet defined) */ void draw_deco_staff(void) { struct SYMBOL *s, *first_gchord; struct VOICE_S *p_voice; - float x, y, w; + float y, w; struct deco_elt *de; struct { float ymin, ymax; @@ -1483,28 +1857,27 @@ memset(minmax, 0, sizeof minmax); first_gchord = 0; for (s = tsfirst; s; s = s->ts_next) { - struct gch *gch; - int ix, ig; + struct gch *gch, *gch2; + int ix; gch = s->gch; if (!gch) continue; if (!first_gchord) first_gchord = s; - ig = -1; + gch2 = NULL; for (ix = 0; ix < MAXGCH; ix++, gch++) { if (gch->type == '\0') break; if (gch->type != 'g') continue; - ig = ix; /* guitar chord closest to the staff */ + gch2 = gch; /* guitar chord closest to the staff */ if (gch->y < 0) break; } - if (ig >= 0) { - gch = s->gch + ig; - w = gch->w; - if (gch->y >= 0) { + if (gch2) { + w = gch2->w; + if (gch2->y >= 0) { y = y_get(s->staff, 1, s->x, w); if (y > minmax[s->staff].ymax) minmax[s->staff].ymax = y; @@ -1524,13 +1897,11 @@ int top, bot; bot = staff_tb[i].botbar; - minmax[i].ymin -= 3; - if (minmax[i].ymin > bot - 10) - minmax[i].ymin = bot -10; + if (minmax[i].ymin > bot - 6) + minmax[i].ymin = bot - 6; top = staff_tb[i].topbar; - minmax[i].ymax += 3; - if (minmax[i].ymax < top + 10) - minmax[i].ymax = top + 10; + if (minmax[i].ymax < top + 6) + minmax[i].ymax = top + 6; } set_sscale(-1); /* restore the scale parameters */ for (s = first_gchord; s; s = s->ts_next) { @@ -1542,7 +1913,7 @@ case MREST: break; case BAR: - if (!s->as.u.bar.repeat_bar) + if (!s->u.bar.repeat_bar) break; default: continue; @@ -1554,166 +1925,9 @@ /* draw the repeat brackets */ for (p_voice = first_voice; p_voice; p_voice = p_voice->next) { - struct SYMBOL *s1, *s2, *first_repeat; - float y2; - int i, repnl; - if (p_voice->second || !p_voice->sym) continue; - - /* search the max y offset and set the end of bracket */ - y = staff_tb[p_voice->staff].topbar + 6 + 20; - first_repeat = 0; - for (s = p_voice->sym->next; s; s = s->next) { - if (s->type != BAR - || !s->as.u.bar.repeat_bar - || (s->sflags & S_NOREPBRA)) - continue; -/*fixme: line cut on repeat!*/ - if (!s->next) - break; - if (!first_repeat) { - set_font(REPEATFONT); - first_repeat = s; - } - s1 = s; - - /* a bracket may be 4 measures - * but only 2 measures when it has no start */ - i = s1->as.text ? 4 : 2; - for (;;) { - if (!s->next) - break; - s = s->next; - if (s->sflags & S_RBSTOP) - break; - if (s->type != BAR) - continue; - if (((s->as.u.bar.type & 0xf0) /* if complex bar */ - && s->as.u.bar.type != (B_OBRA << 4) + B_CBRA) - || s->as.u.bar.type == B_CBRA - || s->as.u.bar.repeat_bar) - break; - if (--i <= 0) { - - /* have a shorter repeat bracket */ - s = s1; - i = 2; - for (;;) { - s = s->next; - if (s->type != BAR) - continue; - if (--i <= 0) - break; - } - s->sflags |= S_RBSTOP; - break; - } - } - y2 = y_get(p_voice->staff, 1, s1->x, s->x - s1->x); - if (y < y2) - y = y2; - - /* have room for the repeat numbers */ - if (s1->gch) { - w = s1->gch->w; - y2 = y_get(p_voice->staff, 1, s1->x + 4, w); - y2 += cfmt.font_tb[REPEATFONT].size + 2; - if (y < y2) - y = y2; - } - if (s->as.u.bar.repeat_bar) - s = s->prev; - } - - /* draw the repeat indications */ - s = first_repeat; - if (!s) - continue; - set_sscale(p_voice->staff); - repnl = 0; - for ( ; s; s = s->next) { - char *p; - - if (s->type != BAR - || !s->as.u.bar.repeat_bar - || (s->sflags & S_NOREPBRA)) - continue; - s1 = s; - for (;;) { - if (!s->next) - break; - s = s->next; - if (s->sflags & S_RBSTOP) - break; - if (s->type != BAR) - continue; - if (((s->as.u.bar.type & 0xf0) /* if complex bar */ - && s->as.u.bar.type != (B_OBRA << 4) + B_CBRA) - || s->as.u.bar.type == B_CBRA - || s->as.u.bar.repeat_bar) - break; - } - s2 = s; - if (s1 == s2) - break; - x = s1->x; - if ((s1->as.u.bar.type & 0x07) == B_COL) - x -= 4; - i = 0; /* no bracket end */ - if (s2->sflags & S_RBSTOP) { - w = 8; /* (w = left shift) */ - } else if (s2->type != BAR) { - w = s2->x - realwidth + 4; - } else if (((s2->as.u.bar.type & 0xf0) /* if complex bar */ - && s2->as.u.bar.type != (B_OBRA << 4) + B_CBRA) - || s2->as.u.bar.type == B_CBRA) { - i = 2; /* bracket start and stop */ -/*fixme:%%staves: cursys moved?*/ - if (s->staff > 0 - && !(cursys->staff[s->staff - 1].flags & STOP_BAR)) { - w = s2->wl; - } else if ((s2->as.u.bar.type & 0x0f) == B_COL) { - w = 12; - } else if (!(s2->sflags & S_RRBAR) - || s2->as.u.bar.type == B_CBRA) { - w = 0; /* explicit repeat end */ - - /* if ']', don't display as thick bar */ - if (s2->as.u.bar.type == B_CBRA) - s2->as.flags |= ABC_F_INVIS; - } else { - w = 8; - } - } else { - w = 8; - } - w = s2->x - x - w; - p = s1->as.text; - if (!p) { - i--; /* no bracket start (1) or not drawn */ - p = ""; - } - if (i == 0 && !s2->next /* 2nd ending at end of line */ - && !(s2->sflags & S_RBSTOP)) { - if (p_voice->bar_start == 0) - repnl = 1; /* continue on next line */ - } - if (i >= 0) { - a2b("(%s)-%.1f %d ", - p, cfmt.font_tb[REPEATFONT].size * 0.8 + 1, i); - putx(w); - putxy(x, y); - a2b("y%d repbra\n", s1->staff); - y_set(s1->staff, 1, x, w, y + 2); - } - if (s->as.u.bar.repeat_bar) - s = s->prev; - } - if (repnl) { - p_voice->bar_start = B_OBRA; - p_voice->bar_repeat = 1; - } + draw_repbra(p_voice); } /* create the decorations tied to the staves */ @@ -1722,7 +1936,8 @@ struct deco_def_s *dd; dd = &deco_def_tb[de->t]; - if (dd->func < 6) /* if not tied to the staff */ + if (!(f_staff & (1 << dd->func)) /* if not tied to the staff */ + || de->m >= 0) /* or chord decoration */ continue; func_tb[dd->func](de); if (dd->ps_func < 0) @@ -1744,7 +1959,7 @@ dd = &deco_def_tb[de->t]; if (dd->ps_func < 0 - || dd->func < 6) + || !(f_staff & (1 << dd->func))) continue; if (cfmt.dynalign) { if (de->flags & DE_UP) @@ -1757,7 +1972,7 @@ } if (de->flags & DE_UP) y += dd->h; - y_set(de->staff, de->flags & DE_UP, de->x, de->v, y); + y_set(de->staff, de->flags & DE_UP, de->x, de->val, y); } } @@ -1766,10 +1981,10 @@ static void draw_gchord(struct SYMBOL *s, float gchy_min, float gchy_max) { - struct gch *gch; - int action, ix, ig, box; + struct gch *gch, *gch2; + int action, ix, box, yav; float x, y, w, h, y_above, y_below; - float hbox, xboxh, xboxl, yboxh, yboxl, expdx; + float hbox, xboxl, yboxh, yboxl, expdx; /* adjust the vertical offset according to the guitar chords */ //fixme: w may be too small @@ -1781,19 +1996,19 @@ y_above = y_get(s->staff, 1, s->x - 2, w) + 2; y_below = y_get(s->staff, 0, s->x - 2, w) - 2; #endif - ig = -1; + gch2 = NULL; + yav = ((s->pits[s->nhd] + s->pits[0]) / 2 - 18) * 3; for (ix = 0, gch = s->gch; ix < MAXGCH; ix++, gch++) { if (gch->type == '\0') break; if (gch->type != 'g') continue; - ig = ix; /* index of guitar chord closest to the staff */ + gch2 = gch; /* guitar chord closest to the staff */ if (gch->y < 0) break; } - if (ig >= 0) { - gch = s->gch + ig; - if (gch->y >= 0) { + if (gch2) { + if (gch2->y >= 0) { if (y_above < gchy_max) y_above = gchy_max; } else { @@ -1804,9 +2019,11 @@ str_font(s->gch->font); set_font(s->gch->font); /* needed if scaled staff */ - set_sscale(s->staff); - action = A_GCHORD; - xboxh = xboxl = s->x; +// set_sscale(s->staff); +//temporary + set_sscale(-1); +// action = A_GCHORD; + xboxl = s->x; yboxh = -100; yboxl = 100; box = 0; @@ -1816,7 +2033,8 @@ break; h = cfmt.font_tb[gch->font].size; str_font(gch->font); - w = tex_str(s->as.text + gch->idx); + tex_str(s->text + gch->idx); + w = gch->w; if (gch->type == 'g') { /* guitar chord */ if (!strchr(tex_buf, '\t')) { action = A_GCHORD; @@ -1877,9 +2095,6 @@ if (gch->box) { if (xboxl > x) xboxl = x; - w += x; - if (xboxh < w) - xboxh = w; if (yboxl > y) yboxl = y; if (yboxh < y + h) @@ -1889,42 +2104,40 @@ break; case '<': /* left */ /*fixme: what symbol space?*/ - if (s->as.u.note.accs[0]) - x -= s->shac[0]; - y = s->yav + gch->y; + if (s->u.note.notes[0].acc) + x -= s->u.note.notes[0].shac; + y = yav + gch->y; break; case '>': /* right */ x += s->xmx; if (s->dots > 0) x += 1.5 + 3.5 * s->dots; - y = s->yav + gch->y; + y = yav + gch->y; break; case '@': /* absolute */ - y = s->yav + gch->y; + y = yav + gch->y; break; } - putxy(x, y + h * 0.2); /* (descent) */ - a2b("y%d M ", s->staff); + putxy(x, (y + h * 0.2) * /* (descent) */ + staff_tb[s->staff].staffscale); + a2b("yns%d M ", s->staff); if (action == A_GCHEXP) a2b("%.2f ", expdx); str_out(tex_buf, action); - if (gch->type == 'g' && box > 0) - a2b(" boxstart"); + if (gch->type == 'g' && box > 0) { + if (box == 1) + a2b(" boxend"); + else + a2b(" boxmark"); + } a2b("\n"); } - /* draw the box of the guitar chords */ - if (xboxh != xboxl) { /* if any normal guitar chord */ + /* draw the box around the guitar chords */ + if (box) { xboxl -= 2; - w = xboxh - xboxl + 2; - putxy(xboxl, yboxl - 2); -#if 1 - a2b("y%d %.1f boxdraw\n", - s->staff, yboxh - yboxl + 3); -#else - a2b("y%d %.1f %.1f box\n", - s->staff, w, yboxh - yboxl + 3); -#endif + putxy(xboxl, (yboxl - 1) * staff_tb[s->staff].staffscale); + a2b("yns%d %.1f boxdraw\n", s->staff, yboxh - yboxl + 3); } } @@ -1953,7 +2166,7 @@ /* leave the measure numbers as unscaled */ font_size = cfmt.font_tb[MEASUREFONT].size; - cfmt.font_tb[MEASUREFONT].size /= staff_tb[staff].clef.staffscale; + cfmt.font_tb[MEASUREFONT].size /= staff_tb[staff].staffscale; s = tsfirst; /* clef */ bar_num = nbar; @@ -1963,8 +2176,6 @@ any_nb = 1; x = 0; w = 20; -// while (s->staff != staff) -// s = s->ts_next; y = y_get(staff, 1, x, w); if (y < staff_tb[staff].topbar + 14) y = staff_tb[staff].topbar + 14; @@ -1984,14 +2195,12 @@ } break; } -// while (s->staff != staff) -// s = s->ts_next; - if (s->prev->type != CLEF) + if (s->prev && s->prev->type != CLEF) s = s->prev; x = s->x - s->wl; set_font(MEASUREFONT); any_nb = 1; - w = cwid('0') * cfmt.font_tb[MEASUREFONT].size; + w = cwid('0') * cfmt.font_tb[MEASUREFONT].swfac; if (bar_num >= 10) { if (bar_num >= 100) w *= 3; @@ -2013,34 +2222,26 @@ } for ( ; s; s = s->ts_next) { - switch (s->type) { - case STAVES: + if (s->sflags & S_NEW_SY) { sy = sy->next; for (staff = 0; staff < nstaff; staff++) { if (!sy->staff[staff].empty) break; } set_sscale(staff); - continue; - default: - continue; - case BAR: - break; } - if (s->u <= 0) + if (s->type != BAR || s->aux <= 0) continue; - bar_num = s->u; + bar_num = s->aux; if (cfmt.measurenb == 0 || (bar_num % cfmt.measurenb) != 0 || !s->next) continue; -// while (s->staff != staff) -// s = s->ts_next; if (!any_nb) { any_nb = 1; set_font(MEASUREFONT); } - w = cwid('0') * cfmt.font_tb[MEASUREFONT].size; + w = cwid('0') * cfmt.font_tb[MEASUREFONT].swfac; if (bar_num >= 10) { if (bar_num >= 100) w *= 3; @@ -2053,7 +2254,7 @@ y = y_get(staff, 1, x, w); if (y < staff_tb[staff].topbar + 6) y = staff_tb[staff].topbar + 6; - if (s->next->as.type == ABC_T_NOTE) { + if (s->next->abc_type == ABC_T_NOTE) { if (s->next->stem > 0) { if (y < s->next->ys - cfmt.font_tb[MEASUREFONT].size) y = s->next->ys - cfmt.font_tb[MEASUREFONT].size; @@ -2156,21 +2357,23 @@ float w; w = 0; - if (s->as.u.tempo.str1) - w += tex_str(s->as.u.tempo.str1); - if (s->as.u.tempo.value != 0) { + if (s->u.tempo.str1) + w += tex_str(s->u.tempo.str1); + if (s->u.tempo.beats[0] != 0) { + if (s->u.tempo.circa) + w += tex_str("ca. "); i = 1; - while (i < sizeof s->as.u.tempo.length - / sizeof s->as.u.tempo.length[0] - && s->as.u.tempo.length[i] > 0) { + while (i < sizeof s->u.tempo.beats + / sizeof s->u.tempo.beats[0] + && s->u.tempo.beats[i] != 0) { w += 10; i++; } - w += 6 + cwid(' ') * cfmt.font_tb[TEMPOFONT].size * 6 + w += 6 + cwid(' ') * cfmt.font_tb[TEMPOFONT].swfac * 6 + 10 + 10; } - if (s->as.u.tempo.str2) - w += tex_str(s->as.u.tempo.str2); + if (s->u.tempo.str2) + w += tex_str(s->u.tempo.str2); return w; } @@ -2179,35 +2382,33 @@ int beat, float sc) { - int top, bot; - unsigned j; + unsigned i; + char tmp[16]; - if (s->as.u.tempo.str1) - put_str(s->as.u.tempo.str1, A_LEFT); - if (s->as.u.tempo.value != 0) { + if (s->u.tempo.str1) + put_str(s->u.tempo.str1, A_LEFT); + if (s->u.tempo.beats[0] != 0) { sc *= 0.7 * cfmt.font_tb[TEMPOFONT].size / 15.0; /*fixme: 15.0 = initial tempofont*/ - if (s->as.u.tempo.length[0] == 0) { - if (beat == 0) - beat = get_beat(&voice_tb[cursys->top_voice].meter); - s->as.u.tempo.length[0] = beat; - } - for (j = 0; - j < sizeof s->as.u.tempo.length - / sizeof s->as.u.tempo.length[0] - && s->as.u.tempo.length[j] > 0; - j++) { - draw_notempo(s, s->as.u.tempo.length[j], sc); + for (i = 0; + i < sizeof s->u.tempo.beats + / sizeof s->u.tempo.beats[0] + && s->u.tempo.beats[i] != 0; + i++) { + draw_notempo(s, s->u.tempo.beats[i], sc); } put_str("= ", A_LEFT); - if (sscanf(s->as.u.tempo.value, "%d/%d", &top, &bot) == 2 - && bot > 0) - draw_notempo(s, top * BASE_LEN / bot, sc); - else - put_str(s->as.u.tempo.value, A_LEFT); + if (s->u.tempo.tempo != 0) { + if (s->u.tempo.circa) + put_str("ca. ", A_LEFT); + snprintf(tmp, sizeof tmp, "%d", s->u.tempo.tempo); + put_str(tmp, A_LEFT); + } else { + draw_notempo(s, s->u.tempo.new_beat, sc); + } } - if (s->as.u.tempo.str2) - put_str(s->as.u.tempo.str2, A_LEFT); + if (s->u.tempo.str2) + put_str(s->u.tempo.str2, A_LEFT); } /* -- draw the parts and the tempo information -- */ @@ -2267,10 +2468,10 @@ if (!(s->sflags & S_SEQST)) continue; if (s->type == TIMESIG) - beat = get_beat(&s->as.u.meter); + beat = get_beat(&s->u.meter); g = s->extra; - if (!g) - continue; +// if (!g) +// continue; for ( ; g; g = g->next) if (g->type == TEMPO) break; @@ -2299,18 +2500,18 @@ continue; if (!some_part) { some_part = 1; - h = cfmt.font_tb[PARTSFONT].size + 2 + 2; - /* + cfmt.partsspace; ?? */ str_font(PARTSFONT); } - w = tex_str(&g->as.text[2]); - y = y_get(staff, 1, s->x - 10, w + 15) + 5; + w = tex_str(&g->text[2]); + y = y_get(staff, 1, s->x - 10, w + 3) + 5; if (ymin < y) ymin = y; } if (!some_part) goto out; + h = cfmt.font_tb[PARTSFONT].size + 2 + 2; + /* + cfmt.partsspace; ?? */ if (top < ymin + h + ht) dy = ymin + h + ht - top; @@ -2324,45 +2525,62 @@ break; if (!g) continue; - w = tex_str(&g->as.text[2]); +// w = tex_str(&g->text[2]); a2b("%.1f %.1f M", s->x - 10, 2 - ht - h); + tex_str(&g->text[2]); str_out(tex_buf, A_LEFT); if (cfmt.partsbox) - a2b(" %.1f %.1f %.1f %.1f box", - s->x - 10 - 2, 2 - ht - h - 4, - w + 4, h); + a2b(" %.1f %.1f %.1f boxend boxdraw", + s->x - 10 - 2, 2 - ht - h - 4, h); +// a2b(" %.1f %.1f %.1f %.1f box", +// s->x - 10 - 2, 2 - ht - h - 4, +// w + 4, h); a2b("\n"); } out: - return dy * staff_tb[staff].clef.staffscale; + return dy; } /* -- initialize the default decorations -- */ -void reset_deco(void) +void init_deco(void) { memset(&deco, 0, sizeof deco); /* standard */ - deco['.'] = deco_define("dot"); + deco['.'] = "dot"; #ifdef DECO_IS_ROLL - deco['~'] = deco_define("roll"); + deco['~'] = "roll"; #endif - deco['H'] = deco_define("fermata"); - deco['L'] = deco_define("emphasis"); - deco['M'] = deco_define("lowermordent"); - deco['O'] = deco_define("coda"); - deco['P'] = deco_define("uppermordent"); - deco['S'] = deco_define("segno"); - deco['T'] = deco_define("trill"); - deco['u'] = deco_define("upbow"); - deco['v'] = deco_define("downbow"); + deco['H'] = "fermata"; + deco['L'] = "emphasis"; + deco['M'] = "lowermordent"; + deco['O'] = "coda"; + deco['P'] = "uppermordent"; + deco['S'] = "segno"; + deco['T'] = "trill"; + deco['u'] = "upbow"; + deco['v'] = "downbow"; /* non-standard */ #ifndef DECO_IS_ROLL - deco['~'] = deco_define("gmark"); + deco['~'] = "gmark"; #endif - deco['J'] = deco_define("slide"); - deco['R'] = deco_define("roll"); + deco['J'] = "slide"; + deco['R'] = "roll"; +} + +/* reset the decoration table at start of a new tune */ +void reset_deco(void) +{ +// struct deco_def_s *dd; +// int ideco; +// +// for (ideco = 1, dd = &deco_def_tb[1]; ideco < 128; ideco++, dd++) { +// if (!dd->name) +// break; +// free(dd->name); +// } + memset(deco_def_tb, 0, sizeof deco_def_tb); } /* -- set the decoration flags -- */ diff -Nru abcm2ps-7.8.9/draw.c abcm2ps-8.14.2/draw.c --- abcm2ps-7.8.9/draw.c 2014-10-12 06:49:36.000000000 +0000 +++ abcm2ps-8.14.2/draw.c 2018-12-18 15:18:26.000000000 +0000 @@ -3,29 +3,20 @@ * * This file is part of abcm2ps. * - * Copyright (C) 1998-2014 Jean-François Moine + * Copyright (C) 1998-2017 Jean-François Moine * Adapted from abc2ps, Copyright (C) 1996,1997 Michael Methfessel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #include #include #include -#include "abc2ps.h" +#include "abcm2ps.h" struct BEAM { /* packages info on one beam */ struct SYMBOL *s1, *s2; @@ -40,20 +31,36 @@ static float cur_scale = 1; /* voice or staff scale */ static float cur_trans = 0; /* != 0 when scaled staff */ static float cur_staff = 1; /* current scaled staff */ +static int cur_color = 0; /* current color */ static void draw_note(float x, struct SYMBOL *s, int fl); static void set_tie_room(void); +// set the symbol color + + +/* set the voice color */ +void set_color(int new_color) +{ + if (new_color == cur_color) + return; + cur_color = new_color; + a2b("%.2f %.2f %.2f setrgbcolor ", + (float) (cur_color >> 16) / 255, + (float) ((cur_color >> 8) & 0xff) / 255, + (float) (cur_color & 0xff) / 255); +} + /* output debug annotations */ static void anno_out(struct SYMBOL *s, char type) { - if (s->as.linenum == 0) + if (s->linenum == 0) return; if (mbf[-1] != '\n') *mbf++ = '\n'; - a2b("%%A %c %d %d ", type, s->as.linenum, s->as.colnum); + a2b("%%A %c %d %d ", type, s->linenum, s->colnum); putxy(s->x - s->wl - 2, staff_tb[s->staff].y + s->ymn - 2); if (type != 'b' && type != 'e') /* if not beam */ a2b("%.1f %d", s->wl + s->wr + 4, s->ymx - s->ymn + 4); @@ -78,8 +85,8 @@ float d1, d2, shift, depth; float top, bot; - shift = !grace ? BEAM_SHIFT : 3; - depth = !grace ? BEAM_DEPTH : 1.7; + shift = !grace ? BEAM_SHIFT : 3.5; + depth = !grace ? BEAM_DEPTH : 1.8; if (stem > 0) { bot = b - (flags - 1) * shift - depth; if (bot > 26) @@ -103,14 +110,16 @@ static struct SYMBOL *sym_dup(struct SYMBOL *s_orig) { struct SYMBOL *s; + int m; s = (struct SYMBOL *) getarena(sizeof *s); memcpy(s, s_orig, sizeof *s); - s->as.flags |= ABC_F_INVIS; - s->as.text = NULL; - memset(s->as.u.note.sl1, 0, sizeof s->as.u.note.sl1); - memset(s->as.u.note.decs, 0, sizeof s->as.u.note.decs); - memset(&s->as.u.note.dc, 0, sizeof s->as.u.note.dc); + s->flags |= ABC_F_INVIS; + s->text = NULL; + for (m = 0; m <= s->nhd; m++) + s->u.note.notes[m].sl1 = 0; + memset(&s->u.note.dc, 0, sizeof s->u.note.dc); + s->gch = NULL; s->ly = NULL; return s; @@ -122,7 +131,7 @@ struct SYMBOL *s1) { struct SYMBOL *s, *s2; - int notes, nflags, staff, voice, two_staves, two_dir; + int notes, nflags, staff, voice, two_staves, two_dir, visible = 0; float x, y, ys, a, b, max_stem_err; float sx, sy, sxx, sxy, syy, a0, stem_xoff, scale; static float min_tb[2][6] = { @@ -132,30 +141,38 @@ STEM_CH_MIN2, STEM_CH_MIN3, STEM_CH_MIN4, STEM_CH_MIN4} }; - /* must have one printed note head */ - if (s1->as.flags & ABC_F_INVIS) { - if (!s1->next - || (s1->next->as.flags & ABC_F_INVIS)) - return 0; - } - if (!(s1->sflags & S_BEAM_ST)) { /* beam from previous music line */ s = sym_dup(s1); - s1->prev->next = s; s->prev = s1->prev; + if (s->prev) + s->prev->next = s; + else + voice_tb[s->voice].sym = s; s1->prev = s; s->next = s1; - s1->ts_prev->ts_next = s; s->ts_prev = s1->ts_prev; +// if (s->ts_prev) + s->ts_prev->ts_next = s; s1->ts_prev = s; s->ts_next = s1; + for (s2 = s->ts_prev; /*s2*/; s2 = s2->ts_prev) { + switch (s2->type) { + default: + continue; + case CLEF: + case KEYSIG: + case TIMESIG: + break; + } + break; + } s->x -= 12; - if (s->x > s1->prev->x + 12) - s->x = s1->prev->x + 12; + if (s->x > s2->x + 12) + s->x = s2->x + 12; s->sflags &= S_SEQST; s->sflags |= S_BEAM_ST | S_TEMP; - s->as.u.note.slur_st = 0; - s->as.u.note.slur_end = 0; + s->u.note.slur_st = 0; + s->u.note.slur_end = 0; s1 = s; } @@ -164,9 +181,9 @@ two_staves = two_dir = 0; staff = s1->staff; voice = s1->voice; - stem_xoff = (s1->as.flags & ABC_F_GRACE) ? GSTEM_XOFF : STEM_XOFF; + stem_xoff = (s1->flags & ABC_F_GRACE) ? GSTEM_XOFF : s1->u.note.sdx; for (s2 = s1; ; s2 = s2->next) { - if (s2->as.type == ABC_T_NOTE) { + if (s2->abc_type == ABC_T_NOTE) { if (s2->nflags > nflags) nflags = s2->nflags; notes++; @@ -174,12 +191,17 @@ two_staves = 1; if (s2->stem != s1->stem) two_dir = 1; + if (!visible + && !(s2->flags & ABC_F_INVIS) + && (!(s2->flags & ABC_F_STEMLESS) + || (s2->sflags & S_TREM2))) + visible = 1; if (s2->sflags & S_BEAM_END) break; } if (!s2->next) { /* beam towards next music line */ for (; ; s2 = s2->prev) { - if (s2->as.type == ABC_T_NOTE) + if (s2->abc_type == ABC_T_NOTE) break; } s = sym_dup(s2); @@ -195,8 +217,8 @@ s->ts_prev = s2; s->sflags &= S_SEQST; s->sflags |= S_BEAM_END | S_TEMP; - s->as.u.note.slur_st = 0; - s->as.u.note.slur_end = 0; + s->u.note.slur_st = 0; + s->u.note.slur_end = 0; s->x += 12; if (s->x < realwidth - 12) s->x = realwidth - 12; @@ -205,13 +227,18 @@ break; } } + if (!visible) + return 0; + bm->s2 = s2; /* (don't display the flags) */ if (staff_tb[staff].y == 0) { /* staves not defined */ if (two_staves) return 0; } else { /* staves defined */ - if (!two_staves && !(s1->as.flags & ABC_F_GRACE)) { + if (!two_staves) { bm->s1 = s1; /* beam already calculated */ +if (s1->xs == s2->xs) + bug("beam with null length", 1); bm->a = (s1->ys- s2->ys) / (s1->xs - s2->xs); bm->b = s1->ys - s1->xs * bm->a + staff_tb[staff].y; @@ -222,14 +249,14 @@ sx = sy = sxx = sxy = syy = 0; /* linear fit through stem ends */ for (s = s1; ; s = s->next) { - if (s->as.type != ABC_T_NOTE) + if (s->abc_type != ABC_T_NOTE) continue; if ((scale = voice_tb[s->voice].scale) == 1) - scale = staff_tb[s->staff].clef.staffscale; + scale = staff_tb[s->staff].staffscale; if (s->stem >= 0) - x = stem_xoff + s->shhd[0]; + x = stem_xoff + s->u.note.notes[0].shhd; else - x = -stem_xoff + s->shhd[s->nhd]; + x = -stem_xoff + s->u.note.notes[s->nhd].shhd; x *= scale; x += s->x; s->xs = x; @@ -245,7 +272,7 @@ b = (sy - a * sx) / notes; /* the next few lines modify the slope of the beam */ - if (!(s1->as.flags & ABC_F_GRACE)) { + if (!(s1->flags & ABC_F_GRACE)) { if (notes >= 3) { float hh; @@ -271,18 +298,19 @@ if (a0 * a0 < BEAM_THRESH * BEAM_THRESH) a = 0; /* flat below threshhold */ - b = (sy - a * sx) / notes; /* recalculate b for new slope */ +// b = (sy - a * sx) / notes; /* recalculate b for new slope */ /* if (nflags>1) b=b+2*stem;*/ /* leave a bit more room if several beams */ /* have flat beams when asked */ if (cfmt.flatbeams) { - if (!(s1->as.flags & ABC_F_GRACE)) - b = -11 + staff_tb[staff].y; - else - b = 35 + staff_tb[staff].y; +// if (!(s1->flags & ABC_F_GRACE)) +// b = -11 + staff_tb[staff].y; +// else +// b = 35 + staff_tb[staff].y; a = 0; } + b = (sy - a * sx) / notes; /* recalculate b for new slope */ /*fixme: have a look again*/ /* have room for the symbols in the staff */ @@ -290,10 +318,10 @@ s = s1; if (two_dir) { /* 2 directions */ /*fixme: more to do*/ - if (!(s1->as.flags & ABC_F_GRACE)) + if (!(s1->flags & ABC_F_GRACE)) ys = BEAM_SHIFT; else - ys = 3; + ys = 3.5; ys *= (nflags - 1); ys += BEAM_DEPTH; ys *= .5; @@ -302,18 +330,18 @@ else ys *= s1->stem; b += ys; - } else if (!(s1->as.flags & ABC_F_GRACE)) { /* normal notes */ + } else if (!(s1->flags & ABC_F_GRACE)) { /* normal notes */ float stem_err, beam_h; beam_h = BEAM_DEPTH + BEAM_SHIFT * (nflags - 1); - while (s->ts_prev->as.type == ABC_T_NOTE + while (s->ts_prev->abc_type == ABC_T_NOTE && s->ts_prev->time == s->time && s->ts_prev->x > s1->xs) s = s->ts_prev; for (; s && s->time <= s2->time; s = s->ts_next) { - if (s->as.type != ABC_T_NOTE - || (s->as.flags & ABC_F_INVIS) + if (s->abc_type != ABC_T_NOTE + || (s->flags & ABC_F_INVIS) || (s->staff != staff && s->voice != voice)) { continue; @@ -331,14 +359,16 @@ if (s->pits[s->nhd] > 28) stem_err -= 2; } - stem_err -= ys - (float) (3 * (s->pits[s->nhd] - 18)); + stem_err -= ys - (float) (3 * + (s->pits[s->nhd] - 18)); } else { if (s->pits[0] < 18) { stem_err -= 2; if (s->pits[0] < 16) stem_err -= 2; } - stem_err -= (float) (3 * (s->pits[0] - 18)) - ys; + stem_err -= (float) (3 * + (s->pits[0] - 18)) - ys; } stem_err += BEAM_DEPTH + BEAM_SHIFT * (s->nflags - 1); } else { @@ -381,9 +411,11 @@ ys = a * s->xs + b - staff_tb[s->staff].y; stem_err = GSTEM - 2; if (s->stem > 0) - stem_err -= ys - (float) (3 * (s->pits[s->nhd] - 18)); + stem_err -= ys - (float) (3 * + (s->pits[s->nhd] - 18)); else - stem_err += ys - (float) (3 * (s->pits[0] - 18)); + stem_err += ys - (float) (3 * + (s->pits[0] - 18)); stem_err += 3 * (s->nflags - 1); if (stem_err > max_stem_err) max_stem_err = stem_err; @@ -403,7 +435,7 @@ switch (s->type) { case NOTEREST: /* cannot move rests in multi-voices */ - if (s->as.type != ABC_T_REST) + if (s->abc_type != ABC_T_REST) break; g = s->ts_next; if (!g || g->staff != staff @@ -414,10 +446,10 @@ /*fall thru*/ case BAR: #if 1 - if (s->as.flags & ABC_F_INVIS) + if (s->flags & ABC_F_INVIS) #else //?? - if (!(s->as.flags & ABC_F_INVIS)) + if (!(s->flags & ABC_F_INVIS)) #endif break; /*fall thru*/ @@ -464,28 +496,30 @@ } if (a == 0) /* shift flat beams onto staff lines */ - b += b_pos(s1->as.flags & ABC_F_GRACE, s1->stem, nflags, + b += b_pos(s1->flags & ABC_F_GRACE, s1->stem, nflags, b - staff_tb[staff].y); /* adjust final stems and rests under beam */ for (s = s1; ; s = s->next) { float dy; - switch (s->as.type) { + switch (s->abc_type) { case ABC_T_NOTE: s->ys = a * s->xs + b - staff_tb[s->staff].y; if (s->stem > 0) { s->ymx = s->ys + 2.5; +#if 0 //fixme: hack if (s->ts_prev && s->ts_prev->stem > 0 && s->ts_prev->staff == s->staff && s->ts_prev->ymn < s->ymx && s->ts_prev->x == s->x - && s->shhd[0] == 0) { + && s->u.note.notes[0].shhd == 0) { s->ts_prev->x -= 5; /* fix stem clash */ s->ts_prev->xs -= 5; } +#endif } else { s->ymn = s->ys - 2.5; } @@ -543,8 +577,8 @@ float y1, dy2; s = bm->s1; - if (n > s->nflags - s->u - && (s->sflags & S_TREM2) && s->head != H_EMPTY) { + if ((s->sflags & S_TREM2) && n > s->nflags - s->aux + && s->head != H_EMPTY) { if (s->head >= H_OVAL) { x1 = s->x + 6; x2 = bm->s2->x - 6; @@ -575,18 +609,19 @@ s1 = bm->s1; /*fixme: KO if many staves with different scales*/ - set_scale(s1); +//fixme: useless? +// set_scale(s1); s2 = bm->s2; - if (!(s1->as.flags & ABC_F_GRACE)) { + if (!(s1->flags & ABC_F_GRACE)) { bshift = BEAM_SHIFT; bstub = BEAM_STUB; shift = .34; /* (half width of the stem) */ bh = BEAM_DEPTH; } else { - bshift = 3; + bshift = 3.5; bstub = 3.2; shift = .29; - bh = 1.6; + bh = 1.8; } /*fixme: quick hack for stubs at end of beam and different stem directions*/ @@ -607,7 +642,7 @@ draw_beam(s1->xs - shift, s2->xs + shift, 0., bh, bm, 1); da = 0; for (s = s1; ; s = s->next) { - if (s->as.type == ABC_T_NOTE + if (s->abc_type == ABC_T_NOTE && s->stem != beam_dir) s->ys = bm->a * s->xs + bm->b - staff_tb[s->staff].y @@ -638,14 +673,14 @@ struct SYMBOL *k1, *k2; float x1; - if (s->as.type != ABC_T_NOTE + if (s->abc_type != ABC_T_NOTE || s->nflags < i) { if (s == s2) break; continue; } if ((s->sflags & S_TREM1) - && i > s->nflags - s->u) { + && i > s->nflags - s->aux) { if (s->head >= H_OVAL) x1 = s->x; else @@ -661,16 +696,21 @@ for (;;) { if (s == s2) break; - if ((s->next->type == NOTEREST - && s->next->nflags < i) - || (s->next->sflags & S_BEAM_BR1) - || ((s->next->sflags & S_BEAM_BR2) - && i > 2)) + if (s->next->type == NOTEREST) { + if (s->next->sflags & S_TREM1) { + if (s->next->nflags - s->next->aux < i) + break; + } else if (s->next->nflags < i) { + break; + } + } + if ((s->next->sflags & S_BEAM_BR1) + || ((s->next->sflags & S_BEAM_BR2) && i > 2)) break; s = s->next; } k2 = s; - while (k2->as.type != ABC_T_NOTE) + while (k2->abc_type != ABC_T_NOTE) k2 = k2->prev; x1 = k1->xs; if (k1 == k2) { @@ -679,29 +719,29 @@ } else if (k1 == s2) { x1 -= bstub; } else if ((k1->sflags & S_BEAM_BR1) - || ((k1->sflags & S_BEAM_BR2) - && i > 2)) { + || ((k1->sflags & S_BEAM_BR2) + && i > 2)) { x1 += bstub; } else { struct SYMBOL *k; k = k1->next; - while (k->as.type != ABC_T_NOTE) + while (k->abc_type != ABC_T_NOTE) k = k->next; if ((k->sflags & S_BEAM_BR1) || ((k->sflags & S_BEAM_BR2) - && i > 2)) { + && i > 2)) { x1 -= bstub; } else { k1 = k1->prev; - while (k1->as.type != ABC_T_NOTE) + while (k1->abc_type != ABC_T_NOTE) k1 = k1->prev; if (k1->nflags < k->nflags || (k1->nflags == k->nflags - && k1->dots < k->dots)) + && k1->dots < k->dots)) x1 += bstub; else - x1 -= bstub; + x1 -= bstub; } } } @@ -728,25 +768,25 @@ int i, end; float yt, yb; - while (cursys->staff[staff].empty - || staff_tb[staff].clef.stafflines == 0) { + while (cursys->staff[staff].empty) { +// || staff_tb[staff].stafflines == 0) { if (cursys->staff[staff].flags & flag) return; staff++; } i = end = staff; for (;;) { - if (!cursys->staff[i].empty - && staff_tb[i].clef.stafflines != 0) + if (!cursys->staff[i].empty) +// && staff_tb[i].stafflines != 0) end = i; if (cursys->staff[i].flags & flag) break; i++; } yt = staff_tb[staff].y + staff_tb[staff].topbar - * staff_tb[staff].clef.staffscale; + * staff_tb[staff].staffscale; yb = staff_tb[end].y + staff_tb[end].botbar - * staff_tb[end].clef.staffscale; + * staff_tb[end].staffscale; a2b("%.1f %.1f %.1f %s\n", yt - yb, x, yt, (flag & (CLOSE_BRACE | CLOSE_BRACE2)) ? "brace" : "bracket"); @@ -765,8 +805,8 @@ for (i = 0; ; i++) { if (cursys->staff[i].flags & (OPEN_BRACE | OPEN_BRACKET)) l++; - if (!cursys->staff[i].empty - && staff_tb[i].clef.stafflines != 0) + if (!cursys->staff[i].empty) +// && staff_tb[i].stafflines != 0) break; if (cursys->staff[i].flags & (CLOSE_BRACE | CLOSE_BRACKET)) l--; @@ -774,19 +814,17 @@ break; } for (j = nst; j > i; j--) { - if (!cursys->staff[j].empty - && staff_tb[j].clef.stafflines != 0) + if (!cursys->staff[j].empty) +// && staff_tb[j].stafflines != 0) break; } if (i == j && l == 0) return; set_sscale(-1); yb = staff_tb[j].y + staff_tb[j].botbar - * staff_tb[j].clef.staffscale; + * staff_tb[j].staffscale; a2b("%.1f %.1f %.1f bar\n", - staff_tb[i].y - + staff_tb[i].topbar * staff_tb[i].clef.staffscale - - yb, + staff_tb[i].y + staff_tb[i].topbar * staff_tb[i].staffscale - yb, x, yb); for (i = 0; i <= nst; i++) { if (cursys->staff[i].flags & OPEN_BRACE) @@ -804,28 +842,46 @@ static void draw_staff(int staff, float x1, float x2) { - int nlines; - float y; + char *stafflines; + int i, l, thick = -1; + float y, w; /* draw the staff */ set_sscale(staff); y = staff_tb[staff].y; - nlines = cursys->staff[staff].clef.stafflines; - switch (nlines) { - case 0: - return; - case 1: - y += 12; - break; - case 2: - case 3: + stafflines = staff_tb[staff].stafflines; + l = strlen(stafflines); + for (i = 0; i < l; i++) { + if (stafflines[i] != '.') { + w = x2 - x1; + for ( ; i < l; i++) { + if (stafflines[i] != '.') { + if (stafflines[i] != '|') { + if (thick != 1) { + if (thick >= 0) + a2b("stroke\n"); + a2b("1.5 SLW "); + thick = 1; + } + } else { + if (thick != 0) { + if (thick >= 0) + a2b("stroke\n"); + a2b("dlw "); + thick = 0; + } + } + putx(w); + putxy(x1, y); + a2b("M 0 RL "); + } + y += 6; + } + a2b("stroke\n"); + break; + } y += 6; - break; } - putx(x2 - x1); - a2b("%d ", nlines); - putxy(x1, y); - a2b("staff\n"); } /* -- draw the time signature -- */ @@ -834,38 +890,41 @@ { unsigned i, staff, l, l2; char *f, meter[64]; - float dx; + float dx, y; - if (s->as.u.meter.nmeter == 0) + if (s->u.meter.nmeter == 0) return; staff = s->staff; x -= s->wl; - for (i = 0; i < s->as.u.meter.nmeter; i++) { - l = strlen(s->as.u.meter.meter[i].top); - if (l > sizeof s->as.u.meter.meter[i].top) - l = sizeof s->as.u.meter.meter[i].top; - if (s->as.u.meter.meter[i].bot[0] != '\0') { + y = staff_tb[staff].y; + for (i = 0; i < s->u.meter.nmeter; i++) { + l = strlen(s->u.meter.meter[i].top); + if (l > sizeof s->u.meter.meter[i].top) + l = sizeof s->u.meter.meter[i].top; + if (s->u.meter.meter[i].bot[0] != '\0') { sprintf(meter, "(%.8s)(%.2s)", - s->as.u.meter.meter[i].top, - s->as.u.meter.meter[i].bot); + s->u.meter.meter[i].top, + s->u.meter.meter[i].bot); f = "tsig"; - l2 = strlen(s->as.u.meter.meter[i].bot); - if (l2 > sizeof s->as.u.meter.meter[i].bot) - l2 = sizeof s->as.u.meter.meter[i].bot; + l2 = strlen(s->u.meter.meter[i].bot); + if (l2 > sizeof s->u.meter.meter[i].bot) + l2 = sizeof s->u.meter.meter[i].bot; if (l2 > l) l = l2; - } else switch (s->as.u.meter.meter[i].top[0]) { + } else switch (s->u.meter.meter[i].top[0]) { case 'C': - if (s->as.u.meter.meter[i].top[1] != '|') { + if (s->u.meter.meter[i].top[1] != '|') { f = "csig"; } else { f = "ctsig"; l--; } meter[0] = '\0'; + x -= 5; + y += 12; break; case 'c': - if (s->as.u.meter.meter[i].top[1] != '.') { + if (s->u.meter.meter[i].top[1] != '.') { f = "imsig"; } else { f = "iMsig"; @@ -874,7 +933,7 @@ meter[0] = '\0'; break; case 'o': - if (s->as.u.meter.meter[i].top[1] != '.') { + if (s->u.meter.meter[i].top[1] != '.') { f = "pmsig"; } else { f = "pMsig"; @@ -885,19 +944,19 @@ case '(': case ')': sprintf(meter, "(\\%s)", - s->as.u.meter.meter[i].top); + s->u.meter.meter[i].top); f = "stsig"; break; default: sprintf(meter, "(%.8s)", - s->as.u.meter.meter[i].top); + s->u.meter.meter[i].top); f = "stsig"; break; } if (meter[0] != '\0') a2b("%s ", meter); dx = (float) (13 * l); - putxy(x + dx * .5, staff_tb[staff].y); + putxy(x + dx * .5, y); a2b("%s\n", f); x += dx; } @@ -908,9 +967,8 @@ { int n, d; - n = micro_tb[acc >> 3]; - if (acc >> 3 != 0 - && (cfmt.micronewps || microscale)) { + n = parse.micro_tb[acc >> 3]; + if (acc >> 3 != 0 && microscale) { if (microscale) { d = microscale; n = acc >> 3; @@ -924,25 +982,56 @@ } } +// draw helper lines +static void draw_hl(float x, float staffb, int up, + int y, char *stafflines, char *hltype) +{ + int i, l; + + l = strlen(stafflines); + + // lower ledger lines + if (!up) { + for (i = 0; i < l - 1; i++) { + if (stafflines[i] != '.') + break; + } + i = i * 6 - 6; + for ( ; i >= y; i -= 6) { + putxy(x, staffb + i); + a2b("%s ", hltype); + } + return; + } + + // upper ledger lines + i = l * 6; + for ( ; i <= y; i += 6) { + putxy(x, staffb + i); + a2b("%s ", hltype); + } +} + /* -- draw a key signature -- */ static void draw_keysig(struct VOICE_S *p_voice, float x, struct SYMBOL *s) { - int old_sf = s->u; + int old_sf = s->aux; int staff = p_voice->staff; float staffb = staff_tb[staff].y; int i, clef_ix, shift; const signed char *p_seq; - static const char sharp_cl[7] = {24, 9, 15, 21, 6, 12, 18}; - static const char flat_cl[7] = {12, 18, 24, 9, 15, 21, 6}; - static const signed char sharp1[6] = {-9, 12, -9, -9, 12, -9}; - static const signed char sharp2[6] = {12, -9, 12, -9, 12, -9}; - static const signed char flat1[6] = {9, -12, 9, -12, 9, -12}; - static const signed char flat2[6] = {-12, 9, -12, 9, -12, 9}; + static const char sharp_cl[] = {24, 9, 15, 21, 6, 12, 18}; + static const char flat_cl[] = {12, 18, 24, 9, 15, 21, 6}; + // (the ending 0 is needed to avoid array overflow) + static const signed char sharp1[] = {-9, 12, -9, -9, 12, -9, 0}; + static const signed char sharp2[] = {12, -9, 12, -9, 12, -9, 0}; + static const signed char flat1[] = {9, -12, 9, -12, 9, -12, 0}; + static const signed char flat2[] = {-12, 9, -12, 9, -12, 9, 0}; - clef_ix = s->pits[0]; + clef_ix = s->u.key.clef_delta; if (clef_ix & 1) clef_ix += 7; clef_ix /= 2; @@ -951,14 +1040,14 @@ clef_ix %= 7; /* normal accidentals */ - if (s->as.u.key.nacc == 0 && !s->as.u.key.empty) { + if (s->u.key.nacc == 0 && !s->u.key.empty) { - /* put neutrals if not 'accidental cancel' */ - if (cfmt.cancelkey || s->as.u.key.sf == 0) { + /* put neutrals if 'accidental cancel' */ + if (cfmt.cancelkey || s->u.key.sf == 0) { /* when flats to sharps, or sharps to flats, */ - if (s->as.u.key.sf == 0 - || old_sf * s->as.u.key.sf < 0) { + if (s->u.key.sf == 0 + || old_sf * s->u.key.sf < 0) { /* old sharps */ shift = sharp_cl[clef_ix]; @@ -979,88 +1068,84 @@ shift += *p_seq++; x += 5.5; } - if (s->as.u.key.sf != 0) + if (s->u.key.sf != 0) x += 3; /* extra space */ - - /* or less sharps or flats */ - } else if (s->as.u.key.sf > 0) { /* sharps */ - if (s->as.u.key.sf < old_sf) { - shift = sharp_cl[clef_ix]; - p_seq = shift > 9 ? sharp1 : sharp2; - for (i = 0; i < s->as.u.key.sf; i++) - shift += *p_seq++; - for (; i < old_sf; i++) { - putxy(x, staffb + shift); - a2b("nt0 "); - shift += *p_seq++; - x += 5.5; - } - x += 3; /* extra space */ - } - } else /*if (s->as.u.key.sf < 0)*/ { /* flats */ - if (s->as.u.key.sf > old_sf) { - shift = flat_cl[clef_ix]; - p_seq = shift < 18 ? flat1 : flat2; - for (i = 0; i > s->as.u.key.sf; i--) - shift += *p_seq++; - for (; i > old_sf; i--) { - putxy(x, staffb + shift); - a2b("nt0 "); - shift += *p_seq++; - x += 5.5; - } - x += 3; /* extra space */ - } } } /* new sharps */ - shift = sharp_cl[clef_ix]; - p_seq = shift > 9 ? sharp1 : sharp2; - for (i = 0; i < s->as.u.key.sf; i++) { - putxy(x, staffb + shift); - a2b("sh0 "); - shift += *p_seq++; - x += 5.5; + if (s->u.key.sf > 0) { + shift = sharp_cl[clef_ix]; + p_seq = shift > 9 ? sharp1 : sharp2; + for (i = 0; i < s->u.key.sf; i++) { + putxy(x, staffb + shift); + a2b("sh0 "); + shift += *p_seq++; + x += 5.5; + } + if (cfmt.cancelkey && s->u.key.sf < old_sf) { + x += 2; + for (; i < old_sf; i++) { + putxy(x, staffb + shift); + a2b("nt0 "); + shift += *p_seq++; + x += 5.5; + } + } } /* new flats */ - shift = flat_cl[clef_ix]; - p_seq = shift < 18 ? flat1 : flat2; - for (i = 0; i > s->as.u.key.sf; i--) { - putxy(x, staffb + shift); - a2b("ft0 "); - shift += *p_seq++; - x += 5.5; + if (s->u.key.sf < 0) { + shift = flat_cl[clef_ix]; + p_seq = shift < 18 ? flat1 : flat2; + for (i = 0; i > s->u.key.sf; i--) { + putxy(x, staffb + shift); + a2b("ft0 "); + shift += *p_seq++; + x += 5.5; + } + if (cfmt.cancelkey && s->u.key.sf > old_sf) { + x += 2; + for (; i > old_sf; i--) { + putxy(x, staffb + shift); + a2b("nt0 "); + shift += *p_seq++; + x += 5.5; + } + } } } else { int acc, last_acc, last_shift; /* explicit accidentals */ - last_acc = s->as.u.key.accs[0]; + last_acc = s->u.key.accs[0]; last_shift = 100; - for (i = 0; i < s->as.u.key.nacc; i++) { - acc = s->as.u.key.accs[i]; - if (acc != last_acc) { - last_acc = acc; + for (i = 0; i < s->u.key.nacc; i++) { + acc = s->u.key.accs[i]; + shift = s->u.key.clef_delta * 3 // clef shift + + 3 * (s->u.key.pits[i] - 18); + if (i != 0 + && (shift > last_shift + 18 + || shift < last_shift - 18)) + x -= 5.5; // no clash + else if (acc != last_acc) x += 3; - } - shift = s->pits[0] * 3 - + 3 * (s->as.u.key.pits[i] - 18); - while (shift < -3) - shift += 21; - while (shift > 24 + 3) - shift -= 21; - if (shift == last_shift + 21 - || shift == last_shift - 21) - x -= 5.5; /* octave */ + last_acc = acc; + if (shift < 0) + draw_hl(x, staffb, 0, + shift, /* lower ledger line */ + staff_tb[s->staff].stafflines, "hl"); + else if (shift > 24) + draw_hl(x, staffb, 1, + shift, /* upper ledger line */ + staff_tb[s->staff].stafflines, "hl"); last_shift = shift; putxy(x, staffb + shift); - draw_acc(acc, s->as.u.key.microscale); + draw_acc(acc, s->u.key.microscale); x += 5.5; } } - if (old_sf != 0 || s->as.u.key.sf != 0 || s->as.u.key.nacc >= 0) + if (old_sf != 0 || s->u.key.sf != 0 || s->u.key.nacc != 0) a2b("\n"); } @@ -1072,14 +1157,15 @@ /* case B_CBRA: */ case (B_OBRA << 4) + B_CBRA: return 0; /* invisible */ - case B_COL: - return B_BAR; /* dotted */ +// case B_COL: +// return B_BAR; /* dotted */ #if 0 case (B_CBRA << 4) + B_BAR: return B_BAR; #endif + case (B_SINGLE << 8) | B_LREP: case (B_BAR << 4) + B_COL: - bar_type |= (B_OBRA << 8); /* |: -> [|: */ + bar_type |= (B_OBRA << 8); /* ||: and |: -> [|: */ break; case (B_BAR << 8) + (B_COL << 4) + B_COL: bar_type |= (B_OBRA << 12); /* |:: -> [|:: */ @@ -1103,7 +1189,7 @@ /* -- draw a measure bar -- */ static void draw_bar(struct SYMBOL *s, float bot, float h) { - int staff, bar_type, dotted; + int staff, bar_type; float x, yb; char *psf; @@ -1112,35 +1198,41 @@ x = s->x; /* if measure repeat, draw the '%' like glyphs */ - if (s->as.u.bar.len != 0) { + if (s->u.bar.len != 0) { struct SYMBOL *s2; set_scale(s); - if (s->as.u.bar.len == 1) { - for (s2 = s->prev; s2->as.type != ABC_T_REST; s2 = s2->prev) + if (s->u.bar.len == 1) { + for (s2 = s->prev; s2->abc_type != ABC_T_REST; s2 = s2->prev) ; - putxy(s2->x, yb); + putxy(s2->x, yb + 12); a2b("mrep\n"); } else { - putxy(x, yb); + putxy(x, yb + 12); a2b("mrep2\n"); if (s->voice == cursys->top_voice) { /*fixme set_font(s->gcf); */ set_font(cfmt.anf); putxy(x, yb + staff_tb[staff].topbar + 4); - a2b("M(%d)showc\n", s->as.u.bar.len); + a2b("M(%d)showc\n", s->u.bar.len); } } } - dotted = s->as.u.bar.dotted || s->as.u.bar.type == B_COL; - bar_type = bar_cnv(s->as.u.bar.type); + + /* don't put a line between the staves if there is no bar above */ + if (staff != 0 + && s->ts_prev + && (s->ts_prev->type != BAR || s->ts_prev->staff != staff - 1)) + h = staff_tb[staff].topbar * staff_tb[staff].staffscale; + + bar_type = bar_cnv(s->u.bar.type); if (bar_type == 0) return; /* invisible */ for (;;) { psf = "bar"; switch (bar_type & 0x07) { case B_BAR: - if (dotted) + if (s->u.bar.dotted) psf = "dotbar"; break; case B_OBRA: @@ -1175,18 +1267,24 @@ /* (the staves are defined) */ static void draw_rest(struct SYMBOL *s) { - int i, y; + int i, j, y, l; +// int no_head; + char *stafflines; float x, dotx, staffb; + static char *rest_tb[NFLAGS_SZ] = { + "r128", "r64", "r32", "r16", "r8", + "r4", + "r2", "r1", "r0", "r00" + }; -static char *rest_tb[NFLAGS_SZ] = { - "r128", "r64", "r32", "r16", "r8", - "r4", - "r2", "r1", "r0", "r00" -}; + /* don't display the rests of invisible staves */ + /* (must do this here for voices out of their normal staff) */ + if (staff_tb[s->staff].empty) + return; - /* if rest alone in the measure, center */ - x = s->x + s->shhd[0] * cur_scale; - if (s->dur == voice_tb[s->voice].meter.wmeasure) { + /* if rest alone in the measure or measure repeat, center */ + if (s->dur == voice_tb[s->voice].meter.wmeasure + || ((s->sflags & S_REPEAT) && s->doty >= 0)) { struct SYMBOL *s2; /* don't use next/prev: there is no bar in voice averlay */ @@ -1204,18 +1302,20 @@ x = (x + s2->x) * .5; /* center the associated decorations */ - if (s->as.u.note.dc.n > 0) + if (s->u.note.dc.n > 0) deco_update(s, x - s->x); s->x = x; + } else { + x = s->x + s->u.note.notes[0].shhd * cur_scale; } - if ((s->as.flags & ABC_F_INVIS) - && !(s->sflags & S_OTHER_HEAD)) + if (s->flags & ABC_F_INVIS) +// && !(s->sflags & S_OTHER_HEAD)) //fixme: before new deco struct return; staffb = staff_tb[s->staff].y; /* bottom of staff */ if (s->sflags & S_REPEAT) { - putxy(x, staffb); + putxy(x, staffb + 12); if (s->doty < 0) { a2b("srep\n"); } else { @@ -1233,70 +1333,40 @@ y = s->y; - if (s->sflags & S_OTHER_HEAD) { - draw_all_deco_head(s, x, y + staffb); - return; - } - i = C_XFLAGS - s->nflags; /* rest_tb index */ + stafflines = staff_tb[s->staff].stafflines; + l = strlen(stafflines); if (i == 7 && y == 12 - && staff_tb[s->staff].clef.stafflines <= 2) + && l <= 2) y -= 6; /* semibreve a bit lower */ putxy(x, y + staffb); /* rest */ - a2b("%s ", rest_tb[i]); + a2b("%s ", s->u.note.notes[0].head ? + s->u.note.notes[0].head : rest_tb[i]); /* output ledger line(s) when greater than minim */ if (i >= 6) { - int yb, yt; - - switch (staff_tb[s->staff].clef.stafflines) { - case 0: - yb = 12; - yt = 12; - break; - case 1: - yb = 6; - yt = 18; - break; - case 2: - yb = 0; - yt = 18; - break; - case 3: - yb = 0; - yt = 24; - break; - default: - yb = -6; - yt = staff_tb[s->staff].clef.stafflines * 6; - break; - } + j = y / 6; switch (i) { - case 6: /* minim */ - if (y <= yb || y >= yt) { - putxy(x, y + staffb); - a2b("hl "); - } - break; - case 7: /* semibreve */ - if (y < yb || y >= yt - 6) { - putxy(x, y + 6 + staffb); - a2b("hl "); - } - break; default: - if (y < yb || y >= yt - 6) { - putxy(x,y + 6 + staffb); - a2b("hl "); + if (j >= l - 1 || stafflines[j + 1] != '|') { + putxy(x, y + staffb); + a2b("hl1 "); } - if (i == 9) /* longa */ + if (i == 9) { // longa y -= 6; - if (y <= yb || y >= yt) { - putxy(x, y + staffb); - a2b("hl "); + j--; } break; + case 7: + y += 6; + j++; + case 6: + break; + } + if (j >= l || stafflines[j] != '|') { + putxy(x, y + staffb); + a2b("hl1 "); } } @@ -1334,7 +1404,7 @@ if (g == bm.s2) bm.s2 = NULL; /* (draw flags again) */ - if (g->as.flags & ABC_F_SAPPO) { /* (on 1st note only) */ + if (g->flags & ABC_F_SAPPO) { /* (on 1st note only) */ if (!g->next) { /* if one note */ x1 = 9; y1 = g->stem > 0 ? 5 : -5; @@ -1357,11 +1427,13 @@ } /* slur */ - if (voice_tb[s->voice].key.mode >= BAGPIPE /* no slur when bagpipe */ + if (voice_tb[s->voice].key.instr == K_HP /* no slur when bagpipe */ + || voice_tb[s->voice].key.instr == K_Hp + || pipeformat || !cfmt.graceslurs - || s->as.u.note.slur_st /* explicit slur */ + || s->u.note.slur_st /* explicit slur */ || !s->next - || s->next->as.type != ABC_T_NOTE) + || s->next->abc_type != ABC_T_NOTE) return; last = g; if (last->stem >= 0) { @@ -1388,7 +1460,7 @@ dy1 = (x3 - x0) * .4; if (dy1 > 3) dy1 = 3; - dy2 = dy1; + dy2 = dy1; bet1 = .2; bet2 = .8; if (y0 > y3 + 7) { @@ -1478,7 +1550,7 @@ y_tb[m] = y; } - /* dispatch and recenter the dots in the staff spaces */ + /* dispatch and recenter the dots in the staff space */ for (m = 0; m < s->nhd; m++) { if (y_tb[m + 1] > y_tb[m]) continue; @@ -1489,7 +1561,8 @@ m1--; } if (3 * (s->pits[m1] - 18) - y_tb[m1] - < y_tb[m + 1] - 3 * (s->pits[m + 1] - 18)) { + < y_tb[m + 1] - 3 * + (s->pits[m + 1] - 18)) { while (m1 <= m) y_tb[m1++] -= 6; } else { @@ -1505,53 +1578,38 @@ int m, signed char *y_tb) { - int i, y, no_head, head, dots, nflags; + struct note *note = &s->u.note.notes[m]; + int y, head, dots, nflags, acc; +// int no_head; + int old_color = -1; float staffb, shhd; char *p; - char perc_hd[8]; + char hd[32]; staffb = staff_tb[s->staff].y; /* bottom of staff */ y = 3 * (s->pits[m] - 18); /* note height on staff */ - shhd = s->shhd[m] * cur_scale; + shhd = note->shhd * cur_scale; - /* draw the note decorations */ - no_head = (s->sflags & S_OTHER_HEAD); - if (no_head) - draw_all_deco_head(s, x + shhd, y + staffb); - if (s->as.u.note.decs[m] != 0) { - int n; - - i = s->as.u.note.decs[m] >> 3; /* index */ - n = i + (s->as.u.note.decs[m] & 0x07); /* # deco */ - for ( ; i < n; i++) - no_head |= draw_deco_head(s->as.u.note.dc.t[i], - x + shhd, - y + staffb, - s->stem); - } - if (s->as.flags & ABC_F_INVIS) + if (s->flags & ABC_F_INVIS) return; - /* special case when no head */ - if (s->nohdix >= 0) { - if ((s->stem > 0 && m <= s->nohdix) - || (s->stem < 0 && m >= s->nohdix)) { - a2b("/x "); /* set x y */ - putx(x + shhd); - a2b("def/y "); - puty(y + staffb); - a2b("def"); - return; - } - } + putxy(x + shhd, y + staffb); /* output x and y */ + +// /* special case when no head */ +// if (s->nohdi1 >= 0 +// && m >= s->nohdi1 && m < s->nohdi2) { +// a2b("xydef"); /* set x y */ +// return; +// } - identify_note(s, s->as.u.note.lens[m], - &head, &dots, &nflags); + identify_note(s, note->len, &head, &dots, &nflags); + acc = note->acc; /* output a ledger line if horizontal shift / chord * and note on a line */ if (y % 6 == 0 - && shhd != (s->stem > 0 ? s->shhd[0] : s->shhd[s->nhd])) { + && shhd != (s->stem > 0 ? s->u.note.notes[0].shhd : + s->u.note.notes[s->nhd].shhd)) { int yy; yy = 0; @@ -1571,22 +1629,24 @@ } /* draw the head */ - putxy(x + shhd, y + staffb); - if (no_head) { - p = "/y exch def/x exch def"; - } else if (s->as.flags & ABC_F_GRACE) { + if (note->invisible) { + p = "xydef"; + } else if ((p = note->head) != NULL) { + snprintf(hd, sizeof hd, "%.*s", note->hlen, p); + p = hd; + a2b("2 copy xydef "); /* set x y */ + } else if (s->flags & ABC_F_GRACE) { p = "ghd"; } else if (s->type == CUSTOS) { p = "custos"; - } else if ((s->sflags & S_PERC) - && (i = s->as.u.note.accs[m]) != 0) { - i &= 0x07; - sprintf(perc_hd, "p%shd", acc_tb[i]); - p = perc_hd; + } else if ((s->sflags & S_PERC) && acc != 0) { + sprintf(hd, "p%shd", acc_tb[acc & 0x07]); + acc = 0; + p = hd; } else { switch (head) { case H_OVAL: - if (s->as.u.note.lens[m] < BREVE) { + if (note->len < BREVE) { p = "HD"; break; } @@ -1596,10 +1656,7 @@ } /* fall thru */ case H_SQUARE: - if (s->as.u.note.lens[m] < BREVE * 2) - p = "breve"; - else - p = "longa"; + p = note->len < BREVE * 2 ? "breve" : "longa"; /* don't display dots on last note of the tune */ if (!tsnext && s->next @@ -1612,6 +1669,10 @@ p = "hd"; break; } } + if (note->color >= 0) { + old_color = cur_color; + set_color(note->color); + } a2b("%s", p); /* draw the dots */ @@ -1620,28 +1681,31 @@ float dotx; int doty; - dotx = (int) (8. + s->xmx); + dotx = 7.7 + s->xmx - note->shhd; doty = y_tb[m] - y; + if (scale_voice) + doty /= cur_scale; while (--dots >= 0) { - a2b(" %.1f %d dt", dotx - shhd, doty); + a2b(" %.1f %d dt", dotx, doty); dotx += 3.5; } } /* draw the accidental */ - if ((i = s->as.u.note.accs[m]) != 0 - && !(s->sflags & S_PERC)) { - x -= s->shac[m] * cur_scale; + if (acc != 0) { + x -= note->shac * cur_scale; a2b(" "); putx(x); - if (s->as.flags & ABC_F_GRACE) - a2b("gsc "); - else - a2b("y "); - draw_acc(i, s->as.u.note.microscale); - if (s->as.flags & ABC_F_GRACE) + a2b(s->flags & ABC_F_GRACE ? "gsc " : "y "); + draw_acc(acc, s->u.note.microscale); + if (s->flags & ABC_F_GRACE) a2b(" grestore"); } + + if (old_color >= 0) { + a2b("\n"); + set_color(old_color); + } } /* -- draw a note or a chord -- */ @@ -1650,7 +1714,7 @@ struct SYMBOL *s, int fl) { - int i, m, ma, y; + int m, ma; float staffb, slen, shhd; char c, *hltype; signed char y_tb[MAXHD]; @@ -1662,8 +1726,8 @@ staffb = staff_tb[s->staff].y; /* output the ledger lines */ - if (!(s->as.flags & ABC_F_INVIS)) { - if (s->as.flags & ABC_F_GRACE) { + if (!(s->flags & ABC_F_INVIS)) { + if (s->flags & ABC_F_GRACE) { hltype = "ghl"; } else { switch (s->head) { @@ -1678,49 +1742,33 @@ break; } } - shhd = (s->stem > 0 ? s->shhd[0] : s->shhd[s->nhd]) - * cur_scale; - y = 3 * (s->pits[0] - 18); /* lower ledger lines */ - switch (staff_tb[s->staff].clef.stafflines) { - case 0: - case 1: i = 6; break; - case 2: - case 3: i = 0; break; - default: i = -6; break; - } - for ( ; i >= y; i -= 6) { - putxy(x + shhd, i + staffb); - a2b("%s ", hltype); - } - y = 3 * (s->pits[s->nhd] - 18); /* upper ledger lines */ - switch (staff_tb[s->staff].clef.stafflines) { - case 0: - case 1: - case 2: i = 18; break; - case 3: i = 24; break; - default: i = staff_tb[s->staff].clef.stafflines * 6; break; - } - for ( ; i <= y; i += 6) { - putxy(x + shhd, i + staffb); - a2b("%s ", hltype); - } + shhd = (s->stem > 0 ? s->u.note.notes[0].shhd : + s->u.note.notes[s->nhd].shhd) + * cur_scale; + if (s->pits[0] < 22) + draw_hl(x + shhd, staffb, 0, + 3 * (s->pits[0] - 18), /* lower ledger lines */ + staff_tb[s->staff].stafflines, hltype); + if (s->pits[s->nhd] > 22) + draw_hl(x + shhd, staffb, 1, + 3 * (s->pits[s->nhd] - 18), /* upper ledger lines */ + staff_tb[s->staff].stafflines, hltype); } /* draw the master note, first or last one */ if (cfmt.setdefl) set_defl(s->stem >= 0 ? DEF_STEMUP : 0); ma = s->stem >= 0 ? 0 : s->nhd; - draw_basic_note(x, s, ma, y_tb); - /* add stem and flags */ - if (!(s->as.flags & (ABC_F_INVIS | ABC_F_STEMLESS))) { + /* draw the stem and flags */ + if (!(s->flags & (ABC_F_INVIS | ABC_F_STEMLESS))) { char c2; c = s->stem >= 0 ? 'u' : 'd'; slen = (s->ys - s->y) / voice_tb[s->voice].scale; - if (!fl || s->nflags - s->u <= 0) { /* stem only */ - c2 = (s->as.flags & ABC_F_GRACE) ? 'g' : 's'; + if (!fl || s->nflags - s->aux <= 0) { /* stem only */ + c2 = (s->flags & ABC_F_GRACE) ? 'g' : 's'; if (s->nflags > 0) { /* (fix for PS low resolution) */ if (s->stem >= 0) slen -= 1; @@ -1731,17 +1779,14 @@ } else { /* stem and flags */ if (cfmt.straightflags) c = 's'; /* straight flag */ - c2 = (s->as.flags & ABC_F_GRACE) ? 'g' : 'f'; - a2b(" %d %.1f s%c%c", s->nflags - s->u, slen, c2, c); + c2 = (s->flags & ABC_F_GRACE) ? 'g' : 'f'; + a2b(" %d %.1f s%c%c", s->nflags - s->aux, slen, c2, c); } } else if (s->sflags & S_XSTEM) { /* cross-staff stem */ struct SYMBOL *s2; s2 = s->ts_prev; - if (s2->stem > 0) - slen = s2->y - s->y; - else - slen = s2->ys - s->y; + slen = (s2->stem > 0 ? s2->y : s2->ys) - s->y; slen += staff_tb[s2->staff].y - staffb; /*fixme:KO when different scales*/ slen /= voice_tb[s->voice].scale; @@ -1749,32 +1794,31 @@ } /* draw the tremolo bars */ - if (!(s->as.flags & ABC_F_INVIS) + if (!(s->flags & ABC_F_INVIS) && fl && (s->sflags & S_TREM1)) { float x1; - x1 = x; - if (s->stem > 0) - slen = 3 * (s->pits[s->nhd] - 18); - else - slen = 3 * (s->pits[0] - 18); + x1 = x + (s->stem > 0 ? s->u.note.notes[0].shhd : + s->u.note.notes[s->nhd].shhd) + * cur_scale; + slen = 3 * (s->pits[s->stem > 0 ? s->nhd : 0] - 18); if (s->head >= H_OVAL) { if (s->stem > 0) - slen = slen + 5 + 5.4 * s->u; + slen += 5 + 5.4 * s->aux; else - slen = slen - 5 - 5.4; + slen -= 5 + 5.4; } else { - x1 += ((s->as.flags & ABC_F_GRACE) + x1 += ((s->flags & ABC_F_GRACE) ? GSTEM_XOFF : STEM_XOFF) * s->stem; if (s->stem > 0) - slen = slen + 6 + 5.4 * s->u; + slen += 6 + 5.4 * s->aux; else - slen = slen - 6 - 5.4; + slen -= 6 + 5.4; } slen /= voice_tb[s->voice].scale; - a2b(" %d ", s->u); + a2b(" %d ", s->aux); putxy(x1, staffb + slen); a2b("trem"); } @@ -1798,11 +1842,11 @@ for (s = s->next; s; s = s->next) { if (s->type == BAR && ((s->sflags & S_RRBAR) - || s->as.u.bar.type == B_THIN_THICK - || s->as.u.bar.type == B_THICK_THIN - || (s->as.u.bar.repeat_bar - && s->as.text - && s->as.text[0] != '1'))) + || s->u.bar.type == B_THIN_THICK + || s->u.bar.type == B_THICK_THIN + || (s->u.bar.repeat_bar + && s->text + && s->text[0] != '1'))) return s; prev = s; } @@ -1810,39 +1854,29 @@ return prev; } -static struct SYMBOL *prev_scut(struct SYMBOL *s) +struct SYMBOL *prev_scut(struct SYMBOL *s) { - struct SYMBOL *sym; - int voice; - float x; - - voice = s->voice; - for (s = s->prev ; s; s = s->prev) { + while (s->prev) { + s = s->prev; if (s->type == BAR && ((s->sflags & S_RRBAR) - || s->as.u.bar.type == B_THIN_THICK - || s->as.u.bar.type == B_THICK_THIN - || (s->as.u.bar.repeat_bar - && s->as.text - && s->as.text[0] != '1'))) + || s->u.bar.type == B_THIN_THICK + || s->u.bar.type == B_THICK_THIN + || (s->u.bar.repeat_bar + && s->text + && s->text[0] != '1'))) return s; } - /* return sym before first note/rest/bar */ - sym = voice_tb[voice].sym; - for (s = sym->next; s; s = s->next) { - switch (s->as.type) { - case ABC_T_NOTE: - case ABC_T_REST: - case ABC_T_BAR: - x = s->x; - do { - s = s->prev; - } while (s->x == x); - return s; - } - } - return sym; + /* return a symbol of any voice starting before the start of the voice */ + s = voice_tb[s->voice].sym; + while (s->type != CLEF) + s = s->ts_prev; /* search a main voice */ + if (s->next && s->next->type == KEYSIG) + s = s->next; + if (s->next && s->next->type == TIMESIG) + s = s->next; + return s; } /* -- decide whether a slur goes up or down -- */ @@ -1852,15 +1886,18 @@ struct SYMBOL *s; int some_upstem, low; + if ((k1->flags & ABC_F_GRACE) && k1->stem > 0) + return -1; + some_upstem = low = 0; for (s = k1; ; s = s->next) { - if (s->as.type == ABC_T_NOTE) { - if (!(s->as.flags & ABC_F_STEMLESS)) { + if (s->abc_type == ABC_T_NOTE) { + if (!(s->flags & ABC_F_STEMLESS)) { if (s->stem < 0) return 1; some_upstem = 1; } - if (s->pits[0] < 22) /* if under middle staff */ + if (s->pits[0] < 22) /* if under middle staff */ low = 1; } if (s == k2) @@ -1971,19 +2008,23 @@ /* -- draw a phrasing slur between two symbols -- */ /* (the staves are not yet defined) */ /* (not a pretty routine, this) */ -static int draw_slur(struct SYMBOL *k1, +static int draw_slur(struct SYMBOL *k1_orig, struct SYMBOL *k2, int m1, int m2, int slur_type) { - struct SYMBOL *k; + struct SYMBOL *k1, *k; float x1, y1, x2, y2, height, addy; float a, y, z, h, dx, dy; int s, nn, upstaff, two_staves; + k1 = k1_orig; + while (k1->voice != k2->voice) + k1 = k1->ts_next; + /*fixme: if two staves, may have upper or lower slur*/ - switch (slur_type & 0x03) { /* (ignore dot bit) */ + switch (slur_type & 0x07) { /* (ignore dot bit) */ case SL_ABOVE: s = 1; break; case SL_BELOW: s = -1; break; default: @@ -2012,103 +2053,113 @@ if (two_staves) error(0, k1, "*** multi-staves slurs not treated yet"); /* fix endpoints */ - x1 = k1->x + k1->xmx; /* take the max right side */ - if (k1 != k2) { - x2 = k2->x; +// x1 = k1->x + k1->xmx; /* take the max right side */ + x1 = k1_orig->x + k1_orig->u.note.notes[0].shhd; + if (k1_orig != k2) { +// x2 = k2->x; + x2 = k2->x + k2->u.note.notes[0].shhd; } else { /* (the slur starts on last note of the line) */ for (k = k2->ts_next; k; k = k->ts_next) - if (k->type == STAVES) + if (k->sflags & S_NEW_SY) break; if (!k) x2 = realwidth; else x2 = k->x; } - y1 = (float) (s > 0 ? k1->ymx + 2 : k1->ymn - 2); - y2 = (float) (s > 0 ? k2->ymx + 2 : k2->ymn - 2); - if (k1->as.type == ABC_T_NOTE) { - if (s > 0) { - if (k1->stem > 0) { - x1 += 5; - if ((k1->sflags & S_BEAM_END) - && k1->nflags >= -1 /* if with a stem */ + if (m1 >= 0) { + y1 = (float) (3 * (k1->pits[m1] - 18) + 5 * s); + } else { + y1 = (float) (s > 0 ? k1->ymx + 2 : k1->ymn - 2); + if (k1->abc_type == ABC_T_NOTE) { + if (s > 0) { + if (k1->stem > 0) { + x1 += 5; + if ((k1->sflags & S_BEAM_END) + && k1->nflags >= -1 /* if with a stem */ //fixme: check if at end of tuplet - && (!(k1->sflags & S_IN_TUPLET))) { -// || k1->ys > y1 - 3)) { - if (k1->nflags > 0) { - x1 += 2; - y1 = k1->ys - 3; - } else { - y1 = k1->ys - 6; + && (!(k1->sflags & S_IN_TUPLET))) { +// || k1->ys > y1 - 3)) { + if (k1->nflags > 0) { + x1 += 2; + y1 = k1->ys - 3; + } else { + y1 = k1->ys - 6; + } +// don't clash with decorations +// } else { +// y1 = k1->ys + 3; } - } else { - y1 = k1->ys + 3; +// } else { +// y1 = k1->y + 8; } } else { - y1 = k1->y + 8; - } - } else { - if (k1->stem < 0) { - x1 -= 1; - if ((k1->sflags & S_BEAM_END) - && k1->nflags >= -1 - && (!(k1->sflags & S_IN_TUPLET) - || k1->ys < y1 + 3)) { - if (k1->nflags > 0) { - x1 += 2; - y1 = k1->ys + 3; - } else { - y1 = k1->ys + 6; + if (k1->stem < 0) { + x1 -= 1; + if ((k1->sflags & S_BEAM_END) + && k1->nflags >= -1 + && (!(k1->sflags & S_IN_TUPLET) + || k1->ys < y1 + 3)) { + if (k1->nflags > 0) { + x1 += 2; + y1 = k1->ys + 3; + } else { + y1 = k1->ys + 6; + } +// } else { +// y1 = k1->ys - 3; } - } else { - y1 = k1->ys - 3; +// } else { +// y1 = k1->y - 8; } - } else { - y1 = k1->y - 8; } } } - - if (k2->as.type == ABC_T_NOTE) { - if (s > 0) { - if (k2->stem > 0) { - x2 += 1; - if ((k2->sflags & S_BEAM_ST) - && k2->nflags >= -1 - && (!(k2->sflags & S_IN_TUPLET))) -// || k2->ys > y2 - 3)) - y2 = k2->ys - 6; - else - y2 = k2->ys + 3; - } else { - y2 = k2->y + 8; - } - } else { - if (k2->stem < 0) { - x2 -= 5; - if ((k2->sflags & S_BEAM_ST) - && k2->nflags >= -1 - && (!(k2->sflags & S_IN_TUPLET))) -// || k2->ys < y2 + 3)) - y2 = k2->ys + 6; - else - y2 = k2->ys - 3; + if (m2 >= 0) { + y2 = (float) (3 * (k2->pits[m2] - 18) + 5 * s); + } else { + y2 = (float) (s > 0 ? k2->ymx + 2 : k2->ymn - 2); + if (k2->abc_type == ABC_T_NOTE) { + if (s > 0) { + if (k2->stem > 0) { + x2 += 1; + if ((k2->sflags & S_BEAM_ST) + && k2->nflags >= -1 + && (!(k2->sflags & S_IN_TUPLET))) +// || k2->ys > y2 - 3)) + y2 = k2->ys - 6; +// else +// y2 = k2->ys + 3; +// } else { +// y2 = k2->y + 8; + } } else { - y2 = k2->y - 8; + if (k2->stem < 0) { + x2 -= 5; + if ((k2->sflags & S_BEAM_ST) + && k2->nflags >= -1 + && (!(k2->sflags & S_IN_TUPLET))) +// || k2->ys < y2 + 3)) + y2 = k2->ys + 6; +// else +// y2 = k2->ys - 3; +// } else { +// y2 = k2->y - 8; + } } } } - if (k1->as.type != ABC_T_NOTE) { + if (k1->abc_type != ABC_T_NOTE) { y1 = y2 + 1.2 * s; x1 = k1->x + k1->wr * .5; if (x1 > x2 - 12) x1 = x2 - 12; } - if (k2->as.type != ABC_T_NOTE) { - if (k1->as.type == ABC_T_NOTE) + if (k2->abc_type != ABC_T_NOTE) { + if (k1->abc_type == ABC_T_NOTE) y2 = y1 + 1.2 * s; else y2 = y1; @@ -2129,7 +2180,8 @@ y1 = y; } } - if (k2->prev->type != BAR + if (k2->prev + && k2->prev->type != BAR && k2->prev->x > x2 - 48) { if (s > 0) { y = k2->prev->ymx - 2; @@ -2143,28 +2195,6 @@ } } -#if 0 - /* shift endpoints */ - addx = .04 * (x2 - x1); - if (addx > 3.0) - addx = 3.0; - addy = .01 * (x2 - x1); - if (addy > 3.0) - addy = 3.0; - x1 += addx; - x2 -= addx; - -/*fixme: to simplify*/ - if (k1->staff == upstaff) - y1 += s * addy; - else - y1 = -6; - if (k2->staff == upstaff) - y2 += s * addy; - else - y2 = -6; -#endif - a = (y2 - y1) / (x2 - x1); /* slur steepness */ if (a > SLUR_SLOPE || a < -SLUR_SLOPE) { if (a > SLUR_SLOPE) @@ -2197,14 +2227,15 @@ } /* special case for grace notes */ - if (k1->as.flags & ABC_F_GRACE) + if (k1->flags & ABC_F_GRACE) x1 = k1->x - GSTEM_XOFF * .5; - if (k2->as.flags & ABC_F_GRACE) + if (k2->flags & ABC_F_GRACE) x2 = k2->x + GSTEM_XOFF * 1.5; h = 0; a = (y2 - y1) / (x2 - x1); - if (k1 != k2) { + if (k1 != k2 + && k1->voice == k2->voice) { addy = y1 - a * x1; for (k = k1->next; k != k2 ; k = k->next) { if (k->staff != upstaff) @@ -2232,6 +2263,8 @@ for (g = k->extra; g; g = g->next) { #if 1 + if (g->type != NOTEREST) + continue; if (s > 0) { y = 3 * (g->pits[g->nhd] - 18) + 6; if (y < g->ymx) @@ -2297,12 +2330,6 @@ } height *= cfmt.slurheight; -/*fixme: ugly!*/ - if (m1 >= 0) - y1 = (float) (3 * (k1->pits[m1] - 18) + 5 * s); - if (m2 >= 0) - y2 = (float) (3 * (k2->pits[m2] - 18) + 5 * s); - slur_out(x1, y1, x2, y2, s, height, slur_type & SL_DOTTED, upstaff); /* have room for other symbols */ @@ -2310,7 +2337,8 @@ a = (y2 - y1) / dx; /*fixme: it seems to work with .4, but why?*/ addy = y1 - a * x1 + .4 * height; - for (k = k1; k != k2; k = k->next) { + if (k1->voice == k2->voice) + for (k = k1; k != k2; k = k->next) { if (k->staff != upstaff) continue; y = a * k->x + addy; @@ -2356,7 +2384,7 @@ continue; } if ((s->type != NOTEREST && s->type != SPACE) - || (s->as.u.note.slur_st == 0 + || (s->u.note.slur_st == 0 && !(s->sflags & S_SL1))) { s = s->next; continue; @@ -2384,11 +2412,11 @@ } if (s1->type == BAR && ((s1->sflags & S_RRBAR) - || s1->as.u.bar.type == B_THIN_THICK - || s1->as.u.bar.type == B_THICK_THIN - || (s1->as.u.bar.repeat_bar - && s1->as.text - && s1->as.text[0] != '1'))) { + || s1->u.bar.type == B_THIN_THICK + || s1->u.bar.type == B_THICK_THIN + || (s1->u.bar.repeat_bar + && s1->text + && s1->text[0] != '1'))) { k = s1; break; } @@ -2396,12 +2424,12 @@ s1 = s1->next; continue; } - if (s1->as.u.note.slur_end + if (s1->u.note.slur_end || (s1->sflags & S_SL2)) { k = s1; break; } - if (s1->as.u.note.slur_st + if (s1->u.note.slur_st || (s1->sflags & S_SL1)) { if (gr2) { /* if in grace note sequence */ for (k = s1; k->next; k = k->next) @@ -2409,7 +2437,7 @@ k->next = gr2->next; if (gr2->next) gr2->next->prev = k; -// gr2->as.u.note.slur_st = SL_AUTO; +// gr2->u.note.slur_st = SL_AUTO; k = NULL; } draw_slurs(s1, last); @@ -2439,26 +2467,26 @@ s1->next = gr1->next; if (gr1->next) gr1->next->prev = s1; - gr1->as.u.note.slur_st = SL_AUTO; + gr1->u.note.slur_st = SL_AUTO; } if (gr2) { gr2->prev->next = gr2->extra; gr2->extra->prev = gr2->prev; - gr2->as.u.note.slur_st = SL_AUTO; + gr2->u.note.slur_st = SL_AUTO; } - if (s->as.u.note.slur_st) { - slur_type = s->as.u.note.slur_st & 0x07; - s->as.u.note.slur_st >>= 3; + if (s->u.note.slur_st) { + slur_type = s->u.note.slur_st & 0x0f; + s->u.note.slur_st >>= 4; m1 = -1; } else { for (m1 = 0; m1 <= s->nhd; m1++) - if (s->as.u.note.sl1[m1]) + if (s->u.note.notes[m1].sl1) break; - slur_type = s->as.u.note.sl1[m1] & 0x07; - s->as.u.note.sl1[m1] >>= 3; - if (s->as.u.note.sl1[m1] == 0) { + slur_type = s->u.note.notes[m1].sl1 & 0x0f; + s->u.note.notes[m1].sl1 >>= 4; + if (s->u.note.notes[m1].sl1 == 0) { for (i = m1 + 1; i <= s->nhd; i++) - if (s->as.u.note.sl1[i]) + if (s->u.note.notes[i].sl1) break; if (i > s->nhd) s->sflags &= ~S_SL1; @@ -2467,18 +2495,18 @@ m2 = -1; cont = 0; if ((k->type == NOTEREST || k->type == SPACE) - && (k->as.u.note.slur_end + && (k->u.note.slur_end || (k->sflags & S_SL2))) { - if (k->as.u.note.slur_end) { - k->as.u.note.slur_end--; + if (k->u.note.slur_end) { + k->u.note.slur_end--; } else { for (m2 = 0; m2 <= k->nhd; m2++) - if (k->as.u.note.sl2[m2]) + if (k->u.note.notes[m2].sl2) break; - k->as.u.note.sl2[m2]--; - if (k->as.u.note.sl2[m2] == 0) { + k->u.note.notes[m2].sl2--; + if (k->u.note.notes[m2].sl2 == 0) { for (i = m2 + 1; i <= k->nhd; i++) - if (k->as.u.note.sl2[i]) + if (k->u.note.notes[i].sl2) break; if (i > k->nhd) k->sflags &= ~S_SL2; @@ -2487,17 +2515,17 @@ } else { if (k->type != BAR || (!(k->sflags & S_RRBAR) - && k->as.u.bar.type != B_THIN_THICK - && k->as.u.bar.type != B_THICK_THIN - && (!k->as.u.bar.repeat_bar - || !k->as.text - || k->as.text[0] == '1'))) + && k->u.bar.type != B_THIN_THICK + && k->u.bar.type != B_THICK_THIN + && (!k->u.bar.repeat_bar + || !k->text + || k->text[0] == '1'))) cont = 1; } slur_type = draw_slur(s, k, m1, m2, slur_type); if (cont) { /*fixme: the slur types are inverted*/ - voice_tb[k->voice].slur_st <<= 3; + voice_tb[k->voice].slur_st <<= 4; voice_tb[k->voice].slur_st += slur_type; } @@ -2512,7 +2540,7 @@ gr2->extra->prev = NULL; } - if (s->as.u.note.slur_st + if (s->u.note.slur_st || (s->sflags & S_SL1)) continue; if (s == last) @@ -2523,17 +2551,18 @@ /* -- draw a tuplet -- */ /* (the staves are not yet defined) */ -/* See 'tuplets' in format.txt about the value of 'u' */ +/* See http://moinejf.free.fr/abcm2ps-doc/tuplets.xhtml + * about the value of 'aux' */ static struct SYMBOL *draw_tuplet(struct SYMBOL *t, /* tuplet in extra */ struct SYMBOL *s) /* main note */ { struct SYMBOL *s1, *s2, *sy, *next, *g; - int r, upstaff, nb_only, some_slur; + int r, upstaff, nb_only, some_slur, dir; float x1, x2, y1, y2, xm, ym, a, s0, yy, yx, dy; next = s; - if ((t->u & 0x0f00) == 0x100) /* if 'when' == never */ - return next; + if ((t->aux & 0xf000) == 0x1000) /* if 'when' == never */ + goto done; /* treat the nested tuplets starting on this symbol */ for (g = t->next; g; g = g->next) { @@ -2545,12 +2574,13 @@ } /* search the first and last notes/rests of the tuplet */ - r = t->as.u.tuplet.r_plet; + r = t->u.tuplet.r_plet; s1 = NULL; some_slur = 0; upstaff = s->staff; for (s2 = s; s2; s2 = s2->next) { - if (s2 != s) { + if (s2 != s + && (s2->sflags & S_IN_TUPLET)) { for (g = s2->extra; g; g = g->next) { if (g->type == TUPLET) { sy = draw_tuplet(g, s2); @@ -2564,15 +2594,15 @@ for (g = s2->extra; g; g = g->next) { if (g->type != NOTEREST) continue; - if (g->as.u.note.slur_st + if (g->u.note.slur_st || (g->sflags & S_SL1)) some_slur = 1; } } continue; } - if (s2->as.u.note.slur_st /* if slur start/end */ - || s2->as.u.note.slur_end + if (s2->u.note.slur_st /* if slur start/end */ + || s2->u.note.slur_end || (s2->sflags & (S_SL1 | S_SL2))) some_slur = 1; if (s2->staff < upstaff) @@ -2583,40 +2613,24 @@ break; } if (!s2) - return next; /* no solution... */ + goto done; /* no solution... */ if (s2->time > next->time) next = s2; -#if 0 - /* draw the slurs when inside the tuplet */ - if (some_slur) { - draw_slurs(s1, s2); - if (s1->as.u.note.slur_st - || (s1->sflags & S_SL1)) - return next; - for (sy = s1->next; sy != s2; sy = sy->next) { - if (sy->as.u.note.slur_st /* if slur start/end */ - || sy->as.u.note.slur_end - || (sy->sflags & (S_SL1 | S_SL2))) - return next; /* don't draw now */ - } - if (s2->as.u.note.slur_end - || (s2->sflags & S_SL2)) - return next; - } -#endif + dir = t->aux & 0x000f; + if (!dir) + dir = s1->stem > 0 ? SL_ABOVE : SL_BELOW; if (s1 == s2) { /* tuplet with 1 note (!) */ nb_only = 1; - } else if ((t->u & 0x0f0) == 0x10) { /* 'what' == slur */ + } else if ((t->aux & 0x0f00) == 0x0100) { /* 'what' == slur */ nb_only = 1; - draw_slur(s1, s2, -1, -1, - s1->stem > 0 ? SL_ABOVE : SL_BELOW); + draw_slur(s1, s2, -1, -1, dir); } else { /* search if a bracket is needed */ - if ((t->u & 0x0f00) == 0x200 /* if 'when' == always */ - || s1->as.type != ABC_T_NOTE || s2->as.type != ABC_T_NOTE) { + if ((t->aux & 0xf000) == 0x2000 /* if 'when' == always */ + || s1->abc_type != ABC_T_NOTE || s2->abc_type != ABC_T_NOTE) { nb_only = 0; } else { nb_only = 1; @@ -2662,8 +2676,8 @@ if (nb_only) { float a, b; - if ((t->u & 0x0f) == 1) /* if 'value' == none */ - return next; + if ((t->aux & 0x00f0) == 0x0010) /* if 'which' == none */ + goto done; xm = (s2->x + s1->x) * .5; if (s1 == s2) /* tuplet with 1 note */ a = 0; @@ -2671,16 +2685,16 @@ a = (s2->ys - s1->ys) / (s2->x - s1->x); b = s1->ys - a * s1->x; yy = a * xm + b; - if (s1->stem > 0) { + if (dir == SL_ABOVE) { ym = y_get(s1->staff, 1, xm - 3, 6); if (ym > yy) b += ym - yy; - b += 4; + b += 2; } else { ym = y_get(s1->staff, 0, xm - 3, 6); if (ym < yy) b += ym - yy; - b -= 12; + b -= 10; } for (sy = s1; ; sy = sy->next) { if (sy->x >= xm) @@ -2693,15 +2707,14 @@ xm -= GSTEM_XOFF; } ym = a * xm + b; - if ((t->u & 0x0f) == 0) /* if 'value' == number */ - a2b("(%d)", t->as.u.tuplet.p_plet); + if ((t->aux & 0x00f0) == 0) /* if 'which' == number */ + a2b("(%d)", t->u.tuplet.p_plet); else - a2b("(%d:%d)", t->as.u.tuplet.p_plet, - t->as.u.tuplet.q_plet); + a2b("(%d:%d)", t->u.tuplet.p_plet, t->u.tuplet.q_plet); putxy(xm, ym); a2b("y%d bnum\n", s1->staff); - if (s1->stem > 0) { + if (dir == SL_ABOVE) { ym += 8; if (sy->ymx < ym) sy->ymx = (short) ym; @@ -2711,45 +2724,46 @@ sy->ymn = (short) ym; y_set(s1->staff, 0, xm - 3, 6, ym); } - s->sflags &= ~S_IN_TUPLET; /* the tuplet is drawn */ - return next; + goto done; } -#if 1 /* draw the slurs when inside the tuplet */ if (some_slur) { draw_slurs(s1, s2); - if (s1->as.u.note.slur_st + if (s1->u.note.slur_st || (s1->sflags & S_SL1)) return next; for (sy = s1->next; sy != s2; sy = sy->next) { - if (sy->as.u.note.slur_st /* if slur start/end */ - || sy->as.u.note.slur_end + if (sy->u.note.slur_st /* if slur start/end */ + || sy->u.note.slur_end || (sy->sflags & (S_SL1 | S_SL2))) return next; /* don't draw now */ } /* don't draw the tuplet when a slur ends on the last note */ - if (s2->as.u.note.slur_end + if (s2->u.note.slur_end || (s2->sflags & S_SL2)) return next; } -#endif - if ((t->u & 0x0f0) != 0) /* if 'what' != square */ + + if ((t->aux & 0x0f00) != 0) /* if 'what' != square */ fprintf(stderr, "'what' value of %%%%tuplets not yet coded\n"); /*fixme: two staves not treated*/ /*fixme: to optimize*/ - if (s1->multi >= 0) { + dir = t->aux & 0x000f; /* 'where' */ + if (!dir) + dir = s1->multi >= 0 ? SL_ABOVE : SL_BELOW; + if (dir == SL_ABOVE) { /* sole or upper voice: the bracket is above the staff */ x1 = s1->x - 4; y1 = 24; if (s1->staff == upstaff) { sy = s1; - if (sy->as.type != ABC_T_NOTE) { + if (sy->abc_type != ABC_T_NOTE) { for (sy = sy->next; sy != s2; sy = sy->next) - if (sy->as.type == ABC_T_NOTE) + if (sy->abc_type == ABC_T_NOTE) break; } ym = y_get(upstaff, 1, sy->x, 0); @@ -2761,9 +2775,9 @@ y2 = 24; if (s2->staff == upstaff) { sy = s2; - if (sy->as.type != ABC_T_NOTE) { + if (sy->abc_type != ABC_T_NOTE) { for (sy = sy->prev; sy != s1; sy = sy->prev) - if (sy->as.type == ABC_T_NOTE) + if (sy->abc_type == ABC_T_NOTE) break; } ym = y_get(upstaff, 1, sy->x, 0); @@ -2772,7 +2786,6 @@ } /* end the backet according to the last note duration */ -#if 1 if (s2->dur > s2->prev->dur) { if (s2->next) x2 = s2->next->x - s2->next->wl - 5; @@ -2781,24 +2794,19 @@ } else { x2 = s2->x + 4; r = s2->stem >= 0 ? 0 : s2->nhd; - if (s2->shhd[r] > 0) - x2 += s2->shhd[r]; + if (s2->u.note.notes[r].shhd > 0) + x2 += s2->u.note.notes[r].shhd; if (s2->staff == upstaff && s2->stem > 0) x2 += 3.5; } -#else - if (s2->next) - x2 += (s2->next->x - s2->next->wl - s2->x - s2->wr) * 0.5; - else - x2 += (realwidth - s2->x) * 0.5; -#endif xm = .5 * (x1 + x2); ym = .5 * (y1 + y2); a = (y2 - y1) / (x2 - x1); - s0 = 3 * (s2->pits[s2->nhd] - s1->pits[s1->nhd]) / (x2 - x1); + s0 = 3 * (s2->pits[s2->nhd] - + s1->pits[s1->nhd]) / (x2 - x1); if (s0 > 0) { if (a < 0) a = 0; @@ -2830,7 +2838,7 @@ break; } - ym += dy + 4; + ym += dy + 2; y1 = ym + a * (x1 - xm); y2 = ym + a * (x2 - xm); putxy(x2 - x1, y2 - y1); @@ -2856,7 +2864,6 @@ /*fixme: think to all that again..*/ x1 = s1->x - 7; -#if 1 if (s2->dur > s2->prev->dur) { if (s2->next) x2 = s2->next->x - s2->next->wl - 8; @@ -2864,21 +2871,15 @@ x2 = realwidth - 6; } else { x2 = s2->x + 2; - if (s2->shhd[s2->nhd] > 0) - x2 += s2->shhd[s2->nhd]; + if (s2->u.note.notes[s2->nhd].shhd > 0) + x2 += s2->u.note.notes[s2->nhd].shhd; } -#else - if (s2->next) - x2 += (s2->next->x - s2->next->wl - s2->x - s2->wr) * 0.5; - else - x2 += (realwidth - s2->x) * 0.5; -#endif if (s1->staff == upstaff) { sy = s1; - if (sy->as.type != ABC_T_NOTE) { + if (sy->abc_type != ABC_T_NOTE) { for (sy = sy->next; sy != s2; sy = sy->next) - if (sy->as.type == ABC_T_NOTE) + if (sy->abc_type == ABC_T_NOTE) break; } y1 = y_get(upstaff, 0, sy->x, 0); @@ -2887,9 +2888,9 @@ } if (s2->staff == upstaff) { sy = s2; - if (sy->as.type != ABC_T_NOTE) { + if (sy->abc_type != ABC_T_NOTE) { for (sy = sy->prev; sy != s1; sy = sy->prev) - if (sy->as.type == ABC_T_NOTE) + if (sy->abc_type == ABC_T_NOTE) break; } y2 = y_get(upstaff, 0, sy->x, 0); @@ -2933,7 +2934,7 @@ break; } - ym += dy - 12; + ym += dy - 10; y1 = ym + a * (x1 - xm); y2 = ym + a * (x2 - xm); putxy(x2 - x1, y2 - y1); @@ -2941,7 +2942,7 @@ a2b("y%d tubrl",upstaff); /* shift the slurs / decorations */ - ym -= 8; + ym -= 2; for (sy = s1; ; sy = sy->next) { if (sy->staff == upstaff) { if (sy == s2) @@ -2956,18 +2957,19 @@ } } /* lower voice */ - if ((t->u & 0x0f) == 1) { /* if 'value' == none */ - s->sflags &= ~S_IN_TUPLET; - return next; + if ((t->aux & 0x00f0) == 0x10) { /* if 'which' == none */ + a2b("\n"); + goto done; } yy = .5 * (y1 + y2); - if ((t->u & 0x0f) == 0) /* if 'value' == number */ - a2b("(%d)", t->as.u.tuplet.p_plet); + if ((t->aux & 0x00f0) == 0) /* if 'which' == number */ + a2b("(%d)", t->u.tuplet.p_plet); else - a2b("(%d:%d)", t->as.u.tuplet.p_plet, - t->as.u.tuplet.q_plet); + a2b("(%d:%d)", t->u.tuplet.p_plet, t->u.tuplet.q_plet); putxy(xm, yy); a2b("y%d bnumb\n", upstaff); + +done: s->sflags &= ~S_IN_TUPLET; return next; } @@ -2976,8 +2978,8 @@ static void draw_note_ties(struct SYMBOL *k1, struct SYMBOL *k2, int ntie, - int *mhead1, - int *mhead2, + unsigned char *mhead1, + unsigned char *mhead2, int job) { int i, s, m1, m2, p, p1, p2, y, staff; @@ -2987,36 +2989,37 @@ m1 = mhead1[i]; p1 = k1->pits[m1]; m2 = mhead2[i]; - p2 = k2->pits[m2]; - s = (k1->as.u.note.ti1[m1] & 0x03) == SL_ABOVE ? 1 : -1; + p2 = job != 2 ? k2->pits[m2] : p1; + s = (k1->u.note.notes[m1].ti1 & 0x07) == SL_ABOVE ? 1 : -1; x1 = k1->x; - sh = k1->shhd[m1]; /* head shift */ + sh = k1->u.note.notes[m1].shhd; /* head shift */ if (s > 0) { if (m1 < k1->nhd && p1 + 1 == k1->pits[m1 + 1]) - if (k1->shhd[m1 + 1] > sh) - sh = k1->shhd[m1 + 1]; + if (k1->u.note.notes[m1 + 1].shhd > sh) + sh = k1->u.note.notes[m1 + 1].shhd; } else { if (m1 > 0 && p1 == k1->pits[m1 - 1] + 1) - if (k1->shhd[m1 - 1] > sh) - sh = k1->shhd[m1 - 1]; + if (k1->u.note.notes[m1 - 1].shhd > sh) + sh = k1->u.note.notes[m1 - 1].shhd; } // x1 += sh; x1 += sh * 0.6; x2 = k2->x; - sh = k2->shhd[m2]; - if (s > 0) { - if (m2 < k2->nhd && p2 + 1 == k2->pits[m2 + 1]) - if (k2->shhd[m2 + 1] < sh) - sh = k2->shhd[m2 + 1]; - } else { - if (m2 > 0 && p2 == k2->pits[m2 - 1] + 1) - if (k2->shhd[m2 - 1] < sh) - sh = k2->shhd[m2 - 1]; + if (job != 2) { + sh = k2->u.note.notes[m2].shhd; + if (s > 0) { + if (m2 < k2->nhd && p2 + 1 == k2->pits[m2 + 1]) + if (k2->u.note.notes[m2 + 1].shhd < sh) + sh = k2->u.note.notes[m2 + 1].shhd; + } else { + if (m2 > 0 && p2 == k2->pits[m2 - 1] + 1) + if (k2->u.note.notes[m2 - 1].shhd < sh) + sh = k2->u.note.notes[m2 - 1].shhd; + } + x2 += sh * 0.6; } -// x2 += sh; - x2 += sh * 0.6; staff = k1->staff; switch (job) { @@ -3026,25 +3029,30 @@ else p = p2; break; - case 1: /* no starting note */ case 3: /* clef or staff change */ + s = -s; + // fall thru + case 1: /* no starting note */ x1 = k1->x; if (x1 > x2 - 20) x1 = x2 - 20; p = p2; staff = k2->staff; - if (job == 3) - s = -s; break; /* case 2: * no ending note */ default: if (k1 != k2) { - x2 -= k2->wl; + if (k2->type == BAR) + x2 -= 2; + else + x2 -= k2->wl; } else { struct SYMBOL *k; + int time; - for (k = k2->ts_next; k; k = k->ts_next) - if (k->type == STAVES) + time = k1->time + k1->dur; + for (k = k1->ts_next; k; k = k->ts_next) + if (k->time > time) break; if (!k) x2 = realwidth; @@ -3059,12 +3067,17 @@ if (x2 - x1 > 20) { x1 += 3.5; x2 -= 3.5; + } else { + x1 += 1.5; + x2 -= 1.5; } y = 3 * (p - 18); +//fixme: clash when 2 ties on second interval chord +// if (p & 1) +// y += 2 * s; +#if 0 if (job != 1 && job != 3) { - if (p & 1) - y += 2 * s; if (s > 0) { // if (k1->nflags > -2 && k1->stem > 0 // && k1->nhd == 0) @@ -3072,30 +3085,19 @@ if (!(p & 1) && k1->dots > 0) y = 3 * (p - 18) + 6; } - } -// if (job != 2) { - else { - if (p & 1) - y += 2 * s; +// } else { // if (s < 0) { // if (k2->nflags > -2 && k2->stem < 0 // && k2->nhd == 0) // x2 -= 4.5; // } -// if (job != 0) -// y1 = y2; -// } else { -// if (k1 == k2) { /* if continuation on next line */ -// k1->as.u.note.ti1[m1] &= SL_DOTTED; -// k1->as.u.note.ti1[m1] += -// s > 0 ? SL_ABOVE : SL_BELOW; -// } } +#endif h = (.04 * (x2 - x1) + 10) * s; slur_out(x1, staff_tb[staff].y + y, x2, staff_tb[staff].y + y, - s, h, k1->as.u.note.ti1[m1] & SL_DOTTED, -1); + s, h, k1->u.note.notes[m1].ti1 & SL_DOTTED, -1); } } @@ -3109,69 +3111,48 @@ { struct SYMBOL *k3; int i, m1, nh1, pit, ntie, tie2, ntie3, time; - int mhead1[MAXHD], mhead2[MAXHD], mhead3[MAXHD]; - - /* special cases for ties to/from a grace note */ - if (k1->type == GRACE) { - k3 = k1->extra; - while (k3) { - if (k3->type == NOTEREST) - k1 = k3; /* last grace note */ - k3 = k3->next; - } - } - if (k2->type == GRACE) { - k3 = k2->extra; - while (k3) { - if (k3->type == NOTEREST) { - k2 = k3; /* first grace note */ - break; - } - k3 = k3->next; - } - } + unsigned char mhead1[MAXHD], mhead2[MAXHD], mhead3[MAXHD]; + time = k1->time + k1->dur; ntie = ntie3 = 0; nh1 = k1->nhd; - time = k1->time + k1->dur; /* half ties from last note in line or before new repeat */ if (job == 2) { for (i = 0; i <= nh1; i++) { - if (k1->as.u.note.ti1[i]) + if (k1->u.note.notes[i].ti1) mhead3[ntie3++] = i; } - draw_note_ties(k1, k2, ntie3, mhead3, mhead3, job); + draw_note_ties(k1, k2 ? k2 : k1, ntie3, mhead3, mhead3, job); return; } /* set up list of ties to draw */ for (i = 0; i <= nh1; i++) { - if (k1->as.u.note.ti1[i] == 0) + if (k1->u.note.notes[i].ti1 == 0) continue; tie2 = -1; - pit = k1->as.u.note.pits[i]; + pit = k1->u.note.notes[i].pit; for (m1 = k2->nhd; m1 >= 0; m1--) { - switch (k2->as.u.note.pits[m1] - pit) { + switch (k2->u.note.notes[m1].pit - pit) { case 1: /* maybe ^c - _d */ case -1: /* _d - ^c */ - if (k1->as.u.note.accs[i] != k2->as.u.note.accs[m1]) + if (k1->u.note.notes[i].acc != k2->u.note.notes[m1].acc) tie2 = m1; - break; + default: + continue; case 0: - mhead1[ntie] = i; - mhead2[ntie++] = m1; - goto found; + tie2 = m1; + break; } + break; } - if (tie2 >= 0) { /* second choice */ + if (tie2 >= 0) { /* 1st or 2nd choice */ mhead1[ntie] = i; mhead2[ntie++] = tie2; } else { mhead3[ntie3++] = i; /* no match */ } -found: - ; } /* draw the ties */ @@ -3184,20 +3165,20 @@ while (k3 && k3->time < time) k3 = k3->ts_next; while (k3 && k3->time == time) { - if (k3->as.type != ABC_T_NOTE + if (k3->abc_type != ABC_T_NOTE || k3->staff != k1->staff) { k3 = k3->ts_next; continue; } ntie = 0; for (i = ntie3; --i >= 0; ) { - pit = k1->as.u.note.pits[mhead3[i]]; + pit = k1->u.note.notes[mhead3[i]].pit; for (m1 = k3->nhd; m1 >= 0; m1--) { - if (k3->as.u.note.pits[m1] == pit) { + if (k3->u.note.notes[m1].pit == pit) { mhead1[ntie] = mhead3[i]; mhead2[ntie++] = m1; ntie3--; - mhead3[i] = mhead3[ntie3]; +// mhead3[i] = mhead3[--ntie3]; break; } } @@ -3212,30 +3193,75 @@ k3 = k3->ts_next; } - if (ntie3 != 0) +// if (ntie3 != 0) error(1, k1, "Bad tie"); } +static void draw_ties_g(struct SYMBOL *s1, + struct SYMBOL *s2, + int job) +{ + struct SYMBOL *g; + + if (s1->type == GRACE) { + for (g = s1->extra; g; g = g->next) { + if (g->sflags & S_TI1) + draw_ties(g, s2, job); + } + } else { + draw_ties(s1, s2, job); + } +} + +/* -- try to get the symbol of a ending tie when combined voices -- */ +static struct SYMBOL *tie_comb(struct SYMBOL *s) +{ + struct SYMBOL *s1; + int time, st; + + time = s->time + s->dur; + st = s->staff; + for (s1 = s->ts_next; s1; s1 = s1->ts_next) { + if (s1->staff != st) + continue; + if (s1->time == time) { + if (s1->abc_type == ABC_T_NOTE) + return s1; + continue; + } + if (s1->time > time) + return s; // bad tie + } + return NULL; // no ending tie +} + /* -- draw all ties between neighboring notes -- */ static void draw_all_ties(struct VOICE_S *p_voice) { - struct SYMBOL *s1, *s2, *rtie; + struct SYMBOL *s1, *s2, *s3, *s4, *rtie; struct SYMBOL tie; - int clef_chg; + int clef_chg, time; - for (s1 = p_voice->sym->next; s1; s1 = s1->next) - if (s1->type != KEYSIG && s1->type != TIMESIG) - break; + for (s1 = p_voice->sym; s1; s1 = s1->next) { + switch (s1->type) { + case CLEF: + case KEYSIG: + case TIMESIG: + continue; + } + break; + } rtie = p_voice->rtie; /* tie from 1st repeat bar */ for (s2 = s1; s2; s2 = s2->next) { - if (s2->as.type == ABC_T_NOTE +// if (s2->abc_type == ABC_T_NOTE + if (s2->dur || s2->type == GRACE) break; if (s2->type != BAR - || !s2->as.u.bar.repeat_bar - || !s2->as.text) + || !s2->u.bar.repeat_bar + || !s2->text) continue; - if (s2->as.text[0] == '1') /* 1st repeat bar */ + if (s2->text[0] == '1') /* 1st repeat bar */ rtie = p_voice->tie; else p_voice->tie = rtie; @@ -3247,7 +3273,7 @@ s1 = p_voice->tie; p_voice->tie = NULL; s1->staff = s2->staff; - s1->ts_next = tsfirst->next; /* (for tie to other voice) */ + s1->ts_next = s2->ts_next; /* (for tie to other voice) */ s1->time = s2->time - s1->dur; /* (if after repeat sequence) */ draw_ties(s1, s2, 1); /* tie to 1st note */ } @@ -3261,22 +3287,25 @@ if (!rtie) continue; if (s1->type != BAR - || !s1->as.u.bar.repeat_bar - || !s1->as.text) + || !s1->u.bar.repeat_bar + || !s1->text) continue; - if (s1->as.text[0] == '1') { /* 1st repeat bar */ + if (s1->text[0] == '1') { /* 1st repeat bar */ rtie = NULL; continue; } + if (s1->u.bar.type == B_BAR) + continue; // not a repeat for (s2 = s1->next; s2; s2 = s2->next) - if (s2->as.type == ABC_T_NOTE) + if (s2->abc_type == ABC_T_NOTE) break; if (!s2) { s1 = NULL; break; } memcpy(&tie, rtie, sizeof tie); - tie.x = s1->x + s1->wr; +// tie.x = s1->x + s1->wr; + tie.x = s1->x; tie.next = s2; tie.staff = s2->staff; tie.time = s2->time - tie.dur; @@ -3287,83 +3316,102 @@ /* search the end of the tie * and notice the clef changes (may occur in an other voice) */ - for (s2 = s1->ts_next; s2; s2 = s2->ts_next) { - if (s2->staff != s1->staff - && s2->voice != s1->voice) - continue; - if (s2->type == CLEF) { - clef_chg = 1; - continue; + time = s1->time + s1->dur; + for (s2 = s1->next; s2; s2 = s2->next) { + if (s2->dur != 0) + break; + if (s2->type == BAR + && s2->u.bar.repeat_bar + && s2->text) { + if (s2->text[0] != '1') + break; + rtie = s1; /* 1st repeat bar */ } - if (s2->voice != s1->voice) - continue; - if (s2->as.type == ABC_T_NOTE) { - if (s2->time != s1->time + s1->dur) - s2 = NULL; /* %%combinevoices */ - break; + } + if (!s2) { + for (s4 = s1->ts_next; s4; s4 = s4->ts_next) { + if (s4->staff != s1->staff) + continue; + if (s4->time < time) + continue; + if (s4->time > time) { + s4 = NULL; + break; + } + if (s4->dur != 0) + break; } - if (s2->type == GRACE) + if (!s4) { + draw_ties_g(s1, NULL, 2); + p_voice->tie = s1; break; - if (s2->type == BAR) { - if ((s2->sflags & S_RRBAR) - || s2->as.u.bar.type == B_THIN_THICK - || s2->as.u.bar.type == B_THICK_THIN) - break; - if (!s2->as.u.bar.repeat_bar - || !s2->as.text) + } + } else { + if (s2->abc_type != ABC_T_NOTE + && s2->abc_type != ABC_T_BAR) { + error(1, s1, "Bad tie"); + continue; + } + if (s2->time == time) { + s4 = s2; + } else { + s4 = tie_comb(s1); + if (s4 == s1) { + error(1, s1, "Bad tie"); continue; - if (s2->as.text[0] != '1') - break; - rtie = s1; /* 1st repeat bar */ + } } } - if (!s2) { - struct SYMBOL *s3; - - /* special case: tie to a combined chord */ - if (s1->ts_prev && s1->ts_prev->next) { - int time; - - s3 = s1->ts_prev->next; /* previous voice */ - time = s1->time + s1->dur; - if (s3->time == time) { - while (s3 && s3->time == time - && s3->as.type != ABC_T_NOTE) - s3 = s3->next; - if (s3 - && s3->time == time - && s3->as.type == ABC_T_NOTE) { - draw_ties(s1, s3, 1); - break; - } + for (s3 = s1->ts_next; s3; s3 = s3->ts_next) { + if (s3->staff != s1->staff) + continue; + if (s3->time > time) + break; + if (s3->type == CLEF) { + clef_chg = 1; + continue; + } +#if 0 + if (s3->type == BAR) { +// if ((s3->sflags & S_RRBAR) +// || s3->u.bar.type == B_THIN_THICK +// || s3->u.bar.type == B_THICK_THIN) { +// s4 = s3; +// break; +// } + if (!s3->u.bar.repeat_bar + || !s3->text) + continue; + if (s3->text[0] != '1') { + s4 = s3; + break; } + rtie = s1; /* 1st repeat bar */ } - draw_ties(s1, s1, 2); - p_voice->tie = s1; - break; +#endif } /* ties with clef or staff change */ - if (clef_chg || s1->staff != s2->staff) { + if (clef_chg || s1->staff != s4->staff) { float x, dx; clef_chg = 0; - dx = (s2->x - s1->x) * 0.4; - x = s2->x; - s2->x -= dx; - if (s2->x > s1->x + 32.) - s2->x = s1->x + 32.; - draw_ties(s1, s2, 2); - s2->x = x; + dx = (s4->x - s1->x) * 0.4; + x = s4->x; + s4->x -= dx; + if (s4->x > s1->x + 32.) + s4->x = s1->x + 32.; + draw_ties_g(s1, s4, 2); + s4->x = x; x = s1->x; s1->x += dx; - if (s1->x < s2->x - 24.) - s1->x = s2->x - 24.; - draw_ties(s1, s2, 3); + if (s1->x < s4->x - 24.) + s1->x = s4->x - 24.; + draw_ties(s1, s4, 3); s1->x = x; continue; } - draw_ties(s1, s2, s2->as.type == ABC_T_NOTE ? 0 : 2); + draw_ties_g(s1, s4, s4->abc_type == ABC_T_NOTE ? 0 : 2); } p_voice->rtie = rtie; } @@ -3376,7 +3424,7 @@ int i, m2, slur_type; unsigned char slur_st; - s = p_voice->sym->next; + s = p_voice->sym; if (!s) return; slur_type = p_voice->slur_st; @@ -3385,9 +3433,9 @@ /* the starting slur types are inverted */ slur_st = 0; while (slur_type != 0) { - slur_st <<= 3; - slur_st |= (slur_type & 0x07); - slur_type >>= 3; + slur_st <<= 4; + slur_st |= (slur_type & 0x0f); + slur_type >>= 4; } /* draw the slurs inside the music line */ @@ -3397,52 +3445,52 @@ for ( ; s; s = s->next) { if (s->type != NOTEREST && s->type != SPACE) continue; - while (s->as.u.note.slur_end + while (s->u.note.slur_end || (s->sflags & S_SL2)) { - if (s->as.u.note.slur_end) { - s->as.u.note.slur_end--; + if (s->u.note.slur_end) { + s->u.note.slur_end--; m2 = -1; } else { for (m2 = 0; m2 <= s->nhd; m2++) - if (s->as.u.note.sl2[m2]) + if (s->u.note.notes[m2].sl2) break; - s->as.u.note.sl2[m2]--; - if (s->as.u.note.sl2[m2] == 0) { + s->u.note.notes[m2].sl2--; + if (s->u.note.notes[m2].sl2 == 0) { for (i = m2 + 1; i <= s->nhd; i++) - if (s->as.u.note.sl2[i]) + if (s->u.note.notes[i].sl2) break; if (i > s->nhd) s->sflags &= ~S_SL2; } } - slur_type = slur_st & 0x07; + slur_type = slur_st & 0x0f; k = prev_scut(s); draw_slur(k, s, -1, m2, slur_type); if (k->type != BAR || (!(k->sflags & S_RRBAR) - && k->as.u.bar.type != B_THIN_THICK - && k->as.u.bar.type != B_THICK_THIN - && (!k->as.u.bar.repeat_bar - || !k->as.text - || k->as.text[0] == '1'))) - slur_st >>= 3; + && k->u.bar.type != B_THIN_THICK + && k->u.bar.type != B_THICK_THIN + && (!k->u.bar.repeat_bar + || !k->text + || k->text[0] == '1'))) + slur_st >>= 4; } } - s = p_voice->sym->next; + s = p_voice->sym; while (slur_st != 0) { - slur_type = slur_st & 0x07; - slur_st >>= 3; + slur_type = slur_st & 0x0f; + slur_st >>= 4; k = next_scut(s); draw_slur(s, k, -1, -1, slur_type); if (k->type != BAR || (!(k->sflags & S_RRBAR) - && k->as.u.bar.type != B_THIN_THICK - && k->as.u.bar.type != B_THICK_THIN - && (!k->as.u.bar.repeat_bar - || !k->as.text - || k->as.text[0] == '1'))) { + && k->u.bar.type != B_THIN_THICK + && k->u.bar.type != B_THICK_THIN + && (!k->u.bar.repeat_bar + || !k->text + || k->text[0] == '1'))) { /*fixme: the slur types are inverted again*/ - p_voice->slur_st <<= 3; + p_voice->slur_st <<= 4; p_voice->slur_st += slur_type; } } @@ -3510,11 +3558,11 @@ char *p; int j, l; - a2b("/y{%.1f y%d}def ", y, p_voice->staff); + a2b("/y{%.1f yns%d}def ", y, p_voice->staff); set_font(VOCALFONT); a2b("%.1f 0 y %d %s\n", realwidth, nly, tblt->head); for (j = 0; j < nly ; j++) { - for (s = p_voice->sym->next; s; s = s->next) { + for (s = p_voice->sym; s; s = s->next) { ly = s->ly; if (!ly || (lyl = ly->lyl[j]) == NULL) { @@ -3523,7 +3571,7 @@ continue; p = &tex_buf[16]; *p-- = '\0'; - l = bar_cnv(s->as.u.bar.type); + l = bar_cnv(s->u.bar.type); while (l != 0) { *p-- = "?|[]:???"[l & 0x07]; l >>= 4; @@ -3555,28 +3603,27 @@ setmap(sf, basemap); for (j = 0; j < 10; j++) memcpy(&workmap[7 * j], basemap, 7); - a2b("gsave 0 %.1f y%d T(%.2s)%s\n", - y, p_voice->staff, + a2b("gsave 0 %.1f yns%d T(%.2s)%s\n", y, p_voice->staff, tblt->instr, tblt->head); tied = 0; for (s = p_voice->sym; s; s = s->next) { switch (s->type) { case NOTEREST: - if (s->as.type == ABC_T_REST) + if (s->abc_type == ABC_T_REST) continue; if (tied) { - tied = s->as.u.note.ti1[0]; + tied = s->u.note.notes[0].ti1; continue; } break; case KEYSIG: - sf = s->as.u.key.sf; + sf = s->u.key.sf; setmap(sf, basemap); for (j = 0; j < 10; j++) memcpy(&workmap[7 * j], basemap, 7); continue; case BAR: - if (s->as.flags & ABC_F_INVIS) + if (s->flags & ABC_F_INVIS) continue; for (j = 0; j < 10; j++) memcpy(&workmap[7 * j], basemap, 7); @@ -3584,8 +3631,8 @@ default: continue; } - pitch = s->as.u.note.pits[0] + 19; - acc = s->as.u.note.accs[0]; + pitch = s->u.note.notes[0].pit + 19; + acc = s->u.note.notes[0].acc; if (acc != 0) { workmap[pitch] = acc == A_NT ? A_NULL @@ -3610,7 +3657,7 @@ int n, d; float micro_p; - n = micro_tb[acc >> 3]; + n = parse.micro_tb[acc >> 3]; d = (n & 0xff) + 1; n = (n >> 8) + 1; switch (acc & 0x07) { @@ -3622,25 +3669,160 @@ micro_p = (float) pitch + (float) n / d; a2b("%d %.3f %.2f %s\n", octave, micro_p, s->x, tblt->note); } - tied = s->as.u.note.ti1[0]; + tied = s->u.note.notes[0].ti1; } a2b("grestore\n"); } /* -- draw the lyrics under (or above) notes -- */ /* !! this routine is tied to set_width() !! */ +static void draw_lyric_line(struct VOICE_S *p_voice, + int j) +{ + struct SYMBOL *s; + struct lyrics *ly; + struct lyl *lyl; + int hyflag, l, lflag; + int ft, curft, defft; + char *p; + float lastx, w; + float x0, shift; + + hyflag = lflag = 0; + if (p_voice->hy_st & (1 << j)) { + hyflag = 1; + p_voice->hy_st &= ~(1 << j); + } + for (s = p_voice->sym; /*s*/; s = s->next) + if (s->type != CLEF + && s->type != KEYSIG && s->type != TIMESIG) + break; + if (s->prev) + lastx = s->prev->x; + else + lastx = tsfirst->x; + x0 = 0; + for ( ; s; s = s->next) { + ly = s->ly; + if (!ly + || (lyl = ly->lyl[j]) == NULL) { + switch (s->type) { + case NOTEREST: + if (s->abc_type == ABC_T_NOTE) + break; + /* fall thru */ + case MREST: + if (lflag) { + putx(x0 - lastx); + putx(lastx + 3); + a2b("y wln "); + lflag = 0; + lastx = s->x + s->wr; + } + } + continue; + } +#if 1 + ft = lyl->f - cfmt.font_tb; + get_str_font(&curft, &defft); + if (ft != curft) { + set_str_font(ft, defft); + } +#else + if (lyl->f != f) { /* font change */ + f = lyl->f; + str_font(f - cfmt.font_tb); + if (lskip < f->size * 1.1) + lskip = f->size * 1.1; + } +#endif + p = lyl->t; + w = lyl->w; + shift = lyl->s; + if (hyflag) { + if (*p == LY_UNDER) { /* '_' */ + *p = LY_HYPH; + } else if (*p != LY_HYPH) { /* not '-' */ + putx(s->x - shift - lastx); + putx(lastx); + a2b("y hyph "); + hyflag = 0; + lastx = s->x + s->wr; + } + } + if (lflag + && *p != LY_UNDER) { /* not '_' */ + putx(x0 - lastx + 3); + putx(lastx + 3); + a2b("y wln "); + lflag = 0; + lastx = s->x + s->wr; + } + if (*p == LY_HYPH /* '-' */ + || *p == LY_UNDER) { /* '_' */ + if (x0 == 0 && lastx > s->x - 18) + lastx = s->x - 18; + if (*p == LY_HYPH) + hyflag = 1; + else + lflag = 1; + x0 = s->x - shift; + continue; + } + x0 = s->x - shift; + l = strlen(p) - 1; + if (p[l] == LY_HYPH) { /* '-' at end */ + p[l] = '\0'; + hyflag = 1; + } + putx(x0); + a2b("y M "); + put_str(p, A_LYRIC); + lastx = x0 + w; + } + if (hyflag) { + x0 = realwidth - 10; + if (x0 < lastx + 10) + x0 = lastx + 10; + putx(x0 - lastx); + putx(lastx); + a2b("y hyph "); + if (cfmt.hyphencont) + p_voice->hy_st |= (1 << j); + } + + /* see if any underscore in the next line */ + for (s = tsnext; s; s = s->ts_next) + if (s->voice == p_voice - voice_tb) + break; + for ( ; s; s = s->next) { + if (s->abc_type == ABC_T_NOTE) { + if (s->ly && s->ly->lyl[j] + && s->ly->lyl[j]->t[0] == LY_UNDER) { + lflag = 1; + x0 = realwidth - 15; + if (x0 < lastx + 12) + x0 = lastx + 12; + } + break; + } + } + if (lflag) { + putx(x0 - lastx + 3); + putx(lastx + 3); + a2b("y wln"); + } + a2b("\n"); +} + static float draw_lyrics(struct VOICE_S *p_voice, int nly, + float *h, float y, int incr) /* 1: below, -1: above */ { - int hyflag, l, j, lflag; - char *p; - float lastx, w, lskip, desc; - struct SYMBOL *s; - struct FONTSPEC *f; - struct lyrics *ly; - struct lyl *lyl; + int j, top; + float sc; /* check if the lyrics contain tablatures */ if (p_voice->tblts[0]) { @@ -3651,157 +3833,36 @@ return y; /* yes */ } + str_font(VOCALFONT); outft = -1; /* force font output */ - lskip = 0; /* (compiler warning) */ - f = NULL; /* (force new font) */ - if (incr > 0) { /* under the staff */ - j = 0; -/*fixme: may not be the current font*/ - y -= cfmt.font_tb[VOCALFONT].size; + sc = staff_tb[p_voice->staff].staffscale; + + /* under the staff */ + if (incr > 0) { if (y > -cfmt.vocalspace) y = -cfmt.vocalspace; - } else { - int top; - - top = staff_tb[p_voice->staff].topbar; - j = nly - 1; - nly = -1; - if (y < top + cfmt.vocalspace - cfmt.font_tb[VOCALFONT].size) - y = top + cfmt.vocalspace - cfmt.font_tb[VOCALFONT].size; - } -/*fixme: may not be the current font*/ - desc = cfmt.font_tb[VOCALFONT].size * .25; /* descent */ - for (; j != nly ; j += incr) { - float x0, shift; - - a2b("/y{%.1f y%d}! ", y + desc, p_voice->staff); - hyflag = lflag = 0; - if (p_voice->hy_st & (1 << j)) { - hyflag = 1; - p_voice->hy_st &= ~(1 << j); - } - for (s = p_voice->sym; /*s*/; s = s->next) - if (s->type != CLEF - && s->type != KEYSIG && s->type != TIMESIG) - break; - if (s->prev) - lastx = s->prev->x; - else - lastx = 0; - x0 = 0; - if (f != 0) - lskip = f->size * 1.1; - for ( ; s; s = s->next) { - ly = s->ly; - if (!ly - || (lyl = ly->lyl[j]) == NULL) { - switch (s->type) { - case NOTEREST: - if (s->as.type == ABC_T_NOTE) - break; - /* fall thru */ - case MREST: - if (lflag) { - putx(x0 - lastx); - putx(lastx + 3); - a2b("y wln "); - lflag = 0; - lastx = s->x + s->wr; - } - } - continue; - } - if (lyl->f != f) { /* font change */ - f = lyl->f; - str_font(f - cfmt.font_tb); - if (lskip < f->size * 1.1) - lskip = f->size * 1.1; - } - p = lyl->t; - w = lyl->w; - shift = lyl->s; - if (hyflag) { - if (*p == LY_UNDER) { /* '_' */ - *p = LY_HYPH; - } else if (*p != LY_HYPH) { /* not '-' */ - putx(s->x - shift - lastx); - putx(lastx); - a2b("y hyph "); - hyflag = 0; - lastx = s->x + s->wr; - } - } - if (lflag - && *p != LY_UNDER) { /* not '_' */ - putx(x0 - lastx + 3); - putx(lastx + 3); - a2b("y wln "); - lflag = 0; - lastx = s->x + s->wr; - } - if (*p == LY_HYPH /* '-' */ - || *p == LY_UNDER) { /* '_' */ - if (x0 == 0 && lastx > s->x - 18) - lastx = s->x - 18; - if (*p == LY_HYPH) - hyflag = 1; - else - lflag = 1; - x0 = s->x - shift; - continue; - } - x0 = s->x - shift; - l = strlen(p) - 1; - if (p[l] == LY_HYPH) { /* '-' at end */ - p[l] = '\0'; - hyflag = 1; - } - putx(x0); - a2b("y M "); - put_str(p, A_LYRIC); - lastx = x0 + w; - } - if (hyflag) { - x0 = realwidth - 10; - if (x0 < lastx + 10) - x0 = lastx + 10; - putx(x0 - lastx); - putx(lastx); - a2b("y hyph "); - if (cfmt.hyphencont) - p_voice->hy_st |= (1 << j); - } - - /* see if any underscore in the next line */ - for (s = tsnext; s; s = s->ts_next) - if (s->voice == p_voice - voice_tb) - break; - for ( ; s; s = s->next) { - if (s->as.type == ABC_T_NOTE) { - if (s->ly && s->ly->lyl[j] != 0 - && s->ly->lyl[j]->t[0] == LY_UNDER) { - lflag = 1; - x0 = realwidth - 15; - if (x0 < lastx + 12) - x0 = lastx + 12; - } - break; - } - } - if (lflag) { - putx(x0 - lastx + 3); - putx(lastx + 3); - a2b("y wln"); - } - a2b("\n"); - if (incr > 0) - y -= lskip; - else - y += lskip; + y += h[0] / 6; // descent + y *= sc; + for (j = 0; j < nly; j++) { + y -= h[j] * 1.1; + a2b("/y{%.1f yns%d}! ", y, p_voice->staff); + draw_lyric_line(p_voice, j); + } + return (y - h[j - 1] / 6) / sc; + } + + /* above the staff */ + top = staff_tb[p_voice->staff].topbar + cfmt.vocalspace; + if (y < top) + y = top; + y += h[nly - 1] / 6; // descent + y *= sc; + for (j = nly; --j >= 0; ) { + a2b("/y{%.1f yns%d}! ", y, p_voice->staff); + draw_lyric_line(p_voice, j); + y += h[j] * 1.1; } - if (incr > 0) - y += lskip; - return y; + return y / sc; } /* -- draw all the lyrics and the tablatures -- */ @@ -3815,10 +3876,13 @@ short a, b; float top, bot; } lyst_tb[MAXSTAFF]; - char nly_tb[MAXVOICE]; + struct { + int nly; + float h[MAXLY]; + } lyvo_tb[MAXVOICE]; char above_tb[MAXVOICE]; char rv_tb[MAXVOICE]; - float top, bot, y; + float top, bot, y, sc; /* check if any lyric */ for (p_voice = first_voice; p_voice; p_voice = p_voice->next) { @@ -3832,7 +3896,7 @@ /* compute the number of lyrics per voice - staff * and their y offset on the staff */ memset(above_tb, 0, sizeof above_tb); - memset(nly_tb, 0, sizeof nly_tb); + memset(lyvo_tb, 0, sizeof lyvo_tb); memset(lyst_tb, 0, sizeof lyst_tb); staff = -1; top = bot = 0; @@ -3845,7 +3909,7 @@ bot = 0; staff = p_voice->staff; } - nly = 0; + nly = -1; if (p_voice->have_ly) { for (s = p_voice->sym; s; s = s->next) { struct lyrics *ly; @@ -3856,7 +3920,7 @@ continue; /*fixme:should get the real width*/ x = s->x; - if (ly->lyl[0] != 0) { + if (ly->lyl[0]) { x -= ly->lyl[0]->s; w = ly->lyl[0]->w; } else { @@ -3868,12 +3932,15 @@ y = y_get(p_voice->staff, 0, x, w); if (bot > y) bot = y; - for (i = MAXLY; --i >= 0; ) - if (ly->lyl[i] != 0) - break; - i++; - if (i > nly) - nly = i; + for (i = 0; i < MAXLY; i++) { + if (!ly->lyl[i]) + continue; + if (i > nly) + nly = i; + if (lyvo_tb[voice].h[i] < ly->lyl[i]->f->size) + lyvo_tb[voice].h[i] = + ly->lyl[i]->f->size; + } } } else { y = y_get(p_voice->staff, 1, 0, realwidth); @@ -3885,9 +3952,10 @@ } lyst_tb[staff].top = top; lyst_tb[staff].bot = bot; - if (nly == 0) + if (nly < 0) continue; - nly_tb[voice] = nly; + nly++; + lyvo_tb[voice].nly = nly; if (p_voice->posit.voc != 0) above_tb[voice] = p_voice->posit.voc == SL_ABOVE; else if (p_voice->next @@ -3917,25 +3985,34 @@ continue; } staff = p_voice->staff; - set_sscale(staff); - if (nly_tb[voice] > 0) - lyst_tb[staff].bot = draw_lyrics(p_voice, nly_tb[voice], + if (lyvo_tb[voice].nly > 0) + lyst_tb[staff].bot = draw_lyrics(p_voice, lyvo_tb[voice].nly, + lyvo_tb[voice].h, lyst_tb[staff].bot, 1); + sc = staff_tb[p_voice->staff].staffscale; for (nly = 0; nly < 2; nly++) { if ((tblt = p_voice->tblts[nly]) == NULL) break; - if (tblt->hu > 0) { - lyst_tb[staff].bot -= tblt->hu; - lyst_tb[staff].b = 1; - } +// if (tblt->hu > 0) { +// lyst_tb[staff].bot -= tblt->hu; +// lyst_tb[staff].b = 1; +// } if (tblt->pitch == 0) - draw_tblt_w(p_voice, nly_tb[voice], - lyst_tb[staff].bot, tblt); + draw_tblt_w(p_voice, + lyvo_tb[voice].nly, + lyst_tb[staff].bot * sc - tblt->hu, + tblt); else - draw_tblt_p(p_voice, lyst_tb[staff].bot, + draw_tblt_p(p_voice, +// lyst_tb[staff].bot, + lyst_tb[staff].bot * sc - tblt->hu, tblt); + if (tblt->hu > 0) { + lyst_tb[staff].bot -= tblt->hu / sc; + lyst_tb[staff].b = 1; + } if (tblt->ha != 0) { - lyst_tb[staff].top += tblt->ha; + lyst_tb[staff].top += tblt->ha / sc; lyst_tb[staff].a = 1; } } @@ -3946,8 +4023,8 @@ voice = rv_tb[i]; p_voice = &voice_tb[voice]; staff = p_voice->staff; - set_sscale(staff); - lyst_tb[staff].top = draw_lyrics(p_voice, nly_tb[voice], + lyst_tb[staff].top = draw_lyrics(p_voice, lyvo_tb[voice].nly, + lyvo_tb[voice].h, lyst_tb[staff].top, -1); } @@ -3956,10 +4033,9 @@ if (!p_voice->sym) continue; staff = p_voice->staff; - set_sscale(staff); if (lyst_tb[staff].a) { top = lyst_tb[staff].top + 2; - for (s = p_voice->sym->next; s; s = s->next) { + for (s = p_voice->sym; s; s = s->next) { /*fixme: may have lyrics crossing a next symbol*/ if (s->ly) { /*fixme:should set the real width*/ @@ -3969,8 +4045,8 @@ } if (lyst_tb[staff].b) { bot = lyst_tb[staff].bot - 2; - if (nly_tb[p_voice - voice_tb] > 0) { - for (s = p_voice->sym->next; s; s = s->next) { + if (lyvo_tb[p_voice - voice_tb].nly > 0) { + for (s = p_voice->sym; s; s = s->next) { if (s->ly) { /*fixme:should set the real width*/ y_set(staff, 0, s->x - 2, 10, bot); @@ -4000,7 +4076,8 @@ void draw_sym_near(void) { struct VOICE_S *p_voice; - struct SYMBOL *s; + struct SYMBOL *s, *g; + int i, staff; /* calculate the beams but don't draw them (the staves are not yet defined) */ for (p_voice = first_voice; p_voice; p_voice = p_voice->next) { @@ -4008,7 +4085,14 @@ int first_note = 1; for (s = p_voice->sym; s; s = s->next) { - if (s->as.type != ABC_T_NOTE) + for (g = s->extra; g; g = g->next) { + if (g->type != NOTEREST) + continue; + if ((g->sflags & (S_BEAM_ST | S_BEAM_END)) + == S_BEAM_ST) + calculate_beam(&bm, g); + } + if (s->abc_type != ABC_T_NOTE) continue; if (((s->sflags & S_BEAM_ST) && !(s->sflags & S_BEAM_END)) || (first_note && !(s->sflags & S_BEAM_ST))) { @@ -4019,14 +4103,10 @@ } /* initialize the y offsets */ - { - int i, staff; - - for (staff = 0; staff <= nstaff; staff++) { - for (i = 0; i < YSTEP; i++) { - staff_tb[staff].top[i] = 0; - staff_tb[staff].bot[i] = 24; - } + for (staff = 0; staff <= nstaff; staff++) { + for (i = 0; i < YSTEP; i++) { + staff_tb[staff].top[i] = 0; + staff_tb[staff].bot[i] = 24; } } @@ -4036,18 +4116,14 @@ /* set the min/max vertical offsets */ for (s = tsfirst; s; s = s->ts_next) { int y; - struct SYMBOL *g; -// if (!s->prev) -// continue; /* skip the clefs */ - if (s->as.flags & ABC_F_INVIS) + if (s->flags & ABC_F_INVIS) continue; if (s->type == GRACE) { - g = s->extra; - for ( ; g; g = g->next) { - y_set(s->staff, 1, g->x - g->wl, g->wl + g->wr, + for (g = s->extra; g; g = g->next) { + y_set(s->staff, 1, g->x - 2, 4, g->ymx + 1); - y_set(s->staff, 0, g->x - g->wl, g->wl + g->wr, + y_set(s->staff, 0, g->x - 2, 4, g->ymn - 1); } continue; @@ -4058,20 +4134,20 @@ } else { y_set(s->staff, 1, s->x - 16, 32, s->ymx + 2); } - if (s->as.type != ABC_T_NOTE) + if (s->abc_type != ABC_T_NOTE) continue; /* have room for the accidentals */ - if (s->as.u.note.accs[s->nhd]) { + if (s->u.note.notes[s->nhd].acc) { y = s->y + 8; if (s->ymx < y) s->ymx = y; y_set(s->staff, 1, s->x, 0., y); } - if (s->as.u.note.accs[0]) { + if (s->u.note.notes[0].acc) { y = s->y; - if ((s->as.u.note.accs[0] & 0x07) == A_SH - || s->as.u.note.accs[0] == A_NT) + if ((s->u.note.notes[0].acc & 0x07) == A_SH + || s->u.note.notes[0].acc == A_NT) y -= 7; else y -= 5; @@ -4084,21 +4160,20 @@ if (cfmt.measurenb >= 0) draw_measnb(); - draw_deco_note(); +// draw_deco_note(); for (p_voice = first_voice; p_voice; p_voice = p_voice->next) { s = p_voice->sym; if (!s) continue; - set_sscale(cursys->voice[p_voice - voice_tb].staff); +//color + set_color(s->color); + set_sscale(p_voice->staff); /* draw the tuplets near the notes */ - for (s = s->next; s; s = s->next) { - struct SYMBOL *g; - - if ((s->sflags & S_IN_TUPLET) - && (g = s->extra) != NULL) { - for ( ; g; g = g->next) { + for ( ; s; s = s->next) { + if (s->sflags & S_IN_TUPLET) { + for (g = s->extra; g; g = g->next) { if (g->type == TUPLET) { s = draw_tuplet(g, s); break; @@ -4109,12 +4184,9 @@ draw_all_slurs(p_voice); /* draw the tuplets over the slurs */ - for (s = p_voice->sym->next; s; s = s->next) { - struct SYMBOL *g; - - if ((s->sflags & S_IN_TUPLET) - && (g = s->extra) != NULL) { - for ( ; g; g = g->next) { + for (s = p_voice->sym; s; s = s->next) { + if (s->sflags & S_IN_TUPLET) { + for (g = s->extra ; g; g = g->next) { if (g->type == TUPLET) { s = draw_tuplet(g, s); break; @@ -4126,12 +4198,11 @@ /* set the top and bottom for all symbols to be out of the staves */ { - int top, bot, i, staff; + int top, bot; for (staff = 0; staff <= nstaff; staff++) { top = staff_tb[staff].topbar + 2; bot = staff_tb[staff].botbar - 2; -/*fixme:should handle stafflines changes*/ for (i = 0; i < YSTEP; i++) { if (top > staff_tb[staff].top[i]) staff_tb[staff].top[i] = (float) top; @@ -4140,9 +4211,11 @@ } } } - draw_all_lyrics(); + set_color(0); + draw_deco_note(); draw_deco_staff(); set_sscale(-1); /* restore the scale parameters */ + draw_all_lyrics(); } /* -- draw the name/subname of the voices -- */ @@ -4208,7 +4281,7 @@ continue; y = staff_tb[staff].y + staff_tb[staff].topbar * .5 - * staff_tb[staff].clef.staffscale + * staff_tb[staff].staffscale + 9 * (staff_p->nl - 1) - cfmt.font_tb[VOICEFONT].size * .3; n = staff; @@ -4235,36 +4308,6 @@ } } -/* -- adjust the empty flag in a staff system -- */ -static void set_empty(struct SYSTEM *sy) -{ - int staff; - - /* if a system brace has empty and non empty staves, keep all staves */ - for (staff = 0; staff <= nstaff; staff++) { - int i, empty_fl; - - if (!(sy->staff[staff].flags & (OPEN_BRACE | OPEN_BRACE2))) - continue; - empty_fl = 0; - i = staff; - while (staff <= nstaff) { - if (sy->staff[staff].empty) - empty_fl |= 1; - else - empty_fl |= 2; - if (cursys->staff[staff].flags & (CLOSE_BRACE | CLOSE_BRACE2)) - break; - staff++; - } - if (empty_fl == 3) { /* if empty and not empty staves */ -/*fixme: add measure bars on empty main voices*/ - while (i <= staff) - sy->staff[i++].empty = 0; - } - } -} - /* -- set the y offset of the staves and return the whole height -- */ static float set_staff(void) { @@ -4279,23 +4322,22 @@ for (staff = 0; staff <= nstaff; staff++) staff_tb[staff].empty = 0; sy = cursys; - set_empty(sy); for (staff = 0; staff <= nstaff; staff++) { if (!sy->staff[staff].empty) empty[staff] = 0; } for (s = tsfirst; s; s = s->ts_next) { - if (s->type != STAVES) + if (!(s->sflags & S_NEW_SY)) continue; sy = sy->next; - set_empty(sy); for (staff = 0; staff <= nstaff; staff++) { if (!sy->staff[staff].empty) empty[staff] = 0; } } - /* output the scale of the voices */ + /* output the scale of the voices + * and flag as non empty the staves with tablatures */ { struct VOICE_S *p_voice; @@ -4304,6 +4346,8 @@ a2b("/scvo%d{gsave %.2f dup scale}!\n", (int) (p_voice - voice_tb), p_voice->scale); + if (p_voice->tblts[0]) + empty[p_voice->staff] = 0; } } @@ -4313,21 +4357,26 @@ break; staff_tb[staff].empty = 1; } - if (staff > nstaff) - staff--; /* one staff, empty */ - y = 0; - for (i = 0; i < YSTEP; i++) { - v = staff_tb[staff].top[i]; - if (y < v) - y = v; + if (staff > nstaff) { + staff--; /* one staff, empty */ + } else { + for (i = 0; i < YSTEP; i++) { + v = staff_tb[staff].top[i]; + if (y < v) + y = v; + } } /* draw the parts and tempo indications if any */ y += draw_partempo(staff, y); + if (empty[staff]) + return y; + + y *= staff_tb[staff].staffscale; staffsep = cfmt.staffsep * 0.5 + - staff_tb[staff].topbar * staff_tb[staff].clef.staffscale; + staff_tb[staff].topbar * staff_tb[staff].staffscale; if (y < staffsep) y = staffsep; staff_tb[staff].y = -y; @@ -4349,31 +4398,31 @@ maxsep = cfmt.maxsysstaffsep; dy = 0; - if (staff_tb[staff].clef.staffscale - == staff_tb[prev_staff].clef.staffscale) { + if (staff_tb[staff].staffscale + == staff_tb[prev_staff].staffscale) { for (i = 0; i < YSTEP; i++) { v = staff_tb[staff].top[i] - staff_tb[prev_staff].bot[i]; if (dy < v) dy = v; } - dy *= staff_tb[staff].clef.staffscale; + dy *= staff_tb[staff].staffscale; } else { for (i = 0; i < YSTEP; i++) { v = staff_tb[staff].top[i] - * staff_tb[staff].clef.staffscale + * staff_tb[staff].staffscale - staff_tb[prev_staff].bot[i] - * staff_tb[prev_staff].clef.staffscale; + * staff_tb[prev_staff].staffscale; if (dy < v) dy = v; } } staffsep += staff_tb[staff].topbar - * staff_tb[staff].clef.staffscale; + * staff_tb[staff].staffscale; if (dy < staffsep) dy = staffsep; maxsep += staff_tb[staff].topbar - * staff_tb[staff].clef.staffscale; + * staff_tb[staff].staffscale; if (dy > maxsep) dy = maxsep; y += dy; @@ -4387,19 +4436,20 @@ if (mbot > v) mbot = v; } - mbot *= staff_tb[prev_staff].clef.staffscale; + mbot *= staff_tb[prev_staff].staffscale; /* output the staff offsets */ for (staff = nstaff; staff >= 0; staff--) { dy = staff_tb[staff].y; - if (staff_tb[staff].clef.staffscale != 1 - && staff_tb[staff].clef.staffscale != 0) { + if (staff_tb[staff].staffscale != 1 + && staff_tb[staff].staffscale != 0) { a2b("/scst%d{gsave 0 %.2f T %.2f dup scale}!\n", - staff, dy, staff_tb[staff].clef.staffscale); + staff, dy, staff_tb[staff].staffscale); a2b("/y%d{}!\n", staff); } else { a2b("/y%d{%.1f add}!\n", staff, dy); } + a2b("/yns%d{%.1f add}!\n", staff, dy); } if (mbot == 0) { @@ -4417,37 +4467,31 @@ maxsep = cfmt.maxstaffsep * 0.5; if (dy > maxsep) dy = maxsep; - y += dy; - if (y > cfmt.maxstaffsep) - y = cfmt.maxstaffsep; /* return the whole staff system height */ - return y; + return y + dy; } /* -- set the bottom and height of the measure bars -- */ -static void bar_set(float *bar_bot, float *bar_height) +static void bar_set(float *bar_bot, float *bar_height, float *xstaff) { - int staff, nlines; - float dy, staffscale; - /* !! max number of staff lines !! */ - static const char top[10] = {18, 18, 12, 18, 18, 24, 30, 36, 42, 48}; - static const char bot[10] = { 6, 6, 6, 6, 0, 0, 0, 0, 0, 0}; + int staff; + float dy, staffscale, top, bot; dy = 0; - for (staff = 0; staff <= nstaff; staff++) { - nlines = cursys->staff[staff].clef.stafflines; - staffscale = cursys->staff[staff].clef.staffscale; - if (cursys->staff[staff].empty) { + for (staff = 0; staff <= cursys->nstaff; staff++) { +// if (cursys->staff[staff].empty) { + if (xstaff[staff] < 0) { bar_bot[staff] = bar_height[staff] = 0; continue; } + staffscale = staff_tb[staff].staffscale; + top = staff_tb[staff].topbar * staffscale; + bot = staff_tb[staff].botbar * staffscale; if (dy == 0) - dy = staff_tb[staff].y + top[nlines] * staffscale; - bar_height[staff] = dy - - staff_tb[staff].y - bot[nlines] * staffscale; - - bar_bot[staff] = staff_tb[staff].y + bot[nlines] * staffscale; + dy = staff_tb[staff].y + top; + bar_bot[staff] = staff_tb[staff].y + bot; + bar_height[staff] = dy - bar_bot[staff]; if (cursys->staff[staff].flags & STOP_BAR) dy = 0; @@ -4459,12 +4503,10 @@ /* -- draw the staff systems and the measure bars -- */ float draw_systems(float indent) { - struct SYSTEM *next_sy; struct SYMBOL *s, *s2; - int staff; + int staff, bar_force; float xstaff[MAXSTAFF], bar_bot[MAXSTAFF], bar_height[MAXSTAFF]; - float x, x2; - float line_height; + float staves_bar, x, x2, line_height; line_height = set_staff(); draw_vname(indent); @@ -4472,44 +4514,61 @@ /* draw the staff, skipping the staff breaks */ for (staff = 0; staff <= nstaff; staff++) xstaff[staff] = cursys->staff[staff].empty ? -1 : 0; - bar_set(bar_bot, bar_height); + bar_set(bar_bot, bar_height, xstaff); draw_lstaff(0); + bar_force = 0; for (s = tsfirst; s; s = s->ts_next) { - staff = s->staff; - switch (s->type) { - case STAVES: - next_sy = cursys->next; + if (bar_force && s->time != bar_force) { + bar_force = 0; + for (staff = 0; staff <= nstaff; staff++) { + if (cursys->staff[staff].empty) + xstaff[staff] = -1; + } + bar_set(bar_bot, bar_height, xstaff); + } + if (s->sflags & S_NEW_SY) { + staves_bar = 0; + for (s2 = s; s2; s2 = s2->ts_next) { + if (s2->time != s->time) + break; + if (s2->type == BAR) { + staves_bar = s2->x; + break; + } + } + cursys = cursys->next; for (staff = 0; staff <= nstaff; staff++) { - if (next_sy->staff[staff].empty - == cursys->staff[staff].empty - && next_sy->staff[staff].clef.stafflines - == cursys->staff[staff].clef.stafflines) + x = xstaff[staff]; + if (x < 0) { // no staff yet + if (!cursys->staff[staff].empty) { + if (staves_bar != 0) + xstaff[staff] = staves_bar; + else + xstaff[staff] = s->x - s->wl - 2; + } continue; - x2 = s->x; - if ((x = xstaff[staff]) >= 0) { - if (s->ts_prev->type == BAR) - x2 = s->ts_prev->x; - draw_staff(staff, x, x2); } - if (next_sy->staff[staff].empty) { - xstaff[staff] = -1; - } else if (xstaff[staff] < 0) { - if (s->ts_next->type != BAR) - xstaff[staff] = x2; - else - xstaff[staff] = s->ts_next->x; + if (!cursys->staff[staff].empty) // if not staff stop + continue; + if (staves_bar != 0) { + x2 = staves_bar; + bar_force = s->time; } else { - xstaff[staff] = x2; + x2 = s->x - s->wl - 2; + xstaff[staff] = -1; } + draw_staff(staff, x, x2); } - cursys = next_sy; - bar_set(bar_bot, bar_height); - break; + bar_set(bar_bot, bar_height, xstaff); + } + staff = s->staff; + switch (s->type) { case BAR: if ((s->sflags & S_SECOND) - || cursys->staff[staff].empty) - s->as.flags |= ABC_F_INVIS; - if (s->as.flags & ABC_F_INVIS) +// || cursys->staff[staff].empty) + || xstaff[staff] < 0) + s->flags |= ABC_F_INVIS; + if (s->flags & ABC_F_INVIS) break; draw_bar(s, bar_bot[staff], bar_height[staff]); if (annotate) @@ -4517,10 +4576,7 @@ break; case STBRK: if (cursys->voice[s->voice].range == 0) { - if (s->next - && s->next->type == STAVES) - s->next->x = s->x; - if ( s->xmx > .5 CM) { + if (s->xmx > .5 CM) { int i, nvoice; /* draw the left system if stbrk in all voices */ @@ -4541,8 +4597,6 @@ s2 = s->prev; if (!s2) break; - if (s2->type == STAVES) - s2 = s2->prev; x2 = s2->x; if (s2->type != BAR) x2 += s2->wr; @@ -4557,14 +4611,18 @@ break; default: //fixme:does not work for "%%staves K: M: $" */ - if (cursys->staff[staff].empty) - s->as.flags |= ABC_F_INVIS; +//removed for K:/M: in empty staves +// if (cursys->staff[staff].empty) +// s->flags |= ABC_F_INVIS; break; } } + + // draw the end of the staves for (staff = 0; staff <= nstaff; staff++) { - if ((x = xstaff[staff]) < 0 - || x >= realwidth - 8) + if (bar_force && cursys->staff[staff].empty) + continue; + if ((x = xstaff[staff]) < 0) continue; draw_staff(staff, x, realwidth); } @@ -4572,31 +4630,30 @@ return line_height; } -/* -- output PostScript sequences -- */ -void output_ps(struct SYMBOL *s, int state) +/* -- output PostScript sequences and set the staff and voice colors -- */ +void output_ps(struct SYMBOL *s, int color) { struct SYMBOL *g, *g2; g = s->extra; g2 = NULL; - for (;;) { - if (g->type == FMTCHG - && (g->u == PSSEQ || g->u == SVGSEQ) - && g->as.state <= state) { - if (g->u == SVGSEQ) - a2b("%%svg %s\n", g->as.text); - else - a2b("%s\n", g->as.text); - if (!g2) - s->extra = g->next; - else - g2->next = g->next; - } else { - g2 = g; + for ( ; g; g = g->next) { + if (g->type == FMTCHG) { + switch (g->aux) { + case PSSEQ: +// case SVGSEQ: +// if (g->aux == SVGSEQ) +// a2b("%%svg %s\n", g->text); +// else + a2b("%s\n", g->text); + if (!g2) + s->extra = g->next; + else + g2->next = g->next; + continue; + } } - g = g->next; - if (!g) - break; + g2 = g; } } @@ -4608,10 +4665,11 @@ float x, y; int staff, first_note; +#if 0 /* output the PostScript code at start of line */ for (s = p_voice->sym; s; s = s->next) { if (s->extra) - output_ps(s, 127); + output_ps(s, 1); switch (s->type) { case CLEF: case KEYSIG: @@ -4621,20 +4679,31 @@ } break; } +#endif bm.s2 = NULL; first_note = 1; for (s = p_voice->sym; s; s = s->next) { if (s->extra) - output_ps(s, 127); - if ((s->as.flags & ABC_F_INVIS) - && s->type != NOTEREST && s->type != GRACE) - continue; + output_ps(s, 1); + if (s->flags & ABC_F_INVIS) { + switch (s->type) { + case KEYSIG: + memcpy(&p_voice->key, &s->u.key, + sizeof p_voice->key); + default: + continue; + case NOTEREST: + case GRACE: + break; + } + } + set_color(s->color); x = s->x; switch (s->type) { case NOTEREST: set_scale(s); - if (s->as.type == ABC_T_NOTE) { + if (s->abc_type == ABC_T_NOTE) { if ((s->sflags & (S_BEAM_ST | S_BEAM_END)) == S_BEAM_ST || (first_note && !(s->sflags & S_BEAM_ST))) { first_note = 0; @@ -4666,51 +4735,55 @@ if (s->sflags & S_SECOND) /* || p_voice->staff != staff) */ break; /* only one clef per staff */ - if ((s->as.flags & ABC_F_INVIS) + if ((s->flags & ABC_F_INVIS) || staff_tb[staff].empty) break; + set_color(0); set_sscale(staff); y = staff_tb[staff].y; - x -= 10; /* clef shift - see set_width() */ + x -= 10; /* clef shift - see set_width() */ putxy(x, y + s->y); - if (s->as.u.clef.name) - a2b("%s\n", s->as.u.clef.name); + if (s->u.clef.name) + a2b("%s\n", s->u.clef.name); else a2b("%c%cclef\n", - s->u ? 's' : ' ', - "tcbp"[(unsigned) s->as.u.clef.type]); - if (s->as.u.clef.octave != 0) { + s->aux ? 's' : ' ', + "tcbp"[(unsigned) s->u.clef.type]); + if (s->u.clef.octave != 0) { /*fixme:break the compatibility and avoid strange numbers*/ - if (s->as.u.clef.octave > 0) - y += s->ymx - 12; + if (s->u.clef.octave > 0) + y += s->ymx - 9; else - y += s->ymn + 2; - putxy(x, y); - a2b("oct%c\n", - s->as.u.clef.octave > 0 ? 'u' : 'l'); + y += s->ymn; + putxy(x - 2, y); + a2b("oct\n"); } if (annotate) anno_out(s, 'c'); break; case TIMESIG: - memcpy(&p_voice->meter, &s->as.u.meter, - sizeof p_voice->meter); +//fixme: set staff color + memcpy(&p_voice->meter, &s->u.meter, + sizeof p_voice->meter); if ((s->sflags & S_SECOND) || staff_tb[s->staff].empty) break; if (cfmt.alignbars && s->staff != 0) break; + set_color(0); set_sscale(s->staff); draw_timesig(x, s); if (annotate) anno_out(s, 'M'); break; case KEYSIG: - memcpy(&p_voice->key, &s->as.u.key, - sizeof p_voice->key); +//fixme: set staff color + memcpy(&p_voice->key, &s->u.key, + sizeof p_voice->key); if ((s->sflags & S_SECOND) || staff_tb[s->staff].empty) break; + set_color(0); set_sscale(s->staff); draw_keysig(p_voice, x, s); if (annotate) @@ -4718,16 +4791,19 @@ break; case MREST: set_scale(s); - a2b("(%d)", s->as.u.bar.len); - putxy(x, staff_tb[s->staff].y); - a2b("mrest\n"); + putxy(x, staff_tb[s->staff].y + 12); + a2b("mrest(%d)/Times-Bold 15 selectfont ", + s->u.bar.len); + putxy(x, staff_tb[s->staff].y + 28); + a2b("M showc\n"); + if (annotate) + anno_out(s, 'Z'); break; case GRACE: set_scale(s); draw_gracenotes(s); break; case SPACE: - case STAVES: case STBRK: case FMTCHG: break; /* nothing */ @@ -4742,21 +4818,30 @@ } set_scale(p_voice->sym); draw_all_ties(p_voice); + set_sscale(-1); + set_color(0); } /* -- draw all symbols -- */ void draw_all_symb(void) { struct VOICE_S *p_voice; + struct SYMBOL *s; for (p_voice = first_voice; p_voice; p_voice = p_voice->next) { -#if 1 /*fixme:test*/ - if (!p_voice->sym) +#if 1 /* pb about rest display when "%%staffnonote 0" fixed in draw_rest */ + if (p_voice->sym) #else - if (staff_tb[p_voice->staff].empty || !p_voice->sym) + if (p_voice->sym + && !staff_tb[p_voice->staff].empty) #endif - continue; - draw_symbols(p_voice); + draw_symbols(p_voice); + } + + // update the clefs + for (s = tsfirst; s; s = s->ts_next) { + if (s->type == CLEF) + staff_tb[s->staff].s_clef = s; } } @@ -4791,39 +4876,24 @@ /* -- set the voice or staff scale -- */ void set_scale(struct SYMBOL *s) { - int staff; float scale, trans; - staff = -1; scale = voice_tb[s->voice].scale; if (scale == 1) { - staff = s->staff; - scale = staff_tb[staff].clef.staffscale; + set_sscale(s->staff); + return; } /*fixme: KO when both staff and voice are scaled */ - if (staff >= 0 && scale != 1) { - trans = staff_tb[staff].y; - scale_voice = 0; - if (staff != cur_staff && cur_scale != 1) - cur_scale = 0; - } else { - trans = 0; - scale_voice = 1; - } + trans = 0; + scale_voice = 1; if (scale == cur_scale && trans == cur_trans) return; if (cur_scale != 1) a2b("grestore "); cur_scale = scale; cur_trans = trans; - if (scale != 1) { - if (scale_voice) { - a2b("scvo%d ", s->voice); - } else { - a2b("scst%d ", staff); - cur_staff = staff; - } - } + if (scale != 1) + a2b("scvo%d ", s->voice); } /* -- set the staff scale (only) -- */ @@ -4835,7 +4905,7 @@ if (staff != cur_staff && cur_scale != 1) cur_scale = 0; if (staff >= 0) - scale = staff_tb[staff].clef.staffscale; + scale = staff_tb[staff].staffscale; else scale = 1; if (staff >= 0 && scale != 1) @@ -4872,10 +4942,10 @@ if (s2->time == s->time && s2->staff == s->staff) { */ dir = s->multi > 0 ? SL_ABOVE : SL_BELOW; for (i = 0; i <= s->nhd; i++) { - ti = s->as.u.note.ti1[i]; - if (!((ti & 0x03) == SL_AUTO)) + ti = s->u.note.notes[i].ti1; + if (!((ti & 0x07) == SL_AUTO)) continue; - s->as.u.note.ti1[i] = (ti & SL_DOTTED) | dir; + s->u.note.notes[i].ti1 = (ti & SL_DOTTED) | dir; } continue; /* } */ @@ -4885,21 +4955,21 @@ sec = ntie = 0; pit = 128; for (i = 0; i <= s->nhd; i++) { - if (s->as.u.note.ti1[i]) { + if (s->u.note.notes[i].ti1) { ntie++; if (pit < 128 - && s->as.u.note.pits[i] <= pit + 1) + && s->u.note.notes[i].pit <= pit + 1) sec++; - pit = s->as.u.note.pits[i]; + pit = s->u.note.notes[i].pit; } } if (ntie <= 1) { dir = s->stem < 0 ? SL_ABOVE : SL_BELOW; for (i = 0; i <= s->nhd; i++) { - ti = s->as.u.note.ti1[i]; + ti = s->u.note.notes[i].ti1; if (ti != 0) { - if ((ti & 0x03) == SL_AUTO) - s->as.u.note.ti1[i] = + if ((ti & 0x07) == SL_AUTO) + s->u.note.notes[i].ti1 = (ti & SL_DOTTED) | dir; break; } @@ -4911,39 +4981,38 @@ /* in chords with an odd number of notes, the outer noteheads are paired off * center notes are tied according to their position in relation to the * center line */ - ntie = ntie / 2; + ntie /= 2; dir = SL_BELOW; for (i = 0; i <= s->nhd; i++) { - ti = s->as.u.note.ti1[i]; + ti = s->u.note.notes[i].ti1; if (ti == 0) continue; if (ntie == 0) { /* central tie */ if (s->pits[i] >= 22) dir = SL_ABOVE; } - if ((ti & 0x03) == SL_AUTO) - s->as.u.note.ti1[i] = + if ((ti & 0x07) == SL_AUTO) + s->u.note.notes[i].ti1 = (ti & SL_DOTTED) | dir; if (ntie-- == 0) dir = SL_ABOVE; } continue; - } else { + } /* even number of notes, ties divided in opposite directions */ - ntie /= 2; - dir = SL_BELOW; - for (i = 0; i <= s->nhd; i++) { - ti = s->as.u.note.ti1[i]; - if (ti == 0) - continue; - if ((ti & 0x03) == SL_AUTO) - s->as.u.note.ti1[i] = - (ti & SL_DOTTED) | dir; - if (--ntie == 0) - dir = SL_ABOVE; - } - continue; + ntie /= 2; + dir = SL_BELOW; + for (i = 0; i <= s->nhd; i++) { + ti = s->u.note.notes[i].ti1; + if (ti == 0) + continue; + if ((ti & 0x07) == SL_AUTO) + s->u.note.notes[i].ti1 = + (ti & SL_DOTTED) | dir; + if (--ntie == 0) + dir = SL_ABOVE; } + continue; } /*fixme: treat more than one second */ /* if (nsec == 1) { */ @@ -4951,24 +5020,24 @@ * opposition; then fill in the remaining notes of the chord accordingly */ pit = 128; for (i = 0; i <= s->nhd; i++) { - if (s->as.u.note.ti1[i]) { + if (s->u.note.notes[i].ti1) { if (pit < 128 - && s->as.u.note.pits[i] <= pit + 1) { + && s->u.note.notes[i].pit <= pit + 1) { ntie = i; break; } - pit = s->as.u.note.pits[i]; + pit = s->u.note.notes[i].pit; } } dir = SL_BELOW; for (i = 0; i <= s->nhd; i++) { - ti = s->as.u.note.ti1[i]; + ti = s->u.note.notes[i].ti1; if (ti == 0) continue; if (ntie == i) dir = SL_ABOVE; - if ((ti & 0x03) == SL_AUTO) - s->as.u.note.ti1[i] = + if ((ti & 0x07) == SL_AUTO) + s->u.note.notes[i].ti1 = (ti & SL_DOTTED) | dir; } /*fixme.. @@ -4999,15 +5068,16 @@ if (!(s->sflags & S_TI1)) continue; - if (s->pits[0] < 20 && s->as.u.note.ti1[0] == SL_BELOW) + if (s->pits[0] < 20 + && (s->u.note.notes[0].ti1 & 0x07) == SL_BELOW) ; else if (s->pits[s->nhd] > 24 - && s->as.u.note.ti1[s->nhd] == SL_ABOVE) + && (s->u.note.notes[s->nhd].ti1 & 0x07) == SL_ABOVE) ; else continue; s2 = s->next; - while (s2 && s2->as.type != ABC_T_NOTE) + while (s2 && s2->abc_type != ABC_T_NOTE) s2 = s2->next; if (s2) { if (s2->staff != s->staff) diff -Nru abcm2ps-7.8.9/features.txt abcm2ps-8.14.2/features.txt --- abcm2ps-7.8.9/features.txt 2014-03-26 07:50:22.000000000 +0000 +++ abcm2ps-8.14.2/features.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,376 +0,0 @@ - Features of abcm2ps 7.6.9 (J.F. Moine, January 2014) - ==================================================== - -abcm2ps tries to follow the ABC standard version 2.1 (december 2011): - - http://abcnotation.com/wiki/abc:standard:v2.1 - -Here are listed only the differences from the standard. - - -Features not implemented. -======================== - -Information fields. - - - The continuation field ('+:') is implemented for w: only. - - - The charsets iso-8859-5 .. iso-8859-8 are not implemented. - -Tune body. - - - The following decorations are not implemented: - !dacoda!, !dacapo! - - - 'U:' fields cannot contain guitar chord nor annotations. - - - The values assigned by the 'U:' field are always global (they - are not restored at end of tune). - - - Multiple measure overlay (as '&&') is not implemented. - Use the '(& .. & .. & .. &) extension instead. - -Text strings. - - - The HTML sequences are not implemented. - - - The unicode '\Uxxxxxxxx' 32 bits character is not implemented. - Use the UTF-16 surrogates instead. - - -Features that work differently. -=============================== - -File structure. - - - The T: header field may be omitted when 'X:' is present. - - - There is no notion of 'file header': any valid ABC field - found outside the tunes is considered as global, and applies - to the remaining tunes. - -Information fields. - - - In a tune body, the lines beginning with a letter in range A-G - or a-g and immediately followed by a colon are interpreted as - information fields. - - - When the %%abc-version is different from '2.0', the field 'A:' is - 'Area', and not 'Author of lyrics'. It is displayed only when - 'infoline' is set. - - - In 'K:' fields, the list of accidentals may be 'none' (for - no accidental). - - - In 'U:' fields, the character may be - '\ ' (back-slash - space) to redefine the character space, or - '\t' (back-slash - t) to redefine the character tabulation. - The default value of these characters is !beambreak! (see below). - -Tune body. - - - The decorations on notes inside chords cannot be standard ones - because their offset is relative to the note they are attached to, - and not to the chord. They must be explicitly defined by %%deco - and %%postscript. - - - '@' in annotations must be followed by the and offsets - of the text from the note position (in points). The and - values are separated by a comma, and may be followed by a - space (usefull if the text begins with a digit, a dot or the - letters 'E' or 'e' - see sample3.abc for an example). - - - Grace notes may appear before any symbol and may contain - chords. Their note lengths are handled. The unit note length - is not tied to L: (or M:). Instead, for compatibility, it is: - - a quaver for a single note and - a semi-quaver for many notes in standard tunes, - - a demi-semi-quaver in bagpipe tunes. - Grace notes greater than crotchets are drawn as crotchets. - - - Tuplets values may be greater than 9. - - - Tuplets may be nested. - -Clefs. - - - When 'clef=' is present, the clef name may be one of - 'G' (treble clef), 'C' (alto clef) or 'F' (bass clef). - The two following definitions are equivalent: - K: clef=F - K: bass - - - The suffixes "^8" and "_8" do an octave transposition - (while "+8" and "-8" don't do it). - -Multiple voices. - - - When the voices are synchronized, a 'P:' field is set in the first - voice, without changing the current voice. - This fixes the common error: - P:A - V:1 - .. - V:2 - .. - P:B % misplaced P: (in voice 2) - V:1 - % should be here - .. - V:2 - % and normally repeated here - .. - -ABC Stylesheet specification. - - - The star ('*' = floating voice) is not treated in '%%score'. - - - '%%staves' coexists with '%%score'. - The differences of '%%staves' are: - - measure bars are drawn between staves when there is - no '|' between the voice names (this feature is inverted - in %%score). - - A floating voice may be only the second one in a - 3 voices brace. - - - Some formatting directives are not implemented, and some other - ones are defined. See the file 'format.txt' for details. - - -Extensions. -========== - -File structure. - - - Lines starting with '\' (back-slash) are ignored (abc2mtex - compatibility). - -Information fields. - - - The field 'L:' may contain 'auto' in which case the duration of - each note is adjusted to fulfill the measures. - This value works when the measures are regular (fixed duration). - 'L:auto' may be used in each case the measure is regular in a - compatible way. - For instance, the three following lines give a same result: - - standard ABC: - L:1/4 - cccd | e2d2 | cedd | c4 | - - auto L: - M:C % required - L:auto - cccd | ed | cedd | c | - - compatible - M:C % required - L:auto - cccd | e2d2 | cedd | c4 | - - - The field 'M:' may specify more complex meters with a - combination of digits, parenthesis, slashes and blanks. - It may also specify ancient meters as 'M:2' or 'M:3', - and also 'M:o' (perfect minor), 'M:o.' (perfect major), - 'M:c' (imperfect minor) and 'M:c.' (imperfect major). - An explicit measure duration may be specified putting its - value after an '=' sign (ex: 'M:C|=2/1'). - - - 'microscale=' in 'K:' or 'V:' fields defines the - denominator to use in microtonal accidentals (see 'microtone' - pitches below). - - - The field 'd:' is the same as 's:' (symbol line). - - - In 'U:' fields, !ignore! defines the character as ignored. - This is the default value for the character '`' (back-quote). - - - In 'U:' fields, !beambreak! defines the character as stopping - note beaming. This is the default value for the characters - '\ ' (space) and '\t' (tabulation). - -Tune body. - - - Microtone pitches are indicated by a number or a fraction after - an accidental (and before the note). - - There are two ways to define microtone pitches: - - - old method (default) - The pitches are indicated by a fraction of semitone as - "^3/4c" (3/4 of a sharp). - When omitted, the numerator defaults to 1 and the - denominator to 2 ("^/c" is the same as "^1/2c"). - Support exists for 1/2 and 3/2 sharps and flats. For other - values, PostScript functions must be defined (%%postscript - or %%beginps - see below). - - - new method - The pitches are indicated by a fraction of tone - (! not semitone !) when "microscale=" - is set in K: or V: information fields. - With this method, only the numerator is to be set after the - accidental as "^3c". - - For instance, the two declarations - - without microscale: ^3/2c - - with microscale=4: ^3c - give a same result. - - Note: the numerator and denominator cannot be greater than 255. - - There are also two ways to implement the accidental drawing - function: - - - old method - When neither "microscale=" nor "%%micronewps" are set, - the name of the PostScript function which draws - a microtone accidental is: - - where: - - is "sh" (sharp) or "ft" (flat) - (may be also "nt", "dsh" or "dft" !) - - is computed from the fraction as: - ( - 1) * 256 + - 1 - and it is called with and . - - - new method - When either "microscale=" or "%%micronewps" is set, - the name of the PostScript function is: - - and it is called with . - Note that the is two times the pitch - denominator when "microscale=" is not set. - - - A note length starting with '0' (zero') indicates a stemless - note. - - - A space ('y') may be followed by a width in points. - The default width is 20 pts. - - - '[]' is the same as '[|]' (invisible bar). - - - ':' (colon alone) is the same as '.|' (dotted bar). - - - ']' alone is not a bar. It stops a repeat bracket. - - - Repeat bars may contain a set of digits, '-' (hyphen), - ',' (comma) or '.' (dot), or even a free string. Ex: - |: ... [1,3 ... :|2,4-6 ... :|["last time" ... - (note that a '[' is needed before the string - this one may - be empty). - - - There may be slurs from notes to grace notes and reverse. - - - Opening slurs ("(") may be followed by "'" or "," to force their - direction (above or below). - - - The tie character ("-") may be followed by "'" or "," to force - the tie direction (above or below). - - - The following decorations are added: - !beamon! do not break beaming (on a measure bar) - !beambr1! and !beambr2! - let only 1 or 2 beams from the previous note - !gmark! grace mark ('~' like sign) - !invisible! prevent a symbol to be displayed - !rbstop! stop here the current repeat bracket - !trem1! .. !trem4! - tremolo (on the second of a couple of notes - - see sample4.abc for example) - !xstem! draw a stem up to the note on the previous - staff - !/! .. !///! tremolo on one note - !beam-accel! and !beam-rall! - feathered beam - - - There may be decorations on grace notes. - - - Multiple lines of guitar chord / annotation may also be - indicated by '\n' or ';' in which case, the lines are of - the same type (gchord or annotation). - The 3 next notations are equivalent: - "_ann1" "_ann2" "G3" "4" - "_ann1;ann2" "G3;4" - "_ann1\nann2" "G3\n4" - (annotation on 2 lines and guitar chord on 2 lines) - The two next notations are NOT equivalent: - "_ann1" "G" - "_ann1;G" - (in the 1st line, 'G' is a guitar chord, - in the 2nd one, it is the 2nd line of the annotation) - A new annotation type may be indicated after a ';' as: - "^above;_below" - -Clefs. - - - the clef definition should not be in K: or V: information fields. - Better use the %%clef pseudo-comment (see format.txt) - - - 'clef=P' is the same as 'perc'. - - - When the clef name is 'perc' (or 'P'), accidentals change the - note head glyph. By default, sharp notes are drawn as a 'x' - and flat notes as a circled 'x'. This behaviour may be changed - redefineding the PostScript functions 'pshhd' and 'pfthd', or - defining 'pnthd' (natural), 'pdshhd' (double sharp) and - 'pdfthd' (double flat). - - - When no clef is specified, clef changes are automatically - inserted when needed ('bass' or 'treble'). - - - The clef name may be enclosed by double quotes in which case - it is the name of the PostScript function which draws the - clef. The arguments of this function are the x and y offsets. - -Multiple voices. - - - 'stem=auto' in a V: field re-enables the automatic computation - of the direction of the stems (default). - - - For compatibility with previous abcm2ps versions, the V: fields may - contain: - - 'gchord=up' (default) and 'gchord=down' - which forces the display of guitar chords above or - below the staff (see 'gchord' in format.txt). - - - 'gstem=up' or 'gstem=down' - which forces the direction of the stems of the grace notes - (see 'gstemdir' in format.txt). - - - 'dyn=up', 'dyn=down' or 'dyn=auto' - which forces the place of the dynamic marks (above - or below the staff - default is 'auto' - - see 'dynamic' in format.txt) - - - 'lyrics=up', 'lyrics=down' or 'lyrics=auto' - which forces the place of the lyrics (above or below - the staff - default is 'auto' - see 'vocal' in format.txt). - (use pseudo comments instead - see format.txt) - - - 'merge' in a V: field makes the voice to go on the same staff - as the previous voice (BarFly compatibility). - - - The BarFly voice switch in tune ('V:x ', i.e. - voice + notes on the same line) may work. - - - The operator '(&...&...&)' permits voice overlay on many - measures. See sample3.abc for an example. - -Text strings. - - - The guitar chords and annotations may contain '\#', '\b' and '\=' - to display accidentals. - - - The strings may contain characters from '\001' to '\005' to display - accidentals. For compatibility, the values '\201' to '\205' are - handled the same way. - - - In quoted string, the '%' does not need to be escaped. - - - The strings may contain XML character references like "é" - or "𝅘𝅥" - -Deprecated ABC syntax. - - - Most of the deprecated ABC syntax is supported. - - - Some incompatible syntaxes are handled according to the ABC version - of the file as the ABC 2.0 line continuation mechanism. diff -Nru abcm2ps-7.8.9/format.c abcm2ps-8.14.2/format.c --- abcm2ps-7.8.9/format.c 2014-04-09 06:16:13.000000000 +0000 +++ abcm2ps-8.14.2/format.c 2018-12-18 15:18:26.000000000 +0000 @@ -3,29 +3,20 @@ * * This file is part of abcm2ps. * - * Copyright (C) 1998-2014 Jean-François Moine + * Copyright (C) 1998-2017 Jean-François Moine * Adapted from abc2ps, Copyright (C) 1996,1997 Michael Methfessel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #include #include #include -#include "abc2ps.h" +#include "abcm2ps.h" struct FORMAT cfmt; /* current format for output */ @@ -54,15 +45,16 @@ {"abc2pscompat", &cfmt.abc2pscompat, FORMAT_B, 3}, {"alignbars", &cfmt.alignbars, FORMAT_I, 0}, {"aligncomposer", &cfmt.aligncomposer, FORMAT_I, 0}, - {"autoclef", &cfmt.autoclef, FORMAT_B, 0}, {"annotationfont", &cfmt.font_tb[ANNOTATIONFONT], FORMAT_F, 0}, + {"autoclef", &cfmt.autoclef, FORMAT_B, 0}, {"barsperstaff", &cfmt.barsperstaff, FORMAT_I, 0}, {"bgcolor", &cfmt.bgcolor, FORMAT_S, 0}, - {"botmargin", &cfmt.botmargin, FORMAT_U, 0}, + {"botmargin", &cfmt.botmargin, FORMAT_U, 1}, {"breaklimit", &cfmt.breaklimit, FORMAT_R, 3}, {"breakoneoln", &cfmt.breakoneoln, FORMAT_B, 0}, {"bstemdown", &cfmt.bstemdown, FORMAT_B, 0}, {"cancelkey", &cfmt.cancelkey, FORMAT_B, 0}, + {"capo", &cfmt.capo, FORMAT_I, 0}, {"combinevoices", &cfmt.combinevoices, FORMAT_I, 0}, {"composerfont", &cfmt.font_tb[COMPOSERFONT], FORMAT_F, 0}, {"composerspace", &cfmt.composerspace, FORMAT_U, 0}, @@ -71,6 +63,7 @@ {"custos", &cfmt.custos, FORMAT_B, 0}, {"dateformat", &cfmt.dateformat, FORMAT_S, 0}, {"dblrepbar", &cfmt.dblrepbar, FORMAT_I, 2}, + {"decoerr", &cfmt.decoerr, FORMAT_B, 0}, {"dynalign", &cfmt.dynalign, FORMAT_B, 0}, {"footer", &cfmt.footer, FORMAT_S, 0}, {"footerfont", &cfmt.font_tb[FOOTERFONT], FORMAT_F, 0}, @@ -78,7 +71,9 @@ {"gchordbox", &cfmt.gchordbox, FORMAT_B, 0}, {"gchordfont", &cfmt.font_tb[GCHORDFONT], FORMAT_F, 3}, {"graceslurs", &cfmt.graceslurs, FORMAT_B, 0}, + {"graceword", &cfmt.graceword, FORMAT_B, 0}, {"gracespace", &cfmt.gracespace, FORMAT_I, 5}, + {"gutter", &cfmt.gutter, FORMAT_U, 0}, {"header", &cfmt.header, FORMAT_S, 0}, {"headerfont", &cfmt.font_tb[HEADERFONT], FORMAT_F, 0}, {"historyfont", &cfmt.font_tb[HISTORYFONT], FORMAT_F, 0}, @@ -89,7 +84,7 @@ {"infospace", &cfmt.infospace, FORMAT_U, 0}, {"keywarn", &cfmt.keywarn, FORMAT_B, 0}, {"landscape", &cfmt.landscape, FORMAT_B, 0}, - {"leftmargin", &cfmt.leftmargin, FORMAT_U, 0}, + {"leftmargin", &cfmt.leftmargin, FORMAT_U, 1}, {"lineskipfac", &cfmt.lineskipfac, FORMAT_R, 0}, {"linewarn", &cfmt.linewarn, FORMAT_B, 0}, {"maxshrink", &cfmt.maxshrink, FORMAT_R, 2}, @@ -100,12 +95,13 @@ {"measurefont", &cfmt.font_tb[MEASUREFONT], FORMAT_F, 2}, {"measurenb", &cfmt.measurenb, FORMAT_I, 0}, {"micronewps", &cfmt.micronewps, FORMAT_B, 0}, - {"microscale", &cfmt.microscale, FORMAT_I, 0}, + {"musicfont", &cfmt.musicfont, FORMAT_S, 1}, {"musicspace", &cfmt.musicspace, FORMAT_U, 0}, {"notespacingfactor", &cfmt.notespacingfactor, FORMAT_R, 1}, {"oneperpage", &cfmt.oneperpage, FORMAT_B, 0}, - {"pageheight", &cfmt.pageheight, FORMAT_U, 0}, - {"pagewidth", &cfmt.pagewidth, FORMAT_U, 0}, + {"pageheight", &cfmt.pageheight, FORMAT_U, 1}, + {"pagewidth", &cfmt.pagewidth, FORMAT_U, 1}, + {"pagescale", &cfmt.scale, FORMAT_R, 0}, #ifdef HAVE_PANGO {"pango", &cfmt.pango, FORMAT_B, 2}, #endif @@ -114,26 +110,21 @@ {"partsfont", &cfmt.font_tb[PARTSFONT], FORMAT_F, 1}, {"partsspace", &cfmt.partsspace, FORMAT_U, 0}, {"pdfmark", &cfmt.pdfmark, FORMAT_I, 0}, + {"rbdbstop", &cfmt.rbdbstop, FORMAT_B, 0}, + {"rbmax", &cfmt.rbmax, FORMAT_I, 0}, + {"rbmin", &cfmt.rbmin, FORMAT_I, 0}, {"repeatfont", &cfmt.font_tb[REPEATFONT], FORMAT_F, 0}, - {"rightmargin", &cfmt.rightmargin, FORMAT_U, 0}, - {"scale", &cfmt.scale, FORMAT_R, 0}, + {"rightmargin", &cfmt.rightmargin, FORMAT_U, 1}, +// {"scale", &cfmt.scale, FORMAT_R, 0}, {"setdefl", &cfmt.setdefl, FORMAT_B, 0}, - {"setfont-1", &cfmt.font_tb[1], FORMAT_F, 0}, - {"setfont-2", &cfmt.font_tb[2], FORMAT_F, 0}, - {"setfont-3", &cfmt.font_tb[3], FORMAT_F, 0}, - {"setfont-4", &cfmt.font_tb[4], FORMAT_F, 0}, -#if FONT_UMAX!=5 -# error Bad number of user fonts -#endif // {"shifthnote", &cfmt.shiftunison, FORMAT_B, 0}, /*to remove*/ {"shiftunison", &cfmt.shiftunison, FORMAT_I, 0}, - {"shiftunisson", &cfmt.shiftunison, FORMAT_I, 0}, /*to remove*/ {"slurheight", &cfmt.slurheight, FORMAT_R, 0}, - {"splittune", &cfmt.splittune, FORMAT_B, 0}, + {"splittune", &cfmt.splittune, FORMAT_I, 1}, {"squarebreve", &cfmt.squarebreve, FORMAT_B, 0}, {"staffnonote", &cfmt.staffnonote, FORMAT_I, 0}, {"staffsep", &cfmt.staffsep, FORMAT_U, 0}, - {"staffwidth", &staffwidth, FORMAT_U, 1}, + {"staffwidth", &staffwidth, FORMAT_U, 2}, {"stemheight", &cfmt.stemheight, FORMAT_R, 0}, {"straightflags", &cfmt.straightflags, FORMAT_B, 0}, {"stretchlast", &cfmt.stretchlast, FORMAT_R, 2}, @@ -150,11 +141,10 @@ {"titleformat", &cfmt.titleformat, FORMAT_S, 0}, {"titleleft", &cfmt.titleleft, FORMAT_B, 0}, {"titlespace", &cfmt.titlespace, FORMAT_U, 0}, - {"titletrim", &cfmt.titletrim, FORMAT_B, 0}, + {"titletrim", &cfmt.titletrim, FORMAT_I, 0}, {"timewarn", &cfmt.timewarn, FORMAT_B, 0}, - {"topmargin", &cfmt.topmargin, FORMAT_U, 0}, + {"topmargin", &cfmt.topmargin, FORMAT_U, 1}, {"topspace", &cfmt.topspace, FORMAT_U, 0}, - {"transpose", &cfmt.transpose, FORMAT_I, 1}, {"tuplets", &cfmt.tuplets, FORMAT_I, 3}, {"vocalfont", &cfmt.font_tb[VOCALFONT], FORMAT_F, 0}, {"vocalspace", &cfmt.vocalspace, FORMAT_U, 0}, @@ -165,8 +155,17 @@ {0, 0, 0, 0} /* end of table */ }; +static const char helvetica[] = "Helvetica"; +static const char times[] = "Times-Roman"; +static const char times_bold[] = "Times-Bold"; +static const char times_italic[] = "Times-Italic"; +static const char sans[] = "sans-serif"; +static const char serif[] = "serif"; +static const char serif_italic[] = "serif-Italic"; +static const char serif_bold[] = "serif-Bold"; + /* -- search a font and add it if not yet defined -- */ -static int get_font(char *fname, int encoding) +static int get_font(const char *fname, int encoding) { int fnum; @@ -190,15 +189,22 @@ error(1, NULL, "Too many fonts"); return 0; } - if (file_initialized> 0 - && (epsf <= 1 && !svg)) - error(1, NULL, - "Cannot have a new font when the output file is opened"); + if (epsf <= 1 && !svg) { + if (file_initialized > 0) + error(1, NULL, + "Cannot have a new font when the output file is opened"); + if (strchr(fname, ' ') != NULL) { + error(1, NULL, + "PostScript fonts cannot have names with spaces"); + return 0; + } + } fnum = nfontnames++; fontnames[fnum] = strdup(fname); if (encoding < 0) encoding = 0; font_enc[fnum] = encoding; + return fnum; } @@ -223,7 +229,7 @@ /* -- define a font -- */ static void fontspec(struct FONTSPEC *f, - char *name, + const char *name, int encoding, float size) { @@ -235,18 +241,20 @@ f->swfac = size; if (swfac_font[f->fnum] != 0) { f->swfac *= swfac_font[f->fnum]; - } else if (strncmp(name, "Times", 5) == 0) { - if (strcmp(name, "Times-Bold") == 0) + } else if (strncmp(name, times, 5) == 0 + || strncmp(name, serif, 5) == 0) { + if (strcmp(name, times_bold) == 0 + || strcmp(name, serif_bold) == 0) f->swfac *= 1.05; } else if (strcmp(name, "Helvetica-Bold") == 0) { f->swfac *= 1.15; - } else if (strncmp(name, "Helvetica", 9) == 0 + } else if (strncmp(name, helvetica, 9) == 0 || strncmp(name, "Palatino", 8) == 0) { - f->swfac *= 1.10; + f->swfac *= 1.1; } else if (strncmp(name, "Courier", 7) == 0) { f->swfac *= 1.35; } else { - f->swfac *= 1.2; /* unknown font */ + f->swfac *= 1.1; /* unknown font */ } if (f == &cfmt.font_tb[GCHORDFONT]) cfmt.gcf = dfont_set(f); @@ -266,14 +274,22 @@ "/mkfont{findfont dup length 1 add dict begin\n" " {1 index/FID ne{def}{pop pop}ifelse}forall\n" " CharStrings/double_sharp known not{\n" - " /CharStrings CharStrings dup length dict copy def\n" + " /CharStrings CharStrings dup length dict copy def\n" + " FontMatrix 0 get 1 eq{\n" + " CharStrings/sharp{pop .46 0 setcharwidth .001 dup scale usharp ufill}bind put\n" + " CharStrings/flat{pop .46 0 setcharwidth .001 dup scale uflat ufill}bind put\n" + " CharStrings/natural{pop .40 0 setcharwidth .001 dup scale unat ufill}bind put\n" + " CharStrings/double_sharp{pop .46 0 setcharwidth .001 dup scale udblesharp ufill}bind put\n" + " CharStrings/double_flat{pop .50 0 setcharwidth .001 dup scale udbleflat ufill}bind put\n" + " }{\n" " CharStrings/sharp{pop 460 0 setcharwidth usharp ufill}bind put\n" " CharStrings/flat{pop 460 0 setcharwidth uflat ufill}bind put\n" " CharStrings/natural{pop 400 0 setcharwidth unat ufill}bind put\n" " CharStrings/double_sharp{pop 460 0 setcharwidth udblesharp ufill}bind put\n" " CharStrings/double_flat{pop 500 0 setcharwidth udbleflat ufill}bind put\n" + " }ifelse\n" " }if currentdict definefont pop end}!\n"; - + fputs(mkfont, fout); make_font_list(); for (i = 0; i < nfontnames; i++) { @@ -306,7 +322,7 @@ s = info['I' - 'A']; prev = NULL; while (s) { - if (s->as.text[0] == *p) + if (s->text[0] == *p) break; prev = s; s = s->next; @@ -330,8 +346,8 @@ s->prev = prev; } } - s->as.text = (char *) getarena(strlen(p) + 1); - strcpy(s->as.text, p); + s->text = (char *) getarena(strlen(p) + 1); + strcpy(s->text, p); } /* -- set the default format -- */ @@ -348,23 +364,23 @@ f->rightmargin = MARGIN; f->topmargin = 1.0 CM; f->botmargin = 1.0 CM; - f->topspace = 0.8 CM; - f->titlespace = 0.2 CM; - f->subtitlespace = 0.1 CM; - f->composerspace = 0.2 CM; - f->musicspace = 0.2 CM; - f->partsspace = 0.3 CM; + f->topspace = 22.0 PT; + f->titlespace = 6.0 PT; + f->subtitlespace = 3.0 PT; + f->composerspace = 6.0 PT; + f->musicspace = 6.0 PT; + f->partsspace = 8.0 PT; f->staffsep = 46.0 PT; f->sysstaffsep = 34.0 PT; f->maxstaffsep = 2000.0 PT; f->maxsysstaffsep = 2000.0 PT; - f->vocalspace = 23.0 PT; - f->textspace = 0.5 CM; - f->scale = 0.75; + f->vocalspace = 10 PT; + f->textspace = 14 PT; + f->scale = 1.0; f->slurheight = 1.0; f->maxshrink = 0.65; f->breaklimit = 0.7; - f->stretchlast = 0.2; + f->stretchlast = 0.25; f->stretchstaff = 1; f->graceslurs = 1; f->hyphencont = 1; @@ -374,7 +390,9 @@ f->measurefirst = 1; f->autoclef = 1; f->breakoneoln = 1; + f->cancelkey = 1; f->dblrepbar = (B_COL << 12) + (B_CBRA << 8) + (B_OBRA << 4) + B_COL; + f->decoerr = 1; f->dynalign = 1; f->keywarn = 1; f->linewarn = 1; @@ -382,8 +400,11 @@ if (!svg && epsf <= 1) f->pango = 1; else - lock_fmt(&cfmt.pango); /* SVG output does not use panga */ + lock_fmt(&cfmt.pango); /* SVG output does not use pango */ #endif + f->rbdbstop = 1; + f->rbmax = 4; + f->rbmin = 2; f->staffnonote = 1; f->titletrim = 1; f->aligncomposer = A_RIGHT; @@ -397,23 +418,43 @@ f->gracespace = (65 << 16) | (80 << 8) | 120; /* left-inside-right - unit 1/10 pt */ f->textoption = T_LEFT; f->ndfont = FONT_DYN; - fontspec(&f->font_tb[ANNOTATIONFONT], "Helvetica", 0, 12.0); - fontspec(&f->font_tb[COMPOSERFONT], "Times-Italic", 0, 14.0); - fontspec(&f->font_tb[FOOTERFONT], "Times-Roman", 0, 12.0); /* not scaled */ - fontspec(&f->font_tb[GCHORDFONT], "Helvetica", 0, 12.0); - fontspec(&f->font_tb[HEADERFONT], "Times-Roman", 0, 12.0); /* not scaled */ - fontspec(&f->font_tb[HISTORYFONT], "Times-Roman", 0, 16.0); - fontspec(&f->font_tb[INFOFONT], "Times-Italic", 0, 14.0); /* same as composer by default */ - fontspec(&f->font_tb[MEASUREFONT], "Times-Italic", 0, 14.0); - fontspec(&f->font_tb[PARTSFONT], "Times-Roman", 0, 15.0); - fontspec(&f->font_tb[REPEATFONT], "Times-Roman", 0, 13.0); - fontspec(&f->font_tb[SUBTITLEFONT], "Times-Roman", 0, 16.0); - fontspec(&f->font_tb[TEMPOFONT], "Times-Bold", 0, 15.0); - fontspec(&f->font_tb[TEXTFONT], "Times-Roman", 0, 16.0); - fontspec(&f->font_tb[TITLEFONT], "Times-Roman", 0, 20.0); - fontspec(&f->font_tb[VOCALFONT], "Times-Bold", 0, 13.0); - fontspec(&f->font_tb[VOICEFONT], "Times-Bold", 0, 13.0); - fontspec(&f->font_tb[WORDSFONT], "Times-Roman", 0, 16.0); + if (svg || epsf > 2) { // SVG output + fontspec(&f->font_tb[ANNOTATIONFONT], sans, 0, 12.0); + fontspec(&f->font_tb[COMPOSERFONT], serif_italic, 0, 14.0); + fontspec(&f->font_tb[FOOTERFONT], serif, 0, 16.0); + fontspec(&f->font_tb[GCHORDFONT], sans, 0, 12.0); + fontspec(&f->font_tb[HEADERFONT], serif, 0, 16.0); + fontspec(&f->font_tb[HISTORYFONT], serif, 0, 16.0); + fontspec(&f->font_tb[INFOFONT], serif_italic, 0, 14.0); /* same as composer by default */ + fontspec(&f->font_tb[MEASUREFONT], serif_italic, 0, 14.0); + fontspec(&f->font_tb[PARTSFONT], serif, 0, 15.0); + fontspec(&f->font_tb[REPEATFONT], serif, 0, 13.0); + fontspec(&f->font_tb[SUBTITLEFONT], serif, 0, 16.0); + fontspec(&f->font_tb[TEMPOFONT], serif_bold, 0, 15.0); + fontspec(&f->font_tb[TEXTFONT], serif, 0, 16.0); + fontspec(&f->font_tb[TITLEFONT], serif, 0, 20.0); + fontspec(&f->font_tb[VOCALFONT], serif_bold, 0, 13.0); + fontspec(&f->font_tb[VOICEFONT], serif_bold, 0, 13.0); + fontspec(&f->font_tb[WORDSFONT], serif, 0, 16.0); + } else { // PS output + fontspec(&f->font_tb[ANNOTATIONFONT], helvetica, 0, 12.0); + fontspec(&f->font_tb[COMPOSERFONT], times_italic, 0, 14.0); + fontspec(&f->font_tb[FOOTERFONT], times, 0, 16.0); + fontspec(&f->font_tb[GCHORDFONT], helvetica, 0, 12.0); + fontspec(&f->font_tb[HEADERFONT], times, 0, 16.0); + fontspec(&f->font_tb[HISTORYFONT], times, 0, 16.0); + fontspec(&f->font_tb[INFOFONT], times_italic, 0, 14.0); /* same as composer by default */ + fontspec(&f->font_tb[MEASUREFONT], times_italic, 0, 14.0); + fontspec(&f->font_tb[PARTSFONT], times, 0, 15.0); + fontspec(&f->font_tb[REPEATFONT], times, 0, 13.0); + fontspec(&f->font_tb[SUBTITLEFONT], times, 0, 16.0); + fontspec(&f->font_tb[TEMPOFONT], times_bold, 0, 15.0); + fontspec(&f->font_tb[TEXTFONT], times, 0, 16.0); + fontspec(&f->font_tb[TITLEFONT], times, 0, 20.0); + fontspec(&f->font_tb[VOCALFONT], times_bold, 0, 13.0); + fontspec(&f->font_tb[VOICEFONT], times_bold, 0, 13.0); + fontspec(&f->font_tb[WORDSFONT], times, 0, 16.0); + } f->fields[0] = (1 << ('C' - 'A')) | (1 << ('M' - 'A')) | (1 << ('O' - 'A')) @@ -473,24 +514,6 @@ default: printf("%d\n", *((int *) fd->v)); break; - case 1: { /* transpose */ - int t; - - t = *((int *) fd->v); - if (t >= 0) - putchar('+'); - printf("%d", t / 3); - switch ((t + 240) % 3) { - case 1: - putchar('#'); - break; - case 2: - putchar('b'); - break; - } - putchar('\n'); - break; - } case 2: { /* dblrepbar */ int v; char tmp[16], *p; @@ -518,8 +541,9 @@ break; } case 3: /* tuplets */ - printf("%d %d %d\n", - cfmt.tuplets >> 8, + printf("%d %d %d %d\n", + cfmt.tuplets >> 12, + (cfmt.tuplets >> 8) & 0x0f, (cfmt.tuplets >> 4) & 0x0f, cfmt.tuplets & 0x0f); break; @@ -555,8 +579,10 @@ } case FORMAT_U: if (fd->subtype == 0) + printf("%.2f\n", *((float *) fd->v)); + else if (fd->subtype == 1) printf("%.2fcm\n", *((float *) fd->v) / (1 CM)); - else + else //if (fd->subtype == 2) printf("%.2fcm\n", (cfmt.pagewidth - cfmt.leftmargin @@ -571,6 +597,36 @@ } } +/* -- get a number with a unit -- */ +/* The type may be + * = 0: internal space - convert 'cm' and 'in' to 72 PPI + * != 0: page dimensions and margins + */ +float scan_u(char *str, int type) +{ + float a; + int nch; + + if (sscanf(str, "%f%n", &a, &nch) == 1) { + str += nch; + if (a == 0) + return 0; + if (*str == '\0' || *str == ' ') { + if (type != 0) + error(0, NULL, "No unit \"%s\"", str - nch); + return a PT; + } + if (!strncasecmp(str, "pt", 2)) + return a PT; + if (!strncasecmp(str, "cm", 2)) + return type ? a CM : a * 28.35; + if (!strncasecmp(str, "in", 2)) + return type ? a IN : a * 72; + } + error(1, NULL, "Unknown unit value \"%s\"", str); + return 20 PT; +} + /* -- get an encoding -- */ static int parse_encoding(char *p) { @@ -584,20 +640,20 @@ || strcmp(p, "above") == 0) return SL_ABOVE; if (strcmp(p, "down") == 0 - || strcmp(p, "below") == 0) + || strcmp(p, "below") == 0 + || strcmp(p, "under") == 0) return SL_BELOW; if (strcmp(p, "hidden") == 0 || strcmp(p, "opposite") == 0) return SL_HIDDEN; - return 0; /* auto (!= SL_AUTO) */ + if (strcmp(p, "auto") == 0) + return 0; /* auto (!= SL_AUTO) */ + return -1; } /* -- get the option for text -- */ int get_textopt(char *p) { - if (*p == '\0' - || strncmp(p, "obeylines", 9) == 0) - return T_LEFT; if (strncmp(p, "align", 5) == 0 || strncmp(p, "justify", 7) == 0) return T_JUSTIFY; @@ -610,7 +666,7 @@ return T_SKIP; if (strncmp(p, "right", 5) == 0) return T_RIGHT; - return -1; + return T_LEFT; } /* -- get the double repeat bar -- */ @@ -646,7 +702,7 @@ } /* -- get a boolean value -- */ -static int g_logv(char *p) +int get_bool(char *p) { switch (*p) { case '\0': @@ -702,7 +758,7 @@ fsize = v; } fontspec(f, - strcmp(fname, "*") != 0 ? fname : 0, + strcmp(fname, "*") != 0 ? fname : NULL, encoding, fsize); if (file_initialized <= 0) @@ -730,9 +786,9 @@ struct tblt_s *tblt; int n; char *q; - static char notes_tb[] = "CDEFGABcdefgab"; - static char pitch_tb[14] = {60, 62, 64, 65, 67, 69, 71, - 72, 74, 76, 77, 79, 81, 83}; + static const char notes_tb[] = "CDEFGABcdefgab"; + static const char pitch_tb[14] = {60, 62, 64, 65, 67, 69, 71, + 72, 74, 76, 77, 79, 81, 83}; /* number */ if (*p == '#') { @@ -800,14 +856,14 @@ error(1, NULL, "Invalid width/height in %%%%tablature"); return 0; } - tblt->hu = scan_u(p); + tblt->hu = scan_u(p, 0); while (*p != '\0' && !isspace((unsigned char) *p)) p++; while (isspace((unsigned char) *p)) p++; if (isdigit(*p)) { tblt->ha = tblt->hu; - tblt->hu = scan_u(p); + tblt->hu = scan_u(p, 0); while (*p != '\0' && !isspace((unsigned char) *p)) p++; while (isspace((unsigned char) *p)) @@ -815,7 +871,7 @@ if (isdigit(*p)) { tblt->wh = tblt->ha; tblt->ha = tblt->hu; - tblt->hu = scan_u(p); + tblt->hu = scan_u(p, 0); while (*p != '\0' && !isspace((unsigned char) *p)) p++; while (isspace((unsigned char) *p)) @@ -875,17 +931,20 @@ struct vpar { char *name; void (*f)(struct VOICE_S *p_voice, int val); - int max; }; static const struct vpar vpar_tb[] = { - {"dynamic", set_dyn, 3}, /* 0 */ - {"gchord", set_gch, 3}, /* 1 */ - {"gstemdir", set_gsd, 3}, /* 2 */ - {"ornament", set_orn, 3}, /* 3 */ - {"stemdir", set_std, 2}, /* 4 */ - {"vocal", set_voc, 3}, /* 5 */ - {"volume", set_vol, 3}, /* 6 */ + {"dynamic", set_dyn}, /* 0 */ + {"gchord", set_gch}, /* 1 */ + {"gstemdir", set_gsd}, /* 2 */ + {"ornament", set_orn}, /* 3 */ + {"stemdir", set_std}, /* 4 */ + {"vocal", set_voc}, /* 5 */ + {"volume", set_vol}, /* 6 */ +#ifndef WIN32 {} +#else + {NULL, NULL, 0} +#endif }; /* -- set a voice parameter -- */ void set_voice_param(struct VOICE_S *p_voice, /* current voice */ @@ -894,17 +953,18 @@ char *p) /* argument */ { const struct vpar *vpar, *vpar2 = NULL; - int i, val; + int i, l, val; + l = strlen(w); for (vpar = vpar_tb; vpar->name; vpar++) { - if (strcmp(w, vpar->name)) + if (strncmp(w, vpar->name, l)) continue; - if (!isdigit(*p)) +// if (!isdigit(*p)) val = get_posit(p); - else - val = strtod(p, 0); - if ((unsigned) val > vpar->max) - goto err; +// else +// val = strtol(p, NULL, 10); +// if ((unsigned) val > vpar->max) +// goto err; break; } if (!vpar->name) { /* compatibility with previous versions */ @@ -914,7 +974,7 @@ if (strcmp(w, "exprabove") == 0) { vpar = &vpar[0]; /* dyn */ vpar2 = &vpar[6]; /* vol */ - if (g_logv(p)) + if (get_bool(p)) val = SL_ABOVE; else val = SL_BELOW; @@ -923,7 +983,7 @@ if (strcmp(w, "exprbelow") == 0) { vpar = &vpar[0]; /* dyn */ vpar2 = &vpar[6]; /* vol */ - if (g_logv(p)) + if (get_bool(p)) val = SL_BELOW; else val = SL_ABOVE; @@ -933,7 +993,7 @@ case 'v': if (strcmp(w, "vocalabove") == 0) { /* compatibility */ vpar = &vpar[5]; /* voc */ - if (g_logv(p)) + if (get_bool(p)) val = SL_ABOVE; else val = SL_BELOW; @@ -965,10 +1025,13 @@ /* -- parse a format line -- */ void interpret_fmt_line(char *w, /* keyword */ - char *p, /* argument */ + char *p, /* value */ int lock) { struct format *fd; + int i; + char *q; + float f; switch (*w) { case 'b': @@ -983,7 +1046,7 @@ break; case 'f': if (strcmp(w, "font") == 0) { - int i, fnum, encoding; + int fnum, encoding; float swfac; char fname[80]; @@ -1006,13 +1069,10 @@ p++; } if (isdigit((unsigned char) *p)) { - char *q; - float v; - - v = strtod(p, &q); - if (v > 2 || (*q != '\0' && *q != '\0')) + f = strtod(p, &q); + if (f > 2 || (*q != '\0' && *q != '\0')) goto bad; - swfac = v; + swfac = f; } } fnum = get_font(fname, encoding); @@ -1037,7 +1097,7 @@ break; case 'm': if (strcmp(w, "musiconly") == 0) { /* compatibility */ - if (g_logv(p)) + if (get_bool(p)) cfmt.fields[1] &= ~(1 << ('w' - 'a')); else cfmt.fields[1] |= (1 << ('w' - 'a')); @@ -1046,23 +1106,45 @@ break; case 'p': if (strcmp(w, "printparts") == 0) { /* compatibility */ - if (g_logv(p)) + if (get_bool(p)) cfmt.fields[0] |= (1 << ('P' - 'A')); else cfmt.fields[0] &= ~(1 << ('P' - 'A')); return; } if (strcmp(w, "printtempo") == 0) { /* compatibility */ - if (g_logv(p)) + if (get_bool(p)) cfmt.fields[0] |= (1 << ('Q' - 'A')); else cfmt.fields[0] &= ~(1 << ('Q' - 'A')); return; } break; + case 's': + if (strncmp(w, "setfont-", 8) == 0) { + i = w[8] - '0'; + if (i < 0 || i >= FONT_UMAX) + return; + g_fspc(p, &cfmt.font_tb[i]); + return; + } + if (strcmp(w, "scale") == 0) { + for (fd = format_tb; fd->name; fd++) + if (strcmp("pagescale", fd->name) == 0) + break; + if (fd->lock) + return; + fd->lock = lock; + f = strtod(p, &q); + if (*q != '\0' && *q != ' ') + goto bad; + cfmt.scale = f / 0.75; // old -> new scale + return; + } + break; case 'w': if (strcmp(w, "withxrefs") == 0) { /* compatibility */ - if (g_logv(p)) + if (get_bool(p)) cfmt.fields[0] |= (1 << ('X' - 'A')); else cfmt.fields[0] &= ~(1 << ('X' - 'A')); @@ -1073,9 +1155,9 @@ int bool; unsigned u; - bool = g_logv(p); + bool = get_bool(p); for (s = info['I' - 'A']; s != 0; s = s->next) { - u = s->as.text[0] - 'A'; + u = s->text[0] - 'A'; if (bool) cfmt.fields[0] |= (1 << u); else @@ -1088,18 +1170,15 @@ for (fd = format_tb; fd->name; fd++) if (strcmp(w, fd->name) == 0) break; - if (fd->name == 0) + if (!fd->name) return; - { - int l; - - l = strlen(p); - if (strcmp(p + l - 5, " lock") == 0) { - p[l - 5] = '\0'; - lock = 1; - } + i = strlen(p); + if (strcmp(p + i - 5, " lock") == 0) { + p[i - 5] = '\0'; + lock = 1; } + if (lock) fd->lock = 1; else if (fd->lock) @@ -1110,6 +1189,8 @@ switch (fd->subtype) { #ifdef HAVE_PANGO case 2: /* %%pango = 0, 1 or 2 */ + if (svg || epsf > 1) // if SVG output + break; if (*p == '2') { cfmt.pango = 2; break; @@ -1119,17 +1200,16 @@ default: case 0: case 3: /* %%abc2pscompat */ - *((int *) fd->v) = g_logv(p); + *((int *) fd->v) = get_bool(p); if (fd->subtype == 3) { if (cfmt.abc2pscompat) - deco['M'] = deco_define("tenuto"); + deco['M'] = "tenuto"; else - deco['M'] = deco_define("lowermordent"); + deco['M'] = "lowermordent"; } break; case 1: { /* %%writefields */ - char *q; - int bool, i; + int bool; unsigned u; q = p; @@ -1137,7 +1217,7 @@ p++; while (isspace((unsigned char) *p)) p++; - bool = g_logv(p); + bool = get_bool(p); while (*q != '\0' && !isspace((unsigned char) *q)) { u = *q - 'A'; if (u < 26) { @@ -1161,12 +1241,14 @@ break; case FORMAT_I: if (fd->subtype == 3) { /* tuplets */ - unsigned i1, i2, i3; + unsigned i1, i2, i3, i4 = 0; - if (sscanf(p, "%d %d %d", &i1, &i2, &i3) != 3 - || i1 > 2 || i2 > 2 || i3 > 2) + if (sscanf(p, "%d %d %d %d", &i1, &i2, &i3, &i4) != 4 + && sscanf(p, "%d %d %d", &i1, &i2, &i3) != 3) + goto bad; + if (i1 > 2 || i2 > 2 || i3 > 2 || i4 > 2) goto bad; - cfmt.tuplets = (i1 << 8) | (i2 << 4) | i3; + cfmt.tuplets = (i1 << 12) | (i2 << 8) | (i3 << 4) | i4; break; } if (fd->subtype == 5) { /* gracespace */ @@ -1174,89 +1256,71 @@ float f1, f2, f3; if (sscanf(p, "%f %f %f", &f1, &f2, &f3) != 3 - || f1 > 256 || f2 > 256 || f3 > 256) + || f1 > 25 || f2 > 25 || f3 > 25) goto bad; - i1 = f2 * 10; + i1 = f1 * 10; i2 = f2 * 10; i3 = f3 * 10; cfmt.gracespace = (i1 << 16) | (i2 << 8) | i3; break; } - if (fd->subtype == 4 && !isdigit(*p)) /* textoption */ - cfmt.textoption = get_textopt(p); + if (fd->subtype == 1 /* splittune */ + && (strcmp(p, "odd") == 0 || strcmp(p, "even") == 0)) + cfmt.splittune = p[0] == 'e' ? 2 : 3; else if (fd->subtype == 2) /* dblrepbar */ cfmt.dblrepbar = get_dblrepbar(p); + else if (fd->subtype == 4 && !isdigit(*p)) /* textoption */ + cfmt.textoption = get_textopt(p); else if (isdigit(*p) || *p == '-' || *p == '+') sscanf(p, "%d", (int *) fd->v); else - *((int *) fd->v) = g_logv(p); - switch (fd->subtype) { - case 1: /* transpose */ - cfmt.transpose *= 3; - if (p[strlen(p) - 1] == '#') { - if (cfmt.transpose > 0) - cfmt.transpose++; - else - cfmt.transpose -= 2; - } else if (p[strlen(p) - 1] == 'b') { - if (cfmt.transpose > 0) - cfmt.transpose += 2; - else - cfmt.transpose--; - } - break; -// case 2: /* (free) */ -// break; - case 4: /* textoption */ - if (cfmt.textoption < 0) + *((int *) fd->v) = get_bool(p); + if (fd->subtype == 4) { /* textoption */ + if (cfmt.textoption < 0) { + cfmt.textoption = 0; goto bad; - break; + } } break; - case FORMAT_R: { - char *q; - int i; - float v; - - v = strtod(p, &q); + case FORMAT_R: + f = strtod(p, &q); if (*q != '\0' && *q != ' ') goto bad; switch (fd->subtype) { default: - if (v <= 0) + if (f <= 0) goto bad; break; case 1: { /* note spacing factor */ float v2; - if (v < 1 || v > 2) + if (f < 1 || f > 2) goto bad; i = C_XFLAGS; /* crotchet index */ v2 = space_tb[i]; for ( ; --i >= 0; ) { - v2 /= v; + v2 /= f; space_tb[i] = v2; } i = C_XFLAGS; v2 = space_tb[i]; for ( ; ++i < NFLAGS_SZ; ) { - v2 *= v; + v2 *= f; space_tb[i] = v2; } break; } case 2: /* maxshrink / stretchlast */ - if (v < 0 || v > 1) + if (f < 0 || f > 1) goto bad; break; case 3: /* breaklimit */ - if (v < 0.5 || v > 1) + if (f < 0.5 || f > 1) goto bad; break; } - *((float *) fd->v) = v; + *((float *) fd->v) = f; break; - } case FORMAT_F: { int b; @@ -1276,28 +1340,30 @@ break; } case FORMAT_U: - *((float *) fd->v) = scan_u(p); - if (fd->subtype == 1) { - float rmargin; - - rmargin = (cfmt.landscape ? cfmt.pageheight : cfmt.pagewidth) + *((float *) fd->v) = scan_u(p, fd->subtype); + switch (fd->subtype) { + case 2: /* staffwidth */ + f = (cfmt.landscape ? cfmt.pageheight : cfmt.pagewidth) - staffwidth - cfmt.leftmargin; - if (rmargin < 0) + if (f < 0) error(1, NULL, "'staffwidth' too big\n"); - cfmt.rightmargin = rmargin; + else + cfmt.rightmargin = f; + break; } break; - case FORMAT_S: { - int l; - - l = strlen(p) + 1; - *((char **) fd->v) = getarena(l); + case FORMAT_S: + i = strlen(p) + 1; + *((char **) fd->v) = getarena(i); if (*p == '"') - get_str(*((char **) fd->v), p, l); + get_str(*((char **) fd->v), p, i); else strcpy(*((char **) fd->v), p); + if (fd->subtype == 1) { // musicfont + // (no control) + svg_font_switch(); + } break; - } } return; bad: @@ -1358,5 +1424,5 @@ /* -- get the encoding of a font -- */ int get_font_encoding(int ft) { - return font_enc[ft]; + return font_enc[cfmt.font_tb[ft].fnum]; } diff -Nru abcm2ps-7.8.9/format.txt abcm2ps-8.14.2/format.txt --- abcm2ps-7.8.9/format.txt 2014-03-26 07:50:22.000000000 +0000 +++ abcm2ps-8.14.2/format.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,2097 +0,0 @@ - Format parameters - ================= - -Note: This file will be soon removed from the abcm2ps distribution. -==== The format parameters documentation is now online: - http://moinejf.free.fr/abcm2ps-doc/index.html - -The general layout of the printed scores may be changed in many ways. - -For example, when running the program, one or more format files may -be specified as program arguments using the command line option -F -(see the file options.txt). -A format file contains a sequence of lines where empty and lines -beginning with a '%' are ignored. -Each line contains a pair consisting of the parameter name -(without the "%%") and the associated value(s). - -Alternatively one or more format parameters may be specified directly -as run time argument pairs using the following syntax. -The first argument is the format parameter name preceded by two dashes -(eg. --vocalfont) and the second argument is the new value. -If the value contains spaces, it should be enclosed by quotes when -the program is run from a shell. For example, the following -command will run abcm2ps on the file myfile.abc changing the format -parameter vocalfont to 'Arial 13'. - - abcm2ps --vocalfont 'Arial 13' myfile.abc - -Format parameters may be specified inside an ABC tune in one of two -ways. Pseudo-comments are specified by beginning a line with '%%'. -The syntax is simply: - - %%parameter_name new_value - -Alternatively, a parameter change may be indicated inside the body of -the tune using the I: information field. For example: - - CDEF | [I:annotationfont Arial 13] "^bla" GABc | - -The keyword "lock" may appear at the end of a parameter value. -After such a keyword has been found, the parameter will not be changed -anymore unless "lock" appears again. -It is implicitly appended in the command line arguments so that these -parameters take precedence and override any other changes. - -example: - abcm2ps --vocalfont 'Arial 13' myfile.abc -in myfile.abc: - %%vocalfont Times-Roman * % <- ignored - %%vocalfont Helvetica * lock % <- vocalfont = 'Helvetica 13' - - -Scope ------ - -This section describes the meaning of the 'Scope:' found in the following -command descriptions. This concept is tied to the way the music is -generated. - -All the commands appearing in the program arguments (including those in -format files) are inserted as pseudo-comments at the head of the ABC file -to be processed. Then, the whole source is parsed. The music is generated -as ABC music elements are processed, but it is not directly written to the -output file. Instead, it is buffered until some event occurs. This may be -either the end of a tune, the end of a page (page full, %%newpage or new tune -with %%splittune), or some specific music element or command (see 'restart' -below). At this moment, if the output file was still empty, the global output -parameters are written (PostScript global definitions), and then the buffered -music is written. - -Here are the possible values of 'Scope:': - -- 'page' - Each output page has specific information (dimensions, - header/footer, ...) which needs to be known at the time a new page - is opened in the output file. As the exact moment of writing - the buffered music may not be known, the commands of scope 'page' - should be set near the beginning of the ABC file or at least - immediately after a 'newpage' command is issued. - -- 'tune' - Commands with the scope 'tune' have to do with the tune headers - (title, composer, tempo...) and footers (lyrics after tune and - notes). - They behave either globally or locally depending on their placement. - - When they appear outside a tune, they apply to the tunes which are - yet to be processed. The parameter values are said to be 'global'. - - When they appear inside a tune, they apply locally to only this - tune, the remaining tunes assume the global values again. - In this case, since the exact write moment is not known, such - commands should appear in the tune header or immediately after - the first K:. - -- 'generation' - As explained above, the generation of the music is done element - by element, independently of the buffering and file output. - It starts at the beginning of a tune and stops naturally at the end - of this tune, but it may be interrupted and restarted when - encountering some specific information field (T: only) or command - (see 'restart' below). - The commands with a scope 'generation' are globally applied to each - generation sequence (between start and stop). In other words, when - a parameter is changed many times in a generation sequence, only the - last value is used. This value remains for the next generation - phases. They have the same global and local behaviour as the 'tune' - commands, i.e. when starting the generation a new tune, all - parameters have the global value. - -- 'immediate' - Such commands are executed as they are found in the source file. - Their effects are immediate and apply to the next music elements. - Some of them may do a generation restart (see 'restart' below). - -- 'voice' - Commands with this scope may appear only inside tunes and apply - to the current voice only. Their main scope type may be - 'generation' or 'immediate'. There is no associated global value. - -- 'restart' - This information indicates that the execution of the command - is preceded by a stop of the generation (see 'generation' above).. - - -Common value types ------------------- - -A value may be: - - 'true', 'yes', '1' or (empty) - - 'false', 'no' or '0' -Only the first character is checked. - - is a whole number, usually positive. - - may be either 'native' or any other string in which case -'utf-8' is assumed (default value). -It is used only for PostScript output without pango. -When the is not 'native', the utf-8 characters are replaced by -the name of their glyphs as they appear in the font files. This is done -thanks to an internal table which contains the ASCII and most Latin -characters. This table may be extended by the command %%glyph to handle more -characters (see the addition of '...' ellipsis - in the file sample.abc). - - is a number which may have a decimal point number (eg. 0.5). - - is used in font definitions. It is expressed in graphic points -(see ). - - is a dimension of which the unit is defined by the suffix: -- 'pt' or no suffix: graphic points, -- 'in': inches, or -- 'cm': centimeters. -The height of a 5 lines staff is always 24pt. - -, and appear in font definitions. -They may be specified as '*' (asterisk), in which case their values -remain unchanged. - may be omitted, in which case its value defaults to 'utf-8' -for the first declaration of the font or it remains unchanged. -When is omitted, it remains unchanged. -Examples: -%%vocalfont Arial 12 % Arial utf-8 12pt -%%vocalfont Times-Roman % Times-Roman utf-8 12pt -%%vocalfont * 13 % Times-Roman utf-8 13pt -%%vocalfont UKaiCN-UTF8-H native % UKaiCN-UTF8-H native 13pt - - -List of the format parameters ------------------------------ - - abc2pscompat - Default: 0 - Compilation: none - Command line: none - Scope: generation - Description: - Handle old abc2ps tunes. - - When set, 'M' becomes the !tenuto! decoration and a pitch - translation may be done for the bass and alto clefs - (respectively, 2 and 1 octaves down). - - It is preferable to rewrite the old tunes to comply with - the current standard rather than using this parameter. - For example, you could include in the tune, - U: M = !tenuto! - and/or: - K:C clef=bass octave=-2 - and the old tune would be interpreted correctly. - - abcm2ps []* - Default: % - Compilation: none - Command line: none - Scope: immediate - Description: - Change the pseudo-comment prefix(es). - - By default, pseudo-comments are lines starting with two percent - signs ("%%"). This command redefines a list of possible second - characters of these commands (up to 3 different characters). - This permits to avoid conflicts with pseudo-comments of other - programs and also to have a simple conditional generation. - Example 1: - - %%abcm2ps * - %*voice Mib % the voices which name contains "Mib" - %*transpose -3 % are transposed a minor third lower - %*voice end - %*abcm2ps % % restore standard pseudo-comments - - Example 2: - - tune.abc: - X:1 - ... - K:C - % % default 4 staves - %Fstaves [(S A) (T B)] % 2 staves - %Sstaves S % Soprano only - %Astaves A % Alto only - V:S - ... - V:A - ... - V:T - ... - V:B - ... - - command line: - abcm2ps --abcm2ps %A tune.abc # generate alto only - - alignbars - Default: 0 - Compilation: none - Command line: none - Scope: immediate, restart and restart after music lines - Description: - Align the bars of the next music lines. - Such an alignment works only when there is only one - voice (i.e. no V:, %%staves or %%score are permitted). - - aligncomposer - Default: 1 - Compilation: none - Command line: none - Scope: tune - Description: - This parameter specifies where the composer field - is displayed. - - A negative value means 'on the left', 0 means 'center', - and a positive value means 'on the right'. - - annotationfont [] [] - Default: Helvetica 12 - Compilation: none - Command line: none - Scope: immediate - Description: - Set the annotation font. - - autoclef - Default: 1 - Compilation: none - Command line: none - Scope: generation - Description: - When this parameter is false, the voices which don't contain - a 'clef=' in K: or V: use the treble clef, according to the - ABC standard. - When true, the clefs and possibly the clef changes for these - voices are determined from the note pitches and inserted - automatically. - - barsperstaff - Default: 0 - Compilation: none - Command line: -B - Scope: generation - Description: - Try to typeset with bars on each line. - - beginps ["nosvg"] - Default: none - Compilation: none - Command line: none - Scope: immediate - Description: - This command introduces a PostScript sequence that - ends with '%%endps' and which will be included in the - PostScript output file. - - Such a sequence cannot be greater than 128 Kb. - - When the output file format is SVG (command options '-g', - '-v' or '-X'), the PostScript code is executed by the - small abcm2ps PS interpreter. Sequences which cannot - be executed (as font redefinitions) must be skipped - checking the presence of the symbol 'svg': - - /svg where {pop} { - .. PostScript code which cannot be executed by abcm2ps .. - } ifelse - - When the option "nosvg" is present, the sequence is not - executed on SVG output. - - beginsvg - Default: none - Compilation: none - Command line: none - Scope: immediate - Description: - This command introduces a SVG sequence that ends with - '%%endsvg' and which will be included in the SVG output file. - - It allows adding a CSS to the generated SVG files. - - The sequence is ignored when the SVG output file has begun - to be written (for example if it is found after the first - K: information field). - - begintext [