]>
Commit | Line | Data |
---|---|---|
6bb9b060 BP |
1 | #! /usr/bin/python |
2 | ||
3 | import re | |
4 | import sys | |
5 | ||
6 | """This utility reads its input, which should be plain text, and | |
7 | prints it back transformed into quoted strings that may be #included | |
8 | into C source code.""" | |
9 | ||
10 | while True: | |
11 | line = sys.stdin.readline() | |
12 | if not line: | |
13 | break | |
14 | ||
15 | s = line.replace("\\", "\\\\").replace('"', '\\"').replace("\n", "\\n") | |
16 | print('"' + s + '"') |