liblouisutdml-2.5.0/0000775000076500007650000000000012222613353011422 500000000000000liblouisutdml-2.5.0/ChangeLog0000664000076500007650000001544712054461273013134 000000000000002010-01-06 Christian Egli * man/Makefile.am (pdf2brl.1): Automatically generate man pages for rtf2brl and pdf2brl. * doc/liblouisxml.texi (Transcribing PDF files with pdf2brl): Add documentation for the pdf2brl tool. * README: Mention the dependency on poppler or xpdf for pdf2brl and rtf2xml for rtf2brl. * tools/Makefile.am (bin_SCRIPTS): Added the pdf2brl script properly to the build process, i.e. make sure it is generated by configure and packaged and installed by make. 2009-12-28 John J. Boyer * implemented handling of xpath expressions * Added pdf2brl tool 2009-11-24 Christian Egli * doc/liblouisxml.texi (html.sem): Fix some typos and add references to the appendix with the sem file examples. 2009-11-23 John J. Boyer * Release 2.1.0: Many new features, see NEWS 2009-11-04 Christian Egli * Makefile.am: * configure.ac: * man/Makefile.am: Automatically generate man pages using help2man if it is available. * Makefile.am: * configure.ac: * gnulib/*: * tools/xml2brl.c: Integrate gnulib and use it to do option parsing using getopt. xml2brl now handles --help and --version. 2009-10-03 Christian Egli * tests/check_version.c: Add a test case for lbx_version(). 2009-08-11 Christian Egli * doc/Makefile.am (man_MANS): Only define the man pages once, otherwise they will be installed twice. * doc/liblouisxml.texi (style): Fixed a small typo with the invocation of the settings macro 2009-07-28 John J. Boyer * Alpha realase of UK Maths files 2009-07-17 Lars Bjørndal * contrib/liblouisxml.spec: Added rpm spec file 2009-07-06 Christian Egli * doc/liblouisxml.texi (Semantic Actions Overview): Fixed two small capitalization typos. 2009-03-12 John J. Boyer * doc/Makefile.am: datarootdir may not work: use datadir 2009-03-09 Christian Egli * doc/Makefile.am (doc_DATA): Use the default location for docdir. Thanks to Lars Bjørndal for the report. 2009-03-04 John J. Boyer * Release 1.9.0 2009-02-20 John J. Boyer * Added the directory mac-osx-10.5 and its files for building on the Mac. 2009-02-18 John J. Boyer * Changing e-mail, website and company name to abilitiessoft. 2009-02-16 John J. Boyer * Added __stdcall as per liblouis. * Moved qetProgramPath from paths.c to compileTranslationTable.c in liblouis and made it exportable as lou_getProgramPath for Windows only. 2009-02-10 (2) John J. Boyer * Put in new path.c module, which finds the program location in Windows. 2009-02-13 Christian Egli * doc/liblouisxml.texi (Semantic Actions in detail): Added docu for config* semantic actions. 2009-02-10 John J. Boyer * Put in new path.c module, which finds the program location in Windows. * Added README.win32 on how to build on Windows. 2009-02-10 Christian Egli * tests/testcode.xml: * liblouisxml/transcribe_music.c: * liblouisxml/transcribe_graphic.c: * liblouisxml/transcribe_chemistry.c: * liblouisxml/make_sem_names.c: Move license from GPL + restrictions/permissions to LGPL with the blessing of the copyright holders. 2009-02-09 Christian Egli * README: Remove any mentioning of mathml2brl * doc/liblouis.texi (Programming with liblouis): Move the programming section to the back and rename to emphasize more on the user instead of the programmer. * doc/liblouisxml-guide.texi: Renamed to liblouisxml.texi 2009-02-08 John J. Boyer * More proofreading and correcting ob liblouis-guide.texi. 2009-02-07 John J. Boyer * Update documentation examples * remove outdated mathml2brl program 2009-02-04 John J. Boyer * Fixed a problem in xml2brl when using the -p option (poorly formatted text) which caused it to fail to recognize text that was in fact properly formatted. 2009-02-04 Christian Egli * doc/liblouisxml-guide.texi (Semantic Actions in detail): Added a separate section to document the semantic actions individually (Table of contents): Added docu for the table of contents feature. 2009-02-03 John J. Boyer * Implemented lbx_version. 2009-02-02 Christian Egli * NEWS: Added NEWS for release 1.8.0 2009-01-26 John J. Boyer * added the configfile, configstring and configtweak semantic actions 2009-01-21 Christian Egli * doc/Makefile.am (msword2brl.1): Generate the man page automatically with the help of a proper usage message, --help and --version options and the help2man utility. 2009-01-08 Christian Egli * doc/msword2brl.1: Add a man page for msword2brl * configure.ac: Generate version string for msword2brl automatically. * doc/Makefile.am (AM_MAKEINFOHTMLFLAGS): Generate the html as one big page. 2008-12-23 Christian Egli * doc/Makefile.am : Integrated the man page and the liblouisxml-guide in the build process. * doc/xml2brl.1: Added a man page for xml2brl. * doc/liblouisxml-guide.texi: Added a texinfo version of the liblouisxml-guide. John J. Boyer, john.boyer@jjb-software.com Release liblouisxml-1.4.2, June 16, 2008 Converted to Gnu autotools A few bugs fixed Release liblouisxml-1.4.1 linux-Makefile optimized for RedHat If there are errors in a liblouis table you will now get only a single arror report instead of myriads. Release liblouisxml-1.4.0, May 12, 2008 doc directory renamed docs . Semantic-action and configuration files in this directory have been prefixed with example_ mode parameter added to functions in liblouisxml.h Cdata sections can now be translated as text, computer code or ignored. A function to find the true namo of the "Program Files" directory in Windows has been written by Yuemei Sun of ViewPlus Technologies. It is in the paths.c module. Paths for translation tables, semantic action files and configuration files can now be assigned more flexibly. See paths.c xml2brl will now accept configuration settings on the command line, so it is unnecessary to change a configuration file. It is now possible to pass a configuration string in memory to the library, not just the name of a configuration file. For details on all these changes see docs/liblouisxml-guide.html liblouisutdml-2.5.0/README0000664000076500007650000000356012054461273012233 00000000000000INTRODUCTION Liblouisutdml is an open-source library providing complete braille transcription services for xml, html and text documents. It translates into appropriate braille codes and formats according to its style sheet and the specifications in the document. A command-line program, file2brl which uses this library is also included. The latest version of liblouis is required. Java bindings are built in to the library. The library is licensed under the GNU Lesser General Public License (LGPL) version 3 or later. See the file COPYING.LIB. The command line tools, are licensed under the GNU General Public License version 3.0 or later. See the file COPYING. DOCUMENTATION For documentation, see liblouisutdml.html or liblouisutdml.txt. These are in the docs directory. For an example of a configuration file, see liblouisutdml.ini and preferences.cfg . For examples of semantics-action files, see dtbook.sem and nemeth.sem . These files are in the lbu_files subdirectory. For examples of translation tables, see en-us-g2.ctb en-us-g1.ctb chardefs.cti nemeth.ctb and whatever other files they may include. These are all in the tables directory of liblouis. INSTALLATION First obtain the latest version of liblouis and compile it. Before compiling, you should chose between 16- and 32-bit Unicode, as described in the README file and the documentation. liblouisutdml inherits this choice from liblouis. After unpacking the distribution tarball for liblouisutdml go to the directory it creates. After running "configure" run "make" and "make install". You will need root privileges for the installation step. This will produce the liblouisutdml library and the program file2brl . To compile the Java bindings go to the java subdirectory and run ant . Note that that the library and programs will not work properly unless you have first installed the latest version of liblouis. liblouisutdml-2.5.0/aclocal.m40000664000076500007650000101250112222611420013173 00000000000000# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 48 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; freebsd*) # from 4.6 on shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix3*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # find out which ABI we are using libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; esac fi rm -rf conftest* ;; esac # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix3*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`gcc -dumpversion\` # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix3*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix3*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # 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, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([gnulib/m4/00gnulib.m4]) m4_include([gnulib/m4/extensions.m4]) m4_include([gnulib/m4/extern-inline.m4]) m4_include([gnulib/m4/getopt.m4]) m4_include([gnulib/m4/gnulib-common.m4]) m4_include([gnulib/m4/gnulib-comp.m4]) m4_include([gnulib/m4/include_next.m4]) m4_include([gnulib/m4/malloc.m4]) m4_include([gnulib/m4/nocrash.m4]) m4_include([gnulib/m4/off_t.m4]) m4_include([gnulib/m4/onceonly.m4]) m4_include([gnulib/m4/realloc.m4]) m4_include([gnulib/m4/ssize_t.m4]) m4_include([gnulib/m4/stdarg.m4]) m4_include([gnulib/m4/stddef_h.m4]) m4_include([gnulib/m4/stdlib_h.m4]) m4_include([gnulib/m4/sys_types_h.m4]) m4_include([gnulib/m4/unistd_h.m4]) m4_include([gnulib/m4/version-etc.m4]) m4_include([gnulib/m4/warn-on-use.m4]) m4_include([gnulib/m4/wchar_t.m4]) liblouisutdml-2.5.0/tests/0000775000076500007650000000000012222613352012563 500000000000000liblouisutdml-2.5.0/tests/Makefile.am0000664000076500007650000000143312211574747014554 00000000000000INCLUDES = \ -I$(top_srcdir)/liblouisutdml \ -I$(top_srcdir)/gnulib LDADD = \ $(top_builddir)/liblouisutdml/liblouisutdml.la \ $(top_builddir)/gnulib/libgnu.la \ $(BASE_DEPENDENCIES_LIBS) \ $(LTLIBINTL) AM_CFLAGS = \ $(BASE_DEPENDENCIES_CFLAGS) AM_LDFLAGS = \ $(BASE_DEPENDENCIES_LDFLAGS) check_PROGRAMS = \ testTranslateString\ tripleTrans dist_check_SCRIPTS = run_test_suite.sh testTranslateString_SOURCES = testTranslateString.c tripleTrans_SOURCES = tripleTrans.c XFAIL_TESTS = \ testTranslateString TESTS = \ $(check_PROGRAMS) \ $(dist_check_SCRIPTS) TESTS_ENVIRONMENT = \ LD_LIBRARY_PATH=$(abs_top_srcdir)/liblouisutdml/.libs:$$LD_LIBRARY_PATH \ PATH=$(abs_top_srcdir)/tools:$$PATH liblouisutdml-2.5.0/tests/run_test_suite.sh0000775000076500007650000000510012216331757016123 00000000000000#!/bin/sh # run_test_suite # # Copyright (C) 2013 by Swiss Library for the Blind, Visually Impaired and Print Disabled # # This file is free software; you can redistribute it and/or modify it # under the terms of the Lesser or Library GNU General Public License as # published by the Free Software Foundation; either version 3, or (at # your option) any later version. # This file 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 Library # GNU General Public License for more details. # You should have received a copy of the Library GNU General Public # License along with this program; see the file COPYING. If not, write # to the Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. verbose=1 colors=1 echo "--------------------------------------------------------------------------------" echo "TESTS" echo "--------------------------------------------------------------------------------" tests=0 error=0 pass=0 fail=0 xfail=0 xpass=0 TESTS_DIR=$(cd $(dirname "$0"); pwd) cd "$TESTS_DIR" for test_dir in test_suite/test_* ; do tests=$(( tests + 1 )) cd "$TESTS_DIR/$test_dir" echo "Running $(basename $test_dir)..." if [ -e README -a $verbose -ne 0 ]; then echo "$(cat README | fold -sw 77 | sed 's/.*/ &/' )" fi file2brl -f ./styles.cfg input.xml output.txt 2>error.log if [ $? -ne 0 ]; then error=$(( error + 1 )) if [ $colors -ne 0 ]; then echo " \033[1m\033[91mERROR\033[0m\033[0m" else echo " ERROR" fi else rm -f error.log diff -q expected.txt output.txt >/dev/null if [ $? -ne 0 ]; then if [ -e xfail ]; then xfail=$(( xfail + 1 )) if [ $colors -ne 0 ]; then echo " \033[1m\033[93mXFAIL\033[0m\033[0m" else echo " XFAIL" fi else fail=$(( fail + 1 )) if [ $colors -ne 0 ]; then echo " \033[1m\033[91mFAIL\033[0m\033[0m" else echo " FAIL" fi fi else if [ -e xfail ]; then xpass=$(( xpass + 1 )) if [ $colors -ne 0 ]; then echo " \033[1m\033[91mXPASS\033[0m\033[0m" else echo " XPASS" fi else pass=$(( pass + 1 )) rm output.txt if [ $colors -ne 0 ]; then echo " \033[1m\033[92mPASS\033[0m\033[0m" else echo " PASS" fi fi fi fi rm -f file2brl.temp done echo "" echo "Summary:" echo "--------" echo "Tests run: $tests, Failures: $((fail + xpass)), Expected failures: $xfail, Errors: $error" echo "" [ $(( error + fail + xpass )) -gt 0 ] && exit 1 exit 0 liblouisutdml-2.5.0/tests/tripleTrans.c0000664000076500007650000000060112054461273015161 00000000000000#include #include #include #include "liblouisutdml.h" int main (int argc, char **argv) { lbu_translateFile ("preferences.cfg", argv[1], "trans1", NULL, NULL, 0); lbu_translateFile ("preferences.cfg", argv[1], "trans2", NULL, NULL, 0); lbu_translateFile ("preferences.cfg", argv[1], "trans3", NULL, NULL, 0); lbu_free (); return 0; } liblouisutdml-2.5.0/tests/Makefile.in0000664000076500007650000006410112222611433014550 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ check_PROGRAMS = testTranslateString$(EXEEXT) tripleTrans$(EXEEXT) subdir = tests DIST_COMMON = $(dist_check_SCRIPTS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/extern-inline.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/malloc.m4 \ $(top_srcdir)/gnulib/m4/nocrash.m4 \ $(top_srcdir)/gnulib/m4/off_t.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/realloc.m4 \ $(top_srcdir)/gnulib/m4/ssize_t.m4 \ $(top_srcdir)/gnulib/m4/stdarg.m4 \ $(top_srcdir)/gnulib/m4/stddef_h.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/sys_types_h.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/version-etc.m4 \ $(top_srcdir)/gnulib/m4/warn-on-use.m4 \ $(top_srcdir)/gnulib/m4/wchar_t.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/liblouisutdml/config.h CONFIG_CLEAN_FILES = am_testTranslateString_OBJECTS = testTranslateString.$(OBJEXT) testTranslateString_OBJECTS = $(am_testTranslateString_OBJECTS) testTranslateString_LDADD = $(LDADD) am__DEPENDENCIES_1 = testTranslateString_DEPENDENCIES = \ $(top_builddir)/liblouisutdml/liblouisutdml.la \ $(top_builddir)/gnulib/libgnu.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_tripleTrans_OBJECTS = tripleTrans.$(OBJEXT) tripleTrans_OBJECTS = $(am_tripleTrans_OBJECTS) tripleTrans_LDADD = $(LDADD) tripleTrans_DEPENDENCIES = \ $(top_builddir)/liblouisutdml/liblouisutdml.la \ $(top_builddir)/gnulib/libgnu.la $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/liblouisutdml depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(testTranslateString_SOURCES) $(tripleTrans_SOURCES) DIST_SOURCES = $(testTranslateString_SOURCES) $(tripleTrans_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_DEPENDENCIES_CFLAGS = @BASE_DEPENDENCIES_CFLAGS@ BASE_DEPENDENCIES_LIBS = @BASE_DEPENDENCIES_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETOPT_H = @GETOPT_H@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GL_GENERATE_STDARG_H_FALSE = @GL_GENERATE_STDARG_H_FALSE@ GL_GENERATE_STDARG_H_TRUE = @GL_GENERATE_STDARG_H_TRUE@ GL_GENERATE_STDDEF_H_FALSE = @GL_GENERATE_STDDEF_H_FALSE@ GL_GENERATE_STDDEF_H_TRUE = @GL_GENERATE_STDDEF_H_TRUE@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_HELP2MAN_FALSE = @HAVE_HELP2MAN_FALSE@ HAVE_HELP2MAN_TRUE = @HAVE_HELP2MAN_TRUE@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE__EXIT = @HAVE__EXIT@ HELP2MAN = @HELP2MAN@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBINTL = @LIBINTL@ LIBLOUISUTDML_AGE = @LIBLOUISUTDML_AGE@ LIBLOUISUTDML_CURRENT = @LIBLOUISUTDML_CURRENT@ LIBLOUISUTDML_REVISION = @LIBLOUISUTDML_REVISION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ RANLIB = @RANLIB@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDARG_H = @STDARG_H@ STDDEF_H = @STDDEF_H@ STRIP = @STRIP@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VERSION = @VERSION@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_F77 = @ac_ct_F77@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ INCLUDES = \ -I$(top_srcdir)/liblouisutdml \ -I$(top_srcdir)/gnulib LDADD = \ $(top_builddir)/liblouisutdml/liblouisutdml.la \ $(top_builddir)/gnulib/libgnu.la \ $(BASE_DEPENDENCIES_LIBS) \ $(LTLIBINTL) AM_CFLAGS = \ $(BASE_DEPENDENCIES_CFLAGS) AM_LDFLAGS = \ $(BASE_DEPENDENCIES_LDFLAGS) dist_check_SCRIPTS = run_test_suite.sh testTranslateString_SOURCES = testTranslateString.c tripleTrans_SOURCES = tripleTrans.c XFAIL_TESTS = \ testTranslateString TESTS = \ $(check_PROGRAMS) \ $(dist_check_SCRIPTS) TESTS_ENVIRONMENT = \ LD_LIBRARY_PATH=$(abs_top_srcdir)/liblouisutdml/.libs:$$LD_LIBRARY_PATH \ PATH=$(abs_top_srcdir)/tools:$$PATH all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done testTranslateString$(EXEEXT): $(testTranslateString_OBJECTS) $(testTranslateString_DEPENDENCIES) @rm -f testTranslateString$(EXEEXT) $(LINK) $(testTranslateString_LDFLAGS) $(testTranslateString_OBJECTS) $(testTranslateString_LDADD) $(LIBS) tripleTrans$(EXEEXT): $(tripleTrans_OBJECTS) $(tripleTrans_DEPENDENCIES) @rm -f tripleTrans$(EXEEXT) $(LINK) $(tripleTrans_LDFLAGS) $(tripleTrans_OBJECTS) $(tripleTrans_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testTranslateString.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tripleTrans.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) \ $(dist_check_SCRIPTS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: liblouisutdml-2.5.0/tests/testTranslateString.c0000664000076500007650000000165312131526737016711 00000000000000#include #include #include #include "liblouisutdml.h" #define BUFSIZE 10000 int main (int argc, char **argv) { char inbuf[BUFSIZE]; widechar outbuf[BUFSIZE]; FILE *inFile; int inlen = 0; int outlen = BUFSIZE; int k; char *configSettings = "editTable=unicode.dis,nemeth_edit.ctb\n"; if (!(inFile = fopen (argv[1], "rb"))) { fprintf (stderr, "Can't open infput file '%s'\n", argv[1]); exit (1); } while ((inbuf[inlen++] = fgetc (inFile)) != EOF && inlen < BUFSIZE); if (inlen == BUFSIZE) { fprintf (stderr, "File '%s' too large\n", argv[1]); exit (1); } inlen--; /*Get rid of EOF*/ if (!lbu_translateString ("preferences.cfg", inbuf, inlen, outbuf, &outlen, NULL, configSettings, 0)) { fprintf (stderr, "Translation failed.\n"); exit (1); } for (k = 0; k < outlen; k++) printf ("%x ", outbuf[k]); return 0; } liblouisutdml-2.5.0/Makefile.am0000664000076500007650000000046112054461273013404 00000000000000SUBDIRS = gnulib doc lbu_files liblouisutdml tests tools man m4 \ java java/src java/src/org java/src/org/liblouis windows windows/include ACLOCAL_AMFLAGS = -I m4 -I gnulib/m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = liblouisutdml.pc EXTRA_DIST = liblouisutdml.pc README.windows README.mac liblouisutdml-2.5.0/liblouisutdml.pc.in0000664000076500007650000000046112054461273015171 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ lbudir=${prefix}/etc/liblouisutdml/lbu_files Name: liblouisutdml Description: a braille XML transcriber with UTDML Version: @VERSION@ Requires: liblouis Libs: -L${libdir} -llouisutdml Cflags: -I${includedir}/liblouisutdml liblouisutdml-2.5.0/configure.ac0000664000076500007650000000426712222611361013636 00000000000000# Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(liblouisutdml, 2.5.0, john.boyer@abilitiessoft.com) AC_CONFIG_SRCDIR([liblouisutdml/semantics.c]) AC_CONFIG_HEADER([liblouisutdml/config.h]) # AM_MAINTAINER_MODE AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) # increment if the interface has additions, changes, removals. LIBLOUISUTDML_CURRENT=6 # increment any time the source changes; set to # 0 if you increment CURRENT LIBLOUISUTDML_REVISION=8 # increment if any interfaces have been added; set to 0 # if any interfaces have been changed or removed. removal has # precedence over adding, so set to 0 if both happened. LIBLOUISUTDML_AGE=0 AC_SUBST(LIBLOUISUTDML_CURRENT) AC_SUBST(LIBLOUISUTDML_REVISION) AC_SUBST(LIBLOUISUTDML_AGE) # Checks for programs. AC_PROG_CC # gnulib gl_EARLY gl_INIT # Checks for more programs. AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET # AC_PROG_RANLIB AC_ISC_POSIX AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL # GNU help2man creates man pages from --help output; in many cases, # this is sufficient, and obviates the need to maintain man pages # separately. However, some developers do not have it so we do not # make its use mandatory. AC_CHECK_PROG([HELP2MAN], [help2man], [help2man]) AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man]) AC_PATH_PROG(PKG_CONFIG, pkg-config) PKG_CHECK_MODULES(BASE_DEPENDENCIES, [liblouis, libxml-2.0]) # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h jni.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_STAT AC_CHECK_FUNCS([memset]) case $host in *mingw* | *cygwin*) LDFLAGS="$LDFLAGS -avoid-version" CFLAGS="$CFLAGS -Wl,--add-stdcall-alias" ;; esac AC_CONFIG_FILES([Makefile gnulib/Makefile doc/Makefile java/Makefile java/src/Makefile java/src/org/Makefile java/src/org/liblouis/Makefile man/Makefile lbu_files/Makefile liblouisutdml/Makefile liblouisutdml.pc tests/Makefile tools/Makefile windows/Makefile windows/include/Makefile m4/Makefile]) AC_OUTPUT liblouisutdml-2.5.0/m4/0000775000076500007650000000000012222613353011742 500000000000000liblouisutdml-2.5.0/m4/Makefile.am0000664000076500007650000000000012054461273013711 00000000000000liblouisutdml-2.5.0/m4/Makefile.in0000664000076500007650000004402312222611432013726 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = m4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/extern-inline.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/malloc.m4 \ $(top_srcdir)/gnulib/m4/nocrash.m4 \ $(top_srcdir)/gnulib/m4/off_t.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/realloc.m4 \ $(top_srcdir)/gnulib/m4/ssize_t.m4 \ $(top_srcdir)/gnulib/m4/stdarg.m4 \ $(top_srcdir)/gnulib/m4/stddef_h.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/sys_types_h.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/version-etc.m4 \ $(top_srcdir)/gnulib/m4/warn-on-use.m4 \ $(top_srcdir)/gnulib/m4/wchar_t.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/liblouisutdml/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_DEPENDENCIES_CFLAGS = @BASE_DEPENDENCIES_CFLAGS@ BASE_DEPENDENCIES_LIBS = @BASE_DEPENDENCIES_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETOPT_H = @GETOPT_H@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GL_GENERATE_STDARG_H_FALSE = @GL_GENERATE_STDARG_H_FALSE@ GL_GENERATE_STDARG_H_TRUE = @GL_GENERATE_STDARG_H_TRUE@ GL_GENERATE_STDDEF_H_FALSE = @GL_GENERATE_STDDEF_H_FALSE@ GL_GENERATE_STDDEF_H_TRUE = @GL_GENERATE_STDDEF_H_TRUE@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_HELP2MAN_FALSE = @HAVE_HELP2MAN_FALSE@ HAVE_HELP2MAN_TRUE = @HAVE_HELP2MAN_TRUE@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE__EXIT = @HAVE__EXIT@ HELP2MAN = @HELP2MAN@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBINTL = @LIBINTL@ LIBLOUISUTDML_AGE = @LIBLOUISUTDML_AGE@ LIBLOUISUTDML_CURRENT = @LIBLOUISUTDML_CURRENT@ LIBLOUISUTDML_REVISION = @LIBLOUISUTDML_REVISION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ RANLIB = @RANLIB@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDARG_H = @STDARG_H@ STDDEF_H = @STDDEF_H@ STRIP = @STRIP@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VERSION = @VERSION@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_F77 = @ac_ct_F77@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: liblouisutdml-2.5.0/liblouisutdml/0000775000076500007650000000000012222613352014311 500000000000000liblouisutdml-2.5.0/liblouisutdml/transcribe_music.c0000664000076500007650000000615112054461273017742 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and abilitiessoft, Inc. www.abilitiessoft.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #include #include #include "louisutdml.h" static void musicText (xmlNode * node, int action); static void musicCdata (xmlNode * node); static int musicEmptyElement (xmlNode * node); int transcribe_music (xmlNode * node, int action) { xmlNode *child; int branchCount = 0; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case no: if (ud->text_length > 0 && ud->text_length < MAX_LENGTH && ud->text_buffer[ud->text_length - 1] > 32) ud->text_buffer[ud->text_length++] = 32; break; case skip: if (action != 0) pop_sem_stack (); return 0; case math: transcribe_math (node, 0); if (action != 0) pop_sem_stack (); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: insert_code (node, branchCount); branchCount++; if (child->children) transcribe_paragraph (child, 1); else musicEmptyElement (child); break; case XML_TEXT_NODE: musicText (child, action); break; case XML_CDATA_SECTION_NODE: musicCdata (child); break; default: break; } child = child->next; } insert_code (node, branchCount); insert_code (node, -1); if (action != 0) { pop_sem_stack (); return 1; } switch (ud->stack[ud->top]) { case para: write_paragraph (para, NULL); break; default: break; } pop_sem_stack (); return 1; } static int musicEmptyElement (xmlNode * node) { push_sem_stack (node); switch (ud->stack[ud->top]) { case softreturn: insert_code (node, 0); break; case boxline: break; case blankline: break; case newpage: break; case righthandpage: break; default: break; } pop_sem_stack (); return 1; } static void musicText (xmlNode * node, int action) { insert_text (node); } static void musicCdata (xmlNode * node) { insert_utf8 (node->content); } liblouisutdml-2.5.0/liblouisutdml/paths.c0000664000076500007650000000771512130746412015530 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include #include "louisutdml.h" static char *lastPath = NULL; static int addPath (const char *path) { int k; int curLen = strlen (ud->path_list); if ((curLen + 1 + strlen (path)) >= sizeof (ud->path_list)) return 0; if (path[0] == 0) return 1; for (k = 0; path[k]; k++) if (path[k] == ',') { lou_logPrint ("Path %s must not contain a comma", path); return 0; } if (curLen > 0) { ud->path_list[curLen++] = ','; ud->path_list[curLen] = 0; } lastPath = &ud->path_list[strlen (ud->path_list)]; strcpy (lastPath, path); return 1; } int set_paths (const char *configPath) { char currentPath[MAXNAMELEN]; char *dataPath = NULL; char *writePath = NULL; /*Set configuration path first*/ ud->config_path = NULL; if (configPath != NULL && configPath[0] != 0) { ud->config_path = alloc_string (configPath); if (!addPath (configPath)) return 0; } /*Set other paths here*/ /* First, see if the program has set a path. */ dataPath = lou_getDataPath (); if (dataPath) { #ifdef _Win32 strcpy (currentPath, dataPath); strcat (currentPath, "\\liblouis\\tables\\"); if (!addPath (currentPath)) return 0; strcpy (currentPath, dataPath); strcat (currentPath, "\\liblouisutdml\\lbu_files\\"); ud->lbu_files_path = alloc_string (currentPath); if (!addPath (currentPath)) return 0; #else strcpy (currentPath, dataPath); strcat (currentPath, "/liblouis/tables/"); if (!addPath (currentPath)) return 0; strcpy (currentPath, dataPath); strcat (currentPath, "/liblouisutdml/lbu_files/"); ud->lbu_files_path = alloc_string (currentPath); if (!addPath (currentPath)) return 0; #endif } else { #ifdef _WIN32 /* Set Windows Paths */ { char louisPath[MAXNAMELEN]; char lbuPath[MAXNAMELEN]; strcpy (currentPath, lou_getProgramPath ()); strcat (currentPath, "..\\"); if (!addPath (currentPath)) return 0; strcpy (lbuPath, currentPath); strcat (lbuPath, "share\\liblouisutdml\\lbu_files\\"); ud->lbu_files_path = alloc_string (lbuPath); strcpy (louisPath, currentPath); strcat (louisPath, "share\\liblouis\\tables\\"); addPath (louisPath); addPath (lbuPath); } #else /* Set Unix paths (Linux, Mac OS X, etc.) */ addPath (LIBLOUIS_TABLES_PATH); addPath (LBU_PATH); ud->lbu_files_path = alloc_string (LBU_PATH); #endif /*WWIN32 */ } /* set current directory last*/ currentPath[0] = '.'; currentPath[1] = ud->file_separator; currentPath[2] = 0; if (!addPath (currentPath)) return 0; if ((writePath = lbu_getWriteablePath ()) == NULL) lbu_setWriteablePath (lastPath); else { currentPath[0] = ud->file_separator; currentPath[1] = 0; strcat (writePath, currentPath); } return 1; } liblouisutdml-2.5.0/liblouisutdml/README0000664000076500007650000000007612054461273015122 00000000000000If you change sem_enum.h be sure to run make -f Makesemnames liblouisutdml-2.5.0/liblouisutdml/liblouisutdml.c0000664000076500007650000003225012171520736017275 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include "config.h" #include #include #include #include "louisutdml.h" #include UserData *ud = NULL; char *EXPORT_CALL lbu_version () { static char *version = PACKAGE_VERSION; static char bothVersions[60]; strcpy (bothVersions, version); strcat (bothVersions, " "); strcat (bothVersions, lou_version ()); return bothVersions; } void libxml_errors (void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { va_list args; char buffer[MAXNAMELEN]; va_start (args, msg); memset (buffer, 0, sizeof (buffer)); vsnprintf (buffer, sizeof (buffer) - 4, msg, args); va_end (args); lou_logPrint ("%s", buffer); } static xmlParserCtxt *ctxt; static int libxml2_initialized = 0; static void cleanupLibxml () { destroy_semantic_table (); if (ud->doc != NULL) xmlFreeDoc (ud->doc); if (!libxml2_initialized) return; xmlCleanupParser (); initGenericErrorDefaultFunc (NULL); xmlFreeParserCtxt (ctxt); } static void freeEverything () { lou_logEnd (); cleanupLibxml (); lbu_free (); } static int processXmlDocument (const char *inputDoc, int length) { /*This function does all processing of xml documents as such. * If length is 0 the document is assumed to be a file. * If length is not 0 it is assumed to be in memory. * Sort of hackish, but only hackers will see it. */ xmlNode *rootElement = NULL; int haveSemanticFile; if (!libxml2_initialized) { libxml2_initialized = 1; LIBXML_TEST_VERSION xmlKeepBlanksDefault (0); xmlSubstituteEntitiesDefault (1); xmlThrDefIndentTreeOutput (1); xmlThrDefKeepBlanksDefaultValue (0); xmlThrDefLineNumbersDefaultValue (1); } ud->doc = NULL; ctxt = xmlNewParserCtxt (); xmlSetGenericErrorFunc (ctxt, libxml_errors); if (length == 0) { if ((ud->mode & htmlDoc)) ud->doc = htmlParseFile (inputDoc, NULL); else { if (ud->internet_access) ud->doc = xmlCtxtReadFile (ctxt, inputDoc, NULL, XML_PARSE_DTDVALID | XML_PARSE_NOENT); else ud->doc = xmlParseFile (inputDoc); if (ud->doc == NULL) { lou_logPrint ("Document could not be processed; may be \ malformed or contain illegal characters"); cleanupLibxml (); return 0; } } } else ud->doc = xmlParseMemory (inputDoc, length); if (ud->doc == NULL) { lou_logPrint ("Document could not be processed, probably malformed"); cleanupLibxml (); return 0; } if (ud->doc->encoding == NULL) { lou_logPrint ("Encoding, preferably UTF-8, must be specified"); cleanupLibxml (); return 0; } if (ud->format_for >= utd && ignore_case_comp (ud->doc->encoding, "UTF-8", 5) != 0) { lou_logPrint ("UTDML requires UTF-8 encoding, not '%s'", ud->doc->encoding); cleanupLibxml (); return 0; } rootElement = xmlDocGetRootElement (ud->doc); if (rootElement == NULL) { lou_logPrint ("Document is empty"); cleanupLibxml (); return 0; } if (ud->mode & convertOnly) convert_utd (); else { haveSemanticFile = compile_semantic_table (rootElement); do_xpath_expr (); examine_document (rootElement); append_new_entries (); /* This will generate a new semantic-action file if none exists * and newEntries is yes in the configuration file. * Otherwise it generates a new_enhtries file.*/ if (!haveSemanticFile) { cleanupLibxml (); return 0; } if (!transcribe_document (rootElement)) { lou_logPrint ("Document could not be transcribed"); cleanupLibxml (); return 0; } } cleanupLibxml (); return 1; } void *EXPORT_CALL lbu_initialize (const char *configFileList, const char *logFileName, const char *settingsString) { if (!read_configuration_file (configFileList, logFileName, settingsString, 0)) return NULL; return (void *) ud; } int EXPORT_CALL lbu_translateString (const char *configFileList, const char *inbuf, int inlen, widechar * outbuf, int *outlen, const char *logFileName, const char *settingsString, unsigned int mode) { /* Translate the well-formed xml expression in inbuf into braille * according to the specifications in configFileList. If the expression * is not well-formed or there are oteer errors, return 0.*/ int k; char *xmlInbuf; if (!read_configuration_file (configFileList, logFileName, settingsString, mode)) return 0; if (inbuf == NULL || outbuf == NULL || outlen == NULL) return 0; ud->inbuf = inbuf; ud->inlen = inlen; ud->outbuf = outbuf; ud->outlen = *outlen; ud->inFile = ud->outFile = NULL; for (k = 0; k < inlen; k++) if (inbuf[k] > ' ') break; if (inbuf[k] != '<') { if (ud->format_for == utd) k = utd_transcribe_text_string (); else k = transcribe_text_string (); *outlen = ud->outlen_so_far; lou_logEnd (); return k; } if (inbuf[k + 1] == '?') xmlInbuf = (char *) inbuf; else { inlen += strlen (ud->xml_header); if (!(xmlInbuf = malloc (inlen + 4))) { lou_logPrint ("Not enough memory"); return 0; } strcpy (xmlInbuf, ud->xml_header); strcat (xmlInbuf, "\n"); strcat (xmlInbuf, inbuf); } k = processXmlDocument (xmlInbuf, inlen); *outlen = ud->outlen_so_far; if (xmlInbuf != inbuf) free (xmlInbuf); lou_logEnd (); return k; } int EXPORT_CALL lbu_translateFile (const char *configFileList, const char *inFileName, const char *outFileName, const char *logFileName, const char *settingsString, unsigned int mode) { /* Translate the well-formed xml expression in inFileName into * braille according to the specifications in configFileList. If the * expression is not well-formed or there are other errors, * return 0. */ int k; if (!read_configuration_file (configFileList, logFileName, settingsString, mode)) return 0; if (inFileName == NULL || outFileName == NULL) return 0; if (strcmp (outFileName, "stdout")) { if (!(ud->outFile = fopen (outFileName, "wb"))) { lou_logPrint ("Can't open output file %s.", outFileName); return 0; } } else ud->outFile = stdout; k = processXmlDocument (inFileName, 0); if (ud->outFile != stdout) fclose (ud->outFile); lou_logEnd (); return k; } int EXPORT_CALL lbu_translateTextFile (const char *configFileList, const char *inFileName, const char *outFileName, const char *logFileName, const char *settingsString, unsigned int mode) { /* Translate the text file in inFileName into braille according to * the specifications in configFileList. If there are errors, print * an error message and return 0.*/ int k; widechar outbuf[2 * BUFSIZE]; if (!read_configuration_file (configFileList, logFileName, settingsString, mode)) return 0; if (inFileName == NULL || outFileName == NULL) return 0; ud->outbuf = outbuf; ud->outlen = (sizeof (outbuf) / CHARSIZE) - 4; if (strcmp (inFileName, "stdin")) { if (!(ud->inFile = fopen (inFileName, "rb"))) { lou_logPrint ("Can't open input file %s.", inFileName); return 0; } } else ud->inFile = stdin; if (strcmp (outFileName, "stdout")) { if (!(ud->outFile = fopen (outFileName, "wb"))) { lou_logPrint ("Can't open output file %s.", outFileName); return 0; } } else ud->outFile = stdout; if (ud->format_for == utd) k = utd_transcribe_text_file (); else k = transcribe_text_file (); if (!k) { freeEverything (); return 0; } if (ud->inFile != stdin) fclose (ud->inFile); if (ud->outFile != stdout) fclose (ud->outFile); lou_logEnd (); return k; } int EXPORT_CALL lbu_backTranslateString (const char *configFileList, const char *inbuf, int inlen, widechar * outbuf, int *outlen, const char *logFileName, const char *settingsString, unsigned int mode) { int k; if (!read_configuration_file (configFileList, logFileName, settingsString, mode)) return 0; if (inbuf == NULL || outbuf == NULL || outlen == NULL) return 0; ud->inbuf = inbuf; ud->inlen = inlen; ud->outbuf = outbuf; ud->outlen = *outlen; ud->inFile = ud->outFile = NULL; if (ud->format_for == utd) k = utd_back_translate_braille_string (); else k = back_translate_braille_string (); if (!k) { freeEverything (); return 0; } *outlen = ud->outlen_so_far; lou_logEnd (); return 1; } int EXPORT_CALL lbu_backTranslateFile (const char *configFileList, const char *inFileName, const char *outFileName, const char *logFileName, const char *settingsString, unsigned int mode) { /* Back translate the braille file in inFileName into either an * xml file or a text file according to * the specifications in configFileList. If there are errors, print an * error message and return 0.*/ int k; widechar outbuf[2 * BUFSIZE]; if (!read_configuration_file (configFileList, logFileName, settingsString, mode)) return 0; if (inFileName == NULL || outFileName == NULL) return 0; ud->outbuf = outbuf; ud->outlen = (sizeof (outbuf) / CHARSIZE) - 4; if (strcmp (inFileName, "stdin")) { if (!(ud->inFile = fopen (inFileName, "rb"))) { lou_logPrint ("Can't open input file %s.", inFileName); return 0; } } else ud->inFile = stdin; if (strcmp (outFileName, "stdout")) { if (!(ud->outFile = fopen (outFileName, "wb"))) { lou_logPrint ("Can't open output file %s.", outFileName); return 0; } } else ud->outFile = stdout; if (ud->format_for == utd) k = utd_back_translate_file (); else k = back_translate_file (); if (!k) { freeEverything (); return 0; } if (ud->inFile != stdin) fclose (ud->inFile); if (ud->outFile != stdout) fclose (ud->outFile); lou_logEnd (); return 1; } static char writeablePath[MAXNAMELEN]; static char *writeablePathPtr = NULL; char *EXPORT_CALL lbu_setWriteablePath (const char *path) { writeablePathPtr = NULL; if (path == NULL) return NULL; strcpy (writeablePath, path); writeablePathPtr = writeablePath; return writeablePathPtr; } char *EXPORT_CALL lbu_getWriteablePath () { return writeablePathPtr; } int EXPORT_CALL lbu_charToDots (const char *tableList, const unsigned char *inbuf, unsigned char *outbuf, int length, const char *logFile, unsigned int mode) { widechar *interBuf; int wcLength; int utf8Length; int result = 0; if (tableList == NULL || inbuf == NULL || outbuf == NULL) return 0; lou_logFile (logFile); interBuf = malloc (length * CHARSIZE); utf8Length = length; wcLength = length; utf8_string_to_wc (inbuf, &utf8Length, interBuf, &wcLength); result = lou_charToDots (tableList, interBuf, interBuf, wcLength, mode | ucBrl); if (result) { utf8Length = length; wc_string_to_utf8 (interBuf, &wcLength, outbuf, &utf8Length); } lou_logEnd (); free (interBuf); return result; } int EXPORT_CALL lbu_dotsToChar (const char *tableList, const unsigned char *inbuf, unsigned char *outbuf, int length, const char *logFile, unsigned int mode) { widechar *interBuf; int wcLength; int utf8Length; int result = 0; if (tableList == NULL || inbuf == NULL || outbuf == NULL) return 0; lou_logFile (logFile); interBuf = malloc (length * CHARSIZE); utf8Length = length; wcLength = length; utf8_string_to_wc (inbuf, &utf8Length, interBuf, &wcLength); result = lou_dotsToChar (tableList, interBuf, interBuf, wcLength, mode); if (result) { utf8Length = length; wc_string_to_utf8 (interBuf, &wcLength, outbuf, &utf8Length); } lou_logEnd (); free (interBuf); return result; } int EXPORT_CALL lbu_checkTable (const char *tableList, const char *logFile, unsigned int mode) { int result = 1; lou_logFile (logFile); if (!lou_getTable (tableList)) result = 0; lou_logEnd (); return result; } void EXPORT_CALL lbu_free () { /* Free all memory used by liblouisutdml. You MUST call this function at * the END of your application.*/ lou_logEnd (); lou_free (); destroy_semantic_table (); if (ud != NULL) free (ud); ud = NULL; } liblouisutdml-2.5.0/liblouisutdml/Makefile.am0000664000076500007650000000222212054461273016271 00000000000000INCLUDES = \ -I$(top_srcdir) \ -DLBU_PATH=\"$(datadir)/liblouisutdml/lbu_files/\" \ -DLIBLOUIS_TABLES_PATH=\"$(datadir)/liblouis/tables/\" liblouisutdmlincludedir = $(includedir)/liblouisutdml liblouisutdmlinclude_HEADERS = \ liblouisutdml.h \ louisutdml.h lib_LTLIBRARIES = liblouisutdml.la liblouisutdml_la_CFLAGS = \ $(BASE_DEPENDENCIES_CFLAGS) liblouisutdml_la_LDFLAGS = \ -version-info \ $(LIBLOUISUTDML_CURRENT):$(LIBLOUISUTDML_REVISION):$(LIBLOUISUTDML_AGE) \ -no-undefined \ $(BASE_DEPENDENCIES_LIBS) liblouisutdml_la_SOURCES = \ ../java/Jliblouisutdml.h \ ../java/Jliblouisutdml.c \ change_table.c \ makeContents.c \ examine_document.c \ liblouisutdml.c \ liblouisutdml.h \ louisutdml.h \ paths.c \ readconfig.c \ semantics.c \ sem_enum.h \ sem_names.h \ transcribe_cdataSection.c \ transcribe_chemistry.c \ transcribe_computerCode.c \ transcribe_document.c \ transcribe_graphic.c \ transcribe_math.c \ transcribe_music.c \ transcribe_paragraph.c \ convert_utd.c \ utd2transinxml.c \ utd2dsbible.c \ utd2brf.c \ utd2pef.c \ utd2volumes.c \ transcriber.c EXTRA_DIST = \ README \ make_sem_names.c \ Makesemnames liblouisutdml-2.5.0/liblouisutdml/transcribe_math.c0000664000076500007650000000755012113644123017550 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" static int mathTrans (); static void mathText (xmlNode * node, int action); static xmlNode *mathRoot; int transcribe_math (xmlNode * node, int action) { StyleType *style; xmlNode *child; int branchCount = 0; if (node == NULL) return 0; if (action == 0) { insert_translation (ud->main_braille_table); mathRoot = node; } else push_sem_stack (node); switch (ud->stack[ud->top]) { case skip: pop_sem_stack (); return 1; case reverse: do_reverse (node); break; default: break; } if ((style = is_style (node)) != NULL) start_style (style, node); child = node->children; while (child) { insert_code (node, branchCount); branchCount++; switch (child->type) { case XML_ELEMENT_NODE: transcribe_math (child, 1); break; case XML_TEXT_NODE: mathText (child, 1); break; case XML_CDATA_SECTION_NODE: transcribe_cdataSection (child); break; default: break; } child = child->next; } insert_code (node, branchCount); insert_code (node, -1); if (style) { mathTrans (); end_style (); } pop_sem_stack (); if (action == 0) mathTrans (); return 1; } static int mathTrans () { int translationLength; int translatedLength; int k; ud->needs_editing = 1; translatedLength = MAX_TRANS_LENGTH - ud->translated_length; translationLength = ud->text_length; if (ud->format_for == utd) { xmlNode *curBrlNode; xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "brl"); xmlSetProp (newNode, (xmlChar *) "modifiers", (xmlChar *) "notext"); curBrlNode = xmlAddNextSibling (mathRoot, newNode); link_brl_node (curBrlNode); ud->text_buffer[ud->text_length++] = ENDSEGMENT; translationLength++; k = lou_translate (ud->mathexpr_table_name, ud->text_buffer, &translationLength, &ud-> translated_buffer[ud->translated_length], &translatedLength, (char *) ud->typeform, NULL, NULL, NULL, NULL, dotsIO); ud->in_sync = 0; memset (ud->typeform, 0, sizeof (ud->typeform)); ud->text_length = 0; if (!k) { lou_logPrint ("Could not open table %s", ud->mathexpr_table_name); ud->mathexpr_table_name = NULL; return 0; } if ((ud->translated_length + translatedLength) < MAX_TRANS_LENGTH) ud->translated_length += translatedLength; else ud->translated_length = MAX_TRANS_LENGTH; } else insert_translation (ud->mathexpr_table_name); return 1; } static void mathText (xmlNode * node, int action) { if (ud->stack[ud->top] == mtext) { mathTrans (); insert_text (node); } else insert_utf8 (node->content); } liblouisutdml-2.5.0/liblouisutdml/transcribe_chemistry.c0000664000076500007650000000666612054461273020644 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and abilitiessoft, Inc. www.abilitiessoft.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #include #include #include "louisutdml.h" static void chemText (xmlNode * node, int action); static void chemCdata (xmlNode * node); static int chemEmptyElement (xmlNode * node); int transcribe_chemistry (xmlNode * node, int action) { xmlNode *child; int branchCount = 0; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case no: if (ud->text_length > 0 && ud->text_length < MAX_LENGTH && ud->text_buffer[ud->text_length - 1] > 32) ud->text_buffer[ud->text_length++] = 32; break; case skip: if (action != 0) pop_sem_stack (); return 0; case math: transcribe_math (node, 0); if (action != 0) pop_sem_stack (); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: insert_code (node, branchCount); branchCount++; if (child->children) transcribe_paragraph (child, 1); else chemEmptyElement (child); break; case XML_TEXT_NODE: chemText (child, action); break; case XML_CDATA_SECTION_NODE: chemCdata (child); break; default: break; } child = child->next; } insert_code (node, branchCount); insert_code (node, -1); if (action != 0) { pop_sem_stack (); return 1; } switch (ud->stack[ud->top]) { case para: write_paragraph (para, NULL); break; case heading10: case heading9: case heading8: case heading7: case heading6: case heading5: case heading4: case heading3: write_paragraph (para, NULL); break; case heading2: write_paragraph (para, NULL); break; case heading1: write_paragraph (para, NULL); break; default: break; } pop_sem_stack (); return 1; } static int chemEmptyElement (xmlNode * node) { push_sem_stack (node); switch (ud->stack[ud->top]) { case softreturn: insert_code (node, 0); break; case boxline: break; case blankline: break; case newpage: break; case righthandpage: break; default: break; } pop_sem_stack (); return 1; } static void chemText (xmlNode * node, int action) { insert_text (node); } static void chemCdata (xmlNode * node) { insert_utf8 (node->content); } liblouisutdml-2.5.0/liblouisutdml/sem_names.h0000664000076500007650000000273612151505061016357 00000000000000#ifndef __SEM_NAMES_h #define __SEM_NAMES_h static const char *semNames[] = { "no", "skip", "generic", "cdata", "htmllink", "htmltarget", "changetable", "reverse", "configfile", "configstring", "configtweak", "document", "para", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6", "heading7", "heading8", "heading9", "heading10", "contentsheader", "contents1", "contents2", "contents3", "contents4", "contents5", "contents6", "contents7", "contents8", "contents9", "contents10", "notranslate", "compbrl", "uncontracted", "contracted", "pagenum", "genpurp1", "genpurp2", "pagebreak", "attrtotext", "runninghead", "footer", "boxline", "italicx", "boldx", "underlinex", "linespacing", "blankline", "softreturn", "newpage", "righthandpage", "code", "music", "math", "mi", "mn", "mo", "mtext", "mspace", "ms", "mglyph", "mrow", "mfrac", "msqrt", "mroot", "mstyle", "merror", "mpadded", "mphantom", "mfenced", "menclose", "msub", "msup", "msubsup", "munder", "mover", "munderover", "mmultiscripts", "none", "semantics", "mprescripts", "mtable", "mtr", "mtd", "maligngroup", "malignmark", "mlabeledtr", "maction", "chemistry", "graphic", "markhead", "utdmeta", "utdbrl", "utdnewpage", "utdnewline", "utdbrlonly", "utddispimg", "utdinlnimg", "end_all", NULL }; #endif /*__SEM_NAMES_H*/ liblouisutdml-2.5.0/liblouisutdml/change_table.c0000664000076500007650000000436312054461273017005 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" int change_table (xmlNode * node) { xmlNode *child; int branchCount = 0; const char *oldTable; const char *newTable; char completePath[MAXNAMELEN]; newTable = (char *) get_attr_value (node); if (strlen ((char *) newTable) < 5) return 0; if (!find_file (newTable, completePath)) { lou_logPrint ("Table %s cannot be found", newTable); return 0; } if (!lou_getTable (completePath)) return 0; insert_translation (ud->main_braille_table); oldTable = ud->main_braille_table; ud->main_braille_table = completePath; child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: insert_code (node, branchCount); branchCount++; if (child->children) transcribe_paragraph (child, 1); break; case XML_TEXT_NODE: insert_text (child); break; default: break; } child = child->next; } insert_code (node, branchCount); insert_code (node, -1); insert_translation (ud->main_braille_table); ud->main_braille_table = oldTable; pop_sem_stack (); return 1; } liblouisutdml-2.5.0/liblouisutdml/sem_enum.h0000664000076500007650000000504112151505046016213 00000000000000/* libloluisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ /* Semantic actions */ typedef enum { /* General */ no = 0, skip, generic, cdata, htmllink, htmltarget, changetable, reverse, configfile, configstring, configtweak, /* reserved styles */ document, para, heading1, heading2, heading3, heading4, heading5, heading6, heading7, heading8, heading9, heading10, contentsheader, contents1, contents2, contents3, contents4, contents5, contents6, contents7, contents8, contents9, contents10, /* translation */ notranslate, compbrl, uncontracted, contracted, /* General text */ pagenum, /* Use next 2 for anything. */ genpurp1, genpurp2, pagebreak, attrtotext, runninghead, footer, boxline, italicx, boldx, underlinex, linespacing, blankline, softreturn, newpage, righthandpage, code, music, /* MathML */ math, mi, mn, mo, mtext, mspace, ms, mglyph, mrow, mfrac, msqrt, mroot, mstyle, merror, mpadded, mphantom, mfenced, menclose, msub, msup, msubsup, munder, mover, munderover, mmultiscripts, none, semantics, mprescripts, mtable, mtr, mtd, maligngroup, malignmark, mlabeledtr, maction, /* Other technical notations */ chemistry, graphic, /* Needed by UTD */ markhead, utdmeta, utdbrl, utdnewpage, utdnewline, utdbrlonly, utddispimg, utdinlnimg, /* End marker */ end_all } sem_act; liblouisutdml-2.5.0/liblouisutdml/liblouisutdml.h0000664000076500007650000001366212116532331017301 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #ifndef __LIBLOUISUTDML_H_ #define __LIBLOUISUTDML_H_ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Function prototypes are documented briefly below. For more extensive documentation see liblouisutdml.html or type info liblouisutdml. */ #ifndef EXPORT_CALL #ifdef _WIN32 #define EXPORT_CALL __stdcall char *EXPORT_CALL lou_getProgramPath (void); #else #define EXPORT_CALL #endif #endif char *EXPORT_CALL lbu_version (void); /* Returns the version of liblouisutdml and liblouis. */ void *EXPORT_CALL lbu_initialize (const char *configFileList, const char *logFileName, const char *settingsString); /* This function initializes the libxml2 library, runs liblouisutdml.ini and processes the configuration file given in configFileList, sets up a log file if logFileName is not NULL and processes the settings in settingsString if this is not null. It returns a pointer to the UserData structure. This pointer is void and must be cast to (UserData *) in the calling program. To access the information in this structure you must include louisutdml.h */ /* Enumeration values to be used in mode parameter. may be ored. * liblouis uses the low-order bits, liblouisutdml uses the high-order * bits,*/ typedef enum { doInit = 1 << 30, htmlDoc = 1 << 29, notUC = 1 << 28, notSync = 1<<27, utdInput = 1<<26, convertOnly = 1<<25, louisDots = 1<<24 } ProcessingModes; int EXPORT_CALL lbu_translateString (const char *configFileList, const char *inbuf, int inlen, widechar *outbuf, int *outlen, const char *logFileName, const char *settingsString, unsigned int mode); /* This function takes a well-formed xml expression in inbuf and translates it into a string of 16- or 32-bit braille characters in outbuf. The xml expression must be immediately followed by a zero or null byte. If it does not begin with an xul header, one is added. The header is specified by the xmlHeader line in the configuration file. If no such line is present, a default header specifying UTF-8 encoding is used. The configFileList parameter points to a configuration file. liblouisutdml.ini is processed before this file. Note that the *outlen parameter is a pointer to an integer. When the function is called, this integer contains the maximum output length. When it returns, it is set to the actual length used. The mode parameter is used to pass options to liblouisutdml which are applied before any configuration fpe is processed. For now, if mode is 0, a full initialization is cone. If it is 1 only a few things are reset to prepare for a new document. The function returns 1 if no errors were encountered and a negative number if a conplete translation could not be done. */ int EXPORT_CALL lbu_backTranslateString (const char *configFileList, const char *inbuf, int inlen, widechar *outbuf, int *outlen, const char *logFileName, const char *settingsString, unsigned int mode); int EXPORT_CALL lbu_translateFile (const char *configFileList, const char *inputFileName, const char *outputFileName, const char *logFileName, const char *settingsString, unsigned int mode); int EXPORT_CALL lbu_translateTextFile (const char *configFileList, const char *inputFileName, const char *outputFileName, const char *logFileName, const char *settingsString, unsigned int mode); int EXPORT_CALL lbu_backTranslateFile (const char *configFileList, const char *inputFileName, const char *outputFileName, const char *logFileName, const char *settingsString, unsigned int mode); int EXPORT_CALL lbu_charToDots (const char *tableList, const unsigned char *inbuf, unsigned char *outbuf, int length, const char *logFile, unsigned int mode); /* Convert the utf8 character string in inbuf to Unicode braille dot patterns and place the result as a utf8 string in outbuf. */ int EXPORT_CALL lbu_dotsToChar (const char *tableList, const unsigned char *inbuf, unsigned char *outbuf, int length, const char *logFile, unsigned int mode); /* Convert the utf8 string of dot patterns in inbuf to characters and place the result as a utf8 string in outbuf. */ int EXPORT_CALL lbu_checkTable (const char *tableList, const char *logFile, unsigned int mode); /* See if the table in tableList exists and is valid. If no errors are found logFile will be empty. */ /* Set/get the path to which temporary files will be written */ char *EXPORT_CALL lbu_setWriteablePath (const char *path); char *EXPORT_CALL lbu_getWriteablePath (); /* This function should be called at the end of the application to free all memory allocated by liblouisutdml or liblouis. */ void EXPORT_CALL lbu_free (void); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /*__LIBLOUISUTDML_H_ */ liblouisutdml-2.5.0/liblouisutdml/transcriber.c0000664000076500007650000042046612216331757016740 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and Abilitiessoft, Inc. www.abilitiessoft.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #include #include #include #include "louisutdml.h" static StyleRecord *styleSpec; /* Note that the following is an actual data area, not a pointer*/ static StyleRecord prevStyleSpec; static StyleType *style; static StyleType *prevStyle; static int styleBody (); int fineFormat () { if (ud->text_length == 0 && ud->translated_length == 0) return 1; else { insert_translation (ud->main_braille_table); if (styleSpec == NULL) write_paragraph (para, NULL); else styleBody (); styleSpec->status = resumeBody; } return 1; } StyleType * find_current_style () { StyleRecord *sr = &ud->style_stack[ud->style_top]; return sr->style; } static int doLeftJustify (); static widechar pageNumberString[MAXNUMLEN]; static int pageNumberLength; static char *blanks = " "; static int fillPage (); static int writeOutbuf (); static int insertCharacters (char *chars, int length); void widecharcpy (widechar * to, const widechar * from, int length); void widestrcpy (widechar * to, const widechar * from) { widecharcpy (to, from, -1); } void widecharcpy (widechar * to, const widechar * from, int length) { int k; if (length < 0) { for (k = 0; from[k]; k++) to[k] = from[k]; } else { for (k = 0; k < length; k++) to[k] = from[k]; } to[k] = 0; } void unsignedcharcpy (char *to, const char *from, int length) { int k; for (k = 0; k < length; k++) to[k] = from[k]; to[k] = 0; } void charcpy (char *to, const char *from, int length) { int k; for (k = 0; k < length; k++) to[k] = from[k]; to[k] = 0; } static char *makeRomanNumber (int n); static int utd_start (); static int utd_finish (); static int utd_insert_translation (const char *table); static void utd_insert_text (xmlNode * node, int length); static int utd_makeBlankLines (int number, int beforeAfter); static void utd_pagebreak (xmlNode * node, char *printPageNumber, int length); static int utd_startStyle (); static int utd_styleBody (); static int utd_finishStyle (); static const TranslationTableHeader *firstTableHeader; static const char *firstTableName; static TranslationTableRule * getLiblouisRule (TranslationTableOffset offset) { if (offset == 0) return NULL; return (TranslationTableRule *) & firstTableHeader->ruleArea[offset]; } int start_document () { ud->head_node = NULL; if (ud->has_math) firstTableName = ud->main_braille_table = ud->mathtext_table_name; else firstTableName = ud->main_braille_table = ud->contracted_table_name; if (!(firstTableHeader = lou_getTable (ud->main_braille_table))) { lou_logPrint ("Cannot open main table %s", ud->main_braille_table); return 0; } if (ud->has_contentsheader) ud->braille_page_number = 1; else ud->braille_page_number = ud->beginning_braille_page_number; ud->outbuf1_len_so_far = 0; styleSpec = &prevStyleSpec; style = prevStyle = lookup_style ("document"); prevStyleSpec.style = prevStyle; if (ud->format_for != utd) { if (ud->outFile && ud->output_encoding == utf16) { /*Little Endian indicator */ fputc (0xff, ud->outFile); fputc (0xfe, ud->outFile); } switch (ud->format_for) { case textDevice: break; case browser: if (!insertCharacters ("HTML Document
",
	       58))
	    return 0;
	  if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd)))
	    return 0;
	  writeOutbuf ();
	  break;
	default:
	  break;
	}
    }
  if (ud->contents && !ud->has_contentsheader)
    initialize_contents ();
  if (ud->format_for == utd)
    return utd_start ();
  return 1;
}

int
end_document ()
{
  if (ud->format_for == utd)
    return utd_finish ();
  if (ud->style_top < 0)
    ud->style_top = 0;
  if (ud->text_length != 0)
    insert_translation (ud->main_braille_table);
  if (ud->translated_length != 0)
    write_paragraph (para, NULL);
  if (ud->braille_pages)
    {
      fillPage ();
      writeOutbuf ();
    }
  if (ud->contents)
    make_contents ();
  switch (ud->format_for)
    {
    case textDevice:
      break;
    case browser:
      if (!insertCharacters ("
", 20)) return 0; if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; writeOutbuf (); break; default: break; } return 1; } static int isLineend (int *c) { if (c[0] == 10 && c[1] == 13) return 2; else if (c[0] == 10 || c[0] == 13) return 1; else return 0; } int transcribe_text_string () { int charsProcessed = 0; int charsInParagraph = 0; int ch; int pch = 0; unsigned char paragraphBuffer[BUFSIZE]; StyleType *docStyle = lookup_style ("document"); StyleType *paraStyle = lookup_style ("para"); if (!start_document ()) return 0; ud->input_encoding = ud->input_text_encoding; start_style (docStyle, NULL); while (1) { while (charsProcessed < ud->inlen) { start_style (paraStyle, NULL); ch = ud->inbuf[charsProcessed++]; if (ch == 0 || ch == 13) continue; if (ch == '\n' && pch == '\n') break; if (charsInParagraph == 0 && ch <= 32) continue; pch = ch; if (ch == 10) ch = ' '; if (charsInParagraph >= MAX_LENGTH) break; paragraphBuffer[charsInParagraph++] = ch; } if (charsInParagraph == 0) break; ch = ud->inbuf[charsProcessed++]; paragraphBuffer[charsInParagraph] = 0; if (!insert_utf8 (paragraphBuffer)) return 0; if (!insert_translation (ud->main_braille_table)) return 0; if (ch == 10) do_blankline (); end_style (paraStyle); charsInParagraph = 0; pch = 0; if (ch > 32) paragraphBuffer[charsInParagraph++] = ch; } ud->input_encoding = utf8; end_style (docStyle); end_document (); return 1; } int transcribe_text_file () { int charsInParagraph = 0; int ch; int pch = 0; unsigned char paragraphBuffer[BUFSIZE]; widechar outbufx[BUFSIZE]; int outlenx = MAX_LENGTH; StyleType *docStyle = lookup_style ("document"); StyleType *paraStyle = lookup_style ("para"); if (!start_document ()) return 0; start_style (docStyle, NULL); ud->outbuf = outbufx; ud->outbuf1_len = outlenx; ud->input_encoding = ud->input_text_encoding; while (1) { start_style (paraStyle, NULL); while ((ch = fgetc (ud->inFile)) != EOF) { if (ch == 0 || ch == 13) continue; if (pch == 10 && ch == 10) break; if (charsInParagraph == 0 && ch <= 32) continue; pch = ch; if (ch < 32) ch = ' '; if (charsInParagraph >= MAX_LENGTH) break; paragraphBuffer[charsInParagraph++] = ch; } if (charsInParagraph == 0) break; ch = fgetc (ud->inFile); paragraphBuffer[charsInParagraph] = 0; if (!insert_utf8 (paragraphBuffer)) return 0; if (!insert_translation (ud->main_braille_table)) return 0; if (ch == 10) do_blankline (); end_style (); charsInParagraph = 0; pch = 0; if (ch > 32) paragraphBuffer[charsInParagraph++] = ch; } ud->input_encoding = utf8; end_style (); end_document (); return 1; } #define MAXBYTES 7 static int first0Bit[MAXBYTES] = { 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0XFE }; int utf8_string_to_wc (const unsigned char *inStr, int *inSize, widechar * outstr, int *outSize) { int in = 0; int out = 0; int lastInSize = 0; int lastOutSize = 0; unsigned int ch = 0; int numBytes = 0; unsigned int utf32 = 0; int k; while (in < *inSize) { ch = inStr[in++] & 0xff; if (ch < 128 || ud->input_encoding == ascii8) { outstr[out++] = (widechar) ch; if (out >= *outSize) { *inSize = in; *outSize = out; return 1; } continue; } lastInSize = in; lastOutSize = out; for (numBytes = MAXBYTES - 1; numBytes >= 0; numBytes--) if (ch >= first0Bit[numBytes]) break; utf32 = ch & (0XFF - first0Bit[numBytes]); for (k = 0; k < numBytes; k++) { if (in >= *inSize) break; utf32 = (utf32 << 6) + (inStr[in++] & 0x3f); } if (CHARSIZE == 2 && utf32 > 0xffff) utf32 = 0xffff; outstr[out++] = (widechar) utf32; if (out >= *outSize) { *inSize = lastInSize; *outSize = lastOutSize; return 1; } } *inSize = in; *outSize = out; return 1; } int wc_string_to_utf8 (const widechar * inStr, int *inSize, unsigned char *outstr, int *outSize) { int in = 0; int out = 0; unsigned char utf8Str[10]; unsigned int utf8Bytes[MAXBYTES] = { 0, 0, 0, 0, 0, 0, 0 }; int utf8Length; int numBytes; unsigned int utf32; int k; while (in < *inSize) { utf32 = inStr[in++]; if (utf32 < 128) { utf8Str[0] = utf32; utf8Length = 1; } else { for (numBytes = 0; numBytes < MAXBYTES - 1; numBytes++) { utf8Bytes[numBytes] = utf32 & 0x3f; utf32 >>= 6; if (utf32 == 0) break; } utf8Str[0] = first0Bit[numBytes] | utf8Bytes[numBytes]; numBytes--; utf8Length = 1; while (numBytes >= 0) utf8Str[utf8Length++] = utf8Bytes[numBytes--] | 0x80; if ((out + utf8Length) > *outSize) { *inSize = in; *outSize = out; return 1; } } for (k = 0; k < utf8Length; k++) outstr[out++] = utf8Str[k]; } outstr[out++] = 0; *inSize = in; *outSize = out; return 1; } static unsigned char * wcCharToUtf8 (widechar ch) { static unsigned char utf8Str[10]; unsigned int utf8Bytes[MAXBYTES] = { 0, 0, 0, 0, 0, 0, 0 }; int numBytes; int k; unsigned int utf32; if (ch < 128) { utf8Str[0] = ch; utf8Str[1] = 0; return utf8Str; } utf32 = ch; for (numBytes = 0; numBytes < MAXBYTES - 1; numBytes++) { utf8Bytes[numBytes] = utf32 & 0x3f; utf32 >>= 6; if (utf32 == 0) break; } utf8Str[0] = first0Bit[numBytes] | utf8Bytes[numBytes]; numBytes--; k = 1; while (numBytes >= 0) utf8Str[k++] = utf8Bytes[numBytes--] | 0x80; utf8Str[k] = 0; return utf8Str; } static int utf8ToWc (const unsigned char *utf8str, int *inSize, widechar * utfwcstr, int *outSize) { int in = 0; int out = 0; int lastInSize = 0; int lastOutSize = 0; unsigned int ch; int numBytes; unsigned int utf32; int k; while (in < *inSize) { ch = utf8str[in++] & 0xff; if (ch < 128 || ud->input_encoding == ascii8) { utfwcstr[out++] = (widechar) ch; if (out >= *outSize) { *inSize = in; *outSize = out; return 1; } continue; } lastInSize = in; lastOutSize = out; for (numBytes = MAXBYTES - 1; numBytes >= 0; numBytes--) if (ch >= first0Bit[numBytes]) break; utf32 = ch & (0XFF - first0Bit[numBytes]); for (k = 0; k < numBytes; k++) { if (in >= *inSize) break; utf32 = (utf32 << 6) + (utf8str[in++] & 0x3f); } if (CHARSIZE == 2 && utf32 > 0xffff) utf32 = 0xffff; utfwcstr[out++] = (widechar) utf32; if (out >= *outSize) { *inSize = lastInSize; *outSize = lastOutSize; return 1; } } *inSize = in; *outSize = out; return 1; } static unsigned char * utfwcto8 (widechar utfwcChar) { static unsigned char utf8Str[10]; unsigned int utf8Bytes[MAXBYTES] = { 0, 0, 0, 0, 0, 0, 0 }; int numBytes; int k; unsigned int utf32; if (utfwcChar < 128) { utf8Str[0] = utfwcChar; utf8Str[1] = 0; return utf8Str; } utf32 = utfwcChar; for (numBytes = 0; numBytes < MAXBYTES - 1; numBytes++) { utf8Bytes[numBytes] = utf32 & 0x3f; utf32 >>= 6; if (utf32 == 0) break; } utf8Str[0] = first0Bit[numBytes] | utf8Bytes[numBytes]; numBytes--; k = 1; while (numBytes >= 0) utf8Str[k++] = utf8Bytes[numBytes--] | 0x80; utf8Str[k] = 0; return utf8Str; } static int minimum (int x, int y) { if (x <= y) return x; return y; } static int maximum (int x, int y) { if (x >= y) return x; return y; } int insert_utf8 (const unsigned char *text) { int length = strlen ((char *) text); int charsToDo = 0; int maxSize = 0; int charsDone = length; int outSize = MAX_LENGTH - ud->text_length; utf8ToWc (text, &charsDone, &ud->text_buffer[ud->text_length], &outSize); ud->text_length += outSize; while (charsDone < length) { /*Handle buffer overflow */ StyleType *style = find_current_style (); const char *table; if (style == NULL) style = lookup_style ("para"); switch (style->action) { case code: table = ud->compbrl_table_name; memset (ud->typeform, computer_braille, ud->text_length); break; default: table = ud->main_braille_table; break; } if (!insert_translation (table)) return 0; if (!write_paragraph (style->action, NULL)) return 0; charsToDo = minimum (MAX_LENGTH, length - charsDone); while (text[charsDone + charsToDo] > 32) charsToDo--; if (charsToDo <= 0) charsToDo = minimum (MAX_LENGTH, length - charsDone); maxSize = MAX_LENGTH; utf8ToWc (&text[charsDone], &charsToDo, &ud->text_buffer[0], &maxSize); charsDone += charsToDo; } return length; } int insert_utfwc (widechar * text, int length) { if (length < 0) return 0; if ((ud->text_length + length) > MAX_LENGTH) return 0; memcpy (&ud->text_buffer[ud->text_length], text, CHARSIZE * length); ud->text_length += length; return length; } #define SHY 0x00AD #define ZWSP 0x200B int remove_soft_hyphens (const widechar * inbuf, const int inlen, widechar * outbuf, int *outlen, int *indices) { int i, j; j = 0; for (i = 0; i < inlen; i++) if (inbuf[i] != SHY && inbuf[i] != ZWSP) { outbuf[j] = inbuf[i]; indices[j] = i; j++; } *outlen = j; return (*outlen == inlen); } int translate_possibly_prehyphenated (const char *table, const widechar * inbuf, int *inlen, widechar * outbuf, int *outlen, char *typeform, int *indices, int mode) { static widechar tmp_outbuf[2 * BUFSIZE]; static char tmp_typeform[2 * BUFSIZE]; static int tmp_indices_1[2 * BUFSIZE]; static int tmp_indices_2[2 * BUFSIZE]; int tmp_outlen; int k; if (ud->hyphenate == 2) { remove_soft_hyphens (inbuf, *inlen, tmp_outbuf, &tmp_outlen, tmp_indices_1); if (typeform != NULL) for (k = 0; k < tmp_outlen; k++) tmp_typeform[k] = typeform[tmp_indices_1[k]]; if (!lou_translate (table, tmp_outbuf, &tmp_outlen, outbuf, outlen, (typeform == NULL ? NULL : tmp_typeform), NULL, NULL, tmp_indices_2, NULL, mode)) return 0; if (indices != NULL) for (k = 0; k < *outlen; k++) indices[k] = tmp_indices_1[tmp_indices_2[k]]; } else return lou_translate (table, inbuf, inlen, outbuf, outlen, typeform, NULL, NULL, indices, NULL, mode); } int insert_translation (const char *table) { int translationLength; int translatedLength; int k; if (style->translation_table != NULL) table = style->translation_table; if (table == NULL) { memset (ud->typeform, 0, sizeof (ud->typeform)); ud->text_length = 0; return 0; } if (ud->text_length == 0) return 1; for (k = 0; k < ud->text_length && ud->text_buffer[k] <= 32; k++); if (k == ud->text_length) { ud->text_length = 0; return 1; } if (styleSpec != NULL && styleSpec->status == resumeBody) styleSpec->status = bodyInterrupted; if (ud->format_for == utd) return (utd_insert_translation (table)); if (ud->translated_length > 0 && ud->translated_length < MAX_TRANS_LENGTH && ud->translated_buffer[ud->translated_length - 1] > 32) { ud->translated_buffer[ud->translated_length++] = 32; if (ud->in_sync) { ud->positions_array[ud->translated_length - 1] = ud->sync_text_length; ud->sync_text_buffer[ud->sync_text_length++] = 32; } } translatedLength = MAX_TRANS_LENGTH - ud->translated_length; translationLength = ud->text_length; ud->text_buffer[ud->text_length++] = 32; ud->text_buffer[ud->text_length++] = 32; k = translate_possibly_prehyphenated (table, &ud->text_buffer[0], &translationLength, &ud->translated_buffer[ud-> translated_length], &translatedLength, (char *) &ud->typeform[0], ud->in_sync ? &ud-> positions_array[ud-> translated_length] : NULL, 0); memset (ud->typeform, 0, sizeof (ud->typeform)); ud->text_length = 0; if (!k) { lou_logPrint ("Cannot find table %s", table); return 0; } if (ud->in_sync) { if (ud->sync_text_length > 0) for (k = 0; k < translationLength; k++) ud->positions_array[ud->translated_length + k] += ud->sync_text_length; memcpy (&ud->sync_text_buffer[ud->sync_text_length], ud->text_buffer, translationLength * CHARSIZE); ud->sync_text_length += translationLength; } if ((ud->translated_length + translatedLength) < MAX_TRANS_LENGTH) ud->translated_length += translatedLength; else { ud->translated_length = MAX_TRANS_LENGTH; if (!write_paragraph (para, NULL)) return 0; } return 1; } static int cellsWritten; static int cellsOnLine; static int insertCharacters (char *chars, int length) { /* Put chars in outbuf, checking for overflow.*/ int k; if (chars == NULL || length < 0) return 0; if (length == 0) return 1; if ((ud->outbuf1_len_so_far + length) >= ud->outbuf1_len) return 0; for (k = 0; k < length; k++) ud->outbuf1[ud->outbuf1_len_so_far++] = (widechar) chars[k]; cellsWritten += length; return 1; } static int insertDubChars (char *chars, int length) { /* Put chars in outbuf, checking for overflow.*/ int k; if (chars == NULL || length < 0) return 0; while (length > 0 && chars[length - 1] == ' ') length--; cellsWritten += length; if (length == 0) return 1; if ((ud->outbuf1_len_so_far + length) >= ud->outbuf1_len) return 0; switch (ud->format_for) { case textDevice: for (k = 0; k < length; k++) ud->outbuf1[ud->outbuf1_len_so_far++] = (widechar) chars[k]; break; case browser: for (k = 0; k < length; k++) { if (chars[k] == '<') { if (!insertCharacters ("<", 4)) return 0; } else if (chars[k] == '&') { if (!insertCharacters ("&", 5)) return 0; } else ud->outbuf1[ud->outbuf1_len_so_far++] = (widechar) chars[k]; } break; default: break; } return 1; } static int insertWidechars (widechar * chars, int length) { /* Put chars in outbuf, checking for overflow.*/ int k; if (chars == NULL || length < 0) return 0; while (length > 0 && chars[length - 1] == ' ') length--; cellsWritten += length; if (length == 0) return 1; if ((ud->outbuf1_len_so_far + length) >= ud->outbuf1_len) return 0; switch (ud->format_for) { case textDevice: memcpy (&ud->outbuf1[ud->outbuf1_len_so_far], chars, length * CHARSIZE); ud->outbuf1_len_so_far += length; break; case browser: for (k = 0; k < length; k++) { if (chars[k] == '<') { if (!insertCharacters ("<", 4)) return 0; } else if (chars[k] == '&') { if (!insertCharacters ("&", 5)) return 0; } else ud->outbuf1[ud->outbuf1_len_so_far++] = chars[k]; } break; default: break; } return 1; } static int startLine (); static int finishLine (); static int lastLineInStyle; static int makeBlankLines (int number) { int k; for (k = 0; k < number; k++) { startLine (); if (!finishLine ()) return 0; } return 1; } static int fillPage () { if (!ud->braille_pages) return 0; if (ud->outbuf3_enabled && ud->lines_length <= MAXLINES) ud->lines_newpage[ud->lines_length] = 1; if (ud->fill_pages == 0 && ud->lines_on_page > 0) ud->fill_pages = 1; if (ud->fill_pages) { startLine (); writeOutbuf (); return 1; } return 0; } static int fillPageForce () { if (!ud->braille_pages) return 0; if (ud->outbuf3_enabled && ud->lines_length <= MAXLINES) ud->lines_newpage[ud->lines_length] = 1; ud->fill_pages++; startLine (); writeOutbuf (); return 1; } static int handlePagenum (xmlChar * printPageNumber, int length) { widechar translationBuffer[MAXNUMLEN]; int translationLength = MAXNUMLEN - 1; widechar translatedBuffer[MAXNUMLEN]; int translatedLength = MAXNUMLEN; char setup[MAXNAMELEN]; if (length == 0) return 1; strcpy (setup, " "); if (!(printPageNumber[0] >= '0' && printPageNumber[0] <= '9')) strcat (setup, ud->letsign); strcat (setup, printPageNumber); length = strlen (setup); utf8ToWc (setup, &length, &translationBuffer[0], &translationLength); if (!lou_translateString (ud->main_braille_table, translationBuffer, &translationLength, translatedBuffer, &translatedLength, NULL, NULL, 0)) return 0; if (translatedBuffer[0] != ' ') { /* Translation dropped leading space */ ud->print_page_number[0] = ' '; widecharcpy (&ud->print_page_number[1], translatedBuffer, translatedLength); } else widecharcpy (ud->print_page_number, translatedBuffer, translatedLength); if (!ud->page_separator_number_first[0] || ud->page_separator_number_first[0] == '_' || ud->ignore_empty_pages) widestrcpy (ud->page_separator_number_first, ud->print_page_number); else widestrcpy (ud->page_separator_number_last, ud->print_page_number); return 1; } static int utd_makePageSeparator (char *printPageNumber, int length); void set_runninghead_string (widechar * chars, int length) { if (length > (sizeof (ud->running_head) / CHARSIZE)) length = sizeof (ud->running_head) / CHARSIZE - 4; ud->running_head_length = length; memcpy (ud->running_head, chars, ud->running_head_length * CHARSIZE); } void set_footer_string (widechar * chars, int length) { if (length > (sizeof (ud->footer) / CHARSIZE)) length = sizeof (ud->footer) / CHARSIZE - 4; ud->footer_length = length; memcpy (ud->footer, chars, ud->footer_length * CHARSIZE); } void do_pagebreak (xmlNode * node) { xmlChar *number = get_attr_value (node); if (ud->format_for == utd) utd_pagebreak (node, number, strlen (number)); else handlePagenum (number, strlen (number)); } void do_attrtotext (xmlNode * node) { char attrValue[MAXNAMELEN]; strcpy (attrValue, get_attr_value (node)); if (ud->orig_format_for == dsbible) { /* Enbncode verse numbers */ int k; for (k = 0; attrValue[k]; k++) attrValue[k] -= 32; } insert_text_string (node, attrValue); } static void setEmphasis () { int k; int top = ud->top; memset (&ud->typeform[ud->old_text_length], 0, ud->text_length - ud->old_text_length); while (top >= 0 && (ud->stack[top] == italicx || ud->stack[top] == boldx || ud->stack[top] == underlinex || ud->stack[top] == compbrl)) { switch (ud->stack[top]) { case italicx: if (!(ud->emphasis & italic)) break; for (k = ud->old_text_length; k < ud->text_length; k++) ud->typeform[k] |= italic; break; case underlinex: if (!(ud->emphasis & underline)) break; for (k = ud->old_text_length; k < ud->text_length; k++) ud->typeform[k] |= underline; break; case boldx: if (!(ud->emphasis & bold)) break; for (k = ud->old_text_length; k < ud->text_length; k++) ud->typeform[k] |= bold; break; case compbrl: if (!(ud->emphasis & computer_braille)) break; for (k = ud->old_text_length; k < ud->text_length; k++) ud->typeform[k] |= compbrl; break; default: break; } //top--; top = -1; /*to be removed when liblouis fixed*/ } return; } void insert_text_string (xmlNode * node, xmlChar * str) { xmlNode *newNode; if (ud->format_for == utd) { newNode = xmlNewNode (NULL, (xmlChar *) "brl"); link_brl_node (xmlAddNextSibling (node, newNode)); } insert_utf8 (str); if (ud->format_for == utd) ud->text_buffer[ud->text_length++] = ENDSEGMENT; return; } void insert_text (xmlNode * node) { int length = strlen ((char *) node->content); int k; for (k = length; k > 0 && node->content[k - 1] <= 32; k--); if (k <= 0) return; if (k < length) length = k + 1; /*Keep last whitespace */ if (style->emphasis) push_action (style->emphasis); if (ud->format_for == utd) return utd_insert_text (node, length); switch (ud->stack[ud->top]) { case notranslate: insert_translation (ud->main_braille_table); insert_utf8 (node->content); if ((ud->translated_length + ud->text_length) > MAX_TRANS_LENGTH) ud->text_length = MAX_TRANS_LENGTH - ud->translated_length; memcpy (&ud->translated_buffer[ud->translated_length], ud->text_buffer, ud->text_length * CHARSIZE); if (ud->in_sync) { for (k = 0; k < ud->text_length; k++) ud->positions_array[ud->translated_length + k] = k; memcpy (&ud->sync_text_buffer[ud->sync_text_length], ud->text_buffer, ud->text_length * CHARSIZE); ud->sync_text_length += ud->text_length; } ud->translated_length += ud->text_length; ud->text_length = 0; return; case pagenum: handlePagenum (node->content, length); return; default: break; } ud->old_text_length = ud->text_length; insert_utf8 (node->content); setEmphasis (); } static int getBraillePageString () { int k; char brlPageString[40]; widechar translationBuffer[MAXNUMLEN]; int translationLength; int translatedLength = MAXNUMLEN; if (!ud->number_braille_pages) { pageNumberLength = 0; return 1; } switch (ud->cur_brl_page_num_format) { case blank: return 1; default: case normal: translationLength = sprintf (brlPageString, "%d", ud->braille_page_number); break; case p: translationLength = sprintf (brlPageString, "p%d", ud->braille_page_number); break; case roman: strcpy (brlPageString, ud->letsign); strcat (brlPageString, makeRomanNumber (ud->braille_page_number)); translationLength = strlen (brlPageString); break; } for (k = 0; k < translationLength; k++) translationBuffer[k] = brlPageString[k]; if (!lou_translateString (ud->main_braille_table, translationBuffer, &translationLength, ud->braille_page_string, &translatedLength, NULL, NULL, 0)) return 0; ud->braille_page_string[translatedLength] = 0; widecharcpy (&(pageNumberString[pageNumberLength]), ud->braille_page_string, translatedLength); pageNumberLength += translatedLength; return 1; } static char * makeRomanNumber (int n) { static char romNum[40]; static const char *hundreds[] = { "", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc", "cm", "m" }; static const char *tens[] = { "", "x", "xx", "xxx", "xl", "l", "lx", "lxx", "lxxx", "xc" }; static const char *units[] = { "", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix" }; if (n <= 0 || n > 1000) return NULL; romNum[0] = 0; strcat (romNum, hundreds[n / 100]); strcat (romNum, tens[(n / 10) % 10]); strcat (romNum, units[n % 10]); return romNum; } static void getPrintPageString () { int k; if (ud->print_page_number_first[0] != '_') { if (ud->print_page_number_first[0] != ' ' && ud->print_page_number_first[0] != '+') { pageNumberString[pageNumberLength++] = ud->print_page_number_first[0]; } for (k = 1; ud->print_page_number_first[k]; k++) { pageNumberString[pageNumberLength++] = ud->print_page_number_first[k]; } if (ud->print_page_number_last[0]) { pageNumberString[pageNumberLength++] = '-'; for (k = 1; ud->print_page_number_last[k]; k++) { pageNumberString[pageNumberLength++] = ud->print_page_number_last[k]; } } } } static int getPageNumber () { int k; int braillePageNumber = 0; int printPageNumber = 0; pageNumberLength = 0; if (ud->lines_on_page == 1) { if (ud->print_pages && ud->print_page_number_at && ud->print_page_number_first[0] != '_') { printPageNumber = 1; } if (ud->braille_pages && !ud->braille_page_number_at && ud->cur_brl_page_num_format != blank) { braillePageNumber = 1; } } else if (ud->lines_on_page == ud->lines_per_page) { if (ud->print_pages && !ud->print_page_number_at && ud->print_page_number_first[0] != '_') { printPageNumber = 1; } if (ud->braille_pages && ud->braille_page_number_at && ud->cur_brl_page_num_format != blank) { braillePageNumber = 1; } } if (ud->interpoint && !(ud->braille_page_number & 1)) braillePageNumber = 0; if (printPageNumber || braillePageNumber) { pageNumberString[pageNumberLength++] = ' '; pageNumberString[pageNumberLength++] = ' '; if (printPageNumber) { pageNumberString[pageNumberLength++] = ' '; getPrintPageString (); } if (braillePageNumber) { pageNumberString[pageNumberLength++] = ' '; getBraillePageString (); } } return 1; } static void addPagesToPrintPageNumber () { int k; if (ud->braille_pages && ud->page_separator_number_first[0]) { if ((ud->lines_on_page == 0 && (ud->ignore_empty_pages || ud->print_page_number_first[0] != ' ')) || (ud->lines_on_page == ud->lines_per_page) || (ud->print_page_number_range && ud->print_page_number_first[0] == '_')) { widestrcpy (ud->print_page_number_first, ud->page_separator_number_first); } else if (ud->page_separator_number_first[0] != '_' && (ud->print_page_number_range || (ud->lines_on_page == 0 && !ud->ignore_empty_pages))) { widestrcpy (ud->print_page_number_last, ud->page_separator_number_first); } if (ud->page_separator_number_last[0] && (ud->print_page_number_range || ud->lines_on_page == 0)) { widestrcpy (ud->print_page_number_last, ud->page_separator_number_last); } } ud->page_separator_number_first[0] = 0; ud->page_separator_number_last[0] = 0; } static int nextPrintPage () { int k; int kk; widechar separatorLine[128]; int pageSeparatorNumberFirstLength = 0; int pageSeparatorNumberLastLength = 0; int pageSeparatorInserted = 0; if (ud->page_separator_number_first[0]) { if (ud->braille_pages && ud->lines_on_page == 0) { } else if (!ud->page_separator) { } else if (ud->fill_pages > 0) { } else if (ud->braille_pages && (ud->lines_on_page == ud->lines_per_page - 1)) { ud->lines_on_page++; cellsWritten = 0; getPageNumber (); finishLine (); } else if (ud->braille_pages && (ud->lines_on_page == ud->lines_per_page - 2)) { insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); ud->lines_on_page = ud->lines_per_page; cellsWritten = 0; getPageNumber (); finishLine (); } else { if (!ud->page_separator_number) { for (k = 0; k < ud->cells_per_line; k++) separatorLine[k] = '-'; } else { for (k = 0; ud->page_separator_number_first[k] != 0; k++) pageSeparatorNumberFirstLength++; for (k = 0; ud->page_separator_number_last[k] != 0; k++) pageSeparatorNumberLastLength++; if (ud->ignore_empty_pages) pageSeparatorNumberLastLength = 0; k = 0; while (k < (ud->cells_per_line - pageSeparatorNumberFirstLength - pageSeparatorNumberLastLength + 1)) { separatorLine[k++] = '-'; } kk = 1; while (k < (ud->cells_per_line - pageSeparatorNumberLastLength)) { separatorLine[k++] = ud->page_separator_number_first[kk++]; } if (pageSeparatorNumberLastLength > 0) { separatorLine[k++] = '-'; kk = 1; while (k < (ud->cells_per_line)) { separatorLine[k++] = ud->page_separator_number_last[kk++]; } } } insertWidechars (separatorLine, ud->cells_per_line); pageSeparatorInserted = 1; insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); if (ud->braille_pages) ud->lines_on_page++; writeOutbuf (); } addPagesToPrintPageNumber (); } return pageSeparatorInserted; } static void continuePrintPageNumber () { int k; if (!ud->braille_pages) return; if (ud->print_page_number[0] == '_') { } else if (!ud->continue_pages) { ud->print_page_number[0] = '+'; } else if (ud->print_page_number[0] == ' ') { ud->print_page_number[0] = 'a'; } else if (ud->print_page_number[0] == 'z') { ud->print_page_number[0] = '_'; ud->print_page_number[1] = 0; } else { ud->print_page_number[0]++; } widestrcpy (ud->print_page_number_first, ud->print_page_number); ud->print_page_number_last[0] = 0; } static int nextBraillePage () { if (ud->braille_pages) { if (!write_buffer (1, 0)) return 0; if (ud->outbuf2_enabled) { ud->lines_on_page = 1; cellsWritten = 0; getPageNumber (); finishLine (); if (!write_buffer (1, 2)) return 0; if (!write_buffer (2, 0)) return 0; } if (!insertCharacters (ud->pageEnd, strlen (ud->pageEnd))) return 0; if (!write_buffer (1, 2)) return 0; ud->lines_on_page = 0; ud->braille_page_number++; continuePrintPageNumber (); } return 1; } static int startLine () { int availableCells = 0; int blank_lines = ud->blank_lines; while (availableCells == 0 || (ud->braille_pages && ud->fill_pages > 0) || blank_lines > 0) { if (ud->page_separator_number_first[0]) { if (nextPrintPage ()) { blank_lines = 0; ud->blank_lines = style->lines_before; } } if (ud->braille_pages) { ud->lines_on_page++; ud->after_contents = 0; cellsWritten = 0; if (ud->lines_on_page == 1) { ud->cur_brl_page_num_format = ud->brl_page_num_format; getBraillePageString (); getPageNumber (); } else if (ud->lines_on_page == ud->lines_per_page) getPageNumber (); else pageNumberLength = 0; if (ud->lines_on_page == 1) { blank_lines = 0; ud->blank_lines = style->lines_before; } if (ud->lines_on_page == 1 && ud->outbuf2_enabled) { pageNumberLength = 0; ud->lines_on_page++; availableCells = ud->cells_per_line; } else if (ud->lines_on_page == 1 && ud->running_head_length > 0) { availableCells = 0; blank_lines = ud->blank_lines; } else if (ud->lines_on_page == 1 && (pageNumberLength > 0 && (style->skip_number_lines || ud->page_number_top_separate_line))) { availableCells = 0; } else if (ud->lines_on_page == ud->lines_per_page && (ud->footer_length > 0 || (pageNumberLength > 0 && (style->skip_number_lines || ud->page_number_bottom_separate_line)))) { availableCells = 0; } else availableCells = ud->cells_per_line - pageNumberLength; } else if (ud->lines_on_page == 0) { ud->lines_on_page++; ud->blank_lines = 0; return ud->cells_per_line; } else if (blank_lines == 0) { ud->blank_lines = 0; return ud->cells_per_line; } if (ud->braille_pages && ud->fill_pages > 0) finishLine (); else if (blank_lines > 0) { finishLine (); blank_lines--; availableCells = 0; } else if (availableCells == 0) { ud->blank_lines = 0; finishLine (); } else { ud->blank_lines = 0; if (ud->outbuf3_enabled && ud->lines_length < MAXLINES) { ud->lines_pagenum[ud->lines_length] = ud->braille_page_number; ud->lines_newpage[ud->lines_length] = 0; ud->lines_length++; } } if (ud->fill_pages > 0 && ud->lines_on_page == 0) { ud->fill_pages--; if (ud->fill_pages == 0) break; else availableCells = 0; } } return availableCells; } static int centerHeadFoot (widechar * toCenter, int length) { int leadingBlanks; int trailingBlanks; int numCells = ud->cells_per_line - (2 * pageNumberLength); if (length > numCells) { int k; length = numCells; for (k = length; toCenter[k] != ' ' && k >= 0; k--); if (k > 0) length = k; } leadingBlanks = ((numCells - length) / 2) + pageNumberLength; trailingBlanks = numCells - leadingBlanks - length + pageNumberLength; if (!insertCharacters (blanks, leadingBlanks)) return 0; if (!insertWidechars (toCenter, length)) return 0; if (pageNumberLength > 0) { if (!insertCharacters (blanks, trailingBlanks)) return 0; if (!insertWidechars (pageNumberString, pageNumberLength)) return 0; } return 1; } static int finishLine () { int cellsToWrite = 0; int leaveBlank; for (leaveBlank = -1; leaveBlank < ud->line_spacing; leaveBlank++) { if (leaveBlank != -1) startLine (); if (ud->braille_pages) { if (cellsWritten > 0 && pageNumberLength > 0) { cellsToWrite = ud->cells_per_line - pageNumberLength - cellsWritten; if (!insertCharacters (blanks, cellsToWrite)) return 0; if (!insertWidechars (pageNumberString, pageNumberLength)) return 0; } else if (ud->lines_on_page == 1) { if (ud->running_head_length > 0) centerHeadFoot (ud->running_head, ud->running_head_length); else { if (pageNumberLength) { cellsToWrite = ud->cells_per_line - pageNumberLength; if (!insertCharacters (blanks, cellsToWrite)) return 0; if (!insertWidechars (pageNumberString, pageNumberLength)) return 0; } } } else if (ud->lines_on_page == ud->lines_per_page) { if (ud->footer_length > 0) centerHeadFoot (ud->footer, ud->footer_length); else { if (pageNumberLength) { cellsToWrite = ud->cells_per_line - pageNumberLength; if (!insertCharacters (blanks, cellsToWrite)) return 0; if (!insertWidechars (pageNumberString, pageNumberLength)) return 0; } } } } if (!(lastLineInStyle && !style->newline_after)) { if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; } if (ud->braille_pages && ud->lines_on_page == ud->lines_per_page) { if (!nextBraillePage ()) return 0; } } return 1; } static int makeBlankPage () { if (!ud->braille_pages) return 1; if (ud->format_for != utd) { if (!makeBlankLines (ud->lines_per_page)) return 0; } else { if (!utd_makeBlankLines (ud->lines_per_page, 2)) return 0; } return 1; } static int writeOutbuf () { return write_buffer (1, 0); } int write_buffer (int from, int skip) { int to = 0; widechar *buffer_from; widechar *buffer_to; int buffer_from_len; int buffer_to_len; int *buffer_from_len_so_far; int *buffer_to_len_so_far; int k; switch (from) { case 1: if (skip != 2 && ud->outbuf2_enabled) to = 2; else if (skip != 3 && ud->outbuf3_enabled) to = 3; buffer_from = ud->outbuf1; buffer_from_len = ud->outbuf1_len; buffer_from_len_so_far = &ud->outbuf1_len_so_far; break; case 2: if (!ud->outbuf2_enabled) return 0; if (skip != 3 && ud->outbuf3_enabled) to = 3; buffer_from = ud->outbuf2; buffer_from_len = ud->outbuf2_len; buffer_from_len_so_far = &ud->outbuf2_len_so_far; break; case 3: if (!ud->outbuf3_enabled) return 0; buffer_from = ud->outbuf3; buffer_from_len = ud->outbuf3_len; buffer_from_len_so_far = &ud->outbuf3_len_so_far; break; default: return 0; } switch (to) { case 0: if (*buffer_from_len_so_far == 0) return 1; if (ud->outFile == NULL) { if ((ud->outlen_so_far + *buffer_from_len_so_far) >= ud->outlen) return 0; for (k = 0; k < *buffer_from_len_so_far; k++) ud->outbuf[ud->outlen_so_far++] = buffer_from[k]; *buffer_from_len_so_far = 0; return 1; } else { unsigned char *utf8Str; switch (ud->output_encoding) { case utf8: for (k = 0; k < *buffer_from_len_so_far; k++) { utf8Str = utfwcto8 (buffer_from[k]); fwrite (utf8Str, strlen ((char *) utf8Str), 1, ud->outFile); } break; case utf16: for (k = 0; k < *buffer_from_len_so_far; k++) { unsigned short uc16 = (unsigned short) buffer_from[k]; fwrite (&uc16, 1, sizeof (uc16), ud->outFile); } break; case utf32: for (k = 0; k < *buffer_from_len_so_far; k++) { unsigned int uc32 = (unsigned int) buffer_from[k]; fwrite (&uc32, 1, sizeof (uc32), ud->outFile); } break; case ascii8: for (k = 0; k < *buffer_from_len_so_far; k++) { fputc ((char) buffer_from[k], ud->outFile); } break; default: break; } *buffer_from_len_so_far = 0; } return 1; case 2: buffer_to = ud->outbuf2; buffer_to_len = ud->outbuf2_len; buffer_to_len_so_far = &ud->outbuf2_len_so_far; break; case 3: buffer_to = ud->outbuf3; buffer_to_len = ud->outbuf3_len; buffer_to_len_so_far = &ud->outbuf3_len_so_far; break; default: return 0; } if (*buffer_from_len_so_far == 0) return 1; if ((*buffer_to_len_so_far + *buffer_from_len_so_far) >= buffer_to_len) return 0; for (k = 0; k < *buffer_from_len_so_far; k++) buffer_to[(*buffer_to_len_so_far)++] = buffer_from[k]; *buffer_from_len_so_far = 0; return 1; } static widechar *translatedBuffer; static int translatedLength; static int *positionsArray; static widechar *saved_translatedBuffer; static int saved_translatedLength; static int *saved_positionsArray; void save_translated_buffer () { saved_translatedBuffer = translatedBuffer; saved_translatedLength = translatedLength; saved_positionsArray = positionsArray; } void restore_translated_buffer () { translatedBuffer = saved_translatedBuffer; translatedLength = saved_translatedLength; positionsArray = saved_positionsArray; } /** * hyphenatex * * Find out where to break the current line so that the first word that * doesn't fit entirely on the line is hyphenated correctly. The word in * question will not be split if it results in parts smaller than * MIN_SYLLABLE_LENGTH, if the word is smaller than MIN_WORD_LENGTH, or if * less than MIN_NEXT_LINE characters remain on the next line. * * Two situations can occur: * - If the text buffer and the translated buffer are in sync (i.e. positions * in the text buffer can be derived from positions in the translated * buffer), the word being split is looked up in the text buffer, then it's * hyphenated (if not already pre-hyphenated), and finally from the hyphen * positions the valid break points in the translated buffer are derived. * - If the buffers are not in sync, the possible break points are computed by * hyphenating the braille word (using back-translation). * * The last break point that still fits on the line is returned. Break points * that don't require a hyphen character to be inserted are chosen over break * points that do. If no suitable break point can be found, zero is returned. * * @param lastBlank The position of the last whitespace character before * lineEnd. * @param lineEnd The position of the last character that could fit on * the current line. * @return Non-zero if a suitable break point was found. * @return *breakAt The position where the line should be broken. * @return *insertHyphen Non-zero if a hyphen character needs to be inserted * after the break point. */ static int hyphenatex (int lastBlank, int lineEnd, int *breakAt, int *insertHyphen) { #define MIN_SYLLABLE_LENGTH 2 #define MIN_WORD_LENGTH 5 #define MIN_NEXT_LINE 12 int k; char hyphens[MAXNAMELEN]; char textHyphens[MAXNAMELEN]; int wordStart = lastBlank + 1; int wordLength; int textWordStart, textWordLength; int const textLength = ud->sync_text_length; widechar *const textBuffer = ud->sync_text_buffer; if (ud->hyphenate != 1 && ud->hyphenate != 2) return 0; // Don't break if not enough characters remain on next line if ((translatedLength - wordStart) < MIN_NEXT_LINE) return 0; // Find word boundaries for (wordLength = wordStart; wordLength < translatedLength; wordLength++) if (translatedBuffer[wordLength] == ' ') break; wordLength -= wordStart; // Don't break if word is too short or too long if (wordLength < MIN_WORD_LENGTH || wordLength > ud->cells_per_line) return 0; // Find the word boundaries in the text buffer if (ud->in_sync) { textWordStart = positionsArray[wordStart]; if (wordStart + wordLength >= translatedLength) textWordLength = textLength - textWordStart; else textWordLength = positionsArray[wordStart + wordLength] - textWordStart; if (textWordStart < 0 || textWordLength < 1 || textWordStart + textWordLength > textLength) return 0; } // First look for break points that don't require a hyphen character to be // inserted *insertHyphen = 0; for (k = minimum(lineEnd - wordStart, wordLength - MIN_SYLLABLE_LENGTH); k > MIN_SYLLABLE_LENGTH; k--) { if (ud->in_sync && ud->hyphenate == 2) { if (textBuffer[positionsArray[wordStart + k] - 1] == ZWSP) { *breakAt = wordStart + k; return 1; } } else { if(translatedBuffer[wordStart + k - 1] == *ud->lit_hyphen) { *breakAt = wordStart + k; return 1; } } } // Then look for other break points *insertHyphen = 1; for (k = 0; k <= wordLength; k++) hyphens[k] = '0'; // Derive hyphen positions in translated buffer from those in text buffer if (ud->in_sync) { switch (ud->hyphenate) { case 1: if (!lou_hyphenate (ud->main_braille_table, &textBuffer[textWordStart], textWordLength, textHyphens, 0)) return 0; break; case 2: textHyphens[0] = '0'; for (k = 1; k < textWordLength; k++) textHyphens[k] = (textBuffer[textWordStart + k - 1] == SHY) ? '1' : '0'; break; } for (k = 1; k < wordLength; k++) hyphens[k] = textHyphens[positionsArray[wordStart + k] - textWordStart]; } // Otherwise, use back-translation else if (!lou_hyphenate (ud->main_braille_table, &translatedBuffer[wordStart], wordLength, hyphens, 1)) return 0; for (k = minimum(lineEnd - wordStart, wordLength - MIN_SYLLABLE_LENGTH) - 1; k > MIN_SYLLABLE_LENGTH; k--) if (hyphens[k] == '1') { *breakAt = wordStart + k; return 1; } return 0; } #define escapeChar 0x1b static int doAlignColumns () { #define MAXCOLS 100 #define MAXROWSIZE 400 #define COLSPACING 2 int numRows = 0; int rowNum = 0; int numCols = 0; int colNum = 0; int colLength = 0; int rowLength; int colSize[MAXCOLS]; widechar rowBuf[MAXROWSIZE]; int bufPos; int k; unsigned int ch; int rowEnd = 0; for (bufPos = 0; bufPos < translatedLength; bufPos++) if (translatedBuffer[bufPos] == escapeChar) break; if (bufPos >= translatedLength) { doLeftJustify (); return 1; } for (k = 0; k < MAXCOLS; k++) colSize[k] = 0; /*Calculate number of columns and column sizes */ while (bufPos < translatedLength) { ch = translatedBuffer[bufPos++]; if (ch == escapeChar) { unsigned int nch = translatedBuffer[bufPos]; if (nch == 'r') /*End of row */ { numRows++; if (rowEnd == 0) rowEnd = colLength; colLength = 0; colNum = 0; bufPos++; } else if (nch == 'c') { if (numRows == 0) numCols++; if (colSize[colNum] < colLength) colSize[colNum] = colLength; colNum++; colLength = 0; bufPos++; } else if (nch == 'e') break; } else colLength++; } colSize[numCols - 1] += rowEnd; if (ud->style_format == alignColumnsLeft) { /*Calculate starting points of columns in output */ int colStart = 0; for (colNum = 0; colNum < numCols; colNum++) { k = colSize[colNum]; colSize[colNum] = colStart; colStart += k; if (colNum != (numCols - 1)) colStart += COLSPACING; } } else { /*Calculate ending points of columns in output */ int colEnd = colSize[0]; for (colNum = 1; colNum < numCols; colNum++) { colEnd += colSize[colNum] + COLSPACING; colSize[colNum] = colEnd; } } /*Now output the stuff.*/ if ((ud->lines_per_page - ud->lines_on_page) < numRows) fillPage (); bufPos = 0; for (rowNum = 0; rowNum < numRows; rowNum++) { int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; rowLength = 0; if (ud->style_format == alignColumnsLeft) { for (colNum = 0; colNum < numCols; colNum++) { while (rowLength < MAXROWSIZE && translatedBuffer[bufPos] != escapeChar) rowBuf[rowLength++] = translatedBuffer[bufPos++]; bufPos += 2; if (colNum < (numCols - 1)) { while (rowLength < MAXROWSIZE && rowLength < colSize[colNum + 1]) rowBuf[rowLength++] = ' '; } else { while (rowLength < MAXROWSIZE && translatedBuffer[bufPos] != escapeChar) rowBuf[rowLength++] = translatedBuffer[bufPos++]; bufPos += 2; /*actual end of row */ } } } else { int prevBufPos = bufPos; int prevCol = 0; for (colNum = 0; colNum < numCols; colNum++) { while (translatedBuffer[bufPos] != escapeChar) bufPos++; for (k = bufPos - 1; k >= prevBufPos; k--) rowBuf[k + prevCol] = translatedBuffer[k]; for (; k >= prevCol; k--) rowBuf[k + prevCol] = ' '; prevBufPos = bufPos + 2; prevCol = colSize[colNum]; rowLength += colSize[colNum]; if (rowLength > MAXROWSIZE) break; } while (rowLength < MAXROWSIZE && translatedBuffer[bufPos] != escapeChar) rowBuf[rowLength++] = translatedBuffer[bufPos++]; bufPos += 2; } while (charactersWritten < rowLength) { int rowTooLong = 0; availableCells = startLine (); if ((charactersWritten + availableCells) >= rowLength) cellsToWrite = rowLength - charactersWritten; else { for (cellsToWrite = availableCells; cellsToWrite > 0; cellsToWrite--) if (rowBuf[charactersWritten + cellsToWrite] == ' ') break; if (cellsToWrite == 0) { cellsToWrite = availableCells - 1; rowTooLong = 1; } } while (rowBuf[charactersWritten + cellsToWrite] == ' ') cellsToWrite--; if (cellsToWrite == 0) break; for (k = charactersWritten; k < (charactersWritten + cellsToWrite); k++) if (rowBuf[k] == 0xa0) /*unbreakable space */ rowBuf[k] = 0x20; /*space */ if (!insertWidechars (&rowBuf[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (rowTooLong) { if (!insertDubChars (ud->lit_hyphen, strlen (ud->lit_hyphen))) return 0; } finishLine (); } } return 1; } static int doListColumns () { widechar *thisRow; int rowLength; int bufPos; int prevPos = 0; for (bufPos = 0; bufPos < translatedLength; bufPos++) if (translatedBuffer[bufPos] == escapeChar) break; if (bufPos >= translatedLength) { doLeftJustify (); return 1; } for (; bufPos < translatedLength; bufPos++) { if (translatedBuffer[bufPos] == escapeChar && translatedBuffer[bufPos + 1] == escapeChar) { int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; int k; thisRow = &translatedBuffer[prevPos]; rowLength = bufPos - prevPos - 1; prevPos = bufPos + 2; while (charactersWritten < rowLength) { int wordTooLong = 0; int breakAt = 0; int insertHyphen = 0; int leadingBlanks = 0; availableCells = startLine (); if (styleSpec->status == startBody) { if (ud->style_first_line_indent < 0) leadingBlanks = 0; else leadingBlanks = ud->style_left_margin + ud->style_first_line_indent; styleSpec->status = resumeBody; } else leadingBlanks = ud->style_left_margin; if (!insertCharacters (blanks, leadingBlanks)) return 0; availableCells -= leadingBlanks; if ((charactersWritten + availableCells) >= rowLength) cellsToWrite = rowLength - charactersWritten; else { for (cellsToWrite = availableCells; cellsToWrite > 0; cellsToWrite--) if (thisRow[charactersWritten + cellsToWrite] == ' ') break; if (cellsToWrite == 0) { cellsToWrite = availableCells - 1; wordTooLong = 1; } else if (ud->hyphenate) if (hyphenatex (charactersWritten + cellsToWrite, charactersWritten + availableCells, &breakAt, &insertHyphen)) cellsToWrite = breakAt - charactersWritten; } for (k = charactersWritten; k < (charactersWritten + cellsToWrite); k++) if (thisRow[k] == 0xa0) /*unbreakable space */ thisRow[k] = 0x20; /*space */ if (!insertWidechars (&thisRow[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (thisRow[charactersWritten] == ' ') charactersWritten++; if ((breakAt && insertHyphen) || wordTooLong) if (!insertDubChars (ud->lit_hyphen, strlen (ud->lit_hyphen))) return 0; finishLine (); } } else if (translatedBuffer[bufPos - 1] != escapeChar && translatedBuffer[bufPos] == escapeChar) translatedBuffer[bufPos] = ' '; } return 1; } static int doListLines () { widechar *thisLine; int lineLength; int bufPos; int prevPos = 0; for (bufPos = 0; bufPos < translatedLength; bufPos++) if (translatedBuffer[bufPos] == escapeChar) break; if (bufPos >= translatedLength) { doLeftJustify (); return 1; } for (; bufPos < translatedLength; bufPos++) if (translatedBuffer[bufPos] == escapeChar && translatedBuffer[bufPos + 1] == escapeChar) { int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; int k; thisLine = &translatedBuffer[prevPos]; lineLength = bufPos - prevPos - 1; prevPos = bufPos + 2; while (charactersWritten < lineLength) { int wordTooLong = 0; int breakAt = 0; int insertHyphen = 0; int leadingBlanks = 0; availableCells = startLine (); if (styleSpec->status == startBody) { if (ud->style_first_line_indent < 0) leadingBlanks = 0; else leadingBlanks = ud->style_left_margin + ud->style_first_line_indent; styleSpec->status = resumeBody; } else leadingBlanks = ud->style_left_margin; if (!insertCharacters (blanks, leadingBlanks)) return 0; availableCells -= leadingBlanks; if ((charactersWritten + availableCells) >= lineLength) cellsToWrite = lineLength - charactersWritten; else { for (cellsToWrite = availableCells; cellsToWrite > 0; cellsToWrite--) if (thisLine[charactersWritten + cellsToWrite] == ' ') break; if (cellsToWrite == 0) { cellsToWrite = availableCells - 1; wordTooLong = 1; } else if (ud->hyphenate) if (hyphenatex (charactersWritten + cellsToWrite, charactersWritten + availableCells, &breakAt, &insertHyphen)) cellsToWrite = breakAt - charactersWritten; } for (k = charactersWritten; k < (charactersWritten + cellsToWrite); k++) if (thisLine[k] == 0xa0) /*unbreakable space */ thisLine[k] = 0x20; /*space */ if (!insertWidechars (&thisLine[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (thisLine[charactersWritten] == ' ') charactersWritten++; if ((breakAt && insertHyphen) || wordTooLong) if (!insertDubChars (ud->lit_hyphen, strlen (ud->lit_hyphen))) return 0; finishLine (); } } return 1; } static int doComputerCode () { int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; int k; while (translatedBuffer[charactersWritten] == 0x0a) charactersWritten++; while (charactersWritten < translatedLength) { int lineTooLong = 0; availableCells = startLine (); for (cellsToWrite = 0; cellsToWrite < availableCells; cellsToWrite++) if ((charactersWritten + cellsToWrite) >= translatedLength || translatedBuffer[charactersWritten + cellsToWrite] == 0x0a) break; if ((charactersWritten + cellsToWrite) > translatedLength) cellsToWrite--; if (cellsToWrite <= 0 && translatedBuffer[charactersWritten] != 0x0a) break; if (cellsToWrite == availableCells && translatedBuffer[charactersWritten + cellsToWrite] != 0x0a) { cellsToWrite = availableCells - strlen (ud->comp_hyphen); lineTooLong = 1; } if (translatedBuffer[charactersWritten + cellsToWrite] == 0x0a) translatedBuffer[charactersWritten + cellsToWrite] = ' '; for (k = charactersWritten; k < (charactersWritten + cellsToWrite); k++) if (translatedBuffer[k] == 0xa0) /*unbreakable space */ translatedBuffer[k] = 0x20; /*space */ if (!insertWidechars (&translatedBuffer[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (translatedBuffer[charactersWritten] == ' ') charactersWritten++; if (lineTooLong) { if (!insertDubChars (ud->comp_hyphen, strlen (ud->comp_hyphen))) return 0; } finishLine (); } return 1; } static int doLeftJustify () { int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; int k; while (charactersWritten < translatedLength) { int wordTooLong = 0; int breakAt = 0; int insertHyphen; int leadingBlanks = 0; int trailingBlanks = 0; availableCells = startLine (); if (styleSpec->status == startBody) { leadingBlanks = ud->style_left_margin + ud->style_first_line_indent; styleSpec->status = resumeBody; } else leadingBlanks = ud->style_left_margin; trailingBlanks = ud->style_right_margin; if (!insertCharacters (blanks, leadingBlanks)) return 0; availableCells -= leadingBlanks; availableCells -= trailingBlanks; if ((charactersWritten + availableCells) >= translatedLength) { cellsToWrite = translatedLength - charactersWritten; lastLineInStyle = 1; } else { for (cellsToWrite = availableCells; cellsToWrite > 0; cellsToWrite--) if (translatedBuffer[charactersWritten + cellsToWrite] == ' ') break; if (cellsToWrite == 0) { cellsToWrite = availableCells - 1; wordTooLong = 1; } else if (ud->hyphenate) if (hyphenatex (charactersWritten + cellsToWrite, charactersWritten + availableCells, &breakAt, &insertHyphen)) cellsToWrite = breakAt - charactersWritten; } for (k = charactersWritten; k < (charactersWritten + cellsToWrite); k++) if (translatedBuffer[k] == 0xa0) /*unbreakable space */ translatedBuffer[k] = 0x20; /*space */ if (!insertWidechars (&translatedBuffer[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (translatedBuffer[charactersWritten] == ' ') charactersWritten++; if ((breakAt && insertHyphen) || wordTooLong) if (!insertDubChars (ud->lit_hyphen, strlen (ud->lit_hyphen))) return 0; finishLine (); } return 1; } static int doContents () { int lastWord; int untilLastWord; int numbersStart; int numbersLength; int leadingBlanks = 0; int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; int minGuideDots = 2; // Only print guide dots if space between last word and page number >= 1 + 2 + 1 int minSpaceAfterLastWord = 1; // Minumum space between last word and page number = 1 cell int minSpaceAfterNotLastWord = 6; // Minimum space after any braille line that is continued on the next line = 6 cells int lastWordNewRule = 0; // Last word begins on a new rule int k; if (translatedBuffer[translatedLength - 1] == 0xa0) { /* No page numbers */ translatedLength--; doLeftJustify (); return 1; } for (k = translatedLength - 1; k > 0 && translatedBuffer[k] != 32; k--); if (k == 0) { doLeftJustify (); return 1; } numbersStart = k + 1; numbersLength = translatedLength - numbersStart; for (--k; k >= 0 && translatedBuffer[k] > 32; k--); lastWord = k + 1; for (k = numbersStart; k < translatedLength; k++) if (translatedBuffer[k] == 0xa0) translatedBuffer[k] = ' '; untilLastWord = lastWord - 1; while (charactersWritten < untilLastWord) { int wordTooLong = 0; int breakAt = 0; int insertHyphen = 0; availableCells = startLine (); if (styleSpec->status == startBody) { leadingBlanks = ud->style_left_margin + ud->style_first_line_indent; styleSpec->status = resumeBody; } else leadingBlanks = ud->style_left_margin; if (leadingBlanks < 0) leadingBlanks = 0; if (!insertCharacters (blanks, leadingBlanks)) return 0; availableCells -= leadingBlanks; if ((charactersWritten + availableCells) >= (untilLastWord + minSpaceAfterNotLastWord)) cellsToWrite = untilLastWord - charactersWritten; else { for (cellsToWrite = availableCells - minSpaceAfterNotLastWord; cellsToWrite > 0; cellsToWrite--) if (translatedBuffer[charactersWritten + cellsToWrite] == ' ') break; if (cellsToWrite <= 0) { wordTooLong = 1; cellsToWrite = 0; } if (ud->hyphenate) if (hyphenatex (charactersWritten + cellsToWrite, charactersWritten + availableCells - minSpaceAfterNotLastWord, &breakAt, &insertHyphen)) cellsToWrite = breakAt - charactersWritten; if (!breakAt && wordTooLong) { cellsToWrite = availableCells - minSpaceAfterNotLastWord - 1; if (cellsToWrite <= 0) cellsToWrite = 1; } } for (k = charactersWritten; k < (charactersWritten + cellsToWrite); k++) if (translatedBuffer[k] == 0xa0) /*unbreakable space */ translatedBuffer[k] = 0x20; /*space */ if (!insertWidechars (&translatedBuffer[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (translatedBuffer[charactersWritten] == ' ') charactersWritten++; if ((breakAt && insertHyphen) || wordTooLong) if (!insertDubChars (ud->lit_hyphen, strlen (ud->lit_hyphen))) return 0; if (charactersWritten < untilLastWord) finishLine (); else { availableCells -= cellsToWrite; if (availableCells <= minSpaceAfterNotLastWord) { finishLine (); availableCells = 0; } } } if (availableCells == 0) { availableCells = startLine (); if (styleSpec->status == startBody) { leadingBlanks = ud->style_left_margin + ud->style_first_line_indent; styleSpec->status = resumeBody; } else leadingBlanks = ud->style_left_margin; if (leadingBlanks < 0) leadingBlanks = 0; if (!insertCharacters (blanks, leadingBlanks)) return 0; availableCells -= leadingBlanks; lastWordNewRule = 1; } else { insertCharacters (blanks, 1); availableCells--; } charactersWritten = lastWord; while (((numbersStart - 1) - charactersWritten) > (availableCells - minSpaceAfterLastWord - numbersLength)) { int breakAt = 0; int insertHyphen = 0; if (ud->hyphenate) { if (((numbersStart - 1) - charactersWritten) > (availableCells - minSpaceAfterNotLastWord)) hyphenatex (charactersWritten, charactersWritten + availableCells - minSpaceAfterNotLastWord, &breakAt, &insertHyphen); else hyphenatex (charactersWritten, numbersStart - 1, &breakAt, &insertHyphen); } if (breakAt || lastWordNewRule) { if (breakAt) cellsToWrite = breakAt - charactersWritten; else { if (((numbersStart - 1) - charactersWritten) > (availableCells - minSpaceAfterNotLastWord)) cellsToWrite = (availableCells - minSpaceAfterNotLastWord) - 1; else cellsToWrite = ((numbersStart - 1) - charactersWritten) - 1; if (cellsToWrite <= 0) cellsToWrite = 1; } if (!insertWidechars (&translatedBuffer[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if ((breakAt && insertHyphen) || lastWordNewRule) if (!insertDubChars (ud->lit_hyphen, strlen (ud->lit_hyphen))) return 0; } finishLine (); availableCells = startLine (); leadingBlanks = ud->style_left_margin; if (!insertCharacters (blanks, leadingBlanks)) return 0; availableCells -= leadingBlanks; lastWordNewRule = 1; if (availableCells < (1 + minSpaceAfterLastWord + numbersLength)) break; } if (!insertWidechars (&translatedBuffer[charactersWritten], (numbersStart - 1) - charactersWritten)) return 0; availableCells -= (numbersStart - 1) - charactersWritten; if ((availableCells - numbersLength) < (1 + minGuideDots + 1)) insertCharacters (blanks, availableCells - numbersLength); else { insertCharacters (blanks, 1); for (k = availableCells - (numbersLength + 2); k > 0; k--) insertCharacters (&ud->line_fill, 1); insertCharacters (blanks, 1); } if (!insertWidechars (&translatedBuffer[numbersStart], numbersLength)) return 0; finishLine (); return 1; } static int doCenterRight () { int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; int k; while (charactersWritten < translatedLength) { int wordTooLong = 0; int leadingBlanks = 0; int trailingBlanks = 0; availableCells = startLine (); if (styleSpec->status == startBody) { leadingBlanks = ud->style_left_margin + ud->style_first_line_indent; styleSpec->status = resumeBody; } else leadingBlanks = ud->style_left_margin; trailingBlanks = ud->style_right_margin; availableCells -= leadingBlanks; availableCells -= trailingBlanks; if ((translatedLength - charactersWritten) < availableCells) { k = (availableCells - (translatedLength - charactersWritten)); if (ud->style_format == centered) k /= 2; else if (ud->style_format != rightJustified) return 0; if (!insertCharacters (blanks, leadingBlanks + k)) return 0; if (!insertWidechars (&translatedBuffer[charactersWritten], translatedLength - charactersWritten)) return 0; finishLine (); break; } if ((charactersWritten + availableCells) > translatedLength) cellsToWrite = translatedLength - charactersWritten; else { for (cellsToWrite = availableCells; cellsToWrite > 0; cellsToWrite--) if (translatedBuffer[charactersWritten + cellsToWrite] == ' ') break; if (cellsToWrite == 0) { cellsToWrite = availableCells - 1; wordTooLong = 1; } } for (k = charactersWritten; k < (charactersWritten + cellsToWrite); k++) if (translatedBuffer[k] == 0xa0) /*unbreakable space */ translatedBuffer[k] = 0x20; /*space */ if (!wordTooLong) { k = availableCells - cellsToWrite; if (ud->style_format == centered) k /= 2; } else k = 0; if (!insertCharacters (blanks, leadingBlanks + k)) return 0; if (!insertWidechars (&translatedBuffer[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (translatedBuffer[charactersWritten] == ' ') charactersWritten++; if (wordTooLong) { if (!insertDubChars (ud->lit_hyphen, strlen (ud->lit_hyphen))) return 0; } finishLine (); } return 1; } static int editTrans () { int translationLength; if (ud->needs_editing && !(ud->contents == 2) && !(ud->style_format == computerCoded) && ud->edit_table_name != NULL && (ud->has_math || ud->has_chem || ud->has_music)) { translationLength = ud->translated_length; translatedLength = MAX_TRANS_LENGTH; if (!lou_translateString (ud->edit_table_name, ud->translated_buffer, &translationLength, ud->text_buffer, &translatedLength, NULL, NULL, 0)) { ud->edit_table_name = NULL; return 0; } ud->in_sync = 0; translatedBuffer = ud->text_buffer; } else { translatedBuffer = ud->translated_buffer; translatedLength = ud->translated_length; positionsArray = ud->positions_array; } return 1; } static int startStyle () { /*Line or page skipping before body*/ styleSpec->status = startBody; lastLineInStyle = 0; if (ud->format_for == utd) return utd_startStyle (); if (!ud->paragraphs) return 1; if (ud->braille_pages && prevStyle->action != document) { if (style->righthand_page) { fillPage (); if (ud->interpoint && !(ud->braille_page_number & 1)) makeBlankPage (); } else if (style->newpage_before) fillPage (); } writeOutbuf (); ud->blank_lines = maximum (ud->blank_lines, style->lines_before); return 1; } static int styleBody () { sem_act action = style->action; while (ud->translated_length > 0 && ud->translated_buffer[ud->translated_length - 1] <= 32) ud->translated_length--; if (ud->translated_length == 0) return 1; if (ud->format_for == utd) return utd_styleBody (); if (!editTrans ()) return 0; if (ud->style_format != computerCoded && action != document) { int realStart; for (realStart = 0; realStart < translatedLength && translatedBuffer[realStart] <= 32 && translatedBuffer[realStart] != escapeChar; realStart++); if (realStart > 0) { translatedBuffer = &translatedBuffer[realStart]; translatedLength -= realStart; if (ud->in_sync) positionsArray = &positionsArray[realStart]; } } while (translatedLength > 0 && translatedBuffer[translatedLength - 1] <= 32 && translatedBuffer[translatedLength - 1] != escapeChar) translatedLength--; if (translatedLength <= 0) { ud->translated_length = ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; return 1; } if (!ud->paragraphs) { cellsWritten = 0; if (!insertWidechars (translatedBuffer, translatedLength)) return 0; if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; writeOutbuf (); ud->translated_length = ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; return 1; } if (action == contentsheader && ud->contents != 2) { if (!fillPage ()) { addPagesToPrintPageNumber (); continuePrintPageNumber (); } write_buffer (3, 0); ud->outbuf3_enabled = 0; initialize_contents (); start_heading (action, translatedBuffer, translatedLength); finish_heading (action); ud->text_length = ud->translated_length = ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; return 1; } if (ud->contents == 1) { if (ud->braille_pages && (action == heading1 || action == heading2 || action == heading3 || action == heading4 || action == heading5 || action == heading6 || action == heading7 || action == heading8 || action == heading9 || action == heading10)) getBraillePageString (); start_heading (action, translatedBuffer, translatedLength); } switch (ud->style_format) { case centered: case rightJustified: doCenterRight (); break; case alignColumnsLeft: case alignColumnsRight: doAlignColumns (); break; case listColumns: doListColumns (); break; case listLines: doListLines (); break; case computerCoded: doComputerCode (); break; case contents: doContents (); break; case leftJustified: default: doLeftJustify (); break; } writeOutbuf (); if (ud->contents == 1) finish_heading (action); styleSpec->status = resumeBody; ud->translated_length = ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; return 1; } static int finishStyle () { /*Skip lines or pages after body*/ if (ud->format_for == utd) return utd_finishStyle (); if (ud->braille_pages) { if (style->newpage_after) fillPage (); } writeOutbuf (); ud->blank_lines = maximum (ud->blank_lines, style->lines_after); return 1; } int write_paragraph (sem_act action, xmlNode * node) { StyleType *holdStyle; if (!((ud->text_length > 0 || ud->translated_length > 0) && ud->style_top >= 0)) return 1; holdStyle = action_to_style (action); if (holdStyle == NULL) holdStyle = lookup_style ("para"); /* We must do some of the work of start_styl* */ if (ud->style_top < (STACKSIZE - 2)) ud->style_top++; styleSpec = &ud->style_stack[ud->style_top]; style = styleSpec->style = holdStyle; styleSpec->node = node; styleSpec->status = beforeBody; if (style->brlNumFormat != normal) ud->brl_page_num_format = style->brlNumFormat; if (style->format != inherit) ud->style_format = style->format; else if (ud->style_format != leftJustified && ud->style_format != rightJustified && ud->style_format != centered) { ud->style_format = leftJustified; } if (style->left_margin != -100) ud->style_left_margin = style->left_margin; if (style->right_margin != -100) ud->style_right_margin = style->right_margin; if (style->first_line_indent != -100) ud->style_first_line_indent = style->first_line_indent; styleSpec->curBrlNumFormat = ud->brl_page_num_format; styleSpec->curStyleFormat = ud->style_format; styleSpec->curLeftMargin = ud->style_left_margin; styleSpec->curRightMargin = ud->style_right_margin; styleSpec->curFirstLineIndent = ud->style_first_line_indent; startStyle (); insert_translation (ud->main_braille_table); styleBody (); end_style (); ud->needs_editing = 0; return 1; } static char *xmlTags[] = { "", "", NULL }; static int insertEscapeChars (int number) { int k; if (number <= 0) return 0; if ((ud->text_length + number) >= MAX_LENGTH) return 0; for (k = 0; k < number; k++) ud->text_buffer[ud->text_length++] = (widechar) escapeChar; return 1; } static int makeParagraph () { int translationLength = 0; int translatedLength; int charactersWritten = 0; int pieceStart; int k; while (ud->text_length > 0 && ud->text_buffer[ud->text_length - 1] <= 32 && ud->text_buffer[ud->text_length - 1] != escapeChar) ud->text_length--; if (ud->text_length == 0) return 1; ud->text_buffer[ud->text_length] = 0; k = 0; while (k < ud->text_length) { if (ud->text_buffer[k] == *ud->lit_hyphen && ud->text_buffer[k + 1] == 10 && ud->text_buffer[k + 2] != escapeChar) k += 2; if (k > translationLength) ud->text_buffer[translationLength] = ud->text_buffer[k]; k++; translationLength++; } translatedLength = MAX_TRANS_LENGTH; if (!lou_backTranslateString (ud->main_braille_table, ud->text_buffer, &translationLength, &ud->translated_buffer[0], &translatedLength, (char *) ud->typeform, NULL, 0)) return 0; if (ud->back_text == html) { if (!insertCharacters ("

", 3)) return 0; } for (k = 0; k < translatedLength; k++) if (ud->translated_buffer[k] == 0) ud->translated_buffer[k] = 32; while (charactersWritten < translatedLength) { int lineLength; if ((charactersWritten + ud->back_line_length) > translatedLength) lineLength = translatedLength - charactersWritten; else { lineLength = ud->back_line_length; while (lineLength > 0 && ud->translated_buffer[charactersWritten + lineLength] != 32) lineLength--; if (lineLength == 0) { lineLength = ud->back_line_length; while ((charactersWritten + lineLength) < translatedLength && ud->translated_buffer[charactersWritten + lineLength] != 32) lineLength++; } } pieceStart = charactersWritten; if (ud->back_text == html) { for (k = charactersWritten; k < charactersWritten + lineLength; k++) if (ud->translated_buffer[k] == '<' || ud->translated_buffer[k] == '&' || ud->translated_buffer[k] == escapeChar) { if (!insertWidechars (&ud->translated_buffer[pieceStart], k - pieceStart)) return 0; if (ud->translated_buffer[k] == '<') { if (!insertCharacters ("<", 4)) return 0; } else if (ud->translated_buffer[k] == '&') { if (!insertCharacters ("&", 5)) return 0; } else { int kk; for (kk = k; kk < translatedLength && ud->translated_buffer[kk] == escapeChar; kk++); kk -= k + 1; if (!insertCharacters (xmlTags[kk], strlen (xmlTags[kk]))) return 0; k += kk; } pieceStart = k + 1; } if (!insertWidechars (&ud->translated_buffer[pieceStart], k - pieceStart)) return 0; } else { if (!insertWidechars (&ud->translated_buffer[charactersWritten], lineLength)) return 0; } charactersWritten += lineLength; if (ud->translated_buffer[charactersWritten] == 32) charactersWritten++; if (charactersWritten < translatedLength) { if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; } } if (ud->back_text == html) { if (!insertCharacters ("

", 4)) return 0; } if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; writeOutbuf (); ud->text_length = 0; return 1; } static int handlePrintPageNumber () { int k, kk; int numberStart = 0; while (ud->text_length > 0 && ud->text_buffer[ud->text_length - 1] <= 32) ud->text_length--; for (k = ud->text_length - 1; k > 0; k--) { if (ud->text_buffer[k] == 10) break; if (ud->text_buffer[k] != '-') numberStart = k; } if ((numberStart - k) < 12) return 1; k++; if (ud->back_text == html) { widechar holdNumber[20]; int kkk = 0; for (kk = numberStart; kk < ud->text_length; kk++) holdNumber[kkk++] = ud->text_buffer[kk]; ud->text_length = k; if (!insertEscapeChars (1)) return 0; for (kk = 0; kk < kkk; kk++) ud->text_buffer[ud->text_length++] = holdNumber[kk]; if (!insertEscapeChars (2)) return 0; } else { for (kk = numberStart; kk < ud->text_length; kk++) ud->text_buffer[k++] = ud->text_buffer[kk]; ud->text_length = k; } return 1; } static int discardPageNumber () { int lastBlank = 0; int k; while (ud->text_length > 0 && ud->text_buffer[ud->text_length - 1] <= 32) ud->text_length--; for (k = ud->text_length - 1; k > 0 && ud->text_buffer[k] != 10; k--) { if (!lastBlank && ud->text_buffer[k] == 32) lastBlank = k; if (lastBlank && ud->text_buffer[k] > 32) break; } if (k > 0 && ud->text_buffer[k] != 10 && (lastBlank - k) > 2) ud->text_length = k + 2; return 1; } int back_translate_braille_string () { int charsProcessed = 0; int ch; int ppch = 0; int pch = 0; int leadingBlanks = 0; int printPage = 0; int newPage = 0; char *htmlStart = "No Title"; char *htmlEnd = ""; if (ud->format_for == utd) return utd_back_translate_braille_string (); if (!start_document ()) return 0; if (ud->back_text == html) { if (!insertCharacters (htmlStart, strlen (htmlStart))) return 0; if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; ud->output_encoding = utf8; } else ud->output_encoding = ascii8; while (charsProcessed < ud->inlen) { ch = ud->inbuf[charsProcessed++]; if (ch == 13) continue; if (pch == 10 && ch == 32) { leadingBlanks++; continue; } if (ch == escapeChar) ch = 32; if (ch == '[' || ch == '\\' || ch == '^' || ch == ']' || ch == '@' || (ch >= 'A' && ch <= 'Z')) ch |= 32; if (ch == 10 && printPage) { handlePrintPageNumber (); printPage = 0; } if (ch == 10 && newPage) { discardPageNumber (); newPage = 0; } if (pch == 10 && (ch == 10 || leadingBlanks > 1)) { makeParagraph (); leadingBlanks = 0; } if (!printPage && ppch == 10 && pch == '-' && ch == '-') printPage = 1; if (!newPage && pch == 10 && ch == ud->pageEnd[0]) { discardPageNumber (); newPage = 1; continue; } if (ch == 10) leadingBlanks = 0; ppch = pch; pch = ch; if (ud->text_length >= MAX_LENGTH) makeParagraph (); ud->text_buffer[ud->text_length++] = ch; } makeParagraph (); if (ud->back_text == html) { if (!insertCharacters (htmlEnd, strlen (htmlEnd))) return 0; if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; writeOutbuf (); ud->output_encoding = ascii8; } return 1; } int back_translate_file () { int ch; int ppch = 0; int pch = 0; int leadingBlanks = 0; int printPage = 0; int newPage = 0; widechar outbufx[BUFSIZE]; char *htmlStart = "No Title"; char *htmlEnd = ""; if (!start_document ()) return 0; ud->outbuf = outbufx; ud->outbuf1_len = MAX_LENGTH; if (ud->back_text == html) { if (!insertCharacters (htmlStart, strlen (htmlStart))) return 0; if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; ud->output_encoding = utf8; } else ud->output_encoding = ascii8; while ((ch = fgetc (ud->inFile)) != EOF) { if (ch == 13) continue; if (pch == 10 && ch == 32) { leadingBlanks++; continue; } if (ch == escapeChar) ch = 32; if (ch == '[' || ch == '\\' || ch == '^' || ch == ']' || ch == '@' || (ch >= 'A' && ch <= 'Z')) ch |= 32; if (ch == 10 && printPage) { handlePrintPageNumber (); printPage = 0; } if (ch == 10 && newPage) { discardPageNumber (); newPage = 0; } if (pch == 10 && (ch == 10 || leadingBlanks > 1)) { makeParagraph (); leadingBlanks = 0; } if (!printPage && ppch == 10 && pch == '-' && ch == '-') printPage = 1; if (!newPage && pch == 10 && ch == ud->pageEnd[0]) { discardPageNumber (); newPage = 1; continue; } if (ch == 10) leadingBlanks = 0; ppch = pch; pch = ch; if (ud->text_length >= MAX_LENGTH) makeParagraph (); ud->text_buffer[ud->text_length++] = ch; } makeParagraph (); if (ud->back_text == html) { if (!insertCharacters (htmlEnd, strlen (htmlEnd))) return 0; if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; writeOutbuf (); ud->output_encoding = ascii8; } return 1; } static int makeLinkOrTarget (xmlNode * node, int which) { StyleType *saveStyle; int saveFirst; int saveOutlen; xmlNode *child; int branchCount = 0; xmlChar *URL = get_attr_value (node); if (which == 0) insertCharacters ("", 2); saveOutlen = ud->outbuf1_len_so_far; child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: insert_code (node, branchCount); branchCount++; transcribe_paragraph (child, 1); break; case XML_TEXT_NODE: insert_text (child); break; default: break; } child = child->next; } insert_code (node, branchCount); insert_code (node, -1); insert_translation (ud->main_braille_table); saveStyle = style; saveFirst = styleSpec->status; styleSpec->status = startBody; style = lookup_style ("para"); editTrans (); doLeftJustify (); style = saveStyle; styleSpec->status = saveFirst; if (ud->outbuf1_len_so_far > saveOutlen) ud->outbuf1_len_so_far -= strlen (ud->lineEnd); if (!insertCharacters ("", 4)) return 0; if (!insertCharacters (ud->lineEnd, strlen (ud->lineEnd))) return 0; writeOutbuf (); return 1; } int insert_linkOrTarget (xmlNode * node, int which) { fineFormat (); makeLinkOrTarget (node, which); return 1; } int doBoxline (xmlNode * node) { widechar boxChar; widechar boxLine[MAXNAMELEN]; int k; int start = ud->text_length; int availableCells; insert_code (node, 0); if (!(ud->text_length - start)) return 0; boxChar = ud->text_buffer[start]; ud->text_length = start; cellsWritten = 0; availableCells = startLine (); while (availableCells != ud->cells_per_line) { finishLine (); availableCells = startLine (); } for (k = 0; k < availableCells; k++) boxLine[k] = boxChar; if (!insertWidechars (boxLine, availableCells)) return 0; cellsWritten = ud->cells_per_line; finishLine (); return 1; } int do_boxline (xmlNode * node) { fineFormat (); return doBoxline (node); } int do_newpage () { fineFormat (); if (ud->lines_on_page > 0) fillPage (); return 1; } int do_blankline () { fineFormat (); makeBlankLines (1); return 1; } int do_softreturn () { fineFormat (); return 1; } int do_righthandpage () { do_newpage (); if (ud->braille_pages && ud->interpoint && !(ud->braille_page_number & 1)) fillPage (); return 1; } int do_pagenum () { if (ud->page_separator) fineFormat (); if (!ud->merge_unnumbered_pages) { ud->print_page_number[0] = '_'; ud->print_page_number[1] = 0; if (!ud->page_separator_number_first[0] || ud->ignore_empty_pages) widestrcpy (ud->page_separator_number_first, ud->print_page_number); } return 1; } void do_linespacing (xmlNode * node) { widechar spacing; int savedTextLength = ud->text_length; insert_code (node, 0); if (ud->text_length == savedTextLength) spacing = '0'; else spacing = ud->text_buffer[savedTextLength]; ud->text_length = savedTextLength; if (spacing < '0' || spacing > '3') spacing = '0'; ud->line_spacing = spacing - '0'; } int start_style (StyleType * curStyle, xmlNode * node) { ud->needs_editing = 0; if (curStyle == NULL) curStyle = lookup_style ("para"); if (prevStyle == NULL) prevStyle = lookup_style ("para"); if ((ud->text_length > 0 || ud->translated_length > 0) && ud->style_top >= 0) { /*Continue last style */ insert_translation (ud->main_braille_table); styleSpec = &ud->style_stack[ud->style_top]; style = styleSpec->style; ud->brl_page_num_format = styleSpec->curBrlNumFormat; ud->style_format = styleSpec->curStyleFormat; ud->style_left_margin = styleSpec->curLeftMargin; ud->style_right_margin = styleSpec->curRightMargin; ud->style_first_line_indent = styleSpec->curFirstLineIndent; styleBody (); } if (ud->style_top < (STACKSIZE - 2)) ud->style_top++; styleSpec = &ud->style_stack[ud->style_top]; style = styleSpec->style = curStyle; styleSpec->status = beforeBody; styleSpec->node = node; if (style->brlNumFormat != normal) ud->brl_page_num_format = style->brlNumFormat; if (style->format != inherit) ud->style_format = style->format; else if (ud->style_format != leftJustified && ud->style_format != rightJustified && ud->style_format != centered) { ud->style_format = leftJustified; } if (style->left_margin != -100) ud->style_left_margin = style->left_margin; if (style->right_margin != -100) ud->style_right_margin = style->right_margin; if (style->first_line_indent != -100) ud->style_first_line_indent = style->first_line_indent; styleSpec->curBrlNumFormat = ud->brl_page_num_format; styleSpec->curStyleFormat = ud->style_format; styleSpec->curLeftMargin = ud->style_left_margin; styleSpec->curRightMargin = ud->style_right_margin; styleSpec->curFirstLineIndent = ud->style_first_line_indent; if (node && !node->children) return 1; startStyle (); styleSpec->status = startBody; return 1; } int end_style () { styleSpec = &ud->style_stack[ud->style_top]; style = styleSpec->style; ud->brl_page_num_format = styleSpec->curBrlNumFormat; ud->style_format = styleSpec->curStyleFormat; ud->style_left_margin = styleSpec->curLeftMargin; ud->style_right_margin = styleSpec->curRightMargin; ud->style_first_line_indent = styleSpec->curFirstLineIndent; if (!(styleSpec->node && !styleSpec->node->children)) { insert_translation (ud->main_braille_table); if (style->runningHead) set_runninghead_string (ud->translated_buffer, ud->translated_length); styleBody (); if (!ud->after_contents) finishStyle (); } memcpy (&prevStyleSpec, styleSpec, sizeof (prevStyleSpec)); prevStyle = prevStyleSpec.style; ud->style_top--; if (ud->style_top < 0) ud->style_top = 0; styleSpec = &ud->style_stack[ud->style_top]; style = styleSpec->style; ud->brl_page_num_format = styleSpec->curBrlNumFormat; ud->style_format = styleSpec->curStyleFormat; ud->style_left_margin = styleSpec->curLeftMargin; ud->style_right_margin = styleSpec->curRightMargin; ud->style_first_line_indent = styleSpec->curFirstLineIndent; ud->needs_editing = 0; return 1; } /* Routines for Unified Tactile Ducument Markup Language (UTDML) */ #define SPACE B16 /* Dot patterns must include B16 and be enclosed in parentheses.*/ #define NBSP (B16 | B10) #define CR (B16 | B11) #define HYPHEN (B16 | B3 | B6) #define ESCAPE (B16 | B11 | B1) #define CDOTS (B16 | B1 | B4) #define EDOTS (B16 | B1 | B5) #define RDOTS (B16 | B1 | B2 | B3 | B5) static char *currentTable; static char currentTableName[MAXNAMELEN]; static int firstPage; static int postponedStart; static int *indices; static int *backIndices; static widechar *backBuf; static int backLength; static xmlNode *brlNode; static xmlNode *firstBrlNode; static xmlNode *prevBrlNode; static xmlNode *documentNode = NULL; static xmlNode *parentOfBrlOnlyNode; static xmlNode *brlOnlyNode; static xmlNode *newpageNode; static xmlNode *newlineNode; static xmlChar *brlContent; static int maxContent; static char *utilStringBuf; static int lineWidth; static int cellsToWrite; static int utd_start () { ud->braille_pages = 1; firstPage = 1; postponedStart = 0; brlContent = (xmlChar *) ud->outbuf1; maxContent = ud->outbuf1_len * CHARSIZE; utilStringBuf = (char *) ud->text_buffer; currentTable = firstTableName; brlNode = firstBrlNode = prevBrlNode = NULL; ud->louis_mode = dotsIO; indices = NULL; if (!(ud->mode & notSync)) indices = ud->positions_array; backIndices = NULL; backBuf = NULL; backLength = 0; lineWidth = ud->normal_line; return 1; } static xmlParserCtxt *ctxt; static xmlNode * makeDaisyDoc () { xmlDoc *doc; xmlNode *newNode; xmlNode *rootNode; xmlNode *bodyNode; xmlNode *sectionNode; static const char *starter = ""; static int initialized = 0; if (!initialized) { initialized = 1; LIBXML_TEST_VERSION xmlKeepBlanksDefault (0); xmlSubstituteEntitiesDefault (1); xmlThrDefIndentTreeOutput (1); xmlThrDefKeepBlanksDefaultValue (0); xmlThrDefLineNumbersDefaultValue (1); } ctxt = xmlNewParserCtxt (); xmlSetGenericErrorFunc (ctxt, libxml_errors); doc = xmlParseMemory (starter, strlen (starter)); rootNode = xmlDocGetRootElement (doc); xmlNewProp (rootNode, (xmlChar *) "semantics", (xmlChar *) "action,no"); newNode = xmlNewNode (NULL, (xmlChar *) "head"); ud->head_node = xmlAddChild (rootNode, newNode); xmlNewProp (ud->head_node, (xmlChar *) "semantics", (xmlChar *) "action,markhead"); newNode = xmlNewNode (NULL, (xmlChar *) "body"); bodyNode = xmlAddChild (rootNode, newNode); xmlNewProp (bodyNode, (xmlChar *) "semantics", (xmlChar *) "style,document"); newNode = xmlNewNode (NULL, (xmlChar *) "section"); sectionNode = xmlAddChild (bodyNode, newNode); xmlNewProp (sectionNode, (xmlChar *) "semantics", (xmlChar *) "action,no"); ud->doc = doc; return sectionNode; } static int processDaisyDoc () { /* This function complements makeDaisyDoc. */ xmlNode *rootElement = NULL; int haveSemanticFile; if (ud->doc == NULL) { lou_logPrint ("Document could not be processed"); return 0; } rootElement = xmlDocGetRootElement (ud->doc); if (rootElement == NULL) { lou_logPrint ("Document is empty"); return 0; } haveSemanticFile = compile_semantic_table (rootElement); do_xpath_expr (); examine_document (rootElement); append_new_entries (); if (!haveSemanticFile) return 0; transcribe_document (rootElement); xmlFreeDoc (ud->doc); xmlCleanupParser (); initGenericErrorDefaultFunc (NULL); xmlFreeParserCtxt (ctxt); return 1; } static int freeDaisyDoc () { /* Call this function if you have used w makeDaisyDoc but not * procesDaisyDoc. */ if (ud->doc == NULL) { lou_logPrint ("Document could not be processed"); return 0; } xmlFreeDoc (ud->doc); xmlCleanupParser (); initGenericErrorDefaultFunc (NULL); xmlFreeParserCtxt (ctxt); return 1; } static int handleChar (int ch, unsigned char *buf, int *posx) { int pos = *posx; if (ch > 127 && ud->input_encoding == ascii8) { buf[pos++] = 0xc3; buf[pos++] = ch & 0x3f; } else if (ch == '<' || ch == '&') { buf[pos++] = '&'; if (ch == '<') { buf[pos++] = 'l'; buf[pos++] = 't'; } else { buf[pos++] = 'a'; buf[pos++] = 'm'; buf[pos++] = 'p'; } buf[pos++] = ';'; } else buf[pos++] = ch; *posx = pos; return 1; } int utd_transcribe_text_string () { xmlNode *addPara = makeDaisyDoc (); xmlNode *newPara; xmlNode *textNode; int charsProcessed = 0; int charsInParagraph = 0; int ch; int pch = 0; unsigned char *paragraphBuffer = (unsigned char *) ud->translated_buffer; ud->input_encoding = ud->input_text_encoding; while (1) { while (charsProcessed < ud->inlen) { ch = ud->inbuf[charsProcessed++]; if (ch == 0 || ch == 13) continue; if (ch == '\n' && pch == '\n') break; pch = ch; if (charsInParagraph >= MAX_LENGTH) break; handleChar (ch, paragraphBuffer, &charsInParagraph); } ch = ud->inbuf[charsProcessed++]; if (charsInParagraph == 0) break; paragraphBuffer[charsInParagraph] = 0; newPara = xmlNewNode (NULL, (xmlChar *) "p"); textNode = xmlNewText (paragraphBuffer); xmlAddChild (newPara, textNode); xmlAddChild (addPara, newPara); if (ch == 10) do_blankline (); charsInParagraph = 0; pch = 0; handleChar (ch, paragraphBuffer, &charsInParagraph); } processDaisyDoc (); ud->input_encoding = utf8; return 1; } int utd_transcribe_text_file () { xmlNode *addPara = makeDaisyDoc (); xmlNode *newPara; xmlNode *textNode; int charsInParagraph = 0; int ch; int pch = 0; unsigned char *paragraphBuffer = (unsigned char *) ud->translated_buffer; ud->input_encoding = ud->input_text_encoding; while (1) { while ((ch = fgetc (ud->inFile)) != EOF) { if (ch == 0 || ch == 13) continue; if (ch == '\n' && pch == '\n') break; pch = ch; if (charsInParagraph >= MAX_LENGTH) break; handleChar (ch, paragraphBuffer, &charsInParagraph); } if (charsInParagraph == 0) break; ch = fgetc (ud->inFile); if (ch != EOF) { paragraphBuffer[charsInParagraph - 1] = 0; newPara = xmlNewNode (NULL, (xmlChar *) "p"); if (ch == 10) xmlNewProp (newPara, (xmlChar *) "before", (xmlChar *) "1"); textNode = xmlNewText (paragraphBuffer); xmlAddChild (newPara, textNode); xmlAddChild (addPara, newPara); } charsInParagraph = 0; pch = 0; if (ch != EOF) handleChar (ch, paragraphBuffer, &charsInParagraph); } processDaisyDoc (); ud->input_encoding = utf8; return 1; } int link_brl_node (xmlNode * node) { if (node == NULL) return 0; if (firstBrlNode == NULL) { firstBrlNode = node; prevBrlNode = firstBrlNode; } else { prevBrlNode->_private = node; prevBrlNode = node; } brlNode = node; return 1; } static int backTranslateBlock (xmlNode * curBlock, xmlNode * curBrl) { xmlNode *child; xmlNode *backText; xmlNode *addBrl; int translationLength; int translatedLength; int goodTrans; int pos; int k, kk; if (curBlock == NULL || curBrl == NULL) return 1; ud->text_length = 0; child = curBrl->children; while (child) { if (child->type == XML_TEXT_NODE) insert_utf8 (child->content); child = child->next; } if (ud->text_length > backLength) { backLength = ud->text_length; backBuf = ud->outbuf1; backIndices = NULL; if (!(ud->mode & notSync)) backIndices = ud->positions_array; } translationLength = ud->text_length; translatedLength = 4 * backLength; goodTrans = lou_backTranslate (ud->main_braille_table, ud->text_buffer, &translationLength, backBuf, &translatedLength, NULL, NULL, backIndices, NULL, NULL, 0); if (!goodTrans) { translatedLength = translationLength; lou_dotsToChar (ud->main_braille_table, ud->text_buffer, backBuf, translatedLength, 0); } pos = 0; for (k = 0; k < translatedLength; k++) { widechar ch = backBuf[k]; unsigned char *utf8str = wcCharToUtf8 (ch); for (kk = 0; utf8str[kk]; kk++) utilStringBuf[pos++] = utf8str[kk]; } utilStringBuf[pos] = 0; backText = xmlNewText ((xmlChar *) utilStringBuf); xmlAddChild (curBlock, backText); addBrl = xmlAddChild (curBlock, curBrl); if (!goodTrans) { if (!(ud->mode & notSync)) xmlNewProp (addBrl, (xmlChar *) "index", (xmlChar *) "-1"); return 1; } kk = 0; if (!(ud->mode & notSync)) { for (k = 0; k < translatedLength; k++) { char posx[MAXNUMLEN]; int posxLen = sprintf (posx, "%d ", backIndices[k]); strcpy (&utilStringBuf[kk], posx); kk += posxLen; } utilStringBuf[--kk] = 0; xmlNewProp (addBrl, (xmlChar *) "index", (xmlChar *) utilStringBuf); } return 1; } static int makeDotsTextNode (xmlNode * node, const widechar * content, int length, int kind) { xmlNode *textNode; int inlen, outlen; if (length <= 0) return 1; if (ud->mode & notUC) { int k; if (kind) memcpy (ud->outbuf1, content, length * CHARSIZE); else lou_dotsToChar (currentTable, content, ud->outbuf1, length, 0); inlen = 0; for (k = 0; k < length; k++) ud->text_buffer[inlen++] = ud->outbuf1[k]; } else { if (kind) lou_charToDots (currentTable, content, ud->text_buffer, length, dotsIO); else memcpy (ud->text_buffer, content, length * CHARSIZE); if (!(ud->mode & louisDots)) for (inlen = 0; inlen < length; inlen++) ud->text_buffer[inlen] = (ud->text_buffer[inlen] & 0x00ff) | 0x2800; else inlen = length; } outlen = maxContent; wc_string_to_utf8 (ud->text_buffer, &inlen, brlContent, &outlen); textNode = xmlNewText (brlContent); xmlAddChild (node, textNode); return 1; } static xmlNode *addBlock; static int formatBackBlock () { xmlNode *newBlock; xmlNode *curBrl; int k; if (ud->translated_length <= 0) return 1; newBlock = xmlNewNode (NULL, (xmlChar *) "p"); xmlNewProp (newBlock, (xmlChar *) "semantics", (xmlChar *) "style,para"); curBrl = xmlNewNode (NULL, (xmlChar *) "brl"); makeDotsTextNode (curBrl, ud->translated_buffer, ud->translated_length, 1); ud->translated_length = ud->sync_text_length = 0; ud->in_sync = 1; backTranslateBlock (xmlAddChild (addBlock, newBlock), curBrl); return 1; } int utd_back_translate_file () { int ch; int ppch = 0; int pch = 0; int leadingBlanks = 0; ud->main_braille_table = ud->contracted_table_name; if (!lou_getTable (ud->main_braille_table)) return 0; ud->output_encoding = utf8; utd_start (); addBlock = makeDaisyDoc (); ud->translated_length = ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; while ((ch = fgetc (ud->inFile)) != EOF) { if (ch == 13) continue; if (pch == 10 && ch == 32) { leadingBlanks++; continue; } if (ch == '[' || ch == '\\' || ch == '^' || ch == ']' || ch == '@' || (ch >= 'A' && ch <= 'Z')) ch |= 32; if (pch == 10 && (ch == 10 || leadingBlanks > 1)) { formatBackBlock (); leadingBlanks = 0; } if (ch == 10) leadingBlanks = 0; ppch = pch; pch = ch; if (ud->translated_length >= MAX_LENGTH) formatBackBlock (); if (ch >= 32) ud->translated_buffer[ud->translated_length++] = ch; ud->in_sync = 0; } formatBackBlock (); ud->text_length = ud->translated_length = ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; utd_finish (); freeDaisyDoc (); return 1; } int utd_back_translate_braille_string () { int ch; int ppch = 0; int pch = 0; int leadingBlanks = 0; int k; ud->main_braille_table = ud->contracted_table_name; if (!lou_getTable (ud->main_braille_table)) return 0; ud->output_encoding = utf8; utd_start (); addBlock = makeDaisyDoc (); for (k = 0; k < ud->inlen; k++) { ch = ud->inbuf[k]; if (ch == 13) continue; if (pch == 10 && ch == 32) { leadingBlanks++; continue; } if (ch == '[' || ch == '\\' || ch == '^' || ch == ']' || ch == '@' || (ch >= 'A' && ch <= 'Z')) ch |= 32; if (pch == 10 && (ch == 10 || leadingBlanks > 1)) { formatBackBlock (); leadingBlanks = 0; } if (ch == 10) leadingBlanks = 0; ppch = pch; pch = ch; if (ud->translated_length >= MAX_LENGTH) formatBackBlock (); if (ch >= 32) ud->translated_buffer[ud->translated_length++] = ch; ud->in_sync = 0; } formatBackBlock (); ud->text_length = ud->translated_length = ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; utd_finish (); freeDaisyDoc (); return 1; } static int utd_insertCharacters (xmlNode * node, char *text, int length) { widechar charBuf[MAXNAMELEN]; int k; if (length <= 0) return 1; if (length >= MAXNAMELEN) length = MAXNAMELEN - 4; for (k = 0; k < length; k++) charBuf[k] = text[k]; makeDotsTextNode (node, charBuf, length, 1); return 1; } static int makeBrlOnlyNode () { xmlNode *newNode; newNode = xmlNewNode (NULL, (xmlChar *) "span"); xmlNewProp (newNode, (xmlChar *) "class", (xmlChar *) "brlonly"); parentOfBrlOnlyNode = xmlAddChild (brlNode, newNode); newNode = xmlNewNode (NULL, (xmlChar *) "brl"); brlOnlyNode = xmlAddChild (parentOfBrlOnlyNode, newNode); return 1; } static int checkTextFragment (widechar * text, int length) { int k; widechar dots; for (k = 0; k < length; k++) { dots = text[k]; if ((dots & (B7 | B8))) lineWidth = ud->wide_line; if (dots == NBSP) text[k] = SPACE; } return 1; } static int insertTextFragment (widechar * content, int length) { if (length <= 0) return 1; checkTextFragment (content, length); makeDotsTextNode (brlNode, content, length, 0); return 1; } typedef enum { topOfPage, lastLine, bottomOfPage, nearBottom, midPage } PageStatus; static PageStatus checkPageStatus () { int remaining; if (ud->vert_line_pos == ud->page_top || ud->lines_on_page == 0) return topOfPage; remaining = ud->page_bottom - ud->vert_line_pos; if (remaining < ud->normal_line || ud->lines_on_page >= ud->lines_per_page) return bottomOfPage; if ((ud->lines_on_page + 1) >= ud->lines_per_page || remaining == ud->normal_line) return lastLine; if (remaining > (2 * ud->normal_line) && remaining < (3 * ud->normal_line)) return nearBottom; return midPage; } /* Handle and generate short strings that appear only in braille. */ typedef struct { widechar origText[MAXNAMELEN]; widechar transText[MAXNAMELEN]; int origTextLength; int transTextLength; widechar prefixedOrigText[MAXNAMELEN]; widechar prefixedTransText[MAXNAMELEN]; int prefixedOrigTextLength; int prefixedTransTextLength; } ShortBrlOnlyStrings; static int setOrigTextChar (ShortBrlOnlyStrings * sbstr, unsigned char *inStr, int length) { for (; length >= 0 && inStr[length - 1] <= 32; length--); if (length <= 0) return 0; sbstr->origTextLength = MAXNAMELEN - 4; utf8_string_to_wc (inStr, &length, sbstr->origText, &sbstr->origTextLength); sbstr->transTextLength = 0; sbstr->prefixedOrigTextLength = 0; sbstr->prefixedTransTextLength = 0; return 1; } static int setOrigTextWidechar (ShortBrlOnlyStrings * sbstr, widechar * inStr, int length) { if (length <= 0) return 0; if (length >= MAXNAMELEN) length = MAXNAMELEN - 4; memcpy (sbstr->origText, inStr, length * CHARSIZE); sbstr->origTextLength = length; sbstr->transTextLength = 0; sbstr->prefixedOrigTextLength = 0; sbstr->prefixedTransTextLength = 0; return 1; } static int translateShortBrlOnly (ShortBrlOnlyStrings * sbstr) { int translationLength = sbstr->origTextLength; int translatedLength = MAXNAMELEN - 4; if (!lou_translateString (firstTableName, sbstr->origText, &translationLength, sbstr->transText, &translatedLength, NULL, NULL, dotsIO)) return 0; for (; sbstr->transText[translatedLength - 1] == SPACE; translatedLength--); sbstr->transText[translatedLength] = 0; sbstr->transTextLength = translatedLength; return 1; } static int addBrlOnly (xmlNode * node, ShortBrlOnlyStrings * sbstr) { int wcLength = sbstr->prefixedOrigTextLength; xmlChar buf[2 * MAXNAMELEN]; int utf8Length = sizeof (buf) - 4; makeDotsTextNode (node, sbstr->prefixedTransText, sbstr->prefixedTransTextLength, 0); wc_string_to_utf8 (sbstr->prefixedOrigText, &wcLength, buf, &utf8Length); xmlAddPrevSibling (node, xmlNewText (buf)); return 1; } static int addPrefixes (ShortBrlOnlyStrings * sbstr, widechar dots, widechar character, int howMany) { int k; int kk = 0; for (k = 0; k < howMany && k < MAXNAMELEN; k++) sbstr->prefixedTransText[k] = dots; for (; k < MAXNAMELEN; k++) { sbstr->prefixedTransText[k] = sbstr->transText[kk++]; if (kk > sbstr->transTextLength) break; } sbstr->prefixedTransTextLength = k; kk = 0; for (k = 0; k < howMany && k < MAXNAMELEN; k++) sbstr->prefixedOrigText[k] = character; for (; k < MAXNAMELEN; k++) { sbstr->prefixedOrigText[k] = sbstr->origText[kk++]; if (kk > sbstr->origTextLength) break; } sbstr->prefixedOrigTextLength = k; } static int addSpaces (ShortBrlOnlyStrings * sbstr, int howMany) { addPrefixes (sbstr, SPACE, ' ', howMany); memcpy (sbstr->origText, sbstr->prefixedOrigText, sbstr->prefixedOrigTextLength * CHARSIZE); memcpy (sbstr->transText, sbstr->prefixedTransText, sbstr->prefixedTransTextLength * CHARSIZE); sbstr->origTextLength = sbstr->prefixedOrigTextLength; sbstr->transTextLength = sbstr->prefixedTransTextLength; return 1; } static int utd_fillPage (); static int makeNewline (xmlNode * parent, int start); static ShortBrlOnlyStrings pageNumber; static int insertPageNumber (int howMany) { if (howMany < 0) howMany = 1; addPrefixes (&pageNumber, SPACE, ' ', howMany); makeBrlOnlyNode (); if (!addBrlOnly (brlOnlyNode, &pageNumber)) return 0; return 1; } static int utd_fillPage (); static int utd_makePageSeparator (char *printPageNumber, int length) { ShortBrlOnlyStrings sb; int k, kk; char setup[MAXNUMLEN]; PageStatus curPageStatus = checkPageStatus (); if (!ud->print_pages || !*printPageNumber) return 1; strcpy (setup, "-"); if (!(printPageNumber[0] >= '0' && printPageNumber[0] <= '9')) strcat (setup, ud->letsign); kk = strlen (setup); for (k = 0; k < length; k++) setup[kk++] = printPageNumber[k]; setup[kk] = 0; length = strlen (setup); memset (&sb, 0, sizeof (sb)); setOrigTextChar (&sb, setup, length); memcpy (ud->print_page_number, sb.origText, sb.origTextLength * CHARSIZE); ud->print_page_number[sb.origTextLength] = 0; translateShortBrlOnly (&sb); if (curPageStatus == topOfPage) return 1; addPrefixes (&sb, HYPHEN, '-', ud->cells_per_line - sb.transTextLength); ud->print_page_number[0] = 'a'; if (curPageStatus == nearBottom) { utd_fillPage (); return 1; } makeBrlOnlyNode (); makeNewline (brlOnlyNode, 0); addBrlOnly (brlOnlyNode, &sb); return 1; } static void utd_pagebreak (xmlNode * node, char *printPageNumber, int length) { xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "brl"); brlNode = xmlAddNextSibling (node, newNode); utd_makePageSeparator (printPageNumber, length); } static int utd_getBraillePageString () { char brlPageString[40]; if (!ud->number_braille_pages) { pageNumber.transTextLength = 0; return 1; } switch (ud->cur_brl_page_num_format) { case blank: return 1; default: case normal: sprintf (brlPageString, "%d", ud->braille_page_number); break; case p: sprintf (brlPageString, "p%d", ud->braille_page_number); break; case roman: strcpy (brlPageString, ud->letsign); strcat (brlPageString, makeRomanNumber (ud->braille_page_number)); break; } setOrigTextChar (&pageNumber, brlPageString, strlen (brlPageString)); translateShortBrlOnly (&pageNumber); addSpaces (&pageNumber, 3); return 1; } static int utd_getPrintPageString () { widechar printPageString[40]; int k; TranslationTableRule *rule; for (k = 0; ud->print_page_number[k]; k++) printPageString[k] = ud->print_page_number[k]; setOrigTextWidechar (&pageNumber, printPageString, k); translateShortBrlOnly (&pageNumber); rule = getLiblouisRule (firstTableHeader->letterSign); if (rule != NULL) { for (k = 0; k < pageNumber.transTextLength; k++) if (pageNumber.transText[k] == rule->charsdots[0]) { pageNumber.transText[k] = SPACE; addSpaces (&pageNumber, 2); break; } } else addSpaces (&pageNumber, 3); ud->print_page_number[0]++; return 1; } static int utd_getPageNumber () { int k; PageStatus curPageStatus; int braillePageNumber = 0; int printPageNumber = 0; memset (&pageNumber, 0, sizeof (pageNumber)); curPageStatus = checkPageStatus (); if (curPageStatus == midPage) return 1; if (curPageStatus == topOfPage) { if (ud->print_pages && ud->print_page_number_at && ud->print_page_number[0] != '_') { printPageNumber = 1; } if (!ud->braille_page_number_at && ud->cur_brl_page_num_format != blank) { braillePageNumber = 1; } } else if (curPageStatus == lastLine) { if (ud->print_pages && !ud->print_page_number_at && ud->print_page_number[0] != '_') { printPageNumber = 1; } if (ud->braille_page_number_at && ud->cur_brl_page_num_format != blank) { braillePageNumber = 1; } } if (ud->interpoint && !(ud->braille_page_number & 1)) braillePageNumber = 0; if (printPageNumber) utd_getPrintPageString (); if (braillePageNumber) utd_getBraillePageString (); return 1; } static int utd_centerHeadFoot (widechar * toCenter, int length) { ShortBrlOnlyStrings sb; int leadingBlanks; int trailingBlanks; int numCells = ud->cells_per_line - pageNumberLength; setOrigTextWidechar (&sb, toCenter, length); translateShortBrlOnly (&sb); if (sb.transTextLength > numCells) sb.transTextLength = numCells - 4; leadingBlanks = (numCells - sb.transTextLength) / 2; trailingBlanks = numCells - leadingBlanks - sb.transTextLength; addPrefixes (&sb, SPACE, ' ', leadingBlanks); addPrefixes (&pageNumber, SPACE, ' ', trailingBlanks); return 1; } /*End of handling and generating braille-only strings*/ int hasAttrValue (xmlNode * node, char *attrName, char *value) { char values[MAXNAMELEN]; xmlChar *allValues; int k; int prevValue = 0; if (node == NULL) return 0; allValues = xmlGetProp (node, (xmlChar *) attrName); if (allValues == NULL) return 0; strcpy (values, allValues); for (k = 0; values[k]; k++) if (values[k] == ' ') { values[k] = 0; if (strcmp (&values[prevValue], value) == 0) return 1; prevValue = k + 1; } if (strcmp (&values[prevValue], value) == 0) return 1; return 0; } static int assignTranslations () { int nextSegment = 0; int curPos = 0; xmlNode *curBrlNode; if (firstBrlNode == NULL) return 0; curBrlNode = firstBrlNode; while (curPos < translatedLength && curBrlNode != NULL && nextSegment < translatedLength) { if (translatedBuffer[curPos] == ENDSEGMENT || nextSegment == 0) { int nextPos = nextSegment; while (translatedBuffer[nextPos] != ENDSEGMENT && nextPos < translatedLength) nextPos++; makeDotsTextNode (curBrlNode, &translatedBuffer[nextSegment], nextPos - nextSegment, 0); if (curBrlNode && curBrlNode->_private != NULL) curBrlNode = curBrlNode->_private; curPos = nextPos; } nextSegment = curPos + 1; } return 1; } static int makeNewpage (xmlNode * parent) { char number[MAXNUMLEN]; xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "newpage"); sprintf (number, "%d", ud->braille_page_number); xmlNewProp (newNode, (xmlChar *) "brlnumber", (xmlChar *) number); newpageNode = xmlAddChild (parent, newNode); ud->lines_on_page = 0; return 1; } static int makeNewline (xmlNode * parent, int start) { char position[MAXNUMLEN]; xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "newline"); sprintf (position, "%d,%d", (ud->cell_width * start + ud->page_left), ud->vert_line_pos); xmlNewProp (newNode, (xmlChar *) "xy", (xmlChar *) position); xmlAddChild (parent, newNode); ud->vert_line_pos += lineWidth; lineWidth = ud->normal_line; ud->lines_on_page++; return 1; } static xmlNode *startNode; static int assignIndices (xmlNode * startNode, int startPos) { int nextSegment = startPos; int firstIndex; int curPos = startPos; xmlNode *curBrlNode; if (indices == NULL) return 1; if (startNode == NULL) return 0; curBrlNode = startNode; firstIndex = indices[startPos]; while (curPos < ud->translated_length && curBrlNode != NULL && nextSegment < ud->translated_length) { if (ud->translated_buffer[curPos] == ENDSEGMENT || nextSegment == startPos) { int indexPos = nextSegment; int kk = 0; if (ud->translated_buffer[curPos] == ENDSEGMENT) firstIndex = indices[curPos + 1]; while (ud->translated_buffer[indexPos] != ENDSEGMENT && indexPos < ud->translated_length) { char pos[MAXNUMLEN]; int posLen; posLen = sprintf (pos, "%d ", indices[indexPos] - firstIndex); strcpy (&utilStringBuf[kk], pos); kk += posLen; indexPos++; } utilStringBuf[--kk] = 0; if (xmlGetProp (curBrlNode, (xmlChar *) "index") == NULL) xmlNewProp (curBrlNode, (xmlChar *) "index", (xmlChar *) utilStringBuf); if (curBrlNode && curBrlNode->_private != NULL) curBrlNode = curBrlNode->_private; curPos = indexPos; } nextSegment = curPos + 1; } return 1; } static int utd_insert_translation (const char *table) { int translationLength; int translatedLength; int oldUdTranslatedLength = ud->translated_length; int k; int *setIndices; if (table != currentTable) { for (k = strlen (table); k >= 0; k--) if (table[k] == ud->file_separator) break; strcpy (currentTableName, &table[k + 1]); xmlNewProp (brlNode, (xmlChar *) "changetable", (xmlChar *) currentTableName); currentTable = table; } translatedLength = MAX_TRANS_LENGTH - ud->translated_length; translationLength = ud->text_length; if (indices != NULL) setIndices = &indices[ud->translated_length]; else setIndices = NULL; k = lou_translate (table, ud->text_buffer, &translationLength, &ud-> translated_buffer[ud->translated_length], &translatedLength, (char *) ud->typeform, NULL, NULL, setIndices, NULL, dotsIO); ud->in_sync = 0; memset (ud->typeform, 0, sizeof (ud->typeform)); ud->text_length = 0; if (!k) { lou_logPrint ("Could not open table %s", table); table = NULL; return 0; } if ((ud->translated_length + translatedLength) < MAX_TRANS_LENGTH) ud->translated_length += translatedLength; else ud->translated_length = MAX_TRANS_LENGTH; assignIndices (startNode, oldUdTranslatedLength); return 1; } static void utd_insert_text (xmlNode * node, int length) { int charsDone; xmlNode *newNode; int outSize; int k; if (ud->text_length >= MAX_TEXT_LENGTH) return; charsDone = length; outSize = MAX_TEXT_LENGTH - ud->text_length; ud->old_text_length = ud->text_length; utf8ToWc (node->content, &charsDone, &ud->text_buffer[ud->text_length], &outSize); ud->text_length += outSize; newNode = xmlNewNode (NULL, (xmlChar *) "brl"); switch (ud->stack[ud->top]) { case notranslate: utd_insert_translation (ud->main_braille_table); if ((ud->translated_length + ud->text_length) > MAX_TRANS_LENGTH) ud->text_length = MAX_TRANS_LENGTH - ud->translated_length; lou_charToDots (ud->main_braille_table, &ud->text_buffer[ud->old_text_length], &ud->translated_buffer[ud->translated_length], ud->text_length - ud->old_text_length, ud->louis_mode); for (k = 0; k < ud->text_length; k++) indices[ud->translated_length + k] = k; ud->translated_length += ud->text_length; ud->translated_buffer[ud->translated_length++] = ENDSEGMENT; ud->text_length = 0; ud->in_sync = 0; return; case pagenum: if (ud->print_pages) { char printPageNumber[MAXNUMLEN + 1]; for (k = 0; k < outSize && k < MAXNUMLEN; k++) printPageNumber[k] = ud->text_buffer[ud->old_text_length + k]; brlNode = xmlAddNextSibling (node, newNode); utd_makePageSeparator (printPageNumber, k); } ud->text_length = ud->old_text_length; return; default: setEmphasis (); break; } if (ud->old_text_length == 0) { startNode = xmlAddNextSibling (node, newNode); link_brl_node (startNode); } else link_brl_node (xmlAddNextSibling (node, newNode)); ud->text_buffer[ud->text_length++] = ENDSEGMENT; return; } static int utd_finishLine (int leadingBlanks, int lengtgh); static int setNewlineNode () { xmlNode *newNode = xmlNewNode (NULL, (xmlChar *) "newline"); newlineNode = xmlAddChild (brlNode, newNode); return 1; } static int setNewlineProp (int horizLinePos) { char position[MAXNUMLEN]; sprintf (position, "%d,%d", horizLinePos, ud->vert_line_pos); xmlNewProp (newlineNode, (xmlChar *) "xy", (xmlChar *) position); return 1; } static int postponedStartActions () { PageStatus curPageStatus = checkPageStatus (); if (prevStyle->action != document) { if (style->righthand_page) { utd_fillPage (); if (ud->interpoint && !(ud->braille_page_number & 1)) makeBlankPage (); } else if (style->newpage_before) utd_fillPage (); else if (style->lines_before > 0 && prevStyle->lines_after == 0 && curPageStatus != topOfPage) { if (curPageStatus == nearBottom) utd_fillPage (); else if (!utd_makeBlankLines (style->lines_before, 0)) return 0; } } else { if (style->lines_before > 0 && prevStyle->lines_after == 0 && prevStyle->action != document && curPageStatus != topOfPage) { if (!utd_makeBlankLines (style->lines_before, 0)) return 0; } } return 1; } static int utd_startLine () { PageStatus curPageStatus; int availableCells = 0; if (firstPage) { firstPage = 0; makeNewpage (brlNode); } if (postponedStart) { postponedStart = 0; postponedStartActions (); } while (availableCells == 0) { setNewlineNode (); lineWidth = ud->normal_line; curPageStatus = checkPageStatus (); utd_getPageNumber (); if (curPageStatus == topOfPage) { if (ud->running_head_length > 0 || (style->skip_number_lines && pageNumber.transTextLength > 0)) { utd_finishLine (0, 0); setNewlineNode (); continue; } availableCells = ud->cells_per_line - pageNumber.transTextLength; } else if (curPageStatus == lastLine || curPageStatus == bottomOfPage) { if (ud->footer_length > 0 || (style->skip_number_lines && pageNumber.transTextLength > 0)) { utd_finishLine (0, 0); continue; } availableCells = ud->cells_per_line - pageNumber.transTextLength; } else availableCells = ud->cells_per_line; } return availableCells; } static int utd_finishLine (int leadingBlanks, int length) { PageStatus curPageStatus; int cellsOnLine = 0; int cellsToWrite = 0; int k; int leaveBlank; int horizLinePos = ud->page_left + leadingBlanks * ud->cell_width; cellsOnLine = leadingBlanks + length; for (leaveBlank = -1; leaveBlank < ud->line_spacing; leaveBlank++) { curPageStatus = checkPageStatus (); if (leaveBlank != -1) { utd_startLine (); ud->vert_line_pos += ud->normal_line; ud->lines_on_page++; setNewlineProp (0); } if (cellsOnLine > 0 && pageNumber.transTextLength > 0) { cellsToWrite = ud->cells_per_line - pageNumber.transTextLength - cellsOnLine; if (!insertPageNumber (cellsToWrite)) return 0; } else if (curPageStatus == topOfPage) { if (ud->running_head_length > 0) centerHeadFoot (ud->running_head, ud->running_head_length); else { if (pageNumber.transTextLength) { cellsToWrite = ud->cells_per_line - pageNumber.transTextLength; if (!insertPageNumber (cellsToWrite)) return 0; } } } else if (curPageStatus == lastLine || curPageStatus == bottomOfPage) { if (ud->footer_length > 0) centerHeadFoot (ud->footer, ud->footer_length); else { if (pageNumber.transTextLength) { horizLinePos = (ud->cells_per_line - pageNumber.transTextLength) * ud->cell_width + ud->page_left; if (!insertPageNumber (0)) return 0; } } } } setNewlineProp (horizLinePos); ud->vert_line_pos += lineWidth; ud->lines_on_page++; curPageStatus = checkPageStatus (); if (curPageStatus == bottomOfPage) { if (ud->print_page_number[0] != '_') { unsigned char holder[MAXNUMLEN]; int k; for (k = 0; ud->print_page_number[k]; k++) holder[k] = ud->print_page_number[k]; holder[k] = 0; xmlSetProp (newpageNode, (xmlChar *) "printnumber", holder); } ud->braille_page_number++; ud->vert_line_pos = ud->page_top; makeNewpage (brlNode); } return 1; } static int utd_doOrdinaryText () { int availableCells; int origAvailableCells; int cellsOnLine = 0; int leadingBlanks = 0; widechar dots; int lastSpace; int charactersWritten = 0; int newLineNeeded = 1; brlNode = firstBrlNode; while (brlNode) { do { if (newLineNeeded) { newLineNeeded = 0; if (translatedBuffer[charactersWritten] == SPACE) charactersWritten++; origAvailableCells = availableCells = utd_startLine (); if (ud->style_format == leftJustified) { if (styleSpec->status == startBody) leadingBlanks = ud->style_left_margin + ud->style_first_line_indent; else leadingBlanks = ud->style_left_margin; availableCells -= leadingBlanks; } styleSpec->status = resumeBody; } lastSpace = 0; for (cellsToWrite = 0; cellsToWrite < availableCells && (charactersWritten + cellsToWrite) < translatedLength && (dots = translatedBuffer[charactersWritten + cellsToWrite]) != ENDSEGMENT; cellsToWrite++) if (dots == SPACE) lastSpace = cellsToWrite; if (cellsToWrite == availableCells) newLineNeeded = 1; if (dots != ENDSEGMENT && lastSpace != 0) cellsToWrite = lastSpace + 1; cellsOnLine += cellsToWrite; availableCells -= cellsToWrite; insertTextFragment (&translatedBuffer[charactersWritten], cellsToWrite); charactersWritten += cellsToWrite; if (newLineNeeded || (charactersWritten + 1) >= translatedLength) { switch (style->format) { default: case leftJustified: break; case centered: leadingBlanks = (origAvailableCells - cellsOnLine) / 2; break; case rightJustified: leadingBlanks = origAvailableCells - cellsOnLine; break; } utd_finishLine (leadingBlanks, cellsToWrite); cellsOnLine = 0; newLineNeeded = 1; } } while (dots != ENDSEGMENT && charactersWritten < translatedLength); charactersWritten++; prevBrlNode = brlNode; brlNode = brlNode->_private; prevBrlNode->_private = NULL; } brlNode = prevBrlNode; /*for utd_finishStyle */ return 1; } static int utd_makeBlankLines (int number, int beforeAfter) { int k; PageStatus curPageStatus; if (number <= 0) return 1; curPageStatus = checkPageStatus (); if (beforeAfter == 0 && (curPageStatus == topOfPage || prevStyle->lines_after > 0 || prevStyle->action == document)) return 1; else if (beforeAfter == 1 && curPageStatus == nearBottom) return 1; for (k = 0; k < number; k++) { utd_startLine (); if (!utd_finishLine (0, 0)) return 0; } return 1; } static int utd_fillPage () { PageStatus curPageStatus = checkPageStatus (); if (curPageStatus == topOfPage) { utd_startLine (); utd_finishLine (0, 0); } ud->vert_line_pos = ud->page_bottom - ud->normal_line; utd_startLine (); utd_finishLine (0, 0); return 1; } static int utd_doComputerCode () { int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; int k; while (translatedBuffer[charactersWritten] == CR) charactersWritten++; while (charactersWritten < translatedLength) { int lineTooLong = 0; availableCells = utd_startLine (); for (cellsToWrite = 0; cellsToWrite < availableCells; cellsToWrite++) if ((charactersWritten + cellsToWrite) >= translatedLength || translatedBuffer[charactersWritten + cellsToWrite] == CR) break; if ((charactersWritten + cellsToWrite) > translatedLength) cellsToWrite--; if (cellsToWrite <= 0 && translatedBuffer[charactersWritten] != CR) break; if (cellsToWrite == availableCells && translatedBuffer[charactersWritten + cellsToWrite] != CR) { cellsToWrite = availableCells - strlen (ud->comp_hyphen); lineTooLong = 1; } if (translatedBuffer[charactersWritten + cellsToWrite] == CR) translatedBuffer[charactersWritten + cellsToWrite] = SPACE; if (!insertTextFragment (&translatedBuffer[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (translatedBuffer[charactersWritten] == SPACE) charactersWritten++; if (lineTooLong) { if (!utd_insertCharacters (brlNode, ud->comp_hyphen, strlen (ud->comp_hyphen))) return 0; } utd_finishLine (0, cellsToWrite); } return 1; } static int utd_doAlignColumns () { int numRows = 0; int rowNum = 0; int numCols = 0; int colNum = 0; int colLength = 0; int rowLength; int colSize[MAXCOLS]; widechar rowBuf[MAXROWSIZE]; int bufPos; int k; unsigned int ch; int rowEnd = 0; for (bufPos = 0; bufPos < translatedLength; bufPos++) if (translatedBuffer[bufPos] == ESCAPE) break; if (bufPos >= translatedLength) { utd_doOrdinaryText (); return 1; } for (k = 0; k < MAXCOLS; k++) colSize[k] = 0; /*Calculate number of columns and column sizes */ while (bufPos < translatedLength) { ch = translatedBuffer[bufPos++]; if (ch == ESCAPE) { unsigned int nch = translatedBuffer[bufPos]; if (nch == RDOTS) /*End of row */ { numRows++; if (rowEnd == 0) rowEnd = colLength; colLength = 0; colNum = 0; bufPos++; } else if (nch == CDOTS) { if (numRows == 0) numCols++; if (colSize[colNum] < colLength) colSize[colNum] = colLength; colNum++; colLength = 0; bufPos++; } else if (nch == EDOTS) break; } else colLength++; } colSize[numCols - 1] += rowEnd; if (style->format == alignColumnsLeft) { /*Calculate starting points of columns in output */ int colStart = 0; for (colNum = 0; colNum < numCols; colNum++) { k = colSize[colNum]; colSize[colNum] = colStart; colStart += k; if (colNum != (numCols - 1)) colStart += COLSPACING; } } else { /*Calculate ending points of columns in output */ int colEnd = colSize[0]; for (colNum = 1; colNum < numCols; colNum++) { colEnd += colSize[colNum] + COLSPACING; colSize[colNum] = colEnd; } } /*Now output the stuff.*/ if ((ud->lines_per_page - ud->lines_on_page) < numRows) utd_fillPage (); bufPos = 0; for (rowNum = 0; rowNum < numRows; rowNum++) { int charactersWritten = 0; int cellsToWrite = 0; int availableCells = 0; rowLength = 0; if (style->format == alignColumnsLeft) { for (colNum = 0; colNum < numCols; colNum++) { while (rowLength < MAXROWSIZE && translatedBuffer[bufPos] != ESCAPE) rowBuf[rowLength++] = translatedBuffer[bufPos++]; bufPos += 2; if (colNum < (numCols - 1)) { while (rowLength < MAXROWSIZE && rowLength < colSize[colNum + 1]) rowBuf[rowLength++] = ' '; } else { while (rowLength < MAXROWSIZE && translatedBuffer[bufPos] != ESCAPE) rowBuf[rowLength++] = translatedBuffer[bufPos++]; bufPos += 2; /*actual end of row */ } } } else { int prevBufPos = bufPos; int prevCol = 0; for (colNum = 0; colNum < numCols; colNum++) { while (translatedBuffer[bufPos] != ESCAPE) bufPos++; for (k = bufPos - 1; k >= prevBufPos; k--) rowBuf[k + prevCol] = translatedBuffer[k]; for (; k >= prevCol; k--) rowBuf[k + prevCol] = ' '; prevBufPos = bufPos + 2; prevCol = colSize[colNum]; rowLength += colSize[colNum]; if (rowLength > MAXROWSIZE) break; } while (rowLength < MAXROWSIZE && translatedBuffer[bufPos] != ESCAPE) rowBuf[rowLength++] = translatedBuffer[bufPos++]; bufPos += 2; } while (charactersWritten < rowLength) { int rowTooLong = 0; availableCells = utd_startLine (); if ((charactersWritten + availableCells) >= rowLength) cellsToWrite = rowLength - charactersWritten; else { for (cellsToWrite = availableCells; cellsToWrite > 0; cellsToWrite--) if (rowBuf[charactersWritten + cellsToWrite] == SPACE) break; if (cellsToWrite == 0) { cellsToWrite = availableCells - 1; rowTooLong = 1; } } while (rowBuf[charactersWritten + cellsToWrite] == SPACE) cellsToWrite--; if (cellsToWrite == 0) break; if (!insertTextFragment (&rowBuf[charactersWritten], cellsToWrite)) return 0; charactersWritten += cellsToWrite; if (rowTooLong) { if (!utd_insertCharacters (brlNode, ud->lit_hyphen, strlen (ud->lit_hyphen))) return 0; } utd_finishLine (0, cellsToWrite); } } return 1; } static int utd_doListColumns () { utd_doOrdinaryText (); return 1; } static int utd_startStyle () { firstBrlNode = NULL; if (styleSpec->node != NULL && style->action == document) { documentNode = styleSpec->node; ud->vert_line_pos = ud->page_top; return 1; } if (!ud->paragraphs) return 1; if ((style->lines_before || style->newpage_before || style->righthand_page) && styleSpec->node != NULL) { postponedStart = 1; } return 1; } static int utd_editTrans () { int translationLength; if (ud->needs_editing && !(ud->contents == 2) && !(style->format == computerCoded) && ud->edit_table_name && (ud->has_math || ud->has_chem || ud->has_music)) { lou_dotsToChar (ud->edit_table_name, ud->translated_buffer, ud->text_buffer, ud->translated_length, ud->louis_mode); translationLength = ud->translated_length; translatedLength = MAX_TRANS_LENGTH; if (!lou_translate (ud->edit_table_name, ud->text_buffer, &translationLength, ud->translated_buffer, &translatedLength, NULL, NULL, NULL, NULL, NULL, dotsIO)) { lou_logPrint ("edit table '%s' could not be found or contains errors", ud->edit_table_name); ud->edit_table_name = NULL; return 0; } } translatedBuffer = ud->translated_buffer; translatedLength = ud->translated_length; return 1; } static int utd_styleBody () { sem_act action; if (!utd_editTrans ()) return 0; if (!ud->paragraphs) assignTranslations (); else { cellsOnLine = 0; action = style->action; if (action == contentsheader && ud->contents != 2) { initialize_contents (); start_heading (action, translatedBuffer, translatedLength); finish_heading (action); ud->text_length = ud->translated_length = ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; return 1; } if (ud->contents == 1) { if (ud->braille_page_number_at && (action == heading1 || action == heading2 || action == heading3 || action == heading4)) getBraillePageString (); start_heading (action, translatedBuffer, translatedLength); } switch (style->format) { case centered: case rightJustified: case leftJustified: default: utd_doOrdinaryText (); break; case alignColumnsLeft: case alignColumnsRight: utd_doAlignColumns (); break; case listColumns: utd_doListColumns (); break; case computerCoded: utd_doComputerCode (); break; case contents: break; } if (ud->contents == 1) finish_heading (action); styleSpec->status = resumeBody; } ud->translated_length = 0; ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; firstBrlNode = NULL; return 1; } static int utd_finishStyle () { PageStatus curPageStatus = checkPageStatus (); if (!ud->paragraphs) return 1; if (style->newpage_after) utd_fillPage (); else if (style->lines_after > 0) { if (curPageStatus == nearBottom) utd_fillPage (); else { if (!utd_makeBlankLines (style->lines_after, 1)) return 0; } } brlNode = firstBrlNode = NULL; return 1; } void do_utdxxxximg (xmlNode * node) { sem_act action; char *cwidth; char *cheight; xmlChar *src; int width; int height; int maxWidth; int maxHeight; xmlNode *curBrl; if (node == NULL) return; action = ud->stack[ud->top]; cwidth = xmlGetProp (node, (xmlChar *) "twidth"); cheight = xmlGetProp (node, (xmlChar *) "twidth"); src = xmlGetProp (node, (xmlChar *) "tsrc"); if (cwidth == NULL || cheight == NULL || src == NULL) return; width = atoi (cwidth); height = atoi (cheight); maxWidth = ud->page_right - ud->page_left; curBrl = xmlNewNode (NULL, (xmlChar *) "brl"); link_brl_node (xmlAddNextSibling (node, curBrl)); xmlNewProp (brlNode, (xmlChar *) "img", src); if (action == utddispimg) { if (!ud->paragraphs) return; maxHeight = ud->page_bottom - ud->page_top - (2 * ud->wide_line); /* Don't use first and last lines on page. */ if ((ud->vert_line_pos + height) > maxHeight) do_righthandpage (); makeNewline (brlNode, 0); lineWidth += height; makeNewline (brlNode, 0); } else if (action == utdinlnimg) { if (height > (ud->wide_line - 2) || (width > maxWidth)) return; // horizLinePos += width; } else return; } void output_xml (xmlDoc * doc) { if (ud->outFile) xmlDocDump (ud->outFile, doc); else { xmlChar *dumpLoc; int dumpSize; xmlDocDumpMemory (doc, &dumpLoc, &dumpSize); if (dumpSize > (CHARSIZE * ud->outlen)) { lou_logPrint ("output buffer too small"); ud->outlen_so_far = 0; } else { memcpy (ud->outbuf, dumpLoc, dumpSize); ud->outlen_so_far = dumpSize; } xmlFree (dumpLoc); } return; } static int utd_finish () { xmlNode *newNode; if (ud->paragraphs) { newNode = xmlNewNode (NULL, (xmlChar *) "brl"); brlNode = xmlAddChild (documentNode, newNode); if (ud->style_top < 0) ud->style_top = 0; if (ud->text_length != 0) insert_translation (ud->main_braille_table); if (ud->translated_length != 0) write_paragraph (para, NULL); if (style == NULL) style = lookup_style ("para"); utd_fillPage (); } if (ud->head_node) { newNode = xmlNewNode (NULL, (xmlChar *) "meta"); xmlNewProp (newNode, (xmlChar *) "name", (xmlChar *) "utd"); sprintf (utilStringBuf, "braillePageNumber=%d \ firstTableName=%s \ dpi=%d \ paperWidth=%d \ paperHeight=%d \ leftMargin=%d \ rightMargin=%d \ topMargin=%d \ bottomMargin=%d", ud->braille_page_number, firstTableName, (int) ud->dpi, ud->paper_width, ud->paper_height, ud->left_margin, ud->right_margin, ud->top_margin, ud->bottom_margin); xmlNewProp (newNode, (xmlChar *) "content", (xmlChar *) utilStringBuf); xmlAddChild (ud->head_node, newNode); } if (ud->orig_format_for != utd) convert_utd (); else output_xml (ud->doc); return 1; } liblouisutdml-2.5.0/liblouisutdml/utd2transinxml.c0000664000076500007650000001563312151533541017405 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" static int findBrlNodes (xmlNode * node); static int txDoBrlNode (xmlNode * node, int action); static int beginDocument (); static int finishBrlNode (); static int finishDocument (); static int doUtdbrlonly (xmlNode * node, int action); static int doUtdnewpage (xmlNode * node); static int doUtdnewline (xmlNode * node); static int doUtddispimg (xmlNode * node); static int firstPage; static int firstLineOnPage; int utd2transinxml (xmlNode * node) { ud->top = -1; ud->style_top = -1; firstPage = 1; firstLineOnPage = 1; beginDocument (); findBrlNodes (node); finishDocument (); return 1; } static int beginDocument () { } static int finishDocument () { output_xml (ud->doc); } static xmlNode *curBrlNode; static int useAfterCurBrl; static xmlNode *afterCurBrl; static int findBrlNodes (xmlNode * node) { xmlNode *child; if (node == NULL) return 0; useAfterCurBrl = 0; push_sem_stack (node); switch (ud->stack[ud->top]) { case utdmeta: return 1; case utdbrl: curBrlNode = node; txDoBrlNode (node, 0); pop_sem_stack (); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: findBrlNodes (child); break; case XML_TEXT_NODE: break; default: break; } if (useAfterCurBrl) { child = afterCurBrl; useAfterCurBrl = 0; } else child = child->next; } pop_sem_stack (); useAfterCurBrl = 0; return 1; } static char *blanks = " "; static int insertCharacters (const char *text, int length) { int k; for (k = 0; k < length; k++) ud->outbuf1[ud->outbuf1_len_so_far++] = text[k]; return 1; } static int doDotsText (xmlNode * node) { ud->text_length = 0; insert_utf8 (node->content); if (!lou_dotsToChar (ud->main_braille_table, ud->text_buffer, &ud->outbuf1[ud->outbuf1_len_so_far], ud->text_length, 0)) return 0; ud->outbuf1_len_so_far += ud->text_length; return 1; } static int doUtdbrlonly (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (ud->top == 0) action = 1; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case utdnewpage: doUtdnewpage (node); if (action != 0) pop_sem_stack (); return 1; case utdnewline: doUtdnewline (node); if (action != 0) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: doUtdbrlonly (child, 1); break; case XML_TEXT_NODE: doDotsText (child); break; default: break; } child = child->next; } if (action != 0) { pop_sem_stack (); return 1; } return 1; } static int lastLinepos; static int doUtdnewpage (xmlNode * node) { lastLinepos = ud->page_top; firstLineOnPage = 1; if (firstPage) { firstPage = 0; return 1; } insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); insertCharacters (ud->pageEnd, strlen (ud->pageEnd)); return 1; } static int doUtdnewline (xmlNode * node) { char *xy; int k; int leadingBlanks; int linepos; if (!firstLineOnPage) insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); xy = (char *) xmlGetProp (node, (xmlChar *) "xy"); for (k = 0; xy[k] != ','; k++); leadingBlanks = (atoi (xy) - ud->left_margin) / ud->cell_width; linepos = (atoi (&xy[k + 1]) - ud->page_top) / ud->normal_line; insertCharacters (blanks, leadingBlanks); if (firstLineOnPage) firstLineOnPage = 0; return 1; } int txDoBrlNode (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (action == 0) ud->outbuf1_len_so_far = 0; else push_sem_stack (node); switch (ud->stack[ud->top]) { case markhead: if (ud->head_node == NULL) ud->head_node = node; pop_sem_stack (); break; case utdbrlonly: doUtdbrlonly (node, 0); if (action != 0) pop_sem_stack (); return 1; case utdnewpage: doUtdnewpage (node); if (action != 0) pop_sem_stack (); return 1; case utdnewline: doUtdnewline (node); if (action != 0) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: txDoBrlNode (child, 1); break; case XML_TEXT_NODE: doDotsText (child); break; default: break; } child = child->next; } if (action != 0) pop_sem_stack (); else finishBrlNode (); return 1; } static int finishBrlNode () { int wcLength; int utf8Length; unsigned char *transText = (unsigned char *) ud->outbuf2; xmlNode *transNode; xmlNode *linkedTransNode; xmlNode *oldPrevSib; xmlNode *oldBrlNode; wcLength = ud->outbuf1_len_so_far; utf8Length = ud->outbuf2_len; wc_string_to_utf8 (ud->outbuf1, &wcLength, transText, &utf8Length); transNode = xmlNewText (transText); oldPrevSib = curBrlNode->prev; if (oldPrevSib != NULL && oldPrevSib->type == XML_TEXT_NODE) { xmlUnlinkNode (oldPrevSib); xmlFreeNode (oldPrevSib); } linkedTransNode = xmlAddPrevSibling (curBrlNode, transNode); afterCurBrl = curBrlNode->next; useAfterCurBrl = 1; oldBrlNode = curBrlNode; xmlUnlinkNode (oldBrlNode); xmlFreeNode (oldBrlNode); return 1; } liblouisutdml-2.5.0/liblouisutdml/readconfig.c0000664000076500007650000010327112200713366016504 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include #include #include #include #include #include #include "louisutdml.h" #include "sem_names.h" #include void memoryError () { fprintf (stderr, "liblouisutdml: insufficient memory\n"); //"liblouisutdml: Insufficient memory: %s", strerror (errno), "\n"); exit (3); } typedef struct { const char *fileName; #define configString fileName FILE *in; int stringPos; int lineNumber; char line[5 * MAXNAMELEN]; char *action; int actionLength; char *value; int valueLength; char *value2; int value2Length; } FileInfo; static char pathEnd[2]; static double paperWidth; static double paperHeight; static double leftMargin; static double rightMargin; static double topMargin; static double bottomMargin; static int errorCount = 0; static int fatalErrorCount = 0; static void configureError (FileInfo * nested, char *format, ...) { char buffer[1024]; va_list arguments; va_start (arguments, format); #ifdef _WIN32 _vsnprintf (buffer, sizeof (buffer), format, arguments); #else vsnprintf (buffer, sizeof (buffer), format, arguments); #endif va_end (arguments); if (nested) lou_logPrint ("%s:%d: %s", nested->fileName, nested->lineNumber, buffer); else lou_logPrint ("%s", buffer); errorCount++; } char * alloc_string (const char *inString) { int length; char *newString; if (inString == NULL) return NULL; length = strlen (inString); if ((length + ud->string_buf_len) >= sizeof (ud->string_buffer)) return NULL; newString = &ud->string_buffer[ud->string_buf_len]; strcpy (newString, inString); ud->string_buf_len += length + 1; return newString; } char * alloc_string_if_not (const char *inString) { int alreadyStored; if (inString == NULL) return NULL; alreadyStored = inString - ud->string_buffer; if (alreadyStored >= 0 && alreadyStored < ud->string_buf_len) return (char *) inString; return (char *) alloc_string (inString); } int file_exists (const char *completePath) { struct stat statInfo; if (stat (completePath, &statInfo) != -1) return 1; return 0; } int find_file (const char *fileName, char *filePath) { struct stat statInfo; char trialPath[MAXNAMELEN]; int listLength; int k; int currentListPos = 0; int nameLength = strlen (fileName); int pathLength; filePath[0] = 0; for (k = 0; k < nameLength && fileName[k] != ud->file_separator; k++); if (k != nameLength) { /* This name contains a path */ if (stat (fileName, &statInfo) != -1) { strcpy (filePath, fileName); return 1; } else return 0; } /*Process path list */ listLength = strlen (ud->path_list); for (k = 0; k < listLength; k++) if (ud->path_list[k] == ',') break; if (k == listLength) { /* Only one path */ strcpy (trialPath, ud->path_list); if (trialPath[strlen (trialPath) - 1] != ud->file_separator) strcat (trialPath, pathEnd); pathLength = strlen (trialPath); strcat (trialPath, fileName); if (stat (trialPath, &statInfo) != -1) { strcpy (&trialPath[pathLength], fileName); strcpy (filePath, trialPath); return 1; } } else { /* Search a list of paths */ strncpy (trialPath, ud->path_list, k); trialPath[k] = 0; if (trialPath[strlen (trialPath) - 1] != ud->file_separator) strcat (trialPath, pathEnd); pathLength = strlen (trialPath); strcat (trialPath, fileName); if (stat (trialPath, &statInfo) != -1) { strcpy (&trialPath[pathLength], fileName); strcpy (filePath, trialPath); return 1; } currentListPos = k + 1; while (currentListPos < listLength) { for (k = currentListPos; k < listLength; k++) if (ud->path_list[k] == ',') break; strncpy (trialPath, &ud->path_list[currentListPos], k - currentListPos); trialPath[k - currentListPos] = 0; if (trialPath[strlen (trialPath) - 1] != ud->file_separator) strcat (trialPath, pathEnd); pathLength = strlen (trialPath); strcat (trialPath, fileName); if (stat (trialPath, &statInfo) != -1) { strcpy (&trialPath[pathLength], fileName); strcpy (filePath, trialPath); return 1; } currentListPos = k + 1; } } return 0; } static char * findTable (FileInfo * nested) { char trialPath[MAXNAMELEN]; char filePath[MAXNAMELEN]; struct stat statInfo; filePath[0] = 0; if (ud->config_path != NULL) { strcpy (trialPath, ud->config_path); if (trialPath[strlen (trialPath) -1] != ud->file_separator) strcat (trialPath, pathEnd); strcat (trialPath, nested->value); if (stat (trialPath, &statInfo) != -1) strcpy (filePath, trialPath); } else if (filePath[0] == 0) { strcpy (trialPath, ud->lbu_files_path); strcat (trialPath, nested->value); if (stat (trialPath, &statInfo) != -1) strcpy (filePath, trialPath); } strcpy (trialPath, filePath); if (trialPath[0] == 0) { if (lou_getTable (nested->value) != NULL) strcpy (trialPath, getLastTableList ()); } if (trialPath[0] == 0) { configureError (nested, "Table '%s' cannot be found.", nested->value); fatalErrorCount++; return NULL; } return alloc_string_if_not (trialPath); } static int controlCharValue (FileInfo * nested) { /*Decode centrol characters*/ int k = 0; char decoded[100]; int decodedLength = 0; while (k < nested->valueLength) { if (nested->value[k] == '~' || nested->value[k] == '^') { decoded[decodedLength++] = (nested->value[k + 1] | 32) - 96; k += 2; } else if (nested->value[k] == '\\') { k++; switch (nested->value[k] | 32) { case 'f': decoded[decodedLength++] = 12; break; case 'n': decoded[decodedLength++] = 10; break; case 'r': decoded[decodedLength++] = 13; break; default: configureError (nested, "invalid value '%s'", nested->value); return 0; } k++; } else decoded[decodedLength++] = nested->value[k++]; } decoded[decodedLength] = 0; strcpy (nested->value, decoded); nested->valueLength = decodedLength; return 1; } static int compileConfig (FileInfo * nested); int config_compileSettings (const char *fileName) { /*Compile an input file or string */ FileInfo nested; char completePath[MAXNAMELEN]; if (!*fileName) return 1; /*Probably run with defaults */ nested.fileName = fileName; nested.lineNumber = 0; nested.stringPos = 1; if (nested.fileName[0] == ud->string_escape) return compileConfig (&nested); if (!find_file (fileName, completePath)) { configureError (NULL, "Can't find configuration file '%s'", fileName); return 0; } if ((nested.in = fopen ((char *) completePath, "rb"))) { compileConfig (&nested); fclose (nested.in); } else { configureError (NULL, "Can't open configuration file '%s'", fileName); return 0; } return 1; } static int getLine (FileInfo * nested) { int lineLen = 0; int ch; if (nested->fileName[0] != ud->string_escape) { int pch = 0; while ((ch = fgetc (nested->in)) != EOF) { if (ch == 13) continue; if (pch == '\\' && ch == 10) { lineLen--; continue; } if (ch == 10 || lineLen > (sizeof (nested->line) - 2)) break; nested->line[lineLen++] = ch; pch = ch; } nested->line[lineLen] = 0; if (ch == EOF) return 0; return 1; } if (nested->configString[nested->stringPos] == 0) return 0; while ((ch = nested->configString[nested->stringPos])) { nested->line[lineLen++] = ch; nested->stringPos++; if (ch == 10 || ch == 13) break; } nested->line[lineLen] = 0; return 1; } static int parseLine (FileInfo * nested) { char *curchar = NULL; int ch = 0; nested->action = ""; nested->value = ""; nested->value2 = ""; while (getLine (nested)) { nested->lineNumber++; curchar = nested->line; while ((ch = *curchar++) <= 32 && ch != 0); if (ch == 0 || ch == '#' || ch == '<') continue; nested->action = curchar - 1; while ((ch = *curchar++) > 32 && ch != '='); nested->actionLength = curchar - nested->action - 1; nested->action[nested->actionLength] = 0; while (((ch = *curchar++) <= 32 || ch == '=') && ch != 0); if (ch == 0) { nested->value = ""; return 1; } else { nested->value = curchar - 1; if (*nested->value == 34) /*quote */ { nested->value++; while (*curchar && *curchar != 34) curchar++; nested->valueLength = curchar - nested->value; } else { while (*curchar++ > 32); nested->valueLength = curchar - nested->value - 1; } nested->value[nested->valueLength] = 0; } while ((ch = *curchar++) <= 32 && ch != 0); if (ch != 0) { nested->value2 = curchar - 1; if (*nested->value2 == 34) /*quote */ { nested->value2++; while (*curchar && *curchar != 34) curchar++; nested->value2Length = curchar - nested->value2; } else { while (*curchar++ > 32); nested->value2Length = curchar - nested->value2 - 1; } nested->value2[nested->value2Length] = 0; } else nested->value2 = ""; return 1; } return 0; } #define NOTFOUND 1000 static int mainActionNumber = NOTFOUND; static int subActionNumber; static int entities = 0; int ignore_case_comp (const char *str1, const char *str2, int length) { /* Replaces strncasecmp, which some compilers don't support */ int k; for (k = 0; k < length; k++) if ((str1[k] | 32) != (str2[k] | 32)) break; if (k != length) return 1; return 0; } int find_action (const char **actions, const char *action) { int actionLength = strlen (action); int k; for (k = 0; actions[k]; k += 2) if (actionLength == strlen (actions[k]) && ignore_case_comp (actions[k], action, actionLength) == 0) break; if (actions[k] == NULL) return -1; return atoi (actions[k + 1]); } static int checkActions (FileInfo * nested, const char **actions) { int actionNum = find_action (actions, nested->action); if (actionNum == -1) return NOTFOUND; return actionNum; } static int checkValues (FileInfo * nested, const char **values) { int k; for (k = 0; values[k]; k += 2) if (nested->valueLength == strlen (values[k]) && ignore_case_comp (values[k], nested->value, nested->valueLength) == 0) break; if (values[k] == NULL) { configureError (nested, "word '%s' in column 2 not recognized", nested->value); return NOTFOUND; } return atoi (values[k + 1]); } static unsigned int hexValue (FileInfo * nested, const char *digits) { int length = strlen (digits); int k; unsigned int binaryValue = 0; for (k = 0; k < length; k++) { unsigned int hexDigit = 0; if (digits[k] >= '0' && digits[k] <= '9') hexDigit = digits[k] - '0'; else if (digits[k] >= 'a' && digits[k] <= 'f') hexDigit = digits[k] - 'a' + 10; else if (digits[k] >= 'A' && digits[k] <= 'F') hexDigit = digits[k] - 'A' + 10; else { configureError (nested, "invalid %d-digit hexadecimal number", length); return 0xffffffff; } binaryValue |= hexDigit << (4 * (length - 1 - k)); } return binaryValue; } static unsigned int convertValue (FileInfo * nested, const char *number) { if (number[0] == '0' && number[1] == 'x') return hexValue (nested, &number[2]); else if (number[0] == '1' && number[1] == '<') { int shift = atoi (&number[3]); return 1 << shift; } else return atoi (number); } static int orValues (FileInfo * nested, const char **values) { int result = 0; int k; int word = 0; int wordLength; while (word < nested->valueLength) { for (wordLength = 0; (word + wordLength) < nested->valueLength && nested->value[word + wordLength] > ' ' && nested->value[word + wordLength] != ','; wordLength++); for (k = 0; values[k]; k += 2) if (wordLength == strlen (values[k]) && ignore_case_comp (values[k], &nested->value[word], wordLength) == 0) { result |= convertValue (nested, values[k + 1]); break; } word += wordLength + 1; } if (result == 0) { configureError (nested, "word '%s' in column 2 not recognized", nested->value); return NOTFOUND; } return result; } static int checkSubActions (FileInfo * nested, const char **mainActions, const char **subActions) { int subAction; mainActionNumber = NOTFOUND; subAction = checkActions (nested, subActions); if (subAction != NOTFOUND && nested->value == "") { configureError (nested, "column 2 is required"); return NOTFOUND; } if (subAction == NOTFOUND) { mainActionNumber = checkActions (nested, mainActions); if (mainActionNumber == NOTFOUND) configureError (nested, "word '%s' in column 1 not recognized", nested->action); return NOTFOUND; } return (subActionNumber = subAction); } static int compileConfig (FileInfo * nested) { static const char *mainActions[] = { "outputFormat", "0", "translation", "0", "xml", "0", "cellsPerLine", "1", "linesPerPage", "2", "interpoint", "3", "lineEnd", "4", "pageEnd", "5", "beginningPageNumber", "6", "braillePages", "7", "paragraphs", "8", "fileEnd", "9", "printPages", "10", "printPageNumberAt", "11", "braillePageNumberAt", "12", "hyphenate", "13", "outputEncoding", "14", "encoding", "14", "backFormat", "15", "backLineLength", "16", "contractedTable", "18", "literarytextTable", "18", "editTable", "19", "uncontractedTable", "20", "compbrlTable", "21", "mathtextTable", "22", "mathexprTable", "23", "topMargin", "24", "xmlHeader", "25", "entity", "26", "internetAccess", "27", "semanticFiles", "28", "newEntries", "29", "include", "30", "formatFor", "31", "inputTextEncoding", "32", "contents", "33", "linefill", "34", "debug", "35", "leftMargin", "36", "pass2convsem", "37", "converterSem", "38", "braillePageNumber", "39", "mergeUnnumberedPages", "40", "pageNumberTopSeparateLine", "41", "pageNumberBottomSeparateLine", "42", "printPageNumberRange", "43", "pageSeparator", "44", "pageSeparatorNumber", "45", "ignoreEmptyPages", "46", "continuePages", "47", "emphasis", "48", "paperWidth", "49", "paperHeight", "50", "numberBraillePages", "51", "printPageNumbersInContents", "52", "braillePageNumbersInContents", "53", "rightMargin", "54", "bottomMargin", "55", "mode", "56", // available "57", // available "58", // available "59", "macro", "60", "style", "90", NULL }; static const char *yesNo[] = { "no", "0", "yes", "1", NULL }; static const char *topBottom[] = { "bottom", "0", "top", "1", NULL }; static const char *encodings[] = { "utf8", "0", "utf16", "1", "utf32", "2", "ascii8", "3", NULL }; static const char *backFormats[] = { "plain", "0", "html", "1", NULL }; static const char *hyphenationModes[] = { "no", "0", "yes", "1", "pre", "2", NULL }; static const char *formatFor[] = { "textDevice", "0", "browser", "1", "utd", "2", "pef", "3", "transInXml", "4", "volumes", "5", "brf", "6", "volumesPef", "7", "volumesBrf", "8", "dsbible", "9", NULL }; static const char *typeForms[] = { "italic", "1", "underline", "2", "bold", "4", "computer_braille", "8", "all", "15", "none", "0x100", NULL }; static const char *configModes[] = { /*liblouis modes */ "noContractions", "1", "compbrlAtCursor", "2", "dotsIO", "4", "comp8Dots", "8", "pass1Only", "16", "compbrlLeftCursor", "32", "otherTrans", "64", "ucBrl", "128", /*liblouisutdml modes */ "doInit", "1<<30", "htmlDoc", "1<<29", "notUC", "1<<28", "notSync", "1<<27", "utdInput", "1<<26", "convertOnly", "1<<25", "louisDots", "1<<24", NULL }; int k; while (parseLine (nested)) { mainActionNumber = checkActions (nested, mainActions); if (mainActionNumber == NOTFOUND) { configureError (nested, "word '%s' in column 1 not recognized", nested->action); continue; } choseMainAction: switch (mainActionNumber) { case NOTFOUND: case 0: break; case 1: ud->cells_per_line = atoi (nested->value); break; case 2: ud->lines_per_page = atoi (nested->value); break; case 3: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->interpoint = k; break; case 4: if (controlCharValue (nested)) memcpy (ud->lineEnd, nested->value, nested->valueLength + 1); break; case 5: if (controlCharValue (nested)) memcpy (ud->pageEnd, nested->value, nested->valueLength + 1); break; case 6: ud->beginning_braille_page_number = atoi (nested->value); break; case 7: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->braille_pages = k; break; case 8: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->paragraphs = k; break; case 9: if (controlCharValue (nested)) memcpy (ud->fileEnd, nested->value, nested->valueLength + 1); break; case 10: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->print_pages = k; break; case 11: if ((k = checkValues (nested, topBottom)) != NOTFOUND) ud->print_page_number_at = k; break; case 12: if ((k = checkValues (nested, topBottom)) != NOTFOUND) { if (k) k = 0; else k = 1; ud->braille_page_number_at = k; } break; case 13: if ((k = checkValues (nested, hyphenationModes)) != NOTFOUND) ud->hyphenate = k; break; case 14: if ((k = checkValues (nested, encodings)) != NOTFOUND) ud->output_encoding = k; break; case 15: if ((k = checkValues (nested, backFormats)) != NOTFOUND) ud->back_text = k; break; case 16: ud->back_line_length = atoi (nested->value); break; case 18: ud->contracted_table_name = findTable (nested); if (ud->contracted_table_name == NULL) { configureError (nested, "invalid literaryTextTable"); return 0; } break; case 19: ud->edit_table_name = findTable (nested); if (ud->edit_table_name == NULL) { configureError (nested, "invalid editTable"); return 0; } break; case 20: ud->uncontracted_table_name = findTable (nested); if (ud->uncontracted_table_name == NULL) { configureError (nested, "invalid uncontractedTableName"); return 0; } break; case 21: ud->compbrl_table_name = findTable (nested); if (ud->compbrl_table_name == NULL) { configureError (nested, "invalid compbrlTableName"); return 0; } break; case 22: ud->mathtext_table_name = findTable (nested); if (ud->mathtext_table_name == NULL) { configureError (nested, "invalid mathtextTableName"); return 0; } break; case 23: ud->mathexpr_table_name = findTable (nested); if (ud->mathexpr_table_name == NULL) { configureError (nested, "invalid mathexprTableName"); return 0; } break; case 24: topMargin = atof (nested->value); break; case 25: if (entities) { configureError (nested, "The header definition must precede all entity definitions."); break; } strcpy (ud->xml_header, nested->value); break; case 26: if (nested->value == "") break; if (!entities) strcat (ud->xml_header, "xml_header, "xml_header, nested->value); strcat (ud->xml_header, " \""); strcat (ud->xml_header, nested->value2); strcat (ud->xml_header, "\">\n"); break; case 27: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->internet_access = k; break; case 28: ud->semantic_files = alloc_string (nested->value); break; case 29: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->new_entries = k; break; case 30: { static const char *actions[] = { NULL }; if (nested->value == "") configureError (nested, "a file name in column 2 is required"); else config_compileSettings (nested->value); if (!parseLine (nested)) break; checkSubActions (nested, mainActions, actions); if (mainActionNumber != NOTFOUND) goto choseMainAction; } break; case 31: if ((k = checkValues (nested, formatFor)) != NOTFOUND) ud->format_for = k; break; case 32: if ((k = checkValues (nested, encodings)) != NOTFOUND) ud->input_text_encoding = k; break; case 33: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->contents = k; break; case 34: if (nested->value == "") ud->line_fill = ' '; else ud->line_fill = nested->value[0]; break; case 35: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->debug = k; break; case 36: leftMargin = atof (nested->value); break; case 37: ud->pass2_conv_sem = alloc_string (nested->value); break; case 38: ud->converter_sem = alloc_string (nested->value); break; case 39: ud->braille_page_number = atoi (nested->value); break; case 40: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->merge_unnumbered_pages = k; break; case 41: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->page_number_top_separate_line = k; break; case 42: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->page_number_bottom_separate_line = k; break; case 43: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->print_page_number_range = k; break; case 44: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->page_separator = k; break; case 45: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->page_separator_number = k; break; case 46: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->ignore_empty_pages = k; break; case 47: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->continue_pages = k; break; case 48: if ((k = orValues (nested, typeForms)) != NOTFOUND) ud->emphasis = k; break; case 49: paperWidth = atof (nested->value); break; case 50: paperHeight = atof (nested->value); break; case 51: if ((k = checkValues (nested, yesNo)) != NOTFOUND) { ud->number_braille_pages = k; } break; case 52: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->print_page_numbers_in_contents = k; break; case 53: if ((k = checkValues (nested, yesNo)) != NOTFOUND) ud->braille_page_numbers_in_contents = k; break; case 54: rightMargin = atof (nested->value); break; case 55: bottomMargin = atof (nested->value); break; case 56: if ((k = orValues (nested, configModes)) != NOTFOUND) ud->config_mode = k; break; // available case 57: // available case 58: // available case 59: case 60: new_macro (nested->value, nested->value2); break; case 90: { static const char *actions[] = { "linesBefore", "0", "linesAfter", "1", "leftMargin", "2", "firstLineIndent", "3", "translationTable", "6", "skipNumberLines", "7", "format", "8", "newPageBefore", "9", "newPageAfter", "10", "rightHandPage", "11", "braillePageNumberFormat", "12", "rightMargin", "13", "keepWithNext", "14", "dontSplit", "15", "orphanControl", "16", "newlineAfter", "17", "runningHead", "18", "emphasis", "19", NULL }; static const char *formats[] = { "inherit", "-100", "leftJustified", "0", "rightJustified", "1", "centered", "2", "alignColumnsLeft", "3", "alignColumnsRight", "4", "listColumns", "5", "listLines", "6", "computerCoded", "7", "contents", "8", NULL }; static const char *pageNumFormats[] = { "normal", "0", "blank", "1", "p", "2", "roman", "3", NULL }; StyleType *style; sem_act styleAction; if (nested->value == "") { configureError (nested, "no style name given in second column"); break; } styleAction = find_semantic_number (nested->value); style = new_style (nested->value); style->action = styleAction; style->newline_after = 1; while (parseLine (nested)) { checkSubActions (nested, mainActions, actions); if (mainActionNumber != NOTFOUND) goto choseMainAction; switch (subActionNumber) { case NOTFOUND: break; case 0: style->lines_before = atoi (nested->value); break; case 1: style->lines_after = atoi (nested->value); break; case 2: style->left_margin = atoi (nested->value); break; case 3: style->first_line_indent = atoi (nested->value); break; case 6: style->translation_table = findTable (nested); break; case 7: if ((k = checkValues (nested, yesNo)) != NOTFOUND) style->skip_number_lines = k; break; case 8: if ((k = checkValues (nested, formats)) != NOTFOUND) style->format = k; break; case 9: if ((k = checkValues (nested, yesNo)) != NOTFOUND) style->newpage_before = k; break; case 10: if ((k = checkValues (nested, yesNo)) != NOTFOUND) style->newpage_after = k; break; case 11: if ((k = checkValues (nested, yesNo)) != NOTFOUND) style->righthand_page = k; break; case 12: if ((k = checkValues (nested, pageNumFormats)) != NOTFOUND) style->brlNumFormat = k; break; case 13: style->right_margin = atoi (nested->value); break; case 14: if ((k = checkValues (nested, yesNo)) != NOTFOUND) style->keep_with_next = k; break; case 15: if ((k = checkValues (nested, yesNo)) != NOTFOUND) style->dont_split = k; break; case 16: style->orphan_control = atoi (nested->value); break; case 17: if ((k = checkValues (nested, yesNo)) != NOTFOUND) style->newline_after = k; break; case 18: if ((k = checkValues (nested, yesNo)) != NOTFOUND) style->runningHead = k; break; case 19: { sem_act action = find_semantic_number (nested->value); if (action == italicx || action == boldx || action == underlinex || action == compbrl) style->emphasis = action; else configureError (nested, "invalid emphasis '%s'", nested->value); } break; default: configureError (nested, "Program error in readconfig.c"); continue; } } break; } default: configureError (nested, "Program error in readconfig.c"); continue; } } return 1; } static int initConfigFiles (const char *firstConfigFile, char *fileName, const char *logFileName) { char configPath[MAXNAMELEN]; int k; strcpy (configPath, firstConfigFile); for (k = strlen (configPath); k >= 0; k--) if (configPath[k] == ud->file_separator) break; strcpy (fileName, &configPath[k + 1]); if (k < 0) k++; configPath[k] = 0; set_paths (configPath); if (logFileName && logFileName[0] != 0) { strcpy ((char *) ud->typeform, lbu_getWriteablePath ()); strcat ((char *) ud->typeform, logFileName); lou_logFile ((char *) ud->typeform); } if (!config_compileSettings ("liblouisutdml.ini")) return 0; return 1; } int read_configuration_file (const char *configFileList, const char *logFileName, const char *configString, unsigned int mode) { /* read the configuration files and perform other initialization*/ int k; char mainFile[MAXNAMELEN]; char subFile[MAXNAMELEN]; int listLength; int currentListPos = 0; errorCount = 0; fatalErrorCount = 0; /*Process logFileName later, after writeablePath is set */ paperWidth = 0; paperHeight = 0; leftMargin = 0; rightMargin = 0; topMargin = 0; bottomMargin = 0; destroy_semantic_table (); if (fatalErrorCount) { configureError (NULL, "%d fatal errors found", fatalErrorCount); return 0; } if (ud == NULL) { if (!(ud = malloc (sizeof (UserData)))) memoryError (); } memset (ud, 0, sizeof (UserData)); ud->outbuf1_len = (sizeof (ud->outbuf1) / CHARSIZE) - 4; ud->outbuf2_len = (sizeof (ud->outbuf2) / CHARSIZE) - 4; ud->outbuf3_len = (sizeof (ud->outbuf3) / CHARSIZE) - 4; entities = 0; ud->mode = mode; ud->top = -1; ud->style_top = -1; ud->emphasis = 15; /* There will be configuration settings for these values */ ud->cell_width = 5; ud->normal_line = 8; ud->wide_line = 10; ud->dpi = 20.0; strcpy (ud->lit_hyphen, "-"); strcpy (ud->comp_hyphen, "_&"); strcpy (ud->letsign, "\\_"); /*End of values */ for (k = document; k < notranslate; k++) { StyleType *style = new_style ((xmlChar *) semNames[k]); style->action = k; } ud->input_encoding = utf8; ud->output_encoding = ascii8; *ud->print_page_number = '_'; *ud->print_page_number_first = '_'; ud->string_escape = ','; #ifdef _WIN32 ud->file_separator = '\\'; #else ud->file_separator = '/'; #endif pathEnd[0] = ud->file_separator; pathEnd[1] = 0; /*Process file list*/ if (configFileList == NULL) { set_paths (NULL); if (logFileName && logFileName[0] != 0) { strcpy ((char *) ud->typeform, lbu_getWriteablePath ()); strcat ((char *) ud->typeform, logFileName); lou_logFile ((char *) ud->typeform); } if (!(config_compileSettings ("liblouisutdml.ini"))) return 0; } else { listLength = strlen (configFileList); for (k = 0; k < listLength; k++) if (configFileList[k] == ',') break; if (k == listLength || k == 0) { /* Only one file */ initConfigFiles (configFileList, mainFile, logFileName); config_compileSettings (mainFile); } else { /* Compile a list of files */ strncpy (subFile, configFileList, k); subFile[k] = 0; initConfigFiles (subFile, mainFile, logFileName); currentListPos = k + 1; config_compileSettings (mainFile); while (currentListPos < listLength) { for (k = currentListPos; k < listLength; k++) if (configFileList[k] == ',') break; strncpy (subFile, &configFileList[currentListPos], k - currentListPos); subFile[k - currentListPos] = 0; config_compileSettings (subFile); currentListPos = k + 1; } } } /* Process configString */ if (configString != NULL) { if (configString[0] == ud->string_escape) config_compileSettings (configString); else { k = 0; ud->typeform[k++] = ud->string_escape; ud->typeform[k] = 0; strcat ((char *) ud->typeform, configString); config_compileSettings ((char *) ud->typeform); } } memset (ud->typeform, 0, sizeof (ud->typeform)); ud->braille_page_number = ud->beginning_braille_page_number; if (entities) strcat (ud->xml_header, "]>\n"); ud->mode = mode | ud->config_mode; ud->orig_format_for = ud->format_for; if (ud->format_for > utd || (ud->mode & louisDots)) { ud->mode &= ~notUC; ud->format_for = utd; } if (ud->format_for == utd) { ud->braille_pages = 1; ud->paper_width = (int) (paperWidth * ud->dpi); ud->paper_height = (int) (paperHeight * ud->dpi); ud->left_margin = (int) (leftMargin * ud->dpi); ud->right_margin = (int) (rightMargin * ud->dpi); ud->top_margin = (int) (topMargin * ud->dpi); ud->bottom_margin = (int) (bottomMargin * ud->dpi); } else { ud->left_margin = (int) leftMargin; } ud->page_left = ud->left_margin; ud->page_right = ud->paper_width - ud->right_margin; ud->page_top = ud->top_margin; ud->page_bottom = ud->paper_height - ud->bottom_margin; if (ud->format_for == utd) { if (ud->page_right <= 0 || ud->page_bottom <= 0) { lou_logPrint ("For UTDML paper witdth and paper height must be specified."); lbu_free (); return 0; } ud->cells_per_line = (ud->page_right - ud->page_left) / ud->cell_width; ud->lines_per_page = (ud->page_bottom - ud->page_top) / ud->normal_line; ud->back_text = textDevice; ud->back_line_length = 70; } return 1; } liblouisutdml-2.5.0/liblouisutdml/utd2volumes.c0000664000076500007650000001401212151534703016667 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" static int findBrlNodes (xmlNode * node); static int volumesDoBrlNode (xmlNode * node, int action); static int beginDocument (); static int finishBrlNode (); static int finishDocument (); static int doUtdbrlonly (xmlNode * node, int action); static int doUtdnewpage (xmlNode * node); static int doUtdnewline (xmlNode * node); static int doUtddispimg (xmlNode * node); static int firstPage; static int firstLineOnPage; int utd2volumes (xmlNode * node) { ud->top = -1; ud->style_top = -1; firstPage = 1; firstLineOnPage = 1; beginDocument (); findBrlNodes (node); finishDocument (); return 1; } static int beginDocument () { } static int finishDocument () { } static int findBrlNodes (xmlNode * node) { xmlNode *child; if (node == NULL) return 0; push_sem_stack (node); switch (ud->stack[ud->top]) { case utdmeta: return 1; case utdbrl: volumesDoBrlNode (node, 0); pop_sem_stack (); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: findBrlNodes (child); break; case XML_TEXT_NODE: break; default: break; } child = child->next; } pop_sem_stack (); return 1; } static char *blanks = " "; static int insertCharacters (const char *text, int length) { int k; for (k = 0; k < length; k++) ud->outbuf1[ud->outbuf1_len_so_far++] = text[k]; return 1; } static int doDotsText (xmlNode * node) { ud->text_length = 0; insert_utf8 (node->content); if (!lou_dotsToChar (ud->main_braille_table, ud->text_buffer, &ud->outbuf1[ud->outbuf1_len_so_far], ud->text_length, 0)) return 0; ud->outbuf1_len_so_far += ud->text_length; return 1; } static int doUtdbrlonly (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (ud->top == 0) action = 1; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case utdnewpage: doUtdnewpage (node); if (action != 0) pop_sem_stack (); return 1; case utdnewline: doUtdnewline (node); if (action != 0) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: doUtdbrlonly (child, 1); break; case XML_TEXT_NODE: doDotsText (child); break; default: break; } child = child->next; } if (action != 0) pop_sem_stack (); return 1; } static int lastLinepos; static int doUtdnewpage (xmlNode * node) { lastLinepos = ud->page_top; firstLineOnPage = 1; if (firstPage) { firstPage = 0; return 1; } insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); insertCharacters (ud->pageEnd, strlen (ud->pageEnd)); return 1; } static int doUtdnewline (xmlNode * node) { char *xy; int k; int leadingBlanks; int linepos; if (!firstLineOnPage) insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); xy = (char *) xmlGetProp (node, (xmlChar *) "xy"); for (k = 0; xy[k] != ','; k++); leadingBlanks = (atoi (xy) - ud->left_margin) / ud->cell_width; linepos = (atoi (&xy[k + 1]) - ud->page_top) / ud->normal_line; insertCharacters (blanks, leadingBlanks); if (firstLineOnPage) firstLineOnPage = 0; return 1; } int volumesDoBrlNode (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (action == 0) ud->outbuf1_len_so_far = 0; else push_sem_stack (node); switch (ud->stack[ud->top]) { case markhead: if (ud->head_node == NULL) ud->head_node = node; pop_sem_stack (); break; case utdbrlonly: doUtdbrlonly (node, 0); if (action != 0) pop_sem_stack (); return 1; case utdnewpage: doUtdnewpage (node); if (action != 0) pop_sem_stack (); return 1; case utdnewline: doUtdnewline (node); if (action != 0) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: volumesDoBrlNode (child, 1); break; case XML_TEXT_NODE: doDotsText (child); break; default: break; } child = child->next; } if (action != 0) { pop_sem_stack (); return 1; } finishBrlNode (); return 1; } static int finishBrlNode () { if (ud->outbuf1_len_so_far == 0) return 1; write_buffer (1, 0); return 1; } liblouisutdml-2.5.0/liblouisutdml/transcribe_computerCode.c0000664000076500007650000000570112054461273021253 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" static int computerCodeEmptyElement (xmlNode * node, int action); int transcribe_computerCode (xmlNode * node, int action) { xmlNode *child; int branchCount = 0; if (action == 0 && (ud->text_length > 0 || ud->translated_length > 0)) { StyleType *style; insert_translation (ud->main_braille_table); ud->top--; style = find_current_style (); ud->top++; if (style != NULL) write_paragraph (style->action, node); else write_paragraph (para, node); } push_sem_stack (node); switch (ud->stack[ud->top]) { case skip: pop_sem_stack (); return 0; case code: break; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: insert_code (node, branchCount); branchCount++; if (child->children) transcribe_computerCode (child, 1); else computerCodeEmptyElement (child, 1); break; case XML_TEXT_NODE: insert_utf8 (child->content); break; case XML_CDATA_SECTION_NODE: transcribe_cdataSection (child); break; default: break; } child = child->next; } insert_code (node, branchCount); insert_code (node, -1); pop_sem_stack (); if (action == 0) { memset (ud->typeform, computer_braille, ud->text_length); insert_translation (ud->compbrl_table_name); write_paragraph (code, node); } return 1; } static int computerCodeEmptyElement (xmlNode * node, int action) { push_sem_stack (node); switch (ud->stack[ud->top]) { case softreturn: break; case boxline: break; case blankline: break; case newpage: break; case righthandpage: break; default: break; } pop_sem_stack (); return 1; } liblouisutdml-2.5.0/liblouisutdml/transcribe_document.c0000664000076500007650000000700612153342523020434 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" int transcribe_document (xmlNode * node) { StyleType *style; xmlNode *child; int childrenDone = 0; ud->top = -1; ud->style_top = -1; ud->text_length = 0; ud->translated_length = 0; ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; if (!start_document ()) return 0; push_sem_stack (node); if ((style = is_style (node)) != NULL) start_style (style, node); switch (ud->stack[ud->top]) { case no: if (ud->text_length > 0 && ud->text_length < MAX_LENGTH && ud->text_buffer[ud->text_length - 1] > 32) ud->text_buffer[ud->text_length++] = 32; break; case skip: pop_sem_stack (); return 0; case htmllink: if (ud->format_for != browser) break; insert_linkOrTarget (node, 0); pop_sem_stack (); return 1; case htmltarget: if (ud->format_for != browser) break; insert_linkOrTarget (node, 1); pop_sem_stack (); return 1; case code: transcribe_computerCode (node, 0); pop_sem_stack (); childrenDone = 1; break; case changetable: change_table (node); childrenDone = 1; break; case math: transcribe_math (node, 0); pop_sem_stack (); childrenDone = 1; break; case graphic: transcribe_graphic (node, 0); pop_sem_stack (); childrenDone = 1; break; case utddispimg: case utdinlnimg: do_utdxxxximg (node); pop_sem_stack (); childrenDone = 1; break; case chemistry: transcribe_chemistry (node, 0); pop_sem_stack (); childrenDone = 1; break; case music: transcribe_music (node, 0); pop_sem_stack (); childrenDone = 1; break; case para: transcribe_paragraph (node, 0); pop_sem_stack (); childrenDone = 1; break; default: break; } if (!childrenDone) { child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: transcribe_paragraph (child, 0); break; case XML_TEXT_NODE: insert_text (child); break; case XML_CDATA_SECTION_NODE: transcribe_cdataSection (child); break; default: break; } child = child->next; } } if (style) end_style (); end_document (); pop_sem_stack (); return 1; } liblouisutdml-2.5.0/liblouisutdml/louisutdml.h0000664000076500007650000002574712221464607016630 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and Abilitiessoft, Inc. www.abilitiessoft.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #ifndef liblouisutdml_h #define liblouisutdml_h #include #include "liblouisutdml.h" #include #include "sem_enum.h" typedef enum { firstCall = 0, otherCall = 1, skipChoicesBefore = 2, skipChoicesAfter = 3 } NodeAction; typedef enum { inherit = -100, leftJustified = 0, rightJustified = 1, centered = 2, alignColumnsLeft = 3, alignColumnsRight = 4, listColumns = 5, listLines = 6, computerCoded = 7, contents = 8 } StyleFormat; typedef enum { normal = 0, blank = 1, p = 2, roman = 3 } BrlPageNumFormat; typedef struct { /*Paragraph formatting instructions */ sem_act action; int lines_before; int lines_after; int left_margin; int right_margin; int keep_with_next; int dont_split; int orphan_control; int first_line_indent; /* At true margin if negative */ char *translation_table; int skip_number_lines; /*Don't write on lines with page numbers */ StyleFormat format; BrlPageNumFormat brlNumFormat; int newpage_before; int newpage_after; int righthand_page; int newline_after; int runningHead; sem_act emphasis; char name[1]; } StyleType; #ifdef _WIN32 #define snprintf _snprintf #define vsnprintf _vsnprintf #endif #ifndef CHARSIZE #define CHARSIZE sizeof (widechar) #endif #define BUFSIZE 8192 #define BIG_BUFSIZE 4 * BUFSIZE - 8 #define MAX_LENGTH BUFSIZE - 4 #define MAX_TEXT_LENGTH 2 * BUFSIZE - 4 #define MAX_TRANS_LENGTH 2 * BUFSIZE - 4 #define MAXNAMELEN 1024 #define MAXNUMLEN 32 #define STACKSIZE 100 #define MAXLINES 512 typedef enum { utf8 = 0, utf16, utf32, ascii8 } Encoding; typedef enum { plain = 0, html } TextFormat; typedef enum { textDevice = 0, browser, utd, pef, transinxml, volumes, brf, volumesPef, volumesBrf, dsbible } FormatFor; typedef enum { error, beforeBody, startBody, resumeBody, bodyInterrupted, afterBody } StyleStatus; typedef struct { StyleType *style; xmlNode *node; StyleStatus status; BrlPageNumFormat curBrlNumFormat; StyleFormat curStyleFormat; int curLeftMargin; int curRightMargin; int curFirstLineIndent; } StyleRecord; typedef struct { /*user data */ FILE *inFile; FILE *outFile; xmlDoc *doc; xmlNode *head_node; int text_length; int old_text_length; int translated_length; int string_buf_len; int needs_editing; int has_math; int has_comp_code; int has_chem; int has_graphics; int has_music; int has_cdata; Encoding input_encoding; Encoding output_encoding; Encoding input_text_encoding; TextFormat back_text; int back_line_length; FormatFor format_for; FormatFor orig_format_for; int contents; int has_contentsheader; unsigned int mode; unsigned int orig_mode; unsigned int config_mode; translationModes louis_mode; int emphasis; double dpi; int cell_width; int normal_line; int wide_line; int debug; int paper_width; int paper_height; int page_left; int page_top; int page_right; int page_bottom; int vert_line_pos; int top_margin; int bottom_margin; int left_margin; int right_margin; int cells_per_line; int lines_per_page; int beginning_braille_page_number; int number_braille_pages; int interpoint; int print_page_number_at; int braille_page_number_at; int hyphenate; int internet_access; int new_entries; int doc_new_entries; const char *inbuf; int inlen; widechar *outbuf; int outlen; int outlen_so_far; widechar outbuf1[2 * BUFSIZE]; widechar outbuf2[2 * BUFSIZE]; widechar outbuf3[2 * BUFSIZE]; int outbuf1_len; int outbuf2_len; int outbuf3_len; int outbuf1_len_so_far; int outbuf2_len_so_far; int outbuf3_len_so_far; int outbuf2_enabled; int outbuf3_enabled; int fill_pages; int after_contents; int blank_lines; int print_page_numbers_in_contents; int braille_page_numbers_in_contents; int lines_pagenum[MAXLINES+1]; int lines_newpage[MAXLINES+1]; int lines_length; BrlPageNumFormat cur_brl_page_num_format; int lines_on_page; int braille_page_number; int prelim_pages; int paragraphs; int braille_pages; int print_pages; widechar page_separator_number_first[MAXNUMLEN]; widechar page_separator_number_last[MAXNUMLEN]; widechar print_page_number_first[MAXNUMLEN]; widechar print_page_number_last[MAXNUMLEN]; int page_separator; int page_separator_number; int ignore_empty_pages; int continue_pages; int merge_unnumbered_pages; int print_page_number_range; int page_number_top_separate_line; int page_number_bottom_separate_line; char path_list[4 * MAXNAMELEN]; char string_escape; char file_separator; char line_fill; char lit_hyphen[5]; char comp_hyphen[5]; char letsign[5]; char *config_path; char *lbu_files_path; widechar running_head[MAXNAMELEN / 2]; widechar footer[MAXNAMELEN / 2]; int running_head_length; int footer_length; const char *contracted_table_name; const char *uncontracted_table_name; const char *compbrl_table_name; const char *mathtext_table_name; const char *mathexpr_table_name; const char *edit_table_name; const char *main_braille_table; const char *semantic_files; const char *converter_sem; const char *pass2_conv_sem; widechar print_page_number[MAXNUMLEN]; widechar braille_page_string[MAXNUMLEN]; char lineEnd[8]; char pageEnd[8]; char fileEnd[8]; int line_spacing; int top; sem_act stack[STACKSIZE]; StyleRecord style_stack[STACKSIZE]; int style_top; BrlPageNumFormat brl_page_num_format; StyleFormat style_format; int style_left_margin; int style_right_margin; int style_first_line_indent; char xml_header[2 * MAXNAMELEN]; widechar text_buffer[2 * BUFSIZE]; int in_sync; widechar sync_text_buffer[2 * BUFSIZE]; int sync_text_length; int positions_array[2 * BUFSIZE]; widechar translated_buffer[2 * BUFSIZE]; unsigned char typeform[2 * BUFSIZE]; char string_buffer[2 * BUFSIZE]; } UserData; extern UserData *ud; /* Function definitions */ sem_act find_semantic_number (const char *semName); int file_exists (const char *completePath); int find_file (const char *fileName, char *filePath); int set_paths (const char *configPath); int read_configuration_file (const char *configFileName, const char *logFileName, const char *settingsString, unsigned int mode); int config_compileSettings (const char *fileName); int do_xpath_expr (); int examine_document (xmlNode * node); int transcribe_document (xmlNode * node); int transcribe_math (xmlNode * node, int action); int transcribe_computerCode (xmlNode * node, int action); int transcribe_cdataSection (xmlNode * node); int transcribe_paragraph (xmlNode * node, int action); int transcribe_chemistry (xmlNode * node, int action); int transcribe_graphic (xmlNode * node, int action); int transcribe_music (xmlNode * node, int action); int compile_semantic_table (xmlNode * rootElement); sem_act set_sem_attr (xmlNode * node); sem_act get_sem_attr (xmlNode * node); sem_act push_sem_stack (xmlNode * node); sem_act push_action (sem_act action); sem_act pop_sem_stack (); void destroy_semantic_table (); void append_new_entries (); int insert_code (xmlNode * node, int which); xmlChar *get_attr_value (xmlNode * node); int change_table (xmlNode * node); int initialize_contents (); int start_heading (sem_act action, widechar * translatedBuffer, int translatedLength); int finish_heading (sem_act action); int make_contents (); void do_reverse (xmlNode * node); int do_boxline (xmlNode * node); void do_pagebreak (xmlNode *node); void do_linespacing (xmlNode * node); int do_newpage (); int do_blankline (); int do_softreturn (); int do_righthandpage (); void libxml_errors (void *ctx ATTRIBUTE_UNUSED, const char *msg, ...); int do_configstring (xmlNode * node); StyleType *new_style (xmlChar * name); StyleType *lookup_style (xmlChar * name); StyleType *is_style (xmlNode * node); StyleType *action_to_style (sem_act action); int insert_utf8 (const unsigned char *intext); int insert_utf16 (widechar * intext, int length); int insert_translation (const char *table); int write_paragraph (sem_act action, xmlNode * node); int start_document (); int end_document (); int transcribe_text_string (); int transcribe_text_file (); int back_translate_file (); StyleType *find_current_style (); void insert_text (xmlNode * node); int insert_linkOrTarget (xmlNode * node, int which); int start_style (StyleType * curStyle, xmlNode * node); int end_style (); int find_action (const char **actions, const char *action); int find_group_length (const char groupSym[2], const char *groupStart); char *alloc_string (const char *inString); char *alloc_string_if_not (const char *inString); int write_buffer (int from, int skip); int link_brl_node (xmlNode * node); void clean_semantic_table (); int back_translate_braille_string (); int utf8_string_to_wc (const unsigned char *instr, int *inSize, widechar * outstr, int *outSize); int wc_string_to_utf8 (const widechar * instr, int *inSize, unsigned char *outstr, int *outSize); void output_xml (xmlDoc *doc); int convert_utd (); int utd2bible (xmlNode * node); int utd2brf (xmlNode * node); int utd2pef (xmlNode * node); int utd2transinxml (xmlNode * node); int utd2volumes (xmlNode * node); int hasAttrValue (xmlNode *node, char *attrName, char *value); xmlChar * new_macro (xmlChar * name, xmlChar *body); unsigned char * lookup_macro (xmlChar * name); char *is_macro (xmlNode *node); int start_macro (xmlNode *node); int end_macro (); int ignore_case_comp (const char *str1, const char *str2, int length); void insert_text_string (xmlNode *node, xmlChar *str); void do_attrtotext (xmlNode *node); int utd_transcribe_text_file (); int utd_transcribe_text_string (); int utd_back_translate_braille_string (); int utd_back_translate_file (); int pass2_conv (); void memoryError (); unsigned char *get_sem_name (xmlNode *node); void set_runninghead_string (widechar *chars, int length); void set_footer_string (widechar *chars, int length); void do_utdxxxximg (xmlNode *node); #endif /*louisutdml_h */ liblouisutdml-2.5.0/liblouisutdml/Makefile.in0000664000076500007650000015540012222611432016300 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = liblouisutdml DIST_COMMON = README $(liblouisutdmlinclude_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \ $(top_srcdir)/gnulib/m4/extensions.m4 \ $(top_srcdir)/gnulib/m4/extern-inline.m4 \ $(top_srcdir)/gnulib/m4/getopt.m4 \ $(top_srcdir)/gnulib/m4/gnulib-common.m4 \ $(top_srcdir)/gnulib/m4/gnulib-comp.m4 \ $(top_srcdir)/gnulib/m4/include_next.m4 \ $(top_srcdir)/gnulib/m4/malloc.m4 \ $(top_srcdir)/gnulib/m4/nocrash.m4 \ $(top_srcdir)/gnulib/m4/off_t.m4 \ $(top_srcdir)/gnulib/m4/onceonly.m4 \ $(top_srcdir)/gnulib/m4/realloc.m4 \ $(top_srcdir)/gnulib/m4/ssize_t.m4 \ $(top_srcdir)/gnulib/m4/stdarg.m4 \ $(top_srcdir)/gnulib/m4/stddef_h.m4 \ $(top_srcdir)/gnulib/m4/stdlib_h.m4 \ $(top_srcdir)/gnulib/m4/sys_types_h.m4 \ $(top_srcdir)/gnulib/m4/unistd_h.m4 \ $(top_srcdir)/gnulib/m4/version-etc.m4 \ $(top_srcdir)/gnulib/m4/warn-on-use.m4 \ $(top_srcdir)/gnulib/m4/wchar_t.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(liblouisutdmlincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) liblouisutdml_la_LIBADD = am_liblouisutdml_la_OBJECTS = liblouisutdml_la-Jliblouisutdml.lo \ liblouisutdml_la-change_table.lo \ liblouisutdml_la-makeContents.lo \ liblouisutdml_la-examine_document.lo \ liblouisutdml_la-liblouisutdml.lo liblouisutdml_la-paths.lo \ liblouisutdml_la-readconfig.lo liblouisutdml_la-semantics.lo \ liblouisutdml_la-transcribe_cdataSection.lo \ liblouisutdml_la-transcribe_chemistry.lo \ liblouisutdml_la-transcribe_computerCode.lo \ liblouisutdml_la-transcribe_document.lo \ liblouisutdml_la-transcribe_graphic.lo \ liblouisutdml_la-transcribe_math.lo \ liblouisutdml_la-transcribe_music.lo \ liblouisutdml_la-transcribe_paragraph.lo \ liblouisutdml_la-convert_utd.lo \ liblouisutdml_la-utd2transinxml.lo \ liblouisutdml_la-utd2dsbible.lo liblouisutdml_la-utd2brf.lo \ liblouisutdml_la-utd2pef.lo liblouisutdml_la-utd2volumes.lo \ liblouisutdml_la-transcriber.lo liblouisutdml_la_OBJECTS = $(am_liblouisutdml_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(liblouisutdml_la_SOURCES) DIST_SOURCES = $(liblouisutdml_la_SOURCES) liblouisutdmlincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(liblouisutdmlinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ ARFLAGS = @ARFLAGS@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_DEPENDENCIES_CFLAGS = @BASE_DEPENDENCIES_CFLAGS@ BASE_DEPENDENCIES_LIBS = @BASE_DEPENDENCIES_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETOPT_H = @GETOPT_H@ GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@ GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@ GL_GENERATE_STDARG_H_FALSE = @GL_GENERATE_STDARG_H_FALSE@ GL_GENERATE_STDARG_H_TRUE = @GL_GENERATE_STDARG_H_TRUE@ GL_GENERATE_STDDEF_H_FALSE = @GL_GENERATE_STDDEF_H_FALSE@ GL_GENERATE_STDDEF_H_TRUE = @GL_GENERATE_STDDEF_H_TRUE@ GNULIB_ATOLL = @GNULIB_ATOLL@ GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@ GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@ GNULIB_CHDIR = @GNULIB_CHDIR@ GNULIB_CHOWN = @GNULIB_CHOWN@ GNULIB_CLOSE = @GNULIB_CLOSE@ GNULIB_DUP = @GNULIB_DUP@ GNULIB_DUP2 = @GNULIB_DUP2@ GNULIB_DUP3 = @GNULIB_DUP3@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ GNULIB_FACCESSAT = @GNULIB_FACCESSAT@ GNULIB_FCHDIR = @GNULIB_FCHDIR@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FSYNC = @GNULIB_FSYNC@ GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@ GNULIB_GETCWD = @GNULIB_GETCWD@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@ GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_LCHOWN = @GNULIB_LCHOWN@ GNULIB_LINK = @GNULIB_LINK@ GNULIB_LINKAT = @GNULIB_LINKAT@ GNULIB_LSEEK = @GNULIB_LSEEK@ GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@ GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@ GNULIB_MKSTEMP = @GNULIB_MKSTEMP@ GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_PREAD = @GNULIB_PREAD@ GNULIB_PTSNAME = @GNULIB_PTSNAME@ GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@ GNULIB_PUTENV = @GNULIB_PUTENV@ GNULIB_PWRITE = @GNULIB_PWRITE@ GNULIB_RANDOM = @GNULIB_RANDOM@ GNULIB_RANDOM_R = @GNULIB_RANDOM_R@ GNULIB_READ = @GNULIB_READ@ GNULIB_READLINK = @GNULIB_READLINK@ GNULIB_READLINKAT = @GNULIB_READLINKAT@ GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@ GNULIB_REALPATH = @GNULIB_REALPATH@ GNULIB_RMDIR = @GNULIB_RMDIR@ GNULIB_RPMATCH = @GNULIB_RPMATCH@ GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@ GNULIB_SETENV = @GNULIB_SETENV@ GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@ GNULIB_SLEEP = @GNULIB_SLEEP@ GNULIB_STRTOD = @GNULIB_STRTOD@ GNULIB_STRTOLL = @GNULIB_STRTOLL@ GNULIB_STRTOULL = @GNULIB_STRTOULL@ GNULIB_SYMLINK = @GNULIB_SYMLINK@ GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@ GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@ GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@ GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@ GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@ GNULIB_UNLINK = @GNULIB_UNLINK@ GNULIB_UNLINKAT = @GNULIB_UNLINKAT@ GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@ GNULIB_UNSETENV = @GNULIB_UNSETENV@ GNULIB_USLEEP = @GNULIB_USLEEP@ GNULIB_WCTOMB = @GNULIB_WCTOMB@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CHOWN = @HAVE_CHOWN@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_SETENV = @HAVE_DECL_SETENV@ HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ HAVE_FACCESSAT = @HAVE_FACCESSAT@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FSYNC = @HAVE_FSYNC@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ HAVE_GETOPT_H = @HAVE_GETOPT_H@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_HELP2MAN_FALSE = @HAVE_HELP2MAN_FALSE@ HAVE_HELP2MAN_TRUE = @HAVE_HELP2MAN_TRUE@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LINK = @HAVE_LINK@ HAVE_LINKAT = @HAVE_LINKAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ HAVE_MKOSTEMP = @HAVE_MKOSTEMP@ HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@ HAVE_MKSTEMP = @HAVE_MKSTEMP@ HAVE_MKSTEMPS = @HAVE_MKSTEMPS@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_PREAD = @HAVE_PREAD@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ HAVE_READLINK = @HAVE_READLINK@ HAVE_READLINKAT = @HAVE_READLINKAT@ HAVE_REALPATH = @HAVE_REALPATH@ HAVE_RPMATCH = @HAVE_RPMATCH@ HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SLEEP = @HAVE_SLEEP@ HAVE_STRTOD = @HAVE_STRTOD@ HAVE_STRTOLL = @HAVE_STRTOLL@ HAVE_STRTOULL = @HAVE_STRTOULL@ HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ HAVE_SYMLINK = @HAVE_SYMLINK@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@ HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@ HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ HAVE_USLEEP = @HAVE_USLEEP@ HAVE_WCHAR_T = @HAVE_WCHAR_T@ HAVE__EXIT = @HAVE__EXIT@ HELP2MAN = @HELP2MAN@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBINTL = @LIBINTL@ LIBLOUISUTDML_AGE = @LIBLOUISUTDML_AGE@ LIBLOUISUTDML_CURRENT = @LIBLOUISUTDML_CURRENT@ LIBLOUISUTDML_REVISION = @LIBLOUISUTDML_REVISION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ NEXT_STDDEF_H = @NEXT_STDDEF_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ RANLIB = @RANLIB@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@ REPLACE_GETCWD = @REPLACE_GETCWD@ REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@ REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_LCHOWN = @REPLACE_LCHOWN@ REPLACE_LINK = @REPLACE_LINK@ REPLACE_LINKAT = @REPLACE_LINKAT@ REPLACE_LSEEK = @REPLACE_LSEEK@ REPLACE_MALLOC = @REPLACE_MALLOC@ REPLACE_MBTOWC = @REPLACE_MBTOWC@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@ REPLACE_PUTENV = @REPLACE_PUTENV@ REPLACE_PWRITE = @REPLACE_PWRITE@ REPLACE_RANDOM_R = @REPLACE_RANDOM_R@ REPLACE_READ = @REPLACE_READ@ REPLACE_READLINK = @REPLACE_READLINK@ REPLACE_REALLOC = @REPLACE_REALLOC@ REPLACE_REALPATH = @REPLACE_REALPATH@ REPLACE_RMDIR = @REPLACE_RMDIR@ REPLACE_SETENV = @REPLACE_SETENV@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_STRTOD = @REPLACE_STRTOD@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@ REPLACE_UNLINK = @REPLACE_UNLINK@ REPLACE_UNLINKAT = @REPLACE_UNLINKAT@ REPLACE_UNSETENV = @REPLACE_UNSETENV@ REPLACE_USLEEP = @REPLACE_USLEEP@ REPLACE_WCTOMB = @REPLACE_WCTOMB@ REPLACE_WRITE = @REPLACE_WRITE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDARG_H = @STDARG_H@ STDDEF_H = @STDDEF_H@ STRIP = @STRIP@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ VERSION = @VERSION@ WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@ ac_ct_AR = @ac_ct_AR@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ ac_ct_F77 = @ac_ct_F77@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ gl_LIBOBJS = @gl_LIBOBJS@ gl_LTLIBOBJS = @gl_LTLIBOBJS@ gltests_LIBOBJS = @gltests_LIBOBJS@ gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ gltests_WITNESS = @gltests_WITNESS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ INCLUDES = \ -I$(top_srcdir) \ -DLBU_PATH=\"$(datadir)/liblouisutdml/lbu_files/\" \ -DLIBLOUIS_TABLES_PATH=\"$(datadir)/liblouis/tables/\" liblouisutdmlincludedir = $(includedir)/liblouisutdml liblouisutdmlinclude_HEADERS = \ liblouisutdml.h \ louisutdml.h lib_LTLIBRARIES = liblouisutdml.la liblouisutdml_la_CFLAGS = \ $(BASE_DEPENDENCIES_CFLAGS) liblouisutdml_la_LDFLAGS = \ -version-info \ $(LIBLOUISUTDML_CURRENT):$(LIBLOUISUTDML_REVISION):$(LIBLOUISUTDML_AGE) \ -no-undefined \ $(BASE_DEPENDENCIES_LIBS) liblouisutdml_la_SOURCES = \ ../java/Jliblouisutdml.h \ ../java/Jliblouisutdml.c \ change_table.c \ makeContents.c \ examine_document.c \ liblouisutdml.c \ liblouisutdml.h \ louisutdml.h \ paths.c \ readconfig.c \ semantics.c \ sem_enum.h \ sem_names.h \ transcribe_cdataSection.c \ transcribe_chemistry.c \ transcribe_computerCode.c \ transcribe_document.c \ transcribe_graphic.c \ transcribe_math.c \ transcribe_music.c \ transcribe_paragraph.c \ convert_utd.c \ utd2transinxml.c \ utd2dsbible.c \ utd2brf.c \ utd2pef.c \ utd2volumes.c \ transcriber.c EXTRA_DIST = \ README \ make_sem_names.c \ Makesemnames all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu liblouisutdml/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu liblouisutdml/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status liblouisutdml/config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done liblouisutdml.la: $(liblouisutdml_la_OBJECTS) $(liblouisutdml_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(liblouisutdml_la_LDFLAGS) $(liblouisutdml_la_OBJECTS) $(liblouisutdml_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-Jliblouisutdml.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-change_table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-convert_utd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-examine_document.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-liblouisutdml.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-makeContents.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-paths.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-readconfig.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-semantics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcribe_cdataSection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcribe_chemistry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcribe_computerCode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcribe_document.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcribe_graphic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcribe_math.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcribe_music.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcribe_paragraph.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-transcriber.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-utd2brf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-utd2dsbible.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-utd2pef.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-utd2transinxml.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblouisutdml_la-utd2volumes.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< liblouisutdml_la-Jliblouisutdml.lo: ../java/Jliblouisutdml.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-Jliblouisutdml.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-Jliblouisutdml.Tpo" -c -o liblouisutdml_la-Jliblouisutdml.lo `test -f '../java/Jliblouisutdml.c' || echo '$(srcdir)/'`../java/Jliblouisutdml.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-Jliblouisutdml.Tpo" "$(DEPDIR)/liblouisutdml_la-Jliblouisutdml.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-Jliblouisutdml.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../java/Jliblouisutdml.c' object='liblouisutdml_la-Jliblouisutdml.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-Jliblouisutdml.lo `test -f '../java/Jliblouisutdml.c' || echo '$(srcdir)/'`../java/Jliblouisutdml.c liblouisutdml_la-change_table.lo: change_table.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-change_table.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-change_table.Tpo" -c -o liblouisutdml_la-change_table.lo `test -f 'change_table.c' || echo '$(srcdir)/'`change_table.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-change_table.Tpo" "$(DEPDIR)/liblouisutdml_la-change_table.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-change_table.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='change_table.c' object='liblouisutdml_la-change_table.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-change_table.lo `test -f 'change_table.c' || echo '$(srcdir)/'`change_table.c liblouisutdml_la-makeContents.lo: makeContents.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-makeContents.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-makeContents.Tpo" -c -o liblouisutdml_la-makeContents.lo `test -f 'makeContents.c' || echo '$(srcdir)/'`makeContents.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-makeContents.Tpo" "$(DEPDIR)/liblouisutdml_la-makeContents.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-makeContents.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='makeContents.c' object='liblouisutdml_la-makeContents.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-makeContents.lo `test -f 'makeContents.c' || echo '$(srcdir)/'`makeContents.c liblouisutdml_la-examine_document.lo: examine_document.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-examine_document.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-examine_document.Tpo" -c -o liblouisutdml_la-examine_document.lo `test -f 'examine_document.c' || echo '$(srcdir)/'`examine_document.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-examine_document.Tpo" "$(DEPDIR)/liblouisutdml_la-examine_document.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-examine_document.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examine_document.c' object='liblouisutdml_la-examine_document.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-examine_document.lo `test -f 'examine_document.c' || echo '$(srcdir)/'`examine_document.c liblouisutdml_la-liblouisutdml.lo: liblouisutdml.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-liblouisutdml.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-liblouisutdml.Tpo" -c -o liblouisutdml_la-liblouisutdml.lo `test -f 'liblouisutdml.c' || echo '$(srcdir)/'`liblouisutdml.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-liblouisutdml.Tpo" "$(DEPDIR)/liblouisutdml_la-liblouisutdml.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-liblouisutdml.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='liblouisutdml.c' object='liblouisutdml_la-liblouisutdml.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-liblouisutdml.lo `test -f 'liblouisutdml.c' || echo '$(srcdir)/'`liblouisutdml.c liblouisutdml_la-paths.lo: paths.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-paths.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-paths.Tpo" -c -o liblouisutdml_la-paths.lo `test -f 'paths.c' || echo '$(srcdir)/'`paths.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-paths.Tpo" "$(DEPDIR)/liblouisutdml_la-paths.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-paths.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='paths.c' object='liblouisutdml_la-paths.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-paths.lo `test -f 'paths.c' || echo '$(srcdir)/'`paths.c liblouisutdml_la-readconfig.lo: readconfig.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-readconfig.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-readconfig.Tpo" -c -o liblouisutdml_la-readconfig.lo `test -f 'readconfig.c' || echo '$(srcdir)/'`readconfig.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-readconfig.Tpo" "$(DEPDIR)/liblouisutdml_la-readconfig.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-readconfig.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='readconfig.c' object='liblouisutdml_la-readconfig.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-readconfig.lo `test -f 'readconfig.c' || echo '$(srcdir)/'`readconfig.c liblouisutdml_la-semantics.lo: semantics.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-semantics.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-semantics.Tpo" -c -o liblouisutdml_la-semantics.lo `test -f 'semantics.c' || echo '$(srcdir)/'`semantics.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-semantics.Tpo" "$(DEPDIR)/liblouisutdml_la-semantics.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-semantics.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='semantics.c' object='liblouisutdml_la-semantics.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-semantics.lo `test -f 'semantics.c' || echo '$(srcdir)/'`semantics.c liblouisutdml_la-transcribe_cdataSection.lo: transcribe_cdataSection.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcribe_cdataSection.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcribe_cdataSection.Tpo" -c -o liblouisutdml_la-transcribe_cdataSection.lo `test -f 'transcribe_cdataSection.c' || echo '$(srcdir)/'`transcribe_cdataSection.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcribe_cdataSection.Tpo" "$(DEPDIR)/liblouisutdml_la-transcribe_cdataSection.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcribe_cdataSection.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcribe_cdataSection.c' object='liblouisutdml_la-transcribe_cdataSection.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcribe_cdataSection.lo `test -f 'transcribe_cdataSection.c' || echo '$(srcdir)/'`transcribe_cdataSection.c liblouisutdml_la-transcribe_chemistry.lo: transcribe_chemistry.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcribe_chemistry.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcribe_chemistry.Tpo" -c -o liblouisutdml_la-transcribe_chemistry.lo `test -f 'transcribe_chemistry.c' || echo '$(srcdir)/'`transcribe_chemistry.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcribe_chemistry.Tpo" "$(DEPDIR)/liblouisutdml_la-transcribe_chemistry.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcribe_chemistry.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcribe_chemistry.c' object='liblouisutdml_la-transcribe_chemistry.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcribe_chemistry.lo `test -f 'transcribe_chemistry.c' || echo '$(srcdir)/'`transcribe_chemistry.c liblouisutdml_la-transcribe_computerCode.lo: transcribe_computerCode.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcribe_computerCode.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcribe_computerCode.Tpo" -c -o liblouisutdml_la-transcribe_computerCode.lo `test -f 'transcribe_computerCode.c' || echo '$(srcdir)/'`transcribe_computerCode.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcribe_computerCode.Tpo" "$(DEPDIR)/liblouisutdml_la-transcribe_computerCode.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcribe_computerCode.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcribe_computerCode.c' object='liblouisutdml_la-transcribe_computerCode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcribe_computerCode.lo `test -f 'transcribe_computerCode.c' || echo '$(srcdir)/'`transcribe_computerCode.c liblouisutdml_la-transcribe_document.lo: transcribe_document.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcribe_document.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcribe_document.Tpo" -c -o liblouisutdml_la-transcribe_document.lo `test -f 'transcribe_document.c' || echo '$(srcdir)/'`transcribe_document.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcribe_document.Tpo" "$(DEPDIR)/liblouisutdml_la-transcribe_document.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcribe_document.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcribe_document.c' object='liblouisutdml_la-transcribe_document.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcribe_document.lo `test -f 'transcribe_document.c' || echo '$(srcdir)/'`transcribe_document.c liblouisutdml_la-transcribe_graphic.lo: transcribe_graphic.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcribe_graphic.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcribe_graphic.Tpo" -c -o liblouisutdml_la-transcribe_graphic.lo `test -f 'transcribe_graphic.c' || echo '$(srcdir)/'`transcribe_graphic.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcribe_graphic.Tpo" "$(DEPDIR)/liblouisutdml_la-transcribe_graphic.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcribe_graphic.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcribe_graphic.c' object='liblouisutdml_la-transcribe_graphic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcribe_graphic.lo `test -f 'transcribe_graphic.c' || echo '$(srcdir)/'`transcribe_graphic.c liblouisutdml_la-transcribe_math.lo: transcribe_math.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcribe_math.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcribe_math.Tpo" -c -o liblouisutdml_la-transcribe_math.lo `test -f 'transcribe_math.c' || echo '$(srcdir)/'`transcribe_math.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcribe_math.Tpo" "$(DEPDIR)/liblouisutdml_la-transcribe_math.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcribe_math.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcribe_math.c' object='liblouisutdml_la-transcribe_math.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcribe_math.lo `test -f 'transcribe_math.c' || echo '$(srcdir)/'`transcribe_math.c liblouisutdml_la-transcribe_music.lo: transcribe_music.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcribe_music.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcribe_music.Tpo" -c -o liblouisutdml_la-transcribe_music.lo `test -f 'transcribe_music.c' || echo '$(srcdir)/'`transcribe_music.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcribe_music.Tpo" "$(DEPDIR)/liblouisutdml_la-transcribe_music.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcribe_music.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcribe_music.c' object='liblouisutdml_la-transcribe_music.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcribe_music.lo `test -f 'transcribe_music.c' || echo '$(srcdir)/'`transcribe_music.c liblouisutdml_la-transcribe_paragraph.lo: transcribe_paragraph.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcribe_paragraph.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcribe_paragraph.Tpo" -c -o liblouisutdml_la-transcribe_paragraph.lo `test -f 'transcribe_paragraph.c' || echo '$(srcdir)/'`transcribe_paragraph.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcribe_paragraph.Tpo" "$(DEPDIR)/liblouisutdml_la-transcribe_paragraph.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcribe_paragraph.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcribe_paragraph.c' object='liblouisutdml_la-transcribe_paragraph.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcribe_paragraph.lo `test -f 'transcribe_paragraph.c' || echo '$(srcdir)/'`transcribe_paragraph.c liblouisutdml_la-convert_utd.lo: convert_utd.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-convert_utd.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-convert_utd.Tpo" -c -o liblouisutdml_la-convert_utd.lo `test -f 'convert_utd.c' || echo '$(srcdir)/'`convert_utd.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-convert_utd.Tpo" "$(DEPDIR)/liblouisutdml_la-convert_utd.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-convert_utd.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='convert_utd.c' object='liblouisutdml_la-convert_utd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-convert_utd.lo `test -f 'convert_utd.c' || echo '$(srcdir)/'`convert_utd.c liblouisutdml_la-utd2transinxml.lo: utd2transinxml.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-utd2transinxml.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-utd2transinxml.Tpo" -c -o liblouisutdml_la-utd2transinxml.lo `test -f 'utd2transinxml.c' || echo '$(srcdir)/'`utd2transinxml.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-utd2transinxml.Tpo" "$(DEPDIR)/liblouisutdml_la-utd2transinxml.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-utd2transinxml.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utd2transinxml.c' object='liblouisutdml_la-utd2transinxml.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-utd2transinxml.lo `test -f 'utd2transinxml.c' || echo '$(srcdir)/'`utd2transinxml.c liblouisutdml_la-utd2dsbible.lo: utd2dsbible.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-utd2dsbible.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-utd2dsbible.Tpo" -c -o liblouisutdml_la-utd2dsbible.lo `test -f 'utd2dsbible.c' || echo '$(srcdir)/'`utd2dsbible.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-utd2dsbible.Tpo" "$(DEPDIR)/liblouisutdml_la-utd2dsbible.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-utd2dsbible.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utd2dsbible.c' object='liblouisutdml_la-utd2dsbible.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-utd2dsbible.lo `test -f 'utd2dsbible.c' || echo '$(srcdir)/'`utd2dsbible.c liblouisutdml_la-utd2brf.lo: utd2brf.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-utd2brf.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-utd2brf.Tpo" -c -o liblouisutdml_la-utd2brf.lo `test -f 'utd2brf.c' || echo '$(srcdir)/'`utd2brf.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-utd2brf.Tpo" "$(DEPDIR)/liblouisutdml_la-utd2brf.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-utd2brf.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utd2brf.c' object='liblouisutdml_la-utd2brf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-utd2brf.lo `test -f 'utd2brf.c' || echo '$(srcdir)/'`utd2brf.c liblouisutdml_la-utd2pef.lo: utd2pef.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-utd2pef.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-utd2pef.Tpo" -c -o liblouisutdml_la-utd2pef.lo `test -f 'utd2pef.c' || echo '$(srcdir)/'`utd2pef.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-utd2pef.Tpo" "$(DEPDIR)/liblouisutdml_la-utd2pef.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-utd2pef.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utd2pef.c' object='liblouisutdml_la-utd2pef.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-utd2pef.lo `test -f 'utd2pef.c' || echo '$(srcdir)/'`utd2pef.c liblouisutdml_la-utd2volumes.lo: utd2volumes.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-utd2volumes.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-utd2volumes.Tpo" -c -o liblouisutdml_la-utd2volumes.lo `test -f 'utd2volumes.c' || echo '$(srcdir)/'`utd2volumes.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-utd2volumes.Tpo" "$(DEPDIR)/liblouisutdml_la-utd2volumes.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-utd2volumes.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utd2volumes.c' object='liblouisutdml_la-utd2volumes.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-utd2volumes.lo `test -f 'utd2volumes.c' || echo '$(srcdir)/'`utd2volumes.c liblouisutdml_la-transcriber.lo: transcriber.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -MT liblouisutdml_la-transcriber.lo -MD -MP -MF "$(DEPDIR)/liblouisutdml_la-transcriber.Tpo" -c -o liblouisutdml_la-transcriber.lo `test -f 'transcriber.c' || echo '$(srcdir)/'`transcriber.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblouisutdml_la-transcriber.Tpo" "$(DEPDIR)/liblouisutdml_la-transcriber.Plo"; else rm -f "$(DEPDIR)/liblouisutdml_la-transcriber.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transcriber.c' object='liblouisutdml_la-transcriber.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblouisutdml_la_CFLAGS) $(CFLAGS) -c -o liblouisutdml_la-transcriber.lo `test -f 'transcriber.c' || echo '$(srcdir)/'`transcriber.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: install-liblouisutdmlincludeHEADERS: $(liblouisutdmlinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(liblouisutdmlincludedir)" || $(mkdir_p) "$(DESTDIR)$(liblouisutdmlincludedir)" @list='$(liblouisutdmlinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(liblouisutdmlincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(liblouisutdmlincludedir)/$$f'"; \ $(liblouisutdmlincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(liblouisutdmlincludedir)/$$f"; \ done uninstall-liblouisutdmlincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(liblouisutdmlinclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(liblouisutdmlincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(liblouisutdmlincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(liblouisutdmlincludedir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-liblouisutdmlincludeHEADERS install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-liblouisutdmlincludeHEADERS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-libLTLIBRARIES \ install-liblouisutdmlincludeHEADERS install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-liblouisutdmlincludeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: liblouisutdml-2.5.0/liblouisutdml/utd2pef.c0000664000076500007650000001137412151532762015762 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" static int walkTree (xmlNode *node); static int walkSubTree (xmlNode *node, int action); static int beginDocument (); static int endSubTree (); static int finishDocument (); int utd2pef (xmlNode * node) { ud->top = -1; ud->style_top = -1; beginDocument (); walkTree (node); finishDocument (); return 1; } static int beginDocument () { } static int finishDocument () { } static int walkTree (xmlNode *node) { xmlNode *child; if (node == NULL) return 0; push_sem_stack (node); switch (ud->stack[ud->top]) { case utdbrl: case utdmeta: walkSubTree (node, 0); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: walkTree (child); break; case XML_TEXT_NODE: break; default: break; } child = child->next; } pop_sem_stack (); return 1; } static char *blanks = " "; static int writeCharacters (const char *text, int length) { int k; for (k = 0; k < length; k++) ud->outbuf1[ud->outbuf1_len_so_far++] = text[k]; return 1; } static int doDotsText (xmlNode * node) { ud->text_length = 0; insert_utf8 (node->content); if (!lou_dotsToChar (ud->main_braille_table, ud->text_buffer, &ud->outbuf1[ud->outbuf1_len_so_far], ud->text_length, ud->louis_mode)) return 0; ud->outbuf1_len_so_far += ud->text_length; return 1; } static int doUtdbrlonly (xmlNode * node) { utd2transinxml (node); return 1; } static int skipFirstNew = 0; static int newpagePending = 0; static int doUtdnewpage (xmlNode * node) { if (skipFirstNew) return 1; newpagePending = 1; return 1; } static int doUtdnewline (xmlNode * node) { char *xy; int k; int leadingBlanks; if (skipFirstNew) skipFirstNew = newpagePending = 0; else writeCharacters (ud->lineEnd, strlen (ud->lineEnd)); if (newpagePending) { writeCharacters (ud->pageEnd, strlen (ud->pageEnd)); newpagePending = 0; } xy = (char *) xmlGetProp (node, (xmlChar *) "xy"); for (k = 0; xy[k] != ','; k++); leadingBlanks = (atoi (&xy[k + 1]) - ud->left_margin) / ud->cell_width; writeCharacters (blanks, leadingBlanks); return 1; } int walkSubTree (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (ud->top == 0) action = 1; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case markhead: if (ud->head_node == NULL) ud->head_node = node; pop_sem_stack (); break; case utdbrl: case utdmeta: walkSubTree (node, 0); if (action != 0) pop_sem_stack (); return 1; case utdbrlonly: doUtdbrlonly (node); if (action != firstCall) pop_sem_stack (); return 1; case utdnewpage: doUtdnewpage (node); if (action != firstCall) pop_sem_stack (); return 1; case utdnewline: doUtdnewline (node); if (action != firstCall) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, firstCall); if (action != firstCall) pop_sem_stack (); return 1; case changetable: change_table (node); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: walkSubTree (child, 1); break; case XML_TEXT_NODE: break; default: break; } child = child->next; } if (action != 0) { pop_sem_stack (); return 1; } endSubTree (); return 1; } static int endSubTree () { } liblouisutdml-2.5.0/liblouisutdml/utd2brf.c0000664000076500007650000001571512222610023015746 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #include #include #include "louisutdml.h" static int brf_beginDocument (); static int brf_findBrlNodes (xmlNode * node); static int brf_doBrlNode (xmlNode * node, int action); static int brf_saveBuffer (); static int brf_doUtdbrlonly (xmlNode * node, int action); static int brf_doUtdnewpage (xmlNode * node); static int brf_doUtdnewline (xmlNode * node); static int brf_finishDocument (); static int firstPage; static int firstLineOnPage; static int prevLinePos; int utd2brf (xmlNode * node) { ud->top = -1; ud->style_top = -1; firstPage = 1; firstLineOnPage = 1; brf_beginDocument (); brf_findBrlNodes (node); brf_finishDocument (); return 1; } static int brf_beginDocument () { return 1; } static int brf_finishDocument () { return 1; } static int brf_findBrlNodes (xmlNode * node) { xmlNode *child; if (node == NULL) return 0; push_sem_stack (node); switch (ud->stack[ud->top]) { case utdmeta: return 1; case utdbrl: brf_doBrlNode (node, 0); pop_sem_stack (); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: brf_findBrlNodes (child); break; case XML_TEXT_NODE: break; default: break; } child = child->next; } pop_sem_stack (); return 1; } static char *blanks = " "; static int brf_insertCharacters (const char *text, int length) { int k; if (length <= 0 || (ud->outbuf1_len_so_far + length) > ud->outbuf1_len) return 0; for (k = 0; k < length; k++) ud->outbuf1[ud->outbuf1_len_so_far++] = text[k]; return 1; } static int brf_doDotsText (xmlNode * node) { ud->text_length = 0; insert_utf8 (node->content); if ((ud->outbuf1_len_so_far + ud->text_length) > ud->outbuf1_len) brf_saveBuffer (); if (!lou_dotsToChar (ud->main_braille_table, ud->text_buffer, &ud->outbuf1[ud->outbuf1_len_so_far], ud->text_length, 0)) return 0; ud->outbuf1_len_so_far += ud->text_length; return 1; } static int brf_doUtdbrlonly (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case utdnewpage: brf_doUtdnewpage (node); if (action != 0) pop_sem_stack (); return 1; case utdnewline: brf_doUtdnewline (node); if (action != 0) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); break; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: brf_doUtdbrlonly (child, 1); break; case XML_TEXT_NODE: if (ud->stack[ud->top] == utdbrlonly) /* print text */ break; brf_doDotsText (child); break; default: break; } child = child->next; } if (action != 0) pop_sem_stack (); return 1; } static int brf_doUtdnewpage (xmlNode * node) { firstLineOnPage = 1; if (firstPage) { firstPage = 0; return 1; } for (; ud->outbuf1_len_so_far > 0 && ud->outbuf1[ud->outbuf1_len_so_far - 1] <= ' '; ud->outbuf1_len_so_far--); brf_insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); brf_insertCharacters (ud->pageEnd, strlen (ud->pageEnd)); brf_saveBuffer (); return 1; } static int brf_doUtdnewline (xmlNode * node) { char *xy; int k; int leadingBlanks; int linePos; for (; ud->outbuf1_len_so_far > 0 && ud->outbuf1[ud->outbuf1_len_so_far - 1] <= ' '; ud->outbuf1_len_so_far--); if (firstLineOnPage) { prevLinePos = ud->page_top; firstLineOnPage = 0; } xy = (char *) xmlGetProp (node, (xmlChar *) "xy"); k = atoi (xy); leadingBlanks = (k - ud->left_margin) / ud->cell_width; if (leadingBlanks < 0 || leadingBlanks > ud->cells_per_line) leadingBlanks = 0; for (k = 0; xy[k] != ','; k++); linePos = atoi (&xy[k + 1]); if (linePos < ud->page_top) linePos = ud->page_top; if (linePos > ud->page_bottom) linePos = ud->page_bottom; /* The following will need modification for wide lines and graphics. */ for (k = prevLinePos; k < linePos; k += ud->normal_line) brf_insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); prevLinePos = linePos; brf_insertCharacters (blanks, leadingBlanks); return 1; } int brf_doBrlNode (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (action == 0) ud->outbuf1_len_so_far = 0; else push_sem_stack (node); switch (ud->stack[ud->top]) { case markhead: if (ud->head_node == NULL) ud->head_node = node; if (action != 0) pop_sem_stack (); return 1; case utdbrlonly: brf_doUtdbrlonly (node, 0); if (action != 0) pop_sem_stack (); return 1; case utdnewpage: brf_doUtdnewpage (node); if (action != 0) pop_sem_stack (); return 1; case utdnewline: brf_doUtdnewline (node); if (action != 0) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); break; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: brf_doBrlNode (child, 1); break; case XML_TEXT_NODE: brf_doDotsText (child); break; default: break; } child = child->next; } if (action != 0) { pop_sem_stack (); return 1; } brf_saveBuffer (); return 1; } static int brf_saveBuffer () { if (ud->outbuf1_len_so_far <= 0) return 1; write_buffer (1, 0); ud->outbuf1_len_so_far = 0; return 1; } liblouisutdml-2.5.0/liblouisutdml/make_sem_names.c0000775000076500007650000000456312054461273017362 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include int main (void) { FILE *semIn; FILE *semOut; char inbuf[128]; char *curchar; int ch; int ignoreLine = 1; char *name; int nameLength; if ((semIn = fopen ("sem_enum.h", "r")) == NULL) { fprintf (stderr, "Cannot open sem_enum.h file.\n"); exit (1); } if ((semOut = fopen ("sem_names.h", "w")) == NULL) { fprintf (stderr, "Cannot open sem_names.h file.\n"); exit (1); } fprintf (semOut, "#ifndef __SEM_NAMES_h\n"); fprintf (semOut, "#define __SEM_NAMES_h\n"); fprintf (semOut, "static const char *semNames[] = {\n"); while ((fgets (inbuf, sizeof (inbuf), semIn))) { curchar = inbuf; while ((ch = *curchar++) <= 32 && ch != 0); if (ch == '/') continue; if (ignoreLine) { if (ch == '{') ignoreLine = 0; continue; } if (ch == '}') break; name = curchar - 1; while ((ch = *curchar++) > 32 && ch != ',' && ch != '='); nameLength = curchar - name - 1; name[nameLength] = 0; fprintf (semOut, " \"%s\",\n", name); } fclose (semIn); fprintf (semOut, "NULL\n"); fprintf (semOut, "};\n"); fprintf (semOut, "#endif /*__SEM_NAMES_H*/\n"); fclose (semOut); return 0; } liblouisutdml-2.5.0/liblouisutdml/semantics.c0000664000076500007650000012441712206175401016374 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include #include "louisutdml.h" #include #include "sem_names.h" typedef struct { const char *fileName; FILE *in; int lineNumber; int numEntries; int unedited; char line[5 * MAXNAMELEN]; } FileInfo; #define HASHSIZE 383 #define MAXINSERTS 256 typedef struct { short int numInserts; short int lastInsert; short int numChars; widechar charInserts[MAXINSERTS]; } InsertsType; typedef enum { styleEntry = 1, xpathEntry = 2, actionEntry = 4, macroEntry = 8 } EntryType; typedef struct { void *next; unsigned char *key; EntryType type; int semNum; InsertsType *inserts; StyleType *style; unsigned char *macro; } HashEntry; typedef struct { int curBucket; HashEntry *curEntry; HashEntry *entries[HASHSIZE]; } HashTable; static int notFound = -1; static HashTable *semanticTable = NULL; static HashTable *newEntriesTable = NULL; static int errorCount = 0; static const xmlChar *rootName; static xmlXPathContext *xpathCtx = NULL; static int registerNamespaces (FileInfo * Nested, xmlXPathContextPtr xpathCtx, const xmlChar * nsList); static void semanticError (FileInfo * nested, char *format, ...) { char buffer[MAXNAMELEN]; va_list arguments; va_start (arguments, format); #ifdef WIN32 _vsnprintf (buffer, sizeof (buffer), format, arguments); #else vsnprintf (buffer, sizeof (buffer), format, arguments); #endif va_end (arguments); if (nested) lou_logPrint ("%s:%d: %s", nested->fileName, nested->lineNumber, buffer); else lou_logPrint ("%s", buffer); errorCount++; } static unsigned int semStringHash (const unsigned char *s) { int k; unsigned int h = 0, g; for (k = 0; s[k]; k++) { h = (h << 4) + s[k]; if ((g = h & 0xf0000000)) { h = h ^ (g >> 24); h = h ^ g; } } return h; } static HashTable * hashNew () { HashTable *table; table = malloc (sizeof (HashTable)); if (!table) memoryError (); memset (table, 0, sizeof (HashTable)); table->curBucket = -1; return table; } static void hashFree (HashTable * table) { int i; HashEntry *e, *next; if (table == NULL) return; for (i = 0; i < HASHSIZE; i++) for (e = table->entries[i]; e; e = next) { next = e->next; free (e->key); if (e->inserts != NULL) free (e->inserts); if (e->type & styleEntry) free (e->style); free (e); } free (table); } static void hashInsert (HashTable * table, const unsigned char *key, int type, int semNum, InsertsType * inserts, StyleType * style, unsigned char *macro); void clean_semantic_table () { int i; HashEntry *e, *next; HashTable *newSemanticTable; if (semanticTable == NULL) return; newSemanticTable = hashNew (); for (i = 0; i < HASHSIZE; i++) for (e = semanticTable->entries[i]; e; e = next) { next = e->next; if (!(e->type == 0 || e->type == xpathEntry)) hashInsert (newSemanticTable, e->key, e->type, e->semNum, NULL, e->style, e->macro); free (e->key); if (e->inserts != NULL) free (e->inserts); free (e); } free (semanticTable); semanticTable = newSemanticTable; } static HashEntry * hashScan (HashTable * table) { /* This function should be called in a statement like * while ((curEnt=y = hashScan (tablename))) * where * HasEntry *curEntry; / It returns a table entry at each call, in no order. When it reaches * the end of the table it resets itself and returns NULL. */ HashEntry *e; if (table == NULL) return NULL; if (table->curBucket == -1) table->curEntry = NULL; while (table->curBucket < HASHSIZE) { if (table->curEntry != NULL) { e = table->curEntry; table->curEntry = e->next; return e; } else table->curBucket++; while (table->curBucket < HASHSIZE && table->entries[table->curBucket] == NULL) table->curBucket++; if (table->curBucket < HASHSIZE) table->curEntry = table->entries[table->curBucket]; } table->curBucket = -1; table->curEntry = NULL; return NULL; } static HashEntry *latestEntry; /* assumes that key is not already present! */ static void hashInsert (HashTable * table, const unsigned char *key, int type, int semNum, InsertsType * inserts, StyleType * style, unsigned char *macro) { int i; if (table == NULL || key == NULL || *key == 0) return; i = semStringHash (key) % HASHSIZE; latestEntry = malloc (sizeof (HashEntry)); if (!latestEntry) memoryError (); latestEntry->next = table->entries[i]; latestEntry->key = malloc (strlen ((char *) key) + 2); if (!latestEntry->key) memoryError (); strcpy ((char *) latestEntry->key, (char *) key); latestEntry->type = type; latestEntry->semNum = semNum; latestEntry->inserts = inserts; latestEntry->style = style; latestEntry->macro = macro; table->entries[i] = latestEntry; } static int hashLookup (HashTable * table, const unsigned char *key) { int i; int keyLength; int entryKeyLength; int k; if (table == NULL || key == NULL || *key == 0) return notFound; keyLength = strlen ((char *) key); i = semStringHash (key) % HASHSIZE; for (latestEntry = table->entries[i]; latestEntry; latestEntry = latestEntry->next) { entryKeyLength = strlen ((char *) latestEntry->key); if (entryKeyLength != keyLength) continue; for (k = 0; k < keyLength; k++) if (key[k] != latestEntry->key[k]) break; if (k == keyLength) return latestEntry->semNum; } return notFound; } static char firstFileName[MAXNAMELEN]; static int haveSemanticFile = 1; #define SEMANTICSUF " mes" sem_act find_semantic_number (const char *name) { static const char *pseudoActions[] = { "include", "newentries", "namespaces", NULL }; int k; char realName[MAXNAMELEN]; if (semanticTable == NULL) semanticTable = hashNew (); /* See if semantic names and numbers are already in table. */ strcpy (realName, "no"); strcat (realName, SEMANTICSUF); if (hashLookup (semanticTable, (xmlChar *) realName) == notFound) { /* Enter names and numbers in table before checking for this one. */ for (k = 0; k < end_all; k++) { strcpy (realName, semNames[k]); strcat (realName, SEMANTICSUF); hashInsert (semanticTable, (xmlChar *) realName, actionEntry, k, NULL, NULL, NULL); } k = 0; while (pseudoActions[k] != NULL) { strcpy (realName, pseudoActions[k]); strcat (realName, SEMANTICSUF); hashInsert (semanticTable, (xmlChar *) realName, actionEntry, k + end_all + 1, NULL, NULL, NULL); k++; } } /* Now look up the name we called this function with. */ for (k = 0; name[k]; k++) realName[k] = name[k] | 32; realName[k] = 0; strcat (realName, SEMANTICSUF); return (hashLookup (semanticTable, (xmlChar *) realName)); } void destroy_semantic_table () { hashFree (semanticTable); semanticTable = NULL; hashFree (newEntriesTable); newEntriesTable = NULL; if (xpathCtx != NULL) xmlXPathFreeContext (xpathCtx); xpathCtx = NULL; } static widechar hexValue (FileInfo * nested, const xmlChar * digits, int length) { int k; unsigned int binaryValue = 0; for (k = 0; k < length; k++) { unsigned int hexDigit = 0; if (digits[k] >= '0' && digits[k] <= '9') hexDigit = digits[k] - '0'; else if (digits[k] >= 'a' && digits[k] <= 'f') hexDigit = digits[k] - 'a' + 10; else if (digits[k] >= 'A' && digits[k] <= 'F') hexDigit = digits[k] - 'A' + 10; else { semanticError (nested, "invalid %d-digit hexadecimal number", length); return (widechar) 0xffffffff; } binaryValue |= hexDigit << (4 * (length - 1 - k)); } return (widechar) binaryValue; } static InsertsType * encodeInsertions (FileInfo * nested, xmlChar * insertions, int length) { int k = 0; int prevk = 0; xmlChar *oneIns = insertions; int oneLength = 0; InsertsType inserts; int insertsSize = sizeof (InsertsType) - (MAXINSERTS * CHARSIZE); InsertsType *insertsPtr; int kk; int startInsert; int sizeInsert; widechar ch; if (*insertions == 0 || length == 0) return NULL; inserts.numInserts = 0; inserts.numChars = 1; inserts.lastInsert = 0; k = 0; prevk = 0; /*Inserjions are placed in inserts.charInserts and consist of a length * followed by the characters to be inserted. The length is one more than * the numbr of characters to make it simpler to step through the * insertions in the next function.*/ while (k < length) { if (insertions[k] == '\\' && insertions[k + 1] == ',') { k += 2; continue; } if (insertions[k] == ',' || k == (length - 1)) { oneLength = k - prevk; if (k == (length - 1)) oneLength++; if (insertions[prevk] == '\\' && insertions[prevk + 1] == '*') { inserts.lastInsert = inserts.numChars; if ((prevk + oneLength) < length) semanticError (nested, "an insertion with \\* must be the last."); } else inserts.numInserts++; startInsert = inserts.numChars++; sizeInsert = 0; kk = 0; while (kk < oneLength) { ch = (widechar) oneIns[kk++]; if (ch == '\\') switch (oneIns[kk]) { case 's': inserts.charInserts[inserts.numChars++] = ' '; kk++; break; case 'e': inserts.charInserts[inserts.numChars++] = 0x1b; kk++; break; case ',': inserts.charInserts[inserts.numChars++] = ','; kk++; break; case 'x': case 'X': inserts.charInserts[inserts.numChars++] = hexValue (nested, &oneIns[kk + 1], 4); kk += 5; break; case 'y': case 'Y': if (CHARSIZE == 2) { not32: semanticError (nested, "liblouisutdml has not been compiled for 32-bit Unicode"); break; } if (oneLength - k > 5) { inserts.charInserts[inserts.numChars++] = hexValue (nested, &oneIns[k + 1], 5); k += 6; } break; case 'z': case 'Z': if (CHARSIZE == 2) goto not32; if (oneLength - k > 8) { inserts.charInserts[inserts.numChars++] = hexValue (nested, &oneIns[k + 1], 8); k += 9; } break; case '*': kk++; sizeInsert--; break; default: kk++; semanticError (nested, "invalid escape sequence."); break; } else inserts.charInserts[inserts.numChars++] = ch; sizeInsert++; } inserts.charInserts[startInsert] = sizeInsert + 1; oneIns = &insertions[k + 1]; prevk = k + 1; } k++; } insertsSize += inserts.numChars * CHARSIZE; insertsPtr = malloc (insertsSize); if (!insertsPtr) memoryError (); memcpy (insertsPtr, &inserts, insertsSize); return insertsPtr; } static int insertFromMacro (int which); int insert_code (xmlNode * node, int which) { int entryStart; widechar *insertStart; int insertLength = 0; int k; int sumLength; InsertsType *inserts; HashEntry *nodeEntry; if (node == NULL) return 0; nodeEntry = (HashEntry *) node->_private; if (nodeEntry == NULL) return 0; if (nodeEntry->macro) { insertFromMacro (which); return 1; } if (nodeEntry->inserts == NULL) return 1; inserts = nodeEntry->inserts; if (which == -1) { if ((entryStart = inserts->lastInsert) == 0) return 1; insertStart = &inserts->charInserts[entryStart + 1]; insertLength = inserts->charInserts[entryStart] - 1; } else { if (inserts->numInserts == 0 || inserts->numInserts < which || (which == 1 && inserts->numInserts == 1)) return 1; sumLength = 1; for (k = 0; k < which; k++) sumLength += inserts->charInserts[sumLength]; insertStart = &inserts->charInserts[sumLength + 1]; insertLength = inserts->charInserts[sumLength] - 1; if (insertLength <= 0) return 0; } if ((ud->text_length + insertLength) > MAX_LENGTH) return 0; memcpy (&ud->text_buffer[ud->text_length], insertStart, CHARSIZE * insertLength); ud->text_length += insertLength; return 1; } #define NUMCOUNTS 1024 #define MAXNUMVAL 5 static int *attrValueCounts = NULL; static HashTable *attrValueCountsTable; static int countAttrValues (xmlChar * key) { int k; int numItems = 1; int lastComma = 0; static int curCount = 0; int thisCount = notFound; if (!ud->new_entries) return 0; if (attrValueCounts == NULL) { attrValueCounts = malloc (NUMCOUNTS * sizeof (int)); if (!attrValueCounts) memoryError (); attrValueCountsTable = hashNew (); curCount = 0; } for (k = 0; key[k]; k++) if (key[k] == ',') { lastComma = k; numItems++; } switch (numItems) { case 1: return 1; case 2: if (hashLookup (attrValueCountsTable, key) != notFound) return 1; if (curCount >= NUMCOUNTS) return 0; hashInsert (attrValueCountsTable, key, 0, curCount, NULL, NULL, NULL); curCount++; return 1; case 3: if (curCount >= NUMCOUNTS) return 0; key[lastComma] = 0; thisCount = hashLookup (attrValueCountsTable, key); if (thisCount == notFound) { attrValueCounts[curCount]++; hashInsert (attrValueCountsTable, key, 0, curCount, NULL, NULL, NULL); curCount++; } key[lastComma] = ','; if (thisCount == notFound) return 1; if (attrValueCounts[thisCount] >= MAXNUMVAL) return 0; attrValueCounts[thisCount]++; return 1; default: return 0; } return 0; } static void destroyattrValueCountsTable () { if (attrValueCounts == NULL) return; hashFree (attrValueCountsTable); free (attrValueCounts); attrValueCounts = NULL; } static int sem_compileFile (const char *fileName); int find_group_length (const char groupSym[2], const char *groupStart) { int level = 0; int k; if (*groupStart != groupSym[0]) return -1; for (k = 0; groupStart[k]; k++) { if (groupStart[k] == groupSym[0]) level++; if (groupStart[k] == groupSym[1]) level--; if (level == 0) return k + 1; } return -1; } static int compileLine (FileInfo * nested) { char *curchar = NULL; int ch = 0; int func = 0; char *funcName; int funcNameLength; char *argsStart; int argsLength; EntryType type = 0; char *action = NULL; int actionLength = 0; char *lookFor = NULL; int lookForLength = 0; char *insertions = NULL; int insertionsLength = 0; InsertsType *inserts = NULL; unsigned char *macro = NULL; StyleType *style = NULL; int actionNum = 0; if (semanticTable == NULL) semanticTable = hashNew (); curchar = nested->line; while ((ch = *curchar++) <= 32 && ch != 0); if (ch == 0 || ch == '#' || ch == '<') return 1; action = curchar - 1; while ((ch = *curchar++) > 32 || ch == '='); actionLength = curchar - action - 1; action[actionLength] = 0; if (!(actionLength == 2 && action[0] == 'n' && action[1] == 'o')) nested->unedited = 0; while (((ch = *curchar++) <= 32 || ch == '=') && ch != 0); if (ch == 0) { semanticError (nested, "Nothing to look for"); return 0; } lookFor = curchar - 1; if (*lookFor == '&') { /*xpath or other special case */ static const char *funcNames[] = { "xpath", "1", "now", "2", NULL }; while ((ch = *curchar++) <= 32 && ch != 0); funcName = curchar - 1; while ((ch = *curchar++) > 32 && ch != '('); funcNameLength = curchar - funcName - 1; funcName[funcNameLength] = 0; func = find_action (funcNames, funcName); if (func < 0) { semanticError (nested, "function name '%s' in column 2 not recognized", funcName); return 0; } } if (!(func == 0 || func == 2)) { funcName[funcNameLength] = ch; if (ch != '(') while ((ch = *curchar++) <= 32 && ch != 0); argsStart = curchar - 1; argsLength = find_group_length ("()", argsStart); if (argsLength < 0) { semanticError (nested, "unmatched parentheses in column 2 '%s'", lookFor); return 0; } switch (func) { case 1: type |= xpathEntry; break; default: break; } lookFor = argsStart; *lookFor = '&'; lookForLength = argsLength - 1; curchar = &lookFor[argsLength]; } else { while (*curchar++ > 32); lookForLength = curchar - lookFor - 1; } lookFor[lookForLength] = 0; actionNum = find_semantic_number (action); style = lookup_style (action); macro = lookup_macro (action); if (actionNum == notFound && style == NULL && macro == NULL) { semanticError (nested, "Action or style or macro '%s' in column 1 not recognized", action); return 0; } if (actionNum > end_all) { /* Handle pseudo actions */ switch (actionNum) { case end_all + 1: /*include */ if (!sem_compileFile (lookFor)) return 0; break; case end_all + 2: /*newentries */ ud->doc_new_entries = 0; break; case end_all + 3: registerNamespaces (nested, xpathCtx, lookFor); break; default: break; } return 1; } if (hashLookup (semanticTable, (xmlChar *) lookFor) != notFound) { if (ud->debug) semanticError (nested, "duplicate entry '%s' in column 2", lookFor); return 1; } countAttrValues ((xmlChar *) lookFor); inserts = NULL; while ((ch = *curchar++) <= 32 && ch != 0); if (ch != 0) { insertions = curchar - 1; while (*curchar++ > 32); insertionsLength = curchar - insertions - 1; insertions[insertionsLength] = 0; inserts = encodeInsertions (nested, (xmlChar *) insertions, insertionsLength); } if (insertionsLength == 0 && (actionNum == configfile || actionNum == configstring)) { semanticError (nested, "This semantic action requires a third column."); return 0; } if (actionNum < 0) actionNum = generic; if (func == 2) { int k; int kk = 0; char configString[2 * MAXNAMELEN]; switch (actionNum) { case configfile: if (!find_file (insertions, configString)) return 0; config_compileSettings (configString); break; case configstring: configString[kk++] = ud->string_escape; for (k = 0; k < insertionsLength; kk++) { if (insertions[k] == '=') configString[kk++] = ' '; else if (insertions[k] == ';') configString[kk++] = '\n'; else configString[kk++] = (char) insertions[k]; } configString[kk] = 0; config_compileSettings (configString); break; default: semanticError (nested, "The 'now' option is not valid with this semantic action."); return 0; } } else { hashInsert (semanticTable, (xmlChar *) lookFor, type, actionNum, inserts, style, macro); nested->numEntries++; } return 1; } static int getALine (FileInfo * nested) { /*Read a line of chars from an input file */ int ch; int pch = 0; int numchars = 0; memset (nested->line, 0, sizeof (nested->line)); while ((ch = fgetc (nested->in)) != EOF) { if (ch == 13) continue; if (pch == '\\' && ch == 10) { numchars--; continue; } if (ch == 10 || numchars >= sizeof (nested->line)) break; nested->line[numchars++] = ch; pch = ch; } if (ch == EOF) return 0; return 1; } static int numEntries = 0; static int sem_compileFile (const char *fileName) { /*Compile an input file */ FileInfo nested; char completePath[MAXNAMELEN]; int haveAppended = 0; if (!*fileName) return 1; /*Probably run with defaults */ if (strncmp (fileName, "appended_", 9) == 0) { strcpy (completePath, lbu_getWriteablePath ()); strcat (completePath, fileName); if (file_exists (completePath)) haveAppended = 1; else return 1; } if (!haveAppended && !find_file (fileName, completePath)) { semanticError (NULL, "Can't find semantic-action file '%s'", fileName); haveSemanticFile = 0; strcpy (firstFileName, fileName); return 0; } memset (&nested, 0, sizeof (nested)); nested.fileName = fileName; nested.unedited = 1; if ((nested.in = fopen ((char *) completePath, "rb"))) { while (getALine (&nested)) { nested.lineNumber++; compileLine (&nested); } fclose (nested.in); if (nested.unedited) semanticError (NULL, "File '%s' needs editing to produce good results.", nested.fileName); } else { semanticError (NULL, "Can't open semantic-action file '%s'", fileName); return 0; } numEntries += nested.numEntries; return 1; } static void getRootName (xmlNode * rootElement, char *fileName) { char *curchar = NULL; rootName = rootElement->name; strcpy (fileName, (char *) rootName); curchar = fileName; while (*curchar) { if (*curchar == ':' || *curchar == '/' || *curchar == ',' || *curchar == '\\' || *curchar == 34 || *curchar == 39 || *curchar == '(' || *curchar == ')' || *curchar < 33 || *curchar > 126) *curchar = '_'; curchar++; } strcat (fileName, ".sem"); } static int moreEntries = 0; int compile_semantic_table (xmlNode * rootElement) { char fileName[MAXNAMELEN]; attrValueCounts = NULL; haveSemanticFile = 1; ud->doc_new_entries = 1; moreEntries = 0; numEntries = 0; rootName = rootElement->name; xpathCtx = xmlXPathNewContext (rootElement->doc); if (ud->semantic_files != NULL) { /*Process file list */ int listLength; int currentListPos; int k; listLength = strlen (ud->semantic_files); firstFileName[0] = 0; for (k = 0; k < listLength; k++) if (ud->semantic_files[k] == ',') break; if (k == listLength) { /* Only one file */ if (ud->semantic_files[0] == '*') getRootName (rootElement, fileName); else strcpy (fileName, ud->semantic_files); if (!sem_compileFile (fileName)) return (haveSemanticFile = 0); strcpy (firstFileName, fileName); } else { /* Compile a list of files */ strncpy (fileName, ud->semantic_files, k); fileName[k] = 0; if (fileName[0] == '*') getRootName (rootElement, fileName); if (!sem_compileFile (fileName)) return (haveSemanticFile = 0); strcpy (firstFileName, fileName); currentListPos = k + 1; while (currentListPos < listLength) { for (k = currentListPos; k < listLength; k++) if (ud->semantic_files[k] == ',') break; strncpy (fileName, &ud->semantic_files[currentListPos], k - currentListPos); fileName[k - currentListPos] = 0; if (fileName[0] == '*') getRootName (rootElement, fileName); if (!sem_compileFile (fileName)) return (haveSemanticFile = 0); currentListPos = k + 1; } } } else { getRootName (rootElement, fileName); strcpy (firstFileName, fileName); if (!sem_compileFile (fileName)) return (haveSemanticFile = 0); } strcpy (fileName, "appended_"); strcat (fileName, firstFileName); sem_compileFile (fileName); if (numEntries == 0) { destroy_semantic_table (); return (haveSemanticFile = 0); } return 1; } static void addNewEntries (const xmlChar * key); /** * registerNamespaces: * @xpathCtx: the pointer to an XPath context. * @nsList: the list of known namespaces in * "= =href2> ..." format. * * Registers namespaces from @nsList in @xpathCtx. * * Returns 1 on success and 0 on failure. */ static int registerNamespaces (FileInfo * nested, xmlXPathContextPtr xpathCtx, const xmlChar * nsList) { xmlChar *nsListDup; xmlChar *prefix; xmlChar *href; xmlChar *next; nsListDup = xmlStrdup (nsList); if (nsListDup == NULL) { semanticError (nested, "Error: unable to strdup namespaces list"); return 0; } next = nsListDup; while (next != NULL) { if ((*next) == '\0') break; /* find prefix */ prefix = next; next = (xmlChar *) xmlStrchr (next, '='); if (next == NULL) { semanticError (nested, "Error: invalid namespaces list format"); xmlFree (nsListDup); return 0; } *(next++) = '\0'; /* find href */ href = next; next = (xmlChar *) xmlStrchr (next, ','); if (next != NULL) { *(next++) = '\0'; } /* do register namespace */ if (xmlXPathRegisterNs (xpathCtx, prefix, href) != 0) { semanticError (nested, "Error: unable to register NS with prefix=\"%s\" and href=\"%s\"", prefix, href); xmlFree (nsListDup); return 0; } } xmlFree (nsListDup); return 1; } static void printXpathNodes (xmlNodeSetPtr nodes) { xmlNodePtr cur; int size; int i; size = (nodes) ? nodes->nodeNr : 0; semanticError (NULL, "Result (%d nodes):", size); for (i = 0; i < size; ++i) { if (nodes->nodeTab[i]->type == XML_NAMESPACE_DECL) { xmlNsPtr ns; ns = (xmlNsPtr) nodes->nodeTab[i]; cur = (xmlNodePtr) ns->next; if (cur->ns) { semanticError (NULL, "= namespace \"%s\"=\"%s\" for node %s:%s", ns->prefix, ns->href, cur->ns->href, cur->name); } else { semanticError (NULL, "= namespace \"%s\"=\"%s\" for node %s", ns->prefix, ns->href, cur->name); } } else if (nodes->nodeTab[i]->type == XML_ELEMENT_NODE) { cur = nodes->nodeTab[i]; if (cur->ns) { semanticError (NULL, "= element node \"%s:%s\"", cur->ns->href, cur->name); } else { semanticError (NULL, "= element node \"%s\"", cur->name); } } else { cur = nodes->nodeTab[i]; semanticError (NULL, "= node \"%s\": type %d", cur->name, cur->type); } } } int do_xpath_expr () { xmlXPathObject *xpathObj; HashEntry *curEntry; while ((curEntry = hashScan (semanticTable))) { if (curEntry->type & xpathEntry) { xmlNodeSet *nodeSet; xmlNode *node; int size; int k; xpathObj = xmlXPathEvalExpression (&curEntry->key[1], xpathCtx); if (xpathObj == NULL || xpathObj->type != XPATH_NODESET) continue; nodeSet = xpathObj->nodesetval; if (ud->debug) printXpathNodes (nodeSet); size = (nodeSet) ? nodeSet->nodeNr : 0; for (k = 0; k < size; k++) { node = nodeSet->nodeTab[k]; if (node->_private == NULL) node->_private = curEntry; } xmlXPathFreeObject (xpathObj); } } return 1; } sem_act set_sem_attr (xmlNode * node) { sem_act action = no; int actionNum = notFound; xmlChar key[MAXNAMELEN]; int k; int oldKeyLength = 0; const xmlChar *name; if (semanticTable == NULL) return no; if (node->_private != NULL) return get_sem_attr (node); if (node->type == XML_CDATA_SECTION_NODE) name = (xmlChar *) "cdata-section"; else name = node->name; if (node->properties) { xmlAttr *attributes = node->properties; while (attributes) { const xmlChar *attrName = attributes->name; xmlChar *attrValue = xmlGetProp (node, attrName); strcpy ((char *) key, (char *) name); strcat ((char *) key, ","); strcat ((char *) key, (char *) attrName); strcat ((char *) key, ","); oldKeyLength = strlen ((char *) key); strncat ((char *) key, (char *) attrValue, sizeof (key) - oldKeyLength - 2); for (k = 0; key[k]; k++) if ((key[k] <= 32 || key[k] > 126) || (k >= oldKeyLength && key[k] == ',')) key[k] = '_'; actionNum = notFound; if (((actionNum = hashLookup (semanticTable, key)) != notFound) || countAttrValues (key)) { if (actionNum == notFound) addNewEntries (key); } if (actionNum == notFound || actionNum == no) { key[oldKeyLength - 1] = 0; actionNum = hashLookup (semanticTable, key); if (actionNum == notFound) addNewEntries (key); else if (actionNum == no) actionNum = notFound; } if (actionNum != notFound && actionNum != no) break; attributes = attributes->next; } } if (actionNum == notFound) { strcpy ((char *) key, (char *) name); actionNum = hashLookup (semanticTable, key); } if (actionNum == notFound) addNewEntries (name); else action = actionNum; node->_private = latestEntry; return action; } sem_act get_sem_attr (xmlNode * node) { HashEntry *nodeEntry = (HashEntry *) node->_private; if (nodeEntry != NULL) return nodeEntry->semNum; else return no; } unsigned char * get_sem_name (xmlNode * node) { int k; static char key[50]; HashEntry *nodeEntry = (HashEntry *) node->_private; if (nodeEntry == NULL) return ""; if (nodeEntry->macro != NULL) { char *macro = nodeEntry->macro; strcpy (key, "macro,"); for (k = 0; macro[k] != ','; k++); k--; strncat (key, macro, k); } else if (nodeEntry->style != NULL) { strcpy (key, "style,"); strcat (key, nodeEntry->style->name); } else { strcpy (key, "action,"); strcat (key, semNames[nodeEntry->semNum]); } return key; } StyleType * is_style (xmlNode * node) { HashEntry *nodeEntry = (HashEntry *) node->_private; if (nodeEntry != NULL) return nodeEntry->style; else return NULL; } xmlChar * get_attr_value (xmlNode * node) { int firstComma = 0, secondComma = 0; int k; xmlChar attrName[MAXNAMELEN]; HashEntry *nodeEntry = (HashEntry *) node->_private; if (nodeEntry == NULL || !node->properties) return (xmlChar *) ""; for (k = 0; nodeEntry->key[k]; k++) if (!firstComma && nodeEntry->key[k] == ',') firstComma = k; else if (firstComma && nodeEntry->key[k] == ',') secondComma = k; if (firstComma == 0) return (xmlChar *) ""; if (secondComma == 0) secondComma = strlen ((char *) nodeEntry->key); k = 0; firstComma++; while (firstComma < secondComma) attrName[k++] = nodeEntry->key[firstComma++]; attrName[k] = 0; return xmlGetProp (node, attrName); } void shortenStack () { int k; int kk = 0; for (k = ud->top / 2; k <= ud->top; k++) ud->stack[kk++] = ud->stack[k]; ud->top = kk - 1; } sem_act push_sem_stack (xmlNode * node) { if (ud->top < -1) ud->top = -1; if (ud->top > (STACKSIZE - 3)) shortenStack (); return (ud->stack[++ud->top] = get_sem_attr (node)); } sem_act push_action (sem_act action) { if (ud->top < -1) ud->top = -1; if (ud->top > (STACKSIZE - 3)) shortenStack (); return (ud->stack[++ud->top] = action); } sem_act pop_sem_stack () { if (ud->top < 0) { ud->top = -1; ud->stack[++ud->top] = no; return no; } ud->top--; if (ud->top > -1) return ud->stack[ud->top]; return no; } static void addNewEntries (const xmlChar * newEntry) { if (newEntry == NULL || *newEntry == 0 || !ud->new_entries || !ud->doc_new_entries) return; if (moreEntries == 0) { moreEntries = 1; newEntriesTable = hashNew (); } if (hashLookup (newEntriesTable, newEntry) != notFound) return; hashInsert (newEntriesTable, newEntry, 0, 0, NULL, NULL, NULL); } void append_new_entries () { int items; char filePrefix[20]; char fileMode[8]; char outFileName[MAXNAMELEN]; FILE *semOut; int numEntries = 0; destroyattrValueCountsTable (); if (!moreEntries || !*firstFileName) return; if (haveSemanticFile) { strcpy (fileMode, "ab"); strcpy (filePrefix, "appended_"); } else { strcpy (fileMode, "wb"); strcpy (filePrefix, "new_"); } strcpy (outFileName, lbu_getWriteablePath ()); strcat (outFileName, filePrefix); strcat (outFileName, firstFileName); semOut = fopen ((char *) outFileName, fileMode); if (!haveSemanticFile) { fprintf (semOut, "# This file was produced by liblouisutdml and is considered part of\n"); fprintf (semOut, "# the code, licensed under the GNU Lesser or Library Public License.\n\n"); fprintf (semOut, "# You must edit this file as explained in the documentation to get\n"); fprintf (semOut, "# proper output.\n\n"); } for (items = 1; items < 4; items++) { HashEntry *curEntry; int k; while ((curEntry = hashScan (newEntriesTable))) { int numItems = 1; for (k = 0; curEntry->key[k]; k++) if (curEntry->key[k] == ',') numItems++; if (numItems != items) continue; fprintf (semOut, "no %s\n", curEntry->key); numEntries++; } } fclose (semOut); if (haveSemanticFile) lou_logPrint ("%d new entries appended to '%s%s'.", numEntries, filePrefix, firstFileName); else lou_logPrint ("%d entries written to new semantic-action file '%s%s'.", numEntries, filePrefix, firstFileName); moreEntries = 0; } void do_reverse (xmlNode * node) { xmlNode *child = node->children; xmlNode *curNext; xmlNode *curPrev; if (!child || !child->next) return; while (child) { curNext = child->next; curPrev = child->prev; if (curNext == NULL) node->children = child; child->next = curPrev; child->prev = curNext; child = curNext; } } #define STYLESUF " elyts" StyleType * new_style (xmlChar * name) { char key[MAXNAMELEN]; StyleType *style; if (!semanticTable) semanticTable = hashNew (); strcpy (key, name); strcat (key, STYLESUF); if (hashLookup (semanticTable, key) != notFound) return latestEntry->style; style = malloc (sizeof (StyleType) + strlen (name) + 3); if (!style) memoryError (); memset (style, 0, sizeof (StyleType)); strcpy (style->name, name); style->newline_after = 1; hashInsert (semanticTable, key, styleEntry, 0, NULL, style, NULL); style->format = inherit; /* inherit parent format by default */ style->right_margin = -100; style->left_margin = -100; style->first_line_indent = -100; return style; } StyleType * lookup_style (xmlChar * name) { char key[MAXNAMELEN]; strcpy (key, name); strcat (key, STYLESUF); if (hashLookup (semanticTable, key) != notFound) return latestEntry->style; return NULL; } StyleType * action_to_style (sem_act action) { if (action < 0 || action >= end_all) return NULL; return lookup_style ((char *) semNames[action]); } /* Beginning of macro processing */ /* Hold macro state */ static char macroName[40]; static char *macro = NULL; static int macroLength = 0; static int posInMacro;; static xmlNode *macroNode; static HashEntry *isMacroEntry; static int macroHasStyle; static char *paramStart = NULL; static int paramLength = 0; static void macroError (char *format, ...) { char buffer[MAXNAMELEN]; va_list arguments; va_start (arguments, format); #ifdef WIN32 _vsnprintf (buffer, sizeof (buffer), format, arguments); #else vsnprintf (buffer, sizeof (buffer), format, arguments); #endif va_end (arguments); lou_logPrint ("Macro %s: %s", macroName, buffer); } char * is_macro (xmlNode * node) { HashEntry *nodeEntry = (HashEntry *) node->_private; if (nodeEntry != NULL) return nodeEntry->macro; else return NULL; } #define MACROSUF " orcam" unsigned char * lookup_macro (xmlChar * name) { char key[MAXNAMELEN]; strcpy (key, name); strcat (key, MACROSUF); if (hashLookup (semanticTable, key) != notFound) return latestEntry->macro; return NULL; } xmlChar * new_macro (xmlChar * name, xmlChar * body) { char *storedMacro; char key[MAXNAMELEN]; xmlChar *nameAndBody = (xmlChar *) ud->text_buffer; strcpy (nameAndBody, name); strcat (nameAndBody, ","); strcat (nameAndBody, body); storedMacro = alloc_string (nameAndBody); if (!semanticTable) semanticTable = hashNew (); strcpy (key, name); strcat (key, MACROSUF); if (hashLookup (semanticTable, key) != notFound) return NULL; hashInsert (semanticTable, key, macroEntry, 0, NULL, NULL, storedMacro); return storedMacro; } static int insertFromMacro (int which) { return 1; } static int doSemanticActions () { int retVal = 1; int semNum = atoi (¯o[posInMacro]); for (; isdigit (macro[posInMacro]) && posInMacro < macroLength; posInMacro++); if (macro[posInMacro] == '(') { paramStart = ¯o[++posInMacro]; paramLength = find_group_length ("()", paramStart - 1); posInMacro += paramLength; paramLength -= 2; } switch (semNum) { case no: if (ud->text_length > 0 && ud->text_length < MAX_LENGTH && ud->text_buffer[ud->text_length - 1] > 32) ud->text_buffer[ud->text_length++] = 32; break; case skip: retVal = -1; break; case markhead: ud->head_node = macroNode; break; case pagebreak: do_pagebreak (macroNode); break; case attrtotext: do_attrtotext (macroNode); break; case configtweak: { int k; int kk = 0; xmlChar configString[2 * MAXNAMELEN]; configString[kk++] = ud->string_escape; for (k = 0; k < paramLength; k++) { if (paramStart[k] == '=') configString[kk++] = ' '; else if (paramStart[k] == ';') configString[kk++] = '\n'; else configString[kk++] = (xmlChar) paramStart[k]; } configString[kk++] = '\n'; configString[kk] = 0; if (!config_compileSettings ((char *) configString)) return 0; } ud->main_braille_table = ud->contracted_table_name; if (!lou_getTable (ud->main_braille_table)) { lou_logPrint ("Cannot open main table %s", ud->main_braille_table); return 0; } break; case htmllink: if (ud->format_for != browser) break; insert_linkOrTarget (macroNode, 0); break; case htmltarget: if (ud->format_for != browser) break; insert_linkOrTarget (macroNode, 1); break; case boxline: do_boxline (macroNode); break; case blankline: do_blankline (); break; case linespacing: do_linespacing (macroNode); break; case softreturn: do_softreturn (); break; case righthandpage: do_righthandpage (); break; case code: transcribe_computerCode (macroNode, 0); break; case math: transcribe_math (macroNode, 0); break; case graphic: transcribe_graphic (macroNode, 0); break; case chemistry: transcribe_chemistry (macroNode, 0); break; case music: transcribe_music (macroNode, 0); break; case changetable: change_table (macroNode); break; case pagenum: do_pagenum (); break; case italicx: push_action (italicx); break; case boldx: push_action (boldx); break; case underlinex: push_action (underlinex); break; case compbrl: push_action (compbrl); break; default: macroError ("semantic action %s is not supported in a macro", semNames[semNum]); retVal = 0; } return retVal; } static int compileMacro () { xmlChar compiledMacro[4 * MAXNAMELEN]; int unPos = 0; int pos = 0; memset (compiledMacro, 0, sizeof (compiledMacro)); while (unPos < macroLength) { if (isalpha (macro[unPos])) { char name[40]; int k; StyleType *style; for (k = 0; isalnum (macro[unPos]) && unPos < macroLength; unPos++) name[k++] = macro[unPos]; name[k] = 0; if ((style = lookup_style (name)) != NULL) { if (macroHasStyle) { macroError ("only one style can be specified"); compiledMacro[0] = '!'; break; } else { macroHasStyle = 1; compiledMacro[pos++] = '~'; isMacroEntry->style = style; } } else { if ((k = find_semantic_number (name)) != notFound) { k = sprintf (name, "%d", k); strcpy (&compiledMacro[pos], name); pos += k; if (macro[unPos] == '(') { k = find_group_length ("()", ¯o[unPos]); strncpy (&compiledMacro[pos], ¯o[unPos], k); pos += k; unPos += k; } } else if (strcmp (name, "styleend") == 0) compiledMacro[pos++] = '@'; else if (strcmp (name, "pause") == 0) compiledMacro[pos++] = '#'; else { macroError ("'%s' is neither a style or semantic action or keyword", name); compiledMacro[0] = '!'; break; } } } if (macro[unPos] == ',') compiledMacro[pos++] = macro[unPos++]; } compiledMacro[pos] = 0; strcpy (macro, compiledMacro); macroLength = pos; return 1; } static int executeMacro () { while (posInMacro < macroLength) { if (isdigit (macro[posInMacro])) doSemanticActions (); else switch (macro[posInMacro]) { case ',': posInMacro++; break; case '~': start_style (isMacroEntry->style, macroNode); macroHasStyle = 1; posInMacro++; break; case '@': end_style (); macroHasStyle = 0; posInMacro++; break; case '#': /* Pause for calling function to do something. */ posInMacro++; return 1; default: posInMacro++; break; } } if (posInMacro >= macroLength) { if (macroHasStyle) end_style (); macro = NULL; } } int start_macro (xmlNode * node) { /* Set macro state */ int k; macroNode = node; isMacroEntry = (HashEntry *) node->_private; if (isMacroEntry == NULL || isMacroEntry->macro == NULL) return 0; macro = isMacroEntry->macro; for (k = 0; macro[k] != ','; k++) macroName[k] = macro[k]; macroName[k] = 0; if (macroLength != 0) { macroError ("macros cannot be nested"); return 0; } macro = ¯o[k + 1]; macroLength = strlen (macro); posInMacro = 0; macroHasStyle = 0; paramStart = NULL; paramLength = 0; /*compile macro the first time it is used. */ if (isalpha (macro[0])) compileMacro (); if (macro[0] == '!') /* Contains errors */ return 0; executeMacro (); return macroHasStyle; } int end_macro () { if (macro == NULL || macro[0] == '!') { macroLength = 0; return 0; } executeMacro (); macroLength = 0; return 1; } /* End of macro processing */ liblouisutdml-2.5.0/liblouisutdml/makeContents.c0000664000076500007650000002364012206715331017037 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and Abilitiessoft, Inc. www.abilitiessoft.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #include #include #include #include "louisutdml.h" #define MAXHEADINGSIZE 4 * MAXNAMELEN extern void widecharcpy (widechar * to, const widechar * from, int length); extern void widestrcpy (widechar * to, const widechar * from); typedef struct { void *next; sem_act action; int headingLength; widechar headingChars[MAXHEADINGSIZE]; } SaveHeading; static SaveHeading heading; static SaveHeading *firstHeading; static SaveHeading *lastHeading; static FILE *saved_outFile; static FILE *tempFile; static char tempFileName[MAXNAMELEN]; static int saved_udContents; static int saved_linesOnPage; static int saved_braillePageNumber; static widechar saved_printPageNumber[MAXNUMLEN]; static widechar saved_printPageNumberFirst[MAXNUMLEN]; static widechar saved_printPageNumberLast[MAXNUMLEN]; static widechar saved_pageSeparatorNumberFirst[MAXNUMLEN]; static widechar saved_pageSeparatorNumberLast[MAXNUMLEN]; static int saved_runningHeadLength; static int saved_footerLength; static widechar saved_runningHead[MAXNAMELEN / 2]; static widechar saved_footer[MAXNAMELEN / 2]; static BrlPageNumFormat saved_braillePageNumberFormat; static StyleRecord *styleSpec; static SaveHeading *saved_firstHeading; static SaveHeading *saved_lastHeading; static void free_headings (SaveHeading *start); int initialize_contents (void) { saved_braillePageNumberFormat = ud->brl_page_num_format; widestrcpy (saved_printPageNumber, ud->print_page_number); widestrcpy (saved_printPageNumberFirst, ud->print_page_number_first); widestrcpy (saved_printPageNumberLast, ud->print_page_number_last); widestrcpy (saved_pageSeparatorNumberFirst, ud->page_separator_number_first); widestrcpy (saved_pageSeparatorNumberLast, ud->page_separator_number_last); saved_runningHeadLength = ud->running_head_length; saved_footerLength = ud->footer_length; widecharcpy (saved_runningHead, ud->running_head, ud->running_head_length); widecharcpy (saved_footer, ud->footer, ud->footer_length); ud->after_contents = 1; saved_udContents = ud->contents; saved_linesOnPage = ud->lines_on_page; saved_braillePageNumber = ud->braille_page_number; ud->contents = 1; firstHeading = NULL; lastHeading = NULL; saved_lastHeading = NULL; saved_firstHeading = NULL; saved_outFile = ud->outFile; strcpy (tempFileName, lbu_getWriteablePath ()); strcat (tempFileName, "lbx_body.temp"); if (!(tempFile = fopen (tempFileName, "w"))) { lou_logPrint ("Can't open temporary file.\n"); return 0; } ud->outFile = tempFile; ud->lines_on_page = 0; if (ud->has_contentsheader) ud->braille_page_number = ud->beginning_braille_page_number; else ud->braille_page_number = 1; return 1; } int start_heading (sem_act action, widechar * translatedBuffer, int translatedLength) { int k; if (!(ud->contents && (action == heading1 || action == heading2 || action == heading3 || action == heading4 || action == heading5 || action == heading6 || action == heading7 || action == heading8 || action == heading9 || action == heading10 || action == contentsheader))) return 1; if (translatedLength > 3 * MAXNAMELEN) translatedLength = 3 * MAXNAMELEN; heading.action = action; heading.headingLength = 0; for (k = 0; k < translatedLength; k++) heading.headingChars[heading.headingLength++] = translatedBuffer[k]; return 1; } int finish_heading (sem_act action) { int k; int headingSize = sizeof (heading) - MAXHEADINGSIZE * CHARSIZE; int initHeadingLength = heading.headingLength; SaveHeading *headingPtr; if (!(ud->contents && (action == heading1 || action == heading2 || action == heading3 || action == heading4 || action == heading5 || action == heading6 || action == heading7 || action == heading8 || action == heading9 || action == heading10 || action == contentsheader))) return 1; heading.next = NULL; if (action != contentsheader) { if (ud->print_pages && ud->print_page_numbers_in_contents && *ud->print_page_number != '_') { heading.headingChars[heading.headingLength++] = ' '; if (ud->print_page_number[0] != '+' && ud->print_page_number[0] != ' ') heading.headingChars[heading.headingLength++] = ud->print_page_number[0]; k = 1; while (ud->print_page_number[k]) heading.headingChars[heading.headingLength++] = ud->print_page_number[k++]; } if (ud->braille_pages && ud->braille_page_numbers_in_contents && *ud->braille_page_string) { if (ud->print_pages && ud->print_page_numbers_in_contents && *ud->print_page_number != '_') heading.headingChars[heading.headingLength++] = 0xa0; else heading.headingChars[heading.headingLength++] = ' '; k = 0; while (ud->braille_page_string[k]) heading.headingChars[heading.headingLength++] = ud->braille_page_string[k++]; } } if (initHeadingLength == heading.headingLength) /* No page numbers */ heading.headingChars[heading.headingLength++] = 0xa0; headingSize += heading.headingLength * CHARSIZE; headingPtr = malloc (headingSize); memcpy (headingPtr, &heading, headingSize); if (lastHeading != NULL) lastHeading->next = headingPtr; lastHeading = headingPtr; if (firstHeading == NULL) firstHeading = headingPtr; return 1; } int make_contents (void) { SaveHeading *currentHeading = NULL; int old_braillePageNumber; sem_act action; int bytesRead; StyleType *style; if (!ud->contents) return 1; old_braillePageNumber = ud->braille_page_number; fclose (tempFile); ud->outFile = saved_outFile; if (firstHeading != NULL) { ud->lines_on_page = saved_linesOnPage; ud->braille_page_number = saved_braillePageNumber; styleSpec = &ud->style_stack[ud->style_top]; styleSpec->curBrlNumFormat = saved_braillePageNumberFormat; ud->brl_page_num_format = saved_braillePageNumberFormat; widestrcpy (ud->print_page_number, saved_printPageNumber); widestrcpy (ud->print_page_number_first, saved_printPageNumberFirst); widestrcpy (ud->print_page_number_last, saved_printPageNumberLast); widestrcpy (ud->page_separator_number_first, saved_pageSeparatorNumberFirst); widestrcpy (ud->page_separator_number_last, saved_pageSeparatorNumberLast); ud->running_head_length = saved_runningHeadLength; ud->footer_length = saved_footerLength; widecharcpy (ud->running_head, saved_runningHead, ud->running_head_length); widecharcpy (ud->footer, saved_footer, ud->footer_length); do_newpage (); ud->contents = 2; currentHeading = firstHeading; while (currentHeading != NULL) { switch (currentHeading->action) { case contentsheader: default: action = currentHeading->action; break; case heading1: action = contents1; break; case heading2: action = contents2; break; case heading3: action = contents3; break; case heading4: action = contents4; break; case heading5: action = contents5; break; case heading6: action = contents6; break; case heading7: action = contents7; break; case heading8: action = contents8; break; case heading9: action = contents9; break; case heading10: action = contents10; break; } style = action_to_style (action); start_style (style, NULL); memcpy (ud->translated_buffer, currentHeading->headingChars, currentHeading->headingLength * CHARSIZE); ud->translated_length = currentHeading->headingLength; ud->in_sync = 0; end_style (style); currentHeading = currentHeading->next; } do_newpage (); ud->prelim_pages = ud->braille_page_number; ud->braille_page_number = saved_braillePageNumber; free_headings (firstHeading); firstHeading = NULL; ud->contents = saved_udContents; ud->braille_page_number = old_braillePageNumber; } if (!(tempFile = fopen (tempFileName, "r"))) { lou_logPrint ("Can't open temporary file.\n"); return 0; } do { bytesRead = fread (ud->translated_buffer, 1, sizeof (ud->translated_buffer), tempFile); fwrite (ud->translated_buffer, 1, bytesRead, ud->outFile); } while (bytesRead != 0); fclose (tempFile); return 1; } void contents_save_state () { saved_firstHeading = firstHeading; saved_lastHeading = lastHeading; } void contents_restore_state () { firstHeading = saved_firstHeading; lastHeading = saved_lastHeading; if (lastHeading != NULL) { free_headings (lastHeading->next); lastHeading->next = NULL; } } static void free_headings (SaveHeading *start) { SaveHeading *current; SaveHeading *next; if (start == NULL) return; current = start; while ((next = current->next) != NULL) { free(current); current = next; } } liblouisutdml-2.5.0/liblouisutdml/transcribe_cdataSection.c0000664000076500007650000000364712054461273021232 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" int transcribe_cdataSection (xmlNode * node) { switch (get_sem_attr (node)) { case no: insert_utf8 (node->content); return 1; case skip: return 1; case code: if (ud->text_length > 0 || ud->translated_length > 0) { StyleType *style; insert_translation (ud->main_braille_table); style = find_current_style (); if (style != NULL) write_paragraph (style->action, node); else write_paragraph (para, node); } insert_utf8 (node->content); memset (ud->typeform, computer_braille, ud->text_length); insert_translation (ud->compbrl_table_name); write_paragraph (code, node); return 1; default: insert_utf8 (node->content); return 1; } } liblouisutdml-2.5.0/liblouisutdml/transcribe_graphic.c0000664000076500007650000000621712054461273020242 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and abilitiessoft, Inc. www.abilitiessoft.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #include #include #include "louisutdml.h" static void graphicText (xmlNode * node, int action); static void graphicCdata (xmlNode * node); static int graphicEmptyElement (xmlNode * node); int transcribe_graphic (xmlNode * node, int action) { xmlNode *child; int elementCount = 0; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case no: if (ud->text_length > 0 && ud->text_length < MAX_LENGTH && ud->text_buffer[ud->text_length - 1] > 32) ud->text_buffer[ud->text_length++] = 32; break; case skip: if (action != 0) pop_sem_stack (); return 0; case math: transcribe_math (node, 0); if (action != 0) pop_sem_stack (); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: insert_code (node, elementCount); elementCount++; if (child->children) transcribe_paragraph (child, 1); else graphicEmptyElement (child); break; case XML_TEXT_NODE: graphicText (child, action); break; case XML_CDATA_SECTION_NODE: graphicCdata (child); break; default: break; } child = child->next; } insert_code (node, elementCount); insert_code (node, -1); if (action != 0) { pop_sem_stack (); return 1; } switch (ud->stack[ud->top]) { case para: write_paragraph (para, NULL); break; default: break; } pop_sem_stack (); return 1; } static int graphicEmptyElement (xmlNode * node) { push_sem_stack (node); switch (ud->stack[ud->top]) { case softreturn: insert_code (node, 0); break; case boxline: break; case blankline: break; case newpage: break; case righthandpage: break; default: break; } pop_sem_stack (); return 1; } static void graphicText (xmlNode * node, int action) { insert_text (node); } static void graphicCdata (xmlNode * node) { insert_utf8 (node->content); } liblouisutdml-2.5.0/liblouisutdml/convert_utd.c0000664000076500007650000000656612113644123016745 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" static int nullPrivate (xmlNode * node) { xmlNode *child; if (node == NULL) return 0; node->_private = NULL; child = node->children; while (child) { child->_private = NULL; nullPrivate (child); child = child->next; } return 1; } int convert_utd () { xmlNode *rootElement = xmlDocGetRootElement (ud->doc); int haveSemanticFile; if (rootElement == NULL) { lou_logPrint ("Document is empty"); return 0; } clean_semantic_table (); ud->format_for = ud->orig_format_for; ud->semantic_files = ud->converter_sem; haveSemanticFile = compile_semantic_table (rootElement); nullPrivate (rootElement); do_xpath_expr (); examine_document (rootElement); append_new_entries (); if (!haveSemanticFile) return 0; switch (ud->format_for) { case dsbible: utd2dsBible (rootElement); break; case brf: utd2brf (rootElement); break; case transinxml: utd2transinxml (rootElement); break; case pef: utd2pef (rootElement); break; case volumes: case volumesPef: case volumesBrf: utd2volumes (rootElement); break; default: break; } return 1; } int pass2_conv () { xmlNode *rootElement = xmlDocGetRootElement (ud->doc); int haveSemanticFile; xmlNode *child; if (rootElement == NULL) { lou_logPrint ("Document is empty"); return 0; } clean_semantic_table (); ud->semantic_files = ud->pass2_conv_sem; haveSemanticFile = compile_semantic_table (rootElement); nullPrivate (rootElement); do_xpath_expr (); examine_document (rootElement); if (!haveSemanticFile) return 0; ud->format_for = utd; ud->top = 0; ud->stack[0] = no; ud->style_top = -1; ud->text_length = 0; ud->translated_length = 0; ud->sync_text_length = 0; ud->in_sync = ud->hyphenate; child = rootElement->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: transcribe_paragraph (child, 0); break; case XML_TEXT_NODE: insert_text (child); break; case XML_CDATA_SECTION_NODE: transcribe_cdataSection (child); break; default: break; } child = child->next; } return 1; } liblouisutdml-2.5.0/liblouisutdml/Makesemnames0000664000076500007650000000032412054461273016567 00000000000000# If you change sem_enum.h run this file with # make -f Makesemnames sem_names.h : sem_enum.h make_sem_names ./make_sem_names make_sem_names : make_sem_names.c gcc -O2 -Wall -o make_sem_names make_sem_names.c liblouisutdml-2.5.0/liblouisutdml/examine_document.c0000664000076500007650000000752312125472262017735 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" static void examText (xmlNode * node); static void examCdataa (xmlNode * node); static int doConfigfile (xmlNode * node); int examine_document (xmlNode * node) { /*Examine the parse tree, add semantic attributes and set indicators.*/ xmlNode *child; if (node == NULL) return 0; ud->stack[++ud->top] = set_sem_attr (node); if (ud->format_for == utd) { unsigned char *name = get_sem_name (node); if (name[0] != 0) xmlNewProp (node, (xmlChar *)"semantics", (xmlChar *)name); } switch (ud->stack[ud->top]) { case skip: pop_sem_stack (); return 1; case configfile: doConfigfile (node); break; case configstring: do_configstring (node); break; case code: ud->has_comp_code = 1; break; case contentsheader: ud->has_contentsheader = 1; break; case math: ud->has_math = 1; break; case chemistry: ud->has_chem = 1; break; case graphic: ud->has_graphics = 1; break; case music: ud->has_music = 1; break; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: examine_document (child); break; case XML_TEXT_NODE: examText (child); break; case XML_CDATA_SECTION_NODE: examCdataa (child); examine_document (child); break; default: break; } child = child->next; } ud->top--; return 1; } static void examText (xmlNode * node) /*We may want to examine text content in the future*/ { switch (ud->stack[ud->top]) { case pagenum: break; default: break; } } static void examCdataa (xmlNode * node) { ud->has_cdata = 1; } static int doConfigfile (xmlNode * node) { int k; char filePath[MAXNAMELEN]; ud->text_length = 0; insert_code (node, 0); for (k = 0; k < ud->text_length; k++) ud->typeform[k] = (xmlChar) ud->text_buffer[k]; ud->typeform[k] = 0; if (!find_file ((char *) ud->typeform, filePath)) return 0; if (!config_compileSettings (filePath)) return 0; return 1; } int do_configstring (xmlNode * node) { int k; int kk = 0; xmlChar configString[2 * MAXNAMELEN]; ud->text_length = 0; insert_code (node, 0); configString[kk++] = ud->string_escape; for (k = 0; k < ud->text_length; k++) { if (ud->text_buffer[k] == '=') configString[kk++] = ' '; else if (ud->text_buffer[k] == ';') configString[kk++] = '\n'; else configString[kk++] = (xmlChar) ud->text_buffer[k]; } configString[kk++] = '\n'; configString[kk] = 0; ud->text_length = 0; if (!config_compileSettings ((char *) configString)) return 0; return 1; } liblouisutdml-2.5.0/liblouisutdml/config.h.in0000664000076500007650000004325712222611426016267 00000000000000/* liblouisutdml/config.h.in. Generated from configure.ac by autoheader. */ /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module malloc-gnu shall be considered present. */ #undef GNULIB_MALLOC_GNU /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module realloc-gnu shall be considered present. */ #undef GNULIB_REALLOC_GNU /* Define to 1 when the gnulib module getopt-gnu should be tested. */ #undef GNULIB_TEST_GETOPT_GNU /* Define to 1 when the gnulib module malloc-posix should be tested. */ #undef GNULIB_TEST_MALLOC_POSIX /* Define to 1 when the gnulib module realloc-posix should be tested. */ #undef GNULIB_TEST_REALLOC_POSIX /* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. */ #undef HAVE_DECL_GETENV /* Define to 1 if you have the declaration of `program_invocation_name', and to 0 if you don't. */ #undef HAVE_DECL_PROGRAM_INVOCATION_NAME /* Define to 1 if you have the declaration of `program_invocation_short_name', and to 0 if you don't. */ #undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_JNI_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if your system has a GNU libc compatible 'malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC_GNU /* Define if the 'malloc' function is POSIX compliant. */ #undef HAVE_MALLOC_POSIX /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if atoll is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ATOLL /* Define to 1 if canonicalize_file_name is declared even after undefining macros. */ #undef HAVE_RAW_DECL_CANONICALIZE_FILE_NAME /* Define to 1 if chdir is declared even after undefining macros. */ #undef HAVE_RAW_DECL_CHDIR /* Define to 1 if chown is declared even after undefining macros. */ #undef HAVE_RAW_DECL_CHOWN /* Define to 1 if dup is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUP /* Define to 1 if dup2 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUP2 /* Define to 1 if dup3 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_DUP3 /* Define to 1 if endusershell is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ENDUSERSHELL /* Define to 1 if environ is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ENVIRON /* Define to 1 if euidaccess is declared even after undefining macros. */ #undef HAVE_RAW_DECL_EUIDACCESS /* Define to 1 if faccessat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FACCESSAT /* Define to 1 if fchdir is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FCHDIR /* Define to 1 if fchownat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FCHOWNAT /* Define to 1 if fdatasync is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FDATASYNC /* Define to 1 if fsync is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FSYNC /* Define to 1 if ftruncate is declared even after undefining macros. */ #undef HAVE_RAW_DECL_FTRUNCATE /* Define to 1 if getcwd is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETCWD /* Define to 1 if getdomainname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETDOMAINNAME /* Define to 1 if getdtablesize is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETDTABLESIZE /* Define to 1 if getgroups is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETGROUPS /* Define to 1 if gethostname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETHOSTNAME /* Define to 1 if getloadavg is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETLOADAVG /* Define to 1 if getlogin is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETLOGIN /* Define to 1 if getlogin_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETLOGIN_R /* Define to 1 if getpagesize is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETPAGESIZE /* Define to 1 if getsubopt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETSUBOPT /* Define to 1 if getusershell is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GETUSERSHELL /* Define to 1 if grantpt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GRANTPT /* Define to 1 if group_member is declared even after undefining macros. */ #undef HAVE_RAW_DECL_GROUP_MEMBER /* Define to 1 if initstate is declared even after undefining macros. */ #undef HAVE_RAW_DECL_INITSTATE /* Define to 1 if initstate_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_INITSTATE_R /* Define to 1 if isatty is declared even after undefining macros. */ #undef HAVE_RAW_DECL_ISATTY /* Define to 1 if lchown is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LCHOWN /* Define to 1 if link is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LINK /* Define to 1 if linkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LINKAT /* Define to 1 if lseek is declared even after undefining macros. */ #undef HAVE_RAW_DECL_LSEEK /* Define to 1 if mkdtemp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKDTEMP /* Define to 1 if mkostemp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKOSTEMP /* Define to 1 if mkostemps is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKOSTEMPS /* Define to 1 if mkstemp is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKSTEMP /* Define to 1 if mkstemps is declared even after undefining macros. */ #undef HAVE_RAW_DECL_MKSTEMPS /* Define to 1 if pipe is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PIPE /* Define to 1 if pipe2 is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PIPE2 /* Define to 1 if posix_openpt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_POSIX_OPENPT /* Define to 1 if pread is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PREAD /* Define to 1 if ptsname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PTSNAME /* Define to 1 if ptsname_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PTSNAME_R /* Define to 1 if pwrite is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PWRITE /* Define to 1 if random is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RANDOM /* Define to 1 if random_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RANDOM_R /* Define to 1 if readlink is declared even after undefining macros. */ #undef HAVE_RAW_DECL_READLINK /* Define to 1 if readlinkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_READLINKAT /* Define to 1 if realpath is declared even after undefining macros. */ #undef HAVE_RAW_DECL_REALPATH /* Define to 1 if rmdir is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RMDIR /* Define to 1 if rpmatch is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RPMATCH /* Define to 1 if secure_getenv is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SECURE_GETENV /* Define to 1 if setenv is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETENV /* Define to 1 if sethostname is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETHOSTNAME /* Define to 1 if setstate is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETSTATE /* Define to 1 if setstate_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETSTATE_R /* Define to 1 if setusershell is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SETUSERSHELL /* Define to 1 if sleep is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SLEEP /* Define to 1 if srandom is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SRANDOM /* Define to 1 if srandom_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SRANDOM_R /* Define to 1 if strtod is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRTOD /* Define to 1 if strtoll is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRTOLL /* Define to 1 if strtoull is declared even after undefining macros. */ #undef HAVE_RAW_DECL_STRTOULL /* Define to 1 if symlink is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SYMLINK /* Define to 1 if symlinkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_SYMLINKAT /* Define to 1 if ttyname_r is declared even after undefining macros. */ #undef HAVE_RAW_DECL_TTYNAME_R /* Define to 1 if unlink is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UNLINK /* Define to 1 if unlinkat is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UNLINKAT /* Define to 1 if unlockpt is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UNLOCKPT /* Define to 1 if unsetenv is declared even after undefining macros. */ #undef HAVE_RAW_DECL_UNSETENV /* Define to 1 if usleep is declared even after undefining macros. */ #undef HAVE_RAW_DECL_USLEEP /* Define to 1 if _Exit is declared even after undefining macros. */ #undef HAVE_RAW_DECL__EXIT /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if your system has a GNU libc compatible 'realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC_GNU /* Define if the 'realloc' function is POSIX compliant. */ #undef HAVE_REALLOC_POSIX /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* String identifying the packager of this software */ #undef PACKAGE_PACKAGER /* Packager info for bug reports (URL/e-mail/...) */ #undef PACKAGE_PACKAGER_BUG_REPORTS /* Packager-specific version information */ #undef PACKAGE_PACKAGER_VERSION /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on OS X. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions if necessary. HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ #undef _NETBSD_SOURCE /* The _Noreturn keyword of C11. */ #if ! (defined _Noreturn \ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__noreturn__)) # elif defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn # endif #endif /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for 'stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to rpl_ if the getopt replacement functions and variables should be used. */ #undef __GETOPT_PREFIX /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'. _GL_EXTERN_INLINE is a portable alternative to 'extern inline'. _GL_INLINE_HEADER_BEGIN contains useful stuff to put in an include file, before uses of _GL_INLINE. It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic, when FOO is an inline function in the header; see . _GL_INLINE_HEADER_END contains useful stuff to put in the same include file, after uses of _GL_INLINE. Suppress extern inline with HP-UX cc, as it appears to be broken; see . Suppress the use of extern inline on Apple's platforms, as Libc-825.25 (2012-09-19) is incompatible with it; see . Perhaps Apple will fix this some day. */ #if ((__GNUC__ \ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : 199901L <= __STDC_VERSION__ && !defined __HP_cc) \ && !defined __APPLE__) # define _GL_INLINE inline # define _GL_EXTERN_INLINE extern inline #elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__ # if __GNUC_GNU_INLINE__ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) # else # define _GL_INLINE extern inline # endif # define _GL_EXTERN_INLINE extern #else # define _GL_INLINE static _GL_UNUSED # define _GL_EXTERN_INLINE static _GL_UNUSED #endif #if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) # if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ # define _GL_INLINE_HEADER_CONST_PRAGMA # else # define _GL_INLINE_HEADER_CONST_PRAGMA \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") # endif # define _GL_INLINE_HEADER_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ _GL_INLINE_HEADER_CONST_PRAGMA # define _GL_INLINE_HEADER_END \ _Pragma ("GCC diagnostic pop") #else # define _GL_INLINE_HEADER_BEGIN # define _GL_INLINE_HEADER_END #endif /* A replacement for va_copy, if needed. */ #define gl_va_copy(a,b) ((a) = (b)) /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. __APPLE__ && __MACH__ test for Mac OS X. __APPLE_CC__ tests for the Apple compiler and its version. __STDC_VERSION__ tests for the C99 mode. */ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef mode_t /* Define to `int' if does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define as a signed type of the same size as size_t. */ #undef ssize_t /* Define as a marker that can be attached to declarations that might not be used. This helps to reduce warnings, such as from GCC -Wunused-parameter. */ #if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) # define _GL_UNUSED __attribute__ ((__unused__)) #else # define _GL_UNUSED #endif /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name is a misnomer outside of parameter lists. */ #define _UNUSED_PARAMETER_ _GL_UNUSED /* The __pure__ attribute was added in gcc 2.96. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) #else # define _GL_ATTRIBUTE_PURE /* empty */ #endif /* The __const__ attribute was added in gcc 2.95. */ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) #else # define _GL_ATTRIBUTE_CONST /* empty */ #endif /* Define as a macro for copying va_list variables. */ #undef va_copy liblouisutdml-2.5.0/liblouisutdml/transcribe_paragraph.c0000664000076500007650000004075012206715331020566 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and Abilitiessoft, Inc. www.abilitiessoft.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@abilitiessoft.com */ #include #include #include "louisutdml.h" extern void widecharcpy (widechar * to, const widechar * from, int length); extern void widestrcpy (widechar * to, const widechar * from); extern void unsignedcharcpy (char * to, const char * from, int length); extern void save_translated_buffer (void); extern void restore_translated_buffer (void); extern void contents_save_state (void); extern void contents_restore_state (void); static int dont_split = 0; static int dont_split_status = 0; static int keep_with_next = 0; static int keep_with_previous = 0; static int keep_with_previous_pos = 0; static int keep_with_previous_status = 0; static int orphan_control = 0; static int orphan_control_pos = 0; static int orphan_control_status = 0; static int saved_text_length; static int saved_sync_text_length; static int saved_translated_length; static int saved_outbuf1_len_so_far; static int saved_outbuf2_len_so_far; static int saved_running_head_length; static int saved_footer_length; static int saved_braille_page_number; static int saved_style_left_margin; static int saved_style_right_margin; static int saved_style_first_line_indent; static StyleFormat saved_style_format; static BrlPageNumFormat saved_brl_page_num_format; static BrlPageNumFormat saved_cur_brl_page_num_format; static int saved_lines_on_page; static int saved_line_spacing; static int saved_blank_lines; static int saved_fill_pages; static int saved_positions_array[2 * BUFSIZE]; static widechar saved_text_buffer[2 * BUFSIZE]; static widechar saved_sync_text_buffer[2 * BUFSIZE]; static widechar saved_translated_buffer[2 * BUFSIZE]; static widechar saved_outbuf1[2 * BUFSIZE]; static widechar saved_outbuf2[2 * BUFSIZE]; static widechar saved_page_separator_number_first[MAXNUMLEN]; static widechar saved_page_separator_number_last[MAXNUMLEN]; static widechar saved_print_page_number_first[MAXNUMLEN]; static widechar saved_print_page_number_last[MAXNUMLEN]; static widechar saved_print_page_number[MAXNUMLEN]; static widechar saved_braille_page_string[MAXNUMLEN]; static widechar saved_running_head[MAXNAMELEN / 2]; static widechar saved_footer[MAXNAMELEN / 2]; static unsigned char saved_typeform[2 * BUFSIZE]; static void saveState (void) { saved_text_length = ud->text_length; saved_sync_text_length = ud->sync_text_length; saved_translated_length = ud->translated_length; saved_outbuf1_len_so_far = ud->outbuf1_len_so_far; saved_outbuf2_len_so_far = ud->outbuf2_len_so_far; saved_running_head_length = ud->running_head_length; saved_footer_length = ud->footer_length; saved_style_left_margin = ud->style_left_margin; saved_style_right_margin = ud->style_right_margin; saved_style_first_line_indent = ud->style_first_line_indent; saved_style_format = ud->style_format; saved_braille_page_number = ud->braille_page_number; saved_brl_page_num_format = ud->brl_page_num_format; saved_cur_brl_page_num_format = ud->cur_brl_page_num_format; saved_lines_on_page = ud->lines_on_page; saved_line_spacing = ud->line_spacing; saved_blank_lines = ud->blank_lines; saved_fill_pages = ud->fill_pages; memcpy (saved_positions_array, ud->positions_array, saved_translated_length * sizeof (int)); widecharcpy (saved_text_buffer, ud->text_buffer, saved_text_length); widecharcpy (saved_sync_text_buffer, ud->sync_text_buffer, saved_sync_text_length); widecharcpy (saved_translated_buffer, ud->translated_buffer, saved_translated_length); widecharcpy (saved_outbuf1, ud->outbuf1, saved_outbuf1_len_so_far); widecharcpy (saved_outbuf2, ud->outbuf2, saved_outbuf2_len_so_far); widecharcpy (saved_running_head, ud->running_head, saved_running_head_length); widecharcpy (saved_footer, ud->footer, saved_footer_length); unsignedcharcpy (saved_typeform, ud->typeform, saved_text_length); widestrcpy (saved_page_separator_number_first, ud->page_separator_number_first); widestrcpy (saved_page_separator_number_last, ud->page_separator_number_last); widestrcpy (saved_print_page_number_first, ud->print_page_number_first); widestrcpy (saved_print_page_number_last, ud->print_page_number_last); widestrcpy (saved_print_page_number, ud->print_page_number); widestrcpy (saved_braille_page_string, ud->braille_page_string); save_translated_buffer (); contents_save_state (); } static void restoreState (void) { ud->text_length = saved_text_length; ud->sync_text_length = saved_sync_text_length; ud->translated_length = saved_translated_length; ud->outbuf1_len_so_far = saved_outbuf1_len_so_far; ud->outbuf2_len_so_far = saved_outbuf2_len_so_far; ud->running_head_length = saved_running_head_length; ud->footer_length = saved_footer_length; ud->style_left_margin = saved_style_left_margin; ud->style_right_margin = saved_style_right_margin; ud->style_first_line_indent = saved_style_first_line_indent; ud->style_format = saved_style_format; ud->braille_page_number = saved_braille_page_number; ud->brl_page_num_format = saved_brl_page_num_format; ud->cur_brl_page_num_format = saved_cur_brl_page_num_format; ud->lines_on_page = saved_lines_on_page; ud->line_spacing = saved_line_spacing; ud->blank_lines = saved_blank_lines; ud->fill_pages = saved_fill_pages; memcpy (ud->positions_array, saved_positions_array, saved_translated_length * sizeof (int)); widecharcpy (ud->text_buffer, saved_text_buffer, saved_text_length); widecharcpy (ud->sync_text_buffer, saved_sync_text_buffer, saved_sync_text_length); widecharcpy (ud->translated_buffer, saved_translated_buffer, saved_translated_length); widecharcpy (ud->outbuf1, saved_outbuf1, saved_outbuf1_len_so_far); widecharcpy (ud->outbuf2, saved_outbuf2, saved_outbuf2_len_so_far); widecharcpy (ud->running_head, saved_running_head, saved_running_head_length); widecharcpy (ud->footer, saved_footer, saved_footer_length); unsignedcharcpy (ud->typeform, saved_typeform, saved_text_length); widestrcpy (ud->page_separator_number_first, saved_page_separator_number_first); widestrcpy (ud->page_separator_number_last, saved_page_separator_number_last); widestrcpy (ud->print_page_number_first, saved_print_page_number_first); widestrcpy (ud->print_page_number_last, saved_print_page_number_last); widestrcpy (ud->print_page_number, saved_print_page_number); widestrcpy (ud->braille_page_string, saved_braille_page_string); restore_translated_buffer (); contents_restore_state (); } int transcribe_paragraph (xmlNode * node, int action) { xmlNode *saved_child; int saved_branchCount = 0; int state_saved = 0; StyleType *style_this; int dont_split_this = 0; int keep_with_next_this = 0; int keep_with_previous_this = 0; int orphan_control_this = 0; StyleType *style; int haveMacro = 0; xmlNode *child; int branchCount = 0; int i; if (node == NULL) return 0; if (ud->top == 0) action = 1; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case no: if (ud->text_length > 0 && ud->text_length < MAX_LENGTH && ud->text_buffer[ud->text_length - 1] > 32) ud->text_buffer[ud->text_length++] = 32; break; case skip: if (action != 0) pop_sem_stack (); return 1; case markhead: ud->head_node = node; pop_sem_stack (); break; case configtweak: do_configstring (node); ud->main_braille_table = ud->contracted_table_name; if (!lou_getTable (ud->main_braille_table)) { lou_logPrint ("Cannot open main table %s", ud->main_braille_table); return 0; } if (node->children == NULL) return 1; break; case htmllink: if (ud->format_for != browser) break; insert_linkOrTarget (node, 0); if (action != 0) pop_sem_stack (); return 1; case htmltarget: if (ud->format_for != browser) break; insert_linkOrTarget (node, 1); if (action != 0) pop_sem_stack (); return 1; case boxline: do_boxline (node); if (node->children == NULL) return 1; break; case pagebreak: do_pagebreak (node); return 1; case attrtotext: do_attrtotext (node); if (node->children == NULL) return 1; break; case blankline: do_blankline (); if (node->children == NULL) return 1; break; case linespacing: do_linespacing (node); if (node->children == NULL) return 1; break; case softreturn: do_softreturn (); if (node->children == NULL) return 1; break; case newpage: do_newpage (); if (node->children == NULL) return 1; break; case righthandpage: do_righthandpage (); if (node->children == NULL) return 1; break; case code: transcribe_computerCode (node, 0); if (action != 0) pop_sem_stack (); return 1; case math: transcribe_math (node, 0); if (action != 0) pop_sem_stack (); return 1; case graphic: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case utddispimg: case utdinlnimg: do_utdxxxximg (node); if (action != 0) pop_sem_stack (); return 1; case chemistry: transcribe_chemistry (node, 0); if (action != 0) pop_sem_stack (); return 1; case music: transcribe_music (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); if (node->children == NULL) return 1; break; case pagenum: do_pagenum (); break; default: break; } if (is_macro (node)) { haveMacro = 1; start_macro (node); } else if ((style = is_style (node)) != NULL) start_style (style, node); child = node->children; while (child) { insert_code (node, branchCount); branchCount++; dont_split_this = 0; orphan_control_this = 0; keep_with_previous_this = 0; switch (child->type) { case XML_ELEMENT_NODE: if (ud->format_for == utd) { } else { style_this = is_style (child); if (style_this && ud->braille_pages) { if (keep_with_next_this && ud->lines_length > 0) keep_with_previous_this = 1; keep_with_next_this = 0; if (!dont_split) { if (ud->lines_on_page > 0 && !((keep_with_previous || keep_with_previous_this) && !ud->outbuf3_enabled)) { if (style_this->dont_split || style_this->keep_with_next) dont_split_this = 1; else if (style_this->orphan_control > 1) orphan_control_this = style_this->orphan_control; } keep_with_next_this = style_this->keep_with_next; } if (dont_split_this || orphan_control_this) { if (!ud->outbuf3_enabled) { saved_child = child; saved_branchCount = branchCount - 1; saveState (); state_saved = 1; ud->outbuf3_enabled = 1; ud->lines_length = 0; } } if (dont_split_this) dont_split = dont_split_this; if (keep_with_next_this) keep_with_next = keep_with_next_this; if (keep_with_previous_this) { keep_with_previous = keep_with_previous_this; keep_with_previous_pos = ud->lines_length; } if (orphan_control_this) { orphan_control = orphan_control_this; orphan_control_pos = ud->lines_length; } } } if (strcmp (child->name, "brl") != 0) transcribe_paragraph (child, 1); break; case XML_TEXT_NODE: /*Is there already a node? */ if (!(ud->format_for == utd && child->next != NULL && strcmp ((char *) child->next->name, "brl") == 0)) insert_text (child); /*Is there now a node? */ if (ud->format_for == utd && child->next != NULL && strcmp ((char *) child->next->name, "brl") == 0) child = child->next; /*skip node */ break; case XML_CDATA_SECTION_NODE: transcribe_cdataSection (child); break; default: break; } if (child != NULL) child = child->next; if (ud->format_for == utd) { } else { if (ud->outbuf3_enabled) { if (dont_split_status >= 0 && keep_with_previous_status >= 0 && orphan_control_status >= 0) { if (keep_with_previous) { if (keep_with_previous_this) keep_with_previous_status = 1; else if (keep_with_previous_pos < ud->lines_length) keep_with_previous_status = 1; else keep_with_previous_status = 0; if (keep_with_previous_pos < ud->lines_length && ud->lines_pagenum[keep_with_previous_pos] > ud->lines_pagenum[keep_with_previous_pos - 1] && !ud->lines_newpage[keep_with_previous_pos]) keep_with_previous_status = -1; } if (dont_split_this) { dont_split_status = 1; for (i = 1; i < ud->lines_length; i++) { if (ud->lines_pagenum[i] > ud->lines_pagenum[i - 1]) { if (!ud->lines_newpage[i]) dont_split_status = -1; break; } } } if (orphan_control) { if (orphan_control_this) orphan_control_status = 1; else orphan_control_status = 0; i = 1; while (i < orphan_control && orphan_control_pos + i < ud->lines_length) { if (ud->lines_pagenum[orphan_control_pos + i] > ud->lines_pagenum[orphan_control_pos + i - 1]) { if (!ud->lines_newpage[i]) orphan_control_status = -1; break; } i++; } if (i == orphan_control) orphan_control_status = 1; } } if (dont_split_status < 0 || keep_with_previous_status < 0 || orphan_control_status < 0) { if (state_saved) { dont_split = 0; dont_split_status = 0; keep_with_next = 0; keep_with_previous = 0; keep_with_previous_status = 0; orphan_control = 0; orphan_control_status = 0; restoreState (); child = saved_child; branchCount = saved_branchCount; state_saved = 0; ud->outbuf3_len_so_far = 0; ud->outbuf3_enabled = 0; do_newpage (); } else break; } if (dont_split_status > 0) { dont_split = 0; dont_split_status = 0; } if (keep_with_previous_status > 0) { keep_with_previous = 0; keep_with_previous_status = 0; } if (orphan_control_status > 0) { orphan_control = 0; orphan_control_status = 0; } if ((!dont_split && !keep_with_previous && !keep_with_next && !orphan_control) || (!child && state_saved)) { write_buffer (3, 0); ud->outbuf3_enabled = 0; state_saved = 0; } } if (dont_split_this) dont_split = 0; if (keep_with_next_this) keep_with_next = 0; if (keep_with_previous_this) keep_with_previous = 0; if (orphan_control_this) orphan_control = 0; } } insert_code (node, branchCount); insert_code (node, -1); if (haveMacro) end_macro (); else if (style) end_style (); else switch (ud->stack[ud->top]) { case runninghead: insert_translation (ud->main_braille_table); set_runninghead_string (ud->translated_buffer, ud->translated_length); ud->translated_length = 0; break; case footer: insert_translation (ud->main_braille_table); set_footer_string (ud->translated_buffer, ud->translated_length); ud->translated_length = 0; break; default: break; } if (action != 0) pop_sem_stack (); else { insert_translation (ud->main_braille_table); write_paragraph (para, NULL); } return 1; } liblouisutdml-2.5.0/liblouisutdml/utd2dsbible.c0000664000076500007650000002060712151533167016613 00000000000000/* liblouisutdml Braille Transcription Library This file may contain code borrowed from the Linux screenreader BRLTTY, copyright (C) 1999-2006 by the BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com and JJB Software, Inc. www.jjb-software.com All rights reserved This file is free software; you can redistribute it and/or modify it under the terms of the Lesser or Library GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Library GNU General Public License for more details. You should have received a copy of the Library GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Maintained by John J. Boyer john.boyer@jjb-software.com */ #include #include #include "louisutdml.h" static int findBrlNodes (xmlNode * node); static int dsBibleDoBrlNode (xmlNode * node, int action); static int beginDocument (); static int finishBrlNode (); static int finishDocument (); static int doUtdbrlonly (xmlNode * node, int action); static int doUtdnewpage (xmlNode * node); static int doUtdnewline (xmlNode * node); static int doUtddispimg (xmlNode * node); static int firstPage; static int firstLineOnPage; static int startOfLastLine; static widechar firstVerse[MAXNUMLEN]; static int firstVerseLength; static widechar lastVerse[MAXNUMLEN]; static int lastVerseLength; static int doVerseNumber (widechar * line, int length) { widechar number[MAXNUMLEN]; int numberLength = 0; int k; int kk; for (k = 0; k < length; k++) if (line[k] >= 16 && line[k] <= 25) break; if (k == length) return length; number[numberLength++] = line[k] + 32; if (line[k + 1] >= 16 && line[k + 1] <= 25) number[numberLength++] = line[k + 1] + 32; if (line[k + 2] >= 16 && line[k + 2] <= 25) number[numberLength++] = line[k + 2] + 32; line[k] = 39; if (numberLength > 1) { k++; for (kk = 0; kk < length; kk++) line[k + kk] = line[k + kk + numberLength - 1]; length -= numberLength - 1; } if (numberLength == 1) kk = 1; else kk = 0; for (k = 0; k < numberLength; k++) if (number[k] == 48) line[kk++] = number[k] + 58; else line[kk++] = number[k] + 48; if (firstVerseLength == 0) { firstVerseLength = numberLength; memcpy (firstVerse, number, numberLength * CHARSIZE); } else { lastVerseLength = numberLength; memcpy (lastVerse, number, numberLength * CHARSIZE); } return length; } static void makeFooter () { int translationLength; int translatedLength; int k; int kk; firstVerse[firstVerseLength++] = ud->lit_hyphen[0]; for (k = 0; k < lastVerseLength; k++) firstVerse[firstVerseLength++] = lastVerse[k]; translationLength = firstVerseLength; translatedLength = MAXNUMLEN; lou_translate (ud->main_braille_table, firstVerse, &translationLength, lastVerse, &translatedLength, NULL, NULL, NULL, NULL, NULL, 0); firstVerseLength = 0; kk = startOfLastLine + ((ud->cells_per_line - translatedLength) / 2); for (k = 0; k < translatedLength; k++) ud->outbuf1[kk++] = lastVerse[k]; } int utd2dsBible (xmlNode * node) { ud->top = -1; ud->style_top = -1; firstPage = 1; firstLineOnPage = 1; beginDocument (); findBrlNodes (node); pass2_conv (); finishDocument (); return 1; } static int beginDocument () { return 1; } static int finishDocument () { return 1; write_buffer (1, 0); ud->outbuf1_len_so_far = 0; return 1; } static int doUtddispimg (xmlNode *node) { return 1; } static int findBrlNodes (xmlNode * node) { xmlNode *child; if (node == NULL) return 0; push_sem_stack (node); switch (ud->stack[ud->top]) { case utdmeta: return 1; case utdbrl: dsBibleDoBrlNode (node, 0); pop_sem_stack (); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: findBrlNodes (child); break; case XML_TEXT_NODE: break; default: break; } child = child->next; } pop_sem_stack (); return 1; } static char *blanks = " "; static int insertCharacters (const char *text, int length) { int k; if ((ud->outbuf1_len_so_far + length) >= ud->outbuf1_len) return 0; for (k = 0; k < length; k++) ud->outbuf1[ud->outbuf1_len_so_far++] = text[k]; return 1; } static int doDotsText (xmlNode * node) { ud->text_length = 0; insert_utf8 (node->content); if (!lou_dotsToChar (ud->main_braille_table, ud->text_buffer, &ud->outbuf1[ud->outbuf1_len_so_far], ud->text_length, 0)) return 0; ud->outbuf1_len_so_far += ud->text_length; return 1; } static int doUtdbrlonly (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (ud->top == 0) action = 1; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case utdnewpage: doUtdnewpage (node); if (action != 0) pop_sem_stack (); return 1; case utdnewline: doUtdnewline (node); if (action != 0) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: doUtdbrlonly (child, 1); break; case XML_TEXT_NODE: doDotsText (child); break; default: break; } child = child->next; } if (action != 0) pop_sem_stack (); return 1; } static int lastLinepos; static int doUtdnewpage (xmlNode * node) { static int prevBrlPageNum = 1; lastLinepos = ud->page_top; firstLineOnPage = 1; if (firstPage) { firstPage = 0; return 1; } if ((prevBrlPageNum & 1)) makeFooter (); insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); insertCharacters (ud->pageEnd, strlen (ud->pageEnd)); write_buffer (1, 0); prevBrlPageNum = atoi (xmlGetProp (node, (xmlChar *) "brlnumber")); return 1; } static int doUtdnewline (xmlNode * node) { char *xy; int k; int leadingBlanks; int linepos; if (!firstLineOnPage) { ud->outbuf1_len_so_far = startOfLastLine + doVerseNumber (&ud->outbuf1[startOfLastLine], ud->outbuf1_len_so_far - startOfLastLine); insertCharacters (ud->lineEnd, strlen (ud->lineEnd)); } xy = (char *) xmlGetProp (node, (xmlChar *) "xy"); for (k = 0; xy[k] != ','; k++); leadingBlanks = (atoi (xy) - ud->left_margin) / ud->cell_width; linepos = (atoi (&xy[k + 1]) - ud->page_top) / ud->normal_line; startOfLastLine = ud->outbuf1_len_so_far; insertCharacters (blanks, leadingBlanks); if (firstLineOnPage) firstLineOnPage = 0; return 1; } int dsBibleDoBrlNode (xmlNode * node, int action) { xmlNode *child; if (node == NULL) return 0; if (action != 0) push_sem_stack (node); switch (ud->stack[ud->top]) { case markhead: if (ud->head_node == NULL) ud->head_node = node; pop_sem_stack (); break; case utdbrlonly: doUtdbrlonly (node, 0); if (action != 0) pop_sem_stack (); return 1; case utdnewpage: doUtdnewpage (node); if (action != 0) pop_sem_stack (); return 1; case utdnewline: doUtdnewline (node); if (action != 0) pop_sem_stack (); return 1; case utddispimg: transcribe_graphic (node, 0); if (action != 0) pop_sem_stack (); return 1; case changetable: change_table (node); return 1; default: break; } child = node->children; while (child) { switch (child->type) { case XML_ELEMENT_NODE: dsBibleDoBrlNode (child, 1); break; case XML_TEXT_NODE: doDotsText (child); break; default: break; } child = child->next; } if (action != 0) { pop_sem_stack (); return 1; } finishBrlNode (); return 1; } static int finishBrlNode () { return 1; } liblouisutdml-2.5.0/COPYING.LIB0000664000076500007650000001672512054461273013022 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. liblouisutdml-2.5.0/doc/0000775000076500007650000000000012222613352012166 500000000000000liblouisutdml-2.5.0/doc/liblouisutdml.texi0000664000076500007650000042415712054461273015714 00000000000000\input texinfo @c %**start of header @setfilename liblouisutdml.info @include version.texi @settitle Liblouisutdml User's and Programmer's Manual @dircategory Misc @direntry * Liblouisutdml: (liblouisutdml). An xml to Braille Translation Library. @end direntry @finalout @defindex semantic @c Macro definitions @c setting. @macro setting{name, args} @tindex \name\ @item \name\ \args\ @end macro @macro settingref{name} @code{\name\} setting (@pxref{\name\ setting,\name\,@code{\name\}}) @end macro @c semantic action. @macro semanticAction{name, args} @semanticindex \name\ @anchor{\name\ semantic} @item \name\ \args\ @end macro @macro semanticref{name} @code{\name\} semantic action (@pxref{\name\ semantic,\name\,@code{\name\}}) @end macro @copying This manual is for liblouisutdml (version @value{VERSION}, @value{UPDATED}), an xml to Braille Translation Library. This file may contain code borrowed from the Linux screenreader @acronym{BRLTTY}, Copyright @copyright{} 1999-2009 by the @acronym{BRLTTY} Team. @noindent Copyright @copyright{} 2004-2009 ViewPlus Technologies, Inc. @uref{www.viewplus.com} and Copyright @copyright{} 2006,2009 Abilitiessoft, Inc. @uref{www.abilitiessoft.com}. @quotation This file is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser (or library) General Public License (LGPL) as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Lesser (or Library) General Public License LGPL for more details. You should have received a copy of the GNU Lesser (or Library) General Public License (LGPL) along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @end quotation @end copying @titlepage @title Liblouisutdml User's and Programmer's Manual @subtitle Release @value{VERSION} @author by John J. Boyer @c The following two commands start the copyright page. @page @vskip 0pt plus 1filll @insertcopying @end titlepage @c Output the table of contents at the beginning. @contents @ifnottex @node Top, Introduction, (dir), (dir) @top Liblouisutdml User's and Programmer's Manual @insertcopying @end ifnottex @menu * Introduction:: * Transcribing Documents:: * Customization Configuring liblouisutdml:: * Connecting with the xml Document:: * Special Features:: * Special Formats:: * Implementing Braille Mathematics Codes:: * Programming with liblouisutdml:: * Example files:: * Configuration Settings Index:: * Semantic Action Index:: * Function Index:: * Program Index:: @detailmenu --- The Detailed Node Listing --- Transcribing Documents * Transcribing XML files with file2brl:: * Transcribing Text Documents:: * Transcribing Poorly Formatted Documents:: * Transcribing html Documents:: * Transcribing Microsoft Word files with msword2brl:: * Transcribing RTF files with rtf2brl:: * Transcribing PDF files with pdf2brl:: Customization: Configuring liblouisutdml * outputFormat:: * translation:: * xml:: * style:: Connecting with the xml Document - Semantic-Action Files * Semantic Actions Overview:: * Semantic Actions in detail:: * Pseudo-actions:: * Using XPath Expressions:: Special Features * Table of contents:: * Back-translation:: * Reformatting:: * Interlining:: * Browser-Friendly Output:: * CDATA Sections:: Special Formats * Tables:: * Reserving Space for Graphics:: * Displayed Text:: * Displayed Mathematics:: * Spatial Layouts in Mathematics:: * Arithmetic Examples:: * Poetry:: * Dividing a Book Into Volumes:: Programming with liblouisutdml * License:: * Overview:: * Files and Paths:: * lbu_version:: * lbu_initialize:: * lbu_translateString:: * lbu_translateFile:: * lbu_translateTextFile:: * lbu_backTranslateFile:: * lbu_free:: Example files * liblouisutdml.ini:: * default.cfg:: * html.sem:: * nemeth.sem:: * Files for BAUK Maths (ukmaths):: Files for BAUK Maths (ukmaths) * ukmaths.cfg:: * ukmaths.sem:: * ukmaths.ctb:: * ukmaths_edit.ctb:: @end detailmenu @end menu @node Introduction, Transcribing Documents, Top, Top @chapter Introduction liblouisutdml is a software component which can be incorporated into software packages to provide the capability of translating any file in the computer lingua franca xml format or plain text into properly transcribed braille. This includes translation into grade two, if desired, mathematical codes, etc. It also includes formatting according to a style sheet which can be modified by the user. The first program into which liblouisutdml has been incorporated is @command{file2brl}. This program will translate an xml or text file into an embosser-ready braille file. It is not necessary to know xml, because MSWord and other word processors can export files in this format. If the word processor has been used correctly @command{file2brl} will produce an excellent braille file. There is a Mac GUI application incorporating liblouisutdml called @command{louis}. For a link to it go to @uref{www.abilitiessoft.com/downloads}. You can also obtain a Windows binary on this page. At present it is command-line. We hope to have a GUI soon. Users who want to generate Braille using @command{file2brl} will be interested in @ref{Transcribing XML files with file2brl}. Those who wish to change the output generated by liblouisutdml should read @ref{Customization Configuring liblouisutdml}. If you encounter a type of xml file with which liblouisutdml is not familiar you can learn how to tell it how to process that file by reading @ref{Connecting with the xml Document}. If you wish to implement a new braille mathematics code read @ref{Implementing Braille Mathematics Codes}. Finally, computer programmers who wish to use liblouisutdml in their software can find the information they need in @ref{Programming with liblouisutdml}. You will also find it advantageous to be acquainted with the companion library liblouis, which is a braille translator and back-translator (@pxref{Top, , Overview, liblouis, Liblouis User's and Programmer's Manual}). @node Transcribing Documents, Customization Configuring liblouisutdml, Introduction, Top @chapter Transcribing Documents @menu * Transcribing XML files with file2brl:: * Transcribing Text Documents:: * Transcribing Poorly Formatted Documents:: * Transcribing html Documents:: * Transcribing Microsoft Word files with msword2brl:: * Transcribing RTF files with rtf2brl:: * Transcribing PDF files with pdf2brl:: @end menu @node Transcribing XML files with file2brl, Transcribing Text Documents, Transcribing Documents, Transcribing Documents @section Transcribing XML files with file2brl @pindex file2brl At the moment, actual transcription with liblouisutdml is done with the command-line (or console) program @command{file2brl}. The line to type is: @example file2brl [OPTIONS] [-f config-file] [infile] [outfile] @end example The brackets indicate that something is optional. You will see that nothing is required except the program name itself, @command{file2brl}. The various optional parts control how the program will behave, as follows: @table @option @item -h @itemx --help This option causes @command{file2brl} to print a help message describing usage and exit. @item -v @itemx --version This option causes @command{file2brl} to display the version information and exit. @item -l @itemx --log-file This option will cause @command{file2brl} and liblouisutdml to print error messages to @file{file2brl.log} instead of stderr. The file will be in the current directory. This option is particularly useful if @command{file2brl} is called by a GUI script or Web application. @item -f configfile @itemx --config-file configfile This specifies the configuration file which tells @command{file2brl} how to do the transcription. (It may be a list of file names separated by commas.) This file specifies such things as the number of cells per line, the number of lines per page, The translation tables to be used, how paragraphs and headings are to be formatted, etc. If this part of the command line is omitted, @command{file2brl} assumes that the configuration file is named @file{default.cfg}. If the configuration file name contains a pathname @command{file2brl} will consider this as a path on which to look for files that it needs (@pxref{Files and Paths}). If no pathname is given the standard paths are searched and finally the current directory. To make @command{file2brl} search the current directory first, precede the file name with @code{./}. @item -Csetting=value @itemx --config-setting setting=value This option enables you to specify configuration settings on the command line instead of changing the configuration file. You can use as many @option{-C} options as you wish. Any settings can be specified except those having to do with styles. @xref{Configuration Settings Index}, for a list of available settings. These must be specified in configuration files. The settings may be in any order. They override any settings in @file{liblouisutdml.ini} or in the configuration file used by @command{file2brl}. @item -b @itemx --backward back-translate. The input file must be a braille file, such as @file{.brf}. The output file is a back-translation of this file. It may be in either plain-text or xhtml (html), according to the setting of @code{backFormat} in the @code{outputFormat} section of the configuration file. Html files will contain page numbers and emphasis. To get good html, the liblouis table must have the entry @samp{space \e 1b} so that it will pass through escape characters. The @file{html.sem} file must also contain the line @samp{pagenum pagenum}. Text output files simply have a blank line between paragraphs. Encoding of text files is controlled by the @code{outputEncoding} setting. Html files are always in UTF-8. @item -r @itemx --reformat Reformat. The input file must be a braille file, such as @file{.brf}. The output is a braille file formatted according to the configuration file. It is advisable to set backFormat to html, since this will preserve print page numbers and emphasis. This option can be useful for changing the line length and page length of a braille file, for example, from 40 to 32 cells. It is also an excellent way to check the accuracy of liblouis tables. The original page numbers at the tops and bottoms of pages are discarded, and new ones are generated. @item -p @itemx --poorly-formatted Poorly formatted input translation. Infile is any text file such as may have been obtained by extracting the text in a pdf file. The input file may also be an xml or html file which is so poorly formatted that better braille can be obtained by ignoring the formatting. @command{file2brl} tries to guess paragraph breaks. The output is generally reasonably formatted, that is, with reasonable paragraph breaks. @item -t @itemx --html The document is an h(t)ml file, not xhtml. This option is useful with files downloaded from the Web in source form. Without it, the program will first try to parse the file as an xml document, producing lots of error messages. It will then try the html parser. With this option, it goes directly to the html parser. See also the @code{formatFor} configuration (@pxref{formatFor setting}) file setting, which enables you to format the braille output for viewing in a browser. @item -T @item --text Consider the document to be a text file, even if it is xml or html. @item infile This is the name of the input file containing the material to be transcribed. The file may be either an xml file or a text file. The @option{-b}, @option{-r} and @option{-p} options discussed above provide for other types of files and processing. Typical xml files are those provided by @uref{www.bookshare.org} or those derived from a word processor by saving in xml format. If a text file is used paragraphs and headings should be separated by blank lines. In such a file there is no way to distinguish between paragraphs and headings, so they will all be formatted as paragraphs, as specified by the configuration file. However, if you want a blank line in the braille transcription use two consecutive blank lines in the text file. @item outfile This is the name of the output file. It will be transcribed as specified by the configuration file and the @option{-C} configuration settings. The following paragraphs provide more information on both the input and output files. @end table @command{file2brl} is set up so that it can be used in a "pipe". To do this, omit both infile and outfile. Input is then taken from the standard input unit. The first file name encountered (a word not preceded by a minus sign) is taken to be the input file and the second to be the output file. If you wish input to be taken from stdin and still want to specify an output file, use one minus sign (@samp{-}) for the input file. If only the program name is typed @command{file2brl} assumes that the configuration file is @file{default.cfg}, input is from the standard input unit, and output is to the standard output unit. @node Transcribing Text Documents, Transcribing Poorly Formatted Documents, Transcribing XML files with file2brl, Transcribing Documents @section Transcribing Text Documents See the previous section on using @command{file2brl}. This program recognizes text files automatically and transcribes them according to the information in the configuration files. Paragraphs must be separated with a blank line. If you want a blank line in the output use two blank lines. @node Transcribing Poorly Formatted Documents, Transcribing html Documents, Transcribing Text Documents, Transcribing Documents @section Transcribing Poorly Formatted Documents @example file2brl -p infile outfile @end example Some text documents, such as those derived from pdf files, and even some xml and html documents, are so poorly formatted that you can get better braille by ignoring whatever markup they contain. The @option{-p} option of @command{file2brl} does this. It ignores xml or html markup and uses heuristics to find the beginning of paragraphs. Its choices are usually good. Note that it does not work with rtf files. However, if @command{rtf2xml} (@pxref{Transcribing RTF files with rtf2brl}) will convert the file, it will work with the resulting xml file. @node Transcribing html Documents, Transcribing Microsoft Word files with msword2brl, Transcribing Poorly Formatted Documents, Transcribing Documents @section Transcribing html Documents @example file2brl -t infile outfile @end example The @option{-t} option prevents @command{xml2blr} from trying to transcribe infile as an xml document. This will produce a lot of error messages. @command{file2brl} will then try the html parser. Note that xhtml documents are actually xml. @node Transcribing Microsoft Word files with msword2brl, Transcribing RTF files with rtf2brl, Transcribing html Documents, Transcribing Documents @section Transcribing Microsoft Word files with msword2brl @pindex msword2brl @example msword2brl infile outfile @end example Infile must be a Microsoft Word file. The script first calls the @command{antiword} program, so you must have this installed on your machine. @command{antiword} is called with @option{-x db}, which causes the output to be in docbook format. This is piped to @command{file2brl}. The output file from @command{file2brl} contains much of the formatting, including emphasis, of the word file. @node Transcribing RTF files with rtf2brl, Transcribing PDF files with pdf2brl, Transcribing Microsoft Word files with msword2brl, Transcribing Documents @section Transcribing RTF files with rtf2brl @pindex rtf2brl @example rtf2brl infile outfile @end example Infile must be a rich-text (rtf) file, such as Bookshare provides for proofreading. The script first calls @command{rtf2xml}, so you must have this program installed on your machine. You can find it on the downloads page of @uref{www.abilitiessoft.com}. It was copied from its SourceForge project. Since it is a Python program, it can be rather slow. Its output is piped to @command{file2brl}. The output of @command{rtf2xml} is xml with the root element @code{doc}. The file @file{doc.sem} is fairly complete, so the output of @command{file2brl} contains much of the formatting, including emphasis, of the original rtf file. @node Transcribing PDF files with pdf2brl, , Transcribing RTF files with rtf2brl, Transcribing Documents @section Transcribing PDF files with pdf2brl @pindex pdf2brl @example pdf2brl infile outfile @end example Infile must be a PDF (Portable Document Format) file. The script first calls the @command{pdftotext} program, so you must have this installed on your machine. It is part of xpdf and most likely already installed if you're on a modern Linux distribution. Otherwise, you can get it from either @uref{http://poppler.freedesktop.org} or @uref{http://www.foolabs.com/xpdf/download.html}. @command{pdftotext} is called with the @option{-raw} and @option{-} options, which cause it to place its output on stdout. This is piped to @command{file2brl}, which is called with the @option{-p} option, since output from @command{pdftotext} is likely to be poorly formatted. The output file from @command{file2brl} is mostly in sensible paragraphs. @node Customization Configuring liblouisutdml, Connecting with the xml Document, Transcribing Documents, Top @chapter Customization: Configuring liblouisutdml The operation of liblouisutdml is controlled by two types of files: semantic-action files and configuration files. The former are discussed in the section Connecting with the xml Document - Semantic-action Files (@pxref{Connecting with the xml Document, Connecting with the xml Document - Semantic-Action Files, Connecting with the xml Document - Semantic-Action Files }). The latter are discussed in this section. A third type of file, braille translation tables, is discussed in the liblouis documentation (@pxref{Top, , Overview, liblouis, Liblouis User's and Programmer's Manual}). Another section of the present document which may be of interest is Implementing Braille Mathematical Codes (@pxref{Implementing Braille Mathematics Codes}). Besides files, liblouisutdml can also be controlled by configuration strings, which are character strings in memory containing configuration settings separated by end-of-line characters. Such strings can be generated by the @option{-C} option on the @command{file2brl} command line, by the @code{configstring} and @code{configtweak} semantic actions, or by passing a string to the @code{lbu_initialize} function. The information below applies to @command{file2brl} as much as to liblouisutdml. Before discussing configuration files in detail it is worth noting that the application program has access to the information in the configuration files by calling the liblouisutdml function @code{lbu_initialize}. This function returns a pointer to a data structure containing the configuration information. The calling program must include the header file @code{louisutdml.h}. You do not need to call @code{lbu_initialize} unless you need the facilities which it provides. A configuration file specification may contain more than one file name, separated by commas. liblouisutdml will process these files in sequence, merging the information they contain. The first file name may also contain a path. liblouisutdml will search for the files it needs first on this path. To make it search first the current directory precede the first file name with @code{./}. After the path, if any, has been evaluated, but before reading any of the files, liblouisutdml reads in a file called @file{liblouisutdml.ini}. This file can contain any configuration settings, but it usually contains only the minimum ones for liblouisutdml to operate properly. You may alter the values in the distribution @file{liblouisutdml.ini}, but you should not delete any settings. Do not specify @file{liblouisutdml.ini} as your configuration file. This will lead to error messages and program termination. If a configuration file read in later contains a particular setting name, the value specified simply replaces the one specified in @file{liblouisutdml.ini} or any previously read configuration file. Originally, configuration files contained four main sections, @code{outputFormat}, @code{translation}, @code{xml} and @code{style}. The section names, except for @code{style} are now optional. In addition, a configuration file can contain an include entry. This causes the file named on that line to be read in at the point where the line occurs. The sections need not follow each other in any particular order, nor is the order of settings within each section important. The section names, except for @code{style} are optional. In this document and in the @file{liblouisutdml.ini} file, where section and setting names consist of more than one word, the first letter of each word following the initial one is capitalized. This is merely for readability. The case of the letters in these names is ignored by the program. Section and setting names may not contain spaces. In addition to @file{liblouisutdml.ini} the distribution also sontains a number of configuration files. The most important of these is @file{preferences.cfg}, which contains all possible settings and a "default" value for each. You should use this file as a refererence. It is the file read by the @command{file2brl} command-line interface program if no configuration file is giben. Here, then, is an explanation of each section and setting in the @file{preferences.cfg} file. When you look at this file you will see that the section names start at the left margin, while the settings are indented one tab stop. This is done for readability. it has no effect on the meaning of the lines. You will also see lines beginning with a number sign (@samp{#}), which are comments. Blank lines can also be used anywhere in a configuration file. In general, a section name is a single word or combination of unspaced words. However, each style has a section of its own, so the word @samp{style} is followed by a space then by the name of the style. Setting lines begin with the name of the setting, followed by at least one space or tab, followed by the value of the setting. A few settings have two values. @menu * outputFormat:: * translation:: * xml:: * style:: @end menu @node outputFormat, translation, Customization Configuring liblouisutdml, Customization Configuring liblouisutdml @section outputFormat This section specifies the format of the output file (or string). @table @code @setting{cellsPerLine, 40} The number of cells in a braille line. @setting{linesPerPage, 25} The number of lines on a braille page @setting{interpoint, no} Whether or not the output will be used to produce interpoint braille. This affects the placement of page numbers and may affect other things in the future. The only two values recognized are @samp{yes} and @samp{no}. @setting{lineEnd, \\r\\n} This specifies the control characters to be placed at the end of each output line. These characters vary from one intended use of the output to another. Most embossers require the carriage-return and line-feed combination specified above. However, a braille display may work best with just one or the other. Any valid control characters can be specified. @setting{pageEnd, \\f} The control Character to be given at the end of a page. Here it is a forms-feed character, but it can be something else if deeded. @setting{fileEnd, ^z} The control character to be placed at the end of the file, here a control-z. @setting{printPages, yes} Whether or not to show print page numbers if they are given in the xml input. The two valid values are @samp{yes} and @samp{no}. @setting{braillePages, yes} Whether or not to format the output into pages. Here the value is @samp{yes}, for use with an embosser. However the user of a braille display may wish to specify @samp{no}, so as not to be bothered with page numbers and forms feed characters. If no is specified the lines will still be of the length given in @code{cellsPerLine}, but the value of @code{linesPerPage} will be ignored. @setting{paragraphs, yes} Whether or not to format the output into paragraphs, using appropriate styles. If @samp{no} is specified, what would be a paragraph is output simply as one long line. Applications that wish to do their own formatting may specify @samp{no}. @setting{beginningPageNumber, 1} This is the number to be placed on the first Braille page if @code{braillePages} is yes. This is useful when producing multiple Braille volumes. @setting{printPageNumberAt, top} If print page numbers are given in the xml input file they will be placed at the top of each braille page in the right-hand corner. If @code{pageSeparator} is set to @samp{yes}, a page separator line will also be produced on the Braille page where the print page break actually occurs. You may also specify @samp{bottom} for this setting. @setting{braillePageNumberAt, bottom} The braille page number will be placed in the bottom right-hand corner of each page. If @code{interpoint yes} has been specified only odd pages will receive page numbers. You may also specify @samp{top} for this setting. If print page numbers and Braille page numbers are both placed at the top or bottom, they are rendered next to each other with a space in between. @anchor{continuePages setting} @setting{continuePages, yes} Print page numbers can be prefixed with a letter (a, b, c, etc.) on continued pages. The two valid values are @samp{yes} and @samp{no}. @anchor{pageSeparator setting} @setting{pageSeparator, yes} A page separator line (or page break indicator), a line of unspaced Braille dots 36, will be placed wherever a print page break occurs. No page separator lines are placed on the first or last line of a Braille page, and no page separator lines are shown when the new print page coincides with a new Braille page. @setting{pageSeparatorNumber, yes} Show a page number at the far right margin of a page separator line. No space is left between the separator line and the first symbol of the page number. @setting{ignoreEmptyPages, yes} An empty page occurs when a @code{pagenum} tag is immediately followed by another @code{pagenum} tag. By default, empty pages are completely ignored. If you specify @samp{no} for this setting, a sequence of @code{pagenum} tags will lead to a @emph{combined} print page number: the number of the first empty page is combined with that of the page on which text reappears, e.g. 5-7. If lettered continuation pages are required (see @code{continuePages}), they carry only the number of the page on which text reappears. @anchor{printPageNumberRange setting} @setting{printPageNumberRange, no} By default, only the page number of the @emph{first} print page on a Braille page is shown at the top or bottom. However, if @code{printPageNumberRange} is set to @samp{yes}, the @emph{range} of print pages contained in the current Braille page is displayed. If the first page in this range is a continued print page, it is prefixed with a letter as usual (see @code{continuePages}). @setting{mergeUnnumberedPages, yes} Page breaks without a page number can simply be ignored. This means that unnumbered print pages will be treated as if they were a part of the preceding page. You can also specify @samp{no} for this setting. @setting{pageNumberTopSeparateLine, yes} Whether or not to provide a separate line for page numbers when they are placed at the top of a Braille page. The two valid values are @samp{yes} and @samp{no}. A print page number range (see @code{printPageNumberRange}) at the top of a page is always displayed on a separate line. @setting{pageNumberBottomSeparateLine, yes} Whether or not to provide a separate line for page numbers when they are placed at the bottom of a Braille page. @setting{hyphenate, no} If @samp{yes} is specified words will be hyphenated at the ends of lines if a hyphenation table is available. In contracted English Braille hyphenation is not generally used, but it can save considerable space. The hyphenation table is specified as part of the table list in the @code{literaryTextTable} setting of the translation section. @setting{outputEncoding, ascii8} This specifies that the output is to be in the form of 8-bit ASCII characters. This is generally used if the output is intended directly for a braille embosser or display. The other values of encoding are @samp{UTF8}, @samp{UTF16} and @samp{UTF32}. These are useful if the application will process the output further, such as for generating displays of braille dots on a screen. @setting{inputTextEncoding, ascii8} This setting is used to specify the encoding of an input text file. The valid values are @samp{UTF8} and @samp{ascii8}. @anchor{formatFor setting} @setting{formatFor, textDevice} This setting specifies the type of device the output is intended for. @samp{textDevice} is any device that accepts plain text, including embossers. You can also specify @samp{browser}. In this case the output will be formatted for viewing in a browser. If the input file contains links, they will be preserved and can be used in the normal way. The text will be translated into braille with the correct line length. Math and computer material will be translated appropriately. These files work well in lynx and Internet Explorer, not so well in elinks and Firefox (Before Jaws 10). @setting{backFormat, plain} This setting specifies the format of back-translated files. @samp{Plain} specifies plain-text, while @samp{html} specifies xhtml. The latter is always encoded in UTF-8. Plain-text files can be encoded in ascii8, UTF-8 or UTF-16. Html is strongly recommended, since it will preserve print page numbering and emphasis. @setting{backLineLength, 70} This setting specifies the length of lines in back-translated files, whether in plain-text or html. This is mainly for human readability. Lines may sometimes be somewhat longer. @setting{interline, no} This setting specifies whether interlining is desired. If it is set to @samp{yes}, the first line in the output will be a braille translation, the next line will be its back-translation according to the interlineBackTable. Back-translation is used instead of simply presenting the print original because a braille line may contain additional information, such as leading blanks, print or braille page numbers, print page separator lines, etc. @anchor{lineFill setting} @setting{lineFill, '} This setting defines the fill character that will be used before the page numbers in the table of contents for example. The default fill character is an apostrophe (dot 3). @end table @node translation, xml, outputFormat, Customization Configuring liblouisutdml @section translation This section specifies the liblouis translation tables to be used for various purposes. @table @code @setting{literaryTextTable, en-us-g2.ctb} The table used for producing literary braille. This may be either contracted or uncontracted. @setting{uncontractedTable, en-us-g1.ctb} The table used for producing uncontracted or Grade One braille. This setting appears to be superfluous and may be eliminated in the future. @setting{compbrailleTable, en-us-compbrl.ctb} The table used for producing large amounts of output in computer braille, such as computer programs. The computer braille table is usually combined with one of the two tables above. @setting{mathtextTable, en-us-mathtext.ctb} This table specifies how the non-mathematical parts of math books are to be translated. In many cases it will be the same as literaryTextTable or uncontractedTable. For books translated with the Nemeth Code it is different, because this code requires modification of standard Grade Two. @setting{MathexpTable, nemeth.ctb} This is the table used to translate mathematical expressions. @setting{editTable, nemeth_edit.ctb} When the output includes both mathematics and text there may be errors where one type of translation directly follows another. The editTable removes these errors. @setting{interlineBackTable, en-us-interline.ctb} This setting specifies the table to be used for back-translation when interlining is turned on. It must be tailored for this purpose, since an ordinary forward-translation table may contain entries that do not handle the additional information in braille lines correctly. @end table @node xml, style, translation, Customization Configuring liblouisutdml @section xml This section provides various information for the processing of xml files. @table @code @setting{semanticFiles, *\,nemeth.sem} This setting gives a list of semantic-action files. These files are read in the sequence given in the list. Here the first member of the list is an asterisk (@samp{*}). This means that the corresponding file is to be named by taking the root element of the document and appending @samp{.sem}. This asterisk member may occur anywhere in the list. @setting{xmlheader, } This line gives the xml header to be added to strings produced by programs like @command{Mathtype} that lack one. @setting{entity, nbsp ^1} This line defines an entity or substitution in an xml file. It is one of those that has two values. The first is the thing to be replaced, and the second is the replacement. As many entity lines as necessary can be used. The information they contain is added to the information provided by xmlHeader. In @file{liblouisutdml.ini} this line is commented out, because specifying it at this point would prevent the user from specifying his own xmlheader. @setting{internetAccess, yes} The computer has an internet connection and liblouisutdml may obtain information necessary for the processing of this file from the Internet. If this setting is @samp{no} liblouisutdml will not try to use the internet. The necessary information may, however, be provided on the local machine in the form of a "dtd" file. @setting{newEntries, yes} liblouisutdml may create a new semantic-action file (beginning with @file{new_}) for a document with an unknown root element or a file (beginning with @file{appended_}) containing new entries for an existing semantic-action file. Both kinds of files are placed on the current directory. If this setting is @samp{no} liblouisutdml will not create a file of new entries and if it encounters a document with an unknown root element it will issue an error message. Setting newEntries to @samp{no} may be useful if users should not be bothered with the minutiae of semantic-action files. @end table @node style, , xml, Customization Configuring liblouisutdml @section style The following sections all deal with styles. Each style has its own section. Style section names are unlike other section names in that they consist of the word style, followed by a space, followed by a style name. With some exceptions, styles are not hard-coded. The user may define any style desired, with any name except @code{document}, @code{para}, @code{heading1}, @code{heading2}, @code{heading3}, @code{heading4}, @code{contentsheader}, @code{contents1}, @code{contents2}, @code{contents3} and @code{contents4}. The first two are needed for basic formatting. The others are needed for the table of contents tool. The user must define settings for these styles as for any others. This is done in @file{liblouisutdml.ini}, which also contains definitions and settings for many other styles. The user can add styles at any time in her/his own configuration files. Styles can be nested. That is, a document may contain a section of one style, and inside this may be a section of another style. For example, you might have styles named frontMatter, titlePage, dedication, contents, and so on. Your document might contain a section of style frontMatter. Inside this section might be subsections of styles titlePage, dedication, contents, and so on. Inside the titlePage section there might be other sections with styles heading1, para, centered, etc. Your frontMatter style might also define the "persistent" style setting @code{braillePageNumberFormat roman}. This setting will apply to all the styles nested within frontMatter, unless they have a setting other than @samp{normal}, which is the default and means ordinary braille page numbers. However, the titlePage style might have the setting @code{braillePageNumberFormat blank}. This will apply to all styles nested within it. When the titlePage section ends, the frontMatter setting @samp{roman} will be restored. The @samp{braiblePageNumberFormat} setting is an example of a "persistent" style setting. Most settings apply only to the style for which they are declared. Below are the settings for the predefined style names. The @samp{document} style contains all possible settings. The others contain only settings that are different from the defaults. @subsection style document This is a predefined style name. All settings have their default values. The user must specify any other values. If a "persistent" style setting is specified, it will apply to the whole ducument. @table @code @setting{linesBefore, 0} This setting gives the number of blank lines which should be left before the text to which this style applies. It is set to a non-zero value for some header styles. @setting{linesAfter, 0} The number of blank lines which should be left after the text to which this style applies. @setting{leftMargin, 0} The number of cells by which the left margin of all lines in the text should be indented. Used for hanging indents, among other things. This is a "persistent" setting, so by default all nested styles will inherit the setting. @setting{rightMargin, 0} The equivalent of @samp{leftMargin} for the right side of the page. This is also a persistent setting. @setting{firstLineIndent, 0} The number of cells by which the first line is to be indented relative to leftMargin. firstLineIndent may be negative. If the result is less than 0 it will be set to 0. This setting is persistent. @setting{translate, contracted} This setting is currently inactive. It may be used in the future. This setting tells how text in this style should be translated. Possible values are @samp{contracted}, @samp{uncontracted}, @samp{compbrl}, @samp{mathtext} and @samp{mathexpr}. @setting{skipNumberLines, no} If this setting is @samp{yes} the top and bottom lines on the page will be skipped if they contain braille or print page numbers. This is useful in some of the mathematical and graphical styles. @setting{format, leftJustified} The format setting controls how the text in the style will be formatted. Valid values are @samp{leftJustified}, @samp{rightJustified}, @samp{centered}, @samp{computerCoded}, @samp{alignColumnsLeft}, @samp{alignColumnsRight}, and @samp{contents}. The first three are self-explanatory. @samp{computerCoded} is used for computer programs and similar material. The next two are used for tabular material. @samp{alignColumnsLeft} causes the left ends of columns to be aligned. @samp{alignColumnsRight} causes the right ends of columns to be aligned. @samp{contents} is used only in styles specifically intended for tables of contents. In the case of @samp{leftJustified}, @samp{rightJustified} and @samp{centered}, nested styles inherit this setting by default. @setting{newPageBefore, no} If this setting is @samp{yes}, the text will begin on a new page. This is useful for certain mathematical and graphical styles. Page numbers are handled properly. @setting{newPageAfter, no} If this setting is @samp{yes} any remaining space on the page after the material covered by this style is handled is left blank, except for page numbers. @setting{rightHandPage, no} if this setting is @samp{yes} and interpoint is yes the material covered by this style will start on a right-hand page. This may cause a left-hand page to be left blank except for page numbers. If interpoint is @samp{no} this setting is equivalent to newPageBefore. @setting{braillePageNumberFormat, normal} This setting specifies the format of braille page numbers. @samp{normal} means ordinary Arabic numbers. @samp{roman} means Roman numbers. @samp{p} means to precede Arabic numbers with the letter "p" (for preliminary). Finally, @samp{blank} causes the page number to be blank (no page numbers). This is a "persistent" style setting. @setting{dontSplit, no} If this setting is @samp{yes}, the element is protected from being split across pages. This means that if a block of text doesn't fit on the current page, it will be placed at the beginning of the next one. This setting applies to the whole element, including children, so if nested styles specify other values for @samp{dontSplit}, these values will be ignored. @setting{keepWithNext, no} If this setting is @samp{yes}, the element covered by this style is protected from being split across pages, and in addition it is kept together with the first line of text of the next sibling. @setting{orphanControl, 0} With this setting you can control how many lines of text of an element must be printed at least at the bottom of a braille page. The default value is @samp{0}. To have an effect, the setting must have a value of @samp{2} or more. @end table @anchor{contentsheader style} @subsection style contentsheader This style is used to specify where the table of contents should be placed and its title. The xml tag assigned to it in the semantic action file should be placed in the document where you want the table of contents, and it should contain the title of that table between its starting and ending markers. @table @code @setting{linesBefore, 1} @setting{linesAfter, 1} @setting{format, centered} @end table @subsection style contents1 This style and the other contents styles are used for the table of contents and correspond to the ten heading levels (@samp{contents5}, @samp{contents6}, @samp{contents7}, @samp{contents8}, @samp{contents9} and @samp{contents10} are not showed here). @table @code @setting{firstLineIndent, -2} @setting{leftMargin, 2} @setting{format, contents} @end table @subsection style contents2 @table @code @setting{firstLineIndent, -2} @setting{leftMargin, 4} @setting{format, contents} @end table @subsection style contents3 @table @code @setting{firstLineIndent, -2} @setting{leftMargin, 6} @setting{format, contents} @end table @subsection style contents4 @table @code @setting{firstLineIndent, -2} @setting{leftMargin, 8} @setting{format, contents} @end table @subsection style heading1 This style is used for main headings, such as chapter titles. @table @code @setting{linesBefore, 1} @setting{center, yes} @setting{linesAfter, 1} @end table @subsection style heading2 The first level of subheadings after the main heading. @table @code @setting{linesBefore, 1} @setting{firstLineIndent, 4} @end table @subsection style heading3 The third level of headings. @table @code @setting{firstLineIndent, 4} @end table @subsection style heading4 The fourth level of headings. There are six more levels: @samp{heading5}, @samp{heading6}, @samp{heading7}, @samp{heading8}, @samp{heading9} and @samp{heading10}. @table @code @setting{firstLineIndent, 4} @end table @subsection style para Paragraph. This is ordinary body text. @table @code @setting{firstLineIndent, 2} @end table @node Connecting with the xml Document, Special Features, Customization Configuring liblouisutdml, Top @chapter Connecting with the xml Document - Semantic-Action Files @menu * Semantic Actions Overview:: * Semantic Actions in detail:: * Pseudo-actions:: * Using XPath Expressions:: @end menu @node Semantic Actions Overview, Semantic Actions in detail, Connecting with the xml Document, Connecting with the xml Document @section Overview When liblouisutdml (or @command{file2brl}) processes an xml document, it needs to be told how to use the information in that document to produce a properly translated and formatted braille document. These instructions are provided by a semantic-action file, so called because it explains the meaning, or semantics, of the various specifications in the xml document. To understand how this works, it is necessary to have a basic knowledge of the organization of an xml document. An xml document is organized like a book, but with much finer detail. First there is the title of the whole book. Then there are various sections, such as author, copyright, table of contents, dedication, acknowledgments, preface, various chapters, bibliography, index, and so on. Each chapter may be divided into sections, and these in turn can be divided into subsections, subsubsections, etc. In a book the parts have names or titles distinguished by capitalization, type fonts, spacing, and so forth. In an xml document the names of the parts are enclosed in angle brackets (@samp{<>}). For example, if liblouisutdml encounters @code{} at the beginning of a document, it knows it is dealing with a document that conforms to the standards of the extensible markup language (xhtml) - at least we hope it does. When you see a book, you know it's a book. The computer can know only by being told. Something enclosed in angle brackets is called an "element" (more properly, a "tag") in xml parlance. (There may be more between the angle brackets than just the name of the element. More of this later). The first "element" in a document thus tells liblouisutdml what kind of document it is dealing with. This element is called the "root element" because the document is visualized as branching out from it like a tree. Some examples of root elements are @code{}, @code{}, @code{}, @code{} and @code{}. Whenever liblouisutdml encounters a root element that it doesn't know about it creates a new file called a semantic-action file. The name of this file is formed by stripping the angle brackets from the root element, putting @samp{new_} in front of it and adding a period plus the letters @samp{sem}. For example, @samp{new_myformat.sem}. If you look in a directory containing semantic-action files you will see names like @file{html.sem}, @file{dtbook.sem}, @file{math.sem}, and so on. The "new" semantic-action files must be edited by a person and the prefix "new" removed to get an ordinary semantic-action file name. Sometimes it is advantageous to preempt the creation of a semantic-action file for a new root element. For example, an article written according to the docbook specification may have the root element @code{
}. However, the specification itself has the root element @code{}. In this case you can specify the @file{book.sem} file in the configuration file by writing, in the xml section,: @example semanticFiles book.sem @end example You will note that this setting uses the plural of "file". This is because you can actually specify a list of file names separated by commas. You might want to do this to specify the semantic-action file for the particular braille mathematical code to be used. For example: @example semanticFiles book.sem,ukmaths.sem @end example You can use an asterisk @code{*} to specify the semantic-action file corresponding to the root element of the document anywhere in the list. As you will see in the next section, different braille style conventions and different braille mathematical codes may require different semantic-action files liblouisutdml records the names of all elements found in the document in the semantic-action file. The document has a multitude of elements, which can be thought of as describing the headings of various parts of the document. One element is used to denote a chapter heading. Another is used to denote a paragraph, Still another to denote text in bold type, and so on. In other words, the elements take the place of the capitalization, changes in type font, spacing, etc. in a book. However, the computer still does not know what to do when it encounters an element. The semantic-action file tells it that. Consider @file{html.sem}. A copy is included as part of this documentation with the name @file{example_html.sem} (@pxref{html.sem}). It may differ from the file that liblouisutdml is currently using. You will see that it begins with some lines about copyrights. Each line begins with a number sign (@samp{#}). This indicates that it is a "comment", intended for the human reader and the computer should ignore it. Then there is a blank line. Finally, there are two other comments explaining that the file must be edited to get proper output. This is because a human being must tell the computer what to do with each element. The semantic files for common types of documents have already been edited, so you generally don't have to worry about this. But if you encounter a new type of document or wish to specify special handling for styles or mathematics you may have to edit the semantic-action file or send it to the maintainer for editing. In any case the rest of this section is essential for understanding how liblouisutdml handles documents and for making changes if the way it does so is not correct. After another blank line you will see a table consisting of two, and sometimes three, columns. The first column contains a word which tells the computer to do something. For example, the first entry in the table is: @samp{include nemeth.sem}. This tells liblouisutdml to include the information in the @file{nemeth.sem} file when it is deciphering an html (actually xhtml) document (it may be preferable to use the semanticFiles setting in the configuration file rather than an include). The second row of the table is: @example no hr @end example @samp{hr} is an element with the angle brackets removed. It means nothing in itself. However, the first column contains the word @samp{no}. This tells liblouisutdml "no do", that is, do nothing. This is not strictly true, since liblouisutdml will sometimes insert a blank space so that words in text do not run together. After a few more lines with @samp{no} in the first column, we see one that says: @example softreturn br @end example This means that when the element @code{

} is encountered, liblouisutdml is to do a soft return, that is, start a new line without starting a new paragraph. The next line says: @example heading1 h1 @end example This tells liblouisutdml that when it encounters the element @code{

} it is to format the text which follows as a first-level braille heading, that is, the text will be centered and preceeded and followed by blank lines. (You can change this by changing the definition of the heading1 style). The next line says: @example italicx em @end example This tells liblouisutdml that when it encounters the element @code{} it is to enclose the text which follows in braille italic indicators. The @samp{x} at the end of the semantic action name is there to prevent conflicts with names elsewhere in the software. Just where the italic indicators will be placed is controlled by the liblouis translation table in use. The next line says: @example skip style @end example This tells liblouis to simply skip ahead until it encounters the element @code{}. Nothing in between will have any effect on the braille output. Note the slash (@samp{/}) before the @samp{style}. This means the end of whatever the @code{

Liblouisutdml User's and Programmer's Manual

Table of Contents

Liblouisutdml User's and Programmer's Manual

This manual is for liblouisutdml (version 2.5.0, 25 November 2012), an xml to Braille Translation Library.

This file may contain code borrowed from the Linux screenreader BRLTTY, Copyright © 1999-2009 by the BRLTTY Team.

Copyright © 2004-2009 ViewPlus Technologies, Inc. www.viewplus.com and Copyright © 2006,2009 Abilitiessoft, Inc. www.abilitiessoft.com.

This file is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser (or library) General Public License (LGPL) as published by the Free Software Foundation; either version 3, or (at your option) any later version.

This file 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 Lesser (or Library) General Public License LGPL for more details.

You should have received a copy of the GNU Lesser (or Library) General Public License (LGPL) along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

1 Introduction

liblouisutdml is a software component which can be incorporated into software packages to provide the capability of translating any file in the computer lingua franca xml format or plain text into properly transcribed braille. This includes translation into grade two, if desired, mathematical codes, etc. It also includes formatting according to a style sheet which can be modified by the user. The first program into which liblouisutdml has been incorporated is file2brl. This program will translate an xml or text file into an embosser-ready braille file. It is not necessary to know xml, because MSWord and other word processors can export files in this format. If the word processor has been used correctly file2brl will produce an excellent braille file.

There is a Mac GUI application incorporating liblouisutdml called louis. For a link to it go to www.abilitiessoft.com/downloads. You can also obtain a Windows binary on this page. At present it is command-line. We hope to have a GUI soon.

Users who want to generate Braille using file2brl will be interested in Transcribing XML files with file2brl. Those who wish to change the output generated by liblouisutdml should read Customization Configuring liblouisutdml. If you encounter a type of xml file with which liblouisutdml is not familiar you can learn how to tell it how to process that file by reading Connecting with the xml Document. If you wish to implement a new braille mathematics code read Implementing Braille Mathematics Codes. Finally, computer programmers who wish to use liblouisutdml in their software can find the information they need in Programming with liblouisutdml.

You will also find it advantageous to be acquainted with the companion library liblouis, which is a braille translator and back-translator (see Overview).

2 Transcribing Documents

2.1 Transcribing XML files with file2brl

At the moment, actual transcription with liblouisutdml is done with the command-line (or console) program file2brl. The line to type is:

     file2brl [OPTIONS] [-f config-file] [infile] [outfile]

The brackets indicate that something is optional. You will see that nothing is required except the program name itself, file2brl. The various optional parts control how the program will behave, as follows:

-h
--help
This option causes file2brl to print a help message describing usage and exit.
-v
--version
This option causes file2brl to display the version information and exit.
-l
--log-file
This option will cause file2brl and liblouisutdml to print error messages to file2brl.log instead of stderr. The file will be in the current directory. This option is particularly useful if file2brl is called by a GUI script or Web application.
-f configfile
--config-file configfile
This specifies the configuration file which tells file2brl how to do the transcription. (It may be a list of file names separated by commas.) This file specifies such things as the number of cells per line, the number of lines per page, The translation tables to be used, how paragraphs and headings are to be formatted, etc. If this part of the command line is omitted, file2brl assumes that the configuration file is named default.cfg. If the configuration file name contains a pathname file2brl will consider this as a path on which to look for files that it needs (see Files and Paths). If no pathname is given the standard paths are searched and finally the current directory. To make file2brl search the current directory first, precede the file name with ./.
-Csetting=value
--config-setting setting=value
This option enables you to specify configuration settings on the command line instead of changing the configuration file. You can use as many -C options as you wish. Any settings can be specified except those having to do with styles. See Configuration Settings Index, for a list of available settings. These must be specified in configuration files. The settings may be in any order. They override any settings in liblouisutdml.ini or in the configuration file used by file2brl.
-b
--backward
back-translate. The input file must be a braille file, such as .brf. The output file is a back-translation of this file. It may be in either plain-text or xhtml (html), according to the setting of backFormat in the outputFormat section of the configuration file. Html files will contain page numbers and emphasis. To get good html, the liblouis table must have the entry `space \e 1b' so that it will pass through escape characters. The html.sem file must also contain the line `pagenum pagenum'. Text output files simply have a blank line between paragraphs. Encoding of text files is controlled by the outputEncoding setting. Html files are always in UTF-8.
-r
--reformat
Reformat. The input file must be a braille file, such as .brf. The output is a braille file formatted according to the configuration file. It is advisable to set backFormat to html, since this will preserve print page numbers and emphasis. This option can be useful for changing the line length and page length of a braille file, for example, from 40 to 32 cells. It is also an excellent way to check the accuracy of liblouis tables. The original page numbers at the tops and bottoms of pages are discarded, and new ones are generated.
-p
--poorly-formatted
Poorly formatted input translation. Infile is any text file such as may have been obtained by extracting the text in a pdf file. The input file may also be an xml or html file which is so poorly formatted that better braille can be obtained by ignoring the formatting. file2brl tries to guess paragraph breaks. The output is generally reasonably formatted, that is, with reasonable paragraph breaks.
-t
--html
The document is an h(t)ml file, not xhtml. This option is useful with files downloaded from the Web in source form. Without it, the program will first try to parse the file as an xml document, producing lots of error messages. It will then try the html parser. With this option, it goes directly to the html parser. See also the formatFor configuration (see formatFor setting) file setting, which enables you to format the braille output for viewing in a browser.
-T
--text
Consider the document to be a text file, even if it is xml or html.
infile
This is the name of the input file containing the material to be transcribed. The file may be either an xml file or a text file. The -b, -r and -p options discussed above provide for other types of files and processing. Typical xml files are those provided by www.bookshare.org or those derived from a word processor by saving in xml format. If a text file is used paragraphs and headings should be separated by blank lines. In such a file there is no way to distinguish between paragraphs and headings, so they will all be formatted as paragraphs, as specified by the configuration file. However, if you want a blank line in the braille transcription use two consecutive blank lines in the text file.
outfile
This is the name of the output file. It will be transcribed as specified by the configuration file and the -C configuration settings. The following paragraphs provide more information on both the input and output files.

file2brl is set up so that it can be used in a "pipe". To do this, omit both infile and outfile. Input is then taken from the standard input unit.

The first file name encountered (a word not preceded by a minus sign) is taken to be the input file and the second to be the output file. If you wish input to be taken from stdin and still want to specify an output file, use one minus sign (`-') for the input file.

If only the program name is typed file2brl assumes that the configuration file is default.cfg, input is from the standard input unit, and output is to the standard output unit.

2.2 Transcribing Text Documents

See the previous section on using file2brl. This program recognizes text files automatically and transcribes them according to the information in the configuration files. Paragraphs must be separated with a blank line. If you want a blank line in the output use two blank lines.

2.3 Transcribing Poorly Formatted Documents

     file2brl -p infile outfile

Some text documents, such as those derived from pdf files, and even some xml and html documents, are so poorly formatted that you can get better braille by ignoring whatever markup they contain. The -p option of file2brl does this. It ignores xml or html markup and uses heuristics to find the beginning of paragraphs. Its choices are usually good. Note that it does not work with rtf files. However, if rtf2xml (see Transcribing RTF files with rtf2brl) will convert the file, it will work with the resulting xml file.

2.4 Transcribing html Documents

     file2brl -t infile outfile

The -t option prevents xml2blr from trying to transcribe infile as an xml document. This will produce a lot of error messages. file2brl will then try the html parser. Note that xhtml documents are actually xml.

2.5 Transcribing Microsoft Word files with msword2brl

     msword2brl infile outfile

Infile must be a Microsoft Word file. The script first calls the antiword program, so you must have this installed on your machine. antiword is called with -x db, which causes the output to be in docbook format. This is piped to file2brl. The output file from file2brl contains much of the formatting, including emphasis, of the word file.

2.6 Transcribing RTF files with rtf2brl

     rtf2brl infile outfile

Infile must be a rich-text (rtf) file, such as Bookshare provides for proofreading. The script first calls rtf2xml, so you must have this program installed on your machine. You can find it on the downloads page of www.abilitiessoft.com. It was copied from its SourceForge project. Since it is a Python program, it can be rather slow. Its output is piped to file2brl. The output of rtf2xml is xml with the root element doc. The file doc.sem is fairly complete, so the output of file2brl contains much of the formatting, including emphasis, of the original rtf file.

2.7 Transcribing PDF files with pdf2brl

     pdf2brl infile outfile

Infile must be a PDF (Portable Document Format) file. The script first calls the pdftotext program, so you must have this installed on your machine. It is part of xpdf and most likely already installed if you're on a modern Linux distribution. Otherwise, you can get it from either http://poppler.freedesktop.org or http://www.foolabs.com/xpdf/download.html. pdftotext is called with the -raw and - options, which cause it to place its output on stdout. This is piped to file2brl, which is called with the -p option, since output from pdftotext is likely to be poorly formatted. The output file from file2brl is mostly in sensible paragraphs.

3 Customization: Configuring liblouisutdml

The operation of liblouisutdml is controlled by two types of files: semantic-action files and configuration files. The former are discussed in the section Connecting with the xml Document - Semantic-action Files (see Connecting with the xml Document - Semantic-Action Files). The latter are discussed in this section. A third type of file, braille translation tables, is discussed in the liblouis documentation (see Overview). Another section of the present document which may be of interest is Implementing Braille Mathematical Codes (see Implementing Braille Mathematics Codes).

Besides files, liblouisutdml can also be controlled by configuration strings, which are character strings in memory containing configuration settings separated by end-of-line characters. Such strings can be generated by the -C option on the file2brl command line, by the configstring and configtweak semantic actions, or by passing a string to the lbu_initialize function.

The information below applies to file2brl as much as to liblouisutdml.

Before discussing configuration files in detail it is worth noting that the application program has access to the information in the configuration files by calling the liblouisutdml function lbu_initialize. This function returns a pointer to a data structure containing the configuration information. The calling program must include the header file louisutdml.h. You do not need to call lbu_initialize unless you need the facilities which it provides.

A configuration file specification may contain more than one file name, separated by commas. liblouisutdml will process these files in sequence, merging the information they contain. The first file name may also contain a path. liblouisutdml will search for the files it needs first on this path. To make it search first the current directory precede the first file name with ./. After the path, if any, has been evaluated, but before reading any of the files, liblouisutdml reads in a file called liblouisutdml.ini. This file can contain any configuration settings, but it usually contains only the minimum ones for liblouisutdml to operate properly. You may alter the values in the distribution liblouisutdml.ini, but you should not delete any settings. Do not specify liblouisutdml.ini as your configuration file. This will lead to error messages and program termination. If a configuration file read in later contains a particular setting name, the value specified simply replaces the one specified in liblouisutdml.ini or any previously read configuration file.

Originally, configuration files contained four main sections, outputFormat, translation, xml and style. The section names, except for style are now optional. In addition, a configuration file can contain an include entry. This causes the file named on that line to be read in at the point where the line occurs. The sections need not follow each other in any particular order, nor is the order of settings within each section important. The section names, except for style are optional. In this document and in the liblouisutdml.ini file, where section and setting names consist of more than one word, the first letter of each word following the initial one is capitalized. This is merely for readability. The case of the letters in these names is ignored by the program. Section and setting names may not contain spaces.

In addition to liblouisutdml.ini the distribution also sontains a number of configuration files. The most important of these is preferences.cfg, which contains all possible settings and a "default" value for each. You should use this file as a refererence. It is the file read by the file2brl command-line interface program if no configuration file is giben.

Here, then, is an explanation of each section and setting in the preferences.cfg file. When you look at this file you will see that the section names start at the left margin, while the settings are indented one tab stop. This is done for readability. it has no effect on the meaning of the lines. You will also see lines beginning with a number sign (`#'), which are comments. Blank lines can also be used anywhere in a configuration file. In general, a section name is a single word or combination of unspaced words. However, each style has a section of its own, so the word `style' is followed by a space then by the name of the style. Setting lines begin with the name of the setting, followed by at least one space or tab, followed by the value of the setting. A few settings have two values.

3.1 outputFormat

This section specifies the format of the output file (or string).

cellsPerLine 40
The number of cells in a braille line.


linesPerPage 25
The number of lines on a braille page


interpoint no
Whether or not the output will be used to produce interpoint braille. This affects the placement of page numbers and may affect other things in the future. The only two values recognized are `yes' and `no'.


lineEnd \r\n
This specifies the control characters to be placed at the end of each output line. These characters vary from one intended use of the output to another. Most embossers require the carriage-return and line-feed combination specified above. However, a braille display may work best with just one or the other. Any valid control characters can be specified.


pageEnd \f
The control Character to be given at the end of a page. Here it is a forms-feed character, but it can be something else if deeded.


fileEnd ^z
The control character to be placed at the end of the file, here a control-z.


printPages yes
Whether or not to show print page numbers if they are given in the xml input. The two valid values are `yes' and `no'.


braillePages yes
Whether or not to format the output into pages. Here the value is `yes', for use with an embosser. However the user of a braille display may wish to specify `no', so as not to be bothered with page numbers and forms feed characters. If no is specified the lines will still be of the length given in cellsPerLine, but the value of linesPerPage will be ignored.


paragraphs yes
Whether or not to format the output into paragraphs, using appropriate styles. If `no' is specified, what would be a paragraph is output simply as one long line. Applications that wish to do their own formatting may specify `no'.


beginningPageNumber 1
This is the number to be placed on the first Braille page if braillePages is yes. This is useful when producing multiple Braille volumes.


printPageNumberAt top
If print page numbers are given in the xml input file they will be placed at the top of each braille page in the right-hand corner. If pageSeparator is set to `yes', a page separator line will also be produced on the Braille page where the print page break actually occurs. You may also specify `bottom' for this setting.


braillePageNumberAt bottom
The braille page number will be placed in the bottom right-hand corner of each page. If interpoint yes has been specified only odd pages will receive page numbers. You may also specify `top' for this setting. If print page numbers and Braille page numbers are both placed at the top or bottom, they are rendered next to each other with a space in between.


continuePages yes
Print page numbers can be prefixed with a letter (a, b, c, etc.) on continued pages. The two valid values are `yes' and `no'.


pageSeparator yes
A page separator line (or page break indicator), a line of unspaced Braille dots 36, will be placed wherever a print page break occurs. No page separator lines are placed on the first or last line of a Braille page, and no page separator lines are shown when the new print page coincides with a new Braille page.


pageSeparatorNumber yes
Show a page number at the far right margin of a page separator line. No space is left between the separator line and the first symbol of the page number.


ignoreEmptyPages yes
An empty page occurs when a pagenum tag is immediately followed by another pagenum tag. By default, empty pages are completely ignored. If you specify `no' for this setting, a sequence of pagenum tags will lead to a combined print page number: the number of the first empty page is combined with that of the page on which text reappears, e.g. 5-7. If lettered continuation pages are required (see continuePages), they carry only the number of the page on which text reappears.


printPageNumberRange no
By default, only the page number of the first print page on a Braille page is shown at the top or bottom. However, if printPageNumberRange is set to `yes', the range of print pages contained in the current Braille page is displayed. If the first page in this range is a continued print page, it is prefixed with a letter as usual (see continuePages).


mergeUnnumberedPages yes
Page breaks without a page number can simply be ignored. This means that unnumbered print pages will be treated as if they were a part of the preceding page. You can also specify `no' for this setting.


pageNumberTopSeparateLine yes
Whether or not to provide a separate line for page numbers when they are placed at the top of a Braille page. The two valid values are `yes' and `no'. A print page number range (see printPageNumberRange) at the top of a page is always displayed on a separate line.


pageNumberBottomSeparateLine yes
Whether or not to provide a separate line for page numbers when they are placed at the bottom of a Braille page.


hyphenate no
If `yes' is specified words will be hyphenated at the ends of lines if a hyphenation table is available. In contracted English Braille hyphenation is not generally used, but it can save considerable space. The hyphenation table is specified as part of the table list in the literaryTextTable setting of the translation section.


outputEncoding ascii8
This specifies that the output is to be in the form of 8-bit ASCII characters. This is generally used if the output is intended directly for a braille embosser or display. The other values of encoding are `UTF8', `UTF16' and `UTF32'. These are useful if the application will process the output further, such as for generating displays of braille dots on a screen.


inputTextEncoding ascii8
This setting is used to specify the encoding of an input text file. The valid values are `UTF8' and `ascii8'.


formatFor textDevice
This setting specifies the type of device the output is intended for. `textDevice' is any device that accepts plain text, including embossers. You can also specify `browser'. In this case the output will be formatted for viewing in a browser. If the input file contains links, they will be preserved and can be used in the normal way. The text will be translated into braille with the correct line length. Math and computer material will be translated appropriately. These files work well in lynx and Internet Explorer, not so well in elinks and Firefox (Before Jaws 10).


backFormat plain
This setting specifies the format of back-translated files. `Plain' specifies plain-text, while `html' specifies xhtml. The latter is always encoded in UTF-8. Plain-text files can be encoded in ascii8, UTF-8 or UTF-16. Html is strongly recommended, since it will preserve print page numbering and emphasis.


backLineLength 70
This setting specifies the length of lines in back-translated files, whether in plain-text or html. This is mainly for human readability. Lines may sometimes be somewhat longer.


interline no
This setting specifies whether interlining is desired. If it is set to `yes', the first line in the output will be a braille translation, the next line will be its back-translation according to the interlineBackTable. Back-translation is used instead of simply presenting the print original because a braille line may contain additional information, such as leading blanks, print or braille page numbers, print page separator lines, etc.


lineFill '
This setting defines the fill character that will be used before the page numbers in the table of contents for example. The default fill character is an apostrophe (dot 3).

3.2 translation

This section specifies the liblouis translation tables to be used for various purposes.

literaryTextTable en-us-g2.ctb
The table used for producing literary braille. This may be either contracted or uncontracted.


uncontractedTable en-us-g1.ctb
The table used for producing uncontracted or Grade One braille. This setting appears to be superfluous and may be eliminated in the future.


compbrailleTable en-us-compbrl.ctb
The table used for producing large amounts of output in computer braille, such as computer programs. The computer braille table is usually combined with one of the two tables above.


mathtextTable en-us-mathtext.ctb
This table specifies how the non-mathematical parts of math books are to be translated. In many cases it will be the same as literaryTextTable or uncontractedTable. For books translated with the Nemeth Code it is different, because this code requires modification of standard Grade Two.


MathexpTable nemeth.ctb
This is the table used to translate mathematical expressions.


editTable nemeth_edit.ctb
When the output includes both mathematics and text there may be errors where one type of translation directly follows another. The editTable removes these errors.


interlineBackTable en-us-interline.ctb
This setting specifies the table to be used for back-translation when interlining is turned on. It must be tailored for this purpose, since an ordinary forward-translation table may contain entries that do not handle the additional information in braille lines correctly.

3.3 xml

This section provides various information for the processing of xml files.

semanticFiles *,nemeth.sem
This setting gives a list of semantic-action files. These files are read in the sequence given in the list. Here the first member of the list is an asterisk (`*'). This means that the corresponding file is to be named by taking the root element of the document and appending `.sem'. This asterisk member may occur anywhere in the list.


xmlheader <?xml version='1.0' encoding='UTF8' standalone='yes'?>
This line gives the xml header to be added to strings produced by programs like Mathtype that lack one.


entity nbsp ^1
This line defines an entity or substitution in an xml file. It is one of those that has two values. The first is the thing to be replaced, and the second is the replacement. As many entity lines as necessary can be used. The information they contain is added to the information provided by xmlHeader. In liblouisutdml.ini this line is commented out, because specifying it at this point would prevent the user from specifying his own xmlheader.


internetAccess yes
The computer has an internet connection and liblouisutdml may obtain information necessary for the processing of this file from the Internet. If this setting is `no' liblouisutdml will not try to use the internet. The necessary information may, however, be provided on the local machine in the form of a "dtd" file.


newEntries yes
liblouisutdml may create a new semantic-action file (beginning with new_) for a document with an unknown root element or a file (beginning with appended_) containing new entries for an existing semantic-action file. Both kinds of files are placed on the current directory. If this setting is `no' liblouisutdml will not create a file of new entries and if it encounters a document with an unknown root element it will issue an error message. Setting newEntries to `no' may be useful if users should not be bothered with the minutiae of semantic-action files.

3.4 style

The following sections all deal with styles. Each style has its own section. Style section names are unlike other section names in that they consist of the word style, followed by a space, followed by a style name. With some exceptions, styles are not hard-coded. The user may define any style desired, with any name except document, para, heading1, heading2, heading3, heading4, contentsheader, contents1, contents2, contents3 and contents4. The first two are needed for basic formatting. The others are needed for the table of contents tool. The user must define settings for these styles as for any others. This is done in liblouisutdml.ini, which also contains definitions and settings for many other styles. The user can add styles at any time in her/his own configuration files.

Styles can be nested. That is, a document may contain a section of one style, and inside this may be a section of another style. For example, you might have styles named frontMatter, titlePage, dedication, contents, and so on. Your document might contain a section of style frontMatter. Inside this section might be subsections of styles titlePage, dedication, contents, and so on. Inside the titlePage section there might be other sections with styles heading1, para, centered, etc.

Your frontMatter style might also define the "persistent" style setting braillePageNumberFormat roman. This setting will apply to all the styles nested within frontMatter, unless they have a setting other than `normal', which is the default and means ordinary braille page numbers. However, the titlePage style might have the setting braillePageNumberFormat blank. This will apply to all styles nested within it. When the titlePage section ends, the frontMatter setting `roman' will be restored. The `braiblePageNumberFormat' setting is an example of a "persistent" style setting. Most settings apply only to the style for which they are declared.

Below are the settings for the predefined style names. The `document' style contains all possible settings. The others contain only settings that are different from the defaults.

3.4.1 style document

This is a predefined style name. All settings have their default values. The user must specify any other values. If a "persistent" style setting is specified, it will apply to the whole ducument.

linesBefore 0

This setting gives the number of blank lines which should be left before the text to which this style applies. It is set to a non-zero value for some header styles.


linesAfter 0

The number of blank lines which should be left after the text to which this style applies.


leftMargin 0

The number of cells by which the left margin of all lines in the text should be indented. Used for hanging indents, among other things. This is a "persistent" setting, so by default all nested styles will inherit the setting.


rightMargin 0

The equivalent of `leftMargin' for the right side of the page. This is also a persistent setting.


firstLineIndent 0

The number of cells by which the first line is to be indented relative to leftMargin. firstLineIndent may be negative. If the result is less than 0 it will be set to 0. This setting is persistent.


translate contracted

This setting is currently inactive. It may be used in the future. This setting tells how text in this style should be translated. Possible values are `contracted', `uncontracted', `compbrl', `mathtext' and `mathexpr'.


skipNumberLines no

If this setting is `yes' the top and bottom lines on the page will be skipped if they contain braille or print page numbers. This is useful in some of the mathematical and graphical styles.


format leftJustified

The format setting controls how the text in the style will be formatted. Valid values are `leftJustified', `rightJustified', `centered', `computerCoded', `alignColumnsLeft', `alignColumnsRight', and `contents'. The first three are self-explanatory. `computerCoded' is used for computer programs and similar material. The next two are used for tabular material. `alignColumnsLeft' causes the left ends of columns to be aligned. `alignColumnsRight' causes the right ends of columns to be aligned. `contents' is used only in styles specifically intended for tables of contents. In the case of `leftJustified', `rightJustified' and `centered', nested styles inherit this setting by default.


newPageBefore no

If this setting is `yes', the text will begin on a new page. This is useful for certain mathematical and graphical styles. Page numbers are handled properly.


newPageAfter no

If this setting is `yes' any remaining space on the page after the material covered by this style is handled is left blank, except for page numbers.


rightHandPage no

if this setting is `yes' and interpoint is yes the material covered by this style will start on a right-hand page. This may cause a left-hand page to be left blank except for page numbers. If interpoint is `no' this setting is equivalent to newPageBefore.


braillePageNumberFormat normal

This setting specifies the format of braille page numbers. `normal' means ordinary Arabic numbers. `roman' means Roman numbers. `p' means to precede Arabic numbers with the letter "p" (for preliminary). Finally, `blank' causes the page number to be blank (no page numbers). This is a "persistent" style setting.


dontSplit no

If this setting is `yes', the element is protected from being split across pages. This means that if a block of text doesn't fit on the current page, it will be placed at the beginning of the next one. This setting applies to the whole element, including children, so if nested styles specify other values for `dontSplit', these values will be ignored.


keepWithNext no

If this setting is `yes', the element covered by this style is protected from being split across pages, and in addition it is kept together with the first line of text of the next sibling.


orphanControl 0

With this setting you can control how many lines of text of an element must be printed at least at the bottom of a braille page. The default value is `0'. To have an effect, the setting must have a value of `2' or more.

3.4.2 style contentsheader

This style is used to specify where the table of contents should be placed and its title. The xml tag assigned to it in the semantic action file should be placed in the document where you want the table of contents, and it should contain the title of that table between its starting and ending markers.

linesBefore 1

linesAfter 1

format centered

3.4.3 style contents1

This style and the other contents styles are used for the table of contents and correspond to the ten heading levels (`contents5', `contents6', `contents7', `contents8', `contents9' and `contents10' are not showed here).

firstLineIndent -2

leftMargin 2

format contents

3.4.4 style contents2

firstLineIndent -2

leftMargin 4

format contents

3.4.5 style contents3

firstLineIndent -2

leftMargin 6

format contents

3.4.6 style contents4

firstLineIndent -2

leftMargin 8

format contents

3.4.7 style heading1

This style is used for main headings, such as chapter titles.

linesBefore 1

center yes

linesAfter 1

3.4.8 style heading2

The first level of subheadings after the main heading.

linesBefore 1

firstLineIndent 4

3.4.9 style heading3

The third level of headings.

firstLineIndent 4

3.4.10 style heading4

The fourth level of headings. There are six more levels: `heading5', `heading6', `heading7', `heading8', `heading9' and `heading10'.

firstLineIndent 4

3.4.11 style para

Paragraph. This is ordinary body text.

firstLineIndent 2

4 Connecting with the xml Document - Semantic-Action Files

4.1 Overview

When liblouisutdml (or file2brl) processes an xml document, it needs to be told how to use the information in that document to produce a properly translated and formatted braille document. These instructions are provided by a semantic-action file, so called because it explains the meaning, or semantics, of the various specifications in the xml document. To understand how this works, it is necessary to have a basic knowledge of the organization of an xml document.

An xml document is organized like a book, but with much finer detail. First there is the title of the whole book. Then there are various sections, such as author, copyright, table of contents, dedication, acknowledgments, preface, various chapters, bibliography, index, and so on. Each chapter may be divided into sections, and these in turn can be divided into subsections, subsubsections, etc. In a book the parts have names or titles distinguished by capitalization, type fonts, spacing, and so forth. In an xml document the names of the parts are enclosed in angle brackets (`<>'). For example, if liblouisutdml encounters <html> at the beginning of a document, it knows it is dealing with a document that conforms to the standards of the extensible markup language (xhtml) - at least we hope it does. When you see a book, you know it's a book. The computer can know only by being told. Something enclosed in angle brackets is called an "element" (more properly, a "tag") in xml parlance. (There may be more between the angle brackets than just the name of the element. More of this later). The first "element" in a document thus tells liblouisutdml what kind of document it is dealing with. This element is called the "root element" because the document is visualized as branching out from it like a tree. Some examples of root elements are <html>, <math>, <book>, <dtbook> and <wordDocument>. Whenever liblouisutdml encounters a root element that it doesn't know about it creates a new file called a semantic-action file. The name of this file is formed by stripping the angle brackets from the root element, putting `new_' in front of it and adding a period plus the letters `sem'. For example, `new_myformat.sem'. If you look in a directory containing semantic-action files you will see names like html.sem, dtbook.sem, math.sem, and so on. The "new" semantic-action files must be edited by a person and the prefix "new" removed to get an ordinary semantic-action file name.

Sometimes it is advantageous to preempt the creation of a semantic-action file for a new root element. For example, an article written according to the docbook specification may have the root element <article>. However, the specification itself has the root element <book>. In this case you can specify the book.sem file in the configuration file by writing, in the xml section,:

     semanticFiles book.sem

You will note that this setting uses the plural of "file". This is because you can actually specify a list of file names separated by commas. You might want to do this to specify the semantic-action file for the particular braille mathematical code to be used. For example:

     semanticFiles book.sem,ukmaths.sem

You can use an asterisk * to specify the semantic-action file corresponding to the root element of the document anywhere in the list.

As you will see in the next section, different braille style conventions and different braille mathematical codes may require different semantic-action files

liblouisutdml records the names of all elements found in the document in the semantic-action file. The document has a multitude of elements, which can be thought of as describing the headings of various parts of the document. One element is used to denote a chapter heading. Another is used to denote a paragraph, Still another to denote text in bold type, and so on. In other words, the elements take the place of the capitalization, changes in type font, spacing, etc. in a book. However, the computer still does not know what to do when it encounters an element. The semantic-action file tells it that.

Consider html.sem. A copy is included as part of this documentation with the name example_html.sem (see html.sem). It may differ from the file that liblouisutdml is currently using. You will see that it begins with some lines about copyrights. Each line begins with a number sign (`#'). This indicates that it is a "comment", intended for the human reader and the computer should ignore it. Then there is a blank line. Finally, there are two other comments explaining that the file must be edited to get proper output. This is because a human being must tell the computer what to do with each element. The semantic files for common types of documents have already been edited, so you generally don't have to worry about this. But if you encounter a new type of document or wish to specify special handling for styles or mathematics you may have to edit the semantic-action file or send it to the maintainer for editing. In any case the rest of this section is essential for understanding how liblouisutdml handles documents and for making changes if the way it does so is not correct.

After another blank line you will see a table consisting of two, and sometimes three, columns. The first column contains a word which tells the computer to do something. For example, the first entry in the table is: `include nemeth.sem'. This tells liblouisutdml to include the information in the nemeth.sem file when it is deciphering an html (actually xhtml) document (it may be preferable to use the semanticFiles setting in the configuration file rather than an include).

The second row of the table is:

     no hr

`hr' is an element with the angle brackets removed. It means nothing in itself. However, the first column contains the word `no'. This tells liblouisutdml "no do", that is, do nothing. This is not strictly true, since liblouisutdml will sometimes insert a blank space so that words in text do not run together.

After a few more lines with `no' in the first column, we see one that says:

     softreturn br

This means that when the element <br> is encountered, liblouisutdml is to do a soft return, that is, start a new line without starting a new paragraph.

The next line says:

     heading1 h1

This tells liblouisutdml that when it encounters the element <h1> it is to format the text which follows as a first-level braille heading, that is, the text will be centered and preceeded and followed by blank lines. (You can change this by changing the definition of the heading1 style).

The next line says:

     italicx em

This tells liblouisutdml that when it encounters the element <em> it is to enclose the text which follows in braille italic indicators. The `x' at the end of the semantic action name is there to prevent conflicts with names elsewhere in the software. Just where the italic indicators will be placed is controlled by the liblouis translation table in use.

The next line says:

     skip style

This tells liblouis to simply skip ahead until it encounters the element </style>. Nothing in between will have any effect on the braille output. Note the slash (`/') before the `style'. This means the end of whatever the <style> element was referring to. Actually, it was referring to specifications of how things should be printed. If liblouisutdml had not been told to skip these specifications, the braille output would have contained a lot of gobledygook.

The next line says:

     italicx strong

This tells liblouis to also use the italic braille indicators for the text between the <strong> and </strong> elements.

After a few more lines with `no' in the first column we come to the line:

     document html

This tells liblouisutdml that everything between <html> and </html> is an entire document. <html> was the root element of this document, so this is logical.

After another `no' line we come to:

     para p

liblouisutdml will consider everything between <p> and </p> to be a normal body text paragraph.

The next line is:

     heading1 title

this causes the title of the document to also be treated as a braille level 1 heading.

Next we have the line:

     list li

The xhtml <li> and </li> pair of elements is used to enclose an item in a list. liblouisutdml will format this with its own list style. That is, the first line will begin at the left margin and subsequent lines will be indented two cells.

Next we have:

     table table

You will note that the names of actions and elements are often identical. This is because they are both mnemonic. In any case, this line tells liblouisutdml to format the table contained in the xhtml document according to the table formatting rules it has been given for braille output.

Next we have the line:

     heading2 h2

This means that the text between <h2> and </h2> is to be formatted according to the Liblouisutdml style heading2. A blank line will be left before the heading and the first line will be indented four spaces.

After a few more lines we come to:

     no table,cellpadding

Note the comma in the second column. This divides the column into two subcolumns. The first is the table element name. The second is called an "attribute" in xml. It gives further instructions about the material enclosed between the starting and ending "tags" of the element (<table> and </table>. Full information requires three subcolumns. The third is called the value and gives the actual information. The attribute is merely the name of the information.

Much further down we find:

     no table,border,0

Here the element is table, the attribute is border and the value is 0. If liblouisutdml were to interpret this, it would mean that the table was to have a border of 0 width. It is not told to do so because tables in braille do not have borders.

Now let's look at the file which is included at the beginning of the html.sem file. This is nemeth.sem. As with html.sem, a copy is included in the appendix (see nemeth.sem), but it is not necessarily the one that liblouisutdml is currently using. It illustrates several more things about how liblouisutdml uses semantic-action files.

The first thing you will notice is that for quite a few lines the first and second columns are identical. This is because the MathML element and attribute names are part of a standard, and it was simplest to use the element names for the semantic actions as well. Most of these actions do not do anything and could be replaced with the generic semantic action. They are retained for backward compatibility.

The first line of real interest is:

     math math

Every mathematical expression begins with the element <math> (which may have attributes and values), and ends with </math>. This is therefore the root element of a mathematical expression. However, mathematical expressions are usually part of a document, so it is not given the semantic action document. The math semantic action causes liblouisutdml to carry out special interpretation actions. These will become clearer as we continue to look at the nemeth.sem file. You will note that this line has three columns. The meaning of the third column is discussed below.

After another uninteresting line we come to two that illustrate several more facts about semantic-action files:

     mfrac mfrac ^?,/,^#
     mfrac mfrac,linethickness,0 ^(,^;%,^)

Like the math entry above, the first line has three columns. While the first two columns must always be present, the third column is optional. Here, it is also divided into subcolumns by commas. The element <mfrac> indicates a fraction. A fraction has two parts, a numerator and a denominator. In xml, we call these parts children of <mfrac>. They may be represented in various ways, which need not concern us here. What is of real importance is that the third column tells liblouisutdml to put the characters `~?' before the numerator, `/' between the numerator and denominator, and `~#' after the denominator. Later on, liblouis will translate these characters into the proper representation of a fraction in the Nemeth Code of Braille Mathematics. (For other mathematical codes, see Implementing Braille Mathematics Codes).

The second line is of even greater interest. The first column is again `mfrac', but this line is for binomial coefficient. The second column contains three subcolumns, an element name, an attribute name and an attribute value. The attribute linethickness specifies the thickness of the line separating the numerator and denominator. Here it is 0, so there is no line. This is how the binomial coefficient is represented in print. The third column tells how to represent it in braille. liblouisutdml will supply `~(', upper number, `~%', lower number, `~)' to liblouis, which will then produce the proper braille representation for the binomial coefficient.

Returning to the line for the math element, we see that the third column begins with a backslash followed by an asterisk. The backslash is an escape character which gives a special meaning to the character which follows it. Here the asterisk means that what follows is to be placed at the very end of the mathematical expression, no matter how complex it is.

For further discussion of how the third column is used see Implementing Braille Mathematics Codes. The third column is not limited to mathematics. It can be used to add characters to anything enclosed by an xml tag.

4.2 Semantic Actions in detail

Here is a complete list of the semantic actions which liblouisutdml recognizes. Some of them are also the names of styles. These are listed in the first table. For a discussion of these, see Customization Configuring liblouisutdml.

Generally the format of a semantic action is:

     semanticAction elementSpecifier optionalArguments

elementSpecifier is the second-column value, which may be an element name, an element-attribute pair or an element-attribute-value triplet, separated by commas. This specifies where a semantic action is to be applied. If it is solely an element then the action is applied if this element is encountered. If it is an element-attribute pair then the action is applied if the given element also has the specified attribute. In the last case with a element-attribute-value triplet the action is only applied if the element has the specified attribute and the value of this attribute is equal to the specified value.

contenss1 elementSpecifier

Note that the contenss1, etc. semantic actions are never assigned an actual elementSpecifier. There used internally by the table of contents generator. They should be assigned style settings, however.


contenss2 elementSpecifier


contenss3 elementSpecifier


contenss4 elementSpecifier


contentsheader elementSpecifier

This semantic action must be assigned an element specifier if used. See the discussion of it in the section on styles.


document elementSpecifier


heading1 elementSpecifier


heading2 elementSpecifier


heading3 elementSpecifier


heading4 elementSpecifier


para elementSpecifier

The following table expbains each of the non-style semantic actions. In general, each one performs a particular function. If a third column is given, the subcolumns will be inserted in order before each branch of any subtree starting from elementSpecifier.

blankline elementSpecifier

This semantic action causes a blank line to appear in the output wherever it may occur. It is useful for fine formatting independent of styles. elementSpecifier should be an empty element, that is, of the form <elementSpecifier/>. If it is not, any content which it may contain will be ignored.


boldx elementSpecifier

Enclose the text which follows in braille bold indicators. The `x' at the end of the semantic action name is there to prevent conflicts with names elsewhere in the software. Just where the bold indicators will be placed is controlled by the liblouis translation table in use.


boxline elementSpecifier character

A line consisting entirely of the character in the third column is placed in the output. If the third column is blank this semantic action does nothing. It is typically used to form the top and bottom lines of "boxed" material. The character must be chosen to produce the desired dot pattern on the embosser or display in use.


chemistry elementSpecifier

When a module to handle chemical notation is ready, this semantic action will invoke it. The processing will be like that produced by the semantic action math.


changetable elementSpecifier

This semantic action is used to change the active translation table. It can switch to a table for another language or to a table for computer braille in a mathematical expression, etc. elementSpecifier is in the form element,attribute. The document contains something like:

          <span lang="en-us-g1.ctb">
          This is uncontracted.
          </span>
     

The specified table remains in effect from <element attribute="tablename"> until </element>, no matter what is between the two. The previous table is then restored.


compbrl elementSpecifier

The material between elementSpecifier and /elementSpecifier is translated as computer braille, if the liblouis table in use phovides for it. Beginning and ending computer braille indicators are inserted if they are in the table.


configfile elementSpecifier filename

The configfile, configstring and configtweak semantic actions enable the configuration of liblouisutdml to be changed according to the contents of the document being transcribed. configfile and configstring take effect during the document analysis phase performed by examine_document.c. configtweak is effective during the transcription phase, performed by transcribe_document.c and the functions called in this module.

elementSpecifier is the usual second-column value, which may be an element name, an element-attribute pair or an element-attribute-value triplet, separated by commas. filename must be on one of the paths set in the paths.c module. The file may contain any configuration settings except those in the xml section. These would be ineffective, since the document has already been parsed.


configstring elementSpecifier setting1=value1;setting2=value2;...

Note that the setting=value pairs are separated by semicolons. Because the string may be longer than a screen line, you can use a backslash `\' followed immediately by a line ending `\n', to continue to another line. The string must not contain any blanks. Any setting which can be specified in a file read with configfile can be specified in configstring.


configtweak elementSpecifier settings

configtweak is identical to configstring except that it is called in the transcription phase. It can be used for things like changing translation tables. For example:

          configtweak elementSpecifier literaryTextTable=fooTable;\
          mathExprTable=barTable
     

configtweak is not a generalization of changetable. The latter changes the active table and applies to a subtree. configtweak remains in effect until changed by another configtweak.


contracted elementSpecifier


footer elementSpecifier

This semantic action is used to specify a footer which will be placed at the bottom of each page.

          <elemntSpecifier>This is a footer</elementSpecifier>
     


generic elementSpecifier

This is a general-purpose semantic action. If the third column is blank it does absolutely nothing. If the third column contains a string or subcolumns its contents are placed in the output according to the usual rules. That is, the first subcolumn is placed before the first branch of the subtree rooted at this node, the second is placed before the second branch, etc. If the last (or only) subcolumn begins with \* it is placed after the last branch, no matter how many branches there may be.


graphic elementSpecifier

When a module which can handle SVG graphics is ready this semantic action will invoke it.


htmllink elementSpecifier

This semantic action is used when the configuration file specifies formatFor browser. It sets up a link which the browser can follow.


htmltarget elementSpecifier

This semantic action establishes a target for a link in the same file when formatFor browser is specified in the configuration file.


italicx elementSpecifier

Enclose the text which follows in braille italic indicators. The `x' at the end of the semantic action name is there to prevent conflicts with names elsewhere in the software. Just where the italic indicators will be placed is controlled by the liblouis translation table in use.


linespacing elementSpecifier digit

This semantic action specifies the numbr of blank lines to be left between adjacent lines in the output. For example if the third column is `1', lines will be double-spaced. `0' specifies normal spacing. The number cannot be greater than `3'. linespacing remains in effect until another linespacing is encountered. It should be assigned to an empty element.


maction elementSpecifier

In the early stages of development I thought that a separate piece of code might be needed for each of the MathML element tags. It turned out, as noted elsewhere, that most of them could have been handled with the generic semantic action. They are retained for backward compatibi2ity. Therefore, unless this is not the case or additional information is needed, they are simlly listed.


maligngroup elementSpecifier


malignmark elementSpecifier


math elementSpecifier

Every mathematical expression begins with the element <elementSpecifier> math (which may have attributes and values), and ends with </elementSpecifier> (/math). This is therefore the root element of a mathematical expression. However, mathematical expressions are usually part of a document, so it is not given the semantic action document. liblouisutdml will, however, handle files and strings which consist of nothing but a mathematical expression properly. The math semantic action causes liblouisutdml to carry out special interpretation actions.


menclose elementSpecifier


merror elementSpecifier


mfenced elementSpecifier


mfrac elementSpecifier


mglyph elementSpecifier


mi elementSpecifier


mlabeledtr elementSpecifier


mmultiscripts elementSpecifier


mn elementSpecifier


mo elementSpecifier


mover elementSpecifier


mpadded elementSpecifier


mphantom elementSpecifier


mprescripts elementSpecifier


mroot elementSpecifier

The MathML element mroot is actually given the semantic action reverse.


mrow elementSpecifier

This can be important in implementing Math codes because it is often used to create visual groups, which may be significant for braille.


ms elementSpecifier


mspace elementSpecifier

This element and its attributes can be helpful for determining spacing.


msqrt elementSpecifier


mstyle elementSpecifier

This MathML element should usually have the semantic action skip.


msub elementSpecifier


msubsup elementSpecifier


msup elementSpecifier


mtable elementSpecifier

The file liblouisutdml.ini defines the style matrix. The semantic-action files for math codes declare mtable to be matrix. Depending on the attributes of this element, it can be set to other styles, such as long division. The matrix style contains the setting format alignColumnsLeft.


mtd elementSpecifier

This element specifies a column in a mathematical table. For the style matrix the third column of the entry in a semantic-action file must contain \*|ec. This indicates the end of the column. Other specifications using the liblouis exactdots feature may also be necessary.


mtext elementSpecifier


mtr elementSpecifier

This element specifies a row in a mathematical table. The entry in a semantic-action file must contain \*\er in the third column for the matrix style, indicating the end of the row. Other things may also need to be specified using the liblouis exactdots feature. Note that rows are not declared as styles nested inside the matrix style. This is because the table must be considered as a whole.


munder elementSpecifier


munderover elementSpecifier


music elementSpecifier

When a module which can interpret MusicML and produce braille music notation is ready this semantic action will invoke it.


newpage elementSpecifier

This semantic action causes the rest of the current page to be left blank except for page numbers and footers. A new page is then begun. Like blankline, it is useful for fine formatting independent of styles.


no elementSpecifier

Originally, this semantic action was intended to be the default and to do nothing when an elementSpecifier had no meaning for braille translation. Later it was found that it should insert a blank space if parts of the text would run together, so this is now its action.


none elementSpecifier

This is a MathML element.


notranslate elementSpecifier

Output the text between the start and end tags exactly as written. It will, however, be formatted with appropriate line breaks, page numbers etc. If you want to make sure that things appear on the same line separate them with an unbreakable space, `&#160;' or `&#xa0;'.


pagenum elementSpecifier

The text between <elementSpecifier> and </elementSpecifier> is taken to be a print page number. If it does not begin with a digit the string \_ is placed before it. It is then passed to liblouis for translation according to the active table. This table must contain an entry for translating \_ into a letter sign or whatever else is wanted. This string is inserted so that roman page numbers will be handled properly. Unnumbered page breaks are indicated with an empty pagenum tag: <elementSpecifier></elementSpecifier>.


reverse elementSpecifier

The branches of the subtree rooted at this node are reversed in order. This is used in handling roots, where the arguments in the translation are in reverse order to those in MathML. the MathML elemnt mroot is declared with this semantic action


righthandpage elementSpecifier

If interpoint yes has been specified in the configuration file, and the current page is a right-hand one, the lest of the page is skipped except for footer and page number. the following left-hand page is similarly skipped. Otherwise, the action is the same as newpage.


runninghead elementSpecifier

This semantic action is used to specify a running header, such as a book title, to be placed at the top of each page. If the header is too long it will be truncated.

          <elementSpecifier>liblouisutdml Manual</elementSpecifier>
     


semantics elementSpecifier

This is a MathML action which seems to be irrelevant to braille translation.


skip elementSpecifier

Skip ahead until encountering the element </elementSpecifier>. Nothing in between will have any effect on the braille output.


softreturn elementSpecifier
Do a soft return, that is, start a new line without starting a new paragraph. elementSpecifier should be empty, for example, <br/>.


uncontracted elementSpecifier

This semantic action seems superfluous and may be eliminated in the future.


underlinex elementSpecifier

Enclose the text which follows in braille underline indicators.

4.3 Pseudo-actions

These actions affect the processing of semantic-action files. They are not connected with any tag in the document. They are executed when they are encountered in the processing of semantic-action files.

4.3.1 include

     include filename

filename must be the name of a semantic action file. The file is compiled as though it were part of the file containing the include entry. Included files may include other files.

4.3.2 newentries

     newentries no

The second column in this entry must contain `no'. Any new entries found in the document will be ignored. No `appended_' file will be produced. This affects only documents processed with this semantic-action file. The configuration setting newEntries affects all documents.

4.3.3 namespaces

     namespaces dtb=http://www.daisy.org/z3986/2005/dtbook/

This pseudo-action is used to declare namespaces used in XPath expressions. (See following section). The format is `namespaces prefix1=url1,prefix2=url2,...'. The list of namespaces may not contain blanks.

4.4 Using XPath Expressions

     para &xpath(h4)

This example causes any element with the name `h4' to be given the semantic action para, no matter what other assignments may be made to it. In general, XPath expressions are entered in the second column with the syntax &xpath(...). That is, the XPath expression is placed within parentheses following &xpath. It may contain parentheses itself, as long as they match. The third column may contain arguments, as with any line in a semantic-action file. XPath expressions are not processed in any particular order. Care should be taken that the node sets which they find do not overlap. If a node is in a node set found by a particular XPath expression it will be given the semantic-action and arguments associated with that expression. This will not be changed subsequently.

The `&funcname(...)' notation may be used for other features, such as XPointer, in the future.

5 Special Features

5.1 Table of contents

A table of contents is produced for an xml file if the file contains a tag which has been defined with the contentsheader semantic action (see contentsheader) and also tags for the heading1, heading2, heading3 or heading4 semantic actions (see heading1). The table of contents will contain print and braille page numbers if these features have been enabled. A sequence of fill characters will be inserted before the page numbers, so that the latter are at the right margin. The fill character can be specified in a configuration file with the lineFill setting (see lineFill). The default fill character is an apostrophe (dot 3).

Five new styles have been defined for the table of contents. The first is the contentsheader style (see contentsheader style), which is used to specify where the table of contents should be placed and the title that should be given to it. In the latter respect it is much like a heading style. The others correspond to the four heading levels and are contents1, contents2, contents3 and contents4. These styles are chosen as appropriate while the table of contents is being made. Do not declare them in a semantic-action file. See the liblouisutdml.ini file for the current default definitions of all these styles.

The table of contents will be placed where the xml tag is that you declared in the contentsheader semantic action (see contentsheader). Its title will be whatever is inside that tag, formatted according to the definition of the contentsheader style. It begins on a new page. After it is completed the braille page number is reset to beginningBraillePageNumber and another new page is started. This means that the xml tag with the contentsheader semantic action should occur at the end of the information which you want to be at the head of the output, such as a title page, dedication, etc.

It is not necessary that an xml file contain a tag with the contentsheader semantic action. If the file contains headers you can obtain a table of contents by specifying contents yes in a configuration file or -Ccontents=yes on the command line of file2brl. In this case, the table of contents will appear at the beginning of the output. Pages will be numbered beginning with 1. When the table of contents is complete, the material in the file will start on a new page and the page number will be the value given in beginningBraillePageNumber.

The contents1, etc. styles all have the format contents setting. This is a variant of the leftJustified format. It has been necessary to change the way firstLineIndent is handled to accommodate multilevel lists. Up till now, if firstLineIndent was negative, the first line would start at the real left margin, regardless of the value of leftMargin. Now the value of firstLineIndent is simply added to leftMargin. This means that if it is negative it is really subtracted. For example, if leftMargin is 4 and firstLineIndent is -2 the first line will start in cell 2. If the result of adding these two values is negative it is set to 0.

5.2 Back-translation

     file2brl -b infile outfile

infile must be a braille file. It can have either upper-case or lower-case letters, etc. outfile will contain the back-translation according to the configuration specifications. It can be in two formats according to the value of backFormat. `ascii' produces plain text output. The lines will generally correspond to the lines in the original braille file. `html' produces a file in xhtml format. This is recommended, since it preserves print page numbers, if present and some of the formatting of the original. It can also be loaded into a browser or word processor, which will format it for good readability. Note that for html format to work your liblouis table must contain the following line:

     space \x001b 1b escape character

To perform the back-translation operation, file2brl uses the liblouisutdml function lbu_backTranslateFile.

5.3 Reformatting

     file2brl -r infile outfile

As in the previous section, infile must be a braille file. It is back-translated and then forward-translated to produce a braille file in outfile which conforms to configuration specifications. It is useful for changing the line length and page length of a braille file. New braille page numbers will be generated if braillePages yes is specified. If backFormat html has been specified, print page numbers will be reproduced in the appropriate places. Some formatting may be lost.

5.4 Interlining

Interlining means printing the original text between the lines of translated braille. It requires special embossers or special methods. The present way in which liblouisutdml produces interlining relies on back-translation. However, it is inadequate for mathematics and depends too much on the quality of the liblouis tables. It is scheduled to be replaced, so you should not use it.

5.5 Browser-Friendly Output

     file2brl infile outfile -CformatFor=browser

infile can be any of the file types accepted by file2brl (xml, html or text). If it contains html links or targets they will be formatted so that a browser can use them. This may be useful if a file contains internal links to different sections, such as its own table of contents. Text will be translated and formatted according to configuration specifications. If the file contains mathematics expressed as MathML it will be translated according to the mathematics code specified by the configuration. outfile should have the extension `.html'. It will actually be xhtml. The -CformatFor=browser part of the above example specifies a configuration setting, which of course can also be specified in a configuration file.

5.6 CDATA Sections

A cdata section may be given the semantic actions skip, no or code. In the first case, the data in the cdata section is ignored. In the second case, it is inserted into the output with no translation. In the third case it is translated into computer braille and inserted into the output. Any other semantic action has the same effect as no.

6 Special Formats

6.1 Tables

Various methods of handling tables can be devised. One that is in current use requires the following lines in a semantic-action file:

     list tr \*;
     generic td \*;\s

The list style specifies that the first line should begin at the left margin and subsequent lines should be indented two spaces. The third column specifies that a semicolon should be placed at the very end of the row. The generic semantic action causes each column in the table to be followed by a semicolon and a space, as specified in the third column. your liblouis table must also contain the following line:

     noback always ;\s; 0

6.2 Reserving Space for Graphics

Your configuration files should contain lines like these:

     style graphspace
     rightHandPage yes

In your semantic-action file you must assign a tag to this style. Note that the semantic action graphic will invoke code to translate SVG graphics when this feature is developed. You can nest various styles within the `graphspace' style, such as a caption at the beginning. In particular, you should have another invocation of `graphspace' at the end to skip to a new page, or the next right-hand page if you are using interpoint.

6.3 Displayed Text

Conventions for setting off a block of text from the rest vary. you may wish to use the quotation style or devise a style of your own.

6.4 Displayed Mathematics

Again, conventions vary. you can define your own style for this purpose and invoke it according to the attributes of the math tag.

6.5 Spatial Layouts in Mathematics

This is also known as 2d mathematics. It spreads out complex fractions and other materials for easier viewing. It is being developed based on the specifications of MathML 3.

6.6 Arithmetic Examples

This is another format that is being developed using MathML 3. It is difficult in earlier versions.

6.7 Poetry

liblouisutdml.ini defines two styles which can be used to format poetry, as follows:

     style stanza
     linesBefore 1
     linesAfter 1
     ttyle line
     leftMargin 2
     firstLineIndent -2

Your document might then contain the following from Samuel Taylor Coleridge's "Rime of the Ancient Mariner":

     <stanza>
     <lino>He holds him with his glittering eye</line>
     <line>The wedding guest stands still</line>
     <line>And listens like a three-years' child.</line>
     <line>He has no force nor will.</line>
     </stanza>

Note that when stanzas follow each other liblouisutdml will produce only one blank line between them, not two.

6.8 Dividing a Book Into Volumes

Details are still under development. However, this much can be said. First, obtain a table of contents for the whole book. This requires that your configuration files have the following settings:

     contents yes
     braillePages yes

This will tell you the approximate braille pages on which things will be placed in the finished product. You can then calculate the number of pages required for each chapter and how many chapters will fit in a volume of your preferred size. From the point of view of the braille reader, it is desirable to avoid splitting chapters between volumes.

At this point you will probably have to edit the source xml file to indicate the beginning and end of volumes. You can define a liblouisutdml style called `volume' and assign appopriate xml tags to it in a semantic-action file. Within the volume style you can nest a title page, chapters, etc. A volume table of contents is still under development.

7 Implementing Braille Mathematics Codes

Much information useful in implementing braille mathematical codes is given in the sections on styles and on semantic actions, especially in the discussion of MathML semantic actions. The chapter on Special Formats also contains much useful information.

The Nemeth Code of Braille Mathematical and Science Notation, BAUK maths and Marburg Maths have been implemented. the Nemeth code was the first and uses an implementation which is now obsolete. The discussion below will concentrate on the implementation of BAUK Maths.

Four tables are used to translate xml documents containing a mixture of text and mathematics. They can be found in the subdirectory lbu_files of the liblouisutdml directory and in the tables subdirectory of the liblouis distribution. First, the semantic-action file ukmaths.sem is used to interpret the mathematical portions of the xml document (The text portions are interpreted by another semantic-action file which will not be discussed here). After the math and text have been interpreted, two liblouis tables, ukmaths.ctb and en-us-g2.ctb are used to translate them. The latter table may be replaced by another table at the user's discretion. Each piece of mathematics or text is translated separately and the pieces are strung together with blanks between them. This results in inaccuracies where mathematics meets text. The fourth table, also a liblouis table, is used to remove these inaccuracies. It is called ukmaths_edit.ctb, and it does things like removing the multi-purpose indicator before a blank, inserting the punctuation indicator before a punctuation mark following a math expression, and removing extra spaces. This table may need editing if a different text translation table is used.

The general format and use of semantic-action files were discussed in the section see Connecting with the xml Document - Semantic-Action Files. In this section we shall concentrate on the optional third column, which is used a lot in ukmaths.sem. While the first two columns can be generated by liblouisutdml but must be edited by a person, the third column must always be provided by a human.

As previously stated, the third column tells liblouisutdml what characters to insert to inform liblouis how to translate the math expression. In fact, you can tell liblouis exactly what dots to insert. This relies on the liblouis opcode exactdots. If you look at the file example_ukmaths.ctb you will see lines like the following:

     exactdots @126
     exactdots @345
     exactdots @123456

This opcode has only a string operand. liblouis assumes that the characters following the at sign are its dot pattern.

In your semantic-action file you might have lines like:

     mfenced mfenced @126,@345
     mfenced mfenced,open,{ @246,@135
     mover mover ,@4-346,@12456

By using this approach you do not have to remember which characters will produce the desired dots in a particular liblouis table or on a particular output device.

Sometimes an element or tag can have an indeterminate number of children. This is true of <math> itself. Yet, it may be necessary to place some characters after the very last element. Let us look at the <math> entry.

     math math \eb,\*\ee

First let us discuss escape sequences starting with a backslash. These are basically the same as in liblouis. The sequence `\e' is shorthand for the escape character, which would otherwise be represented by `\x001b'. The beginning of a math expression is denoted by an escape character followed by the letter b and the end by an escape character followed by the letter `e'. This enables the editing table to do such things as drop the baseline indicator at the end of a math expression and insert a number sign at the beginning, if needed.

Not found in liblouis is the sequence `\*'. This means to put what follows after the very last child of the math element, no matter how many there are.

As another example consider:

     mtd mtd \*\ec

mtd is the MathML tag for a table column. There may be many children of this tag. The entry says to put an escape character (hex 1b), plus the letter `c', after the very last of them.

As a final example consider:

     mtr mtr ^.^\,^(,\*^.^\,^)\er

mtr is the MathML tag for a row in a table, in this case a matrix. Each row in a matrix must begin with the dot pattern `46-6-12356' and end with the dot pattern `46-6-12456'. As usual a caret is placed before the corresponding characters. Since dot 6 is a comma, it must be escaped. This is done by placing a backslash before the comma. There are two subcolumns. the first contains the characters to be placed at the beginning of each row. The second starts with `\*', signifying that the characters following it are to be placed at the end of everything in this row. A subcolumn starting with `\*' must be the last (or only) subcolumn.

Here this last subcolumn ends with an escape character and the letter <r>, signifying the end of a row.

So much for the semantic action file. Even though the characters in the third column were chosen to correspond with nemeth characters, they may not have to be changed for other math codes. liblouis can replace them with anything needed.

This brings us to a consideration of the two tables used by liblouis to translate mathematics texts. The first, en-mathtext.ctb is used to translate text appearing outside math expressions. It is necessary because the Nemeth code requires modifications of Grade 2 braille. Other math codes may not have this requirement.

The table actually used to translate mathematics is nemeth.ctb. It includes two other tables, chardfs.cti and nemethdefs.cti. The first gives ordinary character definitions and is included by all the other tables. Note however, that the unbreakable space, `\x00a0', is translated by dot 9. This is used before and after the equal sign and other symbols in nemeth.ctb. The second table contains character definitions for special math symbols, most of which are Unicode characters greater than `\x00ff'. The Greek letters are here. So are symbols like the integral sign.

Most of the entries in nemeth.ctb should be familiar from other tables. The unfamiliar ones follow the comments `# Semantic pairs' and `# pass2 corrections'. The first simply replace characters preceded by a caret with the character itself. The second make adjustments in the code generated directly from the nemeth.sem file. The pass2 opcode is discussed in the liblouis documentation (see Overview). Here are some comments on a few of the entries in nemeth.ctb.

     pass2 @1456-1456 @6-1456

Replaces double start-fraction indicators with the start complex fraction indicator.

     pass2 @3456-3456 @6-3456

Replaces double end-fraction indicators with the end-complex-fraction indicator.

     pass2 @56[$d1-5]@5 *

Removes the subscript and baseline indicators from numeric subscripts.

     pass2 @5-9 @9

Removes the baseline or multipurpose indicator before an unbreakable space generated by the translation of an equal sign, etc.

     pass2 @45-3-5 @3

Replaces a superscript apostrophe with a simple prime symbol.

     pass2 @9[]$d @3456

Puts a number sign before a digit preceded by a blank.

     pass2 @9-0 @9

Removes a space following an unbreakable space.

We now come to the fourth and last table used for math translation, the editing table, nemeth_edit.ctb. As explained at the beginning, this table is used to remove inaccuracies where math translation butts up against text translation. For example, the Nemeth code puts numbers in the lower part of the cell. However, punctuation marks are also in the lower part of the cell. So Nemeth puts a punctuation indicator, dots `456', in front of any lower-cell punctuation that immediately follows a mathematical expression. If this occurs inside Mathml it is handled by nemeth.ctb. However, a MathML expression is often followed by a punctuation mark which is the first part of text. liblouisutdml puts a blank between math and text, but this can result in a mathematical expression followed by a blank and then, say, a period, dots `256'. nemeth_edit.ctb replaces the blank with the punctuation indicator.

When you look at nemeth_edit.ctb you will see that it begins with an include of chardefs.cti. Most of the entries are ordinary, but some are interesting. for example,

     always "\s 0

replaces the baseline or multipurpose indicator followed by a space with just a space.

8 Programming with liblouisutdml

8.1 License

Liblouisutdml may contain code borrowed from the Linux screenreader BRLTTY, Copyright © 1999-2009 by the BRLTTY Team.

Copyright © 2004-2009 ViewPlus Technologies, Inc. www.viewplus.com.

Copyright © 2006,2009 Abilitiessoft, Inc. www.abilitiessoft.com.

Liblouisutdml is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Liblouisutdml 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Liblouisutdml. If not, see http://www.gnu.org/licenses/.

8.2 Overview

liblouisutdml is an "extensible renderer", designed to translate a wide variety of xml and text documents into braille, but with a special emphasis on technical material. The overall operation of liblouisutdml is controlled by a configuration file. The way in which a particular type of xml document is to be rendered is specified by a semantic-action file for that document type. Braille translation is done by the liblouis braille translation and back-translation library (see Overview). Its operation, in turn is controlled by translation table files. All these files are plain text and can be created and edited in any text editor. Configuration settings can also be specified on the command line of the console-mode transcription program file2brl.

The general operation of liblouisutdml is as follows. It uses the libxml2 library to construct a parse tree of the xml document. After the parse tree is constructed, a function called examine_document looks it over and determines whether math translation tables, etc. are needed. examine_document also constructs a prototype semantic-action file, if one does not exist already. It may also construct another file containing entries not found in an existing file. When it is finished, another function, called transcribe_document, does the actual braille transcription. It calls transcribe_math to handle MathML subtrees, transcribe_chemistry for chemical formula subtrees, transcribe_graphic for SVG graphics, etc. Entities are translated to Unicode, if they are not already. Sequences of symbols indicate superscripts, return to the baseline, subscripts, start and end of fractions, etc. The Braille translator and back-translator library liblouis is used to do the braille translation.

The transcribe_math function works in conjunction with the latest version of liblouis and a special math translation table to transcribe most mathematical expressions into good braille mathematical Code.

The functions which are not ready for use at the moment, such as transcribe_chemistry, are only skeletons. However, I hope that transcribe_graphics can be expanded in the near future to use the graphics capability of the Tiger tactile graphics embossers.

The latest versions of liblouisutdml and liblouis can be downloaded from www.abilitiessoft.com. This site also contains links to a mailing list and to project pages on googlecode.google.com. Note that liblouisutdml will only work with the latest version of liblouis.

liblouisutdml can be compiled to use either 16-bit or 32-bit Unicode internally. This is inherited from liblouis, so liblouis must be compiled first and then liblouisutdml. Wherever 16 bits are mentioned in this document, read 32 if you have compiled the library for 32 bits.

8.3 Files and Paths

liblouisutdml uses three kinds of files, configuration files, semantic-action files, and liblouis translation tables. The first two are discussed elsewhere in this documentation. liblouis translation tables are discussed in the liblouis documentation (see Overview) which is distributed with liblouis.

Note that liblouisutdml also generates some files, all of which are placed in the current directory. These files are new prototype semantic-action files, additions to old semantic-action files, temporary files, and log files. The first two can be used to extend the capability of liblouisutdml to process xml documents. The latter two are useful for debugging.

liblouisutdml determines the paths on which it will search for files at run time, as part of its initialization. First, if the first file in a configuration file list includes a path, liblouisutdml will search first on this path. The path may be either absolune or relative. Only the first filename in a configuration file list may have a path. Next, in Windows liblouisutdml determines the path to itself. this is the second path on which it will look for files. The liblouis tables directory and the liblouisutdml lbu_files directory are relative to this path. In Unix systems, including the Mac,, these directories are absolute paths determined at compile time. liblouisutdml searches first the tables directory and then the lbu_files directory. Finally, it establishes the current directory as the final path to be searched. If you wish the current directory to be the first path searched, prefix the first configuration file name with `./' for Unix or `.\' for Windows.

Paths are handled in the paths.c module. This contains the function set_paths, which is called from readconfig.c and in turn calls addPath in the paths.c module.

8.4 lbu_version

     char *lbu_version (void)

This function returns a pointer to a character string containing the version of liblouisutdml. Other information such as the release date and perhaps notable changes may be added later.

8.5 lbu_initialize

     void * lbu_initialize (
     const char *configFilelist,
     const char *logFileName,
     const char *settingsString)

This function initializes the libxml2 library, processes liblouisutdml.ini and configuration settings given in the configuration files given in configFilelist. This is a list of configuration file names separated by commas. If the first character is a comma it is taken to be a string containing configuration settings and is processed like the settingsString string. if the parameter settingsString is not NULL it is processed last. Such a string must conform to the format of a configuration file. Newlines should be represented with ASCII 10. If logfilename is not null, a log file is produced on the current directory. If it is null any messages are printed on stderr. The function returns a pointer to the UserData structure. This pointer is void and must be cast to (UserData *) in the calling program. To access the information in this structure you must include louisutdml.h. This function is used by file2brl.

8.6 lbu_translateString

     int lbu_translateString (
     const char *configfilelist,
     char * inbuf,
     widechar *outbuf,
     int *outlen,
     unsigned int mode)

This function takes a well-formed xml expression in inbuf and translates it into a string of 16-bit (or 32-bit if this has been specified in liblouis) braille characters in outbuf. The xml expression must be immediately followed by a zero or null byte. Leading whitespace is ignored. If it does not then begin with the characters `<?xml' an xml header is added. If it does not begin with `<' it is assumed to be a text string and is translated accordingly. The header is specified by the xmlHeader line in the configuration file. If no such line is present, a default header specifying UTF-8 encoding is used. The mode parameter specifies whether you want the library to be initialized. If it is 0 everything is reset, the liblouisutdml.ini file is processed and the configuration file and/or string (see previous section) are processed. If mode is 1 liblouisutdml simply prepares to handle a new document. For more on the mode parameter see the next section.

Which 16-bit character in outbuf represents which dot pattern is indicated in the liblouis translation tables. The configfilelist parameter points to a configuration file or string. Among other things, this file specifies translation tables. It is these tables which control just how the translation is made, whether in Grade 2, Grade 1, the Nemeth Code of Braille Mathematics or something else.

Note that the *outlen parameter is a pointer to an integer. When the function is called, this integer contains the maximum output length. When it returns, it is set to the actual length used. The function returns 1 if no errors were encountered and a negative number if a complete translation could not be done.

8.7 lbu_translateFile

     int lbu_translateFile (
     char *configfilelist,
     char *inputFileName,
     char *outputFileName,
     unsigned int mode)

This function accepts a well-formed xml document in inputFilename and produces a braille translation in outputFilename. As for lbu_translateString, the mode parameter specifies whether the library is to be initialized with new configuration information or simply prepared to handle a new document. In addition, the mode parameter can specify that a document is in html, not xhtml. liblouisutdml.h contains an enumeration type with the values dontInit and htmlDoc. These can be combined with an or (`|') operator. The input file is assumed to be encoded in UTF-8, unless otherwise specified in the xml header. The encoding of the output file may be UTF-8, UTF-16, UTF-32 or Ascii-8. This is specified by the outputEncoding line in the configuration file, configfilelist. The function returns 1 if the translation was successful.

8.8 lbu_translateTextFile

     int lbu_translateTextFile (
     char *configfilelist,
     char *inputFileName,
     char *outputFileName,
     unsigned int mode)

This function accepts a text file in inputFilename and produces a braille translation in outputFilename. The input file is assumed to be encoded in Ascii8. However, utf-8 can be specified with the configuration setting inputTextEncoding utf8. Blank lines indicate the divisions between paragraphs. Two blank lines cause a blank line between paragraphs (or headers). The output file may be in UTF-8, UTF-16, or Ascii8, as specified by the outputEncoding line in the configuration file, configfilelist. As for lbu_translateString, the mode parameter specifies whether complete initialization is to be done or simply initialization for a new document.

8.9 lbu_backTranslateFile

     int lbu_backTranslateFile (
     char *configfilelist,
     char *inputFileName,
     char *outputFileName,
     unsigned int mode)

This function accepts a braille file in inputFilename and produces a back-translation in outputFilename. The input file is assumed to be encoded in Ascii8. The output file is in either plain text or html, according to the setting of backFormat in the configuration file. Html files are encoded in UTF8. In plain-text, blank lines are inserted between paragraphs. The output file may be in UTF-8, UTF-16, or Ascii8, as specified by the outputEncoding line in the configuration file, configfilelist. The mode parameter specifies whether or not the library is to be initialized with new configuration information, as described in the section on lbu_translateString (see lbu_translateString).

8.10 lbu_free

     void lbu_free (void)

This function should be called at the end of the application to free all memory allocated by liblouisutdml and liblouis. If you wish to change configuration files during your application, use a mode parameter of 0 on the function call using the new configuration information. This will call the lbu_free function automatically.

Appendix A Example files

This appendix contains all the files referenced in this document. They are up-to-date at the time of writing, but the actual files used by the software may change. Besides being used for reference, they can be studied to see how things are done.

A.1 liblouisutdml.ini

     # canonical Configuration File
     
     # This file contains all possible settings, together with their
     # default values.
     
     # It is read automatically when liblouisutdml starts. You should use it as
     # a reference but never specify it as a configuration file.
     
     # There are three kinds of lines in the file. the first has a single
     # column beginning at the left margin. This column contains the name of
     # a category of settings, such as outputFormat or translation. These
     # lines are optional. The
     # second type of line contains the word style in the first column,
     # followed by at least one space or tab, and then a style name. The
     # third kind of line is indented one tab stop to set it off from the
     # others. It centains a setting name, at least one blank space or tab,
     # and the value of the setting.
     
     outputFormat
     cellsPerLine 40
     linesPerPage 25
     interpoint no
     lineEnd \r\n
     pageEnd \f
     fileEnd ^z
     printPages yes
     braillePages yes
     paragraphs yes
     beginningPageNumber 1
     printPageNumberAt top
     braillePageNumberAt bottom
     hyphenate no
     outputEncoding ascii8
     inputTextEncoding ascii8
     backFormat plain
     backLineLength 70
     formatFor textDevice
     interline no
     lineFill '
     translation
     literarytextTable en-us-g2.ctb
     uncontractedTable en-us-g1.ctb
     compbrlTable en-us-compbrl.ctb
     mathtextTable en-us-g2.ctb
     mathexprTable nemeth.ctb
     editTable nemeth_edit.ctb
     interlineBackTable en-us-interline.ctb
     xml
     semanticFiles *,nemeth.sem
     xmlheader "<?xml version='1.0' encoding='UTF8' standalone='yes'?>"
     # entity nbsp ^1
     internetAccess yes
     newEntries yes
     
     # Unlike the other categories, the style category must be followed by
     # the name of a style.
     
     style document
     linesBefore 0
     linesAfter 0
     leftMargin 0
     firstLineIndent 0
     translate contracted
     skipNumberLines no
     format leftJustified
     newPageBefore no
     newPageAfter no
     righthandPage no
     braillePageNumberFormat normal
     
     style arith
     style attribution
     format rightJustified
     style biblio
     style caption
     leftMargin 4
     firstLineIndent 2
     style code
     linesBefore 1
     linesAfter 1
     skipNumberLines yes
     format computerCoded
     style contentsheader
     linesBefore 1
     format centered
     linesAfter 1
     style contents1
     firstLineIndent -2
     leftMargin 2
     format contents
     style contents2
     firstLineIndent -2
     leftMargin 4
     format contents
     style contents3
     firstLineIndent -2
     leftMargin 6
     format contents
     style contents4
     firstLineIndent -2
     leftMargin 8
     format contents
     style dedication
     newPageBefore yes
     newPageAfter yes
     format centered
     style directions
     style dispmath
     leftMargin 2
     style disptext
     leftMargin 2
     firstLineIndent 2
     style exercise1
     leftMargin 2
     firstLineIndent -2
     style exercise2
     leftMargin 4
     firstLineIndent -2
     style exercise3
     leftMargin 6
     firstLineIndent -2
     style glossary
     firstLineIndent 2
     style graph
     skipNumberLines yes
     style graphlabel
     style heading1
     linesBefore 1
     format centered
     linesAfter 1
     style heading2
     linesBefore 1
     firstLineIndent 4
     style heading3
     firstLineIndent 4
     style heading4
     firstLineIndent 4
     style index
     style line
     firstLineIndent -2
     leftMargin 2
     style list
     firstLineIndent -2
     leftMargin 2
     style matrix
     format alignColumnsLeft
     style music
     skipNumberLines yes
     style note
     style para
     firstLineIndent 2
     style quotation
     linesBefore 1
     linesAfter 1
     style section
     firstLineIndent 4
     style spatial
     style stanza
     linesBefore 1
     linesAfter 1
     style style1
     style style2
     style style3
     style style4
     style style5
     style subsection
     firstLineIndent 4
     style table
     linesBefore 1
     linesAfter 1
     style titlepage
     newPageAfter yes
     style trnote
     firstLineIndent 7
     leftMargin 5
     style volume

A.2 default.cfg

     outputFormat
     cellsPerLine 32
     linesPerPage 25
     interpoint no
     braillePages no
     # backFormat html
     # hyphenate yes
     # interline yes
     translation
     literaryTextTable en-us-g2.ctb,corrections.ctb
     # literaryTextTable en-us-g2.ctb,hyph_en_US.dic
     # literaryTextTable no-no-g1.ctb
     # interlineBackTable en-us-interline.ctb
     compbrlTable en-us-comp8.ctb
     xml
     internetAccess no
     # newEntries no
     # semanticFiles book.sem
     # entity nbsp ~1
     

A.3 html.sem

     # This file was produced by liblouisutdml and is considered part of
     # the code. See the file copyright-notice for permissions and
     # restrictions. This notice also applies to any files with names
     # beginning with 'appended_'.
     
     # You must edit this file as explained in the documentation to get
     # proper output.
     notranslate ntr
     trnote trnote
     contentsheader contentshere
     no hr
     no body
     softreturn br
     heading1 h1
     italicx em
     skip style
     italicx strong
     no ol
     no head
     document html
     no a
     para p
     heading1 title
     list li
     table table
     no param
     pagenum pagenum
     no div
     no span
     no link
     heading2 h2
     no img
     no td
     no tr
     no object
     no ul
     no link,type
     no img,width
     no table,cellpadding
     no img,src
     no div,class
     no td,class
     no p,class
     no table,border
     no table,width
     htmllink link,href
     no param,name
     no param,value
     no link,rel
     no a,id
     no table,cellspacing
     no td,colspan
     no img,height
     no object,classid
     no object,width
     changetable span,lang
     no span,class
     no object,height
     no a,class
     no img,alt
     htmllink a,href
     htmltarget a,name
     no p,align
     no a,name,light
     no a,name,decisi
     no a,name,city
     no a,name,ascent
     no a,name,homeco
     no a,name,forest
     no a,name,prolog
     no p,align,center
     no a,name,homest
     no link,type,text/css
     no a,id,TrigonometricFun
     no img,width,300
     no img,height,300
     no a,href,http://ocw.mit.e
     no td,colspan,3
     no table,border,0
     no table,cellpadding,0
     no td,class,navbar
     no param,name,archive
     no a,href,../tools/content
     no object,height,450
     no span,class,math-inline-bold
     no link,href,../calculus.css
     no param,name,codebase
     no span,class,math-inline-norm
     no img,alt,figure
     no p,class,text-right
     no a,href,contents.xhtml
     no img,src,images/trigo_fun
     no object,classid,java:Trigonometr
     no p,class,text-center
     no a,class,doclink
     no table,cellspacing,0
     no a,href,../glossary_nota
     no div,class,math-block-norma
     no link,href,../mathml.css
     no param,value,trigonometricFun
     no a,href,../index.xhtml
     no link,rel,stylesheet
     no param,value,../applets/
     no object,width,760
     no table,width,100%
     no img,width,184
     no div,class,math-block-bold
     no img,height,116
     no img,src,images/law_sines
     no img,src,images/ln.gif
     no param,value,rotatingCoordina
     no object,classid,java:RotatingCoo
     no a,id,RotatingCoordina
     no a,id,Exercise_3_2
     no a,id,Exercise_3_5
     no object,classid,java:OperationsO
     no a,id,Definition
     no param,value,operationsOnVect
     no param,value,multiplicationVe
     no img,src,images/polar_coo
     no param,value,determinantVecto
     no html,lang
     no html,lang,no
     no i
     no sup
     no style,type
     no style,type,text/css
     no p,class,indent
     no p,class,center
     no p,class,right
     no span,class,math-inline-normal
     no object,classid,java:OperationsOnVectors.class
     no a,href,http://ocw.mit.edu/OcwWeb/Mathematics/18-013ASprin
     code pre
     no meta
     no h1,align
     no meta,content
     no meta,name
     no meta,name,description
     no h1,align,center
     no meta,name,keywords
     no meta,content,Pope_John_Paul_II's_Apostolic__Letter_'Salvifici_D
     no meta,content,suffering__Christian_suffering__redemptive_sufferi
     no font
     no b
     no small
     no h3
     no sub
     no font,size
     no td,align
     no mstyle,fontfamily
     no td,width
     no mi,fontstyle
     no ol,type
     no mstyle,fontfamily,helvetica
     no mi,fontstyle,italic
     no td,align,center
     no meta,content,TtM_3.72
     no td,width,1
     no meta,name,GENERATOR
     no ol,type,1
     no div,class,p
     no font,size,-1
     no mi,fontstyle,normal
     no span,lang,en-us-g1.ctb
     no none
     no col
     no caption
     no thead
     no cite
     no tbody
     no mprescripts
     no math,id
     no mo,minsize
     no math,smilref
     no h1,class
     no p,id
     no caption,title
     no table,id
     no object,data
     no thead,id
     no div,title
     no col,id
     no tbody,id
     no div,id
     no caption,id
     no math,alttext
     no meta,scheme
     no object,id
     no p,title
     no td,rowspan
     no cite,id
     no math,altimg
     no mspace,linebreak
     no table,title
     no td,id
     no tr,id
     no math,overflow
     no div,id,d4e64
     no math,id,d1e21
     no p,title,paragraph:_We_have_performed...
     no div,id,d4e54
     no div,id,d4e59
     no meta,content,Text
     no mi,mathvariant,bold-italic
     no div,id,d4e49
     no math,overflow,scroll
     no div,id,front
     no p,id,d4e72
     no math,alttext,__lamda_sub_c
     no meta,scheme,EID
     no p,id,d4e62
     no p,id,d4e67
     no p,id,d4e52
     no object,id,f1
     no object,id,f2
     no p,id,d4e57
     no object,id,f3
     no tbody,id,d13e73
     no tr,id,d13e74
     no math,smilref,dtb_e057003.smil#d1e21
     no td,colspan,1
     no tr,id,d13e67
     no td,colspan,2
     no p,title,paragraph:_We_report_measure...
     no caption,id,d13e2
     no math,id,d1e770
     no meta,scheme,PACS_code
     no p,title,paragraph:_Angle_resolved_ph...
     no object,data,e057003_2.svg
     no math,smilref,dtb_e057003.smil#d1e770
     no p,title,paragraph:_The_transition_me...
     no col,id,d13e60
     no col,id,d13e61
     no col,id,d13e62
     no col,id,d13e63
     no col,id,d13e64
     no caption,title,caption
     no div,title,Author_Information
     no link,href,default.css
     no math,alttext,__cap_nb_cap_se_sub_2
     no math,id,d1e113
     no math,alttext,__lamda_sub_ay
     no mspace,linebreak,goodbreak
     no math,id,d1e121
     no meta,name,dc:Type
     no math,id,d1e129
     no span,class,sentence
     no div,title,frontmatter
     no cite,id,d4e2807
     no div,class,doctitle
     no math,smilref,dtb_e057003.smil#d1e113
     no td,rowspan,1
     no p,title,paragraph:_We_thank_I._Mazin...
     no math,smilref,dtb_e057003.smil#d1e121
     no math,smilref,dtb_e057003.smil#d1e129
     no math,altimg,math_img/math_2.png
     no cite,id,d4e2838
     no div,class,frontmatter
     no thead,id,d13e66
     no table,title,Table:_Variation_of_the_...
     no cite,id,d4e2816
     no cite,id,d4e2829
     no math,alttext,_2__cap_h_-__cap_nb_cap_se_sub_2
     no td,id,d13e88
     no td,id,d13e71
     no td,id,d13e75
     no param,name,SRC
     no td,id,d13e68
     no td,id,d13e69
     no object,classid,CLSID:8483EB52-5EF2-44F5-A685-C9FD08F9B18C
     no html,lang,en
     no object,data,e057003_3.svg
     no tr,id,d13e193
     no tr,id,d13e167
     no tr,id,d13e180
     no table,id,d13e1
     no math,altimg,math_img/math_1.png
     no meta,content,ANSI/NISO_Z39.86-2005
     no meta,scheme,http://www.w3.org/1998/Math/MathML
     no math,altimg,math_img/math_4.png
     no h1,class,title
     no math,altimg,math_img/math_10.png
     no math,altimg,math_img/math_3.png
     no cite,id,d4e2794
     no meta,scheme,DOI
     no mo,minsize,5ex
     no object,data,e057003_1.svg
     no meta,name,dc:Format
     no a,class,nava
     no a,onclick
     no a,onclick,ChSize('10')
     no a,onclick,ChSize('12')
     no a,onclick,ChSize('13')
     no a,onclick,ChSize('14')
     no a,shape
     no a,shape,rect
     no a,target
     no a,target,_blank
     quotation blockquote
     no br,class
     no br,class,newline
     no center
     no h3,class
     no h3,class,sectionHead
     heading4 h4
     no h4,class
     no h4,class,subsectionHead
     no img,alt,Variable_Star.jpg
     no img,src,Variable%20Star.jpg
     no link,href,http://purl.org/DC/elements/1.0/
     no link,href,root.css
     no link,rel,schema.DC
     no meta,http-equiv
     no meta,http-equiv,Content-Language
     no meta,http-equiv,Content-Type
     no mo,class
     no mo,class,MathClass-close
     no mo,class,MathClass-punc
     no mo,class,MathClass-rel
     no mspace,class
     no mspace,class,quad
     no mspace,width,1em
     no mstyle,class
     no mstyle,class,label
     no mstyle,id
     no mstyle,id,x1-2001r1
     no mstyle,id,x1-2002r2
     no script
     no script,type
     no script,type,text/javascript
     no span,class,titlemark
     no table,class
     no table,class,equation
     no td,class,eq-no
     titlepage titlepage
     dedication dedication
     attribution attribution
     no list
     italicx emp
     no attrib
     no meta,name,generator
     no mo,class,MathClass-op
     no mo,class,MathClass-open
     no mo,class,MathClass-bin
     boxline boxline 7
     no base
     no var
     para dd
     no dl
     para dt
     heading4 h5
     compbrl code
     no base,href
     no hr,title
     no tr,valign
     no pre,style
     no img,width,72
     no pre,style,color:_red
     no tr,valign,baseline
     no base,href,http://www.w3.org/TR/1999/REC-xslt-19991116
     no img,height,48
     no table,class,scrap
     no hr,title,Separator_for_header
     no img,alt,W3C
     no hr,title,Separator_from_footer
     no samp
     no th
     no dd,id
     
     no h2,id
     no table,summary
     no li,id
     no ol,id
     no dl,id
     no ul,class
     no ul,id
     no dt,id
     no samp,id
     no h1,id
     no h3,id
     no ul,class,pl
     no dl,id,dl_1
     no ul,id,ul_1
     no dl,id,dl_2
     no ul,id,ul_2
     no ul,id,ul_3
     no ul,id,ul_4
     no dl,id,dl_5
     no dl,id,dl_6
     no h3,id,h3_18
     no h2,id,h2_5a
     no h1,id,h1_2a
     no h3,id,Vote
     no dl,id,dl_5a
     no samp,id,smp_1
     no samp,id,smp_2
     no li,id,li_0
     no samp,id,smp_3
     no li,id,li_1
     no samp,id,smp_4
     no li,id,li_2
     no samp,id,smp_5
     no li,id,li_3
     no li,id,li_4
     no dd,id,dd_1
     no dt,id,dt_1
     no dd,id,dd_2
     no dt,id,dt_2
     no dd,id,dd_3
     no dt,id,dt_3
     no dd,id,dd_4
     no dt,id,dt_4
     no dd,id,dd_5
     no dt,id,dt_5
     no h3,id,h3_8
     no h3,id,BoD
     no h3,id,h2_5
     no ol,id,ol_3gwk
     no h1,id,h1_2
     no h1,id,h1_3
     no h1,id,h1_4
     no h2,id,h2_6
     no h2,id,h2_7
     no h2,id,h2_8
     no h2,id,h2_9
     no ol,id,ol_2
     no h1,id,h1_a
     no ol,id,ol_3
     no ol,id,ol_4
     no table,summary,This_table_lists_each_kind_of_DTB_file__the_requir
     no ul,id,ol_1
     no base
     no var
     para dd
     para dl
     no dt
     no h5
     code code
     no base,href
     no hr,title
     no tr,valign
     no pre,style
     no img,width,72
     no pre,style,color:_red
     no tr,valign,baseline
     no base,href,http://www.w3.org/TR/1999/REC-xslt-19991116
     no img,height,48
     no table,class,scrap
     no hr,title,Separator_for_header
     no img,alt,W3C
     no hr,title,Separator_from_footer
     no samp
     no th
     no dd,id
     no h2,id
     no table,summary
     no li,id
     no ol,id
     no dl,id
     no ul,class
     no ul,id
     no dt,id
     no samp,id
     no h1,id
     no h3,id
     no ul,class,pl
     no dl,id,dl_1
     no ul,id,ul_1
     no dl,id,dl_2
     no ul,id,ul_2
     no ul,id,ul_3
     no ul,id,ul_4
     no dl,id,dl_5
     no dl,id,dl_6
     no h3,id,h3_18
     no h2,id,h2_5a
     no h1,id,h1_2a
     no h3,id,Vote
     no dl,id,dl_5a
     no samp,id,smp_1
     no samp,id,smp_2
     no li,id,li_0
     no samp,id,smp_3
     no li,id,li_1
     no samp,id,smp_4
     no li,id,li_2
     no samp,id,smp_5
     no li,id,li_3
     no li,id,li_4
     no dd,id,dd_1
     no dt,id,dt_1
     no dd,id,dd_2
     no dt,id,dt_2
     no dd,id,dd_3
     no dt,id,dt_3
     no dd,id,dd_4
     no dt,id,dt_4
     no dd,id,dd_5
     no dt,id,dt_5
     no h3,id,h3_8
     no h3,id,BoD
     no h3,id,h2_5
     no ol,id,ol_3gwk
     no h1,id,h1_2
     no h1,id,h1_3
     no h1,id,h1_4
     no h2,id,h2_6
     no h2,id,h2_7
     no h2,id,h2_8
     no h2,id,h2_9
     no base,href,http://www.daisy.org/z3986/2005/Z3986-2005.html
     no ol,id,ol_2
     no h1,id,h1_a
     no ol,id,ol_3
     no ol,id,ol_4
     no table,summary,This_table_lists_each_kind_of_DTB_file__the_requir
     no ul,id,ol_1
     no form
     no input
     no select
     no label
     no noscript
     no option
     no textarea
     no td,valign
     no input,border
     no textarea,class
     no select,class
     no img,name
     no input,type
     no script,language
     no select,size
     no label,for
     no textarea,name
     no link,media
     no input,name
     no textarea,wrap
     no td,height
     no script,src
     no input,width
     no input,id
     no form,id
     no img,border
     no b,class
     no option,selected
     no li,class
     no form,method
     no img,align
     no table,align
     no input,maxlength
     no img,class
     no input,value
     no select,id
     no form,name
     no textarea,rows
     no tr,align
     no input,class
     no input,src
     no textarea,id
     no select,name
     no pre,class
     no span,id
     no input,alt
     no img,vspace
     no textarea,cols
     no input,height
     no form,action
     no tr,class
     no option,value
     no img,vspace,3
     no img,border,0
     no input,height,21
     no input,width,120
     no select,size,1
     no input,src,//www.ibm.com/i/v14/buttons/submit.gif
     no td,height,18
     no input,maxlength,100
     no option,value,dW
     no pre,class,displaycode
     no textarea,cols,35
     no form,method,get
     no tr,align,right
     no table,align,right
     no input,id,q
     no img,class,display-img
     no textarea,rows,5
     no form,name,form1
     no b,class,related
     no input,name,searchType
     no input,border,0
     no td,valign,middle
     no textarea,class,iform
     no select,id,sn
     no textarea,id,Comments
     no link,media,screen_print
     no select,name,searchScope
     no textarea,name,Comments
     no form,action,//www.ibm.com/developerworks/search/searchResults.
     no img,align,left
     no input,class,ibm-btn-search
     no script,src,/developerworks/js/dwcss14.js
     no span,id,ibm-search-scope
     no label,for,sn
     no script,language,JavaScript
     no input,alt,Submit
     no img,name,Benoit_Marchal
     no tr,class,left-nav-child-highlight
     no input,type,hidden
     no textarea,wrap,virtual
     no li,class,ibm-first
     no option,selected,selected
     no select,class,input-local
     no input,value,1
     no form,id,ibm-search-form
     no body,link
     no h3,align
     no body,vlink
     no body,alink
     no body,bgcolor
     no body,text
     no h2,align
     no font,face
     no body,text,black
     no body,bgcolor,white
     no body,alink,navy
     no body,link,red
     no h2,align,center
     no h3,align,center
     no body,vlink,red
     no font,face,Arial_Helvetica_sans-serif
     no link,rel,SHORTCUT_ICON
     no acronym
     code cdata-section
     no dfn
     no kbd
     no ul,compact
     no a,accesskey
     no ol,start
     no small,class
     no link,title
     no a,rel
     no h2,class
     no div,align
     no ol,start,1
     no small,class,dots
     no h2,class,unnumbered
     no a,rel,next
     no div,align,right
     no link,title,Top
     no ul,compact,
     no a,accesskey,n
     no h3,class,likesectionHead
     no h4,class,likesubsectionHead
     no a,class,url
     no colgroup
     no colgroup,id
     no table,rules
     no tr,style
     no td,style
     no li,class
     no ol,class
     no tr,class
     no li,class,enumerate
     no ol,class,enumerate1
     no tr,style,vertical-align:baseline;
     no td,style,text-align:center;_white-space:nowrap;
     no colgroup,id,TBL-1-4g
     no colgroup,id,TBL-1-5g
     no table,rules,groups
     no colgroup,id,TBL-1-2g
     no colgroup,id,TBL-1-3g
     no td,style,text-align:left;_white-space:nowrap;
     no colgroup,id,TBL-1-1g
     no tr,class,hline
     no table,class,tabular
     no td,class,td11
     no h2,class
     no h2,class,likechapterHead
     no colgroup,id
     no tr,style
     no td,style
     no tr,class
     no h3,class,likesectionHead
     no colgroup,id,TBL-4621-1g
     no tr,style,vertical-align:baseline;
     no td,style,text-align:center;_white-space:nowrap;
     no table,rules,groups
     no colgroup,id,TBL-4621-2g
     no td,style,text-align:left;_white-space:nowrap;
     no h4,class,likesubsectionHead
     no tr,class,hline
     no table,class,tabular
     no td,class,td11

A.4 nemeth.sem

     # Licnsed under LGPL
     
     # Updated 6-18-08 by Mike Sivill <mike.sivill@viewplus.com>
     
     # You must edit this file as explained in the documentation to get
     # proper output.
     
     maction maction
     maligngroup maligngroup
     malignmark malignmark
     math math \eb,\*\ee
     menclose menclose
     mfrac mfrac ^?,/,^#
     mfenced mfenced ^(,^)
     mfenced mfenced,open,{ ^{,^}
     mglyph mglyph
     mi mi
     mlabeledtr mlabeledtr
     mmultiscripts mmultiscripts
     mn mn
     mo mo
     mover mover ^",^<,^}
     mpadded mpadded
     reverse mroot ^<,^>,^}
     mrow mrow
     ms ms
     mspace mspace
     msqrt msqrt ^>,^}
     mstyle mstyle
     msub msub ,^;,^"
     msubsup msupsup ,^~,^~^~,^"
     msubsup msubsup ,^;,^~,^"
     msup msup ,^~,^"
     matrix mtable
     mtd mtd \*\ec
     mtext mtext
     mtr mtr ^`^\,^(,\*^`^\,^)\er
     munder munder ^",^%,^}
     munderover munderover ^",^%,^<,^}
     semantics semantics
     skip annotation
     no annotation,encoding
     no maction,actiontype
     no maction,actiontype,highli
     no maction,actiontype,status
     no maction,actiontype,toggle
     no maction,dsi:background
     no malignmark,edge
     no malignmark,edge,right
     no math,display
     no math,display,block
     no math,mode
     no math,mode,inline
     no math,xmlns
     no mfenced,open
     no mfenced,separators
     no mn,color
     no mn,color,green
     no mo,stretchy
     no mo,stretchy,false
     no mo,stretchy,true
     no mover,accent
     no mover,accent,true
     no ms,lquote
     no ms,rquote
     no ms,rquote,'
     no mspace,height
     no mspace,width
     no mstyle,background
     no mstyle,background,lightb
     no mstyle,background,red
     no mstyle,color
     no mstyle,color,blue
     no mstyle,displaystyle
     no mstyle,displaystyle,true
     no mstyle,fontsize
     no mstyle,fontstyle
     no mstyle,fontstyle,italic
     no mstyle,fontstyle,normal
     no mstyle,fontweight
     no mstyle,fontweight,bold
     no mstyle,mathsize
     no mstyle,mathsize,normal
     no mstyle,mathvariant
     no mstyle,mathvariant,bold
     no mstyle,scriptlevel
     no mtable,columnalign
     no mtable,columnalign,left
     no mtable,equalcolumns
     no mtable,equalcolumns,false
     no mtable,equalrows
     no mtable,equalrows,false
     no mtable,frame
     no mtable,frame,solid
     no mtable,width
     no munderover,accent
     no munderover,accent,true
     skip annotation,encoding,MathType-MTEF
     skip merror
     skip mphantom
     no mo,maxsize
     no mo,maxsize,3
     no mo,mathsize
     no mi,mathvariant
     no mo,mathvariant
     no munder,accentunder
     no mn,mathvariant
     no mtext,mathvariant
     no mi,mathvariant,italic
     no mn,mathvariant,normal
     no mo,mathvariant,normal
     no munder,accentunder,true
     no mtext,mathvariant,normal
     no math,display,inline
     no mi,mathvariant,normal
     no mi,mathvariant,fraktur
     no mi,mathvariant,bold-sans
     
     no mi,mathvariant,double-struck
     no mi,mathvariant,double-struck
     no mi,mathvariant,double-struck
     no menclose,notation
     no mtd,columnalign
     no menclose,notation,longdiv
     no mtd,columnalign,right
     no mfrac
     no mfrac
     no mfrac
     no mfrac
     no mfrac
     no mfrac
     no mstyle,scriptlevel,-1

A.5 Files for BAUK Maths (ukmaths)

A.5.1 ukmaths.cfg

     cellsperline 32
     braillePages no
     mathexprtable us-table.dis,ukmaths.ctb
     editTable ukmaths_edit.ctb
     internetAccess no
     semanticFiles *,ukmaths.sem
     

A.5.2 ukmaths.sem

     # Licensed under LGPL
     
     maction maction
     maligngroup maligngroup
     malignmark malignmark
     math math \eb,\*\ee
     menclose menclose
     mfrac mfrac \x0003,@456-34,\x0004
     mfenced mfenced @126,@345
     mfenced mfenced,open,{ @246,@135
     mover mover ,@4-346,@12456
     munder munder ,@4-16,@12456
     mglyph mglyph
     mi mi
     mlabeledtr mlabeledtr
     mmultiscripts mmultiscripts
     mn mn
     mo mo
     mpadded mpadded
     reverse mroot @146
     mrow mrow \x0001,\*\x0002
     ms ms
     mspace mspace \x00a0
     msqrt msqrt @146
     mstyle mstyle
     msub msub ,@16,@12456
     msubsup msubsup ,@346,@12456
     msup msup ,@346,@12456
     matrix mtable
     mtd mtd \*\ec
     mtext mtext
     mtr mtr @123456,\*@123456\er
     munderover munderover ^",^%,^<,^}
     semantics semantics
     skip annotation
     no annotation,encoding
     no maction,actiontype
     no maction,actiontype,highli
     no maction,actiontype,status
     no maction,actiontype,toggle
     no maction,dsi:background
     no malignmark,edge
     no malignmark,edge,right
     no math,display
     no math,display,block
     no math,mode
     no math,mode,inline
     no math,xmlns
     no mfenced,open
     no mfenced,separators
     no mn,color
     no mn,color,green
     no mo,stretchy
     no mo,stretchy,false
     no mo,stretchy,true
     no mover,accent
     no mover,accent,true
     no ms,lquote
     no ms,rquote
     no ms,rquote,'
     no mspace,height
     no mspace,width
     no mstyle,background
     no mstyle,background,lightb
     no mstyle,background,red
     no mstyle,color
     no mstyle,color,blue
     no mstyle,displaystyle
     no mstyle,displaystyle,true
     no mstyle,fontsize
     no mstyle,fontstyle
     no mstyle,fontstyle,italic
     no mstyle,fontstyle,normal
     no mstyle,fontweight
     no mstyle,fontweight,bold
     no mstyle,mathsize
     no mstyle,mathsize,normal
     no mstyle,mathvariant
     no mstyle,mathvariant,bold
     no mstyle,scriptlevel
     no mtable,columnalign
     no mtable,columnalign,left
     no mtable,equalcolumns
     no mtable,equalcolumns,false
     no mtable,equalrows
     no mtable,equalrows,false
     no mtable,frame
     no mtable,frame,solid
     no mtable,width
     no munderover,accent
     no munderover,accent,true
     skip annotation,encoding,MathType-MTEF
     skip merror
     skip mphantom
     no mo,maxsize
     no mo,maxsize,3
     no mo,mathsize
     no mi,mathvariant
     no mo,mathvariant
     no munder,accentunder
     no mn,mathvariant
     no mtext,mathvariant
     no mi,mathvariant,italic
     no mn,mathvariant,normal
     no mo,mathvariant,normal
     no munder,accentunder,true
     no mtext,mathvariant,normal
     no math,display,inline
     no mi,mathvariant,normal
     no mi,mathvariant,fraktur
     no mi,mathvariant,bold-sans
     no mi,mathvariant,double-struck
     no menclose,notation
     no mtd,columnalign
     no menclose,notation,longdiv
     no mtd,columnalign,right
     no mstyle,scriptlevel,-1

A.5.3 ukmaths.ctb

     # liblouis: UK Maths Table for mathematics
     #
     # Based on the Linux screenreader BRLTTY, copyright (C) 1999-2006 by
     # The BRLTTY Team
     #
     # Copyright (C) 2004, 2005, 2006
     # ViewPlus Technologies, Inc. www.viewplus.com
     # and
     # JJB Software, Inc. www.jjb-software.com
     # All rights reserved
     #
     # This file is free software; you can redistribute it and/or modify it
     # under the terms of the Lesser or Library GNU General Public License
     # as published by the
     # Free Software Foundation; either version 3, or (at your option) any
     # later version.
     #
     # This file 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
     # Library GNU General Public License for more details.
     #
     # You should have received a copy of the Library GNU General Public
     # License along with this program; see the file COPYING. If not, write
     # to
     # the Free Software Foundation, 51 Franklin Street, Fifth Floor,
     # Boston, MA 02110-1301, USA.
     #
     # Maintained by John J. Boyer john.boyer@jjb-software.com
     # Updated 6-18-08 by Mike Sivill <mike.sivill@viewplus.com>
     
     include ukmaths_single_cell_defs.cti
     include ukmaths_unicode_defs.cti
     # grouping definitions are character-definition rules
     grouping mrow \x0001\x0002 1e,2e
     grouping mfrac \x0003\x0004 3e,4e
     grouping brackets \x0005\x0006 126,345
     
     # Braille indicators
     numsign 3456
     capsign 6
     begcaps 6-6
     endcaps 6-3
     singleletterital 4
     singleletterbold 4
     
     # litdigit opcodes must be in this table, not the single-cell table.
     litdigit 0 245
     litdigit 1 1
     litdigit 2 12
     litdigit 3 14
     litdigit 4 145
     litdigit 5 15
     litdigit 6 124
     litdigit 7 1245
     litdigit 8 125
     litdigit 9 24
     
     # No letsign but endnum for letters a-j.
     endnum a 56-1
     endnum b 56-12
     endnum c 56-14
     endnum d 56-145
     endnum e 56-15
     endnum f 56-124
     endnum g 56-1245
     endnum h 56-125
     endnum i 56-24
     endnum j 56-245
     
     # Ordinary translation entries
     always = a-56-2356
     always + a-56-235
     always > a-135-a
     always < a-246-a
     always % 25-1234
     always $ 256
     always & 4-12346
     always ~ 45-156
     always ! 6-236
     prepunc " 236
     postpunc " 356
     postpunc ' 3
     always '' 36
     always ''' 36-3
     midnum , 3
     postpunc , 6-2
     always , 3
     always # 35-2345 print number sign before number
     always ( 126
     always ) 345
     pass2 [{mrow]@126/@345}mrow ?
     pass2 @126[{mrow]/}mrow@345 ?
     decpoint . 2
     always ... 3-3-3
     hyphen - 36
     postpunc . 6-256
     postpunc ; 6-23
     postpunc : 6-25
     postpunc ? 6-236
     endnum % 4-356
     midnum * 4-16
     repeated \s 0
     repeated \x00a0 a
     
     # swap opcodes for replacement and testing.
     swapcd dropped 0123456789 356,2,23,25,456,26,235,2356,236,35
     swapdd upnum 245,1,12,14,145,15,124,1245,125,24 0,0,0,0,0,0,0,0,0,0
     swapdd lownum 356,2,23,25,256,26,235,2356,236,35 0,0,0,0,0,0,0,0,0,0
     
     # now we start doing the real work
     
     # Correction rules
     correct {mrow$ld1-20[}mrow] ?
     correct "\eb"[{mrow]/}mrow"\ee" ?
     context "\eb"[]$l"\ee" @56
     context "\eb"[]","$l"\ee" @56
     context []"@456-34"$d1-10}mfrac #1=1
     # context []"@456-34"$d1-10}mfrac #1=1
     context []"@346"$d1-10"@12456" #1=1
     context []"@16"$d1-10"@12456" #1=1
     # context []"@146"$d1-10 #1=1
     context #1=1$d1-10 #1=0%dropped
     
     # exactdots opcodes for dot patterns in ukmaths.sem
     exactdots @126
     exactdots @345
     exactdots @123456
     exactdots @346
     exactdots @16
     exactdots @23456
     exactdots @34
     exactdots @456-34
     exactdots @12456
     exactdots @146
     
     # Function names and abbreviations
     word cos 1246-14
     word grad 1246-1245
     word cosh 1246-125-14
     word sinh 1246-125-234
     word tanh 1246-125-2345
     word cosech 1246-125-126
     word coth 1246-125-1256
     word sech 1246-125-36
     word log 1246-123
     word sin 1246-234
     word tan 1246-2345
     word cosec 1246-126
     word curl 1246-146
     word div 1246-1456
     word cot 1246-1256
     word arccosh 1246-236-14
     word arcsinh 1246-236-234
     word arctanh 1246-236-2345
     word arccosech 1246-236-126
     word arccoth 1246-236-1256
     word arcsech 1246-236-36
     word sec 1246-36
     word arccos 1246-4-14
     word antilog 1246-4-123
     word arcsin 1246-4-234
     word arctan 1246-4-2345
     word arccosec 1246-4-126
     word arccot 1246-4-1256
     word arcsec 1246-4-25
     word colog 1246-45-123
     
     # pass2 processing
     pass2 [@3456]%lownum1-10 ?
     pass2 [@456-34-3456]%lownum1-10 ?
     
     # pass3 processing
     pass3 @346%lownum1-10[@12456] ?
     pass3 @16[%lownum1-10]@12456 *
     pass3 {mfrac[@3456%upnum1-10%lownum1-10]}mfrac *

A.5.4 ukmaths_edit.ctb

     # liblouis Table for Post-Translation Editing
     #
     # Based on the Linux screenreader BRLTTY, copyright (C) 1999-2006 by
     # The BRLTTY Team
     #
     # Copyright (C) 2004, 2005, 2006
     # ViewPlus Technologies, Inc. www.viewplus.com
     # and
     # JJB Software, Inc. www.jjb-software.com
     # All rights reserved
     #
     # This file is free software; you can redistribute it and/or modify it
     # under the terms of the Lesser or Library GNU General Public License
     # as published by the
     # Free Software Foundation; either version 3, or (at your option) any
     # later version.
     #
     # This file 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
     # Library GNU General Public License for more details.
     #
     # You should have received a copy of the Library GNU General Public
     # License along with this program; see the file COPYING. If not, write
     # to
     # the Free Software Foundation, 51 Franklin Street, Fifth Floor,
     # Boston, MA 02110-1301, USA.
     #
     # Maintained by John J. Boyer john.boyer@jjb-software.com
     # Updated 6-18-08 by Mike Sivill <mike.sivill@viewplus.com>
     include ukmaths_single_cell_defs.cti
     
     
     math \x0001 56
     math \x0002 45
     math \x0003 56
     math \x0004 45
     repeated \s 0
     always \ee\s`4 6-256
     always \ee\s`1 6
     always \ee\s`3 6-25
     always \ee\s`2 6-23
     always `7\s\eb 12356
     always \ee\s`7 23456
     always "\s 0
     always \s,\s 6-0
     # context "\eb"[]$l"\ee" @56
     # context "\eb"[]","$l"\ee" @56
     
     pass2 @1b-12 ?
     pass2 @1b-15 ?
     pass2 @1b-12-4-4 @4

Configuration Settings Index

Semantic Action Index

Function Index

Program Index

liblouisutdml-2.5.0/doc/liblouisutdml.info0000664000076500007650000051113212222613352015656 00000000000000This is ../../doc/liblouisutdml.info, produced by makeinfo version 4.8 from ../../doc/liblouisutdml.texi. INFO-DIR-SECTION Misc START-INFO-DIR-ENTRY * Liblouisutdml: (liblouisutdml). An xml to Braille Translation Library. END-INFO-DIR-ENTRY This manual is for liblouisutdml (version 2.5.0, 25 November 2012), an xml to Braille Translation Library. This file may contain code borrowed from the Linux screenreader BRLTTY, Copyright (C) 1999-2009 by the BRLTTY Team. Copyright (C) 2004-2009 ViewPlus Technologies, Inc. `www.viewplus.com' and Copyright (C) 2006,2009 Abilitiessoft, Inc. `www.abilitiessoft.com'. This file is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser (or library) General Public License (LGPL) as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Lesser (or Library) General Public License LGPL for more details. You should have received a copy of the GNU Lesser (or Library) General Public License (LGPL) along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  File: liblouisutdml.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) Liblouisutdml User's and Programmer's Manual ******************************************** This manual is for liblouisutdml (version 2.5.0, 25 November 2012), an xml to Braille Translation Library. This file may contain code borrowed from the Linux screenreader BRLTTY, Copyright (C) 1999-2009 by the BRLTTY Team. Copyright (C) 2004-2009 ViewPlus Technologies, Inc. `www.viewplus.com' and Copyright (C) 2006,2009 Abilitiessoft, Inc. `www.abilitiessoft.com'. This file is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser (or library) General Public License (LGPL) as published by the Free Software Foundation; either version 3, or (at your option) any later version. This file 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 Lesser (or Library) General Public License LGPL for more details. You should have received a copy of the GNU Lesser (or Library) General Public License (LGPL) along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Menu: * Introduction:: * Transcribing Documents:: * Customization Configuring liblouisutdml:: * Connecting with the xml Document:: * Special Features:: * Special Formats:: * Implementing Braille Mathematics Codes:: * Programming with liblouisutdml:: * Example files:: * Configuration Settings Index:: * Semantic Action Index:: * Function Index:: * Program Index:: --- The Detailed Node Listing --- Transcribing Documents * Transcribing XML files with file2brl:: * Transcribing Text Documents:: * Transcribing Poorly Formatted Documents:: * Transcribing html Documents:: * Transcribing Microsoft Word files with msword2brl:: * Transcribing RTF files with rtf2brl:: * Transcribing PDF files with pdf2brl:: Customization: Configuring liblouisutdml * outputFormat:: * translation:: * xml:: * style:: Connecting with the xml Document - Semantic-Action Files * Semantic Actions Overview:: * Semantic Actions in detail:: * Pseudo-actions:: * Using XPath Expressions:: Special Features * Table of contents:: * Back-translation:: * Reformatting:: * Interlining:: * Browser-Friendly Output:: * CDATA Sections:: Special Formats * Tables:: * Reserving Space for Graphics:: * Displayed Text:: * Displayed Mathematics:: * Spatial Layouts in Mathematics:: * Arithmetic Examples:: * Poetry:: * Dividing a Book Into Volumes:: Programming with liblouisutdml * License:: * Overview:: * Files and Paths:: * lbu_version:: * lbu_initialize:: * lbu_translateString:: * lbu_translateFile:: * lbu_translateTextFile:: * lbu_backTranslateFile:: * lbu_free:: Example files * liblouisutdml.ini:: * default.cfg:: * html.sem:: * nemeth.sem:: * Files for BAUK Maths (ukmaths):: Files for BAUK Maths (ukmaths) * ukmaths.cfg:: * ukmaths.sem:: * ukmaths.ctb:: * ukmaths_edit.ctb::  File: liblouisutdml.info, Node: Introduction, Next: Transcribing Documents, Prev: Top, Up: Top 1 Introduction ************** liblouisutdml is a software component which can be incorporated into software packages to provide the capability of translating any file in the computer lingua franca xml format or plain text into properly transcribed braille. This includes translation into grade two, if desired, mathematical codes, etc. It also includes formatting according to a style sheet which can be modified by the user. The first program into which liblouisutdml has been incorporated is `file2brl'. This program will translate an xml or text file into an embosser-ready braille file. It is not necessary to know xml, because MSWord and other word processors can export files in this format. If the word processor has been used correctly `file2brl' will produce an excellent braille file. There is a Mac GUI application incorporating liblouisutdml called `louis'. For a link to it go to `www.abilitiessoft.com/downloads'. You can also obtain a Windows binary on this page. At present it is command-line. We hope to have a GUI soon. Users who want to generate Braille using `file2brl' will be interested in *Note Transcribing XML files with file2brl::. Those who wish to change the output generated by liblouisutdml should read *Note Customization Configuring liblouisutdml::. If you encounter a type of xml file with which liblouisutdml is not familiar you can learn how to tell it how to process that file by reading *Note Connecting with the xml Document::. If you wish to implement a new braille mathematics code read *Note Implementing Braille Mathematics Codes::. Finally, computer programmers who wish to use liblouisutdml in their software can find the information they need in *Note Programming with liblouisutdml::. You will also find it advantageous to be acquainted with the companion library liblouis, which is a braille translator and back-translator (*note Overview: (liblouis)Top.).  File: liblouisutdml.info, Node: Transcribing Documents, Next: Customization Configuring liblouisutdml, Prev: Introduction, Up: Top 2 Transcribing Documents ************************ * Menu: * Transcribing XML files with file2brl:: * Transcribing Text Documents:: * Transcribing Poorly Formatted Documents:: * Transcribing html Documents:: * Transcribing Microsoft Word files with msword2brl:: * Transcribing RTF files with rtf2brl:: * Transcribing PDF files with pdf2brl::  File: liblouisutdml.info, Node: Transcribing XML files with file2brl, Next: Transcribing Text Documents, Prev: Transcribing Documents, Up: Transcribing Documents 2.1 Transcribing XML files with file2brl ======================================== At the moment, actual transcription with liblouisutdml is done with the command-line (or console) program `file2brl'. The line to type is: file2brl [OPTIONS] [-f config-file] [infile] [outfile] The brackets indicate that something is optional. You will see that nothing is required except the program name itself, `file2brl'. The various optional parts control how the program will behave, as follows: `-h' `--help' This option causes `file2brl' to print a help message describing usage and exit. `-v' `--version' This option causes `file2brl' to display the version information and exit. `-l' `--log-file' This option will cause `file2brl' and liblouisutdml to print error messages to `file2brl.log' instead of stderr. The file will be in the current directory. This option is particularly useful if `file2brl' is called by a GUI script or Web application. `-f configfile' `--config-file configfile' This specifies the configuration file which tells `file2brl' how to do the transcription. (It may be a list of file names separated by commas.) This file specifies such things as the number of cells per line, the number of lines per page, The translation tables to be used, how paragraphs and headings are to be formatted, etc. If this part of the command line is omitted, `file2brl' assumes that the configuration file is named `default.cfg'. If the configuration file name contains a pathname `file2brl' will consider this as a path on which to look for files that it needs (*note Files and Paths::). If no pathname is given the standard paths are searched and finally the current directory. To make `file2brl' search the current directory first, precede the file name with `./'. `-Csetting=value' `--config-setting setting=value' This option enables you to specify configuration settings on the command line instead of changing the configuration file. You can use as many `-C' options as you wish. Any settings can be specified except those having to do with styles. *Note Configuration Settings Index::, for a list of available settings. These must be specified in configuration files. The settings may be in any order. They override any settings in `liblouisutdml.ini' or in the configuration file used by `file2brl'. `-b' `--backward' back-translate. The input file must be a braille file, such as `.brf'. The output file is a back-translation of this file. It may be in either plain-text or xhtml (html), according to the setting of `backFormat' in the `outputFormat' section of the configuration file. Html files will contain page numbers and emphasis. To get good html, the liblouis table must have the entry `space \e 1b' so that it will pass through escape characters. The `html.sem' file must also contain the line `pagenum pagenum'. Text output files simply have a blank line between paragraphs. Encoding of text files is controlled by the `outputEncoding' setting. Html files are always in UTF-8. `-r' `--reformat' Reformat. The input file must be a braille file, such as `.brf'. The output is a braille file formatted according to the configuration file. It is advisable to set backFormat to html, since this will preserve print page numbers and emphasis. This option can be useful for changing the line length and page length of a braille file, for example, from 40 to 32 cells. It is also an excellent way to check the accuracy of liblouis tables. The original page numbers at the tops and bottoms of pages are discarded, and new ones are generated. `-p' `--poorly-formatted' Poorly formatted input translation. Infile is any text file such as may have been obtained by extracting the text in a pdf file. The input file may also be an xml or html file which is so poorly formatted that better braille can be obtained by ignoring the formatting. `file2brl' tries to guess paragraph breaks. The output is generally reasonably formatted, that is, with reasonable paragraph breaks. `-t' `--html' The document is an h(t)ml file, not xhtml. This option is useful with files downloaded from the Web in source form. Without it, the program will first try to parse the file as an xml document, producing lots of error messages. It will then try the html parser. With this option, it goes directly to the html parser. See also the `formatFor' configuration (*note formatFor setting::) file setting, which enables you to format the braille output for viewing in a browser. `-T' `--text' Consider the document to be a text file, even if it is xml or html. `infile' This is the name of the input file containing the material to be transcribed. The file may be either an xml file or a text file. The `-b', `-r' and `-p' options discussed above provide for other types of files and processing. Typical xml files are those provided by `www.bookshare.org' or those derived from a word processor by saving in xml format. If a text file is used paragraphs and headings should be separated by blank lines. In such a file there is no way to distinguish between paragraphs and headings, so they will all be formatted as paragraphs, as specified by the configuration file. However, if you want a blank line in the braille transcription use two consecutive blank lines in the text file. `outfile' This is the name of the output file. It will be transcribed as specified by the configuration file and the `-C' configuration settings. The following paragraphs provide more information on both the input and output files. `file2brl' is set up so that it can be used in a "pipe". To do this, omit both infile and outfile. Input is then taken from the standard input unit. The first file name encountered (a word not preceded by a minus sign) is taken to be the input file and the second to be the output file. If you wish input to be taken from stdin and still want to specify an output file, use one minus sign (`-') for the input file. If only the program name is typed `file2brl' assumes that the configuration file is `default.cfg', input is from the standard input unit, and output is to the standard output unit.  File: liblouisutdml.info, Node: Transcribing Text Documents, Next: Transcribing Poorly Formatted Documents, Prev: Transcribing XML files with file2brl, Up: Transcribing Documents 2.2 Transcribing Text Documents =============================== See the previous section on using `file2brl'. This program recognizes text files automatically and transcribes them according to the information in the configuration files. Paragraphs must be separated with a blank line. If you want a blank line in the output use two blank lines.  File: liblouisutdml.info, Node: Transcribing Poorly Formatted Documents, Next: Transcribing html Documents, Prev: Transcribing Text Documents, Up: Transcribing Documents 2.3 Transcribing Poorly Formatted Documents =========================================== file2brl -p infile outfile Some text documents, such as those derived from pdf files, and even some xml and html documents, are so poorly formatted that you can get better braille by ignoring whatever markup they contain. The `-p' option of `file2brl' does this. It ignores xml or html markup and uses heuristics to find the beginning of paragraphs. Its choices are usually good. Note that it does not work with rtf files. However, if `rtf2xml' (*note Transcribing RTF files with rtf2brl::) will convert the file, it will work with the resulting xml file.  File: liblouisutdml.info, Node: Transcribing html Documents, Next: Transcribing Microsoft Word files with msword2brl, Prev: Transcribing Poorly Formatted Documents, Up: Transcribing Documents 2.4 Transcribing html Documents =============================== file2brl -t infile outfile The `-t' option prevents `xml2blr' from trying to transcribe infile as an xml document. This will produce a lot of error messages. `file2brl' will then try the html parser. Note that xhtml documents are actually xml.  File: liblouisutdml.info, Node: Transcribing Microsoft Word files with msword2brl, Next: Transcribing RTF files with rtf2brl, Prev: Transcribing html Documents, Up: Transcribing Documents 2.5 Transcribing Microsoft Word files with msword2brl ===================================================== msword2brl infile outfile Infile must be a Microsoft Word file. The script first calls the `antiword' program, so you must have this installed on your machine. `antiword' is called with `-x db', which causes the output to be in docbook format. This is piped to `file2brl'. The output file from `file2brl' contains much of the formatting, including emphasis, of the word file.  File: liblouisutdml.info, Node: Transcribing RTF files with rtf2brl, Next: Transcribing PDF files with pdf2brl, Prev: Transcribing Microsoft Word files with msword2brl, Up: Transcribing Documents 2.6 Transcribing RTF files with rtf2brl ======================================= rtf2brl infile outfile Infile must be a rich-text (rtf) file, such as Bookshare provides for proofreading. The script first calls `rtf2xml', so you must have this program installed on your machine. You can find it on the downloads page of `www.abilitiessoft.com'. It was copied from its SourceForge project. Since it is a Python program, it can be rather slow. Its output is piped to `file2brl'. The output of `rtf2xml' is xml with the root element `doc'. The file `doc.sem' is fairly complete, so the output of `file2brl' contains much of the formatting, including emphasis, of the original rtf file.  File: liblouisutdml.info, Node: Transcribing PDF files with pdf2brl, Prev: Transcribing RTF files with rtf2brl, Up: Transcribing Documents 2.7 Transcribing PDF files with pdf2brl ======================================= pdf2brl infile outfile Infile must be a PDF (Portable Document Format) file. The script first calls the `pdftotext' program, so you must have this installed on your machine. It is part of xpdf and most likely already installed if you're on a modern Linux distribution. Otherwise, you can get it from either `http://poppler.freedesktop.org' or `http://www.foolabs.com/xpdf/download.html'. `pdftotext' is called with the `-raw' and `-' options, which cause it to place its output on stdout. This is piped to `file2brl', which is called with the `-p' option, since output from `pdftotext' is likely to be poorly formatted. The output file from `file2brl' is mostly in sensible paragraphs.  File: liblouisutdml.info, Node: Customization Configuring liblouisutdml, Next: Connecting with the xml Document, Prev: Transcribing Documents, Up: Top 3 Customization: Configuring liblouisutdml ****************************************** The operation of liblouisutdml is controlled by two types of files: semantic-action files and configuration files. The former are discussed in the section Connecting with the xml Document - Semantic-action Files (*note Connecting with the xml Document - Semantic-Action Files: Connecting with the xml Document.). The latter are discussed in this section. A third type of file, braille translation tables, is discussed in the liblouis documentation (*note Overview: (liblouis)Top.). Another section of the present document which may be of interest is Implementing Braille Mathematical Codes (*note Implementing Braille Mathematics Codes::). Besides files, liblouisutdml can also be controlled by configuration strings, which are character strings in memory containing configuration settings separated by end-of-line characters. Such strings can be generated by the `-C' option on the `file2brl' command line, by the `configstring' and `configtweak' semantic actions, or by passing a string to the `lbu_initialize' function. The information below applies to `file2brl' as much as to liblouisutdml. Before discussing configuration files in detail it is worth noting that the application program has access to the information in the configuration files by calling the liblouisutdml function `lbu_initialize'. This function returns a pointer to a data structure containing the configuration information. The calling program must include the header file `louisutdml.h'. You do not need to call `lbu_initialize' unless you need the facilities which it provides. A configuration file specification may contain more than one file name, separated by commas. liblouisutdml will process these files in sequence, merging the information they contain. The first file name may also contain a path. liblouisutdml will search for the files it needs first on this path. To make it search first the current directory precede the first file name with `./'. After the path, if any, has been evaluated, but before reading any of the files, liblouisutdml reads in a file called `liblouisutdml.ini'. This file can contain any configuration settings, but it usually contains only the minimum ones for liblouisutdml to operate properly. You may alter the values in the distribution `liblouisutdml.ini', but you should not delete any settings. Do not specify `liblouisutdml.ini' as your configuration file. This will lead to error messages and program termination. If a configuration file read in later contains a particular setting name, the value specified simply replaces the one specified in `liblouisutdml.ini' or any previously read configuration file. Originally, configuration files contained four main sections, `outputFormat', `translation', `xml' and `style'. The section names, except for `style' are now optional. In addition, a configuration file can contain an include entry. This causes the file named on that line to be read in at the point where the line occurs. The sections need not follow each other in any particular order, nor is the order of settings within each section important. The section names, except for `style' are optional. In this document and in the `liblouisutdml.ini' file, where section and setting names consist of more than one word, the first letter of each word following the initial one is capitalized. This is merely for readability. The case of the letters in these names is ignored by the program. Section and setting names may not contain spaces. In addition to `liblouisutdml.ini' the distribution also sontains a number of configuration files. The most important of these is `preferences.cfg', which contains all possible settings and a "default" value for each. You should use this file as a refererence. It is the file read by the `file2brl' command-line interface program if no configuration file is giben. Here, then, is an explanation of each section and setting in the `preferences.cfg' file. When you look at this file you will see that the section names start at the left margin, while the settings are indented one tab stop. This is done for readability. it has no effect on the meaning of the lines. You will also see lines beginning with a number sign (`#'), which are comments. Blank lines can also be used anywhere in a configuration file. In general, a section name is a single word or combination of unspaced words. However, each style has a section of its own, so the word `style' is followed by a space then by the name of the style. Setting lines begin with the name of the setting, followed by at least one space or tab, followed by the value of the setting. A few settings have two values. * Menu: * outputFormat:: * translation:: * xml:: * style::  File: liblouisutdml.info, Node: outputFormat, Next: translation, Prev: Customization Configuring liblouisutdml, Up: Customization Configuring liblouisutdml 3.1 outputFormat ================ This section specifies the format of the output file (or string). `cellsPerLine 40' The number of cells in a braille line. `linesPerPage 25' The number of lines on a braille page `interpoint no' Whether or not the output will be used to produce interpoint braille. This affects the placement of page numbers and may affect other things in the future. The only two values recognized are `yes' and `no'. `lineEnd \r\n' This specifies the control characters to be placed at the end of each output line. These characters vary from one intended use of the output to another. Most embossers require the carriage-return and line-feed combination specified above. However, a braille display may work best with just one or the other. Any valid control characters can be specified. `pageEnd \f' The control Character to be given at the end of a page. Here it is a forms-feed character, but it can be something else if deeded. `fileEnd ^z' The control character to be placed at the end of the file, here a control-z. `printPages yes' Whether or not to show print page numbers if they are given in the xml input. The two valid values are `yes' and `no'. `braillePages yes' Whether or not to format the output into pages. Here the value is `yes', for use with an embosser. However the user of a braille display may wish to specify `no', so as not to be bothered with page numbers and forms feed characters. If no is specified the lines will still be of the length given in `cellsPerLine', but the value of `linesPerPage' will be ignored. `paragraphs yes' Whether or not to format the output into paragraphs, using appropriate styles. If `no' is specified, what would be a paragraph is output simply as one long line. Applications that wish to do their own formatting may specify `no'. `beginningPageNumber 1' This is the number to be placed on the first Braille page if `braillePages' is yes. This is useful when producing multiple Braille volumes. `printPageNumberAt top' If print page numbers are given in the xml input file they will be placed at the top of each braille page in the right-hand corner. If `pageSeparator' is set to `yes', a page separator line will also be produced on the Braille page where the print page break actually occurs. You may also specify `bottom' for this setting. `braillePageNumberAt bottom' The braille page number will be placed in the bottom right-hand corner of each page. If `interpoint yes' has been specified only odd pages will receive page numbers. You may also specify `top' for this setting. If print page numbers and Braille page numbers are both placed at the top or bottom, they are rendered next to each other with a space in between. `continuePages yes' Print page numbers can be prefixed with a letter (a, b, c, etc.) on continued pages. The two valid values are `yes' and `no'. `pageSeparator yes' A page separator line (or page break indicator), a line of unspaced Braille dots 36, will be placed wherever a print page break occurs. No page separator lines are placed on the first or last line of a Braille page, and no page separator lines are shown when the new print page coincides with a new Braille page. `pageSeparatorNumber yes' Show a page number at the far right margin of a page separator line. No space is left between the separator line and the first symbol of the page number. `ignoreEmptyPages yes' An empty page occurs when a `pagenum' tag is immediately followed by another `pagenum' tag. By default, empty pages are completely ignored. If you specify `no' for this setting, a sequence of `pagenum' tags will lead to a _combined_ print page number: the number of the first empty page is combined with that of the page on which text reappears, e.g. 5-7. If lettered continuation pages are required (see `continuePages'), they carry only the number of the page on which text reappears. `printPageNumberRange no' By default, only the page number of the _first_ print page on a Braille page is shown at the top or bottom. However, if `printPageNumberRange' is set to `yes', the _range_ of print pages contained in the current Braille page is displayed. If the first page in this range is a continued print page, it is prefixed with a letter as usual (see `continuePages'). `mergeUnnumberedPages yes' Page breaks without a page number can simply be ignored. This means that unnumbered print pages will be treated as if they were a part of the preceding page. You can also specify `no' for this setting. `pageNumberTopSeparateLine yes' Whether or not to provide a separate line for page numbers when they are placed at the top of a Braille page. The two valid values are `yes' and `no'. A print page number range (see `printPageNumberRange') at the top of a page is always displayed on a separate line. `pageNumberBottomSeparateLine yes' Whether or not to provide a separate line for page numbers when they are placed at the bottom of a Braille page. `hyphenate no' If `yes' is specified words will be hyphenated at the ends of lines if a hyphenation table is available. In contracted English Braille hyphenation is not generally used, but it can save considerable space. The hyphenation table is specified as part of the table list in the `literaryTextTable' setting of the translation section. `outputEncoding ascii8' This specifies that the output is to be in the form of 8-bit ASCII characters. This is generally used if the output is intended directly for a braille embosser or display. The other values of encoding are `UTF8', `UTF16' and `UTF32'. These are useful if the application will process the output further, such as for generating displays of braille dots on a screen. `inputTextEncoding ascii8' This setting is used to specify the encoding of an input text file. The valid values are `UTF8' and `ascii8'. `formatFor textDevice' This setting specifies the type of device the output is intended for. `textDevice' is any device that accepts plain text, including embossers. You can also specify `browser'. In this case the output will be formatted for viewing in a browser. If the input file contains links, they will be preserved and can be used in the normal way. The text will be translated into braille with the correct line length. Math and computer material will be translated appropriately. These files work well in lynx and Internet Explorer, not so well in elinks and Firefox (Before Jaws 10). `backFormat plain' This setting specifies the format of back-translated files. `Plain' specifies plain-text, while `html' specifies xhtml. The latter is always encoded in UTF-8. Plain-text files can be encoded in ascii8, UTF-8 or UTF-16. Html is strongly recommended, since it will preserve print page numbering and emphasis. `backLineLength 70' This setting specifies the length of lines in back-translated files, whether in plain-text or html. This is mainly for human readability. Lines may sometimes be somewhat longer. `interline no' This setting specifies whether interlining is desired. If it is set to `yes', the first line in the output will be a braille translation, the next line will be its back-translation according to the interlineBackTable. Back-translation is used instead of simply presenting the print original because a braille line may contain additional information, such as leading blanks, print or braille page numbers, print page separator lines, etc. `lineFill '' This setting defines the fill character that will be used before the page numbers in the table of contents for example. The default fill character is an apostrophe (dot 3).  File: liblouisutdml.info, Node: translation, Next: xml, Prev: outputFormat, Up: Customization Configuring liblouisutdml 3.2 translation =============== This section specifies the liblouis translation tables to be used for various purposes. `literaryTextTable en-us-g2.ctb' The table used for producing literary braille. This may be either contracted or uncontracted. `uncontractedTable en-us-g1.ctb' The table used for producing uncontracted or Grade One braille. This setting appears to be superfluous and may be eliminated in the future. `compbrailleTable en-us-compbrl.ctb' The table used for producing large amounts of output in computer braille, such as computer programs. The computer braille table is usually combined with one of the two tables above. `mathtextTable en-us-mathtext.ctb' This table specifies how the non-mathematical parts of math books are to be translated. In many cases it will be the same as literaryTextTable or uncontractedTable. For books translated with the Nemeth Code it is different, because this code requires modification of standard Grade Two. `MathexpTable nemeth.ctb' This is the table used to translate mathematical expressions. `editTable nemeth_edit.ctb' When the output includes both mathematics and text there may be errors where one type of translation directly follows another. The editTable removes these errors. `interlineBackTable en-us-interline.ctb' This setting specifies the table to be used for back-translation when interlining is turned on. It must be tailored for this purpose, since an ordinary forward-translation table may contain entries that do not handle the additional information in braille lines correctly.  File: liblouisutdml.info, Node: xml, Next: style, Prev: translation, Up: Customization Configuring liblouisutdml 3.3 xml ======= This section provides various information for the processing of xml files. `semanticFiles *,nemeth.sem' This setting gives a list of semantic-action files. These files are read in the sequence given in the list. Here the first member of the list is an asterisk (`*'). This means that the corresponding file is to be named by taking the root element of the document and appending `.sem'. This asterisk member may occur anywhere in the list. `xmlheader ' This line gives the xml header to be added to strings produced by programs like `Mathtype' that lack one. `entity nbsp ^1' This line defines an entity or substitution in an xml file. It is one of those that has two values. The first is the thing to be replaced, and the second is the replacement. As many entity lines as necessary can be used. The information they contain is added to the information provided by xmlHeader. In `liblouisutdml.ini' this line is commented out, because specifying it at this point would prevent the user from specifying his own xmlheader. `internetAccess yes' The computer has an internet connection and liblouisutdml may obtain information necessary for the processing of this file from the Internet. If this setting is `no' liblouisutdml will not try to use the internet. The necessary information may, however, be provided on the local machine in the form of a "dtd" file. `newEntries yes' liblouisutdml may create a new semantic-action file (beginning with `new_') for a document with an unknown root element or a file (beginning with `appended_') containing new entries for an existing semantic-action file. Both kinds of files are placed on the current directory. If this setting is `no' liblouisutdml will not create a file of new entries and if it encounters a document with an unknown root element it will issue an error message. Setting newEntries to `no' may be useful if users should not be bothered with the minutiae of semantic-action files.  File: liblouisutdml.info, Node: style, Prev: xml, Up: Customization Configuring liblouisutdml 3.4 style ========= The following sections all deal with styles. Each style has its own section. Style section names are unlike other section names in that they consist of the word style, followed by a space, followed by a style name. With some exceptions, styles are not hard-coded. The user may define any style desired, with any name except `document', `para', `heading1', `heading2', `heading3', `heading4', `contentsheader', `contents1', `contents2', `contents3' and `contents4'. The first two are needed for basic formatting. The others are needed for the table of contents tool. The user must define settings for these styles as for any others. This is done in `liblouisutdml.ini', which also contains definitions and settings for many other styles. The user can add styles at any time in her/his own configuration files. Styles can be nested. That is, a document may contain a section of one style, and inside this may be a section of another style. For example, you might have styles named frontMatter, titlePage, dedication, contents, and so on. Your document might contain a section of style frontMatter. Inside this section might be subsections of styles titlePage, dedication, contents, and so on. Inside the titlePage section there might be other sections with styles heading1, para, centered, etc. Your frontMatter style might also define the "persistent" style setting `braillePageNumberFormat roman'. This setting will apply to all the styles nested within frontMatter, unless they have a setting other than `normal', which is the default and means ordinary braille page numbers. However, the titlePage style might have the setting `braillePageNumberFormat blank'. This will apply to all styles nested within it. When the titlePage section ends, the frontMatter setting `roman' will be restored. The `braiblePageNumberFormat' setting is an example of a "persistent" style setting. Most settings apply only to the style for which they are declared. Below are the settings for the predefined style names. The `document' style contains all possible settings. The others contain only settings that are different from the defaults. 3.4.1 style document -------------------- This is a predefined style name. All settings have their default values. The user must specify any other values. If a "persistent" style setting is specified, it will apply to the whole ducument. `linesBefore 0' This setting gives the number of blank lines which should be left before the text to which this style applies. It is set to a non-zero value for some header styles. `linesAfter 0' The number of blank lines which should be left after the text to which this style applies. `leftMargin 0' The number of cells by which the left margin of all lines in the text should be indented. Used for hanging indents, among other things. This is a "persistent" setting, so by default all nested styles will inherit the setting. `rightMargin 0' The equivalent of `leftMargin' for the right side of the page. This is also a persistent setting. `firstLineIndent 0' The number of cells by which the first line is to be indented relative to leftMargin. firstLineIndent may be negative. If the result is less than 0 it will be set to 0. This setting is persistent. `translate contracted' This setting is currently inactive. It may be used in the future. This setting tells how text in this style should be translated. Possible values are `contracted', `uncontracted', `compbrl', `mathtext' and `mathexpr'. `skipNumberLines no' If this setting is `yes' the top and bottom lines on the page will be skipped if they contain braille or print page numbers. This is useful in some of the mathematical and graphical styles. `format leftJustified' The format setting controls how the text in the style will be formatted. Valid values are `leftJustified', `rightJustified', `centered', `computerCoded', `alignColumnsLeft', `alignColumnsRight', and `contents'. The first three are self-explanatory. `computerCoded' is used for computer programs and similar material. The next two are used for tabular material. `alignColumnsLeft' causes the left ends of columns to be aligned. `alignColumnsRight' causes the right ends of columns to be aligned. `contents' is used only in styles specifically intended for tables of contents. In the case of `leftJustified', `rightJustified' and `centered', nested styles inherit this setting by default. `newPageBefore no' If this setting is `yes', the text will begin on a new page. This is useful for certain mathematical and graphical styles. Page numbers are handled properly. `newPageAfter no' If this setting is `yes' any remaining space on the page after the material covered by this style is handled is left blank, except for page numbers. `rightHandPage no' if this setting is `yes' and interpoint is yes the material covered by this style will start on a right-hand page. This may cause a left-hand page to be left blank except for page numbers. If interpoint is `no' this setting is equivalent to newPageBefore. `braillePageNumberFormat normal' This setting specifies the format of braille page numbers. `normal' means ordinary Arabic numbers. `roman' means Roman numbers. `p' means to precede Arabic numbers with the letter "p" (for preliminary). Finally, `blank' causes the page number to be blank (no page numbers). This is a "persistent" style setting. `dontSplit no' If this setting is `yes', the element is protected from being split across pages. This means that if a block of text doesn't fit on the current page, it will be placed at the beginning of the next one. This setting applies to the whole element, including children, so if nested styles specify other values for `dontSplit', these values will be ignored. `keepWithNext no' If this setting is `yes', the element covered by this style is protected from being split across pages, and in addition it is kept together with the first line of text of the next sibling. `orphanControl 0' With this setting you can control how many lines of text of an element must be printed at least at the bottom of a braille page. The default value is `0'. To have an effect, the setting must have a value of `2' or more. 3.4.2 style contentsheader -------------------------- This style is used to specify where the table of contents should be placed and its title. The xml tag assigned to it in the semantic action file should be placed in the document where you want the table of contents, and it should contain the title of that table between its starting and ending markers. `linesBefore 1' `linesAfter 1' `format centered' 3.4.3 style contents1 --------------------- This style and the other contents styles are used for the table of contents and correspond to the ten heading levels (`contents5', `contents6', `contents7', `contents8', `contents9' and `contents10' are not showed here). `firstLineIndent -2' `leftMargin 2' `format contents' 3.4.4 style contents2 --------------------- `firstLineIndent -2' `leftMargin 4' `format contents' 3.4.5 style contents3 --------------------- `firstLineIndent -2' `leftMargin 6' `format contents' 3.4.6 style contents4 --------------------- `firstLineIndent -2' `leftMargin 8' `format contents' 3.4.7 style heading1 -------------------- This style is used for main headings, such as chapter titles. `linesBefore 1' `center yes' `linesAfter 1' 3.4.8 style heading2 -------------------- The first level of subheadings after the main heading. `linesBefore 1' `firstLineIndent 4' 3.4.9 style heading3 -------------------- The third level of headings. `firstLineIndent 4' 3.4.10 style heading4 --------------------- The fourth level of headings. There are six more levels: `heading5', `heading6', `heading7', `heading8', `heading9' and `heading10'. `firstLineIndent 4' 3.4.11 style para ----------------- Paragraph. This is ordinary body text. `firstLineIndent 2'  File: liblouisutdml.info, Node: Connecting with the xml Document, Next: Special Features, Prev: Customization Configuring liblouisutdml, Up: Top 4 Connecting with the xml Document - Semantic-Action Files ********************************************************** * Menu: * Semantic Actions Overview:: * Semantic Actions in detail:: * Pseudo-actions:: * Using XPath Expressions::  File: liblouisutdml.info, Node: Semantic Actions Overview, Next: Semantic Actions in detail, Prev: Connecting with the xml Document, Up: Connecting with the xml Document 4.1 Overview ============ When liblouisutdml (or `file2brl') processes an xml document, it needs to be told how to use the information in that document to produce a properly translated and formatted braille document. These instructions are provided by a semantic-action file, so called because it explains the meaning, or semantics, of the various specifications in the xml document. To understand how this works, it is necessary to have a basic knowledge of the organization of an xml document. An xml document is organized like a book, but with much finer detail. First there is the title of the whole book. Then there are various sections, such as author, copyright, table of contents, dedication, acknowledgments, preface, various chapters, bibliography, index, and so on. Each chapter may be divided into sections, and these in turn can be divided into subsections, subsubsections, etc. In a book the parts have names or titles distinguished by capitalization, type fonts, spacing, and so forth. In an xml document the names of the parts are enclosed in angle brackets (`<>'). For example, if liblouisutdml encounters `' at the beginning of a document, it knows it is dealing with a document that conforms to the standards of the extensible markup language (xhtml) - at least we hope it does. When you see a book, you know it's a book. The computer can know only by being told. Something enclosed in angle brackets is called an "element" (more properly, a "tag") in xml parlance. (There may be more between the angle brackets than just the name of the element. More of this later). The first "element" in a document thus tells liblouisutdml what kind of document it is dealing with. This element is called the "root element" because the document is visualized as branching out from it like a tree. Some examples of root elements are `', `', `', `' and `'. Whenever liblouisutdml encounters a root element that it doesn't know about it creates a new file called a semantic-action file. The name of this file is formed by stripping the angle brackets from the root element, putting `new_' in front of it and adding a period plus the letters `sem'. For example, `new_myformat.sem'. If you look in a directory containing semantic-action files you will see names like `html.sem', `dtbook.sem', `math.sem', and so on. The "new" semantic-action files must be edited by a person and the prefix "new" removed to get an ordinary semantic-action file name. Sometimes it is advantageous to preempt the creation of a semantic-action file for a new root element. For example, an article written according to the docbook specification may have the root element `
'. However, the specification itself has the root element `'. In this case you can specify the `book.sem' file in the configuration file by writing, in the xml section,: semanticFiles book.sem You will note that this setting uses the plural of "file". This is because you can actually specify a list of file names separated by commas. You might want to do this to specify the semantic-action file for the particular braille mathematical code to be used. For example: semanticFiles book.sem,ukmaths.sem You can use an asterisk `*' to specify the semantic-action file corresponding to the root element of the document anywhere in the list. As you will see in the next section, different braille style conventions and different braille mathematical codes may require different semantic-action files liblouisutdml records the names of all elements found in the document in the semantic-action file. The document has a multitude of elements, which can be thought of as describing the headings of various parts of the document. One element is used to denote a chapter heading. Another is used to denote a paragraph, Still another to denote text in bold type, and so on. In other words, the elements take the place of the capitalization, changes in type font, spacing, etc. in a book. However, the computer still does not know what to do when it encounters an element. The semantic-action file tells it that. Consider `html.sem'. A copy is included as part of this documentation with the name `example_html.sem' (*note html.sem::). It may differ from the file that liblouisutdml is currently using. You will see that it begins with some lines about copyrights. Each line begins with a number sign (`#'). This indicates that it is a "comment", intended for the human reader and the computer should ignore it. Then there is a blank line. Finally, there are two other comments explaining that the file must be edited to get proper output. This is because a human being must tell the computer what to do with each element. The semantic files for common types of documents have already been edited, so you generally don't have to worry about this. But if you encounter a new type of document or wish to specify special handling for styles or mathematics you may have to edit the semantic-action file or send it to the maintainer for editing. In any case the rest of this section is essential for understanding how liblouisutdml handles documents and for making changes if the way it does so is not correct. After another blank line you will see a table consisting of two, and sometimes three, columns. The first column contains a word which tells the computer to do something. For example, the first entry in the table is: `include nemeth.sem'. This tells liblouisutdml to include the information in the `nemeth.sem' file when it is deciphering an html (actually xhtml) document (it may be preferable to use the semanticFiles setting in the configuration file rather than an include). The second row of the table is: no hr `hr' is an element with the angle brackets removed. It means nothing in itself. However, the first column contains the word `no'. This tells liblouisutdml "no do", that is, do nothing. This is not strictly true, since liblouisutdml will sometimes insert a blank space so that words in text do not run together. After a few more lines with `no' in the first column, we see one that says: softreturn br This means that when the element `

' is encountered, liblouisutdml is to do a soft return, that is, start a new line without starting a new paragraph. The next line says: heading1 h1 This tells liblouisutdml that when it encounters the element `

' it is to format the text which follows as a first-level braille heading, that is, the text will be centered and preceeded and followed by blank lines. (You can change this by changing the definition of the heading1 style). The next line says: italicx em This tells liblouisutdml that when it encounters the element `' it is to enclose the text which follows in braille italic indicators. The `x' at the end of the semantic action name is there to prevent conflicts with names elsewhere in the software. Just where the italic indicators will be placed is controlled by the liblouis translation table in use. The next line says: skip style This tells liblouis to simply skip ahead until it encounters the element `'. Nothing in between will have any effect on the braille output. Note the slash (`/') before the `style'. This means the end of whatever the `'. Nothing in between will have any effect on the braille output. Note the slash (`/') before the `style'. This means the end of whatever the `