summaryrefslogtreecommitdiff
path: root/pjlib/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-02-14 21:03:15 +0000
committerBenny Prijono <bennylp@teluu.com>2006-02-14 21:03:15 +0000
commitcec9d0501ccdf37cb82e398df6ec4e5bd4e1ac01 (patch)
tree9b4a597308d873fdb95d888dc0cc377f2d6ef02f /pjlib/include
parent651dcb6f4a4e36b5cb7b604a30c7107333fbebc4 (diff)
Changed the unicode functions
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@181 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r--pjlib/include/pj/unicode.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/pjlib/include/pj/unicode.h b/pjlib/include/pj/unicode.h
index 362c225d..e70f5fb5 100644
--- a/pjlib/include/pj/unicode.h
+++ b/pjlib/include/pj/unicode.h
@@ -21,6 +21,10 @@
#include <pj/types.h>
+
+PJ_BEGIN_DECL
+
+
/**
* @file unicode.h
* @brief Provides Unicode conversion for Unicode OSes
@@ -56,20 +60,27 @@ PJ_DECL(char*) pj_unicode_to_ansi(const wchar_t *wstr, pj_size_t len,
#if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0
-# define PJ_DECL_UNICODE_TEMP_BUF(buf,size) wchar_t buf[size]
-# define PJ_STRING_TO_NATIVE(s,buf) pj_ansi_to_unicode( \
+# define PJ_DECL_UNICODE_TEMP_BUF(buf,size) wchar_t buf[size];
+# define PJ_STRING_TO_NATIVE(s,buf,max) pj_ansi_to_unicode( \
s, strlen(s), \
- buf, PJ_ARRAY_SIZE(buf))
-# define PJ_TEXT(s) _TEXT(s)
+ buf, max)
+# define PJ_DECL_ANSI_TEMP_BUF(buf,size) char buf[size];
+# define PJ_NATIVE_TO_STRING(cs,buf,max) pj_unicode_to_ansi( \
+ cs, wcslen(cs), \
+ buf, max)
#else
# define PJ_DECL_UNICODE_TEMP_BUF(var,size)
-# define PJ_STRING_TO_NATIVE(s, buf) (s)
-# define PJ_TEXT(s) (s)
+# define PJ_STRING_TO_NATIVE(s,buf,max) ((char*)s)
+# define PJ_DECL_ANSI_TEMP_BUF(buf,size)
+# define PJ_NATIVE_TO_STRING(cs,buf,max) ((char*)(const char*)cs)
#endif
+PJ_END_DECL
+
+
#endif /* __PJ_UNICODE_H__ */