diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2014-07-26 09:33:58 +0200 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-04-04 16:11:30 -0700 |
commit | fa6dfc688c293fa02c36ee89ac5611fd5e0131a5 (patch) | |
tree | 4563256e31c3402472f41491ba316150a984ea66 | |
parent | 9da68205689f5a1c7c15043f3b6c0dac341cb147 (diff) | |
download | pango-fa6dfc688c293fa02c36ee89ac5611fd5e0131a5.tar.gz |
[modules] Kill pango-querymodules
It serves no purpose now.
-rw-r--r-- | configure.ac | 31 | ||||
-rw-r--r-- | docs/Makefile.am | 23 | ||||
-rw-r--r-- | docs/pango-docs.sgml | 5 | ||||
-rw-r--r-- | docs/pango-querymodules.xml | 131 | ||||
-rwxr-xr-x | pango-zip.sh.in | 1 | ||||
-rw-r--r-- | pango/Makefile.am | 18 | ||||
-rw-r--r-- | pango/querymodules.c | 323 |
7 files changed, 4 insertions, 528 deletions
diff --git a/configure.ac b/configure.ac index 87f1f3e1..bc91395a 100644 --- a/configure.ac +++ b/configure.ac @@ -443,10 +443,7 @@ AM_CONDITIONAL(HAVE_CAIRO_QUARTZ, $have_cairo_quartz) # -# We must have some backend defined, in order for the pango-querymodules -# rule in pango/Makefile.am to work correctly. If you are up to writing -# a new Pango backend outside of Pango, you are up to sending the necessary -# patch to fix that rule. :-) +# We must have some backend defined # if $have_freetype || `test "x$with_xft" = xyes && $have_xft` || $have_cairo || $have_win32 ; then : ; else AC_MSG_ERROR([*** Could not enable any backends. @@ -545,32 +542,6 @@ fi GTK_DOC_CHECK([1.15], [--flavour no-tmpl]) -AC_ARG_ENABLE(man, - AC_HELP_STRING([--enable-man], - [regenerate man pages from Docbook @<:@default=no@:>@]), - enable_man=yes, - enable_man=no) - -if test "x$enable_man" != xno ; then - dnl - dnl Check for xsltproc - dnl - AC_PATH_PROG([XSLTPROC], [xsltproc]) - if test -z "$XSLTPROC"; then - enable_man=no - fi -fi - -if test "x$enable_man" != xno ; then - dnl check for DocBook DTD and stylesheets in the local catalog. - JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN], - [DocBook XML DTD V4.1.2],,enable_man=no) - JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl], - [DocBook XSL Stylesheets],,enable_man=no) -fi - -AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno) - AC_ARG_ENABLE(doc-cross-references, AC_HELP_STRING([--disable-doc-cross-references], [cross reference glib and cairo symbols @<:@default=yes@:>@]), diff --git a/docs/Makefile.am b/docs/Makefile.am index 89be228f..19124137 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -85,8 +85,7 @@ GTKDOC_LIBS += $(GLIB_LIBS) # Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE) content_files = \ pango_markup.sgml \ - version.xml \ - pango-querymodules.xml + version.xml # Images to copy into HTML directory HTML_IMAGES = \ @@ -116,29 +115,13 @@ BUILT_SOURCES = pango.types ######################################################################## -man_MANS = pango-querymodules.1 -if ENABLE_MAN -.xml.1: - @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< -dist-local-check-mans-enabled: - @if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi -else -$(man_MANS): - @echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. - @echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild Pango > $@ -dist-local-check-mans-enabled: - @echo "*** --enable-man must be used in order to make dist" - @false -endif - -MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) +MAINTAINERCLEANFILES = $(BUILT_SOURCES) EXTRA_DIST += \ layout.fig \ layout.eps \ version.xml.in \ check.docs \ - pango.types \ - $(man_MANS) + pango.types # force doc rebulid after configure dist-hook-local: dist-local-check-mans-enabled dist-local-check-no-cross-references all-local diff --git a/docs/pango-docs.sgml b/docs/pango-docs.sgml index 65514ab2..c5e3bb89 100644 --- a/docs/pango-docs.sgml +++ b/docs/pango-docs.sgml @@ -50,11 +50,6 @@ <xi:include href="xml/pango-version.xml"/> </chapter> - <chapter id="tools"> - <title>Pango Tools</title> - <xi:include href="pango-querymodules.xml"/> - </chapter> - <chapter id="pango-hierarchy"> <title>Object Hierarchy</title> <xi:include href="xml/tree_index.sgml"/> diff --git a/docs/pango-querymodules.xml b/docs/pango-querymodules.xml deleted file mode 100644 index 09c3209f..00000000 --- a/docs/pango-querymodules.xml +++ /dev/null @@ -1,131 +0,0 @@ -<refentry id="pango-querymodules"> - -<refentryinfo> -<title>pango-querymodules</title> -<productname>Pango</productname> -<authorgroup> -<author> -<contrib>Developer</contrib> -<firstname>Owen</firstname> -<surname>Taylor</surname> -</author> -<author> -<contrib>Developer</contrib> -<firstname>Behdad</firstname> -<surname>Esfahbod</surname> -</author> -</authorgroup> -</refentryinfo> - -<refmeta> -<refentrytitle>pango-querymodules</refentrytitle> -<manvolnum>1</manvolnum> -<refmiscinfo class="manual">User Commands</refmiscinfo> -</refmeta> - -<refnamediv> -<refname>pango-querymodules</refname> -<refpurpose>Module registration utility</refpurpose> -</refnamediv> - -<refsynopsisdiv> -<cmdsynopsis> -<command>pango-querymodules</command> -<arg choice="opt" rep="repeat">OPTION</arg> -<arg choice="opt" rep="repeat">MODULE</arg> -</cmdsynopsis> -</refsynopsisdiv> - -<refsect1 id="Description"><title>Description</title> -<para> -<command>pango-querymodules</command> collects information about loadable -modules for Pango and writes it to <filename>stdout</filename>. -</para> -<para> -If called without MODULE arguments, it looks for modules in the Pango -module path, which is specified by the key <literal>Pango/ModulesPath</literal> -in the Pango configuration database. -</para> -<para> -If called with MODULE arguments, it looks for the specified modules. The -arguments may be absolute or relative paths. -</para> -<para> -At runtime, Pango looks for the loadable module information (i.e. the output -of pango-querymodules) in <filename><replaceable>libdir</replaceable>/pango/1.8.0/modules.cache</filename>. -</para> -</refsect1> - -<refsect1><title>Options</title> -<variablelist> - -<varlistentry> -<term><option>-?</option>, <option>--help</option></term> -<listitem><para>Prints a short help text and exits.</para></listitem> -</varlistentry> - -<varlistentry> -<term><option>--version</option></term> -<listitem><para>Prints version information.</para></listitem> -</varlistentry> - -<varlistentry> -<term><option>--system</option></term> -<listitem><para>Do not load user-specific configuration.</para></listitem> -</varlistentry> - -<varlistentry> -<term><option>--update-cache</option></term> -<listitem><para>Update the Pango module cache file directly, -instead of writing the information to <filename>stdout</filename>.</para></listitem> -</varlistentry> - -</variablelist> - -</refsect1> - -<refsect1 id="Environment"><title>Environment</title> -<variablelist> - -<varlistentry> -<term><envar>PANGO_RC_FILE</envar></term> -<listitem><para>Specifies an additional rc file for the Pango configuration -database, in addition to the system-wide and per-user files.</para></listitem> -</varlistentry> - -</variablelist> - -</refsect1> - -<refsect1><title>Files</title> - -<variablelist> - -<varlistentry> -<term><filename><replaceable>sysconfdir</replaceable>/pango/pangorc</filename></term> -<listitem><para>System-wide Pango configuration file.</para></listitem> -</varlistentry> - -<varlistentry> -<term><filename><envar>$XDG_CONFIG_HOME</envar>/pango/pangorc</filename></term> -<listitem><para>User-specific Pango configuration file.</para></listitem> -</varlistentry> - -<varlistentry> -<term><filename><replaceable>libdir</replaceable>/pango/1.8.0/modules.cache</filename></term> -<listitem><para>Location of the module cache file read by Pango.</para></listitem> -</varlistentry> - -</variablelist> - -</refsect1> - -<refsect1 id="Bugs"><title>Bugs</title> -<para> -None known yet. -</para> -</refsect1> - -</refentry> - - diff --git a/pango-zip.sh.in b/pango-zip.sh.in index d3d965b9..d1ac2f19 100755 --- a/pango-zip.sh.in +++ b/pango-zip.sh.in @@ -14,7 +14,6 @@ cp -p @abs_srcdir@/COPYING share/doc/pango-dev-@PANGO_VERSION@ rm $ZIP zip $ZIP -@ <<EOF -bin/pango-querymodules.exe bin/libpango-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll bin/libpangoft2-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll bin/libpangowin32-@PANGO_API_VERSION@-@PANGO_CURRENT_MINUS_AGE@.dll diff --git a/pango/Makefile.am b/pango/Makefile.am index 378500ff..61b91502 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -424,24 +424,6 @@ typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) endif # HAVE_INTROSPECTION -# ------------------- pango-querymodules ------------------- - -bin_PROGRAMS = pango-querymodules - -pango_querymodules_SOURCES = \ - querymodules.c - -pango_querymodules_LDADD = -if HAVE_XFT -pango_querymodules_LDADD += libpangoxft-$(PANGO_API_VERSION).la -endif -if HAVE_FREETYPE -pango_querymodules_LDADD += libpangoft2-$(PANGO_API_VERSION).la -endif -if HAVE_WIN32 -pango_querymodules_LDADD += libpangowin32-$(PANGO_API_VERSION).la -endif -pango_querymodules_LDADD += libpango-$(PANGO_API_VERSION).la $(GLIB_LIBS) EXTRA_DIST = \ pango-enum-types.h \ diff --git a/pango/querymodules.c b/pango/querymodules.c deleted file mode 100644 index 0c86811e..00000000 --- a/pango/querymodules.c +++ /dev/null @@ -1,323 +0,0 @@ -/* Pango - * querymodules.c: - * - * Copyright (C) 1999 Red Hat Software - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include <stdlib.h> -#include "config.h" - -#include <glib.h> -#include <gmodule.h> -#include "pango-break.h" -#include "pango-context.h" -#include "pango-impl-utils.h" -#include "pango-engine.h" -#include "pango-enum-types.h" - -#include <errno.h> -#include <string.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#include <glib/gprintf.h> - -#ifdef USE_LA_MODULES -#define SOEXT ".la" -#else -#define SOEXT ("." G_MODULE_SUFFIX) -#endif -#define SOEXT_LEN ((int) strlen (SOEXT)) - -static gboolean system_mode; /* MT-safe as we're single-threaded! */ - -static gboolean -string_needs_escape (const char *str) -{ - while (TRUE) - { - char c = *str++; - - if (!c) - return FALSE; - else if (c == '\"' || c == '\\' || g_ascii_isspace (c)) - return TRUE; - } -} - -static char * -escape_string (const char *str) -{ - GString *result = g_string_new (NULL); - - while (TRUE) - { - char c = *str++; - - switch (c) - { - case '\0': - goto done; - case '\n': - g_string_append (result, "\\n"); - break; - case '\"': - g_string_append (result, "\\\""); - break; - case '\\': - g_string_append (result, "\\\\"); - break; - default: - g_string_append_c (result, c); - } - } - - done: - return g_string_free (result, FALSE); -} - -#define GET_SYMBOL(module,name,location) \ - g_module_symbol (module, name, (gpointer *)(void *)&location) - -static const char * -string_from_script (PangoScript script) -{ - static GEnumClass *class = NULL; /* MT-safe as we're single-threaded! */ - GEnumValue *value; - if (!class) - class = g_type_class_ref (PANGO_TYPE_SCRIPT); - - value = g_enum_get_value (class, script); - if (!value) - { - g_warning ("Engine reported invalid script value %d\n", script); - return string_from_script (PANGO_SCRIPT_INVALID_CODE); - } - - return value->value_nick; -} - -static void -query_module (const char *dir, const char *name, GString *contents) -{ - void (*list) (PangoEngineInfo **engines, gint *n_engines); - void (*init) (GTypeModule *module); - void (*exit) (void); - PangoEngine *(*create) (const gchar *id); - - GModule *module; - gchar *path; - - if (g_path_is_absolute (name)) - path = g_strdup (name); - else - path = g_build_filename (dir, name, NULL); - - module = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); - - if (!module) - g_printerr ("Cannot load module %s: %s\n", path, g_module_error ()); - - if (module && - GET_SYMBOL (module, "script_engine_list", list) && - GET_SYMBOL (module, "script_engine_init", init) && - GET_SYMBOL (module, "script_engine_exit", exit) && - GET_SYMBOL (module, "script_engine_create", create)) - { - gint i,j; - PangoEngineInfo *engines; - gint n_engines; - - (*list) (&engines, &n_engines); - - for (i=0; i<n_engines; i++) - { - const gchar *quote; - gchar *quoted_path; - - if (string_needs_escape (path)) - { - quote = "\""; - quoted_path = escape_string (path); - } - else - { - quote = ""; - quoted_path = g_strdup (path); - } - - g_string_append_printf (contents, - "%s%s%s %s %s %s", - quote, quoted_path, quote, - engines[i].id, engines[i].engine_type, - engines[i].render_type); - g_free (quoted_path); - - for (j=0; j < engines[i].n_scripts; j++) - { - g_string_append_printf (contents, - " %s:%s", - string_from_script (engines[i].scripts[j].script), - engines[i].scripts[j].langs); - } - g_string_append_c (contents, '\n'); - } - } - else - { - g_printerr ("%s does not export Pango module API\n", path); - } - - g_free (path); - if (module) - g_module_close (module); -} - -static G_GNUC_NORETURN gboolean -show_version(const char *name G_GNUC_UNUSED, - const char *arg G_GNUC_UNUSED, - gpointer data G_GNUC_UNUSED, - GError **error G_GNUC_UNUSED) -{ - g_printf("pango-querymodules (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION); - g_printf("module interface version: %s\n", MODULE_VERSION); - exit(0); -} - -int -main (int argc, char **argv) -{ - char *cwd; - int i; - char *path; - GOptionContext *context; - GError *parse_error = NULL; - gboolean update_cache = FALSE; - GString *contents; - GOptionEntry entries[] = - { - {"version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &show_version, - "Show version numbers", NULL}, - {"system", 0, 0, G_OPTION_ARG_NONE, &system_mode, - "Do not load configuration from home directory", NULL}, - {"update-cache", 0, 0, G_OPTION_ARG_NONE, &update_cache, - "Update the default cache file", NULL}, - {NULL} - }; - - context = g_option_context_new ("- [MODULE]..."); - g_option_context_add_main_entries (context, entries, NULL); - - if (!g_option_context_parse (context, &argc, &argv, &parse_error)) - { - if (parse_error != NULL) - { - g_printerr("Parse option error: %s\n", parse_error->message); - } - else - { - g_printerr("Parse option error\n"); - } - exit(1); - } - - g_option_context_free(context); - -#if !GLIB_CHECK_VERSION (2, 35, 3) - g_type_init (); -#endif - - contents = g_string_new (""); - g_string_append (contents, - "# Pango Modules file\n" - "# Automatically generated file, do not edit\n" - "#\n"); - - if (argc == 1) /* No arguments given */ - { - char **dirs; - int i; - - if (system_mode) - path = pango_config_key_get_system ("Pango/ModulesPath"); - else - path = pango_config_key_get ("Pango/ModulesPath"); - if (!path) - path = g_build_filename (pango_get_lib_subdirectory (), - MODULE_VERSION, - "modules", - NULL); - - g_string_append_printf (contents, "# ModulesPath = %s\n#\n", path); - - dirs = pango_split_file_list (path); - - g_free (path); - - for (i=0; dirs[i]; i++) - { - GDir *dir = g_dir_open (dirs[i], 0, NULL); - if (dir) - { - const char *dent; - - while ((dent = g_dir_read_name (dir))) - { - int len = strlen (dent); - if (len > SOEXT_LEN && strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) - query_module (dirs[i], dent, contents); - } - - g_dir_close (dir); - } - } - - g_strfreev (dirs); - } - else - { - cwd = g_get_current_dir (); - - for (i=1; i<argc; i++) - query_module (cwd, argv[i], contents); - - g_free (cwd); - } - - if (update_cache) - { - gchar *cache_file; - GError *err; - - cache_file = g_build_filename (pango_get_lib_subdirectory (), - MODULE_VERSION, - "modules.cache", - NULL); - err = NULL; - if (!g_file_set_contents (cache_file, contents->str, -1, &err)) - { - g_fprintf (stderr, "%s\n", err->message); - exit(1); - } - g_free (cache_file); - } - else - g_print ("%s\n", contents->str); - - return 0; -} |