MGE General C Library - API Documentation v1.8.4
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 "internal.h"
#include <libmgec/libmgec.h>
#include <libmgec/mge-buffer.h>
#include <libmgec/mge-errno.h>
#include <libmgec/mge-memory.h>
#include <libmgec/mge-message.h>
Functions | |
struct mgemessage * | pull_msg (struct mgebuffer *buf, struct mgemessage *msg) |
Pull a message from a buffer object. | |
void | clear_msg (struct mgemessage *msg, const char terminator, const char separator) |
Clear message struct. | |
void | print_msg (struct mgemessage *msg) |
Print a message struct. | |
void | print_def_msg_values (void) |
Print default values to stdout, for debugging. | |
Variables | |
static int | args |
Number of arguments in the message. | |
Message processing functions.
All message handling support functions.
Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0-only
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.