this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Improvements to stub-gen-c-func.py

authored by

Andrew Hyatt and committed by
GitHub
28652c46 e3bf8634

+4 -9
+4 -9
tools/stub-gen-c-func.py
··· 18 18 import sys, subprocess 19 19 20 20 def usage(): 21 - print "Usage: %s <Mach-O> <output directory>" % sys.argv[0] 21 + print("Usage: %s <Mach-O> <output directory>" % sys.argv[0]) 22 22 23 23 if len(sys.argv) != 3: 24 24 usage() ··· 29 29 out = subprocess.check_output(["nm", "-Ug", macho]) 30 30 31 31 functions = [] 32 - for line in out.split("\n"): 32 + for line in out.splitlines(): 33 33 if line == "": 34 34 continue 35 - components = line.split(" ") 36 - id = components[1] 37 - name = components[2] 35 + address, id, name = line.split(" ") 38 36 # Remove the underscore 39 - name = name[1 : len(name)] 37 + name = name[1 : ] 40 38 41 39 if id == "T": 42 40 functions.append(name) ··· 71 69 for funcname in functions: 72 70 header.write("void %s(void);\n" % funcname) 73 71 source.write("void %s(void) { }\n" % funcname) 74 - 75 - header.close() 76 - source.close()