source: trunk/coreutils/src/chown-core.h@ 2555

Last change on this file since 2555 was 2554, checked in by bird, 20 years ago

coretuils-5.94

File size: 2.2 KB
Line 
1/* chown-core.h -- types and prototypes shared by chown and chgrp.
2
3 Copyright (C) 2000, 2003, 2004 Free Software Foundation.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18
19#ifndef CHOWN_CORE_H
20# define CHOWN_CORE_H
21
22# include "dev-ino.h"
23
24enum Change_status
25{
26 CH_NOT_APPLIED = 1,
27 CH_SUCCEEDED,
28 CH_FAILED,
29 CH_NO_CHANGE_REQUESTED
30};
31
32enum Verbosity
33{
34 /* Print a message for each file that is processed. */
35 V_high,
36
37 /* Print a message for each file whose attributes we change. */
38 V_changes_only,
39
40 /* Do not be verbose. This is the default. */
41 V_off
42};
43
44struct Chown_option
45{
46 /* Level of verbosity. */
47 enum Verbosity verbosity;
48
49 /* If nonzero, change the ownership of directories recursively. */
50 bool recurse;
51
52 /* Pointer to the device and inode numbers of `/', when --recursive.
53 Need not be freed. Otherwise NULL. */
54 struct dev_ino *root_dev_ino;
55
56 /* This corresponds to the --dereference (opposite of -h) option. */
57 bool affect_symlink_referent;
58
59 /* If nonzero, force silence (no error messages). */
60 bool force_silent;
61
62 /* The name of the user to which ownership of the files is being given. */
63 char *user_name;
64
65 /* The name of the group to which ownership of the files is being given. */
66 char *group_name;
67};
68
69void
70chopt_init (struct Chown_option *);
71
72void
73chopt_free (struct Chown_option *);
74
75char *
76gid_to_name (gid_t);
77
78char *
79uid_to_name (uid_t);
80
81bool
82chown_files (char **files, int bit_flags,
83 uid_t uid, gid_t gid,
84 uid_t required_uid, gid_t required_gid,
85 struct Chown_option const *chopt);
86
87#endif /* CHOWN_CORE_H */
Note: See TracBrowser for help on using the repository browser.