MGE General C Library - API Documentation
v1.3.5
Library of general C functions.
|
Message processing functions. More...
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include "internal.h"
#include <mge-errno.h>
#include <mgebuffer.h>
#include <mgememory.h>
#include <mgemessage.h>
Functions | |
struct mgemessage * | pull_msg (struct mgebuffer *buf, struct mgemessage *msg) |
Pull a message from a buffer object. More... | |
void | clear_msg (struct mgemessage *msg, const char terminator, const char separator) |
Clear message struct. More... | |
void | print_msg (struct mgemessage *msg) |
Print a message struct. More... | |
void | print_def_msg_values (void) |
Print default values to stdout, for debugging. More... | |
Variables | |
static int | args |
Number of arguments in the message. More... | |
Message processing functions.
All message handling support functions.
Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0
void clear_msg | ( | struct mgemessage * | msg, |
const char | terminator, | ||
const char | separator | ||
) |
Clear message struct.
Free memory allocated to the object and initialise the fields.
msg | A message object to clear. |
terminator | The message delimitter to use. |
separator | The message element delimitter to use. |
void print_def_msg_values | ( | void | ) |
Print default values to stdout, for debugging.
void print_msg | ( | struct mgemessage * | msg | ) |
Print a message struct.
Useful for debugging.
msg | The message object to print to stdout. |
struct mgemessage* pull_msg | ( | struct mgebuffer * | buf, |
struct mgemessage * | msg | ||
) |
Pull a message from a buffer object.
On error NULL is returned and mge_errno is set.
buf | A buffer object. |
msg | A message object. |
|
static |
Number of arguments in the message.