File: defresources.awk

package info (click to toggle)
xosview 1.9.3-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,056 kB
  • sloc: cpp: 10,117; makefile: 142; ansic: 32; awk: 13; sh: 8
file content (29 lines) | stat: -rw-r--r-- 667 bytes parent folder | download | duplicates (7)
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
#
# This is a simple awk program which will generate defaultstring.cc
# from an X resource file.
#

#
# insert the "header" for defaultstring.cc
#
BEGIN {
  print "//";
  print "// Do not edit this file.";
  print "// This file is generated automagically from Xdefaults";
  print "// using the awk program found in defresources.awk.";
  print "// This file will be rebuilt when Xdefaults is modified.";
  print "//\n";
  printf "const char *defaultXResourceString = \"";
}

#
# Echo each line of input (that is not a comment or empty) to stdout.
#
(! /^!/) && (NF != 0) { printf "%s\\n\\\n", $0 }

#
# Insert the "tail" for defresources.cc
#
END {
  print "\";\n";
}