summaryrefslogtreecommitdiff
path: root/gtk/queryimmodules.c
diff options
context:
space:
mode:
authorHans Breuer <hans@breuer.org>2001-11-18 15:37:13 +0000
committerHans Breuer <hans@src.gnome.org>2001-11-18 15:37:13 +0000
commitd9eb9ba9d6b1967c8243aecbd043cebe52198819 (patch)
tree9c1d2439f9cdc7867831afef13162db5282cbcbe /gtk/queryimmodules.c
parentcdc4f6a476940f20d5989c61016a15e13995bd15 (diff)
downloadgdk-pixbuf-d9eb9ba9d6b1967c8243aecbd043cebe52198819.tar.gz
make it compile with msvc: !HAVE_UNISTD_H; no label without op, even if
2001-11-18 Hans Breuer <hans@breuer.org> * gtk/gdkaccelmap.c : make it compile with msvc: !HAVE_UNISTD_H; no label without op, even if it's a no-op. * gtk/gtk.def : * gtk/makefile.msc.in : reflect marshaler split, some clean-up * config.h.win32.in : remove definition of HAVE_DIRENT_H * gtk/gtkfilesel.c : due to GDir (new in glib) DIR isn't required anymore, replace it. * gtk/queryimmodules.c : DIR -> GDir replacement, also getcwd() -> g_get_current_dir() * gdk/win32/gdkgeometry-win32.c : adapt to refactored gdkgeometry-x11.c Even 'noisy laugh' scolling appears to work, though I still can't claim to have fully understood what it is supposed to do ...
Diffstat (limited to 'gtk/queryimmodules.c')
-rw-r--r--gtk/queryimmodules.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/gtk/queryimmodules.c b/gtk/queryimmodules.c
index d60b3661e..aa45cf958 100644
--- a/gtk/queryimmodules.c
+++ b/gtk/queryimmodules.c
@@ -22,9 +22,6 @@
#include "config.h"
#include <glib.h>
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
#include <gmodule.h>
#include <errno.h>
@@ -120,7 +117,7 @@ query_module (const char *dir, const char *name)
int main (int argc, char **argv)
{
- char cwd[PATH_MAX];
+ char *cwd;
int i;
char *path;
gboolean error = FALSE;
@@ -142,28 +139,30 @@ int main (int argc, char **argv)
for (i=0; dirs[i]; i++)
{
- DIR *dir = opendir (dirs[i]);
+ GDir *dir = g_dir_open (dirs[i], 0, NULL);
if (dir)
{
- struct dirent *dent;
+ char *dent;
- while ((dent = readdir (dir)))
+ while ((dent = g_dir_read_name (dir)))
{
- int len = strlen (dent->d_name);
- if (len > 3 && strcmp (dent->d_name + len - strlen (SOEXT), SOEXT) == 0)
- error |= query_module (dirs[i], dent->d_name);
+ int len = strlen (dent);
+ if (len > 3 && strcmp (dent + len - strlen (SOEXT), SOEXT) == 0)
+ error |= query_module (dirs[i], dent);
}
- closedir (dir);
+ g_dir_close (dir);
}
}
}
else
{
- getcwd (cwd, PATH_MAX);
+ cwd = g_get_current_dir ();
for (i=1; i<argc; i++)
error |= query_module (cwd, argv[i]);
+
+ g_free (cwd);
}
return error ? 1 : 0;