Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/modechange.h @ 971:1099024dc505
(mode_create_from_ref): Add prototype.
(MODE_MASK_ALL): New define.
(MODE_BAD_REFERENCE): New define.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sun, 06 Jul 1997 21:27:44 +0000 |
parents | 693765a213f2 |
children | 8de2d981b46f |
rev | line source |
---|---|
5 | 1 /* modechange.h -- definitions for file mode manipulation |
971
1099024dc505
(mode_create_from_ref): Add prototype.
Jim Meyering <jim@meyering.net>
parents:
762
diff
changeset
|
2 Copyright (C) 1989, 1990, 1997 Free Software Foundation, Inc. |
5 | 3 |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
650
b4ef1c1a0171
update FSF address in copyright
Jim Meyering <jim@meyering.net>
parents:
610
diff
changeset
|
15 along with this program; if not, write to the Free Software Foundation, |
b4ef1c1a0171
update FSF address in copyright
Jim Meyering <jim@meyering.net>
parents:
610
diff
changeset
|
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
5 | 17 |
18 /* Masks for the `flags' field in a `struct mode_change'. */ | |
19 | |
20 /* Affect the execute bits only if at least one execute bit is set already, | |
21 or if the file is a directory. */ | |
22 #define MODE_X_IF_ANY_X 01 | |
23 | |
24 /* If set, copy some existing permissions for u, g, or o onto the other two. | |
25 Which of u, g, or o is copied is determined by which bits are set in the | |
26 `value' field. */ | |
27 #define MODE_COPY_EXISTING 02 | |
28 | |
29 struct mode_change | |
30 { | |
31 char op; /* One of "=+-". */ | |
32 char flags; /* Special operations. */ | |
33 unsigned short affected; /* Set for u/g/o/s/s/t, if to be affected. */ | |
34 unsigned short value; /* Bits to add/remove. */ | |
35 struct mode_change *next; /* Link to next change in list. */ | |
36 }; | |
37 | |
38 /* Masks for mode_compile argument. */ | |
39 #define MODE_MASK_EQUALS 1 | |
40 #define MODE_MASK_PLUS 2 | |
41 #define MODE_MASK_MINUS 4 | |
971
1099024dc505
(mode_create_from_ref): Add prototype.
Jim Meyering <jim@meyering.net>
parents:
762
diff
changeset
|
42 #define MODE_MASK_ALL (MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS) |
5 | 43 |
44 /* Error return values for mode_compile. */ | |
45 #define MODE_INVALID (struct mode_change *) 0 | |
46 #define MODE_MEMORY_EXHAUSTED (struct mode_change *) 1 | |
971
1099024dc505
(mode_create_from_ref): Add prototype.
Jim Meyering <jim@meyering.net>
parents:
762
diff
changeset
|
47 #define MODE_BAD_REFERENCE (struct mode_change *) 2 |
5 | 48 |
610 | 49 #ifndef __P |
653 | 50 # if defined (__GNUC__) || (defined (__STDC__) && __STDC__) |
761 | 51 # define __P(Args) Args |
653 | 52 # else |
761 | 53 # define __P(Args) () |
971
1099024dc505
(mode_create_from_ref): Add prototype.
Jim Meyering <jim@meyering.net>
parents:
762
diff
changeset
|
54 # endif |
1099024dc505
(mode_create_from_ref): Add prototype.
Jim Meyering <jim@meyering.net>
parents:
762
diff
changeset
|
55 #endif |
610 | 56 |
57 struct mode_change *mode_compile __P ((const char *, unsigned)); | |
971
1099024dc505
(mode_create_from_ref): Add prototype.
Jim Meyering <jim@meyering.net>
parents:
762
diff
changeset
|
58 struct mode_change *mode_create_from_ref __P ((const char *)); |
610 | 59 unsigned short mode_adjust __P ((unsigned, const struct mode_change *)); |
60 void mode_free __P ((struct mode_change *)); |