Commit 453274b5 authored by Adam Wujek's avatar Adam Wujek

tools/wrpc-dump: add dump_type_dummy

Type used just to store offset of a field in a structure
Signed-off-by: 's avatarAdam Wujek <adam.wujek@creotech.pl>
parent 3587f76d
......@@ -44,6 +44,7 @@ enum dump_type {
dump_type_TimeInterval,
dump_type_RelativeDifference,
dump_type_FixedDelta,
dump_type_dummy,
/* and this is ours */
dump_type_yes_no,
dump_type_yes_no_Boolean,
......@@ -76,6 +77,7 @@ typedef long long long_long;
typedef unsigned long unsigned_long;
typedef unsigned char unsigned_char;
typedef unsigned short unsigned_short;
typedef uint8_t dummy; /* use the smallest */
typedef struct {unsigned char addr[4];} ip_address;
typedef Boolean yes_no_Boolean;
typedef uint8_t yes_no;
......
......@@ -108,15 +108,23 @@ void dump_one_field(void *addr, struct dump_info *info, char *info_prefix)
char buf[128];
char *char_p;
/* now, info may be in wrong-endian. so fix it */
type = wrpc_get_i32(&info->type);
size = wrpc_get_i32(&info->size);
if (type == dump_type_dummy) {
/* dummy type used to store address of e.g. complex structure.
* It makes no point to print such address.*/
return;
}
if (info_prefix!=NULL )
sprintf(pname, "%s.%s", info_prefix, info->name);
else
strcpy(pname, info->name);
printf("%-60s ", pname); /* name includes trailing ':' */
/* now, info may be in wrong-endian. so fix it */
type = wrpc_get_i32(&info->type);
size = wrpc_get_i32(&info->size);
// printf("%3d|%2d|", wrpc_get_i32(&info->offset), size);
/* For some (mostly enum like types) the size may vary. Check the size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment