test with nest union
This commit is contained in:
parent
dd65178724
commit
6c0fbc4bbd
3 changed files with 51 additions and 25 deletions
|
|
@ -6,36 +6,44 @@
|
|||
#include <string.h>
|
||||
|
||||
typedef struct {
|
||||
char *caption;
|
||||
int32_t start;
|
||||
int32_t end;
|
||||
char *caption;
|
||||
int32_t start;
|
||||
int32_t end;
|
||||
} chapter_t;
|
||||
|
||||
typedef struct {
|
||||
uint64_t isbn;
|
||||
uint32_t year;
|
||||
uint64_t isbn;
|
||||
uint32_t year;
|
||||
} publish_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int null_;
|
||||
int null_;
|
||||
} nulldata_t;
|
||||
|
||||
typedef struct {
|
||||
char *title;
|
||||
int n_authors;
|
||||
char **authors;
|
||||
int n_chapters;
|
||||
chapter_t **chapters_;
|
||||
publish_t *publish;
|
||||
nulldata_t *nulldata;
|
||||
int n_magic1;
|
||||
uint32_t *magic_1;
|
||||
char *description;
|
||||
int acquire_method;
|
||||
union {
|
||||
char *buy;
|
||||
char *donation;
|
||||
} acquire;
|
||||
char *from;
|
||||
int with_recipe;
|
||||
union {
|
||||
char *recipe_addr;
|
||||
} u;
|
||||
} buy_t;
|
||||
|
||||
typedef struct {
|
||||
char *title;
|
||||
int n_authors;
|
||||
char **authors;
|
||||
int n_chapters;
|
||||
chapter_t **chapters_;
|
||||
publish_t *publish;
|
||||
nulldata_t *nulldata;
|
||||
int n_magic1;
|
||||
uint32_t *magic_1;
|
||||
char *description;
|
||||
int acquire_method;
|
||||
union {
|
||||
buy_t *buy;
|
||||
char *donation;
|
||||
} acquire;
|
||||
} book_t;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue