comparison lib/mountlist.h @ 5632:f2a6ab91acad

* mountlist.h (MOUNTLIST_H_): New macro, to protect against double inclusion. Include <sys/types.h>, for dev_t. (ME_DUMMY, ME_REMOTE): Move from here.... * mountlist.c (ME_DUMMY, ME_REMOTE): To here. (ME_DUMMY): Count "subfs" as a dummy. Problem reported by Dmitry V. Levin. Include mountlist.h first, to test the interface.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 01 Feb 2005 23:56:46 +0000
parents a535859efd14
children a48fb0e98c8c
comparison
equal deleted inserted replaced
5631:c51bf3eed9e7 5632:f2a6ab91acad
1 /* mountlist.h -- declarations for list of mounted file systems 1 /* mountlist.h -- declarations for list of mounted file systems
2 2
3 Copyright (C) 1991, 1992, 1998, 2000, 2001, 2002, 2003, 2004 Free 3 Copyright (C) 1991, 1992, 1998, 2000, 2001, 2002, 2003, 2004, 2005
4 Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 5
6 This program is free software; you can redistribute it and/or modify 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 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) 8 the Free Software Foundation; either version 2, or (at your option)
9 any later version. 9 any later version.
15 15
16 You should have received a copy of the GNU General Public License 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, 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. */ 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
19 19
20 #ifndef MOUNTLIST_H_
21 #define MOUNTLIST_H_
22
20 #include <stdbool.h> 23 #include <stdbool.h>
24 #include <sys/types.h>
21 25
22 /* A mount table entry. */ 26 /* A mount table entry. */
23 struct mount_entry 27 struct mount_entry
24 { 28 {
25 char *me_devname; /* Device node pathname, including "/dev/". */ 29 char *me_devname; /* Device node pathname, including "/dev/". */
32 struct mount_entry *me_next; 36 struct mount_entry *me_next;
33 }; 37 };
34 38
35 struct mount_entry *read_file_system_list (bool need_fs_type); 39 struct mount_entry *read_file_system_list (bool need_fs_type);
36 40
37 #ifndef ME_DUMMY
38 # define ME_DUMMY(Fs_name, Fs_type) \
39 (!strcmp (Fs_type, "autofs") \
40 /* for Irix 6.5 */ \
41 || !strcmp (Fs_type, "ignore"))
42 #endif 41 #endif
43
44 #undef STREQ
45 #define STREQ(a, b) (strcmp ((a), (b)) == 0)
46
47 #ifndef ME_REMOTE
48 /* A file system is `remote' if its Fs_name contains a `:'
49 or if (it is of type smbfs and its Fs_name starts with `//'). */
50 # define ME_REMOTE(Fs_name, Fs_type) \
51 (strchr ((Fs_name), ':') != 0 \
52 || ((Fs_name)[0] == '/' \
53 && (Fs_name)[1] == '/' \
54 && STREQ (Fs_type, "smbfs")))
55 #endif