ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/ad2c.script
Revision: 1.2
Committed: Mon Mar 5 19:03:08 2007 UTC (17 years, 2 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
major clenaup in utils/

File Contents

# User Rev Content
1 root 1.1 #!/bin/sh
2     #
3     # ad2c : Convert app-defaults file to C strings decls.
4     #
5     # George Ferguson, ferguson@cs.rcohester.edu, 12 Nov 1990.
6     # Updated 19 Mar 1991 - Made it self-contained.
7     #
8    
9     sed -n '
10     : read
11     # remove comments
12     /^!/d
13     # remove blanks
14     /^$/d
15     # escape quotes
16     s/"/\\"/g
17     # escape backslash
18     s/\\/\\\\/g
19     # except the line continuation ones
20     s/\\$//g
21     # add leading quote
22     s/^/"/
23     #
24     : test
25     /\\$/b slash
26     s/$/",/
27     p
28     n
29     b read
30     #
31     : slash
32     p
33     n
34     # just like "read" only does not add leading quote
35     /^!/d
36     /^$/d
37     s/"/\\"/g
38     s/\\\\/\\/g
39     s/\\n/\\\\n/g
40     s/\\t/\\\\t/g
41     s/\\f/\\\\f/g
42     s/\\b/\\\\b/g
43     b test' "$@"