]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/test/generate-sym-test.py
Merge pull request #10293 from poettering/cryptsetup-fixes
[thirdparty/systemd.git] / src / test / generate-sym-test.py
CommitLineData
3e67e5c9 1#!/usr/bin/env python3
37ab1a25
ZJS
2import sys, re
3
4print('#include <stdio.h>')
5for header in sys.argv[2:]:
6 print('#include "{}"'.format(header.split('/')[-1]))
7
8print('''
9void* functions[] = {''')
10
11for line in open(sys.argv[1]):
12 match = re.search('^ +([a-zA-Z0-9_]+);', line)
13 if match:
14 print(' {},'.format(match.group(1)))
15
16print('''};
17
18int main(void) {
19 unsigned i;
20 for (i = 0; i < sizeof(functions)/sizeof(void*); i++)
21 printf("%p\\n", functions[i]);
22 return 0;
23}''')