I'm working on Nim glue to a C API that uses `struct iovec` a lot as a 
parameter type — a generic (pointer, length) tuple indicating a range of memory 
to read or write.

IIRC, a Nim `openarray[uint8]` is passed the same way as an `iovec`: as the 
address of the first byte, then the length. So if I changed the `iovec` 
parameters in the bridged C declarations to `openarray[uint8]`, to make them 
easier for me to use, would that work? And just as importantly, is this 
something that can be counted on to work in the future, either because it's 
official or because too many projects do it already?

Or is there an even better way to do it?

—Jens

Reply via email to