亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sites.c

?? 站點映像程序
?? C
?? 第 1 頁 / 共 4 頁
字號:
int site_readremotefiles( struct site_t *the_site ) {    FILE *fp;    char buf[BUFSIZ], /* for the line */	tmp[BUFSIZ], /* for the current field */	*pos, /* for the current position within buf */	*point, /* for the curpos within tmp */	*this_file = NULL;    struct site_file_t *current;    size_t dir_length;    int state;    /* Get the remote files from the storage file */    DEBUG( DEBUG_FILES, "Reading info file: %s\n", the_site->infofile );    fp = fopen( the_site->infofile, "r" );    if( fp == NULL ) {	/* This is not an error condition, since the info file WILL NOT 	 * exist until the site has been created, which is okay, just means	 * there are 'no' files on the remote site */	return 1;    }    /* The file exists, so read it.     * Format: one item / line, tab-separated fields.     * First field is filename of item.     * Second field is 'dir' for directory items, or mtime for files     * Third field (files only) is size of file */    current = NULL;    while( fgets( buf, BUFSIZ, fp) != NULL ) {	/* Create a new file item and lob it on the end of the linked 	 * list */	current = file_append( the_site );	/* Make sure we have an end-of-buffer */	buf[BUFSIZ-1] = '\0';	this_file = NULL;	/* Now parse the line. Simple DFA, states are:	 *  0: Reading filename, field 1	 *  1: Reading date/time stamp or DIRWORD, field 2	 *  2: Reading file size, field 3 (if file)	 *  3: Junk state - consume-all-crud-till-end-of-line.	 * 	 * We read the current field into tmp char by char.	 * point is the current point within tmp. */	state = 0;	point = tmp;	for( pos = buf; *pos!='\0'; pos++ ) {	    if( *pos < 0 ) state = 5;	    switch( state ) {	    case 0:		if( *pos == '\t' ) {		    /* End of the filename */		    *point = '\0';		    this_file = strdup( tmp );		    point = tmp;		    state = 1;		} else {		    /* Still in the filename */		    *(point++) = *pos;		}		break;	    case 1:		if( *pos == '\t' || *pos == '\n' ) {		    /* End of the second field */		    *point = '\0';		    if( strlen( tmp ) > 0 ) {			if( strcmp( tmp, DIRWORD ) == 0 ) {			    /* It's a directory! */			    current->dir = true;			    state = 3; /* that's all we need */			} else if( strcmp( tmp, LINKWORD ) == 0 ) {			    current->link = true;			    point = tmp;			    state = 4; /* read the link target */			} else {			    /* It's a file! - field 2 is the mtime */			    current->dir = false;			    current->remotetime = atol( tmp );			    point = tmp;			    state = 2;			}		    } else {			/* Corrupt line, we need at least two fields */			/* FIXME: Report this to the user. */			state = 5;		    }					} else {		    /* Within the second field */		    *(point++) = *pos;		}		break;	    case 2:		if( *pos == '\n' ) {		    /* End of the size field */		    *point = '\0';		    current->remotesize = atol( tmp );		    state = 3;		} else {		    /* Within the file size field */		    *(point++) = *pos;		}		break;	    case 3: /* junk state */		break;	    case 4: /* read the link name */		if( *pos == '\n' ) {		    /* End of the field */		    *point = '\0';		    current->remotelink = strdup( tmp );		    state = 3;		} else {		    *(point++) = *pos;		}	    case 5: /* error state */		break;	    }	}	if( this_file==NULL || state == 5 ) {	    /* FIXME: Report this to the user */	    DEBUG( DEBUG_FILES, "Corrupt line.\n" );	    file_delete( the_site, current );	    continue;	}	current->diff = file_deleted;	current->filename = strdup( base_name( this_file ) );	/* we are going to chop the leading / of this_file */	if( strlen(current->filename) > strlen(this_file) ) {	    /* FIXME: Handle these errors properly */	    DEBUG( DEBUG_FILES, "Very corrupt line.\n" );	    free( current->filename );	    file_delete( the_site, current );	    continue;	}	dir_length = strlen(this_file) - strlen(current->filename ) - 1;	current->directory = malloc( dir_length + 1 );	strncpy( current->directory, this_file + 1, dir_length );	*(current->directory+dir_length) = '\0'; /* null-term */	DEBUG( DEBUG_FILES, "Split %s is: Dir [%s], name [%s]\n",	       this_file, current->directory, current->filename );	the_site->numdeleted++;	site_assignnames( current, the_site );	DEBUG( DEBUG_FILES, "Remote: [%s] - file: size: %ld  time: %ld\n",	       current->filename, current->remotesize, current->remotetime );	DEBUG( DEBUG_FILES, 	       "Directory: [%s]  Filename: %s\n"	       "rel_local: %s  rel_remote: %s\n"	       "full_local: %s  full_remote: %s\n",	       current->directory, current->filename,	       current->rel_local, current->rel_remote, 	       current->full_local, current->full_remote );	free( this_file );    }    fclose( fp );    return 0;}/* Read the local site files...  * A stack is used for directories within the site - this is not recursive. * Each item on the stack is a FULL PATH to the directory, i.e., including * the local site root. */int site_readlocalfiles( struct site_t *the_site ) {    char *dirstack[MAXDIRS], *this;    char *full = NULL, *fname, *temp;    struct stat item;    DIR *curdir;    struct dirent *ent;    int dirtop = 0;    size_t dir_length;    struct site_file_t *current;    /* Push the root directory on to the stack */    dirstack[dirtop++] = strdup( the_site->local_root );        /* Now, for all items in the stack, process all the files, and     * add the dirs to the stack. Everything we put on the stack is     * temporary and gets freed eventually. */    while( dirtop > 0 ) {	/* Pop the stack */	this = dirstack[--dirtop];		DEBUG( DEBUG_FILES, "Dir: %s\n", this );	curdir = opendir( this );	if( curdir == NULL ) {	    free( this );	    continue;	}	/* Now read all the directory entries */	while( (ent = readdir( curdir )) != NULL ) {	    if( full != NULL ) 		free( full );	    full = malloc( strlen( this ) + strlen( ent->d_name ) + 1 );	    strcpy( full, this );	    strcat( full, ent->d_name );	    DEBUG( DEBUG_FILES, "Item: %s - ", ent->d_name );#ifndef __EMX__ 	    if( lstat( full, &item ) == -1 ) {#else	    /* There are no symlinks under OS/2, use stat() instead */	    if( stat( full, &item ) == -1 ) {#endif		/* FIXME: FE warning here */		continue;	    }#ifndef __EMX__	    /* Is this a symlink? */	    if( S_ISLNK( item.st_mode ) ) {		DEBUG( DEBUG_FILES, "symlink - " );		if( the_site->symlinks == sitesym_ignore ) {		    /* Just skip it */		    DEBUG( DEBUG_FILES, "ignoring.\n" );		    continue;		} else if( the_site->symlinks == sitesym_follow ) {		    DEBUG( DEBUG_FILES, "followed - " );		    /* Else, carry on as normal, stat the real file */		    if( stat( full, &item ) == -1 ) {			/* It's probably a broken link */			DEBUG( DEBUG_FILES, "broken.\n" );			continue;		    }		} else {		    DEBUG( DEBUG_FILES, "maintained:\n" );		}	    }#endif /* __EMX__ */	    /* Now process it */	    /* This is the rel_local of this file - i.e., everything	     * apart from the local root */	    fname = (char *)full+strlen(the_site->local_root)-1;	    /* Check for excludes */	    if( file_isexcluded( ent->d_name, fname, the_site ) )		continue;   	    for( current=the_site->files; current!=NULL; current=current->next ) {		if( strcmp( current->rel_local, fname ) == 0 )		    /* Match found! */		    break;/*		last = current; */	    }	    	    if( S_ISREG( item.st_mode ) ) {		DEBUG( DEBUG_FILES, "file - " );		if( current == NULL ) {		    /* This is a new local file... */		    DEBUG( DEBUG_FILES, "new - " );		    the_site->numnew++;		    /* Add a new file to the beginning of the list */		    current = file_prepend( the_site );		    current->filename = strdup( base_name( fname ) );		    /* This is the length of the directory name...		     * fname = "/full/file/name.ext", filename = "name.ext"		     * we want directory = "full/file/"... do the maths */		    dir_length = strlen(fname) - strlen(current->filename)-1;		    DEBUG( DEBUG_FILES, "dir_length = %ld\n", (long) dir_length );		    current->directory = malloc( dir_length + 1 );		    strncpy( current->directory, fname+1, dir_length );		    *(current->directory+dir_length) = '\0'; /* nullterm */		    DEBUG( DEBUG_FILES, "directory = %s\n", current->directory );		    site_assignnames( current, the_site );		    current->localtime = item.st_mtime;		    current->localsize = item.st_size;		    current->diff = file_new;		    current->mode = item.st_mode;		    current->dir = false;		    the_site->totalnew += item.st_size;/*		    DEBUG( DEBUG_FILES, "new; size: %ld, time: %ld\n", item.st_size, item.st_mtime );  */		} else {		    /* Match found... compare it */		    current->localtime = item.st_mtime;		    current->localsize = item.st_size;		    the_site->numdeleted--;		    if( (current->localtime > current->remotetime) ||			(current->localsize != current->remotesize) ) {			/* Changed file */			current->diff = file_changed;			current->mode = item.st_mode;			the_site->numchanged++;			the_site->totalchanged += item.st_size;			DEBUG( DEBUG_FILES, "changed (%ld -> %ld)\n", current->localtime, current->remotetime );		    } else {			current->diff = file_unchanged;			current->updated = true;			the_site->numunchanged++;			DEBUG( DEBUG_FILES, "unchanged.\n" );		    }		    /* The names will already have been assigned */		}				    		/* Assign the ASCII type value */		current->isascii = file_isascii( fname, the_site );	    } else if( S_ISDIR( item.st_mode ) ) {		/* THIS IS A DIRECTORY! */		if( strcmp( ent->d_name, "." )==0 ||		    strcmp( ent->d_name, ".." )==0 ) {		    DEBUG( DEBUG_FILES, "ignored.\n" );		    continue;		}				DEBUG( DEBUG_FILES, "directory - " );		if( dirtop < MAXDIRS ) {		    temp = malloc( strlen( full ) + 2 );		    strcpy( temp, full );		    strcat( temp, "/" );		    dirstack[dirtop++] = temp;		} else {		    /* No more room in stack		     * FIXME: Report this to the user.*/		}		if( current == NULL ) {		    /* New Directory */		    the_site->numnew++;		    current = file_append( the_site );		    current->filename = strdup( base_name( fname ) );		    /* Work out the directory name */		    dir_length = strlen(fname) - strlen(current->filename )-1;		    current->directory = malloc( dir_length + 1 );		    strncpy( current->directory, fname+1, dir_length );		    *(current->directory+dir_length) = '\0'; /* null-term */		    site_assignnames( current, the_site );		    current->dir = true;		    current->diff = file_new;		    current->mode = item.st_mode;		    current->localsize = item.st_size;		    DEBUG( DEBUG_FILES, "new.\n" ); 		} else {		    /* It's an existing directory */		    the_site->numdeleted--;		    the_site->numunchanged++;		    current->diff = file_unchanged;		    current->updated = true;		    DEBUG( DEBUG_FILES, "existing.\n" ); 		}	    } #ifndef __EMX__	    else if( S_ISLNK( item.st_mode ) ) {		char tmp[BUFSIZ];		memset( tmp, 0, BUFSIZ );		DEBUG( DEBUG_FILES, "symlink being maintained.\n" );		if( readlink( full, tmp, BUFSIZ ) == -1 ) {		    DEBUG( DEBUG_FILES, "readlink failed: %s\n", 			   strerror(errno) );		    continue;		}		DEBUG( DEBUG_FILES, "Link target: %s\n", tmp );		if( current == NULL ) {		    /* New link */		    the_site->numnew++;		    current = file_append( the_site );		    current->filename = strdup( base_name( fname ) );		    dir_length = strlen(fname) - strlen(current->filename)-1;		    DEBUG( DEBUG_FILES, "dir_length = %ld\n", (long) dir_length );		    current->directory = malloc( dir_length + 1 );		    strncpy( current->directory, fname+1, dir_length );		    *(current->directory+dir_length) = '\0'; /* nullterm */		    DEBUG( DEBUG_FILES, "directory = %s\n", current->directory );		    current->locallink = strdup( tmp );		    current->diff = file_new;		    current->link = true;		    site_assignnames( current, the_site );		} else {		    /* Existing link... compare */		    the_site->numdeleted--;		    current->locallink = strdup( tmp );		    if( strcmp( current->remotelink, tmp ) == 0 ) {			/* Links match */			current->updated = true;			current->diff = file_unchanged;			the_site->numunchanged++;		    } else {			current->diff = file_changed;			the_site->numchanged++;		    }		}	    }#endif /* __EMX__ */	    else {		DEBUG( DEBUG_FILES, "something else.\n" );	    }	}	/* Close the open directory */	closedir( curdir );	/* And we're finished with this */	free( this );    }    return 0;}static void site_checkmoved( struct site_t *the_site ) {    /* Have any files been moved?     * We look for new files, then see if we can find a deleted file     * which matches filename, mod time, and size exactly.     *      * This is simplistic, and it is possible to get it wrong in some     * (unusual) circumstances:     *    Old: /bar/file1.zip, /foo/file1.zip      *    New: /new/file1.zip.     * If all the file1.zip's have the same size and mod time, it     * IS NOT POSSIBLE to know which one has become /new/file1.zip without      * storing remembering the contents of /bar/file1.zip somehow and      * comparing, or using a filesystem which remembers stuff. In any case     * it's pretty silly to try - so the whole shabang is optional.     *     * It would probably be better to search for DELETED files, then      * check them against NEW files, since files are more often added     * to sites then they are deleted. But hey, this is C, who'll notice?     */    struct site_file_t *search, *current;    /*  char *bname, *tmp; */    /* First off, find the new files... */    DEBUG( DEBUG_FILES, "Checking for moved files...\n" );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲猫色日本管| 亚洲午夜免费电影| 悠悠色在线精品| 免费成人在线观看视频| www.色综合.com| 欧美电影免费观看高清完整版在| 中文子幕无线码一区tr| 另类小说图片综合网| 色噜噜狠狠成人网p站| 国产亚洲制服色| 丝袜诱惑亚洲看片| 一本色道久久综合精品竹菊| 久久尤物电影视频在线观看| 日韩黄色片在线观看| 在线免费不卡电影| 国产精品久久久久影视| 国产精品综合在线视频| 555www色欧美视频| 午夜欧美视频在线观看| 91亚洲精品一区二区乱码| 久久久久久久久免费| 蜜桃精品视频在线观看| 欧美老女人在线| 亚洲一区二区欧美日韩| 欧洲视频一区二区| 亚洲品质自拍视频网站| av资源网一区| 中文字幕在线免费不卡| 成人免费高清在线| 国产精品麻豆欧美日韩ww| 成人一区在线看| 国产精品丝袜黑色高跟| 福利一区二区在线| 国产精品美日韩| 国产91丝袜在线播放0| 欧美精彩视频一区二区三区| 国产高清一区日本| 中文字幕+乱码+中文字幕一区| 成人免费看黄yyy456| 中文字幕制服丝袜一区二区三区 | 日韩欧美aaaaaa| 美女网站一区二区| 久久蜜桃一区二区| 菠萝蜜视频在线观看一区| ...av二区三区久久精品| 91免费观看在线| 亚洲一区二区三区四区中文字幕| 欧洲激情一区二区| 日韩中文欧美在线| 亚洲精品一区二区三区福利| 国产99久久久国产精品潘金网站| 国产精品国产自产拍高清av | 麻豆高清免费国产一区| 2022国产精品视频| 成人免费av在线| 亚洲最大成人综合| 日韩欧美一级特黄在线播放| 国产精品一二三| 亚洲人成网站色在线观看| 欧美三级蜜桃2在线观看| 麻豆精品精品国产自在97香蕉| 精品成人一区二区三区四区| 不卡的av在线播放| 日韩和欧美的一区| 中文欧美字幕免费| 在线观看91精品国产麻豆| 韩国三级电影一区二区| 亚洲人妖av一区二区| 欧美一区二区在线观看| 成人天堂资源www在线| 一区二区三区**美女毛片| 精品久久国产字幕高潮| 91在线观看下载| 日本va欧美va欧美va精品| 欧美激情一区二区三区四区| 欧美日韩中字一区| 国产精品主播直播| 天天操天天色综合| 国产精品婷婷午夜在线观看| 欧美精品 日韩| 成人成人成人在线视频| 欧美96一区二区免费视频| 亚洲欧洲成人精品av97| 欧美成人a视频| 欧美午夜精品免费| av电影天堂一区二区在线| 久久精品国产一区二区三区免费看| 国产精品天天看| 精品国产凹凸成av人导航| 欧美亚洲丝袜传媒另类| 成+人+亚洲+综合天堂| 美女脱光内衣内裤视频久久网站 | 色噜噜狠狠成人网p站| 国产精品亚洲一区二区三区在线 | 亚洲欧美一区二区三区孕妇| 日韩美一区二区三区| 在线观看网站黄不卡| youjizz久久| 成人午夜视频网站| 国产自产v一区二区三区c| 婷婷六月综合网| 亚洲一区二区在线免费看| 国产精品美女一区二区在线观看| 欧美mv日韩mv国产网站app| 91精品国产综合久久久久久漫画| 一本色道久久综合精品竹菊| 99久久精品免费看| 91在线精品一区二区| 99久久精品国产精品久久| 成人性生交大片免费看视频在线 | 午夜电影一区二区三区| 一区二区三区在线视频免费观看| 综合久久久久久| 中文字幕一区二区三区四区不卡 | 亚洲一本大道在线| 亚洲欧美日韩国产中文在线| 中日韩av电影| 亚洲猫色日本管| 一级特黄大欧美久久久| 亚洲午夜在线视频| 亚洲成人综合在线| 日韩二区在线观看| 另类欧美日韩国产在线| 久久精品国产精品亚洲综合| 久久超级碰视频| 国产美女主播视频一区| 国产精品一级片在线观看| 国产精品1区2区3区| 高清国产午夜精品久久久久久| 粉嫩绯色av一区二区在线观看| 国产成人免费在线视频| www.亚洲在线| 欧美日韩精品三区| 日韩一区二区三区在线视频| 欧美va在线播放| 国产女主播在线一区二区| 国产精品国模大尺度视频| 一区二区日韩av| 日本欧美肥老太交大片| 韩国毛片一区二区三区| 成人免费视频一区| 欧美色图天堂网| 日韩女同互慰一区二区| 国产欧美日韩精品在线| 一区二区三区在线视频免费| 日韩中文字幕av电影| 国产成人精品一区二| 91看片淫黄大片一级| 欧美一级日韩一级| 欧美激情综合五月色丁香小说| 一区二区三区国产豹纹内裤在线| 免费在线看成人av| 成人久久久精品乱码一区二区三区| 色菇凉天天综合网| 精品国产一区二区在线观看| 成人欧美一区二区三区黑人麻豆| 婷婷一区二区三区| 成人一区在线观看| 欧美一级电影网站| 综合自拍亚洲综合图不卡区| 免费观看在线综合色| 成人手机电影网| 日韩西西人体444www| 亚洲欧美一区二区三区孕妇| 久久91精品久久久久久秒播| 91啪亚洲精品| 久久精品欧美一区二区三区不卡| 亚洲第一福利一区| 波多野结衣欧美| 久久免费精品国产久精品久久久久| 亚洲自拍偷拍九九九| 成人激情小说网站| 精品第一国产综合精品aⅴ| 亚洲午夜视频在线| 99国产欧美久久久精品| 久久影院午夜片一区| 美女一区二区三区在线观看| 在线亚洲一区二区| 国产精品女主播av| 国产精品一区二区果冻传媒| 欧美一区二区在线播放| 亚洲一区二区三区四区在线| 99麻豆久久久国产精品免费| 久久亚洲一级片| 经典一区二区三区| 日韩小视频在线观看专区| 亚洲一区二区三区在线播放| 色综合久久天天| 亚洲视频在线观看三级| 国产精品中文字幕一区二区三区| 91精品国产综合久久精品图片| 夜夜嗨av一区二区三区| 91论坛在线播放| 亚洲欧美另类图片小说| 成人黄色av电影| 一色屋精品亚洲香蕉网站| 成人动漫视频在线| 亚洲欧美日韩久久| 在线亚洲高清视频| 香蕉影视欧美成人|