File: conv-util.c

package info (click to toggle)
kakasi 2.3.6-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,560 kB
  • sloc: sh: 11,430; ansic: 6,734; makefile: 125
file content (60 lines) | stat: -rw-r--r-- 1,449 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 * KAKASI (Kanji Kana Simple inversion program)
 * $Id: conv-util.c,v 1.2 2001-01-16 07:51:47 rug Exp $
 * Copyright (C) 1992
 * Hironobu Takahashi (takahasi@tiny.or.jp)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either versions 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with KAKASI, see the file COPYING.  If not, write to the Free
 * Software Foundation Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

#include <stdio.h>
#include "conv-util.h"

int
isallkana(str)
     unsigned char *str;
{
    while(*str) {
	if (str[0] <= 0xa0) return 0;
	if (str[1] <= 0xa0) return 0;
	if ((str[0] != 0xa4) && (str[0] != 0xa5)) return 0;
	str += 2;
    }
    return 1;
}

int
isallzenkaku(str)
     unsigned char *str;
{
    while(*str) {
	if (str[0] <= 0xa0) return 0;
	if (str[1] <= 0xa0) return 0;
	str += 2;
    }
    return 1;
}

int
includekanji(str)
     unsigned char *str;
{
    while(*str) {
	if (str[0] >= 0xb0) return 1;
	str += 2;
    }
    return 0;
}