1 /*********************************************************************** 2 3 SPL, the Shakespeare Programming Language 4 5 Copyright (C) 2001 Karl Hasselstr�m and Jon �slund 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2 of the License, or (at 10 your option) any later version. 11 12 This program is distributed in the hope that it will be useful, but 13 WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, write to the Free Software 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 20 USA. 21 22 ***********************************************************************/ 23 24 #ifndef __SHAKESPEARE__ 25 #define __SHAKESPEARE__ 26 27 #include <stdlib.h> 28 29 #define BUF_SIZE 1024 30 31 typedef struct _STACKNODE STACKNODE; 32 struct _STACKNODE { 33 int value; 34 STACKNODE *next; 35 }; 36 37 typedef struct { 38 int value; 39 char *name; 40 int on_stage; 41 STACKNODE *stack; 42 } CHARACTER; 43 44 /* global variables */ 45 46 #ifndef GLOBAL 47 # define GLOBAL extern 48 #endif 49 50 GLOBAL CHARACTER **cast; 51 GLOBAL CHARACTER *first_person; 52 GLOBAL CHARACTER *second_person; 53 54 GLOBAL int truth_flag; 55 GLOBAL int num_on_stage; 56 GLOBAL int num_cast; 57 58 /* function prototypes */ 59 extern void activate_character(int line, CHARACTER *character); 60 extern void assign(int line, CHARACTER *character, int value); 61 extern void char_input(int line, CHARACTER *character); 62 extern void char_output(int line, CHARACTER *character); 63 extern void enter_scene(int line, CHARACTER *character); 64 extern void exit_scene(int line, CHARACTER *character); 65 extern void exit_scene_all(int line); 66 extern void global_initialize(); 67 extern CHARACTER *initialize_character(char *name); 68 extern int int_add(int line, int a, int b); 69 extern int int_cube(int line, int value); 70 extern int int_div(int line, int a, int b); 71 extern int int_factorial(int line, int n); 72 extern void int_input(int line, CHARACTER *character); 73 extern int int_mod(int line, int a, int b); 74 extern int int_mul(int line, int a, int b); 75 extern void int_output(int line, CHARACTER *character); 76 extern int int_sqrt(int line, int value); 77 extern int int_square(int line, int value); 78 extern int int_sub(int line, int a, int b); 79 extern int int_twice(int line, int value); 80 extern void pop(int line, CHARACTER *character); 81 extern void push(int line, CHARACTER *character, int value); 82 extern int value_of(int line, CHARACTER *character); 83 84 #endif /* __SHAKESPEARE__ */ 85