Update of /cvsroot/plib/plib/demos/simon/src
In directory usw-pr-cvs1:/tmp/cvs-serv11840/plib/demos/simon/src
Modified Files:
Makefile simon.cxx
Log Message:
Added PSL_DUMP and PSL_TRACE environment vars.
Fixed evaluation of && and || so they don't compute
their right-hand sides unless they have to.
Index: Makefile
===================================================================
RCS file: /cvsroot/plib/plib/demos/simon/src/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Makefile 15 Sep 2002 01:46:33 -0000 1.4
+++ Makefile 15 Sep 2002 04:34:39 -0000 1.5
@@ -18,10 +18,12 @@
install: libsimon.a simon.h simon
mkdir -p /usr/local/simon
- cp simon libsimon.a simon.h /usr/local/simon
+ cp libsimon.a simon.h /usr/local/simon
+ cp simon /usr/local/bin
uninstall:
rm -r /usr/local/simon
+ rm /usr/local/bin/simon
clean:
rm -f simon libsimon.a *.o
Index: simon.cxx
===================================================================
RCS file: /cvsroot/plib/plib/demos/simon/src/simon.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- simon.cxx 15 Sep 2002 02:33:33 -0000 1.5
+++ simon.cxx 15 Sep 2002 04:34:39 -0000 1.6
@@ -25,6 +25,25 @@
#include <simon.h>
#include <plib/psl.h>
+
+pslValue my_print ( int argc, pslValue *argv, pslProgram *p )
+{
+ for ( int i = 0 ; i < argc ; i++ )
+ {
+ switch ( argv[i].getType () )
+ {
+ case PSL_INT : printf ( "%d ", argv[i].getInt () ) ; break ;
+ case PSL_FLOAT : printf ( "%f ", argv[i].getFloat () ) ; break ;
+ case PSL_STRING : printf ( "%s ", argv[i].getString () ) ; break ;
+ case PSL_VOID : printf ( "(void) " ) ; break ;
+ }
+ }
+
+ pslValue ret ;
+ return ret ;
+}
+
+
pslValue my_siJoystickUD ( int, pslValue *, pslProgram * )
{
pslValue ret ;
@@ -142,6 +161,7 @@
{ "siJoystickL" , 0, my_siJoystickL },
{ "siJoystickR" , 0, my_siJoystickR },
{ "fabs" , 1, my_fabs },
+ { "print" ,-1, my_print },
{ NULL, 0, NULL }
} ;
|