summaryrefslogtreecommitdiff
path: root/mcon/U/d_scandir.U
diff options
context:
space:
mode:
Diffstat (limited to 'mcon/U/d_scandir.U')
-rw-r--r--mcon/U/d_scandir.U58
1 files changed, 58 insertions, 0 deletions
diff --git a/mcon/U/d_scandir.U b/mcon/U/d_scandir.U
new file mode 100644
index 0000000..4c2072d
--- /dev/null
+++ b/mcon/U/d_scandir.U
@@ -0,0 +1,58 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?RCS:
+?RCS: $Log: d_scandir.U,v $
+?RCS: Revision 3.0.1.1 1994/01/24 14:06:35 ram
+?RCS: patch16: created
+?RCS:
+?MAKE:d_scandir: Trylink cat i_dirent
+?MAKE: -pick add $@ %<
+?S:d_scandir:
+?S: This variable conditionally defines HAS_SCANDIR if scandir() is
+?S: available to scan a directory.
+?S:.
+?C:HAS_SCANDIR:
+?C: This symbol, if defined, indicates that the scandir routine is
+?C: available to scan a directory.
+?C:.
+?H:#$d_scandir HAS_SCANDIR /**/
+?H:.
+?LINT:set d_scandir
+: see if scandir exists
+$cat >try.c <<EOC
+#$i_dirent I_DIRENT
+#ifdef I_DIRENT
+#include <dirent.h>
+#endif
+int filter(const struct dirent *d)
+{
+ (void) d;
+ return 1;
+}
+
+int compare(const struct dirent **a, const struct dirent **b)
+{
+ (void) a;
+ (void) b;
+ return 1;
+}
+
+int main(void)
+{
+ static struct dirent **namelist;
+ static int ret;
+ ret |= scandir("dir", &namelist, filter, compare);
+ return ret ? 0 : 1;
+}
+EOC
+cyn=scandir
+set d_scandir
+eval $trylink
+