Re: [AD] update/properties |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
> Ok, returning a new datafile makes sense, as well as providing a helper to > construct the object (I think I'll change the name of the routine to > datedit_construct_datafile or something like that). But I don't like the > 'prev' datafile very much: we don't need to pass a previous datafile, only > the properties we want the new one to use. > > Is this good enough for you? If so, I'll make the modifications when > merging the patch. Well, it took some time but I eventually got around to doing that. The prototype of the 'grab' method is now: DATAFILE *(*grab)(int type, AL_CONST char *filename, DATAFILE_PROPERTY **prop, int depth); where 'prop' is a modifiable list of properties, and there are a few associated manipulation routines: AL_CONST char *datedit_get_property(DATAFILE_PROPERTY **prop, int type); int datedit_numprop(DATAFILE_PROPERTY **prop, int type); void datedit_insert_property(DATAFILE_PROPERTY **prop, int type, AL_CONST char *value); Once they are done with creating the data and modifying the properties, plugins call: DATAFILE *datedit_construct(int type, void *dat, long size, DATAFILE_PROPERTY **prop); and return the result. When updating an object, the existing properties are passed unchanged to the plugin, except the date which is always modified. The attached patch updates the dat, grabber and pat2dat utilities as well as the bundled plugins. -- Eric Botcazou
Attachment:
dat_properties.diff.gz
Description: GNU Zip compressed data
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |