enhance to generate encode routine to be more robust to encode NULL

This commit is contained in:
Rongsong Shen 2025-04-27 17:23:50 +08:00
parent 3425f75440
commit 07e2126e25
4 changed files with 17 additions and 1 deletions

View file

@ -15,11 +15,17 @@ struct Publish $C.mapname("publish_t") {
isbn @0: UInt64;
year @1: UInt32;
}
struct Nulldata $C.mapname("nulldata_t") {
null @0: UInt32 $C.mapname("null_");
}
struct Book $C.mapname("book_t") {
title @0: Text;
authors @1: List(Text) $C.mapname("authors") $C.maplistcount("n_authors");
chapters @5: List(Chapter) $C.mapname("chapters_") $C.maplistcount("n_chapters");
publish @6: Publish;
nulldata @7: Nulldata;
magic1 @2: List(UInt32) $C.mapname("magic_1") $C.maplistcount("n_magic1");
acquire :union $C.mapuniontag("acquire_method") {
buy @3: Text;