* libtextstyle/autogen.sh: Don't generate lib/color.h and lib/color.c.
* libtextstyle/lib/color.h: Moved to here from gettext-tools/src/color.h.
* libtextstyle/lib/color.c: Moved to here from gettext-tools/src/color.c.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Remove fd-ostream, file-ostream,
html-styled-ostream, ostream, styled-ostream, term-styled-ostream. Add libxml.
* gettext-tools/gnulib-lib/Makefile.am (MOOPPFLAGS): Remove customization.
* gettext-tools/gnulib-tests/Makefile.am (test_term_ostream_LDADD): Remove
customization.
* gettext-tools/src/Makefile.am (noinst_HEADERS): Remove color.h.
(AM_CPPFLAGS): Add -I directives to the libtextstyle/lib directory.
(libgettextsrc_la_SOURCES): Remove color.c.
(libgettextsrc_la_LDFLAGS): Link with libtextstyle.la.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/write-catalog.h: Include <textstyle.h> instead of ostream.h.
* gettext-tools/src/write-catalog.c: Include <textstyle.h> instead of color.h
and *-ostream.h.
(msgdomain_list_print): Use styled_ostream_create and
noop_styled_ostream_create.
* gettext-tools/src/write-po.h: Include <textstyle.h> instead of ostream.h.
* gettext-tools/src/write-po.c: Include <textstyle.h> instead of *-ostream.h.
(is_stylable): Remove function.
(begin_css_class, end_css_class): Update. Mark as inline.
* gettext-tools/src/write-properties.c: Include <textstyle.h> instead of
ostream.h.
* gettext-tools/src/write-stringtable.c: Likewise.
* gettext-tools/src/msgattrib.c: Include <textstyle.h> instead of color.h.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
error
error-progname
execute
- fd-ostream
- file-ostream
filename
findprog
fnmatch
gettext
gettext-h
hash
- html-styled-ostream
iconv
javacomp
javaexec
libunistring-optional
+ libxml
localcharset
locale
localename
open
opendir
openmp
- ostream
pipe-filter-ii
progname
propername
strpbrk
strtol
strtoul
- styled-ostream
sys_select
sys_stat
sys_time
- term-styled-ostream
trim
unictype/ctype-space
unilbrk/ulc-width-linebreaks
# Rules generated and collected by gnulib-tool.
include Makefile.gnulib
-# Which classes to export from the shared library.
-MOOPPFLAGS += --dllexport=styled_ostream
-
# OS/2 does not support a DLL name longer than 8 characters.
if OS2
libgettextlib_la_LDFLAGS += -os2dllname gtlib
# Ensure that test-quotearg.c finds libintl.h.
AM_CPPFLAGS += -I../intl
-# Ensure that test-term-ostream links correctly when using --disable-shared
-# on macOS.
-test_term_ostream_LDADD += @INTL_MACOSX_LIBS@
-
# Remove .deps directories creates by 'configure'.
# I would say that this left-over is an Automake 1.16.1 bug.
Error handling during writing and reading of PO files.
+-------------- Writing PO files
-| color.h
-| color.c
-| Color and style handling.
| write-catalog.h
| write-catalog.c
| Output of a list-of-messages.
po-lex.h open-catalog.h read-catalog-abstract.h read-catalog.h \
read-po.h read-properties.h read-stringtable.h \
str-list.h \
-color.h write-catalog.h write-po.h write-properties.h write-stringtable.h \
+write-catalog.h write-po.h write-properties.h write-stringtable.h \
dir-list.h file-list.h po-gram-gen.h po-gram-gen2.h cldr-plural.h \
cldr-plural-exp.h locating-rule.h its.h search-path.h \
msgl-charset.h msgl-equal.h msgl-iconv.h msgl-ascii.h msgl-cat.h msgl-header.h \
-I.. -I$(top_srcdir) \
-I$(top_srcdir)/libgrep \
-I../gnulib-lib -I$(top_srcdir)/gnulib-lib \
+ -I../../libtextstyle/lib -I$(top_srcdir)/../libtextstyle/lib \
-I../intl -I$(top_srcdir)/../gettext-runtime/intl
DEFS = \
-DLOCALEDIR=\"$(localedir)\" -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \
# libgettextsrc contains all code that is needed by at least two programs.
libgettextsrc_la_SOURCES = \
$(COMMON_SOURCE) read-catalog.c \
-color.c write-catalog.c write-properties.c write-stringtable.c write-po.c \
+write-catalog.c write-properties.c write-stringtable.c write-po.c \
msgl-ascii.c msgl-iconv.c msgl-equal.c msgl-cat.c msgl-header.c msgl-english.c \
msgl-check.c file-list.c msgl-charset.c po-time.c plural-exp.c plural-eval.c \
plural-table.c quote.h sentence.h sentence.c \
# use iconv().
libgettextsrc_la_LDFLAGS = \
-release @VERSION@ \
- ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
+ ../gnulib-lib/libgettextlib.la $(LTLIBUNISTRING) ../../libtextstyle/lib/libtextstyle.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
# OS/2 does not support a DLL name longer than 8 characters.
if OS2
#include <stdlib.h>
#include <locale.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "error.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "propername.h"
#include "xalloc.h"
#include "gettext.h"
#include <stdlib.h>
#include <locale.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "str-list.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "msgl-cat.h"
#include "msgl-header.h"
#include "propername.h"
#include <stdio.h>
#include <stdlib.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "str-list.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "msgl-cat.h"
#include "propername.h"
#include "gettext.h"
#include <stdlib.h>
#include <locale.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "error.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "msgl-iconv.h"
#include "localcharset.h"
#include "propername.h"
#include <stdlib.h>
#include <locale.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "error.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "propername.h"
#include "gettext.h"
#include <sys/time.h>
#include <unistd.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "error.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "msgl-charset.h"
#include "xalloc.h"
#include "findprog.h"
#include <fnmatch.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "error.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "str-list.h"
#include "msgl-charset.h"
#include "xalloc.h"
# define HAVE_DIR 0
#endif
+#include <textstyle.h>
+
#include "closeout.h"
#include "error.h"
#include "error-progname.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "po-charset.h"
#include "localcharset.h"
#include "localename.h"
#include <string.h>
#include <locale.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "error.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "format.h"
#include "xalloc.h"
#include "xmalloca.h"
#include <stdlib.h>
#include <locale.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "error.h"
#include "error-progname.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "propername.h"
#include "gettext.h"
#include <stdlib.h>
#include <locale.h>
+#include <textstyle.h>
+
#include "closeout.h"
#include "dir-list.h"
#include "str-list.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "msgl-cat.h"
#include "propername.h"
#include "gettext.h"
# define STDOUT_FILENO 1
#endif
-#include "ostream.h"
-#include "file-ostream.h"
+#ifdef GETTEXTDATADIR
+# include <textstyle.h>
+#else
+# include "ostream.h"
+# include "file-ostream.h"
+#endif
+
#include "fwriteerror.h"
#include "error-progname.h"
#include "xvasprintf.h"
# define ENABLE_COLOR 1
-# include "styled-ostream.h"
-# include "term-styled-ostream.h"
-# include "html-styled-ostream.h"
-# include "fd-ostream.h"
-
-# include "color.h"
# include "relocatable.h"
# include "po-charset.h"
# include "msgl-iconv.h"
"GETTEXTSTYLESDIR", relocate (GETTEXTSTYLESDIR),
"po-default.css");
stream =
- term_styled_ostream_create (fd, filename, TTYCTL_AUTO, style_file_name);
- if (stream == NULL)
- stream = fd_ostream_create (fd, filename, true);
+ styled_ostream_create (fd, filename, TTYCTL_AUTO, style_file_name);
output_syntax->print (mdlp, stream, page_width, debug);
ostream_free (stream);
ostream_free (html_stream);
}
else
-#endif
{
- output_syntax->print (mdlp, stream, page_width, debug);
+ noop_styled_ostream_t styled_stream;
+
+ styled_stream = noop_styled_ostream_create (stream, false);
+ output_syntax->print (mdlp, styled_stream, page_width, debug);
+ ostream_free (styled_stream);
}
+#else
+ output_syntax->print (mdlp, stream, page_width, debug);
+#endif
ostream_free (stream);
/* GNU gettext - internationalization aids
- Copyright (C) 1995-1998, 2000-2003, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2003, 2006, 2008, 2019 Free Software Foundation, Inc.
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
#include <stdbool.h>
-#include "ostream.h"
+#ifdef GETTEXTDATADIR
+# include <textstyle.h>
+#else
+# include "ostream.h"
+#endif
+
#include "message.h"
# include <iconv.h>
#endif
+#ifdef GETTEXTDATADIR
+# include <textstyle.h>
+#else
+# include "ostream.h"
+#endif
+
#include "c-ctype.h"
#include "po-charset.h"
#include "format.h"
#include "xalloc.h"
#include "xmalloca.h"
#include "c-strstr.h"
-#include "ostream.h"
-#ifdef GETTEXTDATADIR
-# include "styled-ostream.h"
-#endif
#include "xvasprintf.h"
#include "po-xerror.h"
#include "gettext.h"
When compiled in libgettextpo, don't enable styling support. */
#ifdef GETTEXTDATADIR
-/* Return true if the stream is an instance of styled_ostream_t. */
-static inline bool
-is_stylable (ostream_t stream)
-{
- return IS_INSTANCE (stream, ostream, styled_ostream);
-}
+/* All ostream_t instances are in fact styled_ostream_t instances. */
/* Start a run of text belonging to a given CSS class. */
-static void
+static inline void
begin_css_class (ostream_t stream, const char *classname)
{
- if (is_stylable (stream))
- styled_ostream_begin_use_class ((styled_ostream_t) stream, classname);
+ styled_ostream_begin_use_class ((styled_ostream_t) stream, classname);
}
/* End a run of text belonging to a given CSS class. */
-static void
+static inline void
end_css_class (ostream_t stream, const char *classname)
{
- if (is_stylable (stream))
- styled_ostream_end_use_class ((styled_ostream_t) stream, classname);
+ styled_ostream_end_use_class ((styled_ostream_t) stream, classname);
}
#else
/* GNU gettext - internationalization aids
- Copyright (C) 1995-1998, 2000-2003, 2006, 2008, 2014, 2018 Free Software
+ Copyright (C) 1995-1998, 2000-2003, 2006, 2008, 2014, 2018-2019 Free Software
Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
#ifndef _WRITE_PO_H
#define _WRITE_PO_H
-#include "ostream.h"
-#include "message.h"
-
#include <stdbool.h>
+#ifdef GETTEXTDATADIR
+# include <textstyle.h>
+#else
+# include "ostream.h"
+#endif
+
+#include "message.h"
+
#ifdef __cplusplus
extern "C" {
/* Writing Java .properties files.
- Copyright (C) 2003, 2005-2009 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005-2009, 2019 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
#include <stdlib.h>
#include <string.h>
+#include <textstyle.h>
+
#include "error.h"
#include "message.h"
#include "msgl-ascii.h"
#include "msgl-iconv.h"
#include "po-charset.h"
#include "unistr.h"
-#include "ostream.h"
#include "write-po.h"
#include "xalloc.h"
/* Writing NeXTstep/GNUstep .strings files.
- Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2008, 2019 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
#include <stdlib.h>
#include <string.h>
+#include <textstyle.h>
+
#include "message.h"
#include "msgl-ascii.h"
#include "msgl-iconv.h"
#include "po-charset.h"
#include "c-strstr.h"
-#include "ostream.h"
#include "xvasprintf.h"
#include "write-po.h"
#include <iconv.h>
#endif
+#include <textstyle.h>
+
#include "rc-str-list.h"
#include "xg-encoding.h"
#include "xg-arglist-context.h"
#include "write-po.h"
#include "write-properties.h"
#include "write-stringtable.h"
-#include "color.h"
#include "format.h"
#include "propername.h"
#include "sentence.h"
/build-aux/run-test
/build-aux/test-driver.diff
/build-aux/texinfo.tex
-/lib/color.c
-/lib/color.h
/lib/declared.sh
/lib/exported.sh.in
/m4/exported.m4
cp -p ../build-aux/ltmain.sh build-aux/
cp -p ../gettext-tools/m4/exported.m4 m4/
cp -p ../gettext-tools/libgettextpo/exported.sh.in lib/
-sed -e 's/DLL_VARIABLE/LIBTEXTSTYLE_DLL_VARIABLE/g' < ../gettext-tools/src/color.h > lib/color.h
-cp -p ../gettext-tools/src/color.c lib/
aclocal -I m4 -I gnulib-m4
autoconf
/* Whether to output a test page. */
-extern DLL_VARIABLE bool color_test_mode;
+extern LIBTEXTSTYLE_DLL_VARIABLE bool color_test_mode;
/* Color option. */
enum color_option { color_no, color_tty, color_yes, color_html };
-extern DLL_VARIABLE enum color_option color_mode;
+extern LIBTEXTSTYLE_DLL_VARIABLE enum color_option color_mode;
/* Style to use when coloring. */
-extern DLL_VARIABLE const char *style_file_name;
+extern LIBTEXTSTYLE_DLL_VARIABLE const char *style_file_name;
/* --color argument handling. Return an error indicator. */
extern bool handle_color_option (const char *option);