diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2017-04-25 16:10:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-25 16:10:15 +0300 |
commit | d5d5e06086734f6406b3ccc522c4951cdc18ca21 (patch) | |
tree | 55cc62ab712a9ef82600cafbc8755c589f49d71f /src/test/generate-sym-test.py | |
parent | caf222104afe2d12f3a188a6bfee3a35f2d04fc6 (diff) | |
parent | d730e2d16452d522d3b130071847b75198f42c45 (diff) |
Merge pull request #5704 from keszybz/meson
meson: build systemd using meson
Diffstat (limited to 'src/test/generate-sym-test.py')
-rw-r--r-- | src/test/generate-sym-test.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/generate-sym-test.py b/src/test/generate-sym-test.py new file mode 100644 index 0000000000..a3350c8a81 --- /dev/null +++ b/src/test/generate-sym-test.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 +import sys, re + +print('#include <stdio.h>') +for header in sys.argv[2:]: + print('#include "{}"'.format(header.split('/')[-1])) + +print(''' +void* functions[] = {''') + +for line in open(sys.argv[1]): + match = re.search('^ +([a-zA-Z0-9_]+);', line) + if match: + print(' {},'.format(match.group(1))) + +print('''}; + +int main(void) { + unsigned i; + for (i = 0; i < sizeof(functions)/sizeof(void*); i++) + printf("%p\\n", functions[i]); + return 0; +}''') |