third_party/libgrapheme/generate_headers.py
raw| 1 | #!/usr/bin/env python |
| 2 | |
| 3 | # Copyright 2023 Google LLC. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | ''' |
| 8 | Generate c header out of txt file |
| 9 | |
| 10 | Output is a header |
| 11 | ''' |
| 12 | |
| 13 | import subprocess |
| 14 | import sys |
| 15 | |
| 16 | header = open(sys.argv[2], "w") |
| 17 | code = subprocess.Popen(sys.argv[1], shell=True, universal_newlines=True, stdout=header, cwd=sys.argv[3]) |
| 18 | exit(code.wait()) |