|
Data Structures |
struct | mwService |
| A service is the recipient of sendOnCnl messages sent over channels marked with the corresponding service id. More...
|
Service Extension API |
These functions are for use by service implementations
|
void | mwService_init (struct mwService *service, struct mwSession *session, guint32 service_type) |
| Prepares a newly allocated service for use.
|
void | mwService_started (struct mwService *service) |
| Indicate that a service is started.
|
void | mwService_stopped (struct mwService *service) |
| Indicate that a service is stopped.
|
General Services API |
These functions provide unified access to the general functions of a client service, with some simple sanity-checking.
|
void | mwService_recvCreate (struct mwService *service, struct mwChannel *channel, struct mwMsgChannelCreate *msg) |
| Triggers the recv_create handler on the service.
|
void | mwService_recvAccept (struct mwService *service, struct mwChannel *channel, struct mwMsgChannelAccept *msg) |
| Triggers the recv_accept handler on the service.
|
void | mwService_recvDestroy (struct mwService *service, struct mwChannel *channel, struct mwMsgChannelDestroy *msg) |
| Triggers the recv_destroy handler on the service.
|
void | mwService_recv (struct mwService *service, struct mwChannel *channel, guint16 msg_type, struct mwOpaque *data) |
| Triggers the input handler on the service.
|
guint32 | mwService_getType (struct mwService *) |
const char * | mwService_getName (struct mwService *) |
const char * | mwService_getDesc (struct mwService *) |
mwSession * | mwService_getSession (struct mwService *service) |
enum mwServiceState | mwService_getState (struct mwService *service) |
void | mwService_start (struct mwService *service) |
| Triggers the start handler for the service.
|
void | mwService_stop (struct mwService *service) |
| Triggers the stop handler for the service.
|
void | mwService_free (struct mwService *service) |
| Frees memory used by a service.
|
void | mwService_setClientData (struct mwService *service, gpointer data, GDestroyNotify cleanup) |
| Associates client data with service.
|
gpointer | mwService_getClientData (struct mwService *service) |
| Reference associated client data.
|
void | mwService_removeClientData (struct mwService *service) |
| Removes client data from service.
|
Defines |
#define | MW_SERVICE(srv) ((struct mwService *) srv) |
| Casts a concrete service (such as mwServiceAware) into a mwService.
|
#define | MW_SERVICE_IS_STATE(srvc, state) (mwService_getState(MW_SERVICE(srvc)) == (state)) |
#define | MW_SERVICE_IS_STOPPED(srvc) MW_SERVICE_IS_STATE(srvc, mwServiceState_STOPPED) |
#define | MW_SERVICE_IS_STOPPING(srvc) MW_SERVICE_IS_STATE(srvc, mwServiceState_STOPPING) |
#define | MW_SERVICE_IS_STARTED(srvc) MW_SERVICE_IS_STATE(srvc, mwServiceState_STARTED) |
#define | MW_SERVICE_IS_STARTING(srvc) MW_SERVICE_IS_STATE(srvc, mwServiceState_STARTING) |
#define | MW_SERVICE_IS_LIVE(srvc) (MW_SERVICE_IS_STARTING(srvc) || MW_SERVICE_IS_STARTED(srvc)) |
| If a service is STARTING or STARTED, it's considered LIVE.
|
#define | MW_SERVICE_IS_DEAD(srvc) (MW_SERVICE_IS_STOPPING(srvc) || MW_SERVICE_IS_STOPPED(srvc)) |
| If a service is STOPPING or STOPPED, it's considered DEAD.
|
Typedefs |
typedef void(* | mwService_funcStart )(struct mwService *service) |
typedef void(* | mwService_funcStop )(struct mwService *service) |
typedef void(* | mwService_funcClear )(struct mwService *service) |
typedef const char *(* | mwService_funcGetName )(struct mwService *service) |
typedef const char *(* | mwService_funcGetDesc )(struct mwService *service) |
typedef void(* | mwService_funcRecvCreate )(struct mwService *service, struct mwChannel *channel, struct mwMsgChannelCreate *msg) |
typedef void(* | mwService_funcRecvAccept )(struct mwService *service, struct mwChannel *channel, struct mwMsgChannelAccept *msg) |
typedef void(* | mwService_funcRecvDestroy )(struct mwService *service, struct mwChannel *channel, struct mwMsgChannelDestroy *msg) |
typedef void(* | mwService_funcRecv )(struct mwService *service, struct mwChannel *channel, guint16 msg_type, struct mwOpaque *data) |
Enumerations |
enum | mwServiceState {
mwServiceState_STOPPED,
mwServiceState_STOPPING,
mwServiceState_STARTED,
mwServiceState_STARTING,
mwServiceState_ERROR,
mwServiceState_UNKNOWN
} |
| State-tracking for a service. More...
|