From 5d0ee3b301ca012c81adbf57042f7054ee45808c Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 4 Jun 2017 02:30:17 +0200 Subject: Add readme, flesh out backends --- backend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backend.c') diff --git a/backend.c b/backend.c index e1e143f..673fe9b 100644 --- a/backend.c +++ b/backend.c @@ -15,21 +15,21 @@ backend* backend_match(char* name){ return NULL; } -backend* mm_backend_register(backend b){ +int mm_backend_register(backend b){ if(!backend_match(b.name)){ backends = realloc(backends, (nbackends + 1) * sizeof(backend)); if(!backends){ fprintf(stderr, "Failed to allocate memory\n"); nbackends = 0; - return NULL; + return 1; } backends[nbackends] = b; nbackends++; fprintf(stderr, "Registered backend %s\n", b.name); - return backends + (nbackends - 1); + return 0; } - return NULL; + return 1; } int backends_stop(){ -- cgit v1.2.3