1 #ifndef __EVIL_UTIL_H__ 2 #define __EVIL_UTIL_H__ 3 4 5 /** 6 * @brief Convert a string from char * to wchar_t *. 7 * 8 * @param text The string to convert. 9 * @return The converted string. 10 * 11 * Convert a string from char * to wchar_t * and return it. If the 12 * allocation or conversion fails, NULL is returned. On success, the 13 * returned value must be freed when it is not used anymore. 14 * 15 * Conformity: Non applicable. 16 * 17 * Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, 18 * Windows XP. 19 * 20 * @ingroup Evil 21 */ 22 EAPI wchar_t *evil_char_to_wchar(const char *text); 23 24 /** 25 * @brief Convert a string from wchar_t * to char *. 26 * 27 * @param text The string to convert. 28 * @return The converted string. 29 * 30 * Convert a string from wchar_t * to char * and return it. If the 31 * allocation or conversion fails, NULL is returned. On success, the 32 * returned value must be freed when it is not used anymore. 33 * 34 * Conformity: Non applicable. 35 * 36 * Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, 37 * Windows XP. 38 * 39 * @ingroup Evil 40 */ 41 EAPI char *evil_wchar_to_char(const wchar_t *text); 42 43 /** 44 * @brief Convert a string from UTF-16 to UTF-8. 45 * 46 * @param text The string to convert in UTF-16. 47 * @return The converted string in UTF-8. 48 * 49 * Convert a string from UTF-16 to UTF-8 and return it. If the 50 * allocation or conversion fails, NULL is returned. On success, the 51 * returned value must be freed when it is not used anymore. 52 * 53 * Conformity: Non applicable. 54 * 55 * Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, 56 * Windows XP. 57 * 58 * @ingroup Evil 59 */ 60 EAPI char *evil_utf16_to_utf8(const wchar_t *text); 61 62 /** 63 * @brief Convert a string from UTF-8 to UTF-16. 64 * 65 * @param text The string to convert in UTF-8. 66 * @return The converted string in UTF-16. 67 * 68 * Convert a string from UTF-8 to UTF-16 and return it. If the 69 * allocation or conversion fails, NULL is returned. On success, the 70 * returned value must be freed when it is not used anymore. 71 * 72 * Conformity: Non applicable. 73 * 74 * @since 1.24 75 * 76 * @ingroup Evil 77 */ 78 EAPI wchar_t *evil_utf8_to_utf16(const char *text); 79 80 EAPI const char *evil_format_message(long err); 81 82 EAPI const char *evil_last_error_get(void); 83 84 /** 85 * @brief check if the given path is absolute. 86 * 87 * @param path The path to check. 88 * @return 1 if the given path is absolute, 0 otherwise. 89 * 90 * Check if the path @p path is absolute or not. An absolute path must 91 * begin with a letter (upper or lower case), followed by by the char 92 * ':', followed by the char '/' or '\'. If @p path is absolute this 93 * function returns 1, otherwise it returns 0. If @p path is @c NULL, 94 * it returns 0. 95 * 96 * Conformity: Non applicable. 97 * 98 * Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, 99 * Windows XP. 100 * 101 * @since 1.7 102 * 103 * @ingroup Evil 104 */ 105 EAPI int evil_path_is_absolute(const char *path); 106 107 #endif /* __EVIL_UTIL_H__ */ 108