<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hashtable.h"

#define MAX_INPUT 255
#define MAX_KEY 100
#define MAX_VALUE 154
/*
int main(int argc, char** argv)
{
	HASHTABLE ht = hashtable_init(1024);
	hashtable_put("foo", "bar", ht);
	hashtable_put("baz", "qux", ht);
	puts(hashtable_getv("foo", ht));
	puts(hashtable_getv("baz", ht));
	printf("%d", hashtable_exists("baz", ht));
	hashtable_remove("baz", ht);
	printf("%d", hashtable_exists("baz", ht));
	puts(hashtable_getv("baz", ht));
	hashtable_deinit(&ht);
	return 0;
}
*/

int process(char* input, HASHTABLE ht)
{
	char *quit;
	quit = strstr(input, "quit");
	if(quit == input) {
		exit(0);
	}
	char *put;
	put = strstr(input, "put");
	if(put == input) {
		char *key;
		char *value;
		key = (char*)malloc(sizeof(char) * MAX_KEY);
		value = (char*)malloc(sizeof(char) * MAX_VALUE);
		if(sscanf(input, "put %s %[^\n]", key, value) < 2) {
			return 0;
		}
		hashtable_put(key, value, ht);
		free(key);
		free(value);
		puts("Put.");
	}
	char *get;
	get = strstr(input, "get");
	if(get == input) {
		char *key;
		key = (char*)malloc(sizeof(char) * MAX_KEY);
		if(sscanf(input, "get %s", key) < 1) {
			return 0;
		}
		printf("Got: %s\n", hashtable_getv(key, ht));
		free(key);
	}
	char *remove;
	remove = strstr(input, "remove");
	if(remove == input) {
		printf("remove command");
	}
}

int main(int argc, char** argv)
{
	HASHTABLE ht = hashtable_init(1024);
	puts("Simple Hashtable Test");<commit_msg>test feature 'remove'<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "hashtable.h"

#define MAX_INPUT 255
#define MAX_KEY 100
#define MAX_VALUE 154

int process(char* input, HASHTABLE ht)
{
	char *quit;
	quit = strstr(input, "quit");
	if(quit == input) {
		exit(0);
	}
	char *put;
	put = strstr(input, "put");
	if(put == input) {
		char *key;
		char *value;
		key = (char*)malloc(sizeof(char) * MAX_KEY);
		value = (char*)malloc(sizeof(char) * MAX_VALUE);
		if(sscanf(input, "put %s %[^\n]", key, value) < 2) {
			return 0;
		}
		hashtable_put(key, value, ht);
		free(key);
		free(value);
		puts("Put.");
	}
	char *get;
	get = strstr(input, "get");
	if(get == input) {
		char *key;
		key = (char*)malloc(sizeof(char) * MAX_KEY);
		if(sscanf(input, "get %s", key) < 1) {
			return 0;
		}
		printf("Got: %s\n", hashtable_getv(key, ht));
		free(key);
	}
	char *remove;
	remove = strstr(input, "remove");
	if(remove == input) {
		char *key;
		key = (char*)malloc(sizeof(char) * MAX_KEY);
		if(sscanf(input, "remove %s", key) < 1) {
			return 0;
		}
		hashtable_remove(key, ht);
		printf("Removed: %s\n", key);
		free(key);
	}
}

int main(int argc, char** argv)
{
	HASHTABLE ht = hashtable_init(1024);
	puts("Simple Hashtable Test");
{'fraction_non_alphanumeric': 0.2005813953488372, 'fraction_numerical': 0.015625, 'mean_word_length': 4.473161033797217, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 9, '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': '5113279', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1168, 'n_words': 260}