pazpar2  1.13.0
Macros | Functions
marchash.c File Reference

MARC MAP utilities (hash lookup etc) More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <yaz/nmem.h>
#include "jenkins_hash.h"
#include "marchash.h"

Go to the source code of this file.

Macros

#define inline
 

Functions

static void strtrimcat (char *dest, const char *src)
 
static void strtrimcpy (char *dest, const char *src)
 
struct marchashmarchash_create (NMEM nmem)
 
void marchash_ingest_marcxml (struct marchash *marchash, xmlNodePtr rec_node)
 
struct marcfieldmarchash_add_field (struct marchash *marchash, const char *key, const char *val)
 
struct marcsubfieldmarchash_add_subfield (struct marchash *marchash, struct marcfield *field, const char key, const char *val)
 
struct marcfieldmarchash_get_field (struct marchash *marchash, const char *key, struct marcfield *last)
 
struct marcsubfieldmarchash_get_subfield (char key, struct marcfield *field, struct marcsubfield *last)
 
char * marchash_catenate_subfields (struct marcfield *field, const char *delim, NMEM nmem)
 

Detailed Description

MARC MAP utilities (hash lookup etc)

Definition in file marchash.c.

Macro Definition Documentation

#define inline

Definition at line 28 of file marchash.c.

Function Documentation

struct marcfield* marchash_add_field ( struct marchash marchash,
const char *  key,
const char *  val 
)
struct marcsubfield* marchash_add_subfield ( struct marchash marchash,
struct marcfield field,
const char  key,
const char *  val 
)
char* marchash_catenate_subfields ( struct marcfield field,
const char *  delim,
NMEM  nmem 
)

Definition at line 243 of file marchash.c.

References marcsubfield::next, strtrimcat(), and marcsubfield::val.

Referenced by marcmap_apply().

struct marchash* marchash_create ( NMEM  nmem)

Definition at line 75 of file marchash.c.

References marchash::nmem.

Referenced by marcmap_apply().

struct marcfield* marchash_get_field ( struct marchash marchash,
const char *  key,
struct marcfield last 
)

Definition at line 208 of file marchash.c.

References jenkins_hash(), marcfield::key, MARCHASH_MASK, marcfield::next, and marchash::table.

Referenced by marcmap_apply().

struct marcsubfield* marchash_get_subfield ( char  key,
struct marcfield field,
struct marcsubfield last 
)

Definition at line 225 of file marchash.c.

References marcsubfield::key, marcsubfield::next, and marcfield::subfields.

Referenced by marcmap_apply().

void marchash_ingest_marcxml ( struct marchash marchash,
xmlNodePtr  rec_node 
)

Definition at line 84 of file marchash.c.

References marchash_add_field(), and marchash_add_subfield().

Referenced by marcmap_apply().

static void strtrimcat ( char *  dest,
const char *  src 
)
inlinestatic

Definition at line 43 of file marchash.c.

Referenced by marchash_catenate_subfields(), and strtrimcpy().

static void strtrimcpy ( char *  dest,
const char *  src 
)
inlinestatic

Definition at line 69 of file marchash.c.

References strtrimcat().

Referenced by marchash_add_field().