<div dir="ltr"><br><br><div class="gmail_quote">On Mon, Aug 11, 2008 at 8:44 PM, David Lutterkort <span dir="ltr"><<a href="mailto:dlutter@redhat.com">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 class="Ih2E3d">On Mon, 2008-08-11 at 12:22 +0200, Raphaël Pinson wrote:<br>
> If I change tree_insert to take a struct path *path instead of a const<br>
> char *path, then there is a problem with tree_insert_glue in<br>
> builtin.c, because it can't provide a struct path to tree_insert since<br>
> struct path is a structure specific to augeas.c. On the other hand, if<br>
> I move struct path to internal.h, then I still have to move make_path<br>
> aswell...<br>
<br>
</div>There's two things you can do:<br>
<br>
      * Declare struct path and make_path to internal.h, so that they<br>
        can be called from tree_insert_glue</blockquote><div><br>That's a big change somehow, since that means that all things path are made generic, but that's where it lead me.<br><br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

      * Leave the prototype for tree_insert the way it is, but change<br>
        its implementation to just call make_path, and move the rest of<br>
        its body into a new function tree_insert_path that takes a<br>
        struct path<br>
</blockquote><div><br>I don't understand how that would change the problem. Eventually, the function that calculates the path to the newly created node has to know about the new tree. This tree cannot be easily exported so that means that this calculation is better done within tree_insert, and tree_insert has to return the result, so I don't see how a tree_insert_path function would change that. It seems much easier to me to call tree_insert with a struct path like you suggested before, and have struct path be generic.<br>
<br><br>Raphael<br></div></div></div>