source: trunk/third/audiofile/libaudiofile/af_vfs.h @ 17099

Revision 17099, 1.8 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r17098, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2        Audio File Library
3        Copyright (C) 1999, Elliot Lee <sopwith@redhat.com>
4
5        This library is free software; you can redistribute it and/or
6        modify it under the terms of the GNU Library General Public
7        License as published by the Free Software Foundation; either
8        version 2 of the License, or (at your option) any later version.
9
10        This library is distributed in the hope that it will be useful,
11        but WITHOUT ANY WARRANTY; without even the implied warranty of
12        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13        Library General Public License for more details.
14
15        You should have received a copy of the GNU Library General Public
16        License along with this library; if not, write to the
17        Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18        Boston, MA  02111-1307  USA.
19*/
20
21/*
22        af_vfs.h
23
24        Virtual file operations for the Audio File Library.
25*/
26
27#ifndef AUDIOFILE_VFS_H
28#define AUDIOFILE_VFS_H 1
29
30#include <stdio.h>
31
32struct _AFvirtualfile
33{
34  ssize_t (*read) (AFvirtualfile *vfile, void *data, size_t nbytes);
35  long (*length) (AFvirtualfile *vfile);
36  ssize_t (*write) (AFvirtualfile *vfile, const void *data, size_t nbytes);
37  void (*destroy)(AFvirtualfile *vfile);
38  long (*seek)   (AFvirtualfile *vfile, long offset, int is_relative);
39  long (*tell)   (AFvirtualfile *vfile);
40
41  void *closure;
42};
43
44AFvirtualfile *af_virtual_file_new (void);
45AFvirtualfile *af_virtual_file_new_for_file (FILE *fh);
46void af_virtual_file_destroy (AFvirtualfile *vfile);
47
48size_t af_fread (void *data, size_t size, size_t nmemb, AFvirtualfile *vfile);
49size_t af_fwrite (const void *data, size_t size, size_t nmemb, AFvirtualfile *vfile);
50int af_fclose (AFvirtualfile *vfile);
51long af_flength (AFvirtualfile *vfile);
52int af_fseek (AFvirtualfile *vfile, long offset, int whence);
53long af_ftell (AFvirtualfile *vfile);
54
55#endif
Note: See TracBrowser for help on using the repository browser.