Skip to content
DirEntryInitCopy

DirEntryInitCopy

Description

Initialize a copy of a directory entry. Copies type and deep-copies name (the destination owns the new Str buffer through src->name’s allocator).

Parameters

Name Direction Description
dst out Uninitialised entry receiving the copy.
src in Source entry.

Success

Returns dst with type set and name deep-copied; the new name buffer is owned by the same allocator that backed src->name.

Failure

Aborts via LOG_FATAL if either pointer is NULL.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    DirEntry *DirEntryInitCopy(DirEntry *dst, const DirEntry *src) {
        if (!dst || !src) {
            LOG_FATAL("Invalid arguments");
Last updated on