-/* $Id: api.h,v 1.22 2005-05-03 09:11:34 adam Exp $
+/* $Id: api.h,v 1.23 2005-05-09 10:16:12 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
struct BFiles_struct *zebra_get_bfs(ZebraHandle zh);
YAZ_EXPORT
-ZEBRA_RES zebra_set_limit(ZebraHandle zh, int exclude_flag, zint *ids);
+ZEBRA_RES zebra_set_limit(ZebraHandle zh, int complement_flag, zint *ids);
YAZ_END_CDECL
-/* $Id: limit.c,v 1.1 2005-05-03 09:11:34 adam Exp $
+/* $Id: limit.c,v 1.2 2005-05-09 10:16:13 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
#include "index.h"
struct zebra_limit {
- int exclude_flag;
+ int complement_flag;
zint *ids;
};
}
}
-struct zebra_limit *zebra_limit_create(int exclude_flag, zint *ids)
+struct zebra_limit *zebra_limit_create(int complement_flag, zint *ids)
{
struct zebra_limit *zl = 0;
size_t i;
zl = xmalloc(sizeof(*zl));
zl->ids = xmalloc((i+1) * sizeof(*ids));
memcpy(zl->ids, ids, (i+1) * sizeof(*ids));
- zl->exclude_flag = exclude_flag;
+ zl->complement_flag = complement_flag;
}
return zl;
}
return 1;
for (i = 0; zl->ids[i]; i++)
if (zl->ids[i] == key->mem[1])
- return zl->exclude_flag ? 0 : 1;
- return zl->exclude_flag ? 1 : 0;
+ return zl->complement_flag ? 0 : 1;
+ return zl->complement_flag ? 0 : 1;
}
static void zebra_limit_destroy_cb(void *data)
{
struct zebra_limit *hl;
- hl = zebra_limit_create(zl->exclude_flag, zl->ids);
+ hl = zebra_limit_create(zl->complement_flag, zl->ids);
*filter_data = hl;
*filter_func = zebra_limit_filter_cb;
*filter_destroy = zebra_limit_destroy_cb;
-/* $Id: zebraapi.c,v 1.166 2005-05-09 10:04:30 adam Exp $
+/* $Id: zebraapi.c,v 1.167 2005-05-09 10:16:13 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
zh->store_data_buf = 0;
- zh->m_limit = zebra_limit_create(0, 0);
+ zh->m_limit = zebra_limit_create(1, 0);
return zh;
}
/* ---------------------------------------------------------------------------
Set limit for search/scan
*/
-ZEBRA_RES zebra_set_limit(ZebraHandle zh, int exclude_flag, zint *ids)
+ZEBRA_RES zebra_set_limit(ZebraHandle zh, int complement_flag, zint *ids)
{
ASSERTZH;
zebra_limit_destroy(zh->m_limit);
- zh->m_limit = zebra_limit_create(exclude_flag, ids);
+ zh->m_limit = zebra_limit_create(complement_flag, ids);
return ZEBRA_OK;
}