|
LibTIFF 4.7.2
TIFF library public API and implementation reference
|
Associate borrowed payloads with copied names on a TIFF handle. More...
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. | |
Associate borrowed payloads with copied names on a TIFF handle.
|
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().
| [in] | tif | Non-NULL live TIFF handle. |
| [in] | name | Non-NULL null-terminated lookup name. |
Definition at line 69 of file tif_extension.c.
References client_info::data, client_info::name, client_info::next, and tiff::tif_clientinfo.
|
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.
| [in,out] | tif | Non-NULL live TIFF handle. |
| [in] | data | Borrowed payload pointer, possibly NULL. |
| [in] | name | Non-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.