Rearrange the file tree.
[u/mdw/catacomb] / symm / gthingtab.c.in
diff --git a/symm/gthingtab.c.in b/symm/gthingtab.c.in
new file mode 100644 (file)
index 0000000..1c51520
--- /dev/null
@@ -0,0 +1,32 @@
+%## -*-c-*-
+%##
+%## Skeleton source file for tables of crypto classes
+%#
+/* -*-c-*- GENERATED from gthingtab.c.in
+ *
+ * @{what}tab.c
+ */
+
+#include <string.h>
+
+#include "@what.h"
+
+%repeat
+#include "@{thing:left}.h"
+%end
+
+const @cls *const @{what}tab[] = {
+%repeat
+  &@{thing:right:c},
+%end
+  0
+};
+
+const @cls *@{what}_byname(const char *p)
+{
+  const @cls *const *c;
+
+  for (c = @{what}tab; *c; c++)
+    if (strcmp(p, (*c)->name) == 0) return (*c);
+  return (0);
+}