ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
system.c File Reference

🔧 Shared cross-platform system utilities (included by posix/system.c and windows/system.c) More...

Go to the source code of this file.

Data Structures

struct  bin_cache_entry_t
 Binary PATH cache entry structure for binary detection caching. More...
 

Macros

#define HASH_FUNCTION(keyptr, keylen, hashv)
 
#define BIN_SUFFIX   ""
 
#define PLATFORM_MAX_PATH_LENGTH   4096
 

Functions

void platform_cleanup_binary_path_cache (void)
 Cleanup the binary PATH cache.
 
bool platform_is_binary_in_path (const char *bin_name)
 Check if a binary is available in the system PATH.
 
bool platform_get_executable_path (char *exe_path, size_t path_size)
 Get the path to the current executable.
 

Detailed Description

🔧 Shared cross-platform system utilities (included by posix/system.c and windows/system.c)

Definition in file system.c.

Macro Definition Documentation

◆ BIN_SUFFIX

#define BIN_SUFFIX   ""

Definition at line 33 of file system.c.

◆ HASH_FUNCTION

#define HASH_FUNCTION (   keyptr,
  keylen,
  hashv 
)
Value:
do { \
if (!(keyptr) || (keylen) == 0) { \
(hashv) = 1; /* Non-zero constant for safety */ \
} else { \
(hashv) = fnv1a_hash_bytes((keyptr), (keylen)); \
} \
} while (0)

Definition at line 17 of file system.c.

18 { \
19 if (!(keyptr) || (keylen) == 0) { \
20 (hashv) = 1; /* Non-zero constant for safety */ \
21 } else { \
22 (hashv) = fnv1a_hash_bytes((keyptr), (keylen)); \
23 } \
24 } while (0)

◆ PLATFORM_MAX_PATH_LENGTH

#define PLATFORM_MAX_PATH_LENGTH   4096

Maximum path length supported by the operating system

Platform-specific values:

  • Windows: 32767 characters (extended-length path with \?\ prefix)
  • Linux: 4096 bytes (PATH_MAX from limits.h)
  • macOS: 1024 bytes (PATH_MAX from sys/syslimits.h)

Note: Windows legacy MAX_PATH (260) is too restrictive for modern use. We use the extended-length limit instead.

Definition at line 72 of file system.c.