<div dir="ltr"><br>Alright... I've been playing a bit with it... <br><br>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...<br>
<br>Is this how you mean it to be ?<br><br><br><br>Raphaël<br><br><br><br><div class="gmail_quote">On Mon, Aug 11, 2008 at 11:44 AM, Raphaël Pinson <span dir="ltr"><<a href="mailto:raphink@gmail.com">raphink@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr"><br><br><div class="gmail_quote"><div class="Ih2E3d">On Sat, Aug 9, 2008 at 11:07 AM, Raphaël Pinson <span dir="ltr"><<a href="mailto:raphink@gmail.com" target="_blank">raphink@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><br><br><div class="gmail_quote"><div>On Fri, Aug 8, 2008 at 11:55 PM, David Lutterkort <span dir="ltr"><<a href="mailto:dlutter@redhat.com" target="_blank">dlutter@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Fri, 2008-08-08 at 22:57 +0200, Raphaël Pinson wrote:<br>
><br>
><br>
> On Fri, Aug 8, 2008 at 10:12 PM, David Lutterkort <<a href="mailto:dlutter@redhat.com" target="_blank">dlutter@redhat.com</a>><br>
> wrote:<br>
<br>
</div><div>>         Yes, I think that would be the cleanest solution: tree_insert<br>
>         should<br>
>         become<br>
><br>
>                int tree_insert(struct tree **tree, const char *path,<br>
>         const char *label,<br>
>                                int before, struct path **node)<br>
<br>
</div>Thinking about this more, this is pretty ugly. I'd prefer it if<br>
aug_insert actually calls make_path and then passes that to tree_insert,<br>
which sets the path to the newly created node before returning, so that<br>
tree_insert ahs the signature<br>
<br>
        int tree_insert(struct tree **tree, struct path *path, const char *label,<br>
                        int before)<br>
<div></div></blockquote></div><div><br><br>I'm not sure to understand that part, I'll have to look at the code on monday.<div><br> </div></div></div></div></blockquote></div><div><br><br>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?<br>

<br><br><br><br>Raphaël<br></div></div><br></div>
</blockquote></div><br></div>