Language: C

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

typedef struct node
{
	int nKey;
	node* pNext, *pPrev;
}Node;

Node* pNul;

void Init()
{
	pNul = (Node*)malloc(sizeof(Node));
	pNul->pNext = pNul;
	pNul->pPrev = pNul;
}

void insert(int key)
{
	Node* pCur = (Node*)malloc(sizeof(Node));
	pCur->nKey = key;
	pCur->pNext = pNul->pNext;
	pCur->pNext->pPrev = pCur;
	pCur->pPrev = pNul;
	pNul->pNext = pCur;
}

Node* listSearch(int key)
{
	Node* pCur = pNul->pNext;
	while (pCur->nKey != key && pCur->pNext != pNul)
	{
		pCur = pCur->pNext;
	}
	return pCur;
}

void printList()
{
	Node* pCur = pNul->pNext;
	int nIndex = 0;
	while (pCur != pNul)
	{
		if (0 != nIndex)
		{
			printf(" ");
		}
		printf("%d", pCur->nKey);
		++nIndex;
		pCur = pCur->pNext;
	}
	printf("\n");
}

void deleteNode(Node* p)
{
	p->pNext->pPrev = p->pPrev;
	p->pPrev->pNext = p->pNext;
	p->pNext = p;
	p->pPrev = p;
	free(p);
}

void deleteFirst()
{
	deleteNode(pNul->pNext);
}

void deleteLast()
{
	deleteNode(pNul->pPrev);
}

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

int main()
{
	char cod[20];
	int nkey, n;
	scanf("%d", &n);
	Init();
	for (int i = 0; i < n; ++i)
	{
		scanf("%s", cod);
		if ('i' == cod[0])
		{
			scanf("%d", &nkey);
			insert(nkey);
		}
		else if (6 < strlen(cod))
		{
			if ('L' == cod[6])
			{
				deleteLast();
			}
			else if ('F' == cod[6])
			{
				deleteFirst();
			}
		}
		else
		{
			scanf("%d", &nkey);
			deleteKey(nkey);
		}
	}
	printList();
	return 0;
}


Compiler output:
main.c:8:9: error: unknown type name 'node'
    8 |         node* pNext, *pPrev;
      |         ^~~~
main.c: In function 'Init':
main.c:16:21: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct node *'} [-Wincompatible-pointer-types]
   16 |         pNul->pNext = pNul;
      |                     ^
main.c:17:21: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct node *'} [-Wincompatible-pointer-types]
   17 |         pNul->pPrev = pNul;
      |                     ^
main.c: In function 'insert':
main.c:25:20: error: request for member 'pPrev' in something not a structure or union
   25 |         pCur->pNext->pPrev = pCur;
      |                    ^~
main.c:26:21: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct node *'} [-Wincompatible-pointer-types]
   26 |         pCur->pPrev = pNul;
      |                     ^
main.c:27:21: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct node *'} [-Wincompatible-pointer-types]
   27 |         pNul->pNext = pCur;
      |                     ^
main.c: In function 'listSearch':
main.c:32:22: error: initialization of 'Node *' {aka 'struct node *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   32 |         Node* pCur = pNul->pNext;
      |                      ^~~~
main.c:33:49: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
   33 |         while (pCur->nKey != key && pCur->pNext != pNul)
      |                                                 ^~
main.c:35:22: error: assignment to 'Node *' {aka 'struct node *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   35 |                 pCur = pCur->pNext;
      |                      ^
main.c: In function 'printList':
main.c:42:22: error: initialization of 'Node *' {aka 'struct node *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   42 |         Node* pCur = pNul->pNext;
      |                      ^~~~
main.c:52:22: error: assignment to 'Node *' {aka 'struct node *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   52 |                 pCur = pCur->pNext;
      |                      ^
main.c: In function 'deleteNode':
main.c:59:17: error: request for member 'pPrev' in something not a structure or union
   59 |         p->pNext->pPrev = p->pPrev;
      |                 ^~
main.c:60:17: error: request for member 'pNext' in something not a structure or union
   60 |         p->pPrev->pNext = p->pNext;
      |                 ^~
main.c:61:18: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct node *'} [-Wincompatible-pointer-types]
   61 |         p->pNext = p;
      |                  ^
main.c:62:18: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct node *'} [-Wincompatible-pointer-types]
   62 |         p->pPrev = p;
      |                  ^
main.c: In function 'deleteFirst':
main.c:68:24: error: passing argument 1 of 'deleteNode' from incompatible pointer type [-Wincompatible-pointer-types]
   68 |         deleteNode(pNul->pNext);
      |                    ~~~~^~~~~~~
      |                        |
      |                        int *
main.c:57:23: note: expected 'Node *' {aka 'struct node *'} but argument is of type 'int *'
   57 | void deleteNode(Node* p)
      |                 ~~~~~~^
main.c: In function 'deleteLast':
main.c:73:24: error: passing argument 1 of 'deleteNode' from incompatible pointer type [-Wincompatible-pointer-types]
   73 |         deleteNode(pNul->pPrev);
      |                    ~~~~^~~~~~~
      |                        |
      |                        int *
main.c:57:23: note: expected 'Node *' {aka 'struct node *'} but argument is of type 'int *'
   57 | void deleteNode(Node* p)
      |                 ~~~~~~^