summaryrefslogtreecommitdiffstats
path: root/genprotsym.txr
blob: 7d9f8c2a4ef0a6daf8961cf987c96a8bd1292c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)