核心功能: - ✅ Categories/Series双视图管理(category_view.rs + import_markdown.rs) - ✅ FUSE Multi-Volume支持(tree_type参数) - ✅ SSH/SFTP/SCP/rsync协议完整实现(4042行) - ✅ NFS/SMB Module Phase 1-3完成 - ✅ Archive Module Phase 1-4完成(2916行) - ✅ Download Center API完整实现 - ✅ S3兼容API实现(560行) Git配置修正: - ✅ 删除错误origin(gitea.momentry.ddns.net) - ✅ 删除m5max128(指向机器名) - ✅ 设置origin = m5max128gitea.momentry.ddns.net/admin/markbase - ✅ 设置m4minigitea = m4minigitea.momentry.ddns.net/warren/markbase 数据清理: - ✅ 删除38个临时SQLite(保留accusys.sqlite、demo.sqlite) - ✅ 删除.bak、test_*.bin、调试脚本等临时文件 - ✅ 删除临时目录(build/、download files/、raid_test/等) - ✅ 更新.gitignore排除临时文件 架构优化: - 52个文件修改,2434行新增,4739行删除 - Workspace成员整合(16个crate) - 数据库状态:accusys.sqlite保留(主demo测试) 远程同步: - ✅ 准备推送到m5max128gitea(远程Gitea) - ✅ 准备推送到m4minigitea(本地Gitea)
98 lines
3.4 KiB
C
98 lines
3.4 KiB
C
// Copyright (c) 2016, Google Inc.
|
|
// SPDX-License-Identifier: ISC
|
|
|
|
#ifndef OPENSSL_HEADER_POOL_H
|
|
#define OPENSSL_HEADER_POOL_H
|
|
|
|
#include <openssl/base.h>
|
|
|
|
#include <openssl/stack.h>
|
|
|
|
#if defined(__cplusplus)
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
// Buffers and buffer pools.
|
|
//
|
|
// |CRYPTO_BUFFER|s are simply reference-counted blobs. A |CRYPTO_BUFFER_POOL|
|
|
// is an intern table for |CRYPTO_BUFFER|s. This allows for a single copy of a
|
|
// given blob to be kept in memory and referenced from multiple places.
|
|
|
|
|
|
DEFINE_STACK_OF(CRYPTO_BUFFER)
|
|
|
|
// CRYPTO_BUFFER_POOL_new returns a freshly allocated |CRYPTO_BUFFER_POOL| or
|
|
// NULL on error.
|
|
OPENSSL_EXPORT CRYPTO_BUFFER_POOL* CRYPTO_BUFFER_POOL_new(void);
|
|
|
|
// CRYPTO_BUFFER_POOL_free frees |pool|, which must be empty.
|
|
OPENSSL_EXPORT void CRYPTO_BUFFER_POOL_free(CRYPTO_BUFFER_POOL *pool);
|
|
|
|
// CRYPTO_BUFFER_new returns a |CRYPTO_BUFFER| containing a copy of |data|, or
|
|
// else NULL on error. If |pool| is not NULL then the returned value may be a
|
|
// reference to a previously existing |CRYPTO_BUFFER| that contained the same
|
|
// data. Otherwise, the returned, fresh |CRYPTO_BUFFER| will be added to the
|
|
// pool.
|
|
OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len,
|
|
CRYPTO_BUFFER_POOL *pool);
|
|
|
|
// CRYPTO_BUFFER_alloc creates an unpooled |CRYPTO_BUFFER| of the given size and
|
|
// writes the underlying data pointer to |*out_data|. It returns NULL on error.
|
|
//
|
|
// After calling this function, |len| bytes of contents must be written to
|
|
// |out_data| before passing the returned pointer to any other BoringSSL
|
|
// functions. Once initialized, the |CRYPTO_BUFFER| should be treated as
|
|
// immutable.
|
|
OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_alloc(uint8_t **out_data,
|
|
size_t len);
|
|
|
|
// CRYPTO_BUFFER_new_from_CBS acts the same as |CRYPTO_BUFFER_new|.
|
|
OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new_from_CBS(
|
|
const CBS *cbs, CRYPTO_BUFFER_POOL *pool);
|
|
|
|
// CRYPTO_BUFFER_new_from_static_data_unsafe behaves like |CRYPTO_BUFFER_new|
|
|
// but does not copy |data|. |data| must be immutable and last for the lifetime
|
|
// of the address space.
|
|
OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new_from_static_data_unsafe(
|
|
const uint8_t *data, size_t len, CRYPTO_BUFFER_POOL *pool);
|
|
|
|
// CRYPTO_BUFFER_free decrements the reference count of |buf|. If there are no
|
|
// other references, or if the only remaining reference is from a pool, then
|
|
// |buf| will be freed.
|
|
OPENSSL_EXPORT void CRYPTO_BUFFER_free(CRYPTO_BUFFER *buf);
|
|
|
|
// CRYPTO_BUFFER_up_ref increments the reference count of |buf| and returns
|
|
// one.
|
|
OPENSSL_EXPORT int CRYPTO_BUFFER_up_ref(CRYPTO_BUFFER *buf);
|
|
|
|
// CRYPTO_BUFFER_data returns a pointer to the data contained in |buf|.
|
|
OPENSSL_EXPORT const uint8_t *CRYPTO_BUFFER_data(const CRYPTO_BUFFER *buf);
|
|
|
|
// CRYPTO_BUFFER_len returns the length, in bytes, of the data contained in
|
|
// |buf|.
|
|
OPENSSL_EXPORT size_t CRYPTO_BUFFER_len(const CRYPTO_BUFFER *buf);
|
|
|
|
// CRYPTO_BUFFER_init_CBS initialises |out| to point at the data from |buf|.
|
|
OPENSSL_EXPORT void CRYPTO_BUFFER_init_CBS(const CRYPTO_BUFFER *buf, CBS *out);
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
} // extern C
|
|
|
|
extern "C++" {
|
|
|
|
BSSL_NAMESPACE_BEGIN
|
|
|
|
BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER_POOL, CRYPTO_BUFFER_POOL_free)
|
|
BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER, CRYPTO_BUFFER_free)
|
|
BORINGSSL_MAKE_UP_REF(CRYPTO_BUFFER, CRYPTO_BUFFER_up_ref)
|
|
|
|
BSSL_NAMESPACE_END
|
|
|
|
} // extern C++
|
|
|
|
#endif
|
|
|
|
#endif // OPENSSL_HEADER_POOL_H
|