diff options
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/rune.c | 19 | ||||
| -rw-r--r-- | src/runtime/runtime.h | 6 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/runtime/rune.c b/src/runtime/rune.c index 2c717d7a95..3e1fb14d63 100644 --- a/src/runtime/rune.c +++ b/src/runtime/rune.c @@ -222,3 +222,22 @@ runetochar(byte *str, int32 rune) /* note: in original, arg2 was pointer */ str[3] = Tx | (c & Maskx); return 4; } + +/* + * Wrappers for calling from go + */ +void +sys·bytestorune(byte *str, int32 off, int32 length, int32 outrune, int32 outcount) +{ + outcount = charntorune(&outrune, str + off, length); + FLUSH(&outrune); + FLUSH(&outcount); +} + +void +sys·stringtorune(string str, int32 off, int32 length, int32 outrune, int32 outcount) +{ + outcount = charntorune(&outrune, str->str + off, length); + FLUSH(&outrune); + FLUSH(&outcount); +} diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index dc8f88bb7a..14e8f177be 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -142,4 +142,10 @@ void sys·intstring(int64, string); void sys·ifaces2i(Sigi*, Sigs*, Map*, void*); void sys·ifacei2i(Sigi*, Map*, void*); void sys·ifacei2s(Sigs*, Map*, void*); + +/* + * User go-called + */ void sys·readfile(string, string, bool); +void sys·bytestorune(byte*, int32, int32, int32, int32); +void sys·stringtorune(string, int32, int32, int32, int32); |
