<commit_before>#ifndef _LIBADT_SLIST_H
#define _LIBADT_SLIST_H

typedef struct _slist_root slist_root;

typedef struct _slist_node slist_node;

struct _slist_root {
	int size;			// Size of the list structure.
	void (*destroyfunc)(void *data);
	slist_node *head;	// Position from where we start walking the list.
};

struct _slist_node {
	slist_node *next;	// Pointer to next slist_node element.
	slist_root *root;	// Pointer to initial list structure.
	void *data;			// Pointer to the element added on the list.
};


/* 
 * Create a empty list structure, set a destroy function for its elements.
 * The destroy argument gives a way to free the entire structure when we
 * call slist_destroy. For malloc/calloc data, free must be used. If data
 * is a struct with other members, a function designed to free its memory
 * must be provided. If the data is static or have another way to free its
 * memory, NULL must be set.
 * Complexity: O(1).
 */
void slist_create(slist_root *list, void (destroyfunc)(void *element));

/*
 * Insert an element in the list after the current element indicated.
 * If *current is NULL, *data is not appended.
 * Complexity: O(1).
 */
int slist_insert_el(slist_root *list, slist_node *current, void *data);

/*
 * Change positions of the two elements on the list.
 */
int slist_swap_el(slist_root *list, slist_node *el1, *el2);

/*
 * Remove the element indicated by *current and save the respective 
 * data in **data.
 * Compĺexity: O(n).
 */
int slist_rem_el(slist_root *list, slist_node *current, void **data);

/*
 *  Returns the first element of the list.
 */
int slist_head(slist_root *list);

/*
 * Returns the last element of the list.
 */
int slist_tail(slist_root *list);
<commit_msg>Fix slist_swap_el function header.<commit_after>#ifndef _LIBADT_SLIST_H
#define _LIBADT_SLIST_H

typedef struct _slist_root slist_root;

typedef struct _slist_node slist_node;

struct _slist_root {
	int size;			// Size of the list structure.
	void (*destroyfunc)(void *data);
	slist_node *head;	// Position from where we start walking the list.
};

struct _slist_node {
	slist_node *next;	// Pointer to next slist_node element.
	slist_root *root;	// Pointer to initial list structure.
	void *data;			// Pointer to the element added on the list.
};


/* 
 * Create a empty list structure, set a destroy function for its elements.
 * The destroy argument gives a way to free the entire structure when we
 * call slist_destroy. For malloc/calloc data, free must be used. If data
 * is a struct with other members, a function designed to free its memory
 * must be provided. If the data is static or have another way to free its
 * memory, NULL must be set.
 * Complexity: O(1).
 */
void slist_create(slist_root *list, void (destroyfunc)(void *element));

/*
 * Insert an element in the list after the current element indicated.
 * If *current is NULL, *data is not appended.
 * Complexity: O(1).
 */
int slist_insert_el(slist_root *list, slist_node *current, void *data);

/*
 * Change positions of the two elements on the list.
 */
int slist_swap_el(slist_root *list, slist_node *el1, slist_node *el2);

/*
 * Remove the element indicated by *current and save the respective 
 * data in **data.
 * Compĺexity: O(n).
 */
int slist_rem_el(slist_root *list, slist_node *current, void **data);

/*
 *  Returns the first element of the list.
 */
int slist_head(slist_root *list);

/*
 * Returns the last element of the list.
 */
int slist_tail(slist_root *list);

{'fraction_non_alphanumeric': 0.09281609195402299, 'fraction_numerical': 0.0022988505747126436, 'mean_word_length': 3.972857142857143, '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': '4070807', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1116, 'n_words': 448}