69,373
社区成员
发帖
与我相关
我的任务
分享
Node *list;
Node *current;
Transaction *transaction;
typedef enum {NEW,DELETE,FORWARD,BACKWARD,SEARCH,EDIT}Trans_type;
//...
//...
switch(transaction->type)
{
case NEW:
add_new_trans(list,transaction);
break;
case DELETE:
current=delete_trans(list,current);
break;
case FORWARD:
current=current->next;
break;
case BACKWARD:
current=current->prev;
break;
case SEARCH:
current=search(list,transaction);
break;
case EDIT:
edit_e(list,transaction);
break;
default:
printf("Illegal transation type!");
break;
}