summaryrefslogtreecommitdiffstats
path: root/libk8055/libk8055.c
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-06-04 08:07:46 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-06-04 08:07:46 +0200
commit3f6b29ca999bc27bd09f2053759e7a3c4f02de24 (patch)
tree1066410407b325505de3a39b240ccc7943b9b610 /libk8055/libk8055.c
parent14a6dcb63e9d56dfaf22eb57ac7b8cbf3284d0c1 (diff)
downloadk8055-3f6b29ca999bc27bd09f2053759e7a3c4f02de24.zip
k8055-3f6b29ca999bc27bd09f2053759e7a3c4f02de24.tar.gz
add k8055_alloc and k8055_free
Diffstat (limited to 'libk8055/libk8055.c')
-rw-r--r--libk8055/libk8055.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libk8055/libk8055.c b/libk8055/libk8055.c
index 00aab65..85ee4a3 100644
--- a/libk8055/libk8055.c
+++ b/libk8055/libk8055.c
@@ -79,8 +79,9 @@
**/
-#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <assert.h>
#include <math.h>
#include <libusb.h>
@@ -110,6 +111,16 @@
/* set debug to 0 to not print excess info */
static int debug = 0;
+struct k8055_dev* k8055_alloc( void ) {
+ struct k8055_dev *dev = (struct k8055_dev*) malloc( sizeof(struct k8055_dev) );
+ dev->dev_no=0;
+ return dev;
+}
+
+void k8055_free( struct k8055_dev* dev ) {
+ free(dev);
+}
+
/* Actual read of data from the device endpoint, retry READ_RETRY times if not responding ok */
int k8055_read( struct k8055_dev* dev ) {
if( dev->dev_no==0 ) return K8055_ERROR;