Thread
Thread Index
Message
On Jun 17, 2010, at 12:37, Pierre Joye wrote:
> On Thu, Jun 17, 2010 at 12:29 PM, Dieter Baron
> <dillo%danbala.tuwien.ac.at@localhost> wrote:
>> On Jun 17, 2010, at 12:16, Pierre Joye wrote:
>>
>>> zipint.h is required as of now. I don't think it is very clean, zip.h
>>> should expose all we need to use the library and leave private
>>> definitions in zipint.h.
>>
>> Exactly. zipint.h is an internal header with details that should not be
>> exposed to libzip users.
>>
>> The contents of struct zip are private to libzip.
>>
>> An application using libzip does not need to know them, nor the size of it.
>> If you want a struct zip, you call zip_open (or one of its variants), which
>> allocates and initializes it for you. If you want to add a file to a zip
>> archive from a buffer, you open (or create) the archive with zip_open, and
>> pass the returned struct zip pointer as the first argument to
>> zip_source_buffer.
>>
>>> Right now it is mixed and zipint.h should be
>>> distributed as well.
>>
>> Why do you think so? What are you missing from zip.h?
>
>
> struct zip;
> struct zip_file;
> struct zip_source;
>
> The compiler cannot know the members nor the size of these struct,
> when only zip.h is included.
Indeed, and that is entirely intentional. Why do you think you need to know
them?
If we exposed the size or members of these structs, we whould break ABI
compatibility whenever we changed those structures (e.g. added a new member).
That is why these are opaque types -- you get a pointer to them, pass that
pointer to functions of libzip. Beyond that, you don't have to care how these
types look like.
yours,
dillo
Made by MHonArc.
|