aboutsummaryrefslogtreecommitdiff
path: root/src/survive.c
blob: a6a8b9e26740b940ee47093ad9f35536914b79f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <survive.h>
#include "survive_internal.h"
#include <stdio.h>
#include <stdlib.h>

struct SurviveContext * survive_init( void(*ff)( struct SurviveContext * ctx, const char * fault ) )
{
	int r = 0;
	struct SurviveContext * ret = calloc( 1, sizeof( struct SurviveContext  ) );
	ret->faultfunction = ff;
	if( r = survive_usb_init( ret ) )
	{
		return 0;
	}

	return ret;
}


void survive_close( struct SurviveContext * ctx )
{
	survive_usb_close( ctx );
}

int survive_poll( struct SurviveContext * ctx )
{
	survive_usb_poll( ctx );
}