pazpar2  1.13.1
Data Structures | Macros | Typedefs | Functions
charsets.c File Reference

Pazpar2 Character set facilities. More...

#include <yaz/xmalloc.h>
#include <yaz/wrbuf.h>
#include <yaz/log.h>
#include <yaz/yaz-version.h>
#include <yaz/xml_get.h>
#include <ctype.h>
#include <assert.h>
#include <string.h>
#include "charsets.h"
#include "normalize7bit.h"

Go to the source code of this file.

Data Structures

struct  pp2_charset_s
struct  pp2_charset_token_s
struct  pp2_charset_fact_s
struct  pp2_charset_entry


#define raw_char(c)   (((c) >= 'a' && (c) <= 'z') ? (c) : -1)


typedef struct pp2_charset_spp2_charset_t


static pp2_charset_t pp2_charset_create_xml (xmlNode *xml_node)
static pp2_charset_t pp2_charset_create (void)
static pp2_charset_t pp2_charset_create_a_to_z (void)
static void pp2_charset_destroy (pp2_charset_t pct)
static pp2_charset_token_t pp2_charset_tokenize (pp2_charset_t pct)
static const char * pp2_charset_token_null (pp2_charset_token_t prt)
static const char * pp2_charset_token_a_to_z (pp2_charset_token_t prt)
static const char * pp2_get_sort_ascii (pp2_charset_token_t prt)
static const char * pp2_get_display_ascii (pp2_charset_token_t prt)
static void pp2_get_org_ascii (pp2_charset_token_t prt, size_t *start, size_t *len)
static int pp2_charset_fact_add (pp2_charset_fact_t pft, pp2_charset_t pct, const char *default_id)
pp2_charset_fact_t pp2_charset_fact_create (void)
void pp2_charset_fact_destroy (pp2_charset_fact_t pft)
int pp2_charset_fact_define (pp2_charset_fact_t pft, xmlNode *xml_node, const char *id)
void pp2_charset_fact_incref (pp2_charset_fact_t pft)
pp2_charset_token_t pp2_charset_token_create (pp2_charset_fact_t pft, const char *id)
void pp2_charset_token_first (pp2_charset_token_t prt, const char *buf, int skip_article)
void pp2_charset_token_destroy (pp2_charset_token_t prt)
const char * pp2_charset_token_next (pp2_charset_token_t prt)
const char * pp2_get_sort (pp2_charset_token_t prt)
const char * pp2_get_display (pp2_charset_token_t prt)
void pp2_get_org (pp2_charset_token_t prt, size_t *start, size_t *len)

Detailed Description

Pazpar2 Character set facilities.

Definition in file charsets.c.

Macro Definition Documentation

◆ raw_char

#define raw_char (   c)    (((c) >= 'a' && (c) <= 'z') ? (c) : -1)

Definition at line 382 of file charsets.c.

Referenced by pp2_charset_token_a_to_z().

Typedef Documentation

◆ pp2_charset_t

typedef struct pp2_charset_s* pp2_charset_t

Definition at line 40 of file charsets.c.

Function Documentation

◆ pp2_charset_create()

pp2_charset_t pp2_charset_create ( void  )

◆ pp2_charset_create_a_to_z()

pp2_charset_t pp2_charset_create_a_to_z ( void  )

◆ pp2_charset_create_xml()

pp2_charset_t pp2_charset_create_xml ( xmlNode *  xml_node)

Definition at line 212 of file charsets.c.

Referenced by pp2_charset_fact_define().

◆ pp2_charset_destroy()

void pp2_charset_destroy ( pp2_charset_t  pct)

◆ pp2_charset_fact_add()

int pp2_charset_fact_add ( pp2_charset_fact_t  pft,
pp2_charset_t  pct,
const char *  default_id 

◆ pp2_charset_fact_create()

pp2_charset_fact_t pp2_charset_fact_create ( void  )

◆ pp2_charset_fact_define()

int pp2_charset_fact_define ( pp2_charset_fact_t  pft,
xmlNode *  xml_node,
const char *  id 

◆ pp2_charset_fact_destroy()

void pp2_charset_fact_destroy ( pp2_charset_fact_t  pft)

◆ pp2_charset_fact_incref()

void pp2_charset_fact_incref ( pp2_charset_fact_t  pft)

Definition at line 207 of file charsets.c.

References pp2_charset_fact_s::ref_count.

Referenced by inherit_server_settings().

◆ pp2_charset_token_a_to_z()

static const char * pp2_charset_token_a_to_z ( pp2_charset_token_t  prt)

◆ pp2_charset_token_create()

pp2_charset_token_t pp2_charset_token_create ( pp2_charset_fact_t  pft,
const char *  id 

◆ pp2_charset_token_destroy()

void pp2_charset_token_destroy ( pp2_charset_token_t  prt)

◆ pp2_charset_token_first()

void pp2_charset_token_first ( pp2_charset_token_t  prt,
const char *  buf,
int  skip_article 

◆ pp2_charset_token_next()

const char* pp2_charset_token_next ( pp2_charset_token_t  prt)

◆ pp2_charset_token_null()

static const char * pp2_charset_token_null ( pp2_charset_token_t  prt)

◆ pp2_charset_tokenize()

pp2_charset_token_t pp2_charset_tokenize ( pp2_charset_t  pct)

◆ pp2_get_display()

const char* pp2_get_display ( pp2_charset_token_t  prt)

Definition at line 371 of file charsets.c.

References pp2_charset_s::get_display_handler, and pp2_charset_token_s::pct.

Referenced by run_icu().

◆ pp2_get_display_ascii()

static const char * pp2_get_display_ascii ( pp2_charset_token_t  prt)

Definition at line 432 of file charsets.c.

References pp2_charset_token_s::last_cp, and pp2_charset_token_s::norm_str.

Referenced by pp2_charset_create().

◆ pp2_get_org()

void pp2_get_org ( pp2_charset_token_t  prt,
size_t *  start,
size_t *  len 

Definition at line 376 of file charsets.c.

References pp2_charset_s::get_org_handler, and pp2_charset_token_s::pct.

Referenced by relevance_snippet().

◆ pp2_get_org_ascii()

static void pp2_get_org_ascii ( pp2_charset_token_t  prt,
size_t *  start,
size_t *  len 

Definition at line 442 of file charsets.c.

References pp2_charset_token_s::len, and pp2_charset_token_s::start.

Referenced by pp2_charset_create().

◆ pp2_get_sort()

const char* pp2_get_sort ( pp2_charset_token_t  prt)

Definition at line 366 of file charsets.c.

References pp2_charset_s::get_sort_handler, and pp2_charset_token_s::pct.

Referenced by ingest_to_cluster().

◆ pp2_get_sort_ascii()

static const char * pp2_get_sort_ascii ( pp2_charset_token_t  prt)