void result(t_difference* diff, t_env* env ) { result_line(diff, env); result_line_file1(diff); printf("---\n"); result_line_file2(diff); Delete_list(diff); }
void Select_form() {//选项界面 int flag; char c,cmd,buf[MAXSIZE]; Cur_state = 0; while(1){ flag = 1; printf("\n×××××××××××××××选项界面×××××××××××××××\n"); printf("\t1. 好友界面\n"); printf("\t2. 群列表\n"); printf("\t3. 未读信息 (%d 条)\n",unread_cnt); printf("\t4. 注销\n"); printf("×××××××××××××××××××××××××××××××××××××\n\n"); while( flag ){ printf("请输入操作代号:"); scanf("%c",&cmd); if( cmd < '1' || cmd > '4' ){ printf("[wrong] >> 您的输入有异常,请重新输入!\n"); while( ( c = getchar() ) != '\n' && c != EOF ); } else break; } printf("×××××××××××××××××××××××××××××××××××××\n\n"); while( ( c = getchar() ) != '\n' && c != EOF ); switch( cmd ){ case '1':{ Usr_form(); break; } case '2':{ Group_form(); break; } case '3':{ UnreadMsg_form(); break; } case '4':{ FLAG[9] = -1; Comb_msg( buf, "9" , "$" , "0" ); send( sockfd , buf , MAXSIZE , 0 ); printf("[ 系统提示 ]注销成功!感谢您的登录,有缘再见(*^_^*)/bye~!\n"); chdir("./.."); chdir("./.."); Delete_list( Head ); return; break; } } } }
void Clear_unread( msgNode * h ) {//清空未读信息列表 Delete_list( h ); Write_unread( h ); }