mountlist.h 1.9 KB

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