You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a library that requires me to use the FILE struct for simple I/O operation. For non-standard struct, I have constructed a class and inherited the FFI:Struct. How do I deal with standard library structure definitions? Are there any inbuilt shortcuts within the library?
Inside FILE.h
#ifndef__FILE_defined#define__FILE_defined 1
struct_IO_FILE;
/* The opaque type of streams. This is the definition used elsewhere. */typedefstruct_IO_FILEFILE;
#endif
Inside struct_FILE.h
...
struct_IO_FILE
{
int_flags; /* High-order word is _IO_MAGIC; rest is flags. *//* The following pointers correspond to the C++ streambuf protocol. */char*_IO_read_ptr; /* Current read pointer */char*_IO_read_end; /* End of get area. */char*_IO_read_base; /* Start of putback+get area. */char*_IO_write_base; /* Start of put area. */char*_IO_write_ptr; /* Current put pointer. */char*_IO_write_end; /* End of put area. */char*_IO_buf_base; /* Start of reserve area. */char*_IO_buf_end; /* End of reserve area. *//* The following fields are used to support backing up and undo. */char*_IO_save_base; /* Pointer to start of non-current get area. */char*_IO_backup_base; /* Pointer to first valid character of backup area */char*_IO_save_end; /* Pointer to end of non-current get area. */struct_IO_marker*_markers;
struct_IO_FILE*_chain;
int_fileno;
int_flags2;
__off_t_old_offset; /* This used to be _offset but it's too small. *//* 1+column number of pbase(); 0 is unknown. */unsigned short_cur_column;
signed char_vtable_offset;
char_shortbuf[1];
_IO_lock_t*_lock;
#ifdef_IO_USE_OLD_IO_FILE
};
struct_IO_FILE_complete
{
struct_IO_FILE_file;
#endif
__off64_t _offset;
/* Wide character stream stuff. */struct_IO_codecvt*_codecvt;
struct_IO_wide_data*_wide_data;
struct_IO_FILE*_freeres_list;
void*_freeres_buf;
size_t__pad5;
int_mode;
/* Make sure we don't get into trouble again. */char_unused2[15*sizeof (int) -4*sizeof (void*) -sizeof (size_t)];
};
...
I am using a library that requires me to use the
FILE
struct for simple I/O operation. For non-standard struct, I have constructed a class and inherited theFFI:Struct
. How do I deal with standard library structure definitions? Are there any inbuilt shortcuts within the library?Inside FILE.h
Inside struct_FILE.h
Sample function using
FILE
as parameterThe text was updated successfully, but these errors were encountered: