metasepi / c2ats

generate ATS interface from C code
GNU General Public License v3.0
19 stars 0 forks source link

Support mutual struct #13

Closed master-q closed 8 years ago

master-q commented 8 years ago

Hongwei's advice is using dataview:

https://groups.google.com/forum/#!topic/ats-lang-users/H0JJ4bwLn6A

master-q commented 8 years ago

NetBSD code is also using bit field...

struct ieee_ext {
        u_int   ext_fracl:EXT_FRACLBITS;
        u_int   ext_frach:EXT_FRACHBITS;
#if 0
        u_int   ext_int:1;
#endif
        u_int   ext_exp:EXT_EXPBITS;
        u_int   ext_sign:1;
};
master-q commented 8 years ago

My plan is:

The dataview can be used at interface between C and ATS?

master-q commented 8 years ago

Ah, dataview is algebraic data type. It doesn't match C language struct...

master-q commented 8 years ago

Totally, I should use following policy to translate C interface into ATS sats file?

master-q commented 8 years ago

Fix it with typedef $extype_struct doesn't include at-view.