Changeset 126 for pjproject/trunk/pjlib/include/pj/unicode.h
- Timestamp:
- Jan 20, 2006 9:03:36 PM (18 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/unicode.h
r125 r126 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJ_ COMPAT_UNICODE_H__20 #define __PJ_ COMPAT_UNICODE_H__19 #ifndef __PJ_UNICODE_H__ 20 #define __PJ_UNICODE_H__ 21 21 22 22 #include <pj/types.h> … … 27 27 */ 28 28 29 /** 30 * Convert ANSI strings to Unicode strings. 31 * 32 * @param str The ANSI string to be converted. 33 * @param len The length of the input string. 34 * @param wbuf Buffer to hold the Unicode string output. 35 * @param wbuf_count Buffer size, in number of elements (not bytes). 36 * 37 * @return The Unicode string, NULL terminated. 38 */ 39 PJ_DECL(wchar_t*) pj_ansi_to_unicode(const char *str, pj_size_t len, 40 wchar_t *wbuf, pj_size_t wbuf_count); 41 42 43 /** 44 * Convert Unicode string to ANSI string. 45 * 46 * @param wstr The Unicode string to be converted. 47 * @param len The length of the input string. 48 * @param buf Buffer to hold the ANSI string output. 49 * @param buf_size Size of the output buffer. 50 * 51 * @return The ANSI string, NULL terminated. 52 */ 53 PJ_DECL(char*) pj_unicode_to_ansi(const wchar_t *wstr, pj_size_t len, 54 char *buf, pj_size_t buf_size); 55 56 29 57 #if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0 30 58 31 # define PJ_DECL_UNICODE_TEMP_BUF(var,size) wchar_t var[size] 32 # define PJ_NATIVE_STRING(s,buf) pj_ansi_to_unicode(s,buf,PJ_ARRAY_SIZE(buf)) 59 # define PJ_DECL_UNICODE_TEMP_BUF(buf,size) wchar_t buf[size] 60 # define PJ_STRING_TO_NATIVE(s,buf) pj_ansi_to_unicode( \ 61 s, strlen(s), \ 62 buf, PJ_ARRAY_SIZE(buf)) 63 # define PJ_TEXT(s) _TEXT(s) 33 64 34 PJ_DECL(wchar_t*) pj_ansi_to_unicode(const char *s, wchar_t *buf, 35 pj_size_t buf_count); 36 37 #else /* PJ_NATIVE_STRING_IS_UNICODE */ 65 #else 38 66 39 67 # define PJ_DECL_UNICODE_TEMP_BUF(var,size) 40 # define PJ_NATIVE_STRING(s, buf) s 68 # define PJ_STRING_TO_NATIVE(s, buf) (s) 69 # define PJ_TEXT(s) (s) 41 70 42 #endif /* PJ_NATIVE_STRING_IS_UNICODE */71 #endif 43 72 44 73 45 #endif /* __PJ_COMPAT_UNICODE_H__ */ 74 75 #endif /* __PJ_UNICODE_H__ */
Note: See TracChangeset
for help on using the changeset viewer.