<commit_before>/* Copyright (c) 2007-2010 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "master-service.h"
#include "mail-index-modseq.h"
#include "mailbox-list-private.h"
#include "dbox-mail.h"
#include "dbox-save.h"
#include "sdbox-file.h"
#include "sdbox-sync.h"
#include "sdbox-storage.h"

extern struct mail_storage dbox_storage, sdbox_storage;
extern struct mailbox sdbox_mailbox;
extern struct dbox_storage_vfuncs sdbox_dbox_storage_vfuncs;

static struct mail_storage *sdbox_storage_alloc(void)
{
	struct sdbox_storage *storage;
	pool_t pool;

	pool = pool_alloconly_create("sdbox storage", 512+256);
	storage = p_new(pool, struct sdbox_storage, 1);
	storage->storage.v = sdbox_dbox_storage_vfuncs;
	storage->storage.storage = dbox_storage;
	storage->storage.storage.pool = pool;
	return &storage->storage.storage;
}

static int
sdbox_storage_create(struct mail_storage *storage ATTR_UNUSED,
		     struct mail_namespace *ns ATTR_UNUSED,
		     const char **error_r ATTR_UNUSED)
{
#ifndef HAVE_FLOCK
	if (master_service_get_client_limit(master_service) > 1) {
		*error_r = "sdbox requires client_limit=1 for service "
			"since your OS doesn't support flock()";
		return -1;
	}
#endif
	return 0;
}

static struct mailbox *
sdbox_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
		    const char *name, enum mailbox_flags flags)
{<commit_msg>sdbox: Removed flock() check. It's not used by sdbox.<commit_after>/* Copyright (c) 2007-2010 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "master-service.h"
#include "mail-index-modseq.h"
#include "mailbox-list-private.h"
#include "dbox-mail.h"
#include "dbox-save.h"
#include "sdbox-file.h"
#include "sdbox-sync.h"
#include "sdbox-storage.h"

extern struct mail_storage dbox_storage, sdbox_storage;
extern struct mailbox sdbox_mailbox;
extern struct dbox_storage_vfuncs sdbox_dbox_storage_vfuncs;

static struct mail_storage *sdbox_storage_alloc(void)
{
	struct sdbox_storage *storage;
	pool_t pool;

	pool = pool_alloconly_create("sdbox storage", 512+256);
	storage = p_new(pool, struct sdbox_storage, 1);
	storage->storage.v = sdbox_dbox_storage_vfuncs;
	storage->storage.storage = dbox_storage;
	storage->storage.storage.pool = pool;
	return &storage->storage.storage;
}

static int
sdbox_storage_create(struct mail_storage *storage ATTR_UNUSED,
		     struct mail_namespace *ns ATTR_UNUSED,
		     const char **error_r ATTR_UNUSED)
{
	return 0;
}

static struct mailbox *
sdbox_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
		    const char *name, enum mailbox_flags flags)
{
{'fraction_non_alphanumeric': 0.1053030303030303, 'fraction_numerical': 0.013257575757575758, 'mean_word_length': 5.635678391959799, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5994266', 'n_tokens_mistral': 1004, 'n_tokens_neox': 921, 'n_words': 226}