Luma 0.1.0
A low-level compiled alternative to C, C++, and more!
Loading...
Searching...
No Matches
Functions
std_path.c File Reference
#include "std_path.h"
Include dependency graph for std_path.c:

Functions

bool file_exists (const char *path)
 Check if a file exists at the given path.
 
const char * normalize_std_import (const char *path)
 Normalize a path by removing "std/" prefix if present.
 
bool get_system_std_path (char *buffer, size_t buffer_size)
 Get the system-wide Luma standard library path.
 
bool get_user_std_path (char *buffer, size_t buffer_size)
 Get the user-local Luma standard library path.
 
bool resolve_std_path (const char *import_path, char *buffer, size_t buffer_size)
 Resolve a std/ import path to an actual file path.
 
void print_std_search_paths (void)
 

Function Documentation

◆ file_exists()

bool file_exists ( const char *  path)

Check if a file exists at the given path.

Parameters
pathPath to check
Returns
true if file exists, false otherwise

◆ get_system_std_path()

bool get_system_std_path ( char *  buffer,
size_t  buffer_size 
)

Get the system-wide Luma standard library path.

Parameters
bufferBuffer to store the path
buffer_sizeSize of the buffer
Returns
true if successful, false otherwise

◆ get_user_std_path()

bool get_user_std_path ( char *  buffer,
size_t  buffer_size 
)

Get the user-local Luma standard library path.

Parameters
bufferBuffer to store the path
buffer_sizeSize of the buffer
Returns
true if successful, false otherwise

◆ normalize_std_import()

const char * normalize_std_import ( const char *  path)

Normalize a path by removing "std/" prefix if present.

Parameters
pathThe input path
Returns
Pointer to the normalized path (within the input string)

◆ print_std_search_paths()

void print_std_search_paths ( void  )

◆ resolve_std_path()

bool resolve_std_path ( const char *  import_path,
char *  buffer,
size_t  buffer_size 
)

Resolve a std/ import path to an actual file path.

Parameters
import_pathThe import path (e.g., "std/io" or "std/math")
bufferBuffer to store the resolved path
buffer_sizeSize of the buffer
Returns
true if the path was resolved successfully, false otherwise