xref: /freebsd/contrib/sendmail/include/sm/path.h (revision 81ad6265)
1 /*
2  * Copyright (c) 2000-2001 Proofpoint, Inc. and its suppliers.
3  *	All rights reserved.
4  *
5  * By using this file, you agree to the terms and conditions set
6  * forth in the LICENSE file which can be found at the top level of
7  * the sendmail distribution.
8  *
9  *	$Id: path.h,v 1.7 2013-11-22 20:51:31 ca Exp $
10  */
11 
12 /*
13 **  Portable names for standard filesystem paths
14 **  and macros for directories.
15 */
16 
17 #ifndef SM_PATH_H
18 # define SM_PATH_H
19 
20 # include <sm/gen.h>
21 
22 #  define SM_PATH_DEVNULL	"/dev/null"
23 #  define SM_IS_DIR_DELIM(c)	((c) == '/')
24 #  define SM_FIRST_DIR_DELIM(s)	strchr(s, '/')
25 #  define SM_LAST_DIR_DELIM(s)	strrchr(s, '/')
26 
27 /* Warning: this must be accessible as array */
28 #  define SM_IS_DIR_START(s)	((s)[0] == '/')
29 
30 #  define sm_path_isdevnull(path)	(strcmp(path, "/dev/null") == 0)
31 
32 #endif /* ! SM_PATH_H */
33