Add new struct BinRecord. Comment out functions related to formats. Add

2006-08-26  Soren Sandmann <sandmann@daimi.au.dk>

	* binparser.[ch]: Add new struct BinRecord. Comment out functions
	related to formats. Add new functions to get fields out of
	BinRecords.

	* elfparser.c: Update to new API.
This commit is contained in:
Soren Sandmann
2006-08-26 22:44:12 +00:00
committed by Søren Sandmann Pedersen
parent b569c3a34c
commit 54862afc74
4 changed files with 90 additions and 52 deletions

View File

@ -338,6 +338,32 @@ bin_parser_index (BinParser *parser,
parser->frame->index = index;
}
BinParser *
bin_record_get_parser (BinRecord *record)
{
return record->parser;
}
const gchar *
bin_record_get_string_indirect (BinRecord *record,
const char *name,
gsize str_table)
{
BinParser *parser = record->parser;
const char *result = NULL;
gsize index;
index = bin_record_get_uint (record, name);
bin_parser_begin (parser, record->format, str_table + index);
result = bin_parser_get_string (parser);
bin_parser_end (record->parser);
return result;
}
gsize
bin_parser_get_offset (BinParser *parser)
{
@ -410,6 +436,12 @@ bin_record_index (BinRecord *record,
record->index = index;
}
gsize
bin_record_get_offset (BinRecord *record)
{
return record->offset;
}
/* Fields */
BinField *