// // aegis - project change supervisor // Copyright (C) 2014 Peter Miller // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or (at // your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program. If not, see . // #ifndef COMMON_MULTIBYTE_H #define COMMON_MULTIBYTE_H #include /** * @brief * wide string to multi-byte C string * * The wstr_to_mbs function convers a wide character string into a * multi-byte C string. The conversion is done in the current locale. * The result is NUL terminated, however the result length does not * include the NUL. * * @note * DO NOT free the result. The result will change between calls, * so copy it if you need to keep it. * @sa * wctomb(3), * wcstombs(3) */ void wcs_to_mbs(const wchar_t *text, size_t text_size, char **result, size_t *result_size); /** * The mbs_to_wcs function is used to make a string from an array of * characters. No NUL terminator is assumed. The conversion from * muti-byte to wide characters is done in the current locale. * * @note * The contents of the structure pointed to MUST NOT be altered. * @sa * mbtowc(3), * mbstowcs(3) */ void mbs_to_wcs(const char *text, size_t text_size, wchar_t **result, size_t *result_size); // vim: set ts=8 sw=4 et : #endif // COMMON_MULTIBYTE_H