1RKMAPROMA(3) Library Functions Manual RKMAPROMA(3)
2
3
4
6 RkMapRoma - perform Romaji-kana conversion by using a specified Romaji-
7 kana conversion table
8
10 #include <canna/RK.h>
11 int RkMapRoma(romaji, dst, maxdst, src, srclen, flags, status)
12 struct RkRxDic *romaji;
13 unsigned char *dst;
14 int maxdst;
15 unsigned char *src;
16 int srclen;
17 int flags;
18 int *status;
19
21 RkMapRoma performs Romaji-kana conversion by using a specified Romaji-
22 kana conversion table. romaji specifies a pointer to the Romaji-kana
23 conversion table that has been returned by RkOpenRoma(3). RkMapRoma
24 interprets the srclen bytes of contiguous data starting at the area src
25 as a Romaji character string and searches through the Romaji-kana con‐
26 version table for the rule of Romaji-kana conversion that matches the
27 beginning of the Romaji character string. If the corresponding conver‐
28 sion rule is found, the corresponding kana character string is stored
29 in the area dst. The resulting character string is truncated when its
30 byte length exceeds maxdst -1. dst is padded with null characters at
31 the end if possible.
32
33 flags is a combination of the following Romaji-kana conversion flags
34 connected by or:
35
36 RK_SOKUON Enables gemination, in which a sequence of two
37 occurrences of the same character, xx, is con‐
38 verted to small kana character "tsu" only if it
39 is not defined in the Romaji-kana conversion ta‐
40 ble file.
41
42 RK_FLUSH Converts all Romaji characters compulsorily.
43 Useful for handling n appearing at the end of a
44 character string.
45
46 The flags listed below specify the type of characters stored in src.
47 These specified code conversion to be performed on the character string
48 derived from the Romaji-kana conversion table. These flags can use one
49 by one.
50
51 RK_NFER No conversion
52
53 RK_XFER Hiragana
54
55 RK_HFER Single-byte character
56
57 RK_KFER Katakana
58
59 RK_ZFER Double-byte character
60
61 status is set to the byte length of the character string set in the
62 area dst. A negative value means that there is no matching Romaji
63 character string.
64
66 This function returns the starting byte length of the Romaji character
67 string matched by Romaji-kana conversion.
68
69
70
71 RKMAPROMA(3)