Crazy code comparisons are a way of life.
If you want just Kevin's Get_Tracking_State() functionality just look for everything having to do with tracking_state. Or more specifically you will need the following lines of code from the new version.
tracking.h
lines 126-135: the tracking state defines
line 171: the Get_Tracking_State() declaration
tracking.c
lines 55-57: the tracking state variable
lines 118-122: setting the tracking state variable
lines 136-138: setting the tracking state variable
lines 197-198: setting the tracking state variable
lines 278-279: setting the tracking state variable
lines 551-593: the Get_Tracking_State() definition
I think that's all.