r339: The menu key bindings are now only saved if they actually changed.
[rox-filer.git] / ROX-Filer / src / modechange.h
blob4381c810db2737557b770f00f4a838c8e85f8fbd
1 /*
2 * $Id$
4 * ROX-Filer, filer for the ROX desktop project
5 * By Thomas Leonard, <tal197@users.sourceforge.net>.
7 * This rest of this file was taken from GNU FileUtils, with minor
8 * modifications.
9 */
11 /* Masks for the `flags' field in a `struct mode_change'. */
13 #if ! defined MODECHANGE_H_
14 # define MODECHANGE_H_
16 /* Affect the execute bits only if at least one execute bit is set already,
17 or if the file is a directory. */
18 # define MODE_X_IF_ANY_X 01
20 /* If set, copy some existing permissions for u, g, or o onto the other two.
21 Which of u, g, or o is copied is determined by which bits are set in the
22 `value' field. */
23 # define MODE_COPY_EXISTING 02
25 struct mode_change
27 char op; /* One of "=+-". */
28 char flags; /* Special operations. */
29 unsigned short affected; /* Set for u/g/o/s/s/t, if to be affected. */
30 unsigned short value; /* Bits to add/remove. */
31 struct mode_change *next; /* Link to next change in list. */
34 /* Masks for mode_compile argument. */
35 # define MODE_MASK_EQUALS 1
36 # define MODE_MASK_PLUS 2
37 # define MODE_MASK_MINUS 4
38 # define MODE_MASK_ALL (MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS)
40 struct mode_change *mode_compile(const char *, unsigned);
41 unsigned short mode_adjust(unsigned, const struct mode_change *);
42 void mode_free(struct mode_change *);
44 #endif