Last change
on this file since 6262b5c was 6262b5c, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Added include files for global functions and variables.
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | rscript.c -- define the score test script for scordsp.c
|
---|
| 4 | Version 13 -- 1988-11-03 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[6262b5c] | 8 | #include "all.h"
|
---|
| 9 |
|
---|
[7258c6a] | 10 | extern int16_t sqscan(int8_t *ip);
|
---|
[f40a309] | 11 |
|
---|
[e225e77] | 12 | extern void sqinit(void);
|
---|
| 13 |
|
---|
[7258c6a] | 14 | extern int16_t endflg;
|
---|
[f40a309] | 15 |
|
---|
[7258c6a] | 16 | int8_t *script0[] = { /* initialization score selection string */
|
---|
[f40a309] | 17 |
|
---|
| 18 | "!quiet !normal !score=0 !weight=60 !end",
|
---|
[7258c6a] | 19 | (int8_t *)0L
|
---|
[f40a309] | 20 | };
|
---|
| 21 |
|
---|
| 22 | /*
|
---|
| 23 | =============================================================================
|
---|
| 24 | rscript() -- run a script and return the end condition
|
---|
| 25 |
|
---|
| 26 | -1 error returned by sqscan
|
---|
| 27 | 0 end of strings, no errors
|
---|
| 28 | 1 !end statement encountered
|
---|
| 29 | =============================================================================
|
---|
| 30 | */
|
---|
| 31 |
|
---|
[7258c6a] | 32 | int16_t rscript(int8_t *p[])
|
---|
[f40a309] | 33 | {
|
---|
[7258c6a] | 34 | int16_t rc;
|
---|
[f40a309] | 35 |
|
---|
| 36 | sqinit(); /* initialize the score string interpreter */
|
---|
| 37 | rc = 0; /* preset rc for end of script return */
|
---|
| 38 |
|
---|
| 39 | while (*p) { /* feed the interpreter the score strings */
|
---|
| 40 |
|
---|
| 41 | if (!sqscan(*p++)) { /* ... until we have an error ... */
|
---|
| 42 |
|
---|
| 43 | rc = -1; /* error return */
|
---|
| 44 | break;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | if (endflg) { /* ... or until we hit the !end */
|
---|
| 48 |
|
---|
| 49 | rc = 1; /* !end return */
|
---|
| 50 | break;
|
---|
| 51 | }
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | return(rc);
|
---|
| 55 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.