File containing the definition of the allocs functionalities.
More...
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "./attributes.h"
Go to the source code of this file.
|
#define | os_malloc(s) malloc((s)) |
|
#define | os_realloc(p, s) realloc((p), (s)) |
|
#define | os_calloc(nm, s) calloc((nm), (s)) |
|
#define | os_free(p) free((p)) |
|
#define | os_memcpy(d, s, n) memcpy((d), (s), (n)) |
|
#define | os_memmove(d, s, n) memmove((d), (s), (n)) |
|
#define | os_memset(s, c, n) memset(s, c, (n)) |
|
#define | os_memcmp(s1, s2, n) memcmp((s1), (s2), (n)) |
|
File containing the definition of the allocs functionalities.
- Author
- Alexandru Mereacre
- Date
- 2020
- Copyright
- SPDX-FileCopyrightText: © 2020 NQMCyber Ltd and edgesec contributors SPDX-License-Identifier: LGPL-3.0-or-later
◆ os_calloc
#define os_calloc |
( |
|
nm, |
|
|
|
s |
|
) |
| calloc((nm), (s)) |
◆ os_free
#define os_free |
( |
|
p | ) |
free((p)) |
◆ os_malloc
#define os_malloc |
( |
|
s | ) |
malloc((s)) |
◆ os_memcmp
#define os_memcmp |
( |
|
s1, |
|
|
|
s2, |
|
|
|
n |
|
) |
| memcmp((s1), (s2), (n)) |
◆ os_memcpy
#define os_memcpy |
( |
|
d, |
|
|
|
s, |
|
|
|
n |
|
) |
| memcpy((d), (s), (n)) |
◆ os_memmove
#define os_memmove |
( |
|
d, |
|
|
|
s, |
|
|
|
n |
|
) |
| memmove((d), (s), (n)) |
◆ os_memset
#define os_memset |
( |
|
s, |
|
|
|
c, |
|
|
|
n |
|
) |
| memset(s, c, (n)) |
◆ os_realloc
#define os_realloc |
( |
|
p, |
|
|
|
s |
|
) |
| realloc((p), (s)) |
◆ os_strdup()
- Parameters
-
- Returns
- char* The dublicate string pointer, NULL on error