| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 #ifndef PPAPI_C_DEV_PPB_CHAR_SET_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_CHAR_SET_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_CHAR_SET_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_CHAR_SET_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/c/pp_macros.h" | 9 #include "ppapi/c/pp_macros.h" |
| 10 #include "ppapi/c/pp_stdint.h" | 10 #include "ppapi/c/pp_stdint.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Replaces the error or unrepresentable character with a substitution | 29 // Replaces the error or unrepresentable character with a substitution |
| 30 // character. When converting to a Unicode character set (UTF-8 or UTF-16) | 30 // character. When converting to a Unicode character set (UTF-8 or UTF-16) |
| 31 // it will use the unicode "substitution character" U+FFFD. When converting | 31 // it will use the unicode "substitution character" U+FFFD. When converting |
| 32 // to another character set, the character will be charset-specific. For | 32 // to another character set, the character will be charset-specific. For |
| 33 // many languages this will be the representation of the '?' character. | 33 // many languages this will be the representation of the '?' character. |
| 34 PP_CHARSET_CONVERSIONERROR_SUBSTITUTE | 34 PP_CHARSET_CONVERSIONERROR_SUBSTITUTE |
| 35 }; | 35 }; |
| 36 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_CharSet_ConversionError, 4); | 36 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_CharSet_ConversionError, 4); |
| 37 | 37 |
| 38 struct PPB_CharSet_Dev { | 38 struct PPB_CharSet_Dev_0_4 { |
| 39 // Converts the UTF-16 string pointed to in |*utf16| to an 8-bit string in the | 39 // Converts the UTF-16 string pointed to in |*utf16| to an 8-bit string in the |
| 40 // specified code page. |utf16_len| is measured in UTF-16 units, not bytes. | 40 // specified code page. |utf16_len| is measured in UTF-16 units, not bytes. |
| 41 // This value may not be NULL. | 41 // This value may not be NULL. |
| 42 // | 42 // |
| 43 // The return value is a NULL-terminated 8-bit string corresponding to the | 43 // The return value is a NULL-terminated 8-bit string corresponding to the |
| 44 // new character set, or NULL on failure. THIS STRING MUST BE FREED USING | 44 // new character set, or NULL on failure. THIS STRING MUST BE FREED USING |
| 45 // PPB_Core::MemFree(). The length of the returned string, not including the | 45 // PPB_Core::MemFree(). The length of the returned string, not including the |
| 46 // terminating NULL, will be placed into *output_length. When there is no | 46 // terminating NULL, will be placed into *output_length. When there is no |
| 47 // error, the result will always be non-NULL, even if the output is 0-length. | 47 // error, the result will always be non-NULL, even if the output is 0-length. |
| 48 // In this case, it will only contain the terminator. You must still call | 48 // In this case, it will only contain the terminator. You must still call |
| (...skipping 24 matching lines...) Expand all Loading... |
| 73 | 73 |
| 74 // Returns a string var representing the current multi-byte character set of | 74 // Returns a string var representing the current multi-byte character set of |
| 75 // the current system. | 75 // the current system. |
| 76 // | 76 // |
| 77 // WARNING: You really shouldn't be using this function unless you're dealing | 77 // WARNING: You really shouldn't be using this function unless you're dealing |
| 78 // with legacy data. You should be using UTF-8 or UTF-16 and you don't have | 78 // with legacy data. You should be using UTF-8 or UTF-16 and you don't have |
| 79 // to worry about the character sets. | 79 // to worry about the character sets. |
| 80 struct PP_Var (*GetDefaultCharSet)(PP_Instance instance); | 80 struct PP_Var (*GetDefaultCharSet)(PP_Instance instance); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 typedef struct PPB_CharSet_Dev_0_4 PPB_CharSet_Dev; |
| 84 |
| 83 #endif /* PPAPI_C_DEV_PPB_CHAR_SET_DEV_H_ */ | 85 #endif /* PPAPI_C_DEV_PPB_CHAR_SET_DEV_H_ */ |
| 84 | |
| OLD | NEW |