Reorganize the output to "svnserve --help".
[svn.git] / subversion / libsvn_client / ctx.c
blobc259f10d3233ca967f83db3f4d01bcf0974154ae
1 /*
2 * ctx.c: intialization function for client context
4 * ====================================================================
5 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
19 /* ==================================================================== */
23 /*** Includes. ***/
25 #include <apr_pools.h>
26 #include "svn_client.h"
27 #include "svn_error.h"
30 /*** Code. ***/
32 /* Call the notify_func of the context provided by BATON, if non-NULL. */
33 static void
34 call_notify_func(void *baton, const svn_wc_notify_t *n, apr_pool_t *pool)
36 const svn_client_ctx_t *ctx = baton;
38 if (ctx->notify_func)
39 ctx->notify_func(ctx->notify_baton, n->path, n->action, n->kind,
40 n->mime_type, n->content_state, n->prop_state,
41 n->revision);
44 svn_error_t *
45 svn_client_create_context(svn_client_ctx_t **ctx,
46 apr_pool_t *pool)
48 *ctx = apr_pcalloc(pool, sizeof(svn_client_ctx_t));
49 (*ctx)->notify_func2 = call_notify_func;
50 (*ctx)->notify_baton2 = *ctx;
51 return SVN_NO_ERROR;