diff options
author | Tor Lillqvist <tml@iki.fi> | 2000-07-15 01:06:08 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2000-07-15 01:06:08 +0000 |
commit | 932fe1e3da39b3d8febfca65f6ca5312f0397ed1 (patch) | |
tree | d5583d408b5af1a4ed899a78937fc76ed46c442d /pango/querymodules.c | |
parent | d4fb416c99d0066aafed26306a421a7bd22289e3 (diff) | |
download | pango-932fe1e3da39b3d8febfca65f6ca5312f0397ed1.tar.gz |
pango/pangowin32.h pango/pangowin32-private.h pango/pangowin32-fontcache.c
2000-07-15 Tor Lillqvist <tml@iki.fi>
* pango/pangowin32.h
* pango/pangowin32-private.h
* pango/pangowin32-fontcache.c
* pango/pangowin32-fontmap.c
* modules/basic/basic-win32.c
* examples/viewer-win32.c
* examples/pangowin32.aliases: New files. Start of a Win32
implementation. Does not work yet.
* configure.in: Chek for dirent.h and unistd.h.
* pango/pango-utils.h
* pango/pango-utils.c (pango_get_sysconf_subdirectory,
pango_get_lib_subdirectory): New functions, for better
portability, to enable installation-time choice of directory (on
Windows) instead of compile-time. Use these instead of SYSCONFDIR
"/pango" and LIBDIR "/pango".
(pango_split_file_list): Fix comment, the function splits on
searchpath separators, not commas. Use G_SEARCHPATH_SEPARATOR_S
for portability. Don't try to expand '~' as home directory on
Windows.
(read_config): Use pango_get_sysconf_subdirectory().
* pango/modules.c (read_modules): Use pango_get_sysconf_subdirectory().
Don't crash if a module file cannot be opened.
* pango/querymodules.c: Include config.h Conditionalize inclusion
of dirent.h and unistd.h. Use platform-specific shared library
extension. Use pango_get_lib_subdirectory().
Diffstat (limited to 'pango/querymodules.c')
-rw-r--r-- | pango/querymodules.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pango/querymodules.c b/pango/querymodules.c index 051b41d7..6d8b3210 100644 --- a/pango/querymodules.c +++ b/pango/querymodules.c @@ -19,17 +19,29 @@ * Boston, MA 02111-1307, USA. */ +#include "config.h" + #include <glib.h> +#ifdef HAVE_DIRENT_H #include <dirent.h> +#endif #include <gmodule.h> #include "pango.h" #include "pango-utils.h" #include <errno.h> #include <string.h> +#ifdef HAVE_UNISTD_H #include <unistd.h> +#endif #include <stdio.h> +#ifdef G_OS_WIN32 +#define SOEXT ".dll" +#else +#define SOEXT ".so" +#endif + void query_module (const char *dir, const char *name) { @@ -102,7 +114,9 @@ int main (int argc, char **argv) path = pango_config_key_get ("Pango/ModulesPath"); if (!path) - path = g_strdup (LIBDIR "/pango/modules"); + path = g_strconcat (pango_get_lib_subdirectory (), + G_DIR_SEPARATOR_S "modules", + NULL); printf ("# ModulesPath = %s\n#\n", path); @@ -118,7 +132,7 @@ int main (int argc, char **argv) while ((dent = readdir (dir))) { int len = strlen (dent->d_name); - if (len > 3 && strcmp (dent->d_name + len - 3, ".so") == 0) + if (len > 3 && strcmp (dent->d_name + len - strlen (SOEXT), SOEXT) == 0) query_module (dirs[i], dent->d_name); } |