Ignore:
Timestamp:
Sep 15, 2001, 11:47:44 AM (24 years ago)
Author:
sandervl
Message:

restored old version

File:
1 edited

Legend:

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

    r6652 r6712  
    1 /* $Id: string.c,v 1.2 2001-09-05 14:16:46 bird Exp $ */
    21/*
    32 * Copyright 2001 Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
     
    2524INT AVIFILE_strlenAtoW( LPCSTR lpstr )
    2625{
    27     INT len;
     26        INT     len;
    2827
    29     len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, NULL, 0 );
    30     return ( len > 0 ) ? (len-1) : 0;
     28        len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, NULL, 0 );
     29        return ( len > 0 ) ? (len-1) : 0;
    3130}
    3231
    3332INT AVIFILE_strlenWtoA( LPCWSTR lpwstr )
    3433{
    35     INT len;
     34        INT     len;
    3635
    37     len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
    38                    NULL, 0, NULL, NULL );
    39     return ( len > 0 ) ? (len-1) : 0;
     36        len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
     37                                   NULL, 0, NULL, NULL );
     38        return ( len > 0 ) ? (len-1) : 0;
    4039}
    4140
    4241LPWSTR AVIFILE_strncpyAtoW( LPWSTR lpwstr, LPCSTR lpstr, INT wbuflen )
    4342{
    44     INT len;
     43        INT     len;
    4544
    46     len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, lpwstr, wbuflen );
    47     if ( len == 0 )
    48         *lpwstr = 0;
    49     return lpwstr;
     45        len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, lpwstr, wbuflen );
     46        if ( len == 0 )
     47                *lpwstr = 0;
     48        return lpwstr;
    5049}
    5150
    5251LPSTR AVIFILE_strncpyWtoA( LPSTR lpstr, LPCWSTR lpwstr, INT abuflen )
    5352{
    54     INT len;
     53        INT     len;
    5554
    56     len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
    57                    lpstr, abuflen, NULL, NULL );
    58     if ( len == 0 )
    59         *lpstr = 0;
    60     return lpstr;
     55        len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
     56                                   lpstr, abuflen, NULL, NULL );
     57        if ( len == 0 )
     58                *lpstr = 0;
     59        return lpstr;
    6160}
    6261
    6362LPWSTR AVIFILE_strdupAtoW( LPCSTR lpstr )
    6463{
    65     INT len;
    66     LPWSTR lpwstr = NULL;
     64        INT len;
     65        LPWSTR lpwstr = NULL;
    6766
    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     }
     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        }
    7574
    76     return lpwstr;
     75        return lpwstr;
    7776}
    7877
    7978LPSTR AVIFILE_strdupWtoA( LPCWSTR lpwstr )
    8079{
    81     INT len;
    82     LPSTR lpstr = NULL;
     80        INT len;
     81        LPSTR lpstr = NULL;
    8382
    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     }
     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        }
    9190
    92     return lpstr;
     91        return lpstr;
    9392}
    9493
Note: See TracChangeset for help on using the changeset viewer.