From f97ed948e0cbbf93984f18ff058f2577f4a1b8ab Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 29 Apr 2010 03:48:32 +0000 Subject: [PATCH] Commit vorbisfile constification patch; affects API but not ABI. Closes #1593. svn path=/trunk/vorbis/; revision=17182 --- configure.ac | 2 +- include/vorbis/vorbisfile.h | 10 +++++----- lib/vorbisfile.c | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 91e9d18..c16aa57 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ V_LIB_REVISION=4 V_LIB_AGE=4 VF_LIB_CURRENT=6 -VF_LIB_REVISION=2 +VF_LIB_REVISION=3 VF_LIB_AGE=3 VE_LIB_CURRENT=2 diff --git a/include/vorbis/vorbisfile.h b/include/vorbis/vorbisfile.h index 6cc4a61..de540cf 100644 --- a/include/vorbis/vorbisfile.h +++ b/include/vorbis/vorbisfile.h @@ -147,14 +147,14 @@ typedef struct OggVorbis_File { extern int ov_clear(OggVorbis_File *vf); -extern int ov_fopen(char *path,OggVorbis_File *vf); -extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes); +extern int ov_fopen(const char *path,OggVorbis_File *vf); +extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes); extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, - char *initial, long ibytes, ov_callbacks callbacks); + const char *initial, long ibytes, ov_callbacks callbacks); -extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes); +extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes); extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf, - char *initial, long ibytes, ov_callbacks callbacks); + const char *initial, long ibytes, ov_callbacks callbacks); extern int ov_test_open(OggVorbis_File *vf); extern long ov_bitrate(OggVorbis_File *vf,int i); diff --git a/lib/vorbisfile.c b/lib/vorbisfile.c index 87b1756..c2bb67a 100644 --- a/lib/vorbisfile.c +++ b/lib/vorbisfile.c @@ -871,7 +871,7 @@ static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){ return fseek(f,off,whence); } -static int _ov_open1(void *f,OggVorbis_File *vf,char *initial, +static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial, long ibytes, ov_callbacks callbacks){ int offsettest=((f && callbacks.seek_func)?callbacks.seek_func(f,0,SEEK_CUR):-1); long *serialno_list=NULL; @@ -987,14 +987,14 @@ int ov_clear(OggVorbis_File *vf){ 0) OK */ -int ov_open_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes, - ov_callbacks callbacks){ +int ov_open_callbacks(void *f,OggVorbis_File *vf, + const char *initial,long ibytes,ov_callbacks callbacks){ int ret=_ov_open1(f,vf,initial,ibytes,callbacks); if(ret)return ret; return _ov_open2(vf); } -int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ +int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes){ ov_callbacks callbacks = { (size_t (*)(void *, size_t, size_t, void *)) fread, (int (*)(void *, ogg_int64_t, int)) _fseek64_wrap, @@ -1005,7 +1005,7 @@ int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks); } -int ov_fopen(char *path,OggVorbis_File *vf){ +int ov_fopen(const char *path,OggVorbis_File *vf){ int ret; FILE *f = fopen(path,"rb"); if(!f) return -1; @@ -1049,13 +1049,13 @@ int ov_halfrate_p(OggVorbis_File *vf){ seekability). Use ov_test_open to finish opening the file, else ov_clear to close/free it. Same return codes as open. */ -int ov_test_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes, - ov_callbacks callbacks) +int ov_test_callbacks(void *f,OggVorbis_File *vf, + const char *initial,long ibytes,ov_callbacks callbacks) { return _ov_open1(f,vf,initial,ibytes,callbacks); } -int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ +int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes){ ov_callbacks callbacks = { (size_t (*)(void *, size_t, size_t, void *)) fread, (int (*)(void *, ogg_int64_t, int)) _fseek64_wrap, -- 2.34.1