File: exports.py

package info (click to toggle)
olm 3.2.16%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 3,212 kB
  • sloc: cpp: 15,245; ansic: 10,894; java: 3,244; objc: 2,291; javascript: 1,882; python: 1,839; makefile: 437; sh: 245; asm: 7; xml: 1
file content (18 lines) | stat: -rwxr-xr-x 370 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python3

import sys
import re
import json

expr = re.compile(r"(_*olm_[^( ]*)\(")

exports = {'_free', '_malloc'}

for f in sys.argv[1:]:
    with open(f) as fp:
        for line in fp:
            matches = expr.search(line)
            if matches is not None:
                exports.add('_%s' % (matches.group(1),))

json.dump(sorted(exports), sys.stdout)