2020-12-01 09:17:24 +01:00
|
|
|
#!/usr/bin/env python
|
2021-03-04 10:36:24 +01:00
|
|
|
#
|
|
|
|
|
# SPDX-FileCopyrightText: 2021 ret2libc <sirmy15@gmail.com>
|
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-only
|
2020-12-01 09:17:24 +01:00
|
|
|
|
|
|
|
|
""" Portable python script to preprocess syscall/d files """
|
|
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
import sys
|
|
|
|
|
|
2021-06-28 17:24:39 +08:00
|
|
|
with open(sys.argv[1]) as inf:
|
|
|
|
|
with open(sys.argv[2], "w") as outf:
|
|
|
|
|
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="")
|