home *** CD-ROM | disk | FTP | other *** search
-
- /* d4lseek.c (c)Copyright Sequiter Software Inc., 1987-1990. All rights reserved. */
-
- #include "p4misc.h"
- #include "d4base.h"
- #include "u4error.h"
-
- #ifndef UNIX
- #include <io.h>
- #endif
-
- extern int v4cur_base ;
- extern BASE *v4base ;
-
- int d4lseek( long rec_num )
- {
- BASE *base_ptr ;
- long pos ;
-
- base_ptr = v4base + v4cur_base ;
-
- pos = base_ptr->header_len+ (rec_num-1)* base_ptr->buffer_len ;
- if ( lseek( base_ptr->file_hand, pos, 0 ) != pos )
- {
- u4error( E_LSEEK, base_ptr->name, (char *) 0 ) ;
- return -1 ;
- }
-
- return 0 ;
- }
-