Lets say I have 3 seperate files called: main.c, test.c and test.h. How could I "force" a function that includes test.h to define a function which is already declared in test.h, that test.c file can call it.
This ia a bit messy, so let me give you some code samples of what I mean.
test.h:
...
#define SOMETHING
...
#ifdef SOMETHING
inline void test_func(BYTE b);
#endif
...
test.c:
#include "test.h"
void somefunction(void)
{
...
#ifdef SOMETHING
test_func(integer_value);
#endif
...
}
main.c:
#include "test.h"
int main(void)
{
...
}
inline void test_func(BYTE b)
{
// Do something with b
}
In short: test.h declared a function, main.c defines that function and test.c calls that function.
Is this possible? How?
EDIT:
The user declares the function in main.c when to compiler gives a error or something that that function is not declared.