handle NULL text
This commit is contained in:
parent
07e2126e25
commit
3a7ae150b8
4 changed files with 20 additions and 6 deletions
|
|
@ -27,6 +27,7 @@ struct Book $C.mapname("book_t") {
|
|||
publish @6: Publish;
|
||||
nulldata @7: Nulldata;
|
||||
magic1 @2: List(UInt32) $C.mapname("magic_1") $C.maplistcount("n_magic1");
|
||||
description @8: Text;
|
||||
acquire :union $C.mapuniontag("acquire_method") {
|
||||
buy @3: Text;
|
||||
donation @4: Text;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ typedef struct {
|
|||
nulldata_t *nulldata;
|
||||
int n_magic1;
|
||||
uint32_t *magic_1;
|
||||
char *description;
|
||||
int acquire_method;
|
||||
union {
|
||||
char *buy;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ int encode() {
|
|||
book.nulldata = NULL;
|
||||
book.n_magic1 = 2;
|
||||
book.magic_1 = &magic1[0];
|
||||
book.description = NULL;
|
||||
book.acquire_method = Book_acquire_buy;
|
||||
book.acquire.buy = "bought from Xinhua book store";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue