Availability:C-language interface function
PL_dispatch_hook_t PL_dispatch_hook(PL_dispatch_hook_t)If this hook is not NULL, this function is called when reading from the 
terminal. It is supposed to dispatch events when SWI-Prolog is connected 
to a window environment. It can return two values:
PL_DISPATCH_INPUT indicates Prolog input is available on 
file descriptor 0 or PL_DISPATCH_TIMEOUT to indicate a 
timeout. The old hook is returned. The type PL_dispatch_hook_t 
is defined as:
typedef int  (*PL_dispatch_hook_t)(void);