summaryrefslogtreecommitdiff
path: root/src/libtipidee/tipidee_method_tonum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtipidee/tipidee_method_tonum.c')
-rw-r--r--src/libtipidee/tipidee_method_tonum.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libtipidee/tipidee_method_tonum.c b/src/libtipidee/tipidee_method_tonum.c
new file mode 100644
index 0000000..7c88e45
--- /dev/null
+++ b/src/libtipidee/tipidee_method_tonum.c
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#include <string.h>
+
+#include <tipidee/method.h>
+
+tipidee_method tipidee_method_tonum (char const *s)
+{
+ tipidee_method_conv const *p = tipidee_method_conv_table ;
+ for (; p->str ; p++) if (!strcmp(s, p->str)) break ;
+ return p->num ;
+}