For an example, see lib/mid/event.c:9