[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] libc/fdevopen/calloc/malloc (was gcc-3.4.2 bin forwin
Re: [avr-gcc-list] libc/fdevopen/calloc/malloc (was gcc-3.4.2 bin forwin xp?)
Wed, 10 Nov 2004 10:09:03 -0800
On Wednesday 10 November 2004 5:56 am, Joerg Wunsch wrote:
> OK, but at least I have to restrict the size of the table of pointers
> then, to say 3 pointers. The user has to pass the _iob object's space
> then in the function.
> Sigh, it seems I have to export _iob then in <stdio.h>. :-( I was
> trying to avoid that, I've seen too many crappy old Unix programs
> where programmers abused supposedly internal fields of _iob in their
> programs, as <stdio.h> did export it to them.
You could just expose sizeof(struct _iob) as a #define and require that the
initializer get passed a char* or void* that defines that area:
#define IOB_SIZE 32
void initializeIOBuffers(char* buffers, uint8_t nBuffers);
... later ...
#define NBUFFERS 3
char myBuffers[ NBUFFERS * IOB_SIZE ];