libguac 1.5.5
Loading...
Searching...
No Matches
Functions | Variables
argv.h File Reference

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().
 

Detailed Description

Convenience functions for processing parameter values that are submitted dynamically using "argv" instructions.

Function Documentation

◆ guac_argv_await()

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().

Parameters
argsA NULL-terminated array of the names of all arguments that this function should wait for.
Returns
Zero if all of the specified arguments were received, non-zero if guac_argv_stop() was called before all arguments were received.

◆ 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.

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.

Parameters
streamThe guac_stream that will receive the value of the argument having the given name.
mimetypeThe mimetype of the data that will be received over the stream.
nameThe name of the argument being received.
Returns
Zero if handling of the guac_stream has been successfully handed off, non-zero if the provided argument has not yet been registered with guac_argv_register().

◆ guac_argv_register()

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.

See also
GUAC_ARGV_MAX_NAME_LENGTH
GUAC_ARGV_MAX_REGISTERED
GUAC_ARGV_OPTION_ONCE
GUAC_ARGV_OPTION_ECHO
Parameters
nameThe name of the argument that should be handled by the given callback.
callbackThe callback to invoke when the value of an argument having the given name has finished being received.
dataArbitrary data to be passed to the given callback when a value is received for the given argument.
optionsBitwise OR of all option flags that should affect processing of this argument.
Returns
Zero if the callback was successfully registered, non-zero if the maximum number of registered callbacks has already been reached.

◆ guac_argv_stop()

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.

Variable Documentation

◆ guac_argv_handler

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.