Happy new year
[pazpar2-moved-to-github.git] / src / charsets.h
1 /* This file is part of Pazpar2.
2    Copyright (C) Index Data
3
4 Pazpar2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18 */
19
20 /** \file charsets.h
21     \brief Pazpar2 Character set facilities
22 */
23
24 #ifndef PAZPAR_CHARSETS_H
25 #define PAZPAR_CHARSETS_H
26
27 #include <yaz/wrbuf.h>
28 #include <yaz/xmltypes.h>
29
30 typedef struct pp2_charset_token_s *pp2_charset_token_t;
31 typedef struct pp2_charset_fact_s *pp2_charset_fact_t;
32
33 pp2_charset_fact_t pp2_charset_fact_create(void);
34 void pp2_charset_fact_destroy(pp2_charset_fact_t pft);
35 int pp2_charset_fact_define(pp2_charset_fact_t pft,
36                             xmlNode *xml_node, const char *default_id);
37 void pp2_charset_fact_incref(pp2_charset_fact_t pft);
38 pp2_charset_token_t pp2_charset_token_create(pp2_charset_fact_t pft,
39                                              const char *id);
40
41 void pp2_charset_token_first(pp2_charset_token_t prt,
42                              const char *buf,
43                              int skip_article);
44 void pp2_charset_token_destroy(pp2_charset_token_t prt);
45 const char *pp2_charset_token_next(pp2_charset_token_t prt);
46 const char *pp2_get_sort(pp2_charset_token_t prt);
47 const char *pp2_get_display(pp2_charset_token_t prt);
48 void pp2_get_org(pp2_charset_token_t prt, size_t *start, size_t *len);
49
50 #endif
51
52 /*
53  * Local variables:
54  * c-basic-offset: 4
55  * c-file-style: "Stroustrup"
56  * indent-tabs-mode: nil
57  * End:
58  * vim: shiftwidth=4 tabstop=8 expandtab
59  */
60