Paul Eggert wrote:
> > +#define ARCFOUR_SBOX_SIZE 256
> > +
> > +typedef struct
> > +{
> > + size_t idx_i, idx_j;
> > + char sbox[ARCFOUR_SBOX_SIZE];
> > +} arcfour_context;
>
> Why must these be in arcfour.h? Shouldn't all this private to
> arcfour.c?
>
> You can replace the above lines with 'struct arcfour_context;' and
> then move them into arcfour.c (replacing 'arcfour_context' with
> 'struct arcfour_context' everywhere).
It is needed in arcfour.h so that the user of this module can allocate
a variable of type 'arcfour_context' on the stack. Or if the struct
contents is made private, at least sizeof(arcfour_context) must be made
available through a variable 'const size_t arcfour_context_size'; but
then the allocation of such a context on the stack needs alloca().
Bruno
_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib