Re: C binding for libdar

Denis Corbin <[email protected]>
Newsgroups gmane.comp.sysutils.backup.dar.general
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Wesley Leggette wrote:
| So the big project I've been working on is a C binding for libdar.

Whaooo! Cool!!! :-)

| Right
| now, The API is pretty much finished. I've written the headers and
| documentation. Next up will be testcases and implementation.

This sounds interesting!

|
| If anyone is interested, I'd love for you to take a look at the API and
| tell me what you think. Is it usable? Is it complete? I'd love to know
| soon so that I can make changes before I get into serious
| implementation.

for what I have read of the documentation, you replace any class by a
pointer type to a "struct", which is used explicitly in the function
arguments in place of the C++ "this" implicit argument, and you just
keep the few struct and #defines from libdar?

for example, it seems to be the case for masks:
~  in place of
	my_and_mask.add(another_mask);

~  you have
	dar_mask_and_add(&my_and_mask, &another_mask);

If this is a general principle, I think you should not meet to much
problem in your project, at least not ones you cannot find a solution.

But, the remark I would say for this previous extract for the C binding
~ layer is that you don't seem to restrict the first argument to a type
that can support the "add" operation, all argument are "dar_mask *" so a
user could try to add a mask to a bool_mask for example?

Last point, note also that to stay thread-safe, the implementation of
the C binding functions must not use any "static" members, all must be
stored on the stack (function's arguments and local variables only).

|
| The documentation can be found at:
| http://www.kaylix.net/errata/lddocs/index.html
|
|
| Cheers,


Cheers,
Denis.

P.S.: don't hesitate to contact me if you are in trouble in your project.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCE7rypC5CI8gYGlIRAl0QAKCQ0UIDPRDxAhSKwyBYKKwOfcKabgCfeZv1
yD1QIlM+jF4PhiaQbdyw7G4=
=uf10
-----END PGP SIGNATURE-----



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.