+2003-05-19 Angus Leeming <leeming@lyx.org>
+
+ * forms/c_str.sed: removed. Renamed as:
+ * forms/tmp_str.sed
+
+ * forms/Makefile.am (EXTRA_DIST): add tmp_str.sed.
+ ($(libfdesign_la_SOURCES)): make it depend on tmp_str.sed.
+
+ * forms/fdfix.sh:
+ * forms/fdfixc.sed:
+ * forms/tmp_str.sed: s/c_str\([^(]\)/tmp_str\1/.
2003-05-15 André Pönitz <poenitz@gmx.net>
MAINTAINERCLEANFILES += *.C *.h *.c
-EXTRA_DIST = fdfixc.sed fdfixh.sed fdfix.sh README $(SRCS)
+EXTRA_DIST = fdfixc.sed fdfixh.sed fdfix.sh tmp_str.sed README $(SRCS)
# For (forms_fwd.h, forms_gettext.h) and LString.h, respectively.
INCLUDES = -I$(srcdir)/.. -I$(top_srcdir)/src -I..
nodist_libfdesign_la_SOURCES = $(SRCS:.fd=.C) $(SRCS:.fd=.h)
# This is a trick so that the actual .la file never gets build,
# so we do not need to use diskspace and time for it.
-# It is only getting linked into libxforms.la any way.
+# It is only getting linked into libxforms.la anyway.
libfdesign_la_LINK = touch libfdesign.la
# These are used to generate the .[Ch] files from the .fd ones.
SCRIPT = $(srcdir)/fdfix.sh
SUFFIXES = .fd
-# Make the .Ch files dependent on the fdfix files.
-$(libfdesign_la_SOURCES): $(srcdir)/fdfix.sh $(srcdir)/fdfix[ch].sed
-
-%.C: %.fd
+%.C: %.fd $(srcdir)/fdfix.sh $(srcdir)/fdfix[ch].sed $(srcdir)/tmp_str.sed
$(SHELL) $(SCRIPT) $<
+++ /dev/null
-# file c_str.sed
-# This file is part of LyX, the document processor.
-# Licence details can be found in the file COPYING.
-#
-# author Angus Leeming
-#
-# Full author contact details are available in file CREDITS
-
-# This sed script is run on the .C file after the main fdfixc.sed has done
-# its stuff. It ensures that any c_str variables inserted by fdfixc.sed
-# are declared at the top of the appropriate function.
-#
-# We use a two-pass algorithm like this because a single pass results in
-# convoluted sed.
-
-
-# Initialise the hold space at the start of the function.
-/ \* build_/ {
-h; d
-}
-
-
-# For all lines within the function...
-/^{$/,/^}$/ {
-
-# If it isn't the last line, append it to the hold space.
-/^}$/!{
-H; d
-}
-
-# If it is the last line, paste the contents of the hold space above it,
-# seach for the string "c_str" and, if found, add its declaration to the top
-# of the function.
-/^}$/ {
-x; G
-
-/c_str/s/\( FL_OBJECT \*\)/ char const * c_str;\
-\1/
-}
-
-}
sed -f ${FDFIXC} < ${CIN} >> ${TMP}
-# Pass 2. Ensure that any c_str variables inserted by fdfixc.sed
+# Pass 2. Ensure that any tmp_str variables inserted by fdfixc.sed
# are declared at the top of the appropriate function.
-FDFIXC=${DIRNAME}/c_str.sed
+FDFIXC=${DIRNAME}/tmp_str.sed
sed -f ${FDFIXC} < ${TMP} > ${COUT}
rm -f ${TMP}
# change so:
# fdui->counter_zoom = obj = fl_add_counter(...,"Zoom %|#Z");
# becomes
-# c_str = _("Zoom %|#Z");
-# fdui->counter_zoom = obj = fl_add_counter(...,idex(c_str).c_str());
-# fl_set_button_shortcut(obj,scex(c_str).c_str(),1);
+# tmp_str = _("Zoom %|#Z");
+# fdui->counter_zoom = obj = fl_add_counter(...,idex(tmp_str).c_str());
+# fl_set_button_shortcut(obj,scex(tmp_str).c_str(),1);
-/fl_add.*".*[|].*"/s/fdui\(.*\)"\(.*\)".*/c_str = _("\2");\
- fdui\1idex(c_str).c_str());\
- fl_set_button_shortcut(obj,scex(c_str).c_str(),1);/
+/fl_add.*".*[|].*"/s/fdui\(.*\)"\(.*\)".*/tmp_str = _("\2");\
+ fdui\1idex(tmp_str).c_str());\
+ fl_set_button_shortcut(obj,scex(tmp_str).c_str(),1);/
# gettext will get confused if the string contains a "%" unless the line is
--- /dev/null
+# file tmp_str.sed
+# This file is part of LyX, the document processor.
+# Licence details can be found in the file COPYING.
+#
+# author Angus Leeming
+#
+# Full author contact details are available in file CREDITS
+
+# This sed script is run on the .C file after the main fdfixc.sed has done
+# its stuff. It ensures that any tmp_str variables inserted by fdfixc.sed
+# are declared at the top of the appropriate function.
+#
+# We use a two-pass algorithm like this because a single pass results in
+# convoluted sed.
+
+
+# Initialise the hold space at the start of the function.
+/ \* build_/ {
+h; d
+}
+
+
+# For all lines within the function...
+/^{$/,/^}$/ {
+
+# If it isn't the last line, append it to the hold space.
+/^}$/!{
+H; d
+}
+
+# If it is the last line, paste the contents of the hold space above it,
+# seach for the string "tmp_str" and, if found, add its declaration to the top
+# of the function.
+/^}$/ {
+x; G
+
+/tmp_str/s/\( FL_OBJECT \*\)/ string tmp_str;\
+\1/
+}
+
+}