OCRudoku
v1.0
Resolve word grid with ease
|
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <err.h>
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. | |
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.
first_path | The first part of the file path as a null-terminated string. |
second_path | The second part of the file path as a null-terminated string. |
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.
file_path | The directory path to create as a null-terminated string. |
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.
path | The input file path as a null-terminated string. |