Last change
on this file since a6f5b95 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
1.2 KB
|
Rev | Line | |
---|
[3ae31e9] | 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 |
|
---|
| 8 | extern int sqscan();
|
---|
| 9 |
|
---|
| 10 | extern int endflg;
|
---|
| 11 |
|
---|
| 12 | char *script0[] = { /* initialization score selection string */
|
---|
| 13 |
|
---|
| 14 | "!quiet !normal !score=0 !weight=60 !end",
|
---|
| 15 | (char *)0L
|
---|
| 16 | };
|
---|
| 17 |
|
---|
| 18 | /*
|
---|
| 19 | =============================================================================
|
---|
| 20 | rscript() -- run a script and return the end condition
|
---|
| 21 |
|
---|
| 22 | -1 error returned by sqscan
|
---|
| 23 | 0 end of strings, no errors
|
---|
| 24 | 1 !end statement encountered
|
---|
| 25 | =============================================================================
|
---|
| 26 | */
|
---|
| 27 |
|
---|
| 28 | short
|
---|
| 29 | rscript(p)
|
---|
| 30 | register char *p[];
|
---|
| 31 | {
|
---|
| 32 | short rc;
|
---|
| 33 |
|
---|
| 34 | sqinit(); /* initialize the score string interpreter */
|
---|
| 35 | rc = 0; /* preset rc for end of script return */
|
---|
| 36 |
|
---|
| 37 | while (*p) { /* feed the interpreter the score strings */
|
---|
| 38 |
|
---|
| 39 | if (!sqscan(*p++)) { /* ... until we have an error ... */
|
---|
| 40 |
|
---|
| 41 | rc = -1; /* error return */
|
---|
| 42 | break;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | if (endflg) { /* ... or until we hit the !end */
|
---|
| 46 |
|
---|
| 47 | rc = 1; /* !end return */
|
---|
| 48 | break;
|
---|
| 49 | }
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | return(rc);
|
---|
| 53 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.