Back to index

php5  5.3.10
ascii.c
Go to the documentation of this file.
00001 /**********************************************************************
00002   ascii.c -  Oniguruma (regular expression library)
00003 **********************************************************************/
00004 /*-
00005  * Copyright (c) 2002-2004  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  */
00029 
00030 #include "regenc.h"
00031 
00032 static int
00033 ascii_is_code_ctype(OnigCodePoint code, unsigned int ctype)
00034 {
00035   if (code < 128)
00036     return ONIGENC_IS_ASCII_CODE_CTYPE(code, ctype);
00037   else
00038     return FALSE;
00039 }
00040 
00041 OnigEncodingType OnigEncodingASCII = {
00042   onigenc_single_byte_mbc_enc_len,
00043   "US-ASCII",  /* name */
00044   1,           /* max byte length */
00045   1,           /* min byte length */
00046   ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE,
00047   {
00048       (OnigCodePoint )'\\'                       /* esc */
00049     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.'  */
00050     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*'  */
00051     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
00052     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
00053     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
00054   },
00055   onigenc_is_mbc_newline_0x0a,
00056   onigenc_single_byte_mbc_to_code,
00057   onigenc_single_byte_code_to_mbclen,
00058   onigenc_single_byte_code_to_mbc,
00059   onigenc_ascii_mbc_to_normalize,
00060   onigenc_ascii_is_mbc_ambiguous,
00061   onigenc_ascii_get_all_pair_ambig_codes,
00062   onigenc_nothing_get_all_comp_ambig_codes,
00063   ascii_is_code_ctype,
00064   onigenc_not_support_get_ctype_code_range,
00065   onigenc_single_byte_left_adjust_char_head,
00066   onigenc_always_true_is_allowed_reverse_match
00067 };