X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=isamc%2Fisams.c;h=f9b5dbe011c07173ada3ed0bfb05b391e956835c;hb=3726bf6622da6a8b983bb4cbb7d654e84c3216d7;hp=d844198afaf81183d747684801cf6d32a131ef88;hpb=4415da5dbbba04e50d4524347486d60113ed569c;p=idzebra-moved-to-github.git diff --git a/isamc/isams.c b/isamc/isams.c index d844198..f9b5dbe 100644 --- a/isamc/isams.c +++ b/isamc/isams.c @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isams.c,v $ - * Revision 1.3 1999-05-20 12:57:18 adam + * Revision 1.5 1999-07-14 10:59:27 adam + * Changed functions isc_getmethod, isams_getmethod. + * Improved fatal error handling (such as missing EXPLAIN schema). + * + * Revision 1.4 1999/05/26 07:49:14 adam + * C++ compilation. + * + * Revision 1.3 1999/05/20 12:57:18 adam * Implemented TCL filter. Updated recctrl system. * * Revision 1.2 1999/05/15 14:35:48 adam @@ -50,10 +57,8 @@ struct ISAMS_PP_s { int numRead; }; -ISAMS_M isams_getmethod (void) +void isams_getmethod (ISAMS_M m) { - ISAMS_M m = xmalloc (sizeof(*m)); - m->code_start = NULL; m->code_item = NULL; m->code_stop = NULL; @@ -62,16 +67,14 @@ ISAMS_M isams_getmethod (void) m->debug = 1; m->block_size = 128; - - return m; } ISAMS isams_open (BFiles bfs, const char *name, int writeflag, ISAMS_M method) { - ISAMS is = xmalloc (sizeof(*is)); + ISAMS is = (ISAMS) xmalloc (sizeof(*is)); - is->method = xmalloc (sizeof(*is->method)); + is->method = (ISAMS_M) xmalloc (sizeof(*is->method)); memcpy (is->method, method, sizeof(*method)); is->block_size = is->method->block_size; is->debug = is->method->debug; @@ -84,7 +87,7 @@ ISAMS isams_open (BFiles bfs, const char *name, int writeflag, is->head.last_offset = 0; } memcpy (&is->head_old, &is->head, sizeof(is->head)); - is->merge_buf = xmalloc(2*is->block_size); + is->merge_buf = (char *) xmalloc(2*is->block_size); memset(is->merge_buf, 0, 2*is->block_size); return is; } @@ -163,7 +166,7 @@ ISAMS_P isams_merge (ISAMS is, ISAMS_I data) assert (gap <= (int) sizeof(int)); if (gap > 0) { - if (gap < sizeof(int)) + if (gap < (int) sizeof(int)) bf_write(is->bf, first_block, first_offset, sizeof(int)-gap, &count); memcpy (is->merge_buf, ((char*)&count)+(sizeof(int)-gap), gap); @@ -180,7 +183,7 @@ ISAMS_P isams_merge (ISAMS is, ISAMS_I data) ISAMS_PP isams_pp_open (ISAMS is, ISAMS_P pos) { - ISAMS_PP pp = xmalloc (sizeof(*pp)); + ISAMS_PP pp = (ISAMS_PP) xmalloc (sizeof(*pp)); if (is->debug > 1) logf (LOG_LOG, "isams: isams_pp_open pos=%ld", (long) pos); @@ -188,7 +191,7 @@ ISAMS_PP isams_pp_open (ISAMS is, ISAMS_P pos) pp->decodeClientData = (*is->method->code_start)(ISAMC_DECODE); pp->numKeys = 0; pp->numRead = 0; - pp->buf = xmalloc(is->block_size*2); + pp->buf = (char *) xmalloc(is->block_size*2); pp->block_no = pos/is->block_size; pp->block_offset = pos - pp->block_no * is->block_size; logf (LOG_LOG, "isams: isams_pp_open off=%d no=%d",