#include #include #include #include #include #include #include #include #include #include //#define LOCK_EX 2 /* exclusive lock */ //#define LOCK_UN 8 char tpl[15000]; char xchat[15000]; char tchat[15000]; char* test="111111fsdfk sdl;f;lsdf11111::blockthis is my inner\n block stuff block::2222222dsfksdflsdf2222222222::crap bla bla crap::dslflsd;fkl;sdfl;ds"; char* fetch(char* src,char* lb,char* rb) { register char *s,*e,*p; int len; s=strstr(src,lb); p=NULL; if( s ) { s+=strlen(lb); e=strstr(s,rb); if( e ) { len=e-s; p=(char*)calloc(len+1,sizeof(char)); memcpy(p,s,len); } } return p; } char* replace(char* where,char* lb,char* rb,char* what) { register char *s,*e,*p,*ss; int len,nlen; s=strstr(where,lb); p=NULL; if( s ) { ss=s; s+=strlen(lb); e=strstr(s,rb); if( e ) { len=e-s; nlen=strlen(where)-len+strlen(what)+1; p=(char*)calloc(nlen,sizeof(char)); if(!p) return NULL; memcpy(p,where,ss-where); memcpy(p+(ss-where),what,strlen(what)); memcpy(p+(ss-where)+strlen(what),e+strlen(rb),where+strlen(where)-e-strlen(rb)); } } return p; } int main(int argc,char** argv) { struct dirent *namelist; struct utimbuf timbuf; struct timeb tp; struct stat st; int n; char* xz; char* xx; char* temp1; char* temp2; char* chatblock; char* nickchange; char* joinblock; char* quitblock; char* action; char* s; char name[127]; char namex[127]; char idname[127]; DIR *dirr; FILE *zlo, *chat; int i=0; int fuckinlog; while (1) { dirr = opendir("/usr/local/www/cgi-bin/www.gazeta.ru/chat/users"); while((namelist=readdir(dirr))!=NULL) { s=strrchr(namelist->d_name,'.')+1; if (strcmp(s,"")!=0) { xz=fetch(namelist->d_name,".","."); sprintf(name,"/usr/local/www/cgi-bin/www.gazeta.ru/chat/users/user.%s.%s",xz,s); // ftime(&tp); stat(name,&st); if (st.st_mtime+180d_name,'.')+1; if (strcmp(s,"")!=0) { xz=fetch(namelist->d_name,".","."); sprintf(name,"/bhome/part2/01/vh01002/vcgi/chat/users/user.%s.%s",xz,s); // ftime(&tp); stat(name,&st); //printf ("z%d-%d\n",st.st_mtime,time(NULL)); if (st.st_mtime+180