Tabs to spaces, more consistent formatting.
[AROS.git] / workbench / libs / camd / closemididevice.c
blob75ebc742fab33b78f382359ae03c8c8f6dc46223
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
8 #include <proto/exec.h>
9 #include <proto/dos.h>
11 #include "camd_intern.h"
13 /*****************************************************************************
15 NAME */
17 AROS_LH1(void, CloseMidiDevice,
19 /* SYNOPSIS */
20 AROS_LHA(struct MidiDeviceData *, mididevicedata, A0),
22 /* LOCATION */
23 struct CamdBase *, CamdBase, 35, Camd)
25 /* FUNCTION
26 Remind me to fill in things here later.
28 INPUTS
30 RESULT
32 NOTES
34 EXAMPLE
36 BUGS
38 SEE ALSO
39 OpenMidiDevice()
41 INTERNALS
43 HISTORY
45 2001-01-12 ksvalast first created
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct Drivers *driver,*temp;
53 ObtainSemaphore(CB(CamdBase)->CLSemaphore);
55 driver=FindPrevDriverForMidiDeviceData(mididevicedata,CamdBase);
57 if(driver==NULL){
58 driver=CB(CamdBase)->drivers;
59 CB(CamdBase)->drivers=CB(CamdBase)->drivers->next;
60 }else{
61 temp=driver->next;
62 driver->next=driver->next->next;
63 driver=temp;
66 ReleaseSemaphore(CB(CamdBase)->CLSemaphore);
68 UnLoadSeg(driver->seglist);
69 FreeMem(driver,sizeof(struct Drivers));
71 AROS_LIBFUNC_EXIT