Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h	(revision 8000)
+++ subversion/include/svn_client.h	(working copy)
@@ -375,7 +375,8 @@
 
 /** A client context structure, which holds client specific callbacks, 
  * batons, serves as a cache for configuration options, and other various 
- * and sundry things.
+ * and sundry things.  Clients should use svn_client_open() to allocate
+ * and intialize this structure.
  */
 typedef struct svn_client_ctx_t
 {
@@ -424,6 +425,20 @@
 /** @} */
 
 
+/** Initialize a client context.
+ * Return a client context in @a *ctx (allocated in 
+ * @a pool) that represents a particular instance of the svn
+ * client.  
+ *
+ * Clients should use this function to intialize
+ * and allocate the svn_client_ctx_t structure rather than
+ * doing so directly as the size of this structure may change
+ * in the future. 
+ */ 
+void
+svn_client_open(svn_client_ctx_t **ctx,
+                apr_pool_t *pool);
+
 /** Checkout a working copy of @a URL at @a revision, using @a path as
  * the root directory of the newly checked out working copy, and
  * authenticating with the authentication baton cached in @a ctx.  If
Index: subversion/libsvn_client/ctx.c
===================================================================
--- subversion/libsvn_client/ctx.c	(revision 0)
+++ subversion/libsvn_client/ctx.c	(revision 0)
@@ -0,0 +1,37 @@
+/*
+ * ctx.c:  intialization function for client context
+ *
+ * ====================================================================
+ * Copyright (c) 2000-2003 CollabNet.  All rights reserved.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at http://subversion.tigris.org/license-1.html.
+ * If newer versions of this license are posted there, you may use a
+ * newer version instead, at your option.
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals.  For exact contribution history, see the revision
+ * history and logs, available at http://subversion.tigris.org/.
+ * ====================================================================
+ */
+
+/* ==================================================================== */
+
+
+
+/*** Includes. ***/
+
+#include <apr_pools.h>
+#include "svn_client.h"
+
+
+
+/*** Code. ***/
+
+void
+svn_client_open (svn_client_ctx_t **ctx,
+                      apr_pool_t *pool)
+{
+  *ctx = apr_pcalloc(pool,sizeof(svn_client_ctx_t));
+}
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c	(revision 8000)
+++ subversion/clients/cmdline/main.c	(working copy)
@@ -640,7 +640,7 @@
   int opt_id;
   apr_getopt_t *os;  
   svn_cl__opt_state_t opt_state = { { 0 } };
-  svn_client_ctx_t ctx = { 0 };
+  svn_client_ctx_t *ctx = NULL;
   int received_opts[SVN_OPT_MAX_OPTIONS];
   int i, num_opts = 0;
   const svn_opt_subcommand_desc_t *subcommand = NULL;
@@ -1090,9 +1090,11 @@
 
   /* Create a client context object. */
   command_baton.opt_state = &opt_state;
-  command_baton.ctx = &ctx;
+  svn_client_open(&ctx,pool);
+  command_baton.ctx = ctx;
 
-  if ((err = svn_config_get_config (&(ctx.config), opt_state.config_dir, pool)))
+  if ((err = svn_config_get_config (&(ctx->config),
+                                    opt_state.config_dir, pool)))
     {
       svn_handle_error (err, stderr, FALSE);
       svn_error_clear (err);
@@ -1100,7 +1102,7 @@
       return EXIT_FAILURE;
     }
 
-  cfg = apr_hash_get (ctx.config, SVN_CONFIG_CATEGORY_CONFIG,
+  cfg = apr_hash_get (ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
                       APR_HASH_KEY_STRING);
   
   /* Update the options in the config */
@@ -1130,8 +1132,8 @@
     }
 
   /* Set the log message callback function.  Note that individual
-     subcommands will populate the ctx.log_msg_baton */
-  ctx.log_msg_func = svn_cl__get_log_message;
+     subcommands will populate the ctx->log_msg_baton */
+  ctx->log_msg_func = svn_cl__get_log_message;
 
   /* Authentication set-up. */
   {
@@ -1191,11 +1193,11 @@
 
     /* Build an authentication baton to give to libsvn_client. */
     svn_auth_open (&ab, providers, pool);
-    ctx.auth_baton = ab;
+    ctx->auth_baton = ab;
 
     /* Set up our cancellation support. */
     apr_signal (SIGINT, sig_int);
-    ctx.cancel_func = svn_cl__check_cancel;
+    ctx->cancel_func = svn_cl__check_cancel;
 
     /* Place any default --username or --password credentials into the
        auth_baton's run-time parameter hash. */
Index: tools/examples/minimal_client.c
===================================================================
--- tools/examples/minimal_client.c	(revision 8000)
+++ tools/examples/minimal_client.c	(working copy)
@@ -117,7 +117,7 @@
   svn_opt_revision_t revision;
   apr_hash_t *dirents;
   apr_hash_index_t *hi;
-  svn_client_ctx_t ctx = { 0 };
+  svn_client_ctx_t *ctx = NULL;
   const char *URL;
 
   if (argc <= 1)
@@ -149,8 +149,11 @@
 
   /* All clients need to fill out a client_ctx object. */
   {
+    /* Initialize and allocate the client_ctx object. */
+    svn_client_open(&ctx,pool);
+    
     /* Load the run-time config file into a hash */
-    if ((err = svn_config_get_config (&(ctx.config), NULL, pool)))
+    if ((err = svn_config_get_config (&(ctx->config), NULL, pool)))
       {
         svn_handle_error (err, stderr, 0);
         return EXIT_FAILURE;
@@ -161,16 +164,16 @@
 
     /* A func (& context) which receives event signals during
        checkouts, updates, commits, etc.  */
-    /* ctx.notify_func = my_notification_func;
-       ctx.notify_baton = NULL; */
+    /* ctx->notify_func = my_notification_func;
+       ctx->notify_baton = NULL; */
     
     /* A func (& context) which can receive log messages */
-    /* ctx.log_msg_func = my_log_msg_receiver_func;
-       ctx.log_msg_baton = NULL; */
+    /* ctx->log_msg_func = my_log_msg_receiver_func;
+       ctx->log_msg_baton = NULL; */
     
     /* A func (& context) which checks whether the user cancelled */
-    /* ctx.cancel_func = my_cancel_checking_func;
-       ctx.cancel_baton = NULL; */
+    /* ctx->cancel_func = my_cancel_checking_func;
+       ctx->cancel_baton = NULL; */
 
     /* Make the client_ctx capable of authenticating users */
     {
@@ -193,7 +196,7 @@
       APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
 
       /* Register the auth-providers into the context's auth_baton. */
-      svn_auth_open (&ctx.auth_baton, providers, pool);      
+      svn_auth_open (&ctx->auth_baton, providers, pool);      
     }
   } /* end of client_ctx setup */
 
@@ -208,7 +211,7 @@
   err = svn_client_ls (&dirents,
                        URL, &revision,
                        FALSE, /* no recursion */
-                       &ctx, pool);
+                       ctx, pool);
   if (err)
     {
       svn_handle_error (err, stderr, 0);


