added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / libs / camd / nextmidilink.c
blob0660a6a356652fcdcd3fd7b209386c8551a36138
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include "camd_intern.h"
12 /*****************************************************************************
14 NAME */
16 AROS_LH3(struct MidiLink *, NextMidiLink,
18 /* SYNOPSIS */
19 AROS_LHA(struct MidiNode *, midinode, A0),
20 AROS_LHA(struct MidiLink *, midilink, A1),
21 AROS_LHA(LONG, type, D0),
23 /* LOCATION */
24 struct CamdBase *, CamdBase, 19, Camd)
26 /* FUNCTION
27 Returns the next MidiLink of a specified type that belongs
28 to a midinode. Or NULL if midilink was the first. If midilink
29 is NULL, returns the first one.
31 INPUTS
32 type - MLTYPE_Sender or MLTYPE_Receiver.
34 RESULT
36 NOTES
37 CL_Linkages must be locked.
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 HISTORY
49 2001-01-12 ksvalast first created
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 struct MinNode *node;
57 if(type==MLTYPE_Receiver){
58 node=midinode->mi_InLinks.mlh_Head;
59 }else{
60 node=midinode->mi_OutLinks.mlh_Head;
63 while(node->mln_Succ!=NULL){
64 if(midilink==NULL){
65 return (struct MidiLink *)node;
66 }else{
67 if(node==(struct MinNode *)midilink){
68 if(node->mln_Succ->mln_Succ!=NULL){
69 return GetMidiLinkFromOwnerNode(node->mln_Succ);
70 }else{
71 return NULL;
75 node=node->mln_Succ;
78 return NULL;
80 AROS_LIBFUNC_EXIT