Main Page   Modules   Data Structures   File List   Data Fields   Examples  

String Table
[Section Headers]


Functions

ELF_SPEC_HEADERmelf_stringTableCreate (MELF *melf, const char *name)
void melf_stringTableInitializeEntryList (MELF *melf, ELF_SPEC_HEADER *sect)
void melf_stringTableSynchronizeEntryList (MELF *melf, ELF_SPEC_HEADER *sect)
unsigned long melf_stringTableSetString (MELF *melf, ELF_SPEC_HEADER *stringTable, const char *name)
unsigned long melf_stringTableGetStringIndex (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_stringTableGetStringIndex MELF   melf,
ELF_SPEC_HEADER   stringTable,
const char *    name
 

Gets the index of a given string in the string table. If the index cannot be found, -1 will be returned.

Parameters:
melf  [in] The melf context.
stringTable  [in] The string table to operate on.
name  [in] The name of the index being searched for.
Returns:
The index to the name of the string table content, or -1 on failure.

void melf_stringTableInitializeEntryList MELF   melf,
ELF_SPEC_HEADER   sect
 

Initializes the entry list for the given section. It is not recommended that this function be called directly.

Parameters:
melf  [in] The melf context.
sect  [in] The section that is being operated on.

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. If the operation fails, -1 is returned.

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, or -1 on failure.
Examples:
new.c.

void melf_stringTableSynchronizeEntryList MELF   melf,
ELF_SPEC_HEADER   sect
 

Synchronizes the entry list for the given section. It is not recommended that this function be called directly.

Parameters:
melf  [in] The melf context.
sect  [in] The section that is being operated on.


Generated on Tue May 4 00:14:34 2004 for libmelf by doxygen1.2.15