gbatch_varmon - monitor changes to the variables list
int gbatch_varmon(const int fd, void (*fn)(const int))
Note that this routine is not available in the Windows version, please see <a href="#Xb_setmon_def">the section on gbatch_setmon</a> which covers both jobs and variables.
The function gbatch_varmon is used to set a function to monitor changes to the variables list.
fd is a file descriptor which was previously returned by a
successful call to gbatch_open(3)
.
fn is a pointer to a function which will handle the changes to the
list or NULL
, which cancels any previous call. This function will
be called with fd as an argument when any change is noted. The API
does not note which variables the user is interested in, so any
changes to variables may provoke a call to this function.
The function returns 0 if successful, otherwise an error code as defined in the include file \fBgbatch.h\fR.
void note_mod(const int fd) { var_changes++; }
...
gbatch_varmon(fd, note_mod);
if (var_changes) { var_changes = 0; ... /* Re-read list etc */ ... }
gbatch_varmon(fd, NULL);
gbatch_open(3)
,
gbatch_close(3)
,
gbatch_jobmon(3)
.
Copyright (c) 2009 Free Software Foundation, Inc. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
John M Collins, Xi Software Ltd.