[Liboss-commit] CVS: liboss/src Makefile.am,NONE,1.1 osscat.c,NONE,1.1
Brought to you by:
thesin
|
From: Justin <th...@us...> - 2002-05-10 15:05:45
|
Update of /cvsroot/liboss/liboss/src
In directory usw-pr-cvs1:/tmp/cvs-serv1820/src
Added Files:
Makefile.am osscat.c
Log Message:
Add a src dir and change bin program name to osscat, and now compiles and installs
--- NEW FILE: Makefile.am ---
##
## Process this file with automake to produce Makefile.in
##
CFLAGS = @CFLAGS@ $(COREAUDIO_CFLAGS)
bin_PROGRAMS = osscat
osscat_SOURCES = osscat.c
osscat_DEPENDENCIES = $(top_srcdir)/lib/liboss.la
osscat_LDADD = $(top_srcdir)/lib/liboss.la \
$(COREAUDIO_LDFLAGS)
debug:
@$(MAKE) CFLAGS="$(DEBUG_CFLAGS)"
install-debug: debug
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
mostlyclean-generic:
-rm -f *~ \#* .*~ .\#*
maintainer-clean-generic:
-@echo "This command is intended for maintainers to use;"
-@echo "it deletes files that may require special tools to rebuild."
-rm -f Makefile.in
--- NEW FILE: osscat.c ---
#include "soundcard.h"
#include <stdio.h>
/* FIXME: Add capability for recording with 'libosscat /dev/audio > somefile' */
#define BUF_SIZE 1024
#define DEVICE "/dev/dspW"
int main(int argc, char **argv)
{
int fd, play;
char buf[BUF_SIZE];
if (argc != 2) {
fprintf(stderr, "Usage: libosscat file\n");
exit(1);
}
if ((fd = open(argv[1], O_RDONLY, 0)) < 0) {
fprintf(stderr, "File %s could not be opened.\n", argv[1]);
exit(1);
}
if ((play = open(DEVICE, O_WRONLY, 0)) < 0) {
fprintf(stderr, "%s could not be opened.\n", DEVICE);
exit(1);
}
while (read(fd, buf, BUF_SIZE) > 0) {
write(play, buf, BUF_SIZE); /* if it errors, keep going */
}
return 0;
}
|