Files
mcde/programs/dtterm/mkfallbk
T
lotherkandClaude Opus 5.5 3b2a54c64b ext/src/mcde: import CDE 2.5.3 and pkgsrc wm/cde unchanged (the base of the MCDE fork)
cde-2.5.3.tar.gz, SHA512 a01b413b... as in pkgsrc distinfo; recipe from
pkgsrc 3c1118e94432.  Added with -f: CDE's .gitignore hides 612 files of
the archive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 19:36:46 +00:00

56 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# $XConsortium: mkfallbk.sh /main/2 1995/07/19 17:10:17 drk $
# this file will make a source file for the fallback resources from
# the app-defaults file.
# quote all double quotes (i.e., `"' becomes `\"') and
# strip off all comments (anything after a `!')...
sed -e 's@"@\\"@g' \
-e 's@[ ]*!.*@@' |
# now let's convert the rest with awk...
awk '
BEGIN {
printf "#include <Xm/Xm.h>\n\n"; # to define String...
printf "String fallbackResources[] = {\n"; # preamble...
contLine = 0;
buffer = "";
}
{
# drop blank lines...
if (length($0) == 0) {
next;
}
# if this is not a continuation of the previous line, begin it with
# a "...
if (!contLine) {
printf " \"";
}
# if the last char is a backslash \, then it is continued on the
# next line...
if (substr($0, length($0), 1) == "\\") {
contLine = 1;
} else {
contLine = 0;
}
# print out the line...
printf "%s", $0;
# if it is not continued on the next line, then terminate the string...
if (!contLine) {
printf "\",";
}
# print the newline...
printf "\n";
}
END {
# postamble...
printf " NULL,\n";
printf "};\n"
}'