Ports -> pkgsrc
[dragonfly.git] / gnu / lib / libdialog / dir.h
1 /*
2  * include file for dir.c
3  *
4  * Copyright (c) 1995, Marc van Kempen
5  *
6  * All rights reserved.
7  *
8  * This software may be used, modified, copied, distributed, and
9  * sold, in both source and binary form provided that the above
10  * copyright and these terms are retained, verbatim, as the first
11  * lines of this file.  Under no circumstances is the author
12  * responsible for the proper functioning of this software, nor does
13  * the author assume any responsibility for damages incurred with
14  * its use.
15  *
16  * $DragonFly: src/gnu/lib/libdialog/dir.h,v 1.2 2005/08/08 13:38:49 joerg Exp $
17  */
18
19 #include <sys/types.h>
20 #include <sys/stat.h>
21 #include <limits.h>
22
23 typedef struct DirList {             /* structure to hold the directory entries */
24     char        filename[NAME_MAX]; /* together with the stat-info per file */
25     struct stat filestatus;          /* filename, or the name to which it points */
26     int         link;                /* is it a link ? */
27     char        *linkname;           /* the name of the file the link points to */
28 } DirList;
29
30 #ifndef TRUE
31 #define TRUE (1)
32 #endif
33 #ifndef FALSE
34 #define FALSE (0)
35 #endif
36
37 void get_dir(char *dirname, char *fmask, DirList **dir, int *n);
38 void get_filenames(DirList *d, int n, char ***names, int *nf);
39 void FreeDir(DirList *d, int n);