[elinks-users] LIST_HEAD and *prev *next
Yan Seiner
yan at seiner.com
Tue May 1 09:09:50 MDT 2007
Kalle Olavi Niemitalo wrote:
> Yan Seiner <yan at seiner.com> writes:
>
>
>> Could someone please clue me in on how to use *prev and *next pointers
>> for struct form_control?
>>
>
> It's a cyclic list and the sentinel is just a struct list_head
> rather than a full struct form_control. Compare the pointer to
> &form->items, or preferably use the macros in src/util/lists.h.
>
Hah! OK, thanks. That explains a lot.
> Please note bug 189 will require changing the representation of
> lists in a future version.
>
OK, thanks for the head up.
>
>> On another topic, I've commented out the find_form_state and subsequent
>> free. I haven't been able to find a 'free_form_state' type of
>> function. Could someone please clue me in on how to free the structure
>> allocated with find_form_state?
>>
>
> find_form_state extends the array to which view_state.form_info
> points, and destroy_vs eventually frees the whole array. Do you
> have a specific reason to destroy the form_state before that?
>
Nope. Just my imperfect understanding of elinks - at first glance I
thought that find_form_state creates a new structure...
> Because you're hacking the C code, it might be better to take
> this discussion to elinks-dev.
>
OK, will do.
Thanks!
--Yan
More information about the elinks-users
mailing list