Changeset 1231f33d9c2d07117ed4f1615592d4fff4609e27

Show
Ignore:
Timestamp:
05/24/08 11:45:46 (3 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1211622346 +0300
git-parent:

[22fe2438b98e2d041b4481c0c8706096a8f160ce]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1211622346 +0300
Message:

vlc_scandir: remove (dead) code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_common.h

    r22fe243 r1231f33  
    725725VLC_EXPORT( int64_t, vlc_strtoll, ( const char *nptr, char **endptr, int base ) ); 
    726726 
    727 struct dirent; 
    728 VLC_EXPORT( int, vlc_scandir, ( const char *name, struct dirent ***namelist, int (*filter) ( const struct dirent * ), int (*compar) ( const struct dirent **, const struct dirent ** ) ) ); 
    729 VLC_EXPORT( int, vlc_alphasort, ( const struct dirent **a, const struct dirent **b ) ); 
    730  
    731727VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) ); 
    732728 
  • src/extras/libc.c

    r22fe243 r1231f33  
    7171#endif 
    7272 
    73 #ifdef UNDER_CE 
    74 #   define strcoll strcmp 
    75 #endif 
    76  
    7773/****************************************************************************** 
    7874 * strcasestr: find a substring (little) in another substring (big) 
     
    379375#endif 
    380376 
    381 /***************************************************************************** 
    382  * scandir: scan a directory alpha-sorted 
    383  *****************************************************************************/ 
    384 #if !defined( HAVE_SCANDIR ) 
    385 /* FIXME: I suspect this is dead code -> utf8_scandir */ 
    386 #ifdef WIN32 
    387 # undef opendir 
    388 # undef readdir 
    389 # undef closedir 
    390 #endif 
    391 int vlc_alphasort( const struct dirent **a, const struct dirent **b ) 
    392 { 
    393     return strcoll( (*a)->d_name, (*b)->d_name ); 
    394 } 
    395  
    396 int vlc_scandir( const char *name, struct dirent ***namelist, 
    397                     int (*filter) ( const struct dirent * ), 
    398                     int (*compar) ( const struct dirent **, 
    399                                     const struct dirent ** ) ) 
    400 { 
    401     DIR            * p_dir; 
    402     struct dirent  * p_content; 
    403     struct dirent ** pp_list; 
    404     int              ret, size; 
    405  
    406     if( !namelist || !( p_dir = opendir( name ) ) ) return -1; 
    407  
    408     ret     = 0; 
    409     pp_list = NULL; 
    410     while( ( p_content = readdir( p_dir ) ) ) 
    411     { 
    412         if( filter && !filter( p_content ) ) 
    413         { 
    414             continue; 
    415         } 
    416         pp_list = realloc( pp_list, ( ret + 1 ) * sizeof( struct dirent * ) ); 
    417         size = sizeof( struct dirent ) + strlen( p_content->d_name ) + 1; 
    418         pp_list[ret] = malloc( size ); 
    419         if( pp_list[ret] ) 
    420         { 
    421             memcpy( pp_list[ret], p_content, size ); 
    422             ret++; 
    423         } 
    424         else 
    425         { 
    426             /* Continuing is useless when no more memory can be allocted, 
    427              * so better return what we have found. 
    428              */ 
    429             ret = -1; 
    430             break; 
    431         } 
    432     } 
    433  
    434     closedir( p_dir ); 
    435  
    436     if( compar ) 
    437     { 
    438         qsort( pp_list, ret, sizeof( struct dirent * ), 
    439                (int (*)(const void *, const void *)) compar ); 
    440     } 
    441  
    442     *namelist = pp_list; 
    443     return ret; 
    444 } 
    445 #endif 
    446  
    447377#if defined (WIN32) 
    448378/** 
  • src/libvlccore.sym

    r22fe243 r1231f33  
    370370__var_TriggerCallback 
    371371__var_Type 
    372 vlc_alphasort 
    373372vlc_asprintf 
    374373vlc_b64_decode 
     
    436435vlc_rand_bytes 
    437436vlc_recvmsg 
    438 vlc_scandir 
    439437vlc_sdp_Start 
    440438vlc_sendmsg