Re: [AD] load_datafile_object with properties

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, 2002-10-06 at 22:52, Laurence Withers wrote:
> 
> Yes - an add function, a free whole linked list function and make sure
> that the structure's members are all public.

On Mon, 2002-10-07 at 12:19, Eric Botcazou wrote:
> > These two functions would be used as helpers by the datafile loading and
> > unloading code, and are the main helpers for when you want to alter an
> > object's properties.
> 
> I agree, they are helpers for managing the property list, but...
> 
> > Of course, by making the linked list public, people can also do other
> > stuff such as removing certain elements, etc.
> 
> ...why might the user want to modify the property list at runtime ?
> 

Ok, in this version, I fixed everything mentioned, and converted it to a
linked list with a public API. About the public API, i went a middle
way, and only made the add-to-list function public, but left the
clear-complete-list static. My reasoning was, in case a user would want
to do this for whatever reason, the former is quite lengthy, but the
latter is only a one-line loop.

Changing to a linked list required many changes in the datafile tools
(see my patch), so if you want, I can still send a fixed version of my
first patch using arrays, and only changing datafile.c. But I remember,
there are other changes going on in the datafile tools, so maybe now is
a good time for this anyway?

The patch also contains my errno fix which I forgot to remove from my
cvs script.. I'll remove it in the next patch, I'm just too lazy for it
now :)

I didn't adapt the dat2c and dat2s programs yet, because I'm not sure
what's the best way to hard-code a linked list, all solutions without
some sort of constructor function seem to either require many variables
or be a bit hackish. So be warned, the patch breaks them both.

--
Elias Pschernig

Attachment: properties2.diff.gz
Description: GNU Zip compressed data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/