You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "C. Michael Pilato" <cm...@collab.net> on 2009/07/28 18:10:23 UTC

WC-NG question: ctx->wc_ctx docs

Reading in svn_client.h, I see:

  /** An optional working copy context for the client operation to use.
   * This is initialized by svn_client_create_context() and should never
   * be @c NULL.
   *
   * @since New in 1.7.  */
  svn_wc_context_t *wc_ctx;

Can someone help me interpret this?  If the wc_ctx pointer is "optional",
then what (if not NULL) is its value when the structure initializer "opts
out" on this field?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376353

Re: WC-NG question: ctx->wc_ctx docs

Posted by Julian Foad <ju...@btopenworld.com>.
On Tue, 2009-07-28 at 19:58 -0500, Hyrum K. Wright wrote:
> On Jul 28, 2009, at 1:10 PM, C. Michael Pilato wrote:
> 
> > Reading in svn_client.h, I see:
> >
> >  /** An optional working copy context for the client operation to use.
> >   * This is initialized by svn_client_create_context() and should  
> > never
> >   * be @c NULL.
> >   *
> >   * @since New in 1.7.  */
> >  svn_wc_context_t *wc_ctx;
> >
> > Can someone help me interpret this?  If the wc_ctx pointer is  
> > "optional",
> > then what (if not NULL) is its value when the structure initializer  
> > "opts
> > out" on this field?
> 
> Yeah, something there doesn't parse quite right.  Here's the skinny:
> 
> 1.7-era libsvn_client will initialize the value, and since it's  
> assumed that the same version of the library which initialized it will  
> always be using it, all 1.7-era APIs also assume it is non-NULL.   
> Previous versions of the library obviously have no notion of wc_ctx,  
> will not initialize the value (heck, won't even allocate memory for  
> it), and won't ever use it.
> 
> So the docstring should probably be updated to say something like  
> "this always get initialized inside of svn_client_create_context()".

I removed the word "optional" in r39712.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2402175

Re: WC-NG question: ctx->wc_ctx docs

Posted by "Hyrum K. Wright" <hy...@hyrumwright.org>.
On Jul 28, 2009, at 1:10 PM, C. Michael Pilato wrote:

> Reading in svn_client.h, I see:
>
>  /** An optional working copy context for the client operation to use.
>   * This is initialized by svn_client_create_context() and should  
> never
>   * be @c NULL.
>   *
>   * @since New in 1.7.  */
>  svn_wc_context_t *wc_ctx;
>
> Can someone help me interpret this?  If the wc_ctx pointer is  
> "optional",
> then what (if not NULL) is its value when the structure initializer  
> "opts
> out" on this field?

Yeah, something there doesn't parse quite right.  Here's the skinny:

1.7-era libsvn_client will initialize the value, and since it's  
assumed that the same version of the library which initialized it will  
always be using it, all 1.7-era APIs also assume it is non-NULL.   
Previous versions of the library obviously have no notion of wc_ctx,  
will not initialize the value (heck, won't even allocate memory for  
it), and won't ever use it.

So the docstring should probably be updated to say something like  
"this always get initialized inside of svn_client_create_context()".

You dig?

-Hyrum

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2376460