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
RevLine 
[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
[7258c6a]8extern int16_t sqscan(int8_t *ip);
[f40a309]9
[e225e77]10extern void sqinit(void);
11
[7258c6a]12extern int16_t endflg;
[f40a309]13
[7258c6a]14int8_t *script0[] = { /* initialization score selection string */
[f40a309]15
16 "!quiet !normal !score=0 !weight=60 !end",
[7258c6a]17 (int8_t *)0L
[f40a309]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
[7258c6a]30int16_t rscript(int8_t *p[])
[f40a309]31{
[7258c6a]32 int16_t rc;
[f40a309]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.