RKBGNBUN(3)
π RKBGNBUN β bestie, it's giving "kanji conversion time" β¨
okay so this one is from the Library Functions Manual, page RKBGNBUN(3), and we're about to convert readings into kanji. buckle up π
πΈ NAME πΈ
RkBgnBun, RkwBgnBun β convert the reading of a specified length to kanji π
π¦ SYNOPSIS π¦
#include <canna/RK.h>
int RkBgnBun(cxnum, yomi, maxyomi, mode)
int cxnum;
unsigned char *yomi;
int maxyomi;
int mode;
int RkwBgnBun(cxnum, yomi, maxyomi, mode)
int cxnum;
wchar_t *yomi;
int maxyomi;
int mode;
β¨ DESCRIPTION β¨
RkBgnBun takes your reading yomi β that's maxyomi bytes long, bestie β and turns it into kanji. no cap. π«Ά
β οΈ tiny little detail that will absolutely wreck your day if you ignore it: the reading kana must be adjusted on character boundaries in the EUC code. so like, don't slice it mid-character. that's the vibe check. π
when it runs, the context enters the conversion mode, and both the current clause and the current clause set get set to 0. iconic.
RkwBgnBun is the sibling function β same energy, but it takes a wchar_t argument as yomi instead. and for this one, maxyomi represents the length of yomi by characters instead of bytes. character girlies, this one's for you π§
π the mode thing π
mode represents the code conversion candidate to be added to each clause. it's expressed in a bit field width, and you can set it to one of these with RK_XFERBITS:
RK_XFERβ HiraganaRK_HFERβ Single-width characterRK_KFERβ KatakanaRK_ZFERβ Double-width character
π how candidates get added (the lore) π
so if the number of candidates available for the current clause is N, candidates get added through code conversion by reading the candidates in sequence β from candidate N to candidate N + 1, and so on β starting with the lowest-order bit field. π
candidate addition ends when the corresponding bit field equals 0. that's the periodt. π
the mapping is literally this:
RK_XFERβ Candidate:(KANJI) (HIRAGANA)(RK_XFER << RK_XFERBITS) | RK_KFERβ Candidate:(KANJI) (KATAKANA) (HIRAGANA)(RK_KFER << RK_XFERBITS) | RK_XFERβ Candidate:(KANJI) (HIRAGANA) (KATAKANA)
π one more thing, fr fr π
the context enters the conversion mode, and it stays in it from RkBgnBun all the way to RkEndBun(3). π
π¨ conversion modes cannot be nested. not a suggestion. not a vibe. it's a rule, and the nesting will simply not happen. π
β RETURN VALUE β
this function returns the number of clauses derived from conversion π₯³ β¦ or it returns -1 if the conversion fails. and yeah, -1 is the "we don't talk about it" number. π
π SEE ALSO π
that's the whole page, bestie β no notes, you ate π β¨
anyway, this was RKBGNBUN(3) from the Library Functions Manual, and the page footer just says RKBGNBUN(3) right back at you π¦ (no date, no version β the manual keeps it mysterious, and honestly? main character energy π). mwah, go convert something ππ
π¦ where this page comes from
- debian bookworm: libcanna1g-dev 3.7p3-20 Β· ISC
- debian trixie: libcanna1g-dev 3.7p3-25 Β· ISC
- ubuntu jammy: libcanna1g-dev 3.7p3-17 Β· ISC
- ubuntu noble: libcanna1g-dev 3.7p3-20 Β· ISC
- ubuntu questing: libcanna1g-dev 3.7p3-26
- ubuntu resolute: libcanna1g-dev 3.7p3-26build1 Β· ISC
- ubuntu stonking: libcanna1g-dev 3.7p3-29 Β· ISC
- Copyright 1994 NEC Corporation, Tokyo, Japan
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms