root/foundation-apps/grosview-maxx/defresources.awk

Revision 2, 1.3 KB (checked in by emasson, 3 years ago)

initial import for the community edition

Line 
1#
2# This is a simple awk program which will generate defaultstring.cc
3# from an X resource file.
4#
5#
6# "$Id: defresources.awk,v 1.1.1.1 2008/05/04 15:53:48 emasson Exp $"
7#
8
9#
10# insert the "header" for defaultstring.cc
11#
12BEGIN {
13  print "//";
14  print "// Do not edit this file.";
15  print "// This file is generated automagically from Xdefaults";
16  print "// using the awk program found in defresources.awk.";
17  print "// This file will be rebuilt when Xdefaults is modified.";
18  print "//";
19  print "// $Id: defresources.awk,v 1.1.1.1 2008/05/04 15:53:48 emasson Exp $";
20  print "//";
21  print "//\n\n";
22  print "#include \"general.h\"\n";
23  print "\n";
24  print "CVSID(\"$Id: defresources.awk,v 1.1.1.1 2008/05/04 15:53:48 emasson Exp $\");\n";
25  #  By including all of the Xdefaults file below, we also pick up the
26  #    CVS Id from the Xdefaults file.
27  #  However, it'd be nice if some file had the CVS Id for the
28  #    general.h file.  Let's let this .cc file do that, since it doesn't
29  #    have an associated header file.
30  print "CVSID_DOT_H(GENERAL_H_CVSID);\n";
31  printf "char *defaultXResourceString = \"";
32}
33
34#
35# Echo each line of input (that is not a comment or empty) to stdout.
36#
37(! /^!/) && (NF != 0) { printf "%s\\n\\\n", $0 }
38
39#
40# Insert the "tail" for defresources.cc
41#
42END {
43  print "\";\n";
44}
Note: See TracBrowser for help on using the browser.