mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
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:
committed by
Søren Sandmann Pedersen
parent
b569c3a34c
commit
54862afc74
32
binparser.c
32
binparser.c
@ -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 *
|
||||
|
||||
Reference in New Issue
Block a user