<commit_before>#include <BaseNIntegerList.h>
#include <BaseNIntegerListOfList.h>
#include <io.h>
#include <stdio.h>

typedef struct{
	unsigned char size;
	BaseNIntegerList* lists;
}ArrayOfList;

typedef struct{
	unsigned char size;
	BaseNIntegerListOfList* buckets;
}ArrayOfBuckets;

int main(void);

/*
 * List sub menu. Access to lists related functions.
 * @param list_array An array of list
 * @return           The array of list that might have been modified
 */
ArrayOfList listsMenu(ArrayOfList list_array);

/*
 * Conversion sub menu. Access to ConvertBaseToBinary and ConvertBinaryToBase.
 */
void conversionsMenu(void);

/*
 * List of lists sub menu. Access to bucket lists related functions and RadixSort
 * @param bucket_array An array of bucket
 * @param list_array   A pointer to an array of list, not binded to the array of bucket.
 * @return             The array of bucket passed to the function, eventually modified
 */
ArrayOfBuckets listOfListsMenu(ArrayOfBuckets bucket_array, ArrayOfList* list_array);

/*
 * Extra sub menu. Access to functions not asked for this project but still developped.
 * @param list_array An array of list
 * @return           The array of list, eventually modified
 */
ArrayOfList extraMenu(ArrayOfList list_array);

/*
 * Checks if an arrayoflist is empty, and ask the user if (s)he to input one if so.
 * @param list_array ArrayOfList to check
 * @return           The arrayoflist, eventually modified
 */
ArrayOfList ifListArrayEmptyAskInput(ArrayOfList list_array);

/*
 * Checks if an arrayofbuckets is empty, and ask the user if (s)he wants to input one if so.
 * @param bucket_array Arrayofbuckets to check
 * @return             The arrayofbuckets, eventually modified
 */
ArrayOfBuckets ifBucketArrayEmptyAskInput(ArrayOfBuckets bucket_array);

/*
 * Adds a bucket to an arrayofbuckets.
 * @param bucket_array Arrayofbuckets to modify.
 * @return             The modified arrayofbuckets
 */
ArrayOfBuckets addBucket(ArrayOfBuckets bucket_array);

/*
 * Adds a list to an arrayoflist
 * @param list_array Arrayoflist to modify
 * @return           The modified arrayoflist
 */
ArrayOfList addList(ArrayOfList list_array);

/*
 * Asks the user to input a number between 0 and arraysize. if arraysize equals 0, 0 is returned without questionning the user.
 * @param arraysize Maximum value the user can select + 1
 * @param type      String to display to inform the user what he is selecting
 * @return          The choice of the user.
 */
unsigned char selector(unsigned char arraySize, const char* type);

/*
 * Waits for the user to press a key.
 */
void waitForUser(void);

