Hi I write a library for linked lists but i get this errors and issues. I don't know what to do.If i change in the first typedef struct listNode with list and second listNode with listItem and then replace in linked_lists all listNode with listItem all works fine but i need to implement a list initialisation function and i think to make another struct that store head of list and number of items and i arrived at this point when i have this errors.


linked_lists.h code:
#ifndef linked_lists_h
#define linked_lists_h
#include <stdio.h>
struct listNode;
typedef struct listNode{
int value;
struct list *next;
}listNode;
struct listaa{
int count;
listNode *head;
};
void deleteFirst(listNode *head);
void display(listNode *head);
void addInFront (listNode *head, int value);
void addLast (listNode *head, int value);
void deleteLast(listNode *head);
void add_at_poz(listNode *head, int value, int poz);
void insert_at_poz(listNode *head, int value, int poz);
void delete_at_poz(listNode *head, int poz);
void max(listNode *head);
void min(listNode *head);
#endif /* linked_lists_h */
linked_lists.c code:
#include "linked_lists.h"
#include "stdlib.h"
// Single Linked Lists
void display(listNode *head) { // Display a linked list.
if(head->next != NULL){
listNode *current;
current = head;
while (current->next != NULL) {
current = current->next;
printf("%d, ", current->value);
}
} else {
printf("Lista este goala");
}
printf("\n");
}
//Adding value functions
// Adding in front of the list
void addInFront(listNode *head, int value) {
listNode *new_item;
new_item = (listNode *) malloc(sizeof(listNode));
new_item->next = head->next;
new_item->value = value;
head->next = new_item;
printf("Valoare %d a fost adaugata.\n", value);
}
// Adding at the end of the list
void addLast(listNode *head, int value) {
listNode *new_item,*current = head;
new_item = (listNode *) malloc(sizeof(listNode));
while(current->next != NULL)
current = current->next;
new_item->value = value;
new_item->next = NULL;
current->next = new_item;
}
// Adding a new item at specified pozition
void add_at_poz(listNode *head, int value, int poz) {
poz = poz - 1;
int iter = 0;
listNode *current = head, *new_item;
while(iter < poz) {
current = current->next;
iter++;
}
new_item = (listNode *)malloc(sizeof(listNode));
new_item = current->next;
current->next = new_item;
new_item->value = value;
}
// Insert a new item at specified pozition
void insert_at_poz(listNode *head, int value, int poz) {
poz = poz - 1;
int iter = 0;
listNode *current = head, *new_item;
while(iter < poz) {
current = current->next;
iter++;
}
new_item = (listNode *)malloc(sizeof(listNode));
new_item->next = current->next;
current->next = new_item;
new_item->value = value;
}
// Remove items from list
// Remove first item
void deleteFirst(listNode *head) {
listNode *deletedItem;
deletedItem = head->next;
printf("Elementul %d a fost sters din fata.\n", deletedItem->value);
head->next = deletedItem->next;
free(deletedItem);
}
// Delete last item
void deleteLast(listNode *head) {
listNode *deletedItem, *current;
current = head;
while(current->next->next != NULL)
current = current->next;
deletedItem = current->next;
printf("Ultimul elementul %d a fost sters\n",deletedItem->value);
current->next = NULL;
free(deletedItem);
}
void delete_at_poz(listNode *head,int poz) {
int iter = 0;
listNode *deletedItem, *current = head;
poz = poz - 1;
while(iter < poz) {
current = current->next;
iter++;
}
deletedItem = current->next;
current->next = deletedItem->next;
printf("Elementul de pe pozitia %d cu valoare %d a fost sters. \n", poz+1,deletedItem->value);
free(deletedItem);
}
void max(listNode *head) {
listNode *current;
int max = head->next->value;
current = head;
while (current->next != NULL) {
current=current->next;
if(current->value > max)
max = current->value;
}
printf("Maximul este %d.\n", max);
}
void min(listNode *head) {
listNode *current;
int min = head->next->value;
current = head;
while (current->next != NULL) {
current=current->next;
if(current->value < min)
min = current->value;
}
printf("Minimul este %d.\n", min);
}
struct listdefined? You have astruct listaabut nostruct list.