|  | Home | Documentation | mq.c File Reference updated by Robert van Engelen |

Functions | Variables
mq.c File Reference
`#include "mq.h"`
Include dependency graph for mq.c:

## Functions

static int | soap_mq_init (struct soap *soap, struct soap_mq_data *data)
static void | soap_mq_delete (struct soap *soap, struct soap_plugin *p)
static size_t | soap_mq_recv (struct soap *soap, char *buf, size_t len)
static int | soap_mq_serveloop (struct soap *soap)
static void | soap_mq_set (struct soap_mq_msg *msg)
SOAP_FMAC1 int SOAP_FMAC2 | soap_mq (struct soap *soap, struct soap_plugin *p, void *arg)
SOAP_FMAC1 struct soap_mq_queue *SOAP_FMAC2 | soap_mq_queue (struct soap *soap)
| Create a new queue structure allocated in the current context. Will be deallocated with soap_end(soap). Use soap_mq_get() to receive a message from the current socket to add to the queue.
SOAP_FMAC1 struct soap_mq_msg *SOAP_FMAC2 | soap_mq_get (struct soap *soap, struct soap_mq_queue *mq)
| Receive message from socket and queue it at the end of the queue.
SOAP_FMAC1 struct soap_mq_msg *SOAP_FMAC2 | soap_mq_begin (struct soap_mq_queue *mq)
| Get first message in queue. Use msg->soap to invoke service from the queued message, as in soap_serve(&msg->soap).
SOAP_FMAC1 struct soap_mq_msg *SOAP_FMAC2 | soap_mq_next (struct soap_mq_msg *msg)
| Get next message in queue. Use msg->soap to invoke service from the queued message, as in soap_serve(&msg->soap).
SOAP_FMAC1 void SOAP_FMAC2 | soap_mq_del (struct soap_mq_queue *mq, struct soap_mq_msg *msg)
| Delete message from queue, e.g. after processing it. Delete entire queue when msg==NULL. Note: structures will be deallocated with deallocation with soap_end().

## Variables

const char | soap_mq_id [] = SOAP_MQ_ID

## Function Documentation

## ◆ soap_mq()

SOAP_FMAC1 int SOAP_FMAC2 soap_mq | ( | struct soap * | soap,
|  | struct soap_plugin * | p,
|  | void * | arg )

plugin registry function, invoked by soap_register_plugin

## ◆ soap_mq_begin()

SOAP_FMAC1 struct soap_mq_msg *SOAP_FMAC2 soap_mq_begin | ( | struct soap_mq_queue * | mq | ) |

Get first message in queue. Use msg->soap to invoke service from the queued message, as in soap_serve(&msg->soap).

Parameters

  mq | pointer to the message queue structure created by soap_mq_queue()

Returns
  pointer to first message in the queue, or NULL

## ◆ soap_mq_del()

SOAP_FMAC1 void SOAP_FMAC2 soap_mq_del | ( | struct soap_mq_queue * | mq,
|  | struct soap_mq_msg * | msg )

Delete message from queue, e.g. after processing it. Delete entire queue when msg==NULL. Note: structures will be deallocated with deallocation with soap_end().

Parameters

  mq | pointer to the queue structure
  msg | pointer to a message in the queue, when NULL delete entire queue

## ◆ soap_mq_delete()

void soap_mq_delete | ( | struct soap * | soap,
|  | struct soap_plugin * | p )

static

## ◆ soap_mq_get()

SOAP_FMAC1 struct soap_mq_msg *SOAP_FMAC2 soap_mq_get | ( | struct soap * | soap,
|  | struct soap_mq_queue * | mq )

Receive message from socket and queue it at the end of the queue.

Parameters

  soap | current context
  mq | pointer to the message queue structure created by soap_mq_queue()

Returns
  pointer to the message received and queued, or NULL

## ◆ soap_mq_init()

int soap_mq_init | ( | struct soap * | soap,
|  | struct soap_mq_data * | data )

static

## ◆ soap_mq_next()

SOAP_FMAC1 struct soap_mq_msg *SOAP_FMAC2 soap_mq_next | ( | struct soap_mq_msg * | msg | ) |

Get next message in queue. Use msg->soap to invoke service from the queued message, as in soap_serve(&msg->soap).

Parameters

  msg | pointer to current message in the queue

Returns
  pointer to next message in the queue, or NULL

## ◆ soap_mq_queue()

SOAP_FMAC1 struct soap_mq_queue *SOAP_FMAC2 soap_mq_queue | ( | struct soap * | soap | ) |

Create a new queue structure allocated in the current context. Will be deallocated with soap_end(soap). Use soap_mq_get() to receive a message from the current socket to add to the queue.

Parameters

  soap | current context

Returns
  pointer to the queue structure

## ◆ soap_mq_recv()

size_t soap_mq_recv | ( | struct soap * | soap,
|  | char * | buf,
|  | size_t | len )

static

## ◆ soap_mq_serveloop()

int soap_mq_serveloop | ( | struct soap * | soap | ) |

static

## ◆ soap_mq_set()

void soap_mq_set | ( | struct soap_mq_msg * | msg | ) |

static

## Variable Documentation

## ◆ soap_mq_id

const char soap_mq_id[] = SOAP_MQ_ID