[Smipl-devel] SF.net SVN: smipl:[17] smipl-devel
Brought to you by:
the_student
From: <the...@us...> - 2009-07-28 20:22:06
|
Revision: 17 http://smipl.svn.sourceforge.net/smipl/?rev=17&view=rev Author: the_student Date: 2009-07-28 20:21:55 +0000 (Tue, 28 Jul 2009) Log Message: ----------- Removed all files Removed Paths: ------------- smipl-devel/Error.h smipl-devel/Legacy/ smipl-devel/MDS.h smipl-devel/SIA.h smipl-devel/SIASOUND.h smipl-devel/SMIPL.cpp smipl-devel/SVM.h smipl-devel/TestSuite.h Deleted: smipl-devel/Error.h =================================================================== --- smipl-devel/Error.h 2009-07-24 11:32:53 UTC (rev 16) +++ smipl-devel/Error.h 2009-07-28 20:21:55 UTC (rev 17) @@ -1,2 +0,0 @@ -#define StackUnderflow 1 -#define StackOverflow 2 Deleted: smipl-devel/MDS.h =================================================================== --- smipl-devel/MDS.h 2009-07-24 11:32:53 UTC (rev 16) +++ smipl-devel/MDS.h 2009-07-28 20:21:55 UTC (rev 17) @@ -1,70 +0,0 @@ -#define MDS_NAME_LENGTH 25 - -#define MDS_READ 0x01 -#define MDS_WRITE 0x02 -#define MDS_DELETE 0x04 - -struct MDS_Piece{ - char *Name; - double Value; - char Attribute; - - MDS_Piece *Next; - MDS_Piece() { - Name=new char[MDS_NAME_LENGTH]; - strcpy(Name,""); - Value=0; - Attribute=MDS_READ|MDS_WRITE|MDS_DELETE; - Next=NULL; - } - MDS_Piece(char *Name, double Value) { - this->Name=new char[MDS_NAME_LENGTH]; - this->Value=Value; - this->Attribute=MDS_READ|MDS_WRITE|MDS_DELETE; - this->Next=NULL; - } - MDS_Piece(char *Name, double Value, char attribute) { - this->Name=new char[MDS_NAME_LENGTH]; - this->Value=Value; - this->Attribute=attribute; - this->Next=NULL; - } -}MDS_0; - -MDS_Piece *MDS_Read(char *Name, char *Password=NULL) { - MDS_Piece *DataPiece; - DataPiece=&MDS_0; - pthread_mutex_lock(&MDS); - while(1) { - if(!strcmp(DataPiece->Name,Name)) break; - if(DataPiece->Next==NULL) {pthread_mutex_unlock(&MDS);return NULL;} - DataPiece=DataPiece->Next; - } - pthread_mutex_unlock(&MDS); - return DataPiece; return DataPiece; - return NULL; -} -MDS_Piece *MDS_Last_Piece() { - MDS_Piece *DataPiece=&MDS_0; - pthread_mutex_lock(&MDS); - while(DataPiece->Next!=NULL) DataPiece=DataPiece->Next; - pthread_mutex_unlock(&MDS); - return DataPiece; -} -bool MDS_Create(MDS_Piece Data) { - pthread_mutex_lock(&MDS); - MDS_Piece *DataPiece=MDS_Last_Piece(); - DataPiece->Next=new MDS_Piece(Data); - pthread_mutex_unlock(&MDS); -} -bool MDS_Delete(MDS_Piece *Data){ - pthread_mutex_lock(&MDS); - MDS_Piece *PreviousD=&MDS_0, *NextD=Data->Next; - for(;PreviousD->Next!=Data;) {if(PreviousD->Next!=NULL)PreviousD=PreviousD->Next;else {pthread_mutex_unlock(&MDS);return false;}} - if(Data->Attribute&MDS_DELETE)delete Data; - PreviousD->Next=NextD; - pthread_mutex_unlock(&MDS); -} -MDS_Piece *MDS_First() { - return MDS_0.Next; -} Deleted: smipl-devel/SIA.h =================================================================== --- smipl-devel/SIA.h 2009-07-24 11:32:53 UTC (rev 16) +++ smipl-devel/SIA.h 2009-07-28 20:21:55 UTC (rev 17) @@ -1,9 +0,0 @@ -#ifdef __linux__ -#include <unistd.h> -#include <fcntl.h> -void sys_sleep(int time) {usleep(time);} -#endif -#ifdef WIN32 -#include <windows.h> -void sys_sleep(int time) {Sleep(time);} -#endif Deleted: smipl-devel/SIASOUND.h =================================================================== --- smipl-devel/SIASOUND.h 2009-07-24 11:32:53 UTC (rev 16) +++ smipl-devel/SIASOUND.h 2009-07-28 20:21:55 UTC (rev 17) @@ -1,34 +0,0 @@ -bool MIDI_OUT_INITED=false; -typedef union { unsigned long word; unsigned char data[4]; }MIDI_Message; -#ifdef __linux__ -#include <linux/soundcard.h> -int MIDI_Out; -void MIDI_Init() { - if(MIDI_Out=open("/dev/midi",O_WRONLY,0)<0) goto End; - - - MIDI_OUT_INITED=true; - End: - ; -} -void MIDI_Write(MIDI_Message Melding) { - if(MIDI_OUT_INITED) { - write(MIDI_Out, Melding.data, sizeof(Melding.data)); - } -} -#endif - -#ifdef WIN32 -HMIDIOUT MIDI_Out; -void MIDI_Init() { - if (midiOutOpen(&MIDI_Out, 0, 0, 0, CALLBACK_NULL) != MMSYSERR_NOERROR) { - printf("Error opening MIDI Output.\n"); - goto end; - } - MIDI_OUT_INITED=true; - end: - ; -} -void MIDI_Write(MIDI_Message Melding) { - if(MIDI_OUT_INITED) {if(midiOutShortMsg(MIDI_Out, Melding.word) != MMSYSERR_NOERROR) {throw "MIDI ERROR";}}} -#endif Deleted: smipl-devel/SMIPL.cpp =================================================================== --- smipl-devel/SMIPL.cpp 2009-07-24 11:32:53 UTC (rev 16) +++ smipl-devel/SMIPL.cpp 2009-07-28 20:21:55 UTC (rev 17) @@ -1,207 +0,0 @@ -/*This file is part of SMIPL. - - SMIPL is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - SMIPL is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with SMIPL. If not, see <http://www.gnu.org/licenses/>. -*/ -#include <pthread.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <physfs.h> - -#include <iostream> -#include <fstream> - -#include <string.h> - -using namespace std; - -pthread_mutex_t MDS=PTHREAD_MUTEX_INITIALIZER; -pthread_mutex_t SIA=PTHREAD_MUTEX_INITIALIZER; -pthread_mutex_t Level0=PTHREAD_MUTEX_INITIALIZER; -pthread_mutex_t SVM=PTHREAD_MUTEX_INITIALIZER; -pthread_t MainThread; - -#include "Error.h" -#include "MDS.h" -#include "SIA.h" -#include "SIASOUND.h" -#include "Legacy/Level0.h" -#define MAX_STEPS 100000 -int Steps; -char Data[10000][80],Cmd[80]; -#include "SVM.h" -#define CON 0 -#define SCR 1 - -#include "TestSuite.h" -int main() { - MainThread=pthread_self(); - fstream the_file; - char Licence[15][80]={ - "SMIPL is free software: you can redistribute it and/or modify", - "it under the terms of the GNU General Public License as published by", - "the Free Software Foundation, either version 3 of the License, or", - "(at your option) any later version.", - " ", - "SMIPL is distributed in the hope that it will be useful,", - "but WITHOUT ANY WARRANTY; without even the implied warranty of", - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the", - "GNU General Public License for more details.", - " ", - "You should have received a copy of the GNU General Public License", - "along with SMIPL. If not, see <http://www.gnu.org/licenses/>."}; - #ifdef MAX_VER - NewVar("SMIPL_VER",MAX_VER); - #endif - - - try{ - FillLine('_'); - PrintCentered("SMIPL"); - PrintCentered("for licence information, write GPL"); - FillLine('_'); - int Lin,Address; - bool EnterProg, List=false, LIB_MODE=false; - int Mode=CON; - char Name[255], LIB_START[10]; - fstream Script, Library; - top: - MDS_Piece DataPiece=MDS_0; - Lin=0; - List=false; - EnterProg=false; - cout<<endl<<"? "; - if(Mode==CON) cin.getline(Cmd, 80); - if(Mode==SCR) {Script.getline(Cmd, 80);cout<<Cmd<<endl;if(Script.eof()) {Script.close();Mode=CON;}} - - for(int c1=0;Cmd[c1]!=0;c1++) Cmd[c1]=toupper(Cmd[c1]); - - if(!strcmp(Cmd,"GPL")) {cout<<endl;for(int y=0;strcmp(Licence[y], ""); y++) cout<<Licence[y]<<endl;cout<<endl;} - - if(!strcmp(Cmd,"NEW")) { - pthread_mutex_lock(&MDS); - while(MDS_First()!=NULL) MDS_Delete(MDS_First()); - pthread_mutex_unlock(&MDS); - for(int a=0;a<=10000;a++)strcpy(Data[a],"PROGRAM END"); - VM0.StackP=-1; - } - - if(!strcmp(Cmd,"PROGRAM START")) { - EnterProg=true;Lin=0; - while(EnterProg) { - cout<<Lin<<" "; - if(Mode==CON) cin.getline(Data[Lin], 80); - if(Mode==SCR) {Script.getline(Data[Lin], 80);cout<<Data[Lin]<<endl;} - if(!strcasecmp(Data[Lin], "PROGRAM END")) {EnterProg=false;goto top;} - Lin++; - if(Lin>10000) {cout<<"PROGRAM TO COMPLEX, SMIPL RAN OUT"<<endl;EnterProg=false;goto top;} - } - } - if(!strcmp(Cmd,"LOAD")) { - cout<<"FILENAME: "; - cin.getline(Cmd,80); - the_file.open(Cmd,ios::in); - if(!the_file.is_open()) {cout<<"FILE NOT FOUND!"<<endl;goto top;} - the_file.getline(Cmd,80); - if(strcmp(Cmd,"SMIPL PROGRAM")) {cout<<"UNKNOWN FILE TYPE"<<endl;the_file.close();goto top;} - do{ - the_file.getline(Data[Lin++],80); - }while(!the_file.eof()); - the_file.close(); - goto top; - } - if(!strcmp(Cmd,"SAVE")) { - cout<<"FILENAME: "; - cin.getline(Cmd,80); - the_file.open(Cmd,ios::out); - the_file<<"SMIPL PROGRAM"<<endl; - Lin=0; - cout<<"SAVING..."; - do{ - the_file<<Data[Lin]<<endl; - }while(strcmp(Data[Lin++],"PROGRAM END")); - cout<<"OK"<<endl; - the_file.close(); - } - if(!strcmp(Cmd,"LIST")) {List=true;while(List) {cout<<Lin<<":"<<Data[Lin]<<endl;if(!stricmp(Data[Lin], "PROGRAM END")) {List=false;goto top;}Lin++;}} - if(!strcmp(Cmd,"RUN")) { - Steps=MAX_STEPS; - VM0.Run((void*)0); - } - if(!strcmp(Cmd,"BACKGROUND-RUN")) { - Steps=MAX_STEPS; - StartNewSVMThread(0); - } - if(!strcmp(Cmd,"DUMP")) { - cout<<endl<<"DUMPING MDS..."<<endl; - DataPiece=MDS_0; - pthread_mutex_lock(&MDS); - while(DataPiece.Next!=NULL){ - DataPiece=*DataPiece.Next; - cout<<"NAME:\""<<DataPiece.Name<<"\" VALUE:\""<<DataPiece.Value<<"\""<<endl; - } - pthread_mutex_unlock(&MDS); - pthread_mutex_lock(&Level0); - cout<<endl<<"DUMPING STACK..."<<endl; - for(int a=0;a<VM0.StackP;a++) cout<<"\""<<VM0.Stack[a]<<"\""<<endl; - pthread_mutex_unlock(&Level0); - } - if(!strcmp(Cmd,"QUIT")) goto End; - if(!strcmp(Cmd,"EXIT")) goto End; - if(!strcmp(Cmd,"LIBRARY")) { - do{ - cout<<"LIBRARY NAME? "; - cin.getline(Name, 255); - Library.open(Name); - cout<<"LIBRARY START? "; - cin.getline(LIB_START, 255); - }while(atoi(LIB_START)>10000); - Address=Find(Name); - if(!Address) NewVar(Name, LIB_START); - else Set(Name, LIB_START); - if(Library.is_open()) LIB_MODE=true; - else goto top; - Lin=atoi(LIB_START); - while(LIB_MODE) { - Library.getline(Data[atoi(LIB_START)+Lin], 80); - if(Library.eof()) {LIB_MODE=false;Library.close();goto top;} - Lin++; - if(Lin>10000) {cout<<"LIBRARY TO COMPLEX OR START ADDRESS TO HIGH, SMIPL RAN OUT"<<endl;EnterProg=false;goto top;} - } - VM0.Run((void*)atoi(LIB_START)); //Library auto-init - } - - if(!strcmp(Cmd,"SCRIPT")) {cin.getline(Name, 255); Script.open(Name); if(Script.is_open())Mode=SCR;} - - if(!strcmp(Cmd,"TEST-SMIPL")) {TestAll();cout<<endl;} - - if((Atoi(Cmd)!=0)||(isdigit(Cmd[0]))){ - EnterProg=true;Lin=Atoi(Cmd); - while(EnterProg) { - cout<<Lin<<" "; - if(Mode==CON) cin.getline(Data[Lin], 80); - if(Mode==SCR) {Script.getline(Data[Lin], 80);cout<<Data[Lin]<<endl;} - if(!strcasecmp(Data[Lin], "PROGRAM END")) {EnterProg=false;goto top;} - Lin++; - if(Lin>10000) {cout<<"PROGRAM TO COMPLEX, SMIPL RAN OUT"<<endl;EnterProg=false;goto top;} - } - } - goto top; - } - catch(char* err) {cout<<"ERROR: "<<err<<endl;} - catch(bad_alloc&) {cout<<"R/E: Allocation failure"<<endl;for(;;);} //Might not work, but then again it is better to have tried, and failed than never to have tried at all! - catch(...) {cout<<"R/E: GENERIC ERROR"<<endl;for(;;);} - End:; -} - Deleted: smipl-devel/SVM.h =================================================================== --- smipl-devel/SVM.h 2009-07-24 11:32:53 UTC (rev 16) +++ smipl-devel/SVM.h 2009-07-28 20:21:55 UTC (rev 17) @@ -1,296 +0,0 @@ -#define MAXSVMTHREADS 128 -pthread_mutex_t SVM_ThreadList=PTHREAD_MUTEX_INITIALIZER; -pthread_t SVMthread[MAXSVMTHREADS]; -int SVMThreadP=0; -pthread_t StartNewSVMThread(int Line=0); -struct SVM_Thread{ - double Stack[8000]; -int StackP; -double Pop() { - if(StackP<0) throw StackUnderflow; - pthread_mutex_lock(&Level0); - double Address=Stack[StackP]; - StackP--; - pthread_mutex_unlock(&Level0); - return Address; -} -void Push(double Data) { - if(StackP>80000) throw StackOverflow; - pthread_mutex_lock(&Level0); - StackP++; - Stack[StackP]=Data; - pthread_mutex_unlock(&Level0); -} - - int Line; - MIDI_Message MIDI_Melding; - char argv[10][80],str[80],Op; - int argc,c1, c2, Address; - MDS_Piece *DataPiece; - bool disallow_spaces_in_names, command_executed; - -void *Run(void *function_input_argument) { - #ifdef DEBUG - printf("[%d]: Run()\n",pthread_self()); - #endif - Line=0; - disallow_spaces_in_names=true; - if(function_input_argument!=NULL) Line=(int)function_input_argument; - try{ - disallow_spaces_in_names=true; - double A,B; - while((Steps--)>0) { - try{ - command_executed=false; - c1=0; - c2=0; - argc=0; - for(int a=0;a<=10;a++)argv[a][0]=0; - c1=0; - Op=0; - while(Data[Line][c1]!=0) { - c2=0; - while(!isDelim(Data[Line][c1],disallow_spaces_in_names)) { - if(argc!=0) argv[argc][c2]=Data[Line][c1]; - else argv[argc][c2]=toupper(Data[Line][c1]); - if(argv[argc][c2]=='"') disallow_spaces_in_names=!disallow_spaces_in_names; - c1++; - c2++; - } - if(Data[Line][c1]=='<') {Op='<';} - if(Data[Line][c1]=='>') {Op='>';} - if(Data[Line][c1]=='=') {Op='=';} - argv[argc][c2]='\0'; - if(Op!=0) c1++; - if(strlen(argv[argc])>0) argc++; - NextArg: - //cout<<"."; - if(Data[Line][c1]=='\0') goto Parse; - while(!isgraph(Data[Line][c1])) {if(Data[Line][c1++]=='\0') break;} - } - - Parse: - #ifdef DEBUG - cout<<MAX_STEPS-Steps<<"."<<Line<<": argc:\""<<argc<<"\", argv[0]: \""<<argv[0]<<"\", argv[1]:\""<<argv[1]<<"\", argv[2]:\""<<argv[2]<<"\", argv[3]:\""<<argv[3]<<"\", Op:\""<<Op<<"\""<<endl; - cout<<"C1:"<<c1<<" C2:"<<c2<<endl; - #endif - if(strlen(argv[0])==0) break; - - if(!strcmp(argv[0],"CREATE-THREAD")) { - pthread_mutex_lock(&SVM); - if(argc==1)StartNewSVMThread(); - if(argc==2)StartNewSVMThread(Atoi(argv[1])); - //if(argc==3){sprintf(str,"%d",StartNewSVMThread(Atoi(argv[1])));Set(argv[2],str);} //Won't work with - pthread_mutex_unlock(&SVM); - command_executed=true; - } - - - if(!strcmp(argv[0],"NEW")) { - if(argc>=1) { - if(Find(argv[1])) MDS_Delete(MDS_Read(argv[1])); - NewVar(argv[1],argv[2]); - NewVar(argv[1],""); - } - command_executed=true; - } - if(!strcmp(argv[0],"DELETE")) { - for(int a=1;strlen(argv[a])>0;a++) if(Find(argv[a]))MDS_Delete(MDS_Read(argv[a])); - command_executed=true; - } - - if(!strcmp(argv[0], "SET")) { - if(!Find(argv[1])) NewVar(argv[1], argv[2]); - else Set(argv[1], argv[2]); - command_executed=true; - } - if(!strcmp(argv[0], "ADD")) {if(Find(argv[1])) { - sprintf(str,"%f",Atof(argv[1])+Atof(argv[2])); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0], "SUBTRACT")) {if(Find(argv[1])) { - sprintf(str,"%f",Atof(argv[1])-Atof(argv[2])); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0], "MULTIPLY")) {if(Find(argv[1])) { - sprintf(str,"%f",Atof(argv[1])*Atof(argv[2])); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0], "DIVIDE")) {if(Find(argv[1])) { - sprintf(str,"%f",Atof(argv[1])/Atof(argv[2])); - Set(argv[1],str); - } - command_executed=true; - } - - if(!strcmp(argv[0], "ROOT")) {if(Find(argv[1])) { - sprintf(str,"%f",sqrt(Atof(argv[argc-1]))); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0], "LOG")) {if(Find(argv[1])) { - sprintf(str,"%f",log(Atof(argv[argc-1]))); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0], "POWER")) {if((Find(argv[1]))&&(argc>=3)) { - sprintf(str,"%f",pow(Atof(argv[argc-2]), Atof(argv[argc-1]))); - Set(argv[1],str); - } - command_executed=true; - } - - if(!strcmp(argv[0],"NOT")) {if(Find(argv[1])) { - sprintf(str,"%f",!Atoi(argv[2])); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0], "OR")) {if(Find(argv[1])) { - sprintf(str,"%f",Atoi(argv[1])|Atoi(argv[2])); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0],"AND")) {if(Find(argv[1])) { - sprintf(str,"%f",Atoi(argv[1])&Atoi(argv[2])); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0],"XOR")) {if(Find(argv[1])) { - sprintf(str,"%f",Atoi(argv[1])^Atoi(argv[2])); - Set(argv[1],str); - } - command_executed=true; - } - if(!strcmp(argv[0], "PRINT")) { - for(int a=1;a<argc;a++) { - if(Find(argv[a])) cout<<argv[a]<<"="<<Atof(argv[a])<<" "; - else cout<<"\""<<argv[a]<<"\" not found"; - } - cout<<endl; - command_executed=true; - } - - if(!strcmp(argv[0], "GOTO")) { - Line=Atoi(argv[1])-1; - command_executed=true; - } - - if(!strcmp(argv[0], "GOSUB")) { - Push(Line); - Line=Atoi(argv[1])-1; - command_executed=true; - } - if(!strcmp(argv[0], "RETURN")) { - if(StackP<0) goto End; - Line=(int)Pop(); - command_executed=true; - } - if(!strcmp(argv[0], "IF")) { - A=Atof(argv[1]); - B=Atof(argv[2]); - if(Op=='=') if(A!=B) Line++; - if(Op=='<') if(A>=B) Line++; - if(Op=='>') if(A<=B) Line++; - command_executed=true; - } - if(!strcmp(argv[0], "IF!")){ - A=Atof(argv[1]); - B=Atof(argv[2]); - if(Op=='=') if(!(A!=B)) Line++; - if(Op=='<') if(!(A>=B)) Line++; - if(Op=='>') if(!(A<=B)) Line++; - command_executed=true; - } - if(!strcmp(argv[0], "NEWLINE")) { - cout<<endl; - command_executed=true; - } - if(!strcmp(argv[0], "STOP")) { - command_executed=true; - goto End; - } - if((!strcmp(argv[0], "PROGRAM"))&&(!strcmp(argv[1],"END"))) { - command_executed=true; - goto End; - } - if(!strcmp(argv[0], "PUSH")) { - Push(Atof(argv[1])); - command_executed=true; - } - if(!strcmp(argv[0], "POP")) { - if(Find(argv[1])) { - DataPiece=MDS_Read(argv[1]); - DataPiece->Value=Pop(); - } - command_executed=true; - } - if(!strcmp(argv[0], "MIDI")) { - if(!MIDI_OUT_INITED){ - MIDI_Init(); - if(!MIDI_OUT_INITED) goto End; - } - MIDI_Melding.data[0] = 0x90; // MIDI note-on message (requires to data bytes) - MIDI_Melding.data[1] = 60; // MIDI note-on message: Key number (60 = middle C) - MIDI_Melding.data[2] = 100; // MIDI note-on message: Key velocity (100 = loud) - MIDI_Melding.data[3] = 0; // Unused parameter - if(argc==2) MIDI_Melding.data[1]=Atoi(argv[1]); - if(argc==3) {MIDI_Melding.data[1]=Atoi(argv[1]);MIDI_Melding.data[2]=Atoi(argv[2]);} - if(argc>=4) {MIDI_Melding.data[0]=Atoi(argv[1]);MIDI_Melding.data[1]=Atoi(argv[2]);MIDI_Melding.data[3]=Atoi(argv[3]);} - MIDI_Write(MIDI_Melding); - - command_executed=true; - } - if(!strcmp(argv[0], "SLEEP")) {sys_sleep(Atoi(argv[1]));command_executed=true;} - - if(!command_executed) { - if(Find(argv[0])) { - Push(Line); - Line=Atoi(argv[0])-1; - for(int a=1;a<argc;a++) Push(Atof(argv[a])); - Push(argc-1); - command_executed=true; - } - } - if(!command_executed) {cout<<"UNKNOWN COMMAND:\""<<argv[0]<<"\""<<endl;} - Line++; - } - catch(int VE_Err) { - if(Find("ONWARNING_HANDLER")) {Push(--Line);Line=Atoi("ONWARNING_HANDLER");Push(VE_Err);Push(1);} - else throw VE_Err; - } - catch(...) {throw;} - } - if(Steps==0) cout<<"ERROR: VIRTUAL PROGRAM KILLED OFF, MORE THAN "<<MAX_STEPS<<" PROGRAM LINES EXECUTED"<<endl; - } - catch(int err) {cout<<"ERROR: "<<err<<endl;} - catch(...){throw;} - End: - pthread_mutex_lock(&SVM); - if(pthread_equal(pthread_self(),MainThread)) { - for(int a=0;a<SVMThreadP;a++) pthread_cancel(SVMthread[a]); - } - pthread_mutex_unlock(&SVM); -} -SVM_Thread() { - StackP=0; -} -}VM0; -void *RunNewSVMThread(void *Line) { - SVM_Thread newthread=*new SVM_Thread; - newthread.Run(Line); -} -pthread_t StartNewSVMThread(int Line) { - pthread_create(&SVMthread[SVMThreadP++],NULL,RunNewSVMThread,(void*)Line); - return SVMthread[SVMThreadP]; -} Deleted: smipl-devel/TestSuite.h =================================================================== --- smipl-devel/TestSuite.h 2009-07-24 11:32:53 UTC (rev 16) +++ smipl-devel/TestSuite.h 2009-07-28 20:21:55 UTC (rev 17) @@ -1,68 +0,0 @@ -void TestMDS() { - cout<<(char)9<<"READ: "; - MDS_Read(""); - cout<<"OK"<<endl; - cout<<(char)9<<"Last Piece: "; - MDS_Last_Piece(); - cout<<"OK"<<endl; - cout<<(char)9<<"First: "; - MDS_First(); - cout<<"OK"<<endl; -} -void TestSIA() { - cout<<(char)9<<"sleep: "; - sys_sleep(1); - cout<<"OK"<<endl;; -} -void TestSIASOUND() { - cout<<(char)9<<"Init: "; - MIDI_Init(); - if(MIDI_OUT_INITED)cout<<"OK"<<endl; - else cout<<"FAIL"<<endl; - MIDI_Message MIDIMSG; - MIDIMSG.word=0x903C6400; - cout<<(char)9<<"Write: "; - MIDI_Write(MIDIMSG); - cout<<"OK"<<endl; -} -void TestLevel0() { - cout<<(char)9<<"Find: "; - Find(""); - cout<<"OK"<<endl; - cout<<(char)9<<"NewVar: "; - NewVar("TEST","0"); - cout<<"OK"<<endl; - cout<<(char)9<<"Set: "; - Set("TEST","1"); - cout<<"OK"<<endl; -} -void TestSVM() { -} -void TestAll() { - try{ - cout<<"MDS"<<endl; - TestMDS(); - } - catch(...) {cout<<"Exception!"<<endl;} - try{ - cout<<"SIA"<<endl; - TestSIA(); - } - catch(...) {cout<<"Exception!"<<endl;} - try{ - cout<<"SIASOUND"<<endl; - TestSIASOUND(); - } - catch(...) {cout<<"Exception!"<<endl;} - try{ - cout<<"Level0"<<endl; - TestLevel0(); - } - catch(...) {cout<<"Exception!"<<endl;} - try{ - cout<<"SVM"<<endl; - TestSVM(); - } - catch(...) {cout<<"Exception!"<<endl;} - cout<<endl; -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |