[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Remove platform visibility from Subversion auth functions (Was: Python bindings build seems broken)

From: Jeremy Whitlock <jcscoobyrs_at_gmail.com>
Date: Sat, 11 Oct 2008 08:53:47 -0600

> Good to hear that. (I still don't understand how it could have worked,
> though.)

Everything looks sound. It compiles because all of the stuff that is
public to all systems only reference structures and functions defined
in the Subversion headers. At runtime, it works because from a
functionality standpoint, nothing changed. For the OSX stuff, the
only thing that changed really was that we now have NULL checks in
cmdline.c, which will remove since we've made the promise to return
non-NULL on OSX systems. Does this help explain?

>> > Also, when I said on IRC that 'individual providers can promise more' -- we
>> > could make the individual providers we declare promise to return non-NULL on
>> > the appropriate platforms.
>> >
>> > For example,
>> >
>> > @@ svn_auth.h @@
>> > - * @note This function is only available on Mac OS 10.2 and higher.
>> > + * @note This function returns non-NULL iff the platform is Mac OS 10.2.
>> > */
>> > void
>> > svn_auth_get_keychain_simple_provider(svn_auth_provider_object_t **provider,
>> >
>> > and then we don't need to touch this code in cmdline.c. (But presumably
>> > the bindings will be happier because the functions are defined on all
>> > platforms.)
>>
>> Better documentation makes sense. Are you sure with the "promise" to
>> return non-NULL is enough? It just seemed like a good idea although
>> the only feasible way to get a NULL was on an unsupported platform.
>>
>
> I don't understand the question. If we make a promise in the API, then by
> definition callers don't have to check for it (or, callers that *do* check
> for it (for paranoia or debugging reasons) should use SVN_ERR_ASSERT or
> SVN_ERR_MALFUNCTION.) Does that answer your question?

Yeah. I think I was being a little too paranoid. I was just saying
that if a NULL can be returned, should we check for it and the answer
is no if we know 100% that it can't be NULL and in our case, we can.
NULL only is returned if you call a function for another platform and
that can't happen in cmdline.c since we conditionally include calls to
those functions.

-- 
Take care,
Jeremy Whitlock
http://www.thoughtspark.org
Received on 2008-10-11 16:54:02 CEST

This is an archived mail posted to the Subversion Dev mailing list.