lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Maybe even "typedef struct FILE FILE" should be enough...

There should be no reason for one to wants "struct _IO_FILE" from luajit ffi, or even from normal "C". Too bad "C" has to expose it's internals every once in a while...

But either one works.

On 11/20/11 3:01 PM, Francesco Abbate wrote:
2011/11/20 PooshhMao<>:
However when I try to run your example I get the error: declaration
specifier expected near 'FILE'

Sorry, I forgot that you need to add in ffi.cdef the following declarations:

       struct _IO_FILE;
       typedef struct _IO_FILE FILE;

Actually I didn't notice the problem because I tested the script in
GSL Shell where they are already declared.