mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
programs/common.[ch] : Add function program_name().
This commit is contained in:
parent
e0c6b3038c
commit
7ef22ed2f1
@ -1,3 +1,9 @@
|
||||
2011-03-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* programs/common.[ch]
|
||||
Add function program_name() which returns the program name minus the path
|
||||
from argv [0].
|
||||
|
||||
2011-03-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/wav.c
|
||||
|
@ -360,3 +360,20 @@ sfe_dump_format_map (void)
|
||||
} ;
|
||||
|
||||
} /* sfe_dump_format_map */
|
||||
|
||||
const char *
|
||||
program_name (const char * argv0)
|
||||
{ const char * tmp ;
|
||||
|
||||
tmp = strrchr (argv0, '/') ;
|
||||
argv0 = tmp ? tmp + 1 : argv0 ;
|
||||
|
||||
tmp = strrchr (argv0, '/') ;
|
||||
argv0 = tmp ? tmp + 1 : argv0 ;
|
||||
|
||||
/* Remove leading libtool name mangling. */
|
||||
if (strstr (argv0, "lt-") == argv0)
|
||||
return argv0 + 3 ;
|
||||
|
||||
return argv0 ;
|
||||
} /* program_name */
|
||||
|
@ -69,3 +69,5 @@ void sfe_copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) ;
|
||||
int sfe_file_type_of_ext (const char *filename, int format) ;
|
||||
|
||||
void sfe_dump_format_map (void) ;
|
||||
|
||||
const char * program_name (const char * argv0) ;
|
||||
|
Loading…
Reference in New Issue
Block a user