|
libcfe
0.12.1
some useful C-functions
|
#include "config.h"#include "msgqueue.h"#include <stdlib.h>#include <string.h>#include <errno.h>#include <unistd.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/msg.h>#include <libintl.h>#include "len.h"#include "output.h"Go to the source code of this file.
Data Structures | |
| struct | mymsgbuf_t |
Macros | |
| #define | MSGMAX 8192 |
Functions | |
| int | send_message (int qid, int type, char *msg, int len, short flag) |
| int | receive_message (int qid, int type, char **msg) |
| int | remove_queue (int qid) |
| int | create_queue (void) |
| #define MSGMAX 8192 |
Definition at line 16 of file msgqueue.c.
| int create_queue | ( | void | ) |
Create a new message queue.
Definition at line 116 of file msgqueue.c.
| int receive_message | ( | int | qid, |
| int | type, | ||
| char ** | msg | ||
| ) |
Receive a message from a message queue.
| [in] | qid | The message queue to send the message to. |
| [in] | type | Type of message, must be > 0. |
| [in,out] | msg | NULL pointer, afterwards this points to the received message. |
Definition at line 86 of file msgqueue.c.
| int remove_queue | ( | int | qid | ) |
Destroy a message queue.
| [in] | qid | The message queue to destroy. |
Definition at line 106 of file msgqueue.c.
| int send_message | ( | int | qid, |
| int | type, | ||
| char * | msg, | ||
| int | len, | ||
| short | flag | ||
| ) |
function to call to send a message
| [in] | qid | The message queue to send the message to. |
| [in] | type | Type of message, must be > 0. |
| [in] | msg | Pointer to a string containing the actual text (terminating character is not required). |
| [in] | len | Number of characters to copy from 'msg' to the message queue (when 'len' == 0 it copy up to the first '\0' character). |
| [in] | flag | Set to MSG_PRIORITY to indicate this as important message, otherwise use 0. |
Definition at line 24 of file msgqueue.c.