]> git.lyx.org Git - lyx.git/blob - development/Win32/aspell/dirent.h
Scons: libintl also needs /MD option
[lyx.git] / development / Win32 / aspell / dirent.h
1 /* This file is part of the KDE project
2    Copyright (C) 2000 Werner Almesberger
3
4    libc/sys/linux/sys/dirent.h - Directory entry as returned by readdir
5
6    This program is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Library General Public
8    License as published by the Free Software Foundation; either
9    version 2 of the License, or (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Library General Public License for more details.
15
16    You should have received a copy of the GNU Library General Public License
17    along with this program; see the file COPYING.  If not, write to
18    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19    Boston, MA 02110-1301, USA.
20 */
21
22 #ifndef KDEWIN_SYS_DIRENT_H
23 #define KDEWIN_SYS_DIRENT_H
24
25 // include everywhere
26 #include <sys/types.h>
27
28 #include <io.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31
32 //#include <sys/lock.h>
33
34 #  define F_OK 0 //does the file exist?
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #define HAVE_NO_D_NAMLEN        /* no struct dirent->d_namlen */
41 #define HAVE_DD_LOCK            /* have locking mechanism */
42
43 #define MAXNAMLEN 255           /* sizeof(struct dirent.d_name)-1 */
44
45 #define __dirfd(dir) (dir)->dd_fd
46
47 /* struct dirent - same as Unix */
48 struct dirent {
49     long d_ino;                    /* inode (always 1 in WIN32) */
50     off_t d_off;                /* offset to this dirent */
51     unsigned short d_reclen;    /* length of d_name */
52     char d_name[_MAX_FNAME+1];    /* filename (null terminated) */
53 };
54
55 /* typedef DIR - not the same as Unix */
56 typedef struct {
57     long handle;                /* _findfirst/_findnext handle */
58     short offset;                /* offset into directory */
59     short finished;             /* 1 if there are not more files */
60     struct _finddata_t fileinfo;  /* from _findfirst/_findnext */
61     char *dir;                  /* the dir we are reading */
62     struct dirent dent;         /* the dirent to return */
63 } DIR;
64
65 /* --- redundant --- */
66
67 //DIR *opendir(const char *);
68 //struct dirent *readdir(DIR *);
69 //void rewinddir(DIR *);
70 //int closedir(DIR *);
71
72 /* internal prototype */
73 void _seekdir(DIR *dir,off_t offset);
74
75 //#ifndef _POSIX_SOURCE
76 //long telldir (DIR *);
77 //void seekdir (DIR *, off_t loc);
78
79 #define KDEWIN32_EXPORT 
80
81 KDEWIN32_EXPORT int scandir (const char *__dir,
82              struct dirent ***__namelist,
83              int (*select) (const struct dirent *),
84              int (*compar) (const struct dirent **, const struct dirent **));
85
86 KDEWIN32_EXPORT DIR * opendir(const char *);
87 KDEWIN32_EXPORT int closedir(DIR *);
88 KDEWIN32_EXPORT struct dirent* readdir(DIR *);
89 KDEWIN32_EXPORT struct dirent* readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
90
91 int alphasort (const struct dirent **__a, const struct dirent **__b);
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif  // KDEWIN_SYS_DIRENT_H