http://qs1969.pair.com?node_id=11127851

Bpl has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monkers,

Do you know how I can import automatically a header defined struct into XS code without naming it?

example:
# my struct is defined in SDR.h struct rtlsdr_dev { libusb_context *ctx; struct libusb_device_handle *devh; uint32_t xfer_buf_num; uint32_t xfer_buf_len; struct libusb_transfer **xfer; unsigned char **xfer_buf; rtlsdr_read_async_cb_t cb; void *cb_ctx; enum rtlsdr_async_status async_status; int async_cancel; int use_zerocopy; /* rtl demod context */ uint32_t rate; /* Hz */ uint32_t rtl_xtal; /* Hz */ int fir[FIR_LEN]; int direct_sampling; /* tuner context */ enum rtlsdr_tuner tuner_type; rtlsdr_tuner_iface_t *tuner; uint32_t tun_xtal; /* Hz */ uint32_t freq; /* Hz */ uint32_t bw; uint32_t offs_freq; /* Hz */ int corr; /* ppm */ int gain; /* tenth dB */ struct e4k_state e4k_s; struct r82xx_config r82xx_c; struct r82xx_priv r82xx_p; /* status */ int dev_lost; int driver_active; unsigned int xfer_errors; };
How can I import automatically it in my XS file after including the SDR header? Should I define the various struct inside this struct?
REGARDS