Blame doc/liboggz/html/oggz__io_8h.html

Packit a38265
Packit a38265
<html xmlns="http://www.w3.org/1999/xhtml">
Packit a38265
<head>
Packit a38265
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
Packit a38265
<title>liboggz: oggz_io.h File Reference</title>
Packit a38265
<link href="tabs.css" rel="stylesheet" type="text/css"/>
Packit a38265
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
Packit a38265
</head>
Packit a38265
<body>
Packit a38265
Packit a38265
Packit a38265
  
Packit a38265
    
    Packit a38265
          
  • Main Page
  • Packit a38265
          
  • Modules
  • Packit a38265
          
  • Data Structures
  • Packit a38265
          
  • Files
  • Packit a38265
        
    Packit a38265
      
    Packit a38265
      
    Packit a38265
        
      Packit a38265
            
    • File List
    • Packit a38265
            
    • Globals
    • Packit a38265
          
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265

      oggz_io.h File Reference

      Packit a38265

      Overriding the functions used for input and output of raw data.

      Packit a38265
      More...

      Packit a38265
      Packit a38265

      Go to the source code of this file.

      Packit a38265
      Packit a38265

      Typedefs

      Packit a38265
      typedef size_t(* OggzIORead )(void *user_handle, void *buf, size_t n)
      Packit a38265
       This is the signature of a function which you provide for Oggz to call when it needs to acquire raw input data.  
      Packit a38265
      typedef size_t(* OggzIOWrite )(void *user_handle, void *buf, size_t n)
      Packit a38265
       This is the signature of a function which you provide for Oggz to call when it needs to output raw data.  
      Packit a38265
      typedef int(* OggzIOSeek )(void *user_handle, long offset, int whence)
      Packit a38265
       This is the signature of a function which you provide for Oggz to call when it needs to seek on the raw input or output data.  
      Packit a38265
      typedef long(* OggzIOTell )(void *user_handle)
      Packit a38265
       This is the signature of a function which you provide for Oggz to call when it needs to determine the current offset of the raw input or output data.  
      Packit a38265
      typedef int(* OggzIOFlush )(void *user_handle)
      Packit a38265
       This is the signature of a function which you provide for Oggz to call when it needs to flush the output data.  
      Packit a38265

      Functions

      Packit a38265
      int oggz_io_set_read (OGGZ *oggz, OggzIORead read, void *user_handle)
      Packit a38265
       Set a function for Oggz to call when it needs to read input data.  
      Packit a38265
      void * oggz_io_get_read_user_handle (OGGZ *oggz)
      Packit a38265
       Retrieve the user_handle associated with the function you have provided for reading input data.  
      Packit a38265
      int oggz_io_set_write (OGGZ *oggz, OggzIOWrite write, void *user_handle)
      Packit a38265
       Set a function for Oggz to call when it needs to write output data.  
      Packit a38265
      void * oggz_io_get_write_user_handle (OGGZ *oggz)
      Packit a38265
       Retrieve the user_handle associated with the function you have provided for writing output data.  
      Packit a38265
      int oggz_io_set_seek (OGGZ *oggz, OggzIOSeek seek, void *user_handle)
      Packit a38265
       Set a function for Oggz to call when it needs to seek on its raw data.  
      Packit a38265
      void * oggz_io_get_seek_user_handle (OGGZ *oggz)
      Packit a38265
       Retrieve the user_handle associated with the function you have provided for seeking on input or output data.  
      Packit a38265
      int oggz_io_set_tell (OGGZ *oggz, OggzIOTell tell, void *user_handle)
      Packit a38265
       Set a function for Oggz to call when it needs to determine the offset within its input data (if OGGZ_READ) or output data (if OGGZ_WRITE).  
      Packit a38265
      void * oggz_io_get_tell_user_handle (OGGZ *oggz)
      Packit a38265
       Retrieve the user_handle associated with the function you have provided for determining the current offset in input or output data.  
      Packit a38265
      int oggz_io_set_flush (OGGZ *oggz, OggzIOFlush flush, void *user_handle)
      Packit a38265
       Set a function for Oggz to call when it needs to flush its output.  
      Packit a38265
      void * oggz_io_get_flush_user_handle (OGGZ *oggz)
      Packit a38265
       Retrieve the user_handle associated with the function you have provided for flushing output.  
      Packit a38265
      Packit a38265

      Detailed Description

      Packit a38265

      Overriding the functions used for input and output of raw data.

      Packit a38265

      OggzIO provides a way of overriding the functions Oggz uses to access its raw input or output data. This is required in many situations where the raw stream cannot be accessed via stdio, but can be accessed by other means. This is typically useful within media frameworks, where accessing and moving around in the data is possible only using methods provided by the framework.

      Packit a38265

      The functions you provide for overriding IO will be used by Oggz whenever you call oggz_read() or oggz_write(). They will also be used repeatedly by Oggz when you call oggz_seek().

      Packit a38265
      Note:
      Opening a file with oggz_open() or oggz_open_stdio() is equivalent to calling oggz_new() and setting stdio based functions for data IO.
      Packit a38265

      Typedef Documentation

      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                typedef int(* OggzIOFlush)(void *user_handle)
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      This is the signature of a function which you provide for Oggz to call when it needs to flush the output data.

      Packit a38265

      The behaviour of this function is similar to that of fflush() in stdio.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          user_handle A generic pointer you have provided earlier 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          0 Success 
      Packit a38265
          <  0 An error condition 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                typedef size_t(* OggzIORead)(void *user_handle, void *buf, size_t n)
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      This is the signature of a function which you provide for Oggz to call when it needs to acquire raw input data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          user_handle A generic pointer you have provided earlier 
      Packit a38265
          n The length in bytes that Oggz wants to read 
      Packit a38265
          buf The buffer that you read data into 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          >  0 The number of bytes successfully read into the buffer 
      Packit a38265
          0 to indicate that there is no more data to read (End of file) 
      Packit a38265
          <  0 An error condition 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                typedef int(* OggzIOSeek)(void *user_handle, long offset, int whence)
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      This is the signature of a function which you provide for Oggz to call when it needs to seek on the raw input or output data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          user_handle A generic pointer you have provided earlier 
      Packit a38265
          offset The offset in bytes to seek to 
      Packit a38265
          whence SEEK_SET, SEEK_CUR or SEEK_END (as for stdio.h) 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          >= 0 The offset seeked to 
      Packit a38265
          <  0 An error condition
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Note:
      If you provide an OggzIOSeek function, you MUST also provide an OggzIOTell function, or else all your seeks will fail.
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                typedef long(* OggzIOTell)(void *user_handle)
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      This is the signature of a function which you provide for Oggz to call when it needs to determine the current offset of the raw input or output data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          user_handle A generic pointer you have provided earlier 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          >= 0 The offset 
      Packit a38265
          <  0 An error condition 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                typedef size_t(* OggzIOWrite)(void *user_handle, void *buf, size_t n)
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      This is the signature of a function which you provide for Oggz to call when it needs to output raw data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          user_handle A generic pointer you have provided earlier 
      Packit a38265
          n The length in bytes of the data 
      Packit a38265
          buf A buffer containing data to write 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          >= 0 The number of bytes successfully written (may be less than n if a write error has occurred) 
      Packit a38265
          <  0 An error condition 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Function Documentation

      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                void* oggz_io_get_flush_user_handle 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz
      Packit a38265
                 ) 
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Retrieve the user_handle associated with the function you have provided for flushing output.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Returns:
      the associated user_handle
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                void* oggz_io_get_read_user_handle 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz
      Packit a38265
                 ) 
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Retrieve the user_handle associated with the function you have provided for reading input data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Returns:
      the associated user_handle
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                void* oggz_io_get_seek_user_handle 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz
      Packit a38265
                 ) 
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Retrieve the user_handle associated with the function you have provided for seeking on input or output data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Returns:
      the associated user_handle
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                void* oggz_io_get_tell_user_handle 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz
      Packit a38265
                 ) 
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Retrieve the user_handle associated with the function you have provided for determining the current offset in input or output data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Returns:
      the associated user_handle
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                void* oggz_io_get_write_user_handle 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz
      Packit a38265
                 ) 
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Retrieve the user_handle associated with the function you have provided for writing output data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Returns:
      the associated user_handle
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                int oggz_io_set_flush 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                OggzIOFlush 
      Packit a38265
                 flush, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                void * 
      Packit a38265
                 user_handle 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                )
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Set a function for Oggz to call when it needs to flush its output.

      Packit a38265

      The meaning of this is similar to that of fflush() in stdio.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
          flush Your flushing function 
      Packit a38265
          user_handle Any arbitrary data you wish to pass to the function 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          0 Success 
      Packit a38265
          OGGZ_ERR_BAD_OGGZ oggz does not refer to an existing OGGZ 
      Packit a38265
          OGGZ_ERR_INVALID Operation not suitable for this OGGZ; oggz not open for writing. 
      Packit a38265
          OGGZ_ERR_OUT_OF_MEMORY Out of memory 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                int oggz_io_set_read 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                OggzIORead 
      Packit a38265
                 read, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                void * 
      Packit a38265
                 user_handle 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                )
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Set a function for Oggz to call when it needs to read input data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
          read Your reading function 
      Packit a38265
          user_handle Any arbitrary data you wish to pass to the function 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          0 Success 
      Packit a38265
          OGGZ_ERR_BAD_OGGZ oggz does not refer to an existing OGGZ 
      Packit a38265
          OGGZ_ERR_INVALID Operation not suitable for this OGGZ; oggz not open for reading. 
      Packit a38265
          OGGZ_ERR_OUT_OF_MEMORY Out of memory 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                int oggz_io_set_seek 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                OggzIOSeek 
      Packit a38265
                 seek, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                void * 
      Packit a38265
                 user_handle 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                )
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Set a function for Oggz to call when it needs to seek on its raw data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
          seek Your seeking function 
      Packit a38265
          user_handle Any arbitrary data you wish to pass to the function 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          0 Success 
      Packit a38265
          OGGZ_ERR_BAD_OGGZ oggz does not refer to an existing OGGZ 
      Packit a38265
          OGGZ_ERR_INVALID Operation not suitable for this OGGZ 
      Packit a38265
          OGGZ_ERR_OUT_OF_MEMORY Out of memory
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Note:
      If you provide an OggzIOSeek function, you MUST also provide an OggzIOTell function, or else all your seeks will fail.
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                int oggz_io_set_tell 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                OggzIOTell 
      Packit a38265
                 tell, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                void * 
      Packit a38265
                 user_handle 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                )
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Set a function for Oggz to call when it needs to determine the offset within its input data (if OGGZ_READ) or output data (if OGGZ_WRITE).

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
          tell Your tell function 
      Packit a38265
          user_handle Any arbitrary data you wish to pass to the function 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          0 Success 
      Packit a38265
          OGGZ_ERR_BAD_OGGZ oggz does not refer to an existing OGGZ 
      Packit a38265
          OGGZ_ERR_INVALID Operation not suitable for this OGGZ 
      Packit a38265
          OGGZ_ERR_OUT_OF_MEMORY Out of memory 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
            
      Packit a38265
              
      Packit a38265
                int oggz_io_set_write 
      Packit a38265
                (
      Packit a38265
                OGGZ
      Packit a38265
                 oggz, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                OggzIOWrite 
      Packit a38265
                 write, 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                
      Packit a38265
                void * 
      Packit a38265
                 user_handle 
      Packit a38265
              
      Packit a38265
              
      Packit a38265
                
      Packit a38265
                )
      Packit a38265
                
      Packit a38265
              
      Packit a38265
            
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      Set a function for Oggz to call when it needs to write output data.

      Packit a38265
      Parameters:
      Packit a38265
        
      Packit a38265
          oggz An OGGZ handle 
      Packit a38265
          write Your writing function 
      Packit a38265
          user_handle Any arbitrary data you wish to pass to the function 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Return values:
      Packit a38265
        
      Packit a38265
          0 Success 
      Packit a38265
          OGGZ_ERR_BAD_OGGZ oggz does not refer to an existing OGGZ 
      Packit a38265
          OGGZ_ERR_INVALID Operation not suitable for this OGGZ; oggz not open for writing. 
      Packit a38265
          OGGZ_ERR_OUT_OF_MEMORY Out of memory 
      Packit a38265
        
      Packit a38265
        
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265
      Packit a38265

      <address style="text-align: right;"><small>Generated on Sat Apr 24 09:13:55 2010 for liboggz by 
      Packit a38265
      Packit a38265
      doxygen 1.6.3 </small></address>
      Packit a38265
      </body>
      Packit a38265
      </html>