The header files are the ones in the include directory. Do a control-F search on all of them. Notepad++ also has a "find in files" feature which is also useful.

g is a pointer to a GLOBAL struct. That struct is also defined. Many macros are set up in the headers so that you can avoid pointer logic for simple scripts.