<commit_before>#ifdef _MSC_VER
#pragma once
#endif

#ifndef WUSNAPSHOTS_INCLUDED
#define WUSNAPSHOTS_INCLUDED

#include "wutypes.h"
#include "wuversions.h"

struct SnapshotsResourceDemand
{
	size_t clientStateSize;
};

struct SnapshotsClientInfo
{
	int clientId;
	int isUsingSnapshot;
};

struct SnapshotsSetup
{
	TICKET clientStateTicket;

	int (*revertBlock)(VersionsCreateVersionParams *);
	int (*getTimestamp)(TIMESTAMP *timestamp);

	int (*onCanAdvanceSnapshots)();
};

struct SnapshotsVersionInfo
{
	LXPTR lxptr;
	XPTR xptr;
	int isGarbage;
};

struct SnapshotsOnCheckpointInfo
{
	TIMESTAMP persistentSnapshotTs;
	size_t persistentSnapshotBlocksCount;
	size_t garbageBlocksCount;
	int *activeClientIds;
	size_t activeClientCount;
	int state; /* 0-begin 2-inprocess 1-end */ 
};

int ShInitialise();
int ShStartup(SnapshotsSetup *setup);
int ShDeinitialise();

int ShOnRegisterClient(SnapshotsClientInfo *clientInfo, TIMESTAMP *snapshotTs);
int ShOnUnregisterClient(int clientId);
int ShOnCreateVersion(VersionsCreateVersionParams *);
int ShOnRollback();
int ShOnCommit();
int ShAdvanceSnapshots();
int ShOnCheckpoint(SnapshotsOnCheckpointInfo *onCheckpointInfo,
				   void(*)(void *userData, SnapshotsVersionInfo *buf, size_t count), 
				   void *userData);

int ShNotifyCheckpointActivatedAndWaitForSnapshotAdvanced();
int ShNotifyCheckpointFinished();

#endif<commit_msg>versions6<commit_after>#ifdef _MSC_VER
#pragma once
#endif

#ifndef WUSNAPSHOTS_INCLUDED
#define WUSNAPSHOTS_INCLUDED

#include "wutypes.h"
#include "wuversions.h"

struct SnapshotsResourceDemand
{
	size_t clientStateSize;
};

struct SnapshotsClientInfo
{
	int clientId;
	int isUsingSnapshot;
};

struct SnapshotsSetup
{
	TICKET clientStateTicket;

	int (*revertBlock)(VersionsCreateVersionParams *);
	int (*getTimestamp)(TIMESTAMP *timestamp);

	int (*onCanAdvanceSnapshots)();
};

struct SnapshotsVersionInfo
{
	LXPTR lxptr;
	XPTR xptr;
	int isGarbage;
};

struct SnapshotsOnCheckpointInfo
{
	TIMESTAMP persistentSnapshotTs;
	size_t persistentSnapshotBlocksCount;
	size_t garbageBlocksCount;
	int *activeClientIds;
	size_t activeClientCount;
	int state; /* 0-begin 2-inprocess 1-end */ 
};

int ShInitialise();
int ShStartup(SnapshotsSetup *setup);
int ShDeinitialise();

int ShOnRegisterClient(SnapshotsClientInfo *clientInfo, TIMESTAMP *snapshotTs);
int ShOnUnregisterClient(int clientId);
int ShOnCreateVersion(VersionsCreateVersionParams *);
int ShOnRollback();
int ShOnCommit();
int ShAdvanceSnapshots();
int ShOnCheckpoint(SnapshotsOnCheckpointInfo *onCheckpointInfo,
				   int(*)(void *userData, SnapshotsVersionInfo *buf, size_t count), 
				   void *userData);

int ShNotifyCheckpointActivatedAndWaitForSnapshotAdvanced();
int ShNotifyCheckpointFinished();

#endif
{'fraction_non_alphanumeric': 0.0921291258614436, 'fraction_numerical': 0.0025389916575988395, 'mean_word_length': 7.434250764525994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1522173', 'n_tokens_mistral': 980, 'n_tokens_neox': 929, 'n_words': 195}