I don't know what this "feature" is called so I coudn't google it also I'm sorry if the title doesn't make sense. I recently looked at suckless dwm's source and saw this code: (from dwm.c)
static int (*xerrorxlib)(Display *, XErrorEvent *);
And also this:
static void (*handler[LASTEvent]) (XEvent *) = {
[ButtonPress] = buttonpress,
[ClientMessage] = clientmessage,
[ConfigureRequest] = configurerequest,
[ConfigureNotify] = configurenotify,
[DestroyNotify] = destroynotify,
[EnterNotify] = enternotify,
[Expose] = expose,
[FocusIn] = focusin,
[KeyPress] = keypress,
[KeyRelease] = keypress,
[MappingNotify] = mappingnotify,
[MapRequest] = maprequest,
[MotionNotify] = motionnotify,
[PropertyNotify] = propertynotify,
[UnmapNotify] = unmapnotify
};
What does void (*handler[LASTEvent]) (XEvent *)
mean ? What it is called and why it is used for ?