-
Notifications
You must be signed in to change notification settings - Fork 0
/
table.h
53 lines (44 loc) · 1.39 KB
/
table.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// table.h - drawing a custom table of file extents
//
// This file is part of extents, tools for querying and accessing file extents.
//
// Written in 2019 by Eliah Kagan <degeneracypressure@gmail.com>.
//
// To the extent possible under law, the author(s) have dedicated all copyright
// and related and neighboring rights to this software to the public domain
// worldwide. This software is distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along
// with this software. If not, see
// <http://creativecommons.org/publicdomain/zero/1.0/>.
#ifndef HAVE_EXTENTS_FIEMAP_TABLE_H_
#define HAVE_EXTENTS_FIEMAP_TABLE_H_
#include "feature-test.h"
#include "attribute.h"
#include <stddef.h>
#include <linux/fiemap.h>
#include <linux/types.h>
#include <sys/ioctl.h>
enum datum {
k_datum_logical, // "LOGICAL"
k_datum_physical, // "INITIAL"
k_datum_length, // "COUNT"
k_datum_physical_end // "FINAL"
};
struct colspec {
const char *label;
int width;
enum datum datum;
__u64 offset;
__u64 divisor;
};
struct tablespec {
const struct fiemap *fmp;
int gap_width;
int col_count;
struct colspec cols[];
};
ATTRIBUTE((nonnull))
void show_extent_table(const struct fiemap *restrict fmp, const __u64 offset,
const char *restrict columns);
#endif // ! HAVE_EXTENTS_FIEMAP_TABLE_H_