ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
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)
 Extract relative path from an absolute 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_log_dir (void)
 Get log directory path appropriate for current build type.
 
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

📂 Path Manipulation Utilities

Definition in file path.h.