libguac 1.5.5
|
Convenience functions for processing parameter values that are submitted dynamically using "argv" instructions. More...
Go to the source code of this file.
Functions | |
int | guac_argv_register (const char *name, guac_argv_callback *callback, void *data, int options) |
Registers the given callback such that it is automatically invoked when an "argv" stream for an argument having the given name is processed using guac_argv_received(). | |
int | guac_argv_await (const char **args) |
Waits for receipt of each of the given arguments via guac_argv_received(). | |
int | guac_argv_received (guac_stream *stream, const char *mimetype, const char *name) |
Hands off management of the given guac_stream, automatically processing data received over that stream as the value of the argument having the given name. | |
void | guac_argv_stop () |
Stops further automatic processing of received "argv" streams. | |
Variables | |
guac_user_argv_handler | guac_argv_handler |
Convenience implementation of the "argv" instruction handler which automatically sends any required "ack" instructions and invokes guac_argv_received(). | |
Convenience functions for processing parameter values that are submitted dynamically using "argv" instructions.
int guac_argv_await | ( | const char ** | args | ) |
Waits for receipt of each of the given arguments via guac_argv_received().
This function will block until either ALL of the given arguments have been received via guac_argv_received() or until automatic processing of received arguments is stopped with guac_argv_stop().
args | A NULL-terminated array of the names of all arguments that this function should wait for. |
int guac_argv_received | ( | guac_stream * | stream, |
const char * | mimetype, | ||
const char * | name ) |
Hands off management of the given guac_stream, automatically processing data received over that stream as the value of the argument having the given name.
The argument must have already been registered with guac_argv_register(). The blob_handler and end_handler of the given stream, if already set, will be overridden without regard to their current value.
It is the responsibility of the caller to properly send any required "ack" instructions to accept or reject the received stream.
stream | The guac_stream that will receive the value of the argument having the given name. |
mimetype | The mimetype of the data that will be received over the stream. |
name | The name of the argument being received. |
int guac_argv_register | ( | const char * | name, |
guac_argv_callback * | callback, | ||
void * | data, | ||
int | options ) |
Registers the given callback such that it is automatically invoked when an "argv" stream for an argument having the given name is processed using guac_argv_received().
The maximum number of arguments that may be registered in this way is limited by GUAC_ARGV_MAX_REGISTERED. The maximum length of any provided argument name is limited by GUAC_ARGV_MAX_NAME_LENGTH.
name | The name of the argument that should be handled by the given callback. |
callback | The callback to invoke when the value of an argument having the given name has finished being received. |
data | Arbitrary data to be passed to the given callback when a value is received for the given argument. |
options | Bitwise OR of all option flags that should affect processing of this argument. |
void guac_argv_stop | ( | ) |
Stops further automatic processing of received "argv" streams.
Any call to guac_argv_await() that is currently blocking will return, and any future calls to guac_argv_await() will return immediately without blocking.
guac_user_argv_handler guac_argv_handler |
Convenience implementation of the "argv" instruction handler which automatically sends any required "ack" instructions and invokes guac_argv_received().
Only arguments that are registered with guac_argv_register() will be processed.