aboutsummaryrefslogtreecommitdiffstats
path: root/src/dmpstruct.awk
diff options
context:
space:
mode:
Diffstat (limited to 'src/dmpstruct.awk')
-rwxr-xr-xsrc/dmpstruct.awk28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk
new file mode 100755
index 00000000000..d222d117e62
--- /dev/null
+++ b/src/dmpstruct.awk
@@ -0,0 +1,28 @@
1BEGIN {
2 print "/* Generated by dmpstruct.awk */"
3 print "#ifndef EMACS_DMPSTRUCT_H"
4 print "#define EMACS_DMPSTRUCT_H"
5 struct_name = ""
6 tmpfile = "dmpstruct.tmp"
7}
8# Match a type followed by optional syntactic whitespace
9/^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/ {
10 struct_name = $2
11 close (tmpfile)
12}
13/^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/, /^( )?};$/ {
14 print $0 > tmpfile
15}
16/^( )?} *(GCALIGNED_STRUCT)? *;$/ {
17 if (struct_name != "") {
18 fflush (tmpfile)
19 cmd = "../lib-src/make-fingerprint -r " tmpfile
20 cmd | getline hash
21 close (cmd)
22 printf "#define HASH_%s_%.10s\n", struct_name, hash
23 struct_name = ""
24 }
25}
26END {
27 print "#endif /* EMACS_DMPSTRUCT_H */"
28}