From c9c9df90cf9d66e46b177e62a4402a9def633634 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Wed, 28 Sep 1994 16:58:26 +0000 Subject: [PATCH] Small mod. --- include/isam.h | 9 ++++++++- isam/isam.c | 15 ++++++++++++++- isam/memory.c | 16 +++++++++++++++- isam/memory.h | 6 +++++- 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/include/isam.h b/include/isam.h index 4febc17..2051bf5 100644 --- a/include/isam.h +++ b/include/isam.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isam.h,v $ - * Revision 1.8 1994-09-28 12:56:09 quinn + * Revision 1.9 1994-09-28 16:58:26 quinn + * Small mod. + * + * Revision 1.8 1994/09/28 12:56:09 quinn * Added access functions (ISPT) * * Revision 1.7 1994/09/28 11:56:13 quinn @@ -120,6 +123,10 @@ int is_readkey(ISPT ip, void *buf); int is_writekey(ISPT ip, const void *buf); +int is_numkeys(ISPT ip); + +void is_rewind(ISPT ip); + ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data); #endif diff --git a/isam/isam.c b/isam/isam.c index 98a1f01..2958f16 100644 --- a/isam/isam.c +++ b/isam/isam.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isam.c,v $ - * Revision 1.9 1994-09-28 12:56:15 quinn + * Revision 1.10 1994-09-28 16:58:32 quinn + * Small mod. + * + * Revision 1.9 1994/09/28 12:56:15 quinn * Added access functions (ISPT) * * Revision 1.8 1994/09/28 12:32:17 quinn @@ -438,3 +441,13 @@ int is_readkey(ISPT ip, void *buf) { return is_m_read_record(&ip->tab, buf); } + +int is_numkeys(ISPT ip) +{ + return is_m_num_records(&ip->tab); +} + +void is_rewind(ISPT ip) +{ + is_m_rewind(&ip->tab); +} diff --git a/isam/memory.c b/isam/memory.c index 7962a0e..4bbb4d6 100644 --- a/isam/memory.c +++ b/isam/memory.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: memory.c,v $ - * Revision 1.4 1994-09-27 20:03:52 quinn + * Revision 1.5 1994-09-28 16:58:33 quinn + * Small mod. + * + * Revision 1.4 1994/09/27 20:03:52 quinn * Seems relatively bug-free. * * Revision 1.3 1994/09/26 17:11:30 quinn @@ -378,3 +381,14 @@ int is_m_seek_record(is_mtable *tab, const void *rec) return 0; } } + +int is_m_num_records(is_mtable *tab) +{ + if (tab->data->state < IS_MBSTATE_PARTIAL) + if (read_current_full(tab, tab->data) < 0) + { + log(LOG_FATAL, "read full failed"); + exit(1); + } + return tab->num_records; +} diff --git a/isam/memory.h b/isam/memory.h index 59e726d..2f92ee0 100644 --- a/isam/memory.h +++ b/isam/memory.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: memory.h,v $ - * Revision 1.2 1994-09-27 20:03:52 quinn + * Revision 1.3 1994-09-28 16:58:33 quinn + * Small mod. + * + * Revision 1.2 1994/09/27 20:03:52 quinn * Seems relatively bug-free. * * Revision 1.1 1994/09/26 17:12:32 quinn @@ -92,5 +95,6 @@ int is_m_seek_record(is_mtable *tab, const void *rec); void is_m_delete_record(is_mtable *tab); int is_m_peek_record(is_mtable *tab, void *rec); int is_m_read_full(is_mtable *tab, is_mblock *mblock); +int is_m_num_records(is_mtable *tab); #endif -- 1.7.10.4