home *** CD-ROM | disk | FTP | other *** search
-
- /* d4reccount.c (c)Copyright Sequiter Software Inc., 1987, 1988, 1989. All rights reserved.
-
- Returns the number of records in the database.
- Returns
- >= 0 The number of records in the database.
- -1 Error
- */
-
- #include "d4base.h"
- #include "u4error.h"
- #ifndef UNIX
- #include <io.h>
- #endif
-
- extern BASE *v4base ;
- extern int v4cur_base ;
-
-
- long d4reccount()
- {
- BASE *base_ptr ;
- long len ;
-
- if ( v4cur_base < 0 ) return -1L ;
-
- base_ptr = v4base+ v4cur_base ;
-
- if ( (len = filelength(base_ptr->dos_file)) < 0L)
- {
- u4error( E_INTERNAL, (char *) 0 ) ;
- return -1L ;
- }
-
- return ( (len-base_ptr->header_len)/ base_ptr->buffer_len ) ;
- }