added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / libs / camd / querysysex.c
blobdc03cc4cd919af54fcdad2f20456141090d5fa9a
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include <proto/exec.h>
11 #include "camd_intern.h"
14 /*****************************************************************************
16 NAME */
18 AROS_LH1(ULONG, QuerySysEx,
20 /* SYNOPSIS */
21 AROS_LHA(struct MidiNode *, midinode, A0),
23 /* LOCATION */
24 struct CamdBase *, CamdBase, 28, Camd)
26 /* FUNCTION
27 Remind me to fill in things here later.
29 INPUTS
31 RESULT
33 NOTES
35 EXAMPLE
37 BUGS
38 Not tested. SysEx receiving does probably have some bugs.
40 SEE ALSO
41 SkipSysEx, GetSysEx
43 INTERNALS
45 HISTORY
47 2001-01-12 ksvalast first created
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct MyMidiNode *mymidinode=(struct MyMidiNode *)midinode;
54 UBYTE *sysex;
55 ULONG numleft=1;
57 if(mymidinode->lastreadstatus!=0xf0) return 0;
59 ObtainSemaphore(&mymidinode->sysexsemaphore2);
61 if(mymidinode->sysex_nextis0==TRUE){
62 ReleaseSemaphore(&mymidinode->sysexsemaphore2);
63 return 0;
66 sysex=mymidinode->sysex_read;
68 while(*sysex!=0xf7){
69 numleft++;
70 sysex++;
73 ReleaseSemaphore(&mymidinode->sysexsemaphore2);
75 return numleft;
77 AROS_LIBFUNC_EXIT