LFX Mentorship 2023
Macros | Functions
baseutil.h File Reference

Basic functions for the whole project. More...

#include <stdbool.h>
Include dependency graph for baseutil.h:

Go to the source code of this file.

Macros

#define _BOLD_RED   "\033[1m\033[31m"
 
#define _RESET_COLOR   "\033[0m"
 
#define _ERROR_SIG   _BOLD_RED "ERROR => " _RESET_COLOR
 
#define _SUCCESS   true
 
#define _FAILED   false
 
#define _NOT_FOUND   -1
 

Functions

bool is_null_ptr (const void *ptr, const char *func_name)
 Check if the pointer is a null pointer. More...
 
bool is_file_exist (const char *fname)
 Check If file exists or not. More...
 

Detailed Description

Basic functions for the whole project.

Function Documentation

◆ is_file_exist()

bool is_file_exist ( const char *  fname)

Check If file exists or not.

Parameters
fnameis the file path.
Returns
If exists, return true. If not, return false.

◆ is_null_ptr()

bool is_null_ptr ( const void *  ptr,
const char *  func_name 
)

Check if the pointer is a null pointer.

Parameters
ptrthe pointer to check is null or not.
func_nameUse func to identify which function found a null pointer.
Returns
If is null pointer, return true. If not, return false.