xref: /titanic_41/usr/src/cmd/sendmail/include/sm/path.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * Copyright (c) 2000-2001 Sendmail, 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.6 2001/04/03 01:53:00 gshapiro Exp $
10  */
11 
12 #pragma ident	"%Z%%M%	%I%	%E% SMI"
13 
14 /*
15 **  Portable names for standard filesystem paths
16 **  and macros for directories.
17 */
18 
19 #ifndef SM_PATH_H
20 # define SM_PATH_H
21 
22 # include <sm/gen.h>
23 
24 #  define SM_PATH_DEVNULL	"/dev/null"
25 #  define SM_IS_DIR_DELIM(c)	((c) == '/')
26 #  define SM_FIRST_DIR_DELIM(s)	strchr(s, '/')
27 #  define SM_LAST_DIR_DELIM(s)	strrchr(s, '/')
28 
29 /* Warning: this must be accessible as array */
30 #  define SM_IS_DIR_START(s)	((s)[0] == '/')
31 
32 #  define sm_path_isdevnull(path)	(strcmp(path, "/dev/null") == 0)
33 
34 #endif /* ! SM_PATH_H */
35