head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.54 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.52 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.50 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.48 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.46 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.44 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.42 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.40 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.38 pkgsrc-2008Q2-base:1.2 pkgsrc-2008Q1:1.2.0.36 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.34 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.32 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.30 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.28 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.26 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.24 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.22 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.20 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.18 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.16 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.14 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.12 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.10 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.8 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.6 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.4 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.2 pkgsrc-2003Q4-base:1.2 buildlink2-base:1.2 netbsd-1-4-PATCH002:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.2 date 2000.02.29.16.57.47; author scw; state dead; branches; next 1.1; 1.1 date 99.12.04.12.56.30; author scw; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.12.04.12.56.30; author scw; state Exp; branches; next ; desc @@ 1.2 log @Update to version 2.1.1. The author has incorporated the stdio changes which were originally in the patch files being deleted. @ text @$NetBSD: patch-am,v 1.1 1999/12/04 12:56:30 scw Exp $ --- libaudiofile/wav.c.orig Fri Nov 12 17:55:50 1999 +++ libaudiofile/wav.c Tue Nov 30 21:55:29 1999 @@@@ -32,7 +32,7 @@@@ /*--------------------------------------------------------------------------- | FUNCTION AFreadWAV ---------------------------------------------------------------------------*/ -AFfilehandle AFreadWAV (int file) +AFfilehandle AFreadWAV (fhandle file) { int i; int j; @@@@ -89,7 +89,11 @@@@ if (strncmp (id,"WAVE",4)) fail ("WAV header does not contain a valid form type\n") +#ifndef USE_STDIO while (!done && !error) // && !feof (file)) +#else + while (!done && !error && !feof (file)) +#endif { if (!idRead (file,id)) { @@@@ -144,11 +148,19 @@@@ } // Skip past data for now +#ifndef USE_STDIO handle->ssndStart = lseek (file,0L,SEEK_CUR); +#else + handle->ssndStart = ftell (file); +#endif if (handle->ssndStart == -1) aiffError seeksize = chunksize; if (seeksize % 2) seeksize++; +#ifndef USE_STDIO if (lseek (file,seeksize,SEEK_CUR) == -1) aiffError +#else + if (fseek (file,seeksize,SEEK_CUR) == -1) aiffError +#endif data = TRUE; } else if (!strncmp (id,"cue ",4)) @@@@ -210,7 +222,11 @@@@ { seeksize = chunksize - 4; // Already read in list type if (seeksize % 2) seeksize++; +#ifndef USE_STDIO if (lseek (file,seeksize,SEEK_CUR) == -1) aiffError +#else + if (fseek (file,seeksize,SEEK_CUR) == -1) aiffError +#endif } else { @@@@ -226,7 +242,11 @@@@ else if (!strncmp (listType,"INFO",4)) info = TRUE; while (!done && !error && +#ifndef USE_STDIO amountRead < listChunksize) // && !feof (file)) +#else + amountRead < listChunksize && !feof (file)) +#endif { if (!idRead (file,id)) { @@@@ -253,7 +273,11 @@@@ stringsize = chunksize - 4; // Allow for mark id markname = (char *) calloc (stringsize,sizeof (char)); if (!markname) aiffError +#ifndef USE_STDIO if (read (file,markname,stringsize) != stringsize) +#else + if (fread (markname,1,stringsize,file) != stringsize) +#endif aiffError markname [stringsize - 1] = 0; // Just in case if (stringsize % 2) ucread (uctemp) @@@@ -292,7 +316,11 @@@@ if (chunksize % 2) amountRead++; // Space for padding byte string = (char *) calloc (chunksize,sizeof (char)); if (!string) aiffError +#ifndef USE_STDIO if (read (file,string,chunksize) != chunksize) +#else + if (fread (string,1,chunksize,file) != chunksize) +#endif aiffError string [chunksize - 1] = 0; // Just in case if (chunksize % 2) ucread (uctemp) @@@@ -363,7 +391,11 @@@@ // Skip past data seeksize = chunksize; if (seeksize % 2) seeksize++; +#ifndef USE_STDIO if (lseek (file,seeksize,SEEK_CUR) == -1) aiffError +#else + if (fseek (file,seeksize,SEEK_CUR) == -1) aiffError +#endif } } } @@@@ -407,7 +439,11 @@@@ // Skip past data seeksize = chunksize; if (seeksize % 2) seeksize++; +#ifndef USE_STDIO if (lseek (file,seeksize,SEEK_CUR) == -1) aiffError +#else + if (fseek (file,seeksize,SEEK_CUR) == -1) aiffError +#endif } } @@@@ -421,7 +457,11 @@@@ fail ("no data chunk\n") // Read to start of sound data +#ifndef USE_STDIO if (lseek (file,handle->ssndStart,SEEK_SET) == -1) +#else + if (fseek (file,handle->ssndStart,SEEK_SET) == -1) +#endif fail ("error seeking to start of sound data\n") handle = (AFfilehandle) calloc (1,sizeof (aiffHandle)); @@@@ -432,7 +472,7 @@@@ /*--------------------------------------------------------------------------- | FUNCTION AFwriteWAV ---------------------------------------------------------------------------*/ -AFfilehandle AFwriteWAV (int file,AFfilesetup setup) +AFfilehandle AFwriteWAV (fhandle file,AFfilesetup setup) { int i; int j; @@@@ -543,7 +583,11 @@@@ uiwrite (handle->aiff.mark [i].id) if (stringsize) +#ifndef USE_STDIO if (write (file,handle->aiff.mark [i].name,stringsize) != stringsize) +#else + if (fwrite (handle->aiff.mark [i].name,1,stringsize,file) != stringsize) +#endif return AF_NULL_FILEHANDLE; handle->actualBytes += stringsize; @@@@ -660,7 +704,11 @@@@ { chunksize = handle->aiff.misc [i].size + 1; uiwrite (chunksize) +#ifndef USE_STDIO if (write (file,handle->aiff.misc [i].data,handle->aiff.misc [i].size) +#else + if (fwrite(handle->aiff.misc [i].data,1,handle->aiff.misc [i].size,file) +#endif != handle->aiff.misc [i].size) return AF_NULL_FILEHANDLE; handle->actualBytes += handle->aiff.misc [i].size; @@@@ -685,7 +733,9 @@@@ // Don't know length yet uiwrite (0) - // fflush (file); no flushing needed +#ifdef USE_STDIO + fflush (file); +#endif handle = (AFfilehandle) calloc (1,sizeof (aiffHandle)); *handle = handleAct; @@@@ -707,7 +757,7 @@@@ unsigned short ustemp; unsigned char uctemp; char idtemp [4]; - int file; + fhandle file; int bitWidth; int byteWidth; unsigned int byteRate; @@@@ -723,7 +773,11 @@@@ if (handle->mode == READONLY) { +#ifndef USE_STDIO if (close (handle->file) == -1) return -1; +#else + if (fclose (handle->file) == -1) return -1; +#endif free (handle); return 0; } @@@@ -738,7 +792,11 @@@@ ucwrite (0) // Reset file descriptor +#ifndef USE_STDIO if (lseek (file,0L,SEEK_SET) == -1) +#else + if (fseek (file,0L,SEEK_SET) == -1) +#endif { fprintf (stderr,"unable to seek on file\n"); return -1; @@@@ -821,7 +879,11 @@@@ uiupdate (handle->aiff.mark [i].id) if (stringsize) +#ifndef USE_STDIO if (write (file,handle->aiff.mark [i].name,stringsize) != stringsize) +#else + if (fwrite(handle->aiff.mark [i].name,1,stringsize,file)!= stringsize) +#endif return AF_NULL_FILEHANDLE; handle->actualBytes += stringsize; @@@@ -938,7 +1000,11 @@@@ { chunksize = handle->aiff.misc [i].size + 1; uiupdate (chunksize) +#ifndef USE_STDIO if (write (file,handle->aiff.misc [i].data,handle->aiff.misc [i].size) +#else + if (fwrite(handle->aiff.misc [i].data,1,handle->aiff.misc [i].size,file) +#endif != handle->aiff.misc [i].size) return AF_NULL_FILEHANDLE; handle->actualBytes += handle->aiff.misc [i].size; @@@@ -967,7 +1033,11 @@@@ chunksize *= byteWidth; uiupdate (chunksize) +#ifndef USE_STDIO if (close (handle->file) == -1) return -1; +#else + if (fclose (handle->file) == -1) return -1; +#endif free (handle); return 0; } @@@@ -982,7 +1052,7 @@@@ int i; int j; int frameCount; - int file; + fhandle file; unsigned char uctemp; short stemp; int itemp; @@@@ -996,7 +1066,11 @@@@ i = 0; frameCount = 0; while (handle->actualFrames < handle->aiff.framecount && +#ifndef USE_STDIO frameCount < count) // && !(feof (file))) +#else + frameCount < count && !(feof (file))) +#endif { for (j=0; jaiff.channels; j++) { @@@@ -1034,7 +1108,7 @@@@ int i; int j; int frameCount; - int file; + fhandle file; unsigned char uctemp; short stemp; int itemp; @@@@ -1047,7 +1121,11 @@@@ i = 0; frameCount = 0; +#ifndef USE_STDIO while (frameCount < count) // && !(feof (file))) +#else + while (frameCount < count && !(feof (file))) +#endif { for (j=0; jaiff.channels; j++) { @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ @ 1.1.1.1 log @Digital audio recording and processing package. @ text @@