Header file
struct some_variable {
char *variable;
uint32_t infoe;
uint8_t *info0;
};
1.c in some directory
function1:
----------
static void filename(const char *variable,
function2:
----------
int read_variable(some_variable *var)
FILE *f = NULL;
f = fopen(filename, "rb");
.
.
.
.
}
2.c in other directory
function3:
----------
int own_function()
{
char buf[256];
uint8_t cam[3];
struct some_variable var;
var.variable = "iop";
if (strncmp(var.variable, "iop", 3) == 0) {
read_variable(&var);
f = fopen(filename,"r");
while (fgets(buf, sizeof buf, f)) {
sscanf(b, "%hhX:%hhX:%hhX:"
&cam[0], &cam[1], &cam[2]);
....
}
}
- function1 and function2 are in one file in some directory, function3 is in another file which I am writing.
- I called function 2 in function3.
- I would like to use "filename" from function2 in function3. note: I can't change function2'