Loading...
Searching...
No Matches
traverse.h
Go to the documentation of this file.
/*
libparted
Copyright (C) 1998-2000, 2007-2014, 2019-2023, 2026 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
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/>.
*/
#ifndef TRAVERSE_H_INCLUDED
#define TRAVERSE_H_INCLUDED
#include "fatio.h"
typedef struct _FatTraverseInfo FatTraverseInfo;
struct _FatTraverseInfo {
PedFileSystem* fs;
char* dir_name;
int is_legacy_root_dir;
int dirty;
int eof;
FatDirEntry* dir_entries;
int current_entry;
FatCluster this_buffer, next_buffer;
int buffer_size;
};
extern int fat_traverse_entries_per_buffer (FatTraverseInfo* trav_info);
/* starts traversal at an arbitary cluster. if start_cluster==0, then uses
root directory */
extern FatTraverseInfo* fat_traverse_begin (PedFileSystem* fs,
FatCluster start_cluster,
const char* dir_name);
extern int fat_traverse_complete (FatTraverseInfo* trav_info);
extern FatTraverseInfo* fat_traverse_directory (FatTraverseInfo* trav_info,
FatDirEntry* parent);
extern void fat_traverse_mark_dirty (FatTraverseInfo* trav_info);
extern FatDirEntry* fat_traverse_next_dir_entry (FatTraverseInfo* trav_info);
extern FatCluster fat_dir_entry_get_first_cluster (FatDirEntry* dir_entry,
PedFileSystem* fs);
extern void fat_dir_entry_set_first_cluster (FatDirEntry* dir_entry,
PedFileSystem* fs, FatCluster cluster);
extern uint32_t fat_dir_entry_get_length (FatDirEntry* dir_entry);
extern int fat_dir_entry_is_null_term (const FatDirEntry* dir_entry);
extern int fat_dir_entry_is_file (FatDirEntry* dir_entry);
extern int fat_dir_entry_is_system_file (FatDirEntry* dir_entry);
extern int fat_dir_entry_is_directory (FatDirEntry* dir_entry);
extern void fat_dir_entry_get_name (const FatDirEntry* dir_entry, char* result);
extern int fat_dir_entry_is_active (FatDirEntry* dir_entry);
extern int fat_dir_entry_has_first_cluster (FatDirEntry* dir_entry,
PedFileSystem* fs);
#endif /* TRAVERSE_H_INCLUDED */
FatCluster
uint32_t FatCluster
Definition fat.h:41
FatDirEntry
struct _FatDirEntry FatDirEntry
Definition fat.h:52
fatio.h
PedFileSystem
struct _PedFileSystem PedFileSystem
Definition filesys.h:30
_FatTraverseInfo
Definition traverse.h:27
_FatTraverseInfo::eof
int eof
Definition traverse.h:33
_FatTraverseInfo::dir_entries
FatDirEntry * dir_entries
Definition traverse.h:35
_FatTraverseInfo::dirty
int dirty
Definition traverse.h:32
_FatTraverseInfo::fs
PedFileSystem * fs
Definition traverse.h:28
_FatTraverseInfo::dir_name
char * dir_name
Definition traverse.h:29
_FatTraverseInfo::this_buffer
FatCluster this_buffer
Definition traverse.h:37
_FatTraverseInfo::current_entry
int current_entry
Definition traverse.h:36
_FatTraverseInfo::is_legacy_root_dir
int is_legacy_root_dir
Definition traverse.h:31
_FatTraverseInfo::next_buffer
FatCluster next_buffer
Definition traverse.h:37
_FatTraverseInfo::buffer_size
int buffer_size
Definition traverse.h:38
fat_dir_entry_get_length
uint32_t fat_dir_entry_get_length(FatDirEntry *dir_entry)
Definition traverse.c:273
fat_dir_entry_get_name
void fat_dir_entry_get_name(const FatDirEntry *dir_entry, char *result)
Definition traverse.c:344
fat_dir_entry_is_null_term
int fat_dir_entry_is_null_term(const FatDirEntry *dir_entry)
Definition traverse.c:279
fat_traverse_directory
FatTraverseInfo * fat_traverse_directory(FatTraverseInfo *trav_info, FatDirEntry *parent)
Definition traverse.c:192
fat_traverse_mark_dirty
void fat_traverse_mark_dirty(FatTraverseInfo *trav_info)
Definition traverse.c:117
fat_traverse_begin
FatTraverseInfo * fat_traverse_begin(PedFileSystem *fs, FatCluster start_cluster, const char *dir_name)
Definition traverse.c:123
fat_dir_entry_is_directory
int fat_dir_entry_is_directory(FatDirEntry *dir_entry)
Definition traverse.c:314
fat_dir_entry_get_first_cluster
FatCluster fat_dir_entry_get_first_cluster(FatDirEntry *dir_entry, PedFileSystem *fs)
Definition traverse.c:230
fat_traverse_complete
int fat_traverse_complete(FatTraverseInfo *trav_info)
Definition traverse.c:179
fat_dir_entry_is_active
int fat_dir_entry_is_active(FatDirEntry *dir_entry)
Definition traverse.c:288
fat_dir_entry_is_file
int fat_dir_entry_is_file(FatDirEntry *dir_entry)
Definition traverse.c:297
fat_dir_entry_has_first_cluster
int fat_dir_entry_has_first_cluster(FatDirEntry *dir_entry, PedFileSystem *fs)
Definition traverse.c:323
fat_traverse_next_dir_entry
FatDirEntry * fat_traverse_next_dir_entry(FatTraverseInfo *trav_info)
Definition traverse.c:205
fat_dir_entry_set_first_cluster
void fat_dir_entry_set_first_cluster(FatDirEntry *dir_entry, PedFileSystem *fs, FatCluster cluster)
Definition traverse.c:249
fat_traverse_entries_per_buffer
int fat_traverse_entries_per_buffer(FatTraverseInfo *trav_info)
Definition traverse.c:35
FatTraverseInfo
struct _FatTraverseInfo FatTraverseInfo
Definition traverse.h:25
fat_dir_entry_is_system_file
int fat_dir_entry_is_system_file(FatDirEntry *dir_entry)
Definition traverse.c:306