diff options
Diffstat (limited to 'genprotsym.txr')
-rw-r--r-- | genprotsym.txr | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/genprotsym.txr b/genprotsym.txr new file mode 100644 index 00000000..7d9f8c2a --- /dev/null +++ b/genprotsym.txr @@ -0,0 +1,32 @@ +@(next (open-files (glob "*.c"))) +@(collect :vars (sym)) +val @(coll)@{sym /[A-Za-z0-9_]+_[sk]/}@/[,;]/@(end) +@(end) +@(next "lib.c") +@(collect) +@copyright +@(until) + +@(end) +@(flatten sym) +@(bind gsym @(tuples 5 (sort sym))) +@(output "protsym.c") +/* This file is generated by genprotsym.txr */ + +@{copyright "\n"} + +#include <stddef.h> +#include "config.h" +#include "lib.h" + +@ (repeat) +extern val @(rep)@gsym, @(last)@gsym;@(end) +@ (end) + +val *protected_sym[] = { +@ (repeat) + @(rep)&@gsym, @(last)&@gsym,@(end) +@ (end) + convert(val *, 0) +}; +@(end) |