Ignore:
Timestamp:
Jan 20, 2006 9:03:36 PM (18 years ago)
Author:
bennylp
Message:

Completed testing for WinCE port

File:
1 moved

Legend:

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

    r125 r126  
    1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
    1818 */ 
    19 #ifndef __PJ_COMPAT_UNICODE_H__ 
    20 #define __PJ_COMPAT_UNICODE_H__ 
     19#ifndef __PJ_UNICODE_H__ 
     20#define __PJ_UNICODE_H__ 
    2121 
    2222#include <pj/types.h> 
     
    2727 */ 
    2828 
     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 */ 
     39PJ_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 */ 
     53PJ_DECL(char*) pj_unicode_to_ansi(const wchar_t *wstr, pj_size_t len, 
     54                                  char *buf, pj_size_t buf_size); 
     55 
     56 
    2957#if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0 
    3058 
    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) 
    3364 
    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 
    3866 
    3967#   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) 
    4170 
    42 #endif  /* PJ_NATIVE_STRING_IS_UNICODE */ 
     71#endif 
    4372 
    4473 
    45 #endif  /* __PJ_COMPAT_UNICODE_H__ */ 
     74 
     75#endif  /* __PJ_UNICODE_H__ */ 
Note: See TracChangeset for help on using the changeset viewer.