main/xutil.h

Mon, 15 Jun 2020 13:38:46 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 15 Jun 2020 13:38:46 +0200
changeset 60
07a1a07fdc8c
parent 18
d969e0fe05dc
permissions
-rw-r--r--

write_units now overwrites instead of truncate/write the records. Add ssid to the node mqtt message. Lower rotary log messages. Removed most menu log messages.

/**
 * @file xutil.h
 * @brief In memory string manipulation.
 */


#ifndef XUTIL_H
#define	XUTIL_H

/**
 * @brief Safe memory allocation. Abort if not enough.
 * @param size The amount of memory to allocate.
 * @return A pointer to the allocated memory.
 */
char *xmalloc(size_t size);

/**
 * @brief Copy string in memory.
 * @param src The source string to copy.
 * @return A pointer to the string with the copied string.
 */
char *xstrcpy(char *src);

/**
 * @brief Add data to a string in memory.
 * @param src The original string.
 * @param add The string to append to src.
 * @return A pointer to the combined string.
 */
char *xstrcat(char *src, char *add);

#endif

mercurial