#include <stdlib.h>
#include "libconfig.h"
Go to the source code of this file.
◆ ACFSYM
#define ACFSYM |
( |
|
__sym__ | ) |
__libacfutils_ ## __sym__ |
◆ API_EXPORT
◆ API_EXPORT_DATA
#define API_EXPORT_DATA extern |
◆ ARRAY_NUM_ELEM
#define ARRAY_NUM_ELEM |
( |
|
_array | ) |
(sizeof (_array) / sizeof (*(_array))) |
Given a fixed-size array, evaluates to the number of elements in the array. Useful for automatically determining the capacity of an array for functions which take a count-of-elements argument.
Definition at line 171 of file core.h.
◆ DEPRECATED_ATTR
◆ inline
◆ LACF_DESTROY
#define LACF_DESTROY |
( |
|
ptr | ) |
|
Value: do { \
if ((ptr) != NULL) { \
lacf_free((ptr)); \
(ptr) = NULL; \
} \
} while (0)
Calls lacf_free() on ptr
and also then sets the pointer to NULL
to force a null-pointer-dereference and hard crash if an attempt is made to use the pointer after the LACF_DESTROY
operation.
Definition at line 158 of file core.h.
◆ LACF_UNUSED
#define LACF_UNUSED |
( |
|
x | ) |
(void)(x) |
◆ NODISCARD
◆ NODISCARD_R
◆ PACKED_ATTR
Attribute which marks a structure as having a packed memory layout (i.e. the compiler isn't allowed to insert padding). Place at the start of a structure definition, e.g. PACKED_ATTR struct structName { ... };
Definition at line 97 of file core.h.
◆ restrict
◆ UNUSED
#define UNUSED |
( |
|
x | ) |
(void)(x) |
Attribute which stops a compiler from complaining when a variable isn't used.
Definition at line 103 of file core.h.
◆ UNUSED_ATTR
Attribute which marks a function as unused. This is designed to avoid warnings & errors from compiler code analyzers for unused static functions. Place this ahead of a function declaration or definition, to mark the function as purposely unused.
Definition at line 95 of file core.h.
◆ WARN_UNUSED_RES_ATTR
#define WARN_UNUSED_RES_ATTR |
Attribute which if used on a function, makes the compiler emit a warning if the return value of a function is ignored.
Definition at line 96 of file core.h.
◆ lacf_free()
void lacf_free |
( |
void * |
buf | ) |
|
Whenever libacfutils returns an allocated object (except for the safe_*alloc functions) that you must free, use lacf_free to do so. Otherwise you risk running into troubles with different allocators being used between compilers (thanks Windows!).
Definition at line 49 of file core.c.
◆ lacf_malloc()
void * lacf_malloc |
( |
size_t |
n | ) |
|
Allocates ‘n’ bytes of memory using libacfutils' allocator. This is mostly to complete the functionality of ‘lacf_free’. In general, you won't ever need to call this function.
Definition at line 37 of file core.c.
◆ libacfutils_version
const char* libacfutils_version |
|
extern |
A string holding the current build version of libacfutils. It's just a 7-character git revision number.
Definition at line 29 of file core.c.