]> git.tdb.fi Git - gldbg.git/blob - source/functions.c
Enable bidirectional communication between gldbg and glwrap.so
[gldbg.git] / source / functions.c
1 /* $Id$
2
3 This file is part of gldbg
4 Copyright © 2010  Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
6 */
7
8 #include <string.h>
9 #include "functions.h"
10
11 #include "gensrc/functions.table"
12
13 const char *get_function_name(unsigned short func)
14 {
15         if(func<N_FUNCS)
16                 return func_names[func];
17
18         return NULL;
19 }
20
21 unsigned short get_function(const char *name)
22 {
23         unsigned i;
24         for(i=1; i<N_FUNCS; ++i)
25                 if(!strcmp(func_names[i], name))
26                         return i;
27
28         return 0;
29 }