Last one thing: could you make it specific to xgmthrid or make it a private API (by creating a xxxxx_private.h header)?
For example, there's X-GM-RAW which has a string as parameter.
It's easier to have specific API than find out a generic API for match a possible future Gmail extension.