/* This file is part of Pazpar2.
- Copyright (C) 2006-2010 Index Data
+ Copyright (C) 2006-2013 Index Data
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
*/
-/** \file
+/** \file
\brief MARC MAP utilities (hash lookup etc)
*/
if (field)
{
sub_node = field_node->children;
- while (sub_node)
+ while (sub_node)
{
if ((sub_node->type == XML_ELEMENT_NODE) &&
!strcmp((const char *) sub_node->name, "subfield"))
xmlFree(code);
}
sub_node = sub_node->next;
- }
+ }
}
}
field_node = field_node->next;
int slot;
struct marcfield *new;
struct marcfield *last;
-
+
slot = jenkins_hash((const unsigned char *) key) & MARCHASH_MASK;
new = marchash->table[slot];
last = NULL;
-
- while (new)
+
+ while (new)
{
- last = new;
- new = new->next;
+ last = new;
+ new = new->next;
}
new = nmem_malloc(marchash->nmem, sizeof (struct marcfield));
new->next = NULL;
new->subfields = NULL;
strncpy(new->key, key, 4);
-
- // only 3 char in a marc field name
+
+ // only 3 char in a marc field name
if (new->key[3] != '\0')
return 0;
struct marcfield *cur;
if (last)
cur = last->next;
- else
+ else
cur = marchash->table[jenkins_hash((const unsigned char *)key) & MARCHASH_MASK];
while (cur)
{
{
outsize += strlen(cur->val) + delimsize;
cur = cur->next;
- }
+ }
if (outsize > 0)
- output = nmem_malloc(nmem, outsize);
+ output = nmem_malloc(nmem, outsize);
else
return NULL;
*output = '\0';
{
strtrimcat(output, cur->val);
if (cur->next)
- strcat(output, delim);
+ strcat(output, delim);
cur = cur->next;
- }
+ }
return output;
}
/*