First question, have you tried hard enough to use tools like c2nim or similar?
It helps getting some types correct.
>From last line of your message
var filename_len:uint32
Run
I have the feeling that is input data to the function, so try to set it to your
buffer size.
char filename_inzip[256];
Run
The above is misleading -- C can not pass strings as value arrays, so C passes
always pointers to functions. An array is automatically passed as a pointer to
that array in C. So Nim's cstring is right from type, but you have to
initialize it. Maybe
buf = array[256, char]
filename_inzip: cstring = addr(buf)
Run
But note, the above array lives on the stack. If that parameter have to exists
after the proc returns, then you must allocate it on heap with low level new
equivalents like alloc(). But I think there exist more elegant functions to
initialize cstrings.
For the size types, try to use Nim's c types, like cint, culong. Because in C
size(int) may be 4 bytes, but may be different. Depends on 32/64 bit OS or
embedded devices.