home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 mARCH
/
PCWK3A99.iso
/
Linux
/
DDD331
/
DDD-3_1_.000
/
DDD-3_1_
/
ddd-3.1.1
/
ddd
/
ad2c.sed
< prev
next >
Wrap
Text File
|
1998-04-03
|
905b
|
55 lines
# $Id: ad2c.sed,v 1.6 1998/04/03 15:24:01 zeller Exp $ -*- text -*-
#
# ad2c : Convert app-defaults file to C strings decls.
#
# George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
# Updated 19 Mar 1991 - Made it self-contained.
: read
# remove comments
/^!/d
# remove blank lines
/^$/d
# compress blanks after `:'
s/:[ ][ ]*/: /g
# remove spaces at end of line
s/[ ][ ]*$/ /
s/[ ][ ]*\\n/\\n/g
s/set prompt \(.*\)\\n/set prompt \1 \\n/
# escape backslash
s/\\/\\\\/g
# except the line continuation ones
s/\\$//g
# escape quotes
s/"/\\"/g
s/'/\\'/g
# escape tabs
s/ /\\t/g
# add leading quote
s/^/"/
#
: test
/\\$/b slash
s/$/",/
p
n
b read
#
: slash
p
n
# just like "read" only does not add leading quote
/^!/d
/^$/d
s/:[ ][ ]*/: /g
s/[ ][ ]*$/ /
s/[ ][ ]*\\n$/ /
s/[ ][ ]*\\n/\\n/g
s/set prompt \(.*\)\\n/set prompt \1 \\n/
s/\\/\\\\/g
s/\\$//g
s/"/\\"/g
s/'/\\'/g
s/ /\\t/g
b test