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)
8 * This file can be redistributed under the terms of the GNU Library General
27 static struct flags_name flags_array[] = {
28 { EXT2_SECRM_FL, "s", "Secure_Deletion" },
29 { EXT2_UNRM_FL, "u" , "Undelete" },
30 { EXT2_SYNC_FL, "S", "Synchronous_Updates" },
31 { EXT2_IMMUTABLE_FL, "i", "Immutable" },
32 { EXT2_APPEND_FL, "a", "Append_Only" },
33 { EXT2_NODUMP_FL, "d", "No_Dump" },
34 { EXT2_NOATIME_FL, "A", "No_Atime" },
35 { EXT2_COMPR_FL, "c", "Compression_Requested" },
36 { EXT2_COMPRBLK_FL, "B", "Compressed_File" },
37 { EXT2_DIRTY_FL, "D", "Compressed_Dirty_File" },
38 { EXT2_NOCOMPR_FL, "X", "Compression_Raw_Access" },
39 { EXT2_ECOMPR_FL, "E", "Compression_Error" },
40 { EXT3_JOURNAL_DATA_FL, "j", "Journaled_Data" },
44 void print_flags (FILE * f, unsigned long flags, unsigned options)
46 int long_opt = (options & PFOPT_LONG);
47 struct flags_name *fp;
50 for (fp = flags_array; fp->flag != 0; fp++) {
51 if (flags & fp->flag) {
57 fputs(fp->long_name, f);
59 fputs(fp->short_name, f);
65 if (long_opt && first)