003 File Manager
Current Path:
/usr/src/contrib/subversion/subversion/libsvn_fs_base/bdb
usr
/
src
/
contrib
/
subversion
/
subversion
/
libsvn_fs_base
/
bdb
/
📁
..
📄
bdb-err.c
(2.9 KB)
📄
bdb-err.h
(4.24 KB)
📄
bdb_compat.c
(1.26 KB)
📄
bdb_compat.h
(4.57 KB)
📄
changes-table.c
(16.44 KB)
📄
changes-table.h
(3.68 KB)
📄
checksum-reps-table.c
(8.05 KB)
📄
checksum-reps-table.h
(3.77 KB)
📄
copies-table.c
(6.63 KB)
📄
copies-table.h
(3.75 KB)
📄
dbt.c
(3.83 KB)
📄
dbt.h
(4.14 KB)
📄
env.c
(22.57 KB)
📄
env.h
(5.34 KB)
📄
lock-tokens-table.c
(5.05 KB)
📄
lock-tokens-table.h
(3.33 KB)
📄
locks-table.c
(10.03 KB)
📄
locks-table.h
(4 KB)
📄
miscellaneous-table.c
(4.44 KB)
📄
miscellaneous-table.h
(2.5 KB)
📄
node-origins-table.c
(5.46 KB)
📄
node-origins-table.h
(3.19 KB)
📄
nodes-table.c
(8.27 KB)
📄
nodes-table.h
(4.93 KB)
📄
reps-table.c
(6.41 KB)
📄
reps-table.h
(3.45 KB)
📄
rev-table.c
(7.39 KB)
📄
rev-table.h
(3.03 KB)
📄
strings-table.c
(16.36 KB)
📄
strings-table.h
(5.29 KB)
📄
txn-table.c
(10.49 KB)
📄
txn-table.h
(3.86 KB)
📄
uuids-table.c
(4.33 KB)
📄
uuids-table.h
(2.35 KB)
Editing: dbt.c
/* dbt.c --- DBT-frobbing functions * * ==================================================================== * 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. * ==================================================================== */ #include <stdlib.h> #include <string.h> #include <apr_pools.h> #include <apr_md5.h> #include <apr_sha1.h> #define SVN_WANT_BDB #include "svn_private_config.h" #include "../id.h" #include "dbt.h" DBT * svn_fs_base__clear_dbt(DBT *dbt) { memset(dbt, 0, sizeof(*dbt)); return dbt; } DBT *svn_fs_base__nodata_dbt(DBT *dbt) { svn_fs_base__clear_dbt(dbt); /* A `nodata' dbt is one which retrieves zero bytes from offset zero, and stores them in a zero-byte buffer in user-allocated memory. */ dbt->flags |= (DB_DBT_USERMEM | DB_DBT_PARTIAL); dbt->doff = dbt->dlen = 0; return dbt; } DBT * svn_fs_base__set_dbt(DBT *dbt, const void *data, apr_size_t size) { svn_fs_base__clear_dbt(dbt); dbt->data = (void *) data; dbt->size = (u_int32_t) size; return dbt; } DBT * svn_fs_base__result_dbt(DBT *dbt) { svn_fs_base__clear_dbt(dbt); dbt->flags |= DB_DBT_MALLOC; return dbt; } /* An APR pool cleanup function that simply applies `free' to its argument. */ static apr_status_t apr_free_cleanup(void *arg) { free(arg); return 0; } DBT * svn_fs_base__track_dbt(DBT *dbt, apr_pool_t *pool) { if (dbt->data) apr_pool_cleanup_register(pool, dbt->data, apr_free_cleanup, apr_pool_cleanup_null); return dbt; } DBT * svn_fs_base__recno_dbt(DBT *dbt, db_recno_t *recno) { svn_fs_base__set_dbt(dbt, recno, sizeof(*recno)); dbt->ulen = dbt->size; dbt->flags |= DB_DBT_USERMEM; return dbt; } int svn_fs_base__compare_dbt(const DBT *a, const DBT *b) { int common_size = a->size > b->size ? b->size : a->size; int cmp = memcmp(a->data, b->data, common_size); if (cmp) return cmp; else return a->size - b->size; } /* Building DBT's from interesting things. */ /* Set DBT to the unparsed form of ID; allocate memory from POOL. Return DBT. */ DBT * svn_fs_base__id_to_dbt(DBT *dbt, const svn_fs_id_t *id, apr_pool_t *pool) { svn_string_t *unparsed_id = svn_fs_base__id_unparse(id, pool); svn_fs_base__set_dbt(dbt, unparsed_id->data, unparsed_id->len); return dbt; } /* Set DBT to the unparsed form of SKEL; allocate memory from POOL. */ DBT * svn_fs_base__skel_to_dbt(DBT *dbt, svn_skel_t *skel, apr_pool_t *pool) { svn_stringbuf_t *unparsed_skel = svn_skel__unparse(skel, pool); svn_fs_base__set_dbt(dbt, unparsed_skel->data, unparsed_skel->len); return dbt; } /* Set DBT to the text of the null-terminated string STR. DBT will refer to STR's storage. Return DBT. */ DBT * svn_fs_base__str_to_dbt(DBT *dbt, const char *str) { svn_fs_base__set_dbt(dbt, str, strlen(str)); return dbt; } DBT * svn_fs_base__checksum_to_dbt(DBT *dbt, svn_checksum_t *checksum) { svn_fs_base__set_dbt(dbt, checksum->digest, svn_checksum_size(checksum)); return dbt; }
Upload File
Create Folder