4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
23 /* All Rights Reserved */
26 #ident "%Z%%M% %I% %E% SMI" /* from SVR4 bnu:gnamef.c 2.6 */
31 * get next file name from directory
32 * p -> file description of directory file to read
33 * filename -> address of buffer to return filename in
34 * must be of size MAXBASENAME+1
36 * FALSE -> end of directory read
37 * TRUE -> returned name
41 register char *filename
;
45 register struct dirent
*dp
= &dentry
;
48 if ((dp
= readdir(p
)) == NULL
)
50 if (dp
->d_ino
!= 0 && dp
->d_name
[0] != '.')
54 (void) strncpy(filename
, dp
->d_name
, MAXBASENAME
);
55 filename
[MAXBASENAME
] = '\0';
60 * get next directory name from directory
61 * p -> file description of directory file to read
62 * filename -> address of buffer to return filename in
63 * must be of size MAXBASENAME+1
65 * FALSE -> end of directory read
66 * TRUE -> returned dir
69 gdirf(p
, filename
, dir
)
70 register char *filename
;
74 char statname
[MAXNAMESIZE
];
77 if(gnamef(p
, filename
) == FALSE
)
79 (void) sprintf(statname
, "%s/%s", dir
, filename
);
80 DEBUG(4, "stat %s\n", statname
);
81 if (DIRECTORY(statname
))