]> git.tdb.fi Git - gldbg.git/blobdiff - source/functions.c
Enable bidirectional communication between gldbg and glwrap.so
[gldbg.git] / source / functions.c
diff --git a/source/functions.c b/source/functions.c
new file mode 100644 (file)
index 0000000..f516fdc
--- /dev/null
@@ -0,0 +1,29 @@
+/* $Id$
+
+This file is part of gldbg
+Copyright © 2010  Mikko Rasa, Mikkosoft Productions
+Distributed under the GPL
+*/
+
+#include <string.h>
+#include "functions.h"
+
+#include "gensrc/functions.table"
+
+const char *get_function_name(unsigned short func)
+{
+       if(func<N_FUNCS)
+               return func_names[func];
+
+       return NULL;
+}
+
+unsigned short get_function(const char *name)
+{
+       unsigned i;
+       for(i=1; i<N_FUNCS; ++i)
+               if(!strcmp(func_names[i], name))
+                       return i;
+
+       return 0;
+}