mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
wire gen: add subtypes to printwires
now we print the subtypes out when you call printwire note that we have to reverse the order the subtypes appear in because 1) they're static and, 2) a few of them are nested
This commit is contained in:
committed by
Rusty Russell
parent
51438cef21
commit
88786b8f7a
@@ -1480,12 +1480,16 @@ includes = '\n'.join(includes)
|
||||
printcases = ['case {enum.name}: printf("{enum.name}:\\n"); printwire_{name}("{name}", msg); return;'.format(enum=m.enum, name=m.name) for m in toplevel_messages]
|
||||
|
||||
if options.printwire:
|
||||
decls = [m.print_printwire(options.header) for m in toplevel_messages + messages_with_option]
|
||||
decls = []
|
||||
if not options.header:
|
||||
subtype_decls = [m.print_printwire(options.header, is_embedded=True) for m in subtypes]
|
||||
subtype_decls.reverse()
|
||||
decls += subtype_decls
|
||||
if len(tlv_fields):
|
||||
decls += print_tlv_printwires(options.enumname, tlv_fields)
|
||||
else:
|
||||
decls += [print_tlv_message_printwire_empty.format(enumname=options.enumname)]
|
||||
decls += [m.print_printwire(options.header) for m in toplevel_messages + messages_with_option]
|
||||
else:
|
||||
towire_decls = []
|
||||
fromwire_decls = []
|
||||
|
||||
Reference in New Issue
Block a user