Tizen 2.0 Release
[external/tizen-coreutils.git] / lib / root-dev-ino.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Root device and inode number checking.
4
5    Copyright (C) 2003, 2006 Free Software Foundation, Inc.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2, or (at your option)
10    any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software Foundation,
19    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21 #ifndef ROOT_DEV_INO_H
22 # define ROOT_DEV_INO_H 1
23
24 # include "dev-ino.h"
25 # include "same-inode.h"
26
27 struct dev_ino *
28 get_root_dev_ino (struct dev_ino *root_d_i);
29
30 /* These macros are common to the programs that support the
31    --preserve-root and --no-preserve-root options.  */
32
33 # define ROOT_DEV_INO_CHECK(Root_dev_ino, Dir_statbuf) \
34     (Root_dev_ino && SAME_INODE (*Dir_statbuf, *Root_dev_ino))
35
36 # define ROOT_DEV_INO_WARN(Dirname)                                     \
37   do                                                                    \
38     {                                                                   \
39       if (STREQ (Dirname, "/"))                                         \
40         error (0, 0, _("it is dangerous to operate recursively on %s"), \
41                quote (Dirname));                                        \
42       else                                                              \
43         error (0, 0,                                                    \
44                _("it is dangerous to operate recursively on %s (same as %s)"), \
45                quote_n (0, Dirname), quote_n (1, "/"));                 \
46       error (0, 0, _("use --no-preserve-root to override this failsafe")); \
47     }                                                                   \
48   while (0)
49
50 #endif