]> git.sur5r.net Git - openldap/blobdiff - include/ac/dirent.h
Add server side sorting
[openldap] / include / ac / dirent.h
index 08fd7e818665efaa1878bf25bf46c582b3561c93..d186510fdab5fe6d79c1e82b3cb480008316966a 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2008 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #ifndef _AC_DIRENT_H
 #define _AC_DIRENT_H
 
-#if HAVE_DIRENT_H
+#ifdef HAVE_DIRENT_H
 # include <dirent.h>
 # define NAMLEN(dirent) strlen((dirent)->d_name)
+#elif defined(_MSC_VER)
+#include <windows.h>
+#ifndef MAX_PATH
+#define MAX_PATH       260
+#endif
+struct dirent {
+       char *d_name;
+};
+typedef struct DIR {
+       HANDLE dir;
+       struct dirent data;
+       int first;
+       char buf[MAX_PATH+1];
+} DIR;
 #else
 # define dirent direct
 # define NAMLEN(dirent) (dirent)->d_namlen
-# if HAVE_SYS_NDIR_H
+# ifdef HAVE_SYS_NDIR_H
 #  include <sys/ndir.h>
 # endif
-# if HAVE_SYS_DIR_H
+# ifdef HAVE_SYS_DIR_H
 #  include <sys/dir.h>
 # endif
-# if HAVE_NDIR_H
+# ifdef HAVE_NDIR_H
 #  include <ndir.h>
 # endif
 #endif