GUPnPService

GUPnPService — Class for service implementations.

Synopsis




                    GUPnPServiceAction;
                    GUPnPService;
const char*         gupnp_service_action_get_name       (GUPnPServiceAction *action);
GList*              gupnp_service_action_get_locales    (GUPnPServiceAction *action);
void                gupnp_service_action_get            (GUPnPServiceAction *action,
                                                         ...);
void                gupnp_service_action_get_valist     (GUPnPServiceAction *action,
                                                         va_list var_args);
void                gupnp_service_action_get_value      (GUPnPServiceAction *action,
                                                         const char *argument,
                                                         GValue *value);
void                gupnp_service_action_set            (GUPnPServiceAction *action,
                                                         ...);
void                gupnp_service_action_set_valist     (GUPnPServiceAction *action,
                                                         va_list var_args);
void                gupnp_service_action_set_value      (GUPnPServiceAction *action,
                                                         const char *argument,
                                                         const GValue *value);
void                gupnp_service_action_return         (GUPnPServiceAction *action);
void                gupnp_service_action_return_error   (GUPnPServiceAction *action,
                                                         guint error_code,
                                                         const char *error_description);
void                gupnp_service_notify                (GUPnPService *service,
                                                         ...);
void                gupnp_service_notify_valist         (GUPnPService *service,
                                                         va_list var_args);
void                gupnp_service_notify_value          (GUPnPService *service,
                                                         const char *variable,
                                                         const GValue *value);
void                gupnp_service_freeze_notify         (GUPnPService *service);
void                gupnp_service_thaw_notify           (GUPnPService *service);


Description

GUPnPService allows for handling incoming actions and state variable notification. GUPnPService implements the GUPnPServiceInfo interface.

Details

GUPnPServiceAction

typedef struct _GUPnPServiceAction GUPnPServiceAction;

Opaque structure for holding in-progress action data.


GUPnPService

typedef struct {
        GUPnPServiceInfo parent;

        GUPnPServicePrivate *priv;
} GUPnPService;


gupnp_service_action_get_name ()

const char*         gupnp_service_action_get_name       (GUPnPServiceAction *action);

action : A GUPnPServiceAction
Returns : The name of action

gupnp_service_action_get_locales ()

GList*              gupnp_service_action_get_locales    (GUPnPServiceAction *action);

action : A GUPnPServiceAction
Returns : An ordered (preferred first) GList of locales preferred by the client. Free list and elements after use.

gupnp_service_action_get ()

void                gupnp_service_action_get            (GUPnPServiceAction *action,
                                                         ...);

Retrieves the specified action arguments.

action : A GUPnPServiceAction
... : tuples of argument name, argument type, and argument value location, terminated with NULL.

gupnp_service_action_get_valist ()

void                gupnp_service_action_get_valist     (GUPnPServiceAction *action,
                                                         va_list var_args);

See gupnp_service_action_get(); this version takes a va_list for use by language bindings.

action : A GUPnPServiceAction
var_args : va_list of tuples of argument name, argument type, and argument value location.

gupnp_service_action_get_value ()

void                gupnp_service_action_get_value      (GUPnPServiceAction *action,
                                                         const char *argument,
                                                         GValue *value);

Retrieves the value of argument into value.

action : A GUPnPServiceAction
argument : The name of the argument to retrieve
value : The GValue to store the value of the argument, initialized to the correct type.

gupnp_service_action_set ()

void                gupnp_service_action_set            (GUPnPServiceAction *action,
                                                         ...);

Sets the specified action return values.

action : A GUPnPServiceAction
... : tuples of return value name, return value type, and actual return value, terminated with NULL.

gupnp_service_action_set_valist ()

void                gupnp_service_action_set_valist     (GUPnPServiceAction *action,
                                                         va_list var_args);

See gupnp_service_action_set(); this version takes a va_list for use by language bindings.

action : A GUPnPServiceAction
var_args : va_list of tuples of return value name, return value type, and actual return value.

gupnp_service_action_set_value ()

void                gupnp_service_action_set_value      (GUPnPServiceAction *action,
                                                         const char *argument,
                                                         const GValue *value);

Sets the value of argument to value.

action : A GUPnPServiceAction
argument : The name of the return value to retrieve
value : The GValue to store the return value

gupnp_service_action_return ()

void                gupnp_service_action_return         (GUPnPServiceAction *action);

Return succesfully.

action : A GUPnPServiceAction

gupnp_service_action_return_error ()

void                gupnp_service_action_return_error   (GUPnPServiceAction *action,
                                                         guint error_code,
                                                         const char *error_description);

Return error_code.

action : A GUPnPServiceAction
error_code : The error code
error_description : The error description, or NULL if error_code is one of GUPNP_CONTROL_ERROR_INVALID_ACTION, GUPNP_CONTROL_ERROR_INVALID_ARGS, GUPNP_CONTROL_ERROR_OUT_OF_SYNC or GUPNP_CONTROL_ERROR_ACTION_FAILED, in which case a description is provided automatically.

gupnp_service_notify ()

void                gupnp_service_notify                (GUPnPService *service,
                                                         ...);

Notifies listening clients that the properties listed in Varargs have changed to the specified values.

service : A GUPnPService
... : Tuples of variable name, variable type, and variable value, terminated with NULL.

gupnp_service_notify_valist ()

void                gupnp_service_notify_valist         (GUPnPService *service,
                                                         va_list var_args);

See gupnp_service_notify_valist(); this version takes a va_list for use by language bindings.

service : A GUPnPService
var_args : A va_list of tuples of variable name, variable type, and variable value, terminated with NULL.

gupnp_service_notify_value ()

void                gupnp_service_notify_value          (GUPnPService *service,
                                                         const char *variable,
                                                         const GValue *value);

Notifies listening clients that variable has changed to value.

service : A GUPnPService
variable : The name of the variable to notify
value : The value of the variable

gupnp_service_freeze_notify ()

void                gupnp_service_freeze_notify         (GUPnPService *service);

Causes new notifications to be queued up until gupnp_service_thaw_notify() is called.

service : A GUPnPService

gupnp_service_thaw_notify ()

void                gupnp_service_thaw_notify           (GUPnPService *service);

Sends out any pending notifications, and stops queuing of new ones.

service : A GUPnPService