New API call Xorriso_start_msg_watcher()

This commit is contained in:
2012-09-14 17:52:21 +00:00
parent fcc00d4311
commit eaa501c9ec
10 changed files with 407 additions and 9 deletions

View File

@ -580,8 +580,9 @@ struct Xorriso_lsT;
and the Xorriso_option_pkt_output() protocol will not be applied.
@param xorriso The environment handle
@param stack_handle returns an id number which is unique as long as
its redirection is stacked. It may be re-used after
its redirection was pulled from the stack.
its redirection is stacked. Do not interpret it and
do not use it after its redirection was pulled from
the stack.
@param flag Bitfield for control purposes
bit0= redirect result channel
bit1= redirect info channel
@ -635,6 +636,7 @@ int Xorriso_fetch_outlists(struct XorrisO *xorriso, int stack_handle,
@param stack_handle An id number returned by Xorriso_push_outlists()
and not yet revoked by Xorriso_pull_outlists().
This handle is invalid after the call.
Submit -1 to address the most recent valid id.
@param result_list Result and mark messages (usually directed to stdout)
@param info_list Info and mark messages (usually directed to stderr)
@param flag unused yet, submit 0
@ -645,6 +647,46 @@ int Xorriso_pull_outlists(struct XorrisO *xorriso, int stack_handle,
struct Xorriso_lsT **info_list, int flag);
/** Redirect output by Xorriso_push_outlists() and start a thread which
fetches this output and performs a call of a given function with each
message that is obtained.
@since 1.2.6
@param xorriso The environment handle
@param result_handler Pointer to the function which shall be called with
each result message. A NULL pointer causes output
to be directed to stdout.
The function should use the pointer xorriso with
outmost caution, because nearly all API calls are not
thread-safe and may not be used. Best is to use it
only to distinguish the callers if more than one
struct XorrisO is in use by the application.
@param info_handler Pointer to the function which shall be called with
each info message. A NULL pointer causes output to
be directed to stderr resp. to -as mkisofs -log-file.
The same caution is needed as with result_handler.
@param flag unused yet, submit 0
@return 1 on success, <=0 if failure (e.g. there is already
a watcher active)
*/
int Xorriso_start_msg_watcher(struct XorrisO *xorriso,
int (*result_handler)(struct XorrisO *xorriso, char *text),
int (*info_handler)(struct XorrisO *xorriso, char *text),
int flag);
/** Revoke output redirection by Xorriso_start_msg_watcher() and end the
watcher thread. If text messages are delivered when Xorriso_pull_outlists()
is called, then they get put out through the active handler functions.
@since 1.2.6
@param xorriso The environment handle
@param flag Bitfield for control purposes:
bit0= do not issue SORRY message if no message
watcher is active
@return 1 on success, <=0 if failure
*/
int Xorriso_stop_msg_watcher(struct XorrisO *xorriso, int flag);
/** Obtain the text message from the current list item.
@param entry The current list item
@param flag unused yet, submit 0