Task of comparing two .c files which has function definitions from other files generated via different sources

sshri

New Member
Joined
Jan 30, 2023
Messages
1
Reaction score
0
Credits
19
Hello, Here is my plan to compare the function bodys from both files:
I am writing a shell script to do the following:
- list all .c and .cpp files.
- loop through .c and .cpp to extract function definitions only.
- store function definitions in separate file named as function_name.c.
Now writing a python script to execute shell script to do the following
- Add function definitions as a entry to nested dictionary(hash table)in below format.
file_details={'file1':{'functionName1':'fxn_body1', \
'functionName2':'fxn_body2', \
'functionName3':'fxn_body3'}, \
'file2':{'functionName1':'fxn_body1', \
'functionName2':'fxn_body2', \
'functionName3':'fxn_body3'}, \
'file3':{'functionName1':'fxn_body1', \
'functionName2':'fxn_body2', \
'functionName3':'fxn_body3'}, }
and so on.

I have this work ready but its taking too much time I have around 3k files to apply these operations
I am using lot of awk commands in shell script to achieve this.
Any suggestions to reduce time would be helpful.
 

Members online


Latest posts

Top