EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Macros | Functions
allocs.h File Reference

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"
Include dependency graph for allocs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#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))
 

Functions

__must_free char * os_strdup (const char *s)
 

Detailed Description

File containing the definition of the allocs functionalities.

Author
Alexandru Mereacre
Date
2020

Macro Definition Documentation

◆ os_calloc

#define os_calloc (   nm,
 
)    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,
 
)    memcmp((s1), (s2), (n))

◆ os_memcpy

#define os_memcpy (   d,
  s,
 
)    memcpy((d), (s), (n))

◆ os_memmove

#define os_memmove (   d,
  s,
 
)    memmove((d), (s), (n))

◆ os_memset

#define os_memset (   s,
  c,
 
)    memset(s, c, (n))

◆ os_realloc

#define os_realloc (   p,
 
)    realloc((p), (s))

Function Documentation

◆ os_strdup()

__must_free char* os_strdup ( const char *  s)
Parameters
sThe input string
Returns
char* The dublicate string pointer, NULL on error