Lingua-KO-Hangul-Util

 view release on metacpan or  search on metacpan

Util.xsX  view on Meta::CPAN

composeJamo(src)
    SV * src
  PROTOTYPE: $
  PREINIT:
    SV *dst;
    U8 *s, *p, *e, *d;
    UV uv;
    STRLEN srclen, dstlen, retlen;
    LKHU_CompStruct *i, *complist;
    bool fcomposed;
  PPCODE:
    s = (U8*)sv_2pvunicode(src,&srclen);
    e = s + srclen;

    dstlen = srclen + 1; /* equal or shorter */
    dst = newSV(dstlen);
    SvPOK_only(dst);
    SvUTF8_on(dst);
    d = (U8*)SvPVX(dst);

    for (p = s; p < e;) {

Util.xsX  view on Meta::CPAN


void
composeSyllable(src)
    SV * src
  PROTOTYPE: $
  PREINIT:
    SV *dst;
    U8 *s, *p, *e, *d;
    UV lastuv, nextuv, lindex, vindex, tindex;
    STRLEN srclen, dstlen, curlen, retlen;
  PPCODE:
    s = (U8*)sv_2pvunicode(src,&srclen);
    e = s + srclen;

    dstlen = srclen + 1; /* equal or shorter */
    dst = newSV(dstlen);
    SvPOK_only(dst);
    SvUTF8_on(dst);
    d = (U8*)SvPVX(dst);

    for (p = s; p < e; ) {

Util.xsX  view on Meta::CPAN

void
decomposeHangul(code)
    UV code
  PROTOTYPE: $
  PREINIT:
    UV sindex, lindex, vindex, tindex;
    SV *decomp;
    U8 *t, temp[3 * UTF8_MAXLEN + 1];
    STRLEN tlen;
    int notwantarray;
  PPCODE:
    notwantarray = (GIMME_V != G_ARRAY);
    if (! Hangul_IsS(code)) {
	if (notwantarray)
	    XSRETURN_UNDEF;
	else
	    XSRETURN_EMPTY;
    }

    sindex = code - Hangul_SBase;
    lindex =  sindex / Hangul_NCount;

Util.xsX  view on Meta::CPAN

    } /* decomposeHangul */


void
getHangulComposite(uv,uv2)
    UV uv
    UV uv2
  PROTOTYPE: $$
  PREINIT:
    UV ret_uv;
  PPCODE:
    ret_uv = compositeHangul(uv, uv2);
    if (ret_uv)
	XPUSHs(sv_2mortal(newSVuv(ret_uv)));
    else
	XSRETURN_UNDEF;


SV*
getHangulName(code)
    UV code



( run in 2.693 seconds using v1.01-cache-2.11-cpan-71847e10f99 )