|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
Cross-platform path manipulation with normalization and Windows/Unix separator handling. More...
Go to the source code of this file.
Functions | |
| const char * | extract_project_relative_path (const char *file) |
| char * | expand_path (const char *path) |
| char * | get_config_dir (void) |
| char * | get_data_dir (void) |
| char * | get_log_dir (void) |
| char * | get_discovery_database_dir (void) |
| bool | path_normalize_copy (const char *path, char *out, size_t out_len) |
| bool | path_is_absolute (const char *path) |
| bool | path_is_within_base (const char *path, const char *base) |
| bool | path_is_within_any_base (const char *path, const char *const *bases, size_t base_count) |
| bool | path_looks_like_path (const char *value) |
| asciichat_error_t | path_validate_user_path (const char *input, path_role_t role, char **normalized_out) |
Cross-platform path manipulation with normalization and Windows/Unix separator handling.
Definition in file path.c.
| char * expand_path | ( | const char * | path | ) |
Definition at line 471 of file path.c.
References platform_get_home_dir(), platform_normalize_path_separators(), platform_strdup(), and safe_snprintf().
Referenced by config_create_default(), config_load_and_apply(), detect_default_ssh_key(), and path_validate_user_path().
| const char * extract_project_relative_path | ( | const char * | file | ) |
Definition at line 410 of file path.c.
Referenced by asciichat_fatal_with_context(), asciichat_print_error_context(), log_json_async_safe(), log_json_write(), and log_template_apply().
| char * get_config_dir | ( | void | ) |
Definition at line 493 of file path.c.
References platform_get_config_dir().
Referenced by acds_main(), config_load_and_apply(), discovery_keys_get_cache_path(), get_known_hosts_path(), options_init(), and path_validate_user_path().
| char * get_data_dir | ( | void | ) |
Definition at line 498 of file path.c.
References platform_get_data_dir().
Referenced by get_discovery_database_dir().
| char * get_discovery_database_dir | ( | void | ) |
Definition at line 581 of file path.c.
References get_data_dir(), platform_access(), platform_getenv(), platform_mkdir_recursive(), and safe_snprintf().
Referenced by options_init().
| char * get_log_dir | ( | void | ) |
Definition at line 503 of file path.c.
References platform_access(), platform_get_cwd(), platform_get_temp_dir(), PLATFORM_MAX_PATH_LENGTH, and safe_snprintf().
| bool path_is_absolute | ( | const char * | path | ) |
Definition at line 696 of file path.c.
Referenced by path_is_within_base(), and path_validate_user_path().
| bool path_is_within_any_base | ( | const char * | path, |
| const char *const * | bases, | ||
| size_t | base_count | ||
| ) |
Definition at line 748 of file path.c.
References path_is_within_base().
Referenced by path_validate_user_path().
| bool path_is_within_base | ( | const char * | path, |
| const char * | base | ||
| ) |
Definition at line 714 of file path.c.
References path_is_absolute(), path_normalize_copy(), PLATFORM_MAX_PATH_LENGTH, and platform_path_strcasecmp().
Referenced by path_is_within_any_base().
| bool path_looks_like_path | ( | const char * | value | ) |
Definition at line 766 of file path.c.
Referenced by parse_keys_from_file(), parse_public_key(), parse_public_keys(), path_validate_user_path(), and validate_ssh_key_file().
| bool path_normalize_copy | ( | const char * | path, |
| char * | out, | ||
| size_t | out_len | ||
| ) |
Definition at line 676 of file path.c.
Referenced by path_is_within_base(), and path_validate_user_path().
| asciichat_error_t path_validate_user_path | ( | const char * | input, |
| path_role_t | role, | ||
| char ** | normalized_out | ||
| ) |
Definition at line 974 of file path.c.
References expand_path(), get_config_dir(), path_is_absolute(), path_is_within_any_base(), path_looks_like_path(), path_normalize_copy(), platform_get_cwd(), platform_get_home_dir(), platform_get_temp_dir(), platform_getenv(), platform_is_regular_file(), PLATFORM_MAX_PATH_LENGTH, safe_snprintf(), and true.
Referenced by config_create_default(), config_load_and_apply(), parse_keys_from_file(), parse_log_file(), parse_private_key(), parse_public_key(), and validate_ssh_key_file().