Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to extract a string from a pointer. #4595

Open
locallycompact opened this issue Nov 22, 2018 · 0 comments
Open

Trying to extract a string from a pointer. #4595

locallycompact opened this issue Nov 22, 2018 · 0 comments

Comments

@locallycompact
Copy link
Contributor

locallycompact commented Nov 22, 2018

Hi, I'm really confused as to how to just pull a String out from a double pointer. I'm trying to bind the libpcap interface here: http://www.tcpdump.org/manpages/pcap_next_ex.3pcap.html

The FFI seems to succeed, the Ptr is filled, but fails trying to turn it into a String.

Steps to Reproduce

Use the code here: https://gitlab.com/locallycompact/pcap-idris

nix-shell -p gnumake -p gmp -p libpcap -p glibc
stack exec --nix-packages libpcap  --resolver lts-11.14 -- idris --cg-opt '-D_GNU_SOURCE' --package contrib pcap.idr -o pcap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant