File: parseabc.h

package info (click to toggle)
abcmidi 20190705-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,128 kB
  • sloc: ansic: 30,529; sh: 427; makefile: 104
file content (211 lines) | stat: -rw-r--r-- 7,159 bytes parent folder | download | duplicates (2)
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
/* parseabc.h - interface file for abc parser */
/* used by abc2midi, abc2abc and yaps */

/* abc.h must be #included before this file */
/* functions and variables provided by parseabc.c */

/* for Microsoft Visual C++ 6 */
#ifdef _MSC_VER
#define KANDR
#endif

/* the arg list to event_voice keeps growing; if we put the args into a structure
and pass that around, routines that don't need the new ones need not be altered.
NB. event_voice is *called* from parseabc.c, the actual procedure is linked
in from the program-specific file */
/* added middle= stuff */
#define V_STRLEN 256 /* [SS] 2017-10-11 increase from 64 */
struct voice_params {
	int gotclef;
	int gotoctave;
        int gottranspose;
	int gotname;
	int gotsname;
	int gotmiddle;
        int gotother;  /* [SS] 2011-04-18 */
        int octave;
	int transpose;
	char clefname[V_STRLEN+1];
	char namestring[V_STRLEN+1];
	char snamestring[V_STRLEN+1];
	char middlestring[V_STRLEN+1];
        char other[V_STRLEN+1]; /* [SS] 2011-04-18 */
	};

/* holds a fraction */
struct fraction {
  int num;
  int denom;
};


#ifndef KANDR
extern int readnump(char **p);
extern int readsnump(char **p);
extern int readnumf(char *num);
extern void skipspace(char **p);
extern int readsnumf(char *s);
extern void readstr(char out[], char **in, int limit);
extern int getarg(char *option, int argc, char *argv[]);
extern int *checkmalloc(int size);
extern char *addstring(char *s);
extern char *concatenatestring(char *s1, char *s2);
extern char *lookup_abbreviation(char symbol);
extern int ismicrotone(char **p, int dir);
extern void event_normal_tone(void);
extern void print_inputline(void);
extern void print_inputline_nolinefeed(void);
#else
extern int readnump();
extern int readsnump();
extern int readnumf();
extern void skipspace();
extern int readsnumf();
extern void readstr();
extern int getarg();
extern int *checkmalloc();
extern char *addstring();
extern char *concatenatestring();
extern char *lookup_abbreviation();
extern int ismicrotone();
extern void event_normal_tone();
extern void print_inputline_nolinefeed();
#endif
extern void parseron();
extern void parseroff();

extern int lineno;

/* event_X() routines - these are called from parseabc.c       */
/* the program that uses the parser must supply these routines */
#ifndef KANDR
extern void event_init(int argc, char *argv[], char **filename);
extern void event_text(char *s);
extern void event_reserved(char p);
extern void event_tex(char *s);
extern void event_linebreak(void);
extern void event_startmusicline(void);
extern void event_endmusicline(char endchar);
extern void event_eof(void);
extern void event_comment(char *s);
extern void event_specific(char *package, char *s);
extern void event_specific_in_header(char *package, char *s);
extern void event_startinline(void);
extern void event_closeinline(void);
extern void event_field(char k, char *f);
extern void event_words(char *p, int continuation);
extern void event_part(char *s);


extern void event_voice(int n, char *s, struct voice_params *params);
extern void event_length(int n);
extern void event_blankline(void);
extern void event_refno(int n);
extern void event_tempo(int n, int a, int b, int rel, char *pre, char *post);
extern void event_timesig(int n, int m, int dochecking);
extern void event_octave(int num, int local);
extern void event_info_key(char *key, char *value);
extern void event_info(char *s);
extern void event_key(int sharps, char *s, int modeindex, 
               char modmap[7], int modmul[7], struct fraction modmicro[7],
               int gotkey, int gotclef, char *clefname,
               int octave, int transpose, int gotoctave, int gottranspose,
               int explict);
extern void event_microtone(int dir, int a, int b);
extern void event_graceon(void);
extern void event_graceoff(void);
extern void event_rep1(void);
extern void event_rep2(void);
extern void event_playonrep(char *s);
extern void event_tie(void);
extern void event_slur(int t);
extern void event_sluron(int t);
extern void event_sluroff(int t);
extern void event_rest(int decorators[DECSIZE],int n,int m,int type);
extern void event_mrest(int n,int m,char c);
extern void event_spacing(int n, int m);
extern void event_bar(int type, char *replist);
extern void event_space(void);
extern void event_lineend(char ch, int n);
extern void event_broken(int type, int mult);
extern void event_tuple(int n, int q, int r);
extern void event_chord(void);
extern void event_chordon(int chorddecorators[DECSIZE]);
extern void event_chordoff(int, int);
extern void event_instruction(char *s);
extern void event_gchord(char *s);
extern void event_note(int decorators[DECSIZE], char accidental, int mult, 
                       char note, int xoctave, int n, int m);
extern void event_abbreviation(char symbol, char *string, char container);
extern void event_acciaccatura();
extern void event_start_extended_overlay();
extern void event_stop_extended_overlay();
extern void event_split_voice();
extern void print_voicecodes(void);
extern void init_abbreviations();
extern void free_abbreviations();
extern void parsefile();
extern int parsetune();
#else
extern void event_init();
extern void event_text();
extern void event_reserved();
extern void event_tex();
extern void event_linebreak();
extern void event_startmusicline();
extern void event_endmusicline();
extern void event_eof();
extern void event_comment();
extern void event_specific();
extern void event_specific_in_header();
extern void event_startinline();
extern void event_closeinline();
extern void event_field();
extern void event_words();
extern void event_part();
extern void event_voice();
extern void event_length();
extern void event_blankline();
extern void event_refno();
extern void event_tempo();
extern void event_timesig();
extern void event_octave();
extern void event_info_key();
extern void event_info();
extern void event_key();
extern void event_microtone();
extern void event_graceon();
extern void event_graceoff();
extern void event_rep1();
extern void event_rep2();
extern void event_playonrep();
extern void event_tie();
extern void event_slur();
extern void event_sluron();
extern void event_sluroff();
extern void event_rest();
extern void event_mrest();
extern void event_spacing();
extern void event_bar();
extern void event_space();
extern void event_lineend();
extern void event_broken();
extern void event_tuple();
extern void event_chord();
extern void event_chordon();
extern void event_chordoff();
extern void event_instruction();
extern void event_gchord();
extern void event_note();
extern void event_ignore();
extern void event_abbreviation();
extern void event_acciaccatura();
extern void event_start_extended_overlay();
extern void event_stop_extended_overlay();
extern void event_split_voice();
extern void print_voicecodes();
extern void init_abbreviations();
extern void free_abbreviations();
extern void parsefile();
extern int parsetune();
#endif