Language: C

unsigned int key;
  struct node *next;
  struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
NodePointer listSearch(int key){
  NodePointer x = nil->next;
  while(x->key != key){
    if(x == nil) break;
    x = x->next; }
  return x; }
void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}
void printList(){
  NodePointer cr = nil->next;
  int isl = 1;
  while(1){
    if (cr == nil) {
      break;
    }
    if (isl == 0) {
      printf(" ");
    }
    printf("%d", cr->key);
    cr = cr->next;
    isl = 0;
  }
  printf("\n");
}
void deleteNode(NodePointer t){
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}
void deleteFirst(){
  NodePointer t = nil->next;
  if (t == nil) return;
  deleteNode(t);
}
void deleteLast(){
  NodePointer x = nil->prev;
  if(x == nil) return;
  deleteNode(x);
}
void delete(int key){
  NodePointer x;
  x = listSearch(key);
  if(x == nil) return;
  deleteNode(x);
}
void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
  x->next = nil->next;
  x->prev = nil;
  nil->next = x;
  x->next->prev = x;
}
int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int nop = 0, nod = 0;
  scanf("%d", &n);
  init();
  for(i = 0; i < n; i++){
    scanf("%s%d", com, &key);
    if (com[0] == 'i') {
      insert(key);
      nop++;
      size++;
    } else if (com[0] == 'd') {
      if (strlen(com) > 6) {
        if (com[6] == 'F') deleteFirst();
        else if (com[6] == 'L') deleteLast();
      } else {
	delete(key); nod++;
      }
      size--; }
  }
  printList();
  return 0; }



Compiler output:
main.c:4:1: error: expected identifier or '(' before '}' token
    4 | };
      | ^
main.c: In function 'listSearch':
main.c:8:22: error: invalid use of undefined type 'struct node'
    8 |   NodePointer x = nil->next;
      |                      ^~
main.c:9:10: error: invalid use of undefined type 'struct node'
    9 |   while(x->key != key){
      |          ^~
main.c:11:10: error: invalid use of undefined type 'struct node'
   11 |     x = x->next; }
      |          ^~
main.c: In function 'init':
main.c:14:9: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   14 |   nil = malloc(sizeof(struct node));
      |         ^~~~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
  +++ |+#include <stdlib.h>
    1 | unsigned int key;
main.c:14:9: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   14 |   nil = malloc(sizeof(struct node));
      |         ^~~~~~
main.c:14:9: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:14:23: error: invalid application of 'sizeof' to incomplete type 'struct node'
   14 |   nil = malloc(sizeof(struct node));
      |                       ^~~~~~
main.c:15:6: error: invalid use of undefined type 'struct node'
   15 |   nil->next = nil;
      |      ^~
main.c:16:6: error: invalid use of undefined type 'struct node'
   16 |   nil->prev = nil;
      |      ^~
main.c: In function 'printList':
main.c:19:23: error: invalid use of undefined type 'struct node'
   19 |   NodePointer cr = nil->next;
      |                       ^~
main.c:26:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   26 |       printf(" ");
      |       ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | unsigned int key;
main.c:26:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   26 |       printf(" ");
      |       ^~~~~~
main.c:26:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   28 |     printf("%d", cr->key);
      |     ^~~~~~
main.c:28:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:28:20: error: invalid use of undefined type 'struct node'
   28 |     printf("%d", cr->key);
      |                    ^~
main.c:29:12: error: invalid use of undefined type 'struct node'
   29 |     cr = cr->next;
      |            ^~
main.c:32:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   32 |   printf("\n");
      |   ^~~~~~
main.c:32:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'deleteNode':
main.c:35:4: error: invalid use of undefined type 'struct node'
   35 |   t->prev->next = t->next;
      |    ^~
main.c:35:20: error: invalid use of undefined type 'struct node'
   35 |   t->prev->next = t->next;
      |                    ^~
main.c:36:4: error: invalid use of undefined type 'struct node'
   36 |   t->next->prev = t->prev;
      |    ^~
main.c:36:20: error: invalid use of undefined type 'struct node'
   36 |   t->next->prev = t->prev;
      |                    ^~
main.c:37:3: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   37 |   free(t);
      |   ^~~~
main.c:37:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:37:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:37:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c: In function 'deleteFirst':
main.c:40:22: error: invalid use of undefined type 'struct node'
   40 |   NodePointer t = nil->next;
      |                      ^~
main.c: In function 'deleteLast':
main.c:45:22: error: invalid use of undefined type 'struct node'
   45 |   NodePointer x = nil->prev;
      |                      ^~
main.c: In function 'insert':
main.c:57:7: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
   57 |   x = malloc(sizeof(struct node));
      |       ^~~~~~
main.c:57:7: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:57:21: error: invalid application of 'sizeof' to incomplete type 'struct node'
   57 |   x = malloc(sizeof(struct node));
      |                     ^~~~~~
main.c:58:4: error: invalid use of undefined type 'struct node'
   58 |   x->key = key;
      |    ^~
main.c:59:4: error: invalid use of undefined type 'struct node'
   59 |   x->next = nil->next;
      |    ^~
main.c:59:16: error: invalid use of undefined type 'struct node'
   59 |   x->next = nil->next;
      |                ^~
main.c:60:4: error: invalid use of undefined type 'struct node'
   60 |   x->prev = nil;
      |    ^~
main.c:61:6: error: invalid use of undefined type 'struct node'
   61 |   nil->next = x;
      |      ^~
main.c:62:4: error: invalid use of undefined type 'struct node'
   62 |   x->next->prev = x;
      |    ^~
main.c: In function 'main':
main.c:69:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   69 |   scanf("%d", &n);
      |   ^~~~~
main.c:69:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:69:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:69:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:78:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   78 |       if (strlen(com) > 6) {
      |           ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | unsigned int key;
main.c:78:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   78 |       if (strlen(com) > 6) {
      |           ^~~~~~
main.c:78:11: note: include '<string.h>' or provide a declaration of 'strlen'