From 654da2ffb5abf2afe9532f1d0cb77ed88f8a97cc Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 28 Jan 2014 21:40:13 +0000 Subject: move utf8 conversion routines to use nserror instead of their own error enum --- windows/font.c | 10 +++++----- windows/font.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'windows') diff --git a/windows/font.c b/windows/font.c index c99cec7cf..98269a35f 100644 --- a/windows/font.c +++ b/windows/font.c @@ -35,7 +35,7 @@ #include "windows/gui.h" #include "windows/plot.h" -utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font, +nserror utf8_to_font_encoding(const struct font_desc* font, const char *string, size_t len, char **result) @@ -43,14 +43,14 @@ utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font, return utf8_to_enc(string, font->encoding, len, result); } -utf8_convert_ret utf8_to_local_encoding(const char *string, +nserror utf8_to_local_encoding(const char *string, size_t len, char **result) { return utf8_to_enc(string, "UCS-2", len, result); } -utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len, +nserror utf8_from_local_encoding(const char *string, size_t len, char **result) { assert(string && result); @@ -60,9 +60,9 @@ utf8_convert_ret utf8_from_local_encoding(const char *string, size_t len, *result = strndup(string, len); if (!(*result)) - return UTF8_CONVERT_NOMEM; + return NSERROR_NOMEM; - return UTF8_CONVERT_OK; + return NSERROR_OK; } HFONT get_font(const plot_font_style_t *style) diff --git a/windows/font.h b/windows/font.h index 4bd100f6a..45428fede 100644 --- a/windows/font.h +++ b/windows/font.h @@ -29,7 +29,7 @@ struct font_desc { const char *encoding; }; -extern utf8_convert_ret utf8_to_font_encoding(const struct font_desc* font, +extern nserror utf8_to_font_encoding(const struct font_desc* font, const char *string, size_t len, char **result); -- cgit v1.2.3