<commit_before>/*************************************************************************
	> File Name: list.c
	> Author: skxie
    > Descriptions: implement the functions for list usage.
	> 
 ************************************************************************/

#inlcude "include/nodetype/list.h"

int getListLength(List *list)
{
    if (list == NULL)
        return -1;
    if (list->length != -1)
        return list->length;
    ListCell * node = list->head;
    int len = 0;
    while (node != NULL)
    {
        node = node->next;
        len++;
    }
    list->length = len;
    return list->length;
}

void getHeadOfList(List *list, ListCell *head)
{
    head = NULL;<commit_msg>modified the description of list.c<commit_after>/*************************************************************************
    > File Name: list.c
    > Author: skxie
    > Descriptions: implement the functions for list usage.
    > 
 ************************************************************************/

#inlcude "include/nodetype/list.h"

int getListLength(List *list)
{
    if (list == NULL)
        return -1;
    if (list->length != -1)
        return list->length;
    ListCell * node = list->head;
    int len = 0;
    while (node != NULL)
    {
        node = node->next;
        len++;
    }
    list->length = len;
    return list->length;
}

void getHeadOfList(List *list, ListCell *head)
{
    head = NULL;
{'fraction_non_alphanumeric': 0.3128531073446328, 'fraction_numerical': 0.00423728813559322, 'mean_word_length': 3.037037037037037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '6500794', 'n_tokens_mistral': 417, 'n_tokens_neox': 393, 'n_words': 105}