Suppose I have a function named caller, which will call a function named callee:
void caller()
{
callee();
}
Now caller might be called m
You could hide the function through a function pointer.
static void real_function()
{
//do stuff
function = noop_function;
}
static void noop_function()
{
}
int (*function)(void) = real_function;
Callers just call the function
which will do the work the first time, and do nothing on any subsequent calls.