1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
#define ALLOC(ptr,type,l) ptr = (type *) calloc((unsigned) l,sizeof(type)); \
if (!ptr) g_error("alloc failure in " #type "_array")
#define CHORD -1
#define NORMAL 0
#define GRACE 1
#define MAX_FIELDS 12
#define AREA fields[ 0]
#define BOOK fields[ 1]
#define COMPOSER fields[ 2]
#define DSCGRAPHY fields[ 3]
#define ELEMSKIP fields[ 4]
#define FILENAME fields[ 5]
#define GROUP fields[ 6]
#define HISTORY fields[ 7]
#define INFO fields[ 8]
#define JOINT fields[ 9]
#define KEY fields[10]
#define LENGTH fields[11]
#define METER fields[12]
#define NOTES fields[13]
#define ORIGIN fields[14]
#define PARTS fields[15]
#define TEMPO fields[16]
#define RHYTHM fields[17]
#define SOURCE fields[18]
#define TITLE fields[19]
#define UFIELD fields[20]
#define VFIELD fields[21]
#define WORDS fields[22]
#define NUMBER fields[23]
#define YFIELD fields[24]
#define ZNOTE fields[25]
#define BARS bars
#define REST -999
#define LAST -1999
struct record {
char *fields[26];
char *bars;
struct record *next;
} ;
typedef struct record Record;
typedef struct {
int n; /* numerator */
int d; /* denominator */
} frac ;
typedef struct {
int length;
int type;
int pitch;
char attributes[9];
char *gchord;
int chord;
int tuplet;
char start[9];
char end[9];
int n_notes;
int iaccidental;
frac broken;
} Note ;
typedef struct {
int gchords_above;
int autobeam;
int old_slurs;
int old_chords;
int old_repeats;
int justification;
int mine;
} Setting ;
typedef struct {
int type;
int repeat_no;
int bar_no;
} Barline;
typedef struct {
char *string;
int info1,info2;
} Field;
typedef struct {
int level;
} Misc;
struct symbol {
int type;
union {
Note note;
Barline bar;
Field field;
Misc misc;
} u;
int newline;
int justify; /* MusicTeX only */
struct symbol *next;
struct symbol *prev;
} ;
typedef struct symbol Symbol;
#ifndef atoi
extern int atoi(const char*);
#endif
/* functions in index.c */
extern void g_error(char*,...);
extern void get_index(char*,char*);
extern void size_record(char*,int*,char*);
extern Record *alloc_record(char*,int*);
extern void free_record(struct record*,char*);
extern int get_record(char*,FILE*,struct record*);
extern int put_record(char*,FILE*,struct record*);
extern char lower(char);
/* functions in abc.c */
extern FILE *openIn(char*);
extern char *getsIn(char*);
extern void closeIn(void);
extern void read_settings(void);
extern int is_field(char*);
extern void stripcpy(char*,char*);
extern int range(int*,int*,int*,int*,char**);
extern void process_abc(char[][99],int,Record*,char*,char*,char*,char*,int,
int,int,int*);
enum output_types {
NO_OUTPUT,
TEX_OUTPUT,
INDEX_OUTPUT,
HASH_OUTPUT
};
enum two_bar_types { NO_BARS, ONE_BAR, TWO_BARS, ONE_BAR_PLUS, TWO_BARS_PLUS };
enum symbol_types { UNDETERMINED, BAR_LINE, NOTE, FIELD, MISC};
enum bar_types { BAR, BAR1, DBL_BAR, LDBL_BAR, RDBL_BAR, REPEAT, LREPEAT,
RREPEAT, RREPEAT2 };
enum accidental_types { NONE, DBL_FLAT, FLAT, NATURAL, SHARP, DBL_SHARP };
|