003 File Manager
Current Path:
/usr/src/contrib/subversion/subversion/libsvn_client
usr
/
src
/
contrib
/
subversion
/
subversion
/
libsvn_client
/
📁
..
📄
add.c
(43.54 KB)
📄
blame.c
(32.45 KB)
📄
cat.c
(12.07 KB)
📄
changelist.c
(4.8 KB)
📄
checkout.c
(8.3 KB)
📄
cleanup.c
(8.64 KB)
📄
client.h
(52.12 KB)
📄
cmdline.c
(14.22 KB)
📄
commit.c
(38.22 KB)
📄
commit_util.c
(77.37 KB)
📄
compat_providers.c
(4.31 KB)
📄
conflicts.c
(550.68 KB)
📄
copy.c
(136.7 KB)
📄
ctx.c
(4.06 KB)
📄
delete.c
(22.09 KB)
📄
deprecated.c
(115.45 KB)
📄
diff.c
(113.72 KB)
📄
diff_local.c
(27.35 KB)
📄
diff_summarize.c
(9.92 KB)
📄
export.c
(55.73 KB)
📄
externals.c
(50.42 KB)
📄
import.c
(37.83 KB)
📄
info.c
(17.37 KB)
📄
iprops.c
(9.06 KB)
📄
layout.c
(9.34 KB)
📄
libsvn_client.pc.in
(357 B)
📄
list.c
(20.66 KB)
📄
locking_commands.c
(22.19 KB)
📄
log.c
(34.9 KB)
📄
merge.c
(525.07 KB)
📄
merge_elements.c
(8.1 KB)
📄
mergeinfo.c
(91.66 KB)
📄
mergeinfo.h
(19.55 KB)
📄
mtcc.c
(46.92 KB)
📄
patch.c
(134.18 KB)
📄
prop_commands.c
(57.71 KB)
📄
ra.c
(42.82 KB)
📄
relocate.c
(8.09 KB)
📄
repos_diff.c
(45.37 KB)
📄
resolved.c
(5.24 KB)
📄
revert.c
(6.38 KB)
📄
revisions.c
(7.65 KB)
📄
shelf.c
(43.11 KB)
📄
shelf2.c
(73.33 KB)
📄
status.c
(29.84 KB)
📄
switch.c
(18.86 KB)
📄
update.c
(30.38 KB)
📄
upgrade.c
(15.42 KB)
📄
url.c
(1.98 KB)
📄
util.c
(15.01 KB)
📄
version.c
(1.13 KB)
📄
wc_editor.c
(20.4 KB)
Editing: ctx.c
/* * ctx.c: initialization function for client context * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== */ /* ==================================================================== */ /*** Includes. ***/ #include <stddef.h> #include <apr_pools.h> #include "svn_hash.h" #include "svn_client.h" #include "svn_error.h" #include "private/svn_wc_private.h" #include "client.h" /*** Code. ***/ /* Call the notify_func of the context provided by BATON, if non-NULL. */ static void call_notify_func(void *baton, const svn_wc_notify_t *n, apr_pool_t *pool) { const svn_client_ctx_t *ctx = baton; if (ctx->notify_func) ctx->notify_func(ctx->notify_baton, n->path, n->action, n->kind, n->mime_type, n->content_state, n->prop_state, n->revision); } static svn_error_t * call_conflict_func(svn_wc_conflict_result_t **result, const svn_wc_conflict_description2_t *conflict, void *baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { svn_client_ctx_t *ctx = baton; if (ctx->conflict_func) { const svn_wc_conflict_description_t *cd; cd = svn_wc__cd2_to_cd(conflict, scratch_pool); SVN_ERR(ctx->conflict_func(result, cd, ctx->conflict_baton, result_pool)); } else { /* We have to set a result; so we postpone */ *result = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone, NULL, result_pool); } return SVN_NO_ERROR; } /* The magic number in client_ctx_t.magic_id. */ #define CLIENT_CTX_MAGIC APR_UINT64_C(0xDEADBEEF600DF00D) svn_client__private_ctx_t * svn_client__get_private_ctx(svn_client_ctx_t *ctx) { svn_client__private_ctx_t *const private_ctx = (void*)((char *)ctx - offsetof(svn_client__private_ctx_t, public_ctx)); SVN_ERR_ASSERT_NO_RETURN(&private_ctx->public_ctx == ctx); SVN_ERR_ASSERT_NO_RETURN(0 == private_ctx->magic_null); SVN_ERR_ASSERT_NO_RETURN(CLIENT_CTX_MAGIC == private_ctx->magic_id); return private_ctx; } svn_error_t * svn_client_create_context2(svn_client_ctx_t **ctx, apr_hash_t *cfg_hash, apr_pool_t *pool) { svn_config_t *cfg_config; svn_client__private_ctx_t *const private_ctx = apr_pcalloc(pool, sizeof(*private_ctx)); svn_client_ctx_t *const public_ctx = &private_ctx->public_ctx; private_ctx->magic_null = 0; private_ctx->magic_id = CLIENT_CTX_MAGIC; public_ctx->notify_func2 = call_notify_func; public_ctx->notify_baton2 = public_ctx; public_ctx->conflict_func2 = call_conflict_func; public_ctx->conflict_baton2 = public_ctx; public_ctx->config = cfg_hash; if (cfg_hash) cfg_config = svn_hash_gets(cfg_hash, SVN_CONFIG_CATEGORY_CONFIG); else cfg_config = NULL; SVN_ERR(svn_wc_context_create(&public_ctx->wc_ctx, cfg_config, pool, pool)); *ctx = public_ctx; return SVN_NO_ERROR; } svn_error_t * svn_client_create_context(svn_client_ctx_t **ctx, apr_pool_t *pool) { return svn_client_create_context2(ctx, NULL, pool); }
Upload File
Create Folder