Interation with GMainLoop

Interation with GMainLoop — How to integrate SpreadRPC library with a normal GLib application

Synopsis

gboolean            (*SPRpcGlibCallback)                (SPRpcGlibSource *source,
                                                         SPRpcStatus status,
                                                         gpointer user_data);
typedef             SPRpcGlibSource;
GSource*            sp_rpc_glib_source                  (SPRpc *rpc);

Description

How to integrate SpreadRPC library with a normal GLib application

Details

SPRpcGlibCallback ()

gboolean            (*SPRpcGlibCallback)                (SPRpcGlibSource *source,
                                                         SPRpcStatus status,
                                                         gpointer user_data);

The callback for the error message of the SPRpc GSource

source :

the SPRpcGlibSource

status :

the status, always != SP_RCP_STATUS_DONE

user_data :

user data

Returns :

it should return FALSE if the source should be removed

SPRpcGlibSource

typedef struct sp_rpc_glib_source_t SPRpcGlibSource;

The GSource for the SPRpc library


sp_rpc_glib_source ()

GSource*            sp_rpc_glib_source                  (SPRpc *rpc);

Creates a valid GSource for a GMainContext. It permits to work with a GLib main loop and to receive error message trough the callback.

rpc :

a SPRpc

Returns :

a GSource