2 * ROX-Filer, filer for the ROX desktop project
3 * By Thomas Leonard, <tal197@users.sourceforge.net>.
5 * This rest of this file was taken from GNU FileUtils, with minor
9 /* Masks for the `flags' field in a `struct mode_change'. */
11 #if ! defined MODECHANGE_H_
12 # define MODECHANGE_H_
14 /* Affect the execute bits only if at least one execute bit is set already,
15 or if the file is a directory. */
16 # define MODE_X_IF_ANY_X 01
18 /* If set, copy some existing permissions for u, g, or o onto the other two.
19 Which of u, g, or o is copied is determined by which bits are set in the
21 # define MODE_COPY_EXISTING 02
25 char op
; /* One of "=+-". */
26 char flags
; /* Special operations. */
27 unsigned short affected
; /* Set for u/g/o/s/s/t, if to be affected. */
28 unsigned short value
; /* Bits to add/remove. */
29 struct mode_change
*next
; /* Link to next change in list. */
32 /* Masks for mode_compile argument. */
33 # define MODE_MASK_EQUALS 1
34 # define MODE_MASK_PLUS 2
35 # define MODE_MASK_MINUS 4
36 # define MODE_MASK_ALL (MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS)
38 struct mode_change
*mode_compile(const char *, unsigned);
39 unsigned short mode_adjust(unsigned, const struct mode_change
*);
40 void mode_free(struct mode_change
*);