Bpl has asked for the wisdom of the Perl Monks concerning the following question:
Do you know how I can import automatically a header defined struct into XS code without naming it?
example:How can I import automatically it in my XS file after including the SDR header? Should I define the various struct inside this struct?# 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; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Automatically Import XS struct
by syphilis (Archbishop) on Feb 03, 2021 at 14:12 UTC | |
|
Re^2: Automatically Import XS struct
by dave_the_m (Monsignor) on Feb 03, 2021 at 15:23 UTC | |
by stevieb (Canon) on Feb 03, 2021 at 15:58 UTC | |
by dave_the_m (Monsignor) on Feb 03, 2021 at 16:02 UTC | |
|
Re: Automatically Import XS struct
by dave_the_m (Monsignor) on Feb 03, 2021 at 13:56 UTC | |
by Bpl (Scribe) on Feb 03, 2021 at 14:04 UTC | |
by dave_the_m (Monsignor) on Feb 03, 2021 at 14:10 UTC | |
by Bpl (Scribe) on Feb 03, 2021 at 14:19 UTC | |
by ikegami (Patriarch) on Feb 04, 2021 at 19:52 UTC | |
|
Re: Automatically Import XS struct
by stevieb (Canon) on Feb 03, 2021 at 14:40 UTC |