In the following function signature in C is:
    
    
    extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
                         unz_file_info64 *pfile_info,
                         char *szFileName,
                         uLong fileNameBufferSize,
                         void *extraField,
                         uLong extraFieldBufferSize,
                         char *szComment,
                         uLong commentBufferSize));
    
    Run

and it is used like this:
    
    
    char filename_inzip[256];
    unz_file_info64 file_info;
    uLong ratio=0;
    const char *string_method;
    char charCrypt=' ';
    err = 
unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
    
    Run

In Nim I have tried both the following:
    
    
    proc unzGetCurrentFileInfo64*( file:pointer,
                              pfile_info:unz_file_info64,
                              szFileName:array[256,char],   # char *szFileName,
                              fileNameBufferSize:uint32,     # uLong 
fileNameBufferSize,
                              extraField:pointer,          # void *extraField,
                              extraFieldBufferSize:uint32,  # uLong 
extraFieldBufferSize,
                              szComment:cstring,           # char *szComment,
                              commentBufferSize:uint32):int #uLong 
commentBufferSize));
    
    Run

and:
    
    
    #...
                               szFileName:cstring,   # char *szFileName,
    #...
    
    Run

But when I used the procedure like follows:
    
    
    var filename_inzip:array[256,char]  # or cstring
    var pfile_info = new(unz_file_info64)
    var filename_len:uint32
    error = 
unzGetCurrentFileInfo64(uf,pfile_info,filename_inzip,filename_len,nil,0,""  ,0)
    
    Run

the varible `filename_inzip` is empty. Any clue of what is wrong?

Reply via email to