????rc=sqlite3_exec(db??sql??NULL??NULL??errmsg);
????if(rc==SQLITE_OK)
????{
????return 1;
????}
????else
????{
????return 0;
????}
????}
????int update_user(sqlite3*db??char**errmsg??char*name??char*toname)//???????
????{
????int rc;
????char sql[1024];
????sprintf(sql??"update user set name='%s'where name='%s'"??toname??name);
????rc=sqlite3_exec(db??sql??NULL??NULL??errmsg);
????if(rc==SQLITE_OK)
????{
????return 1;
????}
????else
????{
????return 0;
????}
????}
????int update_db_data(sqlite3*db??char**errmsg??char*name??char*toname)//???????
????{
????int rc1;
????int rc2;
????char sql[1024];
????sprintf(sql??"update data set name='%s'where name='%s'"??toname??name);
????rc1=sqlite3_exec(db??sql??NULL??NULL??errmsg);
????memset(sql??0??1024);
????sprintf(sql??"update data set toname='%s'where toname='%s'"??toname??name);
????rc2=sqlite3_exec(db??sql??NULL??NULL??errmsg);
????if(rc1==SQLITE_OK&&rc2==SQLITE_OK)
????{
????return 1;
????}
????else
????{
????return 0;
????}
????}
????int update_flag(sqlite3*db??char**errmsg??char*name??int flag)//??????????
????{
????int rc;
????char sql[1024];
????sprintf(sql??"update online set flag=%d where name='%s'"??flag??name);
????rc=sqlite3_exec(db??sql??NULL??NULL??errmsg);
????if(rc==SQLITE_OK)
????{
????return 1;
????}
????else
????{
????return 0;
????}
????}
????int delete_user(sqlite3*db??char**errmsg??char*name)//??????
????{
????int rc;
????char sql[1024];
????sprintf(sql??"delete from user where name='%s'"??name);
????rc=sqlite3_exec(db??sql??NULL??NULL??errmsg);
????if(rc==SQLITE_OK)
????{
????return 1;
????}
????else
????{
????return 0;
????}
????}
????void read_online_all(sqlite3*db??char**errmsg??vpChat temp)//????????????????
????{
????int rc;
????sqlite3_stmt*stmt=NULL;
????rc=sqlite3_prepare(db??"select*from online"??-1??&stmt??0);
????is_sqlite_ok(rc);
????rc=sqlite3_step(stmt);
????int userflag=1;
????while(rc==SQLITE_ROW)
????{
????my_strcpy(temp->msg??sqlite3_column_text(stmt??1));
????mywrite(temp);
????sleep(1); 
????rc=sqlite3_step(stmt);
????}
????}
????void read_data(sqlite3*db??char**errmsg??vpChat temp)//????????????????
????{
????int rc;
????char name[80];
????char toname[80];
????sqlite3_stmt*stmt=NULL;
????rc=sqlite3_prepare(db??"select*from data"??-1??&stmt??0);
????is_sqlite_ok(rc);
????rc=sqlite3_step(stmt);
????int userflag=1;
????while(rc==SQLITE_ROW)
????{
????my_strcpy(name??sqlite3_column_text(stmt??2));
????my_strcpy(toname??sqlite3_column_text(stmt??3));
????if( my_strcmp(temp->name??name)==0)
????{
????strcat(temp->msg??"??");
????strcat(temp->msg??"??");
????strcat(temp->msg??toname);
????strcat(temp->msg??"????");
????strcat(temp->msg??sqlite3_column_text(stmt??4));
????strcat(temp->msg??" ");
????my_strcpy(temp->time??sqlite3_column_text(stmt??1));
????mywrite(temp);
????memset(temp->msg??0??sizeof(temp->msg));
????sleep(1);  
????}
????if(my_strcmp(temp->name??toname)==0)
????{
????strcat(temp->msg??toname);
????strcat(temp->msg??"??????");
????strcat(temp->msg??sqlite3_column_text(stmt??4));
????strcat(temp->msg??" ");
????my_strcpy(temp->time??sqlite3_column_text(stmt??1));
????mywrite(temp);
????memset(temp->msg??0??sizeof(temp->msg));
????sleep(1);  
????}
????rc=sqlite3_step(stmt);
????}
????}
????????????????????????
?????????????????????????????
????void is_sqlite(int rc);//?????????
????void is_malloc_ok(vpChat*list);
????void is_sqlite_ok(int rc);
????void open_db(sqlite3**db);//???????
????void creat_user_db(sqlite3*db??char**errmsg);//????user?????
????void creat_data_db(sqlite3*db??char**errmsg);//????data?????
????void creat_online_db(sqlite3*db??char**errmsg);//????online?????
????void creat_server_db(sqlite3*db??char**errmsg);//????server?????
????void insert_server_db(sqlite3*db??char*time??char**errmsg);
????void read_db_ok(sqlite3*db??char*errmsg??char*tablename);
????void delete_clean_db(sqlite3*db??char*tablename??char**errmsg);
????int read_online_fd(sqlite3*db??char**errmsg??char*user);
????int read_online_flag(sqlite3*db??char**errmsg??char*user);
????void write_online_all(sqlite3*db??char**errmsg??vpChat temp);
????int update_passwd(sqlite3*db??char**errmsg??char*name??char*passwd);
????void insert_data_db(sqlite3*db??char**errmsg??char*time??vpChat temp);
????int update_flag(sqlite3*db??char**errmsg??char*name??int flag);
????int delete_user(sqlite3*db??char**errmsg??char*name);
????void read_online_all(sqlite3*db??char**errmsg??vpChat temp);
????void read_data(sqlite3*db??char**errmsg??vpChat temp);
????int update_user(sqlite3*db??char**errmsg??char*name??char*toname);
????int update_db_data(sqlite3*db??char**errmsg??char*name??char*toname);
????????????string.c
??????????????????????????д???????????????Ч???
????#include"data.h"
????int my_strlen(const char*str)
????{
????int len;
????while(*str++!='