[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 10:22:36 UTC 2008


Alright... I've been playing a bit with it...

If I change tree_insert to take a struct path *path instead of a const char
*path, then there is a problem with tree_insert_glue in builtin.c, because
it can't provide a struct path to tree_insert since struct path is a
structure specific to augeas.c. On the other hand, if I move struct path to
internal.h, then I still have to move make_path aswell...

Is this how you mean it to be ?



Raphaël



On Mon, Aug 11, 2008 at 11:44 AM, Raphaël Pinson <raphink at gmail.com> wrote:

>
>
> 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/fd2c8bb7/attachment.htm>


More information about the augeas-devel mailing list