[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA: Re: "FREE" CPLD fitter tools



Steve Williams wrote:
> 
> First, I think it would be good if the jedec_read function return a cookie
> that holds the data from the jedec file, instead of using globals. This
> allows for multiple open images, and is also well suited for libraries that
> get turned into DLLs. An opaque cookie can be declared like so (in a public
> header file):
> 
>   typedef struct jedec_data *jedec_data_t;
> 
> The actual definition of ``struct jedec_data'' can be burried in j_priv.h
> or some other private header file.
> 
Steve,
 Using this scheme, say I want to have nested objects. For example,
jedec_data contains a cookie of architecture_data_t, which is a pointer
to architecture_data which in turn contains a cookie of fuse_array_t,
pointing to a fuse_array. Am I right to think the preprocessor
can't handle this? I'm getting errors like:

 dereferencing pointer to incomplete type

if j is a jedec_data_t, a is an architecture_data_t, and f is
a fuse_array_t and I try to refer to j->a->f.
Is there any way round this to implement a 'has a' relation
that goes more than one deep? 

Thanks
Graham