Paul Therrien wrote:
So a callback is a call to a program, but the program called is
variable. As in the example of an exit program the callback is a
configuration option. We configure the system to call a program as
opposed to having a hardcoded program name. Is this the essence of a
callback?
Not quite.
Exit programs, triggers, and callbacks are all variations on the same
basic concept of shared, standardized code calling installation-specific
code, but different from each other.
An exit program is, first and foremost, a *program* that is tied to an
exit hook, either via some registry mechanism, or simply by having the
right name. It is called whenever the hook is encountered, without
regard for what file(s) might be involved.
A trigger program is like an exit program, except that the hook is
buried in a much lower level of the operating system, so that all file
I/O requests of the specified type will trip it, and is tied to a
specific file.
A callback is a *procedure* or *function* call that is passed as a
parameter when calling an OS, runtime, or library API. Normally, the
callback is within the program calling the API; it is either passed for
immediate use when calling the API, or it may be passed as part of a
"setup" call when initially activating the API, with the resolution to
it then stored persistently within the API for the duration of its
activation.
--
JHHL