X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/813390c45f438f411662b1a55678e63f11681eb4..7db733d4d0fd085313e4ae3d8ff9b7cc533616bb:/gthingtab.c.in diff --git a/gthingtab.c.in b/gthingtab.c.in new file mode 100644 index 0000000..1c51520 --- /dev/null +++ b/gthingtab.c.in @@ -0,0 +1,32 @@ +%## -*-c-*- +%## +%## Skeleton source file for tables of crypto classes +%# +/* -*-c-*- GENERATED from gthingtab.c.in + * + * @{what}tab.c + */ + +#include + +#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); +}