comparison src/nas.c @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3a7e78e1142d
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
797 return 0; 797 return 0;
798 } 798 }
799 799
800 /* Like ftell, but for a buffer in memory */ 800 /* Like ftell, but for a buffer in memory */
801 static long 801 static long
802 dtell() 802 dtell (void)
803 { 803 {
804 return file_posn; 804 return file_posn;
805 } 805 }
806 806
807 /* Data buffer analogs for FileReadS and FileReadL in NAS. */ 807 /* Data buffer analogs for FileReadS and FileReadL in NAS. */
808 808
809 static unsigned short 809 static unsigned short
810 DataReadS(int swapit) 810 DataReadS (int swapit)
811 { 811 {
812 unsigned short us; 812 unsigned short us;
813 813
814 dread(&us, 2, 1); 814 dread(&us, 2, 1);
815 if (swapit) 815 if (swapit)
816 us = FileSwapS(us); 816 us = FileSwapS(us);
817 return us; 817 return us;
818 } 818 }
819 819
820 static AuUint32 820 static AuUint32
821 DataReadL(int swapit) 821 DataReadL (int swapit)
822 { 822 {
823 AuUint32 ul; 823 AuUint32 ul;
824 824
825 dread(&ul, 4, 1); 825 dread(&ul, 4, 1);
826 if (swapit) 826 if (swapit)
827 ul = FileSwapL(ul); 827 ul = FileSwapL(ul);
828 return ul; 828 return ul;
829 } 829 }
830 830
831 static int 831 static int
832 readChunk(RiffChunk *c) 832 readChunk (RiffChunk *c)
833 { 833 {
834 int status; 834 int status;
835 char n; 835 char n;
836 836
837 if ((status = dread(c, sizeof(RiffChunk), 1))) 837 if ((status = dread(c, sizeof(RiffChunk), 1)))
843 843
844 /* A very straight-forward translation of WaveOpenFileForReading to 844 /* A very straight-forward translation of WaveOpenFileForReading to
845 read the wave data from a buffer in memory. */ 845 read the wave data from a buffer in memory. */
846 846
847 static WaveInfo * 847 static WaveInfo *
848 WaveOpenDataForReading(CONST char *data, 848 WaveOpenDataForReading (CONST char *data,
849 int length) 849 int length)
850 { 850 {
851 RiffChunk ck; 851 RiffChunk ck;
852 RIFF_FOURCC fourcc; 852 RIFF_FOURCC fourcc;
853 AuInt32 fileSize; 853 AuInt32 fileSize;
854 WaveInfo *wi; 854 WaveInfo *wi;