首页 新闻 会员 周边

怎么调用特殊定义的结构体

0
悬赏园豆:40 [待解决问题]
#define        A_SEQUENCE_OF(type)        A_SET_OF(type)

#define        A_SET_OF(type)                                        \
        struct {                                        \
                type **array;                                \
                int count;        /* Meaningful size */        \
                int size;        /* Allocated size */        \
                void (*free)(type *);                        \
        }

typedef struct IntersectionStateList {
        A_SEQUENCE_OF(struct IntersectionState) list;
} IntersectionStateList_t;

typedef struct IntersectionState {
        NodeReferenceID_t         intersectionId;
        IntersectionStatusObject_t         status;
        MinuteOfTheYear_t        *moy        /* OPTIONAL */;
        DSecond_t        *timeStamp        /* OPTIONAL */;
        PhaseList_t         phases;
IntersectionState_t;

typedef struct SPAT {
        MsgCount_t         msgCnt;
        MinuteOfTheYear_t        *timeStamp        /* OPTIONAL */;
        DescriptiveName_t        *name        /* OPTIONAL */;
        IntersectionStateList_t         intersections;
} SPAT_t;        

我想使用SPAT_t结构体,但是当中的成员intersections的定义让我很困惑,不知道怎么调用A_SEQUENCE_OF?求大家支招。
张熙12的主页 张熙12 | 初学一级 | 园豆:80
提问于:2017-10-20 10:30
< >
分享
所有回答(1)
1

类似这样吗?不知道"调用A_SEQUENCE_OF"是指什么,define只是简单的字符串替换。

SPAT_t t1;
t1.intersections.list.size=3;
hehe_54321 | 园豆:750 (小虾三级) | 2017-10-20 18:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册