ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
path.c File Reference

Cross-platform path manipulation with normalization and Windows/Unix separator handling. More...

Go to the source code of this file.

Macros

#define UTIL_PATH_BUFFER_BUFFER_SIZE   256
#define PATH_COMPONENT_BUFFER_SIZE   256

Functions

void path_cleanup_thread_locals (void)
 Cleanup thread-local path resources.
const char * extract_project_relative_path (const char *file, const char *const *owned_dirs)
 Extract a path relative to the source root embedded by CMake.
const char * path_last_components (const char *path, size_t component_count)
 Return a pointer to the last components of a path.
char * expand_path (const char *path)
 Expand path with tilde (~) support.
char * get_config_dir (void)
 Get configuration directory path with XDG_CONFIG_HOME support.
char * get_data_dir (void)
 Get application data directory path.
char * get_log_dir (void)
 Get log directory path appropriate for current build type.
char * get_discovery_database_dir (void)
 Get discovery service database directory with Homebrew-aware system-wide fallback.
bool path_normalize_copy (const char *path, char *out, size_t out_len)
 Normalize a path and copy it into the provided buffer.
bool path_is_absolute (const char *path)
 Determine whether a path is absolute on the current platform.
bool path_is_within_base (const char *path, const char *base)
 Check whether a path resides within a specified base directory.
bool path_is_within_any_base (const char *path, const char *const *bases, size_t base_count)
 Check whether a path resides within any of several base directories.
bool path_looks_like_path (const char *value)
 Determine if a string is likely intended to reference the filesystem.
asciichat_error_t path_validate_user_path (const char *input, path_role_t role, char **normalized_out)
 Validate and canonicalize a user-supplied filesystem path.

Detailed Description

Cross-platform path manipulation with normalization and Windows/Unix separator handling.

Definition in file path.c.

Macro Definition Documentation

◆ PATH_COMPONENT_BUFFER_SIZE

#define PATH_COMPONENT_BUFFER_SIZE   256

Definition at line 11 of file path.c.

◆ UTIL_PATH_BUFFER_BUFFER_SIZE

#define UTIL_PATH_BUFFER_BUFFER_SIZE   256

Definition at line 8 of file path.c.