From 607339d4ae053052850528dced4251fd5a3eb9cb Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Sat, 8 Jun 2002 08:04:06 +0000 Subject: [PATCH] Start clearing out my TODO list... Document the requirements for the callbacks in ov_callbacks. svn path=/trunk/vorbis/; revision=3366 --- doc/vorbisfile/ov_callbacks.html | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/vorbisfile/ov_callbacks.html b/doc/vorbisfile/ov_callbacks.html index 9d73c68..9509d1e 100644 --- a/doc/vorbisfile/ov_callbacks.html +++ b/doc/vorbisfile/ov_callbacks.html @@ -23,6 +23,12 @@ The ov_callbacks structure contains file manipulation function prototypes necess The ov_callbacks structure does not need to be user-defined if you are working with a standard file. The typical ov_open() call will fill ov_callbacks for you. However, ov_callbacks should be defined if you are using other data sources. In this situation, use ov_open_callbacks() instead of ov_open().

+

+The callbacks are designed following the stdio functions fread, fseek, fclose, +and ftell. Except where otherwise noted below, they should work the same as +these functions do. +

+
@@ -39,13 +45,19 @@ The ov_callbacks structure does not need to be user-defined if you are working w

Relevant Struct Members

read_func
-
Pointer to custom data reading function.
+
Pointer to custom data reading function. Read up to size*nmemb bytes from +the source into the buffer at ptr. Return the number of bytes read successfully. +Must return 0 if nothing can be read. Should also set errno if an error occurs, +in order to distinguish between error and EOF.
seek_func
-
Pointer to custom data seeking function.
+
Pointer to custom data seeking function. If your data source does not support +seeking, you must return -1. Returns 0 on success. Seeks to a position offset bytes from a position defined by whence. If whence is SEEK_SET, seek relative to the file start. If SEEK_CUR, seek is relative to current file position. If SEEK_END, relative to end of file.
close_func
-
Pointer to custom data source closure function.
+
Pointer to custom data source closure function. This should clear any +resources used by the data source, such as open files or network sockets. Returns 0.
tell_func
-
Pointer to custom data location function.
+
Pointer to custom data location function. Returns the current offset (from the start) of the data stream. If your source is non-seekable, this need not be +implemented.
-- 2.7.4