#ifndef _DATASOURCE_H_ #define _DATASOURCE_H_ #ifdef __cplusplus extern "C" { #endif /* open a virtual file for read, return the ID for the virtual file */ int sopen_rd(); /* open a virtual file for write, return the ID for the virtual file */ int sopen_wt(); /* read n bytes from virtual file ID and store them in buf buf must be allocated enough space for n bytes return number of bytes read */ int sread( void* buf, int n, int ID ); /* write n bytes from buf to file ID return number of bytes written */ int swrite( void* buf, int n, int ID ); #ifdef __cplusplus } #endif #endif