X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fstream.c;fp=src%2Fstream.c;h=7e61dc93b9a4b5183b8e99cc3b9c82571aea6546;hb=8bf874cd9d56a5850bc474df37642170a4c20b28;hp=e51d1f1a9077c43cd86ad2def9854c90cb924e58;hpb=e47eebee2f127d0c1d4825d9bdc41471b6d7f3c1;p=rodin%2Fchimara.git diff --git a/src/stream.c b/src/stream.c index e51d1f1..7e61dc9 100644 --- a/src/stream.c +++ b/src/stream.c @@ -118,6 +118,20 @@ glk_put_char(unsigned char ch) glk_put_char_stream(glk_data->current_stream, ch); } +/** + * glk_put_char_uni: + * @ch: A Unicode code point. + * + * Prints one character to the current stream. The character is assumed to be a + * Unicode code point. + */ +void +glk_put_char_uni(glui32 ch) +{ + g_return_if_fail(glk_data->current_stream != NULL); + glk_put_char_stream_uni(glk_data->current_stream, ch); +} + /** * glk_put_string: * @s: A null-terminated string in Latin-1 encoding. @@ -137,6 +151,21 @@ glk_put_string(char *s) glk_put_string_stream(glk_data->current_stream, s); } +/** + * glk_put_string_uni: + * @s: A zero-terminated string of Unicode code points. + * + * Prints a string of Unicode characters to the current stream. It is equivalent + * to a series of glk_put_char_uni() calls. A string ends on a #glui32 whose + * value is 0. + */ +void +glk_put_string_uni(glui32 *s) +{ + g_return_if_fail(glk_data->current_stream != NULL); + glk_put_string_stream_uni(glk_data->current_stream, s); +} + /** * glk_put_buffer: * @buf: An array of characters in Latin-1 encoding. @@ -157,6 +186,21 @@ glk_put_buffer(char *buf, glui32 len) glk_put_buffer_stream(glk_data->current_stream, buf, len); } +/** + * glk_put_buffer_uni: + * @buf: An array of Unicode code points. + * @len: Length of @buf. + * + * Prints a block of Unicode characters to the current stream. It is equivalent + * to a series of glk_put_char_uni() calls. + */ +void +glk_put_buffer_uni(glui32 *buf, glui32 len) +{ + g_return_if_fail(glk_data->current_stream != NULL); + glk_put_buffer_stream_uni(glk_data->current_stream, buf, len); +} + /** * glk_stream_open_memory: * @buf: An allocated buffer, or %NULL.