int main()
{
	unsigned char user_choice = 0;
	ArrayOfList list_array;
	ArrayOfBuckets bucket_array;

	list_array.size = bucket_array.size = 0;
	list_array.lists = NULL;
	bucket_array.buckets = NULL;

	do {
		Clear();
		SetTextAttributes("+bold");
		user_choice = Menu("- Lists related functions\0- Conversion functions\0- List of lists related functions\0- Extra functions\0Exit\0", 5, "yellow", "blue", user_choice);
		SetTextAttributes("reset");

		switch (user_choice) {
		case 0:
			list_array = listsMenu(list_array);
			break;
		case 1:
			conversionsMenu();
			break;
		case 2:
			bucket_array = listOfListsMenu(bucket_array, &list_array);
			break;
		case 3:
			list_array = extraMenu(list_array);
			break;
		default:
			break;
		}
	}while (user_choice != 4);

	Clear();
	return EXIT_SUCCESS;<commit_msg>Fixing memory leaks<commit_after>#include <BaseNIntegerList.h>
#include <BaseNIntegerListOfList.h>
#include <io.h>
#include <stdio.h>

typedef struct{
	unsigned char size;
	BaseNIntegerList* lists;
}ArrayOfList;

typedef struct{
	unsigned char size;
	BaseNIntegerListOfList* buckets;
}ArrayOfBuckets;

int main(void);

/*
 * List sub menu. Access to lists related functions.
 * @param list_array An array of list
 * @return           The array of list that might have been modified
 */
ArrayOfList listsMenu(ArrayOfList list_array);

/*
 * Conversion sub menu. Access to ConvertBaseToBinary and ConvertBinaryToBase.
 */
void conversionsMenu(void);

/*
 * List of lists sub menu. Access to bucket lists related functions and RadixSort
 * @param bucket_array An array of bucket
 * @param list_array   A pointer to an array of list, not binded to the array of bucket.
 * @return             The array of bucket passed to the function, eventually modified
 */
ArrayOfBuckets listOfListsMenu(ArrayOfBuckets bucket_array, ArrayOfList* list_array);

/*
 * Extra sub menu. Access to functions not asked for this project but still developped.
 * @param list_array An array of list
 * @return           The array of list, eventually modified
 */
ArrayOfList extraMenu(ArrayOfList list_array);

/*
 * Checks if an arrayoflist is empty, and ask the user if (s)he to input one if so.
 * @param list_array ArrayOfList to check
 * @return           The arrayoflist, eventually modified
 */
ArrayOfList ifListArrayEmptyAskInput(ArrayOfList list_array);

/*
 * Checks if an arrayofbuckets is empty, and ask the user if (s)he wants to input one if so.
 * @param bucket_array Arrayofbuckets to check
 * @return             The arrayofbuckets, eventually modified
 */
ArrayOfBuckets ifBucketArrayEmptyAskInput(ArrayOfBuckets bucket_array);

/*
 * Adds a bucket to an arrayofbuckets.
 * @param bucket_array Arrayofbuckets to modify.
 * @return             The modified arrayofbuckets
 */
ArrayOfBuckets addBucket(ArrayOfBuckets bucket_array);

/*
 * Adds a list to an arrayoflist
 * @param list_array Arrayoflist to modify
 * @return           The modified arrayoflist
 */
ArrayOfList addList(ArrayOfList list_array);

/*
 * Asks the user to input a number between 0 and arraysize. if arraysize equals 0, 0 is returned without questionning the user.
 * @param arraysize Maximum value the user can select + 1
 * @param type      String to display to inform the user what he is selecting
 * @return          The choice of the user.
 */
unsigned char selector(unsigned char arraySize, const char* type);

/*
 * Waits for the user to press a key.
 */
void waitForUser(void);

int main()
{
	unsigned char user_choice = 0;
	unsigned char i;
	ArrayOfList list_array;
	ArrayOfBuckets bucket_array;

	list_array.size = bucket_array.size = 0;
	list_array.lists = NULL;
	bucket_array.buckets = NULL;

	do {
		Clear();
		SetTextAttributes("+bold");
		user_choice = Menu("- Lists related functions\0- Conversion functions\0- List of lists related functions\0- Extra functions\0Exit\0", 5, "yellow", "blue", user_choice);
		SetTextAttributes("reset");

		switch (user_choice) {
		case 0:
			list_array = listsMenu(list_array);
			break;
		case 1:
			conversionsMenu();
			break;
		case 2:
			bucket_array = listOfListsMenu(bucket_array, &list_array);
			break;
		case 3:
			list_array = extraMenu(list_array);
			break;
		default:
			break;
		}
	}while (user_choice != 4);

	for (i = list_array.size ; i > 0 ; --i) {
		DeleteIntegerList(&list_array.lists[i - 1]);
	}
	free (list_array.lists);

	for ( i = bucket_array.size ; i > 0 ; --i) {
		DeleteBucketList(&bucket_array.buckets[i - 1]);
	}
	free (bucket_array.buckets);

	Clear();
	return EXIT_SUCCESS;
{'fraction_non_alphanumeric': 0.08470555400502372, 'fraction_numerical': 0.005302818866871337, 'mean_word_length': 3.862279511533243, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '6469408', 'n_tokens_mistral': 2305, 'n_tokens_neox': 2152, 'n_words': 780}