Catch size calculation overflow problem on Alphas running OSF/1.
[gnulib.git] / lib / mountlist.h
1 /* mountlist.h -- declarations for list of mounted filesystems
2
3    Copyright (C) 1991, 1992, 1998, 2000, 2001, 2002, 2003 Free
4    Software Foundation, Inc.
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2, or (at your option)
9    any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software Foundation,
18    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19
20 /* A mount table entry. */
21 struct mount_entry
22 {
23   char *me_devname;             /* Device node pathname, including "/dev/". */
24   char *me_mountdir;            /* Mount point directory pathname. */
25   char *me_type;                /* "nfs", "4.2", etc. */
26   dev_t me_dev;                 /* Device number of me_mountdir. */
27   unsigned int me_dummy : 1;    /* Nonzero for dummy filesystems. */
28   unsigned int me_remote : 1;   /* Nonzero for remote fileystems. */
29   unsigned int me_type_malloced : 1; /* Nonzero if me_type was malloced. */
30   struct mount_entry *me_next;
31 };
32
33 struct mount_entry *read_filesystem_list (int need_fs_type);
34
35 #ifndef ME_DUMMY
36 # define ME_DUMMY(Fs_name, Fs_type) \
37     (!strcmp (Fs_type, "autofs") \
38      /* for Irix 6.5 */ \
39      || !strcmp (Fs_type, "ignore"))
40 #endif
41
42 #undef STREQ
43 #define STREQ(a, b) (strcmp ((a), (b)) == 0)
44
45 #ifndef ME_REMOTE
46 /* A file system is `remote' if its Fs_name contains a `:'
47    or if (it is of type smbfs and its Fs_name starts with `//').  */
48 # define ME_REMOTE(Fs_name, Fs_type)    \
49     (strchr ((Fs_name), ':') != 0       \
50      || ((Fs_name)[0] == '/'            \
51          && (Fs_name)[1] == '/'         \
52          && STREQ (Fs_type, "smbfs")))
53 #endif