rizin/sys/syscall_preprocessing.py
Riccardo Schirone 7912502149
Fix compilation when python is run through meson runpython (#111)
Multiline scripts had issues on my windows system while building
from `cmd`. I removed some "pre_sdb" scripts used to read symlinks
because there are only two and it's probably easier to just avoid
symlinks for better portability.

Also moved a bunch of inlined script to separate files in sys/.
2020-12-01 09:17:24 +01:00

16 lines
No EOL
386 B
Python

#!/usr/bin/env python
""" Portable python script to preprocess syscall/d files """
import re
import sys
inf = open(sys.argv[1])
outf = open(sys.argv[2], 'w')
for line in inf:
if not line.startswith('_') and '=' in line:
arr = re.split('=|,', line)
print('%s.%s=%s' % (arr[1], arr[2], arr[0]), file=outf)
print(line, file=outf, end='')
inf.close()
outf.close()