1 May 2007 01:25
Re: _devid_t and _device_t and a bit of void
Peter Stuge <stuge-libusb <at> cdy.org>
2007-04-30 23:25:16 GMT
2007-04-30 23:25:16 GMT
On Mon, Apr 30, 2007 at 03:44:03PM -0700, Michael Bender wrote: > If a library is properly documented (and assuming that the library > implements the documented behavior), then why do you ever need to > look at the sources of the library? I agree completely. > The application is not "smarter" than the library, and it has > absolutely no business screwing around with private library data. Also fully agreed. > > The library is not distinct from the application. > > That's a cop-out answer. libusb should ideally never coredump due > to internal programming errors or due to the application > manipulating internal library state when it has no business doing > so. Back to my libc example - how many times have you ever had libc > coredump other than when you have fed it garbage? Once so far. But I agree with your point completely. > >>> Ouch no this is the opposite of what I would like to see. Just > >>> let the pointer serve as the hash? > >> you lose sanity checking then > > > > That's fine. I'm willing to sacrifice this isolation for the huge > > increase in ease of use. > > I don't get it - what's the ease of use issue you're talking about(Continue reading)
> On Mon, Apr 30, 2007 at 08:11:46PM +0800, Sophia Li wrote:
>>>>> I want the library to pick the right type depending on the
>>>>> endpoint.
>> Sorry, but endpoint address doesn't contain transfer type
>> information. The information is contained in bmAttributes in
>> endpoint desc. You need to get endpoint desc for deciding the type.
>> That is a big inconvenience.
>
> Yes, I mentioned this two or three times already. I want the library
> to get the descriptor automatically.
>
>
>> Why change all our previous design just for saving a type member in
>> the struct?
>
> That's not it. I made an analogy to system fd:s but I guess noone
> picked up on it.
>
we are not going to get it unless you come up with function prototypes
that illustrate what you are really proposing.
>
> On Sun, Apr 29, 2007 at 04:27:18PM -0700, frits vanderlinden wrote:
>
> This is a nice idea, but it has two problems;
>
> 1. The library is not distinct from the application.
> (the problem is in the application)
>
libusb should do as much as possible that it won't choke on garbage IN
> 2. The cost doesn't outweigh the very small potential benefit.
>
There is massive benefit that libusb will always inform the user that
RSS Feed