summaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
Diffstat (limited to 'programs')
-rw-r--r--programs/sndfile-cmp.c10
-rw-r--r--programs/sndfile-convert.c13
-rw-r--r--programs/sndfile-deinterleave.c1
-rw-r--r--programs/sndfile-info.c12
-rw-r--r--programs/sndfile-interleave.c1
-rw-r--r--programs/sndfile-metadata-get.c3
-rw-r--r--programs/sndfile-metadata-set.c3
-rw-r--r--programs/sndfile-play.c3
-rw-r--r--programs/sndfile-salvage.c13
9 files changed, 35 insertions, 24 deletions
diff --git a/programs/sndfile-cmp.c b/programs/sndfile-cmp.c
index 83c9842..bd12e01 100644
--- a/programs/sndfile-cmp.c
+++ b/programs/sndfile-cmp.c
@@ -34,6 +34,7 @@
#include "sfconfig.h"
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
@@ -130,13 +131,14 @@ print_version (void)
} /* print_version */
static void
-print_usage (void)
+usage_exit (void)
{
print_version () ;
printf ("Usage : %s <filename> <filename>\n", progname) ;
printf (" Compare the PCM data of two sound files.\n\n") ;
-} /* print_usage */
+ exit (0) ;
+} /* usage_exit */
int
main (int argc, char *argv [])
@@ -145,7 +147,7 @@ main (int argc, char *argv [])
progname = progname ? progname + 1 : argv [0] ;
if (argc != 3)
- { print_usage () ;
+ { usage_exit () ;
return 1 ;
} ;
@@ -154,7 +156,7 @@ main (int argc, char *argv [])
if (strcmp (filename1, filename2) == 0)
{ printf ("Error : Input filenames are the same.\n\n") ;
- print_usage () ;
+ usage_exit () ;
return 1 ;
} ;
diff --git a/programs/sndfile-convert.c b/programs/sndfile-convert.c
index 893b247..d3fe542 100644
--- a/programs/sndfile-convert.c
+++ b/programs/sndfile-convert.c
@@ -48,7 +48,7 @@ typedef struct
static void copy_metadata (SNDFILE *outfile, SNDFILE *infile, int channels) ;
static void
-print_usage (char *progname)
+usage_exit (char *progname)
{
printf ("\nUsage : %s [options] [encoding] <input file> <output file>\n", progname) ;
puts ("\n"
@@ -85,7 +85,8 @@ print_usage (char *progname)
sfe_dump_format_map () ;
puts ("") ;
-} /* print_usage */
+ exit (0) ;
+} /* usage_exit */
int
main (int argc, char * argv [])
@@ -99,7 +100,7 @@ main (int argc, char * argv [])
progname = progname ? progname + 1 : argv [0] ;
if (argc < 3 || argc > 5)
- { print_usage (progname) ;
+ { usage_exit (progname) ;
return 1 ;
} ;
@@ -108,19 +109,19 @@ main (int argc, char * argv [])
if (strcmp (infilename, outfilename) == 0)
{ printf ("Error : Input and output filenames are the same.\n\n") ;
- print_usage (progname) ;
+ usage_exit (progname) ;
return 1 ;
} ;
if (strlen (infilename) > 1 && infilename [0] == '-')
{ printf ("Error : Input filename (%s) looks like an option.\n\n", infilename) ;
- print_usage (progname) ;
+ usage_exit (progname) ;
return 1 ;
} ;
if (outfilename [0] == '-')
{ printf ("Error : Output filename (%s) looks like an option.\n\n", outfilename) ;
- print_usage (progname) ;
+ usage_exit (progname) ;
return 1 ;
} ;
diff --git a/programs/sndfile-deinterleave.c b/programs/sndfile-deinterleave.c
index e925cdd..2ae07f6 100644
--- a/programs/sndfile-deinterleave.c
+++ b/programs/sndfile-deinterleave.c
@@ -153,6 +153,7 @@ usage_exit (void)
"If the input file is named 'a.wav', the output files will be named\n"
"a_00.wav, a_01.wav and so on.\n"
) ;
+ printf ("Using %s.\n\n", sf_version_string ()) ;
exit (0) ;
} /* usage_exit */
diff --git a/programs/sndfile-info.c b/programs/sndfile-info.c
index 6d137f8..58a057e 100644
--- a/programs/sndfile-info.c
+++ b/programs/sndfile-info.c
@@ -1,5 +1,5 @@
/*
-** Copyright (C) 1999-2010Erik de Castro Lopo <erikd@mega-nerd.com>
+** Copyright (C) 1999-2010 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** All rights reserved.
**
@@ -48,7 +48,7 @@
#endif
static void print_version (void) ;
-static void print_usage (const char *progname) ;
+static void usage_exit (const char *progname) ;
static void info_dump (const char *filename) ;
static int instrument_dump (const char *filename) ;
@@ -70,7 +70,7 @@ main (int argc, char *argv [])
progname = strrchr (argv [0], '/') ;
progname = progname ? progname + 1 : argv [0] ;
- print_usage (progname) ;
+ usage_exit (progname) ;
return 1 ;
} ;
@@ -123,7 +123,7 @@ print_version (void)
static void
-print_usage (const char *progname)
+usage_exit (const char *progname)
{ printf ("Usage :\n %s <file> ...\n", progname) ;
printf (" Prints out information about one or more sound files.\n\n") ;
printf (" %s -i <file>\n", progname) ;
@@ -143,7 +143,9 @@ print_usage (const char *progname)
*/
Sleep (5 * 1000) ;
#endif
-} /* print_usage */
+ printf ("Using %s.\n\n", sf_version_string ()) ;
+ exit (0) ;
+} /* usage_exit */
/*==============================================================================
** Dumping of sndfile info.
diff --git a/programs/sndfile-interleave.c b/programs/sndfile-interleave.c
index 6dd27ae..56c7326 100644
--- a/programs/sndfile-interleave.c
+++ b/programs/sndfile-interleave.c
@@ -145,6 +145,7 @@ static void
usage_exit (void)
{ puts ("\nUsage : sndfile-interleave <input 1> <input 2> ... -o <output file>\n") ;
puts ("Merge two or more mono files into a single multi-channel file.\n") ;
+ printf ("Using %s.\n\n", sf_version_string ()) ;
exit (0) ;
} /* usage_exit */
diff --git a/programs/sndfile-metadata-get.c b/programs/sndfile-metadata-get.c
index 1d370b3..34fadec 100644
--- a/programs/sndfile-metadata-get.c
+++ b/programs/sndfile-metadata-get.c
@@ -1,5 +1,5 @@
/*
-** Copyright (C) 2008 George Blood Audio
+** Copyright (C) 2008-2010 George Blood Audio
** Written by Erik de Castro Lopo <erikd@mega-nerd.com>
**
** All rights reserved.
@@ -123,6 +123,7 @@ usage_exit (const char *progname, int exit_code)
" --str-license Print the license metadata.\n"
) ;
+ printf ("Using %s.\n\n", sf_version_string ()) ;
exit (exit_code) ;
} /* usage_exit */
diff --git a/programs/sndfile-metadata-set.c b/programs/sndfile-metadata-set.c
index 50e229a..f67bba2 100644
--- a/programs/sndfile-metadata-set.c
+++ b/programs/sndfile-metadata-set.c
@@ -1,5 +1,5 @@
/*
-** Copyright (C) 2008 George Blood Audio
+** Copyright (C) 2008-2010 George Blood Audio
** Written by Erik de Castro Lopo <erikd@mega-nerd.com>
**
** All rights reserved.
@@ -235,6 +235,7 @@ usage_exit (const char *progname, int exit_code)
"exit with an appropriate error message.\n"
) ;
+ printf ("Using %s.\n\n", sf_version_string ()) ;
exit (exit_code) ;
} /* usage_exit */
diff --git a/programs/sndfile-play.c b/programs/sndfile-play.c
index a3198a7..968f984 100644
--- a/programs/sndfile-play.c
+++ b/programs/sndfile-play.c
@@ -1,5 +1,5 @@
/*
-** Copyright (C) 1999-2009 Erik de Castro Lopo <erikd@mega-nerd.com>
+** Copyright (C) 1999-2010 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** All rights reserved.
**
@@ -978,6 +978,7 @@ main (int argc, char *argv [])
if (argc < 2)
{
printf ("\nUsage : %s <input sound file>\n\n", argv [0]) ;
+ printf (" Using %s.\n\n", sf_version_string ()) ;
#if (OS_IS_WIN32 == 1)
printf ("This is a Unix style command line application which\n"
"should be run in a MSDOS box or Command Shell window.\n\n") ;
diff --git a/programs/sndfile-salvage.c b/programs/sndfile-salvage.c
index 18e7307..3c55593 100644
--- a/programs/sndfile-salvage.c
+++ b/programs/sndfile-salvage.c
@@ -49,7 +49,7 @@
#define NOT(x) (! (x))
-static void print_usage (const char *progname) ;
+static void usage_exit (const char *progname) ;
static void salvage_file (const char * broken_wav, const char * fixed_w64) ;
int
@@ -61,8 +61,7 @@ main (int argc, char *argv [])
progname = strrchr (argv [0], '/') ;
progname = progname ? progname + 1 : argv [0] ;
- print_usage (progname) ;
- exit (1) ;
+ usage_exit (progname) ;
} ;
salvage_file (argv [1], argv [2]) ;
@@ -80,10 +79,12 @@ static void copy_data (int fd, SNDFILE * sndfile, int readsize) ;
static void
-print_usage (const char *progname)
+usage_exit (const char *progname)
{ printf ("Usage :\n\n %s <broken wav file> <fixed w64 file>\n\n", progname) ;
- puts (" Salvages the audio data from WAV files which are more than 4G in length.\n") ;
-} /* print_usage */
+ puts ("Salvages the audio data from WAV files which are more than 4G in length.\n") ;
+ printf ("Using %s.\n\n", sf_version_string ()) ;
+ exit (0) ;
+} /* usage_exit */
static void
salvage_file (const char * broken_wav, const char * fixed_w64)