annotate platform/dirent.h @ 1853:4790589f52a9

Initial commit for new dw_signal_connect_data() function... Same as dw_signal_connect() but it has an additional callback parameter that gets called when the callback is being removed. This allows me to free memory allocated for the data parameter and prevent memory leaks in godwindows... Tested GTK and Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 27 Feb 2013 19:14:22 +0000
parents 71e0a3ad07f7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
179
6803aba19dae Don't include this file on unix.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 177
diff changeset
1 #ifdef __UNIX__
6803aba19dae Don't include this file on unix.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 177
diff changeset
2 #include <dirent.h>
6803aba19dae Don't include this file on unix.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 177
diff changeset
3 #else
24
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
4 #ifndef __DIRENT_H__
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
5 #define __DIRENT_H__
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
6
1594
6baf177f335c Rename compat.c/h dwcompat.c/h and configure option to --with-dwcompat.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1404
diff changeset
7 #include "dwcompat.h"
24
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
8 #include <stdio.h>
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
9 #ifdef MAXPATHLEN
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
10 #undef MAXPATHLEN
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
11 #endif
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
12 #define MAXPATHLEN (FILENAME_MAX*4)
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
13 #define MAXNAMLEN FILENAME_MAX
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
14
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
15 #ifdef __cplusplus
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
16 extern "C" {
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
17 #endif
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
18
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
19 /* attribute stuff */
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
20 #ifndef A_RONLY
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
21 # define A_RONLY 0x01
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
22 # define A_HIDDEN 0x02
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
23 # define A_SYSTEM 0x04
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
24 # define A_LABEL 0x08
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
25 # define A_DIR 0x10
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
26 # define A_ARCHIVE 0x20
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
27 #endif
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
28
1404
56f311dc23f6 Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 525
diff changeset
29 #ifdef __WATCOMC__
56f311dc23f6 Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 525
diff changeset
30 #undef DIR
56f311dc23f6 Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 525
diff changeset
31 #undef direct
56f311dc23f6 Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 525
diff changeset
32 #undef dirent
56f311dc23f6 Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 525
diff changeset
33 #define DIR DIRW
56f311dc23f6 Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 525
diff changeset
34 #endif
56f311dc23f6 Changes to get the library building with Watcom on OS/2.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 525
diff changeset
35
24
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
36 struct dirent {
1601
71e0a3ad07f7 Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1594
diff changeset
37 int d_ino; /* Dummy */
71e0a3ad07f7 Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1594
diff changeset
38 int d_reclen; /* Dummy, same as d_namlen */
71e0a3ad07f7 Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1594
diff changeset
39 int d_namlen; /* length of name */
71e0a3ad07f7 Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1594
diff changeset
40 char d_name[MAXNAMLEN + 1];
71e0a3ad07f7 Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1594
diff changeset
41 unsigned long long d_size;
71e0a3ad07f7 Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1594
diff changeset
42 unsigned long d_attribute; /* attributes (see above) */
71e0a3ad07f7 Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1594
diff changeset
43 unsigned short d_time; /* modification time */
71e0a3ad07f7 Enable level 3 warnings in DEBUG mode with Visual C to show deprecation warnings.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 1594
diff changeset
44 unsigned short d_date; /* modification date */
24
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
45 };
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
46
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
47 typedef struct _dirdescr DIR;
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
48 /* the structs do not have to be defined here */
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
49
525
2ff26b697877 Fixes for building with Innotek GCC. Will have to check for regressions
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 179
diff changeset
50 extern DIR * API _opendir(const char *);
174
75bf3051235f Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 24
diff changeset
51 #define opendir(a) _opendir(a)
525
2ff26b697877 Fixes for building with Innotek GCC. Will have to check for regressions
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 179
diff changeset
52 extern DIR *API _openxdir(const char *, unsigned);
174
75bf3051235f Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 24
diff changeset
53 #define openxdir(a, b) _openxdir(a, b)
525
2ff26b697877 Fixes for building with Innotek GCC. Will have to check for regressions
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 179
diff changeset
54 extern struct dirent * API _readdir(DIR *);
174
75bf3051235f Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 24
diff changeset
55 #define readdir(a) _readdir(a)
525
2ff26b697877 Fixes for building with Innotek GCC. Will have to check for regressions
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 179
diff changeset
56 extern void API _seekdir(DIR *, long);
174
75bf3051235f Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 24
diff changeset
57 #define seekdir(a, b) _seekdir(a, b)
525
2ff26b697877 Fixes for building with Innotek GCC. Will have to check for regressions
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 179
diff changeset
58 extern long API _telldir(DIR *);
174
75bf3051235f Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 24
diff changeset
59 #define telldir(a) _telldir(a)
525
2ff26b697877 Fixes for building with Innotek GCC. Will have to check for regressions
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 179
diff changeset
60 extern void API _closedir(DIR *);
174
75bf3051235f Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 24
diff changeset
61 #define closedir(a) _closedir(a)
24
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
62
174
75bf3051235f Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 24
diff changeset
63 #define rewinddir(dirp) _seekdir(dirp, 0L)
525
2ff26b697877 Fixes for building with Innotek GCC. Will have to check for regressions
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 179
diff changeset
64 extern char * API _abs_path(const char *name, char *buffer, int len);
174
75bf3051235f Fixes so you can mix compilers.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 24
diff changeset
65 #define abs_path(a, b, c) _abs_path(a, b, c)
24
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
66
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
67 #ifndef S_IFMT
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
68 #define S_IFMT ( S_IFDIR | S_IFREG )
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
69 #endif
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
70
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
71 #ifndef S_ISDIR
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
72 #define S_ISDIR( m ) (((m) & S_IFMT) == S_IFDIR)
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
73 #endif
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
74
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
75 #ifndef S_ISREG
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
76 #define S_ISREG( m ) (((m) & S_IFMT) == S_IFREG)
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
77 #endif
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
78
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
79 #ifdef __cplusplus
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
80 }
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
81 #endif
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
82
d9e87e8bcf1d Updated dynamic windows to build with EMX.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents:
diff changeset
83 #endif
179
6803aba19dae Don't include this file on unix.
bsmith@81767d24-ef19-dc11-ae90-00e081727c95
parents: 177
diff changeset
84 #endif