diff --git a/ChangeLog b/ChangeLog index 5ad415b77..8e8fb2f2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2001-11-07 Darin Adler + + * acconfig.h: + * configure.in: + Switch to glib's gettext. + + * components/help/converters/*: + Remove, since these were moved to libgnome. + + * Many files: + Get rid of incorrect uses of many locale-specific functions like + g_strcasecmp and isspace. + 2001-11-07 Darin Adler * Makefile.am: diff --git a/acconfig.h b/acconfig.h index 1b1869bc5..830d7d25b 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,22 +1,20 @@ -#undef NAUTILUS_BUILD_MESSAGE -#undef NAUTILUS_SOURCE_DIRECTORY -#undef EAZEL_BUILD_TIMESTAMP +#undef ENABLE_INSTALLER #undef ENABLE_NLS #undef ENABLE_PROFILER -#undef ENABLE_INSTALLER +#undef GETTEXT_PACKAGE #undef HAVE_CATGETS #undef HAVE_GETTEXT #undef HAVE_LC_MESSAGES -#undef HAVE_MEDUSA -#undef HAVE_LIBJPEG -#undef HAVE_STPCPY #undef HAVE_LIBBZ2 #undef HAVE_LIBFAM +#undef HAVE_LIBJPEG +#undef HAVE_MEDUSA +#undef HAVE_STPCPY +#undef bzclose #undef bzCompress #undef bzCompressInit #undef bzDecompress #undef bzDecompressInit -#undef bzclose #undef bzdopen #undef bzerror #undef bzflush diff --git a/components/help/converters/.cvsignore b/components/help/converters/.cvsignore deleted file mode 100644 index 282522db0..000000000 --- a/components/help/converters/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/components/help/converters/ChangeLog b/components/help/converters/ChangeLog deleted file mode 100644 index 12ccf35e3..000000000 --- a/components/help/converters/ChangeLog +++ /dev/null @@ -1,116 +0,0 @@ -2001-10-24 Darin Adler - - reviewed by: - - * gnome-db2html2/Makefile.am: - * gnome-db2html3/Makefile.am: - * gnome-info2html2/Makefile.am: - -=== nautilus 1.0.5 === - -2001-09-21 Philip Langdale - - * components/help/converters/gnome-info2html2/html.c - * components/help/converters/gnome-info2html2/html.h - * components/help/converters/gnome-info2html2/main.c: Added optional - "galeon mode" invoked with -g command line param. This involves writing - fully qualified info: hrefs instead of just the #nodename target, - which appears to me to be a bug, but might have negative effects on - nautilus. It also uses ? queries instead of # refs when forming hrefs. - -2001-09-20 Darin Adler - - * gnome-db2html2/gdb3html.h: Change libxml includes to use - #include instead of #include . - -2001-09-15 Darin Adler - - * gnome-db2html2/sect-elements.c: - * gnome-db2html2/toc-elements.c: - Change bugzilla.eazel.com references to point to bugzilla.gnome.org. - -2001-08-26 Darin Adler - - * gnome-db2html2/Makefile.am: - * gnome-db2html3/Makefile.am: - * gnome-info2html2/Makefile.am: - * gnome-man2html2/Makefile.am: - Remove many unneeded -I directives. - -2001-08-25 Philip Langdale - - * gnome-info2html2/main.c: Duplicated INFOPATH before passing - to strtok to prevent actual env var getting corrupted. - -2001-08-21 Philip Langdale - - * gnome-info2html2/main.c: Fixed bug preventing INFOPATH being - parsed. - -Sat Jun 17 18:07:19 2000 George Lebl - - * gnome-info2html2/main.c (main): Use g_free on the node as it - has been allocated with g_malloc - - * gnome-man2html2/gnome-man2html.c (scan_format): Patch from gnome - bug number 3925. From the description: Briefly, gnome-man2html - doesn't notice when the format lines in table declarations end if - the last thing in the format specification is a font command. - -2000-04-05 Darin Adler - - * gnome-db2html2/gdb3html.c: Removed some unnecessary \n from g_errors. - -2000-03-09 Darin Adler - - * gnome-info2html2/main.c (main): Fixed a warning. - -2000-02-11 Jonathan Blandford - - * gnome-db2html2/toc-elements.c: removed TIP, NOTE, WARNING, and - GRAPHIC from the TOC - - * gnome-db2html2/TODO: added TODO - -2000-02-10 Jonathan Blandford - - * gnome-db2html2/sect-elements.c: added cdata support - -2000-02-09 Jonathan Blandford - - * gnome-db2html2/sect-elements.c: added many more fields. Now, we - just need tables, figures, and CDATA and we're pretty much done - with a rough cut. - -2000-02-08 Jonathan Blandford - - * gnome-db2html2/sect-elements.c: started program listing. - doubting SAX's strictness big time. - -2000-02-08 Elliot Lee - - * gnome-man2html2/gnome-man2html.c, gnome-man2html2/Makefile.am: - Make it look up a file location and use it, if just passed - something like 'ls.1' on the cmdline. Also use zlib to handle - compressed manpages. - -2000-02-07 John Sullivan - - * gnome-info2html2/.cvsignore: - * gnome-man2html2/.cvsignore: - Added some generated files to the ignore-me list. - -2000-02-07 Jonathan Blandford - - * gnome-db2html2/sect-elements.c: support Footnotes. Make much - more robust. General improvements. - -2000-02-03 Jonathan Blandford - - * gnome-db2html2/README: added README - - * gnome-db2html2/Makefile.am: Added new converter to list. Does - rough on-the-fly docbook to html conversion. Not perfect yet - (never will be) but good enough (tm) until we can get a better - solution for jade. - diff --git a/components/help/converters/Makefile.am b/components/help/converters/Makefile.am deleted file mode 100644 index 4c21c2aac..000000000 --- a/components/help/converters/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS=gnome-man2html2 gnome-info2html2 gnome-db2html2 gnome-db2html3 diff --git a/components/help/converters/gnome-db2html2/.cvsignore b/components/help/converters/gnome-db2html2/.cvsignore deleted file mode 100644 index da5622757..000000000 --- a/components/help/converters/gnome-db2html2/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile.in -Makefile -.deps -.libs -gnome-db2html2 diff --git a/components/help/converters/gnome-db2html2/ASSUMPTIONS b/components/help/converters/gnome-db2html2/ASSUMPTIONS deleted file mode 100644 index 92e4bb6f1..000000000 --- a/components/help/converters/gnome-db2html2/ASSUMPTIONS +++ /dev/null @@ -1,46 +0,0 @@ -This holds assumptions for the gnome-db2html2 - - - -These assumptions are requirements of docbook-xml. ---------------------------------------------- -CDATA must be in the form - is right - is wrong ---------------------------------------------- -all tags must be lowercase (this is an DocBook xml requirement, not -mine) ---------------------------------------------- - - - - -DOCBOOK doesn't care about these, but I do. ---------------------------------------------- -if you do: - - Quit - - Ctrl-q - - - -Instead of: - - - - Ctrl-q - - Quit - -The results are better. ---------------------------------------------- -each listitem has one para ---------------------------------------------- -each formalpara has one para ---------------------------------------------- diff --git a/components/help/converters/gnome-db2html2/AUTHORS b/components/help/converters/gnome-db2html2/AUTHORS deleted file mode 100644 index eb2fb58ee..000000000 --- a/components/help/converters/gnome-db2html2/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -Original author is: Jonathon Blandford (jrb@redhat.com) - -Current maintainer is: Ali Abdin (aliabdin@aucegypt.edu) - -Contributors: -John Fleck (jfleck@inkstain.net) diff --git a/components/help/converters/gnome-db2html2/Makefile.am b/components/help/converters/gnome-db2html2/Makefile.am deleted file mode 100644 index 9a27f7b75..000000000 --- a/components/help/converters/gnome-db2html2/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -## Process this file with automake to produce Makefile.in. - -INCLUDES = \ - -DGNOMELOCALEDIR=\""$(datadir)/locale"\" - -LDADD = - -bin_PROGRAMS = gnome-db2html2 - -gnome_db2html2_SOURCES = \ - gdb3html.c \ - gdb3html.h \ - sect-elements.c \ - sect-elements.h \ - sect-preparse.c \ - sect-preparse.h \ - toc-elements.c \ - toc-elements.h diff --git a/components/help/converters/gnome-db2html2/Makefile.doc b/components/help/converters/gnome-db2html2/Makefile.doc deleted file mode 100644 index 39340857f..000000000 --- a/components/help/converters/gnome-db2html2/Makefile.doc +++ /dev/null @@ -1,15 +0,0 @@ -CC=gcc -CFLAGS=`gnome-config gnomeui --cflags` -g -Wall `xml-config --cflags` -LIBS=`gnome-config gnomeui --libs` `xml-config --libs` - -OBJS= \ - gdb3html.o toc-elements.o sect-elements.o sect-preparse.o - -all: gnome-db2html2 - -clean: - rm -f *o gnome-db2html2 core - -gnome-db2html2: $(OBJS) - gcc -o gnome-db2html2 $(OBJS) $(LIBS) - diff --git a/components/help/converters/gnome-db2html2/README b/components/help/converters/gnome-db2html2/README deleted file mode 100644 index e2371ef80..000000000 --- a/components/help/converters/gnome-db2html2/README +++ /dev/null @@ -1,23 +0,0 @@ -This is a docbook->html converter. Yes, I know this isn't perfect, and yes, -I know it isn't jade. It is hopefully, however, fast enough that we can -only ship sgml files (as opposed to jade's output) in the short term, until -we can use Mozilla w/ the docbook xsl instead. - -For those doc people who want to play with this, and don't want -to configure nautilus, you can compile it with the following -command line: - -gcc -o gnome-db2html2 `xml-config --cflags --libs` `gnome-config --cflags --libs gnome` -Wall -g gdb3html.c toc-elements.c sect-elements.c sect-preparse.c - -You can run it by doing: - -gnome-db2html2 file.sgml > file.html - -If you want to look at a particular section, do: - -gnome-db2html2 "file.sgml?sectid" > sectid.html - -View in netscape/testgtkhtml as per normal. Note, internal links won't -work in any way, shape, or form. - - -Jonathan diff --git a/components/help/converters/gnome-db2html2/TODO b/components/help/converters/gnome-db2html2/TODO deleted file mode 100644 index 755f2d7e8..000000000 --- a/components/help/converters/gnome-db2html2/TODO +++ /dev/null @@ -1,8 +0,0 @@ -List of things I know I need to do: ------------------------------------ - -Store the id of the sect with the title of the graphic so that I can get -xref correctly. - -Switch to a DOM based parser (not possible until we switch to a DOM based -parser and/or we switch to libxml 2.2.x) diff --git a/components/help/converters/gnome-db2html2/gdb3html.c b/components/help/converters/gnome-db2html2/gdb3html.c deleted file mode 100644 index 7593b2462..000000000 --- a/components/help/converters/gnome-db2html2/gdb3html.c +++ /dev/null @@ -1,891 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "gdb3html.h" -#include "toc-elements.h" -#include "sect-elements.h" -#include "sect-preparse.h" -#include "gnome.h" - -#if 0 -#define ERROR_OUTPUT -#endif - -/* Generic Function. Used by toc_elements and sect_preparse */ - -void -glossentry_stack_add (Context *context, - const char *name, - const xmlChar **atrs) -{ - /* This function adds a glosssentry id to the context->glossentry_stack */ - char **atrs_ptr; - - atrs_ptr = (char **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (g_strcasecmp (*atrs_ptr, "id") == 0) { - atrs_ptr++; - context->glossentry_stack = - g_list_prepend (context->glossentry_stack, g_strdup (*atrs_ptr)); - break; - } - atrs_ptr += 2; - } -} - -void -sect1id_stack_add (Context *context, - const char *name, - const xmlChar **atrs) -{ - /* This function adds either a sect1id OR chapter tag to the context->sect1id_stack */ - char **atrs_ptr; - - atrs_ptr = (char **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (g_strcasecmp (*atrs_ptr, "id") == 0) { - atrs_ptr++; - context->sect1id_stack = - g_list_prepend (context->sect1id_stack, g_strdup (*atrs_ptr)); - break; - } - atrs_ptr += 2; - } -} - - -/* Generic functions. Used by both elements and toc_elements */ -void -article_start_element (Context *context, const char *name, const xmlChar **atrs) -{ - g_print ("\n"); - context->doctype = ARTICLE_DOC; -} - -void -glossary_start_element (Context *context, const char *name, const xmlChar **atrs) -{ - g_print ("\n"); - context->doctype = GLOSSARY_DOC; -} - -void -book_start_element (Context *context, const char *name, const xmlChar **atrs) -{ - g_print ("\n"); - context->doctype = BOOK_DOC; -} - -void -article_end_element (Context *context, const gchar *name) -{ - /* This should now be covered by the print_footer function */ - /* g_print ("\n\n"); */ -} - -void -ulink_start_element (Context *context, const gchar *name, const xmlChar **atrs) -{ - gint url_found = FALSE; - GSList *list; - gchar **atrs_ptr; - ElementIndex index; - - list = g_slist_prepend (NULL, GINT_TO_POINTER (FOOTNOTE)); - index = find_first_parent (context, list); - - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "url")) { - atrs_ptr++; - if (index == UNDEFINED) { - g_print ("", *atrs_ptr); - } else { - GString *footnote; - list = g_slist_last (context->footnotes); - - footnote = (GString *) list->data; - g_string_append (footnote, ""); - } - - - url_found = TRUE; - break; - } - atrs_ptr += 2; - } - if (!url_found) - g_print (""); -} - - -void -ulink_end_element (Context *context, const gchar *name) -{ - GSList *list; - ElementIndex index; - - list = g_slist_prepend (NULL, GINT_TO_POINTER (FOOTNOTE)); - index = find_first_parent (context, list); - - if (index == UNDEFINED) { - g_print ("\n"); - } else { - GString *footnote; - - list = g_slist_last (context->footnotes); - - footnote = (GString *) list->data; - g_string_append (footnote, "\n"); - } -} - -void -html_em_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - g_print (""); -} - -void -html_em_end_element (Context *context, - const gchar *name) -{ - g_print (""); -} - -void -html_tt_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - g_print (""); -} - -void -html_tt_end_element (Context *context, - const gchar *name) -{ - g_print (""); -} - -void -artheader_start_element (Context *context, const gchar *name, const xmlChar **atrs) -{ - g_print ("\n"); -} - -StackElement * -find_first_element (Context *context, GSList *args) -{ - GList *ptr; - GSList *element_ptr; - - for (ptr = context->stack; ptr; ptr = ptr->next) { - for (element_ptr = args; element_ptr; element_ptr = element_ptr->next) { - if (((StackElement *) ptr->data)->info && - ((StackElement *) ptr->data)->info->index == GPOINTER_TO_UINT (element_ptr->data)) - return (StackElement *) ptr->data; - } - } - return NULL; -} - -ElementIndex -find_first_parent (Context *context, GSList *args) -{ - StackElement *stack_el; - - stack_el = find_first_element (context, args); - if (stack_el == NULL) - return UNDEFINED; - else - return stack_el->info->index; - -} - - -/* helper functions */ - -static ElementInfo * -find_element_info (ElementInfo *elements, - const gchar *name) -{ - while (elements->name != NULL) { - if (!g_strcasecmp (elements->name, name)) - return elements; - elements++; - } - - return NULL; -} -/* new init_entities function and data structure - to handle i18n entities */ -struct gdb_xmlPredefinedEntityValue { - const char *name; - const char *value; -}; - -struct gdb_xmlPredefinedEntityValue gdbXmlPredefinedEntityValues[] = { -/* i18 entities from iso-latin1 character set */ - { "aacute", "á" }, - { "Aacute", "Á" }, - { "acirc", "â" }, - { "Acirc", "Â" }, - { "agrave", "à" }, - { "Agrave", "À" }, - { "aring", "å" }, - { "Aring", "Å" }, - { "atilde", "ã" }, - { "Atilde", "Ã" }, - { "auml", "ä" }, - { "Auml", "Ä" }, - { "aelig", "æ" }, - { "AElig", "Æ" }, - { "ccedil", "ç" }, - { "Ccedil", "Ç" }, - { "eth", "Ð" }, - { "ETH", "ð" }, - { "eacute", "é" }, - { "Eacute", "É" }, - { "ecirc", "ê" }, - { "Ecirc", "Ê" }, - { "egrave", "è" }, - { "Egrave", "È" }, - { "euml", "ë" }, - { "Euml", "Ë" }, - { "iacute", "í" }, - { "Iacute", "Í" }, - { "icirc", "î" }, - { "Icirc", "Î" }, - { "igrave", "ì" }, - { "Igrave", "Ì" }, - { "iuml", "ï" }, - { "Iuml", "Ï" }, - { "ntilde", "ñ" }, - { "Ntilde", "Ñ" }, - { "oacute", "ó" }, - { "Oacute", "Ó" }, - { "ocirc", "ô" }, - { "Ocirc", "Ô" }, - { "ograve", "ò" }, - { "Ograve", "Ò" }, - { "oslash", "⊘" }, - { "Oslash", "Ø" }, - { "otilde", "õ" }, - { "Otilde", "Õ" }, - { "ouml", "ö" }, - { "Ouml", "Ö" }, - { "szlig", "ß" }, - { "thorn", "þ" }, - { "THORN", "Þ" }, - { "uacute", "ú" }, - { "Uacute", "Ú" }, - { "ucirc", "û" }, - { "Ucirc", "Û" }, - { "ugrave", "ù" }, - { "Ugrave", "Ù" }, - { "uuml", "ü" }, - { "Uuml", "Ü" }, - { "yacute", "ý" }, - { "Yacute", "Ý" }, - { "yuml", "ÿ" }, -/* other miscellaneous entities we need */ - { "mdash", "—" }, - { "hellip", "…" }, - { "percnt", "%" } -}; - -static void -init_entities (xmlDocPtr doc) { - unsigned int i; - xmlChar name[50]; - xmlChar value[50]; - const char *in; - xmlChar *out; - - for (i = 0;i < sizeof(gdbXmlPredefinedEntityValues) / - sizeof(gdbXmlPredefinedEntityValues[0]);i++) { - in = gdbXmlPredefinedEntityValues[i].name; - out = &name[0]; - for (;(*out++ = (xmlChar) *in);)in++; - in = gdbXmlPredefinedEntityValues[i].value; - out = &value[0]; - for (;(*out++ = (xmlChar) *in);)in++; - xmlAddDocEntity(doc, &name[0], - XML_INTERNAL_PREDEFINED_ENTITY, NULL, NULL, - &value[0]); - } -} - - -/* our callbacks for the xmlSAXHandler */ - -static xmlEntityPtr -get_entity (Context *context, const char *name) -{ - xmlEntityPtr ret; -#ifdef ERROR_OUTPUT - g_print ("in getEntity:%s\n", name); -#endif - ret = getEntity (context->ParserCtxt, name); - -/* return xmlGetPredefinedEntity (name); */ - return (ret); -} - -static void -start_document (Context *context) -{ - startDocument (context->ParserCtxt); -} - -static void -end_document (Context *context) -{ - endDocument (context->ParserCtxt); -} - -static GList * -remove_head (GList *list) -{ - GList *head; - - head = list; - list = g_list_remove_link (list, head); - g_list_free_1 (head); - return list; -} - -static void -start_element(Context *context, - const gchar *name, - const xmlChar **attrs) -{ - ElementInfo *element; - StackElement *stack_el = g_new0 (StackElement, 1); - - startElement (context->ParserCtxt, name, attrs); - - element = find_element_info (context->elements, name); - - stack_el->info = element; - context->stack = g_list_prepend (context->stack, stack_el); - context->empty_element = TRUE; - - if (element && element->start_element_func) - (* element->start_element_func) (context, name, attrs); - if (!g_strcasecmp (name, "xref")) { - context->stack = remove_head (context->stack); - } else if (!g_strcasecmp (name, "void")) { - context->stack = remove_head (context->stack); - } else if (!g_strcasecmp (name, "anchor")) { - context->stack = remove_head (context->stack); - } -} - -static void -end_element (Context *context, - const gchar *name) -{ - ElementInfo *element; - StackElement *stack_el; - gchar **atrs_ptr; - - endElement (context->ParserCtxt, name); - - element = find_element_info (context->elements, name); - stack_el = (StackElement *) context->stack->data; - if (stack_el->info != element) { - /* Prolly a tag we ignored */ - return; - } - if (element && element->end_element_func) - (* element->end_element_func) (context, name); - - context->stack = remove_head (context->stack); - - atrs_ptr = stack_el->atrs; - while (atrs_ptr && *atrs_ptr) { - g_free (*atrs_ptr); - atrs_ptr++; - }; - g_free (stack_el->atrs); - g_free (stack_el); -} - -static void -gdb3html_characters (Context *context, - const gchar *chars, - int len) -{ - ElementInfo *element; - - characters (context->ParserCtxt, chars, len); - - if (context->stack == NULL) - return; - element = ((StackElement *)context->stack->data)->info; - context->empty_element = FALSE; - - if (element && element->characters_func) - (* element->characters_func) (context, chars, len); -} - -static void -gdb3html_comment (Context *context, const char *msg) -{ -#ifdef ERROR_OUTPUT - g_log("XML", G_LOG_LEVEL_MESSAGE, "%s", msg); -#endif -} - -static void -gdb3html_warning (Context *context, const char *msg, ...) -{ - va_list args; - - va_start(args, msg); -#ifdef ERROR_OUTPUT - g_logv("XML", G_LOG_LEVEL_WARNING, msg, args); -#endif - va_end(args); -} - -static void -gdb3html_error (Context *context, const char *msg, ...) -{ - va_list args; - - va_start(args, msg); -#ifdef ERROR_OUTPUT - g_logv("XML", G_LOG_LEVEL_CRITICAL, msg, args); -#endif - va_end(args); -} - -static void -fatal_error (Context *context, const char *msg, ...) -{ - va_list args; - - va_start(args, msg); -#ifdef ERROR_OUTPUT - g_logv("XML", G_LOG_LEVEL_ERROR, msg, args); -#endif - va_end(args); -} - -static void -cdata_block (Context *context, const xmlChar *value, int len) -{ - ElementInfo *element; - StackElement *stack_el = g_new0 (StackElement, 1); - - cdataBlock (context->ParserCtxt, value, len); - - element = find_element_info (context->elements, "cdata"); - stack_el->info = element; - - context->stack = g_list_prepend (context->stack, stack_el); - - if (element && element->characters_func) - (* element->characters_func) (context, value, len); - - context->stack = remove_head (context->stack); -} - -static int -gdb3html_isStandalone (Context *context) -{ - int ret; - - ret = isStandalone (context->ParserCtxt); - return (ret); -} - -static int -gdb3html_hasInternalSubset (Context *context) -{ - int ret; - - ret = hasInternalSubset (context->ParserCtxt); - return (ret); -} - -static int -gdb3html_hasExternalSubset (Context *context) -{ - int ret; - - ret = hasExternalSubset (context->ParserCtxt); - return (ret); -} -static void -gdb3html_internalSubset (Context *context, const xmlChar *name, - const xmlChar *ExternalID, const xmlChar *SystemID) -{ - /* This function is copied from SAX.c in libxml so we can 'silence' - * the warning messages */ - xmlParserCtxtPtr ctxt; - - ctxt = context->ParserCtxt; - - xmlCreateIntSubset (ctxt->myDoc, name, ExternalID, SystemID); - /* Initialize our "custom" entities - This is a libxml 1.x SAX hack */ - /* FIXME: Remove the below when we use DOM and/or libxml 2.x */ - init_entities (ctxt->myDoc); - - if (((ExternalID != NULL) || (SystemID != NULL)) && - (ctxt->validate && ctxt->wellFormed && ctxt->myDoc)) { - xmlDtdPtr ret = NULL; - xmlParserCtxtPtr dtdCtxt; - xmlParserInputPtr input = NULL; - xmlCharEncoding enc; - - dtdCtxt = xmlNewParserCtxt(); - if (dtdCtxt == NULL) { - return; - } - - /* Ask entity resolve to load it */ - if ((ctxt->directory != NULL) && (dtdCtxt->directory == NULL)) { - dtdCtxt->directory = (char *) xmlStrdup (BAD_CAST ctxt->directory); - } - if ((dtdCtxt->sax != NULL) && (dtdCtxt->sax->resolveEntity != NULL)) { - dtdCtxt->sax->warning = (warningSAXFunc) gdb3html_warning; - input = dtdCtxt->sax->resolveEntity (dtdCtxt->userData, ExternalID, SystemID); - } - if (input == NULL) { - xmlFreeParserCtxt (dtdCtxt); - return; - } - - /* Plug some encoding conversion routines */ - xmlPushInput (dtdCtxt, input); - enc = xmlDetectCharEncoding (dtdCtxt->input->cur); - xmlSwitchEncoding (dtdCtxt, enc); - - if (input->filename == NULL) { - input->filename = (char *) xmlStrdup (SystemID); - } - input->line = 1; - input->col = 1; - input->base = dtdCtxt->input->cur; - input->cur = dtdCtxt->input->cur; - input->free = NULL; - - /* lets parse the entity knowing it's an external subset */ - xmlParseExternalSubset (dtdCtxt, ExternalID, SystemID); - - if (dtdCtxt->myDoc != NULL) { - if (dtdCtxt->wellFormed) { - ret = dtdCtxt->myDoc->intSubset; - dtdCtxt->myDoc->intSubset = NULL; - } else { - ret = NULL; - } - xmlFreeDoc (dtdCtxt->myDoc); - dtdCtxt->myDoc = NULL; - } - xmlFreeParserCtxt (dtdCtxt); - - ctxt->myDoc->extSubset = ret; - } -} - -static xmlParserInputPtr -gdb3html_resolveEntity (Context *context, const xmlChar *publicId, const xmlChar *systemId) -{ - xmlParserInputPtr ret; - - ret = resolveEntity (context->ParserCtxt, publicId, systemId); - return ret; -} - -static void -gdb3html_entityDecl (Context *context, const xmlChar *name, int type, - const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) -{ - entityDecl (context->ParserCtxt, name, type, publicId, systemId, content); - -} - -static void -gdb3html_attributeDecl (Context *context, const xmlChar *elem, const xmlChar *name, - int type, int def, const xmlChar *defaultValue, - xmlEnumerationPtr tree) -{ - attributeDecl(context->ParserCtxt, elem, name, type, def, defaultValue, tree); -} - -static void -gdb3html_elementDecl (Context *context, const xmlChar *name, int type, - xmlElementContentPtr content) -{ - elementDecl(context->ParserCtxt, name, type, content); -} - -static void -gdb3html_notationDecl (Context *context, const xmlChar *name, - const xmlChar *publicId, const xmlChar *systemId) -{ - notationDecl(context->ParserCtxt, name, publicId, systemId); -} - -static void -gdb3html_unparsedEntityDecl (Context *context, const xmlChar *name, - const xmlChar *publicId, const xmlChar *systemId, - const xmlChar *notationName) -{ - unparsedEntityDecl (context->ParserCtxt, name, publicId, systemId, notationName); -} - -static void -gdb3html_reference (Context *context, const xmlChar *name) -{ - reference (context->ParserCtxt, name); -} - -static void -gdb3html_processingInstruction (Context *context, const xmlChar *target, - const xmlChar *data) -{ - processingInstruction (context->ParserCtxt, target, data); -} - -static xmlEntityPtr -gdb3html_getParameterEntity (Context *context, const xmlChar *name) -{ - xmlEntityPtr ret; - - ret = getParameterEntity (context->ParserCtxt, name); - return ret; -} - -static xmlSAXHandler parser = { - (internalSubsetSAXFunc) gdb3html_internalSubset, /* internalSubset */ - (isStandaloneSAXFunc) gdb3html_isStandalone, /* isStandalone */ - (hasInternalSubsetSAXFunc) gdb3html_hasInternalSubset, /* hasInternalSubset */ - (hasExternalSubsetSAXFunc) gdb3html_hasExternalSubset, /* hasExternalSubset */ - (resolveEntitySAXFunc) gdb3html_resolveEntity, /* resolveEntity */ - (getEntitySAXFunc) get_entity, /* getEntity */ - (entityDeclSAXFunc) gdb3html_entityDecl, /* entityDecl */ - (notationDeclSAXFunc) gdb3html_notationDecl, /* notationDecl */ - (attributeDeclSAXFunc) gdb3html_attributeDecl, /* attributeDecl */ - (elementDeclSAXFunc) gdb3html_elementDecl, /* elementDecl */ - (unparsedEntityDeclSAXFunc) gdb3html_unparsedEntityDecl, /* unparsedEntityDecl */ - NULL, /* setDocumentLocator */ - (startDocumentSAXFunc) start_document, /* startDocument */ - (endDocumentSAXFunc) end_document, /* endDocument */ - (startElementSAXFunc) start_element, /* startElement */ - (endElementSAXFunc) end_element, /* endElement */ - (referenceSAXFunc) gdb3html_reference, /* reference */ - (charactersSAXFunc) gdb3html_characters, /* characters */ - NULL, /* ignorableWhitespace */ - (processingInstructionSAXFunc) gdb3html_processingInstruction, /* processingInstruction */ - (commentSAXFunc) gdb3html_comment, /* comment */ - (warningSAXFunc) gdb3html_warning, /* warning */ - (errorSAXFunc) gdb3html_error, /* error */ - (fatalErrorSAXFunc) fatal_error, /* fatalError */ - (getParameterEntitySAXFunc) gdb3html_getParameterEntity, /*parameterEntity */ - (cdataBlockSAXFunc) cdata_block -}; - -void -print_footer (const char *prev, const char *home, const char *next) -{ - g_print ("\n
\n"); - g_print ("\n"); - - g_print ("\n\n\n\n
"); - if (prev == NULL) { - g_print (" "); - } else { - g_print ("<<< ", prev); - g_print ("%s", _("Previous")); - g_print (""); - } - - g_print (""); - if (home == NULL) { - g_print (" "); - } else { - g_print ("", home); - g_print ("%s", _("Home")); - g_print (""); - } - - g_print (""); - if (next == NULL) { - g_print (" "); - } else { - g_print ("", next); - g_print ("%s", _("Next")); - g_print (" >>>"); - } - - g_print ("
\n"); - g_print ("\n\n"); -} - -static void -sect_footer (Context *context, const char *section) -{ - GList *temp_list; - GList *next_node; - GList *prev_node; - char *next_uri; - char *prev_uri; - char *home_uri; - - if (context->sect1id_stack == NULL) { - return; - } - - temp_list = context->sect1id_stack; - while (temp_list != NULL) { - if (g_strcasecmp ((char *)temp_list->data, section) == 0) { - /* Yes the below is correct because we are using a 'stack' */ - next_node = g_list_previous (temp_list); - prev_node = g_list_next (temp_list); - - if (next_node == NULL) { - next_uri = NULL; - } else { - next_uri = g_strdup_printf ("gnome-help:%s?%s", context->base_file, (char *) next_node->data); - } - - if (prev_node == NULL) { - /* link back to the TOC */ - prev_uri = g_strdup_printf ("gnome-help:%s", context->base_file); - } else { - prev_uri = g_strdup_printf ("gnome-help:%s?%s", context->base_file, (char *)prev_node->data); - } - - home_uri = g_strdup_printf ("gnome-help:%s", context->base_file); - - print_footer (prev_uri, home_uri, next_uri); - - g_free (home_uri); - g_free (prev_uri); - g_free (next_uri); - - break; - } - temp_list = g_list_next (temp_list); - } -} - -static void -parse_file (gchar *filename, gchar *section, char *arg) -{ - GList *temp_list; - Context *context = g_new0 (Context, 1); - char *dirpointer; - - context->ParserCtxt = xmlNewParserCtxt (); - xmlInitParserCtxt (context->ParserCtxt); - context->ParserCtxt->sax = &parser; - context->ParserCtxt->validate = 1; - context->ParserCtxt->version = xmlStrdup (XML_DEFAULT_VERSION); - xmlSubstituteEntitiesDefault (1); - - dirpointer = strrchr (arg, '/'); - if (dirpointer != NULL) { - dirpointer++; - if (*dirpointer == '\0') { - context->base_path = g_strdup ("/"); - } else { - context->base_path = g_strndup (arg, dirpointer - arg); - } - } else { - if (g_getenv("PWD")) { - context->base_path = g_strconcat (g_getenv("PWD"), "/", NULL ); - } else { - context->base_path = g_strdup ("./"); - } - } - - if (section) { - context->target_section = g_strdup (section); - context->elements = sect_preparse; - context->data = sect_init_data (); - context->base_file = g_strdup (filename); - - if (xmlSAXUserParseFile (&parser, context, context->base_file) < 0) { - g_error ("error"); - }; - context->elements = sect_elements; - if (xmlSAXUserParseFile (&parser, context, context->base_file) < 0) { - g_error ("error"); - }; - sect_footer (context, section); - } else { - context->elements = toc_elements; - context->data = toc_init_data (); - context->base_file = g_strdup (filename); - if (xmlSAXUserParseFile (&parser, context, context->base_file) < 0) { - g_error ("error"); - }; - temp_list = g_list_last (context->sect1id_stack); - if (temp_list != NULL) { - char *temp_uri; - - temp_uri = g_strdup_printf ("gnome-help:%s?%s", context->base_file, (char *)temp_list->data); - print_footer (NULL, NULL, temp_uri); - g_free (temp_uri); - } - toc_free_data (context->data); - } - - /* Set this to NULL so xmlFreeParserCtxt does not try to free this static memory */ - context->ParserCtxt->sax = NULL; - if (context->ParserCtxt->myDoc) { - xmlFreeDoc (context->ParserCtxt->myDoc); - } - xmlFreeParserCtxt (context->ParserCtxt); - g_free (context->base_path); - g_free (context); -} - -int -main (int argc, char *argv[]) -{ - gchar *section = NULL; - gchar *ptr; - gchar *ptr2; - -#ifdef ENABLE_NLS - bindtextdomain (PACKAGE, GNOMELOCALEDIR); - textdomain (PACKAGE); -#endif - - if (argc != 2) { - g_print ("Usage: gnome-db2html2 FILE[?SECTIONID]\n\n"); - return 0; - } - - if (!strncmp (argv[1], "file://", strlen ("file://"))) { - ptr = argv[1] + strlen ("file://"); - } else - ptr = argv[1]; - - for (ptr2 = ptr; *ptr2; ptr2++){ - if (*ptr2 == '?') { - *ptr2 = '\000'; - if (*(ptr2 + 1)) - section = ptr2 + 1; - break; - } - } - parse_file (ptr, section, argv[1]); - - return 0; -} diff --git a/components/help/converters/gnome-db2html2/gdb3html.h b/components/help/converters/gnome-db2html2/gdb3html.h deleted file mode 100644 index e3e24c748..000000000 --- a/components/help/converters/gnome-db2html2/gdb3html.h +++ /dev/null @@ -1,244 +0,0 @@ -#ifndef __GDB3HTML_H__ -#define __GDB3HTML_H__ - -#include -#include -#include -#include -#include -#include - -typedef enum ElementIndex { - ARTICLE = 0, - BOOK, - SECTION, - SECT1, - SECT2, - SECT3, /* 5 */ - SECT4, - SECT5, - PARA, - FORMALPARA, - BOOKINFO, /* 10 */ - ARTHEADER, - ARTICLEINFO, - GLOSSARYINFO, - AUTHORGROUP, - AUTHOR, /* 15 */ - FIRSTNAME, - OTHERNAME, - SURNAME, - AFFILIATION, - EMAIL, /* 20 */ - ORGNAME, - ADDRESS, - COPYRIGHT, - YEAR, - HOLDER, /* 25 */ - TITLE, - SUBTITLE, - ULINK, - XREF, - FOOTNOTE, - FIGURE, - GRAPHIC, /* 32 */ - CITETITLE, - APPLICATION, - FILENAME, - ITEMIZEDLIST, - ORDEREDLIST, /* 37 */ - VARIABLELIST, - LISTITEM, - PROGRAMLISTING, - SGMLTAG, - EMPHASIS, /* 42 */ - TIP, - WARNING, - IMPORTANT, - NOTE, - CDATA, /* 47 */ - SCREEN, - SCREENSHOT, - SCREENINFO, - COMMAND, - REPLACEABLE, /* 52 */ - FUNCTION, - GUIBUTTON, - GUIICON, - GUILABEL, - GUIMENU, /* 57 */ - GUIMENUITEM, - HARDWARE, - KEYCAP, - KEYCODE, - KEYSYM, /* 62 */ - LITERAL, - PARAMETER, - PROMPT, - SYMBOL, - USERINPUT, /* 67 */ - CAUTION, - LEGALPARA, - FIRSTTERM, - STRUCTNAME, - STRUCTFIELD, /* 72 */ - FUNCSYNOPSIS, - FUNCPROTOTYPE, - FUNCDEF, - FUNCPARAMS, - PARAMDEF, /* 77 */ - VOID, - GUISUBMENU, - INTERFACE, - LINK, /* 81 */ - MENUCHOICE, - TABLE, - INFORMALTABLE, - ROW, - ENTRY, /* 86 */ - THEAD, - TBODY, - ACRONYM, - MARKUP, /* 90 */ - SIMPLELIST, - MEMBER, - MOUSEBUTTON, - SUPERSCRIPT, - SYSTEMITEM, /* 95 */ - VARNAME, - BLOCKQUOTE, - QUOTE, - OPTION, - ENVAR, /* 100 */ - COMPUTEROUTPUT, - INLINEGRAPHIC, - LEGALNOTICE, - QUESTION, - ANSWER, /* 105 */ - CHAPTER, - PREFACE, - TERM, - APPENDIX, - DOCINFO, - GLOSSARY, /* 110 */ - GLOSSDIV, - GLOSSENTRY, - GLOSSTERM, - GLOSSSEE, - GLOSSSEEALSO, /* 115 */ - EXAMPLE, - VARLISTENTRY, - STREET, - CITY, - COUNTRY, /* 120 */ - STATE, - POSTCODE, - LITERALLAYOUT, - QANDAENTRY, - QANDASET, - BRIDGEHEAD, - RELEASEINFO, /* 125 */ - UNDEFINED /* 126 */ -} ElementIndex; - -typedef struct _ElementInfo ElementInfo; -struct _ElementInfo { - ElementIndex index; - gchar *name; - startElementSAXFunc start_element_func; - endElementSAXFunc end_element_func; - charactersSAXFunc characters_func; -}; - -typedef struct _StackElement StackElement; -struct _StackElement { - ElementInfo *info; - gchar **atrs; -}; - -typedef enum DocType { - /* Need the DOC prefix to avoid conflicts with the above */ - ARTICLE_DOC, - BOOK_DOC, - GLOSSARY_DOC -} DocType; - - -typedef struct _Context Context; -struct _Context { - ElementInfo *elements; - gchar *base_file; - gchar *base_path; - gchar *target_section; - GList *stack; - gpointer data; - GHashTable *figure_data; - GHashTable *glossary_data; - GList *glossentry_stack; - GList *sect1id_stack; - - /* determine the "depth" that the current section is on. - * only applies to section and chapter */ - gint preface; - gint chapter; - gint sect1; - gint sect2; - gint sect3; - gint sect4; - gint sect5; - gint appendix; - - gboolean empty_element; /* This is to determine if the element is - empty or not */ - gboolean in_glossterm; - gboolean start_address_character; - DocType doctype; - GSList *footnotes; - xmlParserCtxtPtr ParserCtxt; -}; - -/* useful structs */ -typedef struct AuthorInfo { - gchar *firstname; - gchar *othername; - gchar *surname; - gchar *email; - gchar *orgname; -} AuthorInfo; - -typedef struct HeaderInfo { - gchar *title; - gchar *subtitle; - gchar *copyright_year; - gchar *copyright_holder; - gchar *releaseinfo; - GSList *authors; -} HeaderInfo; - -typedef struct FigureInfo { - gchar *title; - gchar *alt; - gchar *img; - gchar *id; -} FigureInfo; - -void article_start_element (Context *context, const char *name, const xmlChar **atrs); -void book_start_element (Context *context, const char *name, const xmlChar **atrs); -void article_end_element (Context *context, const gchar *name); -void artheader_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void html_em_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void html_em_end_element (Context *context, const gchar *name); -void html_tt_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void html_tt_end_element (Context *context, const gchar *name); -void para_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void para_end_element (Context *context, const gchar *name); -void ulink_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void ulink_end_element (Context *context, const gchar *name); -void sect1id_stack_add (Context *context, const char *name, const xmlChar **atrs); -void glossentry_stack_add (Context *context, const char *name, const xmlChar **atrs); -StackElement *find_first_element (Context *context, GSList *args); -ElementIndex find_first_parent (Context *context, GSList *args); -void print_footer (const char *prev, const char *home, const char *next); -void glossary_start_element (Context *context, const char *name, const xmlChar **atrs); - -#endif diff --git a/components/help/converters/gnome-db2html2/sect-elements.c b/components/help/converters/gnome-db2html2/sect-elements.c deleted file mode 100644 index a24dcfe64..000000000 --- a/components/help/converters/gnome-db2html2/sect-elements.c +++ /dev/null @@ -1,2357 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "sect-elements.h" -#include "gnome.h" - -#define IS_IN_SECT(context) (((SectContext *)context->data)->state == IN_SECT) -ElementInfo sect_elements[] = { - { ARTICLE, "article", (startElementSAXFunc) article_start_element, (endElementSAXFunc) sect_article_end_element, NULL}, - { BOOK, "book", (startElementSAXFunc) book_start_element, NULL, NULL}, - { SECTION, "section", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { SECT1, "sect1", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { SECT2, "sect2", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { SECT3, "sect3", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { SECT4, "sect4", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { SECT5, "sect5", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { PARA, "para", (startElementSAXFunc) sect_para_start_element, (endElementSAXFunc) sect_para_end_element, (charactersSAXFunc) sect_write_characters}, - { FORMALPARA, "formalpara", (startElementSAXFunc) sect_formalpara_start_element, (endElementSAXFunc) sect_formalpara_end_element, NULL }, - { BOOKINFO, "bookinfo", NULL, NULL, NULL}, - { ARTHEADER, "artheader", NULL, NULL, NULL}, //(startElementSAXFunc) artheader_start_element, (endElementSAXFunc) sect_artheader_end_element, NULL}, - { ARTICLEINFO, "articleinfo", NULL, NULL, NULL}, - { GLOSSARYINFO, "glossaryinfo", NULL, NULL, NULL}, - { AUTHORGROUP, "authorgroup", NULL, NULL, NULL}, - { AUTHOR, "author", (startElementSAXFunc) sect_author_start_element, NULL, NULL}, - { FIRSTNAME, "firstname", NULL, NULL, (charactersSAXFunc) sect_author_characters }, - { OTHERNAME, "othername", NULL, NULL, (charactersSAXFunc) sect_author_characters }, - { SURNAME, "surname", NULL, NULL, (charactersSAXFunc) sect_author_characters }, - { AFFILIATION, "affiliation", NULL, NULL, NULL}, - { EMAIL, "email", NULL, NULL, (charactersSAXFunc) sect_email_characters }, - { ORGNAME, "orgname", NULL, NULL, (charactersSAXFunc) sect_author_characters }, - { ADDRESS, "address", (startElementSAXFunc) sect_address_start_element, (endElementSAXFunc) sect_address_end_element, (charactersSAXFunc) sect_address_characters}, - { COPYRIGHT, "copyright", NULL, NULL, NULL}, - { YEAR, "year", NULL, NULL, (charactersSAXFunc) sect_copyright_characters}, - { HOLDER, "holder", NULL, NULL, (charactersSAXFunc) sect_copyright_characters}, - { TITLE, "title", (startElementSAXFunc) sect_title_start_element, (endElementSAXFunc) sect_title_end_element, (charactersSAXFunc) sect_title_characters }, - { SUBTITLE, "subtitle", (startElementSAXFunc) sect_title_start_element, (endElementSAXFunc) sect_title_end_element, (charactersSAXFunc) sect_title_characters }, - { ULINK, "ulink", (startElementSAXFunc) sect_ulink_start_element, (endElementSAXFunc) sect_ulink_end_element, (charactersSAXFunc) sect_write_characters}, - { XREF, "xref", (startElementSAXFunc) sect_xref_start_element, NULL, NULL}, - { FOOTNOTE, "footnote", (startElementSAXFunc) sect_footnote_start_element, NULL, NULL}, - { FIGURE, "figure", (startElementSAXFunc) sect_figure_start_element, (endElementSAXFunc) sect_figure_end_element, NULL}, - { GRAPHIC, "graphic", (startElementSAXFunc) sect_graphic_start_element, NULL, NULL}, - { CITETITLE, "citetitle", (startElementSAXFunc) sect_i_start_element, (endElementSAXFunc) sect_i_end_element, (charactersSAXFunc) sect_write_characters}, - { APPLICATION, "application", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { FILENAME, "filename", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { ITEMIZEDLIST, "itemizedlist", (startElementSAXFunc) sect_itemizedlist_start_element, (endElementSAXFunc) sect_itemizedlist_end_element, NULL}, - { ORDEREDLIST, "orderedlist", (startElementSAXFunc) sect_orderedlist_start_element, (endElementSAXFunc) sect_orderedlist_end_element, NULL}, - { VARIABLELIST, "variablelist", (startElementSAXFunc) sect_variablelist_start_element, (endElementSAXFunc) sect_variablelist_end_element, NULL}, - { LISTITEM, "listitem", (startElementSAXFunc) sect_listitem_start_element, (endElementSAXFunc) sect_listitem_end_element, NULL}, - { PROGRAMLISTING, "programlisting", (startElementSAXFunc) sect_programlisting_start_element, (endElementSAXFunc) sect_programlisting_end_element, (charactersSAXFunc) sect_write_characters}, - { SGMLTAG, "sgmltag", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { EMPHASIS, "emphasis", (startElementSAXFunc) sect_em_start_element, (endElementSAXFunc) sect_em_end_element, (charactersSAXFunc) sect_write_characters}, - { TIP, "tip", (startElementSAXFunc) sect_infobox_start_element, (endElementSAXFunc) sect_infobox_end_element, NULL}, - { WARNING, "warning", (startElementSAXFunc) sect_infobox_start_element, (endElementSAXFunc) sect_infobox_end_element, NULL}, - { IMPORTANT, "important", (startElementSAXFunc) sect_infobox_start_element, (endElementSAXFunc) sect_infobox_end_element, NULL}, - { NOTE, "note", (startElementSAXFunc) sect_infobox_start_element, (endElementSAXFunc) sect_infobox_end_element, NULL}, - { CDATA, "cdata", NULL, NULL, (charactersSAXFunc) sect_cdata_characters}, - { SCREEN, "screen", (startElementSAXFunc)sect_programlisting_start_element, (endElementSAXFunc) sect_programlisting_end_element, (charactersSAXFunc) sect_write_characters}, - { SCREENSHOT, "screenshot", NULL, NULL, NULL}, - { SCREENINFO, "screeninfo", NULL, NULL, NULL}, - { COMMAND, "command", (startElementSAXFunc) sect_b_start_element, (endElementSAXFunc) sect_b_end_element, (charactersSAXFunc) sect_write_characters}, - { REPLACEABLE, "replaceable", (startElementSAXFunc) sect_tti_start_element, (endElementSAXFunc) sect_tti_end_element, (charactersSAXFunc) sect_write_characters}, - { FUNCTION, "function", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { GUIBUTTON, "guibutton", (startElementSAXFunc) sect_b_start_element, (endElementSAXFunc) sect_b_end_element, (charactersSAXFunc) sect_write_characters}, - { GUIICON, "guiicon", (startElementSAXFunc) sect_b_start_element, (endElementSAXFunc) sect_b_end_element, (charactersSAXFunc) sect_write_characters}, - { GUILABEL, "guilabel", (startElementSAXFunc) sect_btt_start_element, (endElementSAXFunc) sect_btt_end_element, (charactersSAXFunc) sect_write_characters}, - { GUIMENU, "guimenu", (startElementSAXFunc) sect_menu_start_element, (endElementSAXFunc) sect_menu_end_element, (charactersSAXFunc) sect_write_characters}, - { GUIMENUITEM, "guimenuitem", (startElementSAXFunc) sect_b_start_element, (endElementSAXFunc) sect_b_end_element, (charactersSAXFunc) sect_write_characters}, - { HARDWARE, "hardware", (startElementSAXFunc) sect_btt_start_element, (endElementSAXFunc) sect_btt_end_element, (charactersSAXFunc) sect_write_characters}, - { KEYCAP, "keycap", (startElementSAXFunc) sect_b_start_element, (endElementSAXFunc) sect_b_end_element, (charactersSAXFunc) sect_write_characters}, - { KEYCAP, "keycode", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { KEYCAP, "keysym", (startElementSAXFunc) sect_keysym_start_element, (endElementSAXFunc) sect_keysym_end_element, (charactersSAXFunc) sect_write_characters}, - { LITERAL, "literal", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { PARAMETER, "parameter", (startElementSAXFunc) sect_tti_start_element, (endElementSAXFunc) sect_tti_end_element, (charactersSAXFunc) sect_write_characters}, - { PROMPT, "prompt", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { SYMBOL, "symbol", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { USERINPUT, "userinput", (startElementSAXFunc) sect_btt_start_element, (endElementSAXFunc) sect_btt_end_element, (charactersSAXFunc) sect_write_characters}, - { CAUTION, "caution", (startElementSAXFunc) sect_infobox_start_element, (endElementSAXFunc) sect_infobox_end_element, NULL}, - { LEGALPARA, "legalpara", NULL, NULL, NULL}, - { FIRSTTERM, "firstterm", (startElementSAXFunc) sect_em_start_element, (endElementSAXFunc) sect_em_end_element, (charactersSAXFunc) sect_write_characters}, - { STRUCTNAME, "structname", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { STRUCTFIELD, "structfield", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { FUNCSYNOPSIS, "funcsynopsis", (startElementSAXFunc) sect_funcsynopsis_start_element, (endElementSAXFunc) sect_funcsynopsis_end_element, NULL}, - { FUNCPROTOTYPE, "funcprototype", (startElementSAXFunc) sect_funcprototype_start_element, NULL, NULL}, - { FUNCDEF, "funcdef", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { FUNCPARAMS, "funcparams", (startElementSAXFunc) sect_funcparams_start_element, (endElementSAXFunc) sect_funcparams_end_element, (charactersSAXFunc) sect_write_characters}, - { PARAMDEF, "paramdef", (startElementSAXFunc) sect_paramdef_start_element, NULL, (charactersSAXFunc) sect_write_characters}, - { VOID, "void", (startElementSAXFunc) sect_void_start_element, NULL, NULL }, - { GUISUBMENU, "guisubmenu", (startElementSAXFunc) sect_menu_start_element, (endElementSAXFunc) sect_menu_end_element, (charactersSAXFunc) sect_write_characters}, - { INTERFACE, "interface", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { LINK, "link", (startElementSAXFunc) sect_link_start_element, (endElementSAXFunc) sect_link_end_element, (charactersSAXFunc) sect_write_characters}, - { MENUCHOICE, "menuchoice", NULL, NULL, NULL}, - { TABLE, "table", (startElementSAXFunc) sect_table_with_border_start_element, (endElementSAXFunc) sect_table_end_element, NULL}, - { INFORMALTABLE, "informaltable", (startElementSAXFunc) sect_informaltable_start_element, (endElementSAXFunc) sect_informaltable_end_element, NULL}, - { ROW, "row", (startElementSAXFunc) sect_row_start_element, (endElementSAXFunc) sect_row_end_element, NULL}, - { ENTRY, "entry", (startElementSAXFunc) sect_entry_start_element, (endElementSAXFunc) sect_entry_end_element, (charactersSAXFunc) sect_write_characters}, - { THEAD, "thead", (startElementSAXFunc) sect_thead_start_element, (endElementSAXFunc) sect_thead_end_element, NULL}, - { TBODY, "tbody", (startElementSAXFunc) sect_tbody_start_element, (endElementSAXFunc) sect_tbody_end_element, NULL}, - { ACRONYM, "acronym", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { MARKUP, "markup", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { SIMPLELIST, "simplelist", (startElementSAXFunc) sect_table_without_border_start_element, (endElementSAXFunc) sect_table_end_element, NULL}, - { MEMBER, "member", (startElementSAXFunc) sect_member_start_element, (endElementSAXFunc) sect_member_end_element, (charactersSAXFunc) sect_write_characters}, - { MOUSEBUTTON, "mousebutton", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { SUPERSCRIPT, "superscript", (startElementSAXFunc) sect_sup_start_element, (endElementSAXFunc) sect_sup_end_element, (charactersSAXFunc) sect_write_characters}, - { SYSTEMITEM, "systemitem", NULL, NULL, (charactersSAXFunc) sect_write_characters}, - { VARNAME, "varname", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { BLOCKQUOTE, "blockquote", (startElementSAXFunc) sect_blockquote_start_element, (endElementSAXFunc) sect_blockquote_end_element, (charactersSAXFunc) sect_write_characters}, - { QUOTE, "quote", (startElementSAXFunc) sect_quote_start_element, (endElementSAXFunc) sect_quote_end_element, (charactersSAXFunc) sect_write_characters}, - { OPTION, "option", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { ENVAR, "envar", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { COMPUTEROUTPUT, "computeroutput", (startElementSAXFunc) sect_tt_start_element, (endElementSAXFunc) sect_tt_end_element, (charactersSAXFunc) sect_write_characters}, - { INLINEGRAPHIC, "inlinegraphic", (startElementSAXFunc) sect_inlinegraphic_start_element, NULL, NULL}, - { LEGALNOTICE, "legalnotice", (startElementSAXFunc) sect_legalnotice_start_element, (endElementSAXFunc) sect_legalnotice_end_element, (charactersSAXFunc) sect_legalnotice_characters}, - { QUESTION, "question", (startElementSAXFunc) sect_question_start_element, (endElementSAXFunc) sect_formalpara_end_element, NULL /* (charactersSAXFunc) sect_write_characters */}, - { ANSWER, "answer", (startElementSAXFunc) sect_answer_start_element, (endElementSAXFunc) sect_formalpara_end_element, NULL /* charactersSAXFunc) sect_write_characters */}, - { CHAPTER, "chapter", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { PREFACE, "preface", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { TERM, "term", (startElementSAXFunc) sect_term_start_element, (endElementSAXFunc) sect_term_end_element, (charactersSAXFunc) sect_write_characters}, - { APPENDIX, "appendix", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { DOCINFO, "docinfo", NULL, NULL, NULL}, - { GLOSSARY, "glossary", (startElementSAXFunc) glossary_start_element, NULL, NULL}, - { GLOSSDIV, "glossdiv", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { GLOSSENTRY, "glossentry", (startElementSAXFunc) sect_sect_start_element, (endElementSAXFunc) sect_sect_end_element, NULL}, - { GLOSSTERM, "glossterm", (startElementSAXFunc) sect_title_start_element, (endElementSAXFunc) sect_title_end_element, (charactersSAXFunc) sect_title_characters }, - { GLOSSSEE, "glosssee", (startElementSAXFunc) sect_glosssee_start_element, NULL, NULL }, - { GLOSSSEEALSO, "glossseealso", (startElementSAXFunc) sect_glossseealso_start_element, NULL, NULL }, - { EXAMPLE, "example", NULL, NULL, NULL }, - { VARLISTENTRY, "varlistentry", (startElementSAXFunc) sect_varlistentry_start_element, (endElementSAXFunc) sect_varlistentry_end_element, NULL }, - { STREET, "street", (startElementSAXFunc) sect_street_start_element, NULL, (charactersSAXFunc) sect_write_characters }, - { CITY, "city", (startElementSAXFunc) sect_city_start_element, NULL, (charactersSAXFunc) sect_write_characters }, - { COUNTRY, "country", (startElementSAXFunc) sect_country_start_element, NULL, (charactersSAXFunc) sect_write_characters }, - { STATE, "state", NULL, NULL, (charactersSAXFunc) sect_write_characters }, - { POSTCODE, "postcode", NULL, NULL, (charactersSAXFunc) sect_write_characters }, - { LITERALLAYOUT, "literallayout", (startElementSAXFunc) sect_literallayout_start_element, (endElementSAXFunc) sect_literallayout_end_element, (charactersSAXFunc) sect_write_characters }, - { QANDAENTRY, "qandaentry", NULL, NULL, NULL, }, - { QANDASET, "qandaset", NULL, NULL, NULL, }, - { BRIDGEHEAD, "bridgehead", (startElementSAXFunc) sect_bridgehead_start_element, (endElementSAXFunc) sect_bridgehead_end_element, (charactersSAXFunc) sect_write_characters }, - { RELEASEINFO, "releaseinfo", NULL, NULL, NULL, }, - { UNDEFINED, NULL, NULL, NULL, NULL} -}; - -void -sect_print (Context *context, gchar *format, ...) -{ - va_list args; - gchar *string; - GSList *list; - ElementIndex index; - GString *footnote; - SectFuncProtoInfo *proto; - StackElement *stack_el; - - g_return_if_fail (format != NULL); - - va_start (args, format); - string = g_strdup_vprintf (format, args); - va_end (args); - - list = g_slist_prepend (NULL, GINT_TO_POINTER (FOOTNOTE)); - list = g_slist_prepend (list, GINT_TO_POINTER (FUNCPROTOTYPE)); - list = g_slist_prepend (list, GINT_TO_POINTER (FUNCDEF)); - list = g_slist_prepend (list, GINT_TO_POINTER (PARAMDEF)); - index = find_first_parent (context, list); - g_slist_free (list); - - switch (index) { - case FUNCDEF: - stack_el = (StackElement *) context->stack->data; - if (stack_el->info->index == FUNCTION) { - list = g_slist_last (((SectContext *)(context->data))->func_synopsis); - proto = (SectFuncProtoInfo *) list->data; - if (proto->func) - g_string_append (proto->func, string); - else - proto->func = g_string_new (string); - g_free (string); - } else { - list = g_slist_last (((SectContext *)(context->data))->func_synopsis); - proto = (SectFuncProtoInfo *) list->data; - if (proto->retval) - g_free (string); - else - proto->retval = string; - } - break; - case PARAMDEF: - list = g_slist_last (((SectContext *)(context->data))->func_synopsis); - proto = (SectFuncProtoInfo *) list->data; - list = g_slist_last (proto->params); - if (list->data) { - GString *gstr = (GString *) list->data; - g_string_append (gstr, string); - } - break; - case FOOTNOTE: - list = g_slist_last (context->footnotes); - footnote = (GString *) list->data; - g_string_append (footnote, string); - g_free (string); - break; - case FUNCPROTOTYPE: - stack_el = (StackElement *) context->stack->data; - if (stack_el->info->index == VOID) { - list = g_slist_last (((SectContext *)(context->data))->func_synopsis); - proto = (SectFuncProtoInfo *) list->data; - if (proto->params == NULL) { - proto->params = g_slist_append (proto->params, - g_string_new (string)); - } /* else was incorrectly used */ - } - g_free (string); - break; - default: - if ((*string == '<') && (*(string +1) == '\000')) { - printf ("<"); - } else if ((*string == '&') && (*(string +1) == '\000')) { - printf ("&"); - } else { - printf ("%s", string); - } - g_free (string); - } -} - -gpointer -sect_init_data (void) -{ - SectContext *retval = g_new0 (SectContext, 1); - retval->header = g_new0 (HeaderInfo, 1); - retval->state = LOOKING_FOR_SECT; - retval->title_hash = g_hash_table_new (g_str_hash, - g_str_equal); - return (gpointer) retval; -} - -void -sect_write_characters (Context *context, - const gchar *chars, - int len) -{ - gchar *temp; - - if (!IS_IN_SECT (context)) - return; - - - temp = g_strndup (chars, len); - sect_print (context, "%s", temp); - g_free (temp); -} - -void -sect_article_end_element (Context *context, const gchar *name) -{ - if (context->footnotes) { - GSList *list; - gint i = 1; - - g_print ("

%s

", _("Notes")); - g_print ("\n\n"); - for (list = context->footnotes; list; list = list->next) { - g_print ("\n", i, i, i); - g_print ("\n", ((GString *)list->data)->str); - i++; - } - g_print ("
\n"); - g_print ("[%d]\n%s\n
"); - } - /* FIXME bugzilla.gnome.org 44408: Is the below needed now that we have the footer printed out */ -/* sect_print (context, "\n\n"); */ -} - -void -sect_para_start_element (Context *context, const gchar *name, const xmlChar **atrs) -{ - GSList *element_list = NULL; - StackElement *stack_el; - - if (!IS_IN_SECT (context)) - return; - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FOOTNOTE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (LISTITEM)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (LEGALNOTICE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (QUESTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ANSWER)); - stack_el = find_first_element (context, element_list); - - g_slist_free (element_list); - if (stack_el == NULL) - return; - - switch (stack_el->info->index) { - case PREFACE: - case CHAPTER: - case SECT1: - case SECT2: - case SECT3: - case SECT4: - case SECT5: - case APPENDIX: - case SECTION: - case LEGALNOTICE: - case LISTITEM: - sect_print (context, "

\n"); - break; - case FORMALPARA: - case QUESTION: - case ANSWER: - default: - break; - }; -} - -void -sect_para_end_element (Context *context, const gchar *name) -{ - GSList *element_list = NULL; - StackElement *stack_el; - - if (!IS_IN_SECT (context)) - return; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FOOTNOTE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (LISTITEM)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (LEGALNOTICE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (QUESTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ANSWER)); - stack_el = find_first_element (context, element_list); - - g_slist_free (element_list); - if (stack_el == NULL) - return; - - switch (stack_el->info->index) { - case PREFACE: - case CHAPTER: - case SECT1: - case SECT2: - case SECT3: - case SECT4: - case SECT5: - case APPENDIX: - case SECTION: - case LEGALNOTICE: - case LISTITEM: - sect_print (context, "

\n"); - break; - case FORMALPARA: - case QUESTION: - case ANSWER: - default: - break; - }; -} - - - -void -sect_formalpara_start_element (Context *context, const gchar *name, const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "

"); -} - -void -sect_formalpara_end_element (Context *context, const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "

"); -} - - -void -sect_sect_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - gchar **atrs_ptr; - SectContext *sect_context = (SectContext *)context->data; - - if (g_strcasecmp (name, "section") == 0) { - return; - } - - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - ((StackElement *)context->stack->data)->atrs = g_new0 (gchar *, 3); - ((StackElement *)context->stack->data)->atrs[0] = g_strdup ("id"); - ((StackElement *)context->stack->data)->atrs[1] = g_strdup (*atrs_ptr); - if (!g_strcasecmp (*atrs_ptr, context->target_section)) - sect_context->state = LOOKING_FOR_SECT_TITLE; - break; - } - atrs_ptr += 2; - } - - switch (name[4]) { - case 'a': - /* Preface tag */ - context->preface++; - context->chapter = 0; - context->sect1 = 0; - context->sect2 = 0; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case 't': - /* Chapter tag */ - context->chapter++; - context->sect1 = 0; - context->sect2 = 0; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case 'n': - /* Appendix tag */ - context->appendix++; - context->chapter = 0; - context->sect1 = 0; - context->sect2 = 0; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - - case '1': - if (sect_context->state != LOOKING_FOR_SECT_TITLE) { - g_free (sect_context->prev); - g_free (sect_context->previd); - } - context->sect1++; - context->sect2 = 0; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case '2': - context->sect2++; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case '3': - context->sect3++; - context->sect4 = 0; - context->sect5 = 0; - break; - case '4': - context->sect4++; - context->sect5 = 0; - break; - case '5': - context->sect4++; - break; - default: - break; - } -} - -void -sect_sect_end_element (Context *context, - const gchar *name) -{ - gchar **atrs_ptr; - - if (g_strcasecmp (name, "section") == 0) { - return; - } - - switch (name[4]) { - case 'a': - context->chapter = 0; - break; - case 't': - context->sect1 = 0; - break; - case '1': - context->sect2 = 0; - break; - case '2': - context->sect3 = 0; - break; - case '3': - context->sect4 = 0; - break; - case '4': - context->sect5 = 0; - break; - case 'n': - /* Nothing should come after the appendix tag */ - /* context->appendix = 0; */ - break; - default: - break; - } - atrs_ptr = ((StackElement *) context->stack->data)->atrs; - - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - if (!g_strcasecmp (*atrs_ptr, context->target_section)) { - ((SectContext *)context->data)->state = LOOKING_FOR_POST_SECT; - } - break; - } - atrs_ptr += 2; - } -} - - -void -sect_author_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - GSList *element_list = NULL; - AuthorInfo *author; - ElementIndex index; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ARTHEADER)); - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - switch (index) { - case ARTHEADER: - break; - default: - return; - }; - author = g_new0 (AuthorInfo, 1); - ((SectContext *) context->data)->header->authors = g_slist_prepend (((SectContext *) context->data)->header->authors, author); -} - -void -sect_author_characters (Context *context, const gchar *chars, int len) -{ - GSList *element_list = NULL; - AuthorInfo *author; - ElementIndex index; - char *temp; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ARTHEADER)); - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - switch (index) { - case ARTHEADER: - break; - default: - sect_write_characters (context, chars, len); - return; - }; - - author = (AuthorInfo *) ((SectContext *) context->data)->header->authors->data; - g_return_if_fail (author != NULL); - temp = g_strndup (chars, len); - if (((StackElement *) context->stack->data)->info->index == FIRSTNAME) - author->firstname = temp; - else if (((StackElement *) context->stack->data)->info->index == OTHERNAME) - author->othername = temp; - else if (((StackElement *) context->stack->data)->info->index == SURNAME) - author->surname = temp; - else if (((StackElement *) context->stack->data)->info->index == EMAIL) { - author->email = temp; - } else if (((StackElement *) context->stack->data)->info->index == ORGNAME) - author->orgname = temp; - else - g_free (temp); -} - -void -sect_email_characters (Context *context, const gchar *chars, int len) -{ - GSList *element_list = NULL; - ElementIndex index; - char *temp; - - if (!IS_IN_SECT (context)) - return; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ARTHEADER)); - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - switch (index) { - case ARTHEADER: - sect_author_characters (context, chars, len); - return; - default: - break; - }; - - temp = g_strndup (chars, len); - sect_print (context, "<%s>", temp, temp); - g_free (temp); -} - -void -sect_country_characters (Context *context, const char *chars, int len) -{ - char *temp; - - if (!IS_IN_SECT (context)) - return; - - temp = g_strndup (chars, len); - sect_print (context, "
%s", temp); - g_free (temp); -} - -void -sect_copyright_characters (Context *context, - const gchar *chars, - int len) -{ - GSList *element_list = NULL; - ElementIndex index; - gchar *temp; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (COPYRIGHT)); - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - temp = g_strndup (chars, len); - - switch (index) { - case COPYRIGHT: - if (((StackElement *) context->stack->data)->info->index == YEAR) - ((SectContext *)context->data)->header->copyright_year = temp; - else if (((StackElement *) context->stack->data)->info->index == HOLDER) - ((SectContext *)context->data)->header->copyright_holder = temp; - break; - default: - g_free (temp); - break; - }; -} - -static gboolean is_in_sect_title = FALSE; - -void -sect_title_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - GSList *element_list = NULL; - StackElement *stack_el; - gchar **atrs_ptr; - SectContext *sect_context; - char *table_msg; - - sect_context = (SectContext *) context->data; - if (!IS_IN_SECT (context)) - return; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TABLE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (IMPORTANT)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSENTRY)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (EXAMPLE)); - stack_el = find_first_element (context, element_list); - - g_slist_free (element_list); - if (stack_el == NULL) - return; - - switch (stack_el->info->index) { - case TABLE: - table_msg = g_strdup_printf (_("Table %d."), sect_context->table_count); - sect_print (context, "

"); - sect_print (context, "%s ", table_msg); - g_free (table_msg); - break; - case PREFACE: - case CHAPTER: - case SECT1: - case SECT2: - case SECT3: - case SECT4: - case SECT5: - case APPENDIX: - case SECTION: - if (context->sect1 == 0) - sect_print (context, "

"); - else if (context->sect2 == 0) - sect_print (context, "

"); - else - sect_print (context, "

"); - sect_print (context, "atrs); - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - sect_print (context, "%s", *atrs_ptr); - break; - } - atrs_ptr += 2; - } - sect_print (context, "\">"); - break; - case FORMALPARA: - sect_print (context, ""); - break; - case GLOSSENTRY: - sect_print (context, "

"); - break; - case EXAMPLE: - sect_print (context, "

"); - break; - default: - break; - }; - -} - -void -sect_title_end_element (Context *context, - const gchar *name) -{ - GSList *element_list = NULL; - ElementIndex index; - - if (!IS_IN_SECT (context)) - return; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TABLE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (IMPORTANT)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSENTRY)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (EXAMPLE)); - - index = find_first_parent (context, element_list); - - switch (index) { - case TABLE: - sect_print (context, "

\n"); - break; - case PREFACE: - case APPENDIX: - sect_print (context, "

\n"); - break; - case CHAPTER: - if (is_in_sect_title == TRUE) { - sect_print (context, "

\n"); - is_in_sect_title = FALSE; - } - break; - case SECT1: - case SECTION: - if (is_in_sect_title == TRUE) { - sect_print (context, "

\n"); - is_in_sect_title = FALSE; - } - break; - case SECT2: - case SECT3: - case SECT4: - case SECT5: - if (is_in_sect_title == TRUE) { - sect_print (context, "\n"); - is_in_sect_title = FALSE; - } - break; - case FORMALPARA: - sect_print (context, "."); - break; - case GLOSSENTRY: - sect_print (context, ""); - break; - case EXAMPLE: - sect_print (context, ""); - default: - break; - }; - - g_slist_free (element_list); - -} - -void -sect_title_characters (Context *context, - const gchar *chars, - int len) -{ - GSList *element_list = NULL; - ElementIndex index; - char *temp; - - - if (((SectContext *)context->data)->state == LOOKING_FOR_SECT_TITLE) { - StackElement *stack_el; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSENTRY)); - - stack_el = find_first_element (context, element_list); - - temp = g_strndup (chars, len); - - sect_print (context, "\n%s\n\n", temp); - sect_print (context, "\n"); - if (stack_el == NULL) { - sect_print (context, "", context->base_file); - sect_print (context, _("Up to Table of Contents")); - sect_print (context, "
\n"); - } -#if 0 - else - sect_print (context, "Up to %s
\n", - context->base_file, - sect_context->topid, - sect_context->top); -#endif - sect_print (context, "

%s

\n", temp); - ((SectContext *)context->data)->state = IN_SECT; - g_free (temp); - return; - } - - if (!IS_IN_SECT (context)) - return; - - temp = g_strndup (chars, len); - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ARTHEADER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TABLE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (IMPORTANT)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSENTRY)); - - index = find_first_parent (context, element_list); - - switch (index) { - case PREFACE: - case CHAPTER: - case SECT1: - case SECT2: - case SECT3: - case SECT4: - case SECT5: - case APPENDIX: - case SECTION: - case FORMALPARA: - case GLOSSENTRY: - sect_print (context, "%s", temp); - g_free (temp); - break; - case ARTHEADER: - if (((StackElement *)context->stack->data)->info->index == TITLE) - ((SectContext *) context->data)->header->title = temp; - else if (((StackElement *)context->stack->data)->info->index == SUBTITLE) - ((SectContext *) context->data)->header->subtitle = temp; - break; - case FIGURE: - ((SectContext *) context->data)->figure->title = temp; - break; - case TABLE: - sect_print (context, "%s", temp); - g_free (temp); - break; - default: - g_free (temp); - break; - }; - - g_slist_free (element_list); -} - -void -sect_ulink_start_element (Context *context, const gchar *name, const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - ulink_start_element (context, name, atrs); -} - - -void -sect_ulink_end_element (Context *context, const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - ulink_end_element (context, name); -} - -void -sect_link_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - gchar **atrs_ptr; - - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "base_file); - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (g_strcasecmp (*atrs_ptr, "linkend") == 0) { - atrs_ptr++; - sect_print (context, "?%s", *atrs_ptr); - break; - } - } - sect_print (context, "\">"); -} - -void -sect_link_end_element (Context *context, const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_xref_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - gchar **atrs_ptr; - gchar *title = NULL; - gchar *fignum_from_figure_id = NULL; - - if (!IS_IN_SECT (context)) - return; - - - atrs_ptr = (gchar **) atrs; - if (*atrs_ptr) { - atrs_ptr++; - fignum_from_figure_id = g_hash_table_lookup (context->figure_data, *atrs_ptr); - atrs_ptr--; - } - - if (fignum_from_figure_id != NULL) { - char *output_msg; - - output_msg = g_strdup_printf (_("Figure %s"), fignum_from_figure_id); - sect_print (context, "%s", output_msg); - g_free (output_msg); - return; - } - - sect_print (context, "base_file); - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "linkend")) { - atrs_ptr++; - sect_print (context, "?%s", *atrs_ptr); - break; - } - atrs_ptr += 2; - } - - if (*atrs_ptr) - title = g_hash_table_lookup (((SectContext *)context->data)->title_hash, *atrs_ptr); - - if (title == NULL) { - sect_print (context, "\">%s", _("the section here")); - } else { - sect_print (context, "\">%s %s", _("the section"), title); - } -} - -void -sect_footnote_start_element (Context *context, const gchar *name, const xmlChar **atrs) -{ - GString *footnote; - gint i; - - if (!IS_IN_SECT (context)) - return; - - footnote = g_string_new (NULL); - context->footnotes = g_slist_append (context->footnotes, footnote); - i = g_slist_length (context->footnotes); - g_print ("[%d]", i, i, i); -} - -void -sect_figure_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - SectContext *sect_context = (SectContext *)context->data; - - /* Increment figure count, before checking for IS_IN_SECT */ - sect_context->figure_count++; - - if (!IS_IN_SECT (context)) - return; - - if (sect_context->figure != NULL) - return; - - sect_context->figure = g_new0 (FigureInfo, 1); -} - -void -sect_figure_end_element (Context *context, - const gchar *name) -{ - SectContext *sect_context = (SectContext *)context->data; - - if (!IS_IN_SECT (context)) - return; - - if (sect_context->figure == NULL) - return; - - if (sect_context->figure->img != NULL) { - char *output_msg; - - if (sect_context->figure->id) - sect_print (context, "", - sect_context->figure->id); - output_msg = g_strdup_printf (_("Figure %d"), sect_context->figure_count); - sect_print (context, "

%s.", output_msg); - g_free (output_msg); - if (sect_context->figure->title) - sect_print (context, " %s", - sect_context->figure->title); - if (sect_context->figure->id) - sect_print (context, ""); - sect_print (context, "

"); - sect_print (context, "\"%s\"

", - context->base_path, - sect_context->figure->img, - (sect_context->figure->alt) ? sect_context->figure->alt : _("IMAGE")); - } - g_free (sect_context->figure->title); - g_free (sect_context->figure->alt); - g_free (sect_context->figure->img); - g_free (sect_context->figure->id); - g_free (sect_context->figure); - sect_context->figure = NULL; -} - -void -sect_inlinegraphic_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - char **atrs_ptr; - char *format; - char *fileref; - char *lowcaseformat; - - if (!IS_IN_SECT (context)) - return; - - format = NULL; - fileref = NULL; - atrs_ptr = (char **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (g_strcasecmp (*atrs_ptr, "format") == 0) { - atrs_ptr++; - format = *atrs_ptr; - atrs_ptr++; - continue; - } else if (g_strcasecmp (*atrs_ptr, "fileref") == 0) { - atrs_ptr++; - fileref = *atrs_ptr; - atrs_ptr++; - continue; - } - atrs_ptr += 2; - } - - if (fileref == NULL) { - return; - } - - /* FIXME bugzilla.gnome.org 44407: Should we put an 'ALT' tag here? */ - if (format == NULL) { - /* Default is PNG */ - sect_print (context, "", context->base_path, fileref); - } else if (g_strcasecmp (format, "gif") == 0) { - sect_print (context, "", context->base_path, fileref); - } else if ((g_strcasecmp (format, "jpg") == 0) || - (g_strcasecmp (format, "jpeg") == 0)) { - /* Some people decide to use .jpg, others use .jpeg */ - lowcaseformat = g_strdup (format); - g_strdown (lowcaseformat); - sect_print (context, "", context->base_path, fileref, lowcaseformat); - g_free (lowcaseformat); - } else { - /* Unknown file format */ - sect_print (context, "", context->base_path, fileref, format); - } -} - - -void -sect_graphic_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - char **atrs_ptr; - char *format; - char *fileref; - char *lowcaseformat; - SectContext *sect_context; - - if (!IS_IN_SECT (context)) - return; - - atrs_ptr = (gchar **) atrs; - format = NULL; - fileref = NULL; - lowcaseformat = NULL; - sect_context = (SectContext *)context->data; - - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "format")) { - atrs_ptr++; - format = *atrs_ptr; - atrs_ptr++; - continue; - } else if (!g_strcasecmp (*atrs_ptr, "fileref")) { - atrs_ptr++; - fileref = *atrs_ptr; - atrs_ptr++; - continue; - } else if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - sect_context->figure->id = g_strdup (*atrs_ptr); - atrs_ptr++; - continue; - } - atrs_ptr += 2; - } - - if (fileref == NULL) - return; - - if (format == NULL) { - /* Default image type */ - sect_context->figure->img = g_strdup_printf ("%s.png", fileref); - } else if (g_strcasecmp (format, "gif") == 0) { - sect_context->figure->img = g_strdup_printf ("%s.gif", fileref); - } else if ((g_strcasecmp (format, "jpg") == 0) || - (g_strcasecmp (format, "jpeg") == 0)) { - /* Some people decide to use .jpg, others use .jpeg */ - lowcaseformat = g_strdup (format); - g_strdown (lowcaseformat); - sect_context->figure->img = g_strdup_printf ("%s.%s", fileref, lowcaseformat); - g_free (lowcaseformat); - } else { - /* Unknown image type */ - sect_context->figure->img = g_strdup_printf ("%s.%s", fileref, format); - } -} - - -static gboolean emphasis_bold = FALSE; -void -sect_em_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - char **atrs_ptr; - char *role; - - if (!IS_IN_SECT (context)) - return; - - atrs_ptr = (gchar **) atrs; - role = NULL; - while (atrs_ptr && *atrs_ptr) { - if (g_strcasecmp (*atrs_ptr, "role") == 0) { - atrs_ptr++; - role = *atrs_ptr; - atrs_ptr++; - continue; - } - atrs_ptr += 2; - } - - if (role) { - emphasis_bold = TRUE; - sect_print (context, ""); - } - else { - sect_print (context, ""); - } -} - -void -sect_em_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - - if (emphasis_bold) { - sect_print (context, ""); - emphasis_bold = FALSE; - } - else { - sect_print (context, ""); - } -} - - -void -sect_tt_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_tt_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_menu_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - GSList *element_list = NULL; - ElementIndex index; - - if (!IS_IN_SECT (context)) - return; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (MENUCHOICE)); - - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - switch (index) { - case MENUCHOICE: - sect_print (context, ""); - break; - default: - return; - }; -} - -void -sect_menu_end_element (Context *context, - const char *name) -{ - GSList *element_list = NULL; - ElementIndex index; - - if (!IS_IN_SECT (context)) - return; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (MENUCHOICE)); - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - switch (index) { - case MENUCHOICE: - sect_print (context, "->"); - break; - default: - return; - }; -} - - -void -sect_b_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_b_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_tti_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_tti_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_btt_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_btt_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_i_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_i_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_itemizedlist_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "

    "); -} - -void -sect_itemizedlist_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
"); -} - -void -sect_orderedlist_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
    "); -} - -void -sect_orderedlist_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
"); -} - -void -sect_variablelist_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
"); -} - -void -sect_variablelist_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
"); -} - -void -sect_listitem_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - GSList *element_list = NULL; - StackElement *stack_el; - - if (!IS_IN_SECT (context)) - return; - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ITEMIZEDLIST)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ORDEREDLIST)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (VARIABLELIST)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (VARLISTENTRY)); - stack_el = find_first_element (context, element_list); - - g_slist_free (element_list); - if (stack_el == NULL) - return; - - switch (stack_el->info->index) { - case VARIABLELIST: - return; - case VARLISTENTRY: - sect_print (context, "
"); - break; - case ITEMIZEDLIST: - case ORDEREDLIST: - sect_print (context, "
  • "); - default: - break; - }; -} - -void -sect_listitem_end_element (Context *context, - const gchar *name) -{ - GSList *element_list = NULL; - StackElement *stack_el; - - if (!IS_IN_SECT (context)) - return; - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ITEMIZEDLIST)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ORDEREDLIST)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (VARIABLELIST)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (VARLISTENTRY)); - stack_el = find_first_element (context, element_list); - - g_slist_free (element_list); - if (stack_el == NULL) - return; - - switch (stack_el->info->index) { - case VARIABLELIST: - return; - case VARLISTENTRY: - sect_print (context, "
  • "); - case ITEMIZEDLIST: - case ORDEREDLIST: - sect_print (context, ""); - default: - break; - }; -} - -void -sect_programlisting_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "\n\n
    \n
    ");
    -}
    -
    -void
    -sect_programlisting_end_element (Context *context,
    -				 const gchar *name)
    -{
    -	if (!IS_IN_SECT (context))
    -		return;
    -
    -	sect_print (context, "
    \n
    \n"); -} - -/* Note that this can return NULL if the file is not found */ -static gchar * -sect_get_infobox_logo (const gchar *name) -{ - if (!g_strcasecmp (name, "tip")) - return gnome_pixmap_file ("gnome-info.png"); - else if (!g_strcasecmp (name, "warning")) - return gnome_pixmap_file ("gnome-warning.png"); - else if (!g_strcasecmp (name, "important")) - return gnome_pixmap_file ("gnome-info.png"); - else if (!g_strcasecmp (name, "note")) - return gnome_pixmap_file ("gnome-info.png"); - return gnome_pixmap_file ("gnome-info.png"); -} - -void -sect_infobox_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - gchar *logo; - - if (!IS_IN_SECT (context)) - return; - - logo = sect_get_infobox_logo (name); - - sect_print (context, "\n\n\n
    "); - if (logo != NULL) - sect_print (context, "\"%s\"", name, logo); - else - sect_print (context, "%s", name); - sect_print (context, "\n"); - sect_print (context, " \n"); - g_free (logo); -} - -void -sect_infobox_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
    \n"); -} - -void -sect_cdata_characters (Context *context, - const gchar *chars, - int len) -{ - gint i; - if (!IS_IN_SECT (context)) - return; - - for (i = 0; i < len; i++) { - if ((i == 0) && (*chars == '\n')) - continue; - if (chars[i] == '<') - sect_print (context, "<"); - else sect_print (context, "%c", chars[i]); - } - -} - -void -sect_keysym_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "("); -} - -void -sect_keysym_end_element (Context *context, const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ")"); -} - -void -sect_funcsynopsis_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ -} - -void -sect_funcsynopsis_end_element (Context *context, - const gchar *name) -{ - GSList *list; - GSList *list2; - SectFuncProtoInfo *proto; - - if (!IS_IN_SECT (context)) - return; - - list = ((SectContext *) context->data)->func_synopsis; - - sect_print (context, "\n"); - while (list) { - proto = (SectFuncProtoInfo *) list->data; - if (proto == NULL) - continue; - - sect_print (context, ""); - if (proto->retval) - sect_print (context, "\n", proto->retval); - else - sect_print (context, "\n"); - if (proto->func) - sect_print (context, "\n", proto->func->str); - else - sect_print (context, "\n"); - sect_print (context, "\n"); - list = list->next; - } - g_slist_free (((SectContext *) context->data)->func_synopsis); - ((SectContext *) context->data)->func_synopsis = NULL; - sect_print (context, "
    %s %s (\n"); - list2 = proto->params; - if (list2 && list2->data) { - sect_print (context, "%s", ((GString *)list2->data)->str); - list2 = list2->next; - } - for (;list2; list2 = list2->next) { - if (list2->data) - sect_print (context, ",
    \n%s", ((GString *)list2->data)->str); - } - sect_print (context, ")

    \n"); -} - -void -sect_funcprototype_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - SectFuncProtoInfo *proto; - - if (!IS_IN_SECT (context)) - return; - - proto = g_new0 (SectFuncProtoInfo, 1); - ((SectContext *) context->data)->func_synopsis = - g_slist_append (((SectContext *) context->data)->func_synopsis, - proto); -} - - -void -sect_funcdef_characters (Context *context, - const gchar *chars, - int len) -{ - SectFuncProtoInfo *proto; - GSList *list; - - if (!IS_IN_SECT (context)) - return; - - if (((SectContext *) context->data)->func_synopsis == NULL) - return; - - proto = g_new0 (SectFuncProtoInfo, 1); - list = g_slist_last (((SectContext *) context->data)->func_synopsis); - proto = (SectFuncProtoInfo *) list->data; - if (proto->retval == NULL) - proto->retval = g_strndup (chars, len); -} - -void -sect_funcparams_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "("); -} - -void -sect_funcparams_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ")"); -} - -void -sect_paramdef_start_element (Context *context, - const gchar *chars, - int len) -{ - SectFuncProtoInfo *proto; - GSList *list; - - if (!IS_IN_SECT (context)) - return; - - if (((SectContext *) context->data)->func_synopsis == NULL) - return; - - list = g_slist_last (((SectContext *)(context->data))->func_synopsis); - - proto = (SectFuncProtoInfo *) list->data; - - if (proto == NULL) - return; - - proto->params = g_slist_append (proto->params, g_string_new ("")); -} -void -sect_void_start_element (Context *context, - const gchar *chars, - int len) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "void"); -} - - -void -sect_informaltable_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, - "\n"); -} - -void -sect_informaltable_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
    \n"); -} - -void -sect_table_with_border_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - SectContext *sect_context; - - sect_context = (SectContext *) context->data; - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "\n"); - - sect_context->table_count++; -} - -void -sect_table_without_border_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
    \n"); -} - -void -sect_table_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context,"
    \n"); -} - -void -sect_row_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "\n"); -} - -void -sect_row_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "\n"); -} -void -sect_entry_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - GSList *element_list = NULL; - StackElement *stack_el; - - if (!IS_IN_SECT (context)) - return; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (THEAD)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TBODY)); - stack_el = find_first_element (context, element_list); - g_slist_free (element_list); - - if (stack_el == NULL) { - return; - } - - switch (stack_el->info->index) { - case THEAD: - sect_print (context, ""); - break; - case TBODY: - sect_print (context, ""); - break; - default: - break; - }; -} - -void -sect_entry_end_element (Context *context, - const char *name) -{ - GSList *element_list = NULL; - StackElement *stack_el; - - if (!IS_IN_SECT (context)) - return; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (THEAD)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TBODY)); - stack_el = find_first_element (context, element_list); - g_slist_free (element_list); - if (stack_el == NULL) { - return; - } - - if (context->empty_element) { - /* We encoutnered an 'empty' element */ - g_print (" "); - } - - switch (stack_el->info->index) { - case THEAD: - sect_print (context, "\n"); - break; - case TBODY: - sect_print (context, "\n"); - break; - default: - break; - } -} - -void -sect_thead_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_thead_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_tbody_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_tbody_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_member_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_member_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "\n"); -} - -void -sect_sup_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_sup_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, ""); -} - -void -sect_quote_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "\""); -} - -void sect_quote_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "\""); -} - -void -sect_blockquote_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
    "); -} - -void -sect_blockquote_end_element (Context *context, - const char *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
    \n"); -} - -void -sect_legalnotice_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - SectContext *sect_context; - - sect_context = (SectContext *)context->data; - - if ((g_strcasecmp (context->target_section, "legalnotice") != 0) || IS_IN_SECT (context)) { - /* If we are not searching for the legalnotice or we are - * currently in a sect then abort */ - return; - } - - sect_context->state = IN_SECT; - sect_print (context, "\n%s\n\n", _("Legal Notice")); - sect_print (context, "\n"); - sect_print (context, "

    %s

    \n", _("Legal Notice")); - -} - -void -sect_legalnotice_end_element (Context *context, - const char *name) -{ - SectContext *sect_context; - char *prev_link; - - sect_context = (SectContext *)context->data; - - if (g_strcasecmp (context->target_section, "legalnotice") != 0) { - return; - } - - - prev_link = g_strdup_printf ("gnome-help:%s", context->base_file); - print_footer (prev_link, prev_link, NULL); - g_free (prev_link); - - sect_context->state = DONE_WITH_SECT; -} - -void -sect_legalnotice_characters (Context *context, - const char *chars, - int len) -{ - if (g_strcasecmp (context->target_section, "legalnotice") != 0) { - return; - } - - sect_write_characters (context, chars, len); -} - -void -sect_question_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - /* This 'Q' is short for 'Question:' */ - sect_print (context, "

    %s: ", _("Q")); -} - -void -sect_answer_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - /* This 'A' is short for 'Answer' */ - sect_print (context, "

    %s: ", _("A")); -} - - -void -sect_glosssee_start_element (Context *context, const gchar *name, const xmlChar **atrs) -{ - gchar **atrs_ptr; - gchar *temp; - - if (!IS_IN_SECT (context)) - return; - - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "otherterm")) { - atrs_ptr++; - ((StackElement *)context->stack->data)->atrs = g_new0 (gchar *, 3); - ((StackElement *)context->stack->data)->atrs[0] = g_strdup ("otherterm"); - ((StackElement *)context->stack->data)->atrs[1] = g_strdup (*atrs_ptr); - - if (g_hash_table_lookup (context->glossary_data, *atrs_ptr)) { - temp = g_hash_table_lookup (context->glossary_data, *atrs_ptr); - g_print("
    %s: %s\n", _("See"), context->base_file, *atrs_ptr, temp); - } - atrs_ptr += 2; - } - } -} - -void -sect_glossseealso_start_element (Context *context, const gchar *name, const xmlChar **atrs) -{ - - gchar **atrs_ptr; - gchar *temp; - - if (!IS_IN_SECT (context)) - return; - - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "otherterm")) { - atrs_ptr++; - ((StackElement *)context->stack->data)->atrs = g_new0 (gchar *, 3); - ((StackElement *)context->stack->data)->atrs[0] = g_strdup ("otherterm"); - ((StackElement *)context->stack->data)->atrs[1] = g_strdup (*atrs_ptr); - - if ( g_hash_table_lookup (context->glossary_data, *atrs_ptr)) { - temp = g_hash_table_lookup (context->glossary_data, *atrs_ptr); - g_print("
    %s: %s\n", _("See also"), context->base_file, *atrs_ptr, temp); - } - atrs_ptr += 2; - } - } -} - -void -sect_varlistentry_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - return; -} - -void -sect_varlistentry_end_element (Context *context, - const gchar *name) -{ - return; -} - -void -sect_address_characters (Context *context, - const char *chars, - int len) -{ - gchar *temp; - - if (!IS_IN_SECT (context)) - return; - - if (context->start_address_character == TRUE) { - g_print ("
       "); - context->start_address_character = FALSE; - } - - temp = g_strndup (chars, len); - sect_print (context, "%s", temp); - g_free (temp); -} -void -sect_address_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - context->start_address_character = TRUE; -} - -void -sect_address_end_element (Context *context, - const gchar *name) -{ - context->start_address_character = FALSE; -} - -void -sect_street_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - sect_print (context, "
       "); -} - -void -sect_city_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - sect_print (context, "
       "); -} - -void -sect_country_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - sect_print (context, "
       "); -} - -void -sect_literallayout_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "

    ");
    -}
    -
    -void
    -sect_literallayout_end_element (Context *context,
    -			   	const gchar *name)
    -{
    -	if (!IS_IN_SECT (context))
    -		return;
    -
    -	sect_print (context, "
    "); -} - -void -sect_bridgehead_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "

    "); -} - -void -sect_bridgehead_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "

    "); -} - -void -sect_term_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
    "); -} - -void -sect_term_end_element (Context *context, - const gchar *name) -{ - if (!IS_IN_SECT (context)) - return; - - sect_print (context, "
    "); -} diff --git a/components/help/converters/gnome-db2html2/sect-elements.h b/components/help/converters/gnome-db2html2/sect-elements.h deleted file mode 100644 index 18d1e94c5..000000000 --- a/components/help/converters/gnome-db2html2/sect-elements.h +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef __SECT_ELEMENTS_H__ -#define __SECT_ELEMENTS_H__ - -#include "gdb3html.h" - -extern ElementInfo sect_elements[]; - -gpointer sect_init_data (void); - -typedef enum SectContextState { - LOOKING_FOR_SECT, - LOOKING_FOR_SECT_TITLE, - IN_SECT, - LOOKING_FOR_POST_SECT, - DONE_WITH_SECT, -} SectContextState; - -typedef struct _SectFuncProtoInfo SectFuncProtoInfo; -struct _SectFuncProtoInfo { - gchar *retval; - GString *func; - GSList *params; -}; - -typedef struct _SectContext SectContext; -struct _SectContext { - HeaderInfo *header; - FigureInfo *figure; - gint figure_count; - gint table_count; - gchar *prev; - gchar *previd; - SectContextState state; - GHashTable *title_hash; - GString *legalpara; - /* A list full of protos. */ - GSList *func_synopsis; -}; - -void sect_print (Context *context, gchar *format, ...); -void sect_write_characters (Context *context, const gchar *chars, int len); -void sect_article_end_element (Context *context, const gchar *name); -void sect_sect_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_sect_end_element (Context *context, const gchar *name); -void sect_para_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_para_end_element (Context *context, const gchar *name); -void sect_formalpara_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_formalpara_end_element (Context *context, const gchar *name); -void sect_author_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_author_characters (Context *context, const gchar *chars, int len); -void sect_email_characters (Context *context, const gchar *chars, int len); -void sect_copyright_characters (Context *context, const gchar *chars, int len); -void sect_title_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_title_end_element (Context *context, const gchar *name); -void sect_title_characters (Context *context, const gchar *chars, int len); -void sect_ulink_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_ulink_end_element (Context *context, const gchar *name); -void sect_xref_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_footnote_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_figure_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_figure_end_element (Context *context, const gchar *name); -void sect_graphic_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_em_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_em_end_element (Context *context, const gchar *name); -void sect_tt_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_tt_end_element (Context *context, const gchar *name); -void sect_b_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_b_end_element (Context *context, const gchar *name); -void sect_tti_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_tti_end_element (Context *context, const gchar *name); -void sect_btt_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_btt_end_element (Context *context, const gchar *name); -void sect_i_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_i_end_element (Context *context, const gchar *name); -void sect_itemizedlist_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_itemizedlist_end_element (Context *context, const gchar *name); -void sect_orderedlist_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_orderedlist_end_element (Context *context, const gchar *name); -void sect_variablelist_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_variablelist_end_element (Context *context, const gchar *name); -void sect_listitem_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_listitem_end_element (Context *context, const gchar *name); -void sect_programlisting_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_programlisting_end_element (Context *context, const gchar *name); -void sect_infobox_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_infobox_end_element (Context *context, const gchar *name); -void sect_cdata_characters (Context *context, const gchar *chars, int len); -void sect_keysym_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_keysym_end_element (Context *context, const gchar *name); -void sect_funcsynopsis_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_funcsynopsis_end_element (Context *context, const gchar *name); -void sect_funcprototype_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_funcdef_characters (Context *context, const gchar *chars, int len); -void sect_funcparams_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_funcparams_end_element (Context *context, const gchar *name); -void sect_paramdef_start_element (Context *context, const gchar *chars, int len); -void sect_parameter_characters (Context *context, const gchar *chars, int len); -void sect_void_start_element (Context *context, const gchar *chars, int len); -void sect_link_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_link_end_element (Context *context, const char *name); -void sect_menu_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_menu_end_element (Context *context, const char *name); -void sect_informaltable_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_informaltable_end_element (Context *context, const char *name); -void sect_table_with_border_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_table_without_border_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_table_end_element (Context *context, const char *name); -void sect_row_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_row_end_element (Context *context, const char *name); -void sect_entry_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_entry_end_element (Context *context, const char *name); -void sect_thead_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_thead_end_element (Context *context, const char *name); -void sect_tbody_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_tbody_end_element (Context *context, const char *name); -void sect_country_characters (Context *context, const char *chars, int len); -void sect_member_start_element (Context *context, const char *chars, const xmlChar **atrs); -void sect_member_end_element (Context *context, const char *name); -void sect_quote_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_quote_end_element (Context *context, const char *name); -void sect_sup_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_sup_end_element (Context *context, const char *name); -void sect_blockquote_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_blockquote_end_element (Context *context, const char *name); -void sect_inlinegraphic_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_legalnotice_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_legalnotice_end_element (Context *context, const char *name); -void sect_legalnotice_characters (Context *context, const char *chars, int len); -void sect_question_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_answer_start_element (Context *context, const char *name, const xmlChar **atrs); -void sect_glosssee_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_glossseealso_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_glossee_end_element (Context *context, const gchar *name); -void sect_varlistentry_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_varlistentry_end_element (Context *context, const gchar *name); -void sect_address_characters (Context *context, const char *chars, int len); -void sect_address_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_address_end_element (Context *context, const gchar *name); -void sect_street_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_city_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_country_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_literallayout_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_literallayout_end_element (Context *context, const gchar *name); -void sect_bridgehead_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_bridgehead_end_element (Context *context, const gchar *name); -void sect_term_start_element (Context *context, const gchar *name, const xmlChar **atrs); -void sect_term_end_element (Context *context, const gchar *name); -#endif diff --git a/components/help/converters/gnome-db2html2/sect-preparse.c b/components/help/converters/gnome-db2html2/sect-preparse.c deleted file mode 100644 index 455f67880..000000000 --- a/components/help/converters/gnome-db2html2/sect-preparse.c +++ /dev/null @@ -1,399 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "sect-elements.h" -#include "gnome.h" - - -static void sect_preparse_sect_start_element (Context *context, const gchar *name, const xmlChar **atrs); -static void sect_preparse_title_characters (Context *context, const gchar *chars, gint len); -static void sect_preparse_figure_start_element (Context *context, const char *name, const xmlChar **atrs); -static void sect_preparse_set_doctype (Context *context, const char *name, const xmlChar **atrs); -static void sect_preparse_glossterm_start_element (Context *context, const char *name, const xmlChar **atrs); -static void sect_preparse_glossterm_characters (Context *context, const gchar *chars, int len); -static void sect_preparse_glossterm_end_element (Context *context, const char *name, const xmlChar **atrs); -static void sect_preparse_glossentry_start_element (Context *context, const char *name, const xmlChar **atrs); -static void sect_preparse_acronym_characters (Context *context, const gchar *chars, int len); -static void gloss_term_append (Context *context, const gchar *chars, int len); - - -ElementInfo sect_preparse[] = { - { ARTICLE, "article", (startElementSAXFunc) sect_preparse_set_doctype, NULL, NULL}, - { BOOK, "book", (startElementSAXFunc) sect_preparse_set_doctype, NULL, NULL}, - { SECTION, "section", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { SECT1, "sect1", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { SECT2, "sect2", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { SECT3, "sect3", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { SECT4, "sect4", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { SECT5, "sect5", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { PARA, "para", NULL, NULL, NULL}, - { FORMALPARA, "formalpara", NULL, NULL, NULL}, - { BOOKINFO, "bookinfo", NULL, NULL, NULL}, - { ARTHEADER, "artheader", NULL, NULL, NULL}, - { ARTICLEINFO, "articleinfo", NULL, NULL, NULL}, - { GLOSSARYINFO, "glossaryinfo", NULL, NULL, NULL}, - { AUTHORGROUP, "authorgroup", NULL, NULL, NULL}, - { AUTHOR, "author", NULL, NULL, NULL}, - { FIRSTNAME, "firstname", NULL, NULL, NULL}, - { OTHERNAME, "othername", NULL, NULL, NULL}, - { SURNAME, "surname", NULL, NULL, NULL}, - { AFFILIATION, "affiliation", NULL, NULL, NULL}, - { EMAIL, "email", NULL, NULL, NULL}, - { ORGNAME, "orgname", NULL, NULL, NULL}, - { ADDRESS, "address", NULL, NULL, NULL}, - { COPYRIGHT, "copyright", NULL, NULL, NULL}, - { YEAR, "year", NULL, NULL, NULL}, - { HOLDER, "holder", NULL, NULL, NULL}, - { TITLE, "title", NULL, NULL, (charactersSAXFunc) sect_preparse_title_characters}, - { SUBTITLE, "subtitle", NULL, NULL, NULL}, - { ULINK, "ulink", NULL, NULL, NULL}, - { XREF, "xref", NULL, NULL, NULL}, - { FOOTNOTE, "footnote", NULL, NULL, NULL}, - { FIGURE, "figure", (startElementSAXFunc) sect_preparse_figure_start_element, NULL, NULL}, - { GRAPHIC, "graphic", NULL, NULL, NULL}, - { CITETITLE, "citetitle", NULL, NULL, NULL}, - { APPLICATION, "application", NULL, NULL, NULL}, - { FILENAME, "filename", NULL, NULL, NULL}, - { ITEMIZEDLIST, "itemizedlist", NULL, NULL, NULL}, - { ORDEREDLIST, "orderedlist", NULL, NULL, NULL}, - { VARIABLELIST, "variablelist", NULL, NULL, NULL}, - { LISTITEM, "listitem", NULL, NULL, NULL}, - { PROGRAMLISTING, "programlisting", NULL, NULL, NULL}, - { SGMLTAG, "sgmltag", NULL, NULL, NULL}, - { EMPHASIS, "emphasis", NULL, NULL, NULL}, - { TIP, "tip", NULL, NULL, NULL}, - { WARNING, "warning", NULL, NULL, NULL}, - { IMPORTANT, "important", NULL, NULL, NULL}, - { NOTE, "note", NULL, NULL, NULL}, - { CDATA, "cdata", NULL, NULL, NULL}, - { SCREEN, "screen", NULL, NULL, NULL}, - { SCREENSHOT, "screenshot", NULL, NULL, NULL}, - { SCREENINFO, "screeninfo", NULL, NULL, NULL}, - { COMMAND, "command", NULL, NULL, NULL}, - { REPLACEABLE, "replaceable", NULL, NULL, NULL}, - { FUNCTION, "function", NULL, NULL, NULL}, - { GUIBUTTON, "guibutton", NULL, NULL, NULL}, - { GUIICON, "guiicon", NULL, NULL, NULL}, - { GUILABEL, "guilabel", NULL, NULL, NULL}, - { GUIMENU, "guimenu", NULL, NULL, NULL}, - { GUIMENUITEM, "guimenuitem", NULL, NULL, NULL}, - { HARDWARE, "hardware", NULL, NULL, NULL}, - { KEYCAP, "keycap", NULL, NULL, NULL}, - { KEYCODE, "keycode", NULL, NULL, NULL}, - { KEYSYM, "keysym", NULL, NULL, NULL}, - { LITERAL, "literal", NULL, NULL, NULL}, - { PARAMETER, "parameter", NULL, NULL, NULL}, - { PROMPT, "prompt", NULL, NULL, NULL}, - { SYMBOL, "symbol", NULL, NULL, NULL}, - { USERINPUT, "userinput", NULL, NULL, NULL}, - { CAUTION, "caution", NULL, NULL, NULL}, - { LEGALPARA, "legalpara", NULL, NULL, NULL}, - { FIRSTTERM, "firstterm", NULL, NULL, NULL}, - { STRUCTNAME, "structname", NULL, NULL, NULL}, - { STRUCTFIELD, "structfield", NULL, NULL, NULL}, - { FUNCSYNOPSIS, "funcsynopsis", NULL, NULL, NULL}, - { FUNCPROTOTYPE, "funcprototype", NULL, NULL, NULL}, - { FUNCDEF, "funcdef", NULL, NULL, NULL}, - { FUNCPARAMS, "funcparams", NULL, NULL, NULL}, - { PARAMDEF, "paramdef", NULL, NULL, NULL}, - { VOID, "void", NULL, NULL, NULL}, - { GUISUBMENU, "guisubmenu", NULL, NULL, NULL}, - { INTERFACE, "interface", NULL, NULL, NULL}, - { LINK, "link", NULL, NULL, NULL}, - { MENUCHOICE, "menuchoice", NULL, NULL, NULL}, - { TABLE, "table", NULL, NULL, NULL}, - { INFORMALTABLE, "informaltable", NULL, NULL, NULL}, - { ROW, "row", NULL, NULL, NULL}, - { ENTRY, "entry", NULL, NULL, NULL}, - { THEAD, "thead", NULL, NULL, NULL}, - { TBODY, "tbody", NULL, NULL, NULL}, - { ACRONYM, "acronym", NULL, NULL, (charactersSAXFunc) sect_preparse_acronym_characters}, - { MARKUP, "markup", NULL, NULL, NULL}, - { SIMPLELIST, "simplelist", NULL, NULL, NULL}, - { MEMBER, "member", NULL, NULL, NULL}, - { MOUSEBUTTON, "mousebutton", NULL, NULL, NULL}, - { SUPERSCRIPT, "superscript", NULL, NULL, NULL}, - { SYSTEMITEM, "systemitem", NULL, NULL, NULL}, - { VARNAME, "varname", NULL, NULL, NULL}, - { BLOCKQUOTE, "blockquote", NULL, NULL, NULL}, - { QUOTE, "quote", NULL, NULL, NULL}, - { OPTION, "option", NULL, NULL, NULL}, - { ENVAR, "envar", NULL, NULL, NULL}, - { COMPUTEROUTPUT, "computeroutput", NULL, NULL, NULL}, - { INLINEGRAPHIC, "inlinegraphic", NULL, NULL, NULL}, - { LEGALNOTICE, "legalnotice", NULL, NULL, NULL}, - { QUESTION, "question", NULL, NULL, NULL}, - { ANSWER, "answer", NULL, NULL, NULL}, - { CHAPTER, "chapter", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { PREFACE, "preface", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { TERM, "term", NULL, NULL, NULL}, - { APPENDIX, "appendix", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { DOCINFO, "docinfo", NULL, NULL, NULL}, - { GLOSSARY, "glossary", (startElementSAXFunc) sect_preparse_set_doctype, NULL, NULL}, - { GLOSSDIV, "glossdiv", (startElementSAXFunc) sect_preparse_sect_start_element, NULL, NULL}, - { GLOSSENTRY, "glossentry", (startElementSAXFunc) sect_preparse_glossentry_start_element, NULL, NULL}, - { GLOSSTERM, "glossterm", (startElementSAXFunc) sect_preparse_glossterm_start_element, (endElementSAXFunc) sect_preparse_glossterm_end_element, (charactersSAXFunc) sect_preparse_glossterm_characters}, - { GLOSSSEE, "glosssee", NULL, NULL, NULL}, - { GLOSSSEEALSO, "glossseealso", NULL, NULL, NULL}, - { EXAMPLE, "example", NULL, NULL, NULL}, - { VARLISTENTRY, "varlistentry", NULL, NULL, NULL}, - { STREET, "street", NULL, NULL, NULL}, - { CITY, "city", NULL, NULL, NULL}, - { COUNTRY, "country", NULL, NULL, NULL}, - { STATE, "state", NULL, NULL, NULL}, - { POSTCODE, "postcode", NULL, NULL, NULL}, - { LITERALLAYOUT, "literallayout", NULL, NULL, NULL}, - { QANDAENTRY, "quandaentry", NULL, NULL, NULL}, - { QANDASET, "quandaset", NULL, NULL, NULL}, - { BRIDGEHEAD, "bridgehead", NULL, NULL, NULL}, - { UNDEFINED, NULL, NULL, NULL, NULL} -}; - -static void -sect_preparse_set_doctype (Context *context, - const char *name, - const xmlChar **atrs) -{ - if (g_strcasecmp (name, "article") == 0) { - context->doctype = ARTICLE_DOC; - } else if (g_strcasecmp (name, "book") == 0) { - context->doctype = BOOK_DOC; - } else if (g_strcasecmp (name, "glossary") == 0) { - context->doctype = GLOSSARY_DOC; - } -} - - -static void -sect_preparse_sect_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - GSList *element_list; - StackElement *stack_el; - gchar **atrs_ptr; - - element_list = NULL; - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (NOTE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TIP)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (WARNING)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GRAPHIC)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CAUTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (IMPORTANT)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSDIV)); - stack_el = find_first_element (context, element_list); - - g_slist_free (element_list); - - if (stack_el == NULL) { - if (g_strcasecmp(name, "section") == 0) { - return; - } - } - - - switch (name[4]) { - case 'a': - sect1id_stack_add (context, name, atrs); - break; - case 't': - sect1id_stack_add (context, name, atrs); - break; - case 's': - sect1id_stack_add (context, name, atrs); - break; - case '1': - if (context->doctype == ARTICLE_DOC && stack_el->info->index != APPENDIX) { - sect1id_stack_add (context, name, atrs); - } - break; - case 'n': - sect1id_stack_add (context, name, atrs); - break; - default: - break; - } - - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - ((StackElement *)context->stack->data)->atrs = g_new0 (gchar *, 3); - ((StackElement *)context->stack->data)->atrs[0] = g_strdup ("id"); - ((StackElement *)context->stack->data)->atrs[1] = g_strdup (*atrs_ptr); - break; - } - atrs_ptr += 2; - } -} - -static void -sect_preparse_title_characters (Context *context, - const gchar *chars, - gint len) -{ - GSList *element_list = NULL; - StackElement *stack_el; - gchar **atrs_ptr; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - - stack_el = find_first_element (context, element_list); - - g_slist_free (element_list); - if (stack_el == NULL) - return; - - atrs_ptr = stack_el->atrs; - - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - gchar *temp; - - temp = g_strndup (chars, len); - atrs_ptr++; - if (g_hash_table_lookup (((SectContext *)context->data)->title_hash, *atrs_ptr) == NULL) { - g_hash_table_insert (((SectContext *)context->data)->title_hash, g_strdup (*atrs_ptr), temp); - } else { - g_free (temp); - } - break; - } - atrs_ptr += 2; - } -} - -static void -sect_preparse_figure_start_element (Context *context, - const char *name, - const xmlChar **atrs) -{ - gchar **atrs_ptr; - static gint figure_num = 0; - - - figure_num++; - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (g_strcasecmp (*atrs_ptr, "id") == 0) { - atrs_ptr++; - if (context->figure_data == NULL) { - context->figure_data = g_hash_table_new (g_str_hash, g_str_equal); - } - if (g_hash_table_lookup (context->figure_data, *atrs_ptr) == NULL) { - /* The key is the 'figure id' - The data is the 'sect id' */ - g_hash_table_insert (context->figure_data, g_strdup (*atrs_ptr), g_strdup_printf("%d",figure_num)); - } - break; - } - atrs_ptr += 2; - } -} - -static void -sect_preparse_glossterm_characters (Context *context, - const gchar *chars, - int len) -{ - gloss_term_append (context, chars, len); -} - -static void -sect_preparse_acronym_characters (Context *context, - const gchar *chars, - int len) -{ - gloss_term_append (context, chars, len); -} - -static void -gloss_term_append (Context *context, - const gchar *chars, - int len) -{ - GList *temp_list; - char *temp_glossentry; - char *temp; - char *new_string; - char *origkey; - char *origdata; - - if (context->in_glossterm == TRUE) { - temp = g_strndup (chars, len); - temp_glossentry = NULL; - /* get most recent entry to glossentry stack */ - temp_list = g_list_first (context->glossentry_stack); - - if (temp_list != NULL) { - temp_glossentry = g_strdup_printf ("%s", (char *)temp_list->data); - } else { return; } - - /* check to see if glossary_data hash exists - if not create it */ - if (context->glossary_data == NULL) { - context->glossary_data = g_hash_table_new (g_str_hash, g_str_equal); - } - /* check to see if an entry for temp_glossentry exists - if not create it */ - if (g_hash_table_lookup (context->glossary_data, temp_glossentry) == NULL) { - /* The key is the 'glossentry id' - The data is the 'glossterm' */ - g_hash_table_insert (context->glossary_data, g_strdup (temp_glossentry), temp); - } else { - /* An entry already exists. Add to it. */ - if (g_hash_table_lookup_extended (context->glossary_data, temp_glossentry, - (gpointer *)&origkey, - (gpointer *)&origdata)) { - new_string = g_strconcat ((gchar *)origdata, temp, NULL ); - g_free(origdata); - g_hash_table_remove(context->glossary_data, origkey); - g_hash_table_insert(context->glossary_data, origkey, new_string); - g_free(temp_glossentry); - } - } - } -} - -static void -sect_preparse_glossentry_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - glossentry_stack_add (context, name, atrs); -} - -static void -sect_preparse_glossterm_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - context->in_glossterm = TRUE; - return; -} - -static void -sect_preparse_glossterm_end_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - context->in_glossterm = FALSE; - return; -} diff --git a/components/help/converters/gnome-db2html2/sect-preparse.h b/components/help/converters/gnome-db2html2/sect-preparse.h deleted file mode 100644 index 25d5d1ab1..000000000 --- a/components/help/converters/gnome-db2html2/sect-preparse.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __SECT_PREPARSE_H__ -#define __SECT_PREPARSE_H__ - -#include "gdb3html.h" - -extern ElementInfo sect_preparse[]; - - -#endif diff --git a/components/help/converters/gnome-db2html2/toc-elements.c b/components/help/converters/gnome-db2html2/toc-elements.c deleted file mode 100644 index 39b873d6b..000000000 --- a/components/help/converters/gnome-db2html2/toc-elements.c +++ /dev/null @@ -1,873 +0,0 @@ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include "sect-elements.h" -#include "toc-elements.h" - -static gboolean in_printed_title = FALSE; -typedef struct _TocContext TocContext; -struct _TocContext { - HeaderInfo *header; -}; - -static void toc_sect_start_element (Context *context, const gchar *name, const xmlChar **atrs); -static void toc_sect_end_element (Context *context, const gchar *name); -static void toc_artheader_end_element (Context *context, const gchar *name); -static void toc_author_start_element (Context *context, const gchar *name, const xmlChar **atrs); -static void toc_author_characters (Context *context, const gchar *chars, int len); -static void toc_copyright_characters (Context *context, const gchar *chars, int len); -static void toc_title_start_element (Context *context, const gchar *name, const xmlChar **atrs); -static void toc_title_end_element (Context *context, const gchar *name); -static void toc_title_characters (Context *context, const gchar *chars, int len); -static void toc_glossdiv_start_element (Context *context, const gchar *name, const xmlChar **atrs); -static void toc_glossdiv_end_element (Context *context, const gchar *name); -static void toc_glossentry_start_element (Context *context, const gchar *name, const xmlChar **atrs); -static void toc_glossentry_end_element (Context *context, const gchar *name); -static void toc_glossterm_start_element (Context *context, const gchar *name, const xmlChar **atrs); -static void toc_glossterm_end_element (Context *context, const gchar *name); -static void toc_tag_characters (Context *context, const gchar *chars, int len); -static void toc_releaseinfo_characters (Context *context, const gchar *chars, int len); - -ElementInfo toc_elements[] = { - { ARTICLE, "article", (startElementSAXFunc) article_start_element, NULL, NULL}, - { BOOK, "book", (startElementSAXFunc) book_start_element, NULL, NULL}, - { SECTION, "section", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { SECT1, "sect1", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { SECT2, "sect2", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { SECT3, "sect3", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { SECT4, "sect4", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { SECT5, "sect5", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { PARA, "para", NULL, NULL, NULL}, - { FORMALPARA, "formalpara", NULL, NULL, NULL}, - { BOOKINFO, "bookinfo", (startElementSAXFunc) artheader_start_element, (endElementSAXFunc) toc_artheader_end_element, NULL}, - { ARTHEADER, "artheader", (startElementSAXFunc) artheader_start_element, (endElementSAXFunc) toc_artheader_end_element, NULL}, - { ARTICLEINFO, "articleinfo", (startElementSAXFunc) artheader_start_element, (endElementSAXFunc) toc_artheader_end_element, NULL}, - { GLOSSARYINFO, "glossaryinfo", (startElementSAXFunc) artheader_start_element, (endElementSAXFunc) toc_artheader_end_element, NULL}, - { AUTHORGROUP, "authorgroup", NULL, NULL, NULL}, - { AUTHOR, "author", (startElementSAXFunc) toc_author_start_element, NULL, NULL}, - { FIRSTNAME, "firstname", NULL, NULL, (charactersSAXFunc) toc_author_characters }, - { OTHERNAME, "othername", NULL, NULL, (charactersSAXFunc) toc_author_characters }, - { SURNAME, "surname", NULL, NULL, (charactersSAXFunc) toc_author_characters }, - { AFFILIATION, "affiliation", NULL, NULL, NULL}, - { EMAIL, "email", NULL, NULL, (charactersSAXFunc) toc_author_characters }, - { ORGNAME, "orgname", NULL, NULL, (charactersSAXFunc) toc_author_characters }, - { ADDRESS, "address", NULL, NULL, NULL}, - { COPYRIGHT, "copyright", NULL, NULL, NULL}, - { YEAR, "year", NULL, NULL, (charactersSAXFunc) toc_copyright_characters}, - { HOLDER, "holder", NULL, NULL, (charactersSAXFunc) toc_copyright_characters}, - { TITLE, "title", (startElementSAXFunc) toc_title_start_element, (endElementSAXFunc) toc_title_end_element, (charactersSAXFunc) toc_title_characters }, - { SUBTITLE, "subtitle", (startElementSAXFunc) toc_title_start_element, (endElementSAXFunc) toc_title_end_element, (charactersSAXFunc) toc_title_characters }, - { ULINK, "ulink", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { XREF, "xref", NULL, NULL, NULL}, - { FOOTNOTE, "footnote", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { FIGURE, "figure", NULL, NULL, NULL}, - { GRAPHIC, "graphic", NULL, NULL, NULL}, - { CITETITLE, "citetitle", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { APPLICATION, "application", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { FILENAME, "filename", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { ITEMIZEDLIST, "itemizedlist", NULL, NULL, NULL}, - { ORDEREDLIST, "orderedlist", NULL, NULL, NULL}, - { VARIABLELIST, "variablelist", NULL, NULL, NULL}, - { LISTITEM, "listitem", NULL, NULL, NULL}, - { PROGRAMLISTING, "programlisting", NULL, NULL, NULL}, - { SGMLTAG, "sgmltag", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { EMPHASIS, "emphasis", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { TIP, "tip", NULL, NULL, NULL}, - { WARNING, "warning", NULL, NULL, NULL}, - { IMPORTANT, "important", NULL, NULL, NULL}, - { NOTE, "note", NULL, NULL, NULL}, - { CDATA, "cdata", NULL, NULL, NULL}, - { SCREEN, "screen", NULL, NULL, NULL}, - { SCREENSHOT, "screenshot", NULL, NULL, NULL}, - { SCREENINFO, "screeninfo", NULL, NULL, NULL}, - { COMMAND, "command", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { REPLACEABLE, "replaceable", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { FUNCTION, "function", NULL, NULL, (charactersSAXFunc) toc_tag_characters}, - { GUIBUTTON, "guibutton", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { GUIICON, "guiicon", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { GUILABEL, "guilabel", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { GUIMENU, "guimenu", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { GUIMENUITEM, "guimenuitem", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { HARDWARE, "hardware", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { KEYCAP, "keycap", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { KEYCODE, "keycode", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { KEYSYM, "keysym", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { LITERAL, "literal", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { PARAMETER, "parameter", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { PROMPT, "prompt", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { SYMBOL, "symbol", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { USERINPUT, "userinput", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { CAUTION, "caution", NULL, NULL, NULL}, - { LEGALPARA, "legalpara", NULL, NULL, NULL}, - { FIRSTTERM, "firstterm", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { STRUCTNAME, "structname", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { STRUCTFIELD, "structfield", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { FUNCSYNOPSIS, "funcsynopsis", NULL, NULL, NULL}, - { FUNCPROTOTYPE, "funcprototype", NULL, NULL, NULL}, - { FUNCDEF, "funcdef", NULL, NULL, NULL}, - { FUNCPARAMS, "funcparams", NULL, NULL, NULL}, - { PARAMDEF, "paramdef", NULL, NULL, NULL}, - { VOID, "void", NULL, NULL, NULL}, - { GUISUBMENU, "guisubmenu", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { INTERFACE, "interface", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { LINK, "link", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { MENUCHOICE, "menuchoice", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { TABLE, "table", NULL, NULL, NULL}, - { INFORMALTABLE, "informaltable", NULL, NULL, NULL}, - { ROW, "row", NULL, NULL, NULL}, - { ENTRY, "entry", NULL, NULL, NULL}, - { THEAD, "thead", NULL, NULL, NULL}, - { TBODY, "tbody", NULL, NULL, NULL}, - { ACRONYM, "acronym", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { MARKUP, "markup", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { SIMPLELIST, "simplelist", NULL, NULL, NULL}, - { MEMBER, "member", NULL, NULL, NULL}, - { MOUSEBUTTON, "mousebutton", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { SUPERSCRIPT, "superscript", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { SYSTEMITEM, "systemitem", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { VARNAME, "varname", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { BLOCKQUOTE, "blockquote", NULL, NULL, NULL}, - { QUOTE, "quote", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { OPTION, "option", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { ENVAR, "envar", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { COMPUTEROUTPUT, "computeroutput", NULL, NULL, (charactersSAXFunc) toc_tag_characters }, - { INLINEGRAPHIC, "inlinegraphic", NULL, NULL, NULL}, - { LEGALNOTICE, "legalnotice", NULL, NULL, NULL}, - { QUESTION, "question", NULL, NULL, NULL}, - { ANSWER, "answer", NULL, NULL, NULL}, - { CHAPTER, "chapter", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { PREFACE, "preface", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { TERM, "term", NULL, NULL, NULL}, - { APPENDIX, "appendix", (startElementSAXFunc) toc_sect_start_element, (endElementSAXFunc) toc_sect_end_element, NULL}, - { DOCINFO, "docinfo", (startElementSAXFunc) artheader_start_element, (endElementSAXFunc) toc_artheader_end_element, NULL}, - { GLOSSARY, "glossary", (startElementSAXFunc) glossary_start_element, NULL, NULL}, - { GLOSSDIV, "glossdiv", (startElementSAXFunc) toc_glossdiv_start_element, (endElementSAXFunc) toc_glossdiv_end_element, NULL}, - { GLOSSENTRY, "glossentry", (startElementSAXFunc) toc_glossentry_start_element, (endElementSAXFunc) toc_glossentry_end_element, NULL}, - { GLOSSTERM, "glossterm", (startElementSAXFunc) toc_glossterm_start_element, (endElementSAXFunc) toc_glossterm_end_element, (charactersSAXFunc) toc_title_characters}, - { GLOSSSEE, "glosssee", NULL, NULL, NULL}, - { GLOSSSEEALSO, "glossseealso", NULL, NULL, NULL}, - { EXAMPLE, "example", NULL, NULL, NULL}, - { VARLISTENTRY, "varlistentry", NULL, NULL, NULL}, - { STREET, "street", NULL, NULL, NULL}, - { CITY, "city", NULL, NULL, NULL}, - { COUNTRY, "country", NULL, NULL, NULL}, - { STATE, "state", NULL, NULL, NULL}, - { POSTCODE, "postcode", NULL, NULL, NULL}, - { LITERALLAYOUT, "literallayout", NULL, NULL, NULL}, - { QANDAENTRY, "qandaentry", NULL, NULL, NULL, }, - { QANDASET, "qandaset", NULL, NULL, NULL, }, - { BRIDGEHEAD, "bridgehead", NULL, NULL, NULL, }, - { RELEASEINFO, "releaseinfo", NULL, NULL, (charactersSAXFunc) toc_releaseinfo_characters, }, - { UNDEFINED, NULL, NULL, NULL, NULL} -}; - -gpointer -toc_init_data (void) -{ - TocContext *retval = g_new0 (TocContext, 1); - retval->header = g_new0 (HeaderInfo, 1); - - return (gpointer) retval; -} - -void -toc_free_data (gpointer data) -{ - TocContext *to_free; - - to_free = (TocContext *) data; - g_free (to_free->header); - g_free (to_free); -} - -static void -toc_sect_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - gchar **atrs_ptr; - - if (g_strcasecmp (name, "section") == 0) { - return; - } - - switch (name[4]) { - case 'a': - sect1id_stack_add (context, name, atrs); - context->preface++; - context->chapter = 0; - context->sect1 = 0; - context->sect2 = 0; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case 't': - sect1id_stack_add (context, name, atrs); - context->chapter++; - context->sect1 = 0; - context->sect2 = 0; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case 'n': - sect1id_stack_add (context, name, atrs); - context->appendix++; - context->chapter = 0; - context->sect1 = 0; - context->sect2 = 0; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case '1': - if (context->doctype == ARTICLE) { - sect1id_stack_add (context, name, atrs); - } - context->sect1++; - context->sect2 = 0; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case '2': - context->sect2++; - context->sect3 = 0; - context->sect4 = 0; - context->sect5 = 0; - break; - case '3': - context->sect3++; - context->sect4 = 0; - context->sect5 = 0; - break; - case '4': - context->sect4++; - context->sect5 = 0; - break; - case '5': - context->sect4++; - break; - default: - break; - } - - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - ((StackElement *)context->stack->data)->atrs = g_new0 (gchar *, 3); - ((StackElement *)context->stack->data)->atrs[0] = g_strdup ("id"); - ((StackElement *)context->stack->data)->atrs[1] = g_strdup (*atrs_ptr); - break; - } - atrs_ptr += 2; - } -} - -static void -toc_sect_end_element (Context *context, - const gchar *name) -{ - if (g_strcasecmp (name, "section") == 0) { - return; - } - - switch (name[4]) { - case 'a': - /* FIXME bugzilla.gnome.org 44410: should chapter be set to zero? */ - context->preface = 0; - context->sect1 = 0; - break; - case 't': - context->sect1 = 0; - break; - case '1': - context->sect2 = 0; - break; - case '2': - context->sect3 = 0; - break; - case '3': - context->sect4 = 0; - break; - case '4': - context->sect5 = 0; - break; - case 'n': - /* FIXME bugzilla.gnome.org 44410: should chapter be set to zero? */ - context->appendix = 0; - context->sect1 = 0; - break; - default: - break; - } -} - -static gboolean artheader_printed = FALSE; - -static void -toc_artheader_end_element (Context *context, const gchar *name) -{ - GSList *ptr; - AuthorInfo *author; - HeaderInfo *header = ((TocContext *) context->data)->header; - if (artheader_printed == TRUE) return; - - if (header->title) - g_print ("%s\n\n", header->title); - else - g_print ("%s\n\n", _("GNOME Documentation")); - - g_print ("\n"); - g_print ("
    \n"); - g_print ("\"GNOME\"\n"); - g_print ("\n"); - if (header->title) - g_print ("

    %s

    \n", header->title); - g_print ("

    \n"); - if (header->subtitle) - g_print ("

    %s

    \n", header->subtitle); - - for (ptr = header->authors; ptr; ptr = ptr->next) { - g_print ("

    by "); - author = (AuthorInfo *) ptr->data; - if (author->firstname) - g_print ("%s ", author->firstname); - if (author->othername) - g_print ("%s ", author->othername); - if (author->surname) - g_print ("%s", author->surname); - g_print ("

    \n"); - if (author->orgname) - g_print ("%s
    ", author->orgname); - if (author->email) - g_print ("<%s>\n", author->email); - g_print ("
    "); - } - g_print ("

    "); - if ((header->copyright_holder) && (header->copyright_year)) { - g_print ("%s © %s %s %s", - context->base_file, _("Copyright"), header->copyright_year, _("by"),header->copyright_holder); - } - if (header->releaseinfo) - g_print ("

    %s

    ", header->releaseinfo); - g_print ("
    \n

    %s

    \n\n", _("Table of Contents")); - g_print ("

    \n"); - artheader_printed = TRUE; -} - -static void -toc_author_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - GSList *element_list = NULL; - AuthorInfo *author; - ElementIndex index; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ARTHEADER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (BOOKINFO)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (DOCINFO)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSARYINFO)); - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - switch (index) { - case ARTHEADER: - case BOOKINFO: - case DOCINFO: - case GLOSSARYINFO: - break; - default: - return; - }; - author = g_new0 (AuthorInfo, 1); - ((TocContext *) context->data)->header->authors = g_slist_prepend (((TocContext *) context->data)->header->authors, author); -} - -static void -toc_author_characters (Context *context, const gchar *chars, int len) -{ - GSList *element_list = NULL; - AuthorInfo *author; - ElementIndex index; - char *temp; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ARTHEADER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (BOOKINFO)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (DOCINFO)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSARYINFO)); - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - switch (index) { - case ARTHEADER: - case BOOKINFO: - case DOCINFO: - case GLOSSARYINFO: - break; - default: - return; - }; - - author = (AuthorInfo *) ((TocContext *) context->data)->header->authors->data; - g_return_if_fail (author != NULL); - temp = g_strndup (chars, len); - if (((StackElement *) context->stack->data)->info->index == FIRSTNAME) - author->firstname = temp; - else if (((StackElement *) context->stack->data)->info->index == OTHERNAME) - author->othername = temp; - else if (((StackElement *) context->stack->data)->info->index == SURNAME) - author->surname = temp; - else if (((StackElement *) context->stack->data)->info->index == EMAIL) { - author->email = temp; - } else if (((StackElement *) context->stack->data)->info->index == ORGNAME) - author->orgname = temp; - else - g_free (temp); -} - -static void -toc_copyright_characters (Context *context, - const gchar *chars, - int len) -{ - GSList *element_list = NULL; - ElementIndex index; - gchar *temp; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (COPYRIGHT)); - index = find_first_parent (context, element_list); - g_slist_free (element_list); - - temp = g_strndup (chars, len); - - /* FIXME: Memory is leaked here, especially if we have multiple - * copyright holders. Not a big priority though. */ - switch (index) { - case COPYRIGHT: - if (((StackElement *) context->stack->data)->info->index == YEAR) - ((TocContext *) context->data)->header->copyright_year = temp; - else if (((StackElement *) context->stack->data)->info->index == HOLDER) { - if (((TocContext *) context->data)->header->copyright_holder == NULL) - ((TocContext *)context->data)->header->copyright_holder = temp; - else ((TocContext *)context->data)->header->copyright_holder = g_strconcat (((TocContext *)context->data)->header->copyright_holder, ", ", temp, NULL); - } - break; - default: - g_free (temp); - break; - }; -} - -static void -toc_title_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - GSList *element_list = NULL; - StackElement *stack_el; - gchar **atrs_ptr; - gboolean print_link; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (NOTE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TIP)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (WARNING)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GRAPHIC)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CAUTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TABLE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (IMPORTANT)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSDIV)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (QANDASET)); - stack_el = find_first_element (context, element_list); - - g_slist_free (element_list); - if (stack_el == NULL) - return; - - switch (stack_el->info->index) { - case PREFACE: - case CHAPTER: - case SECT1: - case SECTION: - case APPENDIX: - case GLOSSDIV: - in_printed_title = TRUE; - if (context->sect1 == 0) { - g_print ("

    "); - } else if (context->sect2 == 0) { - if (context->chapter > 0) { - g_print ("
      "); - } else { - g_print ("
    "); - } - - } else if (context->sect3 == 0) { - g_print ("
         "); - } else { - g_print ("
            "); - } - - if (context->preface > 0) { - if (context->sect1 == 0) g_print ("%s:
    ", _("PREFACE")); - if (context->sect1 > 0) g_print ("  %d", context->sect1); - - } else if (context->chapter > 0) { - g_print ("%d", context->chapter); - if (context->sect1 > 0) g_print (".%d", context->sect1); - - } else if (context->appendix > 0) { - if (context->sect1 == 0) { - g_print ("%s:
    ", _("APPENDIX")); - } else if (context->sect1 > 0) { - g_print ("  %d",context->sect1); - } - } else { - if (context->sect1 > 0) g_print ("%d", context->sect1); - } - - - if (context->sect2 > 0) g_print (".%d", context->sect2); - if (context->sect3 > 0) g_print (".%d", context->sect3); - if (context->sect4 > 0) g_print (".%d", context->sect4); - if (context->sect5 > 0) g_print (".%d", context->sect5); - - /* Don't print the "." if you are in the preface or appendix or glossdiv title */ - if ((stack_el->info->index != PREFACE) && - (stack_el->info->index != APPENDIX) && - (stack_el->info->index != GLOSSDIV)) { - g_print (".  "); - } - - /* Only print the link if we are the chapter tag, or the sect1 tag - * (and the document is an article) or preface or appendix or glossdiv */ - print_link = (((stack_el->info->index == SECT1) && (context->doctype != BOOK_DOC) - && (context->appendix == 0)) - || stack_el->info->index == CHAPTER - || stack_el->info->index == PREFACE - || stack_el->info->index == APPENDIX - || stack_el->info->index == GLOSSDIV); - - if (print_link) { - g_print ("base_file); - - atrs_ptr = (stack_el->atrs); - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - g_print ("?%s", *atrs_ptr); - break; - } - atrs_ptr += 2; - } - g_print ("\">"); - } - break; - case SECT2: - case SECT3: - case SECT4: - case SECT5: - in_printed_title = TRUE; - if (context->sect2 == 0) { - g_print ("
    "); - } else if (context->sect3 == 0) { - g_print ("
         "); - } else { - g_print ("
            "); - } - if (context->chapter > 0) { - g_print ("%d", context->chapter); - if (context->sect1 > 0) g_print (".%d", context->sect1); - } else { - if (context->sect1 > 0) g_print ("%d", context->sect1); - } - if (context->sect2 > 0) g_print (".%d", context->sect2); - if (context->sect3 > 0) g_print (".%d", context->sect3); - if (context->sect4 > 0) g_print (".%d", context->sect4); - if (context->sect5 > 0) g_print (".%d", context->sect5); - g_print (".  "); - default: - break; - }; - -} - -static void -toc_title_end_element (Context *context, - const gchar *name) -{ - GSList *element_list = NULL; - ElementIndex index; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (NOTE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TIP)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (WARNING)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GRAPHIC)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CAUTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TABLE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (IMPORTANT)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSDIV)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (QANDASET)); - - index = find_first_parent (context, element_list); - - in_printed_title = FALSE; - switch (index) { - case PREFACE: - case APPENDIX: - case GLOSSDIV: - g_print ("
    \n"); - break; - case CHAPTER: - g_print ("\n"); - break; - case SECT1: - case SECTION: - if (context->doctype == ARTICLE_DOC) { - g_print ("\n"); - } else { - g_print ("\n"); - } - break; - case SECT2: - g_print ("\n"); - break; - case SECT3: - case SECT4: - case SECT5: - g_print ("\n"); - break; - default: - break; - }; - - g_slist_free (element_list); -} - -static void -toc_title_characters (Context *context, const gchar *chars, int len) -{ - GSList *element_list = NULL; - ElementIndex index; - char *temp; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (PREFACE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CHAPTER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT1)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT2)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT3)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT4)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECT5)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (APPENDIX)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (SECTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (ARTHEADER)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (BOOKINFO)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FIGURE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (FORMALPARA)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (NOTE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TIP)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (WARNING)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GRAPHIC)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (CAUTION)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TABLE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (IMPORTANT)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (DOCINFO)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSDIV)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSTERM)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSARYINFO)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (QANDASET)); - - index = find_first_parent (context, element_list); - - temp = g_strndup (chars, len); - - switch (index) { - case PREFACE: - case CHAPTER: - case SECT1: - case SECT2: - case SECT3: - case SECT4: - case SECT5: - case SECTION: - case APPENDIX: - case GLOSSDIV: - case GLOSSTERM: - g_print ("%s", temp); - g_free (temp); - break; - case ARTHEADER: - case BOOKINFO: - case DOCINFO: - case GLOSSARYINFO: - if (((StackElement *)context->stack->data)->info->index == TITLE) - ((TocContext *) context->data)->header->title = temp; - else if (((StackElement *)context->stack->data)->info->index == SUBTITLE) - ((TocContext *) context->data)->header->subtitle = temp; - break; - default: - g_free (temp); - break; - }; - - g_slist_free (element_list); -} - -static void -toc_glossdiv_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - gchar **atrs_ptr; - - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - ((StackElement *)context->stack->data)->atrs = g_new0 (gchar *, 3); - ((StackElement *)context->stack->data)->atrs[0] = g_strdup ("id"); - ((StackElement *)context->stack->data)->atrs[1] = g_strdup (*atrs_ptr); - break; - } - atrs_ptr += 2; - } -} - -static void -toc_glossdiv_end_element (Context *context, - const gchar *name) -{ -/* FIXME: what do we do here? */ -} - -static void -toc_glossentry_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - gchar **atrs_ptr; - - atrs_ptr = (gchar **) atrs; - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - ((StackElement *)context->stack->data)->atrs = g_new0 (gchar *, 3); - ((StackElement *)context->stack->data)->atrs[0] = g_strdup ("id"); - ((StackElement *)context->stack->data)->atrs[1] = g_strdup (*atrs_ptr); - break; - } - atrs_ptr += 2; - } -} - -static void -toc_glossentry_end_element (Context *context, - const gchar *name) -{ -/* FIXME: what do we do here? */ -} - -static void -toc_glossterm_start_element (Context *context, - const gchar *name, - const xmlChar **atrs) -{ - StackElement *stack_el; - gchar **atrs_ptr; - GSList *element_list = NULL; - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSENTRY)); - stack_el = find_first_element (context, element_list); - - g_print ("
    "); - g_print ("  base_file); - - atrs_ptr = (stack_el->atrs); - while (atrs_ptr && *atrs_ptr) { - if (!g_strcasecmp (*atrs_ptr, "id")) { - atrs_ptr++; - g_print ("?%s", *atrs_ptr); - break; - } - atrs_ptr += 2; - } - g_print ("\">"); - in_printed_title = TRUE; -} - -static void -toc_glossterm_end_element (Context *context, - const gchar *name) -{ - g_print ("\n"); - in_printed_title = FALSE; -} - -static void -toc_tag_characters (Context *context, const gchar *chars, int len) -{ - GSList *element_list = NULL; - ElementIndex index; - char *temp; - - if (in_printed_title == FALSE) { - return; - } - - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (TITLE)); - element_list = g_slist_prepend (element_list, GINT_TO_POINTER (GLOSSTERM)); - - index = find_first_parent (context, element_list); - temp = g_strndup (chars, len); - - switch (index) { - case TITLE: - case GLOSSTERM: - temp = g_strndup (chars, len); - sect_print (context, "%s", temp); - g_free (temp); - break; - default: - g_free (temp); - break; - }; - - g_slist_free (element_list); - -} - -static void -toc_releaseinfo_characters (Context *context, const gchar *chars, int len) -{ - char *temp; - temp = g_strndup (chars, len); - ((TocContext *) context->data)->header->releaseinfo = temp; - -} diff --git a/components/help/converters/gnome-db2html2/toc-elements.h b/components/help/converters/gnome-db2html2/toc-elements.h deleted file mode 100644 index b3a100dd9..000000000 --- a/components/help/converters/gnome-db2html2/toc-elements.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __TOC_ELEMENTS_H__ -#define __TOC_ELEMENTS_H__ - -#include "gdb3html.h" - -extern ElementInfo toc_elements[]; - -gpointer toc_init_data (void); -void toc_free_data (gpointer data); - -#endif diff --git a/components/help/converters/gnome-db2html3/.cvsignore b/components/help/converters/gnome-db2html3/.cvsignore deleted file mode 100644 index ceebf6cab..000000000 --- a/components/help/converters/gnome-db2html3/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -.deps -.libs -*.o -*.lo -gnome-db2html3 -Makefile -Makefile.in diff --git a/components/help/converters/gnome-db2html3/AUTHORS b/components/help/converters/gnome-db2html3/AUTHORS deleted file mode 100644 index e34bea2da..000000000 --- a/components/help/converters/gnome-db2html3/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Author: John Fleck \ No newline at end of file diff --git a/components/help/converters/gnome-db2html3/Makefile.am b/components/help/converters/gnome-db2html3/Makefile.am deleted file mode 100644 index 6e8a2e2f8..000000000 --- a/components/help/converters/gnome-db2html3/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -SUBDIRS= docbook gnome-customization - -INCLUDES = \ - -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ - -DPREFIXDIR=\""$(prefix)"\" \ - $(GNOME_DB2HTML3_FLAG) - -LDADD = - -bin_PROGRAMS = gnome-db2html3 - -gnome_db2html3_SOURCES = \ - gnome-db2html3.c diff --git a/components/help/converters/gnome-db2html3/README b/components/help/converters/gnome-db2html3/README deleted file mode 100644 index 85d68dae2..000000000 --- a/components/help/converters/gnome-db2html3/README +++ /dev/null @@ -1,6 +0,0 @@ -This is a DocBook xml->html converter to replace gnome-db2html2 for -GNOME help file rendering in the Nautilus Mozilla component. It uses -libxslt and libxml2 along with Normal Walsh's stylesheets with a GNOME -customization layer to convert docs on the fly. It also has a built-in -sgml->xml converter to remain backwards compatible with existing sgml -docs. \ No newline at end of file diff --git a/components/help/converters/gnome-db2html3/docbook/.cvsignore b/components/help/converters/gnome-db2html3/docbook/.cvsignore deleted file mode 100644 index 282522db0..000000000 --- a/components/help/converters/gnome-db2html3/docbook/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/components/help/converters/gnome-db2html3/docbook/Makefile.am b/components/help/converters/gnome-db2html3/docbook/Makefile.am deleted file mode 100644 index 3ae0a4a08..000000000 --- a/components/help/converters/gnome-db2html3/docbook/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -SUBDIRS=common html lib - -docbookdir=$(datadir)/sgml/docbook/xsl-stylesheets-1.29 -docbook_DATA = \ - VERSION - -EXTRA_DIST=$(docbook_DATA) diff --git a/components/help/converters/gnome-db2html3/docbook/README b/components/help/converters/gnome-db2html3/docbook/README deleted file mode 100644 index a24699aac..000000000 --- a/components/help/converters/gnome-db2html3/docbook/README +++ /dev/null @@ -1,107 +0,0 @@ -README for the DocBook Stylesheets - -These are XSL stylesheets for the DocBk XML DTD. (They would -also work for the DocBook DTD, modulo certain namecase problems -and the fact that there aren't (yet) any XSL implementations -that work with SGML source documents.) - -As of version 1.0, most of the elements in DocBook are handled -in some way or another, usually reasonably, but there's still -lots of work to be done. - -Manifest --------- - -README this file -TODO planned features not yet implemented (may be incomplete :-) -BUGS known problems (may also be incomplete :-) -VERSION the current version number (note that this is an XSL stylesheet, - included by both fo/docbook.xsl and html/docbook.xsl) -WhatsNew changes since the last public release (for a complete list - of changes, see the ChangeLog file(s)) -bin/ scripts and other tools that work with the stylesheets -common/ contains code common to both stylesheets -contrib/ stylesheets contributed by others -dtds/ dtds used by the stylesheets or stylesheet outputs -fo/ a stylesheet that produces XSL FO result trees -html/ a stylesheet that produces HTML/XHTML result trees -lib/ contains schema-independent functions -template/ contains templates for building stylesheet customization layers -test/ test documents - -Changes -------- - -See the ChangeLog in each directory for additional information -about the specific changes. - -See WhatsNew for changes since the last release. - -Installation ------------- - -Unpack the distribution somewhere. - -Use ---- - -Process your DocBook documents with one of the following stylesheets -using your favorite XSLT processor: - - xhtml/docbook.xsl produces an XHTML result tree - html/docbook.xsl produces an HTML result tree - fo/docbook.xsl produces an FO result tree - -Copyright ---------- - -Copyright (C) 1999, 2000 Norman Walsh - -Ironically, assertion of copyright is done to make it _easier_ -to distribute these stylesheets. (At least one organization, -Software in the Public Interest, requires an explicit copyright -statement in order to redistribute the software.) - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the ``Software''), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -Except as contained in this notice, the names of individuals -credited with contribution to this software shall not be used in -advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization -from the individuals in question. - -Any stylesheet derived from this Software that is publically -distributed will be identified with a different name and the -version strings in any derived Software will be changed so that -no possibility of confusion between the derived package and this -Software will exist. - -Warranty --------- - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER -CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Contacting the Author ---------------------- - -These stylesheets are maintained by Norman Walsh, . - -The best way to reach norm is by email. You will find additional -contact information at http://nwalsh.com/~ndw/ diff --git a/components/help/converters/gnome-db2html3/docbook/VERSION b/components/help/converters/gnome-db2html3/docbook/VERSION deleted file mode 100644 index a674aac18..000000000 --- a/components/help/converters/gnome-db2html3/docbook/VERSION +++ /dev/null @@ -1,6 +0,0 @@ - - -1.29 - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/.cvsignore b/components/help/converters/gnome-db2html3/docbook/common/.cvsignore deleted file mode 100644 index 282522db0..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/components/help/converters/gnome-db2html3/docbook/common/Makefile.am b/components/help/converters/gnome-db2html3/docbook/common/Makefile.am deleted file mode 100644 index fe9d2f971..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -commondir=$(datadir)/sgml/docbook/xsl-stylesheets-1.29/common - -common_DATA = \ - ca.xml \ - common.xsl \ - cs.xml \ - da.xml \ - de.xml \ - el.xml \ - en.xml \ - es.xml \ - et.xml \ - fi.xml \ - fr.xml \ - hu.xml \ - id.xml \ - it.xml \ - ja.xml \ - ko.xml \ - l10n.dtd \ - l10n.xml \ - l10n.xsl \ - nl.xml \ - no.xml \ - pl.xml \ - pt.xml \ - pt_br.xml \ - ro.xml \ - ru.xml \ - sk.xml \ - sl.xml \ - sv.xml \ - zh_cn.xml \ - zh_tw.xml - -EXTRA_DIST = $(common_DATA) diff --git a/components/help/converters/gnome-db2html3/docbook/common/ca.xml b/components/help/converters/gnome-db2html3/docbook/common/ca.xml deleted file mode 100644 index fec3efff1..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/ca.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/common.xsl b/components/help/converters/gnome-db2html3/docbook/common/common.xsl deleted file mode 100644 index c8b905f1c..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/common.xsl +++ /dev/null @@ -1,1929 +0,0 @@ - - - - - - - - -$Id$ - -Walsh -Norman -19992000 -Norman Walsh - - -Common Template Reference - - -
    Introduction - -This is technical reference documentation for the DocBook XSL -Stylesheets; it documents (some of) the parameters, templates, and -other elements of the stylesheets. - -This is not intended to be user documentation. -It is provided for developers writing customization layers for the -stylesheets, and for anyone who's interested in how it -works. - -Although I am trying to be thorough, this documentation is known -to be incomplete. Don't forget to read the source, too :-) -
    -
    - -
    - - - - - - - - - - - -Tests if a given node is a component-level element - - -This template returns '1' if the specified node is a component -(Chapter, Appendix, etc.), and '0' otherwise. - - - - -node - -The node which is to be tested. - - - - - - -This template returns '1' if the specified node is a component -(Chapter, Appendix, etc.), and '0' otherwise. - - - - - - - 1 - 0 - - - - - - -Tests if a given node is a section-level element - - -This template returns '1' if the specified node is a section -(Section, Sect1, Sect2, etc.), and '0' otherwise. - - - - -node - -The node which is to be tested. - - - - - - -This template returns '1' if the specified node is a section -(Section, Sect1, Sect2, etc.), and '0' otherwise. - - - - - - - 1 - 0 - - - - - - -Returns the hierarchical level of a section. - - -This template calculates the hierarchical level of a section. -Hierarchically, components are top level, so a -sect1 is at level 2, sect3 is -at level 3, etc. - -Recursive sections are calculated down to the sixth level. - - - - -node - -The section node for which the level should be calculated. -Defaults to the context node. - - - - - - -The section level, 2, 3, etc. - - - - - - - - 2 - 3 - 4 - 5 - 6 - - - 6 - 5 - 4 - 3 - 2 - - - - - 3 - 4 - 5 - 6 - 6 - - - 6 - 5 - 4 - 3 - - - 2 - - - 2 - - - - -Returns the hierarchical level of a QandASet. - - -This template calculates the hierarchical level of a QandASet. - - - - -The level, 1, 2, etc. - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - - - - , - - - and - - - - - - - - - - - - -[ -] -{ -} - - -[ -] -... - - - | -4pi - - - - - -Provides access to element labels - -Processing an element in the -label.content mode produces the -element label. -If the label is non-null, either because the -label attribute was present on the -element or the stylesheet automatically generated a label, trailing -punctuation is automatically added. - - - - - - Request for label of unexpected element: - - - - - - . - - - - - - - - . - - - - - - - - - - - - - - . - - - - - - - - - - - - - - . - - - - - - - - - - - - - - . - - - - - - - - - - - - - - . - - - - - - - - . - - - - - - - - . - - - - - - - - - - - - - - . - - - - - - - - . - - - - - . - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - . - - - - - - - - - - . - - - - - - - - - - - - - - - - - . - - - - . - - - - - - - - - - - - - - - - - - - - - - - label.content: this can't happen! - - - - - - - - - . - - - - - - - - - - - - - - . - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - . - - - - - - - - - - - . - - - - - - - - - - - - - - - . - - - - - - - - - - -Returns true if $section should be labelled - -Returns true if the specified section should be labelled. -By default, this template simply returns $section.autolabel, but -custom stylesheets may override it to get more selective behavior. - - - - - - - -Provides access to element titles - -Processing an element in the -title.content mode produces the -title of the element. This does not include the label. If -text-only is true, the text of the title -is returned, without inline markup, otherwise inline markup is processed -(in the default mode). By default, text-only -is false. - - - - - - - - - - - - - - - - - Request for title of unexpected element: - - - ???TITLE??? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REFENTRY WITHOUT TITLE??? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Provides access to element subtitles - -Processing an element in the -subtitle.content mode produces the -subtitle of the element. If -text-only is true, the text of the title -is returned, without inline markup, otherwise inline markup is processed -(in the default mode). By default, text-only -is false. - - - - - - - Request for subtitle of unexpected element: - - - ???SUBTITLE??? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Provides reference text for an element - -Processing an element in the -title.ref mode produces the -label and title of the element. - - - - -text-only - - If -text-only is true, the text of the title -is returned, without inline markup, otherwise inline markup is processed -(in the default mode). By default, text-only -is false. - - -label-wrapper - -If label-wrapper is not the emtpy string, -it must be the name of an element. The element so named will be wrapped -around labels on output. - - -title-wrapper - -If title.wrapper is not the emtpy string, -it must be the name of an element. The element so named will be wrapped -around titles on output. - - -label-wrapper-class - -If a label-wrapper is provided and -label-wrapper-class is not the emtpy string, -it be used as the value for a class -attribute on the label-wrapper element. -This is a dirty hack because it only makes sense for the HTML -stylesheet (there's no class attribute -on the FO elements). What I'd really like to do is pass an attribute -set as a parameter, but I can't. - - -title-wrapper-class - -If a title-wrapper is provided and -title-wrapper-class is not the emtpy string, -it be used as the value for a class -attribute on the title-wrapper element. -This is a dirty hack because it only makes sense for the HTML -stylesheet (there's no class attribute -on the FO elements). What I'd really like to do is pass an attribute -set as a parameter, but I can't. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - %g - - - - - - - - - - - - - - - - - - - - - - %t - - - - - - - - - - - - - - - - - - - - - - - - - - - - %n - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Selects an appropriate media object from a list - - -This template examines a list of media objects (usually the -children of a mediaobject or inlinemediaobject) and processes -the "right" object. - -This template relies on a template named "is.acceptable.mediaobject" -to determine if a given object is an acceptable graphic. The semantics -of media objects is that the first acceptable graphic should be used. - - -If no acceptable object is located, nothing happens. - - - - -olist - -The node list of potential objects to examine. - - - - - - -Calls <xsl:apply-templates> on the selected object. - - - - - - 1 - - - - - - - - - 0 - - - - 1 - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Returns '1' if the specified media object is recognized. - - -This template examines a media object and returns '1' if the -object is recognized as a graphic. - - - - -object - -The media object to consider. - - - - - - -0 or 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - 0 - - - - - - 1 - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - . - - - - - - - - - - - - - - - - -Warn users about references to non-unique IDs - -If passed an ID in linkend, -check.id.unique prints -a warning message to the user if either the ID does not exist or -the ID is not unique. - - - - - - - - - - - - Error: no ID for constraint linkend: - - . - - - - - - Warning: multiple "IDs" for constraint linkend: - - . - - - - - - -Warn users about incorrectly typed references - -If passed an ID in linkend, -check.idref.targets makes sure that the element -pointed to by the link is one of the elements listed in -element-list and warns the user otherwise. - - - - - - - - - - - - - - Error: linkend ( - - ) points to " - - " not (one of): - - - - - - - - - -
    - diff --git a/components/help/converters/gnome-db2html3/docbook/common/cs.xml b/components/help/converters/gnome-db2html3/docbook/common/cs.xml deleted file mode 100644 index 42511ceee..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/cs.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/da.xml b/components/help/converters/gnome-db2html3/docbook/common/da.xml deleted file mode 100644 index 959050230..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/da.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/de.xml b/components/help/converters/gnome-db2html3/docbook/common/de.xml deleted file mode 100644 index 33d3e819b..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/de.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/el.xml b/components/help/converters/gnome-db2html3/docbook/common/el.xml deleted file mode 100644 index ad9303204..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/el.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/en.xml b/components/help/converters/gnome-db2html3/docbook/common/en.xml deleted file mode 100644 index a105370bb..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/en.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/es.xml b/components/help/converters/gnome-db2html3/docbook/common/es.xml deleted file mode 100644 index 78483dfb6..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/es.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/et.xml b/components/help/converters/gnome-db2html3/docbook/common/et.xml deleted file mode 100644 index 4c63adbe7..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/et.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/fi.xml b/components/help/converters/gnome-db2html3/docbook/common/fi.xml deleted file mode 100644 index 5d2572551..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/fi.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/fr.xml b/components/help/converters/gnome-db2html3/docbook/common/fr.xml deleted file mode 100644 index f99c07f40..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/fr.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/hu.xml b/components/help/converters/gnome-db2html3/docbook/common/hu.xml deleted file mode 100644 index d37e06ff8..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/hu.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/id.xml b/components/help/converters/gnome-db2html3/docbook/common/id.xml deleted file mode 100644 index f85b02154..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/id.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/it.xml b/components/help/converters/gnome-db2html3/docbook/common/it.xml deleted file mode 100644 index a7e1063ef..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/it.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/ja.xml b/components/help/converters/gnome-db2html3/docbook/common/ja.xml deleted file mode 100644 index 9180e8e18..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/ja.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/ko.xml b/components/help/converters/gnome-db2html3/docbook/common/ko.xml deleted file mode 100644 index 06dd7cb21..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/ko.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/l10n.dtd b/components/help/converters/gnome-db2html3/docbook/common/l10n.dtd deleted file mode 100644 index 0336baf20..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/l10n.dtd +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/l10n.xml b/components/help/converters/gnome-db2html3/docbook/common/l10n.xml deleted file mode 100644 index a7ef90e90..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/l10n.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - -&ca; -&cs; -&da; -&de; -⪙ -&en; -&es; -&et; -&fi; -&fr; -&hu; -&id; -⁢ -&ja; -&ko; -&nl; -&no; -&pl; -&pt; -&pt_br; -&ro; -&ru; -&sk; -&sl; -&sv; -&zh_cn; -&zh_tw; - diff --git a/components/help/converters/gnome-db2html3/docbook/common/l10n.xsl b/components/help/converters/gnome-db2html3/docbook/common/l10n.xsl deleted file mode 100644 index f2f6fad1c..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/l10n.xsl +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ - - - - - - - - - - - - - - - - - - - - - - - - - No " - - " cross reference text for " - - " exists and no default specified. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No " - - " localization of " - - " exists; using "en". - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Editedby - - - - - - by - - - - - bullet - - - - - - - - - - - - No " - - " localization of dingbat - - exists; using "en". - - - - - - - - - - - - - startquote - - - - - - endquote - - - - - - nestedstartquote - - - - - - nestedendquote - - - - - - nav-prev - - - - - - nav-next - - - - - - nav-home - - - - - - nav-up - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/nl.xml b/components/help/converters/gnome-db2html3/docbook/common/nl.xml deleted file mode 100644 index 56ead54d3..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/nl.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/no.xml b/components/help/converters/gnome-db2html3/docbook/common/no.xml deleted file mode 100644 index b3aba44fd..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/no.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/pl.xml b/components/help/converters/gnome-db2html3/docbook/common/pl.xml deleted file mode 100644 index 8582bbebe..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/pl.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/pt.xml b/components/help/converters/gnome-db2html3/docbook/common/pt.xml deleted file mode 100644 index af0c22f4b..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/pt.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/pt_br.xml b/components/help/converters/gnome-db2html3/docbook/common/pt_br.xml deleted file mode 100644 index cf63d1ebf..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/pt_br.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/ro.xml b/components/help/converters/gnome-db2html3/docbook/common/ro.xml deleted file mode 100644 index a59ffd821..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/ro.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/ru.xml b/components/help/converters/gnome-db2html3/docbook/common/ru.xml deleted file mode 100644 index a097cd419..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/ru.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/sk.xml b/components/help/converters/gnome-db2html3/docbook/common/sk.xml deleted file mode 100644 index 0c2fbc85f..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/sk.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/sl.xml b/components/help/converters/gnome-db2html3/docbook/common/sl.xml deleted file mode 100644 index fca0f5e34..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/sl.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/sv.xml b/components/help/converters/gnome-db2html3/docbook/common/sv.xml deleted file mode 100644 index 27b45cce1..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/sv.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/zh_cn.xml b/components/help/converters/gnome-db2html3/docbook/common/zh_cn.xml deleted file mode 100644 index ef373b4a3..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/zh_cn.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/common/zh_tw.xml b/components/help/converters/gnome-db2html3/docbook/common/zh_tw.xml deleted file mode 100644 index 7168114f4..000000000 --- a/components/help/converters/gnome-db2html3/docbook/common/zh_tw.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/.cvsignore b/components/help/converters/gnome-db2html3/docbook/html/.cvsignore deleted file mode 100644 index 282522db0..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/components/help/converters/gnome-db2html3/docbook/html/Makefile.am b/components/help/converters/gnome-db2html3/docbook/html/Makefile.am deleted file mode 100644 index 6af338307..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -htmldir=$(datadir)/sgml/docbook/xsl-stylesheets-1.29/html -html_DATA = \ - admon.xsl \ - autotoc.xsl \ - biblio.xsl \ - block.xsl \ - callout.xsl \ - changebars.xsl \ - chunk-common.xsl \ - chunk.xsl \ - component.xsl \ - division.xsl \ - docbook.xsl \ - ebnf.xsl \ - footnote.xsl \ - formal.xsl \ - glossary.xsl \ - graphics.xsl \ - html.xsl \ - index.xsl \ - info.xsl \ - inline.xsl \ - keywords.xsl \ - lists.xsl \ - math.xsl \ - param.xsl \ - pi.xsl \ - qandaset.xsl \ - refentry.xsl \ - sections.xsl \ - synop.xsl \ - table.xsl \ - titlepage.templates.xsl \ - titlepage.xsl \ - toc.xsl \ - verbatim.xsl \ - xref.xsl \ - xtchunk.xsl - -EXTRA_DIST=$(html_DATA) diff --git a/components/help/converters/gnome-db2html3/docbook/html/admon.xsl b/components/help/converters/gnome-db2html3/docbook/html/admon.xsl deleted file mode 100644 index 234c3a247..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/admon.xsl +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - - - 25 - - - - - - - note - warning - caution - tip - important - note - - - - - -
    - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    - - -
    - - - - - - - - - - -

    - - - - - - -

    -
    -
    - - -
    -
    - - - - - - - - - - - - - -

    - - - -

    -
    - - - - - - - - - - - - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/autotoc.xsl b/components/help/converters/gnome-db2html3/docbook/html/autotoc.xsl deleted file mode 100644 index e4a2204d9..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/autotoc.xsl +++ /dev/null @@ -1,511 +0,0 @@ - - - - - - - - # - - - - - - - - dt - li - - - - - - - dd - - - - - - - -
    -

    - - - TableofContents - - -

    - - - -
    -
    -
    - - - - - -
    -

    - - - TableofContents - - -

    - - - -
    -
    -
    -
    - - - - - -
    -

    - - - TableofContents - - -

    - - - -
    -
    -
    -
    - - - - -
    -

    - - - TableofContents - - -

    - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - yes - - - - yes - - - no - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - diff --git a/components/help/converters/gnome-db2html3/docbook/html/biblio.xsl b/components/help/converters/gnome-db2html3/docbook/html/biblio.xsl deleted file mode 100644 index 274202577..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/biblio.xsl +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - -
    - - - - - - -

    - - - - - - -

    -
    -
    - - - - - - - -
    -
    - - - - - - - - - - - - -

    - - - -

    -
    - - -

    - -

    -
    - - - - -
    - -
    -
    - - - - - - - -

    - - - -

    -
    - - - - - - - - - - - - - - - - - - - - - - [ - - ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ldquo - - - - rdquo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - copyright - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ldquo - - - - rdquo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/block.xsl b/components/help/converters/gnome-db2html3/docbook/html/block.xsl deleted file mode 100644 index bf53b8dbe..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/block.xsl +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - - - - - - -

    - - - - - - - - - - - - - - -

    -
    - - -

    - - - - -

    - - - -

    - - - - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - -  
    - -- - -  
    -
    - -
    - -
    -
    -
    - - - -
    - - -- -
    -
    - - - - - - - - -
    - - - -

    - -

    -
    - - - - -
    - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - - - : - - -

    -
    - - - - - - -

    -
    - - - - -
    - - - - - -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - nbsp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - - -

    - -

    -
    - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/callout.xsl b/components/help/converters/gnome-db2html3/docbook/html/callout.xsl deleted file mode 100644 index 68ca333d8..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/callout.xsl +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - -
    -
    - -
    - - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - {$conum} - - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/changebars.xsl b/components/help/converters/gnome-db2html3/docbook/html/changebars.xsl deleted file mode 100644 index fee001a13..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/changebars.xsl +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - -
    - -
    -
    - - - - - - - - - - - - Revisionflag on unexpected element: - - (Assuming block) - -
    - -
    -
    -
    -
    - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/chunk-common.xsl b/components/help/converters/gnome-db2html3/docbook/html/chunk-common.xsl deleted file mode 100644 index 4b3221a1f..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/chunk-common.xsl +++ /dev/null @@ -1,755 +0,0 @@ - - - - - - - - - - -Output directory for chunks - -If specified, the base.dir identifies -the output directory for chunks. (If not specified, the output directory -is system dependent.) - - - - - - - - - - - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / - - - - - - - - - - - - - - - bk - - - - - - - - - - - - - - - - - - - - - - ar - - - - - - - - - - - - - - - - - - pr - - - - - - - - - - - - - ch - - - - - - - - - - - - - ap - - - - - - - - - - - - - pt - - - - - - - - - - - - - rn - - - - - - - - - - - - - re - - - - - - - - - - - - - co - - - - - - - - - - - s - - - - - - - - - - - - - bi - - - - - - - - - - - - - go - - - - - - - - - - - - - ix - - - - - - - - si - - - - - - - - chunk-filename-error- - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Error - - is not a chunk! - - - - - - - - - - - - Writing - - for - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ID ' - - ' not found in document. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/chunk.xsl b/components/help/converters/gnome-db2html3/docbook/html/chunk.xsl deleted file mode 100644 index 250c2967f..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/chunk.xsl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/component.xsl b/components/help/converters/gnome-db2html3/docbook/html/component.xsl deleted file mode 100644 index 63e46e577..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/component.xsl +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - - - - - - -

    - - - - -

    - - - - - - - - - -

    - - - -

    -
    -
    - - - - - - - - -
    - - - -
    -
    - - - - - - - - - - -
    - - - - - - -
    -
    - - - - - - - - - - -
    - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    -
    - - - - - - - - -
    - - - - - - - - - - - -
    -
    - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/division.xsl b/components/help/converters/gnome-db2html3/docbook/html/division.xsl deleted file mode 100644 index c7c292515..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/division.xsl +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - -
    - - - - - - -
    -
    - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - - - - - - - -
    -
    - - - - - - - - - - - -

    - - - -

    - - - -

    - -

    -
    - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/docbook.xsl b/components/help/converters/gnome-db2html3/docbook/html/docbook.xsl deleted file mode 100644 index 73e649548..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/docbook.xsl +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No template matches - - . - - - - < - - > - - </ - - > - - - - - - - - - - - - - <xsl:apply-templates select="$node" mode="title.ref"> - <xsl:with-param name="text-only" select="'1'"/> - </xsl:apply-templates> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ID ' - - ' not found in document. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/ebnf.xsl b/components/help/converters/gnome-db2html3/docbook/html/ebnf.xsl deleted file mode 100644 index 2bcb200fe..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/ebnf.xsl +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - - - -$Id$ - -Walsh -Norman -19992000 -Norman Walsh - - -HTML EBNF Reference - - -
    Introduction - -This is technical reference documentation for the DocBook XSL -Stylesheets; it documents (some of) the parameters, templates, and -other elements of the stylesheets. - -This reference describes the templates and parameters relevant -to formatting EBNF markup. - -This is not intended to be user documentation. -It is provided for developers writing customization layers for the -stylesheets, and for anyone who's interested in how it -works. - -Although I am trying to be thorough, this documentation is known -to be incomplete. Don't forget to read the source, too :-) -
    -
    -
    - - - - - - - - - -#F5DCB3 - - -Background color for EBNF tables - -Sets the background color for EBNF tables. No bgcolor -attribute is output if ebnf.table.bgcolor is set to -the null string. The default value matches the value used in recent -online versions of the W3C's XML Spec productions. - - - -1 - - -Selects border on EBNF tables - -Selects the border on EBNF tables. If non-zero, the tables have -borders, otherwise they don't. - - - - - - - - - - - - - - 1 - - - - - - EBNF - - for - - - - - - - - - - - - -
    - -
    - - - - - - - - - - EBNF productions - -
    -
    -
    - - - - - - - - - - - [ - - ] - - - - - - - - - - - - - - - - - - - - ::= - - - - - - - - - - -   - - - - - - - - - - - - - - Error: no ID for productionrecap linkend: - - . - - - - - - Warning: multiple "IDs" for productionrecap linkend: - - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - production - - - - - - - - - Non-terminals with no content must point to - production elements in the current document. - - - Invalid xpointer for empty nt: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ??? - - - - - - - - - - - - - /*  - -  */ - - - - - - - - - - constraintdef - - - - - - - - - - - -
    -
    - [ - - - - - : - - - - - - - : - - - - - - - - - - ] -
    - - -
    - -
    -
    - - -

    -
    - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/footnote.xsl b/components/help/converters/gnome-db2html3/docbook/html/footnote.xsl deleted file mode 100644 index a5c7ec7d5..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/footnote.xsl +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - #ftn. - - - - - - - [ - - - - ] - - - - - [ - - - - ] - - - - - - - - - - #ftn. - - - - - - [ - - - - ] - - - - - - - - - - - - - - - - - - - - - ftn. - - - - - - # - - - - -

    - - [ - - - - ] - - -

    -
    - - - - - - - - - -
    -
    -
    - -
    -
    -
    - - -
    - -
    -
    - - - - - -
    - -
    -
    - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/formal.xsl b/components/help/converters/gnome-db2html3/docbook/html/formal.xsl deleted file mode 100644 index d0f8fec97..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/formal.xsl +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - -
    - - - - - - -
    -
    - - - -

    - - - - - - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/glossary.xsl b/components/help/converters/gnome-db2html3/docbook/html/glossary.xsl deleted file mode 100644 index 1885f8459..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/glossary.xsl +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - -
    - - - - - - -

    - - - - - - -

    - - - - - - - -
    - -
    - - -
    - - - - - - - - -

    - -

    -
    - - -

    - -

    -
    - - - - -
    - - - - - - -
    - -
    -
    -
    - - - - -
    - -
    -
    - - -

    - -

    -
    - - - - - - - - - - -
    - -
    - - - -
    - - - - - - - - - -
    -
    - - - - - - - - - - - - - - -
    -

    - - - - - - - - - - - - - . -

    -
    -
    - - -
    -
    - - - - - -

    - - - - - - - - - - - - - . -

    -
    - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/graphics.xsl b/components/help/converters/gnome-db2html3/docbook/html/graphics.xsl deleted file mode 100644 index e30af9d70..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/graphics.xsl +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - A fileref or entityref is required on - - - - - - - - - - - - - - - - - % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/html.xsl b/components/help/converters/gnome-db2html3/docbook/html/html.xsl deleted file mode 100644 index 839c8ac68..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/html.xsl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - bullet - - - - - - - - - - - - - - - - bullet - - - © - - - ® - (SM) -   - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/index.xsl b/components/help/converters/gnome-db2html3/docbook/html/index.xsl deleted file mode 100644 index 183d50639..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/index.xsl +++ /dev/null @@ -1,478 +0,0 @@ - - - - - - - - - -]> - - - - - - - - - - - - -
    - - - - - - -

    - - - - - - -

    -
    -
    - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - - - -

    - - - -

    -
    - - -

    - -

    -
    - - - - -
    - -
    - -
    -
    -
    - - - - - - - - - - - -

    - - - -

    -
    - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - - -
    - -
    - - -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - - -
    - -
    - -
    -
    - -
    -
    -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -

    - - - -

    -
    - - - -
    -
    -
    - - - -
    -
    - - - -
    -

    - -

    -
    - - - -
    -
    -
    - - - - -
    - - - - -
    - -
    -
    - - - - - - - - - -
    -
    -
    -
    - - - - -
    - - - - -
    - -
    -
    - - - - - - - - - -
    -
    -
    -
    - - - - -
    - - - - -
    - - -
    -
    - - - - - - -
    -
    -
    -
    - - - , - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - - - - - -
    -
    - - -
    -
    - - - - - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/info.xsl b/components/help/converters/gnome-db2html3/docbook/html/info.xsl deleted file mode 100644 index b1d664927..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/info.xsl +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/inline.xsl b/components/help/converters/gnome-db2html3/docbook/html/inline.xsl deleted file mode 100644 index 7901a593a..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/inline.xsl +++ /dev/null @@ -1,683 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - , - - - - - - - , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - element - - - - - - - - - - - - - - - - - </ - - > - - - - - - - & - - ; - - - - - - - &# - - ; - - - - - - - % - - ; - - - - - - - <? - - > - - - - - - - <? - - ?> - - - - - - - < - - > - - - - - - - < - - /> - - - - - - - <!-- - - --> - - - - - - - - - - - - - < - - mailto: - - - > - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - -> - - + - - - - - - - - - - - - - - - - - - - - - [ - - ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/keywords.xsl b/components/help/converters/gnome-db2html3/docbook/html/keywords.xsl deleted file mode 100644 index c3b5f706e..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/keywords.xsl +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - , - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/lists.xsl b/components/help/converters/gnome-db2html3/docbook/html/lists.xsl deleted file mode 100644 index 2bae5e6fc..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/lists.xsl +++ /dev/null @@ -1,609 +0,0 @@ - - - - - - - - -
    - - - -
      - -
    -
    -
    - - -

    -
    - - - - - 1 - - - - 2 - - - - - - - - - - - - - - - - - - - - - 1 - - - - - 1 - a - i - A - I - - - - - - 1 - a - i - A - I - - - - -
    - - - -
      - - - - - - - - - - - - - - - - -
    -
    -
    - - -

    -
    - - -
    - - - -
    - -
    -
    -
    - - -

    -
    - - - - - - - - - - - - - - - - - - - - - disc - square - - - - - - -
  • - - - list-style-type: - - - - - - - - - - - -
    - -
    -
    - - - -
    -
  • -
    - - - - - - - - - -
    -
    - - - - , - - - - - - - - - -
    - -
    -
    - - - -
    -
    - - - - - - - - - - - - - - 1 - - - -
    -
    - - - - - - - - - - - - - - 1 - - - -
    -
    - - - - - - - - - - 1 - - - -
    -
    - - - 1 - 1 - - - - - - - - - - - - - - - - - - - - 1 - 1 - - 1 - - - - - - - - - - -   - - - &nbsp; - - - - - - - - - - - - - - - - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - 1 - 1 - 1 - - 1 - - - - - - - - - - -   - - - &nbsp; - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - - - -
    - - - -
    -
    -
    - - - - - -

    - - - -

    -
    - - -
    -
    - - -
  • -
    - - - - - - - - - - - - -

    -
    - - - - - - - - - - - - - - - - - - - -

    - - - : - - -

    -
    - - - - -
    - -

    - - - -

    -
    - - - - -
    -
    - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - : ??? - - -
    - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ??? - - - - - - -
    - diff --git a/components/help/converters/gnome-db2html3/docbook/html/math.xsl b/components/help/converters/gnome-db2html3/docbook/html/math.xsl deleted file mode 100644 index 502a930d8..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/math.xsl +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/param.xsl b/components/help/converters/gnome-db2html3/docbook/html/param.xsl deleted file mode 100644 index de1e13159..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/param.xsl +++ /dev/null @@ -1,947 +0,0 @@ - - - - - - - - -$Id$ - -Walsh -Norman -19992000 -Norman Walsh - - -HTML Parameter Reference - - -
    Introduction - -This is technical reference documentation for the DocBook XSL -Stylesheets; it documents (some of) the parameters, templates, and -other elements of the stylesheets. - -This reference describes each of the HTML Stylesheet parameters. -These are the easily customizable parts of the stylesheet. -If you want to specify an alternate value for one or more of these -parameters, you can do so in a driver stylesheet. - -For example, if you want to change the html.stylesheet -to reference.css, you might create a driver -stylesheet like this: - - - - - - reference.css - -]]> - -Naturally, you have to change the -href attribute on -<xsl:import> -to point to docbook.xsl -on your system. (Or chunk.xsl, if you're using -chunking.) - -This is not intended to be user documentation. -It is provided for developers writing customization layers for the -stylesheets, and for anyone who's interested in how it -works. - -Although I am trying to be thorough, this documentation is known -to be incomplete. Don't forget to read the source, too :-) -
    -
    -
    - - - - - -Is othername in author a -middle name? - -If true (non-zero), the othername of an author -appears between the firstname and -surname. Otherwise, othername -is suppressed. - - - - - - - - -Name of the stylesheet to use in the generated HTML - -The name of the stylesheet to place in the HTML LINK -tag, or the empty string to suppress the stylesheet LINK. - - - - - -text/css - - -The type of the stylesheet used in the generated HTML - -The type of the stylesheet to place in the HTML link tag. - - - - - - - - -An HTML base URI - -If html.base is set, it is used for the BASE -element in the HEAD of the HTML documents. -This is useful for dynamically served HTML where the base URI needs -to be shifted. - - - - - - - -The HTML anchor target for ULinks - -If ulink.target is set, its value will -be used for the target attribute -on anchors generated for ulinks. - - - - - - - -Output manvolnum as part of -refentry cross-reference? - -if true (non-zero), the manvolnum is used when cross-referencing -refentrys, either with xref -or citerefentry. - - - - - -1 - - -Display comment elements? - -If true (non-zero), comments will be displayed, otherwise they are suppressed. -Comments here refers to the comment element, -which will be renamed remark in DocBook V4.0, -not XML comments (<-- like this -->) which are unavailable. - - - - - -kr - - -What style of 'FuncSynopsis' should be generated? - -If funcsynopsis.style is ansi, -ANSI-style function synopses are generated for a -funcsynopsis, otherwise K&R-style -function synopses are generated. - - - - - - - - -Decorate elements of a FuncSynopsis? - -If true (non-zero), elements of the FuncSynopsis will be decorated (e.g. bold or -italic). The decoration is controlled by functions that can be redefined -in a customization layer. - - - - - -0 - - -Generate parens after a function? - -If not 0, the formatting of -a function element will include -generated parenthesis. - - - - - - - - -Output NAME header before 'RefName'(s)? - -If true (non-zero), a "NAME" section title is output before the list -of 'RefName's. - - - - - - - - -Use graphics in admonitions? - -If true (non-zero), admonitions are presented in an alternate style that uses -a graphic. Default graphics are provided in the distribution. - - - - - -../images/ - - -Path to admonition graphics - -Sets the path, probably relative to the directory where the HTML -files are created, to the admonition graphics. - - - - - - - - -Extension for admonition graphics - -Sets the extension to use on admonition graphics. - - - - - - margin-left: 0.5in; margin-right: 0.5in; - - - -CSS style attributes for admonitions - -Specifies the value of the STYLE -attribute that should be added to admonitions. - - - - - - - - -Are sections enumerated? - -If true (non-zero), unlabeled sections will be enumerated. - - - - - - - - -Do section labels include the component label? - -If true (non-zero), section labels are prefixed with the label of the -component that contains them. - - - - - - - - -Are chapters and appendixes enumerated? - -If true (non-zero), unlabeled chapters and appendixes will be enumerated. - - - - - - - - -Are prefaces enumerated? - -If true (non-zero), unlabeled prefaces will be enumerated. - - - - - - - - -Are parts and references enumerated? - -If true (non-zero), unlabeled parts and references will be enumerated. - - - - - - - - -Are divisions in QAndASets enumerated? - -If true (non-zero), unlabeled qandadivs will be enumerated. - - - - - - - - -Does enumeration of QandASet components inherit the numeration of parent elements? - -If true (non-zero), numbered QandADiv elements and Questions and Answers inherit -the numeration of the ancestors of the QandASet. - - - - - -number - - -Sets the default for defaultlabel on QandASet. - -If no defaultlabel attribute is specified on a QandASet, this -value is used. It must be one of the legal values for the defaultlabel -attribute. - - - - - -1 - - -Is a Table of Contents created for QandASets? - -If true (non-zero), a ToC is constructed for QandASets. - - - - - -0 - - -Is a Table of Contents created for QandADivs? - -If true (non-zero), a ToC is constructed for QandADivs. - - - - - -. - - -Text to separate bibliography entries - -Text to separate bibliography entries - - - - - -2 - - -How deep should recursive sections appear -in the TOC? - -Specifies the depth to which recursive sections should appear in the -TOC. - - - - - - - - -Will the output be chunked? - -In addition to providing chunking, the chunker can cleanup a -number of XML to HTML issues. If the chunker is not being used, the -stylesheets try to avoid producing results that will not appear properly -in browsers. - - - - - - - - -Should TOCs be genereated in components (Chapters, Appendixes, etc.)? - -If true (non-zero), they are. - - - - - - - -Should TOCs be genereated in divisions (Books, Parts, etc.)? - -If true (non-zero), they are. - - - - - - - - -Mailto URL for the LINK REL=made HTML HEAD element - -If not the empty string, this address will be used for the -REL=made LINK element in the HTML HEAD. - - - - - - - - -Default extension for graphic filenames - -If a graphic or mediaobject -includes a reference to a filename that does not include an extension, -and the format attribute is -unspecified, the default extension will be used. - - - - - -dl - - -Type of HTML list element to use for Tables of Contents - -When an automatically generated Table of Contents (or List of Titles) -is produced, this HTML element will be used to make the list. - - - - - -1 - - -Test the target of IDREF attributes? - -If 1, the target of IDREF attributes are tested for presence -(and uniqueness). This can be very expensive in large documents. - - - - - - - - -Use the XPath id() function to find link targets? - -If 1, the stylesheets use the id() function -to find the targets of cross reference elements. This is more -efficient, but only works if your XSLT processor implements the -id() function, naturally. -THIS PARAMETER IS NOT SUPPORTED. IT IS ALWAYS ASSUMED TO BE 1. -SEE xref.xsl IF YOU NEED TO TURN IT OFF. - - - - - - - -Insert additional <p> elements for spacing? - -When non-zero, additional, empty paragraphs are inserted in -several contexts (for example, around informal figures), to create a -more pleasing visual appearance in many browsers. - - - - - - - white - black - #0000FF - #840084 - #0000FF - - - -Additional attributes for the HTML body tag - -The attributes defined by this attribute set are added to the -HTML <body> tag. - - - - - -1 - - -Enable CSS decoration of elements - - -If css.decoration is turned on, then HTML elements -produced by the -stylesheet may be decorated with STYLE attributes. For example, the -LI tags produced for list items may include a fragment of CSS in the -STYLE attribute which sets the CSS property "list-style-type". - - - - - -0 - - -Enable decoration of elements that have a revisionflag - - -If show.revisionflag is turned on, then the stylesheets -may produce additional markup designed to allow a CSS stylesheet to -highlight elements that have specific revisionflag settings. - -The markup inserted will be usually be either a <span> or <div> -with an appropriate class attribute. (The value of -the class attribute will be the same as the value of the revisionflag -attribute). In some contexts, for example tables, where extra markup -would be structurally illegal, the class attribute will be added to the -appropriate container element. - -In general, the stylesheets only test for revisionflag in contexts -where an importing stylesheet would have to redefine whole templates. -Most of the revisionflag processing is expected to be done by another -stylesheet, for example changebars.xsl. - - - - -0 - - -Disable header and footer navigation - - -If suppress.navigation is turned on, header and -footer navigation will be suppressed. - - - - - - - -Specify the root element to format - -If rootid is specified, it must be the -value of an ID that occurs in the document being formatted. The entire -document will be loaded and parsed, but formatting will begin at the -element identified, rather than at the root. For example, this allows -you to process only chapter 4 of a book. -Because the entire document is available to the processor, automatic -numbering, cross references, and other dependencies are correctly -resolved. - - - - - - - -Present callout lists using a table? - -The default presentation of CalloutLists uses -an HTML DL. Some browsers don't align DLs very well -if callout.graphics are used. With this option -turned on, CalloutLists are presented in an HTML -TABLE, which usually results in better alignment -of the callout number with the callout description. - - - - - - - -Use graphics for callouts? - -If non-zero, callouts are presented with graphics (e.g., reverse-video -circled numbers instead of "(1)", "(2)", etc.). -Default graphics are provided in the distribution. - - - - - - - - -Extension for callout graphics - -Sets the extension to use on callout graphics. - - - - - - - -Path to callout graphics - -Sets the path, probably relative to the directory where the HTML -files are created, to the callout graphics. - - - - - - - - -Number of the largest callout graphic - -If callout.graphics -is non-zero, graphics are used to represent -callout numbers. The value of -callout.graphics.number.limit -is -the largest number for which a graphic exists. If the callout number -exceeds this limit, the default presentation "(nnn)" will always -be used. - - - - - - - - -Enable Saxon extensions - -If non-zero, saxon extensions may be used. Each extension is -further controlled by its own parameter. But if -saxon.extensions is zero, no extensions will -be used. - - - - - - - - -Enable the textinsert extension element - -The textinsert extension element inserts the contents of a -a file into the result tree (as text). - - - - - - - - -Enable the line numbering extension - -If true, verbatim environments (elements that have the -format='linespecific' notation attribute: address, literallayout, -programlisting, screen, synopsis) that specify line numbering will -have, surprise, line numbers. - - - - - - - - -Indicate which lines should be numbered - -If line numbering is enabled, everyNth line will be numbered. - - - - - - - - -Indicates the width of line numbers - -If line numbering is enabled, line numbers will appear right -justified in a field "width" characters wide. - - - - - - - - -Specify a separator between line numbers and lines - -The separator is inserted between line numbers and lines in -the verbatim environment. - - - - - - - - -Enable the callout extension - -The callouts extension processes areaset -elements in ProgramListingCO and other text-based -callout elements. - - - - - - - - -Indicates what column callouts appear in by default - -If a callout does not identify a column (for example, if it uses -the linerange unit), -it will appear in the default column. - - - - - - - - -Identifies the output format of this stylesheet - -The Saxon extension functions need to know if the output format -is HTML ('html') or XSL Formatting Objects ('fo'). This variable answers -that question. Valid settings are 'html' or 'fo'. - - - - - - - -The (absolute) nominal width of tables - -In order to convert CALS column widths into HTML column widths, it -is sometimes necessary to have an absolute table width to use for conversion -of mixed absolute and relative widths. This value must be an absolute -length (not a percentag). - - - - - - - -The default width of tables - -If specified, this value will be used for the WIDTH attribute on -tables that do not specify an alternate width (with the dbhtml processing -instruction). - - - - - - - -Enable the table columns extension function - -The table columns extension function adjusts the widths of table -columns in the HTML result to more accurately reflect the specifications -in the CALS table. - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - - - -FIXME: - -FIXME: - - - - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/pi.xsl b/components/help/converters/gnome-db2html3/docbook/html/pi.xsl deleted file mode 100644 index b9220aa9f..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/pi.xsl +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - filename - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - filename - - - - - - - - dir - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    -
    - - - - - - No cmdsynopsis elements matched dbcmdlist PI, perhaps it's nested too deep? - - - -
    - - - -
    -
    - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    -
    - - - - - - No funcsynopsis elements matched dbfunclist PI, perhaps it's nested too deep? - - - -
    - - - -
    -
    - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/qandaset.xsl b/components/help/converters/gnome-db2html3/docbook/html/qandaset.xsl deleted file mode 100644 index bdbfea1a8..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/qandaset.xsl +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - - - - - - - - - - -
    -

    - - - - - - - -

    - -
    -
    - - - - - -
    -

    - - - - - -

    - -
    -
    - - - - - - - - -
    - - -
    -
    - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    -
    - - - - - - - - - - - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/refentry.xsl b/components/help/converters/gnome-db2html3/docbook/html/refentry.xsl deleted file mode 100644 index 0d8dc3669..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/refentry.xsl +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - , - - - - - -

    -
    - - - , - -
    - - - - - em-dash - - - - - - - - - - -

    - - - - : - - - -

    -
    - - -
    - - - - - -

    Synopsis

    - -
    -
    - - - - - - - - - - - -

    - - - - - - - - -

    -
    - - -

    - - - - - - - - -

    -
    - - -

    - - - - - - - - -

    -
    - - - - - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/sections.xsl b/components/help/converters/gnome-db2html3/docbook/html/sections.xsl deleted file mode 100644 index ea7eb226a..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/sections.xsl +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - title - - - clear: all - - - - - - - - - - - - - - - - - -

    -
    - -
    - diff --git a/components/help/converters/gnome-db2html3/docbook/html/synop.xsl b/components/help/converters/gnome-db2html3/docbook/html/synop.xsl deleted file mode 100644 index 9c0f30d70..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/synop.xsl +++ /dev/null @@ -1,939 +0,0 @@ - - - -]> - - - - - - - - - - - - - - - - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - -
    - ( - - ) - - - - - - - - - - - - -

    - - ( - - ) - - - -

    -
    - - - - - - -
    -
    - - -

    - - - - - - -

    -
    - - - - - - - - - - - - - - - - - - - - - - (void); - - - (); - - - - - - (...); - - - - - - - ( - - - - - - - - - - - , - - - ); - - - - - - - - - - - - - - - - - , - - - - -
    - - ; -
    - - - ( - - ) - - - - -java - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unrecognized language on classsynopsis: - - - - - - - - - - - - -
    -    
    -    
    -       extends
    -      
    -      
    -	&RE;    
    -      
    -    
    -    
    -      implements
    -      
    -      
    -	&RE;    
    -      
    -    
    -    
    -      throws
    -      
    -    
    -     {&RE;&RE;
    -    
    -    }
    -  
    -
    - - - - - - - - - , - - - - - - - - - - - - - -   - - - - - - , - - - - - - - - - , - - - - - - - - - , - - - - - - - -
    -    - - ; -
    -
    - - - - -   - - - - - - -   - - - - - - - - - - - - - void  - - - - - - - - - - - 0 - - ,&RE; - - -   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - ( - - - - ) - - &RE;    throws  - - - ; -
    -
    - - - - -
    -    
    -    
    -      : 
    -      
    -      
    -	&RE;    
    -      
    -    
    -    
    -       implements
    -      
    -      
    -	&RE;    
    -      
    -    
    -    
    -       throws
    -      
    -    
    -     {&RE;&RE;
    -    
    -    }
    -  
    -
    - - - - - - - - , - - - - - - - - - -   - - - - - - , - - - - - - - - - , - - - - - - - - - , - - - - - - - -
    -    - - ; -
    -
    - - - - -   - - - - - - -   - - - - - - - - - - - - - void  - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - ( - - ) - - &RE;    throws  - - - ; -
    -
    - - - - -
    -    interface 
    -    
    -    
    -      : 
    -      
    -      
    -	&RE;    
    -      
    -    
    -    
    -       implements
    -      
    -      
    -	&RE;    
    -      
    -    
    -    
    -       throws
    -      
    -    
    -     {&RE;&RE;
    -    
    -    }
    -  
    -
    - - - - - - - - , - - - - - - - - - -   - - - - - - , - - - - - - - - - , - - - - - - - - - , - - - - - - - -
    -    - - ; -
    -
    - - - - -   - - - - - - -   - - - - - - - - - - - - - void  - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - ( - - ) - - &RE;    raises( - - ) - - ; -
    -
    - - - - -
    -    package 
    -    
    -    ;&RE;
    -
    -    
    -      @ISA = (
    -      
    -      );&RE;
    -    
    -
    -    
    -  
    -
    - - - - - - - - , - - - - - - - - - -   - - - - - - , - - - - - - - - - , - - - - - - - - - , - - - - - - - -
    -    - - ; -
    -
    - - - - -   - - - - - - -   - - - - - - - - - - - - - void  - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - -
    - sub - - - { ... }; -
    -
    - - - -
    diff --git a/components/help/converters/gnome-db2html3/docbook/html/table.xsl b/components/help/converters/gnome-db2html3/docbook/html/table.xsl deleted file mode 100644 index 724529560..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/table.xsl +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 100% - - - - - - - - - - - 0 - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 100% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - th - - - - - - td - - - - - - th - - - - - td - - - - - - - - - - - - - - - - 0 - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - - - - - - - - - -   - - - - - - - - -Insert empty TDs into a table row - -This template inserts empty TDs into a table row. - - - -number - -The number of empty TDs to add. - - - - - -Nothing - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - -Determine the column number in which a given entry occurs - -If an entry has a -colname or -namest attribute, this template -will determine the number of the column in which the entry should occur. -For other entrys, nothing is returned. - - - -entry - -The entry-element which is to be tested. - - - - - - -This template returns the column number if it can be determined, -or nothing (the empty string) - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - 1 - - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - diff --git a/components/help/converters/gnome-db2html3/docbook/html/titlepage.templates.xsl b/components/help/converters/gnome-db2html3/docbook/html/titlepage.templates.xsl deleted file mode 100644 index e6f6ca8ff..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/titlepage.templates.xsl +++ /dev/null @@ -1,1986 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - - -
    - -
    - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - -
    \ No newline at end of file diff --git a/components/help/converters/gnome-db2html3/docbook/html/titlepage.xsl b/components/help/converters/gnome-db2html3/docbook/html/titlepage.xsl deleted file mode 100644 index f2da969de..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/titlepage.xsl +++ /dev/null @@ -1,598 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - -
    - - - - - - -
    -
    - - - - - - -
    -  
    -  
    -
    - - -
    - -
    -
    - - - - -
    -
    -
    - - -

    - -
    - - -
    - -
    -
    - - - - - - - - -
    -
    -
    - - - - - - - - - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - - -

    - - - - copyright - - - - - - - -

    -
    - - - , - - - - - - - - - - - -

    - -

    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - -

    - - - -

    -
    - - -

    -
    - - -

    -

    -
    - - - - -
    -
    -
    - - - - - - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - - -
    - -
    -
    - - -

    -
    - - - - -
    -
    -
    - - - - - - - -
    -
    -
    - - - - -
    -
    -
    - - -

    - -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - -
    - -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - -

    - -

    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - - 3 - 2 - - - -
    - - - - - - - -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - - -

    - -

    -
    - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - -

    - - - - - - - - - - - -

    - - - - - -
    -
    -
    - - - - -
    -
    -
    - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/toc.xsl b/components/help/converters/gnome-db2html3/docbook/html/toc.xsl deleted file mode 100644 index 55d471626..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/toc.xsl +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/verbatim.xsl b/components/help/converters/gnome-db2html3/docbook/html/verbatim.xsl deleted file mode 100644 index 58a051cbc..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/verbatim.xsl +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    -        
    -          
    -            
    -          
    -          
    -            
    -          
    -        
    -      
    -
    - -
    -        
    -      
    -
    -
    - - - - - - - - - - - - - - -
    -            
    -              
    -                
    -              
    -              
    -                
    -              
    -            
    -          
    -
    - -
    - - - - - - - - -
    -
    -
    -
    - - - -
    -            
    -          
    -
    - -
    - -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - -
    - - - - - - - - -
    -
    - -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - - -
    - - - -
    - - - - -   - - - - - - - - -
    - - - -
    - - - - - -
    -
    - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/xref.xsl b/components/help/converters/gnome-db2html3/docbook/html/xref.xsl deleted file mode 100644 index b0efbe6e2..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/xref.xsl +++ /dev/null @@ -1,633 +0,0 @@ - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - XRef to nonexistent id: - - - ??? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Endterm points to nonexistent ID: - - - ??? - - - - - - - - - - - - - - - - - - - - - - - - - - %g %n - - - - - - - - - - - - - - - [Don't know what gentext to create for xref to: " - - "] - - ??? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ - - - - - - - - - ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - the section called - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/components/help/converters/gnome-db2html3/docbook/html/xtchunk.xsl b/components/help/converters/gnome-db2html3/docbook/html/xtchunk.xsl deleted file mode 100644 index aeb41b564..000000000 --- a/components/help/converters/gnome-db2html3/docbook/html/xtchunk.xsl +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/components/help/converters/gnome-db2html3/docbook/lib/.cvsignore b/components/help/converters/gnome-db2html3/docbook/lib/.cvsignore deleted file mode 100644 index 282522db0..000000000 --- a/components/help/converters/gnome-db2html3/docbook/lib/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/components/help/converters/gnome-db2html3/docbook/lib/Makefile.am b/components/help/converters/gnome-db2html3/docbook/lib/Makefile.am deleted file mode 100644 index 1152f93c8..000000000 --- a/components/help/converters/gnome-db2html3/docbook/lib/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -libdir=$(datadir)/sgml/docbook/xsl-stylesheets-1.29/lib - -lib_DATA=lib.xsl - -EXTRA_DIST=$(lib_DATA) diff --git a/components/help/converters/gnome-db2html3/docbook/lib/lib.xsl b/components/help/converters/gnome-db2html3/docbook/lib/lib.xsl deleted file mode 100644 index 7aa690b47..000000000 --- a/components/help/converters/gnome-db2html3/docbook/lib/lib.xsl +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - -$Id$ - -Walsh -Norman -19992000 -Norman Walsh - - -Library Template Reference - - -
    Introduction - -This is technical reference documentation for the DocBook XSL -Stylesheets; it documents (some of) the parameters, templates, and -other elements of the stylesheets. - -This is not intended to be user documentation. -It is provided for developers writing customization layers for the -stylesheets, and for anyone who's interested in how it -works. - -Although I am trying to be thorough, this documentation is known -to be incomplete. Don't forget to read the source, too :-) -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Substitute one text string for another in a string - -The string.subst template replaces all -occurances of target in string -with replacement and returns the result. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Extract IDREF from an XPointer - -The xpointer.idref template returns the -ID portion of an XPointer which is a pointer to an ID within the current -document, or the empty string if it is not. -In other words, xpointer.idref returns -foo when passed either #foo -or #xpointer(id('foo')), otherwise it returns -the empty string. - - - - - http://... - - - - - - - - - - - - - - - - -Return the unqualified dimension from a length specification - -The length-magnitude template returns the -unqualified length ("20" for "20pt") from a dimension. - - - - - - - - - - - - - - - - - - - - - -Return a fully qualified length specification - -The length-spec template returns the -qualified length from a dimension. If an unqualified length is given, -the default.units will be added to it. - - - - - - - - - - - - - - - - - - - - - - - - - - - Unrecognized unit of measure: - - . - - - - - -
    diff --git a/components/help/converters/gnome-db2html3/gnome-customization/.cvsignore b/components/help/converters/gnome-db2html3/gnome-customization/.cvsignore deleted file mode 100644 index 282522db0..000000000 --- a/components/help/converters/gnome-db2html3/gnome-customization/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/components/help/converters/gnome-db2html3/gnome-customization/Makefile.am b/components/help/converters/gnome-db2html3/gnome-customization/Makefile.am deleted file mode 100644 index 0c94ba289..000000000 --- a/components/help/converters/gnome-db2html3/gnome-customization/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -gnomecustomizationdir=$(datadir)/sgml/docbook/gnome-customization-0.1 - -gnomecustomization_DATA = \ - gnome-customization.xsl - -EXTRA_DIST=$(gnomecustomization_DATA) diff --git a/components/help/converters/gnome-db2html3/gnome-customization/eric_customization.xsl b/components/help/converters/gnome-db2html3/gnome-customization/eric_customization.xsl deleted file mode 100644 index 33cefe197..000000000 --- a/components/help/converters/gnome-db2html3/gnome-customization/eric_customization.xsl +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -./stylesheet/ - - - - - - - - - - - - - - - - - - - -

    - -

    -
    - - - -
    - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    - -
    -
    -
    - - -Written by: -maintained by: - - -

    - - - - - - is - - - - - - - - -

    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - -
    - - - - - - diff --git a/components/help/converters/gnome-db2html3/gnome-customization/eric_titlepage.xsl b/components/help/converters/gnome-db2html3/gnome-customization/eric_titlepage.xsl deleted file mode 100644 index 8dfcade9a..000000000 --- a/components/help/converters/gnome-db2html3/gnome-customization/eric_titlepage.xsl +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - GNOME Logo - - - - - - - - - - - -
    - - - - - -
    -
    - - - - - - - - - - - - - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    - -
    -
    - - -
    diff --git a/components/help/converters/gnome-db2html3/gnome-customization/gnome-customization.xsl b/components/help/converters/gnome-db2html3/gnome-customization/gnome-customization.xsl deleted file mode 100644 index 3aacaa051..000000000 --- a/components/help/converters/gnome-db2html3/gnome-customization/gnome-customization.xsl +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -

    - - - - ?legalnotice - - - - - copyright - - - - - - - - -

    - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - A fileref or entityref is required on - - - - - - - - - - - - - - - - - % - - - - - - - - - - - - - - - - - - - - - file:// - - / - - .png - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/components/help/converters/gnome-db2html3/gnome-db2html3.c b/components/help/converters/gnome-db2html3/gnome-db2html3.c deleted file mode 100644 index 3f65d8fbe..000000000 --- a/components/help/converters/gnome-db2html3/gnome-db2html3.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * gnome-db2html3 - by John Fleck - based on Daniel Veillard's - * xsltproc: user program for the XSL Transformation engine - * - * Copyright (C) John Fleck, 2001 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA. - * - */ - -#ifdef USE_GNOME_DB2HTML3 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern int xmlLoadExtDtdDefaultValue; - -int -main(int argc, char **argv) { - - xsltStylesheetPtr gdb_xslreturn; - xmlDocPtr gdb_doc, gdb_results; - const char *params[16 + 1]; - char *gdb_docname; /* name of doc to be parsed */ - char *gdb_pathname; /* path to the file to be parsed */ - char *gdb_rootid; /* id of sect, chapt, etc to be parsed */ - char *gdb_stylesheet; /* stylesheet to be used */ - char **gdb_split_docname; /* placeholder for file type determination */ - char *ptr; - const char *gdb_catalogs; /* catalog(s) name */ - gboolean has_rootid; - - has_rootid = FALSE; - gdb_doc = NULL; - gdb_rootid = NULL; - - /* stylesheet location based on Linux Standard Base * - * http://www.linuxbase.org/spec/gLSB/gLSB/sgmlr002.html */ - gdb_stylesheet = g_strconcat (PREFIXDIR, "/share/sgml/docbook/gnome-customization-0.1/gnome-customization.xsl", NULL); - - if (argc <= 1) { - g_print("Usage: %s file?rootid, where file\n", argv[0]); - g_print("is the name of the file to be parsed and rootid\n"); - g_print("is the id of the section to be displayed\n"); - return(0); - } - - /* use libxml2 catalog routine to retrieve catalog * - * info to speed dtd resolution */ - gdb_catalogs = getenv("SGML_CATALOG_FILES"); - if (gdb_catalogs == NULL) { - fprintf(stderr, "Variable $SGML_CATALOG_FILES not set\n"); - } else { - xmlLoadCatalogs(gdb_catalogs); - } - - gdb_docname = argv[1]; - - /* check to see if gdb_docname has a ?sectid included */ - for (ptr = gdb_docname; *ptr; ptr++){ - if (*ptr == '?') { - *ptr = '\000'; - if (*(ptr + 1)) { - gdb_rootid = ptr; - has_rootid = TRUE; - } - } - } - - /* libxml housekeeping */ - xmlSubstituteEntitiesDefault(1); - xmlLoadExtDtdDefaultValue = 1; - - /* parse the stylesheet */ - gdb_xslreturn = xsltParseStylesheetFile((const xmlChar *)gdb_stylesheet); - if (gdb_xslreturn != NULL) { - g_printerr ("Stylesheet %s successfully parsed\n", gdb_stylesheet); - } - - /* check the file type by looking at name - * FIXME - we need to be more sophisticated about this - * then parse as either xml or sgml */ - gdb_split_docname = g_strsplit(gdb_docname, ".", 2); - if (!strcmp(gdb_split_docname[1], "sgml")) { - gdb_doc = docbParseFile(gdb_docname, "UTF-8"); - } else { - (gdb_doc = xmlParseFile(gdb_docname)); - } - - if (gdb_doc == NULL) { - g_printerr ("Document not parsed successfully. \n"); - return (0); - } - else { - g_printerr ("Document %s successfully parsed\n", gdb_docname); - } - - /* retrieve path component of filename passed in at - command line */ - gdb_pathname = g_dirname (gdb_doc->URL); - - /* set params to be passed to stylesheet */ - params[0] = "gdb_docname"; - params[1] = g_strconcat("\"", gdb_doc->URL, "\"", NULL) ; - params[2] = "gdb_pathname"; - params[3] = g_strconcat("\"", gdb_pathname, "\"", NULL) ; - params[4] = NULL; - - if (has_rootid) { - params[4] = "rootid"; - params[5] = g_strconcat("\"", gdb_rootid + 1, "\"", NULL) ; - params[6] = NULL; - } - - gdb_results = xsltApplyStylesheet(gdb_xslreturn, gdb_doc, params); - - if (gdb_results != NULL) { - g_printerr ("Stylesheet successfully applied\n"); - } - - /* print out the results */ - xsltSaveResultToFile(stdout, gdb_results, gdb_xslreturn); - - return (1); -} - -#else - -int -main(int argc, char **argv) { - return 1; -} - -#endif /* USE_GNOME_DB2HTML3 */ diff --git a/components/help/converters/gnome-info2html2/.cvsignore b/components/help/converters/gnome-info2html2/.cvsignore deleted file mode 100644 index c76aa6e13..000000000 --- a/components/help/converters/gnome-info2html2/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -Makefile.in -.deps -.libs -gnome-info2html2 \ No newline at end of file diff --git a/components/help/converters/gnome-info2html2/Makefile.am b/components/help/converters/gnome-info2html2/Makefile.am deleted file mode 100644 index 2bc7984c7..000000000 --- a/components/help/converters/gnome-info2html2/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## Process this file with automake to produce Makefile.in. - -INCLUDES = -LDADD = - -bin_PROGRAMS = gnome-info2html2 - -gnome_info2html2_SOURCES = main.c parse.c utils.c html.c data.h html.h parse.h utils.h version.h diff --git a/components/help/converters/gnome-info2html2/data.h b/components/help/converters/gnome-info2html2/data.h deleted file mode 100644 index 60a2ce747..000000000 --- a/components/help/converters/gnome-info2html2/data.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef DATA_H -#define DATA_H - -/* data.h - first cut at data structures for info2html filter */ -/* many of these are motivated by the source code to the 'info' program */ - -/* file we're working on */ -char work_filename[1024]; - -/* node we're working on */ -char work_node[1024]; - -/* some type's we'll want to use below */ -typedef struct info_menu_entry MENU_ENTRY; - -/* the basic component of an info file is a Node */ -/* a node is described by (FILENAME)NODENAME */ -/* .next and .prev are normally along the same branch as current node */ -/* .up is normally 'one branch' up the tree above current branch. */ -/* All can be arbitrary links however */ -/* menu entry is just a linked list of references */ - -typedef struct { - char *filename; /* file in which this node exists */ - char *nodename; /* name of this node */ - char *contents; /* text within this node */ - int contlen; /* length of contents */ - char *next; /* node which follows this one */ - char *prev; /* node previous to this one */ - char *up; /* node above this one */ - MENU_ENTRY *menu; /* linked list of refs from this node */ - char *menu_start; /* ptr to start of menu text in contents */ -} NODE; - -/* a reference is a link to a node */ -typedef struct { - char *refname; /* menu name for reference */ - NODE *node; /* descriptor of node we point at */ -} REFERENCE; - - -struct info_menu_entry{ - char *header; /* header to go before menu */ - REFERENCE *ref; - struct info_menu_entry *next; -}; - -#define INFO_FF '\014' -#define INFO_COOKIE '\037' - - -#define MENU_START "* Menu:" -#define MENU_ENTRY "* " - - -#endif /* DATA_H */ diff --git a/components/help/converters/gnome-info2html2/html.c b/components/help/converters/gnome-info2html2/html.c deleted file mode 100644 index 7044f95d1..000000000 --- a/components/help/converters/gnome-info2html2/html.c +++ /dev/null @@ -1,925 +0,0 @@ -/* handles all html operations */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "data.h" -#include "html.h" -#include "parse.h" -#include "utils.h" - -#define USE_FILE_URLS - -int inTable=0; - -char *BaseFilename=NULL; -char *OverrideBaseFilename=NULL; - -int galeon_mode=0; - -/* prototypes */ -char *form_info_tag_href( char *nodefile, char *nodename ); -int make_Top_link( char *destdir, char *destfile ); -int make_info_dir( char *destdir ); -void write_node_link_html( FILE *f, char *nodefile, char *refname, char *ref ); -void start_html_content( FILE *f ); -void make_nav_links( FILE *f, NODE *node ); -void html_error( char *s, char *p, char *q ); - - -/* print out the url for a info file */ -char *form_info_tag_href( char *nodefile, char *nodename ) -{ - char tmp[1024]; - char *escaped_nodename; - char *filename; - - escaped_nodename = escape_html_chars( nodename ); - if (!strcmp(BaseFilename, nodefile)) - { - if (OverrideBaseFilename) - filename = OverrideBaseFilename; - else - filename = BaseFilename; - } - else - filename = nodefile; - - if (galeon_mode) - g_snprintf (tmp, sizeof (tmp), "HREF=\"info:%s?%s\"", filename, escaped_nodename); - else - g_snprintf (tmp, sizeof (tmp), "HREF=\"#%s\"", escaped_nodename); - - if (escaped_nodename) - g_free(escaped_nodename); - return g_strdup(tmp); -} - - -/* returns zero if success making link from destfile -> index.html in */ -/* specified directory. If it already exists, just returns with success */ -int make_Top_link( char *destdir, char *destfile ) -{ - struct stat filestat; - char *indexlink; - - indexlink = (char *) g_malloc( strlen(destdir) + 20); - strcpy(indexlink, destdir); - strcat(indexlink, "/index.html"); - - if (lstat(indexlink, &filestat)) - { - if (errno == ENOENT) - { - if (symlink(destfile, indexlink)) - { - fprintf(stderr,"Error creating link to %s\n",indexlink); - perror("Error was"); - exit(1); - } - } - else - { - fprintf(stderr,"Error stat'ing file %s\n",indexlink); - perror("Error was"); - exit(1); - } - } - else if (!S_ISLNK(filestat.st_mode)) - { - fprintf(stderr, "file %s exists and isnt a link\n",indexlink); - fprintf(stderr, "FIX ME!!!\n"); - g_free(indexlink); - return -1; - } - return 0; -} - -/* return non-zero if error with making directory */ -int make_info_dir( char *destdir ) -{ - struct stat filestat; - - if (stat(destdir, &filestat)) - { - if (errno == ENOENT) - { - if (mkdir(destdir, 01777)) - { - fprintf(stderr,"Error creating directory %s\n",destdir); - perror("Error was"); - exit(1); - } - } - else - { - fprintf(stderr,"Error stat'ing directory %s\n",destdir); - perror("Error was"); - exit(1); - } - } - else if (!S_ISDIR(filestat.st_mode)) - { - fprintf(stderr, "Info dir %s exists and isnt a directory!\n",destdir); - fprintf(stderr, "FIX ME!!!\n"); - return -1; - } - return 0; -} - -/* write a link to another document */ -void write_node_link_html( FILE *f, char *nodefile, char *refname, char *ref ) -{ - char *converted_nodename; - char *href; - - if (ref) { - if (g_strcasecmp(ref, "(dir)")) { - converted_nodename = g_strdup( ref ); - map_spaces_to_underscores( converted_nodename ); - href = form_info_tag_href(nodefile, converted_nodename); - fprintf(f,"%s%s\n", href, refname, ref); - g_free(href); - g_free(converted_nodename); - } else { - href = form_info_tag_href("dir", "Top"); - fprintf(f,"%s(dir)\n",href, refname); - g_free(href); - - } - } -} - -/* write out top of a new html file */ -#if 0 -void write_html_header( FILE *f, char *filename, char *nodename) -{ - fprintf(f,"\n"); - fprintf(f,"\n"); - fprintf(f,"\n"); - fprintf(f,"Info Node: (%s)%s\n",filename,nodename); - fprintf(f,"\n"); - fprintf(f,"\n"); - fprintf(f,"\n",work_filename, work_node); -} -#endif - -/* start of everything after html header */ -void start_html_content( FILE *f ) -{ - fprintf(f,"\n"); -} - -/* we want to put links to next, prev, and up nodes */ -void make_nav_links( FILE *f, NODE *node ) -{ -#if 0 - fprintf(f,"
    \n");
    -  write_node_link_html( f, node->filename, "Next:", node->next );
    -  write_node_link_html( f, node->filename, "Prev:", node->prev );
    -  write_node_link_html( f, node->filename, "Up:", node->up );
    -  fprintf(f,"
    \n"); -#else - fprintf(f,"\n"); - fprintf(f,"\n"); - fprintf(f,"\t\n"); - fprintf(f,"\t\n"); - fprintf(f,"\t\n"); - fprintf(f,"\n
    \n\t"); - write_node_link_html( f, node->filename, "Next:", node->next ); - fprintf(f,"\t\n\t"); - write_node_link_html( f, node->filename, "Prev:", node->prev ); - fprintf(f,"\t\n\t"); - write_node_link_html( f, node->filename, "Up:", node->up ); - fprintf(f,"\t
    \n"); -#endif - -} - -/* s is error message */ -/* p is start of offending line */ -/* q is end of offending line */ -void html_error( char *s, char *p, char *q ) -{ - fprintf(stderr, "%s:%s\n",work_filename, work_node); - fprintf(stderr, "\t%s\n",s); - fprintf(stderr, "\tOffending line is:\n\t|"); - fwrite(p, 1, q-p, stderr); - fprintf(stderr, "|\n"); -} - -/******************************************************************** - * here is what we expect in contents of a node: - * - * headers: These are identified as a line of text - * followed by a row of '---' or '###' normally. - * These get mapped to

    for now. - * - * body text: Format this between
     
    statements. - * Catch any *Note and *note and make into - * links to other documents. Also try to catch - * URLs as well. - * - * menus: Starts with a '* Menu' line. Goes until the - * end of the node, or until the next line which - * starts with something other than a '* ' or '\n'. - * - * end of node: The INFO_FF and INFO_COOKIE mark the end of a node. - * Hitting EOF also marks the end of a node. - ********************************************************************/ - -void dump_html_for_node( NODE *node ) -{ -/* char *destdir; */ -/* char *destfile; */ - char *escaped_nodename; -/* char *converted_nodename; */ - char *contents_start, *contents_end; - char *header_name; - char *p, *q, *r, *skippnt; - char *end_menu_entry; - - - int menu_open, body_open; - - int seen_menu; - - int prev_was_blank, next_is_blank, current_is_blank; - - int seen_first_header; - - int last_output_was_header; - - int nskip; - - int we_are_in_dir_node; - - int i; - - FILE *f; - -/* msf - used to write each node to a separate file - now we're going */ -/* to just output HTML to stdout. */ -/* Each node will just be concantentated to previous */ -#if 0 - destdir = (char *) g_malloc ( strlen(node->filename) + - strlen(HTML_ROOT) + - strlen(node->filename) + 2); - strcpy(destdir, HTML_ROOT); - strcat(destdir, "/"); - strcat(destdir, node->filename); - strcat(destdir, "/"); - - /* check that the dir for info file exists */ - make_info_dir( destdir ); - - /* ok, we made the dir, lets go */ - destfile = (char *) g_malloc( strlen(destdir) + strlen(node->nodename) + 10); - strcpy(destfile, destdir); - converted_nodename = g_strdup( node->nodename ); - map_spaces_to_underscores( converted_nodename ); - strcat(destfile, converted_nodename); - strcat(destfile, ".html"); - g_free(converted_nodename); - - if (!(f=fopen(destfile, "w"))) - { - fprintf(f,"Couldnt create node html file %s\n",destfile); - perror("Error was"); - exit(1); - } -#endif - - /* hack - just dump to stdout for now */ - f = stdout; - - /* see if this is THE dir node */ - we_are_in_dir_node = !strcmp("Top", node->nodename) && !strcmp("dir", node->filename); - -#if 0 - /* try and make a link between 'index.html' and 'Top.html' */ - if (!strcmp("Top", node->nodename)) - make_Top_link( destdir, destfile ); -#endif - -#if 0 - /* do the html header first */ - write_html_header( f, node->filename, node->nodename ); -#endif - -#if 0 - /* now for the body */ - start_html_content( f ); -#endif - - /* make an anchor */ - escaped_nodename = escape_html_chars( node->nodename ); - map_spaces_to_underscores( escaped_nodename ); - fprintf(f, "\n",escaped_nodename); - g_free(escaped_nodename); - - /* links to other immediate nodes */ - make_nav_links( f, node ); - - /* setup pointers to textual content of current node */ - contents_start = node->contents; - contents_end = node->contents+node->contlen; - - /* scan through all of contents and generate html on the fly */ - /* p points at start of current line */ - /* q points at the end of current line (at '\n' actually) */ - /* r points at the start of next line */ - /* we do this to catch headers */ - /* scan for a header at the top of the contents */ - /* if we see a '\n***'3 '*' in a row i */ - /* then take previous line as a header */ - header_name = NULL; - p = contents_start = node->contents; - q = memchr(p, '\n', contents_end - p); - r=q+1; - - /* we have several states we could be in */ - next_is_blank = 0; - prev_was_blank = 0; - current_is_blank = 0; - seen_first_header = 0; - - seen_menu = 0; - menu_open = 0; - body_open = 0; - - last_output_was_header = 0; - for (; q && r <= contents_end; ) - { - nskip = 1; - skippnt = NULL; - next_is_blank = (*r == '\n'); - current_is_blank = (*p == '\n'); - - /* test some easy things first */ - if (!strncmp(p, MENU_START, strlen(MENU_START))) - { - if (we_are_in_dir_node && !seen_menu) - { - if (body_open) - { - close_body_text_html(f); - body_open = 0; - } - - fprintf(f,"

    Main Info File Directory

    \n"); - - open_body_text_html(f); - body_open = 1; - - fprintf(f,"This is the main directory of available info files.\n"); - } - - if (body_open) - { - close_body_text_html(f); - body_open = 0; - } - else if (seen_menu) - html_error("Warning:saw new menu start and already in menu!", p, q); - - if (menu_open) - close_menu_html( f ); - - if (last_output_was_header) - open_menu_html( f, "" ); - else - open_menu_html( f, "Contents" ); - - seen_menu = 1; - menu_open = 1; - last_output_was_header = 0; - } - else if (we_are_in_dir_node && !seen_menu) - { - /* do nothing */ - } - else if (seen_menu) - { - /* if current line is blank ignore it */ - if (current_is_blank) - { - /* do nothing */ - } - /* first see if its a menu line */ - else if (!strncmp(p, MENU_ENTRY, strlen(MENU_ENTRY))) - { - if (!seen_menu) - html_error("Have seen menu start and hit a menu line!", p, q); - else - { - if (body_open) - { - if (menu_open) - html_error("Hit a menu line, and body and menu are opened!", p, q); - close_body_text_html( f ); - body_open = 0; - open_menu_html( f, "" ); - menu_open = 1; - } - if (!menu_open) - { - open_menu_html( f, "" ); - menu_open = 1; - } - write_menu_entry_html( f, p, node->filename, &end_menu_entry ); - if (end_menu_entry != NULL) - skippnt = end_menu_entry; - last_output_was_header = 0; - } - } - /* maybe its a header line */ - /* man this is getting ridiculous, its like teaching a child */ - /* to read! */ - else if (is_a_hdr_line(r) || - (*p != '*' && *r == '*' && *(r+1) == ' ') || - (*p != '*' && seen_menu && (*p != ' ' && *(p+1) != ' ') && - !current_is_blank && prev_was_blank && next_is_blank)) - { - header_name = (char *) g_malloc( q-p+2 ); - memcpy(header_name, p, q-p); - *(header_name + (q - p) ) = '\000'; - - /* if we were writing a particular component, close it */ - if (menu_open) - { - close_menu_html( f ); - menu_open = 0; - } - - if (body_open) - { - close_body_text_html( f ); - body_open = 0; - } - - if (seen_first_header) - write_header_html( f, header_name, HEADER_SIZE_2 ); - else - { - seen_first_header = 1; - write_header_html( f, header_name, HEADER_SIZE_1 ); - } - - g_free(header_name); - - /* jump ahead another line */ - if (!(*r == '*' && *(r+1) == ' ') && !next_is_blank) - nskip++; - - last_output_was_header = 1; - } - /* well, has to be body text then */ - else - { - if (menu_open) - { - close_menu_html( f ); - menu_open = 0; - - write_html_horiz_rule ( f ); - } - - if (!body_open) - { - open_body_text_html( f ); - body_open = 1; - } - - if (*p != '\n' && !last_output_was_header) - { - skippnt=write_body_text_html( f, p, q, node->filename ); - last_output_was_header = 0; - } - } - } - /* otherwise, no menu seen so things are easier */ - else - { - if (is_a_hdr_line(r)) - { - header_name = (char *) g_malloc( q-p+2 ); - memcpy(header_name, p, q-p); - *(header_name + (q - p) ) = '\000'; - - /* if we were writing a particular component, close it */ - if (body_open) - { - close_body_text_html( f ); - body_open = 0; - } - - if (seen_first_header) - write_header_html( f, header_name, HEADER_SIZE_2 ); - else - { - seen_first_header = 1; - write_header_html( f, header_name, HEADER_SIZE_1 ); - } - - g_free(header_name); - - /* jump ahead another line */ - if (!(*r == '*' && *(r+1) == ' ') && !next_is_blank) - nskip++; - - last_output_was_header = 1; - } - /* well, has to be body text then */ - else - { - if (!body_open) - { - open_body_text_html( f ); - body_open = 1; - } - - if (!(*p == '\n' && last_output_was_header)) - { - skippnt=write_body_text_html( f, p, q, node->filename ); - last_output_was_header = 0; - } - } - } - - /* end of cases, move to next line in contents */ - prev_was_blank = (*p == '\n'); - if (skippnt) - { - p = skippnt; - q = memchr(p, '\n', contents_end - p); - r = q+1; - skippnt = NULL; - } - else - for (i=0; i< nskip; i++) - { - p = r; - q = memchr(p, '\n', contents_end - p); - r = q+1; - } - } - - /* thats all folks */ - if (menu_open) - close_menu_html( f ); - else if (body_open) - close_body_text_html( f ); - - /* put nav links at the bottom */ - make_nav_links(f, node); -#if 0 - fprintf(f,"\n\n"); -#endif - - /* clean up */ -#if 0 - g_free(destdir); - g_free(destfile); -#endif -} - - -void write_header_html( FILE *f, char *p, char *hdr ) -{ - fprintf(f,"<%s> %s \n",hdr,p,hdr); -} - - -void open_body_text_html( FILE *f ) -{ - fprintf(f, "
    \n");
    -}
    -
    -void close_body_text_html( FILE *f )
    -{
    -  fprintf(f, "
    \n"); -} - -/* we have to handle '*note' and '*Note' links in body text */ -/* p is ptr to start of current line */ -/* q is ptr to '\n' at end of current line */ -char *write_body_text_html( FILE *f, char *p, char *q, char *nodefile ) -{ - int curlen; - int ref_exists; - char *tmp; - char *ptr; - char *match1; - char *note_ptr; - char *converted_nodename; - char *escaped_refname; - char *escaped_refnode; - char *escaped_seg; - char *refname, *reffile, *refnode, *end; - char *href; - - curlen = q - p; - tmp = (char *) g_malloc( curlen + 1 ); - memcpy( tmp, p, curlen ); - *(tmp+curlen) = '\000'; - - /* see if there is a reference in current line */ - /* and make sure this isnt a '*Note*' instead ! */ - ref_exists = 0; - if ((note_ptr=strstr(tmp, "*Note")) || (note_ptr=strstr(tmp, "*note"))) - if (*(note_ptr+6) != '*') - ref_exists = 1; - - if (ref_exists) - { - /* find the start of the link */ - note_ptr = (note_ptr - tmp) + p; - match1 = note_ptr + 4; - - /* not needed any more */ - g_free(tmp); - - for (; 1; ) - if (*(match1+1) == ' ' || *(match1+1) == '\n') - match1++; - else - break; - - /* find end of the link */ - if (parse_note_ref( match1, &refname, &reffile, &refnode, &end, 1)) - { - html_error( "Corrupt *Note link found!", p, q ); - return NULL; - } - - /* now we assume that parse_note_ref left control chars in ref* */ - /* if both null, we had a '::' and have to set both */ - if (reffile == NULL && refnode == NULL) - { - reffile = g_strdup(nodefile); - refnode = g_strdup(refname); - } - /* otherwise we had (file)., and we set node to 'Top' */ - else if (refnode == NULL) - refnode = g_strdup("Top"); - /* otherwise we had :nodename., and we set node to 'Top' */ - else if (reffile == NULL) - reffile = g_strdup(nodefile); - -/* Here we need to escape everything up to Note. - * One caveat: The "*Note*" itself isn't escaped. Currently we know this is - * okay ("*Note" has no characters needing escapes.) but.... - */ - curlen = note_ptr - p; - tmp = (char *) g_malloc (curlen + 1); - memcpy (tmp, p, curlen); - *(tmp + curlen) = '\000'; - escaped_seg = escape_html_chars (tmp); - g_free (tmp); - - /* write out stuff up to Note */ - fprintf(f, "%s", escaped_seg); - fprintf(f, ""); - fwrite(note_ptr, 1, match1 - note_ptr, f); - fprintf(f, " "); - - /* we need a nice nodename -> filename translation */ - /* so we convert newlines to spaces */ - converted_nodename = g_strdup( refnode ); - convert_newlines_to_spaces( converted_nodename ); - - /* we don't want two spaces in a row */ - strip_dupspaces( converted_nodename ); - map_spaces_to_underscores( converted_nodename ); - - /* escape HTML chars */ - escaped_refname = escape_html_chars( refname ); - escaped_refnode = escape_html_chars( refnode ); - - /* now output the link to html doc */ -#if 0 - fprintf(f,"", reffile, converted_nodename); -#endif - href = form_info_tag_href(reffile, converted_nodename); - fprintf(f,"", href); - for (ptr=escaped_refname; *ptr; ptr++) - if (*ptr == '\n') - { - fprintf(f,"\n"); - fprintf(f,"", href); - } - else - fprintf(f,"%c", *ptr); - - if (strcmp(refname, refnode)) - { - fprintf(f,": "); - for (ptr=escaped_refnode; *ptr; ptr++) - if (*ptr == '\n') - { - fprintf(f,"\n"); - fprintf(f,"", href); - } - else - fprintf(f,"%c", *ptr); - - fprintf(f,""); - if (end > q && !(strchr(refnode, '\n'))) - fprintf(f,"\n"); - } - else - fprintf(f,""); - - if (href) - g_free(href); - if (escaped_refnode) - g_free(escaped_refnode); - if (escaped_refname) - g_free(escaped_refname); - if (converted_nodename) - g_free(converted_nodename); - - g_free(escaped_seg); - g_free(refname); - g_free(reffile); - g_free(refnode); - - /* write out stuff at end */ - if (end < q) - { - -/* Escape up to the end of line. */ - curlen = q - (end+1); - tmp = (char *) g_malloc (curlen + 1); - memcpy (tmp, end+1, curlen); - *(tmp+curlen) = '\000'; - escaped_seg = escape_html_chars (tmp); - g_free (tmp); - - fprintf (f, "%s", escaped_seg); - fprintf (f, "\n"); - g_free (escaped_seg); - return NULL; - } - else - return end+1; - } - else - { - -/* Escape the whole thing. */ - escaped_seg = escape_html_chars (tmp); - fprintf (f, "%s", escaped_seg); - fprintf (f, "\n"); - /* not needed any more */ - g_free(tmp); - g_free (escaped_seg); - return NULL; - } -} - -void open_menu_html( FILE *f, char *p ) -{ - if (*p != '\000') - fprintf(f, "

    %s

    \n",p); - /* fprintf(f, "
      \n"); */ -#if 0 - fprintf(f, "
      \n"); -#else - if (inTable) - fprintf(stderr, "In a table and starting new one!\n"); - inTable = 1; - fprintf(f, "\n"); -#endif -} - -void close_menu_html( FILE *f ) -{ - /* fprintf(f, "\n"); */ -#if 0 - fprintf(f, "\n"); -#else - if (!inTable) - fprintf(stderr, "Not in a table and closing one!\n"); - inTable = 0; - fprintf(f, "
       
      \n"); -#endif -} - -/* writes menu entry contained in string p */ -/* nodename and nodefile apply to the node which menu entry is in */ -void write_menu_entry_html( FILE *f, char *p, char *nodefile, char **menu_end ) -{ - char *refname; - char *reffile; - char *refnode; - char *end; - char *realend; - char *converted_nodename; - char *escaped_refnode; - char *escaped_refname; - char *href; - - int i, done; - - /* skip over the '* ' at the start of the line */ - if (parse_menu_line( p+2, &refname, &reffile, &refnode, &end, 0 )) - { - html_error("Error parsing menu", p, memchr(p, '\n', 80)); - return; - } - - /* if both null, we had a '::' and have to set both */ - if (reffile == NULL && refnode == NULL) - { - reffile = g_strdup(nodefile); - refnode = g_strdup(refname); - } - /* otherwise we had (file)., and we set node to 'Top' */ - else if (refnode == NULL) - refnode = g_strdup("Top"); - else if (reffile == NULL) - reffile = g_strdup(nodefile); - - /* now find the end of the right hand text for this menu line */ - /* it can continue for several lines */ - done = 0; - for (realend = end+1; !done; realend++) - { - if (*realend == '\n') - { - if (*(realend+1) == '\n') - { - done = 1; - continue; - } - - for (i=1; i<4; i++) - if (!isspace((guchar)*(realend+i)) && *(realend+i) != '\n') - { - done = 1; - break; - } - } - } - *menu_end = realend; - - - converted_nodename = g_strdup( refnode ); - map_spaces_to_underscores( converted_nodename ); - - escaped_refnode = escape_html_chars( refnode ); - escaped_refname = escape_html_chars( refname ); - -#if 0 - fprintf(f,"
      %s\n", - reffile, converted_nodename, escaped_refname); -#endif - - href = form_info_tag_href( reffile, converted_nodename ); -#if 0 - fprintf(f,"
      %s\n", href, escaped_refname ); - fprintf(f,"
      "); - if (*end == '.' && *(end+1) == '\n') - fprintf(f,"%s.\n",escaped_refnode); - else - fwrite(end+1, 1, *menu_end - end - 1, f); -#else - fprintf(f,"\n\t\n\t\t%s\n\t\n" - "\t\n\t\t", - href, escaped_refname ); - if (*end == '.' && *(end+1) == '\n') - fprintf(f,"%s.\n",escaped_refnode); - else - fwrite(end+1, 1, *menu_end - end - 1, f); - fprintf(f,"\n\t\n\n"); -#endif - - if (href) - g_free(href); - if (escaped_refname) - g_free(escaped_refname); - if (escaped_refnode) - g_free(escaped_refnode); - if (converted_nodename) - g_free(converted_nodename); - g_free(refname); - g_free(reffile); - g_free(refnode); -} - -void write_html_horiz_rule( FILE *f ) -{ - fprintf(f, "
      \n"); -} diff --git a/components/help/converters/gnome-info2html2/html.h b/components/help/converters/gnome-info2html2/html.h deleted file mode 100644 index 0c73bad40..000000000 --- a/components/help/converters/gnome-info2html2/html.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef HTML_H -#define HTML_H - -#define HTML_ROOT "./htmltest" - -#define HEADER_SIZE_1 "H1" -#define HEADER_SIZE_2 "H2" - -extern char *BaseFilename; -extern char *OverrideBaseFilename; - -extern int galeon_mode; - -void dump_html_for_node( NODE *node ); - -void open_body_text_html( FILE *f ); -void close_body_text_html( FILE *f ); -char *write_body_text_html( FILE *f, char *p, char *q, char *nodefile ); - -void open_menu_html( FILE *f, char *p ); -void close_menu_html( FILE *f ); -void write_menu_entry_html( FILE *f, char *p, char *nodefile,char **menu_end ); - -void write_header_html( FILE *f, char *p, char *hdr ); - -void write_html_horiz_rule( FILE *f ); -#endif diff --git a/components/help/converters/gnome-info2html2/main.c b/components/help/converters/gnome-info2html2/main.c deleted file mode 100644 index 3e3d6e67d..000000000 --- a/components/help/converters/gnome-info2html2/main.c +++ /dev/null @@ -1,289 +0,0 @@ -/* little test main() to see how we're doing */ - -#include -#include -#include -#include -#include -#include -#ifdef HAVE_LIBBZ2 -#include -#endif -#include -#include -#include -#include - -#include "data.h" -#include "html.h" -#include "parse.h" -#include "utils.h" -#include "version.h" - -/* be quiet or not? */ -static int be_quiet=1; - -/* line_number we're on */ -static int work_line_number; -static char *requested_nodename=NULL; -static struct poptOption options[] = { - {NULL, 'a', POPT_ARG_STRING, &requested_nodename}, - {NULL, 'b', POPT_ARG_STRING, &OverrideBaseFilename}, - {NULL, 'g', POPT_ARG_NONE, &galeon_mode}, - {NULL} -}; - -static int -file_exists(const char *fn) -{ - struct stat sbuf; - - return (stat(fn, &sbuf) == 0); -} - -int -main(int argc, char **argv) -{ - gzFile f = NULL; - int bz = 0; -#ifdef HAVE_LIBBZ2 - BZFILE *bf=NULL; -#endif - char line[250]; - poptContext ctx; - int result; - int foundit=0; - int i, n; - - char convanc[1024]; - NODE *node; - - const char **args; - char *fixup_args[512]; - int curarg; - - if (!be_quiet) - printf("info2html Version %s\n",INFO2HTML_VERSION); - - ctx = poptGetContext("gnome-info2html2", argc, argv, options, 0); - - while(poptGetNextOpt(ctx) >= 0) - /**/ ; - - args = poptGetArgs(ctx); - curarg = 0; - if(!args) - return 1; - - for(n = 0; args[n]; n++) /* */; - if(n == 1 && !file_exists(args[0])) - { - /* As strtok destroys the string it parses and g_getenv returns a pointer to - the actually env var, we have to duplicate the var before parsing it. */ - char *ctmp, *infopath = g_strdup(g_getenv("INFOPATH")); - char *dirs[64], *ext = NULL; - int ndirs; - char buf[PATH_MAX]; - - /* First, find the directory that the info file is in. */ - dirs[0] = "/usr/info"; - dirs[1] = "/usr/share/info"; - /* We now have at least one directory to look in. This is - * necessary because we may not have an 'INFOPATH' set */ - ndirs = 2; - if(infopath) - for(ndirs = 2, ctmp = strtok(infopath, ":"); ndirs < 64 && ctmp; ndirs++, ctmp = strtok(NULL, ":")) - dirs[ndirs] = strdup(ctmp); - - for(i = 0; i < ndirs; i++) - { - ext = ""; - sprintf(buf, "%s/%s.info", dirs[i], args[0]); - if(file_exists(buf)) - break; - ext = ".gz"; - sprintf(buf, "%s/%s.info.gz", dirs[i], args[0]); - if(file_exists(buf)) - break; -#ifdef HAVE_LIBBZ2 - ext = ".bz2"; - sprintf(buf, "%s/%s.info.bz2", dirs[i], args[0]); - if(file_exists(buf)) { - bz = 1; - break; - } -#endif - } - if(i >= ndirs) { - printf ("Document not found\n" - "The info document \"%s\" could not be found. It may have been removed from your system.\n" - "\n", args[0]); - return 2; - } - - n = i; - - for(i = 0; ; i++) - { - if(i) - sprintf(buf, "%s/%s.info-%d%s", dirs[n], args[0], i, ext); - else - sprintf(buf, "%s/%s.info%s", dirs[n], args[0], ext); - - if(!file_exists(buf)) - { - fixup_args[i] = NULL; - break; - } - - fixup_args[i] = strdup(buf); - } - args = (const char **)fixup_args; - } - - if(requested_nodename) - { - char *s, *t; - int len; - /* strip off quotes */ - for (s=requested_nodename; *s == '\"'; ) { - len = strlen( s ); - memmove(s, s+1, len); - } - - t = s + strlen(s) - 1; - while (*t == '\"') - t--; - - *(t+1) = '\0'; - - /* convert anchor so matching works */ - map_spaces_to_underscores(requested_nodename); - } - - work_line_number = 0; - - /* hack, just send to stdout for now */ - fprintf(stdout, "\n"); - - /* big loop to identify sections of info files */ - /* NEW PLAN - format on the fly */ - /* No need to store all nodes, etc since we let web server */ - /* handle resolving tags! */ - for (;1 || !foundit || !requested_nodename;) { - if(bz) - { -#ifdef HAVE_LIBBZ2 - if(!bf) - { - if(args && args[curarg]) - { - bf = bzopen(args[curarg++], "r"); - if(!f) - break; - num_files_left = args[curarg]?1:0; - for(work_line_number = 0, bzread(bf, line, sizeof(line)); *line != INFO_COOKIE; - bzread(bf, line, sizeof(line)), work_line_number++) - /**/ ; - } - else - break; - } - if(!bzread(bf, line, sizeof(line))) - { - bzclose(bf); - bf = NULL; - continue; - } -#else - g_assert_not_reached(); -#endif - } - else - { - if(!f) - { - if(args && args[curarg]) - { - f = gzopen(args[curarg++], "r"); - if(!f) - break; - num_files_left = args[curarg]?1:0; - for(work_line_number = 0, gzgets(f, line, sizeof(line)); *line != INFO_COOKIE; - gzgets(f, line, sizeof(line)), work_line_number++) - /**/ ; - } - else - break; - } - if(!gzgets(f, line, sizeof(line))) - { - gzclose(f); - f = NULL; - continue; - } - } - - work_line_number++; - - /* found a node definition line */ - if (!strncmp(line, "File:", 5)) { - node = alloc_node(); - result=read_node( f, line, node ); - if ( result == READ_ERR ) { - fprintf(stderr, "Error reading the node " - "contents\n"); - fprintf(stderr, "line was |%s|\n",line); - continue; - } - - /* see if this is the requested node name */ - strncpy(convanc, node->nodename, sizeof(convanc)); - map_spaces_to_underscores(convanc); - if (requested_nodename && - strcmp(requested_nodename, convanc)) { -#ifdef DEBUG - fprintf(stderr, "skipping ->%s<-\n", - node->nodename); -#endif - - continue; - } - - foundit = 1; - strcpy(work_node,node->nodename); - - BaseFilename = node->filename; -#ifdef DEBUG - printf("NEW NODE\n"); - printf("\tFile:|%s|\n\tNode:|%s|\n\tNext:|%s|\n", - node->filename, node->nodename,node->next); - printf("\tPrev:|%s|\n\tUp:|%s|\n\n", - node->prev, node->up); - printf("-------------------------------------------" - "-----------\n"); -#endif - /* now lets make some html */ - dump_html_for_node( node ); - - if (node) { - if ( node->contents ) - free(node->contents); - - g_free(node); - BaseFilename = NULL; - } - } - else - continue; - } - - if (!foundit && requested_nodename) { - fprintf(stderr, "Requested node %s not found\n", - requested_nodename); - exit(1); - } - - fprintf(stdout, "\n"); - return 0; -} diff --git a/components/help/converters/gnome-info2html2/parse.c b/components/help/converters/gnome-info2html2/parse.c deleted file mode 100644 index 0177368b0..000000000 --- a/components/help/converters/gnome-info2html2/parse.c +++ /dev/null @@ -1,523 +0,0 @@ -/* simple info file parser. */ -/* currently only finds nodes and contructs a tree */ -/* partially motivated by source code of the 'info' program */ - -#include -#include -#include -#include -#include - -#include "parse.h" -#include "data.h" -#include "utils.h" - -int num_files_left; - -/* main routine to read in a node once we found its start in file f */ -/* assumes NODE has already been allocated */ -int read_node (gzFile f, char *line, NODE *node) -{ - /* we found a node line */ - if (!parse_node_line( node, line )) - return (READ_ERR); - - /* read in the contents, they go until a '\014', or a EOF */ - return (read_node_contents( f, node )); -} - -/* take a node definition and parse components */ -/* assumes that NODE has already been allocated */ -/* returns pointer to node if ok, or NULL on failure */ -NODE *parse_node_line( NODE *node, char * line ) -{ - char *result; - char *temp; - - /* fill in rest soon */ - node->filename = NULL; - node->nodename = NULL; - node->contents = NULL; - node->next = NULL; - node->prev = NULL; - node->up = NULL; - - temp = line; - - /* have trouble on (dir) file which has a slightly diferrent 'File:' line */ - /* so currently we have a hack here */ - if (!(result=parse_node_label( &temp, "File:", 0))) - return NULL; - node->filename = result; - - /* don't allow_eof if we are looking at the 'dir' file, its a special case */ - if (!(result=parse_node_label(&temp,"Node:",strcmp(node->filename, "dir")))) - return NULL; - node->nodename = result; - - /* not clear any of the rest are actually necessary */ - /* keep eye out for hitting end of line */ - if ((result=parse_node_label( &temp, "Next:", 1))) - node->next = result; - - if ((result=parse_node_label( &temp, "Prev:", 1))) - node->prev = result; - - if ((result=parse_node_label( &temp, "Up:", 1))) - node->up = result; - - /* cleanup node filename */ - fixup_info_filename( node->filename ); - - return node; -} - -/* grab node name from the label 'label' */ -/* NULL means it doesn't exist */ -/* strdup's a string and returns it, which can be freed */ -char *parse_node_label( char **line, char *label, int allow_eof ) -{ - char *start, *end; - char *temp; - - temp = strdup( *line ); - - start = strstr( temp, label ); - if (start == NULL) - return NULL; - - start += strlen(label); - if (allow_eof) - { - end = strstr( start, "," ); - if (end == NULL) - end = strstr( start, "\n" ); - } - else { - end = strstr( start, "," ); - if (!end) - end = strstr( start, "\t" ); /* might help (dir) files */ - } - - if (end == NULL) - return NULL; - - *end = '\000'; - strip_spaces( start ); - return start; -} - - -/* from current position in file f, read till we hit EOF or */ -/* a end of node marker. Allocate space and set ptr to point at it */ -/* contents of node->contents is a mirror image of what was in */ -/* the node (menus and all */ -/* assumes that NODE is already allocated */ -#define SEARCH_BUF_SIZE 1024 -#define CONTENTS_BUF_INCR 1024 - -int read_node_contents( gzFile f, NODE *node ) -{ - int nread; - int found; - char *searchbuf; - char *ptr; - - char *tmpcontents; - int tmpcontlen; - int linelen; - - char *status; - - searchbuf = (char *) malloc( SEARCH_BUF_SIZE ); - tmpcontents = (char *) malloc( CONTENTS_BUF_INCR ); - tmpcontlen = CONTENTS_BUF_INCR; - nread = 0; - - /* we read until we hit a '\014' or the end of file */ - /* since its coming form a pipe we read up to EOL */ - /* and save contents as we go along */ - for ( found=0 ; !found ; ) - { - status=gzgets(f, searchbuf, SEARCH_BUF_SIZE); - linelen = strlen( searchbuf ); - for (found=0, ptr = searchbuf; *ptr && !found; ptr++) - if (*ptr == INFO_FF || *ptr == INFO_COOKIE) - found=1; - - /* if we didn't find the magic character, but hit eof, same deal */ - if (!found && gzeof(f)) - { - found = 1; - continue; - } - - if ((nread+linelen+2) > tmpcontlen) - { - tmpcontlen += CONTENTS_BUF_INCR; - tmpcontents = realloc( tmpcontents, tmpcontlen ); - } - - memcpy(tmpcontents+nread, searchbuf, linelen); - nread += linelen; - if (!gzeof(f) || num_files_left) - *(tmpcontents+nread) = '\14'; - } - -/*tmpcontents=realloc(tmpcontents, nread); */ - node->contlen = nread; - node->contents = tmpcontents; - if (searchbuf) - free(searchbuf); - else - fprintf(stderr, "For some reason searchbuf is NULL\n"); - - return READ_OK; -} - -/* given pointer to a string, tells us if its the line following */ -/* a info header line */ -/* ex. */ -/* This is a header */ -/* ================ */ -/* r points at the row of '='*/ -int is_a_hdr_line ( char *r ) -{ - return (!strncmp(r, "***", 3) || - !strncmp(r, "===", 3) || - !strncmp(r, "---", 3) || - !strncmp(r, "...", 3)); -} - - -/* returns 0 if good line found, non-0 otherwise */ -int parse_menu_line( char *line, char **refname, char **reffile, - char **refnode, char **end_of_link, - int span_lines) -{ - char *match; - char *match2; - char *start; - char *end_of_line; - char *end_refnode; - - - start = line; - end_of_line = strchr( line, '\n' ); - *end_of_link = NULL; - - /* ok, we found a menu line, have to convert to a reference */ - /* four types we worry about */ - /* only care about stuff up to '.' OR second ':' */ - /* 1) 'Link:: This is a link' */ - /* 2) 'Link: (file). This is another link' */ - /* 3) 'Link: (file)node. This is yet another' */ - /* 4) 'Link: node.' */ - - /* found a variation on #4 in amdref.info-2 ! */ - /* 5) 'Link: node: */ - - /* find the refname */ - if (!(match=copy_to_anychar( start, ":", refname ))) - return -1; - strip_spaces( *refname ); - strip_dupspaces( *refname ); - match++; - - /* simple case is case #1 above */ - if (*match == ':') - { - *reffile = NULL; - *refnode = NULL; - *end_of_link = match; - return 0; - } - else - { - /* look for parentheses */ - match2 = strchr( match, '(' ); - - /* this means it must be form 4 */ - /* but dont look too far away */ - /* this is a real hack - should do something more intelligent that 10 chars */ - if (!match2 || (match2 - match) > 10) - { - /* look for a ':' or '.' ending node */ -#if 0 - if (!(end_refnode=copy_to_anychar( match, ".", refnode ))) - if (!(end_refnode=copy_to_anychar( match, ":", refnode ))) - return -1; - /* but it cant be past end of the menu line */ - if (end_refnode > end_of_line && !span_lines) - return -1; -#endif - /* span_lines is ignored now we have parse_note_ref() */ - if (!(end_refnode=copy_to_anychar( match, "\n,.", refnode ))) - return -1; - *end_of_link = end_refnode; - strip_spaces( *refnode ); - strip_dupspaces( *refnode ); - if ( *refnode == '\000') - { - free(refnode); - refnode = NULL; - } - *reffile = NULL; - return 0; - } - else - { - match2++; - if (!(match=copy_to_anychar (match2, ")", reffile))) - return -1; - strip_spaces( *reffile ); - fixup_info_filename( *reffile ); - match++; - /* unsure about having '\n' here */ - if (!(match=copy_to_anychar (match, "\n.,", refnode))) - return -1; - *end_of_link = match; - strip_spaces( *refnode ); - strip_dupspaces( *refnode ); - strip_dupspaces( *refname ); - if (!(**refnode)) - *refnode = NULL; - - return 0; - } - } -} - -/* used for *note and *Note refs */ -/* returns 0 if good line found, non-0 otherwise */ -int parse_note_ref( char *line, char **refname, char **reffile, - char **refnode, char **end_of_link, - int span_lines) -{ - char *match; - char *match2; - char *start; - char *end_of_line; - char *end_refnode; - - - start = line; - end_of_line = strchr( line, '\n' ); - *end_of_link = NULL; - - /* ok, we found a menu line, have to convert to a reference */ - /* four types we worry about */ - /* only care about stuff up to '.' OR second ':' */ - /* 1) 'Link:: This is a link' */ - /* 2) 'Link: (file). This is another link' */ - /* 3) 'Link: (file)node. This is yet another' */ - /* 4) 'Link: node.' */ - - /* found a variation on #4 in amdref.info-2 ! */ - /* 5) 'Link: node: */ - - /* find the refname */ - if (!(match=copy_to_anychar( start, ":", refname ))) - return -1; - strip_spaces( *refname ); - strip_dupspaces( *refname ); - match++; - - /* simple case is case #1 above */ - if (*match == ':') - { - *reffile = NULL; - *refnode = NULL; - *end_of_link = match; - return 0; - } - else - { - /* look for parentheses */ - match2 = strchr( match, '(' ); - - /* this means it must be form 4 */ - /* but dont look too far away */ - /* this is a real hack - should do something more intelligent that 10 chars */ - if (!match2 || (match2 - match) > 10) - { - /* look for a ',', ':' or '.' ending node */ -#if 0 - if (!(end_refnode=copy_to_anychar( match, ",", refnode ))) - if (!(end_refnode=copy_to_anychar( match, ".", refnode ))) - if (!(end_refnode=copy_to_anychar( match, ":", refnode ))) -#endif - if (!(end_refnode=copy_to_anychar( match, ",.:", refnode ))) - return -1; - - /* but it cant be past end of the menu line */ - if (end_refnode > end_of_line && !span_lines) - return -1; - - *end_of_link = end_refnode; - strip_spaces( *refnode ); - strip_dupspaces( *refnode ); - *reffile = NULL; - return 0; - } - else - { - match2++; - if (!(match=copy_to_anychar (match2, ")", reffile))) - return -1; - strip_spaces( *reffile ); - fixup_info_filename( *reffile ); - match++; - if (!(match=copy_to_anychar (match, ".,", refnode))) - return -1; - *end_of_link = match; - strip_spaces( *refnode ); - strip_dupspaces( *refnode ); - strip_dupspaces( *refname ); - if (!(**refnode)) - *refnode = NULL; - - return 0; - } - } -} - - -/* old version 1.0 stuff */ -#if 0 - - - -void scan_for_menu( NODE *node ) -{ - char *ptr; - char *match; - char *line; - char *buf; - char *refname, *reffile, *refnode; - char *junk; - - MENU_ENTRY *head; - - int size; - int found; - - NODE *newnode; - REFERENCE *newref; - MENU_ENTRY *newentry; - char menu_hdr[8192]; - char *menu_hdr_ptr; - - /* search for start of a menu */ - size = node->contlen; - found = 0; - for (ptr = node->contents ; ptr < (node->contents+node->contlen) && !found;) - { - line = get_line_from_contents( ptr, size ); - match = strstr(line, MENU_START); - if (match) - { - node->menu_start=ptr; - found = 1; - } - size = size - strlen(line) - 1; - ptr += strlen(line) + 1; - free(line); - } - - if (!found) - return; - - /* we found a menu start, lets read menu in now */ - /* keep looking for entries till we hit a end-of-node condition */ - head = NULL; - menu_hdr_ptr = menu_hdr; - for ( ; ptr < (node->contents+node->contlen); ) - { - buf = get_line_from_contents( ptr, size ); - line = buf; - size = size - strlen(line) - 1; - ptr += strlen(line) + 1; - - if (*line == '\000') - { - free(buf); - continue; - } - - if (*line == INFO_FF || *line == INFO_COOKIE) - { - free(buf); - break; - } - - /* see if its a new menu entry or not */ - if (*line != '*') - { -#if 0 - free(buf); - break; -#endif - if ( (*line != '=') && (*line != '#') ) - { - memcpy(menu_hdr_ptr, line, strlen(line)); - menu_hdr_ptr += strlen(line); - *menu_hdr_ptr = '\n'; - menu_hdr_ptr++; - *menu_hdr_ptr = '\0'; - } - free(buf); - continue; - } - else - { - line += 2; - - if (parse_menu_line( line, &refname, &reffile, &refnode, &junk, 0 )) - { - free(buf); - continue; - } - - /* found the end of nodename, so make a new reference */ - newref = (REFERENCE *) malloc( sizeof(REFERENCE) ); - newref->refname = refname; - - newentry = (MENU_ENTRY *) malloc( sizeof(MENU_ENTRY) ); - newentry->ref = newref; - if (menu_hdr_ptr != menu_hdr) - { - newentry->header = strdup(menu_hdr); - menu_hdr_ptr = menu_hdr; - } - else - newentry->header = NULL; - newentry->next = NULL; - - newnode = (NODE *) malloc( sizeof(NODE) ); - newref->node = newnode; - newnode->next = newnode->prev = newnode->up = NULL; - if (refnode) - newnode->nodename = refnode; - else - newnode->nodename = strdup(refname); - - if (reffile) - newnode->filename = reffile; - else - newnode->filename = strdup(node->filename); - - - if (head == NULL) - node->menu = newentry; - else - head->next = newentry; - head = newentry; - } - free(buf); - } -} - - - -#endif diff --git a/components/help/converters/gnome-info2html2/parse.h b/components/help/converters/gnome-info2html2/parse.h deleted file mode 100644 index 9f539a3cd..000000000 --- a/components/help/converters/gnome-info2html2/parse.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef PARSE_H -#define PARSE_H - -#include -#include "data.h" - -#define READ_OK 1 -#define READ_EOF 2 -#define READ_ERR 0 - -NODE *parse_node_line( NODE *node, char * line ); -char *parse_node_label( char **line, char *label, int allow_eof ); -int parse_menu_line( char *line, char **refname, char **reffile, - char **refnode, char **end_of_link, - int span_lines); - -int parse_note_ref( char *line, char **refname, char **reffile, - char **refnode, char **end_of_link, - int span_lines); - -int read_node_contents( gzFile f, NODE *node ); -int read_node (gzFile f, char *line, NODE *node); - -int is_a_hdr_line (char *r); -extern int num_files_left; - -#endif /* PARSE_H */ diff --git a/components/help/converters/gnome-info2html2/utils.c b/components/help/converters/gnome-info2html2/utils.c deleted file mode 100644 index 5ab276a57..000000000 --- a/components/help/converters/gnome-info2html2/utils.c +++ /dev/null @@ -1,275 +0,0 @@ -/* various utility functions */ - -#include -#include -#include -#include -#include - -#include - -#include "data.h" -#include "utils.h" - -void strip_spaces( char *str ) -{ - int len; - - len = strlen( str ); - if (len < 1) - return; - - while (*str == ' ') - { - len = strlen( str ); - memmove(str, str+1, len); - } - - len = strlen( str ); - while (*(str+len) == '\n') - { - *(str+len) = '\000'; - len = strlen( str ); - } - -#if 0 - q = str + strlen( str ); - for (p=str; *p == ' ' || *p == '\t'; p++); - for (r=q-1; *r == ' ' || *r == '\t'; r--); - len = r - p + 1; - memmove( str, p, len ); - *(str+len)='\000'; -#endif -} - -void strip_newlines( char *str ) -{ - char *p; - int len; - - len = strlen( str ); - if (len < 2) - return; - - for (p=str; len > 0; len--) - if ( *p == '\n' ) - { - if (len > 1) - memmove(p , p+1, len ); - else - *p = '\000'; - } - else - p++; -} - -void strip_dupspaces( char *str ) -{ - char *p; - int len; - - len = strlen( str ) - 1; - if (len < 2) - return; - - for (p=str+1; len > 0; len--) - if ( *p == ' ' && *(p-1) == ' ') - { - if (len > 1) - memmove(p , p+1, len ); - else - *p = '\000'; - } - else - p++; -} - -void convert_newlines_to_spaces( char *str ) -{ - char *p; - int len; - - /* trim head and trailing newlines */ - while (*str == '\n') - { - len = strlen( str ); - memmove(str, str+1, len); - } - - len = strlen( str ); - while (*(str+len) == '\n') - { - *(str+len) = '\000'; - len = strlen( str ); - } - - len = strlen( str ); - for (p=str; len > 0; len--, p++) - if ( *p == '\n' ) - *p = ' '; -} - -char * escape_html_chars( char *str ) -{ - char *p; - char *q; - char tmp[2]; - int len; - - if (!str) - return NULL; - - len = strlen( str ); -#if 0 - if (len <2) - fprintf(stderr,"escaped less < 2 chars= |%s|\n",str); - -#endif - - q = (char *) g_malloc( len * 5 + 4); - *q = '\000'; - *(tmp+1) = '\000'; - for (p=str; *p; p++) - if ( *p == '>' ) - strcat(q, ">"); - else if ( *p == '<' ) - strcat(q, "<"); - else if ( *p == '&' ) - strcat(q, "&"); - else - { - *tmp = *p; - strcat(q, tmp); - } - return q; -} - - -char *get_line_from_contents( char *ptr, int size ) -{ - char *eoln; - char *line; - int linelen; - - eoln = memchr(ptr, '\n', size); - if (eoln == NULL) - return NULL; - - linelen = (eoln-ptr); - line = (char *) g_malloc( linelen+1 ); - memcpy(line, ptr, linelen); - *(line+linelen) = '\000'; - return line; -} - -/* copies from string str up to any character in chr */ -/* if chr doesn't exist, return NULL */ -/* otherwise return location of match */ -/* allocates a new string if anything copied */ -char *copy_to_anychar( char *str, char *chr, char **copy ) -{ - int len; - char *match; - - match = strpbrk(str, chr); - if (!match) - return NULL; - - len = match - str; - *copy = (char *) g_malloc( len+1 ); - *(*copy+len) = '\000'; - memcpy(*copy, str, len ); - return match; -} - -/* allocates a new node */ -NODE *alloc_node() -{ - NODE * tmp; - - tmp = (NODE *) g_malloc( sizeof(NODE) ); - - if (tmp) - { - tmp->nodename=NULL; - tmp->filename=NULL; - tmp->contents=NULL; - tmp->contlen=0; - tmp->next=NULL; - tmp->prev=NULL; - tmp->up=NULL; - tmp->filename=NULL; - tmp->menu=NULL; - tmp->menu_start=NULL; - } - return tmp; -} - -/* deallocates a new node */ -void free_node(NODE *tmp) -{ - if (tmp) - { - if (tmp->nodename) - g_free(tmp->nodename); - if (tmp->filename) - g_free(tmp->filename); - if (tmp->contents) - g_free(tmp->contents); - } - g_free(tmp); -} - -#if 0 -void map_spaces_to_underscores( char *str ) -{ - char *p; - - for (p=str; *p; p++) - if (*p == ' ') - *p = '_'; -} -#endif - -void map_spaces_to_underscores( char *str ) -{ - char *p; - - for (p=str; *p; p++) - switch (*p) - { - case ' ': - case '\n': - case '\t': - case '`': - case '\'': - case '/': - case '\\': - case '"': - case '.': - case '!': - *p = '_'; - break; - } -} - - - -/* reduce infofile filename to basename alone */ -void fixup_info_filename( char *file ) -{ - char *ptr1; - char tail[] = ".info"; - - if (strlen(file) < 6) - return; - - ptr1 = strrchr( file, '.' ); - if (!ptr1) - return; - - if (!strncmp(ptr1, tail, strlen(tail))) - *ptr1 = '\000'; - -} - diff --git a/components/help/converters/gnome-info2html2/utils.h b/components/help/converters/gnome-info2html2/utils.h deleted file mode 100644 index 25a964c8a..000000000 --- a/components/help/converters/gnome-info2html2/utils.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef UTILS_H -#define UTILS_H - -#include "data.h" - -void strip_spaces( char *str ); -void strip_newlines( char *str ); -void strip_dupspaces( char *str ); -void convert_newlines_to_spaces( char *str ); -char *get_line_from_contents( char *ptr, int size ); -char *copy_to_anychar( char *str, char *chr, char **copy ); -NODE *alloc_node( void ); -void free_node( NODE * ); -void map_spaces_to_underscores( char *str ); -void fixup_info_filename( char *file ); -char *escape_html_chars( char *str ); -#endif diff --git a/components/help/converters/gnome-info2html2/version.h b/components/help/converters/gnome-info2html2/version.h deleted file mode 100644 index f1155c368..000000000 --- a/components/help/converters/gnome-info2html2/version.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef VERSION_H -#define VERSION_H - -#define INFO2HTML_VERSION "2.1" - -#endif diff --git a/components/help/converters/gnome-man2html2/.cvsignore b/components/help/converters/gnome-man2html2/.cvsignore deleted file mode 100644 index ef74d4616..000000000 --- a/components/help/converters/gnome-man2html2/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -Makefile.in -.deps -.libs -gnome-man2html2 \ No newline at end of file diff --git a/components/help/converters/gnome-man2html2/Makefile.am b/components/help/converters/gnome-man2html2/Makefile.am deleted file mode 100644 index 0c52cc92f..000000000 --- a/components/help/converters/gnome-man2html2/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -## Process this file with automake to produce Makefile.in. - -LDADD = $(Z_LIBS) $(BZ_LIBS) - -bin_PROGRAMS = gnome-man2html2 - -gnome_man2html2_SOURCES = gnome-man2html.c - -#CFLAGS += -Wall - diff --git a/components/help/converters/gnome-man2html2/README b/components/help/converters/gnome-man2html2/README deleted file mode 100644 index e3b79ac5a..000000000 --- a/components/help/converters/gnome-man2html2/README +++ /dev/null @@ -1,284 +0,0 @@ -gnome-man2html2 --------------- - -Modified version of gnome-man2html2 by Elliot Lee -- slight changes made to the man: URL's output, but otherwise it works -perfectly. - -Modified version of VH-Man2html by Michael Fulbright - -Please do not contact the individuals below if you have problems with -gnome-man2html2, instead send me an email and I'll try to help. - -The README for the original program lies below... - - -VH-Man2html - Modified Verhoeven-man2html ------------------------------------------ -Michael Hamilton -http://www.actrix.gen.nz/users/michael - -vh = Richard Verhoeven's (rcb5@win.tue.nl) Man2html as modified and -packaged by Michael Hamilton. - -Featues: - - Translate man pages to html from tbl/troff source. - - Look up a page by name and section or via full path name. - - Links generated html to other pages, include files, email addresses, - and http refs. - - Name-title index built from man whatis info. - - Name only index built from inspecting the man directories. - - Full text search via glimpse (glimpse obtainable separately). - - Works from man and BSD mandoc source files. - - Fast troff to HTML translator written in C. - - Copes with compressed (gzip etc) source. - -New in version 1.5: - - fix to mansec for compressed pages. - - make now configures ALL scripts, html files, and man pages. - - includes section 9. - -New in version 1.4: - - Uses /etc/man.config to obtain the man path. - - Man2html.c now uses decompression filters specified in /etc/man.config. - - Glimpse now uses decompression filters (see glimpse_filters file). - (Generating indexes will be be slower for compressed hierarchies.) - - Safer - more secure from memory overuns. Man2html now checks for - excessively long input parameters. - - All configuration can now be done by editing the Makefile and the - glimpse_filters file. - - By default (in version 1.4 and above) -M only allows the user to select - what part of the hierarchy to search first - they cannot specify a path - outside of the official hierarchy. Previously the -M option could be - used to retrieve any man/mandoc source file that had "man" in it's - path-name/file-name (a compile time switch can restore the previous - behaviour). - - Fixed more bugs. - -QUICK START INSTRUCTIONS ------------------------- - -To use these cgi scripts all you have to do is install the rpm and -then point your web browser at - - http://localhost/cgi-bin/man2html - -You can either save this location as a bookmark or use an editor to -insert the following lines into an appropriate place in -/usr/doc/HTML/calderadoc/caldera.html (or somewhere like -/home/httpd/index.html if you are using RedHat's http server) - -

      - Linux Manual Pages

      - -For some of the indexes to work you must generate the necessary -databases... - -Vh-man2html's manwhatis CGI-script uses the /usr/man/whatis file to build -a man page index. Caldera 1.0 normally builds the /usr/man/whatis every -morning at 3:21am. If this job has never been run (perhaps because -you turn your machine off at night), you can build it by becoming the -root user and entering: - - /usr/sbin/makewhatis /usr/man /usr/X11R6/man /usr/local/man - -WARNING: makewhatis in Caldera 1.0 takes about 30 minutes on my -486DX66. I have a modified version of makewhatis so that it does -exactly the same job in only 1.5 minutes. My modified version is now -available as part of man-1.4g (man-1.4g.tar.gz) and above: - - ftp://sunsite.unc.edu/pub/Linux/system/Manual-pagers - -To use the Glimpse full text searching, you will need to install -glimpse in /usr/bin. Redhat rpm users can get glimpse from - - ftp://ftp.redhat.com/pub/non-free/glimpse-3.0-1.i386.rpm - -The glimpse home ftp site is cs.arizona.edu. N.B. glimpse is not -freely redistributable for commercial use, I'd be very interested in a -more liberal alternative. Having installed glimpse, you will need to -build a glimpse index in /var/man2html. This doesn't take too long - -about 3 minutes on my 486DX2/66 16MB machine. As root do: - - /usr/bin/glimpseindex -z -H /var/man2html /usr/man/man* /usr/X11R6/man/man* \ - /usr/local/man/man* /opt/man/man* - chmod ugo+r /var/man2html/.glimpse* - -The -z option causes glimpse to apply any filters (for decompression etc) -specified in /var/man2html/.glimpse_filters. - -This could be set up as a cron job in /etc/crontab, e.g. (the following -must be all on one line): - - 21 04 * * 1 root /usr/bin/glimpseindex -z -H /var/man2html /usr/man/man* - /usr/X11R6/man/man* /usr/local/man/man* /opt/man/man* ; - chmod +r /var/man2html/.glimpse* - -If you don't want to use glimpse you can edit the man.html file that -the package installs in /home/http/html/man.html, and remove the -references to full text searches and glimpse. This file can also be -edited to include any local instructions you might wish to include. - -The scripts may generate errors to the httpd error log -/var/log/httpd/error_log. The man binary (used to obtain the man-path -by some of the scripts) seems to always think it's talking to a tty, -and tries to obtain the screen size, resulting in the following error -log entries: - - TIOCGWINSZ - failed : Bad file number - -To serve man pages to remote hosts, all that is required is a httpd -daemon that sets the environment variable SERVER_NAME correctly. - -END OF QUICK START INSTRUCTIONS -------------------------------- - -Vh-man2html was was written by Richard Verhoeven (NL:5482ZX35) at -the Eindhoven University of Technology (Email: rcb5@win.tue.nl). The -original source is available from his web page at: - - http://wsinwp01.win.tue.nl:1234/maninfo.html - -There are other man2html programs around - Richard's page has links to -several of them. Richard's man2html has some useful features for -Caldera/RedHat Linux - - - Works from the troff/nroff source pages. - With linux we almost always have the man source. - Doesn't have to run man+tbl+eqn+nroff to generate output. - Because man isn't run, no catman pages are generated. - Accurate - doesn't have to guess from the man output. - Does tables (eg man ascii) (but doesn't do eqn - few pages use eqn). - Written in C - efficient speed/memory usage. - Fast enough not to need a cache. - Intelligent - Makes good guesses on where to find pages. - Creates links for man pages and include files. - -Richard's original program copes with pages formatted with the man -macros. I've enhanced it by adding translations for the mandoc macros -used in the BSD man pages. BSD mandoc pages in Caldera/Redhat -include Mail, ftp, telnet, rlogin, and lpr and other printer man -pages - so they're pretty important. - -I don't have any documentation on the mandoc macros, so I've had to -guess what they intend, by looking at man source, man output and the -gnroff macro definitions. I've tested it on all the BSD mandoc pages -in Section 1 that I could find. It works reasonable well. There are -still minor formatting glitches to do with punctuation placement. -I checked the BSD mandoc with weblint, e.g. in tcsh/csh - - foreach i ( `egrep -l '^\.Bl' /usr/man/man1/* /usr/man/man8/*` ) - /home/httpd/cgi-bin/man2html $i > tmp/`basename $i` - end - weblint tmp/* - -For broader testing: - - find /usr/man/man* -name '*.[0-9]' \ - -printf "echo %p; /home/httpd/cgi-bin/man2html %p |weblint -x netscape -\n" \ - | sh \ - |& tee weblint.log - -If you want to sample the spectrum of mandoc translation, look at -any of the pages the above grep locates, telnet, lpc, and mail -are good examples. - -For full details of my modifications to man2html.c see the patch -included in the source archive. - -Here's a summary of the rpm's components: - - 1) man.html - Main page or access to man2html and man indexes. - 2) man2html - CGI binary that converts man pages to html. - 3) manwhatis - CGI script for a name and synopsis index organised - by manual section - 4) mansec - CGI script for a name only index for each section. - 5) mansearch - Glimpse full text searching. - 6) mansearch.html - Main page or access to man2html and man indexes. - 7) netscape-man - Front end that starts, or talks to, a running netscape. - 8) /var/ma2html - Cache directory for indexes and glimpse indexes. - -All my scripts are written in awk. In detail... - -The manwhatis script creates section contents html files by looking -for whatis files along the man path. Each whatis entry is translated -to a man2html link. Manwhatis caches it's output in -/var/man2html/whatis-[0-9].html. The cache will be regenerated if any -whatis file in the man path is updated (eg touch /usr/man/whatis). - -The mansec script lists the names of all manual pages for a given -section by using find on the man path. It caches its output in -/var/man2html/manindex-[0-9].html. The cache will be regenerated if -any associated man[0-9] directory in the man path is updated. - -The mansearch script uses glimpse to get back a list of files and -matches which it links back to the actual man pages. The mansearch -script is not pure awk. It's starts out as a shell script to ensure -that the parameters are safely passed to awk. I think it's secure, -but I'm not a cgi script expert. - -To build and install man2html, the scripts, and man.html from the -source archive - edit the Makefile and then: - - make install - -To build binary and source rpms, placing them under /usr/src/... - - make rpm - -SECURITY --------- - -I've modified the man2html C code so that it checks all client input -parameters for length and characters that need escaping. - -Man2html will only return man or mandoc files resident in the man -hierarchy defined in /etc/man.config. - -When man2html generates references to include files they are in the -form file: on the CLIENT host, not the server. - -The parameters to the decompression programs are checked for any -nasties. - -It is still possible for the contents of a man page to over-run -man2html's memory - so I guess a hacker might try to get you to -install a bogus man page in order to get man2html to do something -nasty. - -The scripts check their parameters for anything suspicious. - -The scripts and program write suspicious requests to stderr - so they -can be found in web server log files. - -CREDITS -------- - -See the man page man2html.8 for credits. - ---------------- - -My modifications, packaging and scripts are copyright (c) 1996 -Michael Hamilton (michael@actrix.gen.nz). All rights reserved. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in all -copies of this software. - -IN NO EVENT SHALL MICHAEL HAMILTON BE LIABLE TO ANY PARTY FOR DIRECT, -INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF -THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF MICHAEL -HAMILTON HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -MICHAEL HAMILTON SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND MICHAEL HAMILTON HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - - -Michael diff --git a/components/help/converters/gnome-man2html2/gnome-man2html.c b/components/help/converters/gnome-man2html2/gnome-man2html.c deleted file mode 100644 index 3cd34a088..000000000 --- a/components/help/converters/gnome-man2html2/gnome-man2html.c +++ /dev/null @@ -1,3846 +0,0 @@ -/* -** This program was written by Richard Verhoeven (NL:5482ZX35) -** at the Eindhoven University of Technology. Email: rcb5@win.tue.nl -** -** Permission is granted to distribute, modify and use this program as long -** as this comment is not removed or changed. -* In addition, -* -* Copyright (C) 1999 Red Hat Software -* Changes licensed under the GNU Public License. -*/ - -/* - * gnome-man2html2 - * This version modified for GNOME - December 1999 - * Elliot Lee - * May this code live forever :) - */ - -/* - * gnome-man2html - * This version modified for GNOME - February 1998 - * Michael Fulbright - */ - - -/* - * man2html-linux-1.0/1.1 - * This version modified for Redhat/Caldera linux - March 1996. - * Michael Hamilton . - * - * man2html-linux-1.2 - * Added support for BSD mandoc pages - I didn't have any documentation - * on the mandoc macros, so I may have missed some. - * Michael Hamilton . - * - * vh-man2html-1.3 - * Renamed to avoid confusion (V for Verhoeven, H for Hamilton). - * - * vh-man2html-1.4 - * Now uses /etc/man.config - * Added support for compressed pages. - * Added "length-safe" string operations for client input parameters. - * More secure, -M secured, and client input string lengths checked. - * - */ - -/* -** If you want to use this program for your WWW server, adjust the line -** which defines the CGIBASE or compile it with the -DCGIBASE='"..."' option. -** -** You have to adjust the built-in manpath to your local system. Note that -** every directory should start and end with the '/' and that the first -** directory should be "/" to allow a full path as an argument. -** -** The program first check if PATH_INFO contains some information. -** If it does (t.i. man2html/some/thing is used), the program will look -** for a manpage called PATH_INFO in the manpath. -** -** Otherwise the manpath is searched for the specified command line argument, -** where the following options can be used: -** -** name name of manpage (csh, printf, xv, troff) -** section the section (1 2 3 4 5 6 7 8 9 n l 1v ...) -** -M path an extra directory to look for manpages (replaces "/") -** -** If man2html finds multiple manpages that satisfy the options, an index -** is displayed and the user can make a choice. If only one page is -** found, that page will be displayed. -** -** man2html will add links to the converted manpages. The function add_links -** is used for that. At the moment it will add links as follows, where -** indicates what should match to start with: -** ^^^ -** Recognition Item Link -** ---------------------------------------------------------- -** name(*) Manpage ../man?/name.* -** ^ -** name@hostname Email address mailto:name@hostname -** ^ -** method://string URL method://string -** ^^^ -** www.host.name WWW server http://www.host.name -** ^^^^ -** ftp.host.name FTP server ftp://ftp.host.name -** ^^^^ -** Include file file:/usr/include/file.h -** ^^^ -** -** Since man2html does not check if manpages, hosts or email addresses exist, -** some links might not work. For manpages, some extra checks are performed -** to make sure not every () pair creates a link. Also out of date pages -** might point to incorrect places. -** -** The program will not allow users to get system specific files, such as -** /etc/passwd. It will check that "man" is part of the specified file and -** that "/../" isn't. Even if someone manages to get such file, man2html will -** handle it like a manpage and will usually not produce any output (or crash). -** -** If you find any bugs when normal manpages are converted, please report -** them to me (rcb5@win.tue.nl) after you have checked that man(1) can handle -** the manpage correct. -** -** Known bugs and missing features: -** -** * Equations are not converted at all. -** * Tables are converted but some features are not possible in html. -** * The tabbing environment is converted by counting characters and adding -** spaces. This might go wrong (outside
      )
      -**  * Some pages look beter if man2html works in troff mode, especially pages
      -**    with tables. You can deside at compile time which made you want to use.
      -**
      -**    -DNROFF=0     troff mode
      -**    -DNROFF=1     nroff mode   (default)
      -**
      -**    if you install both modes, you should compile with the correct CGIBASE.
      -**  * Some manpages rely on the fact that troff/nroff is used to convert
      -**    them and use features which are not descripted in the man manpages.
      -**    (definitions, calculations, conditionals, requests). I can't guarantee
      -**    that all these features work on all manpages. (I didn't have the
      -**    time to look through all the available manpages.)
      -*/
      -
      -
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#include 
      -#ifdef HAVE_LIBBZ2
      -#include 
      -#endif
      -
      -static char *URLbasename = NULL;
      -
      -#define NULL_TERMINATED(n) ((n) + 1)
      -
      -#define HUGE_STR_MAX  10000
      -#define LARGE_STR_MAX 2000
      -#define MED_STR_MAX   500
      -#define SMALL_STR_MAX 100
      -#define TINY_STR_MAX  10
      -
      -#define MAX_MAN_PATHS 100	/* Max number of directories */
      -#define MAX_ZCATS     10	/* Max number of zcat style programs */
      -#define MAX_WORDLIST  100
      -
      -#ifndef NROFF
      -#define NROFF 1
      -#endif
      -
      -/* timeformat for signature */
      -#define TIMEFORMAT "%T GMT, %B %d, %Y"
      -
      -/* BSD mandoc Bl/El lists to HTML list types */
      -#define BL_DESC_LIST   1
      -#define BL_BULLET_LIST 2
      -#define BL_ENUM_LIST   4
      -
      -/* BSD mandoc Bd/Ed example(?) blocks */
      -#define BD_LITERAL  1
      -#define BD_INDENT   2
      -
      -/* Don't bother with free(), it will just slow us down, the ultimate
      -   free will be exit() anyway.  Hack to fix a malloc bug that I couldn't
      -   track down (michael@actrix.gen.nz).
      -   */
      -#define free(x)
      -
      -static char
      -*stralloc(int len)
      -{					
      -	/* allocate enough for len + NULL */
      -	char *new = malloc((len + 1) * sizeof(char));
      -	if (!new) {
      -		fprintf(stderr, "man2html: out of memory");
      -		exit(EXIT_FAILURE);
      -	}
      -	return new;
      -}
      -
      -static char
      -*strmaxcpy(char *to, char *from, int n)
      -{				/* Assumes space for n plus a null */
      -	int len = strlen(from);
      -	strncpy(to, from, n);
      -	to[(len <= n) ? len : n] = '\0';
      -	return to;
      -}
      -
      -static char 
      -*strlimitcpy(char *to, char *from, int n, int limit)
      -{                               /* Assumes space for limit plus a null */
      -	int len = n > limit ? limit : n;
      -	strmaxcpy(to, from, len);
      -	to[len] = '\0';
      -	return to;
      -}
      -
      -/* below this you should not change anything unless you know a lot
      -** about this program or about troff.
      -*/
      -
      -
      -typedef struct STRDEF STRDEF;
      -struct STRDEF {
      -    int nr,slen;
      -    char *st;
      -    STRDEF *next;
      -};
      -
      -typedef struct INTDEF INTDEF;
      -struct INTDEF {
      -    int nr;
      -    int val;
      -    int incr;
      -    INTDEF *next;
      -};
      -
      -static char NEWLINE[2]="\n";
      -static char idxlabel[6] = "ixAAA";
      -
      -#define INDEXFILE "/tmp/manindex.list"
      -
      -static char *fname;
      -
      -#ifdef MAXINDEX
      -static FILE *idxfile;
      -#endif
      -
      -static STRDEF *chardef, *strdef, *defdef;
      -static INTDEF *intdef;
      -
      -#define V(A,B) ((A)*256+(B))
      -
      -static INTDEF standardint[] = {
      -    { V('n',' '), NROFF,0, NULL },
      -    { V('t',' '), 1-NROFF,0, NULL },
      -    { V('o',' '), 1,0, NULL },
      -    { V('e',' '), 0,0, NULL },
      -    { V('.','l'), 70,0,NULL },
      -    { V('.','$'), 0,0, NULL },
      -    { V('.','A'), NROFF,0, NULL },
      -    { V('.','T'), 1-NROFF,0, NULL },
      -    { V('.','V'), 1,0, NULL }, /* the me package tests for this */
      -    { 0, 0, 0, NULL } };
      -
      -static STRDEF standardstring[] = {
      -    { V('R',' '), 1, "®", NULL },
      -    { V('l','q'), 2, "``", NULL },
      -    { V('r','q'), 2, "''", NULL },
      -    { 0, 0, NULL, NULL}
      -};
      -
      -
      -static STRDEF standardchar[] = {
      -    { V('*','*'), 1, "*", NULL  },
      -    { V('*','A'), 1, "A", NULL  },
      -    { V('*','B'), 1, "B", NULL  },
      -    { V('*','C'), 2, "Xi", NULL  },
      -    { V('*','D'), 5, "Delta", NULL  },
      -    { V('*','E'), 1, "E", NULL  },
      -    { V('*','F'), 3, "Phi", NULL  },
      -    { V('*','G'), 5, "Gamma", NULL  },
      -    { V('*','H'), 5, "Theta", NULL  },
      -    { V('*','I'), 1, "I", NULL  },
      -    { V('*','K'), 1, "K", NULL  },
      -    { V('*','L'), 6, "Lambda", NULL  },
      -    { V('*','M'), 1, "M", NULL  },
      -    { V('*','N'), 1, "N", NULL  },
      -    { V('*','O'), 1, "O", NULL  },
      -    { V('*','P'), 2, "Pi", NULL  },
      -    { V('*','Q'), 3, "Psi", NULL  },
      -    { V('*','R'), 1, "P", NULL  },
      -    { V('*','S'), 5, "Sigma", NULL  },
      -    { V('*','T'), 1, "T", NULL  },
      -    { V('*','U'), 1, "Y", NULL  },
      -    { V('*','W'), 5, "Omega", NULL  },
      -    { V('*','X'), 1, "X", NULL  },
      -    { V('*','Y'), 1, "H", NULL  },
      -    { V('*','Z'), 1, "Z", NULL  },
      -    { V('*','a'), 5, "alpha", NULL },
      -    { V('*','b'), 4, "beta", NULL },
      -    { V('*','c'), 2, "xi", NULL },
      -    { V('*','d'), 5, "delta", NULL },
      -    { V('*','e'), 7, "epsilon", NULL },
      -    { V('*','f'), 3, "phi", NULL },
      -    { V('*','g'), 5, "gamma", NULL },
      -    { V('*','h'), 5, "theta", NULL },
      -    { V('*','i'), 4, "iota", NULL },
      -    { V('*','k'), 5, "kappa", NULL },
      -    { V('*','l'), 6, "lambda", NULL },
      -    { V('*','m'), 1, "µ", NULL  },
      -    { V('*','n'), 2, "nu", NULL },
      -    { V('*','o'), 1, "o", NULL },
      -    { V('*','p'), 2, "pi", NULL },
      -    { V('*','q'), 3, "psi", NULL },
      -    { V('*','r'), 3, "rho", NULL },
      -    { V('*','s'), 5, "sigma", NULL },
      -    { V('*','t'), 3, "tau", NULL },
      -    { V('*','u'), 7, "upsilon", NULL },
      -    { V('*','w'), 5, "omega", NULL },
      -    { V('*','x'), 3, "chi", NULL },
      -    { V('*','y'), 3, "eta", NULL },
      -    { V('*','z'), 4, "zeta", NULL },
      -    { V('t','s'), 5, "sigma", NULL },
      -    { V('+','-'), 1, "±", NULL  },
      -    { V('1','2'), 1, "½", NULL  },
      -    { V('1','4'), 1, "¼", NULL  },
      -    { V('3','4'), 1, "¾", NULL  },
      -    { V('F','i'), 3, "ffi", NULL  },
      -    { V('F','l'), 3, "ffl", NULL  },
      -    { V('a','a'), 1, "´", NULL  },
      -    { V('a','p'), 1, "~", NULL  },
      -    { V('b','r'), 1, "|", NULL  },
      -    { V('b','u'), 1, "*", NULL  },
      -    { V('b','v'), 1, "|", NULL  },
      -    { V('c','i'), 1, "o", NULL  },
      -    { V('c','o'), 1, "©", NULL  },
      -    { V('c','t'), 1, "¢", NULL  },
      -    { V('d','e'), 1, "°", NULL  },
      -    { V('d','g'), 1, "+", NULL  },
      -    { V('d','i'), 1, "÷", NULL  },
      -    { V('e','m'), 1, "-", NULL  },
      -    { V('e','m'), 3, "---", NULL },
      -    { V('e','q'), 1, "=", NULL  },
      -    { V('e','s'), 1, "Ø", NULL  },
      -    { V('f','f'), 2, "ff", NULL  },
      -    { V('f','i'), 2, "fi", NULL  },
      -    { V('f','l'), 2, "fl", NULL  },
      -    { V('f','m'), 1, "´", NULL  },
      -    { V('g','a'), 1, "`", NULL  },
      -    { V('h','y'), 1, "-", NULL  },
      -    { V('l','c'), 2, "|¯", NULL  },
      -    { V('l','f'), 2, "|_", NULL  },
      -    { V('l','k'), 1, "{", NULL  },
      -    { V('m','i'), 1, "-", NULL  },
      -    { V('m','u'), 1, "×", NULL  },
      -    { V('n','o'), 1, "¬", NULL  },
      -    { V('o','r'), 1, "|", NULL  },
      -    { V('p','l'), 1, "+", NULL  },
      -    { V('r','c'), 2, "¯|", NULL  },
      -    { V('r','f'), 2, "_|", NULL  },
      -    { V('r','g'), 1, "®", NULL  },
      -    { V('r','k'), 1, "}", NULL  },
      -    { V('r','n'), 1, "¯", NULL  },
      -    { V('r','u'), 1, "_", NULL  },
      -    { V('s','c'), 1, "§", NULL  },
      -    { V('s','l'), 1, "/", NULL  },
      -    { V('s','q'), 2, "[]", NULL  },
      -    { V('u','l'), 1, "_", NULL  },
      -    { 0, 0, NULL, NULL  }
      -};
      -
      -/* default: print code */
      -
      -
      -static char escapesym='\\', nobreaksym='\'', controlsym='.', fieldsym=0, padsym=0;
      -
      -static gzFile infh = NULL;
      -#ifdef HAVE_LIBBZ2
      -static BZFILE * inbfh = NULL;
      -#endif
      -static char *buffer=NULL;
      -static int buffpos=0, buffmax=0;
      -static int scaninbuff=0;
      -static int itemdepth=0;
      -static int dl_set[20]= { 0 };
      -static int still_dd=0;
      -static int tabstops[20] = { 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96 };
      -static int maxtstop=12;
      -static int curpos=0;
      -
      -static char *scan_troff(char *c, int san, char **result);
      -static char *scan_troff_mandoc(char *c, int san, char **result);
      -
      -static char **argument=NULL;
      -
      -static char charb[TINY_STR_MAX];
      -
      -static char
      -*expand_char(int nr)
      -{
      -	STRDEF *h;
      -	h=chardef;
      -	if (!nr) return NULL;
      -	while (h)
      -		if (h->nr==nr) {
      -			curpos+=h->slen;
      -			return h->st;
      -		} else
      -			h=h->next;
      -	charb[0]=nr/256;
      -	charb[1]=nr%256;
      -	charb[2]='\0';  
      -	if (charb[0] == '<') {	/* Fix up <= */
      -		charb[4] = charb[1];
      -		strncpy(charb, "<", 4);
      -		charb[5] = '\0';
      -	}
      -	curpos+=2;
      -	return charb;
      -}
      -
      -static char
      -*expand_string(int nr)
      -{
      -	STRDEF *h=strdef;
      -	if (!nr) return NULL;
      -	while (h)
      -		if (h->nr==nr) {
      -			curpos+=h->slen;
      -			return h->st;
      -		} else
      -			h=h->next;
      -	return NULL;
      -}
      -
      -/* msf - this will become real simple, as we read from stdin all the time */
      -/*       and it is always uncompressed                                    */
      -static char
      -*read_man_page(void) 
      -{
      -	char *man_buf = NULL;
      -	char buf[8192];
      -	int buf_size = 0;
      -	int bytes;
      -
      -	/* input from stdin */
      -#ifdef HAVE_LIBBZ2
      -	if (inbfh) 
      -	  bytes = bzread(inbfh, buf, sizeof(buf));
      -	else
      -#endif
      -	  bytes = gzread(infh, buf, sizeof(buf));
      -	while (bytes > 0) {
      -		if (!man_buf) {
      -			man_buf = malloc(bytes+1);
      -			man_buf[0] = '\n';
      -			buf_size = 1;
      -		} else {
      -			man_buf = realloc(man_buf, bytes+buf_size);
      -		}
      -
      -		memcpy(man_buf+buf_size, buf, bytes);
      -		buf_size += bytes;
      -#ifdef HAVE_LIBBZ2
      -		if (inbfh) 
      -		  bytes = bzread(inbfh, buf, sizeof(buf));
      -		else
      -#endif
      -		bytes = gzread(infh, buf, sizeof(buf));
      -	}
      -
      -	if (man_buf) {
      -			man_buf = realloc(man_buf, buf_size+2);
      -			man_buf[buf_size]   = '\n';
      -			man_buf[buf_size+1] = '\0';
      -	}
      -
      -	return man_buf;
      -}
      -
      -
      -static char outbuffer[NULL_TERMINATED(HUGE_STR_MAX)];
      -static int obp=0;
      -static int no_newline_output=0;
      -static int newline_for_fun=0;
      -static int output_possible=0;
      -static int out_length=0;
      -
      -/*
      -** Add the links to the output.
      -** At the moment the following are recognized:
      -**
      -** name(*)                 -> ../man?/name.*
      -** method://string         -> method://string
      -** www.host.name           -> http://www.host.name
      -** ftp.host.name           -> ftp://ftp.host.name
      -** name@host               -> mailto:name@host
      -**                 -> file:/usr/include/name.h   (guess)
      -**
      -** Other possible links to add in the future:
      -**
      -** /dir/dir/file  -> file:/dir/dir/file
      -*/
      -static void
      -add_links(char *c)
      -{
      -	int i,j,nr;
      -	char *f, *g,*h;
      -	char *idtest[6]; /* url, mailto, www, ftp, manpage */
      -	out_length+=strlen(c);
      -
      -	/* search for (section) */
      -	nr=0;
      -	idtest[0]=strstr(c+1,"://");
      -	idtest[1]=strchr(c+1,'@');
      -	idtest[2]=strstr(c,"www.");
      -	idtest[3]=strstr(c,"ftp.");
      -	idtest[4]=strchr(c+1,'(');
      -	idtest[5]=strstr(c+1,".h>");
      -	for (i=0; i<6; i++) nr += (idtest[i]!=NULL);
      -	while (nr) {
      -		j=-1;
      -		for (i=0; i<6; i++)
      -			if (idtest[i] && (j<0 || idtest[i] */
      -			f=idtest[5];
      -			h=f+2;
      -			g=f;
      -			while (g>c && g[-1]!=';') g--;
      -			if (g!=c) {
      -				char t;
      -				t=*g;
      -				*g='\0';
      -				fputs(c, stdout);
      -				*g=t;*h='\0';
      -				printf("%s>", g,g);
      -				c=f+6;
      -			} else {
      -				f[5]='\0';
      -				fputs(c, stdout);
      -				f[5]=';';
      -				c=f+5;
      -			}
      -			break;
      -		case 4: /* manpage */
      -			f=idtest[j];
      -			/* check section */
      -			g=strchr(f,')');
      -			if (g && f-g<6 && (isalnum((unsigned char)f[-1]) || f[-1]=='>') &&
      -			    ((isdigit((unsigned char)f[1]) && f[1]!='0' &&
      -			      (f[2]==')' || (isalpha((unsigned char)f[2]) && f[3]==')') ||
      -			       f[2]=='X')) ||
      -			     (f[2]==')' && (f[1]=='n' || f[1]=='l')))) {
      -				/* this might be a link */
      -				h=f-1;
      -				/* skip html makeup */
      -				while (h>c && *h=='>') {
      -					while (h!=c && *h!='<') h--;
      -					if (h!=c) h--;
      -				}
      -				if (isalnum((unsigned char)*h)) {
      -					char t,sec,subsec, *e;
      -					e=h+1;
      -					sec=f[1];
      -					subsec=f[2];
      -					if ((subsec=='X' && f[3]!=')') ||
      -					    subsec==')') subsec='\0';
      -					while (h>c && (isalnum((unsigned char)h[-1]) ||
      -						       h[-1]=='_' ||
      -						       h[-1]=='-' || 
      -						       h[-1]=='.'))
      -						h--;
      -					t=*h;
      -					*h='\0';
      -					fputs(c, stdout);
      -					*h=t;
      -					t=*e;
      -					*e='\0';
      -/* old code using file: */
      -#if 0
      -					if (subsec)
      -						/* change to whatever you're using */
      -						printf("%s", 
      -						       sec, h, sec, tolower(subsec), h);
      -					else
      -						printf("%s", 
      -						       sec, h, sec, h);
      -#else
      -					/* The code used to take
      -					   'subsec' into account, but
      -					   (a) 'subsec' can be more than
      -					   one character (b) We have
      -					   no use for that information */
      -
      -					printf("%s",
      -					       h, sec,
      -					       h);
      -#endif
      -					*e=t;
      -					c=e;
      -				}
      -			}
      -			*f='\0';
      -			fputs(c, stdout);
      -			*f='(';
      -			idtest[4]=f-1;
      -			c=f;
      -			break; /* manpage */
      -		case 3: /* ftp */
      -		case 2: /* www */
      -			g=f=idtest[j];
      -			while (*g && (isalnum((unsigned char)*g) || *g=='_' || *g=='-' 
      -				      || *g=='+' ||
      -				      *g=='.')) g++;
      -			if (g[-1]=='.') g--;
      -			if (g-f>4) {
      -				char t;
      -				t=*f; *f='\0';
      -				fputs(c, stdout);
      -				*f=t; t=*g;*g='\0';
      -				printf("%s", 
      -				       (j==3?"ftp":"http"),
      -				       f,f);
      -				*g=t;
      -				c=g;
      -			} else {
      -				f[3]='\0';
      -				fputs(c, stdout);
      -				c=f+3;
      -				f[3]='.';
      -			}
      -			break;
      -		case 1: /* mailto */
      -			g=f=idtest[1];
      -			while (g>c && (isalnum((unsigned char)g[-1]) || g[-1]=='_' 
      -				       || g[-1]=='-' ||
      -				       g[-1]=='+' || g[-1]=='.' 
      -				       || g[-1]=='%')) g--;
      -			h=f+1;
      -			while (*h && (isalnum((unsigned char)*h) || *h=='_' || *h=='-' 
      -				      || *h=='+' ||
      -				      *h=='.')) h++;
      -			if (*h=='.') h--;
      -			if (h-f>4 && f-g>1) {
      -				char t;
      -				t=*g;
      -				*g='\0';
      -				fputs(c, stdout);
      -				*g=t;t=*h;*h='\0';
      -				printf("%s",g,g);
      -				*h=t;
      -				c=h;
      -			} else {
      -				*f='\0';
      -				fputs(c, stdout);
      -				*f='@';
      -				idtest[1]=c;
      -				c=f;
      -			}
      -			break;
      -		case 0: /* url */
      -			g=f=idtest[0];
      -			while (g>c && isalpha((unsigned char)g[-1]) && islower((unsigned char)g[-1])) g--;
      -			h=f+3;
      -			while (*h && !isspace((unsigned char)*h) && *h!='<' && *h!='>' 
      -			       && *h!='"' &&
      -			       *h!='&') h++;
      -			if (f-g>2 && f-g<7 && h-f>3) {
      -				char t;
      -				t=*g;
      -				*g='\0';
      -				fputs(c, stdout);
      -				*g=t; t=*h; *h='\0';
      -				printf("%s", g,g);
      -				*h=t;
      -				c=h;
      -			} else {
      -				f[1]='\0';
      -				fputs(c, stdout);
      -				f[1]='/';
      -				c=f+1;
      -			}
      -			break;
      -		default:
      -			break;
      -		}
      -		nr=0;
      -		if (idtest[0] && idtest[0]=buffmax) {
      -				char *h;
      -				h=realloc(buffer, buffmax*2);
      -				if (!h) return;
      -				buffer=h;
      -				buffmax=buffmax*2;
      -			}
      -			buffer[buffpos++]=*c++;
      -		}
      -	} else
      -		if (output_possible) {
      -			while (*c) {
      -				outbuffer[obp++]=*c;
      -				if (*c=='\n' || obp > HUGE_STR_MAX) {
      -					outbuffer[obp]='\0';
      -					add_links(outbuffer);
      -					obp=0;
      -				}
      -				c++;
      -			}
      -		}
      -}
      -
      -#define FO0 ""
      -#define FC0 ""
      -#define FO1 ""
      -#define FC1 ""
      -#define FO2 ""
      -#define FC2 ""
      -#define FO3 ""
      -#define FC3 ""
      -
      -static char *switchfont[16] = { ""     , FC0 FO1, FC0 FO2, FC0 FO3,
      -			 FC1 FO0, ""     , FC1 FO2, FC1 FO3,
      -			 FC2 FO0, FC2 FO1, ""     , FC2 FO3,
      -			 FC3 FO0, FC3 FO1, FC3 FO2, ""      };
      -
      -static char
      -*change_to_font(int nr)
      -{
      -	int i;
      -	switch (nr) {
      -	case '0': nr++;
      -	case '1': case '2': case '3': case '4': nr=nr-'1'; break;
      -	case V('C','W'): nr=3; break;
      -	case 'L': nr=3; break;
      -	case 'B': nr=2; break;
      -	case 'I': nr=1; break;
      -	case 'P': case 'R': nr=0; break;
      -	case 0: case 1: case 2: case 3: break;
      -	default: nr=0; break;
      -	}
      -	i= current_font*4+nr%4;
      -	current_font=nr%4;
      -	return switchfont[i];
      -}
      -
      -static char sizebuf[200];
      -
      -static char
      -*change_to_size(int nr)
      -{
      -	int i;
      -	switch (nr) {
      -	case '0': case '1': case '2': case '3': case '4': case '5': case '6':
      -	case '7': case '8': case '9': nr=nr-'0'; break;
      -	case '\0': break;
      -	default: nr=current_size+nr; if (nr>9) nr=9; if (nr< -9) nr=-9; break;
      -	}
      -	if (nr==current_size) return "";
      -	i=current_font;
      -	sizebuf[0]='\0';
      -	strcat(sizebuf, change_to_font(0));
      -	if (current_size) strcat(sizebuf, "");
      -	current_size=nr;
      -	if (nr) {
      -		int l;
      -		strcat(sizebuf, "nr!=i)
      -			intd=intd->next;
      -		if (intd) {
      -			intd->val=intd->val+j*intd->incr;
      -			intresult=intd->val;
      -		} else {
      -			switch (i) {
      -			case V('.','s'): intresult=current_size; break;
      -			case V('.','f'): intresult=current_font; break;
      -			default: intresult=0; break;
      -			}
      -		}
      -		h="";
      -		break;
      -	case 'w':
      -		c++;
      -		i=*c;
      -		c++;
      -		exoutputp=output_possible;
      -		exskipescape=skip_escape;
      -		output_possible=0;
      -		skip_escape=1;
      -		j=0;
      -		while (*c!=i) {
      -			j++;
      -			if (*c==escapesym)
      -				c=scan_escape(c+1); 
      -			else
      -				c++;
      -		}
      -		output_possible=exoutputp;
      -		skip_escape=exskipescape;
      -		intresult=j;
      -		break;
      -	case 'l': h="
      "; curpos=0; - case 'b': - case 'v': - case 'x': - case 'o': - case 'L': - case 'h': - c++; - i=*c; - c++; - exoutputp=output_possible; - exskipescape=skip_escape; - output_possible=0; - skip_escape=1; - while (*c != i) - if (*c==escapesym) - c=scan_escape(c+1); - else - c++; - output_possible=exoutputp; - skip_escape=exskipescape; - break; - case 'c': no_newline_output=1; break; - case '{': newline_for_fun++; h="";break; - case '}': if (newline_for_fun) newline_for_fun--; h="";break; - case 'p': h="
      \n";curpos=0; break; - case 't': h="\t";curpos=(curpos+8)&0xfff8; break; - case '<': h="<";curpos++; break; - case '>': h=">";curpos++; break; - case '\\': if (single_escape) { c--; break;} - default: b[0]=*c; b[1]=0; h=b; curpos++; break; - } - c++; - if (!skip_escape) - out_html(h); - return c; -} - -typedef struct TABLEITEM TABLEITEM; - -struct TABLEITEM { - char *contents; - int size,align,valign,colspan,rowspan,font,vleft,vright,space,width; - TABLEITEM *next; -}; - -static TABLEITEM emptyfield = {NULL,0,0,0,1,1,0,0,0,0,0,NULL}; - -typedef struct TABLEROW TABLEROW; - -struct TABLEROW { - TABLEITEM *first; - TABLEROW *prev, *next; -}; - -static char *tableopt[]= { "center", "expand", "box", "allbox", "doublebox", - "tab", "linesize", "delim", NULL }; -static int tableoptl[] = { 6,6,3,6,9,3,8,5,0}; - - -static void clear_table(TABLEROW *table) -{ - TABLEROW *tr1,*tr2; - TABLEITEM *ti1,*ti2; - - tr1=table; - while (tr1->prev) tr1=tr1->prev; - while (tr1) { - ti1=tr1->first; - while (ti1) { - ti2=ti1->next; - if (ti1->contents) free(ti1->contents); - free(ti1); - ti1=ti2; - } - tr2=tr1; - tr1=tr1->next; - free(tr2); - } -} - -static char *scan_expression(char *c, int *result); - -static char -*scan_format(char *c, TABLEROW **result, int *maxcol) -{ - TABLEROW *layout, *currow; - TABLEITEM *curfield; - int i,j; - - if (*result) { - clear_table(*result); - } - - layout= currow=(TABLEROW*) malloc(sizeof(TABLEROW)); - currow->next=currow->prev=NULL; - currow->first=curfield=(TABLEITEM*) malloc(sizeof(TABLEITEM)); - *curfield=emptyfield; - while (*c && *c!='.') { - switch (*c) { - case 'C': case 'c': case 'N': case 'n': - case 'R': case 'r': case 'A': case 'a': - case 'L': case 'l': case 'S': case 's': - case '^': case '_': - if (curfield->align) { - curfield->next= - (TABLEITEM*)malloc(sizeof(TABLEITEM)); - curfield=curfield->next; - *curfield=emptyfield; - } - curfield->align=toupper(*c); - c++; - break; - case 'i': case 'I': case 'B': case 'b': - curfield->font = toupper(*c); - c++; - break; - case 'f': case 'F': - c++; - curfield->font = toupper(*c); - c++; - if (!isspace((unsigned char)*c) && *c!='.') c++; - break; - case 't': case 'T': curfield->valign='t'; c++; break; - case 'p': case 'P': - c++; - i=j=0; - if (*c=='+') { j=1; c++; } - if (*c=='-') { j=-1; c++; } - while (isdigit((unsigned char)*c)) i=i*10+(*c++)-'0'; - if (j) curfield->size= i*j; else curfield->size=j-10; - break; - case 'v': case 'V': - case 'w': case 'W': - c=scan_expression(c+2,&curfield->width); - break; - case '|': - if (curfield->align) curfield->vleft++; - else curfield->vright++; - c++; - break; - case 'e': case 'E': - c++; - break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - i=0; - while (isdigit((unsigned char)*c)) i=i*10+(*c++)-'0'; - curfield->space=i; - break; - case ',': case '\n': - currow->next=(TABLEROW*)malloc(sizeof(TABLEROW)); - currow->next->prev=currow; - currow=currow->next; - currow->next=NULL; - curfield=currow->first=(TABLEITEM*)malloc(sizeof(TABLEITEM)); - *curfield=emptyfield; - c++; - break; - default: - c++; - break; - } - } - if (*c=='.') while (*c++!='\n'); - *maxcol=0; - currow=layout; - while (currow) { - curfield=layout->first; - i=0; - while (curfield) { - i++; - curfield=curfield->next; - } - if (i>*maxcol) *maxcol=i; - currow=currow->next; - } - *result=layout; - return c; -} - -static TABLEROW -*next_row(TABLEROW *tr) -{ - if (tr->next) { - tr=tr->next; - if (!tr->next) next_row(tr); - return tr; - } else { - TABLEITEM *ti, *ti2; - tr->next=(TABLEROW*)malloc(sizeof(TABLEROW)); - tr->next->prev=tr; - ti=tr->first; - tr=tr->next; - tr->next=NULL; - if (ti) tr->first=ti2=(TABLEITEM*) malloc(sizeof(TABLEITEM)); - else tr->first=ti2=NULL; - while (ti!=ti2) { - *ti2=*ti; - ti2->contents=NULL; - if ((ti=ti->next)) { - ti2->next=(TABLEITEM*) - malloc(sizeof(TABLEITEM)); - } - ti2=ti2->next; - } - return tr; - } -} - -static char itemreset[20]="\\fR\\s0"; - -static char -*scan_table(char *c) -{ - char *h, *g; - int center=0, expand=0, box=0, border=0, linesize=1; - int i,j,maxcol=0, finished=0; - int oldfont, oldsize,oldfillout; - char itemsep='\t'; - TABLEROW *layout=NULL, *currow; - TABLEITEM *curfield; - - while (*c++!='\n'); - h=c; - if (*h=='.') return c-1; - oldfont=current_font; - oldsize=current_size; - oldfillout=fillout; - out_html(change_to_font(0)); - out_html(change_to_size(0)); - if (!fillout) { - fillout=1; - out_html("
      "); - } - while (*h && *h!='\n') h++; - if (h[-1]==';') { - /* scan table options */ - while (cfirst; - i=0; - while (!finished) { - /* search item */ - h=c; - if ((*c=='_' || *c=='=') && (c[1]==itemsep || c[1]=='\n')) { - if (c[-1]=='\n' && c[1]=='\n') { - if (currow->prev) { - currow->prev->next=(TABLEROW*) - malloc(sizeof(TABLEROW)); - currow->prev->next->next=currow; - currow->prev->next->prev=currow->prev; - currow->prev=currow->prev->next; - } else { - currow->prev=layout=(TABLEROW*) - malloc(sizeof(TABLEROW)); - currow->prev->prev=NULL; - currow->prev->next=currow; - } - curfield=currow->prev->first= - (TABLEITEM*) malloc(sizeof(TABLEITEM)); - *curfield=emptyfield; - curfield->align=*c; - curfield->colspan=maxcol; - curfield=currow->first; - c=c+2; - } else { - if (curfield) { - curfield->align=*c; - do { - curfield=curfield->next; - } while (curfield - && curfield->align=='S'); - } - if (c[1]=='\n') { - currow=next_row(currow); - curfield=currow->first; - } - c=c+2; - } - } else if (*c=='T' && c[1]=='{') { - h=c+2; - c=strstr(h,"\nT}"); - c++; - *c='\0'; - g=NULL; - scan_troff(h,0,&g); - scan_troff(itemreset, 0,&g); - *c='T'; - c+=3; - if (curfield) { - curfield->contents=g; - do { - curfield=curfield->next; - } while (curfield && curfield->align=='S'); - } else - if (g) free(g); - if (c[-1]=='\n') { - currow=next_row(currow); - curfield=currow->first; - } - } else if (*c=='.' && c[1]=='T' && c[2]=='&' && c[-1]=='\n') { - TABLEROW *hr; - while (*c++!='\n'); - hr=currow; - currow=currow->prev; - hr->prev=NULL; - c=scan_format(c,&hr, &i); - hr->prev=currow; - currow->next=hr; - currow=hr; - next_row(currow); - curfield=currow->first; - } else if (*c=='.' && c[1]=='T' && c[2]=='E' && c[-1]=='\n') { - finished=1; - while (*c++!='\n'); - if (currow->prev) - currow->prev->next=NULL; - currow->prev=NULL; - clear_table(currow); - } else if (*c=='.' && c[-1]=='\n' && !isdigit((unsigned char)c[1])) { - /* skip troff request inside table(usually only .sp )*/ - while (*c++!='\n'); - } else { - h=c; - while (*c && (*c!=itemsep || c[-1]=='\\') && - (*c!='\n' || c[-1]=='\\')) c++; - i=0; - if (*c==itemsep) {i=1; *c='\n'; } - if (h[0]=='\\' && h[2]=='\n' && - (h[1]=='_' || h[1]=='^')) { - if (curfield) { - curfield->align=h[1]; - do { - curfield=curfield->next; - } while (curfield && - curfield->align=='S'); - } - h=h+3; - } else { - g=NULL; - h=scan_troff(h,1,&g); - scan_troff(itemreset,0,&g); - if (curfield) { - curfield->contents=g; - do { - curfield=curfield->next; - } while (curfield && - curfield->align=='S'); - } else if (g) free(g); - } - if (i) *c=itemsep; - c=h; - if (c[-1]=='\n') { - currow=next_row(currow); - curfield=currow->first; - } - } - } - /* calculate colspan and rowspan */ - currow=layout; - while (currow->next) currow=currow->next; - while (currow) { - TABLEITEM *ti, *ti1=NULL, *ti2=NULL; - ti=currow->first; - if (currow->prev) - ti1=currow->prev->first; - while (ti) { - switch (ti->align) { - case 'S': - if (ti2) { - ti2->colspan++; - if (ti2->rowspanrowspan) - ti2->rowspan=ti->rowspan; - } - break; - case '^': - if (ti1) - ti1->rowspan++; - default: - if (!ti2) - ti2=ti; - else { - do { - ti2=ti2->next; - } while (ti2 && curfield->align=='S'); - } - break; - } - ti=ti->next; - if (ti1) ti1=ti1->next; - } - currow=currow->prev; - } - /* produce html output */ - if (center) - out_html("
      "); - if (box==2) - out_html(""); - curfield=currow->first; - while (curfield) { - if (curfield->align!='S' && curfield->align!='^') { - out_html("align) { - case 'N': - curfield->space+=4; - case 'R': - out_html(" ALIGN=right"); - break; - case 'C': - out_html(" ALIGN=center"); - default: - break; - } - if (!curfield->valign && curfield->rowspan>1) - out_html(" VALIGN=center"); - if (curfield->colspan>1) { - char buf[5]; - out_html(" COLSPAN="); - sprintf(buf, "%i", curfield->colspan); - out_html(buf); - } - if (curfield->rowspan>1) { - char buf[5]; - out_html(" ROWSPAN="); - sprintf(buf, "%i", curfield->rowspan); - out_html(buf); - } - j=j+curfield->colspan; - out_html(">"); - if (curfield->size) - out_html(change_to_size(curfield->size)); - if (curfield->font) - out_html(change_to_font(curfield->font)); - switch (curfield->align) { - case '=': - out_html("

      "); - break; - case '_': - out_html("
      "); - break; - default: - if (curfield->contents) - out_html(curfield->contents); - break; - } - if (curfield->space) - for (i=0; ispace;i++) - out_html(" "); - if (curfield->font) - out_html(change_to_font(0)); - if (curfield->size) - out_html(change_to_size(0)); - if (j>=maxcol && curfield->align>'@' && - curfield->align!='_') - out_html("
      "); - out_html(""); - } - curfield=curfield->next; - } - out_html("
      \n"); - currow=currow->next; - } - if (box && !border) - out_html("
      "); - out_html("
      \n"); - currow=layout; - while (currow) { - j=0; - out_html("
      "); - out_html(""); - if (box==2) - out_html(""); - if (center) - out_html("
      \n"); - else - out_html("\n"); - if (!oldfillout) - out_html("
      ");
      -	fillout=oldfillout;
      -	out_html(change_to_size(oldsize));
      -	out_html(change_to_font(oldfont));
      -	return c;
      -}
      -
      -static char
      -*scan_expression(char *c, int *result)
      -{
      -	int value=0,value2,sign=1,opex=0;
      -	char oper='c';
      -
      -	if (*c=='!') {
      -		c=scan_expression(c+1, &value);
      -		value= (!value);
      -	} else if (*c=='n') {
      -		c++;
      -		value=NROFF;
      -	} else if (*c=='t') {
      -		c++;
      -		value=1-NROFF;
      -	} else if (*c=='\'' || *c=='"' || *c<' ' || (*c=='\\' && c[1]=='(')) {
      -		/* ?string1?string2?
      -		** test if string1 equals string2.
      -		*/
      -		char *st1=NULL, *st2=NULL, *h;
      -		char *tcmp=NULL;
      -		char sep;
      -		sep=*c;
      -		if (sep=='\\') {
      -			tcmp=c;
      -			c=c+3;
      -		}
      -		c++;
      -		h=c;
      -		while (*c!= sep && (!tcmp || strncmp(c,tcmp,4)))
      -			c++;
      -		*c='\n';
      -		scan_troff(h, 1, &st1);
      -		*c=sep;
      -		if (tcmp)
      -			c=c+3;
      -		c++;
      -		h=c;
      -		while (*c!=sep && (!tcmp || strncmp(c,tcmp,4)))
      -			c++;
      -		*c='\n';
      -		scan_troff(h,1,&st2);
      -		*c=sep;
      -		if (!st1 && !st2)
      -			value=1;
      -		else if (!st1 || !st2)
      -			value=0;
      -		else 
      -			value=(!strcmp(st1, st2));
      -		if (st1) 
      -			free(st1);
      -		if (st2)
      -			free(st2);
      -		if (tcmp)
      -			c=c+3;
      -		c++;
      -	} else {
      -		while (*c && !isspace((unsigned char)*c) && *c!=')') {
      -			opex=0;
      -			switch (*c) {
      -			case '(':
      -				c=scan_expression(c+1, &value2);
      -				value2=sign*value2;
      -				opex=1;
      -				break;
      -			case '.':
      -			case '0': case '1':
      -			case '2': case '3':
      -			case '4': case '5':
      -			case '6': case '7':
      -			case '8': case '9': {
      -				int num=0,denum=1;
      -				value2=0;
      -				while (isdigit((unsigned char)*c))
      -					value2=value2*10+((*c++)-'0');
      -				if (*c=='.') {
      -					c++;
      -					while (isdigit((unsigned char)*c)) {
      -						num=num*10+((*c++)-'0');
      -						denum=denum*10;
      -					}
      -				}
      -				if (isalpha((unsigned char)*c)) {
      -					/* scale indicator */
      -					switch (*c) {
      -					case 'i': /* inch -> 10pt */
      -						value2=value2*10+
      -							(num*10+denum/2)/denum;
      -						num=0;
      -						break;
      -					default:
      -						break;
      -					}
      -					c++;
      -				}
      -				value2=value2+(num+denum/2)/denum;
      -				value2=sign*value2;
      -				opex=1;
      -				break;
      -			}
      -			case '\\':
      -				c=scan_escape(c+1);
      -				value2=intresult*sign;
      -				if (isalpha((unsigned char)*c))
      -					c++; /* scale indicator */
      -				opex=1;
      -				break;
      -			case '-':
      -				if (oper) { 
      -					sign=-1; 
      -					c++;
      -					break;
      -				}
      -			case '>':
      -			case '<':
      -			case '+':
      -			case '/':
      -			case '*':
      -			case '%':
      -			case '&':
      -			case '=':
      -			case ':':
      -				if (c[1]=='=')
      -					oper=(*c++) + 16;
      -				else 
      -					oper=*c;
      -				c++;
      -				break;
      -			default: 
      -				c++;
      -				break;
      -			}
      -			if (opex) {
      -				sign=1;
      -				switch (oper) {
      -				case 'c': 
      -					value=value2; 
      -					break;
      -				case '-': 
      -					value=value-value2;
      -					break;
      -				case '+': 
      -					value=value+value2;
      -					break;
      -				case '*': 
      -					value=value*value2; 
      -					break;
      -				case '/': 
      -					if (value2) 
      -						value=value/value2; 
      -					break;
      -				case '%': 
      -					if (value2) 
      -						value=value%value2; 
      -					break;
      -				case '<':
      -					value=(value':
      -					value=(value>value2); 
      -					break;
      -				case '>'+16:
      -					value=(value>=value2);
      -					break;
      -				case '<'+16: 
      -					value=(value<=value2); 
      -					break;
      -				case '=':
      -				case '='+16: 
      -					value=(value==value2);
      -					break;
      -				case '&':
      -					value = (value && value2);
      -					break;
      -				case ':':
      -					value = (value || value2);
      -					break;
      -				default: 
      -					fprintf(stderr, "man2html: unknown "
      -						"operator %c.\n", oper);
      -				}
      -				oper=0;
      -			}
      -		}
      -		if (*c==')')
      -			c++;
      -	}
      -	*result=value;
      -	return c;
      -}
      -
      -static void 
      -trans_char(char *c, char s, char t)
      -{
      -	char *sl=c;
      -	int slash=0;
      -	while (*sl!='\n' || slash) {
      -		if (!slash) {
      -			if (*sl==escapesym)
      -				slash=1;
      -			else if (*sl==s)
      -				*sl=t;
      -		} else slash=0;
      -		sl++;
      -	}
      -}
      -
      -static char
      -*fill_words(char *c, char *words[], int *n)
      -{
      -	char *sl=c;
      -	int slash=0;
      -	int skipspace=0;
      -	*n=0;
      -	words[*n]=sl;
      -	while (*sl && (*sl!='\n' || slash)) {
      -		if (!slash) {
      -			if (*sl=='"') {
      -				*sl='\a';
      -				skipspace=!skipspace;
      -			} else if (*sl==escapesym)
      -				slash=1;
      -			else if ((*sl==' ' || *sl=='\t') && !skipspace) {
      -				*sl='\n';
      -				if (words[*n]!=sl)
      -					(*n)++;
      -				words[*n]=sl+1;
      -			}
      -		} else {
      -			if (*sl=='"') {
      -				sl--;
      -				*sl='\n';
      -				if (words[*n]!=sl)
      -					(*n)++;
      -				sl++;
      -				while (*sl && *sl !='\n') 
      -					sl++;
      -				words[*n]=sl;
      -				sl--;
      -			}
      -			slash=0;
      -		}
      -		sl++;
      -	}
      -	if (sl!=words[*n])
      -		(*n)++;
      -	return sl;
      -}
      -
      -static char *abbrev_list[] = {
      -    "GSBG", "Getting Started ",
      -    "SUBG", "Customizing SunOS",
      -    "SHBG", "Basic Troubleshooting",
      -    "SVBG", "SunView User's Guide",
      -    "MMBG", "Mail and Messages",
      -    "DMBG", "Doing More with SunOS",
      -    "UNBG", "Using the Network",
      -    "GDBG", "Games, Demos & Other Pursuits",
      -    "CHANGE", "SunOS 4.1 Release Manual",
      -    "INSTALL", "Installing SunOS 4.1",
      -    "ADMIN", "System and Network Administration",
      -    "SECUR", "Security Features Guide",
      -    "PROM", "PROM User's Manual",
      -    "DIAG", "Sun System Diagnostics",
      -    "SUNDIAG", "Sundiag User's Guide",
      -    "MANPAGES", "SunOS Reference Manual",
      -    "REFMAN", "SunOS Reference Manual",
      -    "SSI", "Sun System Introduction",
      -    "SSO", "System Services Overview",
      -    "TEXT", "Editing Text Files",
      -    "DOCS", "Formatting Documents",
      -    "TROFF", "Using nroff and troff",
      -    "INDEX", "Global Index",
      -    "CPG", "C Programmer's Guide",
      -    "CREF", "C Reference Manual",
      -    "ASSY", "Assembly Language Reference",
      -    "PUL", "Programming Utilities and Libraries",
      -    "DEBUG", "Debugging Tools",
      -    "NETP", "Network Programming",
      -    "DRIVER", "Writing Device Drivers",
      -    "STREAMS", "STREAMS Programming",
      -    "SBDK", "SBus Developer's Kit",
      -    "WDDS", "Writing Device Drivers for the SBus",
      -    "FPOINT", "Floating-Point Programmer's Guide",
      -    "SVPG", "SunView 1 Programmer's Guide",
      -    "SVSPG", "SunView 1 System Programmer's Guide",
      -    "PIXRCT", "Pixrect Reference Manual",
      -    "CGI", "SunCGI Reference Manual",
      -    "CORE", "SunCore Reference Manual",
      -    "4ASSY", "Sun-4 Assembly Language Reference",
      -    "SARCH", "SPARC Architecture Manual",
      -    "KR", "The C Programming Language",
      -    NULL, NULL };
      -
      -static char *lookup_abbrev(char *c)
      -{
      -    int i=0;
      -
      -    if (!c) return "";
      -    while (abbrev_list[i] && strcmp(c,abbrev_list[i])) i=i+2;
      -    if (abbrev_list[i]) return abbrev_list[i+1];
      -    else return c;
      -}
      -
      -static char *section_list[] = {
      -    "1", "User Commands ",
      -    "1C", "User Commands",
      -    "1G", "User Commands",
      -    "1S", "User Commands",
      -    "1V", "User Commands ",
      -    "2", "System Calls",
      -    "2V", "System Calls",
      -    "3", "C Library Functions",
      -    "3C", "Compatibility Functions",
      -    "3F", "Fortran Library Routines",
      -    "3K", "Kernel VM Library Functions",
      -    "3L", "Lightweight Processes Library",
      -    "3M", "Mathematical Library",
      -    "3N", "Network Functions",
      -    "3R", "RPC Services Library",
      -    "3S", "Standard I/O Functions",
      -    "3V", "C Library Functions",
      -    "3X", "Miscellaneous Library Functions",
      -    "4", "Devices and Network Interfaces",
      -    "4F", "Protocol Families",
      -    "4I", "Devices and Network Interfaces",
      -    "4M", "Devices and Network Interfaces",
      -    "4N", "Devices and Network Interfaces",
      -    "4P", "Protocols",
      -    "4S", "Devices and Network Interfaces",
      -    "4V", "Devices and Network Interfaces",
      -    "5", "File Formats",
      -    "5V", "File Formats",
      -    "6", "Games and Demos",
      -    "7", "Environments, Tables, and Troff Macros",
      -    "7V", "Environments, Tables, and Troff Macros",
      -    "8", "Maintenance Commands",
      -    "8C", "Maintenance Commands",
      -    "8S", "Maintenance Commands",
      -    "8V", "Maintenance Commands",
      -    "L", "Local Commands",
      -    NULL, "Misc. Reference Manual Pages",
      -    NULL, NULL
      -};
      -
      -static char
      -*section_name(char *c)
      -{
      -    int i=0;
      -
      -    if (!c)
      -	    return "";
      -    while (section_list[i] && strcmp(c,section_list[i]))
      -	    i=i+2;
      -    if (section_list[i+1])
      -	    return section_list[i+1];
      -    else 
      -	    return c;
      -}
      -
      -static char manidx[NULL_TERMINATED(HUGE_STR_MAX)];
      -static int subs=0;
      -static int mip=0;
      -static char label[5]="lbAA";
      -
      -static void 
      -add_to_index(int level, char *item)
      -{
      -	char *c=NULL;
      -	label[3]++;
      -
      -	if (label[3]>'Z') {
      -		label[3]='A';
      -		label[2]++;
      -	}
      -	if (level != subs) {
      -		if (subs) {
      -			strmaxcpy(manidx+mip, "
      \n", HUGE_STR_MAX - mip); - mip+=6; - } else { - strmaxcpy(manidx+mip, "
      \n", HUGE_STR_MAX - mip); - mip+=5; - } - } - subs=level; - scan_troff(item, 1, &c); - sprintf(manidx+mip, "
      %s
      \n", - ((URLbasename) ? URLbasename : ""), label, c); - if (c) - free(c); - while (manidx[mip]) - mip++; -} - -static char -*skip_till_newline(char *c) -{ - int lvl=0; - - while ((*c && *c!='\n') || lvl>0) { - if (*c=='\\') { - c++; - if (*c=='}') - lvl--; - else if (*c=='{') - lvl++; - } - c++; - } - c++; - if (lvl<0 && newline_for_fun) { - newline_for_fun = newline_for_fun+lvl; - if (newline_for_fun<0) - newline_for_fun=0; - } - return c; -} - -static int ifelseval=0; - -static char -*scan_request(char *c) -{ - /* BSD Mandoc stuff */ - static int mandoc_synopsis=0; /* True if in the synopsis section */ - static int mandoc_command=0; /* True if this is mandoc page */ - static int mandoc_bd_options; /* Only copes with non-nested Bd's */ - - int i,j,mode=0; - char *h; - char *wordlist[MAX_WORDLIST]; - int words; - char *sl; - STRDEF *owndef; - - while (*c==' ' || *c=='\t') - c++; - if (c[0]=='\n') - return c+1; - if (c[1]=='\n') - j=1; - else - j=2; - while (c[j]==' ' || c[j]=='\t') - j++; - if (c[0]==escapesym) { - /* some pages use .\" .\$1 .\} */ - /* .\$1 is too difficult/stuppid */ - if (c[1]=='$') - c=skip_till_newline(c); - else - c = scan_escape(c+1); - } else { - i=V(c[0],c[1]); - switch (i) { - case V('`',' '): - out_html(change_to_font('B')); - out_html("`"); - trans_char(c,'"','\a'); - c=c+j; - if (*c!='\n') - c++; - c=scan_troff(c, 1, NULL); - out_html("'"); - out_html(change_to_font('R')); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('a','b'): - h=c+j; - while (*h && *h !='\n') - h++; - *h='\0'; - if (scaninbuff && buffpos) { - buffer[buffpos]='\0'; - puts(buffer); - } - /* fprintf(stderr, "%s\n", c+2); */ - exit(0); - break; - case V('d','i'): - { - STRDEF *de; - - c=c+j; - i=V(c[0],c[1]); - if (*c=='\n') { - c++; - break; - } - while (*c && *c!='\n') - c++; - c++; - h=c; - while (*c && strncmp(c,".di",3)) - while (*c && *c++!='\n'); - *c='\0'; - de=strdef; - while (de && de->nr !=i) - de=de->next; - if (!de) { - de=(STRDEF*) malloc(sizeof(STRDEF)); - de->nr=i; - de->slen=0; - de->next=strdef; - de->st=NULL; - strdef=de; - } else { - if (de->st) - free(de->st); - de->slen=0; - de->st=NULL; - } - scan_troff(h,0,&de->st); - *c='.'; - while (*c && *c++!='\n'); - break; - } - case V('d','s'): - mode=1; - case V('a','s'): - { - STRDEF *de; - int oldcurpos=curpos; - - c=c+j; - i=V(c[0],c[1]); - j=0; - while (c[j] && c[j]!='\n') - j++; - if (j<3) { - c=c+j; - break; - } - if (c[1]==' ') - c=c+1; - else - c=c+2; - while (isspace((unsigned char)*c)) - c++; - if (*c=='"') - c++; - de=strdef; - while (de && de->nr != i) - de=de->next; - single_escape=1; - curpos=0; - if (!de) { - char *h; - - de=(STRDEF*) malloc(sizeof(STRDEF)); - de->nr=i; - de->slen=0; - de->next=strdef; - de->st=NULL; - strdef=de; - h=NULL; - c=scan_troff(c, 1, &h); - de->st=h; - de->slen=curpos; - } else { - if (mode) { - char *h=NULL; - - c=scan_troff(c, 1, &h); - free(de->st); - de->slen=0; - de->st=h; - } else - c=scan_troff(c,1,&de->st); - de->slen+=curpos; - } - single_escape=0; - curpos=oldcurpos; - } - break; - case V('b','r'): - if (still_dd) - out_html("
      "); - else - out_html("
      \n"); - curpos=0; - c=c+j; - if (c[0]==escapesym) - c=scan_escape(c+1); - c=skip_till_newline(c); - break; - case V('c','2'): - c=c+j; - if (*c!='\n') - nobreaksym=*c; - else - nobreaksym='\''; - c=skip_till_newline(c); - break; - case V('c','c'): - c=c+j; - if (*c!='\n') - controlsym=*c; - else - controlsym='.'; - c=skip_till_newline(c); - break; - case V('c','e'): - c=c+j; - if (*c=='\n') { i=1; } - else { - i=0; - while ('0'<=*c && *c<='9') { - i=i*10+*c-'0'; - c++; - } - } - c=skip_till_newline(c); - /* center next i lines */ - if (i>0) { - out_html("
      \n"); - while (i && *c) { - char *line=NULL; - c=scan_troff(c,1, &line); - if (line && strncmp(line, "
      ", 4)) { - out_html(line); - out_html("
      \n"); - i--; - } - } - out_html("
      \n"); - curpos=0; - } - break; - case V('e','c'): - c=c+j; - if (*c!='\n') - escapesym=*c; - else - escapesym='\\'; - break; - c=skip_till_newline(c); - case V('e','o'): - escapesym='\0'; - c=skip_till_newline(c); - break; - case V('e','x'): - exit(0); - break; - case V('f','c'): - c=c+j; - if (*c=='\n') { - fieldsym=padsym='\0'; - } else { - fieldsym=c[0]; - padsym=c[1]; - } - c=skip_till_newline(c); - break; - case V('f','i'): - if (!fillout) { - out_html(change_to_font(0)); - out_html(change_to_size('0')); - out_html("\n"); - } - curpos=0; - fillout=1; - c=skip_till_newline(c); - break; - case V('f','t'): - c=c+j; - if (*c=='\n') { - out_html(change_to_font(0)); - } else { - if (*c==escapesym) { - int fn; - - c=scan_expression(c, &fn); - c--; - out_html(change_to_font(fn)); - } else { - out_html(change_to_font(*c)); - c++; - } - } - c=skip_till_newline(c); - break; - case V('e','l'): - /* .el anything : else part of if else */ - if (ifelseval) { - c=c+j; - c[-1]='\n'; - c=scan_troff(c,1,NULL); - } else - c=skip_till_newline(c+j); - break; - case V('i','e'): - /* .ie c anything : then part of if else */ - case V('i','f'): - /* .if c anything - * .if !c anything - * .if N anything - * .if !N anything - * .if 'string1'string2' anything - * .if !'string1'string2' anything - */ - c=c+j; - c=scan_expression(c, &i); - ifelseval=!i; - if (i) { - *c='\n'; - c++; - c=scan_troff(c,1,NULL); - } else - c=skip_till_newline(c); - break; - case V('i','g'): - { - char *endwith="..\n"; - i=3; - c=c+j; - if (*c!='\n' && strncmp(c, "\\\"", 2)) { - endwith=c-1;i=1; - c[-1]='.'; - while (*c && *c!='\n') { - c++; - i++; - } - } - c++; - while (*c && strncmp(c,endwith,i)) - while (*c && *c++!='\n'); - while (*c && *c++!='\n'); - break; - } - case V('n','f'): - if (fillout) { - out_html(change_to_font(0)); - out_html(change_to_size('0')); - out_html("
      \n");
      -			}
      -			curpos=0;
      -			fillout=0;
      -			c=skip_till_newline(c);
      -			break;
      -		case V('p','s'):
      -			c=c+j;
      -			if (*c=='\n') {
      -				out_html(change_to_size('0'));
      -			} else {
      -				j=0;i=0;
      -				if (*c=='-') { 
      -					j= -1;
      -					c++;
      -				} else if (*c=='+') {
      -					j=1;
      -					c++;
      -				}
      -				c=scan_expression(c, &i);
      -				if (!j) {
      -					j=1;
      -					if (i>5)
      -						i=i-10;
      -				}
      -				out_html(change_to_size(i*j));
      -			}
      -			c=skip_till_newline(c);
      -			break;
      -		case V('s','p'):
      -			c=c+j;
      -			if (fillout)
      -				out_html("

      "); - else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } - curpos=0; - c=skip_till_newline(c); - break; - case V('s','o'): - { - /* msf */ - curpos=0; - c=c+j; - if (*c=='/') { - h=c; - } else { - h=c-3; - h[0]='.'; - h[1]='.'; - h[2]='/'; - } - while (*c!='\n') - c++; - *c='\0'; - *c++='\n'; - - printf(" WARNING - a .so macro slipped " - "through!\n"); - break; - } - case V('t','a'): - c=c+j; - j=0; - while (*c!='\n') { - sl=scan_expression(c, &tabstops[j]); - if (*c=='-' || *c=='+') - tabstops[j]+=tabstops[j-1]; - c=sl; - while (*c==' ' || *c=='\t') - c++; - j++; - } - maxtstop=j; - curpos=0; - break; - case V('t','i'): - /*while (itemdepth || dl_set[itemdepth]) { - out_html("

      \n"); - if (dl_set[itemdepth]) dl_set[itemdepth]=0; - else itemdepth--; - }*/ - out_html("
      \n"); - c=c+j; - c=scan_expression(c, &j); - for (i=0; ia b ] */ - mode=1; - c[0]='B'; - c[1]='I'; - out_html(change_to_font('R')); - out_html("["); - curpos++; - case V('B','R'): - case V('B','I'): - case V('I','B'): - case V('I','R'): - case V('R','B'): - case V('R','I'): - { - char font[2] ; - - font[0] = c[0]; - font[1] = c[1]; - c=c+j; - if (*c=='\n') - c++; - sl=fill_words(c, wordlist, &words); - c=sl+1; - /* .BR name (section) - ** indicates a link. It will be added - ** in the output routine. - */ - for (i=0; i\n"); - dl_set[itemdepth]=1; - } - out_html("
      "); - if (words) { - scan_troff(wordlist[0], 1,NULL); - } - out_html("
      "); - curpos=0; - break; - case V('T','P'): - if (!dl_set[itemdepth]) { - out_html("
      \n"); - dl_set[itemdepth]=1; - } - out_html("
      "); - c=skip_till_newline(c); - /* somewhere a definition ends with '.TP' */ - if (!*c) - still_dd=1; - else { - c=scan_troff(c,1,NULL); - out_html("
      "); - } - curpos=0; - break; - case V('I','X'): - /* general index */ - sl = fill_words(c+j, wordlist, &words); - c=sl+1; - j=4; - while (idxlabel[j]=='Z') - idxlabel[j--]='A'; - idxlabel[j]++; -#ifdef MAKEINDEX - fprintf(idxfile, "%s@%s@", fname, idxlabel); - for (j=0; j' and '<' solves it, - ** but creates - ** some space. A normal space does not work. - */ - out_html("\">"); - break; - case V('L','P'): - case V('P','P'): - if (dl_set[itemdepth]) { - out_html("
      \n"); - dl_set[itemdepth]=0; - } - if (fillout) - out_html("

      \n"); - else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } - curpos=0; - c=skip_till_newline(c); - break; - case V('H','P'): - if (!dl_set[itemdepth]) { - out_html("

      "); - dl_set[itemdepth]=1; - } - out_html("
      \n"); - still_dd=1; - c=skip_till_newline(c); - curpos=0; - break; - case V('P','D'): - c=skip_till_newline(c); - break; - case V('R','s'): /* BSD mandoc */ - case V('R','S'): - sl=fill_words(c+j, wordlist, &words); - j=1; - if (words>0) - scan_expression(wordlist[0], &j); - if (j>=0) { - itemdepth++; - dl_set[itemdepth]=0; - out_html("
      "); - c=skip_till_newline(c); - curpos=0; - break; - } - case V('R','e'): /* BSD mandoc */ - case V('R','E'): - if (itemdepth > 0) { - if (dl_set[itemdepth]) - out_html("
      "); - out_html("
      \n"); - itemdepth--; - } - c=skip_till_newline(c); - curpos=0; - break; - case V('S','B'): - out_html(change_to_size(-1)); - out_html(change_to_font('B')); - c=scan_troff(c+j, 1, NULL); - out_html(change_to_font('R')); - out_html(change_to_size('0')); - break; - case V('S','M'): - c=c+j; - if (*c=='\n') - c++; - out_html(change_to_size(-1)); - trans_char(c,'"','\a'); - c=scan_troff(c,1,NULL); - out_html(change_to_size('0')); - break; - case V('S','s'): /* BSD mandoc */ - mandoc_command = 1; - case V('S','S'): - mode=1; - case V('S','h'): /* BSD mandoc */ - /* hack for fallthru from above */ - mandoc_command = !mode || mandoc_command; - case V('S','H'): - c=c+j; - if (*c=='\n') - c++; - while (itemdepth || dl_set[itemdepth]) { - out_html("\n"); - if (dl_set[itemdepth]) - dl_set[itemdepth]=0; - else if (itemdepth > 0) - itemdepth--; - } - out_html(change_to_font(0)); - out_html(change_to_size(0)); - if (!fillout) { - fillout=1; - out_html(""); - } - trans_char(c,'"', '\a'); - add_to_index(mode, c); - out_html(" \n

      "); - else - out_html("\"> \n

      "); - mandoc_synopsis = strncmp(c, "SYNOPSIS", 8) == 0; - c = mandoc_command ? - scan_troff_mandoc(c,1,NULL) : - scan_troff(c,1,NULL); - if (mode) - out_html("

      \n"); - else - out_html("\n"); - curpos=0; - break; - case V('T','S'): - c=scan_table(c); - break; - case V('D','t'): /* BSD mandoc */ - mandoc_command = 1; - case V('T','H'): - if (!output_possible) { - sl = fill_words(c+j, wordlist, &words); - if (words>1) { - for (i=1; i" - "Manpage of "); - out_html(wordlist[0]); - out_html("\n" - "\n

      "); - out_html(wordlist[0]); - out_html("

      \nSection: "); - if (words>4) - out_html(wordlist[4]); - else - out_html(section_name( - wordlist[1])); - out_html(" ("); - out_html(wordlist[1]); - if (words>2) { - out_html(")
      Updated: "); - scan_troff(wordlist[2], - 1, NULL); - } else out_html(")"); - - out_html("\n"); - printf("
      Index\n"); -#if 0 - out_html("
      Index\n"); -#endif - *sl='\n'; -#if 0 - fputs("
      Return to Main Contents\n", stdout); -#endif - out_html("
      \n"); - if (mandoc_command) - out_html("
      BSD mandoc
      "); - } - c=sl+1; - } else c=skip_till_newline(c); - curpos=0; - break; - case V('T','X'): - sl=fill_words(c+j, wordlist, &words); - *sl='\0'; - out_html(change_to_font('I')); - if (words>1) - wordlist[1][-1]='\0'; - c=lookup_abbrev(wordlist[0]); - curpos+=strlen(c); - out_html(c); - out_html(change_to_font('R')); - if (words>1) - out_html(wordlist[1]); - *sl='\n'; - c=sl+1; - break; - case V('r','m'): - /* .rm xx : Remove request, macro or string */ - case V('r','n'): - /* .rn xx yy : Rename request,macro or - ** string xx to yy - */ - { - STRDEF *de; - c=c+j; - i=V(c[0],c[1]); - c=c+2; - while (isspace((unsigned char)*c) && *c!='\n') - c++; - j=V(c[0],c[1]); - while (*c && *c!='\n') - c++; - c++; - de=strdef; - while (de && de->nr!=j) - de=de->next; - if (de) { - if (de->st) - free(de->st); - de->nr=0; - } - de=strdef; - while (de && de->nr!=i) - de=de->next; - if (de) - de->nr=j; - break; - } - case V('n','x'): - /* .nx filename : next file. */ - case V('i','n'): - /* .in +-N : Indent */ - c=skip_till_newline(c); - break; - case V('n','r'): - /* .nr R +-N M: define and set number register R by +-N; - ** auto-increment by M - */ - { - INTDEF *intd; - c=c+j; - i=V(c[0],c[1]); - c=c+2; - intd=intdef; - while (intd && intd->nr!=i) - intd=intd->next; - if (!intd) { - intd = (INTDEF*) malloc(sizeof(INTDEF)); - intd->nr=i; - intd->val=0; - intd->incr=0; - intd->next=intdef; - intdef=intd; - } - while (*c==' ' || *c=='\t') - c++; - c=scan_expression(c,&intd->val); - if (*c!='\n') { - while (*c==' ' || *c=='\t') - c++; - c=scan_expression(c,&intd->incr); - } - c=skip_till_newline(c); - break; - } - case V('a','m'): - /* .am xx yy : append to a macro. */ - /* define or handle as .ig yy */ - mode=1; - case V('d','e'): - /* .de xx yy : define or redefine macro xx; - ** end at .yy (..) */ - /* define or handle as .ig yy */ - { - STRDEF *de; - int olen=0; - - c=c+j; - sl=fill_words(c, wordlist, &words); - i=V(c[0],c[1]);j=2; - if (words==1) - wordlist[1]=".."; - else { - wordlist[1]--; - wordlist[1][0]='.'; - j=3; - } - c=sl+1; - sl=c; - while (*c && strncmp(c,wordlist[1],j)) - c=skip_till_newline(c); - de=defdef; - while (de && de->nr!= i) - de=de->next; - if (mode && de) - olen=strlen(de->st); - j=olen+c-sl; - h = stralloc(j*2+4); - if (h) { - for (j=0; jst[j]; - if (!j || h[j-1]!='\n') - h[j++]='\n'; - while (sl!=c) { - if (sl[0]=='\\' && sl[1]=='\\') { - h[j++]='\\'; sl++; - } else - h[j++]=*sl; - sl++; - } - h[j]='\0'; - if (de) { - if (de->st) - free(de->st); - de->st=h; - } else { - de = (STRDEF*) malloc(sizeof(STRDEF)); - de->nr=i; - de->next=defdef; - de->st=h; - defdef=de; - } - } - } - c=skip_till_newline(c); - break; - case V('B','l'): /* BSD mandoc */ - { - char list_options[NULL_TERMINATED(MED_STR_MAX)]; - char *nl = strchr(c,'\n'); - - c=c+j; - if (dl_set[itemdepth]) { /* These things can nest. */ - itemdepth++; - } - if (nl) { /* Parse list options */ - strlimitcpy(list_options,c,nl-c,MED_STR_MAX); - } - if (strstr(list_options, "-bullet")) { - /* HTML Unnumbered List */ - dl_set[itemdepth] = BL_BULLET_LIST; - out_html("
        \n"); - } - else if (strstr(list_options, "-enum")) { - /* HTML Ordered List */ - dl_set[itemdepth] = BL_ENUM_LIST; - out_html("
          \n"); - } - else { /* HTML Descriptive List */ - dl_set[itemdepth] = BL_DESC_LIST; - out_html("
          \n"); - } - if (fillout) - out_html("

          \n"); - else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } - curpos=0; - c=skip_till_newline(c); - break; - } - case V('E','l'): /* BSD mandoc */ - c=c+j; - if (dl_set[itemdepth] & BL_DESC_LIST) { - out_html("

          \n"); - } - else if (dl_set[itemdepth] & BL_BULLET_LIST) { - out_html("
      \n"); - } - else if (dl_set[itemdepth] & BL_ENUM_LIST) { - out_html("\n"); - } - dl_set[itemdepth]=0; - if (itemdepth > 0) - itemdepth--; - if (fillout) - out_html("

      \n"); - else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } - curpos=0; - c=skip_till_newline(c); - break; - case V('I','t'): /* BSD mandoc */ - c=c+j; - if (strncmp(c, "Xo", 2) == 0 && isspace((unsigned char)*(c+2))) { - c = skip_till_newline(c); - } - if (dl_set[itemdepth] & BL_DESC_LIST) { - out_html("

      "); - out_html(change_to_font('B')); - if (*c=='\n') { - /* Don't allow embedded comms after - ** a newline */ - c++; - c=scan_troff(c,1,NULL); - } - else { /* Do allow embedded comms on - ** the same line. */ - c=scan_troff_mandoc(c,1,NULL); - } - out_html(change_to_font('R')); - out_html(NEWLINE); - out_html("
      "); - } - else if (dl_set[itemdepth] & - (BL_BULLET_LIST | BL_ENUM_LIST)) { - out_html("
    • "); - c=scan_troff_mandoc(c,1,NULL); - out_html(NEWLINE); - } - if (fillout) - curpos++; - else curpos=0; - break; - case V('B','k'): /* BSD mandoc */ - case V('E','k'): /* BSD mandoc */ - case V('D','d'): /* BSD mandoc */ - case V('O','s'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - c=scan_troff_mandoc(c, 1, NULL); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('B','t'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - out_html(" is currently in beta test."); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('B','x'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - out_html("BSD "); - c=scan_troff_mandoc(c, 1, NULL); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('D','l'): /* BSD mandoc */ - c=c+j; - out_html(NEWLINE); - out_html("
      "); - out_html(change_to_font('L')); - if (*c=='\n') - c++; - c=scan_troff_mandoc(c, 1, NULL); - out_html(change_to_font('R')); - out_html("
      "); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('B','d'): /* BSD mandoc */ - { /* Seems like a kind of example/literal mode */ - char bd_options[NULL_TERMINATED(MED_STR_MAX)]; - char *nl = strchr(c,'\n'); - - c=c+j; - if (nl) { - strlimitcpy(bd_options,c,nl-c,MED_STR_MAX); - } - out_html(NEWLINE); - /* Remember options for terminating Bl */ - mandoc_bd_options = 0; - - if (strstr(bd_options, "-offset indent")) { - mandoc_bd_options |= BD_INDENT; - out_html("
      \n"); - } - if (strstr(bd_options, "-literal") - || strstr(bd_options, "-unfilled")) { - if (fillout) { - mandoc_bd_options |= BD_LITERAL; - out_html(change_to_font(0)); - out_html(change_to_size('0')); - out_html("
      \n");
      -				}
      -				curpos=0;
      -				fillout=0;
      -			}
      -			c=skip_till_newline(c);
      -			break;
      -		}
      -		case V('E','d'):	/* BSD mandoc */
      -			if (mandoc_bd_options & BD_LITERAL) {
      -				if (!fillout) {
      -					out_html(change_to_font(0));
      -					out_html(change_to_size('0'));
      -					out_html("
      \n"); - } - } - if (mandoc_bd_options & BD_INDENT) - out_html("
      \n"); - curpos=0; - fillout=1; - c=skip_till_newline(c); - break; - case V('B','e'): /* BSD mandoc */ - c=c+j; - if (fillout) - out_html("

      "); - else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } - curpos=0; - c=skip_till_newline(c); - break; - case V('X','r'): /* BSD mandoc */ - { - /* Translate xyz 1 to xyz(1) - * Allow for multiple spaces. - * Allow the section to be missing. - */ - char buff[NULL_TERMINATED(MED_STR_MAX)]; - char *bufptr; - - trans_char(c,'"','\a'); - bufptr = buff; - c = c+j; - if (*c == '\n') - c++; /* Skip spaces */ - while (isspace((unsigned char)*c) && *c != '\n') - c++; - while (isalnum((unsigned char)*c)) { /* Copy the xyz part */ - *bufptr = *c; - bufptr++; - if (bufptr >= buff + MED_STR_MAX) - break; - c++; - } - while (isspace((unsigned char)*c) && *c != '\n') - c++; /* Skip spaces */ - /* Convert the number if there is one */ - if (isdigit((unsigned char)*c)) { - *bufptr = '('; - bufptr++; - if (bufptr < buff + MED_STR_MAX) { - while (isalnum((unsigned char)*c)) { - *bufptr = *c; - bufptr++; - if (bufptr >= buff + - MED_STR_MAX) - break; - c++; - } - if (bufptr < buff + MED_STR_MAX) { - *bufptr = ')'; - bufptr++; - } - } - } - - while (*c != '\n') { /* Copy the remainder */ - if (!isspace((unsigned char)*c)) { - *bufptr = *c; - bufptr++; - if (bufptr >= buff + MED_STR_MAX) - break; - } - c++; - } - *bufptr = '\n'; - scan_troff_mandoc(buff, 1, NULL); - - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - } - break; - case V('F','l'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - out_html("-"); - if (*c!='\n') { - out_html(change_to_font('B')); - c=scan_troff_mandoc(c, 1, NULL); - out_html(change_to_font('R')); - } - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('P','a'): /* BSD mandoc */ - case V('P','f'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - c=scan_troff_mandoc(c, 1, NULL); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('P','p'): /* BSD mandoc */ - if (fillout) - out_html("

      \n"); - else { - out_html(NEWLINE); - NEWLINE[0]='\n'; - } - curpos=0; - c=skip_till_newline(c); - break; - case V('D','q'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - out_html("``"); - c=scan_troff_mandoc(c, 1, NULL); - out_html("''"); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('O','p'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - out_html(change_to_font('R')); - out_html("["); - c=scan_troff_mandoc(c, 1, NULL); - out_html(change_to_font('R')); - out_html("]"); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('O','o'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - out_html(change_to_font('R')); - out_html("["); - c=scan_troff_mandoc(c, 1, NULL); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('O','c'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - c=scan_troff_mandoc(c, 1, NULL); - out_html(change_to_font('R')); - out_html("]"); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('P','q'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - out_html("("); - c=scan_troff_mandoc(c, 1, NULL); - out_html(")"); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('Q','l'): /* BSD mandoc */ - { /* Single quote first word in the line */ - char *sp; - - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - sp = c; - do { /* Find first whitespace after the - * first word that isn't a mandoc macro - */ - while (*sp && isspace((unsigned char)*sp)) - sp++; - while (*sp && !isspace((unsigned char)*sp)) - sp++; - } while (*sp && isupper((unsigned char)*(sp-2)) && islower((unsigned char)*(sp-1))); - - /* Use a newline to mark the end of text to - * be quoted - */ - if (*sp) - *sp = '\n'; - out_html("`"); /* Quote the text */ - c=scan_troff_mandoc(c, 1, NULL); - out_html("'"); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - } - case V('S','q'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - out_html("`"); - c=scan_troff_mandoc(c, 1, NULL); - out_html("'"); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('A','r'): /* BSD mandoc */ - /* parse one line in italics */ - out_html(change_to_font('I')); - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') { /* An empty Ar means "file ..." */ - out_html("file ..."); - } - else { - c=scan_troff_mandoc(c, 1, NULL); - } - out_html(change_to_font('R')); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('A','d'): /* BSD mandoc */ - case V('E','m'): /* BSD mandoc */ - case V('V','a'): /* BSD mandoc */ - case V('X','c'): /* BSD mandoc */ - /* parse one line in italics */ - out_html(change_to_font('I')); - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - c=scan_troff_mandoc(c, 1, NULL); - out_html(change_to_font('R')); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('N','d'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - out_html(" - "); - c=scan_troff_mandoc(c, 1, NULL); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('N','m'): /* BSD mandoc */ - { - static char mandoc_name[NULL_TERMINATED(SMALL_STR_MAX)] = ""; - trans_char(c,'"','\a'); - c=c+j; - if (mandoc_synopsis) { - /* Break lines only in the Synopsis. - * The Synopsis section seems to be treated - * as a special case - Bummer! - */ - static int count = 0; - /* Don't break on the first Nm */ - if (count) { - out_html("
      "); - } - else { - char *end = strchr(c, '\n'); - /* Remember the name for later. */ if (end) { - strlimitcpy(mandoc_name, - c, end - c, - SMALL_STR_MAX); - } - } - count++; - } - out_html(change_to_font('B')); - while (*c == ' '|| *c == '\t') - c++; - if (*c == '\n') { - /* If Nm has no argument, - * use one from an earlier - * Nm command that did have one. - * Hope there aren't - * too many commands that do this. - */ - out_html(mandoc_name); - } else { - c=scan_troff_mandoc(c, 1, NULL); - } - out_html(change_to_font('R')); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - } - case V('C','d'): /* BSD mandoc */ - case V('C','m'): /* BSD mandoc */ - case V('I','c'): /* BSD mandoc */ - case V('M','s'): /* BSD mandoc */ - case V('O','r'): /* BSD mandoc */ - case V('S','y'): /* BSD mandoc */ - /* parse one line in bold */ - out_html(change_to_font('B')); - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - c=scan_troff_mandoc(c, 1, NULL); - out_html(change_to_font('R')); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('D','v'): /* BSD mandoc */ - case V('E','v'): /* BSD mandoc */ - case V('F','r'): /* BSD mandoc */ - case V('L','i'): /* BSD mandoc */ - case V('N','o'): /* BSD mandoc */ - case V('N','s'): /* BSD mandoc */ - case V('T','n'): /* BSD mandoc */ - case V('n','N'): /* BSD mandoc */ - trans_char(c,'"','\a'); - c=c+j; - if (*c=='\n') - c++; - out_html(change_to_font('B')); - c=scan_troff_mandoc(c, 1, NULL); - out_html(change_to_font('R')); - out_html(NEWLINE); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('%','A'): /* BSD mandoc biblio stuff */ - case V('%','D'): - case V('%','N'): - case V('%','O'): - case V('%','P'): - case V('%','Q'): - case V('%','V'): - c=c+j; - if (*c=='\n') - c++; - /* Don't allow embedded mandoc coms */ - c=scan_troff(c, 1, NULL); - if (fillout) - curpos++; - else - curpos=0; - break; - case V('%','B'): - case V('%','J'): - case V('%','R'): - case V('%','T'): - c=c+j; - out_html(change_to_font('I')); - if (*c=='\n') - c++; - /* Don't allow embedded mandoc coms */ - c=scan_troff(c, 1, NULL); - out_html(change_to_font('R')); - if (fillout) - curpos++; - else - curpos=0; - break; - default: - /* search macro database of self-defined macros */ - owndef = defdef; - while (owndef && owndef->nr!=i) - owndef=owndef->next; - if (owndef) { - char **oldargument; - int deflen; - int onff; - - sl=fill_words(c+j, wordlist, &words); - c=sl+1; - *sl='\0'; - for (i=1;ist); - for (i=0; - (owndef->st[deflen+2+i]=owndef->st[i]); - i++); - oldargument=argument; - argument=wordlist; - onff=newline_for_fun; - if (mandoc_command) { - scan_troff_mandoc(owndef->st+deflen+2, - 0, NULL); - } else { - scan_troff(owndef->st+deflen+2, 0, - NULL); - } - newline_for_fun=onff; - argument=oldargument; - for (i=0; i"); - curpos=0; - still_dd=0; - } - switch (*h) { - case '&': - intbuff[ibp++]='&'; - intbuff[ibp++]='a'; - intbuff[ibp++]='m'; - intbuff[ibp++]='p'; - intbuff[ibp++]=';'; - curpos++; - break; - case '<': - intbuff[ibp++]='&'; - intbuff[ibp++]='l'; - intbuff[ibp++]='t'; - intbuff[ibp++]=';'; - curpos++; - break; - case '>': - intbuff[ibp++]='&'; - intbuff[ibp++]='g'; - intbuff[ibp++]='t'; - intbuff[ibp++]=';'; - curpos++; - break; - case '"': - intbuff[ibp++]='&'; - intbuff[ibp++]='q'; - intbuff[ibp++]='u'; - intbuff[ibp++]='o'; - intbuff[ibp++]='t'; - intbuff[ibp++]=';'; - curpos++; - break; - case '\n': - if (h[-1]=='\n' && fillout) { - intbuff[ibp++]='<'; - intbuff[ibp++]='P'; - intbuff[ibp++]='>'; - } - if (contained_tab && fillout) { - intbuff[ibp++]='<'; - intbuff[ibp++]='B'; - intbuff[ibp++]='R'; - intbuff[ibp++]='>'; - } - contained_tab=0; - curpos=0; - usenbsp=0; - intbuff[ibp++]='\n'; - break; - case '\t': - { - int curtab=0; - contained_tab=1; - FLUSHIBP; - /* like a typewriter, not like TeX */ - tabstops[19]=curpos+1; - while (curtab480) { - FLUSHIBP; } - curpos++; - } - } else { - out_html(""); - while (curpos"); - } - } - } - break; - default: - if (*h==' ' && (h[-1]=='\n' || usenbsp)) { - FLUSHIBP; - if (!usenbsp && fillout) { - out_html("
      "); - curpos=0; - } - usenbsp=fillout; - if (usenbsp) - out_html(" "); - else - intbuff[ibp++]=' '; - } else if (*h>31 && *h<127) - intbuff[ibp++]=*h; - else if (((unsigned char)(*h))>127) { - intbuff[ibp++]='&'; - intbuff[ibp++]='#'; - intbuff[ibp++]='0'+((unsigned char)(*h))/100; - intbuff[ibp++]='0'+(((unsigned char)(*h))%100)/10; - intbuff[ibp++]='0'+((unsigned char)(*h))%10; - intbuff[ibp++]=';'; - } - curpos++; - break; - } - if (ibp > (MED_STR_MAX - 20)) - FLUSHIBP; - h++; - } - } - FLUSHIBP; - if (buffer) - buffer[buffpos]='\0'; - if (san && *h) - h++; - newline_for_fun=exnewline_for_fun; - if (result) { - *result = buffer; - buffer=exbuffer; - buffpos=exbuffpos; - buffmax=exbuffmax; - scaninbuff=exscaninbuff; - } - return h; -} - - -static char -*scan_troff_mandoc(char *c, int san, char **result) -{ - char *ret, *end = c; - int oldval = mandoc_line; - - mandoc_line = 1; - while (*end && *end != '\n') { - end++; - } - - if (end > c + 2 - && ispunct((unsigned char)*(end - 1)) - && isspace((unsigned char)*(end - 2)) && *(end - 2) != '\n') { - /* Don't format lonely punctuation E.g. in "xyz ," format - * the xyz and then append the comma removing the space. - */ - *(end - 2) = '\n'; - ret = scan_troff(c, san, result); - *(end - 2) = *(end - 1); - *(end - 1) = ' '; - } else { - ret = scan_troff(c, san, result); - } - mandoc_line = oldval; - return ret; -} - -int -main(int argc, char **argv) -{ - char *t=NULL; - int i; - char *buf; - char *h = '\0'; - STRDEF *stdf; - char *infile = NULL; - - /* see if they gave us a basename for the URL references */ - - for(i = 1; i < argc; i++) - { - if(!strcmp(argv[i], "-n")) - { - i++; - if(i >= argc) - return 1; - - URLbasename = strdup(argv[i]); - } - else if(argv[i][0] == '-') - return 2; - else - infile = argv[i]; - } - - if(!infile || !strcmp(infile, "-")) - infh = gzdopen(0, "r"); - else - { -#ifdef HAVE_LIBBZ2 - if (strstr(infile,".bz2")) - inbfh = bzopen(infile, "r"); - else -#endif - infh = gzopen(infile, "r"); -#ifdef HAVE_LIBBZ2 - if(!infh && !inbfh) -#else - if(!infh) -#endif - { - FILE *fh; - char cmdline[512], *ctmp, output[512]; - - /* Try searching for this as a man page name, instead */ - ctmp = strrchr(infile, '.'); - if(ctmp && (isdigit((unsigned char)*(ctmp+1)) || (*(ctmp+1) == 'n')) && *(ctmp+2) == '\0') - { - char section = *(ctmp+1); - - *ctmp = '\0'; - - snprintf(cmdline, sizeof(cmdline), "man -w %c %s", section, infile); - } - else - snprintf(cmdline, sizeof(cmdline), "man -w %s", infile); - - fh = popen(cmdline, "r"); - fgets(output, sizeof(output), fh); - pclose(fh); - - i = strlen(output) - 1; - while(isspace((unsigned char)output[i])) output[i--] = '\0'; - - if (output[0]) { -#ifdef HAVE_LIBBZ2 - if(strstr(output,".bz2")) - inbfh = bzopen(output, "r"); - else -#endif - infh = gzopen(output, "r"); - } - } - } -#ifdef HAVE_LIBBZ2 - if(!infh && !inbfh) -#else - if(!infh) -#endif - { - printf("Document not found\n" - "The document \"%s\" couldn't be found. It may have been removed from your system.\n" - "\n", infile); - - return 3; - } - - buf=read_man_page(); - if (!buf) { - t=strrchr(h,'.'); - if (t) - *t='\0'; - t=strrchr(h,'/'); - if (!t) - t=h; - else - t++; - printf("Bad manpage.\n" - "\n

      Bad manpage.

      \n" - "Sorry, unable to convert the manpage.\n" - "\n"); - exit(0); - } - fname=h; - - stdf=&standardchar[0]; - i=0; - while (stdf->nr) { - stdf->next=&standardchar[i]; - stdf=stdf->next; - i++; - } - chardef=&standardchar[0]; - stdf=&standardstring[0]; - i=0; - while (stdf->nr) { - stdf->next=&standardstring[i]; - stdf=stdf->next; - i++; - } - strdef=&standardstring[0]; - intdef=&standardint[0]; - i=0; - while (intdef->nr) { - intdef->next=&standardint[i]; - intdef=intdef->next; - i++; - } - intdef=&standardint[0]; - defdef=NULL; - scan_troff(buf+1,0,NULL); - while (itemdepth || dl_set[itemdepth]) { - out_html("\n"); - if (dl_set[itemdepth]) - dl_set[itemdepth]=0; - else if (itemdepth > 0) - itemdepth--; - } - out_html(change_to_font(0)); - out_html(change_to_size(0)); - if (!fillout) { - fillout=1; - out_html(""); - } - out_html(NEWLINE); - if (output_possible) { - /*   for mosaic users */ - fputs("
      \n 

      Index

      \n
      \n", - stdout); - manidx[mip]=0; - fputs(manidx,stdout); - if (subs) - fputs("
      \n", stdout); - fputs("\n", stdout); -/* print_sig(); */ - fputs("\n\n", stdout); - } else { - printf("Invalid Manpage\n" - "

      Invalid Manpage

      \n" - "You tried to retrieve an incorrect manpage.\n" - "The page does not contain a manpage header and will\n" - "not produce any output.\n" - "If the page is a formatted manpage, you might want to use\n" - "a different man2html (or cat2html) converter.\n"); - -/* print_sig(); */ - fputs("\n\n", stdout); - } - - if (buf) - free(buf); - - return 0; -} diff --git a/components/help/converters/gnome-man2html2/man2html.8 b/components/help/converters/gnome-man2html2/man2html.8 deleted file mode 100644 index 431e31994..000000000 --- a/components/help/converters/gnome-man2html2/man2html.8 +++ /dev/null @@ -1,259 +0,0 @@ -.\" man2html - UNIX Man Page to HTML translator -.TH man2html 8 "3 May 1996" "Michael Hamilton" "Linux" -.SH NAME -man2html \- UNIX Man Page to HTML translator -.SH SYNOPSIS -\fBman2html\fP [options] [pagespec] -.SH DESCRIPTION -\fBMan2html\fP is a UNIX Man Page to HTML translator that can be -used as a CGI interface for man page access via httpd daemons. - -This man2html is more formally called \fBVH-Man2html\fP - Richard -Verhoeven's Man2html modified and packaged by Michael Hamilton. - -.B Man2html -can be used to view man pages using your web browser. -.B Man2html -locates compressed or uncompressed man pages -anywhere in the normal man hierarchy. -It translates pages in both the man(7) and -.I mandoc -(BSD) macro styles. -It generates html directly from troff(1) and tbl(1) -macro source without the need for -tbl/troff/nroff (sorry eqn isn't supported). -It generates links to other man pages, C include files, include files, -and http references. -Supporting CGI scripts allow you to browse HTML whatis(1) -subject indexes and name-only indexes. -You can optionally add glimpse(1) -(a text indexing package) to do full text searches. -.PP -There are five ways of requesting pages: - -.TP -.I "\fBman2html" -Invoking \fBman2html\fP without parameters causes the starting page -to be presented. You can use the search-able index on the starting -page to enter requests corresponding to following requests. -.PP -.TP -.I "\fBman2html \ \fIpage_name\fP" -Invoking \fBman2html\fP with a \fIpage_name\fP" as a parameter will -cause it to search for pages that match the name. If more than one -page is located, HTML for selecting any of the pages will be generated. -If a single page is located, a redirect for full path name will -be generated - which effectively re-invokes man2html with the full -reference. -.PP -.TP -.I "\fBman2html \ \fIpage_name \ \fIsection_number\fP" -Similar to the above, but the required section is supplied to limit -the search. -.TP -.I "\fBman2html \-M \ \fP/\fIman_hierarchy_toplevel \ \fIpage_name \fP" -Similar to the above but the search is started in a particular -man page hierarchy, for example /usr/local/man. -.PP -.TP -.I "\fBman2html \ \fP/\fIfull_path_to_page_name\fB.\fIsection_number \fP" -The specified man page is translated. The page may optionally be -compressed with any of the compess utilities defined in /etc/man.config. -.SH BROWSING -To use these cgi scripts from a Web browser all you have to do is -point your web browser at -.nf - http://localhost/cgi-bin/man2html -.fi -You can either save this location as a bookmark or use an editor to -insert the following lines into an appropriate place in -a top level document. -.nf -

      Linux Manual Pages

      -.fi -The netscape-man(1) script allows you to enter man page requests at -the command line with the output presented in Netscape. If you are -already running netscape, the script will pass the request to the -existing browser. You can can use your shell to alias the name to -something shorter if you wish. - -.B Man2html -has been tested with netscape(1) version 2.0 (I recommend Helvetica -fonts) and with lynx(1) (lynx can't do tables). Output for a large -number of pages has been verified with weblint(1). -.B Man2html -has also been tested as a server to other UNIX hosts. -.SH INSTALLATION -For some of the indexes to work you must generate the necessary -databases. - -The manwhatis CGI script uses the /usr/man/whatis (see whatis(1)) file -to build a man page index. If this job has never been run (perhaps -because you turn your machine off at night when cron might be -scheduled to run it), you can build it by becoming the root user and -entering: -.nf - /usr/sbin/makewhatis /usr/man /usr/X11R6/man /usr/local/man -.fi -WARNING: makewhatis on my Caldera 1.0 takes about 30 minutes on my -486DX66. I have a modified version of makewhatis so that it does -exactly the same job in only 1.5 minutes. My modified version is now -available as part of man-1.4g.tar.gz: -.nf - ftp://sunsite.unc.edu/pub/Linux/system/Manual-pagers -.fi -To use the Glimpse full text searching, you will need to install -glimpse in /usr/bin. -The glimpse home ftp site is -.nf - ftp://ftp.cs.arizona.edu/glimpse/ -.fi -Redhat rpm users can get glimpse from -.nf - ftp://ftp.redhat.com/pub/non-free/glimpse-3.0-1.i386.rpm -.fi -N.B. glimpse is not freely redistributable for commercial use. -Having installed glimpse, -you will need to -build a glimpse index in /var/man2html. This doesn't take too long - -about 3 minutes on my 486DX2/66 16MB machine. As root do: -.nf - /usr/bin/glimpseindex -z -H /var/man2html /usr/man/man* /usr/X11R6/man/man* \ - /usr/local/man/man* /opt/man/man* - chmod ugo+r /var/man2html/.glimpse* -.fi -The -z option causes glimpse to apply any filters (for decompression etc) -specified in /var/man2html/.glimpse_filters. -This could be set up as a cron job in /etc/crontab, e.g. (the following -must be all on one line): -.nf - 21 04 * * 1 root /usr/bin/glimpseindex -H /var/man2html /usr/man/man* - /usr/X11R6/man/man* /usr/local/man/man* /opt/man/man* ; - chmod +r /var/man2html/.glimpse* -.fi -To serve man pages to remote hosts, all that is required is a httpd -daemon that sets the environment variable SERVER_NAME correctly. -The only problem you might have with this, is if your server machine -has dual-names. -.SH SECURITY - -I've modified Richard's man2html C code so that it checks all client -input parameters. It checks both for length and any characters that -need escaping. - -Man2html will only return man or mandoc files resident in the man -hierarchy defined in /etc/man.config. When it returns references to -any any other kinds of files, for example, include files, they will be -"file:" references on the CLIENT host, not on the server. - -The parameters to the decompression programs are checked for any -nasties. - -It is still possible for the contents of a man page to over-run -man2html's memory - so I guess a hacker might try to get you to -install a bogus man page in order to get man2html to do something -nasty. - -The scripts check their parameters for anything suspicious. - -The scripts and program write suspicious requests to stderr - so they -can be found in web server log files. -.SH FILES -.TP -/etc/man.config -Manpath and decompression configuration info from the man(1) config file. -.TP -/home/httpd/html/man.html -Top level document loaded by man2html. -.TP -/home/httpd/html/mansearch.html -Search page. -.TP -/home/httpd/html/mansearchhelp.html -help for the search page. -.TP -/home/httpd/cgi-bin/man2html -The C program that translates man and mandoc macros to HTML. -.TP -/home/httpd/cgi-bin/manwhatis -Builds name-subject section indexes from the UNIX man whatis files. -.TP -/home/httpd/cgi-bin/mansearch -Does glimpse searches. -.TP -/home/httpd/cgi-bin/mansec -Searches the man page to create name-only indexes. -.TP -/usr/bin/netscape-man -Front end for netscape. -.TP -/var/man2html -This directory holds a cache of indexes computed by manwhatis and mansec. -They are updated if the whatis files or man directories are updated. -The glimpse index is also expected to live here. -.TP -\.\.\./man/whatis -Used by the manwhatis script. -.SH ENVIRONMENT -.TP -.B SERVER_NAME -is used to obtain the server-name for redirects when a partial -man-page specification is translated to a complete man-page path. -.SH SEE ALSO -.IR man (1) , -.IR whatis (1) , -.IR apropos (1) , -.IR netscape-man (1) , -.IR netscape (1) , -.IR lynx (1) -.IR glimpse (1) , -.B http://www.actrix.gen.nz/users/michael/giveaways.html - -.SH DISTRIBUTION -This program (man2html.c) was written by Richard Verhoeven (NL:5482ZX35) -at the Eindhoven University of Technology. Email: rcb5@win.tue.nl - -Permission is granted to distribute, modify and use this program as long -as this comment is not removed or changed. - -My modifications, packaging and scripts are copyright (c) 1996 -Michael Hamilton (michael@actrix.gen.nz). All rights reserved. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in all -copies of this software. - -IN NO EVENT SHALL MICHAEL HAMILTON BE LIABLE TO ANY PARTY FOR DIRECT, -INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF -THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF MICHAEL -HAMILTON HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -MICHAEL HAMILTON SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND MICHAEL HAMILTON HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -.SH AUTHORS -VH-Man2html was was written by Richard Verhoeven (NL:5482ZX35) at -the Eindhoven University of Technology (Email: rcb5@win.tue.nl). The -original source is available from his web page at: - - http://wsinwp01.win.tue.nl:1234/maninfo.html - -BSD mandoc support, indexing scripts, Makefile, man pages, and other -packaging were added by Michael Hamilton (michael@actrix.gen.nz). - -Maintenance and enhancement requests for this version should be directed -to Michael Hamilton (michael@actrix.gen.nz). -.SH CREDITS -As well as Richard, thanks are due to the following people for providing feedback -and assistance: -Tim Bird , -Erick Branderhorst , -Michael De La Rue , -Christoph Lameter , -and -Rainer Scholz . - diff --git a/components/help/help-method.c b/components/help/help-method.c index b691d428b..1cdd7f6bf 100644 --- a/components/help/help-method.c +++ b/components/help/help-method.c @@ -211,13 +211,13 @@ convert_file_to_uri (HelpURI *help_uri, char *file) help_uri->file = file; mime_type = gnome_vfs_get_file_mime_type (file, NULL, FALSE); - if (g_strcasecmp (mime_type, "text/sgml") == 0) { + if (g_ascii_strcasecmp (mime_type, "text/sgml") == 0) { help_uri->type = SGML_FILE; - } else if (g_strcasecmp (mime_type, "text/xml") == 0) { + } else if (g_ascii_strcasecmp (mime_type, "text/xml") == 0) { help_uri->type = XML_FILE; - } else if (g_strcasecmp (mime_type, "text/html") == 0) { + } else if (g_ascii_strcasecmp (mime_type, "text/html") == 0) { help_uri->type = HTML_FILE; - } else if (g_strcasecmp (mime_type, "application/x-troff-man") == 0) { + } else if (g_ascii_strcasecmp (mime_type, "application/x-troff-man") == 0) { /* FIXME bugzilla.gnome.org 42402: * The check above used to check for a prefix * of "application/x-troff-man", but now we check for diff --git a/components/help/hyperbola-filefmt.c b/components/help/hyperbola-filefmt.c index f4ecf75eb..00129baa1 100644 --- a/components/help/hyperbola-filefmt.c +++ b/components/help/hyperbola-filefmt.c @@ -89,7 +89,7 @@ tree_node_destroy (gpointer key, gpointer data, gpointer user_data) static gint tree_key_compare (gconstpointer k1, gconstpointer k2) { - return g_strcasecmp (k1, k2); + return eel_strcoll (k1, k2); } HyperbolaDocTree * @@ -231,7 +231,7 @@ fmt_read_mapping (TreeInfo * ti, const char *srcfile) int regerr; char real_regbuf[LINE_MAX]; - if (aline[0] == '#' || isspace (aline[0])) + if (aline[0] == '#' || g_ascii_isspace (aline[0])) continue; g_strstrip (aline); @@ -994,7 +994,7 @@ fmt_scrollkeeper_parse_toc_section (HyperbolaDocTree * tree, char **ancestors, * Set the correct separator token. SGML requires ? but * the other use # */ - if (!g_strncasecmp ("help", base_uri, 4)) { + if (!g_ascii_strncasecmp ("help", base_uri, 4)) { separator[0] = '?'; } else { separator[0] = '#'; @@ -1013,7 +1013,7 @@ fmt_scrollkeeper_parse_toc_section (HyperbolaDocTree * tree, char **ancestors, if (go_deeper > 0) { for (pos = 1, next_child = next_child->next; next_child != NULL; next_child = next_child->next) { - if (!g_strncasecmp (next_child->name, "tocsect", 7)) { + if (!g_ascii_strncasecmp (next_child->name, "tocsect", 7)) { fmt_scrollkeeper_parse_toc_section (tree, section, next_child, @@ -1089,7 +1089,7 @@ fmt_scrollkeeper_parse_doc_toc (HyperbolaDocTree * tree, char **ancestors, /* Process the top-level tocsect nodes in the file */ for (pos = 1, next_child = toc_doc->children->children; next_child != NULL; next_child = next_child->next) { - if (!g_strncasecmp (next_child->name, "tocsect", 7)) { + if (!g_ascii_strncasecmp (next_child->name, "tocsect", 7)) { fmt_scrollkeeper_parse_toc_section (tree, ancestors, next_child, base_uri, pos, @@ -1147,11 +1147,11 @@ fmt_scrollkeeper_parse_document (HyperbolaDocTree * tree, char **ancestors, /* Obtain info about the document from the XML node describing it */ for (; next_child != NULL; next_child = next_child->next) { - if (!g_strcasecmp (next_child->name, "doctitle")) { + if (!g_ascii_strcasecmp (next_child->name, "doctitle")) { doc_data[0] = xmlNodeGetContent (next_child->children); - } else if (!g_strcasecmp (next_child->name, "docsource")) { + } else if (!g_ascii_strcasecmp (next_child->name, "docsource")) { doc_data[1] = xmlNodeGetContent (next_child->children); - } else if (!g_strcasecmp (next_child->name, "docformat")) { + } else if (!g_ascii_strcasecmp (next_child->name, "docformat")) { doc_data[2] = xmlNodeGetContent (next_child->children); } } @@ -1163,13 +1163,13 @@ fmt_scrollkeeper_parse_document (HyperbolaDocTree * tree, char **ancestors, /* Decide on the appropriate prefix */ - if (!g_strcasecmp ("text/html", doc_data[2])) { + if (!g_ascii_strcasecmp ("text/html", doc_data[2])) { doc_uri = g_strconcat ("file://", doc_data[1], NULL); - } else if (!g_strcasecmp ("text/sgml", doc_data[2])) { + } else if (!g_ascii_strcasecmp ("text/sgml", doc_data[2])) { doc_uri = g_strconcat ("gnome-help:", doc_data[1], NULL); - } else if (!g_strcasecmp ("info", doc_data[2])) { + } else if (!g_ascii_strcasecmp ("info", doc_data[2])) { doc_uri = g_strconcat ("info:", doc_data[1], NULL); - } else if (!g_strcasecmp ("applications/x-troff", doc_data[2])) { + } else if (!g_ascii_strcasecmp ("applications/x-troff", doc_data[2])) { /* Man Pages */ doc_uri = g_strconcat ("man:", doc_data[1], NULL); } else { @@ -1280,10 +1280,10 @@ fmt_scrollkeeper_parse_section (HyperbolaDocTree * tree, char **ancestors, for (; next_child->next != NULL; next_child = next_child->next) { - if (!g_strcasecmp (next_child->next->name, "sect")) { + if (!g_ascii_strcasecmp (next_child->next->name, "sect")) { fmt_scrollkeeper_parse_section (tree, section, next_child->next); - } else if (!g_strcasecmp (next_child->next->name, "doc")) { + } else if (!g_ascii_strcasecmp (next_child->next->name, "doc")) { fmt_scrollkeeper_parse_document (tree, section, next_child->next); } @@ -1313,14 +1313,14 @@ fmt_scrollkeeper_parse_xml (HyperbolaDocTree * tree, char **defpath, /* Ensure the document is valid and a real ScrollKeeper document */ if (!doc->children || !doc->children->name || - g_strcasecmp (doc->children->name, "ScrollKeeperContentsList")) { + g_ascii_strcasecmp (doc->children->name, "ScrollKeeperContentsList")) { g_warning ("Invalid ScrollKeeper XML Contents List!"); return; } /* Start parsing the list and add to the tree */ for (node = doc->children->children; node != NULL; node = node->next) { - if (!g_strcasecmp (node->name, "sect")) + if (!g_ascii_strcasecmp (node->name, "sect")) fmt_scrollkeeper_parse_section (tree, defpath, node); } } diff --git a/components/help/hyperbola-nav-index.c b/components/help/hyperbola-nav-index.c index 5e452e235..41f0ef0e7 100644 --- a/components/help/hyperbola-nav-index.c +++ b/components/help/hyperbola-nav-index.c @@ -315,8 +315,8 @@ text_matches (const char *text, const char *check_for) check_len = strlen (check_for); while (*ctmp) { - if (tolower (*ctmp) == tolower (*check_for)) { - if (!strncasecmp (ctmp, check_for, check_len)) + if (g_ascii_tolower (*ctmp) == g_ascii_tolower (*check_for)) { + if (!g_ascii_strncasecmp (ctmp, check_for, check_len)) return TRUE; } @@ -954,7 +954,7 @@ despace (GString * s) g_assert (s->len == (int) strlen (s->str)); for (ctmp = s->str, i = s->len; *ctmp; ctmp++, i--) { - if (isspace (*ctmp)) { + if (g_ascii_isspace (*ctmp)) { if (*ctmp != ' ') *ctmp = ' '; if (!ctmp_s) @@ -990,11 +990,11 @@ get_entity (SAXParseInfo * spi, const gchar * name) static void start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) { - if (!g_strcasecmp (name, "indexterm")) { + if (!g_ascii_strcasecmp (name, "indexterm")) { int i; for (i = 0; attrs[i]; i++) { - if (!g_strcasecmp (attrs[i], "id")) { + if (!g_ascii_strcasecmp (attrs[i], "id")) { i++; break; } @@ -1014,13 +1014,13 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) if (!spi->in_term || spi->sub_type != NONE) return; - if (!g_strcasecmp (name, "primary")) { + if (!g_ascii_strcasecmp (name, "primary")) { spi->sub_type = PRIMARY; - } else if (!g_strcasecmp (name, "secondary")) { + } else if (!g_ascii_strcasecmp (name, "secondary")) { spi->sub_type = SECONDARY; - } else if (!g_strcasecmp (name, "seealso")) { + } else if (!g_ascii_strcasecmp (name, "seealso")) { spi->sub_type = SEEALSO; - } else if (!g_strcasecmp (name, "see")) { + } else if (!g_ascii_strcasecmp (name, "see")) { spi->sub_type = SEE; } else spi->sub_type = NONE; @@ -1034,7 +1034,7 @@ end_element (SAXParseInfo * spi, const gchar * name) { int this_type; - if (!g_strcasecmp (name, "indexterm")) { + if (!g_ascii_strcasecmp (name, "indexterm")) { int i; IndexItem *parent_ii = NULL, *ii = NULL; ItemType it; @@ -1068,7 +1068,7 @@ end_element (SAXParseInfo * spi, const gchar * name) if (!parent_ii->subitems) parent_ii->subitems = g_tree_new ((GCompareFunc) - g_strcasecmp); + eel_strcoll); parent_tree = parent_ii->subitems; if (spi->stinfo[SECONDARY]) @@ -1098,7 +1098,7 @@ end_element (SAXParseInfo * spi, const gchar * name) if (!ii->subitems) ii->subitems = g_tree_new ((GCompareFunc) - g_strcasecmp); + eel_strcoll); parent_ii = ii; parent_tree = parent_ii->subitems; @@ -1179,13 +1179,13 @@ end_element (SAXParseInfo * spi, const gchar * name) if (!spi->in_term || spi->sub_type == NONE) return; - if (!g_strcasecmp (name, "primary")) { + if (!g_ascii_strcasecmp (name, "primary")) { this_type = PRIMARY; - } else if (!g_strcasecmp (name, "secondary")) { + } else if (!g_ascii_strcasecmp (name, "secondary")) { this_type = SECONDARY; - } else if (!g_strcasecmp (name, "seealso")) { + } else if (!g_ascii_strcasecmp (name, "seealso")) { this_type = SEEALSO; - } else if (!g_strcasecmp (name, "see")) { + } else if (!g_ascii_strcasecmp (name, "see")) { this_type = SEE; } else this_type = NONE; @@ -1212,7 +1212,7 @@ end_element (SAXParseInfo * spi, const gchar * name) static void start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) { - if (!g_strcasecmp (name, "indexitem") && + if (!g_ascii_strcasecmp (name, "indexitem") && spi->sub_type==NONE) { int i; for (i = PRIMARY; i < NONE; i++){ @@ -1225,7 +1225,7 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) return; } - if (!g_strcasecmp (name, "indexitem") && + if (!g_ascii_strcasecmp (name, "indexitem") && spi->sub_type==PRIMARY) { process_index_term (spi, PRIMARY); spi->sub_type = SECONDARY; @@ -1233,7 +1233,7 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) return; } - if (!g_strcasecmp (name, "indexitem") && + if (!g_ascii_strcasecmp (name, "indexitem") && spi->sub_type==SECONDARY) { if(spi->in_indexitem > 1){ process_index_term (spi, SECONDARY); @@ -1243,7 +1243,7 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) return; } - if (!g_strcasecmp (name, "indexitem") && + if (!g_ascii_strcasecmp (name, "indexitem") && spi->sub_type==TERTIARY) { if(spi->in_indexitem < 2) spi->sub_type = SECONDARY; @@ -1251,17 +1251,17 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) return; } - if (!g_strcasecmp (name, "title")){ + if (!g_ascii_strcasecmp (name, "title")){ spi->in_term++; g_string_assign (spi->sub_text, ""); return; } - if (!g_strcasecmp (name, "link")) { + if (!g_ascii_strcasecmp (name, "link")) { int i, j; for (i = 0; attrs[i]; i++) { - if (!g_strcasecmp (attrs[i], "linkid")){ + if (!g_ascii_strcasecmp (attrs[i], "linkid")){ i++; break; } @@ -1271,7 +1271,7 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) g_strdup(attrs[i])); for(j=i+1; attrs[j]; j++){ - if (!g_strcasecmp (attrs[j], "indexid")){ + if (!g_ascii_strcasecmp (attrs[j], "indexid")){ j++; break; } @@ -1282,10 +1282,10 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) return; } - if (!g_strcasecmp (name, "see")) { + if (!g_ascii_strcasecmp (name, "see")) { int i; for (i = 0; attrs[i]; i++) { - if (!g_strcasecmp (attrs[i], "indexid")){ + if (!g_ascii_strcasecmp (attrs[i], "indexid")){ i++; break; } @@ -1298,10 +1298,10 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) } - if (!g_strcasecmp (name, "seealso")) { + if (!g_ascii_strcasecmp (name, "seealso")) { int i; for (i = 0; attrs[i]; i++) { - if (!g_strcasecmp (attrs[i], "indexid")){ + if (!g_ascii_strcasecmp (attrs[i], "indexid")){ i++; break; } @@ -1314,7 +1314,7 @@ start_element (SAXParseInfo * spi, const gchar * name, const xmlChar ** attrs) } - if (!g_strcasecmp (name, "indexdoc")){ + if (!g_ascii_strcasecmp (name, "indexdoc")){ spi->sub_type = NONE; return; } @@ -1341,7 +1341,7 @@ process_index_term(SAXParseInfo *spi, ItemType it) if (!parent_ii->subitems) parent_ii->subitems = g_tree_new((GCompareFunc) - g_strcasecmp); + eel_strcoll); spi->parent_tree = parent_ii->subitems; } ii = @@ -1374,7 +1374,7 @@ process_index_term(SAXParseInfo *spi, ItemType it) if (!ii->duplicates) ii->duplicates = g_tree_new ((GCompareFunc) - g_strcasecmp); + eel_strcoll); duplicate_ii = g_tree_lookup (ii->duplicates, @@ -1399,7 +1399,7 @@ process_index_term(SAXParseInfo *spi, ItemType it) if (!ii->subitems) ii->subitems = g_tree_new((GCompareFunc) - g_strcasecmp); + eel_strcoll); spi->parent_tree = ii->subitems; } @@ -1408,7 +1408,7 @@ process_index_term(SAXParseInfo *spi, ItemType it) if (!ii->ref_subitems) ii->ref_subitems = g_tree_new ((GCompareFunc) - g_strcasecmp); + eel_strcoll); parent_tree = ii->ref_subitems; buf = g_strdup_printf ("%s%s%s", _("(see: "), spi->stinfo[SEE], ")"); @@ -1428,7 +1428,7 @@ process_index_term(SAXParseInfo *spi, ItemType it) if (!ii->ref_subitems) ii->ref_subitems = g_tree_new ((GCompareFunc) - g_strcasecmp); + eel_strcoll); parent_tree = ii->ref_subitems; buf = g_strdup_printf ("%s%s%s", _("(see also: "), spi->stinfo[SEEALSO], ")"); @@ -1463,7 +1463,7 @@ end_element (SAXParseInfo * spi, const gchar * name) int this_type;/*, i;*/ ItemType it; - if (!g_strcasecmp (name, "indexitem")) { + if (!g_ascii_strcasecmp (name, "indexitem")) { spi->in_indexitem--; it = spi->sub_type; @@ -1483,7 +1483,7 @@ end_element (SAXParseInfo * spi, const gchar * name) } - if (!g_strcasecmp (name, "indexdoc")){ + if (!g_ascii_strcasecmp (name, "indexdoc")){ spi->sub_type = NONE; return; } @@ -1491,16 +1491,16 @@ end_element (SAXParseInfo * spi, const gchar * name) if (spi->sub_type == NONE) return; - if (!g_strcasecmp(name, "link")){ + if (!g_ascii_strcasecmp(name, "link")){ this_type = spi->sub_type; return; - } else if (!g_strcasecmp (name, "title")) { + } else if (!g_ascii_strcasecmp (name, "title")) { this_type=spi->sub_type; spi->in_term--; - } else if (!g_strcasecmp (name, "seealso")) { + } else if (!g_ascii_strcasecmp (name, "seealso")) { this_type = SEEALSO; spi->in_term--; - } else if (!g_strcasecmp (name, "see")) { + } else if (!g_ascii_strcasecmp (name, "see")) { this_type = SEE; spi->in_term--; } else @@ -1738,7 +1738,7 @@ hyperbola_navigation_index_new (void) char *dir; hni = g_new0 (HyperbolaNavigationIndex, 1); - hni->all_items = g_tree_new ((GCompareFunc) g_strcasecmp); + hni->all_items = g_tree_new ((GCompareFunc) eel_strcoll); dir = gnome_datadir_file ("gnome/help"); if (!dir) @@ -1840,7 +1840,7 @@ hyperbola_navigation_index_parse_index_files (HyperbolaNavigationIndex *hni, memset (&spi, 0, sizeof (spi)); spi.idx = hni; - spi.index_items = g_tree_new ((GCompareFunc) g_strcasecmp); + spi.index_items = g_tree_new ((GCompareFunc) eel_strcoll); switch(index_type){ case ALL_INDEX_FILES: @@ -1861,7 +1861,7 @@ hyperbola_navigation_index_parse_index_files (HyperbolaNavigationIndex *hni, spi.doc_uri = g_strdup((char *)tmp->data); /* Set the correct separator token. SGML requires ? but * the other use # */ - if (!g_strncasecmp ("help", spi.doc_uri, 4)) { + if (!g_ascii_strncasecmp ("help", spi.doc_uri, 4)) { spi.separator = "?"; } else { spi.separator = "#"; @@ -2696,9 +2696,9 @@ GtkWidget * make_index_page (HyperbolaNavigationIndex *hni) { GtkWidget *vbox; - hni->all_index_items = g_tree_new ((GCompareFunc) g_strcasecmp); - hni->index_selected_index_items = g_tree_new ((GCompareFunc) g_strcasecmp); - hni->contents_selected_index_items = g_tree_new ((GCompareFunc) g_strcasecmp); + hni->all_index_items = g_tree_new ((GCompareFunc) eel_strcoll); + hni->index_selected_index_items = g_tree_new ((GCompareFunc) eel_strcoll); + hni->contents_selected_index_items = g_tree_new ((GCompareFunc) eel_strcoll); hni->index_selected_index_files = g_hash_table_new(g_str_hash, g_str_equal); hni->contents_selected_index_files = g_hash_table_new(g_str_hash, g_str_equal); diff --git a/components/loser/content/nautilus-content-loser.c b/components/loser/content/nautilus-content-loser.c index f56d9c315..9f1620fe0 100644 --- a/components/loser/content/nautilus-content-loser.c +++ b/components/loser/content/nautilus-content-loser.c @@ -236,7 +236,7 @@ nautilus_content_loser_maybe_fail (const char *location) { ensure_fail_env (); - if (strcasecmp (location, failure_point) == 0) { + if (g_ascii_strcasecmp (location, failure_point) == 0) { nautilus_content_loser_fail (); } } @@ -248,14 +248,14 @@ nautilus_content_loser_fail (void) { ensure_fail_env (); - if (strcasecmp (failure_mode, "hang") == 0) { + if (g_ascii_strcasecmp (failure_mode, "hang") == 0) { while (1) { } - } else if (strcasecmp (failure_mode, "exit") == 0) { + } else if (g_ascii_strcasecmp (failure_mode, "exit") == 0) { exit (0); - } else if (strcasecmp (failure_mode, "error-exit") == 0) { + } else if (g_ascii_strcasecmp (failure_mode, "error-exit") == 0) { exit (-1); - } else if (strcasecmp (failure_mode, "crash") == 0) { + } else if (g_ascii_strcasecmp (failure_mode, "crash") == 0) { abort (); } else { puts ("XXX - would fail now, if NAUTILUS_CONTENT_LOSER_MODE were set properly."); diff --git a/components/loser/sidebar/nautilus-sidebar-loser.c b/components/loser/sidebar/nautilus-sidebar-loser.c index 10b95a056..ef99cc7a5 100644 --- a/components/loser/sidebar/nautilus-sidebar-loser.c +++ b/components/loser/sidebar/nautilus-sidebar-loser.c @@ -239,7 +239,7 @@ nautilus_sidebar_loser_maybe_fail (const char *location) { ensure_fail_env (); - if (strcasecmp (location, failure_point) == 0) { + if (g_ascii_strcasecmp (location, failure_point) == 0) { nautilus_sidebar_loser_fail (); } } @@ -251,14 +251,14 @@ nautilus_sidebar_loser_fail (void) { ensure_fail_env (); - if (strcasecmp (failure_mode, "hang") == 0) { + if (g_ascii_strcasecmp (failure_mode, "hang") == 0) { while (1) { } - } else if (strcasecmp (failure_mode, "exit") == 0) { + } else if (g_ascii_strcasecmp (failure_mode, "exit") == 0) { exit (0); - } else if (strcasecmp (failure_mode, "error-exit") == 0) { + } else if (g_ascii_strcasecmp (failure_mode, "error-exit") == 0) { exit (-1); - } else if (strcasecmp (failure_mode, "crash") == 0) { + } else if (g_ascii_strcasecmp (failure_mode, "crash") == 0) { abort (); } else { puts ("XXX - would fail now, if NAUTILUS_SIDEBAR_LOSER_MODE were set properly."); diff --git a/components/mozilla/nautilus-mozilla-content-view.c b/components/mozilla/nautilus-mozilla-content-view.c index 45eb75ed4..ae1c6305b 100644 --- a/components/mozilla/nautilus-mozilla-content-view.c +++ b/components/mozilla/nautilus-mozilla-content-view.c @@ -493,7 +493,7 @@ try_transform_nautilus_uri_to_file_scheme (const char *uri) GnomeVFSURI *vfs_uri; char *real_uri; - if (strncasecmp ("file:///", uri, strlen ("file:///")) == 0) { + if (g_ascii_strncasecmp ("file:///", uri, strlen ("file:///")) == 0) { return NULL; } @@ -1891,7 +1891,7 @@ string_list_get_index_of_string (const char *string_list[], guint num_strings, c for (i = 0; i < num_strings; i++) { g_assert (string_list[i] != NULL); if (strlen (string) >= strlen (string_list[i]) - && (strncasecmp (string, string_list[i], strlen (string_list[i])) == 0)) { + && (g_ascii_strncasecmp (string, string_list[i], strlen (string_list[i])) == 0)) { return i; } } diff --git a/components/mozilla/nautilus-mozilla-encoding-tables.c b/components/mozilla/nautilus-mozilla-encoding-tables.c index 44d312a13..5cf9a5e3e 100644 --- a/components/mozilla/nautilus-mozilla-encoding-tables.c +++ b/components/mozilla/nautilus-mozilla-encoding-tables.c @@ -155,7 +155,7 @@ mozilla_encoding_groups_table_find_translated (const char *encoding_group) g_return_val_if_fail (strlen (encoding_group) > 0, NULL); for (i = 0; i < mozilla_encoding_groups_table_get_count (); i++) { - if (g_strcasecmp (encoding_group, mozilla_encoding_groups_table_peek_nth (i)) == 0) { + if (g_ascii_strcasecmp (encoding_group, mozilla_encoding_groups_table_peek_nth (i)) == 0) { return mozilla_encoding_groups_table_peek_nth_translated (i); } } @@ -194,7 +194,7 @@ mozilla_encoding_table_find_translated (const char *encoding) g_return_val_if_fail (strlen (encoding) > 0, NULL); for (i = 0; i < mozilla_encoding_table_get_count (); i++) { - if (g_strcasecmp (encoding, mozilla_encoding_table_peek_nth (i)) == 0) { + if (g_ascii_strcasecmp (encoding, mozilla_encoding_table_peek_nth (i)) == 0) { return mozilla_encoding_table_peek_nth_translated (i); } } diff --git a/components/music/fileinfo.c b/components/music/fileinfo.c index 5ef44a4b5..d4e0906ea 100644 --- a/components/music/fileinfo.c +++ b/components/music/fileinfo.c @@ -74,7 +74,7 @@ static gint find_genre_id(gchar * text) static gint genre_comp_func(gconstpointer a, gconstpointer b) { - return strcasecmp(a, b); + return eel_strcoll(a, b); } static void save_cb(GtkWidget * w, gpointer data) @@ -82,7 +82,7 @@ static void save_cb(GtkWidget * w, gpointer data) gint fd; struct id3v1tag_t tag; - if (!strncasecmp(current_filename, "http://", 7)) + if (!g_ascii_strncasecmp(current_filename, "http://", 7)) return; if ((fd = open(current_filename, O_RDWR)) != -1) @@ -132,7 +132,7 @@ static void remove_id3_cb(GtkWidget * w, gpointer data) gint fd, len; struct id3v1tag_t tag; - if (!strncasecmp(current_filename, "http://", 7)) + if (!g_ascii_strncasecmp(current_filename, "http://", 7)) return; if ((fd = open(current_filename, O_RDWR)) != -1) @@ -385,7 +385,7 @@ void mpg123_file_info_box(char *filename) gtk_label_set_text(GTK_LABEL(mpeg_flags), ""); gtk_label_set_text(GTK_LABEL(mpeg_fileinfo), ""); - if (!strncasecmp(filename, "http://", 7)) + if (!g_ascii_strncasecmp(filename, "http://", 7)) { file_info_http(filename); return; diff --git a/components/music/nautilus-music-view.c b/components/music/nautilus-music-view.c index ee78b9f67..a757092a3 100644 --- a/components/music/nautilus-music-view.c +++ b/components/music/nautilus-music-view.c @@ -973,7 +973,7 @@ extract_number(const char *name_str) found_digit = FALSE; accumulator = 0; - if (isdigit (*name_str)) { + if (g_ascii_isdigit (*name_str)) { temp_str = name_str; } else if (strchr(name_str, '(') != NULL) { temp_str = strchr(name_str, '(') + 1; @@ -981,7 +981,7 @@ extract_number(const char *name_str) return -1; } - while (isdigit (*temp_str)) { + while (g_ascii_isdigit (*temp_str)) { found_digit = TRUE; accumulator = (10 * accumulator) + *temp_str - 48; temp_str += 1; diff --git a/configure.in b/configure.in index c90a41413..9d80446ca 100644 --- a/configure.in +++ b/configure.in @@ -82,11 +82,11 @@ dnl ========================================================================== ALL_LINGUAS="az ca cs da de el en_GB es fi fr ga gl hu it ja ko lt lv nl nn no pl pt pt_BR ro ru sk sl sv ta tr uk zh_TW" -AM_GNOME2_GETTEXT -# AM_GNOME2_GETTEXT above substs $DATADIRNAME -# this is the directory where the *.{mo,gmo} files are installed -gnomelocaledir='${prefix}/${DATADIRNAME}/locale' -AC_SUBST(gnomelocaledir) +GETTEXT_PACKAGE=nautilus +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE") + +AM_GLIB_GNU_GETTEXT AC_PROG_INTLTOOL @@ -709,8 +709,4 @@ case "X$ENABLE_PROFILER" in ;; esac -dnl <= Snapshot things => - -echo "NAUTILUS_SOURCE_DIRECTORY : $NAUTILUS_SOURCE_DIRECTORY" - dnl <= End of configuration summary => diff --git a/libnautilus-private/nautilus-desktop-file-loader.c b/libnautilus-private/nautilus-desktop-file-loader.c index 2100e8fc4..346de05b9 100644 --- a/libnautilus-private/nautilus-desktop-file-loader.c +++ b/libnautilus-private/nautilus-desktop-file-loader.c @@ -352,17 +352,17 @@ key_equal (gconstpointer v1, * and don't count leading/trailing spaces */ - while (isspace ((guchar)*p1)) { + while (g_ascii_isspace (*p1)) { ++p1; } - while (isspace ((guchar)*p2)) { + while (g_ascii_isspace (*p2)) { ++p2; } while (*p1 && *p2 && *p1 != '=' && *p2 != '=' && - !isspace ((guchar)*p1) && !isspace ((guchar)*p2)) { + !g_ascii_isspace (*p1) && !g_ascii_isspace (*p2)) { if (*p1 != *p2) { return FALSE; } @@ -371,11 +371,11 @@ key_equal (gconstpointer v1, ++p2; } - if (*p1 && *p1 != '=' && !isspace ((guchar)*p1)) { + if (*p1 && *p1 != '=' && !g_ascii_isspace (*p1)) { return FALSE; } - if (*p2 && *p2 != '=' && !isspace ((guchar)*p2)) { + if (*p2 && *p2 != '=' && !g_ascii_isspace (*p2)) { return FALSE; } @@ -392,12 +392,12 @@ key_hash (gconstpointer key) * and don't count leading/trailing spaces */ - while (isspace ((guchar)*p)) { + while (g_ascii_isspace (*p)) { ++p; } if (h) { - for (p += 1; *p != '\0' && *p != '=' && !isspace ((guchar)*p); p++) { + for (p += 1; *p != '\0' && *p != '=' && !g_ascii_isspace (*p); p++) { h = (h << 5) - h + *p; } } @@ -470,7 +470,7 @@ hash_lines (NautilusDesktopFile *df) while (iter != NULL && *iter != NULL) { p = *iter; - while (isspace ((guchar)*p)) { + while (g_ascii_isspace (*p)) { ++p; } @@ -507,7 +507,7 @@ hash_lines (NautilusDesktopFile *df) } else { if (current_sect) { ++eq; - while (isspace ((guchar)*eq)) { + while (g_ascii_isspace (*eq)) { ++eq; } /* could overwrite an earlier copy of @@ -644,7 +644,7 @@ key_foreach (gpointer key, gpointer value, gpointer data) key_end = (char*) key; while (*key_end && - !isspace ((guchar)*key_end) && + !g_ascii_isspace (*key_end) && *key_end != '=') { ++key_end; } diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c index f1a007cbb..45d6d6e80 100644 --- a/libnautilus-private/nautilus-file.c +++ b/libnautilus-private/nautilus-file.c @@ -5109,7 +5109,7 @@ nautilus_extract_top_left_text (const char *text, if (*in == '\n') { break; } - if (isprint ((guchar) *in)) { + if (g_ascii_isprint (*in)) { *out++ = *in; i++; } diff --git a/libnautilus-private/nautilus-find-icon-image.c b/libnautilus-private/nautilus-find-icon-image.c index 523d29a6e..071c15904 100644 --- a/libnautilus-private/nautilus-find-icon-image.c +++ b/libnautilus-private/nautilus-find-icon-image.c @@ -201,7 +201,7 @@ get_themed_icon_file_path (const NautilusIconTheme *icon_theme, /* Try each suffix. */ for (i = 0; i < G_N_ELEMENTS (icon_file_name_suffixes); i++) { - if (include_size && g_strcasecmp (icon_file_name_suffixes[i], ".svg") != 0) { + if (include_size && g_ascii_strcasecmp (icon_file_name_suffixes[i], ".svg") != 0) { /* Build a path for this icon. */ partial_path = g_strdup_printf ("%s-%u", themed_icon_name, diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index 022ac10d1..75f2a392b 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -2171,10 +2171,10 @@ match_best_name (NautilusIconContainer *container, } /* Require the match pattern to already be lowercase. */ - g_assert (((char) tolower ((guchar) match_state->name[match_length])) + g_assert (g_ascii_tolower (match_state->name[match_length]) == match_state->name[match_length]); - if (((char) tolower ((guchar) name[match_length])) + if (g_ascii_tolower (name[match_length]) != match_state->name[match_length]) { break; } @@ -2208,7 +2208,7 @@ select_matching_name (NautilusIconContainer *container, for (index = 0; ; index++) { if (match_state.name[index] == '\0') break; - match_state.name[index] = tolower ((guchar) match_state.name[index]); + match_state.name[index] = g_ascii_tolower (match_state.name[index]); } icon = find_best_icon (container, @@ -2899,7 +2899,7 @@ handle_typeahead (NautilusIconContainer *container, const char *key_string) /* only handle if printable keys typed */ for (index = 0; index < key_string_length; index++) { - if (!isprint ((guchar) key_string[index])) { + if (!g_ascii_isprint (key_string[index])) { return FALSE; } } diff --git a/libnautilus-private/nautilus-mime-actions.c b/libnautilus-private/nautilus-mime-actions.c index 63d7c20a4..9f889cd52 100644 --- a/libnautilus-private/nautilus-mime-actions.c +++ b/libnautilus-private/nautilus-mime-actions.c @@ -139,9 +139,9 @@ nautilus_mime_get_default_action_type_for_file (NautilusFile *file) g_free (mime_type); return action_type; } else { - if (g_strcasecmp (action_type_string, "application") == 0) { + if (g_ascii_strcasecmp (action_type_string, "application") == 0) { return GNOME_VFS_MIME_ACTION_TYPE_APPLICATION; - } else if (g_strcasecmp (action_type_string, "component") == 0) { + } else if (g_ascii_strcasecmp (action_type_string, "component") == 0) { return GNOME_VFS_MIME_ACTION_TYPE_COMPONENT; } else { return GNOME_VFS_MIME_ACTION_TYPE_NONE; @@ -1686,7 +1686,7 @@ application_supports_uri_scheme (gpointer data, /* The default supported uri scheme is "file" */ if (application->supported_uri_schemes == NULL - && g_strcasecmp ((const char *) uri_scheme, "file") == 0) { + && g_ascii_strcasecmp ((const char *) uri_scheme, "file") == 0) { return TRUE; } return g_list_find_custom (application->supported_uri_schemes, diff --git a/libnautilus-private/nautilus-program-chooser.c b/libnautilus-private/nautilus-program-chooser.c index 9e17a3334..6fe68126c 100644 --- a/libnautilus-private/nautilus-program-chooser.c +++ b/libnautilus-private/nautilus-program-chooser.c @@ -894,7 +894,7 @@ set_default_for_type (ProgramFilePair *pair) if (pair->action_type == GNOME_VFS_MIME_ACTION_TYPE_APPLICATION) { gnome_vfs_mime_set_default_application (mime_type, pair->application->id); } else { - if (g_strcasecmp (mime_type, "x-directory/normal") == 0) { + if (g_ascii_strcasecmp (mime_type, "x-directory/normal") == 0) { nautilus_global_preferences_set_default_folder_viewer (pair->view_identifier->iid); } else { gnome_vfs_mime_set_default_component (mime_type, pair->view_identifier->iid); diff --git a/src/nautilus-information-panel.c b/src/nautilus-information-panel.c index d0c84538f..3f2a3a4fb 100644 --- a/src/nautilus-information-panel.c +++ b/src/nautilus-information-panel.c @@ -1412,13 +1412,13 @@ add_buttons_from_metadata (NautilusSidebar *sidebar, const char *button_data) /* for each term, either create a button or attach a property to one */ for (index = 0; (term = terms[index]) != NULL; index++) { - current_term = g_strdup(term); - temp_str = strchr(current_term, '='); + current_term = g_strdup (term); + temp_str = strchr (current_term, '='); if (temp_str) { *temp_str = '\0'; - if (!g_strcasecmp(current_term, "button")) { - button_name = g_strdup(temp_str + 1); - } else if (!g_strcasecmp(current_term, "script")) { + if (!g_ascii_strcasecmp (current_term, "button")) { + button_name = g_strdup (temp_str + 1); + } else if (!g_ascii_strcasecmp (current_term, "script")) { if (button_name != NULL) { temp_button = gtk_button_new_with_label (button_name); gtk_box_pack_start (GTK_BOX (sidebar->details->button_box), diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c index db5e2633b..683e04d17 100644 --- a/src/nautilus-property-browser.c +++ b/src/nautilus-property-browser.c @@ -1247,8 +1247,8 @@ emblem_keyword_valid (const char *keyword) keyword_length = strlen (keyword); for (index = 0; index < keyword_length; index++) { - if (!isalnum ((guchar) keyword[index]) - && !isspace ((guchar) keyword[index])) { + if (!g_ascii_isalnum (keyword[index]) + && !g_ascii_isspace (keyword[index])) { return FALSE; } } diff --git a/src/nautilus-sidebar.c b/src/nautilus-sidebar.c index d0c84538f..3f2a3a4fb 100644 --- a/src/nautilus-sidebar.c +++ b/src/nautilus-sidebar.c @@ -1412,13 +1412,13 @@ add_buttons_from_metadata (NautilusSidebar *sidebar, const char *button_data) /* for each term, either create a button or attach a property to one */ for (index = 0; (term = terms[index]) != NULL; index++) { - current_term = g_strdup(term); - temp_str = strchr(current_term, '='); + current_term = g_strdup (term); + temp_str = strchr (current_term, '='); if (temp_str) { *temp_str = '\0'; - if (!g_strcasecmp(current_term, "button")) { - button_name = g_strdup(temp_str + 1); - } else if (!g_strcasecmp(current_term, "script")) { + if (!g_ascii_strcasecmp (current_term, "button")) { + button_name = g_strdup (temp_str + 1); + } else if (!g_ascii_strcasecmp (current_term, "script")) { if (button_name != NULL) { temp_button = gtk_button_new_with_label (button_name); gtk_box_pack_start (GTK_BOX (sidebar->details->button_box), diff --git a/test/test-nautilus-mime-actions-set.c b/test/test-nautilus-mime-actions-set.c index 1fa4d7931..f3dee2577 100644 --- a/test/test-nautilus-mime-actions-set.c +++ b/test/test-nautilus-mime-actions-set.c @@ -50,9 +50,9 @@ usage (const char *name) static GnomeVFSMimeActionType str_to_action_type (const char *str) { - if (g_strcasecmp (str, "component") == 0) { + if (g_ascii_strcasecmp (str, "component") == 0) { return GNOME_VFS_MIME_ACTION_TYPE_COMPONENT; - } else if (g_strcasecmp (str, "application") == 0) { + } else if (g_ascii_strcasecmp (str, "application") == 0) { return GNOME_VFS_MIME_ACTION_TYPE_APPLICATION; } else { return GNOME_VFS_MIME_ACTION_TYPE_NONE;