Language: C

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

#define INS ("insert")
#define DEL ("delete")
#define DEL_FST ("deleteFirst")
#define DEL_LST ("deleteLast")

#define CMD_TOP	 (0)
#define CMD_END	 (1)
#define CMD_DATA (-1)
typedef struct aaa{
	int		   data;
	struct aaa *next_p;
	struct aaa *back_p;
} TBL_T;

TBL_T	*top_p;


/**------------ SUB ROUTIONE -------------*/
int func_ins(int cmd,int reg_dt)
{
	TBL_T *wk_p;

	if (cmd != CMD_TOP) {
		printf("fun_ins ERROR\n");
		return -1;
	}

	if ((wk_p=(TBL_T*)malloc(sizeof(TBL_T)))==NULL) {
		printf("fun_ins ERROR 2\n");
		return -2;
	}

	wk_p->data = reg_dt;

	if (top_p == NULL) {
		wk_p->next_p = NULL;
		wk_p->back_p = NULL;
	}
	else {
		top_p->back_p = wk_p;
		wk_p->next_p=top_p;
		wk_p->back_p = NULL;
	}

	top_p = wk_p;
	return (int)wk_p;
}

int func_del(int cmd,int del_dt)
{
	TBL_T	*wk_p,*wk2_p;

	if (top_p == NULL) {
		return 0;
	}
	switch(cmd) {
	case CMD_TOP:
		wk_p = top_p;
		wk2_p = wk_p->next_p;
		wk2_p->back_p = NULL;
//		top_p->back_p = NULL;
		top_p = wk2_p;
		break;
	case CMD_END:
		wk_p = top_p;
		while (1) {
			if (wk_p->next_p == NULL) {
				wk2_p = wk_p->back_p;
				wk2_p->next_p = NULL;
				break;
			}
			else {
				wk_p = wk_p->next_p;
			}
		}
		break;
	case CMD_DATA:
		wk_p = top_p;
		while (1) {
			if (wk_p->data == del_dt) {
				wk2_p = wk_p->back_p;
				if (wk2_p != NULL) {
					wk2_p->next_p = wk_p->next_p;
				}
				wk2_p = wk_p->next_p;
				if (wk2_p != NULL) {
					wk2_p->back_p = wk_p->back_p;
				}
				break;
			}

			if (wk_p->next_p == NULL) {
				return 0;
			}
			else {
				wk_p = wk_p->next_p;
			}
		}
		break;
	default:
		printf("fun_del ERROR \n");
		return -1;
	}
	free(wk_p);
	return (int)wk_p;
}

void func_dsp(void)
{
	TBL_T	*wk_p;
????????????int     wk;

	if (top_p == NULL) {
		return;
	}

	wk_p = top_p;
	while (1) {
                wk = wk_p->data;
		if (wk_p->next_p == NULL) {
		        printf("%d",wk);

			break;
		}
		else {
		        printf("%d ",wk);
			wk_p = wk_p->next_p;
		}
	}
}

void func_free(void)
{
	TBL_T	*wk_p;


	while (1) {
		if (top_p == NULL) {
			return;
		}
		wk_p = top_p;
		top_p = wk_p->next_p;
		free(wk_p);
	}
}
/**------------ SUB ROUTIONE -------------*/

int main()
{
	int     n,i;

	char	name[32];
	int		data;
	TBL_T	*wk_p;
	char 	buff[96];


	/** INIT **/
	top_p = NULL;

	/** INPUT **/
	gets(&(buff[0]));
	sscanf(&(buff[0]),"%d",&n);

	for (i=0 ; i<n ; i++) {
		gets(&(buff[0]));
		sscanf(&(buff[0]),"%s %d",name,&data);
		if (strcmp(name,INS)==0) {
			func_ins(CMD_TOP,data);
		}
		else {
			if (strcmp(name,DEL)==0) {
				func_del(CMD_DATA,data);
			}
			else {
				if (strcmp(name,DEL_FST)==0) {
					func_del(CMD_TOP,NULL);
				}
				else{
					if (strcmp(name,DEL_LST)==0) {
						func_del(CMD_END,NULL);
					}
					else {
						printf("ERROR\n");
					}
				}
			}
		}
	}

	func_dsp();
	func_free();
	return 0;
}

Compiler output:
main.c: In function 'func_ins':
main.c:52:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   52 |         return (int)wk_p;
      |                ^
main.c: In function 'func_del':
main.c:111:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  111 |         return (int)wk_p;
      |                ^
main.c: In function 'func_dsp':
main.c:117:1: error: expected expression before '?' token
  117 | ????????????int     wk;
      | ^
main.c:125:17: error: 'wk' undeclared (first use in this function); did you mean 'wk_p'?
  125 |                 wk = wk_p->data;
      |                 ^~
      |                 wk_p
main.c:125:17: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:168:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
  168 |         gets(&(buff[0]));
      |         ^~~~
      |         fgets
main.c:183:58: error: passing argument 2 of 'func_del' makes integer from pointer without a cast [-Wint-conversion]
  183 |                                         func_del(CMD_TOP,NULL);
      |                                                          ^~~~
      |                                                          |
      |                                                          void *
main.c:55:26: note: expected 'int' but argument is of type 'void *'
   55 | int func_del(int cmd,int del_dt)
      |                      ~~~~^~~~~~
main.c:187:66: error: passing argument 2 of 'func_del' makes integer from pointer without a cast [-Wint-conversion]
  187 |                                                 func_del(CMD_END,NULL);
      |                                                                  ^~~~
      |                                                                  |
      |                                                                  void *
main.c:55:26: note: expected 'int' but argument is of type 'void *'
   55 | int func_del(int cmd,int del_dt)
      |                      ~~~~^~~~~~