1
/* A lexical scanner generated by flex */
3
/* Scanner skeleton version:
4
* $Header: /home/kde/kdemultimedia/kmidi/cfg.cpp,v 1.9 2000/08/08 18:21:55 faure Exp $
8
#define YY_FLEX_MAJOR_VERSION 2
9
#define YY_FLEX_MINOR_VERSION 5
14
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
27
/* Use prototypes in function declarations. */
30
/* The "const" storage-class-modifier is valid. */
33
#else /* ! __cplusplus */
41
#endif /* ! __cplusplus */
60
#define YY_PROTO(proto) proto
62
#define YY_PROTO(proto) ()
65
/* Returned upon end-of-file. */
68
/* Promotes a possibly negative, possibly signed char to an unsigned
69
* integer for use as an array index. If the signed char is negative,
70
* we want to instead treat it as an 8-bit unsigned char, hence the
73
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75
/* Enter a start condition. This macro really ought to take a parameter,
76
* but we do it the disgusting crufty way forced on us by the ()-less
77
* definition of BEGIN.
79
#define BEGIN yy_start = 1 + 2 *
81
/* Translate the current start state into a value that can be later handed
82
* to BEGIN to return to the state. The YYSTATE alias is for lex
85
#define YY_START ((yy_start - 1) / 2)
86
#define YYSTATE YY_START
88
/* Action number for EOF rule of a given start state. */
89
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91
/* Special action meaning "start processing a new file". */
92
#define YY_NEW_FILE yyrestart( yyin )
94
#define YY_END_OF_BUFFER_CHAR 0
96
/* Size of default input buffer. */
97
#define YY_BUF_SIZE 16384
99
typedef struct yy_buffer_state *YY_BUFFER_STATE;
102
extern FILE *yyin, *yyout;
104
#define EOB_ACT_CONTINUE_SCAN 0
105
#define EOB_ACT_END_OF_FILE 1
106
#define EOB_ACT_LAST_MATCH 2
108
/* The funky do-while in the following #define is used to turn the definition
109
* int a single C statement (which needs a semi-colon terminator). This
110
* avoids problems with code like:
112
* if ( condition_holds )
115
* do_something_else();
117
* Prior to using the do-while the compiler would get upset at the
118
* "else" because it interpreted the "if" statement as being all
119
* done when it reached the ';' after the yyless() call.
122
/* Return all but the first 'n' matched characters back to the input stream. */
127
/* Undo effects of setting up yytext. */ \
128
*yy_cp = yy_hold_char; \
129
YY_RESTORE_YY_MORE_OFFSET \
130
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
135
#define unput(c) yyunput( c, yytext_ptr )
137
/* The following is because we cannot portably get our hands on size_t
138
* (without autoconf's help, which isn't available because we want
139
* flex-generated scanners to compile on their own).
141
typedef unsigned int yy_size_t;
144
struct yy_buffer_state
148
char *yy_ch_buf; /* input buffer */
149
char *yy_buf_pos; /* current position in input buffer */
151
/* Size of input buffer in bytes, not including room for EOB
154
yy_size_t yy_buf_size;
156
/* Number of characters read into yy_ch_buf, not including EOB
161
/* Whether we "own" the buffer - i.e., we know we created it,
162
* and can realloc() it to grow it, and should free() it to
165
int yy_is_our_buffer;
167
/* Whether this is an "interactive" input source; if so, and
168
* if we're using stdio for input, then we want to use getc()
169
* instead of fread(), to make sure we stop fetching input after
172
int yy_is_interactive;
174
/* Whether we're considered to be at the beginning of a line.
175
* If so, '^' rules will be active on the next match, otherwise
180
/* Whether to try to fill the input buffer when we reach the
185
int yy_buffer_status;
186
#define YY_BUFFER_NEW 0
187
#define YY_BUFFER_NORMAL 1
188
/* When an EOF's been seen but there's still some text to process
189
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
190
* shouldn't try reading from the input source any more. We might
191
* still have a bunch of tokens to match, though, because of
192
* possible backing-up.
194
* When we actually see the EOF, we change the status to "new"
195
* (via yyrestart()), so that the user can continue scanning by
196
* just pointing yyin at a new input file.
198
#define YY_BUFFER_EOF_PENDING 2
201
static YY_BUFFER_STATE yy_current_buffer = 0;
203
/* We provide macros for accessing buffer states in case in the
204
* future we want to put the buffer states in a more general
207
#define YY_CURRENT_BUFFER yy_current_buffer
210
/* yy_hold_char holds the character lost when yytext is formed. */
211
static char yy_hold_char;
213
static int yy_n_chars; /* number of characters read into yy_ch_buf */
218
/* Points to current character in buffer. */
219
static char *yy_c_buf_p = (char *) 0;
220
static int yy_init = 1; /* whether we need to initialize */
221
static int yy_start = 0; /* start state number */
223
/* Flag which is used to allow yywrap()'s to do buffer switches
224
* instead of setting up a fresh yyin. A bit of a hack ...
226
static int yy_did_buffer_switch_on_eof;
228
void yyrestart YY_PROTO(( FILE *input_file ));
230
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
231
void yy_load_buffer_state YY_PROTO(( void ));
232
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
233
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
234
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
235
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
236
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
239
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
240
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
243
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
244
static void yy_flex_free YY_PROTO(( void * ));
246
#define yy_new_buffer yy_create_buffer
248
#define yy_set_interactive(is_interactive) \
250
if ( ! yy_current_buffer ) \
251
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252
yy_current_buffer->yy_is_interactive = is_interactive; \
255
#define yy_set_bol(at_bol) \
257
if ( ! yy_current_buffer ) \
258
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259
yy_current_buffer->yy_at_bol = at_bol; \
262
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
266
#define YY_SKIP_YYWRAP
267
typedef unsigned char YY_CHAR;
268
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
269
typedef int yy_state_type;
271
#define yytext_ptr yytext
273
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
274
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
275
static int yy_get_next_buffer YY_PROTO(( void ));
276
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
278
/* Done after the current pattern has been matched and before the
279
* corresponding action - sets up yytext.
281
#define YY_DO_BEFORE_ACTION \
282
yytext_ptr = yy_bp; \
283
yyleng = (int) (yy_cp - yy_bp); \
284
yy_hold_char = *yy_cp; \
288
#define YY_NUM_RULES 45
289
#define YY_END_OF_BUFFER 46
290
static yyconst short int yy_accept[379] =
292
0, 0, 0, 0, 0, 0, 0, 0, 46, 43,
293
43, 44, 1, 43, 1, 43, 43, 43, 43, 43,
294
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
295
43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
296
43, 43, 43, 43, 43, 0, 1, 1, 0, 0,
297
0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
298
2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
299
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
300
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
301
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
303
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
304
0, 0, 0, 0, 0, 0, 0, 19, 0, 0,
305
0, 23, 0, 29, 0, 28, 0, 27, 0, 26,
306
0, 21, 0, 25, 0, 24, 0, 0, 0, 0,
307
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
308
0, 0, 0, 0, 0, 0, 0, 0, 14, 0,
309
0, 0, 0, 0, 0, 37, 0, 0, 40, 0,
310
0, 0, 22, 0, 0, 0, 0, 0, 0, 0,
311
20, 0, 0, 0, 20, 0, 0, 0, 0, 0,
312
20, 0, 0, 0, 0, 0, 0, 0, 0, 4,
314
3, 5, 0, 0, 0, 0, 0, 0, 0, 0,
315
35, 36, 38, 39, 19, 0, 0, 0, 0, 0,
316
0, 0, 0, 20, 20, 0, 0, 0, 0, 0,
317
0, 6, 0, 0, 5, 5, 0, 0, 0, 30,
318
0, 33, 0, 0, 0, 0, 0, 0, 20, 20,
319
0, 0, 0, 20, 20, 0, 0, 0, 0, 0,
320
13, 0, 0, 0, 5, 5, 0, 0, 31, 0,
321
34, 0, 41, 42, 0, 0, 20, 20, 41, 42,
322
0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
323
0, 0, 20, 20, 0, 0, 0, 0, 0, 15,
325
16, 7, 0, 0, 0, 41, 42, 0, 0, 0,
326
0, 12, 11, 0, 32, 0, 0, 0, 0, 0,
327
7, 6, 6, 6, 6, 0, 6, 6, 6, 0,
328
0, 10, 0, 10, 6, 6, 6, 0, 0, 0,
329
0, 0, 6, 6, 6, 0, 0, 0, 10, 9,
330
6, 6, 6, 0, 0, 20, 0, 6, 6, 6,
331
0, 0, 10, 0, 6, 6, 6, 6, 18, 0,
332
8, 0, 0, 0, 0, 8, 17, 0
335
static yyconst int yy_ec[256] =
337
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
338
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
339
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
340
1, 5, 1, 6, 7, 1, 1, 1, 1, 1,
341
1, 1, 8, 9, 10, 1, 1, 11, 12, 13,
342
11, 11, 11, 11, 11, 11, 11, 14, 1, 1,
343
15, 1, 1, 1, 16, 17, 18, 19, 17, 17,
344
17, 17, 17, 17, 17, 17, 20, 17, 21, 22,
345
17, 17, 17, 17, 17, 23, 17, 24, 17, 17,
346
25, 1, 26, 1, 1, 1, 27, 28, 29, 30,
348
31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
349
41, 42, 36, 43, 44, 45, 46, 47, 36, 48,
350
49, 36, 1, 1, 1, 1, 1, 1, 1, 1,
351
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
354
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
356
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
357
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
361
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
367
static yyconst int yy_meta[50] =
369
1, 2, 3, 4, 5, 6, 4, 1, 1, 1,
370
1, 1, 1, 1, 1, 5, 5, 5, 5, 5,
371
5, 5, 5, 5, 1, 1, 5, 5, 5, 5,
372
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
373
5, 5, 5, 5, 5, 5, 5, 5, 5
376
static yyconst short int yy_base[406] =
378
0, 6, 49, 30, 40, 53, 57, 61, 880, 1311,
379
75, 1311, 0, 105, 870, 132, 134, 24, 139, 1,
380
841, 5, 828, 825, 40, 177, 810, 812, 801, 782,
381
775, 154, 55, 158, 772, 765, 775, 162, 6, 178,
382
758, 755, 767, 170, 63, 106, 0, 0, 0, 222,
383
0, 159, 211, 85, 764, 18, 752, 753, 110, 771,
384
1311, 200, 234, 185, 239, 190, 243, 255, 259, 271,
385
275, 287, 244, 260, 276, 288, 727, 738, 715, 708,
386
693, 694, 208, 687, 227, 677, 0, 679, 682, 665,
387
658, 652, 647, 654, 636, 637, 634, 0, 273, 304,
389
628, 626, 615, 593, 589, 594, 0, 148, 305, 582,
390
577, 583, 562, 555, 552, 0, 190, 311, 0, 317,
391
335, 283, 318, 1311, 349, 313, 353, 356, 368, 363,
392
380, 375, 392, 387, 404, 399, 416, 418, 423, 436,
393
339, 438, 442, 417, 424, 448, 453, 465, 467, 531,
394
538, 528, 329, 525, 529, 472, 354, 484, 1311, 516,
395
486, 511, 521, 499, 497, 1311, 455, 449, 1311, 437,
396
437, 467, 481, 493, 497, 510, 498, 524, 526, 541,
397
543, 549, 556, 567, 573, 542, 427, 421, 525, 578,
398
512, 514, 0, 590, 421, 413, 444, 592, 404, 1311,
400
589, 601, 0, 413, 606, 614, 618, 626, 382, 374,
401
1311, 1311, 1311, 1311, 1311, 630, 634, 645, 651, 632,
402
407, 657, 646, 664, 671, 370, 369, 677, 397, 371,
403
682, 695, 0, 88, 697, 709, 390, 364, 714, 717,
404
702, 1311, 729, 730, 731, 357, 743, 745, 735, 1311,
405
751, 8, 91, 759, 761, 340, 343, 766, 361, 343,
406
771, 371, 327, 323, 766, 798, 583, 802, 776, 757,
407
1311, 803, 814, 815, 205, 241, 820, 826, 1311, 1311,
408
831, 336, 328, 832, 1311, 673, 149, 833, 839, 845,
409
163, 263, 846, 854, 856, 307, 334, 37, 870, 1311,
411
1311, 882, 0, 884, 851, 332, 326, 888, 298, 299,
412
278, 1311, 893, 302, 866, 894, 905, 229, 215, 910,
413
1311, 916, 921, 923, 935, 951, 963, 937, 975, 188,
414
173, 929, 0, 965, 977, 983, 989, 994, 1000, 1024,
415
1006, 1018, 1030, 1042, 1044, 153, 141, 140, 1032, 1008,
416
1050, 1056, 1058, 1066, 1079, 1096, 1102, 0, 1108, 1110,
417
113, 97, 1311, 1081, 1116, 1122, 1124, 1129, 1311, 78,
418
1135, 0, 46, 73, 47, 1311, 1311, 1311, 1157, 1163,
419
1169, 1175, 1181, 1186, 1191, 1197, 1203, 1208, 1214, 1220,
420
1226, 1232, 1237, 1243, 1248, 1253, 1259, 1264, 1270, 1276,
422
1282, 1288, 1293, 1299, 1305
425
static yyconst short int yy_def[406] =
427
379, 379, 379, 2, 379, 2, 379, 2, 378, 378,
428
378, 378, 380, 378, 381, 378, 378, 382, 382, 378,
429
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
430
378, 14, 378, 378, 378, 378, 378, 14, 378, 378,
431
378, 378, 378, 14, 378, 378, 380, 380, 14, 378,
432
17, 382, 382, 378, 378, 378, 378, 378, 378, 381,
433
378, 383, 383, 378, 378, 384, 378, 378, 378, 378,
434
378, 378, 382, 385, 386, 382, 378, 378, 378, 378,
435
378, 378, 378, 378, 378, 378, 26, 378, 378, 378,
436
378, 378, 378, 378, 378, 378, 378, 32, 378, 378,
438
378, 378, 378, 378, 378, 378, 38, 378, 378, 378,
439
378, 378, 378, 378, 378, 44, 378, 383, 387, 378,
440
378, 378, 384, 378, 378, 378, 378, 378, 378, 378,
441
378, 378, 378, 378, 378, 378, 378, 382, 385, 386,
442
388, 378, 385, 378, 378, 386, 378, 389, 382, 378,
443
378, 378, 378, 378, 378, 378, 378, 390, 378, 378,
444
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
445
378, 387, 378, 378, 385, 385, 378, 386, 386, 386,
446
388, 389, 388, 391, 389, 378, 378, 378, 378, 378,
447
389, 389, 392, 382, 378, 378, 378, 393, 378, 378,
449
378, 390, 394, 378, 378, 378, 378, 378, 378, 378,
450
378, 378, 378, 378, 378, 385, 386, 386, 391, 392,
451
392, 391, 392, 389, 389, 378, 378, 382, 378, 378,
452
378, 393, 395, 378, 378, 390, 394, 378, 378, 378,
453
378, 378, 378, 378, 378, 378, 386, 386, 385, 378,
454
392, 392, 392, 389, 389, 378, 378, 382, 378, 378,
455
378, 395, 378, 378, 378, 378, 378, 378, 378, 378,
456
378, 378, 386, 386, 392, 392, 389, 389, 378, 378,
457
382, 378, 378, 378, 378, 378, 378, 396, 378, 378,
458
392, 392, 389, 389, 382, 378, 378, 378, 378, 378,
460
378, 396, 397, 378, 378, 392, 392, 386, 378, 378,
461
378, 378, 378, 397, 378, 393, 398, 378, 378, 399,
462
378, 400, 393, 393, 398, 401, 393, 398, 398, 378,
463
378, 399, 402, 399, 400, 393, 393, 401, 395, 401,
464
395, 403, 393, 398, 398, 378, 378, 402, 399, 399,
465
393, 393, 386, 395, 395, 403, 403, 392, 398, 398,
466
378, 378, 378, 404, 393, 393, 398, 398, 378, 378,
467
404, 405, 378, 405, 378, 378, 378, 0, 378, 378,
468
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
469
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
471
378, 378, 378, 378, 378
474
static yyconst short int yy_nxt[1361] =
476
378, 11, 12, 378, 11, 378, 13, 14, 12, 378,
477
14, 378, 15, 250, 16, 17, 16, 16, 16, 77,
478
78, 18, 18, 18, 18, 18, 18, 19, 18, 18,
479
20, 32, 74, 21, 32, 22, 23, 75, 74, 80,
480
24, 34, 12, 82, 34, 104, 13, 81, 275, 25,
481
26, 12, 80, 26, 38, 13, 27, 38, 40, 12,
482
81, 40, 44, 13, 311, 44, 28, 84, 312, 29,
483
35, 85, 377, 33, 31, 27, 46, 36, 376, 46,
484
86, 47, 84, 39, 37, 28, 85, 41, 29, 375,
485
36, 45, 30, 31, 42, 86, 250, 37, 42, 96,
487
82, 43, 113, 77, 78, 43, 49, 46, 373, 49,
488
46, 47, 47, 50, 51, 50, 50, 50, 263, 264,
489
52, 52, 52, 52, 52, 52, 53, 52, 52, 54,
490
370, 276, 55, 62, 56, 57, 62, 84, 369, 58,
491
50, 85, 50, 50, 50, 363, 63, 74, 59, 64,
492
86, 65, 75, 74, 66, 98, 67, 68, 98, 100,
493
300, 301, 100, 107, 47, 76, 107, 74, 250, 362,
494
69, 116, 75, 74, 116, 70, 71, 72, 87, 109,
495
88, 87, 109, 47, 47, 82, 120, 104, 101, 120,
496
89, 123, 108, 90, 123, 102, 361, 99, 92, 102,
498
117, 62, 103, 88, 62, 119, 103, 111, 110, 156,
499
250, 306, 156, 89, 112, 111, 90, 347, 346, 74,
500
91, 92, 112, 62, 75, 74, 62, 82, 158, 113,
501
50, 158, 50, 50, 50, 378, 63, 76, 378, 119,
502
121, 331, 291, 121, 125, 137, 250, 125, 138, 122,
503
122, 122, 139, 126, 126, 126, 127, 140, 141, 127,
504
129, 142, 330, 129, 143, 128, 128, 128, 250, 130,
505
130, 130, 131, 144, 159, 131, 133, 145, 292, 133,
506
146, 132, 132, 132, 147, 134, 134, 134, 135, 137,
507
148, 135, 138, 122, 122, 122, 139, 136, 136, 136,
509
84, 140, 141, 307, 85, 100, 109, 321, 100, 109,
510
47, 47, 378, 86, 312, 378, 378, 96, 120, 123,
511
319, 120, 123, 126, 126, 126, 318, 173, 173, 173,
512
198, 250, 149, 198, 101, 110, 121, 250, 310, 121,
513
182, 102, 111, 183, 184, 122, 122, 122, 103, 112,
514
125, 309, 185, 125, 127, 158, 297, 127, 158, 126,
515
126, 126, 296, 128, 128, 128, 128, 128, 128, 129,
516
287, 286, 129, 130, 130, 130, 285, 283, 130, 130,
517
130, 131, 282, 280, 131, 132, 132, 132, 279, 272,
518
132, 132, 132, 133, 267, 266, 133, 134, 134, 134,
520
260, 259, 134, 134, 134, 135, 257, 256, 135, 136,
521
136, 136, 250, 246, 136, 136, 136, 137, 186, 137,
522
137, 186, 138, 245, 174, 145, 139, 175, 145, 144,
523
148, 140, 141, 176, 176, 176, 144, 177, 148, 142,
524
178, 238, 142, 142, 147, 231, 143, 234, 231, 145,
525
148, 144, 146, 230, 189, 144, 147, 189, 187, 229,
526
188, 227, 148, 190, 190, 190, 192, 226, 137, 192,
527
193, 138, 215, 156, 214, 139, 156, 179, 213, 180,
528
140, 141, 201, 201, 201, 158, 212, 205, 158, 203,
529
205, 173, 173, 173, 174, 194, 211, 174, 174, 177,
531
206, 175, 177, 190, 190, 190, 144, 176, 176, 176,
532
144, 137, 148, 378, 216, 192, 378, 378, 192, 193,
533
176, 176, 176, 144, 141, 177, 189, 145, 178, 189,
534
146, 210, 147, 209, 147, 190, 190, 190, 148, 187,
535
148, 188, 145, 186, 142, 146, 186, 143, 74, 147,
536
182, 208, 207, 182, 193, 148, 185, 182, 204, 200,
537
183, 184, 185, 199, 197, 179, 217, 180, 220, 185,
538
221, 222, 74, 221, 186, 196, 195, 186, 378, 145,
539
223, 218, 145, 187, 288, 188, 171, 288, 190, 190,
540
190, 137, 148, 198, 138, 170, 198, 233, 139, 201,
542
201, 201, 235, 140, 141, 235, 378, 205, 169, 115,
543
205, 236, 236, 236, 224, 239, 225, 114, 239, 241,
544
206, 113, 241, 228, 240, 240, 240, 243, 168, 167,
545
243, 137, 242, 220, 216, 145, 220, 250, 146, 166,
546
244, 106, 147, 144, 141, 223, 145, 251, 148, 146,
547
251, 250, 220, 147, 221, 222, 249, 221, 220, 148,
548
221, 222, 249, 221, 223, 378, 105, 104, 378, 378,
549
223, 247, 378, 165, 299, 378, 378, 299, 137, 164,
550
163, 138, 248, 231, 162, 139, 231, 252, 161, 253,
551
140, 141, 261, 261, 261, 258, 378, 97, 235, 378,
553
378, 235, 96, 241, 254, 95, 241, 265, 265, 265,
554
235, 255, 94, 235, 378, 239, 242, 93, 239, 236,
555
236, 236, 160, 157, 240, 240, 240, 240, 240, 240,
556
243, 268, 270, 243, 268, 270, 142, 155, 154, 143,
557
269, 269, 269, 244, 145, 271, 145, 146, 144, 146,
558
153, 147, 251, 147, 152, 251, 250, 148, 270, 148,
559
378, 270, 378, 378, 378, 378, 378, 137, 151, 150,
560
138, 271, 284, 61, 139, 284, 265, 265, 265, 140,
561
141, 261, 261, 261, 83, 274, 269, 269, 269, 82,
562
79, 273, 252, 115, 253, 114, 277, 113, 278, 235,
564
281, 106, 235, 268, 289, 105, 268, 289, 265, 265,
565
265, 104, 269, 269, 269, 145, 145, 290, 146, 146,
566
97, 378, 147, 147, 378, 378, 96, 378, 148, 148,
567
378, 378, 137, 284, 288, 138, 284, 288, 303, 139,
568
289, 95, 94, 289, 140, 141, 304, 378, 93, 304,
569
378, 378, 305, 290, 305, 378, 83, 137, 378, 378,
570
138, 315, 315, 315, 139, 82, 294, 79, 293, 308,
571
141, 299, 61, 295, 299, 298, 315, 315, 315, 378,
572
313, 313, 313, 378, 378, 304, 378, 378, 304, 316,
573
378, 305, 317, 305, 320, 316, 147, 320, 316, 233,
575
378, 378, 148, 313, 313, 313, 316, 378, 322, 317,
576
326, 320, 378, 327, 320, 333, 378, 192, 378, 322,
577
192, 193, 378, 378, 378, 378, 378, 378, 378, 179,
578
378, 180, 378, 378, 378, 323, 145, 324, 145, 146,
579
75, 146, 75, 327, 378, 327, 328, 378, 329, 322,
580
378, 322, 339, 334, 262, 340, 75, 262, 378, 341,
581
378, 336, 378, 337, 189, 342, 378, 189, 378, 378,
582
378, 378, 378, 343, 343, 343, 145, 344, 378, 146,
583
75, 378, 378, 327, 378, 378, 378, 378, 378, 322,
584
378, 378, 349, 378, 378, 339, 350, 262, 340, 353,
586
262, 339, 341, 378, 339, 285, 378, 354, 342, 364,
587
354, 285, 364, 378, 342, 345, 355, 355, 355, 357,
588
351, 262, 357, 358, 262, 339, 352, 262, 340, 353,
589
262, 145, 341, 378, 145, 378, 378, 378, 342, 378,
590
343, 343, 343, 145, 322, 145, 146, 75, 146, 75,
591
327, 378, 327, 378, 378, 378, 322, 378, 322, 145,
592
378, 378, 146, 378, 378, 378, 147, 354, 350, 378,
593
354, 285, 148, 378, 378, 378, 355, 355, 355, 359,
594
339, 360, 364, 339, 285, 364, 372, 378, 378, 355,
595
355, 355, 378, 342, 378, 378, 366, 262, 365, 262,
597
262, 285, 262, 357, 378, 262, 357, 358, 262, 145,
598
378, 145, 146, 75, 146, 75, 327, 378, 327, 378,
599
378, 378, 322, 378, 322, 145, 378, 378, 146, 75,
600
145, 378, 327, 146, 75, 378, 378, 327, 322, 378,
601
378, 378, 378, 322, 378, 378, 378, 378, 378, 378,
602
368, 378, 378, 378, 378, 378, 367, 10, 10, 10,
603
10, 10, 10, 48, 48, 378, 48, 48, 48, 60,
604
60, 60, 60, 60, 60, 73, 378, 378, 378, 73,
605
73, 118, 118, 378, 378, 118, 118, 124, 378, 378,
606
124, 74, 74, 378, 378, 74, 74, 75, 75, 378,
608
378, 75, 75, 172, 172, 378, 172, 172, 181, 181,
609
378, 378, 181, 181, 191, 191, 378, 378, 191, 191,
610
202, 202, 378, 378, 202, 202, 219, 219, 378, 219,
611
219, 219, 221, 221, 378, 221, 221, 232, 232, 378,
612
378, 232, 232, 237, 237, 378, 237, 237, 262, 262,
613
378, 262, 262, 302, 302, 378, 378, 302, 302, 314,
614
314, 378, 314, 314, 325, 325, 378, 378, 325, 325,
615
332, 332, 378, 378, 332, 332, 335, 335, 378, 378,
616
335, 335, 338, 338, 378, 338, 338, 338, 348, 348,
617
378, 348, 348, 356, 356, 378, 356, 356, 356, 371,
619
371, 378, 378, 371, 371, 374, 374, 378, 374, 374,
620
9, 378, 378, 378, 378, 378, 378, 378, 378, 378,
621
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
622
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
623
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
624
378, 378, 378, 378, 378, 378, 378, 378, 378, 378
627
static yyconst short int yy_chk[1361] =
629
0, 1, 1, 0, 1, 0, 1, 2, 2, 0,
630
2, 0, 2, 252, 2, 2, 2, 2, 2, 20,
631
20, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632
2, 4, 18, 2, 4, 2, 2, 18, 18, 22,
633
2, 5, 5, 39, 5, 39, 5, 22, 252, 2,
634
3, 3, 56, 3, 6, 3, 4, 6, 7, 7,
635
56, 7, 8, 7, 298, 8, 4, 25, 298, 4,
636
5, 25, 375, 4, 4, 3, 11, 5, 374, 11,
637
25, 11, 33, 6, 5, 3, 33, 7, 3, 373,
638
6, 8, 3, 3, 7, 33, 253, 6, 8, 33,
640
45, 7, 45, 54, 54, 8, 14, 46, 370, 14,
641
46, 14, 46, 14, 14, 14, 14, 14, 234, 234,
642
14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
643
362, 253, 14, 16, 14, 14, 16, 59, 361, 14,
644
16, 59, 16, 16, 16, 348, 16, 19, 14, 17,
645
59, 17, 19, 19, 17, 32, 17, 17, 32, 34,
646
287, 287, 34, 38, 34, 19, 38, 52, 291, 347,
647
17, 44, 52, 52, 44, 17, 17, 17, 26, 40,
648
32, 26, 40, 26, 40, 108, 64, 108, 34, 64,
649
32, 66, 38, 32, 66, 34, 346, 32, 32, 38,
651
44, 62, 34, 26, 62, 62, 38, 44, 40, 83,
652
275, 291, 83, 26, 44, 40, 26, 331, 330, 53,
653
26, 26, 40, 50, 53, 53, 50, 117, 85, 117,
654
50, 85, 50, 50, 50, 63, 50, 53, 63, 63,
655
65, 319, 275, 65, 67, 73, 276, 67, 73, 65,
656
65, 65, 73, 67, 67, 67, 68, 73, 73, 68,
657
69, 74, 318, 69, 74, 68, 68, 68, 292, 69,
658
69, 69, 70, 74, 85, 70, 71, 75, 276, 71,
659
75, 70, 70, 70, 75, 71, 71, 71, 72, 76,
660
75, 72, 76, 122, 122, 122, 76, 72, 72, 72,
662
99, 76, 76, 292, 99, 100, 109, 314, 100, 109,
663
100, 109, 118, 99, 311, 118, 118, 99, 120, 123,
664
310, 120, 123, 126, 126, 126, 309, 120, 120, 120,
665
153, 307, 76, 153, 100, 109, 121, 306, 297, 121,
666
141, 100, 109, 141, 141, 121, 121, 121, 100, 109,
667
125, 296, 141, 125, 127, 157, 283, 127, 157, 125,
668
125, 125, 282, 127, 127, 127, 128, 128, 128, 129,
669
264, 263, 129, 130, 130, 130, 262, 260, 129, 129,
670
129, 131, 259, 257, 131, 132, 132, 132, 256, 246,
671
131, 131, 131, 133, 238, 237, 133, 134, 134, 134,
673
230, 229, 133, 133, 133, 135, 227, 226, 135, 136,
674
136, 136, 221, 210, 135, 135, 135, 137, 144, 138,
675
137, 144, 138, 209, 139, 145, 138, 139, 145, 137,
676
137, 138, 138, 139, 139, 139, 139, 140, 145, 142,
677
140, 204, 142, 143, 140, 197, 143, 199, 197, 146,
678
140, 142, 146, 196, 147, 143, 146, 147, 144, 195,
679
144, 188, 146, 147, 147, 147, 148, 187, 149, 148,
680
148, 149, 172, 156, 171, 149, 156, 140, 170, 140,
681
149, 149, 156, 156, 156, 158, 168, 161, 158, 158,
682
161, 173, 173, 173, 174, 149, 167, 174, 175, 177,
684
161, 175, 177, 174, 174, 174, 174, 175, 175, 175,
685
175, 176, 177, 191, 176, 192, 191, 191, 192, 192,
686
176, 176, 176, 176, 176, 178, 189, 179, 178, 189,
687
179, 165, 178, 164, 179, 189, 189, 189, 178, 177,
688
179, 177, 180, 186, 181, 180, 186, 181, 181, 180,
689
182, 163, 162, 182, 182, 180, 181, 183, 160, 155,
690
183, 183, 182, 154, 152, 178, 179, 178, 184, 183,
691
184, 184, 184, 184, 185, 151, 150, 185, 185, 190,
692
184, 180, 190, 186, 267, 186, 115, 267, 190, 190,
693
190, 194, 190, 198, 194, 114, 198, 198, 194, 201,
695
201, 201, 202, 194, 194, 202, 202, 205, 113, 112,
696
205, 202, 202, 202, 185, 206, 185, 111, 206, 207,
697
205, 110, 207, 194, 206, 206, 206, 208, 106, 105,
698
208, 216, 207, 220, 216, 217, 220, 220, 217, 104,
699
208, 103, 217, 216, 216, 220, 218, 223, 217, 218,
700
223, 223, 219, 218, 219, 219, 219, 219, 222, 218,
701
222, 222, 222, 222, 219, 224, 102, 101, 224, 224,
702
222, 217, 225, 97, 286, 225, 225, 286, 228, 96,
703
95, 228, 218, 231, 94, 228, 231, 223, 93, 223,
704
228, 228, 231, 231, 231, 228, 232, 92, 235, 232,
706
232, 235, 91, 241, 224, 90, 241, 235, 235, 235,
707
236, 225, 89, 236, 236, 239, 241, 88, 239, 236,
708
236, 236, 86, 84, 239, 239, 239, 240, 240, 240,
709
243, 244, 245, 243, 244, 245, 249, 82, 81, 249,
710
244, 244, 244, 243, 247, 245, 248, 247, 249, 248,
711
80, 247, 251, 248, 79, 251, 251, 247, 270, 248,
712
254, 270, 255, 254, 254, 255, 255, 258, 78, 77,
713
258, 270, 261, 60, 258, 261, 265, 265, 265, 258,
714
258, 261, 261, 261, 58, 248, 269, 269, 269, 57,
715
55, 247, 251, 43, 251, 42, 254, 41, 255, 266,
717
258, 37, 266, 268, 272, 36, 268, 272, 266, 266,
718
266, 35, 268, 268, 268, 273, 274, 272, 273, 274,
719
31, 277, 273, 274, 277, 277, 30, 278, 273, 274,
720
278, 278, 281, 284, 288, 281, 284, 288, 288, 281,
721
289, 29, 28, 289, 281, 281, 290, 293, 27, 290,
722
293, 293, 290, 289, 290, 294, 24, 295, 294, 294,
723
295, 305, 305, 305, 295, 23, 278, 21, 277, 295,
724
295, 299, 15, 281, 299, 284, 315, 315, 315, 9,
725
299, 299, 299, 302, 0, 304, 302, 302, 304, 308,
726
0, 304, 308, 304, 313, 316, 308, 313, 316, 316,
728
0, 0, 308, 313, 313, 313, 317, 0, 316, 317,
729
317, 320, 0, 317, 320, 320, 0, 322, 0, 317,
730
322, 322, 323, 0, 324, 323, 323, 324, 324, 308,
731
332, 308, 0, 332, 332, 316, 325, 316, 328, 325,
732
325, 328, 328, 325, 0, 328, 317, 0, 317, 325,
733
0, 328, 326, 320, 326, 326, 326, 326, 0, 326,
734
0, 323, 0, 324, 327, 326, 334, 327, 327, 334,
735
334, 0, 0, 327, 327, 327, 329, 328, 335, 329,
736
329, 335, 335, 329, 336, 0, 0, 336, 336, 329,
737
337, 0, 334, 337, 337, 338, 334, 338, 338, 338,
739
338, 339, 338, 0, 339, 339, 0, 341, 338, 350,
740
341, 341, 350, 350, 339, 329, 341, 341, 341, 342,
741
336, 342, 342, 342, 342, 340, 337, 340, 340, 340,
742
340, 343, 340, 349, 343, 343, 349, 349, 340, 0,
743
343, 343, 343, 344, 343, 345, 344, 344, 345, 345,
744
344, 351, 345, 0, 351, 351, 344, 352, 345, 353,
745
352, 352, 353, 0, 0, 0, 353, 354, 349, 0,
746
354, 354, 353, 0, 0, 0, 354, 354, 354, 344,
747
355, 345, 364, 355, 355, 364, 364, 0, 0, 355,
748
355, 355, 0, 355, 0, 0, 352, 356, 351, 356,
750
356, 356, 356, 357, 0, 357, 357, 357, 357, 359,
751
0, 360, 359, 359, 360, 360, 359, 365, 360, 0,
752
365, 365, 359, 366, 360, 367, 366, 366, 367, 367,
753
368, 0, 367, 368, 368, 0, 371, 368, 367, 371,
754
371, 0, 0, 368, 0, 0, 0, 0, 0, 0,
755
360, 0, 0, 0, 0, 0, 359, 379, 379, 379,
756
379, 379, 379, 380, 380, 0, 380, 380, 380, 381,
757
381, 381, 381, 381, 381, 382, 0, 0, 0, 382,
758
382, 383, 383, 0, 0, 383, 383, 384, 0, 0,
759
384, 385, 385, 0, 0, 385, 385, 386, 386, 0,
761
0, 386, 386, 387, 387, 0, 387, 387, 388, 388,
762
0, 0, 388, 388, 389, 389, 0, 0, 389, 389,
763
390, 390, 0, 0, 390, 390, 391, 391, 0, 391,
764
391, 391, 392, 392, 0, 392, 392, 393, 393, 0,
765
0, 393, 393, 394, 394, 0, 394, 394, 395, 395,
766
0, 395, 395, 396, 396, 0, 0, 396, 396, 397,
767
397, 0, 397, 397, 398, 398, 0, 0, 398, 398,
768
399, 399, 0, 0, 399, 399, 400, 400, 0, 0,
769
400, 400, 401, 401, 0, 401, 401, 401, 402, 402,
770
0, 402, 402, 403, 403, 0, 403, 403, 403, 404,
772
404, 0, 0, 404, 404, 405, 405, 0, 405, 405,
773
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
774
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
775
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
776
378, 378, 378, 378, 378, 378, 378, 378, 378, 378,
777
378, 378, 378, 378, 378, 378, 378, 378, 378, 378
780
static yy_state_type yy_last_accepting_state;
781
static char *yy_last_accepting_cpos;
783
/* The intent behind this definition is that it'll catch
784
* any uses of REJECT which flex missed.
786
#define REJECT reject_used_but_not_detected
787
#define yymore() yymore_used_but_not_detected
788
#define YY_MORE_ADJ 0
789
#define YY_RESTORE_YY_MORE_OFFSET
795
* Cfg file reader, Greg Lee, 8/93.
796
* Adapted from Adagio for KMidi 12/99.
797
* $Id: cfg.cpp,v 1.9 2000/08/08 18:21:55 faure Exp $
806
#include "playmidi.h"
807
#include "readmidi.h"
809
#include "controls.h"
813
#define YY_ALWAYS_INTERACTIVE 0
814
#define YY_NEVER_INTERACTIVE 1
816
#define YY_INPUT(buf,result,max_size) \
817
result = fread( buf, 1, max_size, yyin );
819
extern int set_play_mode(char *cp);
820
static int prescanning;
821
static char doing_drums = 0;
822
static char doing_sf = 0;
823
static int patchno = -1;
825
static char *patchname;
826
static char cfg_flag = 1;
827
static int tone_bank;
828
static void set_patchno(char *m);
830
static char *s_dirname = 0;
831
static char *sfname = 0;
833
static int current_toneset = 0;
834
static int current_drumset = 0;
836
static int cfg_condition = -1;
838
static ToneBank *bank=0;
839
static int banknum=0;
840
static int rcf_count=1;
841
static int font_type=FONT_NORMAL;
844
#define MAX_INCLUDE_DEPTH 40
845
static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
846
static int include_stack_ptr = 0;
848
static void new_toneset(int n);
849
static void new_patch(const char *vname, int num);
851
#define YY_NO_UNPUT 1
857
/* Macros after this point can all be overridden by user definitions in
861
#ifndef YY_SKIP_YYWRAP
863
extern "C" int yywrap YY_PROTO(( void ));
865
extern int yywrap YY_PROTO(( void ));
870
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
874
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
877
#ifdef YY_NEED_STRLEN
878
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
883
static int yyinput YY_PROTO(( void ));
885
static int input YY_PROTO(( void ));
890
static int yy_start_stack_ptr = 0;
891
static int yy_start_stack_depth = 0;
892
static int *yy_start_stack = 0;
893
#ifndef YY_NO_PUSH_STATE
894
static void yy_push_state YY_PROTO(( int new_state ));
896
#ifndef YY_NO_POP_STATE
897
static void yy_pop_state YY_PROTO(( void ));
899
#ifndef YY_NO_TOP_STATE
900
static int yy_top_state YY_PROTO(( void ));
904
#define YY_NO_PUSH_STATE 1
905
#define YY_NO_POP_STATE 1
906
#define YY_NO_TOP_STATE 1
909
#ifdef YY_MALLOC_DECL
917
/* Just try to get by without declaring the routines. This will fail
918
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
919
* or sizeof(void*) != sizeof(int).
924
/* Amount of stuff to slurp up with each read. */
925
#ifndef YY_READ_BUF_SIZE
926
#define YY_READ_BUF_SIZE 8192
929
/* Copy whatever the last rule matched to the standard output. */
932
/* This used to be an fputs(), but since the string might contain NUL's,
933
* we now use fwrite().
935
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
938
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
939
* is returned in "result".
942
#define YY_INPUT(buf,result,max_size) \
943
if ( yy_current_buffer->yy_is_interactive ) \
946
for ( n = 0; n < max_size && \
947
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
950
buf[n++] = (char) c; \
951
if ( c == EOF && ferror( yyin ) ) \
952
YY_FATAL_ERROR( "input in flex scanner failed" ); \
955
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
956
&& ferror( yyin ) ) \
957
YY_FATAL_ERROR( "input in flex scanner failed" );
960
/* No semi-colon after return; correct usage is to write "yyterminate();" -
961
* we don't want an extra ';' after the "return" because that will cause
962
* some compilers to complain about unreachable statements.
965
#define yyterminate() return YY_NULL
968
/* Number of entries by which start-condition stack grows. */
969
#ifndef YY_START_STACK_INCR
970
#define YY_START_STACK_INCR 25
973
/* Report a fatal error. */
974
#ifndef YY_FATAL_ERROR
975
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
978
/* Default declaration of generated scanner - a define so the user can
979
* easily add parameters.
982
#define YY_DECL int yylex YY_PROTO(( void ))
985
/* Code executed at the beginning of each rule, after yytext and yyleng
988
#ifndef YY_USER_ACTION
989
#define YY_USER_ACTION
992
/* Code executed at the end of each rule. */
994
#define YY_BREAK break;
997
#define YY_RULE_SETUP \
999
yy_current_buffer->yy_at_bol = \
1000
(yytext[yyleng - 1] == '\n'); \
1005
register yy_state_type yy_current_state;
1006
register char *yy_cp = NULL, *yy_bp = NULL;
1007
register int yy_act;
1022
yy_start = 1; /* first start state */
1030
if ( ! yy_current_buffer )
1032
yy_create_buffer( yyin, YY_BUF_SIZE );
1034
yy_load_buffer_state();
1037
while ( 1 ) /* loops until end-of-file is reached */
1041
/* Support of yytext. */
1042
*yy_cp = yy_hold_char;
1044
/* yy_bp points to the position in yy_ch_buf of the start of
1049
yy_current_state = yy_start;
1050
yy_current_state += YY_AT_BOL();
1054
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1055
if ( yy_accept[yy_current_state] )
1057
yy_last_accepting_state = yy_current_state;
1058
yy_last_accepting_cpos = yy_cp;
1060
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1062
yy_current_state = (int) yy_def[yy_current_state];
1063
if ( yy_current_state >= 379 )
1064
yy_c = yy_meta[(unsigned int) yy_c];
1066
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1069
while ( yy_current_state != 378 );
1070
yy_cp = yy_last_accepting_cpos;
1071
yy_current_state = yy_last_accepting_state;
1074
yy_act = yy_accept[yy_current_state];
1076
YY_DO_BEFORE_ACTION;
1079
do_action: /* This label is used only to access EOF actions. */
1083
{ /* beginning of action switch */
1084
case 0: /* must back up */
1085
/* undo the effects of YY_DO_BEFORE_ACTION */
1086
*yy_cp = yy_hold_char;
1087
yy_cp = yy_last_accepting_cpos;
1088
yy_current_state = yy_last_accepting_state;
1089
goto yy_find_action;
1106
while (isspace(yytext[i])) i++;
1108
cfg_condition = atoi(yytext+i);
1122
int sf_oldbank, sf_newbank = banknum;
1124
while (isspace(yytext[i])) i++;
1125
if (yytext[i+1] == 'f') i += 2;
1127
while (isspace(yytext[i])) i++;
1128
if (yytext[i] == '"') {
1130
for (j = i; j < yyleng && yytext[j] != '"'; j++) ;
1133
else for (j = i; j < yyleng && !isspace(yytext[j]); j++) ;
1134
sfname = strncpy( (char *)malloc(j-i+1), yytext+i, j-i );
1136
if (doing_drums) sf_newbank += 256;
1137
sf_oldbank = sf_newbank;
1139
while (j < yyleng && isspace(yytext[j])) j++;
1140
if (j < yyleng && isdigit(yytext[j])) sf_oldbank = atoi(yytext+j);
1142
init_soundfont(sfname, sf_oldbank, sf_newbank, rcf_count);
1150
while (isspace(yytext[i])) i++;
1151
if (yytext[i] == 'd') i += 3;
1153
while (isspace(yytext[i])) i++;
1154
s_dirname = strcpy( (char *)malloc(strlen(yytext+i)+1), yytext+i );
1155
add_to_pathlist(s_dirname, rcf_count);
1167
while (isspace(yytext[i])) i++;
1169
while (isspace(yytext[i])) i++;
1171
if (prescanning && cfg_condition >= 0 && cfg_condition < 30 &&
1172
rcf_count==1 && !cfg_names[cfg_condition])
1174
cfg_names[cfg_condition] = (char *)safe_malloc(strlen(yytext+i)+1);
1175
strcpy(cfg_names[cfg_condition], yytext+i);
1178
if (!prescanning && (cfg_condition < 0 || cfg_condition == cfg_select)) {
1181
if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
1182
ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
1183
"Probable source loop in configuration files");
1186
include_stack[include_stack_ptr++] =
1189
fname = strcpy( (char *)malloc(strlen(yytext+i)+1), yytext+i );
1194
yyin = open_file(fname, 1, OF_VERBOSE, rcf_count);
1197
ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
1198
"Source file %s not found\n", fname);
1199
include_stack_ptr--;
1202
if (yyin == NULL) yyin = save_yyin;
1206
yy_switch_to_buffer(
1207
yy_create_buffer( yyin, YY_BUF_SIZE ) );
1213
case YY_STATE_EOF(INITIAL):
1214
case YY_STATE_EOF(P):
1215
case YY_STATE_EOF(K):
1216
case YY_STATE_EOF(S):
1219
if ( --include_stack_ptr < 0 ) {
1223
if (yyin) close_file(yyin);
1224
yy_delete_buffer( YY_CURRENT_BUFFER );
1226
yy_switch_to_buffer(
1227
include_stack[include_stack_ptr] );
1235
char *bank_name = NULL;
1237
while (isspace(yytext[i])) i++;
1239
current_drumset = atoi(yytext+i);
1242
new_toneset(current_drumset);
1245
while (isspace(yytext[i])) i++;
1246
while (isdigit(yytext[i])) i++;
1247
while (isspace(yytext[i])) i++;
1248
if (yytext[i+1] == 'f') i += 2; else i += 3;
1249
while (isspace(yytext[i])) i++;
1250
patchname = yytext + i;
1251
if (patchname[0] == '"') {
1252
bank_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
1253
bank_name[strlen(patchname)-2] = '\0';
1255
else bank_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
1256
bank->name = bank_name;
1266
while (isspace(yytext[i])) i++;
1268
current_drumset = atoi(yytext+i);
1271
new_toneset(current_drumset);
1279
char *bank_name = NULL;
1281
while (isspace(yytext[i])) i++;
1283
current_drumset = atoi(yytext+i);
1286
new_toneset(current_drumset);
1287
font_type=FONT_NORMAL;
1289
while (isspace(yytext[i])) i++;
1290
while (isdigit(yytext[i])) i++;
1291
while (isspace(yytext[i])) i++;
1292
patchname = yytext + i;
1293
if (patchname[0] == '"') {
1294
bank_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
1295
bank_name[strlen(patchname)-2] = '\0';
1297
else bank_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
1298
bank->name = bank_name;
1307
while (isspace(yytext[i])) i++;
1309
current_drumset = atoi(yytext+i);
1312
new_toneset(current_drumset);
1313
font_type=FONT_NORMAL;
1321
while (isspace(yytext[i])) i++;
1323
current_toneset = atoi(yytext+i);
1326
new_toneset(current_toneset);
1335
while (isspace(yytext[i])) i++;
1337
current_toneset = atoi(yytext+i);
1340
new_toneset(current_toneset);
1341
font_type=FONT_NORMAL;
1348
current_toneset = SFXBANK;
1351
new_toneset(current_toneset);
1352
font_type=FONT_NORMAL;
1359
current_drumset = SFXDRUM1;
1362
new_toneset(current_toneset);
1363
font_type=FONT_NORMAL;
1364
bank->name = "drumsfx1";
1371
current_drumset = SFXDRUM2;
1374
new_toneset(current_toneset);
1375
font_type=FONT_NORMAL;
1376
bank->name = "drumsfx2";
1391
current_drumset = current_toneset;
1398
const char *gm_name = NULL;
1399
char *vc_name = NULL;
1400
patchno = atoi(yytext);
1404
while (isspace(yytext[i])) i++;
1405
while (isdigit(yytext[i])) i++;
1406
if (yytext[i] == ',') {
1408
tone_bank = atoi(yytext + i);
1409
while (isdigit(yytext[i])) i++;
1412
if (doing_drums) tone_bank = current_drumset;
1413
else tone_bank = current_toneset;
1415
new_toneset(tone_bank);
1417
while (isspace(yytext[i])) i++;
1418
if (!cfg_flag && yytext[i] == '=') i++;
1419
if ( (patchname = strrchr(yytext + i, '\\')) == NULL)
1420
patchname = yytext + i;
1422
if (patchname[0] == '"') {
1423
vc_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
1424
vc_name[strlen(patchname)-2] = '\0';
1426
else vc_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
1427
if (patchno < 128) gm_name = gm_voice[doing_drums? patchno+128 : patchno].vname;
1429
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Bad patch number %d in cfg file.", patchno);
1431
if (gm_name == NULL) gm_name = (doing_drums)? "drum":"instr";
1433
ctl->cmsg(CMSG_INFO, VERB_DEBUG, "config: voice %s[%d,%d] = patch %s",
1434
gm_name, patchno, tone_bank, vc_name);
1436
new_patch(vc_name, patchno);
1446
const char *gm_name = NULL;
1447
char *vc_name = NULL;
1449
set_patchno(yytext);
1451
if (patchno < 256) {
1453
while (yytext[i] != '=' && yytext[i] != ',') i++;
1454
if (yytext[i] == ',') {
1456
tone_bank = atoi(yytext + i);
1459
if (doing_drums) tone_bank = current_drumset;
1460
else tone_bank = current_toneset;
1463
while (yytext[i] != '=') i++;
1465
while (isspace(yytext[i])) i++;
1466
if ( (patchname = strrchr(yytext + i, '\\')) == NULL)
1467
patchname = yytext + i;
1469
if (patchname[0] == '"') {
1470
vc_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
1471
vc_name[strlen(patchname)-2] = '\0';
1473
else vc_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
1474
gm_name = gm_voice[patchno].vname;
1475
if (gm_name == NULL) gm_name = (doing_drums)? "drum":"instr";
1477
ctl->cmsg(CMSG_INFO, VERB_DEBUG, "config: voice %s[%d,%d] = patch %s",
1478
gm_name, patchno, tone_bank, vc_name);
1482
ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Bad line \"%s ...\" in cfg file.", yytext);
1484
new_patch(vc_name, patchno);
1492
{ if (prescanning) {
1493
i=0; while(isspace(yytext[i])) i++;
1494
j = atoi(yytext+i+2);
1495
if (j > 1 && j < MAX_VOICES) voices = j;
1501
{ if (prescanning) {
1502
i=0; while(isspace(yytext[i])) i++;
1503
j = atoi(yytext+i+2);
1504
if (j > 1 && j < MAX_AMPLIFICATION) amplification = j;
1510
{ if (prescanning) {
1511
i=0; while(isspace(yytext[i])) i++;
1512
j = atoi(yytext+i+2);
1513
if (j > 1 && j < MAX_CONTROL_RATIO) control_ratio = j;
1519
{ if (prescanning) {
1520
i=0; while(isspace(yytext[i])) i++;
1521
j = atoi(yytext+i+2);
1522
if (j < 100) j *= 1000;
1523
if (j > MIN_OUTPUT_RATE && j < MAX_OUTPUT_RATE) play_mode->rate = j;
1529
{ if (prescanning) {
1530
i=0; while(isspace(yytext[i])) i++;
1531
j = atoi(yytext+i+2);
1532
max_patch_memory = j * 1000000;
1538
{ if (prescanning) {
1539
i=0; while(isspace(yytext[i])) i++;
1540
j = atoi(yytext+i+2);
1541
if (j >= 0 && j <= 3) current_interpolation = j;
1547
{ if (prescanning) {
1548
i=0; while(isspace(yytext[i])) i++;
1549
j = atoi(yytext+i+2);
1550
if (j >= 0 && j <= 2) opt_expression_curve = j;
1556
{ if (prescanning) {
1557
i=0; while(isspace(yytext[i])) i++;
1558
j = atoi(yytext+i+2);
1559
if (j >= 0 && j <= 2) opt_volume_curve = j;
1565
{ if (prescanning) {
1566
i=0; while(isspace(yytext[i])) i++;
1568
while(isspace(yytext[i])) i++;
1569
if (set_play_mode(yytext+i)) /* error */;
1577
while (yytext[i] != '=') i++;
1578
bank->tone[patchno].amp = atoi(yytext+i+1);
1587
while (yytext[i] != '=') i++;
1588
bank->tone[patchno].note = atoi(yytext+i+1);
1597
while (yytext[i] != '=') i++;
1598
bank->tone[patchno].tuning = atoi(yytext+i+1);
1616
bank->tone[patchno].strip_loop=0;
1624
bank->tone[patchno].strip_tail=0;
1632
bank->tone[patchno].strip_envelope=0;
1640
bank->tone[patchno].strip_loop=1;
1648
bank->tone[patchno].strip_tail=1;
1656
bank->tone[patchno].strip_envelope=1;
1664
set_patchno(yytext);
1665
if (patchno < 256) gm_voice[patchno].flags &= ~SOLO_MASK;
1672
set_patchno(yytext);
1673
if (patchno < 256) gm_voice[patchno].flags |= SOLO_MASK;
1692
case YY_END_OF_BUFFER:
1694
/* Amount of text matched not including the EOB char. */
1695
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
1697
/* Undo the effects of YY_DO_BEFORE_ACTION. */
1698
*yy_cp = yy_hold_char;
1699
YY_RESTORE_YY_MORE_OFFSET
1701
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
1703
/* We're scanning a new file or input source. It's
1704
* possible that this happened because the user
1705
* just pointed yyin at a new source and called
1706
* yylex(). If so, then we have to assure
1707
* consistency between yy_current_buffer and our
1708
* globals. Here is the right place to do so, because
1709
* this is the first action (other than possibly a
1710
* back-up) that will match for the new input source.
1712
yy_n_chars = yy_current_buffer->yy_n_chars;
1713
yy_current_buffer->yy_input_file = yyin;
1714
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
1717
/* Note that here we test for yy_c_buf_p "<=" to the position
1718
* of the first EOB in the buffer, since yy_c_buf_p will
1719
* already have been incremented past the NUL character
1720
* (since all states make transitions on EOB to the
1721
* end-of-buffer state). Contrast this with the test
1724
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1725
{ /* This was really a NUL. */
1726
yy_state_type yy_next_state;
1728
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
1730
yy_current_state = yy_get_previous_state();
1732
/* Okay, we're now positioned to make the NUL
1733
* transition. We couldn't have
1734
* yy_get_previous_state() go ahead and do it
1735
* for us because it doesn't know how to deal
1736
* with the possibility of jamming (and we don't
1737
* want to build jamming into it because then it
1738
* will run more slowly).
1741
yy_next_state = yy_try_NUL_trans( yy_current_state );
1743
yy_bp = yytext_ptr + YY_MORE_ADJ;
1745
if ( yy_next_state )
1747
/* Consume the NUL. */
1748
yy_cp = ++yy_c_buf_p;
1749
yy_current_state = yy_next_state;
1755
yy_cp = yy_last_accepting_cpos;
1756
yy_current_state = yy_last_accepting_state;
1757
goto yy_find_action;
1761
else switch ( yy_get_next_buffer() )
1763
case EOB_ACT_END_OF_FILE:
1765
yy_did_buffer_switch_on_eof = 0;
1769
/* Note: because we've taken care in
1770
* yy_get_next_buffer() to have set up
1771
* yytext, we can now set up
1772
* yy_c_buf_p so that if some total
1773
* hoser (like flex itself) wants to
1774
* call the scanner after we return the
1775
* YY_NULL, it'll still work - another
1776
* YY_NULL will get returned.
1778
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
1780
yy_act = YY_STATE_EOF(YY_START);
1786
if ( ! yy_did_buffer_switch_on_eof )
1792
case EOB_ACT_CONTINUE_SCAN:
1794
yytext_ptr + yy_amount_of_matched_text;
1796
yy_current_state = yy_get_previous_state();
1799
yy_bp = yytext_ptr + YY_MORE_ADJ;
1802
case EOB_ACT_LAST_MATCH:
1804
&yy_current_buffer->yy_ch_buf[yy_n_chars];
1806
yy_current_state = yy_get_previous_state();
1809
yy_bp = yytext_ptr + YY_MORE_ADJ;
1810
goto yy_find_action;
1817
"fatal flex scanner internal error--no action found" );
1818
} /* end of action switch */
1819
} /* end of scanning one token */
1820
} /* end of yylex */
1823
/* yy_get_next_buffer - try to read in a new buffer
1825
* Returns a code representing an action:
1826
* EOB_ACT_LAST_MATCH -
1827
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1828
* EOB_ACT_END_OF_FILE - end of file
1831
static int yy_get_next_buffer()
1833
register char *dest = yy_current_buffer->yy_ch_buf;
1834
register char *source = yytext_ptr;
1835
register int number_to_move, i;
1838
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1840
"fatal flex scanner internal error--end of buffer missed" );
1842
if ( yy_current_buffer->yy_fill_buffer == 0 )
1843
{ /* Don't try to fill the buffer, so this is an EOF. */
1844
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1846
/* We matched a single character, the EOB, so
1847
* treat this as a final EOF.
1849
return EOB_ACT_END_OF_FILE;
1854
/* We matched some text prior to the EOB, first
1857
return EOB_ACT_LAST_MATCH;
1861
/* Try to read more data. */
1863
/* First move last chars to start of buffer. */
1864
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1866
for ( i = 0; i < number_to_move; ++i )
1867
*(dest++) = *(source++);
1869
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1870
/* don't do the read, it's not guaranteed to return an EOF,
1873
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1878
yy_current_buffer->yy_buf_size - number_to_move - 1;
1880
while ( num_to_read <= 0 )
1881
{ /* Not enough room in the buffer - grow it. */
1882
#ifdef YY_USES_REJECT
1884
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1887
/* just a shorter name for the current buffer */
1888
YY_BUFFER_STATE b = yy_current_buffer;
1890
int yy_c_buf_p_offset =
1891
(int) (yy_c_buf_p - b->yy_ch_buf);
1893
if ( b->yy_is_our_buffer )
1895
int new_size = b->yy_buf_size * 2;
1897
if ( new_size <= 0 )
1898
b->yy_buf_size += b->yy_buf_size / 8;
1900
b->yy_buf_size *= 2;
1902
b->yy_ch_buf = (char *)
1903
/* Include room in for 2 EOB chars. */
1904
yy_flex_realloc( (void *) b->yy_ch_buf,
1905
b->yy_buf_size + 2 );
1908
/* Can't grow it, we don't own it. */
1911
if ( ! b->yy_ch_buf )
1913
"fatal error - scanner input buffer overflow" );
1915
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1917
num_to_read = yy_current_buffer->yy_buf_size -
1922
if ( num_to_read > YY_READ_BUF_SIZE )
1923
num_to_read = YY_READ_BUF_SIZE;
1925
/* Read in more data. */
1926
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1927
yy_n_chars, num_to_read );
1929
yy_current_buffer->yy_n_chars = yy_n_chars;
1932
if ( yy_n_chars == 0 )
1934
if ( number_to_move == YY_MORE_ADJ )
1936
ret_val = EOB_ACT_END_OF_FILE;
1942
ret_val = EOB_ACT_LAST_MATCH;
1943
yy_current_buffer->yy_buffer_status =
1944
YY_BUFFER_EOF_PENDING;
1949
ret_val = EOB_ACT_CONTINUE_SCAN;
1951
yy_n_chars += number_to_move;
1952
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1953
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1955
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1961
/* yy_get_previous_state - get the state just before the EOB char was reached */
1963
static yy_state_type yy_get_previous_state()
1965
register yy_state_type yy_current_state;
1966
register char *yy_cp;
1968
yy_current_state = yy_start;
1969
yy_current_state += YY_AT_BOL();
1971
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1973
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1974
if ( yy_accept[yy_current_state] )
1976
yy_last_accepting_state = yy_current_state;
1977
yy_last_accepting_cpos = yy_cp;
1979
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1981
yy_current_state = (int) yy_def[yy_current_state];
1982
if ( yy_current_state >= 379 )
1983
yy_c = yy_meta[(unsigned int) yy_c];
1985
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1988
return yy_current_state;
1992
/* yy_try_NUL_trans - try to make a transition on the NUL character
1995
* next_state = yy_try_NUL_trans( current_state );
1998
#ifdef YY_USE_PROTOS
1999
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
2001
static yy_state_type yy_try_NUL_trans( yy_current_state )
2002
yy_state_type yy_current_state;
2005
register int yy_is_jam;
2006
register char *yy_cp = yy_c_buf_p;
2008
register YY_CHAR yy_c = 1;
2009
if ( yy_accept[yy_current_state] )
2011
yy_last_accepting_state = yy_current_state;
2012
yy_last_accepting_cpos = yy_cp;
2014
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2016
yy_current_state = (int) yy_def[yy_current_state];
2017
if ( yy_current_state >= 379 )
2018
yy_c = yy_meta[(unsigned int) yy_c];
2020
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2021
yy_is_jam = (yy_current_state == 378);
2023
return yy_is_jam ? 0 : yy_current_state;
2028
#ifdef YY_USE_PROTOS
2029
static void yyunput( int c, register char *yy_bp )
2031
static void yyunput( c, yy_bp )
2033
register char *yy_bp;
2036
register char *yy_cp = yy_c_buf_p;
2038
/* undo effects of setting up yytext */
2039
*yy_cp = yy_hold_char;
2041
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2042
{ /* need to shift things up to make room */
2043
/* +2 for EOB chars. */
2044
register int number_to_move = yy_n_chars + 2;
2045
register char *dest = &yy_current_buffer->yy_ch_buf[
2046
yy_current_buffer->yy_buf_size + 2];
2047
register char *source =
2048
&yy_current_buffer->yy_ch_buf[number_to_move];
2050
while ( source > yy_current_buffer->yy_ch_buf )
2051
*--dest = *--source;
2053
yy_cp += (int) (dest - source);
2054
yy_bp += (int) (dest - source);
2055
yy_current_buffer->yy_n_chars =
2056
yy_n_chars = yy_current_buffer->yy_buf_size;
2058
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
2059
YY_FATAL_ERROR( "flex scanner push-back overflow" );
2062
*--yy_cp = (char) c;
2066
yy_hold_char = *yy_cp;
2069
#endif /* ifndef YY_NO_UNPUT */
2073
static int yyinput()
2080
*yy_c_buf_p = yy_hold_char;
2082
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2084
/* yy_c_buf_p now points to the character we want to return.
2085
* If this occurs *before* the EOB characters, then it's a
2086
* valid NUL; if not, then we've hit the end of the buffer.
2088
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2089
/* This was really a NUL. */
2093
{ /* need more input */
2094
int offset = yy_c_buf_p - yytext_ptr;
2097
switch ( yy_get_next_buffer() )
2099
case EOB_ACT_LAST_MATCH:
2100
/* This happens because yy_g_n_b()
2101
* sees that we've accumulated a
2102
* token and flags that we need to
2103
* try matching the token before
2104
* proceeding. But for input(),
2105
* there's no matching to consider.
2106
* So convert the EOB_ACT_LAST_MATCH
2107
* to EOB_ACT_END_OF_FILE.
2110
/* Reset buffer status. */
2115
case EOB_ACT_END_OF_FILE:
2120
if ( ! yy_did_buffer_switch_on_eof )
2129
case EOB_ACT_CONTINUE_SCAN:
2130
yy_c_buf_p = yytext_ptr + offset;
2136
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
2137
*yy_c_buf_p = '\0'; /* preserve yytext */
2138
yy_hold_char = *++yy_c_buf_p;
2140
yy_current_buffer->yy_at_bol = (c == '\n');
2146
#ifdef YY_USE_PROTOS
2147
void yyrestart( FILE *input_file )
2149
void yyrestart( input_file )
2153
if ( ! yy_current_buffer )
2154
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
2156
yy_init_buffer( yy_current_buffer, input_file );
2157
yy_load_buffer_state();
2161
#ifdef YY_USE_PROTOS
2162
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
2164
void yy_switch_to_buffer( new_buffer )
2165
YY_BUFFER_STATE new_buffer;
2168
if ( yy_current_buffer == new_buffer )
2171
if ( yy_current_buffer )
2173
/* Flush out information for old buffer. */
2174
*yy_c_buf_p = yy_hold_char;
2175
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
2176
yy_current_buffer->yy_n_chars = yy_n_chars;
2179
yy_current_buffer = new_buffer;
2180
yy_load_buffer_state();
2182
/* We don't actually know whether we did this switch during
2183
* EOF (yywrap()) processing, but the only time this flag
2184
* is looked at is after yywrap() is called, so it's safe
2185
* to go ahead and always set it.
2187
yy_did_buffer_switch_on_eof = 1;
2191
#ifdef YY_USE_PROTOS
2192
void yy_load_buffer_state( void )
2194
void yy_load_buffer_state()
2197
yy_n_chars = yy_current_buffer->yy_n_chars;
2198
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
2199
yyin = yy_current_buffer->yy_input_file;
2200
yy_hold_char = *yy_c_buf_p;
2204
#ifdef YY_USE_PROTOS
2205
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
2207
YY_BUFFER_STATE yy_create_buffer( file, size )
2214
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2216
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2218
b->yy_buf_size = size;
2220
/* yy_ch_buf has to be 2 characters longer than the size given because
2221
* we need to put in 2 end-of-buffer characters.
2223
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
2224
if ( ! b->yy_ch_buf )
2225
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
2227
b->yy_is_our_buffer = 1;
2229
yy_init_buffer( b, file );
2235
#ifdef YY_USE_PROTOS
2236
void yy_delete_buffer( YY_BUFFER_STATE b )
2238
void yy_delete_buffer( b )
2245
if ( b == yy_current_buffer )
2246
yy_current_buffer = (YY_BUFFER_STATE) 0;
2248
if ( b->yy_is_our_buffer )
2249
yy_flex_free( (void *) b->yy_ch_buf );
2251
yy_flex_free( (void *) b );
2255
#ifndef YY_ALWAYS_INTERACTIVE
2256
#ifndef YY_NEVER_INTERACTIVE
2257
extern int isatty YY_PROTO(( int ));
2261
#ifdef YY_USE_PROTOS
2262
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
2264
void yy_init_buffer( b, file )
2271
yy_flush_buffer( b );
2273
b->yy_input_file = file;
2274
b->yy_fill_buffer = 1;
2276
#if YY_ALWAYS_INTERACTIVE
2277
b->yy_is_interactive = 1;
2279
#if YY_NEVER_INTERACTIVE
2280
b->yy_is_interactive = 0;
2282
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2288
#ifdef YY_USE_PROTOS
2289
void yy_flush_buffer( YY_BUFFER_STATE b )
2291
void yy_flush_buffer( b )
2301
/* We always need two end-of-buffer characters. The first causes
2302
* a transition to the end-of-buffer state. The second causes
2303
* a jam in that state.
2305
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2306
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2308
b->yy_buf_pos = &b->yy_ch_buf[0];
2311
b->yy_buffer_status = YY_BUFFER_NEW;
2313
if ( b == yy_current_buffer )
2314
yy_load_buffer_state();
2318
#ifndef YY_NO_SCAN_BUFFER
2319
#ifdef YY_USE_PROTOS
2320
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
2322
YY_BUFFER_STATE yy_scan_buffer( base, size )
2330
base[size-2] != YY_END_OF_BUFFER_CHAR ||
2331
base[size-1] != YY_END_OF_BUFFER_CHAR )
2332
/* They forgot to leave room for the EOB's. */
2335
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
2337
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2339
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2340
b->yy_buf_pos = b->yy_ch_buf = base;
2341
b->yy_is_our_buffer = 0;
2342
b->yy_input_file = 0;
2343
b->yy_n_chars = b->yy_buf_size;
2344
b->yy_is_interactive = 0;
2346
b->yy_fill_buffer = 0;
2347
b->yy_buffer_status = YY_BUFFER_NEW;
2349
yy_switch_to_buffer( b );
2356
#ifndef YY_NO_SCAN_STRING
2357
#ifdef YY_USE_PROTOS
2358
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
2360
YY_BUFFER_STATE yy_scan_string( yy_str )
2361
yyconst char *yy_str;
2365
for ( len = 0; yy_str[len]; ++len )
2368
return yy_scan_bytes( yy_str, len );
2373
#ifndef YY_NO_SCAN_BYTES
2374
#ifdef YY_USE_PROTOS
2375
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
2377
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
2378
yyconst char *bytes;
2387
/* Get memory for full buffer, including space for trailing EOB's. */
2389
buf = (char *) yy_flex_alloc( n );
2391
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2393
for ( i = 0; i < len; ++i )
2396
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
2398
b = yy_scan_buffer( buf, n );
2400
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2402
/* It's okay to grow etc. this buffer, and we should throw it
2403
* away when we're done.
2405
b->yy_is_our_buffer = 1;
2412
#ifndef YY_NO_PUSH_STATE
2413
#ifdef YY_USE_PROTOS
2414
static void yy_push_state( int new_state )
2416
static void yy_push_state( new_state )
2420
if ( yy_start_stack_ptr >= yy_start_stack_depth )
2424
yy_start_stack_depth += YY_START_STACK_INCR;
2425
new_size = yy_start_stack_depth * sizeof( int );
2427
if ( ! yy_start_stack )
2428
yy_start_stack = (int *) yy_flex_alloc( new_size );
2431
yy_start_stack = (int *) yy_flex_realloc(
2432
(void *) yy_start_stack, new_size );
2434
if ( ! yy_start_stack )
2436
"out of memory expanding start-condition stack" );
2439
yy_start_stack[yy_start_stack_ptr++] = YY_START;
2446
#ifndef YY_NO_POP_STATE
2447
static void yy_pop_state()
2449
if ( --yy_start_stack_ptr < 0 )
2450
YY_FATAL_ERROR( "start-condition stack underflow" );
2452
BEGIN(yy_start_stack[yy_start_stack_ptr]);
2457
#ifndef YY_NO_TOP_STATE
2458
static int yy_top_state()
2460
return yy_start_stack[yy_start_stack_ptr - 1];
2464
#ifndef YY_EXIT_FAILURE
2465
#define YY_EXIT_FAILURE 2
2468
#ifdef YY_USE_PROTOS
2469
static void yy_fatal_error( yyconst char msg[] )
2471
static void yy_fatal_error( msg )
2475
(void) fprintf( stderr, "%s\n", msg );
2476
exit( YY_EXIT_FAILURE );
2481
/* Redefine yyless() so it works in section 3 code. */
2487
/* Undo effects of setting up yytext. */ \
2488
yytext[yyleng] = yy_hold_char; \
2489
yy_c_buf_p = yytext + n; \
2490
yy_hold_char = *yy_c_buf_p; \
2491
*yy_c_buf_p = '\0'; \
2497
/* Internal utility routines. */
2500
#ifdef YY_USE_PROTOS
2501
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
2503
static void yy_flex_strncpy( s1, s2, n )
2510
for ( i = 0; i < n; ++i )
2515
#ifdef YY_NEED_STRLEN
2516
#ifdef YY_USE_PROTOS
2517
static int yy_flex_strlen( yyconst char *s )
2519
static int yy_flex_strlen( s )
2524
for ( n = 0; s[n]; ++n )
2532
#ifdef YY_USE_PROTOS
2533
static void *yy_flex_alloc( yy_size_t size )
2535
static void *yy_flex_alloc( size )
2539
return (void *) malloc( size );
2542
#ifdef YY_USE_PROTOS
2543
static void *yy_flex_realloc( void *ptr, yy_size_t size )
2545
static void *yy_flex_realloc( ptr, size )
2550
/* The cast to (char *) in the following accommodates both
2551
* implementations that use char* generic pointers, and those
2552
* that use void* generic pointers. It works with the latter
2553
* because both ANSI C and C++ allow castless assignment from
2554
* any pointer type to void*, and deal with argument conversions
2555
* as though doing an assignment.
2557
return (void *) realloc( (char *) ptr, size );
2560
#ifdef YY_USE_PROTOS
2561
static void yy_flex_free( void *ptr )
2563
static void yy_flex_free( ptr )
2580
static void new_toneset(int n)
2586
tonebank[n]=(ToneBank *)safe_malloc(sizeof(ToneBank));
2587
memset(tonebank[n], 0, sizeof(ToneBank));
2593
drumset[n]=(ToneBank *)safe_malloc(sizeof(ToneBank));
2594
memset(drumset[n], 0, sizeof(ToneBank));
2600
static void new_patch(const char *vname, int num)
2602
if (bank->tone[num].name) return;
2603
bank->tone[num].name=vname;
2604
bank->tone[num].note=bank->tone[num].amp=bank->tone[num].pan=
2605
bank->tone[num].strip_loop=bank->tone[num].strip_envelope=
2606
bank->tone[num].sf_ix=
2607
bank->tone[num].strip_tail=bank->tone[num].last_used=-1;
2608
bank->tone[num].font_type=font_type;
2609
bank->tone[num].tuning=0;
2610
bank->tone[num].layer=0;
2613
static void set_patchno(char *m)
2618
while (isspace(m[w])) w++;
2619
for (i = 0; i < 256; i++) {
2620
vn = gm_voice[i].vname;
2621
if (vn == NULL) continue;
2622
for (j = 0; m[j+w] && vn[j+y] && m[j+w] == vn[j+y]; j++)
2623
if (vn[j+y+1] && isspace(vn[j+y+1]) && m[j+w+1] && !isspace(m[j+w+1]) ) y++ ;
2624
if (!m[j+w] || m[j+w] == '=' || m[j+w] == ',' || m[j+w] == ':') break;
2625
if (!vn[j+y] && isspace(m[j+w])) break;
2627
if (i < 256 && vn != NULL) patchno = i;
2632
char *current_config_file = 0;
2634
int read_config_file(const char *name, int prescan)
2637
prescanning = prescan;
2638
include_stack_ptr = 0;
2642
current_config_file = (char *)safe_malloc(strlen(name)+1);
2643
strcpy(current_config_file, name);
2646
yyin = open_file(name, 1, OF_VERBOSE, rcf_count);
2647
if (!yyin) return -1;
2649
current_toneset = current_drumset = 0;
2650
doing_drums = doing_sf = 0;
2651
if (!(retvalue = yylex())) {
2652
if (prescan) got_a_configuration = 1;
2653
else got_a_configuration = 2;