ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
path.h File Reference

📂 Path Manipulation Utilities More...

Go to the source code of this file.

Macros

#define PATH_COMPONENT_DOT   '.'
 Path component: current directory (single dot).
#define PATH_COMPONENT_DOTDOT   ".."
 Path component: parent directory (double dot).
#define PATH_TILDE   '~'
 Path component: home directory tilde.
#define PATH_DRIVE_SEPARATOR   ':'
 Path component: Windows drive separator (colon).
#define MAX_PATH_BASES   16
 Maximum number of path base directories.

Enumerations

enum  path_role_t {
  PATH_ROLE_CONFIG_FILE , PATH_ROLE_LOG_FILE , PATH_ROLE_KEY_PRIVATE , PATH_ROLE_KEY_PUBLIC ,
  PATH_ROLE_CLIENT_KEYS
}
 Classification for user-supplied filesystem paths. More...

Functions

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.
void path_cleanup_thread_locals (void)
 Cleanup thread-local path resources.

Detailed Description

📂 Path Manipulation Utilities

Definition in file path.h.