- struct record_index_entry entry;
- int r, i, size = 0, got;
- char *cptr;
- off_t pos = (rec->sysno-1)*sizeof(entry) + sizeof(p->head);
-
- for (i = 0; i < REC_NO_INFO; i++)
- if (!rec->info[i])
- size += sizeof(*rec->size);
- else
- size += sizeof(*rec->size) + rec->size[i];
-
- entry.u.used.offset = p->head.data_size;
- entry.u.used.size = size;
- p->head.data_size += size;
- p->head.data_used += size;
-
- if (lseek (p->index_fd, pos, SEEK_SET) == (pos) -1)
- {
- logf (LOG_FATAL|LOG_ERRNO, "seek in %s to pos %ld",
- p->index_fname, (long) pos);
- exit (1);
- }
- r = write (p->index_fd, &entry, sizeof(entry));
- if (r != sizeof(entry))
- {
- if (r == -1)
- logf (LOG_FATAL|LOG_ERRNO, "write of %s at pos %ld",
- p->index_fname, (long) pos);
- else
- logf (LOG_FATAL, "write of %s at pos %ld",
- p->index_fname, (long) pos);
- exit (1);
- }
- if (lseek (p->data_fd, entry.u.used.offset, SEEK_SET) == -1)
- {
- logf (LOG_FATAL|LOG_ERRNO, "lseek in %s to pos %ld",
- p->data_fname, entry.u.used.offset);
- exit (1);
- }
- if (p->tmp_size < entry.u.used.size)
- {
- free (p->tmp_buf);
- p->tmp_size = entry.u.used.size + 16384;
- if (!(p->tmp_buf = malloc (p->tmp_size)))
- {
- logf (LOG_FATAL|LOG_ERRNO, "malloc");
- exit (1);
- }
- }
- cptr = p->tmp_buf;
- for (i = 0; i < REC_NO_INFO; i++)
+}
+
+void rect_code_stop(void *p)
+{
+}
+
+
+recindex_t recindex_open(BFiles bfs, int rw, int use_isamb)
+{
+ recindex_t p = xmalloc(sizeof(*p));
+ p->index_BFile = 0;
+ p->isamb = 0;
+
+ p->index_fname = "reci";
+ p->index_BFile = bf_open(bfs, p->index_fname, RIDX_CHUNK, rw);
+ if (p->index_BFile == NULL)