source: buchla-68k/ram/rscript.c@ e225e77

Last change on this file since e225e77 was e225e77, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added missing includes and declarations.

  • Property mode set to 100644
File size: 1.2 KB
Line 
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
8extern int16_t sqscan(int8_t *ip);
9
10extern void sqinit(void);
11
12extern int16_t endflg;
13
14int8_t *script0[] = { /* initialization score selection string */
15
16 "!quiet !normal !score=0 !weight=60 !end",
17 (int8_t *)0L
18};
19
20/*
21 =============================================================================
22 rscript() -- run a script and return the end condition
23
24 -1 error returned by sqscan
25 0 end of strings, no errors
26 1 !end statement encountered
27 =============================================================================
28*/
29
30int16_t rscript(int8_t *p[])
31{
32 int16_t 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.