Hello everyone, this is my first post so please give me a hand.
I apologize for my English, I'll try to be clear with my request.
I need to write a script (Bash) which finds all the variables defined in the file .h of the folder and then writes the name of the files .c where these variables are used.
I'd like to have a result like this:
MAXCAR
defined in xxx.h
used in yyy.c
The structure of the .h files is something like this:
#ifndef
#define XXX_H
.
.
#define MAXCAR 4
.
.
#endif
Of course the .c that uses the variable is something like this
#include "xxx.h"
.
.
.
int z=MAXCAR*4;
I hope I am clear with my request. I'll thank everyone who can help!