From 34e445b8457113ceee1b1778a53687165de28707 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Mon, 28 Oct 2024 13:50:05 +0100 Subject: [PATCH] scripts/*: add a script that can list every function name --- .gitignore | 1 + scripts/parsing_functions_names.py | 49 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 scripts/parsing_functions_names.py diff --git a/.gitignore b/.gitignore index 9c58ac0..3d03265 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ bin/* build/* +scripts/junk \ No newline at end of file diff --git a/scripts/parsing_functions_names.py b/scripts/parsing_functions_names.py new file mode 100755 index 0000000..56e3076 --- /dev/null +++ b/scripts/parsing_functions_names.py @@ -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() +