futility/updater_archive.c
/* Callback for archive_walk on a ZIP file. */
Callback for archive_walk on a ZIP file.
Callback for archive_walk on a ZIP file .
static int archive_zip_walk(
		void *handle, void *arg,
		int (*callback)(const char *name, void *arg))
{
	zip_int64_t num, i;
	struct zip *zip = (struct zip *)handle;
	assert(zip);
	num = zip_get_num_entries(zip, 0);
	if (num < 0)
		return 1;
	for (i = 0; i < num; i++) {
		const char *name = zip_get_name(zip, i, 0);
		if (*name && name[strlen(name) - 1] == '/')
			continue;
		if (callback(name, arg))
			break;
	}
	return 0;
}
static int archive_zip_walk ( void * handle , void * arg , int ( * callback ) ( const char * name , void * arg ) ) { zip_int64_t num , i ; struct zip * zip = ( struct zip * ) handle ; assert ( zip ) ; num = zip_get_num_entries ( zip , 0 ) ; if ( num < 0 ) return 1 ; for ( i = 0 ; i < num ; i ++ ) { const char * name = zip_get_name ( zip , i , 0 ) ; if ( * name && name [ strlen ( name ) - 1 ] == ' ' ) continue ; if ( callback ( name , arg ) ) break ; } return 0 ; }
Callback for archive_walk on a ZIP file.
Callback for archive_walk on a ZIP file .