Last change
on this file since 0292fbb was 0c834c5, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Prototypes for global function pointers. Consistent global types.
|
-
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 |
|
---|
[0580615] | 8 | extern int sqscan(char *ip);
|
---|
[f40a309] | 9 |
|
---|
[0c834c5] | 10 | extern short endflg;
|
---|
[f40a309] | 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 |
|
---|
[0580615] | 28 | short rscript(char *p[])
|
---|
[f40a309] | 29 | {
|
---|
| 30 | short rc;
|
---|
| 31 |
|
---|
| 32 | sqinit(); /* initialize the score string interpreter */
|
---|
| 33 | rc = 0; /* preset rc for end of script return */
|
---|
| 34 |
|
---|
| 35 | while (*p) { /* feed the interpreter the score strings */
|
---|
| 36 |
|
---|
| 37 | if (!sqscan(*p++)) { /* ... until we have an error ... */
|
---|
| 38 |
|
---|
| 39 | rc = -1; /* error return */
|
---|
| 40 | break;
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | if (endflg) { /* ... or until we hit the !end */
|
---|
| 44 |
|
---|
| 45 | rc = 1; /* !end return */
|
---|
| 46 | break;
|
---|
| 47 | }
|
---|
| 48 | }
|
---|
| 49 |
|
---|
| 50 | return(rc);
|
---|
| 51 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.