ql_foreachx for callbacks with state
typedef for the callbacks.
I am doing so much type-casting, I need some typing reduction