summaryrefslogtreecommitdiffstats
path: root/win/dirent.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch)
tree5ac38a06f3dde268dc7927dc155896926aaf7012 /win/dirent.h
downloadtdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz
tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'win/dirent.h')
-rw-r--r--win/dirent.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/win/dirent.h b/win/dirent.h
new file mode 100644
index 000000000..2a4edf4c8
--- /dev/null
+++ b/win/dirent.h
@@ -0,0 +1,93 @@
+/* This file is part of the KDE project
+ Copyright (C) 2000 Werner Almesberger
+
+ libc/sys/linux/sys/dirent.h - Directory entry as returned by readdir
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef _SYS_DIRENT_H
+#define _SYS_DIRENT_H
+
+#include <kdecore/kdelibs_export.h>
+
+#include <sys/types.h>
+#include <io.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <sys/lock.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define HAVE_NO_D_NAMLEN /* no struct dirent->d_namlen */
+#define HAVE_DD_LOCK /* have locking mechanism */
+
+#define MAXNAMLEN 255 /* sizeof(struct dirent.d_name)-1 */
+
+#define __dirfd(dir) (dir)->dd_fd
+
+/* struct dirent - same as Unix */
+struct dirent {
+ long d_ino; /* inode (always 1 in WIN32) */
+ off_t d_off; /* offset to this dirent */
+ unsigned short d_reclen; /* length of d_name */
+ char d_name[_MAX_FNAME+1]; /* filename (null terminated) */
+};
+
+/* typedef DIR - not the same as Unix */
+typedef struct {
+ long handle; /* _findfirst/_findnext handle */
+ short offset; /* offset into directory */
+ short finished; /* 1 if there are not more files */
+ struct _finddata_t fileinfo; /* from _findfirst/_findnext */
+ char *dir; /* the dir we are reading */
+ struct dirent dent; /* the dirent to return */
+} DIR;
+
+/* --- redundant --- */
+
+//DIR *opendir(const char *);
+//struct dirent *readdir(DIR *);
+//void rewinddir(DIR *);
+//int closedir(DIR *);
+
+/* internal prototype */
+void _seekdir(DIR *dir,off_t offset);
+
+//#ifndef _POSIX_SOURCE
+//long telldir (DIR *);
+//void seekdir (DIR *, off_t loc);
+
+KDEWIN32_EXPORT int scandir (const char *__dir,
+ struct dirent ***__namelist,
+ int (*select) (const struct dirent *),
+ int (*compar) (const struct dirent **, const struct dirent **));
+
+KDEWIN32_EXPORT DIR * opendir(const char *);
+KDEWIN32_EXPORT int closedir(DIR *);
+KDEWIN32_EXPORT struct dirent* readdir(DIR *);
+KDEWIN32_EXPORT struct dirent* readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
+
+int alphasort (const struct dirent **__a, const struct dirent **__b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif