scripts/*: add a script that can list every function name
This commit is contained in:
parent
93e19a618c
commit
549431196b
|
@ -1,2 +1,3 @@
|
|||
bin/*
|
||||
build/*
|
||||
scripts/junk
|
|
@ -0,0 +1,49 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
#rr = open('read_me.doc', 'r', encoding='UTF-8')
|
||||
rr = open('include/widget.h', 'r', encoding='UTF-8')
|
||||
ww = open('scripts/junk', "w")
|
||||
|
||||
l = [None] * 75
|
||||
n = -1
|
||||
|
||||
for line in rr:
|
||||
if (line [0:4] == 'void'
|
||||
or line [0:3] == 'int'
|
||||
or line [0:4] == 'char'
|
||||
or line [0:8] == 'GtkEntry'):
|
||||
n += 1
|
||||
l[n] = line.split(' ')[1]
|
||||
if (len(l[n]) > 0
|
||||
and l[n][0] == '*'):
|
||||
l[n] = l[n][1:]
|
||||
|
||||
for line in rr:
|
||||
if (line [0:10] == 'const char'
|
||||
or line [0:17] == 'struct TreeNode_t'):
|
||||
n += 1
|
||||
l[n] = line.split(' ')[2]
|
||||
if (len(l[n]) > 0
|
||||
and l[n][0] == '*'):
|
||||
l[n] = l[n][1:]
|
||||
|
||||
|
||||
#l.sort()
|
||||
n = -1
|
||||
for line in l:
|
||||
n += 1
|
||||
if (line == None):
|
||||
line = "None"
|
||||
if (n in range(69)):
|
||||
if (line[-1:] == '\n'):
|
||||
line = line[:-1]
|
||||
if (line[-3:] == '();'):
|
||||
line = line[:-3]
|
||||
#line = str(n) + ' ' + line
|
||||
print(line)
|
||||
line = line + '\n'
|
||||
ww.write(line)
|
||||
|
||||
rr.close()
|
||||
ww.close()
|
||||
|
Loading…
Reference in New Issue