Main Page   Modules   Data Structures   File List   Data Fields   Examples  

String Table
[Section Headers]


Functions

ELF_SPEC_HEADERmelf_stringTableCreate (MELF *melf, const char *name)
unsigned long melf_stringTableSetString (MELF *melf, ELF_SPEC_HEADER *stringTable, const char *name)
const char * melf_stringTableGetString (MELF *melf, ELF_SPEC_HEADER *stringTable, unsigned long index)

Function Documentation

ELF_SPEC_HEADER* melf_stringTableCreate MELF   melf,
const char *    name
 

Creates a new string table section with the specified name. If the name is NULL, the name for the new section will not be set.

Parameters:
melf [in] The melf context.
name [in] The name of the string table. This can be NULL.
Returns:
On success an initialized string table section header is returned. Otherwise, NULL is returned.

const char* melf_stringTableGetString MELF   melf,
ELF_SPEC_HEADER   stringTable,
unsigned long    index
 

Gets the string value at the specified index in the string table.

Parameters:
melf [in] The melf context.
stringTable [in] The string table to operate on.
index [in] The index to get the string at.
Returns:
A pointer to a valid string on success, otherwise NULL.

unsigned long melf_stringTableSetString MELF   melf,
ELF_SPEC_HEADER   stringTable,
const char *    name
 

Sets a string in the string table. If the name exists in the string table its index will be re-used. Otherwise, it is appended to the end.

Parameters:
melf [in] The melf context.
stringTable [in] The string table to operate on.
name [in] The name to set.
Returns:
The index to the name in the string table content.
Examples:
new.c.


Generated on Sat Feb 22 18:36:57 2003 for libmelf by doxygen1.3-rc3