Define a public documented type for the struct stat used by g_stat()

Define GStatBuf as the type used by g_stat() and g_lstat(). Replaces
the non-public struct tag _g_stat_struct. Mostly relevant for Windows
where there are several variants of stat-style structs. On POSIX, is
just another name for struct stat.

Actually, also on many POSIX systems there are in fact several
variants of struct stat and corresponding stat() and lstat()
functions, but as g_stat and g_lstat are normally on POSIX just macros
that expand to stat and lstat, this should not cause a problem. It's
only when it's the actual g_stat() or g_lstat() implementation inside
GLib that gets called that one needs to be sure the passed struct is
the same as what GLib expects.)
This commit is contained in:
Tor Lillqvist
2010-03-21 20:04:18 +02:00
parent e7763678b5
commit 1229281d95
5 changed files with 42 additions and 64 deletions

View File

@@ -270,11 +270,7 @@ g_io_modules_scan_all_in_directory (const char *dirname)
const gchar *name;
char *filename;
GDir *dir;
#ifdef G_OS_WIN32
struct _g_stat_struct statbuf;
#else
struct stat statbuf;
#endif
GStatBuf statbuf;
char *data;
time_t cache_mtime;
GHashTable *cache;