You need to be careful here. "Global" variables are those that are available to any point in the code but there's no formal definition of global in the standard - it uses more formal terms like scope, storage duration and linkage.
One definition of global applies to a single file, another can apply across multiple files.
With you particular setup, if you include that header file in multiple C source files, then try and link them together, you'll get link errors because each object file has their own copy of the variables, and they're all trying to export them.
If you want your variables to be global for a single source file, put them at the top of that source file and make them static (effectively invisible to the linker):
static int state;
This means every function in that file can get at them yet they don't interfere with other files.
However, if you want your variables to be global across all source files, put the declaration in a header file and the definition in one C source file. A declaration declares that something exists while a definition brings it into existence:
something.h:
extern int state; // declare it
file1.c:
#include "something.h" // declare it (in header)
int state; // AND define it.
// Now you can use state anywhere.
file2.c:
#include "something.h" // declare it (in header)
// Now you can use state anywhere.
This means there is one copy of state
that all files have access to.
In terms of using global variables, it should generally be avoided as much as possible. Using them makes encapsulation much more difficult and exposes the innards of your code to manipulation from outside.
The basic rule is to Use the smallest possible scope for any individual item, that still allows you to achieve your ends. And sometimes, that means passing things around.
If you really don't want to pass them around, at least isolate all the data, and code that manipulates it, to a single file so you can hide it that way.