I know that both functions return the number of events that have been received by Xlib from the server and the difference between them is that XPending flushes the
XPending