prsoccessing cli args

This commit is contained in:
phyto 2019-05-27 15:36:22 +02:00
bovenliggende 76bd00d052
commit 407c980690
3 gewijzigde bestanden met toevoegingen van 30 en 4 verwijderingen

Bestand weergeven

@ -4,8 +4,9 @@
CC = gcc
CCOPT = -Wall -g -DDEBUG_LEVEL=1
CCOPT = -Wall -g -DDEBUG_LEVEL=0
LIBS = -lao -lsndfile -lm
player.o: player.c Makefile
$(CC) ${CCOPT} -c $<

Bestand weergeven

@ -65,7 +65,7 @@ sndf = sf_open(fname, SFM_READ, &sfinfo);
if (NULL==sndf)
{
perror("sf_open");
abort();
return -2;
}
#if DEBUG_LEVEL

Bestand weergeven

@ -4,15 +4,40 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "player.h"
/* --------------------------------------------------------------------- */
int verbosity;
/* --------------------------------------------------------------------- */
void help(int v)
{
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
char *wavname = "1337.wav";
int foo;
int foo, opt, K;
printf("\n**** %s **** compiled the %s at %s ***\n",
argv[0], __DATE__, __TIME__);
while ((opt = getopt(argc, argv, "hK:vw:")) != -1) {
switch (opt) {
case 'h': help(0); break;
case 'K': K = atoi(optarg); break;
case 'v': verbosity++; break;
case 'w': wavname = optarg; break;
default: break;
}
}
foo = blast_this_file(wavname);