repo.or.cz
/
twcon.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge pull request #832 from GreYFoX/oypull1
[twcon.git]
/
scripts
/
dat2c.py
blob
09517ca5a82ff4b468a62a4405514048aab2d1ab
1
import
sys
2
3
data
=
file
(
sys
.
argv
[
1
],
"rb"
).
read
()
4
5
i
=
0
6
print
"unsigned char"
,
sys
.
argv
[
2
],
"[] = {"
7
print
str
(
ord
(
data
[
0
])),
8
for
d
in
data
[
1
:]:
9
s
=
","
+
str
(
ord
(
d
))
10
print
s
,
11
i
+=
len
(
s
)+
1
12
13
if
i
>=
70
:
14
print
""
15
i
=
0
16
print
""
17
print
"};"