Commit | Line | Data |
---|---|---|
7db733d4 MW |
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 | ||
141c1284 MW |
12 | #include <mLib/macros.h> |
13 | ||
7db733d4 MW |
14 | #include "@what.h" |
15 | ||
16 | %repeat | |
aaae9cab | 17 | #include "@{thing:left:f}.h" |
7db733d4 MW |
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++) | |
141c1284 | 32 | if (STRCMP(p, ==, (*c)->name)) return (*c); |
7db733d4 MW |
33 | return (0); |
34 | } |