pazpar2  1.13.0
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
 

Macros

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

Typedefs

typedef struct pp2_charset_spp2_charset_t
 

Functions

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

#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

typedef struct pp2_charset_s* pp2_charset_t

Definition at line 40 of file charsets.c.

Function Documentation

pp2_charset_t pp2_charset_create ( void  )
static
pp2_charset_t pp2_charset_create_a_to_z ( void  )
static
pp2_charset_t pp2_charset_create_xml ( xmlNode *  xml_node)
static

Definition at line 212 of file charsets.c.

Referenced by pp2_charset_fact_define().

void pp2_charset_destroy ( pp2_charset_t  pct)
static
int pp2_charset_fact_add ( pp2_charset_fact_t  pft,
pp2_charset_t  pct,
const char *  default_id 
)
static
pp2_charset_fact_t pp2_charset_fact_create ( void  )
int pp2_charset_fact_define ( pp2_charset_fact_t  pft,
xmlNode *  xml_node,
const char *  id 
)
void pp2_charset_fact_destroy ( pp2_charset_fact_t  pft)
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().

static const char * pp2_charset_token_a_to_z ( pp2_charset_token_t  prt)
static
pp2_charset_token_t pp2_charset_token_create ( pp2_charset_fact_t  pft,
const char *  id 
)
void pp2_charset_token_destroy ( pp2_charset_token_t  prt)
void pp2_charset_token_first ( pp2_charset_token_t  prt,
const char *  buf,
int  skip_article 
)
const char* pp2_charset_token_next ( pp2_charset_token_t  prt)
static const char * pp2_charset_token_null ( pp2_charset_token_t  prt)
static
pp2_charset_token_t pp2_charset_tokenize ( pp2_charset_t  pct)
static
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().

static const char * pp2_get_display_ascii ( pp2_charset_token_t  prt)
static

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().

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().

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

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().

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().

static const char * pp2_get_sort_ascii ( pp2_charset_token_t  prt)
static