mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +01:00
tools/generate-wire.py: simplify printwire routines, fix ... handling.
We make them return bool, and always use names `cursor` and `plen` in callers, for simplicity. Also, `...` means "loop until finished" not "loop this many bytes". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -9,18 +9,18 @@
|
||||
${i}
|
||||
% endfor
|
||||
|
||||
void print${options.enum_name}_message(const u8 *msg);
|
||||
bool print${options.enum_name}_message(const u8 *msg);
|
||||
|
||||
void print${options.enum_name}_tlv_message(const char *tlv_name, const u8 *msg);
|
||||
bool print${options.enum_name}_tlv_message(const char *tlv_name, const u8 *msg);
|
||||
|
||||
% for msg in messages:
|
||||
void printwire_${msg.name}(const char *fieldname, const u8 *cursor);
|
||||
bool printwire_${msg.name}(const char *fieldname, const u8 *cursor);
|
||||
|
||||
% endfor
|
||||
|
||||
% if options.expose_subtypes:
|
||||
% for subtype in subtypes:
|
||||
void printwire_${subtype.name}(const char *fieldname, const u8 **cursor, size_t *plen);
|
||||
bool printwire_${subtype.name}(const char *fieldname, const u8 **cursor, size_t *plen);
|
||||
% endfor
|
||||
% endif
|
||||
#endif /* LIGHTNING_${idem} */
|
||||
|
||||
Reference in New Issue
Block a user