LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
Functions
Named client information

Associate borrowed payloads with copied names on a TIFF handle. More...

Collaboration diagram for Named client information:

Functions

void * TIFFGetClientInfo (TIFF *tif, const char *name)
 Look up a borrowed payload by its handle-local name.
 
void TIFFSetClientInfo (TIFF *tif, void *data, const char *name)
 Add or replace a handle-local named borrowed payload.
 

Detailed Description

Associate borrowed payloads with copied names on a TIFF handle.

Function Documentation

◆ TIFFGetClientInfo()

void * TIFFGetClientInfo ( TIFF *  tif,
const char *  name 
)
extern

Look up a borrowed payload by its handle-local name.

Uses case-sensitive strcmp() matching without allocation, I/O, mutation, or diagnostics. Does not transfer ownership or extend payload lifetime. A later replacement changes the association, and handle cleanup releases only names/nodes, not payloads. This list is independent of TIFFClientdata().

Parameters
[in]tifNon-NULL live TIFF handle.
[in]nameNon-NULL null-terminated lookup name.
Returns
The stored pointer, or NULL if absent or if the stored payload is NULL; these cases are not distinguished.

Definition at line 69 of file tif_extension.c.

References client_info::data, client_info::name, client_info::next, and tiff::tif_clientinfo.

◆ TIFFSetClientInfo()

void TIFFSetClientInfo ( TIFF *  tif,
void *  data,
const char *  name 
)
extern

Add or replace a handle-local named borrowed payload.

For an existing case-sensitive name, stores data without allocation or freeing the old payload. A new entry allocates a node and copied name through checked handle allocators. If either allocation fails, emits allocation diagnostics, frees any partially allocated node, and leaves the list unchanged; the void API supplies no status.

The caller retains ownership of both old and new payloads and must keep the active one alive while it can be used. Passing NULL stores a NULL association rather than removing it. TIFFCleanup()/TIFFClose() release the copied name and node but not the payload. No file I/O or retention of the input name pointer occurs.

Parameters
[in,out]tifNon-NULL live TIFF handle.
[in]dataBorrowed payload pointer, possibly NULL.
[in]nameNon-NULL null-terminated association name; copied for a new entry.

Definition at line 83 of file tif_extension.c.

References _TIFFCheckMalloc(), _TIFFfreeExt(), _TIFFmemcpy(), client_info::data, client_info::name, client_info::next, and tiff::tif_clientinfo.

Here is the call graph for this function: