Main index | Section 3 | Options |
#include <libelftc.h>
Function elftc_string_table_create() creates a new, empty string table. The argument sizehint provides a hint about the expected number of bytes of string data in the table. If the argument sizehint is zero, an implementation-defined default will be used instead.
Function elftc_string_table_destroy() destroys the previously allocated string table specified by argument table, and frees the internal resources allocated for it.
Function elftc_string_table_from_section() creates a new string table and initializes it based on the contents of the section specified by argument scn. This section must be of type SHT_STRTAB. The argument sizehint provides a hint about expected number of bytes of string data in the table. If the value of sizehint is zero, an implementation-default will be used instead.
Function elftc_string_table_image() returns a pointer to the ELF representation of the contents of the string table specified by argument table. If argument size is not NULL, the size of the ELF representation of the string table is stored in the location pointed to by argument size. The function elftc_string_table_image() will compact the string table if the table contains deleted strings. The string offsets returned by prior calls to elftc_string_table_insert() and elftc_string_table_lookup() should be treated as invalid after a call to this function.
Function elftc_string_table_insert() inserts the NUL-terminated string pointed to by argument string into the string table specified by argument table, and returns an offset value usable in ELF data structures. Multiple insertions of the same content will return the same offset. The offset returned will remain valid until the next call to elftc_string_table_image().
Function elftc_string_table_lookup() looks up the string referenced by argument string in the string table specified by argument table, and if found, returns the offset associated with the string. The returned offset will be valid until the next call to elftc_string_table_image().
Function elftc_string_table_remove() removes the string pointed by argument string from the string table referenced by argument table, if it is present in the string table.
Function elftc_string_table_to_string() returns a pointer to the NUL-terminated string residing at argument offset in the string table specified by argument table. The value of argument offset should be one returned by a prior call to elftc_string_table_insert() or elftc_string_table_lookup(). The returned pointer will remain valid until the next call to elftc_string_table_insert() or elftc_string_table_image().
The functions elftc_string_table_insert(), elftc_string_table_lookup(), elftc_string_table_remove() and elftc_string_table_to_string() have O(1) asymptotic behavior. The function elftc_string_table_image() can have O(size) asymptotic behavior, where size denotes the size of the string table.
The function elftc_string_table_image() returns a pointer to an in-memory representation of an ELF string table on success, or NULL in case of an error.
Functions elftc_string_table_insert() and elftc_string_table_lookup() return a non-zero offset on success, or zero in case of an error.
Function elftc_string_table_remove() returns a positive value on success, or zero in case of an error.
Function elftc_string_table_to_string() returns a valid pointer on success, or NULL in case of an error.
ELFTC_STRING_TABLE_CREATE (3) | June 27, 2019 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.