{ 
do{ 
int rtsyn_play_some_data (void){	PmMessage pmmsg;	int played;		int j,port,exlen,data,shift;	long pmlength,pmbpoint;		played=0;	{		sleep(0);		for(port=0;port<rtsyn_portnumber;port++){			pmerr=Pm_Read(midistream[port].stream, pmbuffer, PMBUFF_SIZE);			if(pmerr<0) goto pmerror;			pmlength=pmerr;			pmbpoint=0;			while(pmbpoint<pmlength){				played=~0;				pmmsg=pmbuffer[pmbpoint].message;				pmbpoint++;				if( 1==rtsyn_play_one_data (port, pmmsg) ){						j=0;					sysexbuffer[j++] = 0xf0;					for (shift = 8,data=0; shift < 32 && (data != 0x0f7); shift += 8) {       		         	data= (pmmsg >> shift) & 0x0FF;						sysexbuffer[j++]=data;					}					if(data!=0x0f7){						if(pmbpoint>=pmlength){							{								pmerr=Pm_Read(midistream[port].stream, pmbuffer, PMBUFF_SIZE);								if(pmerr<0){goto pmerror; }								sleep(0);							}while(pmerr==8);							pmlength=pmerr;							pmbpoint=0;						}						while(j<EXBUFF_SIZE-4){							for (shift=0,data=0; shift < 32 && (data != 0x0f7); shift += 8) {                				data= (pmbuffer[pmbpoint].message >> shift) & 0x0FF;								sysexbuffer[j++]=data;							}							pmbpoint++;							if(data==0x0f7) break;							if( pmbpoint>=pmlength ){								{									pmerr=Pm_Read(midistream[port].stream, pmbuffer, PMBUFF_SIZE);									if(pmerr<0){goto pmerror;}									sleep(0);								}while(pmerr==0);								pmlength=pmerr;								pmbpoint=0;							}						}					}					exlen=j;					rtsyn_play_one_sysex (sysexbuffer,exlen );				}			}		}	}while(rtsyn_reachtime>get_current_calender_time());	return played;pmerror:	Pm_Terminate();	ctl->cmsg(  CMSG_ERROR, VERB_NORMAL, "PortMIDI error: %s\n", Pm_GetErrorText( pmerr ) );	return 0;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/ac05fc62cad3d61b721f42ec31c55bf195182c15/rtsyn_portmidi.c/buggy/interface/rtsyn_portmidi.c