<commit_before>/**
 * @copyright
 * ====================================================================
 *    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.
 * ====================================================================
 * @endcopyright
 *
 * @file svn_cache.h
 * @brief In-memory cache implementation.
 */


#ifndef SVN_CACHE_H
#define SVN_CACHE_H

#include <apr_pools.h>
#include <apr_hash.h>

#include "svn_types.h"
#include "svn_error.h"
#include "svn_iter.h"
#include "svn_config.h"


#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */




/**
 * @defgroup svn_cache__support In-memory caching
 * @{
 */

/**
 * A function type for copying an object @a in into a different pool @a pool
 *  and returning the result in @a *out.
 *
 * @since New in 1.6.
*/
typedef svn_error_t *(*svn_cache__dup_func_t)(void **out,
                                              const void *in,
                                              apr_pool_t *pool);

/**
 * A function type for deserializing an object @a *out from the string
 * @a data of length @a data_len in the pool @a pool.
*/
typedef svn_error_t *(*svn_cache__deserialize_func_t)(void **out,
                                                      const char *data,
                                                      apr_size_t data_len,
                                                      apr_pool_t *pool);

/**
 * A function type for deserializing an object @a *out from the string
 * @a data of length @a data_len in the pool @a pool. The extra information
 * @a baton passed into can be used to deserialize only a specific part or
 * sub-structure or to perform any other non-modifying operation that may
 * not require the whole structure to be processed.
 */
typedef svn_error_t *(*svn_cache__partial_getter_func_t)(void **out,
                                                         const char *data,
                                                         apr_size_t data_len,
                                                         void *baton,
                                                         apr_pool_t *pool);

/**
 * A function type for serializing an object @a in into bytes.  The
 * function should allocate the serialized value in @a pool, set @a
 * *data to the serialized value, and set *data_len to its length.
*/
typedef svn_error_t *(*svn_cache__serialize_func_t)(char **data,
                                                    apr_size_t *data_len,
                                                    void *in,<commit_msg>Header cleanup.<commit_after>/**
 * @copyright
 * ====================================================================
 *    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.
 * ====================================================================
 * @endcopyright
 *
 * @file svn_cache.h
 * @brief In-memory cache implementation.
 */


#ifndef SVN_CACHE_H
#define SVN_CACHE_H

#include <apr_pools.h>
#include <apr_hash.h>

#include "svn_types.h"
#include "svn_error.h"
#include "svn_iter.h"
#include "svn_config.h"


#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */




/**
 * @defgroup svn_cache__support In-memory caching
 * @{
 */

/**
 * A function type for deserializing an object @a *out from the string
 * @a data of length @a data_len in the pool @a pool.
*/
typedef svn_error_t *(*svn_cache__deserialize_func_t)(void **out,
                                                      const char *data,
                                                      apr_size_t data_len,
                                                      apr_pool_t *pool);

/**
 * A function type for deserializing an object @a *out from the string
 * @a data of length @a data_len in the pool @a pool. The extra information
 * @a baton passed into can be used to deserialize only a specific part or
 * sub-structure or to perform any other non-modifying operation that may
 * not require the whole structure to be processed.
 */
typedef svn_error_t *(*svn_cache__partial_getter_func_t)(void **out,
                                                         const char *data,
                                                         apr_size_t data_len,
                                                         void *baton,
                                                         apr_pool_t *pool);

/**
 * A function type for serializing an object @a in into bytes.  The
 * function should allocate the serialized value in @a pool, set
 * @a *data to the serialized value, and set @a *data_len to its length.
 */
typedef svn_error_t *(*svn_cache__serialize_func_t)(char **data,
                                                    apr_size_t *data_len,
                                                    void *in,
{'fraction_non_alphanumeric': 0.11290834126228988, 'fraction_numerical': 0.001585791309863622, 'mean_word_length': 1.9905168326220959, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5093341', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1557, 'n_words': 624}