Ignore:
Timestamp:
Sep 5, 2001, 4:16:46 PM (24 years ago)
Author:
bird
Message:

Added $Id:$ keyword.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/avifil32/string.c

    r6386 r6652  
     1/* $Id: string.c,v 1.2 2001-09-05 14:16:46 bird Exp $ */
    12/*
    23 * Copyright 2001 Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
     
    2425INT AVIFILE_strlenAtoW( LPCSTR lpstr )
    2526{
    26         INT     len;
     27    INT len;
    2728
    28         len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, NULL, 0 );
    29         return ( len > 0 ) ? (len-1) : 0;
     29    len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, NULL, 0 );
     30    return ( len > 0 ) ? (len-1) : 0;
    3031}
    3132
    3233INT AVIFILE_strlenWtoA( LPCWSTR lpwstr )
    3334{
    34         INT     len;
     35    INT len;
    3536
    36         len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
    37                                    NULL, 0, NULL, NULL );
    38         return ( len > 0 ) ? (len-1) : 0;
     37    len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
     38                   NULL, 0, NULL, NULL );
     39    return ( len > 0 ) ? (len-1) : 0;
    3940}
    4041
    4142LPWSTR AVIFILE_strncpyAtoW( LPWSTR lpwstr, LPCSTR lpstr, INT wbuflen )
    4243{
    43         INT     len;
     44    INT len;
    4445
    45         len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, lpwstr, wbuflen );
    46         if ( len == 0 )
    47                 *lpwstr = 0;
    48         return lpwstr;
     46    len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, lpwstr, wbuflen );
     47    if ( len == 0 )
     48        *lpwstr = 0;
     49    return lpwstr;
    4950}
    5051
    5152LPSTR AVIFILE_strncpyWtoA( LPSTR lpstr, LPCWSTR lpwstr, INT abuflen )
    5253{
    53         INT     len;
     54    INT len;
    5455
    55         len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
    56                                    lpstr, abuflen, NULL, NULL );
    57         if ( len == 0 )
    58                 *lpstr = 0;
    59         return lpstr;
     56    len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
     57                   lpstr, abuflen, NULL, NULL );
     58    if ( len == 0 )
     59        *lpstr = 0;
     60    return lpstr;
    6061}
    6162
    6263LPWSTR AVIFILE_strdupAtoW( LPCSTR lpstr )
    6364{
    64         INT len;
    65         LPWSTR lpwstr = NULL;
     65    INT len;
     66    LPWSTR lpwstr = NULL;
    6667
    67         len = AVIFILE_strlenAtoW( lpstr );
    68         if ( len > 0 )
    69         {
    70                 lpwstr = (LPWSTR)HeapAlloc( AVIFILE_data.hHeap, 0, sizeof(WCHAR)*(len+1) );
    71                 if ( lpwstr != NULL )
    72                         (void)AVIFILE_strncpyAtoW( lpwstr, lpstr, len+1 );
    73         }
     68    len = AVIFILE_strlenAtoW( lpstr );
     69    if ( len > 0 )
     70    {
     71        lpwstr = (LPWSTR)HeapAlloc( AVIFILE_data.hHeap, 0, sizeof(WCHAR)*(len+1) );
     72        if ( lpwstr != NULL )
     73            (void)AVIFILE_strncpyAtoW( lpwstr, lpstr, len+1 );
     74    }
    7475
    75         return lpwstr;
     76    return lpwstr;
    7677}
    7778
    7879LPSTR AVIFILE_strdupWtoA( LPCWSTR lpwstr )
    7980{
    80         INT len;
    81         LPSTR lpstr = NULL;
     81    INT len;
     82    LPSTR lpstr = NULL;
    8283
    83         len = AVIFILE_strlenWtoA( lpwstr );
    84         if ( len > 0 )
    85         {
    86                 lpstr = (LPSTR)HeapAlloc( AVIFILE_data.hHeap, 0, sizeof(CHAR)*(len+1) );
    87                 if ( lpstr != NULL )
    88                         (void)AVIFILE_strncpyWtoA( lpstr, lpwstr, len+1 );
    89         }
     84    len = AVIFILE_strlenWtoA( lpwstr );
     85    if ( len > 0 )
     86    {
     87        lpstr = (LPSTR)HeapAlloc( AVIFILE_data.hHeap, 0, sizeof(CHAR)*(len+1) );
     88        if ( lpstr != NULL )
     89            (void)AVIFILE_strncpyWtoA( lpstr, lpwstr, len+1 );
     90    }
    9091
    91         return lpstr;
     92    return lpstr;
    9293}
    9394
Note: See TracChangeset for help on using the changeset viewer.