Language: C

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

struct node {
  unsigned int key;
  struct node *next;
  struct node *prev;
};

typedef struct node *NodePointer

Nodepointer nil;

void init()
{
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void insert(int key)
{
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  x->prev = nil;
}

void deleteFirst()
{
  NodePointer t = nil -> next;
  if(t == nil)
    {
      return;
    }
  
  deleteNode(t);
}

void deleteLast()
{
  NodePointer t = nil -> prev;
  if(t == nil)
    {
      return;
    }

  deleteNode(t);
}

void deleteNode(NodePointer t)
{
  t->prev->next = t->next;
  t->next->prev = t->prev; 
}



void delete(int key)
{
  NodePointer x;
  x = listSearch(key);  
  if(x != NULL)
    {
      if(x == nil)
	{
	  return;
	}

      deleteNode(x);
    }
}


main()
{
  int n, i, key, np, nd;
  char com[20];
  NodePointer a;

  scanf("%d", &n);
  init();

  for(i=0; i<n; i++)
    {
      scanf("%s %d", com, &key);

      if(com[0] == 'i')
	{
	  insert(key);
	  np++;
	  size++;
	}
      else if(com[0] == 'd')
	{
	  if(strlen(com) > 6)
	    {
	      if(com[6] == 'F')
		{
		  deleteFirst();
		}
	      else if(com[6] == 'L')
		{
		  deleteLast();
		}
	      else
		{
		  delete(key);
		  nd++;
		}
	      size--;
	    }
	}
    }



  return 0;
}

Compiler output:
main.c:13:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Nodepointer'
   13 | Nodepointer nil;
      | ^~~~~~~~~~~
main.c:13:1: error: unknown type name 'Nodepointer'
main.c: In function 'init':
main.c:17:3: error: 'nil' undeclared (first use in this function)
   17 |   nil = malloc(sizeof(struct node));
      |   ^~~
main.c:17:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'insert':
main.c:24:3: error: unknown type name 'NodePointer'
   24 |   NodePointer x;
      |   ^~~~~~~~~~~
main.c:25:5: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
   25 |   x = malloc(sizeof(struct node));
      |     ^
main.c:26:4: error: invalid type argument of '->' (have 'int')
   26 |   x->key = key;
      |    ^~
main.c:27:4: error: invalid type argument of '->' (have 'int')
   27 |   x->next = nil->next;
      |    ^~
main.c:27:13: error: 'nil' undeclared (first use in this function)
   27 |   x->next = nil->next;
      |             ^~~
main.c:29:4: error: invalid type argument of '->' (have 'int')
   29 |   x->prev = nil;
      |    ^~
main.c: In function 'deleteFirst':
main.c:34:3: error: unknown type name 'NodePointer'
   34 |   NodePointer t = nil -> next;
      |   ^~~~~~~~~~~
main.c:34:19: error: 'nil' undeclared (first use in this function)
   34 |   NodePointer t = nil -> next;
      |                   ^~~
main.c:40:3: error: implicit declaration of function 'deleteNode' [-Wimplicit-function-declaration]
   40 |   deleteNode(t);
      |   ^~~~~~~~~~
main.c: In function 'deleteLast':
main.c:45:3: error: unknown type name 'NodePointer'
   45 |   NodePointer t = nil -> prev;
      |   ^~~~~~~~~~~
main.c:45:19: error: 'nil' undeclared (first use in this function)
   45 |   NodePointer t = nil -> prev;
      |                   ^~~
main.c: At top level:
main.c:54:17: error: unknown type name 'NodePointer'
   54 | void deleteNode(NodePointer t)
      |                 ^~~~~~~~~~~
main.c: In function 'delete':
main.c:64:3: error: unknown type name 'NodePointer'
   64 |   NodePointer x;
      |   ^~~~~~~~~~~
main.c:65:7: error: implicit declaration of function 'listSearch'; did you mean 'bsearch'? [-Wimplicit-function-declaration]
   65 |   x = listSearch(key);
      |       ^~~~~~~~~~
      |       bsearch
main.c:66:8: warning: comparison between pointer and integer
   66 |   if(x != NULL)
      |        ^~
main.c:68:15: error: 'nil' undeclared (first use in this function)
   68 |       if(x == nil)
      |               ^~~
main.c: At top level:
main.c:78:1: error: return type defaults to 'int' [-Wimplicit-int]
   78 | main()
      | ^~~~
main.c: In function 'main':
main.c:82:3: error: unknown type name 'NodePointer'
   82 |   NodePointer a;
      |   ^~~~~~~~~~~
main.c:95:11: error: 'size' undeclared (first use in this function); did you mean 'size_t'?
   95 |           size++;
      |           ^~~~
      |           size_t