scripts/*: add a script that can list every function name

This commit is contained in:
Jean Sirmai 2024-10-28 13:50:05 +01:00
parent 5c0289217e
commit 2f33355180
Signed by: jean
GPG Key ID: FB3115C340E057E3
2 changed files with 50 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
bin/*
build/*
scripts/junk

View File

@ -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()