<commit_before>//
//  CBSha256Hash.c
//  cbitcoin
//
//  Created by <NAME> on 01/05/2012.
//  Copyright (c) 2012 <NAME>
//  
//  This file is part of cbitcoin.
//
//  cbitcoin is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//  
//  cbitcoin is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with cbitcoin.  If not, see <http://www.gnu.org/licenses/>.

#include "CBSha256Hash.h"

//  Virtual Table Store

static CBSha256HashVT * VTStore = NULL;
static int objectNum = 0;

//  Constructors

CBSha256Hash * CBNewEmptySha256Hash(CBEvents * events){
	CBSha256Hash * self = malloc(sizeof(*self));
	CBAddVTToObject(CBGetObject(self), VTStore, CBCreateSha256HashVT);
	CBInitEmptySha256Hash(self,events);
	return self;
}
CBSha256Hash * CBNewSha256HashFromByteArray(CBByteArray * bytes,CBEvents * events){
	CBSha256Hash * self = malloc(sizeof(*self));
	CBAddVTToObject(CBGetObject(self), VTStore, CBCreateSha256HashVT);
	CBInitSha256HashFromByteArrayAndHash(self,bytes,-1,events);
	return self;
}
CBSha256Hash * CBNewSha256HashFromByteArrayAndHash(CBByteArray * bytes,int hash,CBEvents * events){
	CBSha256Hash * self = malloc(sizeof(*self));
	CBAddVTToObject(CBGetObject(self), VTStore, CBCreateSha256HashVT);
	CBInitSha256HashFromByteArrayAndHash(self,bytes,hash,events);
	return self;
}

//  Virtual Table Creation

CBSha256HashVT * CBCreateSha256HashVT(){
	CBSha256HashVT * VT = malloc(sizeof(*VT));
	CBSetSha256HashVT(VT);
	return VT;
}
void CBSetSha256HashVT(CBSha256HashVT * VT){
	CBSetByteArrayVT((CBByteArrayVT *)VT);
	((CBObjectVT *)VT)->free = (void (*)(void *))CBFreeSha256Hash;<commit_msg>VT caching fix<commit_after>//
//  CBSha256Hash.c
//  cbitcoin
//
//  Created by <NAME> on 01/05/2012.
//  Copyright (c) 2012 <NAME>
//  
//  This file is part of cbitcoin.
//
//  cbitcoin is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//  
//  cbitcoin is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with cbitcoin.  If not, see <http://www.gnu.org/licenses/>.

#include "CBSha256Hash.h"

//  Virtual Table Store

static void * VTStore = NULL;
static int objectNum = 0;

//  Constructors

CBSha256Hash * CBNewEmptySha256Hash(CBEvents * events){
	CBSha256Hash * self = malloc(sizeof(*self));
	objectNum++;
	CBAddVTToObject(CBGetObject(self), &VTStore, CBCreateSha256HashVT);
	CBInitEmptySha256Hash(self,events);
	return self;
}
CBSha256Hash * CBNewSha256HashFromByteArray(CBByteArray * bytes,CBEvents * events){
	CBSha256Hash * self = malloc(sizeof(*self));
	objectNum++;
	CBAddVTToObject(CBGetObject(self), &VTStore, CBCreateSha256HashVT);
	CBInitSha256HashFromByteArrayAndHash(self,bytes,-1,events);
	return self;
}
CBSha256Hash * CBNewSha256HashFromByteArrayAndHash(CBByteArray * bytes,int hash,CBEvents * events){
	CBSha256Hash * self = malloc(sizeof(*self));
	objectNum++;
	CBAddVTToObject(CBGetObject(self), &VTStore, CBCreateSha256HashVT);
	CBInitSha256HashFromByteArrayAndHash(self,bytes,hash,events);
	return self;
}

//  Virtual Table Creation

CBSha256HashVT * CBCreateSha256HashVT(){
	CBSha256HashVT * VT = malloc(sizeof(*VT));
	CBSetSha256HashVT(VT);
	return VT;
}
void CBSetSha256HashVT(CBSha256HashVT * VT){
	CBSetByteArrayVT((CBByteArrayVT *)VT);
	((CBObjectVT *)VT)->free = (void (*)(void *))CBFreeSha256Hash;
{'fraction_non_alphanumeric': 0.11207729468599034, 'fraction_numerical': 0.042753623188405795, 'mean_word_length': 4.775453277545328, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2362671', 'n_tokens_mistral': 1535, 'n_tokens_neox': 1394, 'n_words': 380}