X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isamc%2Fisamc.c;h=44155d22c9cf06166a3b96fa4db1a9e2479aaf65;hb=801ef4b322574c793abdc1ba81dea2da62ca60bc;hp=9cd4471f04d577947a95491f2072e5c0154a246e;hpb=3c1fd34223220690747a11e43a2d5833a8e7e3f7;p=idzebra-moved-to-github.git diff --git a/isamc/isamc.c b/isamc/isamc.c index 9cd4471..44155d2 100644 --- a/isamc/isamc.c +++ b/isamc/isamc.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isamc.c,v $ - * Revision 1.10 1998-03-11 11:18:18 adam + * Revision 1.11 1998-03-13 15:30:50 adam + * New functions isc_block_used and isc_block_size. Fixed 'leak' + * in isc_alloc_block. + * + * Revision 1.10 1998/03/11 11:18:18 adam * Changed the isc_merge to take into account the mfill (minimum-fill). * * Revision 1.9 1998/03/06 13:54:02 adam @@ -68,9 +72,9 @@ ISAMC_M isc_getmethod (void) { 32, 28, 0, 3 }, { 64, 54, 30, 0 }, #else - { 32, 28, 20, 20 }, - { 512, 490, 340, 20 }, - { 4096, 3950, 3200, 20 }, + { 32, 28, 24, 20 }, + { 512, 490, 350, 20 }, + { 4096, 3950, 4200, 20 }, {32768, 32000, 30000, 0 }, #endif }; @@ -161,6 +165,21 @@ ISAMC isc_open (BFiles bfs, const char *name, int writeflag, ISAMC_M method) return is; } +int isc_block_used (ISAMC is, int type) +{ + if (type < 0 || type >= is->no_files) + return -1; + return is->files[type].head.lastblock-1; +} + +int isc_block_size (ISAMC is, int type) +{ + ISAMC_filecat filecat = is->method->filecat; + if (type < 0 || type >= is->no_files) + return -1; + return filecat[type].bsize; +} + int isc_close (ISAMC is) { int i; @@ -246,6 +265,7 @@ int isc_alloc_block (ISAMC is, int cat) if ((nb = is->files[cat].fc_list[j]) && (!block || nb < block)) { is->files[cat].fc_list[j] = 0; + block = nb; break; } }