ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
system.c File Reference

🔧 Shared cross-platform system utilities (safe string functions, etc.) More...

Go to the source code of this file.

Data Structures

struct  bin_cache_entry_t
 Cache entry for binary PATH lookup. More...
 

Macros

#define PLATFORM_SYSTEM_C
 
#define BIN_SUFFIX   ""
 
#define PLATFORM_MAX_PATH_LENGTH   4096
 

Functions

bool check_binary_in_path_uncached (const char *bin_name)
 
int safe_snprintf (char *buffer, size_t buffer_size, const char *format,...)
 Safe formatted string printing to buffer.
 
int safe_fprintf (FILE *stream, const char *format,...)
 Safe formatted output to file stream.
 
int safe_vsnprintf (char *buffer, size_t buffer_size, const char *format, va_list ap)
 Safe formatted string printing with va_list.
 
size_t platform_write_all (int fd, const void *buf, size_t count)
 Write all bytes to a file descriptor, handling partial writes.
 

Detailed Description

🔧 Shared cross-platform system utilities (safe string functions, etc.)

Definition in file system.c.

Macro Definition Documentation

◆ BIN_SUFFIX

#define BIN_SUFFIX   ""

Definition at line 30 of file system.c.

◆ 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 69 of file system.c.

◆ PLATFORM_SYSTEM_C

#define PLATFORM_SYSTEM_C

Definition at line 8 of file system.c.

Function Documentation

◆ check_binary_in_path_uncached()

bool check_binary_in_path_uncached ( const char *  bin_name)
extern