Menu

How to access each item of SEQUENCE OF in c programming?

Help
2017-01-13
2017-01-13
  • Kevin Zhang

    Kevin Zhang - 2017-01-13

    asn definition is :
    MonitorData ::= SEQUENCE OF MonitorDataItem

    compile it and get following c struct

    typedef struct MonitorData {
    A_SEQUENCE_OF(struct MonitorDataItem) list;

    /* Context for parsing across buffer boundaries */
    asn_struct_ctx_t _asn_ctx;
    

    } MonitorData_t;
    MonitorData_t mt;

    how to access each MonitorDataItem in mt? use array?
    I tried mt.list[0] but gcc compiler complained : "subscripted value is neither array nor pointer nor vector", I read the asn_SET_OF.h, asn_anonymous_set_ *?? ...but I can't make it clear, can someone help me?

     
  • Kevin Zhang

    Kevin Zhang - 2017-01-13

    forgive my silly, i know now!fdfjk
    #define A_SET_OF(type) \ struct { \ type array; \ int count; / Meaningful size / \ int size; / Allocated size / \ void (free)(type ); \ }

     

Log in to post a comment.