]>
git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - lib/e2p/pf.c
2 * pf.c - Print file attributes on an ext2 file system
4 * Copyright (C) 1993, 1994 Remy Card <card@masi.ibp.fr>
5 * Laboratoire MASI, Institut Blaise Pascal
6 * Universite Pierre et Marie Curie (Paris VI)
9 * This file may be redistributed under the terms of the GNU Library
10 * General Public License, version 2.
26 const char *short_name
;
27 const char *long_name
;
30 static struct flags_name flags_array
[] = {
31 { EXT2_SECRM_FL
, "s", "Secure_Deletion" },
32 { EXT2_UNRM_FL
, "u" , "Undelete" },
33 { EXT2_SYNC_FL
, "S", "Synchronous_Updates" },
34 { EXT2_DIRSYNC_FL
, "D", "Synchronous_Directory_Updates" },
35 { EXT2_IMMUTABLE_FL
, "i", "Immutable" },
36 { EXT2_APPEND_FL
, "a", "Append_Only" },
37 { EXT2_NODUMP_FL
, "d", "No_Dump" },
38 { EXT2_NOATIME_FL
, "A", "No_Atime" },
39 { EXT2_COMPR_FL
, "c", "Compression_Requested" },
40 { EXT4_ENCRYPT_FL
, "E", "Encrypted" },
41 { EXT3_JOURNAL_DATA_FL
, "j", "Journaled_Data" },
42 { EXT2_INDEX_FL
, "I", "Indexed_directory" },
43 { EXT2_NOTAIL_FL
, "t", "No_Tailmerging" },
44 { EXT2_TOPDIR_FL
, "T", "Top_of_Directory_Hierarchies" },
45 { EXT4_EXTENTS_FL
, "e", "Extents" },
46 { FS_NOCOW_FL
, "C", "No_COW" },
47 { EXT4_CASEFOLD_FL
, "F", "Casefold" },
48 { EXT4_INLINE_DATA_FL
, "N", "Inline_Data" },
49 { EXT4_PROJINHERIT_FL
, "P", "Project_Hierarchy" },
50 { EXT4_VERITY_FL
, "V", "Verity" },
54 void print_flags (FILE * f
, unsigned long flags
, unsigned options
)
56 int long_opt
= (options
& PFOPT_LONG
);
57 struct flags_name
*fp
;
60 for (fp
= flags_array
; fp
->flag
!= 0; fp
++) {
61 if (flags
& fp
->flag
) {
67 fputs(fp
->long_name
, f
);
69 fputs(fp
->short_name
, f
);
75 if (long_opt
&& first
)