Veritable Lasagna
An Allocator & Data Structure Library for C.
Loading...
Searching...
No Matches
vl_filesys.c File Reference
#include "vl_filesys.h"
#include <string.h>
+ Include dependency graph for vl_filesys.c:

Functions

void vlFSInit (vl_filesys *sys)
 Initializes a filesystem context.
 
void vlFSFree (vl_filesys *sys)
 Frees resources associated with a filesystem context.
 
vl_filesysvlFSNew (void)
 Creates a new filesystem context.
 
void vlFSDelete (vl_filesys *sys)
 Deletes a filesystem context created with vlFSNew.
 
vl_filesys_statvlFSStatNew (vl_filesys *sys)
 Creates a new file stat object.
 
void vlFSStatDelete (vl_filesys_stat *stat)
 Deletes a file stat object.
 
vl_filesys_pathvlFSPathNew (vl_filesys *sys, const char *pathStr)
 Creates a new filesystem path object.
 
void vlFSPathDelete (vl_filesys_path *path)
 Deletes a filesystem path object.
 
vl_filesys_pathvlFSPathClone (const vl_filesys_path *src, vl_filesys_path *dest)
 Clones a filesystem path.
 
vl_bool_t vlFSPathEquals (const vl_filesys_path *pathA, const vl_filesys_path *pathB)
 Compares two filesystem paths for equality.
 
void vlFSPathSet (vl_filesys_path *path, const char *pathStr)
 Sets the path string for a filesystem path object.
 
const vl_transientvlFSPathString (const vl_filesys_path *path)
 Gets the string representation of a filesystem path.
 
void vlFSPathJoin (const vl_filesys_path *base, vl_filesys_path *dest, const char *component)
 Joins a path component to a base path.
 
void vlFSPathNormalize (vl_filesys_path *path)
 Normalizes a filesystem path by resolving relative components.
 
void vlFSPathParent (const vl_filesys_path *path, vl_filesys_path *parentOut)
 Gets the parent directory of a filesystem path.
 

Function Documentation

◆ vlFSDelete()

void vlFSDelete ( vl_filesys sys)

Deletes a filesystem context created with vlFSNew.

Parameters
sysPointer to the filesystem context to delete
+ Here is the call graph for this function:

◆ vlFSFree()

void vlFSFree ( vl_filesys sys)

Frees resources associated with a filesystem context.

Parameters
sysPointer to the filesystem context to free
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSInit()

void vlFSInit ( vl_filesys sys)

Initializes a filesystem context.

Parameters
sysPointer to the filesystem context to initialize
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSNew()

vl_filesys * vlFSNew ( void  )

Creates a new filesystem context.

Returns
Pointer to the newly created filesystem context
+ Here is the call graph for this function:

◆ vlFSPathClone()

vl_filesys_path * vlFSPathClone ( const vl_filesys_path src,
vl_filesys_path dest 
)

Clones a filesystem path.

Parameters
srcSource path to clone
[out]destDestination path object
Returns
Pointer to the cloned path object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSPathDelete()

void vlFSPathDelete ( vl_filesys_path path)

Deletes a filesystem path object.

Parameters
pathPointer to the path object to delete
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSPathEquals()

vl_bool_t vlFSPathEquals ( const vl_filesys_path pathA,
const vl_filesys_path pathB 
)

Compares two filesystem paths for equality.

Parameters
pathAFirst path to compare
pathBSecond path to compare
Returns
True if paths are equal, false otherwise
+ Here is the call graph for this function:

◆ vlFSPathJoin()

void vlFSPathJoin ( const vl_filesys_path base,
vl_filesys_path dest,
const char *  component 
)

Joins a path component to a base path.

Parameters
baseBase path to join to
[out]destDestination path object for the result
componentPath component to join
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSPathNew()

vl_filesys_path * vlFSPathNew ( vl_filesys sys,
const char *  path 
)

Creates a new filesystem path object.

Parameters
sysPointer to the filesystem context
pathString representation of the path
Returns
Pointer to the newly created path object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSPathNormalize()

void vlFSPathNormalize ( vl_filesys_path path)

Normalizes a filesystem path by resolving relative components.

This function will normalize the given path with native file path separators.

Parameters
pathPointer to the path object to normalize
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSPathParent()

void vlFSPathParent ( const vl_filesys_path path,
vl_filesys_path parentOut 
)

Gets the parent directory of a filesystem path.

Parameters
pathInput path
[out]parentOutPointer to store the parent path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSPathSet()

void vlFSPathSet ( vl_filesys_path path,
const char *  pathStr 
)

Sets the path string for a filesystem path object.

Parameters
pathPointer to the path object
pathStrString representation of the new path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSPathString()

const vl_transient * vlFSPathString ( const vl_filesys_path path)

Gets the string representation of a filesystem path.

Parameters
pathPointer to the path object
Returns
Pointer to the path string
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlFSStatDelete()

void vlFSStatDelete ( vl_filesys_stat stat)

Deletes a file stat object.

Parameters
statPointer to the stat object to delete
+ Here is the call graph for this function:

◆ vlFSStatNew()

vl_filesys_stat * vlFSStatNew ( vl_filesys sys)

Creates a new file stat object.

Parameters
sysPointer to the filesystem context
Returns
Pointer to the newly created stat object
+ Here is the call graph for this function: