I would pass parameter instead of static int
to be reentrant.
then caller can decide to reinit the state when desired.
int main()
{
int state = 0;
abc(&state);
abc(&state);
abc(&state);
abc(&state);
return 0;
}
void abc(int* state)
{
if (*state == 0)
{
xyz();
++*state;
}
printf("This is abc");
}