dtprintinfo: remove register keyword
[oweals/cde.git] / cde / programs / dtterm / mkfallbk
1 #!/bin/sh
2 # $XConsortium: mkfallbk.sh /main/2 1995/07/19 17:10:17 drk $
3
4 # this file will make a source file for the fallback resources from
5 # the app-defaults file.
6
7 # quote all double quotes (i.e., `"' becomes `\"') and
8 # strip off all comments (anything after a `!')...
9 sed -e 's@"@\\"@g' \
10     -e 's@[      ]*!.*@@' |
11
12 # now let's convert the rest with awk...
13 awk '
14 BEGIN {
15     printf "#include <Xm/Xm.h>\n\n";            # to define String...
16     printf "String fallbackResources[] = {\n";  # preamble...
17     contLine = 0;
18     buffer = "";
19 }
20 {
21     # drop blank lines... 
22     if (length($0) == 0) {
23         next;
24     }
25
26     # if this is not a continuation of the previous line, begin it with
27     # a "...
28     if (!contLine) {
29         printf "    \"";
30     }
31         
32     # if the last char is a backslash \, then it is continued on the
33     # next line...
34     if (substr($0, length($0), 1) == "\\") {
35         contLine = 1;
36     } else {
37         contLine = 0;
38     }
39
40     # print out the line...
41     printf "%s", $0;
42
43     # if it is not continued on the next line, then terminate the string...
44     if (!contLine) {
45         printf "\",";
46     }
47
48     # print the newline...
49     printf "\n";
50 }
51 END {
52     # postamble...
53     printf "    NULL,\n";
54     printf "};\n"
55 }'