1 /* rec_callback.c - callbacks for recognizer actions
2 
3    Copyright 2001 Carl Worth
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2, or (at your option)
8    any later version.
9 
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14  */
15 
16 #include <stdio.h>
17 #include "rec_callback.h"
18 
19 #ifdef DMALLOC
20 #include "dmalloc.h"
21 #endif
22 
rec_callback_init(rec_callback_t * callback,rec_cb_fun_t cb_fun,void * data)23 int rec_callback_init(rec_callback_t *callback, rec_cb_fun_t cb_fun, void *data)
24 {
25     callback->cb_fun = cb_fun;
26     callback->data = data;
27     callback->next = NULL;
28 
29     return 0;
30 }
31 
rec_callback_deinit(rec_callback_t * callback)32 void rec_callback_deinit(rec_callback_t *callback)
33 {
34     callback->next = NULL;
35     callback->data = NULL;
36     callback->cb_fun = NULL;
37 }
38