[feature] add pglobal.h and seperate some code from poll_struct.h