ds 0.10.0
A C library to safely yet efficiently work with UTF-8–encoded, growable dynamic strings.
helpers.c File Reference

Implementation of helper constants and functions. More...

#include <stdbool.h>
#include <stddef.h>
#include "ds/helpers.h"
Include dependency graph for helpers.c:

Go to the source code of this file.

Functions

bool ds_helpers_is_null (void const *const ptr)
 Returns true if ptr is NULL. More...
 
bool ds_helpers_is_instance (void const *const ptr)
 Returns true if ptr is a valid non-NULL pointer. More...
 

Detailed Description

Implementation of helper constants and functions.

Author
Avinash Maddikonda (svass.nosp@m.saka.nosp@m.vi@gm.nosp@m.ail..nosp@m.com)
Since
0.2.0
Date
2023-07-25

Definition in file helpers.c.

Function Documentation

◆ ds_helpers_is_instance()

bool ds_helpers_is_instance ( void const *  ptr)

Returns true if ptr is a valid non-NULL pointer.

Parameters
ptrThe pointer to check.
Returns
true if ptr is a valid non-NULL pointer. false otherwise.

Examples

Basic usage:

int x = 0;
assert (ds_helpers_is_instance (&x));
bool ds_helpers_is_instance(void const *ptr)
Returns true if ptr is a valid non-NULL pointer.
Definition: helpers.c:19

Definition at line 19 of file helpers.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ds_helpers_is_null()

bool ds_helpers_is_null ( void const *  ptr)

Returns true if ptr is NULL.

Parameters
ptrThe pointer to check.
Returns
true if ptr is NULL, and false otherwise.

Examples

Basic usage:

assert (ds_helpers_is_null (NULL));
bool ds_helpers_is_null(void const *ptr)
Returns true if ptr is NULL.
Definition: helpers.c:13

Definition at line 13 of file helpers.c.

Here is the caller graph for this function: