pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] Public API and gl_list


From: gerel
Subject: Re: [pdf-devel] Public API and gl_list
Date: Mon, 10 Mar 2008 19:00:51 -0300

 > Date: Mon, 10 Mar 2008 22:49:55 +0100
 > From: address@hidden
 > 
 > 
 >     >    BTW, I'm thinking in declaring pdf_list_t, etc, to be a structure 
 > and not a
 >     >    pointer to one, otherwise we'll need to change the list API. 
 >     > 
 >     > Why? 
 >     > 
 >     >    I prefer the structure based version. 
 >     >    What do you think ?
 >     > 
 >     > I don't have objections to use structures rather than pointer to
 >     > structures in this case.
 >     > 
 >     > 
 > 
 >    Ah, ok it doesn't matter. Going with pointers anyway.
 > 
 > Ok :)
 > 

I found a problem.

This is the declaration of gl_list_iterator_t,

typedef struct
{
  /* For fast dispatch of gl_list_iterator_next.  */
  const struct gl_list_implementation *vtable;
  /* For detecting whether the last returned element was removed.  */
  gl_list_t list;
  size_t count;
  /* Other, implementation-private fields.  */
  void *p; void *q;
  size_t i; size_t j;
} gl_list_iterator_t;


I think we can't convert that to (void*).
One solution would be to paste that right on pdf-list.h but it's not an
alternative, since we won't gain anything after all if we mix detailed
structures with (void*) pointer structures.

I'm stuck here.

OTOH, I decided to use structures instead of pointers to structures because 
there
is no way to keep track of pdf_list_node_t's allocated memory, and because it's
simpler to implement :-) 

-gerel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]