实例代码如下:
#include
#include
#include
#include
#include
typedef struct node_ node_t;
struct node_{
char* name;//gequming
node_t * prev;
node_t * next;
};
node_t *head = NULL;
int first=1;//diyicibofnag
node_t * cur =NULL;//dangqianbofang
enum{STOP,PAUSE,PLAY};
int status = STOP;
void List_init(void){
head = malloc(sizeof(node_t));
memset(head,0x00,sizeof(node_t));
head->next = head->prev=head;
}
void list_insert(const char* name){
node_t *p = malloc(sizeof(node_t));
memset(p,0x00,sizeof(node_t));
p->name = malloc(strlen(name)+1);
strcpy(p->name,name);
p->next = head->next;
p->prev = head;
head->n