Add floppy_close() and floppy_open()

This commit is contained in:
Laurent Vivier 2005-11-21 21:50:49 +00:00
parent 8a787307e9
commit 0326a56eaf
2 changed files with 40 additions and 0 deletions

17
libfloppy/floppy_close.c Normal file
View File

@ -0,0 +1,17 @@
/*
*
* (c) 2005 Laurent Vivier <LaurentVivier@wanadoo.fr>
*
*/
#include <stdlib.h>
#include "libfloppy.h"
int floppy_close(floppy_device_t* device)
{
if (device == NULL)
return -1;
free(device);
return 0;
}

23
libfloppy/floppy_open.c Normal file
View File

@ -0,0 +1,23 @@
/*
*
* (c) 2005 Laurent Vivier <LaurentVivier@wanadoo.fr>
*
*/
#include <stdlib.h>
#include "libfloppy.h"
floppy_device_t *floppy_open(int unit)
{
floppy_device_t *dev;
dev = (floppy_device_t *)malloc(sizeof(floppy_device_t));
if (dev == NULL)
return NULL;
dev->unit = unit;
return dev;
}