$NetBSD: patch-ak,v 1.2 1999/08/22 22:55:46 kim Exp $ --- db.c.orig Tue Jun 8 00:19:45 1999 +++ db.c Sun Aug 22 18:04:14 1999 @@ -1095,7 +1095,7 @@ if (!db_sequential) fseek(master_file, - (off_t)(MASTER_FIELDS * sizeof(net_long) + DB_LOCK_MESSAGE + + (long)(MASTER_FIELDS * sizeof(net_long) + DB_LOCK_MESSAGE + GROUP_FIELDS * sizeof(net_long) * gh->group_num), 0); if (fread((char *)buf, sizeof(net_long), GROUP_FIELDS, master_file) != GROUP_FIELDS) @@ -1115,7 +1115,7 @@ #else if (!db_sequential) fseek(master_file, - (off_t)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * gh->group_num), 0); + (long)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * gh->group_num), 0); if (fread((char *)gh, SAVED_GROUP_HEADER_SIZE(*gh), 1, master_file) != 1) goto err; @@ -1137,7 +1137,7 @@ if (!db_sequential) fseek(master_file, - (off_t)(MASTER_FIELDS * sizeof(net_long) + DB_LOCK_MESSAGE + + (long)(MASTER_FIELDS * sizeof(net_long) + DB_LOCK_MESSAGE + GROUP_FIELDS * sizeof(net_long) * gh->group_num), 0); buf[0] = gh->first_db_article; @@ -1155,7 +1155,7 @@ goto err; #else /* NETWORK_DATABASE */ if (!db_sequential) - fseek(master_file, (off_t)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * gh->group_num), 0); + fseek(master_file, (long)(sizeof(master_header) + SAVED_GROUP_HEADER_SIZE(*gh) * gh->group_num), 0); if (fwrite((char *)gh, SAVED_GROUP_HEADER_SIZE(*gh), 1, master_file) != 1) @@ -1340,10 +1340,10 @@ #ifndef NOV -off_t db_read_art(f) +long db_read_art(f) FILE *f; { - off_t bytes; + long bytes; #ifdef NETWORK_DATABASE net_long buf[ARTICLE_FIELDS]; @@ -1526,7 +1526,7 @@ * fill in db_hdr and db_data from the overview data for the next * article in this group. does weirdo nn encodings of header fields. */ -off_t +long db_read_art(f) FILE *f; { @@ -1734,32 +1734,32 @@ } -off_t get_index_offset(gh, art_num) +long get_index_offset(gh, art_num) group_header *gh; article_number art_num; { #ifdef NETWORK_DATABASE - return (off_t)((art_num - gh->first_db_article) * sizeof(net_long)); + return (long)((art_num - gh->first_db_article) * sizeof(net_long)); #else /* NETWORK_DATABASE */ - return (off_t)((art_num - gh->first_db_article) * sizeof(off_t)); + return (long)((art_num - gh->first_db_article) * sizeof(long)); #endif /* NETWORK_DATABASE */ } -off_t get_data_offset(gh, art_num) +long get_data_offset(gh, art_num) group_header *gh; article_number art_num; { FILE *index; - off_t data_offset; + long data_offset; - if (gh->first_db_article == art_num) return (off_t)0; + if (gh->first_db_article == art_num) return (long)0; index = open_data_file(gh, 'x', OPEN_READ); - if (index == NULL) return (off_t)(-1); + if (index == NULL) return (long)(-1); fseek(index, get_index_offset(gh, art_num), 0); if (!db_read_offset(index, &data_offset)) - data_offset = (off_t)(-1); + data_offset = (long)(-1); fclose(index); @@ -1770,7 +1770,7 @@ int db_read_offset(f, offset) FILE *f; -off_t *offset; +long *offset; { #ifdef NETWORK_DATABASE net_long temp; @@ -1783,7 +1783,7 @@ *offset = temp; #else /* NETWORK_DATABASE */ - if (fread((char *)offset, sizeof(off_t), 1, f) != 1) return 0; + if (fread((char *)offset, sizeof(long), 1, f) != 1) return 0; #endif /* NETWORK_DATABASE */ return 1; } @@ -1791,7 +1791,7 @@ int db_write_offset(f, offset) FILE *f; -off_t *offset; +long *offset; { #ifdef NETWORK_DATABASE net_long temp; @@ -1805,7 +1805,7 @@ #else /* NETWORK_DATABASE */ - if (fwrite((char *)offset, sizeof(off_t), 1, f) != 1) return 0; + if (fwrite((char *)offset, sizeof(long), 1, f) != 1) return 0; #endif /* NETWORK_DATABASE */ return 1; } @@ -1829,7 +1829,7 @@ int db_read_offset(f, offset) FILE *f; -off_t *offset; +long *offset; { nn_exitmsg(50, "STUB ROUTINE CALLED: db_read_offset\n"); return -1; @@ -1853,7 +1853,7 @@ return NULL; } -off_t +long get_index_offset(gh, art_num) group_header *gh; article_number art_num;