Can you explain the IoMethod and IoFile from the os.h ???
 
 I see the follwing in the code...
 
 #if OS_UNIX
 #define sqlite3OsOpenReadWrite      sqlite3UnixOpenReadWrite
 .
 #endif
 #if OS_WIN
 #define sqlite3OsOpenReadWrite      sqlite3WinOpenReadWrite
 #if OS_OS2
 #define sqlite3OsOpenReadWrite      sqlite3Os2OpenReadWrite
 
 etc... 
 followed by  IoMethod and IoFile type and struct delcarations. I understand 
the the defines are used as subtitutions in the pre processor for calls. 
 
 int sqlite3OsOpenReadWrite(const char*, OsFile**, int*);  --- Really becomes 
an instance of one of the above specific calls such as :  
sqlite3UnixOpenReadWrite
 
 My questions is why are the pointers stored in IxMethod ??? Since really the 
ifdefs above define the various interfaces to the operating system specific 
calls. why keep reference pointers to the functions inside of IxMethod ??? 
 
 I'm building an interface into os system calls such as open/fopen read/fread 
and i'd like to  be able to have the calling code dynamically set up which 
interace to use, so I'm trying to get  a handle on the above code as a 
roadmap...
 
 Thanks,
 Ken
 
 
 

Reply via email to