dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libast / i386 / include / ast / ast_dir.h
blobc873ed32532289385a8fa605cd93690a7d784060
2 /* : : generated by proto : : */
3 /***********************************************************************
4 * *
5 * This software is part of the ast package *
6 * Copyright (c) 1985-2010 AT&T Intellectual Property *
7 * and is licensed under the *
8 * Common Public License, Version 1.0 *
9 * by AT&T Intellectual Property *
10 * *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
14 * *
15 * Information and Software Systems Research *
16 * AT&T Research *
17 * Florham Park NJ *
18 * *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
22 * *
23 ***********************************************************************/
27 * AT&T Research
29 * common dirent maintenance interface
32 #ifndef _AST_DIR_H
33 #if !defined(__PROTO__)
34 #include <prototyped.h>
35 #endif
36 #if !defined(__LINKAGE__)
37 #define __LINKAGE__ /* 2004-08-11 transition */
38 #endif
40 #define _AST_DIR_H
42 #include <ast_lib.h>
44 #if _mem_d_fileno_dirent || _mem_d_ino_dirent
45 #if !_mem_d_fileno_dirent
46 #undef _mem_d_fileno_dirent
47 #define _mem_d_fileno_dirent 1
48 #define d_fileno d_ino
49 #endif
50 #endif
52 #if _BLD_ast
53 #include "dirlib.h"
54 #else
55 #include <dirent.h>
56 #endif
58 #if _mem_d_fileno_dirent
59 #define D_FILENO(d) ((d)->d_fileno)
60 #endif
62 #if _mem_d_namlen_dirent
63 #define D_NAMLEN(d) ((d)->d_namlen)
64 #else
65 #define D_NAMLEN(d) (strlen((d)->d_name))
66 #endif
68 #if _mem_d_reclen_dirent
69 #define D_RECLEN(d) ((d)->d_reclen)
70 #else
71 #define D_RECLEN(d) D_RECSIZ(d,D_NAMLEN(d))
72 #endif
74 #define D_RECSIZ(d,n) (sizeof(*(d))-sizeof((d)->d_name)+((n)+sizeof(char*))&~(sizeof(char*)-1))
77 * NOTE: 2003-03-27 mac osx bug symlink==DT_REG bug discovered;
78 * the kernel *and* all directories must be fixed, so d_type
79 * is summarily disabled until we see that happen
82 #if _mem_d_type_dirent && defined(DT_UNKNOWN) && defined(DT_REG) && defined(DT_DIR) && defined(DT_LNK) && ! ( __APPLE__ || __MACH__ )
83 #define D_TYPE(d) ((d)->d_type)
84 #endif
86 #endif