History

Improve version reporting.

Erik de Castro Lopo committed 22 years ago

Commit 01d94cc1 parent 6c6b9061 file · +8 −9Browse files

Unified · Split

examples/sndfile-resample.c+8−9
@@ -44,15 +44,16 @@ main (int argc, char *argv []) · 43 unmodified lines
44 int new_sample_rate = -1, k, converter, max_speed = SF_FALSE ;44 int new_sample_rate = -1, k, converter, max_speed = SF_FALSE ;
45 45
46 if (argc == 2 && strcmp (argv [1], "--version") == 0)46 if (argc == 2 && strcmp (argv [1], "--version") == 0)
47 { char *progname, *cptr ;47 { char buffer [64], *cptr ;
48 48
49 progname = argv [0] ;49 if ((cptr = strrchr (argv [0], '/')) != NULL)
50 if ((cptr = strrchr (progname, '/')) != NULL)50 argv [0] = cptr + 1 ;
51 progname = cptr + 1 ;51 if ((cptr = strrchr (argv [0], '\\')) != NULL)
52 if ((cptr = strrchr (progname, '\\')) != NULL)52 argv [0] = cptr + 1 ;
53 progname = cptr + 1 ;
54 53
55 printf ("%s (%s)\n", progname, src_get_version ()) ;54 sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ;
55
56 printf ("%s (%s,%s)\n", argv [0], src_get_version (), buffer) ;
56 exit (0) ;57 exit (0) ;
57 } ;58 } ;
58 59
@@ -99,8 +100,6 @@ main (int argc, char *argv []) · 40 unmodified lines
99 exit (1) ;100 exit (1) ;
100 } ;101 } ;
101 102
102 printf ("Version : %s\n", src_get_version ()) ;
103
104 printf ("Input File : %s\n", argv [argc - 2]) ;103 printf ("Input File : %s\n", argv [argc - 2]) ;
105 printf ("Sample Rate : %d\n", sfinfo.samplerate) ;104 printf ("Sample Rate : %d\n", sfinfo.samplerate) ;
106 printf ("Input Frames : %ld\n\n", (long) sfinfo.frames) ;105 printf ("Input Frames : %ld\n\n", (long) sfinfo.frames) ;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t