# rc-file to read binary data produced by following C structs: # #struct product #{ # uint8_t record_id; # unsigned int product_id; # char name[10]; # unsigned int amount; #}; # #struct customer #{ # uint8_t record_id; # unsigned int customer_id; # char name[20]; # char address[30]; # double balance; #}; # # Fields seems to be aligned to 4 bytes, so records must have FILLER fields in plase where compiler has added # aligment bytes. # # Records are distinguished by first byte (record_id). Product has value 1 and customer value 2. structure bin_data { type binary record product { id 1 \x01 field record_id uint8 field FILLER 3 field product_id uint field name 10 field FILLER 2 field amount uint } record customer { id 1 \x02 field record_id uint8 field FILLER 3 field customer_id uint field name 20 field address 30 field FILLER 2 field balance double } } output default { record_header "record %r\n" data "%n = %d\n" justify = indent " " }