+struct record_index_entry {
+ zint next; /* first block of record info / next free entry */
+ int size; /* size of record or 0 if free entry */
+} ent;
+
+
+static void rect_log_item(int level, const void *b, const char *txt)
+{
+ zint sys;
+ int len;
+
+
+ memcpy(&sys, b, sizeof(sys));
+ len = ((const char *) b)[sizeof(sys)];
+
+ if (len == sizeof(struct record_index_entry))
+ {
+ memcpy(&ent, (const char *)b + sizeof(sys) + 1, len);
+ yaz_log(YLOG_LOG, "%s " ZINT_FORMAT " next=" ZINT_FORMAT " sz=%d", txt, sys,
+ ent.next, ent.size);
+
+ }
+ else
+ yaz_log(YLOG_LOG, "%s " ZINT_FORMAT, txt, sys);
+}
+
+int rect_compare(const void *a, const void *b)
+{
+ zint s_a, s_b;
+
+ memcpy(&s_a, a, sizeof(s_a));
+ memcpy(&s_b, b, sizeof(s_b));
+
+ if (s_a > s_b)
+ return 1;
+ else if (s_a < s_b)
+ return -1;
+ return 0;
+}
+
+void *rect_code_start(void)
+{
+ return 0;
+}
+
+void rect_encode(void *p, char **dst, const char **src)
+{
+ zint sys;
+ int len;
+
+ memcpy(&sys, *src, sizeof(sys));
+ zebra_zint_encode(dst, sys);
+ (*src) += sizeof(sys);
+
+ len = **src;
+ **dst = len;
+ (*src)++;
+ (*dst)++;
+
+ memcpy(*dst, *src, len);
+ *dst += len;
+ *src += len;
+}
+
+void rect_decode(void *p, char **dst, const char **src)
+{
+ zint sys;
+ int len;
+
+ zebra_zint_decode(src, &sys);
+ memcpy(*dst, &sys, sizeof(sys));
+ *dst += sizeof(sys);
+
+ len = **src;
+ **dst = len;
+ (*src)++;
+ (*dst)++;
+
+ memcpy(*dst, *src, len);
+ *dst += len;
+ *src += len;
+}
+
+void rect_code_reset(void *p)
+{
+}
+
+void rect_code_stop(void *p)
+{
+}
+
+
+recindex_t recindex_open(BFiles bfs, int rw, int use_isamb)