GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
Functions
gp_user_path.h File Reference

Utility functions for building paths. More...

#include <utils/gp_path.h>

Go to the source code of this file.

Functions

char * gp_user_path (const char *path, const char *file_name)
 Prepares a buffer with a path.
 
int gp_user_mkpath (const char *path, enum gp_mkpath_flags flags)
 Creates a path, if it does not exists.
 

Detailed Description

Utility functions for building paths.

Definition in file gp_user_path.h.

Function Documentation

◆ gp_user_mkpath()

int gp_user_mkpath ( const char *  path,
enum gp_mkpath_flags  flags 
)

Creates a path, if it does not exists.

The path is constructed in "$HOME/$PATH/".

Works exactly the same as 'mkdir -p'.

Parameters
pathA path, one or more directories.
Returns
Zero on success, non-zero otherwise and errno is set.

◆ gp_user_path()

char * gp_user_path ( const char *  path,
const char *  file_name 
)

Prepares a buffer with a path.

The path is constructed as "$HOME/$PATH/$FILE_NAME".

Parameters
pathA path, one or more directories.
file_nameA file name.
Returns
A newly allocated buffer with path or NULL in a case of a failure.