|
Packit |
b89d10 |
/**********************************************************************
|
|
Packit |
b89d10 |
iso8859_8.c - Oniguruma (regular expression library)
|
|
Packit |
b89d10 |
**********************************************************************/
|
|
Packit |
b89d10 |
/*-
|
|
Packit |
b89d10 |
* Copyright (c) 2002-2018 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
|
|
Packit |
b89d10 |
* All rights reserved.
|
|
Packit |
b89d10 |
*
|
|
Packit |
b89d10 |
* Redistribution and use in source and binary forms, with or without
|
|
Packit |
b89d10 |
* modification, are permitted provided that the following conditions
|
|
Packit |
b89d10 |
* are met:
|
|
Packit |
b89d10 |
* 1. Redistributions of source code must retain the above copyright
|
|
Packit |
b89d10 |
* notice, this list of conditions and the following disclaimer.
|
|
Packit |
b89d10 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
Packit |
b89d10 |
* notice, this list of conditions and the following disclaimer in the
|
|
Packit |
b89d10 |
* documentation and/or other materials provided with the distribution.
|
|
Packit |
b89d10 |
*
|
|
Packit |
b89d10 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
Packit |
b89d10 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
b89d10 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
Packit |
b89d10 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
Packit |
b89d10 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
b89d10 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
Packit |
b89d10 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
Packit |
b89d10 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
Packit |
b89d10 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
Packit |
b89d10 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
Packit |
b89d10 |
* SUCH DAMAGE.
|
|
Packit |
b89d10 |
*/
|
|
Packit |
b89d10 |
|
|
Packit |
b89d10 |
#include "regenc.h"
|
|
Packit |
b89d10 |
|
|
Packit |
b89d10 |
#define ENC_IS_ISO_8859_8_CTYPE(code,ctype) \
|
|
Packit |
b89d10 |
((EncISO_8859_8_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0)
|
|
Packit |
b89d10 |
|
|
Packit |
b89d10 |
static const unsigned short EncISO_8859_8_CtypeTable[256] = {
|
|
Packit |
b89d10 |
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
|
|
Packit |
b89d10 |
0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008,
|
|
Packit |
b89d10 |
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
|
|
Packit |
b89d10 |
0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008,
|
|
Packit |
b89d10 |
0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
|
|
Packit |
b89d10 |
0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
|
|
Packit |
b89d10 |
0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0,
|
|
Packit |
b89d10 |
0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0,
|
|
Packit |
b89d10 |
0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2,
|
|
Packit |
b89d10 |
0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
|
|
Packit |
b89d10 |
0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2,
|
|
Packit |
b89d10 |
0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0,
|
|
Packit |
b89d10 |
0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2,
|
|
Packit |
b89d10 |
0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
|
|
Packit |
b89d10 |
0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2,
|
|
Packit |
b89d10 |
0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008,
|
|
Packit |
b89d10 |
0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
|
|
Packit |
b89d10 |
0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
|
|
Packit |
b89d10 |
0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
|
|
Packit |
b89d10 |
0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008,
|
|
Packit |
b89d10 |
0x0284, 0x0000, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0, 0x00a0,
|
|
Packit |
b89d10 |
0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0,
|
|
Packit |
b89d10 |
0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x00a0, 0x30e2, 0x00a0, 0x01a0,
|
|
Packit |
b89d10 |
0x00a0, 0x10a0, 0x00a0, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x0000,
|
|
Packit |
b89d10 |
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
|
Packit |
b89d10 |
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
|
Packit |
b89d10 |
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
|
Packit |
b89d10 |
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01a0,
|
|
Packit |
b89d10 |
0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
|
|
Packit |
b89d10 |
0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
|
|
Packit |
b89d10 |
0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2, 0x30a2,
|
|
Packit |
b89d10 |
0x30a2, 0x30a2, 0x30a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
|
|
Packit |
b89d10 |
};
|
|
Packit |
b89d10 |
|
|
Packit |
b89d10 |
static int
|
|
Packit |
b89d10 |
is_code_ctype(OnigCodePoint code, unsigned int ctype)
|
|
Packit |
b89d10 |
{
|
|
Packit |
b89d10 |
if (code < 256)
|
|
Packit |
b89d10 |
return ENC_IS_ISO_8859_8_CTYPE(code, ctype);
|
|
Packit |
b89d10 |
else
|
|
Packit |
b89d10 |
return FALSE;
|
|
Packit |
b89d10 |
}
|
|
Packit |
b89d10 |
|
|
Packit |
b89d10 |
OnigEncodingType OnigEncodingISO_8859_8 = {
|
|
Packit |
b89d10 |
onigenc_single_byte_mbc_enc_len,
|
|
Packit |
b89d10 |
"ISO-8859-8", /* name */
|
|
Packit |
b89d10 |
1, /* max enc length */
|
|
Packit |
b89d10 |
1, /* min enc length */
|
|
Packit |
b89d10 |
onigenc_is_mbc_newline_0x0a,
|
|
Packit |
b89d10 |
onigenc_single_byte_mbc_to_code,
|
|
Packit |
b89d10 |
onigenc_single_byte_code_to_mbclen,
|
|
Packit |
b89d10 |
onigenc_single_byte_code_to_mbc,
|
|
Packit |
b89d10 |
onigenc_ascii_mbc_case_fold,
|
|
Packit |
b89d10 |
onigenc_ascii_apply_all_case_fold,
|
|
Packit |
b89d10 |
onigenc_ascii_get_case_fold_codes_by_str,
|
|
Packit |
b89d10 |
onigenc_minimum_property_name_to_ctype,
|
|
Packit |
b89d10 |
is_code_ctype,
|
|
Packit |
b89d10 |
onigenc_not_support_get_ctype_code_range,
|
|
Packit |
b89d10 |
onigenc_single_byte_left_adjust_char_head,
|
|
Packit |
b89d10 |
onigenc_always_true_is_allowed_reverse_match,
|
|
Packit |
b89d10 |
NULL, /* init */
|
|
Packit |
b89d10 |
NULL, /* is_initialized */
|
|
Packit |
b89d10 |
onigenc_always_true_is_valid_mbc_string,
|
|
Packit |
b89d10 |
ENC_FLAG_ASCII_COMPATIBLE,
|
|
Packit |
b89d10 |
0, 0
|
|
Packit |
b89d10 |
};
|