Ignore:
Timestamp:
Feb 14, 2006 9:03:15 PM (18 years ago)
Author:
bennylp
Message:

Changed the unicode functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/unicode.h

    r126 r181  
    2121 
    2222#include <pj/types.h> 
     23 
     24 
     25PJ_BEGIN_DECL 
     26 
    2327 
    2428/** 
     
    5761#if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0 
    5862 
    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( \ 
     63#   define PJ_DECL_UNICODE_TEMP_BUF(buf,size)   wchar_t buf[size]; 
     64#   define PJ_STRING_TO_NATIVE(s,buf,max)       pj_ansi_to_unicode( \ 
    6165                                                    s, strlen(s), \ 
    62                                                     buf, PJ_ARRAY_SIZE(buf)) 
    63 #   define PJ_TEXT(s)                            _TEXT(s) 
     66                                                    buf, max) 
     67#   define PJ_DECL_ANSI_TEMP_BUF(buf,size)      char buf[size]; 
     68#   define PJ_NATIVE_TO_STRING(cs,buf,max)      pj_unicode_to_ansi( \ 
     69                                                    cs, wcslen(cs), \ 
     70                                                    buf, max) 
    6471 
    6572#else 
    6673 
    6774#   define PJ_DECL_UNICODE_TEMP_BUF(var,size) 
    68 #   define PJ_STRING_TO_NATIVE(s, buf)          (s) 
    69 #   define PJ_TEXT(s)                           (s) 
     75#   define PJ_STRING_TO_NATIVE(s,buf,max)       ((char*)s) 
     76#   define PJ_DECL_ANSI_TEMP_BUF(buf,size) 
     77#   define PJ_NATIVE_TO_STRING(cs,buf,max)      ((char*)(const char*)cs) 
    7078 
    7179#endif 
     
    7381 
    7482 
     83PJ_END_DECL 
     84 
     85 
    7586#endif  /* __PJ_UNICODE_H__ */ 
Note: See TracChangeset for help on using the changeset viewer.