Language: C

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

struct Node{
  int key;
  Node *next, *prev;
};

Node *nil;

Node* listSearch(int key){
  Node *cur = nil->next;
  while(cur != nil && cur->key != key){
    cur = cur->next;
  }
  return cur;
}


void init(){
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  Node *cur = nil->next;
  int isf = 0;
  while(1){
    if(cur == nil) break;
    if(isf++ > 0) printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(Node *t){
  if(t == nil) retun;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void deleteFirst(){
  deleteNode(nil->next);
}

void deleteLast(){
  deleteNode(nil->prev);
}

void deleteKey(int key){
  deleteNode(listSearch(key));
}

void insert(int key){
  Node *x = (Node *)malloc(sizeof(Node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  
  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{
	deleteKey(key);
	nd++;
      }
      size--;
    }
  }

  printList();
}



Compiler output:
main.c:7:3: error: unknown type name 'Node'
    7 |   Node *next, *prev;
      |   ^~~~
main.c:10:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   10 | Node *nil;
      | ^~~~
      | struct 
main.c:12:1: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   12 | Node* listSearch(int key){
      | ^~~~
      | struct 
main.c: In function 'listSearch':
main.c:13:3: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   13 |   Node *cur = nil->next;
      |   ^~~~
      |   struct 
main.c:13:18: error: request for member 'next' in something not a structure or union
   13 |   Node *cur = nil->next;
      |                  ^~
main.c:14:26: error: request for member 'key' in something not a structure or union
   14 |   while(cur != nil && cur->key != key){
      |                          ^~
main.c:15:14: error: request for member 'next' in something not a structure or union
   15 |     cur = cur->next;
      |              ^~
main.c: In function 'init':
main.c:22:10: error: 'Node' undeclared (first use in this function)
   22 |   nil = (Node *)malloc(sizeof(Node));
      |          ^~~~
main.c:22:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:16: error: expected expression before ')' token
   22 |   nil = (Node *)malloc(sizeof(Node));
      |                ^
main.c:23:6: error: request for member 'next' in something not a structure or union
   23 |   nil->next = nil;
      |      ^~
main.c:24:6: error: request for member 'prev' in something not a structure or union
   24 |   nil->prev = nil;
      |      ^~
main.c: In function 'printList':
main.c:28:3: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   28 |   Node *cur = nil->next;
      |   ^~~~
      |   struct 
main.c:28:18: error: request for member 'next' in something not a structure or union
   28 |   Node *cur = nil->next;
      |                  ^~
main.c:33:21: error: request for member 'key' in something not a structure or union
   33 |     printf("%d", cur->key);
      |                     ^~
main.c:34:14: error: request for member 'next' in something not a structure or union
   34 |     cur = cur->next;
      |              ^~
main.c: At top level:
main.c:39:17: error: unknown type name 'Node'
   39 | void deleteNode(Node *t){
      |                 ^~~~
main.c: In function 'deleteFirst':
main.c:47:3: error: implicit declaration of function 'deleteNode' [-Wimplicit-function-declaration]
   47 |   deleteNode(nil->next);
      |   ^~~~~~~~~~
main.c:47:17: error: request for member 'next' in something not a structure or union
   47 |   deleteNode(nil->next);
      |                 ^~
main.c: In function 'deleteLast':
main.c:51:17: error: request for member 'prev' in something not a structure or union
   51 |   deleteNode(nil->prev);
      |                 ^~
main.c: In function 'insert':
main.c:59:3: error: unknown type name 'Node'; use 'struct' keyword to refer to the type
   59 |   Node *x = (Node *)malloc(sizeof(Node));
      |   ^~~~
      |   struct 
main.c:59:14: error: 'Node' undeclared (first use in this function)
   59 |   Node *x = (Node *)malloc(sizeof(Node));
      |              ^~~~
main.c:59:20: error: expected expression before ')' token
   59 |   Node *x = (Node *)malloc(sizeof(Node));
      |                    ^
main.c:60:4: error: request for member 'key' in something not a structure or union
   60 |   x->key = key;
      |    ^~
main.c:61:4: error: request for member 'next' in something not a structure or union
   61 |   x->next = nil->next;
      |    ^~
main.c:61:16: error: request for member 'next' in something not a structure or union
   61 |   x->next = nil->next;
      |                ^~
main.c:62:6: error: request for member 'next' in something not a structure or union
   62 |   nil->next->prev = x;
      |      ^~
main.c:63:6: error: request for member 'next' in something not a structure or union
   63 |   nil->next = x;
      |      ^~
main.c:64:4: error: request for member 'prev' in something not a structure or union
   64 |   x->prev = nil;
      |    ^~