[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libvir] 1/4 Additions to the public API



[... Struct versus 3 arrays discussion snipped ...]

I think both representations have their merits, and DV's "3 arrays"
approach is much easier to marshal through the remote code, and
simpler to produce OCaml bindings for (no idea about Python).

The reason for using the struct was to provide extensibility.  The
dnsmasq "--dhcp-hostfiles" file format is much richer than merely
(hwaddr, ipaddr [, hostname]) triplets.  For example it can include
lease times and client IDs[1].

The API calls I chose give us the opportunity to extend the structure
with new elements in future.  But to do this you have to provide a
deallocator (because additional elements may need to be freed), and
flags on the Add call.

If we agree that we won't / can't / don't want to extend this
structure, I'd be more than happy to use 3 arrays and lose the
deallocator.  It will simplify the remote code considerably.

Rich.

[1] See the dnsmasq manual page for the full details.  I'm not
convinced that the format is even well-specified by that manpage so
probably at some point we'll need to look at the source code.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]