一.dlist头文件
#ifndef __DLIST_H__
#define __DLIST_H__
#include<stdio.h>
#include<stdlib.h>
typedef struct node
{
int data;
struct node *prior;
struct node *next;
}dlistnode;
extern dlistnode *dlist_creat();
extern void dlist_show(dlistnode *H);
extern dlistnode * dlist_get(dlistnode * H,int pos);
extern int dlist_insert(dlistnode *H,int value,int pos);
extern int dlist_delete(dlistnode *H,int pos);
#endif
二.dlist.c文件函数实现
#include"dlist.h"
dlistnode *dlist_creat()
{
dlistnode *H, *r,*p;
int n;
if((H = (dlistnode *)malloc(sizeof(dlistnode))) ==NULL)
{
printf("malloc failed\n");
return NULL;
}
H->prior = H;
H->next = H;
r = H;