[augeas-devel] [PATCH] Write last created node in /augeas/tree/last_created for tree_create and tree_insert

Raphaël Pinson raphink at gmail.com
Mon Aug 11 09:44:32 UTC 2008


On Sat, Aug 9, 2008 at 11:07 AM, Raphaël Pinson <raphink at gmail.com> wrote:

>
>
> On Fri, Aug 8, 2008 at 11:55 PM, David Lutterkort <dlutter at redhat.com>wrote:
>
>> On Fri, 2008-08-08 at 22:57 +0200, Raphaël Pinson wrote:
>> >
>> >
>> > On Fri, Aug 8, 2008 at 10:12 PM, David Lutterkort <dlutter at redhat.com>
>> > wrote:
>>
>> >         Yes, I think that would be the cleanest solution: tree_insert
>> >         should
>> >         become
>> >
>> >                int tree_insert(struct tree **tree, const char *path,
>> >         const char *label,
>> >                                int before, struct path **node)
>>
>> Thinking about this more, this is pretty ugly. I'd prefer it if
>> aug_insert actually calls make_path and then passes that to tree_insert,
>> which sets the path to the newly created node before returning, so that
>> tree_insert ahs the signature
>>
>>        int tree_insert(struct tree **tree, struct path *path, const char
>> *label,
>>                        int before)
>>
>
>
> I'm not sure to understand that part, I'll have to look at the code on
> monday.
>
>


Hmmm ok, let me see if I got it. Instead of sending a const char *path to
tree_insert, you would send a struct path *path, which was created by
aug_insert (or the other function calling tree_insert) and tree_insert would
then return the path to the newly created node in *path, so aug_insert could
call format_path on it (or call the function to write to
/augeas/tree/least_created). Is that it?




Raphaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080811/87b69b36/attachment.htm>


More information about the augeas-devel mailing list