libparted 3.6
Loading...
Searching...
No Matches
table.h
Go to the documentation of this file.
1/*
2 libparted
3 Copyright (C) 1998-2000, 2007, 2009-2014, 2019-2023 Free Software
4 Foundation, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef PED_FAT_TABLE_H_INCLUDED
21#define PED_FAT_TABLE_H_INCLUDED
22
23typedef struct _FatTable FatTable;
24
25#include "fat.h"
26
27struct _FatTable {
28 void* table;
30 int raw_size;
31
36
38};
39
40extern FatTable* fat_table_new (FatType fat_type, FatCluster size);
41extern FatTable* fat_table_duplicate (const FatTable* ft);
42extern void fat_table_destroy (FatTable* ft);
43extern void fat_table_clear (FatTable* ft);
45 FatCluster new_cluster_count);
46
47extern int fat_table_read (FatTable* ft, const PedFileSystem* fs,
48 int table_num);
49extern int fat_table_write (const FatTable* ft, PedFileSystem* fs,
50 int table_num);
51extern int fat_table_write_all (const FatTable* ft, PedFileSystem* fs);
52extern int fat_table_compare (const FatTable* a, const FatTable* b);
53extern int fat_table_count_stats (FatTable* ft);
54
55extern FatCluster fat_table_get (const FatTable* ft, FatCluster cluster);
56extern int fat_table_set (FatTable* ft, FatCluster cluster, FatCluster value);
57
60 PedFileSystem* fs);
61
62extern int fat_table_is_bad (const FatTable* ft, FatCluster cluster);
63extern int fat_table_is_eof (const FatTable* ft, FatCluster cluster);
64extern int fat_table_is_empty (const FatTable* ft, FatCluster cluster);
65extern int fat_table_is_available (const FatTable* ft, FatCluster cluster);
66extern int fat_table_is_active (const FatTable* ft, FatCluster cluster);
67
68extern int fat_table_set_eof (FatTable* ft, FatCluster cluster);
69extern int fat_table_set_avail (FatTable* ft, FatCluster cluster);
70extern int fat_table_set_bad (FatTable* ft, FatCluster cluster);
71
72extern int fat_table_entry_size (FatType fat_type);
73
74#endif /* PED_FAT_TABLE_H_INCLUDED */
enum _FatType FatType
Definition: fat.h:49
uint32_t FatCluster
Definition: fat.h:41
Definition: fat.h:57
FatCluster bad_cluster_count
Definition: fat.h:65
FatCluster cluster_count
Definition: fat.h:63
void * table
Definition: fat.h:58
FatCluster size
Definition: fat.h:59
int raw_size
Definition: fat.h:60
FatCluster last_alloc
Definition: fat.h:67
FatCluster free_cluster_count
Definition: fat.h:64
FatType fat_type
Definition: fat.h:62
Structure describing file system.
Definition: filesys.h:68
void fat_table_clear(FatTable *ft)
Definition: table.c:78
int fat_table_set_eof(FatTable *ft, FatCluster cluster)
Definition: table.c:414
void fat_table_destroy(FatTable *ft)
Definition: table.c:53
int fat_table_set_cluster_count(FatTable *ft, FatCluster new_cluster_count)
Definition: table.c:91
int fat_table_is_bad(const FatTable *ft, FatCluster cluster)
Definition: table.c:367
int fat_table_is_eof(const FatTable *ft, FatCluster cluster)
Definition: table.c:376
int fat_table_set_avail(FatTable *ft, FatCluster cluster)
Definition: table.c:459
FatCluster fat_table_get(const FatTable *ft, FatCluster cluster)
Definition: table.c:296
int fat_table_is_available(const FatTable *ft, FatCluster cluster)
Definition: table.c:385
int fat_table_compare(const FatTable *a, const FatTable *b)
Definition: table.c:186
int fat_table_entry_size(FatType fat_type)
Definition: table.c:467
int fat_table_write_all(const FatTable *ft, PedFileSystem *fs)
Definition: table.c:172
FatCluster fat_table_alloc_cluster(FatTable *ft)
Definition: table.c:325
int fat_table_count_stats(FatTable *ft)
Definition: table.c:100
int fat_table_write(const FatTable *ft, PedFileSystem *fs, int table_num)
Definition: table.c:154
int fat_table_set(FatTable *ft, FatCluster cluster, FatCluster value)
Definition: table.c:264
int fat_table_read(FatTable *ft, const PedFileSystem *fs, int table_num)
Definition: table.c:119
FatTable * fat_table_duplicate(const FatTable *ft)
Definition: table.c:60
int fat_table_is_empty(const FatTable *ft, FatCluster cluster)
Definition: table.c:394
FatCluster fat_table_alloc_check_cluster(FatTable *ft, PedFileSystem *fs)
Definition: table.c:348
int fat_table_is_active(const FatTable *ft, FatCluster cluster)
Definition: table.c:404
FatTable * fat_table_new(FatType fat_type, FatCluster size)
Definition: table.c:27
int fat_table_set_bad(FatTable *ft, FatCluster cluster)
Definition: table.c:436