Here the function prototype manual goes,
Xlib Programming Manual: XSetErrorHandler
I'm confused with the first lineCode:int (*XSetErrorHandler(handler))() int (*handler)(Display *, XErrorEvent *)Most people use the function like thatCode:int (*XSetErrorHandler(handler))()
Others direct invoke the functionCode:int (*handler)(Display *, XErrorEvent *) = NULL; int old(Display *d, XErrorEvent *e){...} handler = XSetErrorHandler(old); XSetErrorHandler(handler);
I have no idea how the hell XSetErrorHandler works.Code:XSetErrorHandler(old);
As I understood for XSetErrorHandler()
At first it in the bracket returns one function which returned pf integer value,and then invoke the function.
But it conflicts withwhich obvisouly return function pointer.Code:handler = XSetErrorHandler(old);
what's the theory of the function?
how hell does function works?
I'm looking forware to the explanation.
Ching.



LinkBack URL
About LinkBacks



