]> git.ozlabs.org Git - petitboot/blob - test/parser/extract-config.awk
pb-plugin: Move plugin wrappers to a separate dir
[petitboot] / test / parser / extract-config.awk
1 BEGIN {
2         config=0
3 }
4
5 /^#if[ \t]*0[ \t]*\/\*[ \t]*PARSER_EMBEDDED_CONFIG/ {
6         config=1
7         print "#include <stdlib.h>"
8         print "const char __embedded_config[] = "
9         next
10 }
11 !config {
12         next
13 }
14 /^#endif/ {
15         print ";"
16         print "const size_t __embedded_config_size = sizeof(__embedded_config);"
17         exit
18 }
19 {
20         gsub("\"", "\\\"");
21         print "\t\"" $0 "\\n\""
22 }