<commit_before>#include <stdio.h>
#include <stdlib.h>

#include <dl_deque.h><commit_msg>Add dl_deque.c implementation.<commit_after>#include <stdio.h>
#include <stdlib.h>

#include <dl_deque.h>

void dl_deque_create(dl_deque_root *deque, t_destroyfunc destroyfunc) {
	dlist_create(deque, destroyfunc);
}

int dl_deque_put(dl_deque_root *deque, void *data) {
	return dlist_insert_el_prev(deque, deque->head, data);
}

int dl_deque_push(dl_deque_root *deque, void *data) {
	return dlist_insert_el_next(deque, deque->tail, data);
}

void * dl_deque_first(dl_deque_root *deque) {
	if (dlist_size(deque) > 0) {
		return deque->head->data;
	} else {
		fprintf(stderr, "Deque is empty!");
		return NULL;
	}
}

void * dl_deque_last(dl_deque_root *deque) {
	if (dlist_size(deque) > 0) {
		return deque->tail->data;
	} else {
		fprintf(stderr, "Deque is empty!");
		return NULL;
	}
}

void * dl_deque_get(dl_deque_root *deque) {
if (dlist_size(deque) > 0) {
		return dlist_rem_el(deque, deque->head);
	} else {
		fprintf(stderr, "Deque is empty!");
		return NULL;
	}
}

void * dl_deque_pop(dl_deque_root *deque) {
	if (dlist_size(deque) > 0) {
		return dlist_rem_el(deque, deque->tail);
	} else {
		fprintf(stderr, "Deque is empty!");
		return NULL;
	}
}

void dl_deque_destroy(dl_deque_root *deque) {
	
}
{'fraction_non_alphanumeric': 0.14594594594594595, 'fraction_numerical': 0.003088803088803089, 'mean_word_length': 5.2009569377990434, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '6679540', 'n_tokens_mistral': 582, 'n_tokens_neox': 560, 'n_words': 103}