6 if ( rb
->read(fd
, &c
, 1) )
12 off_t
my_ftell(int fd
){
13 return rb
->lseek(fd
, 0, SEEK_CUR
);
16 int my_putc(char c
, int fd
){
17 return rb
->write(fd
,&c
,1);
20 void *my_malloc(size_t size
)
22 static char *offset
= NULL
;
23 static size_t totalSize
= 0;
26 int remainder
= size
% 4;
28 size
= size
+ 4-remainder
;
32 offset
= rb
->plugin_get_audio_buffer(&totalSize
);
35 if (size
+ 4 > totalSize
)
37 /* We've made our point. */
42 *((unsigned int *)offset
) = size
;
45 totalSize
-= size
+ 4;