F
fl
Hi,
I am programming my routine with a commerical software product. I want
to make the software standalone. Thus, I want to understand the
interface definition, see below in the end.
"number_array" is the union? Then, I can see only one constitute of
this union, a struct. According to the union definition, there should
have several options for a union. What is the problem? Because this C
part is from Matlab matrix.h file, I do not think it is an error.
My second question is about the "} data" line. What is data for? It is
the name of union?
Thanks a lot, please explain it to me if you could.
union {
struct {
void *pdata;
void *pimag_data;
void *reserved5;
int reserved6[3];
} number_array;
} data;
...............................
struct mxArray_tag0 {
void *reserved;
int reserved1[2];
void *reserved2;
int number_of_dims;
unsigned int reserved3;
struct {
unsigned int scalar_flag : 1;
unsigned int flag1 : 1;
unsigned int flag2 : 1;
unsigned int flag3 : 1;
unsigned int flag4 : 1;
unsigned int flag5 : 1;
unsigned int flag6 : 1;
unsigned int flag7 : 1;
unsigned int private_data_flag : 1;
unsigned int flag8 : 1;
unsigned int flag9 : 1;
unsigned int flag10 : 1;
unsigned int flag11 : 4;
unsigned int flag12 : 8;
unsigned int flag13 : 8;
} flags;
unsigned int reserved4[2];
union {
struct {
void *pdata;
void *pimag_data;
void *reserved5;
int reserved6[3];
} number_array;
} data;
};
I am programming my routine with a commerical software product. I want
to make the software standalone. Thus, I want to understand the
interface definition, see below in the end.
"number_array" is the union? Then, I can see only one constitute of
this union, a struct. According to the union definition, there should
have several options for a union. What is the problem? Because this C
part is from Matlab matrix.h file, I do not think it is an error.
My second question is about the "} data" line. What is data for? It is
the name of union?
Thanks a lot, please explain it to me if you could.
union {
struct {
void *pdata;
void *pimag_data;
void *reserved5;
int reserved6[3];
} number_array;
} data;
...............................
struct mxArray_tag0 {
void *reserved;
int reserved1[2];
void *reserved2;
int number_of_dims;
unsigned int reserved3;
struct {
unsigned int scalar_flag : 1;
unsigned int flag1 : 1;
unsigned int flag2 : 1;
unsigned int flag3 : 1;
unsigned int flag4 : 1;
unsigned int flag5 : 1;
unsigned int flag6 : 1;
unsigned int flag7 : 1;
unsigned int private_data_flag : 1;
unsigned int flag8 : 1;
unsigned int flag9 : 1;
unsigned int flag10 : 1;
unsigned int flag11 : 4;
unsigned int flag12 : 8;
unsigned int flag13 : 8;
} flags;
unsigned int reserved4[2];
union {
struct {
void *pdata;
void *pimag_data;
void *reserved5;
int reserved6[3];
} number_array;
} data;
};