traverse.c revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted
Copyright (C) 1998, 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include "fat.h"
#include "traverse.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef DISCOVER_ONLY
#define NO_CLUSTER -1
static char tmp_buffer [4096];
int
{
}
/* returns 1 if there are no more directory entries in the directory being
* traversed, 0 otherwise.
*/
static int
if (trav_info->is_legacy_root_dir)
return 1;
else
}
static int
{
return 0;
return 0;
return 1;
}
static int
{
(void*) trav_info->dir_entries,
return 0;
return 1;
}
static int
{
if (trav_info->is_legacy_root_dir)
return write_root_dir (trav_info);
else
return write_dir_cluster (trav_info);
}
static int
{
"Cluster %ld in directory %s is outside file system!",
(long) trav_info->this_buffer,
return 0;
}
}
/* FIXME: put into fat_dir_entry_* operations */
void
{
}
char* dir_name)
{
if (!trav_info)
goto error;
goto error_free_trav_info;
if (trav_info->is_legacy_root_dir) {
} else {
}
if (!trav_info->dir_entries)
goto error_free_dir_name;
if (trav_info->is_legacy_root_dir) {
goto error_free_dir_entries;
} else {
if (!read_next_dir_buffer (trav_info))
goto error_free_dir_entries;
}
return trav_info;
return NULL;
}
int
{
if (!write_dir_buffer (trav_info))
return 0;
}
return 1;
}
{
}
{
return NULL;
if (trav_info->current_entry
if (!write_dir_buffer (trav_info))
return NULL;
}
trav_info->current_entry = 0;
if (is_last_buffer (trav_info)) {
return NULL;
}
if (!read_next_dir_buffer (trav_info))
return NULL;
}
}
{
case FAT_TYPE_FAT12:
case FAT_TYPE_FAT16:
case FAT_TYPE_FAT32:
* 65536L
}
return 0;
}
void
{
case FAT_TYPE_FAT12:
PED_ASSERT (0, (void) 0);
break;
case FAT_TYPE_FAT16:
break;
case FAT_TYPE_FAT32:
break;
}
}
{
}
int
{
}
int
{
return 1;
}
int
if (!fat_dir_entry_is_active (dir_entry)) return 0;
return 1;
}
int
{
if (!fat_dir_entry_is_file (dir_entry)) return 0;
}
int
{
if (!fat_dir_entry_is_active (dir_entry)) return 0;
}
int
{
if (!fat_dir_entry_is_file (dir_entry)
return 0;
if (first_cluster == 0
return 0;
return 1;
}
/*
decrypts silly DOS names to FILENAME.EXT
*/
void
int i;
char *src;
for (i=0; i<8; i++) {
}
*result++ = '.';
for (i=8; i<11; i++) {
}
}
*result = 0;
}
#endif /* !DISCOVER_ONLY */