Main Page | Class List | File List | Class Members | File Members

ipod_io.h

Go to the documentation of this file.
00001 /*
00002  * ipod_io.h
00003  *
00004  * Duane Maxwell
00005  * (c) 2005 by Linspire Inc
00006  *
00007  * This library is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU Lesser General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00020  */
00021 
00022 #ifndef __IPOD_IO_H__
00023 #define __IPOD_IO_H__
00024 
00025 #include <sys/types.h>
00026 #include <stdint.h>
00027 #include <stdlib.h>
00028 #include <stdio.h>
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00046 typedef int (*ipod_io_read_func)(void *data, size_t maxDataLen, size_t *dataRead,void *userData);
00047 
00056 typedef int (*ipod_io_write_func)(void *data, size_t dataLen,size_t *dataWritten,void *userData);
00057 
00064 typedef int (*ipod_io_tell_func)(size_t *offset,void *userData);
00065 
00072 typedef int (*ipod_io_seek_func)(size_t offset,void *userData);
00073 
00080 typedef int (*ipod_io_length_func)(size_t *offset,void *userData);
00081 
00084 typedef struct {
00085     void *userData; 
00086     ipod_io_read_func read; 
00087     ipod_io_write_func write; 
00088     ipod_io_tell_func tell; 
00089     ipod_io_seek_func seek; 
00090     ipod_io_length_func length; 
00091 } ipod_io_struct;
00092 
00093 typedef ipod_io_struct *ipod_io; 
00103 extern int ipod_io_read(ipod_io io,void *data, size_t maxDataLen, size_t *dataRead);
00104 
00113 extern int ipod_io_write(ipod_io io,void *data, size_t dataLen, size_t *dataWritten);
00114 
00120 extern int8_t ipod_io_getb(ipod_io io);
00121 
00127 extern void ipod_io_putb(ipod_io io,int8_t b);
00128 
00134 extern uint8_t ipod_io_getub(ipod_io io);
00135 
00141 extern void ipod_io_putub(ipod_io io,uint8_t b);
00142 
00148 extern int16_t ipod_io_getw(ipod_io io);
00149 
00155 extern void ipod_io_putw(ipod_io io,int16_t w);
00156 
00162 extern uint16_t ipod_io_getuw(ipod_io io);
00163 
00169 extern void ipod_io_putuw(ipod_io io,uint16_t w);
00170 
00176 extern int16_t ipod_io_getw_be(ipod_io io);
00177 
00183 extern void ipod_io_putw_be(ipod_io io,int16_t w);
00184 
00190 extern uint16_t ipod_io_getuw_be(ipod_io io);
00191 
00197 extern void ipod_io_putuw_be(ipod_io io,uint16_t w);
00198 
00204 extern int32_t ipod_io_getl(ipod_io io);
00205 
00211 extern void ipod_io_putl(ipod_io io,int32_t l);
00212 
00218 extern uint32_t ipod_io_getul(ipod_io io);
00219 
00225 extern void ipod_io_putul(ipod_io io,uint32_t l);
00226 
00227 
00233 extern int32_t ipod_io_getl_be(ipod_io io);
00234 
00240 extern void ipod_io_putl_be(ipod_io io,int32_t l);
00241 
00247 extern uint32_t ipod_io_getul_be(ipod_io io);
00248 
00254 extern void ipod_io_putul_be(ipod_io io,uint32_t l);
00255 
00261 extern float ipod_io_getf(ipod_io io);
00262 
00268 extern void ipod_io_putf(ipod_io io,float f);
00269 
00275 extern uint32_t ipod_io_get4cc(ipod_io io);
00276 
00277 
00283 extern void ipod_io_put4cc(ipod_io io,uint32_t l);
00284 
00285 
00291 extern uint32_t ipod_io_getul3(ipod_io io);
00292 
00298 extern void ipod_io_putul3(ipod_io io,uint32_t l);
00299 
00305 extern uint32_t ipod_io_getul_ss(ipod_io io); // synchsafe integers from MP3 files
00306 
00312 extern void ipod_io_seek(ipod_io io,size_t offset);
00313 
00319 extern size_t ipod_io_tell(ipod_io io);
00320 
00327 extern size_t ipod_io_length(ipod_io io);
00328 
00334 extern void ipod_io_skip(ipod_io io,size_t count);
00335 
00341 extern void ipod_io_backpatch(ipod_io io,size_t mark);
00342 
00349 extern void ipod_io_get_simple_header(ipod_io io,size_t *h1,size_t *h2);
00350 
00357 extern size_t ipod_io_put_simple_header(ipod_io io,uint32_t tag,size_t size);
00358 
00364 extern size_t ipod_io_get_list_header(ipod_io io);
00365 
00372 extern size_t ipod_io_put_list_header(ipod_io io,uint32_t tag,size_t size);
00373 
00379 extern void ipod_io_put_zeros(ipod_io io,unsigned int count);
00380 
00387 extern void ipod_io_put_pad(ipod_io io,size_t mark,size_t size);
00388 
00389 #ifdef __cplusplus
00390 };
00391 #endif
00392 
00393 #endif

Generated on Tue Dec 13 14:55:22 2005 for libipod by  doxygen 1.3.9.1