| 1 | %## -*-c-*- |
| 2 | %## |
| 3 | %## Skeleton source file for tables of crypto classes |
| 4 | %# |
| 5 | /* -*-c-*- GENERATED from gthingtab.c.in |
| 6 | * |
| 7 | * @{what}tab.c |
| 8 | */ |
| 9 | |
| 10 | #include <string.h> |
| 11 | |
| 12 | #include <mLib/macros.h> |
| 13 | |
| 14 | #include "@what.h" |
| 15 | |
| 16 | %repeat |
| 17 | #include "@{thing:left:f}.h" |
| 18 | %end |
| 19 | |
| 20 | const @cls *const @{what}tab[] = { |
| 21 | %repeat |
| 22 | &@{thing:right:c}, |
| 23 | %end |
| 24 | 0 |
| 25 | }; |
| 26 | |
| 27 | const @cls *@{what}_byname(const char *p) |
| 28 | { |
| 29 | const @cls *const *c; |
| 30 | |
| 31 | for (c = @{what}tab; *c; c++) |
| 32 | if (STRCMP(p, ==, (*c)->name)) return (*c); |
| 33 | return (0); |
| 34 | } |