* Sebastian Hammer, Adam Dickmeiss
*
* $Log: isam.h,v $
- * Revision 1.9 1994-09-28 16:58:26 quinn
+ * Revision 1.10 1995-09-06 16:10:57 adam
+ * More work on boolean sets.
+ *
+ * Revision 1.9 1994/09/28 16:58:26 quinn
* Small mod.
*
* Revision 1.8 1994/09/28 12:56:09 quinn
* Open isam file.
*/
ISAM is_open(const char *name, int (*cmp)(const void *p1, const void *p2),
- int writeflag);
+ int writeflag, int keysize);
/*
* Close isam file.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsbool.h,v $
- * Revision 1.1 1995-09-06 13:27:37 adam
+ * Revision 1.2 1995-09-06 16:10:57 adam
+ * More work on boolean sets.
+ *
+ * Revision 1.1 1995/09/06 13:27:37 adam
* New set type: bool. Not finished yet.
*
*/
{
int key_size;
int op;
+ RSET rset_l;
+ RSET rset_r;
+ int (*cmp)(const void *p1, const void *p2);
} rset_bool_parms;
#endif
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1995, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rset.h,v $
- * Revision 1.5 1995-09-04 15:20:13 adam
+ * Revision 1.6 1995-09-06 16:10:58 adam
+ * More work on boolean sets.
+ *
+ * Revision 1.5 1995/09/04 15:20:13 adam
* More work on temp sets. is_open member removed.
*
* Revision 1.4 1995/09/04 09:09:52 adam
void rset_delete(RSET rs);
/* void rset_rewind(RSET rs); */
-#define rset_rewind(rs, wflag) ((*(rs)->control->f_rewind)((rs)->control))
+#define rset_rewind(rs) ((*(rs)->control->f_rewind)((rs)->control))
/* int rset_count(RSET rs); */
-#define rset_count(rs, wflag) ((*(rs)->control->f_count)((rs)->control))
+#define rset_count(rs) ((*(rs)->control->f_count)((rs)->control))
/* int rset_read(RSET rs, void *buf); */
#define rset_read(rs, buf) ((*(rs)->control->f_read)((rs)->control, (buf)))
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsbool.c,v $
- * Revision 1.1 1995-09-06 13:27:15 adam
+ * Revision 1.2 1995-09-06 16:11:55 adam
+ * More work on boolean sets.
+ *
+ * Revision 1.1 1995/09/06 13:27:15 adam
* New set type: bool. Not finished yet.
*
*/
struct rset_bool_info {
int key_size;
int op;
+ RSET rset_l;
+ RSET rset_r;
+ int more_l;
+ int more_r;
+ void *buf_l;
+ void *buf_r;
+ int (*cmp)(const void *p1, const void *p2);
};
static rset_control *r_create(const struct rset_control *sel, void *parms)
logf (LOG_DEBUG, "rsbool_create(%s)", sel->desc);
newct = xmalloc(sizeof(*newct));
- memcpy(newct, sel, sizeof(*sel));
+ memcpy (newct, sel, sizeof(*sel));
newct->buf = xmalloc (sizeof(struct rset_bool_info));
info = (struct rset_bool_info*) newct->buf;
info->key_size = bool_parms->key_size;
info->op = bool_parms->op;
+ info->rset_l = bool_parms->rset_l;
+ info->rset_r = bool_parms->rset_r;
+ info->cmp = bool_parms->cmp;
+ info->buf_l = xmalloc (info->key_size);
+ info->buf_r = xmalloc (info->key_size);
return newct;
}
static int r_open(rset_control *ct, int wflag)
{
+ struct rset_bool_info *info = ct->buf;
+
if (wflag)
{
logf (LOG_FATAL, "bool set type is read-only");
return -1;
}
+ rset_open (info->rset_l, wflag);
+ rset_open (info->rset_r, wflag);
+ info->more_l = rset_read (info->rset_l, info->buf_l);
+ info->more_r = rset_read (info->rset_r, info->buf_r);
return 0;
}
static void r_close(rset_control *ct)
{
- /* NOP */
+ struct rset_bool_info *info = ct->buf;
+
+ rset_close (info->rset_l);
+ rset_close (info->rset_r);
}
static void r_delete(rset_control *ct)
{
- xfree(ct);
+ struct rset_bool_info *info = ct->buf;
+
+ rset_delete (info->rset_l);
+ rset_delete (info->rset_r);
+ xfree (info->buf_l);
+ xfree (info->buf_r);
+ xfree (ct->buf);
+ xfree (ct);
}
static void r_rewind(rset_control *ct)
{
+ struct rset_bool_info *info = ct->buf;
+
logf (LOG_DEBUG, "rsbool_rewind");
+ rset_rewind (info->rset_l);
+ rset_rewind (info->rset_r);
}
static int r_count (rset_control *ct)
static int r_read (rset_control *ct, void *buf)
{
+ struct rset_bool_info *info = ct->buf;
+
+ if (!info->more_l && !info->more_r)
+ return 0;
return 0;
}
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1995, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rset.c,v $
- * Revision 1.3 1995-09-04 15:20:39 adam
+ * Revision 1.4 1995-09-06 16:11:56 adam
+ * More work on boolean sets.
+ *
+ * Revision 1.3 1995/09/04 15:20:39 adam
* More work on temp sets. is_open member removed.
*
* Revision 1.2 1995/09/04 12:33:56 adam
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1995, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsisam.c,v $
- * Revision 1.7 1995-09-06 10:35:44 adam
+ * Revision 1.8 1995-09-06 16:11:56 adam
+ * More work on boolean sets.
+ *
+ * Revision 1.7 1995/09/06 10:35:44 adam
* Null set implemented.
*
* Revision 1.6 1995/09/05 11:43:24 adam
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1995, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rstemp.c,v $
- * Revision 1.5 1995-09-05 16:36:59 adam
+ * Revision 1.6 1995-09-06 16:11:56 adam
+ * More work on boolean sets.
+ *
+ * Revision 1.5 1995/09/05 16:36:59 adam
* Minor changes.
*
* Revision 1.4 1995/09/05 11:43:24 adam