6dc7096e1a9bcc0d241aec8d4b03308e55bad00c
[pazpar2-moved-to-github.git] / src / icu_I18N.h
1 /* $Id: icu_I18N.h,v 1.4 2007-05-02 14:01:36 marc Exp $
2    Copyright (c) 2006-2007, Index Data.
3
4 This file is part of Pazpar2.
5
6 Pazpar2 is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
10
11 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Pazpar2; see the file LICENSE.  If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA.
20  */
21
22 #ifndef ICU_I18NL_H
23 #define ICU_I18NL_H
24
25 #ifdef HAVE_ICU
26
27 #include <yaz/nmem.h>
28
29
30 //#include <unicode/utypes.h>   /* Basic ICU data types */
31 //#include <unicode/uchar.h>    /* char names           */
32
33 //#include <unicode/ustdio.h>
34 //#include <unicode/ucol.h> 
35 //#include <unicode/ucnv.h>     /* C   Converter API    */
36 //#include <unicode/ustring.h>  /* some more string fcns*/
37 //#include <unicode/uloc.h>
38 //#include <unicode/ubrk.h>
39 //#include <unicode/unistr.h>
40
41
42
43 struct icu_termmap
44 {
45     char * sort_key;   // standard C string '\0' terminated 
46     char * norm_term;  // standard C utf-8 string
47     char * disp_term;  // standard C utf-8 string
48 };
49
50 struct icu_termmap * icu_termmap_create(NMEM nmem);
51
52 int icu_termmap_cmp(const void *vp1, const void *vp2);
53
54 char * icu_casemap(NMEM nmem, char *buf, size_t buf_cap, 
55                    size_t *dest8_len,  const char *src8,
56                    const char *locale, char action);
57
58 char * icu_sortmap(NMEM nmem, char *buf, size_t buf_cap, 
59                    size_t *dest8_len,  const char *src8,
60                    const char *locale);
61
62
63 #endif // HAVE_ICU
64 #endif // ICU_I18NL_H