Is it possible to make an enum statement avail its contents across all source files in a multi-file C project, or is it necessary to just use them within a .h file and localise their use as much as possible?
Also, would anyone be able to suggest some strategies or references for reducing the amount of global variables in general? I'm finding I need to use extern a lot more than I'd like.
you can define enum type in the header as you define struct
you will declare enum var in a function that needs it
to avoid globals - pass the needed data as parameters
If you have enums or other items that are used a lot, you could put their declarations in one main important header file that your other .c files will need to include. I imagine the overhead of doing this only really becomes insignificant when you have a lot of .c files that require a lot of data types.