comparison lshlib.h @ 648:4b79043f90ba

hack lshlib into happiness with mingw _locking() for file locking; hardcode pagesize as 64k; use lseek()/read()-write()/lseek() and buffers to emulate mmap(). I haven't actually tested all this lshlib functionality, but with this change I can build an audioDB.dll which works well enough to be linked into a binary which seems to work under Wine.
author mas01cr
date Tue, 13 Oct 2009 20:17:06 +0000
parents 9119f2fa3efe
children 9bd13c7819ae
comparison
equal deleted inserted replaced
647:7e7ba87b5466 648:4b79043f90ba
265 // LSH serial data structure file handling 265 // LSH serial data structure file handling
266 void get_lock(int fd, bool exclusive); 266 void get_lock(int fd, bool exclusive);
267 void release_lock(int fd); 267 void release_lock(int fd);
268 int serial_create(char* filename, Uns32T FMT); 268 int serial_create(char* filename, Uns32T FMT);
269 int serial_create(char* filename, float binWidth, Uns32T nTables, Uns32T nRows, Uns32T nCols, Uns32T k, Uns32T d, Uns32T FMT); 269 int serial_create(char* filename, float binWidth, Uns32T nTables, Uns32T nRows, Uns32T nCols, Uns32T k, Uns32T d, Uns32T FMT);
270 char* serial_mmap(int dbfid, Uns32T sz, Uns32T w, off_t offset = 0);
271 void serial_munmap(char* db, Uns32T N);
272 int serial_open(char* filename,int writeFlag); 270 int serial_open(char* filename,int writeFlag);
273 void serial_close(int dbfid); 271 void serial_close(int dbfid);
274 272
275 // Function to write hashfunctions to disk 273 // Function to write hashfunctions to disk
276 int serialize_lsh_hashfunctions(int fid); 274 int serialize_lsh_hashfunctions(int fid);
306 // Helper functions 304 // Helper functions
307 void serial_print_header(Uns32T requestedFormat); 305 void serial_print_header(Uns32T requestedFormat);
308 float* get_serial_hashfunction_base(char* db); 306 float* get_serial_hashfunction_base(char* db);
309 SerialElementT* get_serial_hashtable_base(char* db); 307 SerialElementT* get_serial_hashtable_base(char* db);
310 Uns32T get_serial_hashtable_offset(); // Size of SerialHeader + HashFunctions 308 Uns32T get_serial_hashtable_offset(); // Size of SerialHeader + HashFunctions
311 SerialHeaderT* serial_get_header(char* db); 309 SerialHeaderT* serial_get_header(int fd);
310 void serial_write_header(int fd, SerialHeaderT *header);
311 void serial_get_table(int, int, void *, size_t);
312 void serial_write_table(int, int, void *, size_t);
312 SerialHeaderT* lshHeader; 313 SerialHeaderT* lshHeader;
313 314
314 // Core Retrieval/Inspections Functions 315 // Core Retrieval/Inspections Functions
315 void bucket_chain_point(bucket* p, Uns32T qpos); 316 void bucket_chain_point(bucket* p, Uns32T qpos);
316 void sbucket_chain_point(sbucket* p, Uns32T qpos); 317 void sbucket_chain_point(sbucket* p, Uns32T qpos);