collate.h revision 101498
16485Sache/*- 26485Sache * Copyright (c) 1995 Alex Tatmanjants <alex@elvisti.kiev.ua> 36485Sache * at Electronni Visti IA, Kiev, Ukraine. 46485Sache * All rights reserved. 56485Sache * 66485Sache * Redistribution and use in source and binary forms, with or without 76485Sache * modification, are permitted provided that the following conditions 86485Sache * are met: 96485Sache * 1. Redistributions of source code must retain the above copyright 106485Sache * notice, this list of conditions and the following disclaimer. 116485Sache * 2. Redistributions in binary form must reproduce the above copyright 126485Sache * notice, this list of conditions and the following disclaimer in the 136485Sache * documentation and/or other materials provided with the distribution. 146485Sache * 156485Sache * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 166485Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 176485Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 186485Sache * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 196485Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 206485Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 216485Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 226485Sache * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 236485Sache * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 246485Sache * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 256485Sache * SUCH DAMAGE. 266485Sache * 2750476Speter * $FreeBSD: head/lib/libc/locale/collate.h 101498 2002-08-08 05:51:54Z ache $ 286485Sache */ 296485Sache 3088309Sphantom#ifndef _COLLATE_H_ 3188309Sphantom#define _COLLATE_H_ 326485Sache 336485Sache#include <sys/cdefs.h> 346485Sache#include <sys/types.h> 356485Sache#include <limits.h> 366485Sache 376485Sache#define STR_LEN 10 386485Sache#define TABLE_SIZE 100 3918949Sache#define COLLATE_VERSION "1.0\n" 406485Sache 416485Sachestruct __collate_st_char_pri { 426485Sache int prim, sec; 436485Sache}; 446485Sachestruct __collate_st_chain_pri { 456485Sache u_char str[STR_LEN]; 466485Sache int prim, sec; 476485Sache}; 486485Sache 496485Sacheextern int __collate_load_error; 5051216Sdtextern int __collate_substitute_nontrivial; 516485Sacheextern u_char __collate_substitute_table[UCHAR_MAX + 1][STR_LEN]; 526485Sacheextern struct __collate_st_char_pri __collate_char_pri_table[UCHAR_MAX + 1]; 536485Sacheextern struct __collate_st_chain_pri __collate_chain_pri_table[TABLE_SIZE]; 546485Sache 556485Sache__BEGIN_DECLS 5692905Sobrienu_char *__collate_strdup(u_char *); 5792905Sobrienu_char *__collate_substitute(const u_char *); 58101498Sacheint __collate_load_tables(const char *); 5992905Sobrienvoid __collate_lookup(const u_char *, int *, int *, int *); 6092905Sobrienint __collate_range_cmp(int, int); 616485Sache#ifdef COLLATE_DEBUG 6292905Sobrienvoid __collate_print_tables(void); 636485Sache#endif 646485Sache__END_DECLS 656485Sache 6688309Sphantom#endif /* !_COLLATE_H_ */ 67