/* Generic dirent.h */1/* $OpenLDAP$ */2/* This work is part of OpenLDAP Software <http://www.openldap.org/>.3*4* Copyright 1998-2024 The OpenLDAP Foundation.5* All rights reserved.6*7* Redistribution and use in source and binary forms, with or without8* modification, are permitted only as authorized by the OpenLDAP9* Public License.10*11* A copy of this license is available in file LICENSE in the12* top-level directory of the distribution or, alternatively, at13* <http://www.OpenLDAP.org/license.html>.14*/1516#ifndef _AC_DIRENT_H17#define _AC_DIRENT_H1819#ifdef HAVE_DIRENT_H20# include <dirent.h>21# define NAMLEN(dirent) strlen((dirent)->d_name)22#elif defined(_MSC_VER)23#include <windows.h>24#ifndef MAX_PATH25#define MAX_PATH 26026#endif27struct dirent {28char *d_name;29};30typedef struct DIR {31HANDLE dir;32struct dirent data;33int first;34char buf[MAX_PATH+1];35} DIR;36DIR *opendir(const char *name);37struct dirent *readdir(DIR *dir);38int closedir(DIR *dir);39#else40# define dirent direct41# define NAMLEN(dirent) (dirent)->d_namlen42# ifdef HAVE_SYS_NDIR_H43# include <sys/ndir.h>44# endif45# ifdef HAVE_SYS_DIR_H46# include <sys/dir.h>47# endif48# ifdef HAVE_NDIR_H49# include <ndir.h>50# endif51#endif5253#endif /* _AC_DIRENT_H */545556