12.4.22 Foreign Code Hooks
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Foreign Language Interface
        • The Foreign Include File
          • Foreign Code Hooks
            • PL_dispatch_hook()
            • PL_abort_hook()
            • PL_abort_unhook()
            • PL_on_halt()
            • PL_exit_hook()
            • PL_agc_hook()
    • Packages
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);