OCRudoku  v1.0
Resolve word grid with ease
Loading...
Searching...
No Matches
ApplicationUtils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

char * path_get_directory (char *path)
 Extracts the directory part of a given file path.
 
char * combine_path (const char *first_path, const char *second_path)
 Combines two file paths into a single path.
 
void mkpath (const char *file_path)
 Creates a directory path.
 

Function Documentation

◆ combine_path()

char * combine_path ( const char * first_path,
const char * second_path )

Combines two file paths into a single path.

This function takes two file paths as input and concatenates them into a single path. If the first path does not end with a directory separator ('/' or '\'), one will be added between the two paths.

Parameters
first_pathThe first part of the file path as a null-terminated string.
second_pathThe second part of the file path as a null-terminated string.
Returns
A newly allocated string containing the combined file path. The caller is responsible for freeing the returned string.

◆ mkpath()

void mkpath ( const char * file_path)

Creates a directory path.

This function takes a file path as input and creates the directory structure specified by the path. It uses the system's mkdir command with the -p option to create any necessary parent directories.

Parameters
file_pathThe directory path to create as a null-terminated string.

◆ path_get_directory()

char * path_get_directory ( char * path)

Extracts the directory part of a given file path.

This function takes a file path as input and returns a new string containing only the directory part of the path. If the input path does not contain any directory separators ('/' or '\'), the original path is returned.

Parameters
pathThe input file path as a null-terminated string.
Returns
A newly allocated string containing the directory part of the path, or the original path if no directory separators are found. The caller is responsible for freeing the returned string.