3
# ad2c : Convert app-defaults file to C strings decls.
6
# Ad2c converts X resource files into C declarations,
7
# appropriate for inclusion as fallback resources.
8
# It reads from the given files (or stdin if none are given)
9
# and writes the C declarations to stdout.
12
# George Ferguson, ferguson@cs.rochester.edu, 12 Nov 1990.
15
# This software is provided as is with no warranty expressed
16
# or implied. I hope you find it useful, but I won't be held
17
# responsable for any damage that may occur from reading, com-
18
# piling, installing or using it.
20
# You are free to use any part of this code for other pur-
21
# poses. It would be nice if you could keep my name on some
22
# part of whatever the final product is.
26
# Made it self-contained.
27
# 6 Jan 1992: mycroft@gnu.ai.mit.edu (Charles Hannum)
28
# Removed use of "-n" and ":read" label since Gnu and
29
# IBM sed print pattern space on "n" command. Still works
30
# with Sun sed, of course.
31
# 7 Jan 1992: matthew@sunpix.East.Sun.COM (Matthew Stier)
32
# Escape quotes after escaping backslashes.
33
# 8 Jul 1992: Version 1.6
34
# 24 Feb 1994: david@ora.com (David Flanagan)
35
# convert `!' comments to C-style comments.
36
# output blank lines rather than deleting them.
37
# this makes the output resemble the input a bit more.
38
# 30 May 1995: david@ora.com (David Flanagan)
39
# an Xmt-specific change to comment out xmtRequires lines,
40
# as suggested by Mike McGary.
46
# comment out xmtRequires lines, since we probably will run this script
47
# on those files too. Only do this if the line is not \-terminated, since
48
# the multi-line case is too tricky and rare to bother handling correctly.
49
# Thanks to Mike McGary for this suggestion.
55
# except the line continuation ones
61
# just like "read" only does not add leading quote
72
/xmtRequires:.*[^\\]$/ {
73
s|^\(.*\)$|/\* \1 \*/|