3 Copyright (C) 1999, Elliot Lee <sopwith@redhat.com>
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.
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.
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.
24 Virtual file operations for the Audio File Library.
27 #ifndef AUDIOFILE_VFS_H
28 #define AUDIOFILE_VFS_H 1
31 #include <audiofile.h>
39 ssize_t (*read
) (AFvirtualfile
*vfile
, void *data
, size_t nbytes
);
40 long (*length
) (AFvirtualfile
*vfile
);
41 ssize_t (*write
) (AFvirtualfile
*vfile
, const void *data
, size_t nbytes
);
42 void (*destroy
)(AFvirtualfile
*vfile
);
43 long (*seek
) (AFvirtualfile
*vfile
, long offset
, int is_relative
);
44 long (*tell
) (AFvirtualfile
*vfile
);
49 AFvirtualfile
*af_virtual_file_new (void);
50 AFvirtualfile
*af_virtual_file_new_for_file (FILE *fh
);
51 void af_virtual_file_destroy (AFvirtualfile
*vfile
);
53 size_t af_fread (void *data
, size_t size
, size_t nmemb
, AFvirtualfile
*vfile
);
54 size_t af_fwrite (const void *data
, size_t size
, size_t nmemb
, AFvirtualfile
*vfile
);
55 int af_fclose (AFvirtualfile
*vfile
);
56 long af_flength (AFvirtualfile
*vfile
);
57 int af_fseek (AFvirtualfile
*vfile
, long offset
, int whence
);
58 long af_ftell (AFvirtualfile
*vfile
);