/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/**
ZOOM_record_cache next;
};
-
-static int strcmp_null(const char *v1, const char *v2)
-{
- if (!v1 && !v2)
- return 0;
- if (!v1 || !v2)
- return -1;
- return strcmp(v1, v2);
-}
-
static size_t record_hash(int pos)
{
if (pos < 0)
for (rc = r->record_hash[record_hash(pos)]; rc; rc = rc->next)
{
if (pos == rc->pos
- && strcmp_null(r->schema, rc->schema) == 0
- && strcmp_null(elementSetName,rc->elementSetName) == 0
- && strcmp_null(syntax, rc->syntax) == 0)
+ && yaz_strcmp_null(schema, rc->schema) == 0
+ && yaz_strcmp_null(elementSetName,rc->elementSetName) == 0
+ && yaz_strcmp_null(syntax, rc->syntax) == 0)
break;
}
if (!rc)
rc->syntax = odr_strdup_null(r->odr, syntax);
- rc->schema = odr_strdup_null(r->odr, r->schema);
+ rc->schema = odr_strdup_null(r->odr, schema);
rc->pos = pos;
rc->next = r->record_hash[record_hash(pos)];
ZOOM_record ZOOM_record_cache_lookup(ZOOM_resultset r, int pos,
const char *syntax,
- const char *elementSetName)
+ const char *elementSetName,
+ const char *schema)
{
ZOOM_record_cache rc;
{
if (pos == rc->pos)
{
- if (strcmp_null(r->schema, rc->schema))
+ if (yaz_strcmp_null(schema, rc->schema))
continue;
- if (strcmp_null(elementSetName,rc->elementSetName))
+ if (yaz_strcmp_null(elementSetName,rc->elementSetName))
continue;
- if (strcmp_null(syntax, rc->syntax))
+ if (yaz_strcmp_null(syntax, rc->syntax))
continue;
return &rc->rec;
}